1 line
13 KiB
JavaScript
Vendored
1 line
13 KiB
JavaScript
Vendored
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3126,8315],{61357:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/embed/video",function(){return n(56535)}])},53627:function(e,t,n){"use strict";n.d(t,{R:function(){return OfflineBanner}});var i=n(85893),s=n(74253),r=n(45938),o=n(5152),a=n.n(o),l=n(94184),c=n.n(l),u=n(3546),d=n.n(u);let h=a()(()=>n.e(9095).then(n.t.bind(n,69095,23)),{loadableGenerated:{webpack:()=>[69095]},ssr:!1}),OfflineBanner=e=>{let t,{streamName:n,customText:o,lastLive:a,notificationsEnabled:l,fediverseAccount:u,showsHeader:f=!0,onNotifyClick:_,onFollowClick:m,className:p}=e;return t=o||(!o&&l&&u?(0,i.jsxs)("span",{children:["This stream is offline. You can"," ",(0,i.jsx)("span",{role:"link",tabIndex:0,className:d().actionLink,onClick:_,children:"be notified"})," ","the next time ",n," goes live or"," ",(0,i.jsx)("span",{role:"link",tabIndex:0,className:d().actionLink,onClick:m,children:"follow"})," ",u," on the Fediverse."]}):!o&&l?(0,i.jsxs)("span",{children:["This stream is offline."," ",(0,i.jsx)("span",{role:"link",tabIndex:0,className:d().actionLink,onClick:_,children:"Be notified"})," ","the next time ",n," goes live."]}):!o&&u?(0,i.jsxs)("span",{children:["This stream is offline."," ",(0,i.jsx)("span",{role:"link",tabIndex:0,className:d().actionLink,onClick:m,children:"Follow"})," ",u," on the Fediverse to see the next time ",n," goes live."]}):"This stream is offline. Check back soon!"),(0,i.jsx)("div",{id:"offline-banner",className:c()(d().outerContainer,p),children:(0,i.jsxs)("div",{className:d().innerContainer,children:[f&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:d().header,children:n}),(0,i.jsx)(s.Z,{className:d().separator})]}),o?(0,i.jsx)("div",{className:d().bodyText,dangerouslySetInnerHTML:{__html:t}}):(0,i.jsx)("div",{className:d().bodyText,children:t}),a&&(0,i.jsxs)("div",{className:d().lastLiveDate,children:[(0,i.jsx)(h,{className:d().clockIcon}),"Last live ".concat((0,r.Z)(new Date(a))," ago.")]})]})})}},33933:function(e,t,n){"use strict";n.d(t,{X:function(){return Statusbar}});var i=n(85893),s=n(45938),r=n(68730),o=n(67294),a=n(5152),l=n.n(a),c=n(94184),u=n.n(c),d=n(93640),h=n.n(d),f=n(76233);let _=l()(()=>n.e(1965).then(n.t.bind(n,41965,23)),{loadableGenerated:{webpack:()=>[41965]},ssr:!1}),Statusbar=e=>{let t,{online:n,lastConnectTime:a,lastDisconnectTime:l,viewerCount:c,className:d}=e,[,m]=(0,o.useState)(new Date);(0,o.useEffect)(()=>{let e=setInterval(()=>m(new Date),1e3);return()=>{clearInterval(e)}},[]);let p="";if(n&&a){let e=function(e){let t="hour",n="minute",i=(0,r.Z)({start:e,end:new Date});return i.days>=1?"".concat(i.days," ").concat((0,f._6)("day",i.days),"\n ").concat(i.hours," ").concat((0,f._6)(t,i.hours)):i.hours>=1?"".concat(i.hours," ").concat((0,f._6)(t,i.hours)," ").concat(i.minutes,"\n ").concat((0,f._6)(n,i.minutes)):"".concat(i.minutes," ").concat((0,f._6)(n,i.minutes),"\n ").concat(i.seconds," ").concat((0,f._6)("second",i.seconds))}(new Date(a));p=n?"Live for ".concat(e):"Offline",t=c>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:h().viewerIcon,children:(0,i.jsx)(_,{})}),(0,i.jsx)("span",{children:" ".concat(c)})]})}else!n&&(p="Offline",l&&(t="Last live ".concat((0,s.Z)(new Date(l))," ago.")));return(0,i.jsxs)("div",{className:u()(h().statusbar,d),role:"status",children:[(0,i.jsx)("span",{"aria-live":"off",className:h().onlineMessage,children:p}),(0,i.jsx)("span",{className:h().viewerCount,children:t})]})};Statusbar.defaultProps={lastConnectTime:null,lastDisconnectTime:null}},80750:function(e,t,n){var i=n(34155);n(91479);var s=n(67294),r=s&&"object"==typeof s&&"default"in s?s:{default:s};function _defineProperties(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var o=void 0!==i&&i.env&&!0,isString=function(e){return"[object String]"===Object.prototype.toString.call(e)},a=function(){function StyleSheet(e){var t=void 0===e?{}:e,n=t.name,i=void 0===n?"stylesheet":n,s=t.optimizeForSpeed,r=void 0===s?o:s;invariant$1(isString(i),"`name` must be a string"),this._name=i,this._deletedRulePlaceholder="#"+i+"-deleted-rule____{}",invariant$1("boolean"==typeof r,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=r,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var a=document.querySelector('meta[property="csp-nonce"]');this._nonce=a?a.getAttribute("content"):null}var e,t=StyleSheet.prototype;return t.setOptimizeForSpeed=function(e){invariant$1("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),invariant$1(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},t.isOptimizeForSpeed=function(){return this._optimizeForSpeed},t.inject=function(){var e=this;if(invariant$1(!this._injected,"sheet already injected"),this._injected=!0,this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(o||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(t,n){return"number"==typeof n?e._serverSheet.cssRules[n]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),n},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},t.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]},t.getSheet=function(){return this.getSheetForTag(this._tags[this._tags.length-1])},t.insertRule=function(e,t){if(invariant$1(isString(e),"`insertRule` accepts only strings"),this._optimizeForSpeed){var n=this.getSheet();"number"!=typeof t&&(t=n.cssRules.length);try{n.insertRule(e,t)}catch(t){return o||console.warn("StyleSheet: illegal rule: \n\n"+e+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),-1}}else{var i=this._tags[t];this._tags.push(this.makeStyleTag(this._name,e,i))}return this._rulesCount++},t.replaceRule=function(e,t){if(this._optimizeForSpeed){var n=this.getSheet();if(t.trim()||(t=this._deletedRulePlaceholder),!n.cssRules[e])return e;n.deleteRule(e);try{n.insertRule(t,e)}catch(i){o||console.warn("StyleSheet: illegal rule: \n\n"+t+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),n.insertRule(this._deletedRulePlaceholder,e)}}else{var i=this._tags[e];invariant$1(i,"old rule at index `"+e+"` not found"),i.textContent=t}return e},t.deleteRule=function(e){if(this._optimizeForSpeed)this.replaceRule(e,"");else{var t=this._tags[e];invariant$1(t,"rule at index `"+e+"` not found"),t.parentNode.removeChild(t),this._tags[e]=null}},t.flush=function(){this._injected=!1,this._rulesCount=0,this._tags.forEach(function(e){return e&&e.parentNode.removeChild(e)}),this._tags=[]},t.cssRules=function(){var e=this;return this._tags.reduce(function(t,n){return n?t=t.concat(Array.prototype.map.call(e.getSheetForTag(n).cssRules,function(t){return t.cssText===e._deletedRulePlaceholder?null:t})):t.push(null),t},[])},t.makeStyleTag=function(e,t,n){t&&invariant$1(isString(t),"makeStyleTag accepts only strings as second parameter");var i=document.createElement("style");this._nonce&&i.setAttribute("nonce",this._nonce),i.type="text/css",i.setAttribute("data-"+e,""),t&&i.appendChild(document.createTextNode(t));var s=document.head||document.getElementsByTagName("head")[0];return n?s.insertBefore(i,n):s.appendChild(i),i},_defineProperties(StyleSheet.prototype,[{key:"length",get:function(){return this._rulesCount}}]),e&&_defineProperties(StyleSheet,e),StyleSheet}();function invariant$1(e,t){if(!e)throw Error("StyleSheet: "+t+".")}var stringHash=function(e){for(var t=5381,n=e.length;n;)t=33*t^e.charCodeAt(--n);return t>>>0},l={};function computeId(e,t){if(!t)return"jsx-"+e;var n=String(t),i=e+n;return l[i]||(l[i]="jsx-"+stringHash(e+"-"+n)),l[i]}function computeSelector(e,t){var n=e+t;return l[n]||(l[n]=t.replace(/__jsx-style-dynamic-selector/g,e)),l[n]}var c=function(){function StyleSheetRegistry(e){var t=void 0===e?{}:e,n=t.styleSheet,i=void 0===n?null:n,s=t.optimizeForSpeed,r=void 0!==s&&s;this._sheet=i||new a({name:"styled-jsx",optimizeForSpeed:r}),this._sheet.inject(),i&&"boolean"==typeof r&&(this._sheet.setOptimizeForSpeed(r),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var e=StyleSheetRegistry.prototype;return e.add=function(e){var t=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer||(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,t){return e[t]=0,e},{}));var n=this.getIdAndRules(e),i=n.styleId,s=n.rules;if(i in this._instancesCounts){this._instancesCounts[i]+=1;return}var r=s.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[i]=r,this._instancesCounts[i]=1},e.remove=function(e){var t=this,n=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(n in this._instancesCounts,"styleId: `"+n+"` not found"),this._instancesCounts[n]-=1,this._instancesCounts[n]<1){var i=this._fromServer&&this._fromServer[n];i?(i.parentNode.removeChild(i),delete this._fromServer[n]):(this._indices[n].forEach(function(e){return t._sheet.deleteRule(e)}),delete this._indices[n]),delete this._instancesCounts[n]}},e.update=function(e,t){this.add(t),this.remove(e)},e.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},e.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map(function(t){return[t,e._fromServer[t]]}):[],n=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return n[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},e.styles=function(e){var t,n;return t=this.cssRules(),void 0===(n=e)&&(n={}),t.map(function(e){var t=e[0],i=e[1];return r.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:n.nonce?n.nonce:void 0,dangerouslySetInnerHTML:{__html:i}})})},e.getIdAndRules=function(e){var t=e.children,n=e.dynamic,i=e.id;if(n){var s=computeId(i,n);return{styleId:s,rules:Array.isArray(t)?t.map(function(e){return computeSelector(s,e)}):[computeSelector(s,t)]}}return{styleId:computeId(i),rules:Array.isArray(t)?t:[t]}},e.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,t){return e[t.id.slice(2)]=t,e},{})},StyleSheetRegistry}(),u=s.createContext(null);u.displayName="StyleSheetContext";var d=r.default.useInsertionEffect||r.default.useLayoutEffect,h=new c;function JSXStyle(e){var t=h||s.useContext(u);return t&&d(function(){return t.add(e),function(){t.remove(e)}},[e.id,String(e.dynamic)]),null}JSXStyle.dynamic=function(e){return e.map(function(e){return computeId(e[0],e[1])}).join(" ")},t.style=JSXStyle},12332:function(e,t,n){"use strict";e.exports=n(80750).style},56535:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return VideoEmbed}});var i=n(85893),s=n(12332),r=n.n(s),o=n(67294),a=n(4480),l=n(11163),c=n(10149),u=n(42843),d=n(53627),h=n(33933),f=n(49631),_=n(21426),m=n(67003),p=n.n(m);function VideoEmbed(){var e;let t=(0,a.sJ)(u.RI),n=(0,a.sJ)(u.g1),s=(0,a.sJ)(u.Q),{name:m}=n,{offlineMessage:v}=n,{viewerCount:S,lastConnectTime:y,lastDisconnectTime:g,streamTitle:b}=t,x=(0,a.sJ)(u.YW),j=(0,l.useRouter)(),C=null!==(e=j.asPath.split("?")[1])&&void 0!==e?e:"",k=C.split("&").reduce((e,t)=>{let[n,i]=t.split("=");return{...e,[n]:i}},{}),F="true"===k.initiallyMuted,R=(0,i.jsx)(c.default,{active:!0,style:{padding:"10px"},paragraph:{rows:10}});(0,o.useEffect)(()=>{document.body.classList.add("body-background")},[]);let w=(0,i.jsx)(d.R,{streamName:m,customText:v,lastLive:g,notificationsEnabled:!1}),N=(0,i.jsxs)("div",{className:"jsx-c9ad39c4496ab6bc "+(p().onlineContainer||""),children:[(0,i.jsx)(r(),{id:"c9ad39c4496ab6bc",children:".body-background{background:var(--theme-color-components-video-status-bar-background)}"}),(0,i.jsx)(f.OwncastPlayer,{source:"/hls/stream.m3u8",online:x,initiallyMuted:F,title:b||m,embedded:!0}),(0,i.jsx)(h.X,{online:x,lastConnectTime:y,lastDisconnectTime:g,viewerCount:S})]});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(u.me,{}),(0,i.jsx)(_.Q,{}),(0,i.jsx)("div",{className:"video-embed",children:s.appLoading?R:x?N:w})]})}},91479:function(){},3546:function(e){e.exports={outerContainer:"OfflineBanner_outerContainer__2Cwh6",innerContainer:"OfflineBanner_innerContainer__6BMbR",bodyText:"OfflineBanner_bodyText__8w_fr",separator:"OfflineBanner_separator__X2xF3",lastLiveDate:"OfflineBanner_lastLiveDate__K35HM",clockIcon:"OfflineBanner_clockIcon__0rWpM",header:"OfflineBanner_header__p5jNi",footer:"OfflineBanner_footer__lQUrD",actionLink:"OfflineBanner_actionLink__g64az"}},93640:function(e){e.exports={statusbar:"Statusbar_statusbar__b24qe",onlineMessage:"Statusbar_onlineMessage__FJnEa",viewerCount:"Statusbar_viewerCount__pfDDX",viewerIcon:"Statusbar_viewerIcon__U_j6P"}},67003:function(e){e.exports={onlineContainer:"VideoEmbed_onlineContainer__5XevB"}},11163:function(e,t,n){e.exports=n(38355)}},function(e){e.O(0,[2544,9403,6300,5938,5888,3886,8215,3430,6295,9774,2888,179],function(){return e(e.s=61357)}),_N_E=e.O()}]); |