Files
owncast/static/admin/_next/static/chunks/464-0371726593a593d7.js

1 line
16 KiB
JavaScript
Vendored

"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[464],{82911:function(e,t,n){n.d(t,{Z:function(){return s}});var r=n(1413),a=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 708c-22.1 0-40-17.9-40-40s17.9-40 40-40 40 17.9 40 40-17.9 40-40 40zm62.9-219.5a48.3 48.3 0 00-30.9 44.8V620c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8v-21.5c0-23.1 6.7-45.9 19.9-64.9 12.9-18.6 30.9-32.8 52.1-40.9 34-13.1 56-41.6 56-72.7 0-44.1-43.1-80-96-80s-96 35.9-96 80v7.6c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V420c0-39.3 17.2-76 48.4-103.3C430.4 290.4 470 276 512 276s81.6 14.5 111.6 40.7C654.8 344 672 380.7 672 420c0 57.8-38.1 109.8-97.1 132.5z"}}]},name:"question-circle",theme:"filled"},c=n(42922),i=function(e,t){return a.createElement(c.Z,(0,r.Z)((0,r.Z)({},e),{},{ref:t,icon:o}))};i.displayName="QuestionCircleFilled";var s=a.forwardRef(i)},84674:function(e,t,n){n.d(t,{Z:function(){return s}});var r=n(1413),a=n(67294),o={icon:function(e,t){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm288.5 682.8L277.7 224C258 240 240 258 224 277.7l522.8 522.8C682.8 852.7 601 884 512 884c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372c0 89-31.3 170.8-83.5 234.8z",fill:e}},{tag:"path",attrs:{d:"M512 140c-205.4 0-372 166.6-372 372s166.6 372 372 372c89 0 170.8-31.3 234.8-83.5L224 277.7c16-19.7 34-37.7 53.7-53.7l522.8 522.8C852.7 682.8 884 601 884 512c0-205.4-166.6-372-372-372z",fill:t}}]}},name:"stop",theme:"twotone"},c=n(42922),i=function(e,t){return a.createElement(c.Z,(0,r.Z)((0,r.Z)({},e),{},{ref:t,icon:o}))};i.displayName="StopTwoTone";var s=a.forwardRef(i)},6226:function(e,t,n){n.d(t,{Z:function(){return m}});var r=n(4942),a=n(87462),o=n(71002),c=n(67294),i=n(94184),s=n.n(i),l=n(99134),u=n(59844),d=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n};var f=["xs","sm","md","lg","xl","xxl"],p=c.forwardRef((function(e,t){var n,i=c.useContext(u.E_),p=i.getPrefixCls,m=i.direction,h=c.useContext(l.Z),v=h.gutter,y=h.wrap,x=h.supportFlexGap,b=e.prefixCls,Z=e.span,g=e.order,j=e.offset,w=e.push,C=e.pull,O=e.className,N=e.children,A=e.flex,k=e.style,P=d(e,["prefixCls","span","order","offset","push","pull","className","children","flex","style"]),T=p("col",b),E={};f.forEach((function(t){var n,c={},i=e[t];"number"===typeof i?c.span=i:"object"===(0,o.Z)(i)&&(c=i||{}),delete P[t],E=(0,a.Z)((0,a.Z)({},E),(n={},(0,r.Z)(n,"".concat(T,"-").concat(t,"-").concat(c.span),void 0!==c.span),(0,r.Z)(n,"".concat(T,"-").concat(t,"-order-").concat(c.order),c.order||0===c.order),(0,r.Z)(n,"".concat(T,"-").concat(t,"-offset-").concat(c.offset),c.offset||0===c.offset),(0,r.Z)(n,"".concat(T,"-").concat(t,"-push-").concat(c.push),c.push||0===c.push),(0,r.Z)(n,"".concat(T,"-").concat(t,"-pull-").concat(c.pull),c.pull||0===c.pull),(0,r.Z)(n,"".concat(T,"-rtl"),"rtl"===m),n))}));var S=s()(T,(n={},(0,r.Z)(n,"".concat(T,"-").concat(Z),void 0!==Z),(0,r.Z)(n,"".concat(T,"-order-").concat(g),g),(0,r.Z)(n,"".concat(T,"-offset-").concat(j),j),(0,r.Z)(n,"".concat(T,"-push-").concat(w),w),(0,r.Z)(n,"".concat(T,"-pull-").concat(C),C),n),O,E),M={};if(v&&v[0]>0){var z=v[0]/2;M.paddingLeft=z,M.paddingRight=z}if(v&&v[1]>0&&!x){var D=v[1]/2;M.paddingTop=D,M.paddingBottom=D}return A&&(M.flex=function(e){return"number"===typeof e?"".concat(e," ").concat(e," auto"):/^\d+(\.\d+)?(px|em|rem|%)$/.test(e)?"0 0 ".concat(e):e}(A),!1!==y||M.minWidth||(M.minWidth=0)),c.createElement("div",(0,a.Z)({},P,{style:(0,a.Z)((0,a.Z)({},M),k),className:S,ref:t}),N)}));p.displayName="Col";var m=p},27049:function(e,t,n){var r=n(87462),a=n(4942),o=n(67294),c=n(94184),i=n.n(c),s=n(59844),l=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n};t.Z=function(e){var t,n=o.useContext(s.E_),c=n.getPrefixCls,u=n.direction,d=e.prefixCls,f=e.type,p=void 0===f?"horizontal":f,m=e.orientation,h=void 0===m?"center":m,v=e.orientationMargin,y=e.className,x=e.children,b=e.dashed,Z=e.plain,g=l(e,["prefixCls","type","orientation","orientationMargin","className","children","dashed","plain"]),j=c("divider",d),w=h.length>0?"-".concat(h):h,C=!!x,O="left"===h&&null!=v,N="right"===h&&null!=v,A=i()(j,"".concat(j,"-").concat(p),(t={},(0,a.Z)(t,"".concat(j,"-with-text"),C),(0,a.Z)(t,"".concat(j,"-with-text").concat(w),C),(0,a.Z)(t,"".concat(j,"-dashed"),!!b),(0,a.Z)(t,"".concat(j,"-plain"),!!Z),(0,a.Z)(t,"".concat(j,"-rtl"),"rtl"===u),(0,a.Z)(t,"".concat(j,"-no-default-orientation-margin-left"),O),(0,a.Z)(t,"".concat(j,"-no-default-orientation-margin-right"),N),t),y),k=(0,r.Z)((0,r.Z)({},O&&{marginLeft:v}),N&&{marginRight:v});return o.createElement("div",(0,r.Z)({className:A},g,{role:"separator"}),x&&o.createElement("span",{className:"".concat(j,"-inner-text"),style:k},x))}},99134:function(e,t,n){var r=(0,n(67294).createContext)({});t.Z=r},25968:function(e,t,n){n.d(t,{Z:function(){return y}});var r=n(87462),a=n(4942),o=n(71002),c=n(97685),i=n(67294),s=n(94184),l=n.n(s),u=n(59844),d=n(99134),f=n(93355),p=n(24308),m=n(98082),h=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n},v=((0,f.b)("top","middle","bottom","stretch"),(0,f.b)("start","end","center","space-around","space-between"),i.forwardRef((function(e,t){var n,s=e.prefixCls,f=e.justify,v=e.align,y=e.className,x=e.style,b=e.children,Z=e.gutter,g=void 0===Z?0:Z,j=e.wrap,w=h(e,["prefixCls","justify","align","className","style","children","gutter","wrap"]),C=i.useContext(u.E_),O=C.getPrefixCls,N=C.direction,A=i.useState({xs:!0,sm:!0,md:!0,lg:!0,xl:!0,xxl:!0}),k=(0,c.Z)(A,2),P=k[0],T=k[1],E=(0,m.Z)(),S=i.useRef(g);i.useEffect((function(){var e=p.ZP.subscribe((function(e){var t=S.current||0;(!Array.isArray(t)&&"object"===(0,o.Z)(t)||Array.isArray(t)&&("object"===(0,o.Z)(t[0])||"object"===(0,o.Z)(t[1])))&&T(e)}));return function(){return p.ZP.unsubscribe(e)}}),[]);var M=O("row",s),z=function(){var e=[0,0];return(Array.isArray(g)?g:[g,0]).forEach((function(t,n){if("object"===(0,o.Z)(t))for(var r=0;r<p.c4.length;r++){var a=p.c4[r];if(P[a]&&void 0!==t[a]){e[n]=t[a];break}}else e[n]=t||0})),e}(),D=l()(M,(n={},(0,a.Z)(n,"".concat(M,"-no-wrap"),!1===j),(0,a.Z)(n,"".concat(M,"-").concat(f),f),(0,a.Z)(n,"".concat(M,"-").concat(v),v),(0,a.Z)(n,"".concat(M,"-rtl"),"rtl"===N),n),y),L={},I=z[0]>0?z[0]/-2:void 0,R=z[1]>0?z[1]/-2:void 0;if(I&&(L.marginLeft=I,L.marginRight=I),E){var B=(0,c.Z)(z,2);L.rowGap=B[1]}else R&&(L.marginTop=R,L.marginBottom=R);var F=(0,c.Z)(z,2),_=F[0],U=F[1],V=i.useMemo((function(){return{gutter:[_,U],wrap:j,supportFlexGap:E}}),[_,U,j,E]);return i.createElement(d.Z.Provider,{value:V},i.createElement("div",(0,r.Z)({},w,{className:D,style:(0,r.Z)((0,r.Z)({},L),x),ref:t}),b))})));v.displayName="Row";var y=v},66192:function(e,t,n){n.d(t,{Z:function(){return m}});var r=n(34051),a=n.n(r),o=n(85893),c=n(52455),i=n(71577),s=n(21640),l=n(82911),u=n(84674),d=n(58827);function f(e,t,n,r,a,o,c){try{var i=e[o](c),s=i.value}catch(l){return void n(l)}i.done?t(s):Promise.resolve(s).then(r,a)}function p(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function c(e){f(o,r,a,c,i,"next",e)}function i(e){f(o,r,a,c,i,"throw",e)}c(void 0)}))}}function m(e){var t=e.user,n=e.isEnabled,r=e.label,f=e.onClick;function m(){return(m=p(a().mark((function e(t){var r,o,c;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.id,o={userId:r,enabled:!n},e.prev=2,e.next=5,(0,d.rQ)(d.NM,{data:o,method:"POST",auth:!0});case 5:return c=e.sent,e.abrupt("return",c.success);case 9:e.prev=9,e.t0=e.catch(2),console.error(e.t0);case 12:return e.abrupt("return",!1);case 13:case"end":return e.stop()}}),e,null,[[2,9]])})))).apply(this,arguments)}var h=n?"ban":"unban",v=n?(0,o.jsx)(s.Z,{style:{color:"var(--ant-error)"}}):(0,o.jsx)(l.Z,{style:{color:"var(--ant-warning)"}}),y=(0,o.jsxs)(o.Fragment,{children:["Are you sure you want to ",h," ",(0,o.jsx)("strong",{children:t.displayName}),n?" and remove their messages?":"?"]});return(0,o.jsx)(i.Z,{onClick:function(){c.Z.confirm({title:"Confirm ".concat(h),content:y,onCancel:function(){},onOk:function(){return new Promise((function(e,n){var r=function(e){return m.apply(this,arguments)}(t);r?setTimeout((function(){e(r),null===f||void 0===f||f()}),3e3):n()}))},okType:"danger",okText:n?"Absolutely":null,icon:v})},size:"small",icon:n?(0,o.jsx)(u.Z,{twoToneColor:"#ff4d4f"}):null,className:"block-user-button",children:r||h})}m.defaultProps={label:"",onClick:null}},31386:function(e,t,n){n.d(t,{Z:function(){return D}});var r=n(85893),a=n(67294),o=n(94199),c=n(52455),i=n(84916),s=n(25968),l=n(6226),u=n(27049),d=n(26713),f=n(85533),p=n(58091),m=n(96486),h=n(66192),v=n(34051),y=n.n(v),x=n(71577),b=n(21640),Z=n(82911),g=n(84674),j=n(1413),w={icon:function(e,t){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M866.9 169.9L527.1 54.1C523 52.7 517.5 52 512 52s-11 .7-15.1 2.1L157.1 169.9c-8.3 2.8-15.1 12.4-15.1 21.2v482.4c0 8.8 5.7 20.4 12.6 25.9L499.3 968c3.5 2.7 8 4.1 12.6 4.1s9.2-1.4 12.6-4.1l344.7-268.6c6.9-5.4 12.6-17 12.6-25.9V191.1c.2-8.8-6.6-18.3-14.9-21.2zM810 654.3L512 886.5 214 654.3V226.7l298-101.6 298 101.6v427.6z",fill:e}},{tag:"path",attrs:{d:"M214 226.7v427.6l298 232.2 298-232.2V226.7L512 125.1 214 226.7zM632.8 328H688c6.5 0 10.3 7.4 6.5 12.7L481.9 633.4a16.1 16.1 0 01-26 0l-126.4-174c-3.8-5.3 0-12.7 6.5-12.7h55.2c5.2 0 10 2.5 13 6.6l64.7 89.1 150.9-207.8c3-4.1 7.9-6.6 13-6.6z",fill:t}},{tag:"path",attrs:{d:"M404.2 453.3c-3-4.1-7.8-6.6-13-6.6H336c-6.5 0-10.3 7.4-6.5 12.7l126.4 174a16.1 16.1 0 0026 0l212.6-292.7c3.8-5.3 0-12.7-6.5-12.7h-55.2c-5.1 0-10 2.5-13 6.6L468.9 542.4l-64.7-89.1z",fill:e}}]}},name:"safety-certificate",theme:"twotone"},C=n(42922),O=function(e,t){return a.createElement(C.Z,(0,j.Z)((0,j.Z)({},e),{},{ref:t,icon:w}))};O.displayName="SafetyCertificateTwoTone";var N=a.forwardRef(O),A=n(58827);function k(e,t,n,r,a,o,c){try{var i=e[o](c),s=i.value}catch(l){return void n(l)}i.done?t(s):Promise.resolve(s).then(r,a)}function P(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function c(e){k(o,r,a,c,i,"next",e)}function i(e){k(o,r,a,c,i,"throw",e)}c(void 0)}))}}function T(e){var t,n=e.user,a=e.onClick;function o(){return(o=P(y().mark((function e(t,n){var r,a,o;return y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.id,a={userId:r,isModerator:n},e.prev=2,e.next=5,(0,A.rQ)(A.jr,{data:a,method:"POST",auth:!0});case 5:return o=e.sent,e.abrupt("return",o.success);case 9:e.prev=9,e.t0=e.catch(2),console.error(e.t0);case 12:return e.abrupt("return",!1);case 13:case"end":return e.stop()}}),e,null,[[2,9]])})))).apply(this,arguments)}var i=null===(t=n.scopes)||void 0===t?void 0:t.includes("MODERATOR"),s=i?"remove moderator":"add moderator",l=i?(0,r.jsx)(b.Z,{style:{color:"var(--ant-error)"}}):(0,r.jsx)(Z.Z,{style:{color:"var(--ant-warning)"}}),u=(0,r.jsxs)(r.Fragment,{children:["Are you sure you want to ",s," ",(0,r.jsx)("strong",{children:n.displayName}),"?"]});return(0,r.jsx)(x.Z,{onClick:function(){c.Z.confirm({title:"Confirm ".concat(s),content:u,onCancel:function(){},onOk:function(){return new Promise((function(e,t){var r=function(e,t){return o.apply(this,arguments)}(n,!i);r?setTimeout((function(){e(r),null===a||void 0===a||a()}),3e3):t()}))},okType:"danger",okText:i?"Yup!":null,icon:l})},size:"small",icon:i?(0,r.jsx)(g.Z,{twoToneColor:"#ff4d4f"}):(0,r.jsx)(N,{twoToneColor:"#22bb44"}),className:"block-user-button",children:s})}T.defaultProps={onClick:null};var E=n(20643),S=n(2766);function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function z(e){return function(e){if(Array.isArray(e))return M(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"===typeof e)return M(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return M(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function D(e){var t=e.user,n=e.connectionInfo,v=e.children,y=(0,a.useState)(!1),x=y[0],b=y[1],Z=function(){b(!1)},g=t.displayName,j=t.createdAt,w=t.previousNames,C=t.nameChangedAt,O=t.disabledAt,N=n||{},A=N.connectedAt,k=N.messageCount,P=N.userAgent,M=null,D=w&&z(w);w&&w.length>1&&C&&(M=new Date(C),D.reverse());var L=new Date(j),I=(0,p.Z)(L,"PP pp"),R=M?(0,f.Z)(M):null;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.Z,{title:(0,r.jsxs)(r.Fragment,{children:["Created at: ",I,".",(0,r.jsx)("br",{})," Click for more info."]}),placement:"bottomLeft",children:(0,r.jsx)("button",{type:"button","aria-label":"Display more details about this user",className:"user-item-container",onClick:function(){b(!0)},children:v})}),(0,r.jsx)(c.Z,{destroyOnClose:!0,width:600,cancelText:"Close",okButtonProps:{style:{display:"none"}},title:"User details: ".concat(g),visible:x,onOk:Z,onCancel:Z,children:(0,r.jsxs)("div",{className:"user-details",children:[(0,r.jsx)(i.Z.Title,{level:4,children:g}),(0,r.jsxs)("p",{className:"created-at",children:["User created at ",I,"."]}),(0,r.jsxs)(s.Z,{gutter:16,children:[n&&(0,r.jsxs)(l.Z,{md:M?12:24,children:[(0,r.jsx)(i.Z.Title,{level:5,children:"This user is currently connected to Chat."}),(0,r.jsxs)("ul",{className:"connection-info",children:[(0,r.jsxs)("li",{children:[(0,r.jsx)("strong",{children:"Active for:"})," ",(0,f.Z)(new Date(A))]}),(0,r.jsxs)("li",{children:[(0,r.jsx)("strong",{children:"Messages sent:"})," ",k]}),(0,r.jsxs)("li",{children:[(0,r.jsx)("strong",{children:"User Agent:"}),(0,r.jsx)("br",{}),(0,S.AB)(P)]})]})]}),M&&(0,r.jsxs)(l.Z,{md:n?12:24,children:[(0,r.jsx)(i.Z.Title,{level:5,children:"This user is also seen as:"}),(0,r.jsx)("ul",{className:"previous-names-list",children:(0,m.uniq)(D).map((function(e,t){return(0,r.jsxs)("li",{className:0===t?"latest":"",children:[(0,r.jsx)("span",{className:"user-name-item",children:e}),0===t?" (Changed ".concat(R," ago)"):""]})}))})]})]}),(0,r.jsx)(u.Z,{}),(0,r.jsxs)(d.Z,{direction:"horizontal",children:[O?(0,r.jsxs)(r.Fragment,{children:["This user was banned on ",(0,r.jsx)("code",{children:(0,E.u)(O)}),".",(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),(0,r.jsx)(h.Z,{label:"Unban this user",user:t,isEnabled:!1,onClick:Z})]}):(0,r.jsx)(h.Z,{label:"Ban this user",user:t,isEnabled:!0,onClick:Z}),(0,r.jsx)(T,{user:t,onClick:Z})]})]})})]})}D.defaultProps={connectionInfo:null}},20643:function(e,t,n){n.d(t,{u:function(){return s},Z:function(){return l}});var r=n(85893),a=n(17962),o=n(58091),c=n(31386),i=n(66192);function s(e){return(0,o.Z)(new Date(e),"MMM d H:mma")}function l(e){var t=e.data,n=[{title:"Last Known Display Name",dataIndex:"displayName",key:"displayName",render:function(e,t){return(0,r.jsx)(c.Z,{user:t,children:(0,r.jsx)("span",{className:"display-name",children:e})})}},{title:"Created",dataIndex:"createdAt",key:"createdAt",render:function(e){return s(e)},sorter:function(e,t){return new Date(e.createdAt).getTime()-new Date(t.createdAt).getTime()},sortDirections:["descend","ascend"]},{title:"Disabled at",dataIndex:"disabledAt",key:"disabledAt",defaultSortOrder:"descend",render:function(e){return e?s(e):null},sorter:function(e,t){return new Date(e.disabledAt).getTime()-new Date(t.disabledAt).getTime()},sortDirections:["descend","ascend"]},{title:"",key:"block",className:"actions-col",render:function(e,t){return(0,r.jsx)(i.Z,{user:t,isEnabled:!t.disabledAt})}}];return(0,r.jsx)(a.Z,{pagination:{hideOnSinglePage:!0},className:"table-container",columns:n,dataSource:t,size:"small",rowKey:"id"})}}}]);