Files
owncast/static/web/_next/static/chunks/7283.68d6a73788370fe4.js
T
2023-01-10 08:49:18 +00:00

2 lines
8.4 KiB
JavaScript

(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7283],{86548:function(e,t,i){"use strict";i.d(t,{Z:function(){return c}});var r=i(1413),n=i(67294),s={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z"}}]},name:"edit",theme:"outlined"},o=i(42135),a=function(e,t){return n.createElement(o.Z,(0,r.Z)((0,r.Z)({},e),{},{ref:t,icon:s}))};a.displayName="EditOutlined";var c=n.forwardRef(a)},24308:function(e,t,i){"use strict";i.d(t,{c4:function(){return s}});var r=i(4942),n=i(87462),s=["xxl","xl","lg","md","sm","xs"],o={xs:"(max-width: 575px)",sm:"(min-width: 576px)",md:"(min-width: 768px)",lg:"(min-width: 992px)",xl:"(min-width: 1200px)",xxl:"(min-width: 1600px)"},a=new Map,c=-1,l={},u={matchHandlers:{},dispatch:function(e){return l=e,a.forEach((function(e){return e(l)})),a.size>=1},subscribe:function(e){return a.size||this.register(),c+=1,a.set(c,e),e(l),c},unsubscribe:function(e){a.delete(e),a.size||this.unregister()},unregister:function(){var e=this;Object.keys(o).forEach((function(t){var i=o[t],r=e.matchHandlers[i];null===r||void 0===r||r.mql.removeListener(null===r||void 0===r?void 0:r.listener)})),a.clear()},register:function(){var e=this;Object.keys(o).forEach((function(t){var i=o[t],s=function(i){var s=i.matches;e.dispatch((0,n.Z)((0,n.Z)({},l),(0,r.Z)({},t,s)))},a=window.matchMedia(i);a.addListener(s),e.matchHandlers[i]={mql:a,listener:s},s(a)}))}};t.ZP=u},99134:function(e,t,i){"use strict";var r=(0,i(67294).createContext)({});t.Z=r},92820:function(e,t,i){"use strict";var r=i(87462),n=i(4942),s=i(71002),o=i(97685),a=i(94184),c=i.n(a),l=i(67294),u=i(53124),d=i(98082),f=i(24308),h=i(93355),p=i(99134),v=function(e,t){var i={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(i[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(e);n<r.length;n++)t.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(i[r[n]]=e[r[n]])}return i};(0,h.b)("top","middle","bottom","stretch"),(0,h.b)("start","end","center","space-around","space-between","space-evenly");function w(e,t){var i=l.useState("string"===typeof e?e:""),r=(0,o.Z)(i,2),n=r[0],a=r[1];return l.useEffect((function(){!function(){if("object"===(0,s.Z)(e))for(var i=0;i<f.c4.length;i++){var r=f.c4[i];if(t[r]){var n=e[r];if(void 0!==n)return void a(n)}}}()}),[JSON.stringify(e),t]),n}var m=l.forwardRef((function(e,t){var i,a=e.prefixCls,h=e.justify,m=e.align,b=e.className,x=e.style,y=e.children,g=e.gutter,Z=void 0===g?0:g,j=e.wrap,N=v(e,["prefixCls","justify","align","className","style","children","gutter","wrap"]),_=l.useContext(u.E_),C=_.getPrefixCls,O=_.direction,M=l.useState({xs:!0,sm:!0,md:!0,lg:!0,xl:!0,xxl:!0}),S=(0,o.Z)(M,2),E=S[0],B=S[1],L=l.useState({xs:!1,sm:!1,md:!1,lg:!1,xl:!1,xxl:!1}),P=(0,o.Z)(L,2),k=P[0],A=P[1],R=w(m,k),T=w(h,k),I=(0,d.Z)(),J=l.useRef(Z);l.useEffect((function(){var e=f.ZP.subscribe((function(e){A(e);var t=J.current||0;(!Array.isArray(t)&&"object"===(0,s.Z)(t)||Array.isArray(t)&&("object"===(0,s.Z)(t[0])||"object"===(0,s.Z)(t[1])))&&B(e)}));return function(){return f.ZP.unsubscribe(e)}}),[]);var z=C("row",a),H=function(){var e=[void 0,void 0];return(Array.isArray(Z)?Z:[Z,void 0]).forEach((function(t,i){if("object"===(0,s.Z)(t))for(var r=0;r<f.c4.length;r++){var n=f.c4[r];if(E[n]&&void 0!==t[n]){e[i]=t[n];break}}else e[i]=t})),e}(),K=c()(z,(i={},(0,n.Z)(i,"".concat(z,"-no-wrap"),!1===j),(0,n.Z)(i,"".concat(z,"-").concat(T),T),(0,n.Z)(i,"".concat(z,"-").concat(R),R),(0,n.Z)(i,"".concat(z,"-rtl"),"rtl"===O),i),b),V={},q=null!=H[0]&&H[0]>0?H[0]/-2:void 0,F=null!=H[1]&&H[1]>0?H[1]/-2:void 0;if(q&&(V.marginLeft=q,V.marginRight=q),I){var G=(0,o.Z)(H,2);V.rowGap=G[1]}else F&&(V.marginTop=F,V.marginBottom=F);var U=(0,o.Z)(H,2),W=U[0],D=U[1],Q=l.useMemo((function(){return{gutter:[W,D],wrap:j,supportFlexGap:I}}),[W,D,j,I]);return l.createElement(p.Z.Provider,{value:Q},l.createElement("div",(0,r.Z)({},N,{className:K,style:(0,r.Z)((0,r.Z)({},V),x),ref:t}),y))}));t.Z=m},71230:function(e,t,i){"use strict";var r=i(92820);t.Z=r.Z},11424:function(e,t,i){"use strict";i.r(t),i.d(t,{BrowserNotifyModal:function(){return x}});var r=i(85893),n=i(6880),s=i(71577),o=i(11382),a=i(71230),c=i(67294),l=i(4480),u=i(77466);function d(e){const t=(e+"=".repeat((4-e.length%4)%4)).replace(/-/g,"+").replace(/_/g,"/"),i=window.atob(t),r=new Uint8Array(i.length);for(let n=0;n<i.length;++n)r[n]=i.charCodeAt(n);return r}var f=i(38851),h=i.n(f),p=i(83469);const{Title:v}=n.Z,w=()=>(0,r.jsx)("div",{children:"Browser notifications are not supported in your browser."}),m=e=>{let{start:t}=e;return(0,r.jsx)("div",{id:"browser-push-preview-box",className:h().pushPreview,children:(0,r.jsxs)("div",{className:h().inner,children:[(0,r.jsxs)("div",{className:h().title,children:[window.location.toString()," wants to"]}),(0,r.jsxs)("div",{className:h().permissionLine,children:[(0,r.jsx)("svg",{className:h().bell,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M14 12.3333V13H2V12.3333L3.33333 11V7C3.33333 4.93333 4.68667 3.11333 6.66667 2.52667C6.66667 2.46 6.66667 2.4 6.66667 2.33333C6.66667 1.97971 6.80714 1.64057 7.05719 1.39052C7.30724 1.14048 7.64638 1 8 1C8.35362 1 8.69276 1.14048 8.94281 1.39052C9.19286 1.64057 9.33333 1.97971 9.33333 2.33333C9.33333 2.4 9.33333 2.46 9.33333 2.52667C11.3133 3.11333 12.6667 4.93333 12.6667 7V11L14 12.3333ZM9.33333 13.6667C9.33333 14.0203 9.19286 14.3594 8.94281 14.6095C8.69276 14.8595 8.35362 15 8 15C7.64638 15 7.30724 14.8595 7.05719 14.6095C6.80714 14.3594 6.66667 14.0203 6.66667 13.6667",fill:"#676670"})}),(0,r.jsx)("span",{className:h().showNotificationsText,children:"Show notifications"})]}),(0,r.jsxs)("div",{className:h().buttonRow,children:[(0,r.jsx)(s.Z,{type:"primary",onClick:()=>{t()},children:"Allow"}),(0,r.jsx)("button",{type:"button",className:h().disabled,children:"Block"})]})]})})},b=()=>(0,r.jsxs)("div",{children:[(0,r.jsx)(v,{children:"Notifications are enabled"}),"To disable push notifications from ",window.location.hostname.toString()," access your browser permissions for this site and turn off notifications.",(0,r.jsx)("a",{href:"https://owncast.online/docs/notifications",children:" Learn more."})]}),x=()=>{const[e,t]=(0,c.useState)(null),i=(0,l.sJ)(u.FI),n=(0,l.sJ)(u.g1),[s,f]=(0,c.useState)(!1),v=(0,p.Z)()&&"default"!==Notification.permission,{notifications:x}=n,{browser:y}=x,{publicKey:g}=y,Z=y.enabled&&(0,p.Z)();if(v)return(0,r.jsx)(b,{});const j=async()=>{if(!(0,p.Z)()||"default"===Notification.permission){f(!0);try{!async function(e,t,i){const r={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({channel:e,destination:t})};try{await fetch("".concat("/api/notifications/register","?accessToken=").concat(i),r)}catch(n){console.error(n)}}("BROWSER_PUSH_NOTIFICATION",await async function(e){const t=await navigator.serviceWorker.ready;let i=await t.pushManager.getSubscription();return i||(i=await t.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:d(e)})),JSON.stringify(i)}(g),i),t(null)}catch(e){t("Error registering for live notifications: ".concat(e.message,". Make sure you're not inside a private browser environment or have previously disabled notifications for this stream."))}f(!1)}};return Z?(0,r.jsxs)(o.Z,{spinning:s,children:[(0,r.jsxs)(a.Z,{className:h().description,children:["Get notified right in the browser each time this stream goes live.",(0,r.jsx)("a",{href:"https://owncast.online/docs/notifications/#browser-notifications",children:"Learn more"}),"\xa0 about Owncast browser notifications."]}),(0,r.jsx)(a.Z,{children:e}),(0,r.jsx)(m,{start:()=>j()})]}):(0,r.jsx)(w,{})}},38851:function(e){e.exports={description:"BrowserNotifyModal_description__tMKKq",pushPreview:"BrowserNotifyModal_pushPreview__4Og4q",inner:"BrowserNotifyModal_inner__uhFDw",title:"BrowserNotifyModal_title__dd_Lh",permissionLine:"BrowserNotifyModal_permissionLine__K8nyJ",bell:"BrowserNotifyModal_bell__9mIeI",buttonRow:"BrowserNotifyModal_buttonRow__oxJUg",disabled:"BrowserNotifyModal_disabled__v88lb"}}}]);
//# sourceMappingURL=7283.68d6a73788370fe4.js.map