mirror of
https://github.com/owncast/owncast.git
synced 2025-01-09 10:07:34 +03:00
1 line
No EOL
10 KiB
JavaScript
Vendored
1 line
No EOL
10 KiB
JavaScript
Vendored
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8714],{99611:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var o=n(1413),r=n(67294),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"},l=n(42135),i=function(e,t){return r.createElement(l.Z,(0,o.Z)((0,o.Z)({},e),{},{ref:t,icon:a}))};i.displayName="EyeOutlined";var s=r.forwardRef(i)},68795:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var o=n(1413),r=n(67294),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"}}]},name:"search",theme:"outlined"},l=n(42135),i=function(e,t){return r.createElement(l.Z,(0,o.Z)((0,o.Z)({},e),{},{ref:t,icon:a}))};i.displayName="SearchOutlined";var s=r.forwardRef(i)},79531:function(e,t,n){"use strict";n.d(t,{Z:function(){return A}});var o=n(87462),r=n(4942),a=n(94184),l=n.n(a),i=n(67294),s=n(53124),c=n(65223),u=n(82586),d=n(97685),f=n(71002),p=n(1413),m={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"}},{tag:"path",attrs:{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"}}]},name:"eye-invisible",theme:"outlined"},v=n(42135),h=function(e,t){return i.createElement(v.Z,(0,p.Z)((0,p.Z)({},e),{},{ref:t,icon:m}))};h.displayName="EyeInvisibleOutlined";var g=i.forwardRef(h),w=n(99611),y=n(98423),Z=n(42550),x=n(72922),C=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)0>t.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n},b=function(e){return e?i.createElement(w.Z,null):i.createElement(g,null)},_={click:"onClick",hover:"onMouseOver"},E=i.forwardRef(function(e,t){var n=e.visibilityToggle,a=void 0===n||n,c="object"===(0,f.Z)(a)&&void 0!==a.visible,p=(0,i.useState)(function(){return!!c&&a.visible}),m=(0,d.Z)(p,2),v=m[0],h=m[1],g=(0,i.useRef)(null);i.useEffect(function(){c&&h(a.visible)},[c,a]);var w=(0,x.Z)(g),E=function(){e.disabled||(v&&w(),h(function(e){var t,n=!e;return"object"===(0,f.Z)(a)&&(null===(t=a.onVisibleChange)||void 0===t||t.call(a,n)),n}))},j=function(t){var n,o=e.action,a=e.iconRender,l=_[void 0===o?"click":o]||"",s=(void 0===a?b:a)(v),c=(n={},(0,r.Z)(n,l,E),(0,r.Z)(n,"className","".concat(t,"-icon")),(0,r.Z)(n,"key","passwordIcon"),(0,r.Z)(n,"onMouseDown",function(e){e.preventDefault()}),(0,r.Z)(n,"onMouseUp",function(e){e.preventDefault()}),n);return i.cloneElement(i.isValidElement(s)?s:i.createElement("span",null,s),c)};return i.createElement(s.C,null,function(n){var s=n.getPrefixCls,c=e.className,d=e.prefixCls,f=e.inputPrefixCls,p=e.size,m=C(e,["className","prefixCls","inputPrefixCls","size"]),h=s("input",f),w=s("input-password",d),x=a&&j(w),b=l()(w,c,(0,r.Z)({},"".concat(w,"-").concat(p),!!p)),_=(0,o.Z)((0,o.Z)({},(0,y.Z)(m,["suffix","iconRender","visibilityToggle"])),{type:v?"text":"password",className:b,prefixCls:h,suffix:x});return p&&(_.size=p),i.createElement(u.ZP,(0,o.Z)({ref:(0,Z.sQ)(t,g)},_))})}),j=n(68795),M=n(71577),N=n(97647),O=n(4173),z=n(96159),k=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)0>t.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n},S=i.forwardRef(function(e,t){var n,a,c=e.prefixCls,d=e.inputPrefixCls,f=e.className,p=e.size,m=e.suffix,v=e.enterButton,h=void 0!==v&&v,g=e.addonAfter,w=e.loading,y=e.disabled,x=e.onSearch,C=e.onChange,b=e.onCompositionStart,_=e.onCompositionEnd,E=k(e,["prefixCls","inputPrefixCls","className","size","suffix","enterButton","addonAfter","loading","disabled","onSearch","onChange","onCompositionStart","onCompositionEnd"]),S=i.useContext(s.E_),P=S.getPrefixCls,F=S.direction,A=i.useContext(N.Z),B=i.useRef(!1),T=P("input-search",c),L=P("input",d),R=(0,O.ri)(T,F).compactSize||p||A,I=i.useRef(null),D=function(e){var t;document.activeElement===(null===(t=I.current)||void 0===t?void 0:t.input)&&e.preventDefault()},U=function(e){var t,n;x&&x(null===(n=null===(t=I.current)||void 0===t?void 0:t.input)||void 0===n?void 0:n.value,e)},Q="boolean"==typeof h?i.createElement(j.Z,null):null,q="".concat(T,"-button"),H=h||{},V=H.type&&!0===H.type.__ANT_BUTTON;a=V||"button"===H.type?(0,z.Tm)(H,(0,o.Z)({onMouseDown:D,onClick:function(e){var t,n;null===(n=null===(t=null==H?void 0:H.props)||void 0===t?void 0:t.onClick)||void 0===n||n.call(t,e),U(e)},key:"enterButton"},V?{className:q,size:R}:{})):i.createElement(M.Z,{className:q,type:h?"primary":void 0,size:R,disabled:y,key:"enterButton",onMouseDown:D,onClick:U,loading:w,icon:Q},h),g&&(a=[a,(0,z.Tm)(g,{key:"addonAfter"})]);var J=l()(T,(n={},(0,r.Z)(n,"".concat(T,"-rtl"),"rtl"===F),(0,r.Z)(n,"".concat(T,"-").concat(R),!!R),(0,r.Z)(n,"".concat(T,"-with-button"),!!h),n),f);return i.createElement(u.ZP,(0,o.Z)({ref:(0,Z.sQ)(I,t),onPressEnter:function(e){B.current||w||U(e)}},E,{size:R,onCompositionStart:function(e){B.current=!0,null==b||b(e)},onCompositionEnd:function(e){B.current=!1,null==_||_(e)},prefixCls:L,addonAfter:a,suffix:m,onChange:function(e){e&&e.target&&"click"===e.type&&x&&x(e.target.value,e),C&&C(e)},className:J,disabled:y}))}),P=n(80173),F=u.ZP;F.Group=function(e){var t,n=(0,i.useContext)(s.E_),a=n.getPrefixCls,u=n.direction,d=e.prefixCls,f=e.className,p=a("input-group",d),m=l()(p,(t={},(0,r.Z)(t,"".concat(p,"-lg"),"large"===e.size),(0,r.Z)(t,"".concat(p,"-sm"),"small"===e.size),(0,r.Z)(t,"".concat(p,"-compact"),e.compact),(0,r.Z)(t,"".concat(p,"-rtl"),"rtl"===u),t),void 0===f?"":f),v=(0,i.useContext)(c.aM),h=(0,i.useMemo)(function(){return(0,o.Z)((0,o.Z)({},v),{isFormItemInput:!1})},[v]);return i.createElement("span",{className:m,style:e.style,onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,onFocus:e.onFocus,onBlur:e.onBlur},i.createElement(c.aM.Provider,{value:h},e.children))},F.Search=S,F.TextArea=P.Z,F.Password=E;var A=F},68714:function(e,t,n){"use strict";n.r(t),n.d(t,{FollowModal:function(){return f}});var o=n(85893),r=n(26713),a=n(11382),l=n(14670),i=n(79531),s=n(71577),c=n(67294),u=n(13096),d=n.n(u);let f=e=>{let{handleClose:t,account:n,name:u}=e,[f,p]=(0,c.useState)(null),[m,v]=(0,c.useState)(!1),[h,g]=(0,c.useState)(!1),[w,y]=(0,c.useState)(null),Z=e=>{p(e),function(e){let t=e.replace(/^@+/,"");return/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(String(t).toLowerCase())}(e)?v(!0):v(!1)},x=()=>{window.open("https://owncast.online/join-fediverse","_blank")},C=async()=>{if(m){g(!0);try{let e=f.replace(/^@+/,""),n=await fetch("/api/remotefollow",{method:"POST",body:JSON.stringify({account:e})}),o=await n.json();if(o.redirectUrl&&(window.open(o.redirectUrl,"_blank"),t()),!o.success){y(o.message),g(!1);return}if(!o.redirectUrl){y("Unable to follow."),g(!1);return}}catch(e){y(e.message)}g(!1)}};return(0,o.jsxs)(r.Z,{direction:"vertical",id:"follow-modal",children:[(0,o.jsxs)("div",{className:d().header,children:["By following this stream you'll get notified on the Fediverse when it goes live. Now is a great time to",(0,o.jsx)("a",{href:"https://owncast.online/join-fediverse",target:"_blank",rel:"noreferrer",children:"\xa0learn about the Fediverse\xa0"}),"if it's new to you."]}),(0,o.jsxs)(a.Z,{spinning:h,children:[w&&(0,o.jsx)(l.Z,{message:"Follow Error",description:w,type:"error",showIcon:!0}),(0,o.jsxs)("div",{className:d().account,children:[(0,o.jsx)("img",{src:"/logo",alt:"logo",className:d().logo}),(0,o.jsxs)("div",{className:d().username,children:[(0,o.jsx)("div",{className:d().name,children:u}),(0,o.jsx)("div",{children:n})]})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)("div",{className:d().instructions,children:"Enter your username @server to follow"}),(0,o.jsx)(i.Z,{value:f,size:"large",onChange:e=>Z(e.target.value),placeholder:"Your fediverse account @account@server",defaultValue:f}),(0,o.jsx)("div",{className:d().footer,children:"You'll be redirected to your Fediverse server and asked to confirm the action."})]}),(0,o.jsxs)(r.Z,{className:d().buttons,children:[(0,o.jsx)(s.Z,{disabled:!m,type:"primary",onClick:C,children:"Follow"}),(0,o.jsx)(s.Z,{onClick:x,type:"primary",children:"Join the Fediverse"})]})]})]})}},13096:function(e){e.exports={header:"FollowModal_header__la1ji",buttons:"FollowModal_buttons__tt4Mc",instructions:"FollowModal_instructions__HiKFF",footer:"FollowModal_footer__AjucH",account:"FollowModal_account__cmHkm",logo:"FollowModal_logo__Ew8xK",username:"FollowModal_username__A_OTw",name:"FollowModal_name__Sf_TP"}}}]); |