diff --git a/403/index.html b/403/index.html new file mode 100644 index 00000000..6f94a16b --- /dev/null +++ b/403/index.html @@ -0,0 +1,49 @@ + + + + + RetroFiber + + + + + + +
+
+ + + + +
+

+ +

+

RetroFiber

+

Error 403

+

You do not have access to this page.

+
+
+

2022 © RetroFiber - + Github + +

+
+
+ + diff --git a/404.html b/404.html index 3d2a7234..969467b9 100644 --- a/404.html +++ b/404.html @@ -1,19 +1,50 @@ - 404 + RetroFiber - - + + + -
-
-
-

Error 404

-

The page you are looking for might have been removed, had its name changed or is temporarily unavailable.

+
+
+ + + + +
+

+ +

+

RetroFiber

+

Error 404

+

The page you are looking for may have been removed, changed or may have never existed.

Please try to return to the homepage.

Good luck.

- +
+

2022 © RetroFiber - + Github + +

+
+
+
diff --git a/Offline_Download_Version.html b/Offline_Download_Version.html new file mode 100644 index 00000000..6ff83e77 --- /dev/null +++ b/Offline_Download_Version.html @@ -0,0 +1,35895 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +My Drive - Google Drive + + + + + + + + + + + + + + + + +
+
+

you are running eaglercraft locally, check this link regularly for an updated version

+

the version you are currently using is from 09/21/2022

+

(Game will launch in 5)

+
+ + \ No newline at end of file diff --git a/RetroTV/_headers b/RetroTV/_headers new file mode 100644 index 00000000..1216e42d --- /dev/null +++ b/RetroTV/_headers @@ -0,0 +1,5 @@ +/* + X-Frame-Options: DENY + X-XSS-Protection: 1; mode=block + X-Content-Type-Options: nosniff + Referrer-Policy: origin-when-cross-origin diff --git a/RetroTV/_redirects b/RetroTV/_redirects new file mode 100644 index 00000000..7797f7c6 --- /dev/null +++ b/RetroTV/_redirects @@ -0,0 +1 @@ +/* /index.html 200 diff --git a/RetroTV/android-chrome-192x192.png b/RetroTV/android-chrome-192x192.png new file mode 100644 index 00000000..f71a0514 Binary files /dev/null and b/RetroTV/android-chrome-192x192.png differ diff --git a/RetroTV/android-chrome-512x512.png b/RetroTV/android-chrome-512x512.png new file mode 100644 index 00000000..b44f4951 Binary files /dev/null and b/RetroTV/android-chrome-512x512.png differ diff --git a/RetroTV/apple-touch-icon.png b/RetroTV/apple-touch-icon.png new file mode 100644 index 00000000..f45b8fd4 Binary files /dev/null and b/RetroTV/apple-touch-icon.png differ diff --git a/RetroTV/assets/DeveloperView-6fc51757.js b/RetroTV/assets/DeveloperView-6fc51757.js new file mode 100644 index 00000000..3df2964f --- /dev/null +++ b/RetroTV/assets/DeveloperView-6fc51757.js @@ -0,0 +1 @@ +import{j as i,a as e,N as r,T as s,b as o,A as t}from"./index-a5d2672e.js";function d(){return i("div",{className:"py-48",children:[e(r,{}),i(s,{classNames:"flex flex-col space-y-4",children:[e(o,{className:"mb-8",children:"Developer tools"}),e(t,{to:"/dev/providers",direction:"right",linkText:"Provider tester"}),e(t,{to:"/dev/embeds",direction:"right",linkText:"Embed scraper tester"}),e(t,{to:"/dev/video",direction:"right",linkText:"Video tester"}),e(t,{to:"/dev/test",direction:"right",linkText:"Test page"})]})]})}export{d as default}; diff --git a/RetroTV/assets/VideoTesterView-90119065.js b/RetroTV/assets/VideoTesterView-90119065.js new file mode 100644 index 00000000..5e76a58d --- /dev/null +++ b/RetroTV/assets/VideoTesterView-90119065.js @@ -0,0 +1 @@ +import{r as l,M as o,j as s,a as e,H as y,V as h,c as v,S as f,d as M,N as g,T as x,D as N,B as d,e as S}from"./index-a5d2672e.js";const c={streamUrl:"http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4",type:o.MP4},B={imdbId:"",tmdbId:"",meta:{id:"hello-world",title:"Big Buck Bunny",type:S.MOVIE,seasons:void 0,year:"2000"}};function C(){const[r,i]=l.useState(null),[t,m]=l.useState(o.MP4),[n,u]=l.useState(""),p=l.useCallback(a=>{i({streamUrl:a,type:t})},[t]);return r?s("div",{className:"fixed left-0 top-0 h-[100dvh] w-screen",children:[e(y,{children:e("html",{"data-full":"true"})}),s(h,{includeSafeArea:!0,autoPlay:!0,onGoBack:()=>i(null),children:[e(v,{data:{captions:[],meta:B},linkedCaptions:[]}),e(f,{source:r.streamUrl,type:t,quality:M.QUNKNOWN,captions:[]})]})]}):s("div",{className:"py-64",children:[e(g,{}),s(x,{classNames:"flex items-start flex-col space-y-4",children:[e("div",{className:"w-48",children:e(N,{options:[{id:o.MP4,name:"Mp4"},{id:o.HLS,name:"hls/m3u8"}],selectedItem:{id:t,name:t},setSelectedItem:a=>m(a.id)})}),s("div",{className:"mb-4 flex gap-4",children:[e("input",{type:"text",placeholder:"stream url here...",value:n,onChange:a=>u(a.target.value)}),e(d,{onClick:()=>p(n),children:"Play video"})]}),e(d,{onClick:()=>i({streamUrl:c.streamUrl,type:c.type}),children:"Play default video"})]})]})}export{C as default}; diff --git a/RetroTV/assets/index-a5d2672e.js b/RetroTV/assets/index-a5d2672e.js new file mode 100644 index 00000000..48ab0d16 --- /dev/null +++ b/RetroTV/assets/index-a5d2672e.js @@ -0,0 +1,134 @@ +var Fee=Object.defineProperty;var Bee=(t,e,r)=>e in t?Fee(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var le=(t,e,r)=>(Bee(t,typeof e!="symbol"?e+"":e,r),r);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();var ve=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Lx(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Uee(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){if(this instanceof n){var i=[null];i.push.apply(i,arguments);var a=Function.bind.apply(e,i);return new a}return e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var m0={},jee={get exports(){return m0},set exports(t){m0=t}},Ep={};/* +object-assign +(c) Sindre Sorhus +@license MIT +*/var DL=Object.getOwnPropertySymbols,Hee=Object.prototype.hasOwnProperty,zee=Object.prototype.propertyIsEnumerable;function Gee(t){if(t==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function Vee(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de",Object.getOwnPropertyNames(t)[0]==="5")return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;var n=Object.getOwnPropertyNames(e).map(function(a){return e[a]});if(n.join("")!=="0123456789")return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(a){i[a]=a}),Object.keys(Object.assign({},i)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}var BI=Vee()?Object.assign:function(t,e){for(var r,n=Gee(t),i,a=1;a"u"&&a2!==void 0,fj={all:a2,IS_HTMLDDA:yte},dj=fj,xte=dj.all,Ne=dj.IS_HTMLDDA?function(t){return typeof t=="function"||t===xte}:function(t){return typeof t=="function"},jL=Ne,hj=fj,bte=hj.all,De=hj.IS_HTMLDDA?function(t){return typeof t=="object"?t!==null:jL(t)||t===bte}:function(t){return typeof t=="object"?t!==null:jL(t)},JE=he,Ete=Ne,Ste=function(t){return Ete(t)?t:void 0},ht=function(t,e){return arguments.length<2?Ste(JE[t]):JE[t]&&JE[t][e]},_te=ae,ni=_te({}.isPrototypeOf),ds=typeof navigator<"u"&&String(navigator.userAgent)||"",pj=he,eS=ds,HL=pj.process,zL=pj.Deno,GL=HL&&HL.versions||zL&&zL.version,VL=GL&&GL.v8,bi,fy;VL&&(bi=VL.split("."),fy=bi[0]>0&&bi[0]<4?1:+(bi[0]+bi[1]));!fy&&eS&&(bi=eS.match(/Edge\/(\d+)/),(!bi||bi[1]>=74)&&(bi=eS.match(/Chrome\/(\d+)/),bi&&(fy=+bi[1])));var hs=fy,WL=hs,wte=re,zf=!!Object.getOwnPropertySymbols&&!wte(function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&WL&&WL<41}),Tte=zf,mj=Tte&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Rte=ht,Ate=Ne,Ite=ni,$te=mj,Cte=Object,uc=$te?function(t){return typeof t=="symbol"}:function(t){var e=Rte("Symbol");return Ate(e)&&Ite(e.prototype,Cte(t))},kte=String,fc=function(t){try{return kte(t)}catch{return"Object"}},Ote=Ne,Lte=fc,Pte=TypeError,It=function(t){if(Ote(t))return t;throw Pte(Lte(t)+" is not a function")},Nte=It,Dte=on,ps=function(t,e){var r=t[e];return Dte(r)?void 0:Nte(r)},tS=$e,rS=Ne,nS=De,Mte=TypeError,gj=function(t,e){var r,n;if(e==="string"&&rS(r=t.toString)&&!nS(n=tS(r,t))||rS(r=t.valueOf)&&!nS(n=tS(r,t))||e!=="string"&&rS(r=t.toString)&&!nS(n=tS(r,t)))return n;throw Mte("Can't convert object to primitive value")},wo={},Fte={get exports(){return wo},set exports(t){wo=t}},VI=!1,KL=he,Bte=Object.defineProperty,WI=function(t,e){try{Bte(KL,t,{value:e,configurable:!0,writable:!0})}catch{KL[t]=e}return e},Ute=he,jte=WI,YL="__core-js_shared__",Hte=Ute[YL]||jte(YL,{}),KI=Hte,qL=KI;(Fte.exports=function(t,e){return qL[t]||(qL[t]=e!==void 0?e:{})})("versions",[]).push({version:"3.30.1",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.30.1/LICENSE",source:"https://github.com/zloirock/core-js"});var zte=Nt,Gte=Object,We=function(t){return Gte(zte(t))},Vte=ae,Wte=We,Kte=Vte({}.hasOwnProperty),je=Object.hasOwn||function(e,r){return Kte(Wte(e),r)},Yte=ae,qte=0,Xte=Math.random(),Qte=Yte(1 .toString),Gf=function(t){return"Symbol("+(t===void 0?"":t)+")_"+Qte(++qte+Xte,36)},Zte=he,Jte=wo,XL=je,ere=Gf,tre=zf,rre=mj,pu=Zte.Symbol,iS=Jte("wks"),nre=rre?pu.for||pu:pu&&pu.withoutSetter||ere,Me=function(t){return XL(iS,t)||(iS[t]=tre&&XL(pu,t)?pu[t]:nre("Symbol."+t)),iS[t]},ire=$e,QL=De,ZL=uc,are=ps,sre=gj,ore=Me,lre=TypeError,cre=ore("toPrimitive"),Px=function(t,e){if(!QL(t)||ZL(t))return t;var r=are(t,cre),n;if(r){if(e===void 0&&(e="default"),n=ire(r,t,e),!QL(n)||ZL(n))return n;throw lre("Can't convert object to primitive value")}return e===void 0&&(e="number"),sre(t,e)},ure=Px,fre=uc,Ho=function(t){var e=ure(t,"string");return fre(e)?e:e+""},dre=he,JL=De,s2=dre.document,hre=JL(s2)&&JL(s2.createElement),Nx=function(t){return hre?s2.createElement(t):{}},pre=_e,mre=re,gre=Nx,vj=!pre&&!mre(function(){return Object.defineProperty(gre("div"),"a",{get:function(){return 7}}).a!=7}),vre=_e,yre=$e,xre=wp,bre=ri,Ere=qt,Sre=Ho,_re=je,wre=vj,eP=Object.getOwnPropertyDescriptor;ar.f=vre?eP:function(e,r){if(e=Ere(e),r=Sre(r),wre)try{return eP(e,r)}catch{}if(_re(e,r))return bre(!yre(xre.f,e,r),e[r])};var pt={},Tre=_e,Rre=re,yj=Tre&&Rre(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),Are=De,Ire=String,$re=TypeError,Ie=function(t){if(Are(t))return t;throw $re(Ire(t)+" is not an object")},Cre=_e,kre=vj,Ore=yj,Um=Ie,tP=Ho,Lre=TypeError,aS=Object.defineProperty,Pre=Object.getOwnPropertyDescriptor,sS="enumerable",oS="configurable",lS="writable";pt.f=Cre?Ore?function(e,r,n){if(Um(e),r=tP(r),Um(n),typeof e=="function"&&r==="prototype"&&"value"in n&&lS in n&&!n[lS]){var i=Pre(e,r);i&&i[lS]&&(e[r]=n.value,n={configurable:oS in n?n[oS]:i[oS],enumerable:sS in n?n[sS]:i[sS],writable:!1})}return aS(e,r,n)}:aS:function(e,r,n){if(Um(e),r=tP(r),Um(n),kre)try{return aS(e,r,n)}catch{}if("get"in n||"set"in n)throw Lre("Accessors not supported");return"value"in n&&(e[r]=n.value),e};var Nre=_e,Dre=pt,Mre=ri,Nr=Nre?function(t,e,r){return Dre.f(t,e,Mre(1,r))}:function(t,e,r){return t[e]=r,t},g0={},Fre={get exports(){return g0},set exports(t){g0=t}},o2=_e,Bre=je,xj=Function.prototype,Ure=o2&&Object.getOwnPropertyDescriptor,YI=Bre(xj,"name"),jre=YI&&function(){}.name==="something",Hre=YI&&(!o2||o2&&Ure(xj,"name").configurable),Vf={EXISTS:YI,PROPER:jre,CONFIGURABLE:Hre},zre=ae,Gre=Ne,l2=KI,Vre=zre(Function.toString);Gre(l2.inspectSource)||(l2.inspectSource=function(t){return Vre(t)});var qI=l2.inspectSource,Wre=he,Kre=Ne,rP=Wre.WeakMap,bj=Kre(rP)&&/native code/.test(String(rP)),Yre=wo,qre=Gf,nP=Yre("keys"),Dx=function(t){return nP[t]||(nP[t]=qre(t))},Tp={},Xre=bj,Ej=he,Qre=De,Zre=Nr,cS=je,uS=KI,Jre=Dx,ene=Tp,iP="Object already initialized",c2=Ej.TypeError,tne=Ej.WeakMap,dy,v0,hy,rne=function(t){return hy(t)?v0(t):dy(t,{})},nne=function(t){return function(e){var r;if(!Qre(e)||(r=v0(e)).type!==t)throw c2("Incompatible receiver, "+t+" required");return r}};if(Xre||uS.state){var Wi=uS.state||(uS.state=new tne);Wi.get=Wi.get,Wi.has=Wi.has,Wi.set=Wi.set,dy=function(t,e){if(Wi.has(t))throw c2(iP);return e.facade=t,Wi.set(t,e),e},v0=function(t){return Wi.get(t)||{}},hy=function(t){return Wi.has(t)}}else{var Lc=Jre("state");ene[Lc]=!0,dy=function(t,e){if(cS(t,Lc))throw c2(iP);return e.facade=t,Zre(t,Lc,e),e},v0=function(t){return cS(t,Lc)?t[Lc]:{}},hy=function(t){return cS(t,Lc)}}var Dt={set:dy,get:v0,has:hy,enforce:rne,getterFor:nne},XI=ae,ine=re,ane=Ne,jm=je,u2=_e,sne=Vf.CONFIGURABLE,one=qI,Sj=Dt,lne=Sj.enforce,cne=Sj.get,aP=String,Sv=Object.defineProperty,une=XI("".slice),fne=XI("".replace),dne=XI([].join),hne=u2&&!ine(function(){return Sv(function(){},"length",{value:8}).length!==8}),pne=String(String).split("String"),mne=Fre.exports=function(t,e,r){une(aP(e),0,7)==="Symbol("&&(e="["+fne(aP(e),/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!jm(t,"name")||sne&&t.name!==e)&&(u2?Sv(t,"name",{value:e,configurable:!0}):t.name=e),hne&&r&&jm(r,"arity")&&t.length!==r.arity&&Sv(t,"length",{value:r.arity});try{r&&jm(r,"constructor")&&r.constructor?u2&&Sv(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch{}var n=lne(t);return jm(n,"source")||(n.source=dne(pne,typeof e=="string"?e:"")),t};Function.prototype.toString=mne(function(){return ane(this)&&cne(this).source||one(this)},"toString");var gne=Ne,vne=pt,yne=g0,xne=WI,_t=function(t,e,r,n){n||(n={});var i=n.enumerable,a=n.name!==void 0?n.name:e;if(gne(r)&&yne(r,a,n),n.global)i?t[e]=r:xne(e,r);else{try{n.unsafe?t[e]&&(i=!0):delete t[e]}catch{}i?t[e]=r:vne.f(t,e,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return t},ms={},bne=Math.ceil,Ene=Math.floor,_j=Math.trunc||function(e){var r=+e;return(r>0?Ene:bne)(r)},Sne=_j,$t=function(t){var e=+t;return e!==e||e===0?0:Sne(e)},_ne=$t,wne=Math.max,Tne=Math.min,ba=function(t,e){var r=_ne(t);return r<0?wne(r+e,0):Tne(r,e)},Rne=$t,Ane=Math.min,wn=function(t){return t>0?Ane(Rne(t),9007199254740991):0},Ine=wn,Ye=function(t){return Ine(t.length)},$ne=qt,Cne=ba,kne=Ye,sP=function(t){return function(e,r,n){var i=$ne(e),a=kne(i),s=Cne(n,a),o;if(t&&r!=r){for(;a>s;)if(o=i[s++],o!=o)return!0}else for(;a>s;s++)if((t||s in i)&&i[s]===r)return t||s||0;return!t&&-1}},Rp={includes:sP(!0),indexOf:sP(!1)},One=ae,fS=je,Lne=qt,Pne=Rp.indexOf,Nne=Tp,oP=One([].push),wj=function(t,e){var r=Lne(t),n=0,i=[],a;for(a in r)!fS(Nne,a)&&fS(r,a)&&oP(i,a);for(;e.length>n;)fS(r,a=e[n++])&&(~Pne(i,a)||oP(i,a));return i},QI=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Dne=wj,Mne=QI,Fne=Mne.concat("length","prototype");ms.f=Object.getOwnPropertyNames||function(e){return Dne(e,Fne)};var Ap={};Ap.f=Object.getOwnPropertySymbols;var Bne=ht,Une=ae,jne=ms,Hne=Ap,zne=Ie,Gne=Une([].concat),ZI=Bne("Reflect","ownKeys")||function(e){var r=jne.f(zne(e)),n=Hne.f;return n?Gne(r,n(e)):r},lP=je,Vne=ZI,Wne=ar,Kne=pt,Mx=function(t,e,r){for(var n=Vne(e),i=Kne.f,a=Wne.f,s=0;ss;)Sie.f(e,o=i[s++],n[o]);return e};var Rie=ht,Rj=Rie("document","documentElement"),Aie=Ie,Iie=Fx,cP=QI,$ie=Tp,Cie=Rj,kie=Nx,Oie=Dx,uP=">",fP="<",f2="prototype",d2="script",Aj=Oie("IE_PROTO"),hS=function(){},Ij=function(t){return fP+d2+uP+t+fP+"/"+d2+uP},dP=function(t){t.write(Ij("")),t.close();var e=t.parentWindow.Object;return t=null,e},Lie=function(){var t=kie("iframe"),e="java"+d2+":",r;return t.style.display="none",Cie.appendChild(t),t.src=String(e),r=t.contentWindow.document,r.open(),r.write(Ij("document.F=Object")),r.close(),r.F},Hm,wv=function(){try{Hm=new ActiveXObject("htmlfile")}catch{}wv=typeof document<"u"?document.domain&&Hm?dP(Hm):Lie():dP(Hm);for(var t=cP.length;t--;)delete wv[f2][cP[t]];return wv()};$ie[Aj]=!0;var ii=Object.create||function(e,r){var n;return e!==null?(hS[f2]=Aie(e),n=new hS,hS[f2]=null,n[Aj]=e):n=wv(),r===void 0?n:Iie.f(n,r)},Bx={},Pie=Ho,Nie=pt,Die=ri,gs=function(t,e,r){var n=Pie(e);n in t?Nie.f(t,n,Die(0,r)):t[n]=r},hP=ba,Mie=Ye,Fie=gs,Bie=Array,Uie=Math.max,kp=function(t,e,r){for(var n=Mie(t),i=hP(e,n),a=hP(r===void 0?n:r,n),s=Bie(Uie(a-i,0)),o=0;im;m++)if((o||m in h)&&(x=h[m],b=p(x,m,d),t))if(e)y[m]=b;else if(b)switch(t){case 3:return!0;case 5:return x;case 6:return m;case 2:bP(y,x)}else switch(t){case 4:return!1;case 7:bP(y,x)}return a?-1:n||i?i:y}},or={forEach:$s(0),map:$s(1),filter:$s(2),some:$s(3),every:$s(4),find:$s(5),findIndex:$s(6),filterReject:$s(7)},Ux=j,n$=he,i$=$e,Cae=ae,lf=_e,cf=zf,kae=re,zt=je,Oae=ni,h2=Ie,jx=qt,a$=Ho,Lae=Ce,p2=ri,y0=ii,Dj=Cp,Pae=ms,Mj=Bx,Nae=Ap,Fj=ar,Bj=pt,Dae=Fx,Uj=wp,pS=_t,Mae=sr,s$=wo,Fae=Dx,jj=Tp,EP=Gf,Bae=Me,Uae=e$,jae=ln,Hae=kj,zae=Tn,Hj=Dt,Hx=or.forEach,qr=Fae("hidden"),zx="Symbol",x0="prototype",Gae=Hj.set,SP=Hj.getterFor(zx),qn=Object[x0],Ml=n$.Symbol,gh=Ml&&Ml[x0],Vae=n$.TypeError,mS=n$.QObject,zj=Fj.f,El=Bj.f,Gj=Mj.f,Wae=Uj.f,Vj=Cae([].push),is=s$("symbols"),Lp=s$("op-symbols"),Kae=s$("wks"),m2=!mS||!mS[x0]||!mS[x0].findChild,g2=lf&&kae(function(){return y0(El({},"a",{get:function(){return El(this,"a",{value:7}).a}})).a!=7})?function(t,e,r){var n=zj(qn,e);n&&delete qn[e],El(t,e,r),n&&t!==qn&&El(qn,e,n)}:El,gS=function(t,e){var r=is[t]=y0(gh);return Gae(r,{type:zx,tag:t,description:e}),lf||(r.description=e),r},Gx=function(e,r,n){e===qn&&Gx(Lp,r,n),h2(e);var i=a$(r);return h2(n),zt(is,i)?(n.enumerable?(zt(e,qr)&&e[qr][i]&&(e[qr][i]=!1),n=y0(n,{enumerable:p2(0,!1)})):(zt(e,qr)||El(e,qr,p2(1,{})),e[qr][i]=!0),g2(e,i,n)):El(e,i,n)},o$=function(e,r){h2(e);var n=jx(r),i=Dj(n).concat(Yj(n));return Hx(i,function(a){(!lf||i$(v2,n,a))&&Gx(e,a,n[a])}),e},Yae=function(e,r){return r===void 0?y0(e):o$(y0(e),r)},v2=function(e){var r=a$(e),n=i$(Wae,this,r);return this===qn&&zt(is,r)&&!zt(Lp,r)?!1:n||!zt(this,r)||!zt(is,r)||zt(this,qr)&&this[qr][r]?n:!0},Wj=function(e,r){var n=jx(e),i=a$(r);if(!(n===qn&&zt(is,i)&&!zt(Lp,i))){var a=zj(n,i);return a&&zt(is,i)&&!(zt(n,qr)&&n[qr][i])&&(a.enumerable=!0),a}},Kj=function(e){var r=Gj(jx(e)),n=[];return Hx(r,function(i){!zt(is,i)&&!zt(jj,i)&&Vj(n,i)}),n},Yj=function(t){var e=t===qn,r=Gj(e?Lp:jx(t)),n=[];return Hx(r,function(i){zt(is,i)&&(!e||zt(qn,i))&&Vj(n,is[i])}),n};cf||(Ml=function(){if(Oae(gh,this))throw Vae("Symbol is not a constructor");var e=!arguments.length||arguments[0]===void 0?void 0:Lae(arguments[0]),r=EP(e),n=function(i){this===qn&&i$(n,Lp,i),zt(this,qr)&&zt(this[qr],r)&&(this[qr][r]=!1),g2(this,r,p2(1,i))};return lf&&m2&&g2(qn,r,{configurable:!0,set:n}),gS(r,e)},gh=Ml[x0],pS(gh,"toString",function(){return SP(this).tag}),pS(Ml,"withoutSetter",function(t){return gS(EP(t),t)}),Uj.f=v2,Bj.f=Gx,Dae.f=o$,Fj.f=Wj,Pae.f=Mj.f=Kj,Nae.f=Yj,Uae.f=function(t){return gS(Bae(t),t)},lf&&(Mae(gh,"description",{configurable:!0,get:function(){return SP(this).description}}),pS(qn,"propertyIsEnumerable",v2,{unsafe:!0})));Ux({global:!0,constructor:!0,wrap:!0,forced:!cf,sham:!cf},{Symbol:Ml});Hx(Dj(Kae),function(t){jae(t)});Ux({target:zx,stat:!0,forced:!cf},{useSetter:function(){m2=!0},useSimple:function(){m2=!1}});Ux({target:"Object",stat:!0,forced:!cf,sham:!lf},{create:Yae,defineProperty:Gx,defineProperties:o$,getOwnPropertyDescriptor:Wj});Ux({target:"Object",stat:!0,forced:!cf},{getOwnPropertyNames:Kj});Hae();zae(Ml,zx);jj[qr]=!0;var qae=zf,qj=qae&&!!Symbol.for&&!!Symbol.keyFor,Xae=j,Qae=ht,Zae=je,Jae=Ce,Xj=wo,ese=qj,vS=Xj("string-to-symbol-registry"),tse=Xj("symbol-to-string-registry");Xae({target:"Symbol",stat:!0,forced:!ese},{for:function(t){var e=Jae(t);if(Zae(vS,e))return vS[e];var r=Qae("Symbol")(e);return vS[e]=r,tse[r]=e,r}});var rse=j,nse=je,ise=uc,ase=fc,sse=wo,ose=qj,_P=sse("symbol-to-string-registry");rse({target:"Symbol",stat:!0,forced:!ose},{keyFor:function(e){if(!ise(e))throw TypeError(ase(e)+" is not a symbol");if(nse(_P,e))return _P[e]}});var lse=_p,Qj=Function.prototype,wP=Qj.apply,TP=Qj.call,ai=typeof Reflect=="object"&&Reflect.apply||(lse?TP.bind(wP):function(){return TP.apply(wP,arguments)}),cse=ae,dc=cse([].slice),use=ae,RP=Go,fse=Ne,AP=Pr,dse=Ce,IP=use([].push),hse=function(t){if(fse(t))return t;if(RP(t)){for(var e=t.length,r=[],n=0;na&&Noe(v,arguments[a]),v});f.prototype=l,o!=="Error"?jP?jP(f,u):HP(f,u,{name:!0}):Moe&&i in c&&(zP(f,c,i),zP(f,c,"prepareStackTrace")),HP(f,c);try{l.name!==o&&UP(l,"name",o),l.constructor=f}catch{}return f}},fH=j,Foe=he,_a=ai,dH=uH,y2="WebAssembly",GP=Foe[y2],py=Error("e",{cause:7}).cause!==7,hc=function(t,e){var r={};r[t]=dH(t,e,py),fH({global:!0,constructor:!0,arity:1,forced:py},r)},c$=function(t,e){if(GP&&GP[t]){var r={};r[t]=dH(y2+"."+t,e,py),fH({target:y2,stat:!0,constructor:!0,arity:1,forced:py},r)}};hc("Error",function(t){return function(r){return _a(t,this,arguments)}});hc("EvalError",function(t){return function(r){return _a(t,this,arguments)}});hc("RangeError",function(t){return function(r){return _a(t,this,arguments)}});hc("ReferenceError",function(t){return function(r){return _a(t,this,arguments)}});hc("SyntaxError",function(t){return function(r){return _a(t,this,arguments)}});hc("TypeError",function(t){return function(r){return _a(t,this,arguments)}});hc("URIError",function(t){return function(r){return _a(t,this,arguments)}});c$("CompileError",function(t){return function(r){return _a(t,this,arguments)}});c$("LinkError",function(t){return function(r){return _a(t,this,arguments)}});c$("RuntimeError",function(t){return function(r){return _a(t,this,arguments)}});var Boe=_e,Uoe=re,joe=Ie,Hoe=ii,VP=Np,Tv=Error.prototype.toString,zoe=Uoe(function(){if(Boe){var t=Hoe(Object.defineProperty({},"name",{get:function(){return this===t}}));if(Tv.call(t)!=="true")return!0}return Tv.call({message:1,name:2})!=="2: 1"||Tv.call({})!=="Error"}),hH=zoe?function(){var e=joe(this),r=VP(e.name,"Error"),n=VP(e.message);return r?n?r+": "+n:r:n}:Tv,Goe=_t,WP=hH,KP=Error.prototype;KP.toString!==WP&&Goe(KP,"toString",WP);var Voe=re,u$=!Voe(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}),Woe=je,Koe=Ne,Yoe=We,qoe=Dx,Xoe=u$,YP=qoe("IE_PROTO"),x2=Object,Qoe=x2.prototype,si=Xoe?x2.getPrototypeOf:function(t){var e=Yoe(t);if(Woe(e,YP))return e[YP];var r=e.constructor;return Koe(r)&&e instanceof r?r.prototype:e instanceof x2?Qoe:null},Dp={},Zoe=Me,Joe=Dp,ele=Zoe("iterator"),tle=Array.prototype,f$=function(t){return t!==void 0&&(Joe.Array===t||tle[ele]===t)},rle=Ea,qP=ps,nle=on,ile=Dp,ale=Me,sle=ale("iterator"),Mp=function(t){if(!nle(t))return qP(t,sle)||qP(t,"@@iterator")||ile[rle(t)]},ole=$e,lle=It,cle=Ie,ule=fc,fle=Mp,dle=TypeError,Vx=function(t,e){var r=arguments.length<2?fle(t):e;if(lle(r))return cle(ole(r,t));throw dle(ule(t)+" is not iterable")},hle=$e,XP=Ie,ple=ps,pH=function(t,e,r){var n,i;XP(t);try{if(n=ple(t,"return"),!n){if(e==="throw")throw r;return r}n=hle(n,t)}catch(a){i=!0,n=a}if(e==="throw")throw r;if(i)throw n;return XP(n),r},mle=Ni,gle=$e,vle=Ie,yle=fc,xle=f$,ble=Ye,QP=ni,Ele=Vx,Sle=Mp,ZP=pH,_le=TypeError,Rv=function(t,e){this.stopped=t,this.result=e},JP=Rv.prototype,wa=function(t,e,r){var n=r&&r.that,i=!!(r&&r.AS_ENTRIES),a=!!(r&&r.IS_RECORD),s=!!(r&&r.IS_ITERATOR),o=!!(r&&r.INTERRUPTED),c=mle(e,n),l,u,f,d,h,p,v,m=function(y){return l&&ZP(l,"normal",y),new Rv(!0,y)},g=function(y){return i?(vle(y),o?c(y[0],y[1],m):c(y[0],y[1])):o?c(y,m):c(y)};if(a)l=t.iterator;else if(s)l=t;else{if(u=Sle(t),!u)throw _le(yle(t)+" is not iterable");if(xle(u)){for(f=0,d=ble(t);d>f;f++)if(h=g(t[f]),h&&QP(JP,h))return h;return new Rv(!1)}l=Ele(t,u)}for(p=a?t.next:l.next;!(v=gle(p,l)).done;){try{h=g(v.value)}catch(y){ZP(l,"throw",y)}if(typeof h=="object"&&h&&QP(JP,h))return h}return new Rv(!1)},wle=j,Tle=ni,Rle=si,my=Sa,Ale=Mx,mH=ii,yS=Nr,xS=ri,Ile=aH,$le=cH,Cle=wa,kle=Np,Ole=Me,Lle=Ole("toStringTag"),gy=Error,Ple=[].push,uf=function(e,r){var n=Tle(bS,this),i;my?i=my(gy(),n?Rle(this):bS):(i=n?this:mH(bS),yS(i,Lle,"Error")),r!==void 0&&yS(i,"message",kle(r)),$le(i,uf,i.stack,1),arguments.length>2&&Ile(i,arguments[2]);var a=[];return Cle(e,Ple,{that:a}),yS(i,"errors",a),i};my?my(uf,gy):Ale(uf,gy,{name:!0});var bS=uf.prototype=mH(gy.prototype,{constructor:xS(1,uf),message:xS(1,""),name:xS(1,"AggregateError")});wle({global:!0,constructor:!0,arity:2},{AggregateError:uf});var Nle=j,Dle=ht,Mle=ai,eN=re,Fle=uH,d$="AggregateError",tN=Dle(d$),rN=!eN(function(){return tN([1]).errors[0]!==1})&&eN(function(){return tN([1],d$,{cause:7}).cause!==7});Nle({global:!0,constructor:!0,arity:2,forced:rN},{AggregateError:Fle(d$,function(t){return function(r,n){return Mle(t,this,arguments)}},rN,!0)});var Ble=Me,Ule=ii,jle=pt.f,b2=Ble("unscopables"),E2=Array.prototype;E2[b2]==null&&jle(E2,b2,{configurable:!0,value:Ule(null)});var cn=function(t){E2[b2][t]=!0},Hle=j,zle=We,Gle=Ye,Vle=$t,Wle=cn;Hle({target:"Array",proto:!0},{at:function(e){var r=zle(this),n=Gle(r),i=Vle(e),a=i>=0?i:n+i;return a<0||a>=n?void 0:r[a]}});Wle("at");var Kle=TypeError,Yle=9007199254740991,Yf=function(t){if(t>Yle)throw Kle("Maximum allowed index exceeded");return t},qle=re,Xle=Me,Qle=hs,Zle=Xle("species"),Fp=function(t){return Qle>=51||!qle(function(){var e=[],r=e.constructor={};return r[Zle]=function(){return{foo:1}},e[t](Boolean).foo!==1})},Jle=j,ece=re,tce=Go,rce=De,nce=We,ice=Ye,nN=Yf,iN=gs,ace=Op,sce=Fp,oce=Me,lce=hs,gH=oce("isConcatSpreadable"),cce=lce>=51||!ece(function(){var t=[];return t[gH]=!1,t.concat()[0]!==t}),uce=function(t){if(!rce(t))return!1;var e=t[gH];return e!==void 0?!!e:tce(t)},fce=!cce||!sce("concat");Jle({target:"Array",proto:!0,arity:1,forced:fce},{concat:function(e){var r=nce(this),n=ace(r,0),i=0,a,s,o,c,l;for(a=-1,o=arguments.length;a2?arguments[2]:void 0,c=gce((o===void 0?i:ES(o,i))-s,i-a),l=1;for(s0;)s in n?n[a]=n[s]:mce(n,a),a+=l,s+=l;return n},vce=j,yce=vH,xce=cn;vce({target:"Array",proto:!0},{copyWithin:yce});xce("copyWithin");var bce=re,vs=function(t,e){var r=[][t];return!!r&&bce(function(){r.call(null,e||function(){return 1},1)})},Ece=j,Sce=or.every,_ce=vs,wce=_ce("every");Ece({target:"Array",proto:!0,forced:!wce},{every:function(e){return Sce(this,e,arguments.length>1?arguments[1]:void 0)}});var Tce=We,sN=ba,Rce=Ye,h$=function(e){for(var r=Tce(this),n=Rce(r),i=arguments.length,a=sN(i>1?arguments[1]:void 0,n),s=i>2?arguments[2]:void 0,o=s===void 0?n:sN(s,n);o>a;)r[a++]=e;return r},Ace=j,Ice=h$,$ce=cn;Ace({target:"Array",proto:!0},{fill:Ice});$ce("fill");var Cce=j,kce=or.filter,Oce=Fp,Lce=Oce("filter");Cce({target:"Array",proto:!0,forced:!Lce},{filter:function(e){return kce(this,e,arguments.length>1?arguments[1]:void 0)}});var Pce=j,Nce=or.find,Dce=cn,S2="find",yH=!0;S2 in[]&&Array(1)[S2](function(){yH=!1});Pce({target:"Array",proto:!0,forced:yH},{find:function(e){return Nce(this,e,arguments.length>1?arguments[1]:void 0)}});Dce(S2);var Mce=j,Fce=or.findIndex,Bce=cn,_2="findIndex",xH=!0;_2 in[]&&Array(1)[_2](function(){xH=!1});Mce({target:"Array",proto:!0,forced:xH},{findIndex:function(e){return Fce(this,e,arguments.length>1?arguments[1]:void 0)}});Bce(_2);var Uce=Ni,jce=Hf,Hce=We,zce=Ye,oN=function(t){var e=t==1;return function(r,n,i){for(var a=Hce(r),s=jce(a),o=Uce(n,i),c=zce(s),l,u;c-- >0;)if(l=s[c],u=o(l,c,a),u)switch(t){case 0:return l;case 1:return c}return e?-1:void 0}},Kx={findLast:oN(0),findLastIndex:oN(1)},Gce=j,Vce=Kx.findLast,Wce=cn;Gce({target:"Array",proto:!0},{findLast:function(e){return Vce(this,e,arguments.length>1?arguments[1]:void 0)}});Wce("findLast");var Kce=j,Yce=Kx.findLastIndex,qce=cn;Kce({target:"Array",proto:!0},{findLastIndex:function(e){return Yce(this,e,arguments.length>1?arguments[1]:void 0)}});qce("findLastIndex");var Xce=Go,Qce=Ye,Zce=Yf,Jce=Ni,bH=function(t,e,r,n,i,a,s,o){for(var c=i,l=0,u=s?Jce(s,o):!1,f,d;l0&&Xce(f)?(d=Qce(f),c=bH(t,e,f,d,c,a-1)-1):(Zce(c+1),t[c]=f),c++),l++;return c},EH=bH,eue=j,tue=EH,rue=We,nue=Ye,iue=$t,aue=Op;eue({target:"Array",proto:!0},{flat:function(){var e=arguments.length?arguments[0]:void 0,r=rue(this),n=nue(r),i=aue(r,0);return i.length=tue(i,r,r,n,0,e===void 0?1:iue(e)),i}});var sue=j,oue=EH,lue=It,cue=We,uue=Ye,fue=Op;sue({target:"Array",proto:!0},{flatMap:function(e){var r=cue(this),n=uue(r),i;return lue(e),i=fue(r,0),i.length=oue(i,r,r,n,0,1,e,arguments.length>1?arguments[1]:void 0),i}});var due=or.forEach,hue=vs,pue=hue("forEach"),SH=pue?[].forEach:function(e){return due(this,e,arguments.length>1?arguments[1]:void 0)},mue=j,lN=SH;mue({target:"Array",proto:!0,forced:[].forEach!=lN},{forEach:lN});var gue=Ie,vue=pH,yue=function(t,e,r,n){try{return n?e(gue(r)[0],r[1]):e(r)}catch(i){vue(t,"throw",i)}},xue=Ni,bue=$e,Eue=We,Sue=yue,_ue=f$,wue=Wf,Tue=Ye,cN=gs,Rue=Vx,Aue=Mp,uN=Array,_H=function(e){var r=Eue(e),n=wue(this),i=arguments.length,a=i>1?arguments[1]:void 0,s=a!==void 0;s&&(a=xue(a,i>2?arguments[2]:void 0));var o=Aue(r),c=0,l,u,f,d,h,p;if(o&&!(this===uN&&_ue(o)))for(d=Rue(r,o),h=d.next,u=n?new this:[];!(f=bue(h,d)).done;c++)p=s?Sue(d,a,[f.value,c],!0):f.value,cN(u,c,p);else for(l=Tue(r),u=n?new this(l):uN(l);l>c;c++)p=s?a(r[c],c):r[c],cN(u,c,p);return u.length=c,u},Iue=Me,wH=Iue("iterator"),TH=!1;try{var $ue=0,fN={next:function(){return{done:!!$ue++}},return:function(){TH=!0}};fN[wH]=function(){return this},Array.from(fN,function(){throw 2})}catch{}var Yx=function(t,e){if(!e&&!TH)return!1;var r=!1;try{var n={};n[wH]=function(){return{next:function(){return{done:r=!0}}}},t(n)}catch{}return r},Cue=j,kue=_H,Oue=Yx,Lue=!Oue(function(t){Array.from(t)});Cue({target:"Array",stat:!0,forced:Lue},{from:kue});var Pue=j,Nue=Rp.includes,Due=re,Mue=cn,Fue=Due(function(){return!Array(1).includes()});Pue({target:"Array",proto:!0,forced:Fue},{includes:function(e){return Nue(this,e,arguments.length>1?arguments[1]:void 0)}});Mue("includes");var Bue=j,Uue=zo,jue=Rp.indexOf,Hue=vs,w2=Uue([].indexOf),RH=!!w2&&1/w2([1],1,-0)<0,zue=RH||!Hue("indexOf");Bue({target:"Array",proto:!0,forced:zue},{indexOf:function(e){var r=arguments.length>1?arguments[1]:void 0;return RH?w2(this,e,r)||0:jue(this,e,r)}});var Gue=j,Vue=Go;Gue({target:"Array",stat:!0},{isArray:Vue});var Wue=re,Kue=Ne,Yue=De,dN=si,que=_t,Xue=Me,T2=Xue("iterator"),AH=!1,Vl,SS,_S;[].keys&&(_S=[].keys(),"next"in _S?(SS=dN(dN(_S)),SS!==Object.prototype&&(Vl=SS)):AH=!0);var Que=!Yue(Vl)||Wue(function(){var t={};return Vl[T2].call(t)!==t});Que&&(Vl={});Kue(Vl[T2])||que(Vl,T2,function(){return this});var IH={IteratorPrototype:Vl,BUGGY_SAFARI_ITERATORS:AH},Zue=IH.IteratorPrototype,Jue=ii,efe=ri,tfe=Tn,rfe=Dp,nfe=function(){return this},p$=function(t,e,r,n){var i=e+" Iterator";return t.prototype=Jue(Zue,{next:efe(+!n,r)}),tfe(t,i,!1),rfe[i]=nfe,t},ife=j,afe=$e,$H=Vf,sfe=Ne,ofe=p$,hN=si,pN=Sa,lfe=Tn,cfe=Nr,wS=_t,ufe=Me,ffe=Dp,CH=IH,dfe=$H.PROPER,hfe=$H.CONFIGURABLE,mN=CH.IteratorPrototype,Wm=CH.BUGGY_SAFARI_ITERATORS,Ad=ufe("iterator"),gN="keys",Id="values",vN="entries",pfe=function(){return this},m$=function(t,e,r,n,i,a,s){ofe(r,e,n);var o=function(g){if(g===i&&d)return d;if(!Wm&&g in u)return u[g];switch(g){case gN:return function(){return new r(this,g)};case Id:return function(){return new r(this,g)};case vN:return function(){return new r(this,g)}}return function(){return new r(this)}},c=e+" Iterator",l=!1,u=t.prototype,f=u[Ad]||u["@@iterator"]||i&&u[i],d=!Wm&&f||o(i),h=e=="Array"&&u.entries||f,p,v,m;if(h&&(p=hN(h.call(new t)),p!==Object.prototype&&p.next&&(hN(p)!==mN&&(pN?pN(p,mN):sfe(p[Ad])||wS(p,Ad,pfe)),lfe(p,c,!0))),dfe&&i==Id&&f&&f.name!==Id&&(hfe?cfe(u,"name",Id):(l=!0,d=function(){return afe(f,this)})),i)if(v={values:o(Id),keys:a?d:o(gN),entries:o(vN)},s)for(m in v)(Wm||l||!(m in u))&&wS(u,m,v[m]);else ife({target:e,proto:!0,forced:Wm||l},v);return u[Ad]!==d&&wS(u,Ad,d,{name:i}),ffe[e]=d,v},qx=function(t,e){return{value:t,done:e}},mfe=qt,g$=cn,yN=Dp,kH=Dt,gfe=pt.f,vfe=m$,Km=qx,yfe=_e,OH="Array Iterator",xfe=kH.set,bfe=kH.getterFor(OH),LH=vfe(Array,"Array",function(t,e){xfe(this,{type:OH,target:mfe(t),index:0,kind:e})},function(){var t=bfe(this),e=t.target,r=t.kind,n=t.index++;return!e||n>=e.length?(t.target=void 0,Km(void 0,!0)):r=="keys"?Km(n,!1):r=="values"?Km(e[n],!1):Km([n,e[n]],!1)},"values"),xN=yN.Arguments=yN.Array;g$("keys");g$("values");g$("entries");if(yfe&&xN.name!=="values")try{gfe(xN,"name",{value:"values"})}catch{}var Efe=j,Sfe=ae,_fe=Hf,wfe=qt,Tfe=vs,Rfe=Sfe([].join),Afe=_fe!=Object,Ife=Afe||!Tfe("join",",");Efe({target:"Array",proto:!0,forced:Ife},{join:function(e){return Rfe(wfe(this),e===void 0?",":e)}});var $fe=ai,Cfe=qt,kfe=$t,Ofe=Ye,Lfe=vs,Pfe=Math.min,R2=[].lastIndexOf,PH=!!R2&&1/[1].lastIndexOf(1,-0)<0,Nfe=Lfe("lastIndexOf"),Dfe=PH||!Nfe,NH=Dfe?function(e){if(PH)return $fe(R2,this,arguments)||0;var r=Cfe(this),n=Ofe(r),i=n-1;for(arguments.length>1&&(i=Pfe(i,kfe(arguments[1]))),i<0&&(i=n+i);i>=0;i--)if(i in r&&r[i]===e)return i||0;return-1}:R2,Mfe=j,bN=NH;Mfe({target:"Array",proto:!0,forced:bN!==[].lastIndexOf},{lastIndexOf:bN});var Ffe=j,Bfe=or.map,Ufe=Fp,jfe=Ufe("map");Ffe({target:"Array",proto:!0,forced:!jfe},{map:function(e){return Bfe(this,e,arguments.length>1?arguments[1]:void 0)}});var Hfe=j,zfe=re,Gfe=Wf,Vfe=gs,DH=Array,Wfe=zfe(function(){function t(){}return!(DH.of.call(t)instanceof t)});Hfe({target:"Array",stat:!0,forced:Wfe},{of:function(){for(var e=0,r=arguments.length,n=new(Gfe(this)?this:DH)(r);r>e;)Vfe(n,e,arguments[e++]);return n.length=r,n}});var Kfe=_e,Yfe=Go,qfe=TypeError,Xfe=Object.getOwnPropertyDescriptor,Qfe=Kfe&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}(),v$=Qfe?function(t,e){if(Yfe(t)&&!Xfe(t,"length").writable)throw qfe("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e},Zfe=j,Jfe=We,ede=Ye,tde=v$,rde=Yf,nde=re,ide=nde(function(){return[].push.call({length:4294967296},1)!==4294967297}),ade=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}},sde=ide||!ade();Zfe({target:"Array",proto:!0,arity:1,forced:sde},{push:function(e){var r=Jfe(this),n=ede(r),i=arguments.length;rde(n+i);for(var a=0;a=0:o>c;c+=l)c in s&&(i=r(i,s[c],c,a));return i}},Xx={left:EN(!1),right:EN(!0)},dde=Pr,ys=typeof process<"u"&&dde(process)=="process",hde=j,pde=Xx.left,mde=vs,SN=hs,gde=ys,vde=!gde&&SN>79&&SN<83,yde=vde||!mde("reduce");hde({target:"Array",proto:!0,forced:yde},{reduce:function(e){var r=arguments.length;return pde(this,e,r,r>1?arguments[1]:void 0)}});var xde=j,bde=Xx.right,Ede=vs,_N=hs,Sde=ys,_de=!Sde&&_N>79&&_N<83,wde=_de||!Ede("reduceRight");xde({target:"Array",proto:!0,forced:wde},{reduceRight:function(e){return bde(this,e,arguments.length,arguments.length>1?arguments[1]:void 0)}});var Tde=j,Rde=ae,Ade=Go,Ide=Rde([].reverse),wN=[1,2];Tde({target:"Array",proto:!0,forced:String(wN)===String(wN.reverse())},{reverse:function(){return Ade(this)&&(this.length=this.length),Ide(this)}});var $de=j,TN=Go,Cde=Wf,kde=De,RN=ba,Ode=Ye,Lde=qt,Pde=gs,Nde=Me,Dde=Fp,Mde=dc,Fde=Dde("slice"),Bde=Nde("species"),TS=Array,Ude=Math.max;$de({target:"Array",proto:!0,forced:!Fde},{slice:function(e,r){var n=Lde(this),i=Ode(n),a=RN(e,i),s=RN(r===void 0?i:r,i),o,c,l;if(TN(n)&&(o=n.constructor,Cde(o)&&(o===TS||TN(o.prototype))?o=void 0:kde(o)&&(o=o[Bde],o===null&&(o=void 0)),o===TS||o===void 0))return Mde(n,a,s);for(c=new(o===void 0?TS:o)(Ude(s-a,0)),l=0;a1?arguments[1]:void 0)}});var AN=kp,Vde=Math.floor,A2=function(t,e){var r=t.length,n=Vde(r/2);return r<8?Wde(t,e):Kde(t,A2(AN(t,0,n),e),A2(AN(t,n),e),e)},Wde=function(t,e){for(var r=t.length,n=1,i,a;n0;)t[a]=t[--a];a!==n++&&(t[a]=i)}return t},Kde=function(t,e,r,n){for(var i=e.length,a=r.length,s=0,o=0;s3)){if(nhe)return!0;if(PN)return PN<603;var t="",e,r,n,i;for(e=65;e<76;e++){switch(r=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:n=3;break;case 68:case 71:n=4;break;default:n=2}for(i=0;i<47;i++)qs.push({k:r+i,v:n})}for(qs.sort(function(a,s){return s.v-a.v}),i=0;ikN(r)?1:-1}};Qde({target:"Array",proto:!0,forced:lhe},{sort:function(e){e!==void 0&&Zde(e);var r=Jde(this);if(UH)return e===void 0?NN(r):NN(r,e);var n=[],i=CN(r),a,s;for(s=0;si-c+o;u--)RS(n,u-1)}else if(o>c)for(u=i-c;u>a;u--)f=u+c-1,d=u+o-1,f in n?n[d]=n[f]:RS(n,d);for(u=0;ur;)i[r]=e[r++];return i},Nhe=he,Dhe=function(t){return Nhe[t].prototype},Mhe=j,Fhe=ae,Bhe=It,Uhe=qt,jhe=E$,Hhe=Dhe,zhe=cn,Ghe=Array,Vhe=Fhe(Hhe("Array").sort);Mhe({target:"Array",proto:!0},{toSorted:function(e){e!==void 0&&Bhe(e);var r=Uhe(this),n=jhe(Ghe,r);return Vhe(n,e)}});zhe("toSorted");var Whe=j,Khe=cn,Yhe=Yf,qhe=Ye,Xhe=ba,Qhe=qt,Zhe=$t,Jhe=Array,e0e=Math.max,t0e=Math.min;Whe({target:"Array",proto:!0},{toSpliced:function(e,r){var n=Qhe(this),i=qhe(n),a=Xhe(e,i),s=arguments.length,o=0,c,l,u,f;for(s===0?c=l=0:s===1?(c=0,l=i-a):(c=s-2,l=t0e(e0e(Zhe(r),0),i-a)),u=Yhe(i+c-l),f=Jhe(u);o=i||s<0)throw m0e("Incorrect index");for(var o=new e(i),c=0;c>1,o=e===23?Fa(2,-24)-Fa(2,-77):0,c=t<0||t===0&&1/t<0?1:0,l=0,u,f,d;for(t=A0e(t),t!=t||t===1/0?(f=t!=t?1:0,u=a):(u=I0e($0e(t)/C0e),d=Fa(2,-u),t*d<1&&(u--,d*=2),u+s>=1?t+=o/d:t+=o*Fa(2,1-s),t*d>=2&&(u++,d/=2),u+s>=a?(f=0,u=a):u+s>=1?(f=(t*d-1)*Fa(2,e),u=u+s):(f=t*Fa(2,s-1)*Fa(2,e),u=0));e>=8;)n[l++]=f&255,f/=256,e-=8;for(u=u<0;)n[l++]=u&255,u/=256,i-=8;return n[--l]|=c*128,n},O0e=function(t,e){var r=t.length,n=r*8-e-1,i=(1<>1,s=n-7,o=r-1,c=t[o--],l=c&127,u;for(c>>=7;s>0;)l=l*256+t[o--],s-=8;for(u=l&(1<<-s)-1,l>>=-s,s+=e;s>0;)u=u*256+t[o--],s-=8;if(l===0)l=1-a;else{if(l===i)return u?NaN:c?-1/0:1/0;u=u+Fa(2,e),l=l-a}return(c?-1:1)*u*Fa(2,l-e)},L0e={pack:k0e,unpack:O0e},Qx=he,_$=ae,AS=_e,P0e=S$,GH=Vf,MN=Nr,N0e=sr,FN=Bp,IS=re,Ym=Ta,D0e=$t,M0e=wn,vy=zH,VH=L0e,F0e=si,BN=Sa,B0e=ms.f,U0e=h$,j0e=kp,WH=Tn,w$=Dt,H0e=GH.PROPER,UN=GH.CONFIGURABLE,Iu="ArrayBuffer",Zx="DataView",$u="prototype",z0e="Wrong length",KH="Wrong index",jN=w$.getterFor(Iu),Lh=w$.getterFor(Zx),HN=w$.set,Fn=Qx[Iu],mn=Fn,Pc=mn&&mn[$u],ea=Qx[Zx],sl=ea&&ea[$u],zN=Object.prototype,G0e=Qx.Array,yy=Qx.RangeError,V0e=_$(U0e),W0e=_$([].reverse),YH=VH.pack,GN=VH.unpack,VN=function(t){return[t&255]},WN=function(t){return[t&255,t>>8&255]},KN=function(t){return[t&255,t>>8&255,t>>16&255,t>>24&255]},YN=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},K0e=function(t){return YH(t,23,4)},Y0e=function(t){return YH(t,52,8)},qm=function(t,e,r){N0e(t[$u],e,{configurable:!0,get:function(){return r(this)[e]}})},Cs=function(t,e,r,n){var i=vy(r),a=Lh(t);if(i+e>a.byteLength)throw yy(KH);var s=a.bytes,o=i+a.byteOffset,c=j0e(s,o,o+e);return n?c:W0e(c)},ks=function(t,e,r,n,i,a){var s=vy(r),o=Lh(t);if(s+e>o.byteLength)throw yy(KH);for(var c=o.bytes,l=s+o.byteOffset,u=n(+i),f=0;fa)throw yy("Wrong offset");if(n=n===void 0?a-s:M0e(n),s+n>a)throw yy(z0e);HN(this,{type:Zx,buffer:e,byteLength:n,byteOffset:s,bytes:i.bytes}),AS||(this.buffer=e,this.byteLength=n,this.byteOffset=s)},sl=ea[$u],AS&&(qm(mn,"byteLength",jN),qm(ea,"buffer",Lh),qm(ea,"byteLength",Lh),qm(ea,"byteOffset",Lh)),FN(sl,{getInt8:function(e){return Cs(this,1,e)[0]<<24>>24},getUint8:function(e){return Cs(this,1,e)[0]},getInt16:function(e){var r=Cs(this,2,e,arguments.length>1?arguments[1]:void 0);return(r[1]<<8|r[0])<<16>>16},getUint16:function(e){var r=Cs(this,2,e,arguments.length>1?arguments[1]:void 0);return r[1]<<8|r[0]},getInt32:function(e){return YN(Cs(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function(e){return YN(Cs(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(e){return GN(Cs(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(e){return GN(Cs(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(e,r){ks(this,1,e,VN,r)},setUint8:function(e,r){ks(this,1,e,VN,r)},setInt16:function(e,r){ks(this,2,e,WN,r,arguments.length>2?arguments[2]:void 0)},setUint16:function(e,r){ks(this,2,e,WN,r,arguments.length>2?arguments[2]:void 0)},setInt32:function(e,r){ks(this,4,e,KN,r,arguments.length>2?arguments[2]:void 0)},setUint32:function(e,r){ks(this,4,e,KN,r,arguments.length>2?arguments[2]:void 0)},setFloat32:function(e,r){ks(this,4,e,K0e,r,arguments.length>2?arguments[2]:void 0)},setFloat64:function(e,r){ks(this,8,e,Y0e,r,arguments.length>2?arguments[2]:void 0)}});else{var qN=H0e&&Fn.name!==Iu;if(!IS(function(){Fn(1)})||!IS(function(){new Fn(-1)})||IS(function(){return new Fn,new Fn(1.5),new Fn(NaN),Fn.length!=1||qN&&!UN})){mn=function(e){return Ym(this,Pc),new Fn(vy(e))},mn[$u]=Pc;for(var XN=B0e(Fn),QN=0,$S;XN.length>QN;)($S=XN[QN++])in mn||MN(mn,$S,Fn[$S]);Pc.constructor=mn}else qN&&UN&&MN(Fn,"name",Iu);BN&&F0e(sl)!==zN&&BN(sl,zN);var Xm=new ea(new mn(2)),ZN=_$(sl.setInt8);Xm.setInt8(0,2147483648),Xm.setInt8(1,2147483649),(Xm.getInt8(0)||!Xm.getInt8(1))&&FN(sl,{setInt8:function(e,r){ZN(this,e,r<<24>>24)},setUint8:function(e,r){ZN(this,e,r<<24>>24)}},{unsafe:!0})}WH(mn,Iu);WH(ea,Zx);var Jx={ArrayBuffer:mn,DataView:ea},q0e=j,X0e=he,Q0e=Jx,Z0e=qf,T$="ArrayBuffer",JN=Q0e[T$],J0e=X0e[T$];q0e({global:!0,constructor:!0,forced:J0e!==JN},{ArrayBuffer:JN});Z0e(T$);var epe=S$,R$=_e,kr=he,qH=Ne,eb=De,To=je,A$=Ea,tpe=fc,rpe=Nr,I2=_t,npe=sr,ipe=ni,tb=si,Xf=Sa,ape=Me,spe=Gf,XH=Dt,QH=XH.enforce,ope=XH.get,xy=kr.Int8Array,$2=xy&&xy.prototype,eD=kr.Uint8ClampedArray,tD=eD&&eD.prototype,na=xy&&tb(xy),Ti=$2&&tb($2),lpe=Object.prototype,I$=kr.TypeError,rD=ape("toStringTag"),C2=spe("TYPED_ARRAY_TAG"),by="TypedArrayConstructor",as=epe&&!!Xf&&A$(kr.opera)!=="Opera",ZH=!1,Zr,Xs,Cu,ss={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},$$={BigInt64Array:8,BigUint64Array:8},cpe=function(e){if(!eb(e))return!1;var r=A$(e);return r==="DataView"||To(ss,r)||To($$,r)},JH=function(t){var e=tb(t);if(eb(e)){var r=ope(e);return r&&To(r,by)?r[by]:JH(e)}},ez=function(t){if(!eb(t))return!1;var e=A$(t);return To(ss,e)||To($$,e)},upe=function(t){if(ez(t))return t;throw I$("Target is not a typed array")},fpe=function(t){if(qH(t)&&(!Xf||ipe(na,t)))return t;throw I$(tpe(t)+" is not a typed array constructor")},dpe=function(t,e,r,n){if(R$){if(r)for(var i in ss){var a=kr[i];if(a&&To(a.prototype,t))try{delete a.prototype[t]}catch{try{a.prototype[t]=e}catch{}}}(!Ti[t]||r)&&I2(Ti,t,r?e:as&&$2[t]||e,n)}},hpe=function(t,e,r){var n,i;if(R$){if(Xf){if(r){for(n in ss)if(i=kr[n],i&&To(i,t))try{delete i[t]}catch{}}if(!na[t]||r)try{return I2(na,t,r?e:as&&na[t]||e)}catch{}else return}for(n in ss)i=kr[n],i&&(!i[t]||r)&&I2(i,t,e)}};for(Zr in ss)Xs=kr[Zr],Cu=Xs&&Xs.prototype,Cu?QH(Cu)[by]=Xs:as=!1;for(Zr in $$)Xs=kr[Zr],Cu=Xs&&Xs.prototype,Cu&&(QH(Cu)[by]=Xs);if((!as||!qH(na)||na===Function.prototype)&&(na=function(){throw I$("Incorrect invocation")},as))for(Zr in ss)kr[Zr]&&Xf(kr[Zr],na);if((!as||!Ti||Ti===lpe)&&(Ti=na.prototype,as))for(Zr in ss)kr[Zr]&&Xf(kr[Zr].prototype,Ti);as&&tb(tD)!==Ti&&Xf(tD,Ti);if(R$&&!To(Ti,rD)){ZH=!0,npe(Ti,rD,{configurable:!0,get:function(){return eb(this)?this[C2]:void 0}});for(Zr in ss)kr[Zr]&&rpe(kr[Zr],C2,Zr)}var Oe={NATIVE_ARRAY_BUFFER_VIEWS:as,TYPED_ARRAY_TAG:ZH&&C2,aTypedArray:upe,aTypedArrayConstructor:fpe,exportTypedArrayMethod:dpe,exportTypedArrayStaticMethod:hpe,getTypedArrayConstructor:JH,isView:cpe,isTypedArray:ez,TypedArray:na,TypedArrayPrototype:Ti},ppe=j,tz=Oe,mpe=tz.NATIVE_ARRAY_BUFFER_VIEWS;ppe({target:"ArrayBuffer",stat:!0,forced:!mpe},{isView:tz.isView});var gpe=Wf,vpe=fc,ype=TypeError,C$=function(t){if(gpe(t))return t;throw ype(vpe(t)+" is not a constructor")},nD=Ie,xpe=C$,bpe=on,Epe=Me,Spe=Epe("species"),Qf=function(t,e){var r=nD(t).constructor,n;return r===void 0||bpe(n=nD(r)[Spe])?e:xpe(n)},_pe=j,k$=zo,wpe=re,rz=Jx,iD=Ie,aD=ba,Tpe=wn,Rpe=Qf,O$=rz.ArrayBuffer,k2=rz.DataView,nz=k2.prototype,sD=k$(O$.prototype.slice),Ape=k$(nz.getUint8),Ipe=k$(nz.setUint8),$pe=wpe(function(){return!new O$(2).slice(1,void 0).byteLength});_pe({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:$pe},{slice:function(e,r){if(sD&&r===void 0)return sD(iD(this),e);for(var n=iD(this).byteLength,i=aD(e,n),a=aD(r===void 0?n:r,n),s=new(Rpe(this,O$))(Tpe(a-i)),o=new k2(this),c=new k2(s),l=0;i0;(i>>>=1)&&(r+=r))i&1&&(n+=r);return n},oz=ae,Xpe=wn,oD=Ce,Qpe=rb,Zpe=Nt,Jpe=oz(Qpe),eme=oz("".slice),tme=Math.ceil,lD=function(t){return function(e,r,n){var i=oD(Zpe(e)),a=Xpe(r),s=i.length,o=n===void 0?" ":oD(n),c,l;return a<=s||o==""?i:(c=a-s,l=Jpe(o,tme(c/o.length)),l.length>c&&(l=eme(l,0,c)),t?i+l:l+i)}},L$={start:lD(!1),end:lD(!0)},Vo=ae,cD=re,ol=L$.start,rme=RangeError,nme=isFinite,ime=Math.abs,xs=Date.prototype,CS=xs.toISOString,ame=Vo(xs.getTime),sme=Vo(xs.getUTCDate),ome=Vo(xs.getUTCFullYear),lme=Vo(xs.getUTCHours),cme=Vo(xs.getUTCMilliseconds),ume=Vo(xs.getUTCMinutes),fme=Vo(xs.getUTCMonth),dme=Vo(xs.getUTCSeconds),hme=cD(function(){return CS.call(new Date(-5e13-1))!="0385-07-25T07:06:39.999Z"})||!cD(function(){CS.call(new Date(NaN))})?function(){if(!nme(ame(this)))throw rme("Invalid time value");var e=this,r=ome(e),n=cme(e),i=r<0?"-":r>9999?"+":"";return i+ol(ime(r),i?6:4,0)+"-"+ol(fme(e)+1,2,0)+"-"+ol(sme(e),2,0)+"T"+ol(lme(e),2,0)+":"+ol(ume(e),2,0)+":"+ol(dme(e),2,0)+"."+ol(n,3,0)+"Z"}:CS,pme=j,uD=hme;pme({target:"Date",proto:!0,forced:Date.prototype.toISOString!==uD},{toISOString:uD});var mme=j,gme=re,vme=We,yme=Px,xme=gme(function(){return new Date(NaN).toJSON()!==null||Date.prototype.toJSON.call({toISOString:function(){return 1}})!==1});mme({target:"Date",proto:!0,arity:1,forced:xme},{toJSON:function(e){var r=vme(this),n=yme(r,"number");return typeof n=="number"&&!isFinite(n)?null:r.toISOString()}});var bme=Ie,Eme=gj,Sme=TypeError,_me=function(t){if(bme(this),t==="string"||t==="default")t="string";else if(t!=="number")throw Sme("Incorrect hint");return Eme(this,t)},wme=je,Tme=_t,Rme=_me,Ame=Me,fD=Ame("toPrimitive"),dD=Date.prototype;wme(dD,fD)||Tme(dD,fD,Rme);var lz=ae,Ime=_t,P$=Date.prototype,hD="Invalid Date",cz="toString",$me=lz(P$[cz]),Cme=lz(P$.getTime);String(new Date(NaN))!=hD&&Ime(P$,cz,function(){var e=Cme(this);return e===e?$me(this):hD});var kme=j,Up=ae,Ome=Ce,Lme=Up("".charAt),Pme=Up("".charCodeAt),Nme=Up(/./.exec),Dme=Up(1 .toString),Mme=Up("".toUpperCase),Fme=/[\w*+\-./@]/,pD=function(t,e){for(var r=Dme(t,16);r.length1?arguments[1]:void 0),h;h=h?h.next:f.first;)for(d(h.value,h.key,this);h&&h.removed;)h=h.previous},has:function(u){return!!c(this,u)}}),SD(a,r?{get:function(u){var f=c(this,u);return f&&f.value},set:function(u,f){return o(this,u===0?0:u,f)}}:{add:function(u){return o(this,u=u===0?0:u,u)}}),$d&&jge(a,"size",{configurable:!0,get:function(){return s(this).size}}),i},setStrong:function(t,e,r){var n=e+" Iterator",i=DS(e),a=DS(n);Wge(t,e,function(s,o){wD(this,{type:n,target:s,state:i(s),kind:o,last:void 0})},function(){for(var s=a(this),o=s.kind,c=s.last;c&&c.removed;)c=c.previous;return!s.target||!(s.last=c=c?c.next:s.state.first)?(s.target=void 0,Qm(void 0,!0)):o=="keys"?Qm(c.key,!1):o=="values"?Qm(c.value,!1):Qm([c.key,c.value],!1)},r?"entries":"values",!r,!0),Kge(e)}},Yge=nb,qge=yz;Yge("Map",function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},qge);var Xge=Math.log,xz=Math.log1p||function(e){var r=+e;return r>-1e-8&&r<1e-8?r-r*r/2:Xge(1+r)},Qge=j,Zge=xz,MS=Math.acosh,Jge=Math.log,TD=Math.sqrt,eve=Math.LN2,tve=!MS||Math.floor(MS(Number.MAX_VALUE))!=710||MS(1/0)!=1/0;Qge({target:"Math",stat:!0,forced:tve},{acosh:function(e){var r=+e;return r<1?NaN:r>9490626562425156e-8?Jge(r)+eve:Zge(r-1+TD(r-1)*TD(r+1))}});var rve=j,RD=Math.asinh,nve=Math.log,ive=Math.sqrt;function bz(t){var e=+t;return!isFinite(e)||e==0?e:e<0?-bz(-e):nve(e+ive(e*e+1))}var ave=!(RD&&1/RD(0)>0);rve({target:"Math",stat:!0,forced:ave},{asinh:bz});var sve=j,AD=Math.atanh,ove=Math.log,lve=!(AD&&1/AD(-0)<0);sve({target:"Math",stat:!0,forced:lve},{atanh:function(e){var r=+e;return r==0?r:ove((1+r)/(1-r))/2}});var U$=Math.sign||function(e){var r=+e;return r==0||r!=r?r:r<0?-1:1},cve=j,uve=U$,fve=Math.abs,dve=Math.pow;cve({target:"Math",stat:!0},{cbrt:function(e){var r=+e;return uve(r)*dve(fve(r),1/3)}});var hve=j,pve=Math.floor,mve=Math.log,gve=Math.LOG2E;hve({target:"Math",stat:!0},{clz32:function(e){var r=e>>>0;return r?31-pve(mve(r+.5)*gve):32}});var Cd=Math.expm1,vve=Math.exp,ib=!Cd||Cd(10)>22025.465794806718||Cd(10)<22025.465794806718||Cd(-2e-17)!=-2e-17?function(e){var r=+e;return r==0?r:r>-1e-6&&r<1e-6?r+r*r/2:vve(r)-1}:Cd,yve=j,xve=ib,ID=Math.cosh,bve=Math.abs,FS=Math.E,Eve=!ID||ID(710)===1/0;yve({target:"Math",stat:!0,forced:Eve},{cosh:function(e){var r=xve(bve(e)-1)+1;return(r+1/(r*FS*FS))*(FS/2)}});var Sve=j,$D=ib;Sve({target:"Math",stat:!0,forced:$D!=Math.expm1},{expm1:$D});var _ve=U$,wve=Math.abs,ab=Math.pow,O2=ab(2,-52),Iv=ab(2,-23),Tve=ab(2,127)*(2-Iv),BS=ab(2,-126),Rve=function(t){return t+1/O2-1/O2},Ave=Math.fround||function(e){var r=+e,n=wve(r),i=_ve(r),a,s;return nTve||s!=s?i*(1/0):i*s)},Ive=j,$ve=Ave;Ive({target:"Math",stat:!0},{fround:$ve});var Cve=j,CD=Math.hypot,kve=Math.abs,Ove=Math.sqrt,Lve=!!CD&&CD(1/0,NaN)!==1/0;Cve({target:"Math",stat:!0,arity:2,forced:Lve},{hypot:function(e,r){for(var n=0,i=0,a=arguments.length,s=0,o,c;i0?(c=o/s,n+=c*c):n+=o;return s===1/0?1/0:s*Ove(n)}});var Pve=j,Nve=re,kD=Math.imul,Dve=Nve(function(){return kD(4294967295,5)!=-5||kD.length!=2});Pve({target:"Math",stat:!0,forced:Dve},{imul:function(e,r){var n=65535,i=+e,a=+r,s=n&i,o=n&a;return 0|s*o+((n&i>>>16)*o+s*(n&a>>>16)<<16>>>0)}});var Mve=Math.log,Fve=Math.LOG10E,Ez=Math.log10||function(e){return Mve(e)*Fve},Bve=j,Uve=Ez;Bve({target:"Math",stat:!0},{log10:Uve});var jve=j,Hve=xz;jve({target:"Math",stat:!0},{log1p:Hve});var zve=j,Gve=Math.log,Vve=Math.LN2;zve({target:"Math",stat:!0},{log2:function(e){return Gve(e)/Vve}});var Wve=j,Kve=U$;Wve({target:"Math",stat:!0},{sign:Kve});var Yve=j,qve=re,OD=ib,Xve=Math.abs,LD=Math.exp,Qve=Math.E,Zve=qve(function(){return Math.sinh(-2e-17)!=-2e-17});Yve({target:"Math",stat:!0,forced:Zve},{sinh:function(e){var r=+e;return Xve(r)<1?(OD(r)-OD(-r))/2:(LD(r-1)-LD(-r-1))*(Qve/2)}});var Jve=j,PD=ib,ND=Math.exp;Jve({target:"Math",stat:!0},{tanh:function(e){var r=+e,n=PD(r),i=PD(-r);return n==1/0?1:i==1/0?-1:(n-i)/(ND(r)+ND(-r))}});var eye=Tn;eye(Math,"Math",!0);var tye=j,rye=_j;tye({target:"Math",stat:!0},{trunc:rye});var nye=ae,sb=nye(1 .valueOf),ob=` +\v\f\r                 \u2028\u2029\uFEFF`,iye=ae,aye=Nt,sye=Ce,L2=ob,DD=iye("".replace),oye=RegExp("^["+L2+"]+"),lye=RegExp("(^|[^"+L2+"])["+L2+"]+$"),US=function(t){return function(e){var r=sye(aye(e));return t&1&&(r=DD(r,oye,"")),t&2&&(r=DD(r,lye,"$1")),r}},Jf={start:US(1),end:US(2),trim:US(3)},cye=j,Sz=VI,uye=_e,_z=he,wz=t$,Tz=ae,fye=$p,MD=je,dye=Kf,hye=ni,pye=uc,Rz=Px,mye=re,gye=ms.f,vye=ar.f,yye=pt.f,xye=sb,bye=Jf.trim,lb="Number",ku=_z[lb];wz[lb];var j$=ku.prototype,Eye=_z.TypeError,Sye=Tz("".slice),Zm=Tz("".charCodeAt),_ye=function(t){var e=Rz(t,"number");return typeof e=="bigint"?e:wye(e)},wye=function(t){var e=Rz(t,"number"),r,n,i,a,s,o,c,l;if(pye(e))throw Eye("Cannot convert a Symbol value to a number");if(typeof e=="string"&&e.length>2){if(e=bye(e),r=Zm(e,0),r===43||r===45){if(n=Zm(e,2),n===88||n===120)return NaN}else if(r===48){switch(Zm(e,1)){case 66:case 98:i=2,a=49;break;case 79:case 111:i=8,a=55;break;default:return+e}for(s=Sye(e,2),o=s.length,c=0;ca)return NaN;return parseInt(s,i)}}return+e},H$=fye(lb,!ku(" 0o1")||!ku("0b1")||ku("+0x1")),Tye=function(t){return hye(j$,t)&&mye(function(){xye(t)})},cb=function(e){var r=arguments.length<1?0:ku(_ye(e));return Tye(this)?dye(Object(r),this,cb):r};cb.prototype=j$;H$&&!Sz&&(j$.constructor=cb);cye({global:!0,constructor:!0,wrap:!0,forced:H$},{Number:cb});var Rye=function(t,e){for(var r=uye?gye(e):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),n=0,i;r.length>n;n++)MD(e,i=r[n])&&!MD(t,i)&&yye(t,i,vye(e,i))};(H$||Sz)&&Rye(wz[lb],ku);var Aye=j;Aye({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{EPSILON:Math.pow(2,-52)});var Iye=he,$ye=Iye.isFinite,Cye=Number.isFinite||function(e){return typeof e=="number"&&$ye(e)},kye=j,Oye=Cye;kye({target:"Number",stat:!0},{isFinite:Oye});var Lye=De,Pye=Math.floor,z$=Number.isInteger||function(e){return!Lye(e)&&isFinite(e)&&Pye(e)===e},Nye=j,Dye=z$;Nye({target:"Number",stat:!0},{isInteger:Dye});var Mye=j;Mye({target:"Number",stat:!0},{isNaN:function(e){return e!=e}});var Fye=j,Bye=z$,Uye=Math.abs;Fye({target:"Number",stat:!0},{isSafeInteger:function(e){return Bye(e)&&Uye(e)<=9007199254740991}});var jye=j;jye({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MAX_SAFE_INTEGER:9007199254740991});var Hye=j;Hye({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MIN_SAFE_INTEGER:-9007199254740991});var Az=he,zye=re,Gye=ae,Vye=Ce,Wye=Jf.trim,Kye=ob,Yye=Gye("".charAt),Ey=Az.parseFloat,FD=Az.Symbol,BD=FD&&FD.iterator,qye=1/Ey(Kye+"-0")!==-1/0||BD&&!zye(function(){Ey(Object(BD))}),Iz=qye?function(e){var r=Wye(Vye(e)),n=Ey(r);return n===0&&Yye(r,0)=="-"?-0:n}:Ey,Xye=j,UD=Iz;Xye({target:"Number",stat:!0,forced:Number.parseFloat!=UD},{parseFloat:UD});var $z=he,Qye=re,Zye=ae,Jye=Ce,e1e=Jf.trim,jD=ob,Ph=$z.parseInt,HD=$z.Symbol,zD=HD&&HD.iterator,Cz=/^[+-]?0x/i,t1e=Zye(Cz.exec),r1e=Ph(jD+"08")!==8||Ph(jD+"0x16")!==22||zD&&!Qye(function(){Ph(Object(zD))}),kz=r1e?function(e,r){var n=e1e(Jye(e));return Ph(n,r>>>0||(t1e(Cz,n)?16:10))}:Ph,n1e=j,GD=kz;n1e({target:"Number",stat:!0,forced:Number.parseInt!=GD},{parseInt:GD});var i1e=j,G$=ae,a1e=$t,s1e=sb,o1e=rb,l1e=Ez,P2=re,c1e=RangeError,VD=String,u1e=isFinite,f1e=Math.abs,d1e=Math.floor,WD=Math.pow,h1e=Math.round,ia=G$(1 .toExponential),p1e=G$(o1e),KD=G$("".slice),Oz=ia(-69e-12,4)==="-6.9000e-11"&&ia(1.255,2)==="1.25e+0"&&ia(12345,3)==="1.235e+4"&&ia(25,0)==="3e+1",m1e=function(){return P2(function(){ia(1,1/0)})&&P2(function(){ia(1,-1/0)})},g1e=function(){return!P2(function(){ia(1/0,1/0),ia(NaN,1/0)})},v1e=!Oz||!m1e()||!g1e();i1e({target:"Number",proto:!0,forced:v1e},{toExponential:function(e){var r=s1e(this);if(e===void 0)return ia(r);var n=a1e(e);if(!u1e(r))return String(r);if(n<0||n>20)throw c1e("Incorrect fraction digits");if(Oz)return ia(r,n);var i="",a="",s=0,o="",c="";if(r<0&&(i="-",r=-r),r===0)s=0,a=p1e("0",n+1);else{var l=l1e(r);s=d1e(l);var u=0,f=WD(10,s-n);u=h1e(r/f),2*r>=(2*u+1)*f&&(u+=1),u>=WD(10,n+1)&&(u/=10,s+=1),a=VD(u)}return n!==0&&(a=KD(a,0,1)+"."+KD(a,1)),s===0?(o="+",c="0"):(o=s>0?"+":"-",c=VD(f1e(s))),a+="e"+o+c,i+a}});var y1e=j,V$=ae,x1e=$t,b1e=sb,E1e=rb,YD=re,S1e=RangeError,Lz=String,Pz=Math.floor,N2=V$(E1e),qD=V$("".slice),kd=V$(1 .toFixed),mu=function(t,e,r){return e===0?r:e%2===1?mu(t,e-1,r*t):mu(t*t,e/2,r)},_1e=function(t){for(var e=0,r=t;r>=4096;)e+=12,r/=4096;for(;r>=2;)e+=1,r/=2;return e},Nc=function(t,e,r){for(var n=-1,i=r;++n<6;)i+=e*t[n],t[n]=i%1e7,i=Pz(i/1e7)},jS=function(t,e){for(var r=6,n=0;--r>=0;)n+=t[r],t[r]=Pz(n/e),n=n%e*1e7},XD=function(t){for(var e=6,r="";--e>=0;)if(r!==""||e===0||t[e]!==0){var n=Lz(t[e]);r=r===""?n:r+N2("0",7-n.length)+n}return r},w1e=YD(function(){return kd(8e-5,3)!=="0.000"||kd(.9,0)!=="1"||kd(1.255,2)!=="1.25"||kd(0xde0b6b3a7640080,0)!=="1000000000000000128"})||!YD(function(){kd({})});y1e({target:"Number",proto:!0,forced:w1e},{toFixed:function(e){var r=b1e(this),n=x1e(e),i=[0,0,0,0,0,0],a="",s="0",o,c,l,u;if(n<0||n>20)throw S1e("Incorrect fraction digits");if(r!=r)return"NaN";if(r<=-1e21||r>=1e21)return Lz(r);if(r<0&&(a="-",r=-r),r>1e-21)if(o=_1e(r*mu(2,69,1))-69,c=o<0?r*mu(2,-o,1):r/mu(2,o,1),c*=4503599627370496,o=52-o,o>0){for(Nc(i,0,c),l=n;l>=7;)Nc(i,1e7,0),l-=7;for(Nc(i,mu(10,l,1),0),l=o-1;l>=23;)jS(i,1<<23),l-=23;jS(i,1<0?(u=s.length,s=a+(u<=n?"0."+N2("0",n-u)+s:qD(s,0,u-n)+"."+qD(s,u-n))):s=a+s,s}});var T1e=j,R1e=ae,QD=re,ZD=sb,Sy=R1e(1 .toPrecision),A1e=QD(function(){return Sy(1,void 0)!=="1"})||!QD(function(){Sy({})});T1e({target:"Number",proto:!0,forced:A1e},{toPrecision:function(e){return e===void 0?Sy(ZD(this)):Sy(ZD(this),e)}});var JD=_e,I1e=ae,$1e=$e,C1e=re,HS=Cp,k1e=Ap,O1e=wp,L1e=We,P1e=Hf,Dc=Object.assign,e3=Object.defineProperty,N1e=I1e([].concat),Nz=!Dc||C1e(function(){if(JD&&Dc({b:1},Dc(e3({},"a",{enumerable:!0,get:function(){e3(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var t={},e={},r=Symbol(),n="abcdefghijklmnopqrst";return t[r]=7,n.split("").forEach(function(i){e[i]=i}),Dc({},t)[r]!=7||HS(Dc({},e)).join("")!=n})?function(e,r){for(var n=L1e(e),i=arguments.length,a=1,s=k1e.f,o=O1e.f;i>a;)for(var c=P1e(arguments[a++]),l=s?N1e(HS(c),s(c)):HS(c),u=l.length,f=0,d;u>f;)d=l[f++],(!JD||$1e(o,c,d))&&(n[d]=c[d]);return n}:Dc,D1e=j,t3=Nz;D1e({target:"Object",stat:!0,arity:2,forced:Object.assign!==t3},{assign:t3});var M1e=j,F1e=_e,B1e=ii;M1e({target:"Object",stat:!0,sham:!F1e},{create:B1e});var U1e=he,j1e=re,r3=x$,ub=!j1e(function(){if(!(r3&&r3<535)){var t=Math.random();__defineSetter__.call(null,t,function(){}),delete U1e[t]}}),H1e=j,z1e=_e,G1e=ub,V1e=It,W1e=We,K1e=pt;z1e&&H1e({target:"Object",proto:!0,forced:G1e},{__defineGetter__:function(e,r){K1e.f(W1e(this),e,{get:V1e(r),enumerable:!0,configurable:!0})}});var Y1e=j,q1e=_e,n3=Fx.f;Y1e({target:"Object",stat:!0,forced:Object.defineProperties!==n3,sham:!q1e},{defineProperties:n3});var X1e=j,Q1e=_e,i3=pt.f;X1e({target:"Object",stat:!0,forced:Object.defineProperty!==i3,sham:!Q1e},{defineProperty:i3});var Z1e=j,J1e=_e,exe=ub,txe=It,rxe=We,nxe=pt;J1e&&Z1e({target:"Object",proto:!0,forced:exe},{__defineSetter__:function(e,r){nxe.f(rxe(this),e,{set:txe(r),enumerable:!0,configurable:!0})}});var ixe=_e,Dz=ae,axe=Cp,sxe=qt,oxe=wp.f,lxe=Dz(oxe),cxe=Dz([].push),a3=function(t){return function(e){for(var r=sxe(e),n=axe(r),i=n.length,a=0,s=[],o;i>a;)o=n[a++],(!ixe||lxe(r,o))&&cxe(s,t?[o,r[o]]:r[o]);return s}},Mz={entries:a3(!0),values:a3(!1)},uxe=j,fxe=Mz.entries;uxe({target:"Object",stat:!0},{entries:function(e){return fxe(e)}});var dxe=j,hxe=Zf,pxe=re,mxe=De,gxe=os.onFreeze,D2=Object.freeze,vxe=pxe(function(){D2(1)});dxe({target:"Object",stat:!0,forced:vxe,sham:!hxe},{freeze:function(e){return D2&&mxe(e)?D2(gxe(e)):e}});var yxe=j,xxe=wa,bxe=gs;yxe({target:"Object",stat:!0},{fromEntries:function(e){var r={};return xxe(e,function(n,i){bxe(r,n,i)},{AS_ENTRIES:!0}),r}});var Exe=j,Sxe=re,_xe=qt,Fz=ar.f,Bz=_e,wxe=!Bz||Sxe(function(){Fz(1)});Exe({target:"Object",stat:!0,forced:wxe,sham:!Bz},{getOwnPropertyDescriptor:function(e,r){return Fz(_xe(e),r)}});var Txe=j,Rxe=_e,Axe=ZI,Ixe=qt,$xe=ar,Cxe=gs;Txe({target:"Object",stat:!0,sham:!Rxe},{getOwnPropertyDescriptors:function(e){for(var r=Ixe(e),n=$xe.f,i=Axe(r),a={},s=0,o,c;i.length>s;)c=n(r,o=i[s++]),c!==void 0&&Cxe(a,o,c);return a}});var kxe=j,Oxe=re,Lxe=Bx.f,Pxe=Oxe(function(){return!Object.getOwnPropertyNames(1)});kxe({target:"Object",stat:!0,forced:Pxe},{getOwnPropertyNames:Lxe});var Nxe=j,Dxe=re,Mxe=We,Uz=si,Fxe=u$,Bxe=Dxe(function(){Uz(1)});Nxe({target:"Object",stat:!0,forced:Bxe,sham:!Fxe},{getPrototypeOf:function(e){return Uz(Mxe(e))}});var Uxe=j,jxe=je;Uxe({target:"Object",stat:!0},{hasOwn:jxe});var jz=Object.is||function(e,r){return e===r?e!==0||1/e===1/r:e!=e&&r!=r},Hxe=j,zxe=jz;Hxe({target:"Object",stat:!0},{is:zxe});var Gxe=j,s3=D$;Gxe({target:"Object",stat:!0,forced:Object.isExtensible!==s3},{isExtensible:s3});var Vxe=j,Wxe=re,Kxe=De,Yxe=Pr,Hz=N$,M2=Object.isFrozen,qxe=Hz||Wxe(function(){M2(1)});Vxe({target:"Object",stat:!0,forced:qxe},{isFrozen:function(e){return!Kxe(e)||Hz&&Yxe(e)=="ArrayBuffer"?!0:M2?M2(e):!1}});var Xxe=j,Qxe=re,Zxe=De,Jxe=Pr,zz=N$,F2=Object.isSealed,ebe=zz||Qxe(function(){F2(1)});Xxe({target:"Object",stat:!0,forced:ebe},{isSealed:function(e){return!Zxe(e)||zz&&Jxe(e)=="ArrayBuffer"?!0:F2?F2(e):!1}});var tbe=j,rbe=We,Gz=Cp,nbe=re,ibe=nbe(function(){Gz(1)});tbe({target:"Object",stat:!0,forced:ibe},{keys:function(e){return Gz(rbe(e))}});var abe=j,sbe=_e,obe=ub,lbe=We,cbe=Ho,ube=si,fbe=ar.f;sbe&&abe({target:"Object",proto:!0,forced:obe},{__lookupGetter__:function(e){var r=lbe(this),n=cbe(e),i;do if(i=fbe(r,n))return i.get;while(r=ube(r))}});var dbe=j,hbe=_e,pbe=ub,mbe=We,gbe=Ho,vbe=si,ybe=ar.f;hbe&&dbe({target:"Object",proto:!0,forced:pbe},{__lookupSetter__:function(e){var r=mbe(this),n=gbe(e),i;do if(i=ybe(r,n))return i.set;while(r=vbe(r))}});var xbe=j,bbe=De,Ebe=os.onFreeze,Sbe=Zf,_be=re,B2=Object.preventExtensions,wbe=_be(function(){B2(1)});xbe({target:"Object",stat:!0,forced:wbe,sham:!Sbe},{preventExtensions:function(e){return B2&&bbe(e)?B2(Ebe(e)):e}});var Tbe=_e,Rbe=sr,o3=De,Abe=We,Ibe=Nt,l3=Object.getPrototypeOf,c3=Object.setPrototypeOf,u3=Object.prototype,f3="__proto__";if(Tbe&&l3&&c3&&!(f3 in u3))try{Rbe(u3,f3,{configurable:!0,get:function(){return l3(Abe(this))},set:function(e){var r=Ibe(this);!o3(e)&&e!==null||!o3(r)||c3(r,e)}})}catch{}var $be=j,Cbe=De,kbe=os.onFreeze,Obe=Zf,Lbe=re,U2=Object.seal,Pbe=Lbe(function(){U2(1)});$be({target:"Object",stat:!0,forced:Pbe,sham:!Obe},{seal:function(e){return U2&&Cbe(e)?U2(kbe(e)):e}});var Nbe=j,Dbe=Sa;Nbe({target:"Object",stat:!0},{setPrototypeOf:Dbe});var Mbe=JI,Fbe=Ea,Bbe=Mbe?{}.toString:function(){return"[object "+Fbe(this)+"]"},Ube=JI,jbe=_t,Hbe=Bbe;Ube||jbe(Object.prototype,"toString",Hbe,{unsafe:!0});var zbe=j,Gbe=Mz.values;zbe({target:"Object",stat:!0},{values:function(e){return Gbe(e)}});var Vbe=j,d3=Iz;Vbe({global:!0,forced:parseFloat!=d3},{parseFloat:d3});var Wbe=j,h3=kz;Wbe({global:!0,forced:parseInt!=h3},{parseInt:h3});var Kbe=TypeError,bs=function(t,e){if(tb)","g");return t.exec("b").groups.a!=="b"||"b".replace(t,"$c")!=="bc"}),vwe=_e,iC=he,Wp=ae,ywe=$p,xwe=Kf,bwe=Nr,Ewe=ms.f,q3=ni,Swe=Gp,X3=Ce,_we=Vp,EG=pb,wwe=iH,Twe=_t,Rwe=re,Awe=je,Iwe=Dt.enforce,$we=qf,Cwe=Me,SG=nC,_G=bG,kwe=Cwe("match"),so=iC.RegExp,au=so.prototype,Owe=iC.SyntaxError,Lwe=Wp(au.exec),Ry=Wp("".charAt),Q3=Wp("".replace),Z3=Wp("".indexOf),Pwe=Wp("".slice),Nwe=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,Fl=/a/g,t_=/a/g,Dwe=new so(Fl)!==Fl,wG=EG.MISSED_STICKY,Mwe=EG.UNSUPPORTED_Y,Fwe=vwe&&(!Dwe||wG||SG||_G||Rwe(function(){return t_[kwe]=!1,so(Fl)!=Fl||so(t_)==t_||so(Fl,"i")!="/a/i"})),Bwe=function(t){for(var e=t.length,r=0,n="",i=!1,a;r<=e;r++){if(a=Ry(t,r),a==="\\"){n+=a+Ry(t,++r);continue}!i&&a==="."?n+="[\\s\\S]":(a==="["?i=!0:a==="]"&&(i=!1),n+=a)}return n},Uwe=function(t){for(var e=t.length,r=0,n="",i=[],a={},s=!1,o=!1,c=0,l="",u;r<=e;r++){if(u=Ry(t,r),u==="\\")u=u+Ry(t,++r);else if(u==="]")s=!1;else if(!s)switch(!0){case u==="[":s=!0;break;case u==="(":Lwe(Nwe,Pwe(t,r+1))&&(r+=2,o=!0),n+=u,c++;continue;case(u===">"&&o):if(l===""||Awe(a,l))throw new Owe("Invalid capture group name");a[l]=!0,i[i.length]=[l,c],o=!1,l="";continue}o?l+=u:n+=u}return[n,i]};if(ywe("RegExp",Fwe)){for(var cl=function(e,r){var n=q3(au,this),i=Swe(e),a=r===void 0,s=[],o=e,c,l,u,f,d,h;if(!n&&i&&a&&e.constructor===cl)return e;if((i||q3(au,e))&&(e=e.source,a&&(r=_we(o))),e=e===void 0?"":X3(e),r=r===void 0?"":X3(r),o=e,SG&&"dotAll"in Fl&&(l=!!r&&Z3(r,"s")>-1,l&&(r=Q3(r,/s/g,""))),c=r,wG&&"sticky"in Fl&&(u=!!r&&Z3(r,"y")>-1,u&&Mwe&&(r=Q3(r,/y/g,""))),_G&&(f=Uwe(e),e=f[0],s=f[1]),d=xwe(so(e,r),n?this:au,cl),(l||u||s.length)&&(h=Iwe(d),l&&(h.dotAll=!0,h.raw=cl(Bwe(e),c)),u&&(h.sticky=!0),s.length&&(h.groups=s)),e!==o)try{bwe(d,"source",o===""?"(?:)":o)}catch{}return d},J3=Ewe(so),e4=0;J3.length>e4;)wwe(cl,so,J3[e4++]);au.constructor=cl,cl.prototype=au,Twe(iC,"RegExp",cl,{constructor:!0})}$we("RegExp");var jwe=_e,Hwe=nC,zwe=Pr,Gwe=sr,Vwe=Dt.get,t4=RegExp.prototype,Wwe=TypeError;jwe&&Hwe&&Gwe(t4,"dotAll",{configurable:!0,get:function(){if(this!==t4){if(zwe(this)==="RegExp")return!!Vwe(this).dotAll;throw Wwe("Incompatible receiver, RegExp required")}}});var vu=$e,mb=ae,Kwe=Ce,Ywe=J$,qwe=pb,Xwe=wo,Qwe=ii,Zwe=Dt.get,Jwe=nC,eTe=bG,tTe=Xwe("native-string-replace",String.prototype.replace),Ay=RegExp.prototype.exec,Q2=Ay,rTe=mb("".charAt),nTe=mb("".indexOf),iTe=mb("".replace),r_=mb("".slice),Z2=function(){var t=/a/,e=/b*/g;return vu(Ay,t,"a"),vu(Ay,e,"a"),t.lastIndex!==0||e.lastIndex!==0}(),TG=qwe.BROKEN_CARET,J2=/()??/.exec("")[1]!==void 0,aTe=Z2||J2||TG||Jwe||eTe;aTe&&(Q2=function(e){var r=this,n=Zwe(r),i=Kwe(e),a=n.raw,s,o,c,l,u,f,d;if(a)return a.lastIndex=r.lastIndex,s=vu(Q2,a,i),r.lastIndex=a.lastIndex,s;var h=n.groups,p=TG&&r.sticky,v=vu(Ywe,r),m=r.source,g=0,y=i;if(p&&(v=iTe(v,"y",""),nTe(v,"g")===-1&&(v+="g"),y=r_(i,r.lastIndex),r.lastIndex>0&&(!r.multiline||r.multiline&&rTe(i,r.lastIndex-1)!==` +`)&&(m="(?: "+m+")",y=" "+y,g++),o=new RegExp("^(?:"+m+")",v)),J2&&(o=new RegExp("^"+m+"$(?!\\s)",v)),Z2&&(c=r.lastIndex),l=vu(Ay,p?o:r,y),p?l?(l.input=r_(l.input,g),l[0]=r_(l[0],g),l.index=r.lastIndex,r.lastIndex+=l[0].length):r.lastIndex=0:Z2&&l&&(r.lastIndex=r.global?l.index+l[0].length:c),J2&&l&&l.length>1&&vu(tTe,l[0],o,function(){for(u=1;u=0?i:n+i;return a<0||a>=n?void 0:UTe(r,a)}});var sC=ae,HTe=$t,zTe=Ce,GTe=Nt,VTe=sC("".charAt),o4=sC("".charCodeAt),WTe=sC("".slice),l4=function(t){return function(e,r){var n=zTe(GTe(e)),i=HTe(r),a=n.length,s,o;return i<0||i>=a?t?"":void 0:(s=o4(n,i),s<55296||s>56319||i+1===a||(o=o4(n,i+1))<56320||o>57343?t?VTe(n,i):s:t?WTe(n,i,i+2):(s-55296<<10)+(o-56320)+65536)}},vb={codeAt:l4(!1),charAt:l4(!0)},KTe=j,YTe=vb.codeAt;KTe({target:"String",proto:!0},{codePointAt:function(e){return YTe(this,e)}});var qTe=Gp,XTe=TypeError,oC=function(t){if(qTe(t))throw XTe("The method doesn't accept regular expressions");return t},QTe=Me,ZTe=QTe("match"),lC=function(t){var e=/./;try{"/./"[t](e)}catch{try{return e[ZTe]=!1,"/./"[t](e)}catch{}}return!1},JTe=j,$G=zo,e2e=ar.f,t2e=wn,c4=Ce,r2e=oC,n2e=Nt,i2e=lC,u4=$G("".endsWith),a2e=$G("".slice),s2e=Math.min,CG=i2e("endsWith"),o2e=!CG&&!!function(){var t=e2e(String.prototype,"endsWith");return t&&!t.writable}();JTe({target:"String",proto:!0,forced:!o2e&&!CG},{endsWith:function(e){var r=c4(n2e(this));r2e(e);var n=arguments.length>1?arguments[1]:void 0,i=r.length,a=n===void 0?i:s2e(t2e(n),i),s=c4(e);return u4?u4(r,s,a):a2e(r,a-s.length,a)===s}});var l2e=j,c2e=ae,u2e=ba,f2e=RangeError,f4=String.fromCharCode,d4=String.fromCodePoint,d2e=c2e([].join),h2e=!!d4&&d4.length!=1;l2e({target:"String",stat:!0,arity:1,forced:h2e},{fromCodePoint:function(e){for(var r=[],n=arguments.length,i=0,a;n>i;){if(a=+arguments[i++],u2e(a,1114111)!==a)throw f2e(a+" is not a valid code point");r[i]=a<65536?f4(a):f4(((a-=65536)>>10)+55296,a%1024+56320)}return d2e(r,"")}});var p2e=j,m2e=ae,g2e=oC,v2e=Nt,h4=Ce,y2e=lC,x2e=m2e("".indexOf);p2e({target:"String",proto:!0,forced:!y2e("includes")},{includes:function(e){return!!~x2e(h4(v2e(this)),h4(g2e(e)),arguments.length>1?arguments[1]:void 0)}});var b2e=vb.charAt,E2e=Ce,kG=Dt,S2e=m$,p4=qx,OG="String Iterator",_2e=kG.set,w2e=kG.getterFor(OG);S2e(String,"String",function(t){_2e(this,{type:OG,string:E2e(t),index:0})},function(){var e=w2e(this),r=e.string,n=e.index,i;return n>=r.length?p4(void 0,!0):(i=b2e(r,n),e.index+=i.length,p4(i,!1))});var m4=zo,g4=_t,T2e=gb,v4=re,LG=Me,R2e=Nr,A2e=LG("species"),n_=RegExp.prototype,yb=function(t,e,r,n){var i=LG(t),a=!v4(function(){var l={};return l[i]=function(){return 7},""[t](l)!=7}),s=a&&!v4(function(){var l=!1,u=/a/;return t==="split"&&(u={},u.constructor={},u.constructor[A2e]=function(){return u},u.flags="",u[i]=/./[i]),u.exec=function(){return l=!0,null},u[i](""),!l});if(!a||!s||r){var o=m4(/./[i]),c=e(i,""[t],function(l,u,f,d,h){var p=m4(l),v=u.exec;return v===T2e||v===n_.exec?a&&!h?{done:!0,value:o(u,f,d)}:{done:!0,value:p(f,u,d)}:{done:!1}});g4(String.prototype,t,c[0]),g4(n_,i,c[1])}n&&R2e(n_[i],"sham",!0)},I2e=vb.charAt,xb=function(t,e,r){return e+(r?I2e(t,e).length:1)},y4=$e,$2e=Ie,C2e=Ne,k2e=Pr,O2e=gb,L2e=TypeError,Kp=function(t,e){var r=t.exec;if(C2e(r)){var n=y4(r,t,e);return n!==null&&$2e(n),n}if(k2e(t)==="RegExp")return y4(O2e,t,e);throw L2e("RegExp#exec called on incompatible receiver")},P2e=$e,N2e=yb,D2e=Ie,M2e=on,F2e=wn,i_=Ce,B2e=Nt,U2e=ps,j2e=xb,x4=Kp;N2e("match",function(t,e,r){return[function(i){var a=B2e(this),s=M2e(i)?void 0:U2e(i,t);return s?P2e(s,i,a):new RegExp(i)[t](i_(a))},function(n){var i=D2e(this),a=i_(n),s=r(e,i,a);if(s.done)return s.value;if(!i.global)return x4(i,a);var o=i.unicode;i.lastIndex=0;for(var c=[],l=0,u;(u=x4(i,a))!==null;){var f=i_(u[0]);c[l]=f,f===""&&(i.lastIndex=j2e(a,F2e(i.lastIndex),o)),l++}return l===0?null:c}]});var H2e=j,z2e=$e,PG=zo,G2e=p$,ag=qx,b4=Nt,NG=wn,E0=Ce,V2e=Ie,W2e=on,K2e=Pr,Y2e=Gp,DG=Vp,q2e=ps,X2e=_t,Q2e=re,Z2e=Me,J2e=Qf,eRe=xb,tRe=Kp,MG=Dt,rRe=VI,Iy=Z2e("matchAll"),FG="RegExp String",BG=FG+" Iterator",nRe=MG.set,iRe=MG.getterFor(BG),E4=RegExp.prototype,aRe=TypeError,eR=PG("".indexOf),$y=PG("".matchAll),a_=!!$y&&!Q2e(function(){$y("a",/./)}),sRe=G2e(function(e,r,n,i){nRe(this,{type:BG,regexp:e,string:r,global:n,unicode:i,done:!1})},FG,function(){var e=iRe(this);if(e.done)return ag(void 0,!0);var r=e.regexp,n=e.string,i=tRe(r,n);return i===null?(e.done=!0,ag(void 0,!0)):e.global?(E0(i[0])===""&&(r.lastIndex=eRe(n,NG(r.lastIndex),e.unicode)),ag(i,!1)):(e.done=!0,ag(i,!1))}),UG=function(t){var e=V2e(this),r=E0(t),n=J2e(e,RegExp),i=E0(DG(e)),a,s,o;return a=new n(n===RegExp?e.source:e,i),s=!!~eR(i,"g"),o=!!~eR(i,"u"),a.lastIndex=NG(e.lastIndex),new sRe(a,r,s,o)};H2e({target:"String",proto:!0,forced:a_},{matchAll:function(e){var r=b4(this),n,i,a,s;if(W2e(e)){if(a_)return $y(r,e)}else{if(Y2e(e)&&(n=E0(b4(DG(e))),!~eR(n,"g")))throw aRe("`.matchAll` does not allow non-global regexes");if(a_)return $y(r,e);if(a=q2e(e,Iy),a===void 0&&rRe&&K2e(e)=="RegExp"&&(a=UG),a)return z2e(a,e,r)}return i=E0(r),s=new RegExp(e,"g"),s[Iy](i)}});Iy in E4||X2e(E4,Iy,UG);var oRe=ds,jG=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(oRe),lRe=j,cRe=L$.end,uRe=jG;lRe({target:"String",proto:!0,forced:uRe},{padEnd:function(e){return cRe(this,e,arguments.length>1?arguments[1]:void 0)}});var fRe=j,dRe=L$.start,hRe=jG;fRe({target:"String",proto:!0,forced:hRe},{padStart:function(e){return dRe(this,e,arguments.length>1?arguments[1]:void 0)}});var pRe=j,HG=ae,mRe=qt,gRe=We,S4=Ce,vRe=Ye,_4=HG([].push),yRe=HG([].join);pRe({target:"String",stat:!0},{raw:function(e){var r=mRe(gRe(e).raw),n=vRe(r);if(!n)return"";for(var i=arguments.length,a=[],s=0;;){if(_4(a,S4(r[s++])),s===n)return yRe(a,"");s]*>)/g,TRe=/\$([$&'`]|\d{1,2})/g,zG=function(t,e,r,n,i,a){var s=r+t.length,o=n.length,c=TRe;return i!==void 0&&(i=ERe(i),c=wRe),_Re(a,c,function(l,u){var f;switch(s_(u,0)){case"$":return"$";case"&":return t;case"`":return o_(e,0,r);case"'":return o_(e,s);case"<":f=i[o_(u,1,-1)];break;default:var d=+u;if(d===0)return l;if(d>o){var h=SRe(d/10);return h===0?l:h<=o?n[h-1]===void 0?s_(u,1):n[h-1]+s_(u,1):l}f=n[d-1]}return f===void 0?"":f})},RRe=ai,w4=$e,bb=ae,ARe=yb,IRe=re,$Re=Ie,CRe=Ne,kRe=on,ORe=$t,LRe=wn,Fc=Ce,PRe=Nt,NRe=xb,DRe=ps,MRe=zG,FRe=Kp,BRe=Me,tR=BRe("replace"),URe=Math.max,jRe=Math.min,HRe=bb([].concat),l_=bb([].push),T4=bb("".indexOf),R4=bb("".slice),zRe=function(t){return t===void 0?t:String(t)},GRe=function(){return"a".replace(/./,"$0")==="$0"}(),A4=function(){return/./[tR]?/./[tR]("a","$0")==="":!1}(),VRe=!IRe(function(){var t=/./;return t.exec=function(){var e=[];return e.groups={a:"7"},e},"".replace(t,"$")!=="7"});ARe("replace",function(t,e,r){var n=A4?"$":"$0";return[function(a,s){var o=PRe(this),c=kRe(a)?void 0:DRe(a,tR);return c?w4(c,a,o,s):w4(e,Fc(o),a,s)},function(i,a){var s=$Re(this),o=Fc(i);if(typeof a=="string"&&T4(a,n)===-1&&T4(a,"$<")===-1){var c=r(e,s,o,a);if(c.done)return c.value}var l=CRe(a);l||(a=Fc(a));var u=s.global;if(u){var f=s.unicode;s.lastIndex=0}for(var d=[];;){var h=FRe(s,o);if(h===null||(l_(d,h),!u))break;var p=Fc(h[0]);p===""&&(s.lastIndex=NRe(o,LRe(s.lastIndex),f))}for(var v="",m=0,g=0;g=m&&(v+=R4(o,m,x)+R,m=x+y.length)}return v+R4(o,m)}]},!VRe||!GRe||A4);var WRe=j,KRe=$e,uC=ae,I4=Nt,YRe=Ne,qRe=on,XRe=Gp,Od=Ce,QRe=ps,ZRe=Vp,JRe=zG,eAe=Me,tAe=eAe("replace"),rAe=TypeError,GG=uC("".indexOf);uC("".replace);var $4=uC("".slice),nAe=Math.max,C4=function(t,e,r){return r>t.length?-1:e===""?r:GG(t,e,r)};WRe({target:"String",proto:!0},{replaceAll:function(e,r){var n=I4(this),i,a,s,o,c,l,u,f,d,h=0,p=0,v="";if(!qRe(e)){if(i=XRe(e),i&&(a=Od(I4(ZRe(e))),!~GG(a,"g")))throw rAe("`.replaceAll` does not allow non-global regexes");if(s=QRe(e,tAe),s)return KRe(s,e,n,r)}for(o=Od(n),c=Od(e),l=YRe(r),l||(r=Od(r)),u=c.length,f=nAe(1,u),h=C4(o,c,0);h!==-1;)d=l?Od(r(c,h,o)):JRe(c,o,h,[],void 0,r),v+=$4(o,p,h)+d,p=h+u,h=C4(o,c,h+f);return p1||"".split(/.?/).length?n=function(i,a){var s=c_(L4(this)),o=a===void 0?D4:a>>>0;if(o===0)return[];if(i===void 0)return[s];if(!mAe(i))return Ld(e,s,i,o);for(var c=[],l=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.unicode?"u":"")+(i.sticky?"y":""),u=0,f=new RegExp(i.source,l+"g"),d,h,p;(d=Ld(bAe,f,s))&&(h=f.lastIndex,!(h>u&&(Uc(c,Pd(s,u,d.index)),d.length>1&&d.index=o)));)f.lastIndex===d.index&&f.lastIndex++;return u===s.length?(p||!wAe(f,""))&&Uc(c,""):Uc(c,Pd(s,u)),c.length>o?P4(c,0,o):c}:"0".split(void 0,0).length?n=function(i,a){return i===void 0&&a===0?[]:Ld(e,this,i,a)}:n=e,[function(a,s){var o=L4(this),c=pAe(a)?void 0:xAe(a,t);return c?Ld(c,a,o,s):Ld(n,c_(o),a,s)},function(i,a){var s=hAe(this),o=c_(i),c=r(n,s,o,a,n!==e);if(c.done)return c.value;var l=gAe(s,RegExp),u=s.unicode,f=(s.ignoreCase?"i":"")+(s.multiline?"m":"")+(s.unicode?"u":"")+(Bc?"g":"y"),d=new l(Bc?"^(?:"+s.source+")":s,f),h=a===void 0?D4:a>>>0;if(h===0)return[];if(o.length===0)return N4(d,o)===null?[o]:[];for(var p=0,v=0,m=[];v1?arguments[1]:void 0,r.length)),i=M4(e);return F4?F4(r,i,n):OAe(r,n,n+i.length)===i}});var NAe=j,DAe=ae,MAe=Nt,B4=$t,FAe=Ce,BAe=DAe("".slice),UAe=Math.max,jAe=Math.min,HAe=!"".substr||"ab".substr(-1)!=="b";NAe({target:"String",proto:!0,forced:HAe},{substr:function(e,r){var n=FAe(MAe(this)),i=n.length,a=B4(e),s,o;return a===1/0&&(a=0),a<0&&(a=UAe(i+a,0)),s=r===void 0?i:B4(r),s<=0||s===1/0?"":(o=jAe(a+s,i),a>=o?"":BAe(n,a,o))}});var zAe=Vf.PROPER,GAe=re,U4=ob,j4="​…᠎",dC=function(t){return GAe(function(){return!!U4[t]()||j4[t]()!==j4||zAe&&U4[t].name!==t})},VAe=j,WAe=Jf.trim,KAe=dC;VAe({target:"String",proto:!0,forced:KAe("trim")},{trim:function(){return WAe(this)}});var YAe=Jf.end,qAe=dC,YG=qAe("trimEnd")?function(){return YAe(this)}:"".trimEnd,XAe=j,H4=YG;XAe({target:"String",proto:!0,name:"trimEnd",forced:"".trimRight!==H4},{trimRight:H4});var QAe=j,z4=YG;QAe({target:"String",proto:!0,name:"trimEnd",forced:"".trimEnd!==z4},{trimEnd:z4});var ZAe=Jf.start,JAe=dC,qG=JAe("trimStart")?function(){return ZAe(this)}:"".trimStart,eIe=j,G4=qG;eIe({target:"String",proto:!0,name:"trimStart",forced:"".trimLeft!==G4},{trimLeft:G4});var tIe=j,V4=qG;tIe({target:"String",proto:!0,name:"trimStart",forced:"".trimStart!==V4},{trimStart:V4});var rIe=ae,nIe=Nt,W4=Ce,iIe=/"/g,aIe=rIe("".replace),Rn=function(t,e,r,n){var i=W4(nIe(t)),a="<"+e;return r!==""&&(a+=" "+r+'="'+aIe(W4(n),iIe,""")+'"'),a+">"+i+""},sIe=re,An=function(t){return sIe(function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3})},oIe=j,lIe=Rn,cIe=An;oIe({target:"String",proto:!0,forced:cIe("anchor")},{anchor:function(e){return lIe(this,"a","name",e)}});var uIe=j,fIe=Rn,dIe=An;uIe({target:"String",proto:!0,forced:dIe("big")},{big:function(){return fIe(this,"big","","")}});var hIe=j,pIe=Rn,mIe=An;hIe({target:"String",proto:!0,forced:mIe("blink")},{blink:function(){return pIe(this,"blink","","")}});var gIe=j,vIe=Rn,yIe=An;gIe({target:"String",proto:!0,forced:yIe("bold")},{bold:function(){return vIe(this,"b","","")}});var xIe=j,bIe=Rn,EIe=An;xIe({target:"String",proto:!0,forced:EIe("fixed")},{fixed:function(){return bIe(this,"tt","","")}});var SIe=j,_Ie=Rn,wIe=An;SIe({target:"String",proto:!0,forced:wIe("fontcolor")},{fontcolor:function(e){return _Ie(this,"font","color",e)}});var TIe=j,RIe=Rn,AIe=An;TIe({target:"String",proto:!0,forced:AIe("fontsize")},{fontsize:function(e){return RIe(this,"font","size",e)}});var IIe=j,$Ie=Rn,CIe=An;IIe({target:"String",proto:!0,forced:CIe("italics")},{italics:function(){return $Ie(this,"i","","")}});var kIe=j,OIe=Rn,LIe=An;kIe({target:"String",proto:!0,forced:LIe("link")},{link:function(e){return OIe(this,"a","href",e)}});var PIe=j,NIe=Rn,DIe=An;PIe({target:"String",proto:!0,forced:DIe("small")},{small:function(){return NIe(this,"small","","")}});var MIe=j,FIe=Rn,BIe=An;MIe({target:"String",proto:!0,forced:BIe("strike")},{strike:function(){return FIe(this,"strike","","")}});var UIe=j,jIe=Rn,HIe=An;UIe({target:"String",proto:!0,forced:HIe("sub")},{sub:function(){return jIe(this,"sub","","")}});var zIe=j,GIe=Rn,VIe=An;zIe({target:"String",proto:!0,forced:VIe("sup")},{sup:function(){return GIe(this,"sup","","")}});var ki={},K4={get exports(){return ki},set exports(t){ki=t}},XG=he,u_=re,WIe=Yx,KIe=Oe.NATIVE_ARRAY_BUFFER_VIEWS,YIe=XG.ArrayBuffer,ul=XG.Int8Array,hC=!KIe||!u_(function(){ul(1)})||!u_(function(){new ul(-1)})||!WIe(function(t){new ul,new ul(null),new ul(1.5),new ul(t)},!0)||u_(function(){return new ul(new YIe(2),1,void 0).length!==1}),qIe=$t,XIe=RangeError,QIe=function(t){var e=qIe(t);if(e<0)throw XIe("The argument can't be less than 0");return e},ZIe=QIe,JIe=RangeError,QG=function(t,e){var r=ZIe(t);if(r%e)throw JIe("Wrong offset");return r},e$e=Ea,ZG=function(t){var e=e$e(t);return e=="BigInt64Array"||e=="BigUint64Array"},t$e=Px,r$e=TypeError,pC=function(t){var e=t$e(t,"number");if(typeof e=="number")throw r$e("Can't convert number to bigint");return BigInt(e)},n$e=Ni,i$e=$e,a$e=C$,s$e=We,o$e=Ye,l$e=Vx,c$e=Mp,u$e=f$,f$e=ZG,d$e=Oe.aTypedArrayConstructor,h$e=pC,JG=function(e){var r=a$e(this),n=s$e(e),i=arguments.length,a=i>1?arguments[1]:void 0,s=a!==void 0,o=c$e(n),c,l,u,f,d,h,p,v;if(o&&!u$e(o))for(p=l$e(n,o),v=p.next,n=[];!(h=i$e(v,p)).done;)n.push(h.value);for(s&&i>2&&(a=n$e(a,arguments[2])),l=o$e(n),u=new(d$e(r))(l),f=f$e(u),c=0;l>c;c++)d=s?a(n[c],c):n[c],u[c]=f?h$e(d):+d;return u},Y4=j,eV=he,q4=$e,p$e=_e,m$e=hC,ed=Oe,tV=Jx,X4=Ta,g$e=ri,Nd=Nr,v$e=z$,y$e=wn,Q4=zH,f_=QG,rV=Ho,Dd=je,x$e=Ea,rR=De,b$e=uc,E$e=ii,S$e=ni,sg=Sa,_$e=ms.f,Z4=JG,w$e=or.forEach,T$e=qf,R$e=sr,nV=pt,iV=ar,mC=Dt,A$e=Kf,nR=mC.get,I$e=mC.set,$$e=mC.enforce,aV=nV.f,C$e=iV.f,k$e=Math.round,d_=eV.RangeError,sV=tV.ArrayBuffer,O$e=sV.prototype,L$e=tV.DataView,og=ed.NATIVE_ARRAY_BUFFER_VIEWS,J4=ed.TYPED_ARRAY_TAG,e8=ed.TypedArray,Md=ed.TypedArrayPrototype,P$e=ed.aTypedArrayConstructor,iR=ed.isTypedArray,lg="BYTES_PER_ELEMENT",h_="Wrong length",t8=function(t,e){P$e(t);for(var r=0,n=e.length,i=new t(n);n>r;)i[r]=e[r++];return i},cg=function(t,e){R$e(t,e,{configurable:!0,get:function(){return nR(this)[e]}})},r8=function(t){var e;return S$e(O$e,t)||(e=x$e(t))=="ArrayBuffer"||e=="SharedArrayBuffer"},oV=function(t,e){return iR(t)&&!b$e(e)&&e in t&&v$e(+e)&&e>=0},n8=function(e,r){return r=rV(r),oV(e,r)?g$e(2,e[r]):C$e(e,r)},i8=function(e,r,n){return r=rV(r),oV(e,r)&&rR(n)&&Dd(n,"value")&&!Dd(n,"get")&&!Dd(n,"set")&&!n.configurable&&(!Dd(n,"writable")||n.writable)&&(!Dd(n,"enumerable")||n.enumerable)?(e[r]=n.value,e):aV(e,r,n)};p$e?(og||(iV.f=n8,nV.f=i8,cg(Md,"buffer"),cg(Md,"byteOffset"),cg(Md,"byteLength"),cg(Md,"length")),Y4({target:"Object",stat:!0,forced:!og},{getOwnPropertyDescriptor:n8,defineProperty:i8}),K4.exports=function(t,e,r){var n=t.match(/\d+/)[0]/8,i=t+(r?"Clamped":"")+"Array",a="get"+t,s="set"+t,o=eV[i],c=o,l=c&&c.prototype,u={},f=function(v,m){var g=nR(v);return g.view[a](m*n+g.byteOffset,!0)},d=function(v,m,g){var y=nR(v);r&&(g=(g=k$e(g))<0?0:g>255?255:g&255),y.view[s](m*n+y.byteOffset,g,!0)},h=function(v,m){aV(v,m,{get:function(){return f(this,m)},set:function(g){return d(this,m,g)},enumerable:!0})};og?m$e&&(c=e(function(v,m,g,y){return X4(v,l),A$e(function(){return rR(m)?r8(m)?y!==void 0?new o(m,f_(g,n),y):g!==void 0?new o(m,f_(g,n)):new o(m):iR(m)?t8(c,m):q4(Z4,c,m):new o(Q4(m))}(),v,c)}),sg&&sg(c,e8),w$e(_$e(o),function(v){v in c||Nd(c,v,o[v])}),c.prototype=l):(c=e(function(v,m,g,y){X4(v,l);var x=0,b=0,_,S,w;if(!rR(m))w=Q4(m),S=w*n,_=new sV(S);else if(r8(m)){_=m,b=f_(g,n);var R=m.byteLength;if(y===void 0){if(R%n||(S=R-b,S<0))throw d_(h_)}else if(S=y$e(y)*n,S+b>R)throw d_(h_);w=S/n}else return iR(m)?t8(c,m):q4(Z4,c,m);for(I$e(v,{buffer:_,byteOffset:b,byteLength:S,length:w,view:new L$e(_)});x=0?i:n+i;return a<0||a>=n?void 0:r[a]});var Y$e=ae,cV=Oe,q$e=vH,X$e=Y$e(q$e),Q$e=cV.aTypedArray,Z$e=cV.exportTypedArrayMethod;Z$e("copyWithin",function(e,r){return X$e(Q$e(this),e,r,arguments.length>2?arguments[2]:void 0)});var uV=Oe,J$e=or.every,eCe=uV.aTypedArray,tCe=uV.exportTypedArrayMethod;tCe("every",function(e){return J$e(eCe(this),e,arguments.length>1?arguments[1]:void 0)});var fV=Oe,rCe=h$,nCe=pC,iCe=Ea,aCe=$e,sCe=ae,oCe=re,lCe=fV.aTypedArray,cCe=fV.exportTypedArrayMethod,uCe=sCe("".slice),fCe=oCe(function(){var t=0;return new Int8Array(2).fill({valueOf:function(){return t++}}),t!==1});cCe("fill",function(e){var r=arguments.length;lCe(this);var n=uCe(iCe(this),0,3)==="Big"?nCe(e):+e;return aCe(rCe,this,n,r>1?arguments[1]:void 0,r>2?arguments[2]:void 0)},fCe);var dV=Oe,dCe=Qf,hCe=dV.aTypedArrayConstructor,pCe=dV.getTypedArrayConstructor,Eb=function(t){return hCe(dCe(t,pCe(t)))},mCe=E$,gCe=Eb,vCe=function(t,e){return mCe(gCe(t),e)},hV=Oe,yCe=or.filter,xCe=vCe,bCe=hV.aTypedArray,ECe=hV.exportTypedArrayMethod;ECe("filter",function(e){var r=yCe(bCe(this),e,arguments.length>1?arguments[1]:void 0);return xCe(this,r)});var pV=Oe,SCe=or.find,_Ce=pV.aTypedArray,wCe=pV.exportTypedArrayMethod;wCe("find",function(e){return SCe(_Ce(this),e,arguments.length>1?arguments[1]:void 0)});var mV=Oe,TCe=or.findIndex,RCe=mV.aTypedArray,ACe=mV.exportTypedArrayMethod;ACe("findIndex",function(e){return TCe(RCe(this),e,arguments.length>1?arguments[1]:void 0)});var gV=Oe,ICe=Kx.findLast,$Ce=gV.aTypedArray,CCe=gV.exportTypedArrayMethod;CCe("findLast",function(e){return ICe($Ce(this),e,arguments.length>1?arguments[1]:void 0)});var vV=Oe,kCe=Kx.findLastIndex,OCe=vV.aTypedArray,LCe=vV.exportTypedArrayMethod;LCe("findLastIndex",function(e){return kCe(OCe(this),e,arguments.length>1?arguments[1]:void 0)});var yV=Oe,PCe=or.forEach,NCe=yV.aTypedArray,DCe=yV.exportTypedArrayMethod;DCe("forEach",function(e){PCe(NCe(this),e,arguments.length>1?arguments[1]:void 0)});var MCe=hC,FCe=Oe.exportTypedArrayStaticMethod,BCe=JG;FCe("from",BCe,MCe);var xV=Oe,UCe=Rp.includes,jCe=xV.aTypedArray,HCe=xV.exportTypedArrayMethod;HCe("includes",function(e){return UCe(jCe(this),e,arguments.length>1?arguments[1]:void 0)});var bV=Oe,zCe=Rp.indexOf,GCe=bV.aTypedArray,VCe=bV.exportTypedArrayMethod;VCe("indexOf",function(e){return zCe(GCe(this),e,arguments.length>1?arguments[1]:void 0)});var WCe=he,KCe=re,gC=ae,EV=Oe,vC=LH,YCe=Me,yC=YCe("iterator"),a8=WCe.Uint8Array,qCe=gC(vC.values),XCe=gC(vC.keys),QCe=gC(vC.entries),xC=EV.aTypedArray,Sb=EV.exportTypedArrayMethod,su=a8&&a8.prototype,_b=!KCe(function(){su[yC].call([1])}),SV=!!su&&su.values&&su[yC]===su.values&&su.values.name==="values",_V=function(){return qCe(xC(this))};Sb("entries",function(){return QCe(xC(this))},_b);Sb("keys",function(){return XCe(xC(this))},_b);Sb("values",_V,_b||!SV,{name:"values"});Sb(yC,_V,_b||!SV,{name:"values"});var wV=Oe,ZCe=ae,JCe=wV.aTypedArray,eke=wV.exportTypedArrayMethod,tke=ZCe([].join);eke("join",function(e){return tke(JCe(this),e)});var TV=Oe,rke=ai,nke=NH,ike=TV.aTypedArray,ake=TV.exportTypedArrayMethod;ake("lastIndexOf",function(e){var r=arguments.length;return rke(nke,ike(this),r>1?[e,arguments[1]]:[e])});var RV=Oe,ske=or.map,oke=Eb,lke=RV.aTypedArray,cke=RV.exportTypedArrayMethod;cke("map",function(e){return ske(lke(this),e,arguments.length>1?arguments[1]:void 0,function(r,n){return new(oke(r))(n)})});var AV=Oe,uke=hC,fke=AV.aTypedArrayConstructor,dke=AV.exportTypedArrayStaticMethod;dke("of",function(){for(var e=0,r=arguments.length,n=new(fke(this))(r);r>e;)n[e]=arguments[e++];return n},uke);var IV=Oe,hke=Xx.left,pke=IV.aTypedArray,mke=IV.exportTypedArrayMethod;mke("reduce",function(e){var r=arguments.length;return hke(pke(this),e,r,r>1?arguments[1]:void 0)});var $V=Oe,gke=Xx.right,vke=$V.aTypedArray,yke=$V.exportTypedArrayMethod;yke("reduceRight",function(e){var r=arguments.length;return gke(vke(this),e,r,r>1?arguments[1]:void 0)});var CV=Oe,xke=CV.aTypedArray,bke=CV.exportTypedArrayMethod,Eke=Math.floor;bke("reverse",function(){for(var e=this,r=xke(e).length,n=Eke(r/2),i=0,a;i1?arguments[1]:void 0,1),n=wke(e);if(sR)return OV(PV,this,n,r);var i=this.length,a=Ske(n),s=0;if(a+r>i)throw Tke("Wrong length");for(;sa;)o[a]=n[a++];return o},Pke);var DV=Oe,Nke=or.some,Dke=DV.aTypedArray,Mke=DV.exportTypedArrayMethod;Mke("some",function(e){return Nke(Dke(this),e,arguments.length>1?arguments[1]:void 0)});var Fke=he,Bke=zo,oR=re,Uke=It,jke=y$,MV=Oe,o8=MH,Hke=FH,l8=hs,c8=x$,zke=MV.aTypedArray,Gke=MV.exportTypedArrayMethod,S0=Fke.Uint16Array,Lu=S0&&Bke(S0.prototype.sort),Vke=!!Lu&&!(oR(function(){Lu(new S0(2),null)})&&oR(function(){Lu(new S0(2),{})})),u8=!!Lu&&!oR(function(){if(l8)return l8<74;if(o8)return o8<67;if(Hke)return!0;if(c8)return c8<602;var t=new S0(516),e=Array(516),r,n;for(r=0;r<516;r++)n=r%4,t[r]=515-r,e[r]=r-2*n+3;for(Lu(t,function(i,a){return(i/4|0)-(a/4|0)}),r=0;r<516;r++)if(t[r]!==e[r])return!0}),Wke=function(t){return function(e,r){return t!==void 0?+t(e,r)||0:r!==r?-1:e!==e?1:e===0&&r===0?1/e>0&&1/r<0?1:-1:e>r}};Gke("sort",function(e){return e!==void 0&&Uke(e),u8?Lu(this,e):jke(zke(this),Wke(e))},!u8||Vke);var FV=Oe,Kke=wn,f8=ba,Yke=Eb,qke=FV.aTypedArray,Xke=FV.exportTypedArrayMethod;Xke("subarray",function(e,r){var n=qke(this),i=n.length,a=f8(e,i),s=Yke(n);return new s(n.buffer,n.byteOffset+a*n.BYTES_PER_ELEMENT,Kke((r===void 0?i:f8(r,i))-a))});var Qke=he,Zke=ai,BV=Oe,lR=re,d8=dc,Cy=Qke.Int8Array,h8=BV.aTypedArray,Jke=BV.exportTypedArrayMethod,UV=[].toLocaleString,eOe=!!Cy&&lR(function(){UV.call(new Cy(1))}),tOe=lR(function(){return[1,2].toLocaleString()!=new Cy([1,2]).toLocaleString()})||!lR(function(){Cy.prototype.toLocaleString.call([1,2])});Jke("toLocaleString",function(){return Zke(UV,eOe?d8(h8(this)):h8(this),d8(arguments))},tOe);var rOe=jH,EC=Oe,nOe=EC.aTypedArray,iOe=EC.exportTypedArrayMethod,aOe=EC.getTypedArrayConstructor;iOe("toReversed",function(){return rOe(nOe(this),aOe(this))});var wb=Oe,sOe=ae,oOe=It,lOe=E$,cOe=wb.aTypedArray,uOe=wb.getTypedArrayConstructor,fOe=wb.exportTypedArrayMethod,dOe=sOe(wb.TypedArrayPrototype.sort);fOe("toSorted",function(e){e!==void 0&&oOe(e);var r=cOe(this),n=lOe(uOe(r),r);return dOe(n,e)});var hOe=Oe.exportTypedArrayMethod,pOe=re,mOe=he,gOe=ae,p8=mOe.Uint8Array,vOe=p8&&p8.prototype||{},ky=[].toString,yOe=gOe([].join);pOe(function(){ky.call({})})&&(ky=function(){return yOe(this)});var xOe=vOe.toString!=ky;hOe("toString",ky,xOe);var bOe=HH,SC=Oe,EOe=ZG,SOe=$t,_Oe=pC,wOe=SC.aTypedArray,TOe=SC.getTypedArrayConstructor,ROe=SC.exportTypedArrayMethod,AOe=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(t){return t===8}}();ROe("with",function(t,e){var r=wOe(this),n=SOe(t),i=EOe(r)?_Oe(e):+e;return bOe(r,TOe(r),n,i)},!AOe);var IOe=j,_C=ae,$Oe=Ce,m8=String.fromCharCode,g8=_C("".charAt),v8=_C(/./.exec),y8=_C("".slice),COe=/^[\da-f]{2}$/i,kOe=/^[\da-f]{4}$/i;IOe({global:!0},{unescape:function(e){for(var r=$Oe(e),n="",i=r.length,a=0,s,o;a>(-2*a&6))));return n}});var dLe=j,hLe=he,tW=ht,rW=ae,pLe=$e,nW=re,C8=Ce,mLe=bs,gLe=ZV.itoc,Kl=tW("btoa"),k8=rW("".charAt),vLe=rW("".charCodeAt),O8=!!Kl&&!nW(function(){Kl()}),L8=!!Kl&&nW(function(){return Kl(null)!=="bnVsbA=="}),P8=!!Kl&&Kl.length!==1;dLe({global:!0,bind:!0,enumerable:!0,forced:O8||L8||P8},{btoa:function(e){if(mLe(arguments.length,1),O8||L8||P8)return pLe(Kl,hLe,C8(e));for(var r=C8(e),n="",i=0,a=gLe,s,o;k8(r,i)||(a="=",i%1);){if(o=vLe(r,i+=3/4),o>255)throw new(tW("DOMException"))("The string contains characters outside of the Latin1 range","InvalidCharacterError");s=s<<8|o,n+=k8(a,63&s>>8-i%1*8)}return n}});var iW={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},yLe=Nx,v_=yLe("span").classList,N8=v_&&v_.constructor&&v_.constructor.prototype,aW=N8===Object.prototype?void 0:N8,D8=he,M8=iW,xLe=aW,y_=SH,bLe=Nr,sW=function(t){if(t&&t.forEach!==y_)try{bLe(t,"forEach",y_)}catch{t.forEach=y_}};for(var x_ in M8)M8[x_]&&sW(D8[x_]&&D8[x_].prototype);sW(xLe);var F8=he,oW=iW,ELe=aW,vh=LH,b_=Nr,lW=Me,E_=lW("iterator"),B8=lW("toStringTag"),S_=vh.values,cW=function(t,e){if(t){if(t[E_]!==S_)try{b_(t,E_,S_)}catch{t[E_]=S_}if(t[B8]||b_(t,B8,e),oW[e]){for(var r in vh)if(t[r]!==vh[r])try{b_(t,r,vh[r])}catch{t[r]=vh[r]}}}};for(var __ in oW)cW(F8[__]&&F8[__].prototype,__);cW(ELe,"DOMTokenList");var SLe=ys,_Le=function(t){try{if(SLe)return Function('return require("'+t+'")')()}catch{}},uW={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}},wLe=j,TLe=_Le,Oy=ht,IC=re,RLe=ii,$C=ri,Ly=pt.f,ALe=_t,Ov=sr,Lv=je,ILe=Ta,$Le=Ie,fW=hH,U8=Np,Pu=uW,CLe=l$,dW=Dt,CC=_e,df="DOMException",cR="DATA_CLONE_ERR",Tb=Oy("Error"),cs=Oy(df)||function(){try{var t=Oy("MessageChannel")||TLe("worker_threads").MessageChannel;new t().port1.postMessage(new WeakMap)}catch(e){if(e.name==cR&&e.code==25)return e.constructor}}(),kLe=cs&&cs.prototype,hW=Tb.prototype,OLe=dW.set,LLe=dW.getterFor(df),PLe="stack"in Tb(df),pW=function(t){return Lv(Pu,t)&&Pu[t].m?Pu[t].c:0},kC=function(){ILe(this,Mh);var e=arguments.length,r=U8(e<1?void 0:arguments[0]),n=U8(e<2?void 0:arguments[1],"Error"),i=pW(n);if(OLe(this,{type:df,name:n,message:r,code:i}),CC||(this.name=n,this.message=r,this.code=i),PLe){var a=Tb(r);a.name=df,Ly(this,"stack",$C(1,CLe(a.stack,1)))}},Mh=kC.prototype=RLe(hW),mW=function(t){return{enumerable:!0,configurable:!0,get:t}},w_=function(t){return mW(function(){return LLe(this)[t]})};CC&&(Ov(Mh,"code",w_("code")),Ov(Mh,"message",w_("message")),Ov(Mh,"name",w_("name")));Ly(Mh,"constructor",$C(1,kC));var Rb=IC(function(){return!(new cs instanceof Tb)}),NLe=Rb||IC(function(){return hW.toString!==fW||String(new cs(1,2))!=="2: 1"}),DLe=Rb||IC(function(){return new cs(1,"DataCloneError").code!==25});Rb||cs[cR]!==25||kLe[cR];var j8=Rb;wLe({global:!0,constructor:!0,forced:j8},{DOMException:j8?kC:cs});var _0=Oy(df),Py=_0.prototype;NLe&&cs===_0&&ALe(Py,"toString",fW);DLe&&CC&&cs===_0&&Ov(Py,"code",mW(function(){return pW($Le(this).name)}));for(var H8 in Pu)if(Lv(Pu,H8)){var z8=Pu[H8],vg=z8.s,G8=$C(6,z8.c);Lv(_0,vg)||Ly(_0,vg,G8),Lv(Py,vg)||Ly(Py,vg,G8)}var MLe=j,FLe=he,OC=ht,uR=ri,fR=pt.f,V8=je,BLe=Ta,ULe=Kf,W8=Np,T_=uW,jLe=l$,HLe=_e,Xp="DOMException",gW=OC("Error"),Qp=OC(Xp),LC=function(){BLe(this,zLe);var e=arguments.length,r=W8(e<1?void 0:arguments[0]),n=W8(e<2?void 0:arguments[1],"Error"),i=new Qp(r,n),a=gW(r);return a.name=Xp,fR(i,"stack",uR(1,jLe(a.stack,1))),ULe(i,this,LC),i},zLe=LC.prototype=Qp.prototype,GLe="stack"in gW(Xp),VLe="stack"in new Qp(1,2),R_=Qp&&HLe&&Object.getOwnPropertyDescriptor(FLe,Xp),WLe=!!R_&&!(R_.writable&&R_.configurable),K8=GLe&&!WLe&&!VLe;MLe({global:!0,constructor:!0,forced:K8},{DOMException:K8?LC:Qp});var yh=OC(Xp),Y8=yh.prototype;if(Y8.constructor!==yh){fR(Y8,"constructor",uR(1,yh));for(var q8 in T_)if(V8(T_,q8)){var X8=T_[q8],Q8=X8.s;V8(yh,Q8)||fR(yh,Q8,uR(6,X8.c))}}var KLe=ht,YLe=Tn,Z8="DOMException";YLe(KLe(Z8),Z8);var qLe=j,XLe=he,J8=fb.clear;qLe({global:!0,bind:!0,enumerable:!0,forced:XLe.clearImmediate!==J8},{clearImmediate:J8});var QLe=typeof Bun=="function"&&Bun&&typeof Bun.version=="string",vW=he,ZLe=ai,JLe=Ne,ePe=QLe,tPe=ds,rPe=dc,nPe=bs,iPe=vW.Function,aPe=/MSIE .\./.test(tPe)||ePe&&function(){var t=vW.Bun.version.split(".");return t.length<3||t[0]==0&&(t[1]<3||t[1]==3&&t[2]==0)}(),PC=function(t,e){var r=e?2:1;return aPe?function(n,i){var a=nPe(arguments.length,1)>r,s=JLe(n)?n:iPe(n),o=a?rPe(arguments,r):[],c=a?function(){ZLe(s,this,o)}:s;return e?t(c,i):t(c)}:t},sPe=j,yW=he,eM=fb.set,oPe=PC,tM=yW.setImmediate?oPe(eM,!1):eM;sPe({global:!0,bind:!0,enumerable:!0,forced:yW.setImmediate!==tM},{setImmediate:tM});var lPe=j,cPe=he,uPe=qz,fPe=It,dPe=bs,hPe=ys,pPe=cPe.process;lPe({global:!0,enumerable:!0,dontCallGetSet:!0},{queueMicrotask:function(e){dPe(arguments.length,1),fPe(e);var r=hPe&&pPe.domain;uPe(r?r.bind(e):e)}});var mPe=j,Bs=he,gPe=sr,vPe=_e,yPe=TypeError,xPe=Object.defineProperty,rM=Bs.self!==Bs;try{if(vPe){var A_=Object.getOwnPropertyDescriptor(Bs,"self");(rM||!A_||!A_.get||!A_.enumerable)&&gPe(Bs,"self",{get:function(){return Bs},set:function(e){if(this!==Bs)throw yPe("Illegal invocation");xPe(Bs,"self",{value:e,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}else mPe({global:!0,simple:!0,forced:rM},{self:Bs})}catch{}var yg=ae,Bd=Map.prototype,bPe={Map,set:yg(Bd.set),get:yg(Bd.get),has:yg(Bd.has),remove:yg(Bd.delete),proto:Bd},I_=ae,xg=Set.prototype,EPe={Set,add:I_(xg.add),has:I_(xg.has),remove:I_(xg.delete),proto:xg},SPe=he,_Pe=re,$_=hs,wPe=Xz,TPe=K$,RPe=ys,nM=SPe.structuredClone,APe=!!nM&&!_Pe(function(){if(TPe&&$_>92||RPe&&$_>94||wPe&&$_>97)return!1;var t=new ArrayBuffer(8),e=nM(t,{transfer:[t]});return t.byteLength!=0||e.byteLength!=8}),IPe=j,yt=he,NC=ht,Zp=ae,DC=re,$Pe=Gf,Pv=Ne,CPe=Wf,kPe=on,dR=De,OPe=uc,LPe=wa,xW=Ie,bW=Ea,PPe=je,NPe=gs,C_=Nr,Nv=Ye,DPe=bs,MPe=Vp,Ab=bPe,EW=EPe,FPe=lH,SW=APe,xh=yt.Object,BPe=yt.Array,_W=yt.Date,Jp=yt.Error,UPe=yt.EvalError,jPe=yt.RangeError,HPe=yt.ReferenceError,zPe=yt.SyntaxError,wW=yt.TypeError,GPe=yt.URIError,VPe=yt.PerformanceMark,hf=yt.WebAssembly,WPe=hf&&hf.CompileError||Jp,KPe=hf&&hf.LinkError||Jp,YPe=hf&&hf.RuntimeError||Jp,Yl=NC("DOMException"),hR=Ab.Map,TW=Ab.has,qPe=Ab.get,Ny=Ab.set,XPe=EW.Set,QPe=EW.add,ZPe=NC("Object","keys"),JPe=Zp([].push),eNe=Zp((!0).valueOf),tNe=Zp(1 .valueOf),rNe=Zp("".valueOf),nNe=Zp(_W.prototype.getTime),pR=$Pe("structuredClone"),w0="DataCloneError",bg="Transferring",RW=function(t){return!DC(function(){var e=new yt.Set([7]),r=t(e),n=t(xh(7));return r==e||!r.has(7)||typeof n!="object"||n!=7})&&t},iM=function(t,e){return!DC(function(){var r=new e,n=t({a:r,b:r});return!(n&&n.a===n.b&&n.a instanceof e&&n.a.stack===r.stack)})},iNe=function(t){return!DC(function(){var e=t(new yt.AggregateError([1],pR,{cause:3}));return e.name!="AggregateError"||e.errors[0]!=1||e.message!=pR||e.cause!=3})},Nu=yt.structuredClone,aNe=!iM(Nu,Jp)||!iM(Nu,Yl)||!iNe(Nu),sNe=!Nu&&RW(function(t){return new VPe(pR,{detail:t}).detail}),Os=RW(Nu)||sNe,k_=function(t){throw new Yl("Uncloneable type: "+t,w0)},hr=function(t,e){throw new Yl((e||"Cloning")+" of "+t+" cannot be properly polyfilled in this engine",w0)},oNe=function(){var t;try{t=new yt.DataTransfer}catch{try{t=new yt.ClipboardEvent("").clipboardData}catch{}}return t&&t.items&&t.files?t:null},dr=function(t,e){if(OPe(t)&&k_("Symbol"),!dR(t))return t;if(e){if(TW(e,t))return qPe(e,t)}else e=new hR;var r=bW(t),n=!1,i,a,s,o,c,l,u,f,d,h,p;switch(r){case"Array":s=BPe(Nv(t)),n=!0;break;case"Object":s={},n=!0;break;case"Map":s=new hR,n=!0;break;case"Set":s=new XPe,n=!0;break;case"RegExp":s=new RegExp(t.source,MPe(t));break;case"Error":switch(a=t.name,a){case"AggregateError":s=NC("AggregateError")([]);break;case"EvalError":s=UPe();break;case"RangeError":s=jPe();break;case"ReferenceError":s=HPe();break;case"SyntaxError":s=zPe();break;case"TypeError":s=wW();break;case"URIError":s=GPe();break;case"CompileError":s=WPe();break;case"LinkError":s=KPe();break;case"RuntimeError":s=YPe();break;default:s=Jp()}n=!0;break;case"DOMException":s=new Yl(t.message,t.name),n=!0;break;case"DataView":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":i=yt[r],dR(i)||hr(r),s=new i(dr(t.buffer,e),t.byteOffset,r==="DataView"?t.byteLength:t.length);break;case"DOMQuad":try{s=new DOMQuad(dr(t.p1,e),dr(t.p2,e),dr(t.p3,e),dr(t.p4,e))}catch{Os?s=Os(t):hr(r)}break;case"FileList":if(o=oNe(),o){for(c=0,l=Nv(t);c1&&!kPe(arguments[1])?xW(arguments[1]):void 0,n=r?r.transfer:void 0,i;return n!==void 0&&(i=new hR,lNe(n,i)),dr(e,i)}});var cNe=j,AW=he,uNe=PC,aM=uNe(AW.setInterval,!0);cNe({global:!0,bind:!0,forced:AW.setInterval!==aM},{setInterval:aM});var fNe=j,IW=he,dNe=PC,sM=dNe(IW.setTimeout,!0);fNe({global:!0,bind:!0,forced:IW.setTimeout!==sM},{setTimeout:sM});var hNe=re,pNe=Me,mNe=_e,oM=VI,gNe=pNe("iterator"),MC=!hNe(function(){var t=new URL("b?a=1&b=2&c=3","http://a"),e=t.searchParams,r="";return t.pathname="c%20d",e.forEach(function(n,i){e.delete("b"),r+=i+n}),oM&&!t.toJSON||!e.size&&(oM||!mNe)||!e.sort||t.href!=="http://a/c%20d?a=1&c=3"||e.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!e[gNe]||new URL("https://a@b").username!=="a"||new URLSearchParams(new URLSearchParams("a=b")).get("a")!=="b"||new URL("http://тест").host!=="xn--e1aybc"||new URL("http://a#б").hash!=="#%D0%B1"||r!=="a1c3"||new URL("http://x",void 0).host!=="x"}),pc=ae,O_=2147483647,Fh=36,$W=1,mR=26,vNe=38,yNe=700,xNe=72,bNe=128,ENe="-",SNe=/[^\0-\u007E]/,CW=/[.\u3002\uFF0E\uFF61]/g,lM="Overflow: input needs wider integers to process",L_=Fh-$W,cM=RangeError,_Ne=pc(CW.exec),yu=Math.floor,P_=String.fromCharCode,uM=pc("".charCodeAt),kW=pc([].join),Qs=pc([].push),wNe=pc("".replace),TNe=pc("".split),RNe=pc("".toLowerCase),ANe=function(t){for(var e=[],r=0,n=t.length;r=55296&&i<=56319&&r>1,t+=yu(t/e);t>L_*mR>>1;)t=yu(t/L_),n+=Fh;return yu(n+(L_+1)*t/(t+vNe))},$Ne=function(t){var e=[];t=ANe(t);var r=t.length,n=bNe,i=0,a=xNe,s,o;for(s=0;s=n&&oyu((O_-i)/f))throw cM(lM);for(i+=(u-n)*f,n=u,s=0;sO_)throw cM(lM);if(o==n){for(var d=i,h=Fh;;){var p=h<=a?$W:h>=a+mR?mR:h-a;if(d0?arguments[0]:void 0,r=MW(this,new BW(e));Du||(this.length=r.entries.length)},mf=Ib.prototype;ONe(mf,{append:function(e,r){jc(arguments.length,2);var n=Un(this);Rl(n.entries,{key:vn(e),value:vn(r)}),Du||this.length++,n.updateURL()},delete:function(t){jc(arguments.length,1);for(var e=Un(this),r=e.entries,n=vn(t),i=0;in.key?1:-1}),e.updateURL()},forEach:function(e){for(var r=Un(this).entries,n=DNe(e,arguments.length>1?arguments[1]:void 0),i=0,a;i1?EM(arguments[1]):{})}}),N_(Dy)){var F_=function(e){return PW(this,D_),new Dy(e,arguments.length>1?EM(arguments[1]):{})};D_.constructor=F_,F_.prototype=D_,gR({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:F_})}}var sDe={URLSearchParams:Ib,getState:Un},oDe=j,UC=_e,lDe=MC,jC=he,SM=Ni,oi=ae,My=_t,Ln=sr,cDe=Ta,xR=je,HC=Nz,Hc=_H,mi=kp,uDe=vb.codeAt,fDe=CNe,Da=Ce,dDe=Tn,hDe=bs,UW=sDe,jW=Dt,pDe=jW.set,Fy=jW.getterFor("URL"),mDe=UW.URLSearchParams,gDe=UW.getState,Ud=jC.URL,bR=jC.TypeError,By=jC.parseInt,vDe=Math.floor,_M=Math.pow,Hn=oi("".charAt),_i=oi(/./.exec),bh=oi([].join),yDe=oi(1 .toString),xDe=oi([].pop),lu=oi([].push),B_=oi("".replace),bDe=oi([].shift),EDe=oi("".split),Uh=oi("".slice),Uy=oi("".toLowerCase),SDe=oi([].unshift),_De="Invalid authority",U_="Invalid scheme",fl="Invalid host",wM="Invalid port",HW=/[a-z]/i,wDe=/[\d+-.a-z]/i,ER=/\d/,TDe=/^0x/i,RDe=/^[0-7]+$/,ADe=/^\d+$/,zW=/^[\da-f]+$/i,IDe=/[\0\t\n\r #%/:<>?@[\\\]^|]/,$De=/[\0\t\n\r #/:<>?@[\\\]^|]/,CDe=/^[\u0000-\u0020]+/,kDe=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,ODe=/[\t\n\r]/g,Pn,LDe=function(t){var e=EDe(t,"."),r,n,i,a,s,o,c;if(e.length&&e[e.length-1]==""&&e.length--,r=e.length,r>4)return t;for(n=[],i=0;i1&&Hn(a,0)=="0"&&(s=_i(TDe,a)?16:8,a=Uh(a,s==8?1:2)),a==="")o=0;else{if(!_i(s==10?ADe:s==8?RDe:zW,a))return t;o=By(a,s)}lu(n,o)}for(i=0;i=_M(256,5-r))return null}else if(o>255)return null;for(c=xDe(n),i=0;i6))return;for(o=0;d();){if(c=null,o>0)if(d()=="."&&o<4)i++;else return;if(!_i(ER,d()))return;for(;_i(ER,d());){if(l=By(d(),10),c===null)c=l;else{if(c==0)return;c=c*10+l}if(c>255)return;i++}e[r]=e[r]*256+c,o++,(o==2||o==4)&&r++}if(o!=4)return;break}else if(d()==":"){if(i++,!d())return}else if(d())return;e[r++]=a}if(n!==null)for(u=r-n,r=7;r!=0&&u>0;)f=e[r],e[r--]=e[n+u-1],e[n+--u]=f;else if(r!=8)return;return e},NDe=function(t){for(var e=null,r=1,n=null,i=0,a=0;a<8;a++)t[a]!==0?(i>r&&(e=n,r=i),n=null,i=0):(n===null&&(n=a),++i);return i>r&&(e=n,r=i),e},jd=function(t){var e,r,n,i;if(typeof t=="number"){for(e=[],r=0;r<4;r++)SDe(e,t%256),t=vDe(t/256);return bh(e,".")}else if(typeof t=="object"){for(e="",n=NDe(t),r=0;r<8;r++)i&&t[r]===0||(i&&(i=!1),n===r?(e+=r?":":"::",i=!0):(e+=yDe(t[r],16),r<7&&(e+=":")));return"["+e+"]"}return t},Dv={},GW=HC({},Dv,{" ":1,'"':1,"<":1,">":1,"`":1}),VW=HC({},GW,{"#":1,"?":1,"{":1,"}":1}),j_=HC({},VW,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Ls=function(t,e){var r=uDe(t,0);return r>32&&r<127&&!xR(e,t)?t:encodeURIComponent(t)},Sg={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Eh=function(t,e){var r;return t.length==2&&_i(HW,Hn(t,0))&&((r=Hn(t,1))==":"||!e&&r=="|")},TM=function(t){var e;return t.length>1&&Eh(Uh(t,0,2))&&(t.length==2||(e=Hn(t,2))==="/"||e==="\\"||e==="?"||e==="#")},DDe=function(t){return t==="."||Uy(t)==="%2e"},MDe=function(t){return t=Uy(t),t===".."||t==="%2e."||t===".%2e"||t==="%2e%2e"},H_={},RM={},z_={},AM={},IM={},G_={},$M={},CM={},_g={},wg={},V_={},W_={},K_={},Y_={},kM={},q_={},zc={},Ki={},OM={},dl={},Ca={},zC=function(t,e,r){var n=Da(t),i,a,s;if(e){if(a=this.parse(n),a)throw bR(a);this.searchParams=null}else{if(r!==void 0&&(i=new zC(r,!0)),a=this.parse(n,null,i),a)throw bR(a);s=gDe(new mDe),s.bindURL(this),this.searchParams=s}};zC.prototype={type:"URL",parse:function(t,e,r){var n=this,i=e||H_,a=0,s="",o=!1,c=!1,l=!1,u,f,d,h;for(t=Da(t),e||(n.scheme="",n.username="",n.password="",n.host=null,n.port=null,n.path=[],n.query=null,n.fragment=null,n.cannotBeABaseURL=!1,t=B_(t,CDe,""),t=B_(t,kDe,"$1")),t=B_(t,ODe,""),u=Hc(t);a<=u.length;){switch(f=u[a],i){case H_:if(f&&_i(HW,f))s+=Uy(f),i=RM;else{if(e)return U_;i=z_;continue}break;case RM:if(f&&(_i(wDe,f)||f=="+"||f=="-"||f=="."))s+=Uy(f);else if(f==":"){if(e&&(n.isSpecial()!=xR(Sg,s)||s=="file"&&(n.includesCredentials()||n.port!==null)||n.scheme=="file"&&!n.host))return;if(n.scheme=s,e){n.isSpecial()&&Sg[n.scheme]==n.port&&(n.port=null);return}s="",n.scheme=="file"?i=Y_:n.isSpecial()&&r&&r.scheme==n.scheme?i=AM:n.isSpecial()?i=CM:u[a+1]=="/"?(i=IM,a++):(n.cannotBeABaseURL=!0,lu(n.path,""),i=OM)}else{if(e)return U_;s="",i=z_,a=0;continue}break;case z_:if(!r||r.cannotBeABaseURL&&f!="#")return U_;if(r.cannotBeABaseURL&&f=="#"){n.scheme=r.scheme,n.path=mi(r.path),n.query=r.query,n.fragment="",n.cannotBeABaseURL=!0,i=Ca;break}i=r.scheme=="file"?Y_:G_;continue;case AM:if(f=="/"&&u[a+1]=="/")i=_g,a++;else{i=G_;continue}break;case IM:if(f=="/"){i=wg;break}else{i=Ki;continue}case G_:if(n.scheme=r.scheme,f==Pn)n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=mi(r.path),n.query=r.query;else if(f=="/"||f=="\\"&&n.isSpecial())i=$M;else if(f=="?")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=mi(r.path),n.query="",i=dl;else if(f=="#")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=mi(r.path),n.query=r.query,n.fragment="",i=Ca;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=mi(r.path),n.path.length--,i=Ki;continue}break;case $M:if(n.isSpecial()&&(f=="/"||f=="\\"))i=_g;else if(f=="/")i=wg;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,i=Ki;continue}break;case CM:if(i=_g,f!="/"||Hn(s,a+1)!="/")continue;a++;break;case _g:if(f!="/"&&f!="\\"){i=wg;continue}break;case wg:if(f=="@"){o&&(s="%40"+s),o=!0,d=Hc(s);for(var p=0;p65535)return wM;n.port=n.isSpecial()&&g===Sg[n.scheme]?null:g,s=""}if(e)return;i=zc;continue}else return wM;break;case Y_:if(n.scheme="file",f=="/"||f=="\\")i=kM;else if(r&&r.scheme=="file")if(f==Pn)n.host=r.host,n.path=mi(r.path),n.query=r.query;else if(f=="?")n.host=r.host,n.path=mi(r.path),n.query="",i=dl;else if(f=="#")n.host=r.host,n.path=mi(r.path),n.query=r.query,n.fragment="",i=Ca;else{TM(bh(mi(u,a),""))||(n.host=r.host,n.path=mi(r.path),n.shortenPath()),i=Ki;continue}else{i=Ki;continue}break;case kM:if(f=="/"||f=="\\"){i=q_;break}r&&r.scheme=="file"&&!TM(bh(mi(u,a),""))&&(Eh(r.path[0],!0)?lu(n.path,r.path[0]):n.host=r.host),i=Ki;continue;case q_:if(f==Pn||f=="/"||f=="\\"||f=="?"||f=="#"){if(!e&&Eh(s))i=Ki;else if(s==""){if(n.host="",e)return;i=zc}else{if(h=n.parseHost(s),h)return h;if(n.host=="localhost"&&(n.host=""),e)return;s="",i=zc}continue}else s+=f;break;case zc:if(n.isSpecial()){if(i=Ki,f!="/"&&f!="\\")continue}else if(!e&&f=="?")n.query="",i=dl;else if(!e&&f=="#")n.fragment="",i=Ca;else if(f!=Pn&&(i=Ki,f!="/"))continue;break;case Ki:if(f==Pn||f=="/"||f=="\\"&&n.isSpecial()||!e&&(f=="?"||f=="#")){if(MDe(s)?(n.shortenPath(),f!="/"&&!(f=="\\"&&n.isSpecial())&&lu(n.path,"")):DDe(s)?f!="/"&&!(f=="\\"&&n.isSpecial())&&lu(n.path,""):(n.scheme=="file"&&!n.path.length&&Eh(s)&&(n.host&&(n.host=""),s=Hn(s,0)+":"),lu(n.path,s)),s="",n.scheme=="file"&&(f==Pn||f=="?"||f=="#"))for(;n.path.length>1&&n.path[0]==="";)bDe(n.path);f=="?"?(n.query="",i=dl):f=="#"&&(n.fragment="",i=Ca)}else s+=Ls(f,VW);break;case OM:f=="?"?(n.query="",i=dl):f=="#"?(n.fragment="",i=Ca):f!=Pn&&(n.path[0]+=Ls(f,Dv));break;case dl:!e&&f=="#"?(n.fragment="",i=Ca):f!=Pn&&(f=="'"&&n.isSpecial()?n.query+="%27":f=="#"?n.query+="%23":n.query+=Ls(f,Dv));break;case Ca:f!=Pn&&(n.fragment+=Ls(f,GW));break}a++}},parseHost:function(t){var e,r,n;if(Hn(t,0)=="["){if(Hn(t,t.length-1)!="]"||(e=PDe(Uh(t,1,-1)),!e))return fl;this.host=e}else if(this.isSpecial()){if(t=fDe(t),_i(IDe,t)||(e=LDe(t),e===null))return fl;this.host=e}else{if(_i($De,t))return fl;for(e="",r=Hc(t),n=0;n1?arguments[1]:void 0,i=pDe(r,new zC(e,!1,n));UC||(r.href=i.serialize(),r.origin=i.getOrigin(),r.protocol=i.getProtocol(),r.username=i.getUsername(),r.password=i.getPassword(),r.host=i.getHost(),r.hostname=i.getHostname(),r.port=i.getPort(),r.pathname=i.getPathname(),r.search=i.getSearch(),r.searchParams=i.getSearchParams(),r.hash=i.getHash())},_r=gf.prototype,Nn=function(t,e){return{get:function(){return Fy(this)[t]()},set:e&&function(r){return Fy(this)[e](r)},configurable:!0,enumerable:!0}};UC&&(Ln(_r,"href",Nn("serialize","setHref")),Ln(_r,"origin",Nn("getOrigin")),Ln(_r,"protocol",Nn("getProtocol","setProtocol")),Ln(_r,"username",Nn("getUsername","setUsername")),Ln(_r,"password",Nn("getPassword","setPassword")),Ln(_r,"host",Nn("getHost","setHost")),Ln(_r,"hostname",Nn("getHostname","setHostname")),Ln(_r,"port",Nn("getPort","setPort")),Ln(_r,"pathname",Nn("getPathname","setPathname")),Ln(_r,"search",Nn("getSearch","setSearch")),Ln(_r,"searchParams",Nn("getSearchParams")),Ln(_r,"hash",Nn("getHash","setHash")));My(_r,"toJSON",function(){return Fy(this).serialize()},{enumerable:!0});My(_r,"toString",function(){return Fy(this).serialize()},{enumerable:!0});if(Ud){var LM=Ud.createObjectURL,PM=Ud.revokeObjectURL;LM&&My(gf,"createObjectURL",SM(LM,Ud)),PM&&My(gf,"revokeObjectURL",SM(PM,Ud))}dDe(gf,"URL");oDe({global:!0,constructor:!0,forced:!lDe,sham:!UC},{URL:gf});var FDe=j,BDe=ht,UDe=re,jDe=bs,NM=Ce,HDe=MC,WW=BDe("URL"),zDe=HDe&&UDe(function(){WW.canParse()});FDe({target:"URL",stat:!0,forced:!zDe},{canParse:function(e){var r=jDe(arguments.length,1),n=NM(e),i=r<2||arguments[1]===void 0?void 0:NM(arguments[1]);try{return!!new WW(n,i)}catch{return!1}}});var GDe=j,VDe=$e;GDe({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return VDe(URL.prototype.toString,this)}});var WDe=_e,KDe=ae,YDe=sr,SR=URLSearchParams.prototype,qDe=KDe(SR.forEach);WDe&&!("size"in SR)&&YDe(SR,"size",{get:function(){var e=0;return qDe(this,function(){e++}),e},configurable:!0,enumerable:!0});(function(t){t.exports=t$})(rte);var ql={},XDe={get exports(){return ql},set exports(t){ql=t}},li={},_R={},QDe={get exports(){return _R},set exports(t){_R=t}},KW={};/** @license React v0.20.2 + * scheduler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */(function(t){var e,r,n,i;if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;t.unstable_now=function(){return a.now()}}else{var s=Date,o=s.now();t.unstable_now=function(){return s.now()-o}}if(typeof window>"u"||typeof MessageChannel!="function"){var c=null,l=null,u=function(){if(c!==null)try{var k=t.unstable_now();c(!0,k),c=null}catch(O){throw setTimeout(u,0),O}};e=function(k){c!==null?setTimeout(e,0,k):(c=k,setTimeout(u,0))},r=function(k,O){l=setTimeout(k,O)},n=function(){clearTimeout(l)},t.unstable_shouldYield=function(){return!1},i=t.unstable_forceFrameRate=function(){}}else{var f=window.setTimeout,d=window.clearTimeout;if(typeof console<"u"){var h=window.cancelAnimationFrame;typeof window.requestAnimationFrame!="function"&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),typeof h!="function"&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")}var p=!1,v=null,m=-1,g=5,y=0;t.unstable_shouldYield=function(){return t.unstable_now()>=y},i=function(){},t.unstable_forceFrameRate=function(k){0>k||125>>1,Q=k[D];if(Q!==void 0&&0R(de,F))rt!==void 0&&0>R(rt,de)?(k[D]=rt,k[oe]=F,D=oe):(k[D]=de,k[ee]=F,D=ee);else if(rt!==void 0&&0>R(rt,F))k[D]=rt,k[oe]=F,D=oe;else break e}}return O}return null}function R(k,O){var F=k.sortIndex-O.sortIndex;return F!==0?F:k.id-O.id}var I=[],T=[],C=1,L=null,H=3,N=!1,P=!1,B=!1;function V(k){for(var O=S(T);O!==null;){if(O.callback===null)w(T);else if(O.startTime<=k)w(T),O.sortIndex=O.expirationTime,_(I,O);else break;O=S(T)}}function M(k){if(B=!1,V(k),!P)if(S(I)!==null)P=!0,e(U);else{var O=S(T);O!==null&&r(M,O.startTime-k)}}function U(k,O){P=!1,B&&(B=!1,n()),N=!0;var F=H;try{for(V(O),L=S(I);L!==null&&(!(L.expirationTime>O)||k&&!t.unstable_shouldYield());){var D=L.callback;if(typeof D=="function"){L.callback=null,H=L.priorityLevel;var Q=D(L.expirationTime<=O);O=t.unstable_now(),typeof Q=="function"?L.callback=Q:L===S(I)&&w(I),V(O)}else w(I);L=S(I)}if(L!==null)var ee=!0;else{var de=S(T);de!==null&&r(M,de.startTime-O),ee=!1}return ee}finally{L=null,H=F,N=!1}}var W=i;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(k){k.callback=null},t.unstable_continueExecution=function(){P||N||(P=!0,e(U))},t.unstable_getCurrentPriorityLevel=function(){return H},t.unstable_getFirstCallbackNode=function(){return S(I)},t.unstable_next=function(k){switch(H){case 1:case 2:case 3:var O=3;break;default:O=H}var F=H;H=O;try{return k()}finally{H=F}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=W,t.unstable_runWithPriority=function(k,O){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var F=H;H=k;try{return O()}finally{H=F}},t.unstable_scheduleCallback=function(k,O,F){var D=t.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0D?(k.sortIndex=F,_(T,k),S(I)===null&&k===S(T)&&(B?n():B=!0,r(M,F-D))):(k.sortIndex=Q,_(I,k),P||N||(P=!0,e(U))),k},t.unstable_wrapCallback=function(k){var O=H;return function(){var F=H;H=O;try{return k.apply(this,arguments)}finally{H=F}}}})(KW);(function(t){t.exports=KW})(QDe);/** @license React v17.0.2 + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var $b=A,ft=BI,Kt=_R;function te(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ZDe=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,DM=Object.prototype.hasOwnProperty,MM={},FM={};function JDe(t){return DM.call(FM,t)?!0:DM.call(MM,t)?!1:ZDe.test(t)?FM[t]=!0:(MM[t]=!0,!1)}function e3e(t,e,r,n){if(r!==null&&r.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function t3e(t,e,r,n){if(e===null||typeof e>"u"||e3e(t,e,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Dr(t,e,r,n,i,a,s){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=t,this.type=e,this.sanitizeURL=a,this.removeEmptyString=s}var nr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){nr[t]=new Dr(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];nr[e]=new Dr(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){nr[t]=new Dr(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){nr[t]=new Dr(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){nr[t]=new Dr(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){nr[t]=new Dr(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){nr[t]=new Dr(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){nr[t]=new Dr(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){nr[t]=new Dr(t,5,!1,t.toLowerCase(),null,!1,!1)});var GC=/[\-:]([a-z])/g;function VC(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(GC,VC);nr[e]=new Dr(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(GC,VC);nr[e]=new Dr(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(GC,VC);nr[e]=new Dr(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){nr[t]=new Dr(t,1,!1,t.toLowerCase(),null,!1,!1)});nr.xlinkHref=new Dr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){nr[t]=new Dr(t,1,!1,t.toLowerCase(),null,!0,!0)});function WC(t,e,r,n){var i=nr.hasOwnProperty(e)?nr[e]:null,a=i!==null?i.type===0:n?!1:!(!(2o||i[s]!==a[o])return` +`+i[s].replace(" at new "," at ");while(1<=s&&0<=o);break}}}finally{Q_=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?_h(t):""}function r3e(t){switch(t.tag){case 5:return _h(t.type);case 16:return _h("Lazy");case 13:return _h("Suspense");case 19:return _h("SuspenseList");case 0:case 2:case 15:return t=Tg(t.type,!1),t;case 11:return t=Tg(t.type.render,!1),t;case 22:return t=Tg(t.type._render,!1),t;case 1:return t=Tg(t.type,!0),t;default:return""}}function Mu(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Ws:return"Fragment";case Al:return"Portal";case jh:return"Profiler";case KC:return"StrictMode";case Hh:return"Suspense";case jy:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case qC:return(t.displayName||"Context")+".Consumer";case YC:return(t._context.displayName||"Context")+".Provider";case Cb:var e=t.render;return e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case kb:return Mu(t.type);case QC:return Mu(t._render);case XC:e=t._payload,t=t._init;try{return Mu(t(e))}catch{}}return null}function Ao(t){switch(typeof t){case"boolean":case"number":case"object":case"string":case"undefined":return t;default:return""}}function XW(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function n3e(t){var e=XW(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),n=""+t[e];if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,a=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(s){n=""+s,a.call(this,s)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(s){n=""+s},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Rg(t){t._valueTracker||(t._valueTracker=n3e(t))}function QW(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=XW(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function Hy(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function TR(t,e){var r=e.checked;return ft({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function UM(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=Ao(e.value!=null?e.value:r),t._wrapperState={initialChecked:n,initialValue:r,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function ZW(t,e){e=e.checked,e!=null&&WC(t,"checked",e,!1)}function RR(t,e){ZW(t,e);var r=Ao(e.value),n=e.type;if(r!=null)n==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+r):t.value!==""+r&&(t.value=""+r);else if(n==="submit"||n==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?AR(t,e.type,r):e.hasOwnProperty("defaultValue")&&AR(t,e.type,Ao(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function jM(t,e,r){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,r||e===t.value||(t.value=e),t.defaultValue=e}r=t.name,r!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,r!==""&&(t.name=r)}function AR(t,e,r){(e!=="number"||Hy(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}function i3e(t){var e="";return $b.Children.forEach(t,function(r){r!=null&&(e+=r)}),e}function IR(t,e){return t=ft({children:void 0},e),(e=i3e(e.children))&&(t.children=e),t}function Fu(t,e,r,n){if(t=t.options,e){e={};for(var i=0;i=r.length))throw Error(te(93));r=r[0]}e=r}e==null&&(e=""),r=e}t._wrapperState={initialValue:Ao(r)}}function JW(t,e){var r=Ao(e.value),n=Ao(e.defaultValue);r!=null&&(r=""+r,r!==t.value&&(t.value=r),e.defaultValue==null&&t.defaultValue!==r&&(t.defaultValue=r)),n!=null&&(t.defaultValue=""+n)}function zM(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}var CR={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function eK(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function kR(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?eK(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var Ag,tK=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,r,n,i){MSApp.execUnsafeLocalFunction(function(){return t(e,r,n,i)})}:t}(function(t,e){if(t.namespaceURI!==CR.svg||"innerHTML"in t)t.innerHTML=e;else{for(Ag=Ag||document.createElement("div"),Ag.innerHTML=""+e.valueOf().toString()+"",e=Ag.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function R0(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var zh={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},a3e=["Webkit","ms","Moz","O"];Object.keys(zh).forEach(function(t){a3e.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),zh[e]=zh[t]})});function rK(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||zh.hasOwnProperty(t)&&zh[t]?(""+e).trim():e+"px"}function nK(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=rK(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,i):t[r]=i}}var s3e=ft({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function OR(t,e){if(e){if(s3e[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(te(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(te(60));if(!(typeof e.dangerouslySetInnerHTML=="object"&&"__html"in e.dangerouslySetInnerHTML))throw Error(te(61))}if(e.style!=null&&typeof e.style!="object")throw Error(te(62))}}function LR(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function ek(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var PR=null,Bu=null,Uu=null;function GM(t){if(t=rm(t)){if(typeof PR!="function")throw Error(te(280));var e=t.stateNode;e&&(e=Mb(e),PR(t.stateNode,t.type,e))}}function iK(t){Bu?Uu?Uu.push(t):Uu=[t]:Bu=t}function aK(){if(Bu){var t=Bu,e=Uu;if(Uu=Bu=null,GM(t),e)for(t=0;tn?0:1<r;r++)e.push(t);return e}function Lb(t,e,r){t.pendingLanes|=e;var n=e-1;t.suspendedLanes&=n,t.pingedLanes&=n,t=t.eventTimes,e=31-Io(e),t[e]=r}var Io=Math.clz32?Math.clz32:S3e,b3e=Math.log,E3e=Math.LN2;function S3e(t){return t===0?32:31-(b3e(t)/E3e|0)|0}var _3e=Kt.unstable_UserBlockingPriority,w3e=Kt.unstable_runWithPriority,Fv=!0;function T3e(t,e,r,n){Il||rk();var i=ok,a=Il;Il=!0;try{sK(i,t,e,r,n)}finally{(Il=a)||nk()}}function R3e(t,e,r,n){w3e(_3e,ok.bind(null,t,e,r,n))}function ok(t,e,r,n){if(Fv){var i;if((i=(e&4)===0)&&0=Vh),eF=String.fromCharCode(32),tF=!1;function _K(t,e){switch(t){case"keyup":return q3e.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function wK(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var bu=!1;function Q3e(t,e){switch(t){case"compositionend":return wK(e);case"keypress":return e.which!==32?null:(tF=!0,eF);case"textInput":return t=e.data,t===eF&&tF?null:t;default:return null}}function Z3e(t,e){if(bu)return t==="compositionend"||!dk&&_K(t,e)?(t=EK(),Bv=ck=Zs=null,bu=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:r,offset:e-t};t=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=aF(r)}}function IK(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?IK(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function oF(){for(var t=window,e=Hy();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=Hy(t.document)}return e}function BR(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var l4e=us&&"documentMode"in document&&11>=document.documentMode,Eu=null,UR=null,Kh=null,jR=!1;function lF(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;jR||Eu==null||Eu!==Hy(n)||(n=Eu,"selectionStart"in n&&BR(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Kh&&O0(Kh,n)||(Kh=n,n=Wy(UR,"onSelect"),0_u||(t.current=zR[_u],zR[_u]=null,_u--)}function St(t,e){_u++,zR[_u]=t.current,t.current=e}var $o={},br=Ko($o),tn=Ko(!1),Xl=$o;function yf(t,e){var r=t.type.contextTypes;if(!r)return $o;var n=t.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in r)i[a]=e[a];return n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function rn(t){return t=t.childContextTypes,t!=null}function qy(){at(tn),at(br)}function vF(t,e,r){if(br.current!==$o)throw Error(te(168));St(br,e),St(tn,r)}function DK(t,e,r){var n=t.stateNode;if(t=e.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in t))throw Error(te(108,Mu(e)||"Unknown",i));return ft({},r,n)}function jv(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||$o,Xl=br.current,St(br,t),St(tn,tn.current),!0}function yF(t,e,r){var n=t.stateNode;if(!n)throw Error(te(169));r?(t=DK(t,e,Xl),n.__reactInternalMemoizedMergedChildContext=t,at(tn),at(br),St(br,t)):at(tn),St(tn,r)}var pk=null,Bl=null,f4e=Kt.unstable_runWithPriority,mk=Kt.unstable_scheduleCallback,GR=Kt.unstable_cancelCallback,d4e=Kt.unstable_shouldYield,xF=Kt.unstable_requestPaint,VR=Kt.unstable_now,h4e=Kt.unstable_getCurrentPriorityLevel,Fb=Kt.unstable_ImmediatePriority,MK=Kt.unstable_UserBlockingPriority,FK=Kt.unstable_NormalPriority,BK=Kt.unstable_LowPriority,UK=Kt.unstable_IdlePriority,uw={},p4e=xF!==void 0?xF:function(){},Ga=null,Hv=null,fw=!1,bF=VR(),gr=1e4>bF?VR:function(){return VR()-bF};function xf(){switch(h4e()){case Fb:return 99;case MK:return 98;case FK:return 97;case BK:return 96;case UK:return 95;default:throw Error(te(332))}}function jK(t){switch(t){case 99:return Fb;case 98:return MK;case 97:return FK;case 96:return BK;case 95:return UK;default:throw Error(te(332))}}function Ql(t,e){return t=jK(t),f4e(t,e)}function P0(t,e,r){return t=jK(t),mk(t,e,r)}function Ra(){if(Hv!==null){var t=Hv;Hv=null,GR(t)}HK()}function HK(){if(!fw&&Ga!==null){fw=!0;var t=0;try{var e=Ga;Ql(99,function(){for(;tw?(R=S,S=null):R=S.sibling;var I=d(m,S,y[w],x);if(I===null){S===null&&(S=R);break}t&&S&&I.alternate===null&&e(m,S),g=a(I,g,w),_===null?b=I:_.sibling=I,_=I,S=R}if(w===y.length)return r(m,S),b;if(S===null){for(;ww?(R=S,S=null):R=S.sibling;var T=d(m,S,I.value,x);if(T===null){S===null&&(S=R);break}t&&S&&T.alternate===null&&e(m,S),g=a(T,g,w),_===null?b=T:_.sibling=T,_=T,S=R}if(I.done)return r(m,S),b;if(S===null){for(;!I.done;w++,I=y.next())I=f(m,I.value,x),I!==null&&(g=a(I,g,w),_===null?b=I:_.sibling=I,_=I);return b}for(S=n(m,S);!I.done;w++,I=y.next())I=h(S,m,w,I.value,x),I!==null&&(t&&I.alternate!==null&&S.delete(I.key===null?w:I.key),g=a(I,g,w),_===null?b=I:_.sibling=I,_=I);return t&&S.forEach(function(C){return e(m,C)}),b}return function(m,g,y,x){var b=typeof y=="object"&&y!==null&&y.type===Ws&&y.key===null;b&&(y=y.props.children);var _=typeof y=="object"&&y!==null;if(_)switch(y.$$typeof){case Sh:e:{for(_=y.key,b=g;b!==null;){if(b.key===_){switch(b.tag){case 7:if(y.type===Ws){r(m,b.sibling),g=i(b,y.props.children),g.return=m,m=g;break e}break;default:if(b.elementType===y.type){r(m,b.sibling),g=i(b,y.props),g.ref=Yd(m,b,y),g.return=m,m=g;break e}}r(m,b);break}else e(m,b);b=b.sibling}y.type===Ws?(g=Wu(y.props.children,m.mode,x,y.key),g.return=m,m=g):(x=Wv(y.type,y.key,y.props,null,m.mode,x),x.ref=Yd(m,g,y),x.return=m,m=x)}return s(m);case Al:e:{for(b=y.key;g!==null;){if(g.key===b)if(g.tag===4&&g.stateNode.containerInfo===y.containerInfo&&g.stateNode.implementation===y.implementation){r(m,g.sibling),g=i(g,y.children||[]),g.return=m,m=g;break e}else{r(m,g);break}else e(m,g);g=g.sibling}g=vw(y,m.mode,x),g.return=m,m=g}return s(m)}if(typeof y=="string"||typeof y=="number")return y=""+y,g!==null&&g.tag===6?(r(m,g.sibling),g=i(g,y),g.return=m,m=g):(r(m,g),g=gw(y,m.mode,x),g.return=m,m=g),s(m);if(Cg(y))return p(m,g,y,x);if(Hd(y))return v(m,g,y,x);if(_&&kg(m,y),typeof y>"u"&&!b)switch(m.tag){case 1:case 22:case 0:case 11:case 15:throw Error(te(152,Mu(m.type)||"Component"))}return r(m,g)}}var e1=KK(!0),YK=KK(!1),nm={},ca=Ko(nm),D0=Ko(nm),M0=Ko(nm);function Cl(t){if(t===nm)throw Error(te(174));return t}function KR(t,e){switch(St(M0,e),St(D0,t),St(ca,nm),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:kR(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=kR(e,t)}at(ca),St(ca,e)}function bf(){at(ca),at(D0),at(M0)}function TF(t){Cl(M0.current);var e=Cl(ca.current),r=kR(e,t.type);e!==r&&(St(D0,t),St(ca,r))}function xk(t){D0.current===t&&(at(ca),at(D0))}var Et=Ko(0);function t1(t){for(var e=t;e!==null;){if(e.tag===13){var r=e.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&64)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Ya=null,eo=null,ua=!1;function qK(t,e){var r=Wn(5,null,null,0);r.elementType="DELETED",r.type="DELETED",r.stateNode=e,r.return=t,r.flags=8,t.lastEffect!==null?(t.lastEffect.nextEffect=r,t.lastEffect=r):t.firstEffect=t.lastEffect=r}function RF(t,e){switch(t.tag){case 5:var r=t.type;return e=e.nodeType!==1||r.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,!0):!1;case 13:return!1;default:return!1}}function YR(t){if(ua){var e=eo;if(e){var r=e;if(!RF(t,e)){if(e=ju(r.nextSibling),!e||!RF(t,e)){t.flags=t.flags&-1025|2,ua=!1,Ya=t;return}qK(Ya,r)}Ya=t,eo=ju(e.firstChild)}else t.flags=t.flags&-1025|2,ua=!1,Ya=t}}function AF(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;Ya=t}function Og(t){if(t!==Ya)return!1;if(!ua)return AF(t),ua=!0,!1;var e=t.type;if(t.tag!==5||e!=="head"&&e!=="body"&&!HR(e,t.memoizedProps))for(e=eo;e;)qK(t,e),e=ju(e.nextSibling);if(AF(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(te(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var r=t.data;if(r==="/$"){if(e===0){eo=ju(t.nextSibling);break e}e--}else r!=="$"&&r!=="$!"&&r!=="$?"||e++}t=t.nextSibling}eo=null}}else eo=Ya?ju(t.stateNode.nextSibling):null;return!0}function dw(){eo=Ya=null,ua=!1}var zu=[];function bk(){for(var t=0;ta))throw Error(te(301));a+=1,er=pr=null,e.updateQueue=null,Yh.current=x4e,t=r(n,i)}while(qh)}if(Yh.current=s1,e=pr!==null&&pr.next!==null,F0=0,er=pr=At=null,r1=!1,e)throw Error(te(300));return t}function kl(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return er===null?At.memoizedState=er=t:er=er.next=t,er}function yc(){if(pr===null){var t=At.alternate;t=t!==null?t.memoizedState:null}else t=pr.next;var e=er===null?At.memoizedState:er.next;if(e!==null)er=e,pr=t;else{if(t===null)throw Error(te(310));pr=t,t={memoizedState:pr.memoizedState,baseState:pr.baseState,baseQueue:pr.baseQueue,queue:pr.queue,next:null},er===null?At.memoizedState=er=t:er=er.next=t}return er}function sa(t,e){return typeof e=="function"?e(t):e}function qd(t){var e=yc(),r=e.queue;if(r===null)throw Error(te(311));r.lastRenderedReducer=t;var n=pr,i=n.baseQueue,a=r.pending;if(a!==null){if(i!==null){var s=i.next;i.next=a.next,a.next=s}n.baseQueue=i=a,r.pending=null}if(i!==null){i=i.next,n=n.baseState;var o=s=a=null,c=i;do{var l=c.lane;if((F0&l)===l)o!==null&&(o=o.next={lane:0,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null}),n=c.eagerReducer===t?c.eagerState:t(n,c.action);else{var u={lane:l,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null};o===null?(s=o=u,a=n):o=o.next=u,At.lanes|=l,im|=l}c=c.next}while(c!==null&&c!==i);o===null?a=n:o.next=s,Vn(n,e.memoizedState)||(Ri=!0),e.memoizedState=n,e.baseState=a,e.baseQueue=o,r.lastRenderedState=n}return[e.memoizedState,r.dispatch]}function Xd(t){var e=yc(),r=e.queue;if(r===null)throw Error(te(311));r.lastRenderedReducer=t;var n=r.dispatch,i=r.pending,a=e.memoizedState;if(i!==null){r.pending=null;var s=i=i.next;do a=t(a,s.action),s=s.next;while(s!==i);Vn(a,e.memoizedState)||(Ri=!0),e.memoizedState=a,e.baseQueue===null&&(e.baseState=a),r.lastRenderedState=a}return[a,n]}function IF(t,e,r){var n=e._getVersion;n=n(e._source);var i=e._workInProgressVersionPrimary;if(i!==null?t=i===n:(t=t.mutableReadLanes,(t=(F0&t)===t)&&(e._workInProgressVersionPrimary=n,zu.push(e))),t)return r(e._source);throw zu.push(e),Error(te(350))}function XK(t,e,r,n){var i=Cr;if(i===null)throw Error(te(349));var a=e._getVersion,s=a(e._source),o=Yh.current,c=o.useState(function(){return IF(i,e,r)}),l=c[1],u=c[0];c=er;var f=t.memoizedState,d=f.refs,h=d.getSnapshot,p=f.source;f=f.subscribe;var v=At;return t.memoizedState={refs:d,source:e,subscribe:n},o.useEffect(function(){d.getSnapshot=r,d.setSnapshot=l;var m=a(e._source);if(!Vn(s,m)){m=r(e._source),Vn(u,m)||(l(m),m=ho(v),i.mutableReadLanes|=m&i.pendingLanes),m=i.mutableReadLanes,i.entangledLanes|=m;for(var g=i.entanglements,y=m;0r?98:r,function(){t(!0)}),Ql(97<\/script>",t=t.removeChild(t.firstChild)):typeof n.is=="string"?t=s.createElement(r,{is:n.is}):(t=s.createElement(r),r==="select"&&(s=t,n.multiple?s.multiple=!0:n.size&&(s.size=n.size))):t=s.createElementNS(t,r),t[Js]=e,t[Yy]=n,aY(t,e,!1,!1),e.stateNode=t,s=LR(r,n),r){case"dialog":nt("cancel",t),nt("close",t),i=n;break;case"iframe":case"object":case"embed":nt("load",t),i=n;break;case"video":case"audio":for(i=0;iiA&&(e.flags|=64,a=!0,Zd(n,!1),e.lanes=33554432)}else{if(!a)if(t=t1(s),t!==null){if(e.flags|=64,a=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),Zd(n,!0),n.tail===null&&n.tailMode==="hidden"&&!s.alternate&&!ua)return e=e.lastEffect=n.lastEffect,e!==null&&(e.nextEffect=null),null}else 2*gr()-n.renderingStartTime>iA&&r!==1073741824&&(e.flags|=64,a=!0,Zd(n,!1),e.lanes=33554432);n.isBackwards?(s.sibling=e.child,e.child=s):(r=n.last,r!==null?r.sibling=s:e.child=s,n.last=s)}return n.tail!==null?(r=n.tail,n.rendering=r,n.tail=r.sibling,n.lastEffect=e.lastEffect,n.renderingStartTime=gr(),r.sibling=null,e=Et.current,St(Et,a?e&1|2:e&1),r):null;case 23:case 24:return Ck(),t!==null&&t.memoizedState!==null!=(e.memoizedState!==null)&&n.mode!=="unstable-defer-without-hiding"&&(e.flags|=4),null}throw Error(te(156,e.tag))}function S4e(t){switch(t.tag){case 1:rn(t.type)&&qy();var e=t.flags;return e&4096?(t.flags=e&-4097|64,t):null;case 3:if(bf(),at(tn),at(br),bk(),e=t.flags,e&64)throw Error(te(285));return t.flags=e&-4097|64,t;case 5:return xk(t),null;case 13:return at(Et),e=t.flags,e&4096?(t.flags=e&-4097|64,t):null;case 19:return at(Et),null;case 4:return bf(),null;case 10:return vk(t),null;case 23:case 24:return Ck(),null;default:return null}}function Rk(t,e){try{var r="",n=e;do r+=r3e(n),n=n.return;while(n);var i=r}catch(a){i=` +Error generating stack: `+a.message+` +`+a.stack}return{value:t,source:e,stack:i}}function JR(t,e){try{console.error(e.value)}catch(r){setTimeout(function(){throw r})}}var _4e=typeof WeakMap=="function"?WeakMap:Map;function lY(t,e,r){r=uo(-1,r),r.tag=3,r.payload={element:null};var n=e.value;return r.callback=function(){l1||(l1=!0,aA=n),JR(t,e)},r}function cY(t,e,r){r=uo(-1,r),r.tag=3;var n=t.type.getDerivedStateFromError;if(typeof n=="function"){var i=e.value;r.payload=function(){return JR(t,e),n(i)}}var a=t.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(r.callback=function(){typeof n!="function"&&(oa===null?oa=new Set([this]):oa.add(this),JR(t,e));var s=e.stack;this.componentDidCatch(e.value,{componentStack:s!==null?s:""})}),r}var w4e=typeof WeakSet=="function"?WeakSet:Set;function jF(t){var e=t.ref;if(e!==null)if(typeof e=="function")try{e(null)}catch(r){mo(t,r)}else e.current=null}function T4e(t,e){switch(e.tag){case 0:case 11:case 15:case 22:return;case 1:if(e.flags&256&&t!==null){var r=t.memoizedProps,n=t.memoizedState;t=e.stateNode,e=t.getSnapshotBeforeUpdate(e.elementType===e.type?r:xi(e.type,r),n),t.__reactInternalSnapshotBeforeUpdate=e}return;case 3:e.flags&256&&hk(e.stateNode.containerInfo);return;case 5:case 6:case 4:case 17:return}throw Error(te(163))}function R4e(t,e,r){switch(r.tag){case 0:case 11:case 15:case 22:if(e=r.updateQueue,e=e!==null?e.lastEffect:null,e!==null){t=e=e.next;do{if((t.tag&3)===3){var n=t.create;t.destroy=n()}t=t.next}while(t!==e)}if(e=r.updateQueue,e=e!==null?e.lastEffect:null,e!==null){t=e=e.next;do{var i=t;n=i.next,i=i.tag,i&4&&i&1&&(yY(r,t),P4e(r,t)),t=n}while(t!==e)}return;case 1:t=r.stateNode,r.flags&4&&(e===null?t.componentDidMount():(n=r.elementType===r.type?e.memoizedProps:xi(r.type,e.memoizedProps),t.componentDidUpdate(n,e.memoizedState,t.__reactInternalSnapshotBeforeUpdate))),e=r.updateQueue,e!==null&&SF(r,e,t);return;case 3:if(e=r.updateQueue,e!==null){if(t=null,r.child!==null)switch(r.child.tag){case 5:t=r.child.stateNode;break;case 1:t=r.child.stateNode}SF(r,e,t)}return;case 5:t=r.stateNode,e===null&&r.flags&4&&PK(r.type,r.memoizedProps)&&t.focus();return;case 6:return;case 4:return;case 12:return;case 13:r.memoizedState===null&&(r=r.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&hK(r))));return;case 19:case 17:case 20:case 21:case 23:case 24:return}throw Error(te(163))}function HF(t,e){for(var r=t;;){if(r.tag===5){var n=r.stateNode;if(e)n=n.style,typeof n.setProperty=="function"?n.setProperty("display","none","important"):n.display="none";else{n=r.stateNode;var i=r.memoizedProps.style;i=i!=null&&i.hasOwnProperty("display")?i.display:null,n.style.display=rK("display",i)}}else if(r.tag===6)r.stateNode.nodeValue=e?"":r.memoizedProps;else if((r.tag!==23&&r.tag!==24||r.memoizedState===null||r===t)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}}function zF(t,e){if(Bl&&typeof Bl.onCommitFiberUnmount=="function")try{Bl.onCommitFiberUnmount(pk,e)}catch{}switch(e.tag){case 0:case 11:case 14:case 15:case 22:if(t=e.updateQueue,t!==null&&(t=t.lastEffect,t!==null)){var r=t=t.next;do{var n=r,i=n.destroy;if(n=n.tag,i!==void 0)if(n&4)yY(e,r);else{n=e;try{i()}catch(a){mo(n,a)}}r=r.next}while(r!==t)}break;case 1:if(jF(e),t=e.stateNode,typeof t.componentWillUnmount=="function")try{t.props=e.memoizedProps,t.state=e.memoizedState,t.componentWillUnmount()}catch(a){mo(e,a)}break;case 5:jF(e);break;case 4:uY(t,e)}}function GF(t){t.alternate=null,t.child=null,t.dependencies=null,t.firstEffect=null,t.lastEffect=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.return=null,t.updateQueue=null}function VF(t){return t.tag===5||t.tag===3||t.tag===4}function WF(t){e:{for(var e=t.return;e!==null;){if(VF(e))break e;e=e.return}throw Error(te(160))}var r=e;switch(e=r.stateNode,r.tag){case 5:var n=!1;break;case 3:e=e.containerInfo,n=!0;break;case 4:e=e.containerInfo,n=!0;break;default:throw Error(te(161))}r.flags&16&&(R0(e,""),r.flags&=-17);e:t:for(r=t;;){for(;r.sibling===null;){if(r.return===null||VF(r.return)){r=null;break e}r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.flags&2||r.child===null||r.tag===4)continue t;r.child.return=r,r=r.child}if(!(r.flags&2)){r=r.stateNode;break e}}n?eA(t,r,e):tA(t,r,e)}function eA(t,e,r){var n=t.tag,i=n===5||n===6;if(i)t=i?t.stateNode:t.stateNode.instance,e?r.nodeType===8?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(r.nodeType===8?(e=r.parentNode,e.insertBefore(t,r)):(e=r,e.appendChild(t)),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=Ky));else if(n!==4&&(t=t.child,t!==null))for(eA(t,e,r),t=t.sibling;t!==null;)eA(t,e,r),t=t.sibling}function tA(t,e,r){var n=t.tag,i=n===5||n===6;if(i)t=i?t.stateNode:t.stateNode.instance,e?r.insertBefore(t,e):r.appendChild(t);else if(n!==4&&(t=t.child,t!==null))for(tA(t,e,r),t=t.sibling;t!==null;)tA(t,e,r),t=t.sibling}function uY(t,e){for(var r=e,n=!1,i,a;;){if(!n){n=r.return;e:for(;;){if(n===null)throw Error(te(160));switch(i=n.stateNode,n.tag){case 5:a=!1;break e;case 3:i=i.containerInfo,a=!0;break e;case 4:i=i.containerInfo,a=!0;break e}n=n.return}n=!0}if(r.tag===5||r.tag===6){e:for(var s=t,o=r,c=o;;)if(zF(s,c),c.child!==null&&c.tag!==4)c.child.return=c,c=c.child;else{if(c===o)break e;for(;c.sibling===null;){if(c.return===null||c.return===o)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}a?(s=i,o=r.stateNode,s.nodeType===8?s.parentNode.removeChild(o):s.removeChild(o)):i.removeChild(r.stateNode)}else if(r.tag===4){if(r.child!==null){i=r.stateNode.containerInfo,a=!0,r.child.return=r,r=r.child;continue}}else if(zF(t,r),r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return;r=r.return,r.tag===4&&(n=!1)}r.sibling.return=r.return,r=r.sibling}}function mw(t,e){switch(e.tag){case 0:case 11:case 14:case 15:case 22:var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var n=r=r.next;do(n.tag&3)===3&&(t=n.destroy,n.destroy=void 0,t!==void 0&&t()),n=n.next;while(n!==r)}return;case 1:return;case 5:if(r=e.stateNode,r!=null){n=e.memoizedProps;var i=t!==null?t.memoizedProps:n;t=e.type;var a=e.updateQueue;if(e.updateQueue=null,a!==null){for(r[Yy]=n,t==="input"&&n.type==="radio"&&n.name!=null&&ZW(r,n),LR(t,i),e=LR(t,n),i=0;ii&&(i=s),r&=~a}if(r=i,r=gr()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*I4e(r/1960))-r,10 component higher in the tree to provide a loading indicator or placeholder to display.`)}tr!==5&&(tr=2),c=Rk(c,o),d=s;do{switch(d.tag){case 3:a=c,d.flags|=4096,e&=-e,d.lanes|=e;var _=lY(d,a,e);EF(d,_);break e;case 1:a=c;var S=d.type,w=d.stateNode;if(!(d.flags&64)&&(typeof S.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(oa===null||!oa.has(w)))){d.flags|=4096,e&=-e,d.lanes|=e;var R=cY(d,a,e);EF(d,R);break e}}d=d.return}while(d!==null)}vY(r)}catch(I){e=I,Lt===r&&r!==null&&(Lt=r=r.return);continue}break}while(1)}function mY(){var t=o1.current;return o1.current=s1,t===null?s1:t}function Rh(t,e){var r=Se;Se|=16;var n=mY();Cr===t&&yr===e||Vu(t,e);do try{C4e();break}catch(i){pY(t,i)}while(1);if(gk(),Se=r,o1.current=n,Lt!==null)throw Error(te(261));return Cr=null,yr=0,tr}function C4e(){for(;Lt!==null;)gY(Lt)}function k4e(){for(;Lt!==null&&!d4e();)gY(Lt)}function gY(t){var e=xY(t.alternate,t,Zl);t.memoizedProps=t.pendingProps,e===null?vY(t):Lt=e,Ak.current=null}function vY(t){var e=t;do{var r=e.alternate;if(t=e.return,e.flags&2048){if(r=S4e(e),r!==null){r.flags&=2047,Lt=r;return}t!==null&&(t.firstEffect=t.lastEffect=null,t.flags|=2048)}else{if(r=E4e(r,e,Zl),r!==null){Lt=r;return}if(r=e,r.tag!==24&&r.tag!==23||r.memoizedState===null||Zl&1073741824||!(r.mode&4)){for(var n=0,i=r.child;i!==null;)n|=i.lanes|i.childLanes,i=i.sibling;r.childLanes=n}t!==null&&!(t.flags&2048)&&(t.firstEffect===null&&(t.firstEffect=e.firstEffect),e.lastEffect!==null&&(t.lastEffect!==null&&(t.lastEffect.nextEffect=e.firstEffect),t.lastEffect=e.lastEffect),1s&&(o=s,s=_,_=o),o=sF(y,_),a=sF(y,s),o&&a&&(b.rangeCount!==1||b.anchorNode!==o.node||b.anchorOffset!==o.offset||b.focusNode!==a.node||b.focusOffset!==a.offset)&&(x=x.createRange(),x.setStart(o.node,o.offset),b.removeAllRanges(),_>s?(b.addRange(x),b.extend(a.node,a.offset)):(x.setEnd(a.node,a.offset),b.addRange(x)))))),x=[],b=y;b=b.parentNode;)b.nodeType===1&&x.push({element:b,left:b.scrollLeft,top:b.scrollTop});for(typeof y.focus=="function"&&y.focus(),y=0;ygr()-$k?Vu(t,0):Ik|=r),Zn(t,e)}function M4e(t,e){var r=t.stateNode;r!==null&&r.delete(e),e=0,e===0&&(e=t.mode,e&2?e&4?(Ka===0&&(Ka=nd),e=uu(62914560&~Ka),e===0&&(e=4194304)):e=xf()===99?1:2:e=1),r=_n(),t=jb(t,e),t!==null&&(Lb(t,e,r),Zn(t,r))}var xY;xY=function(t,e,r){var n=e.lanes;if(t!==null)if(t.memoizedProps!==e.pendingProps||tn.current)Ri=!0;else if(r&n)Ri=!!(t.flags&16384);else{switch(Ri=!1,e.tag){case 3:PF(e),dw();break;case 5:TF(e);break;case 1:rn(e.type)&&jv(e);break;case 4:KR(e,e.stateNode.containerInfo);break;case 10:n=e.memoizedProps.value;var i=e.type._context;St(Xy,i._currentValue),i._currentValue=n;break;case 13:if(e.memoizedState!==null)return r&e.child.childLanes?NF(t,e,r):(St(Et,Et.current&1),e=qa(t,e,r),e!==null?e.sibling:null);St(Et,Et.current&1);break;case 19:if(n=(r&e.childLanes)!==0,t.flags&64){if(n)return UF(t,e,r);e.flags|=64}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),St(Et,Et.current),n)break;return null;case 23:case 24:return e.lanes=0,hw(t,e,r)}return qa(t,e,r)}else Ri=!1;switch(e.lanes=0,e.tag){case 2:if(n=e.type,t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2),t=e.pendingProps,i=yf(e,br.current),Hu(e,r),i=Sk(null,e,n,t,i,r),e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0){if(e.tag=1,e.memoizedState=null,e.updateQueue=null,rn(n)){var a=!0;jv(e)}else a=!1;e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,yk(e);var s=n.getDerivedStateFromProps;typeof s=="function"&&Jy(e,n,s,t),i.updater=Bb,e.stateNode=i,i._reactInternals=e,WR(e,n,t,r),e=QR(null,e,n,!0,a,r)}else e.tag=0,Vr(null,e,i,r),e=e.child;return e;case 16:i=e.elementType;e:{switch(t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2),t=e.pendingProps,a=i._init,i=a(i._payload),e.type=i,a=e.tag=B4e(i),t=xi(i,t),a){case 0:e=XR(null,e,i,t,r);break e;case 1:e=LF(null,e,i,t,r);break e;case 11:e=kF(null,e,i,t,r);break e;case 14:e=OF(null,e,i,xi(i.type,t),n,r);break e}throw Error(te(306,i,""))}return e;case 0:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:xi(n,i),XR(t,e,n,i,r);case 1:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:xi(n,i),LF(t,e,n,i,r);case 3:if(PF(e),n=e.updateQueue,t===null||n===null)throw Error(te(282));if(n=e.pendingProps,i=e.memoizedState,i=i!==null?i.element:null,GK(t,e),N0(e,n,null,r),n=e.memoizedState.element,n===i)dw(),e=qa(t,e,r);else{if(i=e.stateNode,(a=i.hydrate)&&(eo=ju(e.stateNode.containerInfo.firstChild),Ya=e,a=ua=!0),a){if(t=i.mutableSourceEagerHydrationData,t!=null)for(i=0;i"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(r){console.error(r)}}e(),t.exports=li})(XDe);const W4e=Lx(ql);function u1(t,e){return u1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},u1(t,e)}function ma(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,u1(t,e)}var be={},K4e={get exports(){return be},set exports(t){be=t}},Y4e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",q4e=Y4e,X4e=q4e;function EY(){}function SY(){}SY.resetWarningCache=EY;var Q4e=function(){function t(n,i,a,s,o,c){if(c!==X4e){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}t.isRequired=t;function e(){return t}var r={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:SY,resetWarningCache:EY};return r.PropTypes=r,r};K4e.exports=Q4e();function ir(){return ir=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0;u--){var f=n[u];f==="."?xw(n,u):f===".."?(xw(n,u),l++):l&&(xw(n,u),l--)}if(!s)for(;l--;l)n.unshift("..");s&&n[0]!==""&&(!n[0]||!Dg(n[0]))&&n.unshift("");var d=n.join("/");return o&&d.substr(-1)!=="/"&&(d+="/"),d}function XF(t){return t.valueOf?t.valueOf():Object.prototype.valueOf.call(t)}function Kv(t,e){if(t===e)return!0;if(t==null||e==null)return!1;if(Array.isArray(t))return Array.isArray(e)&&t.length===e.length&&t.every(function(i,a){return Kv(i,e[a])});if(typeof t=="object"||typeof e=="object"){var r=XF(t),n=XF(e);return r!==t||n!==e?Kv(r,n):Object.keys(Object.assign({},t,e)).every(function(i){return Kv(t[i],e[i])})}return!1}var J4e=!0,bw="Invariant failed";function qo(t,e){if(!t){if(J4e)throw new Error(bw);var r=typeof e=="function"?e():e,n=r?"".concat(bw,": ").concat(r):bw;throw new Error(n)}}function Jh(t){return t.charAt(0)==="/"?t:"/"+t}function QF(t){return t.charAt(0)==="/"?t.substr(1):t}function e8e(t,e){return t.toLowerCase().indexOf(e.toLowerCase())===0&&"/?#".indexOf(t.charAt(e.length))!==-1}function _Y(t,e){return e8e(t,e)?t.substr(e.length):t}function wY(t){return t.charAt(t.length-1)==="/"?t.slice(0,-1):t}function t8e(t){var e=t||"/",r="",n="",i=e.indexOf("#");i!==-1&&(n=e.substr(i),e=e.substr(0,i));var a=e.indexOf("?");return a!==-1&&(r=e.substr(a),e=e.substr(0,a)),{pathname:e,search:r==="?"?"":r,hash:n==="#"?"":n}}function Wr(t){var e=t.pathname,r=t.search,n=t.hash,i=e||"/";return r&&r!=="?"&&(i+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(i+=n.charAt(0)==="#"?n:"#"+n),i}function Ar(t,e,r,n){var i;typeof t=="string"?(i=t8e(t),i.state=e):(i=ir({},t),i.pathname===void 0&&(i.pathname=""),i.search?i.search.charAt(0)!=="?"&&(i.search="?"+i.search):i.search="",i.hash?i.hash.charAt(0)!=="#"&&(i.hash="#"+i.hash):i.hash="",e!==void 0&&i.state===void 0&&(i.state=e));try{i.pathname=decodeURI(i.pathname)}catch(a){throw a instanceof URIError?new URIError('Pathname "'+i.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):a}return r&&(i.key=r),n?i.pathname?i.pathname.charAt(0)!=="/"&&(i.pathname=Z4e(i.pathname,n.pathname)):i.pathname=n.pathname:i.pathname||(i.pathname="/"),i}function r8e(t,e){return t.pathname===e.pathname&&t.search===e.search&&t.hash===e.hash&&t.key===e.key&&Kv(t.state,e.state)}function Nk(){var t=null;function e(s){return t=s,function(){t===s&&(t=null)}}function r(s,o,c,l){if(t!=null){var u=typeof t=="function"?t(s,o):t;typeof u=="string"?typeof c=="function"?c(u,l):l(!0):l(u!==!1)}else l(!0)}var n=[];function i(s){var o=!0;function c(){o&&s.apply(void 0,arguments)}return n.push(c),function(){o=!1,n=n.filter(function(l){return l!==c})}}function a(){for(var s=arguments.length,o=new Array(s),c=0;cN?P.splice(N,P.length-N,C):P.push(C),u({action:T,location:C,index:N,entries:P})}})}function m(R,I){var T="REPLACE",C=Ar(R,I,f(),w.location);l.confirmTransitionTo(C,T,r,function(L){L&&(w.entries[w.index]=C,u({action:T,location:C}))})}function g(R){var I=r6(w.index+R,0,w.entries.length-1),T="POP",C=w.entries[I];l.confirmTransitionTo(C,T,r,function(L){L?u({action:T,location:C,index:I}):u()})}function y(){g(-1)}function x(){g(1)}function b(R){var I=w.index+R;return I>=0&&I=0)&&(r[i]=t[i]);return r}var OY=uA,I8e={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},$8e={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},LY={};LY[OY.ForwardRef]=I8e;LY[OY.Memo]=$8e;var Sw=1073741823,n6=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:{};function C8e(){var t="__global_unique_id__";return n6[t]=(n6[t]||0)+1}function k8e(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}function O8e(t){var e=[];return{on:function(n){e.push(n)},off:function(n){e=e.filter(function(i){return i!==n})},get:function(){return t},set:function(n,i){t=n,e.forEach(function(a){return a(t,i)})}}}function L8e(t){return Array.isArray(t)?t[0]:t}function P8e(t,e){var r,n,i="__create-react-context-"+C8e()+"__",a=function(o){ma(c,o);function c(){for(var u,f=arguments.length,d=new Array(f),h=0;h"u"&&(Ef=zk);function q8e(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}var X8e=Ef(function(t,e){var r=t.innerRef,n=t.navigate,i=t.onClick,a=sm(t,["innerRef","navigate","onClick"]),s=a.target,o=ir({},a,{onClick:function(l){try{i&&i(l)}catch(u){throw l.preventDefault(),u}!l.defaultPrevented&&l.button===0&&(!s||s==="_self")&&!q8e(l)&&(l.preventDefault(),n())}});return zk!==Ef?o.ref=e||r:o.ref=r,ce.createElement("a",o)}),om=Ef(function(t,e){var r=t.component,n=r===void 0?X8e:r,i=t.replace,a=t.to,s=t.innerRef,o=sm(t,["component","replace","to","innerRef"]);return ce.createElement(ga.Consumer,null,function(c){c||qo(!1);var l=c.history,u=dA(fA(a,c.location),c.location),f=u?l.createHref(u):"",d=ir({},o,{href:f,navigate:function(){var p=fA(a,c.location),v=Wr(c.location)===Wr(dA(p)),m=i||v?l.replace:l.push;m(p)}});return zk!==Ef?d.ref=e||s:d.innerRef=s,ce.createElement(n,d)})}),MY=function(e){return e},h1=ce.forwardRef;typeof h1>"u"&&(h1=MY);function Q8e(){for(var t=arguments.length,e=new Array(t),r=0;r{if(a=J8e(a),a in c6)return;c6[a]=!0;const s=a.endsWith(".css"),o=s?'[rel="stylesheet"]':"";if(!!n)for(let u=i.length-1;u>=0;u--){const f=i[u];if(f.href===a&&(!s||f.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${a}"]${o}`))return;const l=document.createElement("link");if(l.rel=s?"stylesheet":Z8e,s||(l.as="script",l.crossOrigin=""),l.href=a,document.head.appendChild(l),s)return new Promise((u,f)=>{l.addEventListener("load",u),l.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${a}`)))})})).then(()=>e())};function eMe(t={}){const{immediate:e=!1,onNeedRefresh:r,onOfflineReady:n,onRegistered:i,onRegisteredSW:a,onRegisterError:s}=t;let o,c;const l=async(f=!0)=>{await c};async function u(){if("serviceWorker"in navigator){const{Workbox:f}=await hA(()=>import("./workbox-window.prod.es5-dc90f814.js"),[]);o=new f("/sw.js",{scope:"/",type:"classic"}),o.addEventListener("activated",d=>{(d.isUpdate||d.isExternal)&&window.location.reload()}),o.addEventListener("installed",d=>{d.isUpdate||n==null||n()}),o.register({immediate:e}).then(d=>{a?a("/sw.js",d):i==null||i(d)}).catch(d=>{s==null||s(d)})}}return c=u(),l}function Gt(t){return Gt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gt(t)}function tMe(t,e){if(Gt(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Gt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function FY(t){var e=tMe(t,"string");return Gt(e)==="symbol"?e:String(e)}function ci(t,e,r){return e=FY(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Gk(t,e){if(t==null)return{};var r=sm(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}var rMe={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},nMe=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function u6(t){var e={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},r=t.match(/<\/?([^\s]+?)[/\s>]/);if(r&&(e.name=r[1],(rMe[r[1]]||t.charAt(t.length-2)==="/")&&(e.voidElement=!0),e.name.startsWith("!--"))){var n=t.indexOf("-->");return{type:"comment",comment:n!==-1?t.slice(4,n):""}}for(var i=new RegExp(nMe),a=null;(a=i.exec(t))!==null;)if(a[0].trim())if(a[1]){var s=a[1].trim(),o=[s,""];s.indexOf("=")>-1&&(o=s.split("=")),e.attrs[o[0]]=o[1],i.lastIndex--}else a[2]&&(e.attrs[a[2]]=a[3].trim().substring(1,a[3].length-1));return e}var iMe=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,aMe=/^\s*$/,sMe=Object.create(null);function BY(t,e){switch(e.type){case"text":return t+e.content;case"tag":return t+="<"+e.name+(e.attrs?function(r){var n=[];for(var i in r)n.push(i+'="'+r[i]+'"');return n.length?" "+n.join(" "):""}(e.attrs):"")+(e.voidElement?"/>":">"),e.voidElement?t:t+e.children.reduce(BY,"")+"";case"comment":return t+""}}var oMe={parse:function(t,e){e||(e={}),e.components||(e.components=sMe);var r,n=[],i=[],a=-1,s=!1;if(t.indexOf("<")!==0){var o=t.indexOf("<");n.push({type:"text",content:o===-1?t:t.substring(0,o)})}return t.replace(iMe,function(c,l){if(s){if(c!=="")return;s=!1}var u,f=c.charAt(1)!=="/",d=c.startsWith("',bookmark:'',clock:'',eyeSlash:'',arrowLeft:'',chevronDown:'',chevronRight:'',chevronLeft:'',clapperBoard:'',film:'',dragon:'',warning:'',arrowRight:'',movieWeb:'',discord:'',github:'',play:'',pause:'',expand:'',compress:'',volume:'',volume_x:'',x:'',edit:'',bookmark_outline:'',airplay:'',episodes:'',skip_forward:'',skip_backward:'',file:'',captions:'',link:'',circle_exclamation:'',casting:"",download:'',gear:'',watch_party:'',pictureInPicture:'',checkmark:'',tachometer:''};function CMe(){const t=A.useRef(null);return A.useEffect(()=>{var r;const e=document.createElement("google-cast-launcher");e.setAttribute("id","castbutton"),(r=t.current)==null||r.appendChild(e)},[]),E("div",{ref:t,className:"h-6"})}const Ve=A.memo(t=>t.icon==="casting"?E(CMe,{}):E("span",{dangerouslySetInnerHTML:{__html:$Me[t.icon]},className:t.className}));function nn(t){const e=t.clickable?"cursor-pointer hover:scale-110 hover:bg-denim-600 hover:text-white active:scale-125":"",r=t.transparent?"bg-opacity-0 hover:bg-opacity-50":"",n=t.active?"border-bink-600 bg-bink-100 text-bink-600":"";return E("div",{className:t.className||void 0,onClick:t.onClick,children:E("div",{className:`flex h-12 w-12 items-center justify-center rounded-full border-2 border-transparent bg-denim-500 transition-[background-color,color,transform,border-color] duration-75 ${r} ${e} ${n}`,children:E(Ve,{icon:t.icon})})})}function m1(t){const e=!!t.url,r=!!t.to,n=E("span",{className:"cursor-pointer font-bold text-bink-600 hover:text-bink-700",children:t.children});return e?E("a",{target:t.newTab?"_blank":void 0,rel:"noreferrer",href:t.url,children:n}):r?E(om,{to:t.to,children:n}):E("span",{onClick:()=>t.onClick&&t.onClick(),children:n})}function lm(t){return E("h1",{className:`text-2xl font-bold text-white sm:text-3xl md:text-4xl ${t.className??""}`,children:t.children})}const kMe="3.2.1",OMe="https://discord.gg/Jhqt4Xzpfb",LMe="https://github.com/movie-web/movie-web",PMe="G-44YVXRL61C",NMe="https://b267ab7d52674c23af4e4e6cf2956251@o4505053491167232.ingest.sentry.io/4505053495296000",DMe={TMDB_READ_API_KEY:{}.VITE_TMDB_READ_API_KEY,APP_VERSION:void 0,GITHUB_LINK:void 0,DISCORD_LINK:void 0,CORS_PROXY_URL:{}.VITE_CORS_PROXY_URL,NORMAL_ROUTER:{}.VITE_NORMAL_ROUTER};function KY(t){var r;let e=(r=window==null?void 0:window.__CONFIG__)==null?void 0:r[`VITE_${t}`];return e!==void 0&&e.length===0&&(e=void 0),DMe[t]??e??void 0}function Iw(t,e){return KY(t)??e??""}function MMe(){if(["TMDB_READ_API_KEY","CORS_PROXY_URL"].map(r=>{const n=KY(r);return n||(window.alert(`Misconfigured instance, missing key: ${r}`),n)}).includes(void 0))throw new Error("Misconfigured instance")}function Er(){return{APP_VERSION:kMe,GITHUB_LINK:LMe,DISCORD_LINK:OMe,TMDB_READ_API_KEY:Iw("TMDB_READ_API_KEY"),PROXY_URLS:Iw("CORS_PROXY_URL").split(",").map(t=>t.trim()),NORMAL_ROUTER:Iw("NORMAL_ROUTER","false")==="true"}}function FMe(t){return Y("div",{className:"w-4xl mt-12 max-w-full rounded bg-denim-300 px-6 py-4",children:[Y("p",{className:"mb-1 break-words font-bold text-white",children:[t.error.name," - ",t.error.description]}),E("p",{className:"break-words",children:t.error.path})]})}function Kk(t){const{t:e}=ke();return Y("div",{className:`${t.localSize?"h-full":"min-h-screen"} flex w-full flex-col items-center justify-center px-4 py-12`,children:[Y("div",{className:"flex flex-col items-center justify-start text-center",children:[E(nn,{icon:ue.WARNING,className:"mb-6 text-red-400"}),E(lm,{children:e("media.errors.genericTitle")}),t.children?E("p",{className:"my-6 max-w-lg",children:t.children}):E("p",{className:"my-6 max-w-lg",children:Y(Wk,{i18nKey:"media.errors.videoFailed",children:[E(m1,{url:Er().DISCORD_LINK,newTab:!0}),E(m1,{url:Er().GITHUB_LINK,newTab:!0})]})})]}),t.error?E(FMe,{error:t.error}):null]})}class BMe extends A.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,r){if(console.error("Render error caught",e,r),e instanceof Error){const n=e;this.setState(i=>({...i,hasError:!0,error:{name:n.name,description:n.message,path:r.componentStack.split(` +`)[1]}}))}}render(){return this.state.hasError?E(Kk,{error:this.state.error}):this.props.children}}const UMe=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,jMe=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,HMe=/^\s*["[{]|^\s*-?\d[\d.]{0,14}\s*$/;function zMe(t,e){if(t!=="__proto__"&&!(t==="constructor"&&e&&typeof e=="object"&&"prototype"in e))return e}function GMe(t,e={}){if(typeof t!="string")return t;const r=t.toLowerCase().trim();if(r==="true")return!0;if(r==="false")return!1;if(r==="null")return null;if(r==="nan")return Number.NaN;if(r==="infinity")return Number.POSITIVE_INFINITY;if(r!=="undefined"){if(!HMe.test(t)){if(e.strict)throw new SyntaxError("Invalid JSON");return t}try{return UMe.test(t)||jMe.test(t)?JSON.parse(t,zMe):JSON.parse(t)}catch(n){if(e.strict)throw n;return t}}}const VMe=/#/g,WMe=/&/g,KMe=/=/g,YY=/\+/g,YMe=/%5e/gi,qMe=/%60/gi,XMe=/%7c/gi,QMe=/%20/gi;function ZMe(t){return encodeURI(""+t).replace(XMe,"|")}function mA(t){return ZMe(typeof t=="string"?t:JSON.stringify(t)).replace(YY,"%2B").replace(QMe,"+").replace(VMe,"%23").replace(WMe,"%26").replace(qMe,"`").replace(YMe,"^")}function $w(t){return mA(t).replace(KMe,"%3D")}function qY(t=""){try{return decodeURIComponent(""+t)}catch{return""+t}}function JMe(t){return qY(t.replace(YY," "))}function eFe(t=""){const e={};t[0]==="?"&&(t=t.slice(1));for(const r of t.split("&")){const n=r.match(/([^=]+)=?(.*)/)||[];if(n.length<2)continue;const i=qY(n[1]);if(i==="__proto__"||i==="constructor")continue;const a=JMe(n[2]||"");typeof e[i]<"u"?Array.isArray(e[i])?e[i].push(a):e[i]=[e[i],a]:e[i]=a}return e}function tFe(t,e){return(typeof e=="number"||typeof e=="boolean")&&(e=String(e)),e?Array.isArray(e)?e.map(r=>`${$w(t)}=${mA(r)}`).join("&"):`${$w(t)}=${mA(e)}`:$w(t)}function rFe(t){return Object.keys(t).filter(e=>t[e]!==void 0).map(e=>tFe(e,t[e])).join("&")}const nFe=/^\w{2,}:([/\\]{1,2})/,iFe=/^\w{2,}:([/\\]{2})?/,aFe=/^([/\\]\s*){2,}[^/\\]/;function XY(t,e={}){return typeof e=="boolean"&&(e={acceptRelative:e}),e.strict?nFe.test(t):iFe.test(t)||(e.acceptRelative?aFe.test(t):!1)}const sFe=/\/$|\/\?/;function gA(t="",e=!1){return e?sFe.test(t):t.endsWith("/")}function oFe(t="",e=!1){if(!e)return(gA(t)?t.slice(0,-1):t)||"/";if(!gA(t,!0))return t||"/";const[r,...n]=t.split("?");return(r.slice(0,-1)||"/")+(n.length>0?`?${n.join("?")}`:"")}function lFe(t="",e=!1){if(!e)return t.endsWith("/")?t:t+"/";if(gA(t,!0))return t||"/";const[r,...n]=t.split("?");return r+"/"+(n.length>0?`?${n.join("?")}`:"")}function cFe(t=""){return t.startsWith("/")}function uFe(t=""){return(cFe(t)?t.slice(1):t)||"/"}function fFe(t,e){if(hFe(e)||XY(t))return t;const r=oFe(e);return t.startsWith(r)?t:mFe(r,t)}function dFe(t,e){const r=QY(t),n={...eFe(r.search),...e};return r.search=rFe(n),gFe(r)}function hFe(t){return!t||t==="/"}function pFe(t){return t&&t!=="/"}function mFe(t,...e){let r=t||"";for(const n of e.filter(i=>pFe(i)))r=r?lFe(r)+uFe(n):n;return r}function QY(t="",e){if(!XY(t,{acceptRelative:!0}))return e?QY(e+t):b6(t);const[r="",n,i=""]=(t.replace(/\\/g,"/").match(/([^/:]+:)?\/\/([^/@]+@)?(.*)/)||[]).splice(1),[a="",s=""]=(i.match(/([^#/?]*)(.*)?/)||[]).splice(1),{pathname:o,search:c,hash:l}=b6(s.replace(/\/(?=[A-Za-z]:)/,""));return{protocol:r,auth:n?n.slice(0,Math.max(0,n.length-1)):"",host:a,pathname:o,search:c,hash:l}}function b6(t=""){const[e="",r="",n=""]=(t.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:e,search:r,hash:n}}function gFe(t){const e=t.pathname+(t.search?(t.search.startsWith("?")?"":"?")+t.search:"")+t.hash;return t.protocol?t.protocol+"//"+(t.auth?t.auth+"@":"")+t.host+e:e}let ZY=class extends Error{constructor(){super(...arguments),this.name="FetchError"}};function vFe(t,e,r){let n="";e&&(n=e.message),t&&r?n=`${n} (${r.status} ${r.statusText} (${t.toString()}))`:t&&(n=`${n} (${t.toString()})`);const i=new ZY(n);return Object.defineProperty(i,"request",{get(){return t}}),Object.defineProperty(i,"response",{get(){return r}}),Object.defineProperty(i,"data",{get(){return r&&r._data}}),Object.defineProperty(i,"status",{get(){return r&&r.status}}),Object.defineProperty(i,"statusText",{get(){return r&&r.statusText}}),Object.defineProperty(i,"statusCode",{get(){return r&&r.status}}),Object.defineProperty(i,"statusMessage",{get(){return r&&r.statusText}}),i}const yFe=new Set(Object.freeze(["PATCH","POST","PUT","DELETE"]));function E6(t="GET"){return yFe.has(t.toUpperCase())}function xFe(t){if(t===void 0)return!1;const e=typeof t;return e==="string"||e==="number"||e==="boolean"||e===null?!0:e!=="object"?!1:Array.isArray(t)?!0:t.constructor&&t.constructor.name==="Object"||typeof t.toJSON=="function"}const bFe=new Set(["image/svg","application/xml","application/xhtml","application/html"]),EFe=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function SFe(t=""){if(!t)return"json";const e=t.split(";").shift()||"";return EFe.test(e)?"json":bFe.has(e)||e.startsWith("text/")?"text":"blob"}const _Fe=new Set([408,409,425,429,500,502,503,504]);function JY(t){const{fetch:e,Headers:r}=t;function n(s){const o=s.error&&s.error.name==="AbortError"||!1;if(s.options.retry!==!1&&!o){let l;typeof s.options.retry=="number"?l=s.options.retry:l=E6(s.options.method)?0:1;const u=s.response&&s.response.status||500;if(l>0&&_Fe.has(u))return i(s.request,{...s.options,retry:l-1})}const c=vFe(s.request,s.error,s.response);throw Error.captureStackTrace&&Error.captureStackTrace(c,i),c}const i=async function(o,c={}){const l={request:o,options:{...t.defaults,...c},response:void 0,error:void 0};l.options.onRequest&&await l.options.onRequest(l),typeof l.request=="string"&&(l.options.baseURL&&(l.request=fFe(l.request,l.options.baseURL)),(l.options.query||l.options.params)&&(l.request=dFe(l.request,{...l.options.params,...l.options.query})),l.options.body&&E6(l.options.method)&&xFe(l.options.body)&&(l.options.body=typeof l.options.body=="string"?l.options.body:JSON.stringify(l.options.body),l.options.headers=new r(l.options.headers),l.options.headers.has("content-type")||l.options.headers.set("content-type","application/json"),l.options.headers.has("accept")||l.options.headers.set("accept","application/json"))),l.response=await e(l.request,l.options).catch(async f=>(l.error=f,l.options.onRequestError&&await l.options.onRequestError(l),n(l)));const u=(l.options.parseResponse?"json":l.options.responseType)||SFe(l.response.headers.get("content-type")||"");if(u==="json"){const f=await l.response.text(),d=l.options.parseResponse||GMe;l.response._data=d(f)}else u==="stream"?l.response._data=l.response.body:l.response._data=await l.response[u]();return l.options.onResponse&&await l.options.onResponse(l),l.response.status>=400&&l.response.status<600?(l.options.onResponseError&&await l.options.onResponseError(l),n(l)):l.response},a=function(o,c){return i(o,c).then(l=>l._data)};return a.raw=i,a.native=e,a.create=(s={})=>JY({...t,defaults:{...t.defaults,...s}}),a}const eq=function(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}(),wFe=eq.fetch||(()=>Promise.reject(new Error("[ofetch] global.fetch is not supported!"))),TFe=eq.Headers,RFe=JY({fetch:wFe,Headers:TFe}),S6="https://apis.justwatch.com",AFe="https://images.justwatch.com";var ie=(t=>(t.MOVIE="movie",t.SERIES="series",t.ANIME="anime",t))(ie||{});function IFe(t){if(t===ie.MOVIE)return"movie";if(t===ie.SERIES)return"show";throw new Error("unsupported type")}function $Fe(t){if(t==="movie")return ie.MOVIE;if(t==="show")return ie.SERIES;throw new Error("unsupported type")}function CFe(t,e){var i,a;const r=$Fe(t.object_type);let n;return r===ie.SERIES&&(n=(i=t.seasons)==null?void 0:i.sort((s,o)=>s.season_number-o.season_number).map(s=>({id:s.id.toString(),number:s.season_number,title:s.title}))),{title:t.title,id:t.id.toString(),year:(a=t.original_release_year)==null?void 0:a.toString(),poster:t.poster?`${AFe}${t.poster.replace("{profile}","s166")}`:void 0,type:r,seasons:n,seasonData:e?{id:e.id.toString(),number:e.season_number,title:e.title,episodes:e.episodes.sort((s,o)=>s.episode_number-o.episode_number).map(s=>({id:s.id.toString(),number:s.episode_number,title:s.title}))}:void 0}}let Cw=Math.floor(Math.random()*Er().PROXY_URLS.length);function tq(){const t=Er().PROXY_URLS[Cw];return Cw=(Cw+1)%Er().PROXY_URLS.length,t}const Yk=RFe.create({retry:0});function _6(t,e){let r=t;return Object.entries(e).forEach(([n,i])=>{r=r.replace(`{${n}}`,encodeURIComponent(i))}),r}function qk(t,e={}){return Yk(t,e)}function ge(t,e={}){let r=(e==null?void 0:e.baseURL)??"";r.length>0&&r.endsWith("/")&&t.startsWith("/")?r+=t.slice(1):r.length>0&&!r.endsWith("/")&&!t.startsWith("/")?r+=`/${t}`:r+=t;const n=new URL(r);return Object.entries((e==null?void 0:e.params)??{}).forEach(([i,a])=>{n.searchParams.set(i,a)}),Yk(tq(),{...e,baseURL:void 0,params:{destination:n.toString()}})}function kFe(t,e={}){let r=(e==null?void 0:e.baseURL)??"";r.length>0&&r.endsWith("/")&&t.startsWith("/")?r+=t.slice(1):r.length>0&&!r.endsWith("/")&&!t.startsWith("/")?r+=`/${t}`:r+=t;const n=new URL(r);return Object.entries((e==null?void 0:e.params)??{}).forEach(([i,a])=>{n.searchParams.set(i,a)}),Yk.raw(tq(),{...e,baseURL:void 0,params:{destination:n.toString()}})}function Jl(t){if(t===ie.MOVIE)return"movie";if(t===ie.SERIES)return"show";throw new Error("unsupported type")}function nE(t){if(t==="movie")return ie.MOVIE;if(t==="show")return ie.SERIES;throw new Error("unsupported type")}function rq(t,e){var i,a;const r=nE(t.object_type);let n;return r===ie.SERIES&&(n=(i=t.seasons)==null?void 0:i.sort((s,o)=>s.season_number-o.season_number).map(s=>({title:s.title,id:s.id.toString(),number:s.season_number}))),{title:t.title,id:t.id.toString(),year:(a=t.original_release_year)==null?void 0:a.toString(),poster:t.poster,type:r,seasons:n,seasonData:e?{id:e.id.toString(),number:e.season_number,title:e.title,episodes:e.episodes.sort((s,o)=>s.episode_number-o.episode_number).map(s=>({id:s.id.toString(),number:s.episode_number,title:s.title}))}:void 0}}const OFe="https://api.themoviedb.org/3",LFe={accept:"application/json",Authorization:`Bearer ${Er().TMDB_READ_API_KEY}`};async function Lo(t,e){return await qk(encodeURI(t),{headers:LFe,baseURL:OFe,params:{...e}})}async function PFe(t,e){let r;switch(e){case"movie":r=await Lo("search/movie",{query:t,include_adult:!1,language:"en-US",page:1});break;case"show":r=await Lo("search/tv",{query:t,include_adult:!1,language:"en-US",page:1});break;default:throw new Error("Invalid media type")}return r}function nq(t,e){if(e==="movie")return Lo(`/movie/${t}`);if(e==="show")return Lo(`/tv/${t}`);throw new Error("Invalid media type")}function g1(t){if(t)return`https://image.tmdb.org/t/p/w185/${t}`}async function iq(t,e){return(await Lo(`/tv/${t}/season/${e}`)).episodes.map(n=>({id:n.id,episode_number:n.episode_number,title:n.name}))}async function NFe(t,e){let r;switch(e){case"movie":r=await Lo(`/movie/${t}/external_ids`);break;case"show":r=await Lo(`/tv/${t}/external_ids`);break;default:throw new Error("Invalid media type")}return r}async function aq(t){const r=(await Lo(`/find/${t}`,{external_source:"imdb_id"})).movie_results[0];if(r)return r.id.toString()}function DFe(t,e){if(nE(e)===ie.SERIES){const i=t;return{title:i.name,poster:g1(i.poster_path),id:i.id,original_release_year:new Date(i.first_air_date).getFullYear(),object_type:e}}const n=t;return{title:n.title,poster:g1(n.poster_path),id:n.id,original_release_year:new Date(n.release_date).getFullYear(),object_type:e}}function MFe(t,e){if(e===ie.MOVIE){const r=t;return{id:t.id,title:r.title,object_type:Jl(e),poster:g1(r.poster_path)??void 0,original_release_year:new Date(r.release_date).getFullYear()}}if(e===ie.SERIES){const r=t;return{id:t.id,title:r.name,object_type:Jl(e),seasons:r.seasons.map(n=>({id:n.id,season_number:n.season_number,title:n.name})),poster:g1(r.poster_path)??void 0,original_release_year:new Date(r.first_air_date).getFullYear()}}throw new Error("unsupported type")}async function v1(t,e,r){const n=await nq(e,Jl(t));if(!n)return null;const a=(await NFe(e,Jl(t))).imdb_id??void 0;let s;if(t===ie.SERIES){const l=n.seasons;let u=l.find(f=>f.id.toString()===r);if(u||(u=l.find(f=>f.season_number===1)),u){const f=await iq(n.id.toString(),u.season_number);s={id:u.id.toString(),season_number:u.season_number,title:u.name,episodes:f}}}const o=MFe(n,t);if(!o)return null;const c=rq(o,s);return c?{meta:c,imdbId:a,tmdbId:e}:null}async function sq(t,e,r){var c,l,u,f,d;const n=IFe(t);let i;try{const h=_6("/content/titles/{type}/{id}/locale/en_US",{type:n,id:e});i=await ge(h,{baseURL:S6})}catch(h){if(h instanceof ZY&&(h.statusCode===400||h.statusCode===404))return null;throw h}let a=(c=i.external_ids.find(h=>h.provider==="imdb_latest"))==null?void 0:c.external_id;a||(a=(l=i.external_ids.find(h=>h.provider==="imdb"))==null?void 0:l.external_id);let s=(u=i.external_ids.find(h=>h.provider==="tmdb_latest"))==null?void 0:u.external_id;s||(s=(f=i.external_ids.find(h=>h.provider==="tmdb"))==null?void 0:f.external_id);let o;if(i.object_type==="show"){const h=r??((d=i.seasons)==null?void 0:d[0].id.toString())??"",p=_6("/content/titles/show_season/{id}/locale/en_US",{id:h});o=await ge(p,{baseURL:S6})}return{meta:CFe(i,o),imdbId:a,tmdbId:s}}function FFe(t){return["tmdb",Jl(t.type),t.id].join("-")}function oq(t){const[e,r,n]=t.split("-",3);if(e!=="tmdb")return null;let i;try{i=nE(r)}catch{return null}return{type:i,id:n}}function vA(t){return!!t.startsWith("/media/JW")}async function BFe(t){if(!vA(t))return;const e=t.split("/").slice(2),[,r,n]=e[0].split("-",3),i=nE(r),a=await sq(i,n);if(!a)return;const{tmdbId:s,imdbId:o}=a;if(!(!s&&!o)){if(o&&i===ie.MOVIE){const c=await aq(o);if(c)return`/media/tmdb-movie-${c}`}if(s)return`/media/tmdb-${r}-${s}`}}var y1=function(){return y1=Object.assign||function(e){for(var r,n=1,i=arguments.length;n[e,r],[e]);return E(Xk.Provider,{value:n,children:t.children})}function qFe(t){const[e,{height:r}]=KFe(),[n,i]=A.useContext(Xk);return A.useEffect(()=>(i(a=>[...a,{id:t,height:0}]),i(a=>{const s=a.find(o=>o.id===t);return s&&(s.height=r),a}),()=>{i(a=>a.filter(s=>s.id!==t))}),[r,t,i]),[e]}function iE(){const[t]=A.useContext(Xk);return t.reduce((e,r)=>e+r.height,0)}function XFe(t){const[e]=qFe("internet"),r={error:"bg-[#C93957] text-white"},n={error:ue.CIRCLE_EXCLAMATION};return E("div",{ref:e,children:E("div",{className:[r[t.type],"flex items-center justify-center p-1"].join(" "),children:Y("div",{className:"flex items-center space-x-3",children:[E(Ve,{icon:n[t.type]}),E("div",{children:t.children})]})})})}function QFe(){const[t,e]=A.useState(!0),r=A.useRef(!0);return A.useEffect(()=>{let n=0,i=null;const a=setInterval(()=>{if(n+=1,r.current&&n<10)return;n=0,i&&i.abort(),i=new AbortController;const s=i.signal;fetch("/ping.txt",{signal:s}).then(()=>{e(!0),r.current=!0}).catch(o=>{o.name!=="AbortError"&&(e(!1),r.current=!1)})},5e3);return()=>{clearInterval(a),i&&i.abort()}},[]),t}function ZFe(t){const{t:e}=ke(),r=QFe(),n=iE();return Y("div",{children:[E("div",{className:"fixed inset-x-0 z-[1000]",children:r?null:E(XFe,{type:"error",children:e("errors.offline")})}),E("div",{style:{paddingTop:`${n}px`},className:"flex min-h-screen flex-col",children:t.children})]})}const Ns={},uq={};async function JFe(){var t,e;for(const[r,n]of Object.values(uq)){const i=n.versions.sort((l,u)=>l.version-u.version),a=r._raw(),s=a["--version"]&&typeof a["--version"]=="number"?a["--version"]:0,o=i.filter(l=>l.version>=s);let c=a;try{for(const l of o)l.migrate&&(localStorage.setItem(`BACKUP-v${l.version}-${n.key}`,JSON.stringify(c)),c=await l.migrate(c))}catch(l){console.error(`FAILED TO MIGRATE STORE ${n.key}`,l),c=((e=(t=o[o.length-1]).create)==null?void 0:e.call(t))??{}}r.save(c)}}function e6e(t){const e=t.key??"",r=t.versions.sort((o,c)=>c.version-o.version)[0];function n(o){return Ns[e]||(Ns[e]=[]),Ns[e].push(o),{destroy(){Ns[e]=Ns[e].filter(c=>c===o)}}}function i(){var c;const o=((c=r.create)==null?void 0:c.call(r))??{};return o["--version"]=r.version,o}function a(){const o=localStorage.getItem(e);if(!o)return i();try{return JSON.parse(o)}catch(c){return console.error(`FAILED TO PARSE LOCALSTORAGE FOR KEY ${e}`,c),i()}}function s(o){const c={...o};c["--version"]=r.version,localStorage.setItem(e,JSON.stringify(c)),Ns[e]||(Ns[e]=[]),Ns[e].forEach(l=>l(window.structuredClone(o)))}return{get(){const o=a();return delete o["--version"],o},_raw(){return a()},onChange:n,save:s}}function t6e(t){var n;const e=t.versions.sort((i,a)=>i.version-a.version);if(e.forEach((i,a,s)=>{if(a!==0&&i.version!==s[a-1].version+1)throw new Error("Version list of store is not incremental")}),e.forEach(i=>{if(i.version<0)throw new Error("Versions cannot be negative")}),((n=e[0])==null?void 0:n.version)!==0)throw new Error("Version 0 doesn't exist in version list of store");if(!t.versions[t.versions.length-1].create)throw new Error("Missing create function on latest version of store");if(!t.key)throw new Error("storage key not set in store");const r=[...e];r.pop(),r.forEach(i=>{if(!i.migrate)throw new Error(`Migration missing on version ${i.version}`)})}function aE(){const t={versions:[],key:null};return{setKey(e){return t.key=e,this},addVersion(e){return t.versions.push(e),this},build(){t6e(t);const e=e6e(t);return uq[t.key??""]=[e,t],e}}}function Qk(t){const[e,r]=A.useState(t.get());A.useEffect(()=>{const{destroy:i}=t.onChange(a=>{r(a)});return()=>{i()}},[t]);function n(i){const a=i(e);t.save(a)}return[e,n]}class r6e{constructor(){this.INTERVAL_MS=2*60*1e3,this._interval=null,this._compare=null,this._storage=[]}initialize(){if(this._interval)throw new Error("cache is already initialized");this._interval=setInterval(()=>{const e=new Date;this._storage.filter(r=>!(r.expirythis._compare&&this._compare(n.key,e));if(r)return r.value}set(e,r,n){if(!this._compare)throw new Error("Compare function not set");const i=this._storage.find(s=>this._compare&&this._compare(s.key,e)),a=new Date(new Date().getTime()+n*1e3);if(i){i.key=e,i.value=r,i.expiry=a;return}this._storage.push({key:e,value:r,expiry:a})}remove(e){if(!this._compare)throw new Error("Compare function not set");this._storage.filter(r=>!(this._compare&&this._compare(r.key,e)))}clear(){this._storage=[]}}const e0=new r6e;e0.setCompare((t,e)=>t.type===e.type&&t.searchQuery.trim()===e.searchQuery.trim());e0.initialize();async function fq(t){if(e0.has(t))return e0.get(t);const{searchQuery:e,type:r}=t,i=(await PFe(e,Jl(r))).results.map(a=>{const s=DFe(a,Jl(r));return rq(s)});return e0.set(t,i,3600),i}function yA(t){return t.trim().toLowerCase().replace(/['":]/g,"").replace(/[^a-zA-Z0-9]+/g,"_")}function Zk(t,e){return yA(t)===yA(e)}async function dq(t,e){const r=(a,s)=>Math.abs(a-s)<=1,n={},i=await Promise.all(Object.values(t).map(async a=>{const s=Number(a.year.toString().split("-")[0]),c=(await fq({searchQuery:`${a.title} ${s}`,type:a.mediaType})).find(l=>r(Number(l.year),s)&&Zk(l.title,a.title));if(!c){console.error(`No item found for migration: ${a.title}`);return}return{id:a.mediaId,data:c}}));for(const a of i.filter(Boolean)){if(!a)continue;let s=[["0","0"]];if(a.data.type==="series"){const o=await v1(a.data.type,a.data.id);if(!o||!(o!=null&&o.meta.seasons))return;s=[...new Set(e!=null&&e.items?e.items.filter(u=>u.mediaId===a.id).map(u=>u.seasonId):["0"])].map(u=>{var f,d;return{num:u,season:(d=(f=o.meta)==null?void 0:f.seasons)==null?void 0:d[Math.max(0,u-1)]}}).map(u=>{var f;return u?[u.num,(f=u==null?void 0:u.season)==null?void 0:f.id]:[]}).filter(u=>u.length>0)}n[a.id]||(n[a.id]={}),await Promise.all(s.map(async([o,c])=>{o&&(n[a.id][o]=await v1(a.data.type,a.data.id,c==="0"||c===null?void 0:c))}))}return n}async function n6e(t){const e=t;if(!e)return;const r={};e.bookmarks.forEach(a=>{r[a.mediaId]||(r[a.mediaId]=a)});const n=await dq(r);return n?{bookmarks:Object.keys(n).map(a=>n[a][0]).map(a=>a==null?void 0:a.meta).filter(Boolean)}:void 0}async function i6e(t){var s,o,c,l;const e=t;if(!e)return;const r={};e.items.forEach(u=>{r[u.mediaId]||(r[u.mediaId]=u)});const n=await dq(r,e);if(!n)return;const i={...e,items:[]},a=Date.now();for(const u of e.items)if(u.mediaType==="movie"){if(!((s=n[u.mediaId][0])!=null&&s.meta))continue;const f={item:{meta:(o=n[u.mediaId][0])==null?void 0:o.meta},progress:u.progress,percentage:u.percentage,watchedAt:Date.now()};e.items=e.items.filter(d=>JSON.stringify(d)!==JSON.stringify(u)),i.items.push(f)}else if(u.mediaType==="series"){if(!((c=n[u.mediaId][u.seasonId])!=null&&c.meta))continue;const f=(l=n[u.mediaId][u.seasonId])==null?void 0:l.meta;if(f.type!=="series")return;const d={item:{meta:f,series:{episode:Number(u.episodeId),season:Number(u.seasonId),seasonId:f.seasonData.id,episodeId:f.seasonData.episodes[Number(u.episodeId)-1].id}},progress:u.progress,percentage:u.percentage,watchedAt:a+Number(u.seasonId)*1e3+Number(u.episodeId)};if(i.items.find(h=>{var p,v;return h.item.meta.id===d.item.meta.id&&((p=h.item.series)==null?void 0:p.episodeId)===((v=d.item.series)==null?void 0:v.episodeId)}))continue;e.items=e.items.filter(h=>JSON.stringify(h)!==JSON.stringify(u)),i.items.push(d)}return i}function a6e(t){return t!=null}async function hq(t,e){const r=await sq(e,t);if(!r)return;const{tmdbId:n,imdbId:i}=r;if(!(!n&&!i)){if(i&&e===ie.MOVIE){const a=await aq(i);if(a)return a}if(n)return n}}async function s6e(t){const e=t.bookmarks.map(async r=>({...r,id:await hq(r.id,r.type).catch(()=>{})}));return{bookmarks:(await Promise.all(e)).filter(r=>r.id)}}async function o6e(t){return{items:(await Promise.all(t.items.map(async r=>{try{const n=await hq(r.item.meta.id,r.item.meta.type);if(!n)return null;const i=structuredClone(r);if(i.item.meta.id=n,i.item.series){const a=i.item.series,o=(await nq(n,"show")).seasons.find(u=>u.season_number===a.season);if(!o)return null;const l=(await iq(n,o.season_number)).find(u=>u.episode_number===a.episode);if(!l)return null;i.item.series.episodeId=l.id.toString(),i.item.series.seasonId=o.id.toString()}return i}catch{return null}}))).filter(a6e)}}const l6e=aE().setKey("mw-bookmarks").addVersion({version:0,migrate(t){return n6e(t)}}).addVersion({version:1,migrate(t){return s6e(t)}}).addVersion({version:2,create(){return{bookmarks:[]}}}).build(),pq=A.createContext({setItemBookmark:()=>{},getFilteredBookmarks:()=>[],bookmarkStore:{bookmarks:[]}});function c6e(t,e){return t.findIndex(n=>n.id===e.id)}function u6e(t){const[e,r]=Qk(l6e),n=A.useMemo(()=>({setItemBookmark(i,a){r(s=>{let o=[...s.bookmarks];return o=o.filter(c=>c.id!==i.id),a&&o.push({...i}),{bookmarks:o}})},getFilteredBookmarks(){return[...e.bookmarks]},bookmarkStore:e}),[e,r]);return E(pq.Provider,{value:n,children:t.children})}function Jk(){return A.useContext(pq)}function mq(t,e){return c6e(t,e)!==-1}const gq=aE().setKey("mw-settings").addVersion({version:0,create(){return{language:"en",captionSettings:{delay:0,style:{color:"#ffffff",fontSize:25,backgroundColor:"#00000096"}}}},migrate(t){return{language:t.language,captionSettings:{language:"none",...t.captionSettings}}}}).addVersion({version:1,create(){return{language:"en",captionSettings:{delay:0,language:"none",style:{color:"#ffffff",fontSize:25,backgroundColor:"#00000096"}}}}}).build(),vq=A.createContext(null);function f6e(t){function e(a,s,o){return Math.max(a,Math.min(s,o))}const[r,n]=Qk(gq),i=A.useMemo(()=>({...r,setLanguage(s){n(o=>({...o,language:s}))},setCaptionLanguage(s){n(o=>{const c=o.captionSettings;return c.language=s,o})},setCaptionDelay(s){n(o=>{const c=o.captionSettings;return c.delay=e(-10,s,10),o})},setCaptionColor(s){n(o=>{const c=o.captionSettings.style;return c.color=s,o})},setCaptionFontSize(s){n(o=>{const c=o.captionSettings.style;return c.fontSize=e(10,s,60),o})},setCaptionBackgroundColor(s){n(o=>{const c=o.captionSettings.style;return c.backgroundColor=`${c.backgroundColor.substring(0,7)}${s.toString(16).padStart(2,"0")}`,o})}}),[r,n]);return E(vq.Provider,{value:i,children:t.children})}function sd(){return A.useContext(vq)}const d6e=aE().setKey("video-progress").addVersion({version:0,migrate(){return{items:[]}}}).addVersion({version:1,async migrate(t){return i6e(t)}}).addVersion({version:2,migrate(t){return o6e(t)}}).addVersion({version:3,create(){return{items:[]}}}).build(),h6e=15*60,p6e=5*60;function m6e(t,e,r){const n=Math.max(0,e-t);return e{},getFilteredWatched:()=>[],removeProgress:()=>{},watched:{items:[]}});sE.displayName="WatchedContext";function x1(t,e){var r,n;return t.meta.id===e.meta.id&&(!t.series||t.series.seasonId===((r=e.series)==null?void 0:r.seasonId)&&t.series.episodeId===((n=e.series)==null?void 0:n.episodeId))}function g6e(t){const[e,r]=Qk(d6e),n=A.useMemo(()=>({removeProgress(i){r(a=>{const s={...a};return s.items=s.items.filter(o=>o.item.meta.id!==i),s})},updateProgress(i,a,s){r(o=>{const c={...o};let l=c.items.find(u=>x1(i,u.item));return l||(l={item:{...i,meta:{...i.meta},series:i.series?{...i.series}:void 0},progress:0,percentage:0,watchedAt:Date.now()},c.items.push(l)),l.progress=a,l.percentage=Math.round(a/s*100),l.watchedAt=Date.now(),m6e(a,s,!!i.series)||(c.items=o.items.filter(u=>!x1(u.item,i))),c})},getFilteredWatched(){let i=e.items;const a=[];return i=i.sort((s,o)=>o.watchedAt-s.watchedAt).filter(s=>{const o=s.item.meta.id;return a.includes(o)?!1:(a.push(o),!0)}),i},watched:e}),[e,r]);return E(sE.Provider,{value:n,children:t.children})}function oE(){return A.useContext(sE)}function v6e(t,e,r){return(e==null?void 0:e.meta.type)===ie.SERIES&&r?x1(t,{meta:e.meta,series:{season:0,episode:0,episodeId:r,seasonId:e.meta.seasonData.id}}):e?x1(t,{meta:e.meta}):()=>!1}function y6e(t,e){const{watched:r,updateProgress:n}=A.useContext(sE),i=A.useMemo(()=>r.items.find(o=>v6e(o.item,t,e)),[r,t,e]),a=A.useRef([0,0]);return{updateProgress:A.useCallback((o,c)=>{var u;const l=a.current[0]!==o||a.current[1]!==c;if(t&&l){a.current=[o,c];const f={meta:t.meta,series:t.meta.type===ie.SERIES&&e?{seasonId:t.meta.seasonData.id,episodeId:e,season:t.meta.seasonData.number,episode:((u=t.meta.seasonData.episodes.find(d=>d.id===e))==null?void 0:u.number)||0}:void 0};n(f,o,c)}},[t,n,e]),watchedItem:i}}function x6e(t){return t&&typeof t=="object"&&"default"in t?t.default:t}var yq=A,b6e=x6e(yq);function w6(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function E6e(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var S6e=!!(typeof window<"u"&&window.document&&window.document.createElement);function _6e(t,e,r){if(typeof t!="function")throw new Error("Expected reducePropsToState to be a function.");if(typeof e!="function")throw new Error("Expected handleStateChangeOnClient to be a function.");if(typeof r<"u"&&typeof r!="function")throw new Error("Expected mapStateOnServer to either be undefined or a function.");function n(i){return i.displayName||i.name||"Component"}return function(a){if(typeof a!="function")throw new Error("Expected WrappedComponent to be a React component.");var s=[],o;function c(){o=t(s.map(function(u){return u.props})),l.canUseDOM?e(o):r&&(o=r(o))}var l=function(u){E6e(f,u);function f(){return u.apply(this,arguments)||this}f.peek=function(){return o},f.rewind=function(){if(f.canUseDOM)throw new Error("You may only call rewind() on the server. Call peek() to read the current state.");var p=o;return o=void 0,s=[],p};var d=f.prototype;return d.UNSAFE_componentWillMount=function(){s.push(this),c()},d.componentDidUpdate=function(){c()},d.componentWillUnmount=function(){var p=s.indexOf(this);s.splice(p,1),c()},d.render=function(){return b6e.createElement(a,this.props)},f}(yq.PureComponent);return w6(l,"displayName","SideEffect("+n(a)+")"),w6(l,"canUseDOM",S6e),l}}var w6e=_6e,T6e=typeof Element<"u",R6e=typeof Map=="function",A6e=typeof Set=="function",I6e=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Xv(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var r,n,i;if(Array.isArray(t)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(!Xv(t[n],e[n]))return!1;return!0}var a;if(R6e&&t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(a=t.entries();!(n=a.next()).done;)if(!e.has(n.value[0]))return!1;for(a=t.entries();!(n=a.next()).done;)if(!Xv(n.value[1],e.get(n.value[0])))return!1;return!0}if(A6e&&t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(a=t.entries();!(n=a.next()).done;)if(!e.has(n.value[0]))return!1;return!0}if(I6e&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(t[n]!==e[n])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf&&typeof t.valueOf=="function"&&typeof e.valueOf=="function")return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString&&typeof t.toString=="function"&&typeof e.toString=="function")return t.toString()===e.toString();if(i=Object.keys(t),r=i.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[n]))return!1;if(T6e&&t instanceof Element)return!1;for(n=r;n--!==0;)if(!((i[n]==="_owner"||i[n]==="__v"||i[n]==="__o")&&t.$$typeof)&&!Xv(t[i[n]],e[i[n]]))return!1;return!0}return t!==t&&e!==e}var $6e=function(e,r){try{return Xv(e,r)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}},Ul={BODY:"bodyAttributes",HTML:"htmlAttributes",TITLE:"titleAttributes"},we={BASE:"base",BODY:"body",HEAD:"head",HTML:"html",LINK:"link",META:"meta",NOSCRIPT:"noscript",SCRIPT:"script",STYLE:"style",TITLE:"title"};Object.keys(we).map(function(t){return we[t]});var lt={CHARSET:"charset",CSS_TEXT:"cssText",HREF:"href",HTTPEQUIV:"http-equiv",INNER_HTML:"innerHTML",ITEM_PROP:"itemprop",NAME:"name",PROPERTY:"property",REL:"rel",SRC:"src",TARGET:"target"},b1={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},B0={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate"},C6e=Object.keys(b1).reduce(function(t,e){return t[b1[e]]=e,t},{}),k6e=[we.NOSCRIPT,we.SCRIPT,we.STYLE],Ai="data-react-helmet",O6e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},L6e=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},P6e=function(){function t(e,r){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n]);return r},D6e=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t},xA=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return r===!1?String(e):String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")},M6e=function(e){var r=Ku(e,we.TITLE),n=Ku(e,B0.TITLE_TEMPLATE);if(n&&r)return n.replace(/%s/g,function(){return Array.isArray(r)?r.join(""):r});var i=Ku(e,B0.DEFAULT_TITLE);return r||i||void 0},F6e=function(e){return Ku(e,B0.ON_CHANGE_CLIENT_STATE)||function(){}},kw=function(e,r){return r.filter(function(n){return typeof n[e]<"u"}).map(function(n){return n[e]}).reduce(function(n,i){return jr({},n,i)},{})},B6e=function(e,r){return r.filter(function(n){return typeof n[we.BASE]<"u"}).map(function(n){return n[we.BASE]}).reverse().reduce(function(n,i){if(!n.length)for(var a=Object.keys(i),s=0;s=0;n--){var i=e[n];if(i.hasOwnProperty(r))return i[r]}return null},U6e=function(e){return{baseTag:B6e([lt.HREF,lt.TARGET],e),bodyAttributes:kw(Ul.BODY,e),defer:Ku(e,B0.DEFER),encode:Ku(e,B0.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:kw(Ul.HTML,e),linkTags:th(we.LINK,[lt.REL,lt.HREF],e),metaTags:th(we.META,[lt.NAME,lt.CHARSET,lt.HTTPEQUIV,lt.PROPERTY,lt.ITEM_PROP],e),noscriptTags:th(we.NOSCRIPT,[lt.INNER_HTML],e),onChangeClientState:F6e(e),scriptTags:th(we.SCRIPT,[lt.SRC,lt.INNER_HTML],e),styleTags:th(we.STYLE,[lt.CSS_TEXT],e),title:M6e(e),titleAttributes:kw(Ul.TITLE,e)}},bA=function(){var t=Date.now();return function(e){var r=Date.now();r-t>16?(t=r,e(r)):setTimeout(function(){bA(e)},0)}}(),R6=function(e){return clearTimeout(e)},j6e=typeof window<"u"?window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||bA:global.requestAnimationFrame||bA,H6e=typeof window<"u"?window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||R6:global.cancelAnimationFrame||R6,z6e=function(e){return console&&typeof console.warn=="function"&&console.warn(e)},rh=null,G6e=function(e){rh&&H6e(rh),e.defer?rh=j6e(function(){A6(e,function(){rh=null})}):(A6(e),rh=null)},A6=function(e,r){var n=e.baseTag,i=e.bodyAttributes,a=e.htmlAttributes,s=e.linkTags,o=e.metaTags,c=e.noscriptTags,l=e.onChangeClientState,u=e.scriptTags,f=e.styleTags,d=e.title,h=e.titleAttributes;EA(we.BODY,i),EA(we.HTML,a),V6e(d,h);var p={baseTag:Vc(we.BASE,n),linkTags:Vc(we.LINK,s),metaTags:Vc(we.META,o),noscriptTags:Vc(we.NOSCRIPT,c),scriptTags:Vc(we.SCRIPT,u),styleTags:Vc(we.STYLE,f)},v={},m={};Object.keys(p).forEach(function(g){var y=p[g],x=y.newTags,b=y.oldTags;x.length&&(v[g]=x),b.length&&(m[g]=p[g].oldTags)}),r&&r(),l(e,v,m)},xq=function(e){return Array.isArray(e)?e.join(""):e},V6e=function(e,r){typeof e<"u"&&document.title!==e&&(document.title=xq(e)),EA(we.TITLE,r)},EA=function(e,r){var n=document.getElementsByTagName(e)[0];if(n){for(var i=n.getAttribute(Ai),a=i?i.split(","):[],s=[].concat(a),o=Object.keys(r),c=0;c=0;d--)n.removeAttribute(s[d]);a.length===s.length?n.removeAttribute(Ai):n.getAttribute(Ai)!==o.join(",")&&n.setAttribute(Ai,o.join(","))}},Vc=function(e,r){var n=document.head||document.querySelector(we.HEAD),i=n.querySelectorAll(e+"["+Ai+"]"),a=Array.prototype.slice.call(i),s=[],o=void 0;return r&&r.length&&r.forEach(function(c){var l=document.createElement(e);for(var u in c)if(c.hasOwnProperty(u))if(u===lt.INNER_HTML)l.innerHTML=c.innerHTML;else if(u===lt.CSS_TEXT)l.styleSheet?l.styleSheet.cssText=c.cssText:l.appendChild(document.createTextNode(c.cssText));else{var f=typeof c[u]>"u"?"":c[u];l.setAttribute(u,f)}l.setAttribute(Ai,"true"),a.some(function(d,h){return o=h,l.isEqualNode(d)})?a.splice(o,1):s.push(l)}),a.forEach(function(c){return c.parentNode.removeChild(c)}),s.forEach(function(c){return n.appendChild(c)}),{oldTags:a,newTags:s}},bq=function(e){return Object.keys(e).reduce(function(r,n){var i=typeof e[n]<"u"?n+'="'+e[n]+'"':""+n;return r?r+" "+i:i},"")},W6e=function(e,r,n,i){var a=bq(n),s=xq(r);return a?"<"+e+" "+Ai+'="true" '+a+">"+xA(s,i)+"":"<"+e+" "+Ai+'="true">'+xA(s,i)+""},K6e=function(e,r,n){return r.reduce(function(i,a){var s=Object.keys(a).filter(function(l){return!(l===lt.INNER_HTML||l===lt.CSS_TEXT)}).reduce(function(l,u){var f=typeof a[u]>"u"?u:u+'="'+xA(a[u],n)+'"';return l?l+" "+f:f},""),o=a.innerHTML||a.cssText||"",c=k6e.indexOf(e)===-1;return i+"<"+e+" "+Ai+'="true" '+s+(c?"/>":">"+o+"")},"")},Eq=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.keys(e).reduce(function(n,i){return n[b1[i]||i]=e[i],n},r)},Y6e=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.keys(e).reduce(function(n,i){return n[C6e[i]||i]=e[i],n},r)},q6e=function(e,r,n){var i,a=(i={key:r},i[Ai]=!0,i),s=Eq(n,a);return[ce.createElement(we.TITLE,s,r)]},X6e=function(e,r){return r.map(function(n,i){var a,s=(a={key:i},a[Ai]=!0,a);return Object.keys(n).forEach(function(o){var c=b1[o]||o;if(c===lt.INNER_HTML||c===lt.CSS_TEXT){var l=n.innerHTML||n.cssText;s.dangerouslySetInnerHTML={__html:l}}else s[c]=n[o]}),ce.createElement(e,s)})},ka=function(e,r,n){switch(e){case we.TITLE:return{toComponent:function(){return q6e(e,r.title,r.titleAttributes)},toString:function(){return W6e(e,r.title,r.titleAttributes,n)}};case Ul.BODY:case Ul.HTML:return{toComponent:function(){return Eq(r)},toString:function(){return bq(r)}};default:return{toComponent:function(){return X6e(e,r)},toString:function(){return K6e(e,r,n)}}}},Sq=function(e){var r=e.baseTag,n=e.bodyAttributes,i=e.encode,a=e.htmlAttributes,s=e.linkTags,o=e.metaTags,c=e.noscriptTags,l=e.scriptTags,u=e.styleTags,f=e.title,d=f===void 0?"":f,h=e.titleAttributes;return{base:ka(we.BASE,r,i),bodyAttributes:ka(Ul.BODY,n,i),htmlAttributes:ka(Ul.HTML,a,i),link:ka(we.LINK,s,i),meta:ka(we.META,o,i),noscript:ka(we.NOSCRIPT,c,i),script:ka(we.SCRIPT,l,i),style:ka(we.STYLE,u,i),title:ka(we.TITLE,{title:d,titleAttributes:h},i)}},Q6e=function(e){var r,n;return n=r=function(i){N6e(a,i);function a(){return L6e(this,a),D6e(this,i.apply(this,arguments))}return a.prototype.shouldComponentUpdate=function(o){return!$6e(this.props,o)},a.prototype.mapNestedChildrenToProps=function(o,c){if(!c)return null;switch(o.type){case we.SCRIPT:case we.NOSCRIPT:return{innerHTML:c};case we.STYLE:return{cssText:c}}throw new Error("<"+o.type+" /> elements are self-closing and can not contain children. Refer to our API for more information.")},a.prototype.flattenArrayTypeChildren=function(o){var c,l=o.child,u=o.arrayTypeChildren,f=o.newChildProps,d=o.nestedChildren;return jr({},u,(c={},c[l.type]=[].concat(u[l.type]||[],[jr({},f,this.mapNestedChildrenToProps(l,d))]),c))},a.prototype.mapObjectTypeChildren=function(o){var c,l,u=o.child,f=o.newProps,d=o.newChildProps,h=o.nestedChildren;switch(u.type){case we.TITLE:return jr({},f,(c={},c[u.type]=h,c.titleAttributes=jr({},d),c));case we.BODY:return jr({},f,{bodyAttributes:jr({},d)});case we.HTML:return jr({},f,{htmlAttributes:jr({},d)})}return jr({},f,(l={},l[u.type]=jr({},d),l))},a.prototype.mapArrayTypeChildrenToProps=function(o,c){var l=jr({},c);return Object.keys(o).forEach(function(u){var f;l=jr({},l,(f={},f[u]=o[u],f))}),l},a.prototype.warnOnInvalidChildren=function(o,c){return!0},a.prototype.mapChildrenToProps=function(o,c){var l=this,u={};return ce.Children.forEach(o,function(f){if(!(!f||!f.props)){var d=f.props,h=d.children,p=T6(d,["children"]),v=Y6e(p);switch(l.warnOnInvalidChildren(f,h),f.type){case we.LINK:case we.META:case we.NOSCRIPT:case we.SCRIPT:case we.STYLE:u=l.flattenArrayTypeChildren({child:f,arrayTypeChildren:u,newChildProps:v,nestedChildren:h});break;default:c=l.mapObjectTypeChildren({child:f,newProps:c,newChildProps:v,nestedChildren:h});break}}}),c=this.mapArrayTypeChildrenToProps(u,c),c},a.prototype.render=function(){var o=this.props,c=o.children,l=T6(o,["children"]),u=jr({},l);return c&&(u=this.mapChildrenToProps(c,u)),ce.createElement(e,u)},P6e(a,null,[{key:"canUseDOM",set:function(o){e.canUseDOM=o}}]),a}(ce.Component),r.propTypes={base:be.object,bodyAttributes:be.object,children:be.oneOfType([be.arrayOf(be.node),be.node]),defaultTitle:be.string,defer:be.bool,encodeSpecialCharacters:be.bool,htmlAttributes:be.object,link:be.arrayOf(be.object),meta:be.arrayOf(be.object),noscript:be.arrayOf(be.object),onChangeClientState:be.func,script:be.arrayOf(be.object),style:be.arrayOf(be.object),title:be.string,titleAttributes:be.object,titleTemplate:be.string},r.defaultProps={defer:!0,encodeSpecialCharacters:!0},r.peek=e.peek,r.rewind=function(){var i=e.rewind();return i||(i=Sq({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}})),i},n},Z6e=function(){return null},J6e=w6e(U6e,G6e,Sq)(Z6e),va=Q6e(J6e);va.renderStatic=va.rewind;function cm(t){return E("div",{className:t.className,children:Y("div",{className:"flex flex-col items-center justify-center",children:[Y("div",{className:"flex h-12 items-center justify-center",children:[E("div",{className:"mx-1 h-2 w-2 animate-loading-pin rounded-full bg-denim-300"}),E("div",{className:"mx-1 h-2 w-2 animate-loading-pin rounded-full bg-denim-300 [animation-delay:150ms]"}),E("div",{className:"mx-1 h-2 w-2 animate-loading-pin rounded-full bg-denim-300 [animation-delay:300ms]"}),E("div",{className:"mx-1 h-2 w-2 animate-loading-pin rounded-full bg-denim-300 [animation-delay:450ms]"})]}),t.text&&t.text.length?E("p",{className:"mt-3 max-w-xs text-sm opacity-75",children:t.text}):null]})})}function lE(){const t=xc();return A.useCallback(()=>{t.action!=="POP"?t.goBack():t.push("/")},[t])}function od(t){const[e,r]=A.useState(!1),[n,i]=A.useState(!1),[a,s]=A.useState(void 0),o=A.useRef(!0),c=A.useMemo(()=>t,[]);return ce.useEffect(()=>(o.current=!0,()=>{o.current=!1}),[]),[A.useMemo(()=>async(...u)=>(r(!0),i(!1),s(void 0),new Promise(f=>{c(...u).then(d=>o.current?(i(!0),f(d),null):f(void 0)).catch(d=>{o&&(s(d),console.error("USELOADING ERROR",d),i(!1)),f(void 0)})}).finally(()=>o.current&&r(!1))),[c]),e,a,n]}let _l=[],Tu=[];function Fi(t){t.disabled||_l.push(t)}function um(t){t.disabled||Tu.push(t)}function e5e(){_l=_l.sort((i,a)=>a.rank-i.rank),Tu=Tu.sort((i,a)=>a.rank-i.rank);let t=null;_l.forEach(i=>{if(t===null){t=i.rank;return}if(t===i.rank)throw new Error(`Duplicate rank number for provider ${i.id}`);t=i.rank}),t=null,_l.forEach(i=>{if(t===null){t=i.rank;return}if(t===i.rank)throw new Error(`Duplicate rank number for embed scraper ${i.id}`);t=i.rank});const e=_l.map(i=>i.id);if(e.length>0&&new Set(e).size!==e.length)throw new Error("Duplicate IDS in providers");const r=Tu.map(i=>i.id);if(r.length>0&&new Set(r).size!==r.length)throw new Error("Duplicate IDS in embed scrapers");const n=Tu.map(i=>i.for);if(n.length>0&&new Set(n).size!==n.length)throw new Error("Duplicate types in embed scrapers")}function _q(){return _l}function t5e(){return Tu}function cE(t){return t5e().find(e=>e.for===t)??null}function r5e(t){return t.embeds=t.embeds.map(e=>[e,e.type?cE(e.type):null]).sort(([,e],[,r])=>((r==null?void 0:r.rank)??0)-((e==null?void 0:e.rank)??0)).map(e=>e[0]),t}async function wq(t,e){try{const r=await t.scrape(e);return r5e(r)}catch(r){throw console.error("Failed to run provider",r,{id:t.id,ctx:{...e}}),r}}async function eO(t,e){try{return await t.getStream(e)}catch(r){throw console.error("Failed to run embed scraper",{id:t.id,ctx:{...e}}),r}}async function n5e(t,e,r){var i,a,s;if(t.stream)return{...t.stream,providerId:e,embedId:e};let n=0;for(const o of t.embeds){if(n+=1,!o.type)continue;const c=cE(o.type);if(!c)throw new Error(`Type for embed not found: ${o.type}`);const l=[e,c.id,n].join("|");(i=r.onNext)==null||i.call(r,{id:c.id,type:"embed",eventId:l});let u;try{u=await eO(c,{url:o.url,progress(f){var d;(d=r.onProgress)==null||d.call(r,{errored:!1,eventId:l,id:c.id,percentage:f,type:"embed"})}})}catch{(a=r.onProgress)==null||a.call(r,{errored:!0,eventId:l,id:c.id,percentage:100,type:"embed"});continue}return(s=r.onProgress)==null||s.call(r,{errored:!1,eventId:l,id:c.id,percentage:100,type:"embed"}),u.providerId=e,u}return null}async function i5e(t){var r,n,i;const e=_q();for(const a of e){const s=a.id;(r=t.onNext)==null||r.call(t,{id:a.id,type:"provider",eventId:s});let o;try{let l;t.type===ie.SERIES?l={media:t.media,type:t.type,episode:t.episode,season:t.season,progress(u){var f;(f=t.onProgress)==null||f.call(t,{percentage:u,eventId:s,errored:!1,id:a.id,type:"provider"})}}:l={media:t.media,type:t.type,progress(u){var f;(f=t.onProgress)==null||f.call(t,{percentage:u,eventId:s,errored:!1,id:a.id,type:"provider"})}},o=await wq(a,l)}catch{(n=t.onProgress)==null||n.call(t,{percentage:100,errored:!0,eventId:s,id:a.id,type:"provider"});continue}(i=t.onProgress)==null||i.call(t,{errored:!1,id:a.id,eventId:s,percentage:100,type:"provider"});const c=await n5e(o,a.id,t);if(c)return c}return null}function a5e(t,e){const[r,n]=A.useState([]),[i,a]=A.useState(null),[s,o]=A.useState(!0);return A.useEffect(()=>{o(!0),a(null),n([]),(async()=>{const c=await i5e({media:t,...e,onNext(l){n(u=>[...u,{errored:!1,id:l.id,eventId:l.eventId,type:l.type,percentage:0}])},onProgress(l){n(u=>{const f=u.reverse().find(d=>d.id===l.id);return f&&(f.errored=l.errored,f.percentage=l.percentage),[...u]})}});o(!1),a(c)})()},[t,e]),{stream:i,pending:s,eventLog:r}}let s5e=t=>crypto.getRandomValues(new Uint8Array(t)),o5e=(t,e,r)=>{let n=(2<{let s="";for(;;){let o=r(i),c=i;for(;c--;)if(s+=t[o[c]&n]||"",s.length===a)return s}}},l5e=(t,e=21)=>o5e(t,e,s5e),c5e=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((e,r)=>(r&=63,r<36?e+=r.toString(36):r<62?e+=(r-26).toString(36).toUpperCase():r>62?e+="-":e+="_",e),"");const U0=new Map;function Sr(t){const e=U0.get(t);if(!e)throw new Error("invalid descriptor or has been unregistered");return e}function u5e(t){const e=t;e.mediaPlaying={isPlaying:!1,isPaused:!0,isLoading:!1,isSeeking:!1,isDragSeeking:!1,isFirstLoading:!0,hasPlayedOnce:!1,volume:e.mediaPlaying.volume,playbackSpeed:1},e.progress={time:0,duration:0,buffered:0,draggingTime:0},e.initalized=!1}function f5e(){return{interface:{popout:null,isFullscreen:!1,isFocused:!1,leftControlHovering:!1,popoutBounds:null,volumeChangedWithKeybind:!1,volumeChangedWithKeybindDebounce:null,timeFormat:0},mediaPlaying:{isPlaying:!1,isPaused:!0,isLoading:!1,isSeeking:!1,isDragSeeking:!1,isFirstLoading:!0,hasPlayedOnce:!1,volume:0,playbackSpeed:1},progress:{time:0,duration:0,buffered:0,draggingTime:0},casting:{isCasting:!1,controller:null,instance:null,player:null},meta:null,source:null,error:null,canAirplay:!1,initalized:!1,stateProviderId:"video",pausedWhenSeeking:!1,hlsInstance:null,stateProvider:null,wrapperElement:null}}function d5e(){const t=c5e();if(U0.has(t))throw new Error("duplicate id");return U0.set(t,f5e()),t}function h5e(t){U0.has(t)&&U0.delete(t)}const Tq=A.createContext("");function p5e(t){const[e,r]=A.useState(null);return A.useEffect(()=>{const n=d5e();return r(n),()=>{h5e(n)}},[r]),e?E(Tq.Provider,{value:e,children:t.children}):null}function Re(){return A.useContext(Tq)}function tO(t,e){return`_vid:::${t}:::${e}`}function bc(t,e,r){const n=new CustomEvent(tO(t,e),{detail:r});document.dispatchEvent(n)}function Ec(t,e,r){document.addEventListener(tO(t,e),r)}function Sc(t,e,r){document.removeEventListener(tO(t,e),r)}function Rq(t){return{popout:t.interface.popout,leftControlHovering:t.interface.leftControlHovering,isFocused:t.interface.isFocused,isFullscreen:t.interface.isFullscreen,popoutBounds:t.interface.popoutBounds,volumeChangedWithKeybind:t.interface.volumeChangedWithKeybind,timeFormat:t.interface.timeFormat}}function gn(t,e){bc(t,"interface",Rq(e))}function Bi(t){const e=Sr(t),[r,n]=A.useState(Rq(e));return A.useEffect(()=>{function i(a){n(a.detail)}return Ec(t,"interface",i),()=>{Sc(t,"interface",i)}},[t]),r}function Aq(t){return t.meta?{...t.meta}:null}function I6(t,e){bc(t,"meta",Aq(e))}function ui(t){const e=Sr(t),[r,n]=A.useState(Aq(e));return A.useEffect(()=>{function i(a){n(a.detail)}return Ec(t,"meta",i),()=>{Sc(t,"meta",i)}},[t]),r}function Iq(t){return{time:t.progress.time,duration:t.progress.duration,buffered:t.progress.buffered,draggingTime:t.progress.draggingTime}}function Xa(t,e){bc(t,"progress",Iq(e))}function Xo(t){const e=Sr(t),[r,n]=A.useState(Iq(e));return A.useEffect(()=>{function i(a){n(a.detail)}return Ec(t,"progress",i),()=>{Sc(t,"progress",i)}},[t]),r}function st(t){const e=Sr(t);return{getId(){var r;return((r=e.stateProvider)==null?void 0:r.getId())??""},pause(){var r;(r=e.stateProvider)==null||r.pause()},play(){var r;(r=e.stateProvider)==null||r.play()},setSource(r){var n;(n=e.stateProvider)==null||n.setSource(r)},setSeeking(r){var n;(n=e.stateProvider)==null||n.setSeeking(r)},setTime(r){var n;(n=e.stateProvider)==null||n.setTime(r)},exitFullscreen(){var r;(r=e.stateProvider)==null||r.exitFullscreen()},enterFullscreen(){var r;(r=e.stateProvider)==null||r.enterFullscreen()},setVolume(r,n=!1){var i;n&&(e.interface.volumeChangedWithKeybindDebounce&&clearTimeout(e.interface.volumeChangedWithKeybindDebounce),e.interface.volumeChangedWithKeybind=!0,gn(t,e),e.interface.volumeChangedWithKeybindDebounce=setTimeout(()=>{e.interface.volumeChangedWithKeybind=!1,gn(t,e)},3e3)),(i=e.stateProvider)==null||i.setVolume(r,n)},startAirplay(){var r;(r=e.stateProvider)==null||r.startAirplay()},setCaption(r,n){var i;(i=e.stateProvider)==null||i.setCaption(r,n)},clearCaption(){var r;(r=e.stateProvider)==null||r.clearCaption()},setLeftControlsHover(r){e.interface.leftControlHovering=r,gn(t,e)},setDraggingTime(r){e.progress.draggingTime=Math.max(0,Math.min(e.progress.duration,r)),Xa(t,e)},openPopout(r){e.interface.popout=r,gn(t,e)},closePopout(){e.interface.popout=null,gn(t,e)},setFocused(r){e.interface.isFocused=r,gn(t,e)},setMeta(r){r?e.meta=r:e.meta=null,I6(t,e)},setCurrentEpisode(r,n){e.meta&&(e.meta.episode={seasonId:r,episodeId:n},I6(t,e))},togglePictureInPicture(){var r;(r=e.stateProvider)==null||r.togglePictureInPicture(),gn(t,e)},setPlaybackSpeed(r){var n;(n=e.stateProvider)==null||n.setPlaybackSpeed(r),gn(t,e)},setTimeFormat(r){e.interface.timeFormat=r,gn(t,e)}}}function m5e(t){var r,n;const e=(n=(r=t.data)==null?void 0:r.seasons)==null?void 0:n.map(i=>{var a;return i.id===((a=t.seasonData)==null?void 0:a.id)?{...i,episodes:t.seasonData.episodes}:i});if(t.data)return{meta:t.data.meta,episode:t.data.episode,seasons:e,captions:t.linkedCaptions??[]}}function g5e(t){const e=Re(),r=st(e);return A.useEffect(()=>{r.setMeta(m5e(t))},[t,r]),null}var $q="Expected a function",$6=0/0,v5e="[object Symbol]",y5e=/^\s+|\s+$/g,x5e=/^[-+]0x[0-9a-f]+$/i,b5e=/^0b[01]+$/i,E5e=/^0o[0-7]+$/i,S5e=parseInt,_5e=typeof ve=="object"&&ve&&ve.Object===Object&&ve,w5e=typeof self=="object"&&self&&self.Object===Object&&self,T5e=_5e||w5e||Function("return this")(),R5e=Object.prototype,A5e=R5e.toString,I5e=Math.max,$5e=Math.min,Ow=function(){return T5e.Date.now()};function C5e(t,e,r){var n,i,a,s,o,c,l=0,u=!1,f=!1,d=!0;if(typeof t!="function")throw new TypeError($q);e=C6(e)||0,E1(r)&&(u=!!r.leading,f="maxWait"in r,a=f?I5e(C6(r.maxWait)||0,e):a,d="trailing"in r?!!r.trailing:d);function h(S){var w=n,R=i;return n=i=void 0,l=S,s=t.apply(R,w),s}function p(S){return l=S,o=setTimeout(g,e),u?h(S):s}function v(S){var w=S-c,R=S-l,I=e-w;return f?$5e(I,a-R):I}function m(S){var w=S-c,R=S-l;return c===void 0||w>=e||w<0||f&&R>=a}function g(){var S=Ow();if(m(S))return y(S);o=setTimeout(g,v(S))}function y(S){return o=void 0,d&&n?h(S):(n=i=void 0,s)}function x(){o!==void 0&&clearTimeout(o),l=0,n=c=i=o=void 0}function b(){return o===void 0?s:y(Ow())}function _(){var S=Ow(),w=m(S);if(n=arguments,i=this,c=S,w){if(o===void 0)return p(c);if(f)return o=setTimeout(g,e),h(c)}return o===void 0&&(o=setTimeout(g,e)),s}return _.cancel=x,_.flush=b,_}function k5e(t,e,r){var n=!0,i=!0;if(typeof t!="function")throw new TypeError($q);return E1(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),C5e(t,e,{leading:n,maxWait:e,trailing:i})}function E1(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function O5e(t){return!!t&&typeof t=="object"}function L5e(t){return typeof t=="symbol"||O5e(t)&&A5e.call(t)==v5e}function C6(t){if(typeof t=="number")return t;if(L5e(t))return $6;if(E1(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=E1(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(y5e,"");var r=b5e.test(t);return r||E5e.test(t)?S5e(t.slice(2),r?2:8):x5e.test(t)?$6:+t}var P5e=k5e;function N5e(){const t=rE();return A.useMemo(()=>Object.fromEntries(new URLSearchParams(t.search).entries()),[t])}function Cq(t){return{hasPlayedOnce:t.mediaPlaying.hasPlayedOnce,isLoading:t.mediaPlaying.isLoading,isPaused:t.mediaPlaying.isPaused,isPlaying:t.mediaPlaying.isPlaying,isSeeking:t.mediaPlaying.isSeeking,isDragSeeking:t.mediaPlaying.isDragSeeking,isFirstLoading:t.mediaPlaying.isFirstLoading,volume:t.mediaPlaying.volume,playbackSpeed:t.mediaPlaying.playbackSpeed}}function Jt(t,e){bc(t,"mediaplaying",Cq(e))}function Cn(t){const e=Sr(t),[r,n]=A.useState(Cq(e));return A.useEffect(()=>{function i(a){n(a.detail)}return Ec(t,"mediaplaying",i),()=>{Sc(t,"mediaplaying",i)}},[t]),r}function kq(t){return{canAirplay:t.canAirplay,wrapperInitialized:!!t.wrapperElement,initalized:t.initalized,isCasting:t.casting.isCasting,stateProviderId:t.stateProviderId}}function ld(t,e){bc(t,"misc",kq(e))}function Es(t){const e=Sr(t),[r,n]=A.useState(kq(e));return A.useEffect(()=>{function i(a){n(a.detail)}return Ec(t,"misc",i),()=>{Sc(t,"misc",i)}},[t]),r}function D5e(t){const e=Re(),r=Cn(e),n=Xo(e),i=st(e),a=Es(e),s=A.useRef(null),o=A.useRef(t.startAt??0),c=N5e(),l=A.useMemo(()=>P5e((d,h)=>{var p;o.current=d,(p=t.onProgress)==null||p.call(t,d,h)},1e3),[t]);A.useEffect(()=>{r.isPlaying&&(n.duration===0||n.time===0||l(n.time,n.duration))},[n,r,l]),A.useEffect(()=>()=>{l.cancel()},[l]),A.useEffect(()=>{s.current||r.isFirstLoading||Number.isNaN(n.duration)||(i.setTime(o.current),s.current=!0)},[s,t,n,r,i]);const u=A.useRef(null),f=A.useMemo(()=>a.stateProviderId,[a]);return A.useEffect(()=>{if(u.current!==f&&!r.isFirstLoading){if(u.current=f,(c.t??null)!==null){const d=c.t.toString().split(":").map(Number).reverse(),h=d[2]??0,p=Math.min(d[1]??0,59),v=Math.min(d[0]??0,p>0?59:1/0),m=h*60*60+p*60+v;i.setTime(m);return}i.setTime(o.current)}},[i,r,f,c]),A.useEffect(()=>{s.current&&r.isFirstLoading&&(s.current=null)},[r]),null}function M5e(t){const e=Re(),r=ui(e),n=xc(),i=A.useRef(null);return A.useEffect(()=>{var s,o,c,l,u;const a={episodeId:(s=r==null?void 0:r.episode)==null?void 0:s.episodeId,seasonId:(o=r==null?void 0:r.episode)==null?void 0:o.seasonId};if(i.current===null){if(!r)return;i.current=a;return}(a.episodeId!==((c=i.current)==null?void 0:c.episodeId)||a.seasonId!==((l=i.current)==null?void 0:l.seasonId))&&(i.current=a,(u=t.onSelect)==null||u.call(t,a))},[r,t,n]),null}/*! @license DOMPurify 3.0.2 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.2/LICENSE */const{entries:Oq,setPrototypeOf:k6,isFrozen:F5e,getPrototypeOf:B5e,getOwnPropertyDescriptor:U5e}=Object;let{freeze:Or,seal:Oi,create:j5e}=Object,{apply:SA,construct:_A}=typeof Reflect<"u"&&Reflect;SA||(SA=function(e,r,n){return e.apply(r,n)});Or||(Or=function(e){return e});Oi||(Oi=function(e){return e});_A||(_A=function(e,r){return new e(...r)});const H5e=Jn(Array.prototype.forEach),O6=Jn(Array.prototype.pop),nh=Jn(Array.prototype.push),Qv=Jn(String.prototype.toLowerCase),Lw=Jn(String.prototype.toString),z5e=Jn(String.prototype.match),gi=Jn(String.prototype.replace),G5e=Jn(String.prototype.indexOf),V5e=Jn(String.prototype.trim),dn=Jn(RegExp.prototype.test),Pw=W5e(TypeError);function Jn(t){return function(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i/gm),Q5e=Oi(/\${[\w\W]*}/gm),Z5e=Oi(/^data-[\-\w.\u00B7-\uFFFF]/),J5e=Oi(/^aria-[\-\w]+$/),Lq=Oi(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),eBe=Oi(/^(?:\w+script|data):/i),tBe=Oi(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Pq=Oi(/^html$/i);var M6=Object.freeze({__proto__:null,MUSTACHE_EXPR:q5e,ERB_EXPR:X5e,TMPLIT_EXPR:Q5e,DATA_ATTR:Z5e,ARIA_ATTR:J5e,IS_ALLOWED_URI:Lq,IS_SCRIPT_OR_DATA:eBe,ATTR_WHITESPACE:tBe,DOCTYPE_NAME:Pq});const rBe=()=>typeof window>"u"?null:window,nBe=function(e,r){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const i="data-tt-policy-suffix";r.currentScript&&r.currentScript.hasAttribute(i)&&(n=r.currentScript.getAttribute(i));const a="dompurify"+(n?"#"+n:"");try{return e.createPolicy(a,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}};function Nq(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:rBe();const e=pe=>Nq(pe);if(e.version="3.0.2",e.removed=[],!t||!t.document||t.document.nodeType!==9)return e.isSupported=!1,e;const r=t.document;let{document:n}=t;const{DocumentFragment:i,HTMLTemplateElement:a,Node:s,Element:o,NodeFilter:c,NamedNodeMap:l=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:u,DOMParser:f,trustedTypes:d}=t,h=o.prototype,p=Mg(h,"cloneNode"),v=Mg(h,"nextSibling"),m=Mg(h,"childNodes"),g=Mg(h,"parentNode");if(typeof a=="function"){const pe=n.createElement("template");pe.content&&pe.content.ownerDocument&&(n=pe.content.ownerDocument)}const y=nBe(d,r),x=y?y.createHTML(""):"",{implementation:b,createNodeIterator:_,createDocumentFragment:S,getElementsByTagName:w}=n,{importNode:R}=r;let I={};e.isSupported=typeof Oq=="function"&&typeof g=="function"&&b&&typeof b.createHTMLDocument<"u";const{MUSTACHE_EXPR:T,ERB_EXPR:C,TMPLIT_EXPR:L,DATA_ATTR:H,ARIA_ATTR:N,IS_SCRIPT_OR_DATA:P,ATTR_WHITESPACE:B}=M6;let{IS_ALLOWED_URI:V}=M6,M=null;const U=Ae({},[...L6,...Nw,...Dw,...Mw,...P6]);let W=null;const k=Ae({},[...N6,...Fw,...D6,...Fg]);let O=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),F=null,D=null,Q=!0,ee=!0,de=!1,oe=!0,rt=!1,Mt=!1,Mr=!1,un=!1,wt=!1,Tt=!1,Ia=!1,Rs=!0,Zo=!1;const Jo="user-content-";let el=!0,fi=!1,Ft={},Ct=null;const di=Ae({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let tl=null;const Ed=Ae({},["audio","video","img","source","image","track"]);let ji=null;const As=Ae({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),kc="http://www.w3.org/1998/Math/MathML",rl="http://www.w3.org/2000/svg",kn="http://www.w3.org/1999/xhtml";let fn=kn,$a=!1,Sd=null;const Om=Ae({},[kc,rl,kn],Lw);let Hi;const WE=["application/xhtml+xml","text/html"],KE="text/html";let Rt,Is=null;const Lm=n.createElement("form"),Pm=function(z){return z instanceof RegExp||z instanceof Function},Oc=function(z){Is&&Is===z||((!z||typeof z!="object")&&(z={}),z=Wc(z),Hi=WE.indexOf(z.PARSER_MEDIA_TYPE)===-1?Hi=KE:Hi=z.PARSER_MEDIA_TYPE,Rt=Hi==="application/xhtml+xml"?Lw:Qv,M="ALLOWED_TAGS"in z?Ae({},z.ALLOWED_TAGS,Rt):U,W="ALLOWED_ATTR"in z?Ae({},z.ALLOWED_ATTR,Rt):k,Sd="ALLOWED_NAMESPACES"in z?Ae({},z.ALLOWED_NAMESPACES,Lw):Om,ji="ADD_URI_SAFE_ATTR"in z?Ae(Wc(As),z.ADD_URI_SAFE_ATTR,Rt):As,tl="ADD_DATA_URI_TAGS"in z?Ae(Wc(Ed),z.ADD_DATA_URI_TAGS,Rt):Ed,Ct="FORBID_CONTENTS"in z?Ae({},z.FORBID_CONTENTS,Rt):di,F="FORBID_TAGS"in z?Ae({},z.FORBID_TAGS,Rt):{},D="FORBID_ATTR"in z?Ae({},z.FORBID_ATTR,Rt):{},Ft="USE_PROFILES"in z?z.USE_PROFILES:!1,Q=z.ALLOW_ARIA_ATTR!==!1,ee=z.ALLOW_DATA_ATTR!==!1,de=z.ALLOW_UNKNOWN_PROTOCOLS||!1,oe=z.ALLOW_SELF_CLOSE_IN_ATTR!==!1,rt=z.SAFE_FOR_TEMPLATES||!1,Mt=z.WHOLE_DOCUMENT||!1,wt=z.RETURN_DOM||!1,Tt=z.RETURN_DOM_FRAGMENT||!1,Ia=z.RETURN_TRUSTED_TYPE||!1,un=z.FORCE_BODY||!1,Rs=z.SANITIZE_DOM!==!1,Zo=z.SANITIZE_NAMED_PROPS||!1,el=z.KEEP_CONTENT!==!1,fi=z.IN_PLACE||!1,V=z.ALLOWED_URI_REGEXP||Lq,fn=z.NAMESPACE||kn,O=z.CUSTOM_ELEMENT_HANDLING||{},z.CUSTOM_ELEMENT_HANDLING&&Pm(z.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(O.tagNameCheck=z.CUSTOM_ELEMENT_HANDLING.tagNameCheck),z.CUSTOM_ELEMENT_HANDLING&&Pm(z.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(O.attributeNameCheck=z.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),z.CUSTOM_ELEMENT_HANDLING&&typeof z.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(O.allowCustomizedBuiltInElements=z.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),rt&&(ee=!1),Tt&&(wt=!0),Ft&&(M=Ae({},[...P6]),W=[],Ft.html===!0&&(Ae(M,L6),Ae(W,N6)),Ft.svg===!0&&(Ae(M,Nw),Ae(W,Fw),Ae(W,Fg)),Ft.svgFilters===!0&&(Ae(M,Dw),Ae(W,Fw),Ae(W,Fg)),Ft.mathMl===!0&&(Ae(M,Mw),Ae(W,D6),Ae(W,Fg))),z.ADD_TAGS&&(M===U&&(M=Wc(M)),Ae(M,z.ADD_TAGS,Rt)),z.ADD_ATTR&&(W===k&&(W=Wc(W)),Ae(W,z.ADD_ATTR,Rt)),z.ADD_URI_SAFE_ATTR&&Ae(ji,z.ADD_URI_SAFE_ATTR,Rt),z.FORBID_CONTENTS&&(Ct===di&&(Ct=Wc(Ct)),Ae(Ct,z.FORBID_CONTENTS,Rt)),el&&(M["#text"]=!0),Mt&&Ae(M,["html","head","body"]),M.table&&(Ae(M,["tbody"]),delete F.tbody),Or&&Or(z),Is=z)},Nm=Ae({},["mi","mo","mn","ms","mtext"]),Dm=Ae({},["foreignobject","desc","title","annotation-xml"]),YE=Ae({},["title","style","font","a","script"]),nl=Ae({},Nw);Ae(nl,Dw),Ae(nl,K5e);const _d=Ae({},Mw);Ae(_d,Y5e);const qE=function(z){let Z=g(z);(!Z||!Z.tagName)&&(Z={namespaceURI:fn,tagName:"template"});const se=Qv(z.tagName),Xe=Qv(Z.tagName);return Sd[z.namespaceURI]?z.namespaceURI===rl?Z.namespaceURI===kn?se==="svg":Z.namespaceURI===kc?se==="svg"&&(Xe==="annotation-xml"||Nm[Xe]):!!nl[se]:z.namespaceURI===kc?Z.namespaceURI===kn?se==="math":Z.namespaceURI===rl?se==="math"&&Dm[Xe]:!!_d[se]:z.namespaceURI===kn?Z.namespaceURI===rl&&!Dm[Xe]||Z.namespaceURI===kc&&!Nm[Xe]?!1:!_d[se]&&(YE[se]||!nl[se]):!!(Hi==="application/xhtml+xml"&&Sd[z.namespaceURI]):!1},zi=function(z){nh(e.removed,{element:z});try{z.parentNode.removeChild(z)}catch{z.remove()}},wd=function(z,Z){try{nh(e.removed,{attribute:Z.getAttributeNode(z),from:Z})}catch{nh(e.removed,{attribute:null,from:Z})}if(Z.removeAttribute(z),z==="is"&&!W[z])if(wt||Tt)try{zi(Z)}catch{}else try{Z.setAttribute(z,"")}catch{}},Td=function(z){let Z,se;if(un)z=""+z;else{const On=z5e(z,/^[\r\n\t ]+/);se=On&&On[0]}Hi==="application/xhtml+xml"&&fn===kn&&(z=''+z+"");const Xe=y?y.createHTML(z):z;if(fn===kn)try{Z=new f().parseFromString(Xe,Hi)}catch{}if(!Z||!Z.documentElement){Z=b.createDocument(fn,"template",null);try{Z.documentElement.innerHTML=$a?x:Xe}catch{}}const Bt=Z.body||Z.documentElement;return z&&se&&Bt.insertBefore(n.createTextNode(se),Bt.childNodes[0]||null),fn===kn?w.call(Z,Mt?"html":"body")[0]:Mt?Z.documentElement:Bt},ur=function(z){return _.call(z.ownerDocument||z,z,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null,!1)},Gi=function(z){return z instanceof u&&(typeof z.nodeName!="string"||typeof z.textContent!="string"||typeof z.removeChild!="function"||!(z.attributes instanceof l)||typeof z.removeAttribute!="function"||typeof z.setAttribute!="function"||typeof z.namespaceURI!="string"||typeof z.insertBefore!="function"||typeof z.hasChildNodes!="function")},il=function(z){return typeof s=="object"?z instanceof s:z&&typeof z=="object"&&typeof z.nodeType=="number"&&typeof z.nodeName=="string"},hi=function(z,Z,se){I[z]&&H5e(I[z],Xe=>{Xe.call(e,Z,se,Is)})},kL=function(z){let Z;if(hi("beforeSanitizeElements",z,null),Gi(z))return zi(z),!0;const se=Rt(z.nodeName);if(hi("uponSanitizeElement",z,{tagName:se,allowedTags:M}),z.hasChildNodes()&&!il(z.firstElementChild)&&(!il(z.content)||!il(z.content.firstElementChild))&&dn(/<[/\w]/g,z.innerHTML)&&dn(/<[/\w]/g,z.textContent))return zi(z),!0;if(!M[se]||F[se]){if(!F[se]&&LL(se)&&(O.tagNameCheck instanceof RegExp&&dn(O.tagNameCheck,se)||O.tagNameCheck instanceof Function&&O.tagNameCheck(se)))return!1;if(el&&!Ct[se]){const Xe=g(z)||z.parentNode,Bt=m(z)||z.childNodes;if(Bt&&Xe){const On=Bt.length;for(let mt=On-1;mt>=0;--mt)Xe.insertBefore(p(Bt[mt],!0),v(z))}}return zi(z),!0}return z instanceof o&&!qE(z)||(se==="noscript"||se==="noembed")&&dn(/<\/no(script|embed)/i,z.innerHTML)?(zi(z),!0):(rt&&z.nodeType===3&&(Z=z.textContent,Z=gi(Z,T," "),Z=gi(Z,C," "),Z=gi(Z,L," "),z.textContent!==Z&&(nh(e.removed,{element:z.cloneNode()}),z.textContent=Z)),hi("afterSanitizeElements",z,null),!1)},OL=function(z,Z,se){if(Rs&&(Z==="id"||Z==="name")&&(se in n||se in Lm))return!1;if(!(ee&&!D[Z]&&dn(H,Z))){if(!(Q&&dn(N,Z))){if(!W[Z]||D[Z]){if(!(LL(z)&&(O.tagNameCheck instanceof RegExp&&dn(O.tagNameCheck,z)||O.tagNameCheck instanceof Function&&O.tagNameCheck(z))&&(O.attributeNameCheck instanceof RegExp&&dn(O.attributeNameCheck,Z)||O.attributeNameCheck instanceof Function&&O.attributeNameCheck(Z))||Z==="is"&&O.allowCustomizedBuiltInElements&&(O.tagNameCheck instanceof RegExp&&dn(O.tagNameCheck,se)||O.tagNameCheck instanceof Function&&O.tagNameCheck(se))))return!1}else if(!ji[Z]){if(!dn(V,gi(se,B,""))){if(!((Z==="src"||Z==="xlink:href"||Z==="href")&&z!=="script"&&G5e(se,"data:")===0&&tl[z])){if(!(de&&!dn(P,gi(se,B,"")))){if(se)return!1}}}}}}return!0},LL=function(z){return z.indexOf("-")>0},PL=function(z){let Z,se,Xe,Bt;hi("beforeSanitizeAttributes",z,null);const{attributes:On}=z;if(!On)return;const mt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:W};for(Bt=On.length;Bt--;){Z=On[Bt];const{name:Vi,namespaceURI:XE}=Z;if(se=Vi==="value"?Z.value:V5e(Z.value),Xe=Rt(Vi),mt.attrName=Xe,mt.attrValue=se,mt.keepAttr=!0,mt.forceKeepAttr=void 0,hi("uponSanitizeAttribute",z,mt),se=mt.attrValue,mt.forceKeepAttr||(wd(Vi,z),!mt.keepAttr))continue;if(!oe&&dn(/\/>/i,se)){wd(Vi,z);continue}rt&&(se=gi(se,T," "),se=gi(se,C," "),se=gi(se,L," "));const NL=Rt(z.nodeName);if(OL(NL,Xe,se)){if(Zo&&(Xe==="id"||Xe==="name")&&(wd(Vi,z),se=Jo+se),y&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!XE)switch(d.getAttributeType(NL,Xe)){case"TrustedHTML":se=y.createHTML(se);break;case"TrustedScriptURL":se=y.createScriptURL(se);break}try{XE?z.setAttributeNS(XE,Vi,se):z.setAttribute(Vi,se),O6(e.removed)}catch{}}}hi("afterSanitizeAttributes",z,null)},Mee=function pe(z){let Z;const se=ur(z);for(hi("beforeSanitizeShadowDOM",z,null);Z=se.nextNode();)hi("uponSanitizeShadowNode",Z,null),!kL(Z)&&(Z.content instanceof i&&pe(Z.content),PL(Z));hi("afterSanitizeShadowDOM",z,null)};return e.sanitize=function(pe){let z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Z,se,Xe,Bt;if($a=!pe,$a&&(pe=""),typeof pe!="string"&&!il(pe)){if(typeof pe.toString!="function")throw Pw("toString is not a function");if(pe=pe.toString(),typeof pe!="string")throw Pw("dirty is not a string, aborting")}if(!e.isSupported)return pe;if(Mr||Oc(z),e.removed=[],typeof pe=="string"&&(fi=!1),fi){if(pe.nodeName){const Vi=Rt(pe.nodeName);if(!M[Vi]||F[Vi])throw Pw("root node is forbidden and cannot be sanitized in-place")}}else if(pe instanceof s)Z=Td(""),se=Z.ownerDocument.importNode(pe,!0),se.nodeType===1&&se.nodeName==="BODY"||se.nodeName==="HTML"?Z=se:Z.appendChild(se);else{if(!wt&&!rt&&!Mt&&pe.indexOf("<")===-1)return y&&Ia?y.createHTML(pe):pe;if(Z=Td(pe),!Z)return wt?null:Ia?x:""}Z&&un&&zi(Z.firstChild);const On=ur(fi?pe:Z);for(;Xe=On.nextNode();)kL(Xe)||(Xe.content instanceof i&&Mee(Xe.content),PL(Xe));if(fi)return pe;if(wt){if(Tt)for(Bt=S.call(Z.ownerDocument);Z.firstChild;)Bt.appendChild(Z.firstChild);else Bt=Z;return(W.shadowroot||W.shadowrootmod)&&(Bt=R.call(r,Bt,!0)),Bt}let mt=Mt?Z.outerHTML:Z.innerHTML;return Mt&&M["!doctype"]&&Z.ownerDocument&&Z.ownerDocument.doctype&&Z.ownerDocument.doctype.name&&dn(Pq,Z.ownerDocument.doctype.name)&&(mt=" +`+mt),rt&&(mt=gi(mt,T," "),mt=gi(mt,C," "),mt=gi(mt,L," ")),y&&Ia?y.createHTML(mt):mt},e.setConfig=function(pe){Oc(pe),Mr=!0},e.clearConfig=function(){Is=null,Mr=!1},e.isValidAttribute=function(pe,z,Z){Is||Oc({});const se=Rt(pe),Xe=Rt(z);return OL(se,Xe,Z)},e.addHook=function(pe,z){typeof z=="function"&&(I[pe]=I[pe]||[],nh(I[pe],z))},e.removeHook=function(pe){if(I[pe])return O6(I[pe])},e.removeHooks=function(pe){I[pe]&&(I[pe]=[])},e.removeAllHooks=function(){I={}},e}var iBe=Nq();class aBe{constructor({name:e,build:r,detect:n,helper:i,parse:a}){this.name=e,this.helper=i,this.build=r,this.detect=s=>{if(typeof s!="string")throw new Error("Expected string content!");return n(s)},this.parse=(s,o)=>{if(typeof s!="string")throw new Error("Expected string content!");return a(s,o)}}}const Ss=t=>new aBe(t),sBe="ssa",Sf={toMilliseconds:t=>{const e=/^\s*(\d+:)?(\d{1,2}):(\d{1,2})(?:[.,](\d{1,3}))?\s*$/.exec(t);if(!e)throw new Error(`Invalid time format: ${t}`);const r=e[1]?parseInt(e[1].replace(":","")):0,n=parseInt(e[2]),i=parseInt(e[3]),a=e[4]?parseInt(e[4]):0;return r*3600*1e3+n*60*1e3+i*1e3+a*10},toTimeString:t=>{const e=Math.floor(t/1e3/3600),r=Math.floor(t/1e3/60%60),n=Math.floor(t/1e3%60),i=Math.floor(t%1e3/10);return`${e}:${r<10?"0":""}${r}:${n<10?"0":""}${n}.${i<10?"0":""}${i}`}},Dq=(t,e)=>{let r,n=null;const i=[],a=e.eol||`\r +`,s=t.split(/\r?\n\s*\n/);for(let o=0;o_.split(S,w).join(S).length)(m,",",n.length-1)+1;y.content=m.substring(b),y.data.Text=y.content,y.text=y.content.replace(/\\N/g,a).replace(/\{[^}]+\}/g,""),i.push(y)}}}}}e.verbose&&console.log("WARN: Unknown part",s[o])}return i},Mq=(t,e)=>{const r=e.eol||`\r +`,n=e.format==="ass";let i="";i+=`[Script Info]${r}`,i+=`; Script generated by subsrt ${r}`,i+=`ScriptType: v4.00${n?"+":""}${r}`,i+=`Collisions: Normal${r}`,i+=r,n?(i+=`[V4+ Styles]${r}`,i+=`Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding${r}`,i+=`Style: DefaultVCD, Arial,28,&H00B4FCFC,&H00B4FCFC,&H00000008,&H80000008,-1,0,0,0,100,100,0.00,0.00,1,1.00,2.00,2,30,30,30,0${r}`):(i+=`[V4 Styles]${r}`,i+=`Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, TertiaryColour, BackColour, Bold, Italic, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding${r}`,i+=`Style: DefaultVCD, Arial,28,11861244,11861244,11861244,-2147483640,-1,0,1,1,2,2,30,30,30,0,0${r}`),i+=r,i+=`[Events]${r}`,i+=`Format: ${n?"Layer":"Marked"}, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text${r}`;for(let a=0;a/^\s*\[Script Info\]\r?\n/.test(t)&&/\s*\[Events\]\r?\n/.test(t)?t.indexOf("[V4+ Styles]")>0?"ass":"ssa":!1,oBe=Ss({name:sBe,build:Mq,detect:Fq,helper:Sf,parse:Dq}),lBe="ass",cBe=Ss({name:lBe,build:Mq,detect:Fq,helper:Sf,parse:Dq}),uBe="json",fBe=(t,e)=>JSON.parse(t),dBe=(t,e)=>JSON.stringify(t,void 0,2),hBe=t=>{try{const e=JSON.parse(t);return Array.isArray(e)&&e.length>0&&typeof e[0]=="object"}catch{return!1}},pBe=Ss({name:uBe,build:dBe,detect:hBe,parse:fBe}),mBe="lrc",rO={toMilliseconds:t=>{const e=/^\s*(\d+):(\d{1,2})(?:[.,](\d{1,3}))?\s*$/.exec(t);if(!e)throw new Error(`Invalid time format: ${t}`);const r=parseInt(e[1]),n=parseInt(e[2]),i=e[3]?parseInt(e[3]):0;return r*60*1e3+n*1e3+i*10},toTimeString:t=>{const e=Math.floor(t/1e3/60),r=Math.floor(t/1e3%60),n=Math.floor(t%1e3);return`${(e<10?"0":"")+e}:${r<10?"0":""}${r}.${n<100?"0":""}${n<10?"0":Math.floor(n/10)}`}},gBe=(t,e)=>{let r=null;const n=[],i=t.split(/\r?\n/);for(let a=0;a{let r="",n=!1;const i=e.eol||`\r +`;for(let a=0;a/\r?\n\[\d+:\d{1,2}(?:[.,]\d{1,3})?\].*\r?\n/.test(t),xBe=Ss({name:mBe,build:vBe,detect:yBe,helper:rO,parse:gBe}),bBe="sbv",j0={toMilliseconds:t=>{const e=/^\s*(\d{1,2}):(\d{1,2}):(\d{1,2})(?:[.,](\d{1,3}))?\s*$/.exec(t);if(!e)throw new Error(`Invalid time format: ${t}`);const r=parseInt(e[1]),n=parseInt(e[2]),i=parseInt(e[3]),a=e[4]?parseInt(e[4]):0;return r*3600*1e3+n*60*1e3+i*1e3+a},toTimeString:t=>{const e=Math.floor(t/1e3/3600),r=Math.floor(t/1e3/60%60),n=Math.floor(t/1e3%60),i=Math.floor(t%1e3);return`${(e<10?"0":"")+e}:${r<10?"0":""}${r}:${n<10?"0":""}${n}.${i<100?"0":""}${i<10?"0":""}${i}`}},EBe=(t,e)=>{const r=[],n=e.eol||`\r +`,i=t.split(/\r?\n\s*\n/);for(let a=0;a>[^:]+:\s*/g,""),r.push(c);continue}e.verbose&&console.log("WARN: Unknown part",i[a])}return r},SBe=(t,e)=>{let r="";const n=e.eol||`\r +`;for(let i=0;i/\d{1,2}:\d{1,2}:\d{1,2}(?:[.,]\d{1,3})?\s*[,;]\s*\d{1,2}:\d{1,2}:\d{1,2}(?:[.,]\d{1,3})?/.test(t),wBe=Ss({name:bBe,build:SBe,detect:_Be,helper:j0,parse:EBe}),Bq="smi",nO={htmlEncode:t=>t.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">").replace(/\r?\n/g,"
"),htmlDecode:(t,e)=>t.replace(//gi,e||`\r +`).replace(/ /g," ").replace(/"/g,'"').replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")},TBe=(t,e)=>{if(e.format&&e.format!==Bq)throw new Error(`Invalid format: ${e.format}`);const r=[],n=e.eol||`\r +`,i=/]*>([\s\S]*)<\/TITLE>/i.exec(t);if(i){const l={};l.type="meta",l.name="title",l.data=i[1].replace(/^\s*/g,"").replace(/\s*$/g,""),r.push(l)}const a=/]*>([\s\S]*)<\/STYLE>/i.exec(t);if(a){const l={};l.type="meta",l.name="style",l.data=a[1],r.push(l)}const s=t.replace(/^[\s\S]*]*>/gi,"").replace(/<\/BODY[^>]*>[\s\S]*$/gi,"");let o=null;const c=s.split(/]+Start\s*=\s*["']?(\d+)[^\d>]*>([\s\S]*)/i.exec(u);if(f){const d={};d.type="caption",d.start=parseInt(f[1]),d.end=d.start+2e3,d.duration=d.end-d.start,d.content=f[2].replace(/^<\/SYNC[^>]*>/gi,"");let h=!0;const p=/^([\s\S]*)/i.exec(d.content)||/^]*)>([\s\S]*)/i.exec(d.content);if(p){let v=p[2].replace(/\s+/gi,n).replace(//gi,n).replace(/<[^>]+>/g,""),v=v.replace(/^\s+/g,"").replace(/\s+$/g,""),h=v.replace(/ /gi," ").replace(/\s+/g,"").length===0,d.text=nO.htmlDecode(v,n)}!e.preserveSpaces&&h?e.verbose&&console.log(`INFO: Skipping white space caption at ${d.start}`):r.push(d),o&&(o.end=d.start,o.duration=o.end-o.start),o=d;continue}e.verbose&&console.log("WARN: Unknown part",c[l])}return r},RBe=(t,e)=>{const r=e.eol||`\r +`;let n="";n+=`${r}`,n+=`${r}`,n+=`${e.title||""}${r}`,n+=`${r}`,n+=`${r}`,n+=`${r}`;for(let i=0;i${r}`,n+=`

${nO.htmlEncode(a.text||"")}${e.closeTags?"

":""}${r}`,e.closeTags&&(n+=`
${r}`),n+=`${r}`,n+=`

 ${e.closeTags?"

":""}${r}`,e.closeTags&&(n+=`
${r}`);continue}e.verbose&&console.log("SKIP:",a)}}return n+=`${r}`,n+=`${r}`,n},ABe=t=>/]*>[\s\S]*]*>/.test(t),IBe=Ss({name:Bq,build:RBe,detect:ABe,helper:nO,parse:TBe}),$Be="srt",H0={toMilliseconds:t=>{const e=/^\s*(\d{1,2}):(\d{1,2}):(\d{1,2})(?:[.,](\d{1,3}))?\s*$/.exec(t);if(!e)throw new Error(`Invalid time format: ${t}`);const r=parseInt(e[1]),n=parseInt(e[2]),i=parseInt(e[3]),a=e[4]?parseInt(e[4]):0;return r*3600*1e3+n*60*1e3+i*1e3+a},toTimeString:t=>{const e=Math.floor(t/1e3/3600),r=Math.floor(t/1e3/60%60),n=Math.floor(t/1e3%60),i=Math.floor(t%1e3);return`${(e<10?"0":"")+e}:${r<10?"0":""}${r}:${n<10?"0":""}${n},${i<100?"0":""}${i<10?"0":""}${i}`}},CBe=(t,e)=>{const r=[],n=e.eol||`\r +`,i=t.split(/\r?\n\s*\n/g);for(let a=0;a\s*(\d{1,2}:\d{1,2}:\d{1,2}(?:[.,]\d{1,3})?)\r?\n([\s\S]*)$/.exec(i[a]);if(o){const c={};c.type="caption",c.index=parseInt(o[1]),c.start=H0.toMilliseconds(o[2]),c.end=H0.toMilliseconds(o[3]),c.duration=c.end-c.start;const l=o[4].split(/\r?\n/);c.content=l.join(n),c.text=c.content.replace(/<[^>]+>/g,"").replace(/\{[^}]+\}/g,"").replace(/>>[^:]*:\s*/g,""),r.push(c);continue}e.verbose&&console.log("WARN: Unknown part",i[a])}return r},kBe=(t,e)=>{let r="";const n=e.eol||`\r +`;for(let i=0;i ${H0.toTimeString(a.end)}${n}`,r+=a.text+n,r+=n;continue}e.verbose&&console.log("SKIP:",a)}return r},OBe=t=>/\d+\r?\n\d{1,2}:\d{1,2}:\d{1,2}(?:[.,]\d{1,3})?\s*-->\s*\d{1,2}:\d{1,2}:\d{1,2}(?:[.,]\d{1,3})?/.test(t),LBe=Ss({name:$Be,build:kBe,detect:OBe,helper:H0,parse:CBe}),PBe="sub",wA=25,NBe=(t,e)=>{e.fps||(e.fps=wA);const r=e.fps>0?e.fps:wA,n=[],i=e.eol||`\r +`,a=t.split(/\r?\n/g);for(let s=0;s{const r=(e.fps||0)>0?e.fps:wA;let n="";const i=e.eol||`\r +`;for(let a=0;a=0?s.frame.start:s.start*r,c=typeof s.frame=="object"&&s.frame.end>=0?s.frame.end:s.end*r,l=s.text.replace(/\r?\n/,"|");n+=`{${o}}{${c}}${l}${i}`;continue}e.verbose&&console.log("SKIP:",s)}return n},MBe=t=>/^\{\d+\}\{\d+\}.*/.test(t),FBe=Ss({name:PBe,build:DBe,detect:MBe,parse:NBe}),BBe="vtt",z0={toMilliseconds:t=>{const e=/^\s*(\d{1,2}:)?(\d{1,2}):(\d{1,2})(?:[.,](\d{1,3}))?\s*$/.exec(t);if(!e)throw new Error(`Invalid time format: ${t}`);const r=e[1]?parseInt(e[1].replace(":","")):0,n=parseInt(e[2]),i=parseInt(e[3]),a=e[4]?parseInt(e[4]):0;return r*3600*1e3+n*60*1e3+i*1e3+a},toTimeString:t=>{const e=Math.floor(t/1e3/3600),r=Math.floor(t/1e3/60%60),n=Math.floor(t/1e3%60),i=Math.floor(t%1e3);return`${(e<10?"0":"")+e}:${r<10?"0":""}${r}:${n<10?"0":""}${n}.${i<100?"0":""}${i<10?"0":""}${i}`}},UBe=(t,e)=>{let r=1;const n=[],i=t.split(/\r?\n\s*\n/);for(const a of i){const o=/^([^\r\n]+\r?\n)?((?:\d{1,2}:)?\d{1,2}:\d{1,2}(?:[.,]\d{1,3})?)\s*-->\s*((?:\d{1,2}:)?\d{1,2}:\d{1,2}(?:[.,]\d{1,3})?)[^\S\r\n]?.*\r?\n([\s\S]*)$/.exec(a);if(o){const l={};l.type="caption",l.index=r++,o[1]&&(l.cue=o[1].replace(/[\r\n]*/g,"")),l.start=z0.toMilliseconds(o[2]),l.end=z0.toMilliseconds(o[3]),l.duration=l.end-l.start,l.content=o[4],l.text=l.content.replace(/<[^>]+>/g,"").replace(/\{[^}]+\}/g,""),n.push(l);continue}const c=/^([A-Z]+)(\r?\n([\s\S]*))?$/.exec(a)||/^([A-Z]+)\s+([^\r\n]*)$/.exec(a);if(c){const l={};l.type="meta",l.name=c[1],c[3]&&(l.data=c[3]),n.push(l);continue}e.verbose&&console.log("WARN: Unknown part",a)}return n},jBe=(t,e)=>{const r=e.eol||`\r +`;let n=`WEBVTT${r}${r}`;for(let i=0;i ${z0.toTimeString(a.end)}${r}`,n+=a.text+r,n+=r;continue}e.verbose&&console.log("SKIP:",a)}return n},HBe=t=>/^\s*WEBVTT\r?\n/.test(t),zBe=Ss({name:BBe,build:jBe,detect:HBe,helper:z0,parse:UBe}),GBe={vtt:zBe,lrc:xBe,smi:IBe,ssa:oBe,ass:cBe,sub:FBe,srt:LBe,sbv:wBe,json:pBe},VBe=t=>JSON.parse(JSON.stringify(t));class WBe{constructor(){this.format=GBe,this.list=()=>Object.keys(this.format),this.detect=e=>{const r=this.list();for(let n=0;n"u"||typeof a.detect!="function")continue;const s=a.detect(e);if(s===!0||s===i)return i}return""},this.parse=(e,r={})=>{const n=r.format||this.detect(e);if(!n||n.trim().length===0)throw new Error("Cannot determine subtitle format!");const i=this.format[n];if(typeof i>"u")throw new Error(`Unsupported subtitle format: ${n}`);const a=i.parse;if(typeof a!="function")throw new Error(`Subtitle format does not support 'parse' op: ${n}`);return a(e,r)},this.build=(e,r={})=>{const n=r.format||"srt";if(!n||n.trim().length===0)throw new Error("Cannot determine subtitle format!");const i=this.format[n];if(typeof i>"u")throw new Error(`Unsupported subtitle format: ${n}`);const a=i.build;if(typeof a!="function")throw new Error(`Subtitle format does not support 'build' op: ${n}`);return a(e,r)},this.convert=(e,r={})=>{let n={};typeof r=="string"?n.to=r:n=r;const i={format:n.from||void 0,verbose:n.verbose,eol:n.eol};let a=this.parse(e,i);n.resync&&(a=this.resync(a,n.resync));const s={format:n.to||n.format,verbose:n.verbose,eol:n.eol};return this.build(a,s)},this.resync=(e,r={})=>{let n,i,a=!1,s;if(typeof r=="function")n=r;else if(typeof r=="number")s=r,n=c=>[c[0]+s,c[1]+s];else if(typeof r=="object")s=(r.offset||0)*(r.frame?r.fps||25:1),i=r.ratio||1,a=r.frame||!1,n=c=>[Math.round(c[0]*i+s),Math.round(c[1]*i+s)];else throw new Error("Argument 'options' not defined!");const o=[];for(let c=0;c(t.MP4="mp4",t.HLS="hls",t))(Yt||{}),Li=(t=>(t.VTT="vtt",t.SRT="srt",t.LRC="lrc",t.SBV="sbv",t.SUB="sub",t.SSA="ssa",t.ASS="ass",t.JSON="json",t.UNKNOWN="unknown",t))(Li||{}),Ge=(t=>(t.Q360P="360p",t.Q540P="540p",t.Q480P="480p",t.Q720P="720p",t.Q1080P="1080p",t.QUNKNOWN="unknown",t))(Ge||{});const ih="external-custom";function TA(t,e){return e?`linked-${t.langIso}`:`external-${t.langIso}`}const iO=YBe().map(t=>`.${t}`);function Uq(t){return iO.some(e=>t.endsWith(e))}function ZBe(t){if(!Uq(t))return Li.UNKNOWN;const e=iO.find(r=>t.endsWith(r));return e?e.slice(1):Li.UNKNOWN}const JBe=iBe.sanitize;async function jq(t){let e;t.url.startsWith("blob:")?e=await(await fetch(t.url)).blob():t.needsProxy?e=await ge(t.url,{responseType:"blob"}):e=await qk(t.url,{responseType:"blob"});const r=await e.text(),n=QBe(r,"vtt");return URL.createObjectURL(new Blob([n],{type:"text/vtt"}))}function S1(t){t&&t.startsWith("blob:")&&URL.revokeObjectURL(t)}function Hq(t){const e=t.trim();if(e==="")throw new Error("Given text is empty");if(qBe(e)==="")throw new Error("Invalid subtitle format");return XBe(e).filter(r=>r.type==="caption")}const _1=[{id:"none",englishName:"None",name:"None",nativeName:"Lorem ipsum"},{id:"pirate",englishName:"Pirate",name:"Pirate English",nativeName:"Pirate English"},{id:"aa",englishName:"Afar",name:"Afar - Afaraf",nativeName:"Afaraf"},{id:"ab",englishName:"Abkhaz",name:"Abkhaz - Аҧсуа бызшәа",nativeName:"Аҧсуа бызшәа"},{id:"ae",englishName:"Avestan",name:"Avestan - Avesta",nativeName:"Avesta"},{id:"af",englishName:"Afrikaans",name:"Afrikaans - Afrikaans",nativeName:"Afrikaans"},{id:"ak",englishName:"Akan",name:"Akan - Akan",nativeName:"Akan"},{id:"am",englishName:"Amharic",name:"Amharic - አማርኛ",nativeName:"አማርኛ"},{id:"an",englishName:"Aragonese",name:"Aragonese - Aragonés",nativeName:"Aragonés"},{id:"ar",englishName:"Arabic",name:"Arabic - اللغة العربية",nativeName:"اللغة العربية"},{id:"as",englishName:"Assamese",name:"Assamese - অসমীয়া",nativeName:"অসমীয়া"},{id:"av",englishName:"Avaric",name:"Avaric - Авар мацӀ",nativeName:"Авар мацӀ"},{id:"ay",englishName:"Aymara",name:"Aymara - Aymar aru",nativeName:"Aymar aru"},{id:"az",englishName:"Azerbaijani",name:"Azerbaijani - Azərbaycan dili",nativeName:"Azərbaycan dili"},{id:"ba",englishName:"Bashkir",name:"Bashkir - Башҡорт теле",nativeName:"Башҡорт теле"},{id:"be",englishName:"Belarusian",name:"Belarusian - Беларуская мова",nativeName:"Беларуская мова"},{id:"bg",englishName:"Bulgarian",name:"Bulgarian - Български език",nativeName:"Български език"},{id:"bh",englishName:"Bihari",name:"Bihari - भोजपुरी",nativeName:"भोजपुरी"},{id:"bi",englishName:"Bislama",name:"Bislama - Bislama",nativeName:"Bislama"},{id:"bm",englishName:"Bambara",name:"Bambara - Bamanankan",nativeName:"Bamanankan"},{id:"bn",englishName:"Bengali",name:"Bengali - বাংলা",nativeName:"বাংলা"},{id:"bo",englishName:"Tibetan Standard",name:"Tibetan Standard - བོད་ཡིག",nativeName:"བོད་ཡིག"},{id:"br",englishName:"Breton",name:"Breton - Brezhoneg",nativeName:"Brezhoneg"},{id:"bs",englishName:"Bosnian",name:"Bosnian - Bosanski jezik",nativeName:"Bosanski jezik"},{id:"ca",englishName:"Catalan",name:"Catalan - Català",nativeName:"Català"},{id:"ce",englishName:"Chechen",name:"Chechen - Нохчийн мотт",nativeName:"Нохчийн мотт"},{id:"ch",englishName:"Chamorro",name:"Chamorro - Chamoru",nativeName:"Chamoru"},{id:"co",englishName:"Corsican",name:"Corsican - Corsu",nativeName:"Corsu"},{id:"cr",englishName:"Cree",name:"Cree - ᓀᐦᐃᔭᐍᐏᐣ",nativeName:"ᓀᐦᐃᔭᐍᐏᐣ"},{id:"cs",englishName:"Czech",name:"Czech - Čeština",nativeName:"Čeština"},{id:"cu",englishName:"Old Church Slavonic",name:"Old Church Slavonic - Ѩзыкъ словѣньскъ",nativeName:"Ѩзыкъ словѣньскъ"},{id:"cv",englishName:"Chuvash",name:"Chuvash - Чӑваш чӗлхи",nativeName:"Чӑваш чӗлхи"},{id:"cy",englishName:"Welsh",name:"Welsh - Cymraeg",nativeName:"Cymraeg"},{id:"da",englishName:"Danish",name:"Danish - Dansk",nativeName:"Dansk"},{id:"de",englishName:"German",name:"German - Deutsch",nativeName:"Deutsch"},{id:"dv",englishName:"Divehi",name:"Divehi - Dhivehi",nativeName:"Dhivehi"},{id:"dz",englishName:"Dzongkha",name:"Dzongkha - རྫོང་ཁ",nativeName:"རྫོང་ཁ"},{id:"ee",englishName:"Ewe",name:"Ewe - Eʋegbe",nativeName:"Eʋegbe"},{id:"el",englishName:"Greek",name:"Greek - Ελληνικά",nativeName:"Ελληνικά"},{id:"en",englishName:"English",name:"English - English",nativeName:"English"},{id:"eo",englishName:"Esperanto",name:"Esperanto - Esperanto",nativeName:"Esperanto"},{id:"es",englishName:"Spanish",name:"Spanish - Español",nativeName:"Español"},{id:"et",englishName:"Estonian",name:"Estonian - Eesti",nativeName:"Eesti"},{id:"eu",englishName:"Basque",name:"Basque - Euskara",nativeName:"Euskara"},{id:"fa",englishName:"Persian",name:"Persian - فارسی",nativeName:"فارسی"},{id:"ff",englishName:"Fula",name:"Fula - Fulfulde",nativeName:"Fulfulde"},{id:"fi",englishName:"Finnish",name:"Finnish - Suomi",nativeName:"Suomi"},{id:"fj",englishName:"Fijian",name:"Fijian - Vakaviti",nativeName:"Vakaviti"},{id:"fo",englishName:"Faroese",name:"Faroese - Føroyskt",nativeName:"Føroyskt"},{id:"fr",englishName:"French",name:"French - Français",nativeName:"Français"},{id:"fy",englishName:"Western Frisian",name:"Western Frisian - Frysk",nativeName:"Frysk"},{id:"ga",englishName:"Irish",name:"Irish - Gaeilge",nativeName:"Gaeilge"},{id:"gd",englishName:"Scottish Gaelic",name:"Scottish Gaelic - Gàidhlig",nativeName:"Gàidhlig"},{id:"gl",englishName:"Galician",name:"Galician - Galego",nativeName:"Galego"},{id:"gn",englishName:"Guaraní",name:"Guaraní - Avañeẽ",nativeName:"Avañeẽ"},{id:"gu",englishName:"Gujarati",name:"Gujarati - ગુજરાતી",nativeName:"ગુજરાતી"},{id:"gv",englishName:"Manx",name:"Manx - Gaelg",nativeName:"Gaelg"},{id:"ha",englishName:"Hausa",name:"Hausa - هَوُسَ",nativeName:"هَوُسَ"},{id:"he",englishName:"Hebrew",name:"Hebrew - עברית",nativeName:"עברית"},{id:"hi",englishName:"Hindi",name:"Hindi - हिन्दी",nativeName:"हिन्दी"},{id:"ho",englishName:"Hiri Motu",name:"Hiri Motu - Hiri Motu",nativeName:"Hiri Motu"},{id:"hr",englishName:"Croatian",name:"Croatian - Hrvatski jezik",nativeName:"Hrvatski jezik"},{id:"ht",englishName:"Haitian",name:"Haitian - Kreyòl ayisyen",nativeName:"Kreyòl ayisyen"},{id:"hu",englishName:"Hungarian",name:"Hungarian - Magyar",nativeName:"Magyar"},{id:"hy",englishName:"Armenian",name:"Armenian - Հայերեն",nativeName:"Հայերեն"},{id:"hz",englishName:"Herero",name:"Herero - Otjiherero",nativeName:"Otjiherero"},{id:"ia",englishName:"Interlingua",name:"Interlingua - Interlingua",nativeName:"Interlingua"},{id:"id",englishName:"Indonesian",name:"Indonesian - Indonesian",nativeName:"Indonesian"},{id:"ie",englishName:"Interlingue",name:"Interlingue - Interlingue",nativeName:"Interlingue"},{id:"ig",englishName:"Igbo",name:"Igbo - Asụsụ Igbo",nativeName:"Asụsụ Igbo"},{id:"ii",englishName:"Nuosu",name:"Nuosu - ꆈꌠ꒿ Nuosuhxop",nativeName:"ꆈꌠ꒿ Nuosuhxop"},{id:"ik",englishName:"Inupiaq",name:"Inupiaq - Iñupiaq",nativeName:"Iñupiaq"},{id:"io",englishName:"Ido",name:"Ido - Ido",nativeName:"Ido"},{id:"is",englishName:"Icelandic",name:"Icelandic - Íslenska",nativeName:"Íslenska"},{id:"it",englishName:"Italian",name:"Italian - Italiano",nativeName:"Italiano"},{id:"iu",englishName:"Inuktitut",name:"Inuktitut - ᐃᓄᒃᑎᑐᑦ",nativeName:"ᐃᓄᒃᑎᑐᑦ"},{id:"ja",englishName:"Japanese",name:"Japanese - 日本語",nativeName:"日本語"},{id:"jv",englishName:"Javanese",name:"Javanese - Basa Jawa",nativeName:"Basa Jawa"},{id:"ka",englishName:"Georgian",name:"Georgian - Ქართული",nativeName:"Ქართული"},{id:"kg",englishName:"Kongo",name:"Kongo - Kikongo",nativeName:"Kikongo"},{id:"ki",englishName:"Kikuyu",name:"Kikuyu - Gĩkũyũ",nativeName:"Gĩkũyũ"},{id:"kj",englishName:"Kwanyama",name:"Kwanyama - Kuanyama",nativeName:"Kuanyama"},{id:"kk",englishName:"Kazakh",name:"Kazakh - Қазақ тілі",nativeName:"Қазақ тілі"},{id:"kl",englishName:"Kalaallisut",name:"Kalaallisut - Kalaallisut",nativeName:"Kalaallisut"},{id:"km",englishName:"Khmer",name:"Khmer - ខេមរភាសា",nativeName:"ខេមរភាសា"},{id:"kn",englishName:"Kannada",name:"Kannada - ಕನ್ನಡ",nativeName:"ಕನ್ನಡ"},{id:"ko",englishName:"Korean",name:"Korean - 한국어",nativeName:"한국어"},{id:"kr",englishName:"Kanuri",name:"Kanuri - Kanuri",nativeName:"Kanuri"},{id:"ks",englishName:"Kashmiri",name:"Kashmiri - कश्मीरी",nativeName:"कश्मीरी"},{id:"ku",englishName:"Kurdish",name:"Kurdish - Kurdî",nativeName:"Kurdî"},{id:"kv",englishName:"Komi",name:"Komi - Коми кыв",nativeName:"Коми кыв"},{id:"kw",englishName:"Cornish",name:"Cornish - Kernewek",nativeName:"Kernewek"},{id:"ky",englishName:"Kyrgyz",name:"Kyrgyz - Кыргызча",nativeName:"Кыргызча"},{id:"la",englishName:"Latin",name:"Latin - Latine",nativeName:"Latine"},{id:"lb",englishName:"Luxembourgish",name:"Luxembourgish - Lëtzebuergesch",nativeName:"Lëtzebuergesch"},{id:"lg",englishName:"Ganda",name:"Ganda - Luganda",nativeName:"Luganda"},{id:"li",englishName:"Limburgish",name:"Limburgish - Limburgs",nativeName:"Limburgs"},{id:"ln",englishName:"Lingala",name:"Lingala - Lingála",nativeName:"Lingála"},{id:"lo",englishName:"Lao",name:"Lao - ພາສາ",nativeName:"ພາສາ"},{id:"lt",englishName:"Lithuanian",name:"Lithuanian - Lietuvių kalba",nativeName:"Lietuvių kalba"},{id:"lu",englishName:"Luba-Katanga",name:"Luba-Katanga - Tshiluba",nativeName:"Tshiluba"},{id:"lv",englishName:"Latvian",name:"Latvian - Latviešu valoda",nativeName:"Latviešu valoda"},{id:"mg",englishName:"Malagasy",name:"Malagasy - Fiteny malagasy",nativeName:"Fiteny malagasy"},{id:"mh",englishName:"Marshallese",name:"Marshallese - Kajin M̧ajeļ",nativeName:"Kajin M̧ajeļ"},{id:"mi",englishName:"Māori",name:"Māori - Te reo Māori",nativeName:"Te reo Māori"},{id:"mk",englishName:"Macedonian",name:"Macedonian - Македонски јазик",nativeName:"Македонски јазик"},{id:"ml",englishName:"Malayalam",name:"Malayalam - മലയാളം",nativeName:"മലയാളം"},{id:"mn",englishName:"Mongolian",name:"Mongolian - Монгол хэл",nativeName:"Монгол хэл"},{id:"mr",englishName:"Marathi",name:"Marathi - मराठी",nativeName:"मराठी"},{id:"ms",englishName:"Malay",name:"Malay - هاس ملايو‎",nativeName:"هاس ملايو‎"},{id:"mt",englishName:"Maltese",name:"Maltese - Malti",nativeName:"Malti"},{id:"my",englishName:"Burmese",name:"Burmese - ဗမာစာ",nativeName:"ဗမာစာ"},{id:"na",englishName:"Nauru",name:"Nauru - Ekakairũ Naoero",nativeName:"Ekakairũ Naoero"},{id:"nb",englishName:"Norwegian Bokmål",name:"Norwegian Bokmål - Norsk bokmål",nativeName:"Norsk bokmål"},{id:"nd",englishName:"Northern Ndebele",name:"Northern Ndebele - IsiNdebele",nativeName:"IsiNdebele"},{id:"ne",englishName:"Nepali",name:"Nepali - नेपाली",nativeName:"नेपाली"},{id:"ng",englishName:"Ndonga",name:"Ndonga - Owambo",nativeName:"Owambo"},{id:"nl",englishName:"Dutch",name:"Dutch - Nederlands",nativeName:"Nederlands"},{id:"nn",englishName:"Norwegian Nynorsk",name:"Norwegian Nynorsk - Norsk nynorsk",nativeName:"Norsk nynorsk"},{id:"no",englishName:"Norwegian",name:"Norwegian - Norsk",nativeName:"Norsk"},{id:"nr",englishName:"Southern Ndebele",name:"Southern Ndebele - IsiNdebele",nativeName:"IsiNdebele"},{id:"nv",englishName:"Navajo",name:"Navajo - Diné bizaad",nativeName:"Diné bizaad"},{id:"ny",englishName:"Chichewa",name:"Chichewa - ChiCheŵa",nativeName:"ChiCheŵa"},{id:"oc",englishName:"Occitan",name:"Occitan - Occitan",nativeName:"Occitan"},{id:"oj",englishName:"Ojibwe",name:"Ojibwe - ᐊᓂᔑᓈᐯᒧᐎᓐ",nativeName:"ᐊᓂᔑᓈᐯᒧᐎᓐ"},{id:"om",englishName:"Oromo",name:"Oromo - Afaan Oromoo",nativeName:"Afaan Oromoo"},{id:"or",englishName:"Oriya",name:"Oriya - ଓଡ଼ିଆ",nativeName:"ଓଡ଼ିଆ"},{id:"os",englishName:"Ossetian",name:"Ossetian - Ирон æвзаг",nativeName:"Ирон æвзаг"},{id:"pa",englishName:"Panjabi",name:"Panjabi - ਪੰਜਾਬੀ",nativeName:"ਪੰਜਾਬੀ"},{id:"pi",englishName:"Pāli",name:"Pāli - पाऴि",nativeName:"पाऴि"},{id:"pl",englishName:"Polish",name:"Polish - Język polski",nativeName:"Język polski"},{id:"ps",englishName:"Pashto",name:"Pashto - پښتو",nativeName:"پښتو"},{id:"pt",englishName:"Portuguese",name:"Portuguese - Português",nativeName:"Português"},{id:"qu",englishName:"Quechua",name:"Quechua - Runa Simi",nativeName:"Runa Simi"},{id:"rm",englishName:"Romansh",name:"Romansh - Rumantsch grischun",nativeName:"Rumantsch grischun"},{id:"rn",englishName:"Kirundi",name:"Kirundi - Ikirundi",nativeName:"Ikirundi"},{id:"ro",englishName:"Romanian",name:"Romanian - Română",nativeName:"Română"},{id:"ru",englishName:"Russian",name:"Russian - Русский",nativeName:"Русский"},{id:"rw",englishName:"Kinyarwanda",name:"Kinyarwanda - Ikinyarwanda",nativeName:"Ikinyarwanda"},{id:"sa",englishName:"Sanskrit",name:"Sanskrit - संस्कृतम्",nativeName:"संस्कृतम्"},{id:"sc",englishName:"Sardinian",name:"Sardinian - Sardu",nativeName:"Sardu"},{id:"sd",englishName:"Sindhi",name:"Sindhi - सिन्धी",nativeName:"सिन्धी"},{id:"se",englishName:"Northern Sami",name:"Northern Sami - Davvisámegiella",nativeName:"Davvisámegiella"},{id:"sg",englishName:"Sango",name:"Sango - Yângâ tî sängö",nativeName:"Yângâ tî sängö"},{id:"si",englishName:"Sinhala",name:"Sinhala - සිංහල",nativeName:"සිංහල"},{id:"sk",englishName:"Slovak",name:"Slovak - Slovenčina",nativeName:"Slovenčina"},{id:"sl",englishName:"Slovene",name:"Slovene - Slovenski jezik",nativeName:"Slovenski jezik"},{id:"sm",englishName:"Samoan",name:"Samoan - Gagana faa Samoa",nativeName:"Gagana faa Samoa"},{id:"sn",englishName:"Shona",name:"Shona - ChiShona",nativeName:"ChiShona"},{id:"so",englishName:"Somali",name:"Somali - Soomaaliga",nativeName:"Soomaaliga"},{id:"sq",englishName:"Albanian",name:"Albanian - Shqip",nativeName:"Shqip"},{id:"sr",englishName:"Serbian",name:"Serbian - Српски језик",nativeName:"Српски језик"},{id:"ss",englishName:"Swati",name:"Swati - SiSwati",nativeName:"SiSwati"},{id:"st",englishName:"Southern Sotho",name:"Southern Sotho - Sesotho",nativeName:"Sesotho"},{id:"su",englishName:"Sundanese",name:"Sundanese - Basa Sunda",nativeName:"Basa Sunda"},{id:"sv",englishName:"Swedish",name:"Swedish - Svenska",nativeName:"Svenska"},{id:"sw",englishName:"Swahili",name:"Swahili - Kiswahili",nativeName:"Kiswahili"},{id:"ta",englishName:"Tamil",name:"Tamil - தமிழ்",nativeName:"தமிழ்"},{id:"te",englishName:"Telugu",name:"Telugu - తెలుగు",nativeName:"తెలుగు"},{id:"tg",englishName:"Tajik",name:"Tajik - Тоҷикӣ",nativeName:"Тоҷикӣ"},{id:"th",englishName:"Thai",name:"Thai - ไทย",nativeName:"ไทย"},{id:"ti",englishName:"Tigrinya",name:"Tigrinya - ትግርኛ",nativeName:"ትግርኛ"},{id:"tk",englishName:"Turkmen",name:"Turkmen - Türkmen",nativeName:"Türkmen"},{id:"tl",englishName:"Tagalog",name:"Tagalog - Wikang Tagalog",nativeName:"Wikang Tagalog"},{id:"tn",englishName:"Tswana",name:"Tswana - Setswana",nativeName:"Setswana"},{id:"to",englishName:"Tonga",name:"Tonga - Faka Tonga",nativeName:"Faka Tonga"},{id:"tr",englishName:"Turkish",name:"Turkish - Türkçe",nativeName:"Türkçe"},{id:"ts",englishName:"Tsonga",name:"Tsonga - Xitsonga",nativeName:"Xitsonga"},{id:"tt",englishName:"Tatar",name:"Tatar - Татар теле",nativeName:"Татар теле"},{id:"tw",englishName:"Twi",name:"Twi - Twi",nativeName:"Twi"},{id:"ty",englishName:"Tahitian",name:"Tahitian - Reo Tahiti",nativeName:"Reo Tahiti"},{id:"ug",englishName:"Uyghur",name:"Uyghur - ئۇيغۇرچە‎",nativeName:"ئۇيغۇرچە‎"},{id:"uk",englishName:"Ukrainian",name:"Ukrainian - Українська",nativeName:"Українська"},{id:"ur",englishName:"Urdu",name:"Urdu - اردو",nativeName:"اردو"},{id:"uz",englishName:"Uzbek",name:"Uzbek - Ўзбек",nativeName:"Ўзбек"},{id:"ve",englishName:"Venda",name:"Venda - Tshivenḓa",nativeName:"Tshivenḓa"},{id:"vi",englishName:"Vietnamese",name:"Vietnamese - Tiếng Việt",nativeName:"Tiếng Việt"},{id:"vo",englishName:"Volapük",name:"Volapük - Volapük",nativeName:"Volapük"},{id:"wa",englishName:"Walloon",name:"Walloon - Walon",nativeName:"Walon"},{id:"wo",englishName:"Wolof",name:"Wolof - Wollof",nativeName:"Wollof"},{id:"xh",englishName:"Xhosa",name:"Xhosa - IsiXhosa",nativeName:"IsiXhosa"},{id:"yi",englishName:"Yiddish",name:"Yiddish - ייִדיש",nativeName:"ייִדיש"},{id:"yo",englishName:"Yoruba",name:"Yoruba - Yorùbá",nativeName:"Yorùbá"},{id:"za",englishName:"Zhuang",name:"Zhuang - Saɯ cueŋƅ",nativeName:"Saɯ cueŋƅ"},{id:"zh",englishName:"Chinese",name:"Chinese - 中文",nativeName:"中文"},{id:"zu",englishName:"Zulu",name:"Zulu - IsiZulu",nativeName:"IsiZulu"}];function eUe(t){const e=Es(t);return{initialized:A.useMemo(()=>!!e.initalized,[e])}}async function tUe(t){for(let e=0;e{if(i.current||!n)return;r.setSource(t);const s=_1.find(c=>c.id===a.language);if(!s)return;const o=t.captions.filter(c=>c.langIso.indexOf(s.englishName)!==-1||c.langIso.indexOf(s.nativeName)!==-1);o&&(tUe(o).then(c=>{if(!c)return;const l=TA(c.caption,!0);r.setCaption(l,c.blobUrl)}),i.current=!0)},[t,r,n,a.language]),null}function zq(t){const{t:e}=ke();return Y("div",{className:`flex items-center space-x-2 rounded-full bg-bink-300 bg-opacity-50 px-4 py-2 text-bink-600 ${t.clickable?"transition-[transform,background-color] hover:scale-105 hover:bg-bink-400 hover:text-bink-700 active:scale-95":""}`,children:[E(Ve,{className:"text-xl",icon:ue.MOVIE_WEB}),E("span",{className:["font-semibold text-white",t.hideTextOnMobile?"hidden sm:block":""].join(" "),children:e("global.name")})]})}function Aa(t){const[e,r]=A.useState(!1),n=A.useRef(!1);return A.useEffect(()=>{function i(){const a=t?window.innerHeight<600:window.innerWidth<1024;n.current!==a&&(n.current=a,r(a))}return i(),window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i)}},[t]),{isMobile:e}}const _s=A.forwardRef((t,e)=>E("div",{className:t.className,ref:e,children:E("button",{type:"button",onClick:t.onClick,className:["group pointer-events-auto p-2 text-white transition-transform duration-100 active:scale-110",t.disabled?"pointer-events-none cursor-not-allowed opacity-50":""].join(" "),children:Y("div",{className:["flex items-center justify-center rounded-full bg-denim-600 bg-opacity-0 transition-colors duration-100",t.active?"!bg-denim-500 !bg-opacity-100":"",t.noPadding?"":t.wide?"p-2 sm:px-4":"p-2",t.disabled?"":"group-hover:bg-opacity-50 group-active:bg-denim-500 group-active:bg-opacity-100"].join(" "),children:[E(Ve,{icon:t.icon,className:t.iconSize??"text-2xl"}),E("p",{className:"hidden sm:block",children:t.text?E("span",{className:"ml-2",children:t.text}):null})]})})}));function Gq(t){const e=Re(),r=st(e),n=Es(e),i=A.useCallback(()=>{r.startAirplay()},[r]);return n.canAirplay?E(_s,{className:t.className,onClick:i,icon:ue.AIRPLAY}):null}function Vq(t){const[e,r]=A.useState(!1),n=Re(),a=Es(n).isCasting,s=A.useRef(null),o=A.useCallback(c=>{const l=(c.getAttribute("style")??"").includes("inline");r(!l)},[r]);return A.useEffect(()=>{var u;const c=(u=s.current)==null?void 0:u.querySelector("google-cast-launcher");if(!c)return;const l=new MutationObserver(()=>{o(c)});return l.observe(c,{attributes:!0,attributeFilter:["style"]}),o(c),()=>{l.disconnect()}},[o]),E(_s,{ref:s,className:[t.className??"","google-cast-button",a?"casting":"",e?"hidden":""].join(" "),icon:ue.CASTING,onClick:c=>{const l=c.currentTarget.querySelector("google-cast-launcher");l&&l.click()}})}function _c(t){const{isMobile:e}=Aa(),{bookmarkStore:r,setItemBookmark:n}=Jk(),i=t.media?mq(r.bookmarks,t.media):!1,a=t.media&&t.onClick,{t:s}=ke(),o=iE();return Y("div",{className:"flex items-center",style:{paddingTop:t.isFullScreen?`${o}px`:void 0},children:[Y("div",{className:"flex min-w-0 flex-1 items-center",children:[Y("p",{className:"flex items-center truncate",children:[t.onClick?Y("span",{onClick:t.onClick,className:"flex cursor-pointer items-center py-1 text-white opacity-50 transition-opacity hover:opacity-100",children:[E(Ve,{className:"mr-2",icon:ue.ARROW_LEFT}),e?E("span",{children:s("videoPlayer.backToHomeShort")}):E("span",{children:s("videoPlayer.backToHome")})]}):null,a?E("span",{className:"mx-4 h-6 w-[1.5px] rotate-[30deg] bg-white opacity-50"}):null,t.media?E("span",{className:"truncate text-white",children:t.media.title}):null]}),t.media&&E(nn,{clickable:!0,transparent:!0,icon:i?ue.BOOKMARK:ue.BOOKMARK_OUTLINE,className:"ml-2 text-white",onClick:()=>t.media&&n(t.media,!i)})]}),t.showControls?Y(xr,{children:[E(Gq,{}),E(Vq,{})]}):E(zq,{hideTextOnMobile:!0})]})}var nUe=Object.defineProperty,iUe=(t,e,r)=>e in t?nUe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Bw=(t,e,r)=>(iUe(t,typeof e!="symbol"?e+"":e,r),r);let aUe=class{constructor(){Bw(this,"current",this.detect()),Bw(this,"handoffState","pending"),Bw(this,"currentId",0)}set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},jl=new aUe,ei=(t,e)=>{jl.isServer?A.useEffect(t,e):A.useLayoutEffect(t,e)};function ts(t){let e=A.useRef(t);return ei(()=>{e.current=t},[t]),e}function Wq(t,e){let[r,n]=A.useState(t),i=ts(t);return ei(()=>n(i.current),[i,n,...e]),r}function sUe(t){typeof queueMicrotask=="function"?queueMicrotask(t):Promise.resolve().then(t).catch(e=>setTimeout(()=>{throw e}))}function Po(){let t=[],e={addEventListener(r,n,i,a){return r.addEventListener(n,i,a),e.add(()=>r.removeEventListener(n,i,a))},requestAnimationFrame(...r){let n=requestAnimationFrame(...r);return e.add(()=>cancelAnimationFrame(n))},nextFrame(...r){return e.requestAnimationFrame(()=>e.requestAnimationFrame(...r))},setTimeout(...r){let n=setTimeout(...r);return e.add(()=>clearTimeout(n))},microTask(...r){let n={current:!0};return sUe(()=>{n.current&&r[0]()}),e.add(()=>{n.current=!1})},style(r,n,i){let a=r.style.getPropertyValue(n);return Object.assign(r.style,{[n]:i}),this.add(()=>{Object.assign(r.style,{[n]:a})})},group(r){let n=Po();return r(n),this.add(()=>n.dispose())},add(r){return t.push(r),()=>{let n=t.indexOf(r);if(n>=0)for(let i of t.splice(n,1))i()}},dispose(){for(let r of t.splice(0))r()}};return e}function _f(){let[t]=A.useState(Po);return A.useEffect(()=>()=>t.dispose(),[t]),t}let Ke=function(t){let e=ts(t);return ce.useCallback((...r)=>e.current(...r),[e])};function aO(){let[t,e]=A.useState(jl.isHandoffComplete);return t&&jl.isHandoffComplete===!1&&e(!1),A.useEffect(()=>{t!==!0&&e(!0)},[t]),A.useEffect(()=>jl.handoff(),[]),t}var F6;let uE=(F6=ce.useId)!=null?F6:function(){let t=aO(),[e,r]=ce.useState(t?()=>jl.nextId():null);return ei(()=>{e===null&&r(jl.nextId())},[e]),e!=null?""+e:void 0};function rr(t,e,...r){if(t in e){let i=e[t];return typeof i=="function"?i(...r):i}let n=new Error(`Tried to handle "${t}" but there is no handler defined. Only defined handlers are: ${Object.keys(e).map(i=>`"${i}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,rr),n}function Kq(t){return jl.isServer?null:t instanceof Node?t.ownerDocument:t!=null&&t.hasOwnProperty("current")&&t.current instanceof Node?t.current.ownerDocument:document}let B6=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(t=>`${t}:not([tabindex='-1'])`).join(",");var oUe=(t=>(t[t.First=1]="First",t[t.Previous=2]="Previous",t[t.Next=4]="Next",t[t.Last=8]="Last",t[t.WrapAround=16]="WrapAround",t[t.NoScroll=32]="NoScroll",t))(oUe||{}),lUe=(t=>(t[t.Error=0]="Error",t[t.Overflow=1]="Overflow",t[t.Success=2]="Success",t[t.Underflow=3]="Underflow",t))(lUe||{}),cUe=(t=>(t[t.Previous=-1]="Previous",t[t.Next=1]="Next",t))(cUe||{}),sO=(t=>(t[t.Strict=0]="Strict",t[t.Loose=1]="Loose",t))(sO||{});function Yq(t,e=0){var r;return t===((r=Kq(t))==null?void 0:r.body)?!1:rr(e,{[0](){return t.matches(B6)},[1](){let n=t;for(;n!==null;){if(n.matches(B6))return!0;n=n.parentElement}return!1}})}var uUe=(t=>(t[t.Keyboard=0]="Keyboard",t[t.Mouse=1]="Mouse",t))(uUe||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",t=>{t.metaKey||t.altKey||t.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",t=>{t.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:t.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function fUe(t,e=r=>r){return t.slice().sort((r,n)=>{let i=e(r),a=e(n);if(i===null||a===null)return 0;let s=i.compareDocumentPosition(a);return s&Node.DOCUMENT_POSITION_FOLLOWING?-1:s&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Uw(t,e,r){let n=ts(e);A.useEffect(()=>{function i(a){n.current(a)}return document.addEventListener(t,i,r),()=>document.removeEventListener(t,i,r)},[t,r])}function dUe(t,e,r=!0){let n=A.useRef(!1);A.useEffect(()=>{requestAnimationFrame(()=>{n.current=r})},[r]);function i(s,o){if(!n.current||s.defaultPrevented)return;let c=function u(f){return typeof f=="function"?u(f()):Array.isArray(f)||f instanceof Set?f:[f]}(t),l=o(s);if(l!==null&&l.getRootNode().contains(l)){for(let u of c){if(u===null)continue;let f=u instanceof HTMLElement?u:u.current;if(f!=null&&f.contains(l)||s.composed&&s.composedPath().includes(f))return}return!Yq(l,sO.Loose)&&l.tabIndex!==-1&&s.preventDefault(),e(s,l)}}let a=A.useRef(null);Uw("mousedown",s=>{var o,c;n.current&&(a.current=((c=(o=s.composedPath)==null?void 0:o.call(s))==null?void 0:c[0])||s.target)},!0),Uw("click",s=>{a.current&&(i(s,()=>a.current),a.current=null)},!0),Uw("blur",s=>i(s,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function U6(t){var e;if(t.type)return t.type;let r=(e=t.as)!=null?e:"button";if(typeof r=="string"&&r.toLowerCase()==="button")return"button"}function hUe(t,e){let[r,n]=A.useState(()=>U6(t));return ei(()=>{n(U6(t))},[t.type,t.as]),ei(()=>{r||e.current&&e.current instanceof HTMLButtonElement&&!e.current.hasAttribute("type")&&n("button")},[r,e]),r}let pUe=Symbol();function wc(...t){let e=A.useRef(t);A.useEffect(()=>{e.current=t},[t]);let r=Ke(n=>{for(let i of e.current)i!=null&&(typeof i=="function"?i(n):i.current=n)});return t.every(n=>n==null||(n==null?void 0:n[pUe]))?void 0:r}function mUe(t){throw new Error("Unexpected object: "+t)}var Jr=(t=>(t[t.First=0]="First",t[t.Previous=1]="Previous",t[t.Next=2]="Next",t[t.Last=3]="Last",t[t.Specific=4]="Specific",t[t.Nothing=5]="Nothing",t))(Jr||{});function gUe(t,e){let r=e.resolveItems();if(r.length<=0)return null;let n=e.resolveActiveIndex(),i=n??-1,a=(()=>{switch(t.focus){case 0:return r.findIndex(s=>!e.resolveDisabled(s));case 1:{let s=r.slice().reverse().findIndex((o,c,l)=>i!==-1&&l.length-c-1>=i?!1:!e.resolveDisabled(o));return s===-1?s:r.length-1-s}case 2:return r.findIndex((s,o)=>o<=i?!1:!e.resolveDisabled(s));case 3:{let s=r.slice().reverse().findIndex(o=>!e.resolveDisabled(o));return s===-1?s:r.length-1-s}case 4:return r.findIndex(s=>e.resolveId(s)===t.id);case 5:return null;default:mUe(t)}})();return a===-1?n:a}function RA(...t){return t.filter(Boolean).join(" ")}var w1=(t=>(t[t.None=0]="None",t[t.RenderStrategy=1]="RenderStrategy",t[t.Static=2]="Static",t))(w1||{}),Qa=(t=>(t[t.Unmount=0]="Unmount",t[t.Hidden=1]="Hidden",t))(Qa||{});function Qo({ourProps:t,theirProps:e,slot:r,defaultTag:n,features:i,visible:a=!0,name:s}){let o=qq(e,t);if(a)return Bg(o,r,n,s);let c=i??0;if(c&2){let{static:l=!1,...u}=o;if(l)return Bg(u,r,n,s)}if(c&1){let{unmount:l=!0,...u}=o;return rr(l?0:1,{[0](){return null},[1](){return Bg({...u,hidden:!0,style:{display:"none"}},r,n,s)}})}return Bg(o,r,n,s)}function Bg(t,e={},r,n){let{as:i=r,children:a,refName:s="ref",...o}=jw(t,["unmount","static"]),c=t.ref!==void 0?{[s]:t.ref}:{},l=typeof a=="function"?a(e):a;"className"in o&&o.className&&typeof o.className=="function"&&(o.className=o.className(e));let u={};if(e){let f=!1,d=[];for(let[h,p]of Object.entries(e))typeof p=="boolean"&&(f=!0),p===!0&&d.push(h);f&&(u["data-headlessui-state"]=d.join(" "))}if(i===A.Fragment&&Object.keys(AA(o)).length>0){if(!A.isValidElement(l)||Array.isArray(l)&&l.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${n} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(o).map(p=>` - ${p}`).join(` +`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(p=>` - ${p}`).join(` +`)].join(` +`));let f=l.props,d=typeof(f==null?void 0:f.className)=="function"?(...p)=>RA(f==null?void 0:f.className(...p),o.className):RA(f==null?void 0:f.className,o.className),h=d?{className:d}:{};return A.cloneElement(l,Object.assign({},qq(l.props,AA(jw(o,["ref"]))),u,c,vUe(l.ref,c.ref),h))}return A.createElement(i,Object.assign({},jw(o,["ref"]),i!==A.Fragment&&c,i!==A.Fragment&&u),l)}function vUe(...t){return{ref:t.every(e=>e==null)?void 0:e=>{for(let r of t)r!=null&&(typeof r=="function"?r(e):r.current=e)}}}function qq(...t){if(t.length===0)return{};if(t.length===1)return t[0];let e={},r={};for(let n of t)for(let i in n)i.startsWith("on")&&typeof n[i]=="function"?(r[i]!=null||(r[i]=[]),r[i].push(n[i])):e[i]=n[i];if(e.disabled||e["aria-disabled"])return Object.assign(e,Object.fromEntries(Object.keys(r).map(n=>[n,void 0])));for(let n in r)Object.assign(e,{[n](i,...a){let s=r[n];for(let o of s){if((i instanceof Event||(i==null?void 0:i.nativeEvent)instanceof Event)&&i.defaultPrevented)return;o(i,...a)}}});return e}function ws(t){var e;return Object.assign(A.forwardRef(t),{displayName:(e=t.displayName)!=null?e:t.name})}function AA(t){let e=Object.assign({},t);for(let r in e)e[r]===void 0&&delete e[r];return e}function jw(t,e=[]){let r=Object.assign({},t);for(let n of e)n in r&&delete r[n];return r}function yUe(t){let e=t.parentElement,r=null;for(;e&&!(e instanceof HTMLFieldSetElement);)e instanceof HTMLLegendElement&&(r=e),e=e.parentElement;let n=(e==null?void 0:e.getAttribute("disabled"))==="";return n&&xUe(r)?!1:n}function xUe(t){if(!t)return!1;let e=t.previousElementSibling;for(;e!==null;){if(e instanceof HTMLLegendElement)return!1;e=e.previousElementSibling}return!0}function Xq(t={},e=null,r=[]){for(let[n,i]of Object.entries(t))Zq(r,Qq(e,n),i);return r}function Qq(t,e){return t?t+"["+e+"]":e}function Zq(t,e,r){if(Array.isArray(r))for(let[n,i]of r.entries())Zq(t,Qq(e,n.toString()),i);else r instanceof Date?t.push([e,r.toISOString()]):typeof r=="boolean"?t.push([e,r?"1":"0"]):typeof r=="string"?t.push([e,r]):typeof r=="number"?t.push([e,`${r}`]):r==null?t.push([e,""]):Xq(r,e,t)}let bUe="div";var Jq=(t=>(t[t.None=1]="None",t[t.Focusable=2]="Focusable",t[t.Hidden=4]="Hidden",t))(Jq||{});function EUe(t,e){let{features:r=1,...n}=t,i={ref:e,"aria-hidden":(r&2)===2?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return Qo({ourProps:i,theirProps:n,slot:{},defaultTag:bUe,name:"Hidden"})}let SUe=ws(EUe),oO=A.createContext(null);oO.displayName="OpenClosedContext";var yn=(t=>(t[t.Open=1]="Open",t[t.Closed=2]="Closed",t[t.Closing=4]="Closing",t[t.Opening=8]="Opening",t))(yn||{});function lO(){return A.useContext(oO)}function eX({value:t,children:e}){return ce.createElement(oO.Provider,{value:t},e)}var jt=(t=>(t.Space=" ",t.Enter="Enter",t.Escape="Escape",t.Backspace="Backspace",t.Delete="Delete",t.ArrowLeft="ArrowLeft",t.ArrowUp="ArrowUp",t.ArrowRight="ArrowRight",t.ArrowDown="ArrowDown",t.Home="Home",t.End="End",t.PageUp="PageUp",t.PageDown="PageDown",t.Tab="Tab",t))(jt||{});function _Ue(t,e,r){let[n,i]=A.useState(r),a=t!==void 0,s=A.useRef(a),o=A.useRef(!1),c=A.useRef(!1);return a&&!s.current&&!o.current?(o.current=!0,s.current=a,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!a&&s.current&&!c.current&&(c.current=!0,s.current=a,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[a?t:n,Ke(l=>(a||i(l),e==null?void 0:e(l)))]}function j6(t){return[t.screenX,t.screenY]}function wUe(){let t=A.useRef([-1,-1]);return{wasMoved(e){let r=j6(e);return t.current[0]===r[0]&&t.current[1]===r[1]?!1:(t.current=r,!0)},update(e){t.current=j6(e)}}}function cO(){let t=A.useRef(!1);return ei(()=>(t.current=!0,()=>{t.current=!1}),[]),t}var TUe=(t=>(t[t.Open=0]="Open",t[t.Closed=1]="Closed",t))(TUe||{}),RUe=(t=>(t[t.Single=0]="Single",t[t.Multi=1]="Multi",t))(RUe||{}),AUe=(t=>(t[t.Pointer=0]="Pointer",t[t.Other=1]="Other",t))(AUe||{}),IUe=(t=>(t[t.OpenListbox=0]="OpenListbox",t[t.CloseListbox=1]="CloseListbox",t[t.GoToOption=2]="GoToOption",t[t.Search=3]="Search",t[t.ClearSearch=4]="ClearSearch",t[t.RegisterOption=5]="RegisterOption",t[t.UnregisterOption=6]="UnregisterOption",t[t.RegisterLabel=7]="RegisterLabel",t))(IUe||{});function Hw(t,e=r=>r){let r=t.activeOptionIndex!==null?t.options[t.activeOptionIndex]:null,n=fUe(e(t.options.slice()),a=>a.dataRef.current.domRef.current),i=r?n.indexOf(r):null;return i===-1&&(i=null),{options:n,activeOptionIndex:i}}let $Ue={[1](t){return t.dataRef.current.disabled||t.listboxState===1?t:{...t,activeOptionIndex:null,listboxState:1}},[0](t){if(t.dataRef.current.disabled||t.listboxState===0)return t;let e=t.activeOptionIndex,{isSelected:r}=t.dataRef.current,n=t.options.findIndex(i=>r(i.dataRef.current.value));return n!==-1&&(e=n),{...t,listboxState:0,activeOptionIndex:e}},[2](t,e){var r;if(t.dataRef.current.disabled||t.listboxState===1)return t;let n=Hw(t),i=gUe(e,{resolveItems:()=>n.options,resolveActiveIndex:()=>n.activeOptionIndex,resolveId:a=>a.id,resolveDisabled:a=>a.dataRef.current.disabled});return{...t,...n,searchQuery:"",activeOptionIndex:i,activationTrigger:(r=e.trigger)!=null?r:1}},[3]:(t,e)=>{if(t.dataRef.current.disabled||t.listboxState===1)return t;let r=t.searchQuery!==""?0:1,n=t.searchQuery+e.value.toLowerCase(),i=(t.activeOptionIndex!==null?t.options.slice(t.activeOptionIndex+r).concat(t.options.slice(0,t.activeOptionIndex+r)):t.options).find(s=>{var o;return!s.dataRef.current.disabled&&((o=s.dataRef.current.textValue)==null?void 0:o.startsWith(n))}),a=i?t.options.indexOf(i):-1;return a===-1||a===t.activeOptionIndex?{...t,searchQuery:n}:{...t,searchQuery:n,activeOptionIndex:a,activationTrigger:1}},[4](t){return t.dataRef.current.disabled||t.listboxState===1||t.searchQuery===""?t:{...t,searchQuery:""}},[5]:(t,e)=>{let r={id:e.id,dataRef:e.dataRef},n=Hw(t,i=>[...i,r]);return t.activeOptionIndex===null&&t.dataRef.current.isSelected(e.dataRef.current.value)&&(n.activeOptionIndex=n.options.indexOf(r)),{...t,...n}},[6]:(t,e)=>{let r=Hw(t,n=>{let i=n.findIndex(a=>a.id===e.id);return i!==-1&&n.splice(i,1),n});return{...t,...r,activationTrigger:1}},[7]:(t,e)=>({...t,labelId:e.id})},uO=A.createContext(null);uO.displayName="ListboxActionsContext";function fm(t){let e=A.useContext(uO);if(e===null){let r=new Error(`<${t} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,fm),r}return e}let fO=A.createContext(null);fO.displayName="ListboxDataContext";function dm(t){let e=A.useContext(fO);if(e===null){let r=new Error(`<${t} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,dm),r}return e}function CUe(t,e){return rr(e.type,$Ue,t,e)}let kUe=A.Fragment;function OUe(t,e){let{value:r,defaultValue:n,form:i,name:a,onChange:s,by:o=(D,Q)=>D===Q,disabled:c=!1,horizontal:l=!1,multiple:u=!1,...f}=t;const d=l?"horizontal":"vertical";let h=wc(e),[p=u?[]:void 0,v]=_Ue(r,s,n),[m,g]=A.useReducer(CUe,{dataRef:A.createRef(),listboxState:1,options:[],searchQuery:"",labelId:null,activeOptionIndex:null,activationTrigger:1}),y=A.useRef({static:!1,hold:!1}),x=A.useRef(null),b=A.useRef(null),_=A.useRef(null),S=Ke(typeof o=="string"?(D,Q)=>{let ee=o;return(D==null?void 0:D[ee])===(Q==null?void 0:Q[ee])}:o),w=A.useCallback(D=>rr(R.mode,{[1]:()=>p.some(Q=>S(Q,D)),[0]:()=>S(p,D)}),[p]),R=A.useMemo(()=>({...m,value:p,disabled:c,mode:u?1:0,orientation:d,compare:S,isSelected:w,optionsPropsRef:y,labelRef:x,buttonRef:b,optionsRef:_}),[p,c,u,m]);ei(()=>{m.dataRef.current=R},[R]),dUe([R.buttonRef,R.optionsRef],(D,Q)=>{var ee;g({type:1}),Yq(Q,sO.Loose)||(D.preventDefault(),(ee=R.buttonRef.current)==null||ee.focus())},R.listboxState===0);let I=A.useMemo(()=>({open:R.listboxState===0,disabled:c,value:p}),[R,c,p]),T=Ke(D=>{let Q=R.options.find(ee=>ee.id===D);Q&&V(Q.dataRef.current.value)}),C=Ke(()=>{if(R.activeOptionIndex!==null){let{dataRef:D,id:Q}=R.options[R.activeOptionIndex];V(D.current.value),g({type:2,focus:Jr.Specific,id:Q})}}),L=Ke(()=>g({type:0})),H=Ke(()=>g({type:1})),N=Ke((D,Q,ee)=>D===Jr.Specific?g({type:2,focus:Jr.Specific,id:Q,trigger:ee}):g({type:2,focus:D,trigger:ee})),P=Ke((D,Q)=>(g({type:5,id:D,dataRef:Q}),()=>g({type:6,id:D}))),B=Ke(D=>(g({type:7,id:D}),()=>g({type:7,id:null}))),V=Ke(D=>rr(R.mode,{[0](){return v==null?void 0:v(D)},[1](){let Q=R.value.slice(),ee=Q.findIndex(de=>S(de,D));return ee===-1?Q.push(D):Q.splice(ee,1),v==null?void 0:v(Q)}})),M=Ke(D=>g({type:3,value:D})),U=Ke(()=>g({type:4})),W=A.useMemo(()=>({onChange:V,registerOption:P,registerLabel:B,goToOption:N,closeListbox:H,openListbox:L,selectActiveOption:C,selectOption:T,search:M,clearSearch:U}),[]),k={ref:h},O=A.useRef(null),F=_f();return A.useEffect(()=>{O.current&&n!==void 0&&F.addEventListener(O.current,"reset",()=>{V(n)})},[O,V]),ce.createElement(uO.Provider,{value:W},ce.createElement(fO.Provider,{value:R},ce.createElement(eX,{value:rr(R.listboxState,{[0]:yn.Open,[1]:yn.Closed})},a!=null&&p!=null&&Xq({[a]:p}).map(([D,Q],ee)=>ce.createElement(SUe,{features:Jq.Hidden,ref:ee===0?de=>{var oe;O.current=(oe=de==null?void 0:de.closest("form"))!=null?oe:null}:void 0,...AA({key:D,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:i,name:D,value:Q})})),Qo({ourProps:k,theirProps:f,slot:I,defaultTag:kUe,name:"Listbox"}))))}let LUe="button";function PUe(t,e){var r;let n=uE(),{id:i=`headlessui-listbox-button-${n}`,...a}=t,s=dm("Listbox.Button"),o=fm("Listbox.Button"),c=wc(s.buttonRef,e),l=_f(),u=Ke(m=>{switch(m.key){case jt.Space:case jt.Enter:case jt.ArrowDown:m.preventDefault(),o.openListbox(),l.nextFrame(()=>{s.value||o.goToOption(Jr.First)});break;case jt.ArrowUp:m.preventDefault(),o.openListbox(),l.nextFrame(()=>{s.value||o.goToOption(Jr.Last)});break}}),f=Ke(m=>{switch(m.key){case jt.Space:m.preventDefault();break}}),d=Ke(m=>{if(yUe(m.currentTarget))return m.preventDefault();s.listboxState===0?(o.closeListbox(),l.nextFrame(()=>{var g;return(g=s.buttonRef.current)==null?void 0:g.focus({preventScroll:!0})})):(m.preventDefault(),o.openListbox())}),h=Wq(()=>{if(s.labelId)return[s.labelId,i].join(" ")},[s.labelId,i]),p=A.useMemo(()=>({open:s.listboxState===0,disabled:s.disabled,value:s.value}),[s]),v={ref:c,id:i,type:hUe(t,s.buttonRef),"aria-haspopup":"listbox","aria-controls":(r=s.optionsRef.current)==null?void 0:r.id,"aria-expanded":s.disabled?void 0:s.listboxState===0,"aria-labelledby":h,disabled:s.disabled,onKeyDown:u,onKeyUp:f,onClick:d};return Qo({ourProps:v,theirProps:a,slot:p,defaultTag:LUe,name:"Listbox.Button"})}let NUe="label";function DUe(t,e){let r=uE(),{id:n=`headlessui-listbox-label-${r}`,...i}=t,a=dm("Listbox.Label"),s=fm("Listbox.Label"),o=wc(a.labelRef,e);ei(()=>s.registerLabel(n),[n]);let c=Ke(()=>{var u;return(u=a.buttonRef.current)==null?void 0:u.focus({preventScroll:!0})}),l=A.useMemo(()=>({open:a.listboxState===0,disabled:a.disabled}),[a]);return Qo({ourProps:{ref:o,id:n,onClick:c},theirProps:i,slot:l,defaultTag:NUe,name:"Listbox.Label"})}let MUe="ul",FUe=w1.RenderStrategy|w1.Static;function BUe(t,e){var r;let n=uE(),{id:i=`headlessui-listbox-options-${n}`,...a}=t,s=dm("Listbox.Options"),o=fm("Listbox.Options"),c=wc(s.optionsRef,e),l=_f(),u=_f(),f=lO(),d=(()=>f!==null?(f&yn.Open)===yn.Open:s.listboxState===0)();A.useEffect(()=>{var g;let y=s.optionsRef.current;y&&s.listboxState===0&&y!==((g=Kq(y))==null?void 0:g.activeElement)&&y.focus({preventScroll:!0})},[s.listboxState,s.optionsRef]);let h=Ke(g=>{switch(u.dispose(),g.key){case jt.Space:if(s.searchQuery!=="")return g.preventDefault(),g.stopPropagation(),o.search(g.key);case jt.Enter:if(g.preventDefault(),g.stopPropagation(),s.activeOptionIndex!==null){let{dataRef:y}=s.options[s.activeOptionIndex];o.onChange(y.current.value)}s.mode===0&&(o.closeListbox(),Po().nextFrame(()=>{var y;return(y=s.buttonRef.current)==null?void 0:y.focus({preventScroll:!0})}));break;case rr(s.orientation,{vertical:jt.ArrowDown,horizontal:jt.ArrowRight}):return g.preventDefault(),g.stopPropagation(),o.goToOption(Jr.Next);case rr(s.orientation,{vertical:jt.ArrowUp,horizontal:jt.ArrowLeft}):return g.preventDefault(),g.stopPropagation(),o.goToOption(Jr.Previous);case jt.Home:case jt.PageUp:return g.preventDefault(),g.stopPropagation(),o.goToOption(Jr.First);case jt.End:case jt.PageDown:return g.preventDefault(),g.stopPropagation(),o.goToOption(Jr.Last);case jt.Escape:return g.preventDefault(),g.stopPropagation(),o.closeListbox(),l.nextFrame(()=>{var y;return(y=s.buttonRef.current)==null?void 0:y.focus({preventScroll:!0})});case jt.Tab:g.preventDefault(),g.stopPropagation();break;default:g.key.length===1&&(o.search(g.key),u.setTimeout(()=>o.clearSearch(),350));break}}),p=Wq(()=>{var g,y,x;return(x=(g=s.labelRef.current)==null?void 0:g.id)!=null?x:(y=s.buttonRef.current)==null?void 0:y.id},[s.labelRef.current,s.buttonRef.current]),v=A.useMemo(()=>({open:s.listboxState===0}),[s]),m={"aria-activedescendant":s.activeOptionIndex===null||(r=s.options[s.activeOptionIndex])==null?void 0:r.id,"aria-multiselectable":s.mode===1?!0:void 0,"aria-labelledby":p,"aria-orientation":s.orientation,id:i,onKeyDown:h,role:"listbox",tabIndex:0,ref:c};return Qo({ourProps:m,theirProps:a,slot:v,defaultTag:MUe,features:FUe,visible:d,name:"Listbox.Options"})}let UUe="li";function jUe(t,e){let r=uE(),{id:n=`headlessui-listbox-option-${r}`,disabled:i=!1,value:a,...s}=t,o=dm("Listbox.Option"),c=fm("Listbox.Option"),l=o.activeOptionIndex!==null?o.options[o.activeOptionIndex].id===n:!1,u=o.isSelected(a),f=A.useRef(null),d=ts({disabled:i,value:a,domRef:f,get textValue(){var _,S;return(S=(_=f.current)==null?void 0:_.textContent)==null?void 0:S.toLowerCase()}}),h=wc(e,f);ei(()=>{if(o.listboxState!==0||!l||o.activationTrigger===0)return;let _=Po();return _.requestAnimationFrame(()=>{var S,w;(w=(S=f.current)==null?void 0:S.scrollIntoView)==null||w.call(S,{block:"nearest"})}),_.dispose},[f,l,o.listboxState,o.activationTrigger,o.activeOptionIndex]),ei(()=>c.registerOption(n,d),[d,n]);let p=Ke(_=>{if(i)return _.preventDefault();c.onChange(a),o.mode===0&&(c.closeListbox(),Po().nextFrame(()=>{var S;return(S=o.buttonRef.current)==null?void 0:S.focus({preventScroll:!0})}))}),v=Ke(()=>{if(i)return c.goToOption(Jr.Nothing);c.goToOption(Jr.Specific,n)}),m=wUe(),g=Ke(_=>m.update(_)),y=Ke(_=>{m.wasMoved(_)&&(i||l||c.goToOption(Jr.Specific,n,0))}),x=Ke(_=>{m.wasMoved(_)&&(i||l&&c.goToOption(Jr.Nothing))}),b=A.useMemo(()=>({active:l,selected:u,disabled:i}),[l,u,i]);return Qo({ourProps:{id:n,ref:h,role:"option",tabIndex:i===!0?void 0:-1,"aria-disabled":i===!0?!0:void 0,"aria-selected":u,disabled:void 0,onClick:p,onFocus:v,onPointerEnter:g,onMouseEnter:g,onPointerMove:y,onMouseMove:y,onPointerLeave:x,onMouseLeave:x},theirProps:s,slot:b,defaultTag:UUe,name:"Listbox.Option"})}let HUe=ws(OUe),zUe=ws(PUe),GUe=ws(DUe),VUe=ws(BUe),WUe=ws(jUe),Ug=Object.assign(HUe,{Button:zUe,Label:GUe,Options:VUe,Option:WUe});function KUe(t=0){let[e,r]=A.useState(t),n=cO(),i=A.useCallback(c=>{n.current&&r(l=>l|c)},[e,n]),a=A.useCallback(c=>!!(e&c),[e]),s=A.useCallback(c=>{n.current&&r(l=>l&~c)},[r,n]),o=A.useCallback(c=>{n.current&&r(l=>l^c)},[r]);return{flags:e,addFlag:i,hasFlag:a,removeFlag:s,toggleFlag:o}}function YUe(t){let e={called:!1};return(...r)=>{if(!e.called)return e.called=!0,t(...r)}}function zw(t,...e){t&&e.length>0&&t.classList.add(...e)}function Gw(t,...e){t&&e.length>0&&t.classList.remove(...e)}function qUe(t,e){let r=Po();if(!t)return r.dispose;let{transitionDuration:n,transitionDelay:i}=getComputedStyle(t),[a,s]=[n,i].map(c=>{let[l=0]=c.split(",").filter(Boolean).map(u=>u.includes("ms")?parseFloat(u):parseFloat(u)*1e3).sort((u,f)=>f-u);return l}),o=a+s;if(o!==0){r.group(l=>{l.setTimeout(()=>{e(),l.dispose()},o),l.addEventListener(t,"transitionrun",u=>{u.target===u.currentTarget&&l.dispose()})});let c=r.addEventListener(t,"transitionend",l=>{l.target===l.currentTarget&&(e(),c())})}else e();return r.add(()=>e()),r.dispose}function XUe(t,e,r,n){let i=r?"enter":"leave",a=Po(),s=n!==void 0?YUe(n):()=>{};i==="enter"&&(t.removeAttribute("hidden"),t.style.display="");let o=rr(i,{enter:()=>e.enter,leave:()=>e.leave}),c=rr(i,{enter:()=>e.enterTo,leave:()=>e.leaveTo}),l=rr(i,{enter:()=>e.enterFrom,leave:()=>e.leaveFrom});return Gw(t,...e.enter,...e.enterTo,...e.enterFrom,...e.leave,...e.leaveFrom,...e.leaveTo,...e.entered),zw(t,...o,...l),a.nextFrame(()=>{Gw(t,...l),zw(t,...c),qUe(t,()=>(Gw(t,...o),zw(t,...e.entered),s()))}),a.dispose}function QUe({container:t,direction:e,classes:r,onStart:n,onStop:i}){let a=cO(),s=_f(),o=ts(e);ei(()=>{let c=Po();s.add(c.dispose);let l=t.current;if(l&&o.current!=="idle"&&a.current)return c.dispose(),n.current(o.current),c.add(XUe(l,r.current,o.current==="enter",()=>{c.dispose(),i.current(o.current)})),c.dispose},[e])}function hl(t=""){return t.split(" ").filter(e=>e.trim().length>1)}let fE=A.createContext(null);fE.displayName="TransitionContext";var ZUe=(t=>(t.Visible="visible",t.Hidden="hidden",t))(ZUe||{});function JUe(){let t=A.useContext(fE);if(t===null)throw new Error("A is used but it is missing a parent or .");return t}function e7e(){let t=A.useContext(dE);if(t===null)throw new Error("A is used but it is missing a parent or .");return t}let dE=A.createContext(null);dE.displayName="NestingContext";function hE(t){return"children"in t?hE(t.children):t.current.filter(({el:e})=>e.current!==null).filter(({state:e})=>e==="visible").length>0}function tX(t,e){let r=ts(t),n=A.useRef([]),i=cO(),a=_f(),s=Ke((h,p=Qa.Hidden)=>{let v=n.current.findIndex(({el:m})=>m===h);v!==-1&&(rr(p,{[Qa.Unmount](){n.current.splice(v,1)},[Qa.Hidden](){n.current[v].state="hidden"}}),a.microTask(()=>{var m;!hE(n)&&i.current&&((m=r.current)==null||m.call(r))}))}),o=Ke(h=>{let p=n.current.find(({el:v})=>v===h);return p?p.state!=="visible"&&(p.state="visible"):n.current.push({el:h,state:"visible"}),()=>s(h,Qa.Unmount)}),c=A.useRef([]),l=A.useRef(Promise.resolve()),u=A.useRef({enter:[],leave:[],idle:[]}),f=Ke((h,p,v)=>{c.current.splice(0),e&&(e.chains.current[p]=e.chains.current[p].filter(([m])=>m!==h)),e==null||e.chains.current[p].push([h,new Promise(m=>{c.current.push(m)})]),e==null||e.chains.current[p].push([h,new Promise(m=>{Promise.all(u.current[p].map(([g,y])=>y)).then(()=>m())})]),p==="enter"?l.current=l.current.then(()=>e==null?void 0:e.wait.current).then(()=>v(p)):v(p)}),d=Ke((h,p,v)=>{Promise.all(u.current[p].splice(0).map(([m,g])=>g)).then(()=>{var m;(m=c.current.shift())==null||m()}).then(()=>v(p))});return A.useMemo(()=>({children:n,register:o,unregister:s,onStart:f,onStop:d,wait:l,chains:u}),[o,s,n,f,d,u,l])}function t7e(){}let r7e=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function H6(t){var e;let r={};for(let n of r7e)r[n]=(e=t[n])!=null?e:t7e;return r}function n7e(t){let e=A.useRef(H6(t));return A.useEffect(()=>{e.current=H6(t)},[t]),e}let i7e="div",rX=w1.RenderStrategy;function a7e(t,e){let{beforeEnter:r,afterEnter:n,beforeLeave:i,afterLeave:a,enter:s,enterFrom:o,enterTo:c,entered:l,leave:u,leaveFrom:f,leaveTo:d,...h}=t,p=A.useRef(null),v=wc(p,e),m=h.unmount?Qa.Unmount:Qa.Hidden,{show:g,appear:y,initial:x}=JUe(),[b,_]=A.useState(g?"visible":"hidden"),S=e7e(),{register:w,unregister:R}=S,I=A.useRef(null);A.useEffect(()=>w(p),[w,p]),A.useEffect(()=>{if(m===Qa.Hidden&&p.current){if(g&&b!=="visible"){_("visible");return}return rr(b,{hidden:()=>R(p),visible:()=>w(p)})}},[b,p,w,R,g,m]);let T=ts({enter:hl(s),enterFrom:hl(o),enterTo:hl(c),entered:hl(l),leave:hl(u),leaveFrom:hl(f),leaveTo:hl(d)}),C=n7e({beforeEnter:r,afterEnter:n,beforeLeave:i,afterLeave:a}),L=aO();A.useEffect(()=>{if(L&&b==="visible"&&p.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[p,b,L]);let H=x&&!y,N=(()=>!L||H||I.current===g?"idle":g?"enter":"leave")(),P=KUe(0),B=Ke(k=>rr(k,{enter:()=>{P.addFlag(yn.Opening),C.current.beforeEnter()},leave:()=>{P.addFlag(yn.Closing),C.current.beforeLeave()},idle:()=>{}})),V=Ke(k=>rr(k,{enter:()=>{P.removeFlag(yn.Opening),C.current.afterEnter()},leave:()=>{P.removeFlag(yn.Closing),C.current.afterLeave()},idle:()=>{}})),M=tX(()=>{_("hidden"),R(p)},S);QUe({container:p,classes:T,direction:N,onStart:ts(k=>{M.onStart(p,k,B)}),onStop:ts(k=>{M.onStop(p,k,V),k==="leave"&&!hE(M)&&(_("hidden"),R(p))})}),A.useEffect(()=>{H&&(m===Qa.Hidden?I.current=null:I.current=g)},[g,H,b]);let U=h,W={ref:v};return y&&g&&(U={...U,className:RA(h.className,...T.current.enter,...T.current.enterFrom)}),ce.createElement(dE.Provider,{value:M},ce.createElement(eX,{value:rr(b,{visible:yn.Open,hidden:yn.Closed})|P.flags},Qo({ourProps:W,theirProps:U,defaultTag:i7e,features:rX,visible:b==="visible",name:"Transition.Child"})))}function s7e(t,e){let{show:r,appear:n=!1,unmount:i,...a}=t,s=A.useRef(null),o=wc(s,e);aO();let c=lO();if(r===void 0&&c!==null&&(r=(c&yn.Open)===yn.Open),![!0,!1].includes(r))throw new Error("A is used but it is missing a `show={true | false}` prop.");let[l,u]=A.useState(r?"visible":"hidden"),f=tX(()=>{u("hidden")}),[d,h]=A.useState(!0),p=A.useRef([r]);ei(()=>{d!==!1&&p.current[p.current.length-1]!==r&&(p.current.push(r),h(!1))},[p,r]);let v=A.useMemo(()=>({show:r,appear:n,initial:d}),[r,n,d]);A.useEffect(()=>{if(r)u("visible");else if(!hE(f))u("hidden");else{let g=s.current;if(!g)return;let y=g.getBoundingClientRect();y.x===0&&y.y===0&&y.width===0&&y.height===0&&u("hidden")}},[r,f]);let m={unmount:i};return ce.createElement(dE.Provider,{value:f},ce.createElement(fE.Provider,{value:v},Qo({ourProps:{...m,as:A.Fragment,children:ce.createElement(nX,{ref:o,...m,...a})},theirProps:{},defaultTag:A.Fragment,features:rX,visible:l==="visible",name:"Transition"})))}function o7e(t,e){let r=A.useContext(fE)!==null,n=lO()!==null;return ce.createElement(ce.Fragment,null,!r&&n?ce.createElement(IA,{ref:e,...t}):ce.createElement(nX,{ref:e,...t}))}let IA=ws(s7e),nX=ws(a7e),l7e=ws(o7e),$A=Object.assign(IA,{Child:l7e,Root:IA});function c7e(t,e){return t==="slide-down"?{leave:`transition-[transform,opacity] ${e}`,leaveFrom:"opacity-100 translate-y-0",leaveTo:"-translate-y-4 opacity-0",enter:`transition-[transform,opacity] ${e}`,enterFrom:"opacity-0 -translate-y-4",enterTo:"translate-y-0 opacity-100"}:t==="slide-up"?{leave:`transition-[transform,opacity] ${e}`,leaveFrom:"opacity-100 translate-y-0",leaveTo:"translate-y-4 opacity-0",enter:`transition-[transform,opacity] ${e}`,enterFrom:"opacity-0 translate-y-4",enterTo:"translate-y-0 opacity-100"}:t==="slide-full-left"?{leave:`transition-[transform] ${e}`,leaveFrom:"translate-x-0",leaveTo:"-translate-x-full",enter:`transition-[transform] ${e}`,enterFrom:"-translate-x-full",enterTo:"translate-x-0"}:t==="slide-full-right"?{leave:`transition-[transform] ${e}`,leaveFrom:"translate-x-0",leaveTo:"translate-x-full",enter:`transition-[transform] ${e}`,enterFrom:"translate-x-full",enterTo:"translate-x-0"}:t==="fade"?{leave:`transition-[transform,opacity] ${e}`,leaveFrom:"opacity-100",leaveTo:"opacity-0",enter:`transition-[transform,opacity] ${e}`,enterFrom:"opacity-0",enterTo:"opacity-100"}:{}}function $i(t){const e=t.durationClass??"duration-200",r=c7e(t.animation,e);return t.isChild?E($A.Child,{as:A.Fragment,...r,children:E("div",{className:t.className,children:t.children})}):E($A,{show:t.show,as:A.Fragment,...r,children:E("div",{className:t.className,children:t.children})})}function u7e(t){const e=Re(),r=st(e),n=Cn(e),i=Bi(e),[a,s]=A.useState(!1),o=A.useRef(null),c=A.useRef(null),l=A.useRef(0),u=A.useCallback(()=>{a||setTimeout(()=>{Date.now()-l.current<200||s(!0)},20),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{s(!1),o.current=null},3e3)},[s,a]),f=A.useCallback(()=>{s(!1)},[s]),d=A.useCallback(m=>{if(!(!c.current||c.current!==m.target)&&i.popout===null){if(m.type==="touchend"){l.current=Date.now();return}m.button===0&&setTimeout(()=>{if(Date.now()-l.current<200){s(g=>!g);return}n.isPlaying?r.pause():r.play()},20)}},[r,n,i]),h=A.useCallback(m=>{!c.current||c.current!==m.target||(i.isFullscreen?r.exitFullscreen():r.enterFullscreen())},[r,i]),p=A.useRef(null);A.useEffect(()=>{var g;const m=a||n.isPaused||!!i.popout;m!==p.current&&(p.current=m,(g=t.onBackdropChange)==null||g.call(t,m))},[a,n,t,i]);const v=a||n.isPaused||!!i.popout;return Y("div",{className:`absolute inset-0 ${v?"":"cursor-none"}`,onMouseMove:u,onMouseLeave:f,ref:c,onMouseUp:d,onTouchEnd:d,onDoubleClick:h,children:[E("div",{className:`pointer-events-none absolute inset-0 bg-black bg-opacity-20 transition-opacity duration-200 ${v?"":"!opacity-0"}`}),E("div",{className:`pointer-events-none absolute inset-x-0 bottom-0 h-[20%] bg-gradient-to-t from-black to-transparent transition-opacity duration-200 ${v?"":"!opacity-0"}`}),E("div",{className:`pointer-events-none absolute inset-x-0 top-0 h-[20%] bg-gradient-to-b from-black to-transparent transition-opacity duration-200 ${v?"":"!opacity-0"}`}),E("div",{className:"pointer-events-none absolute inset-0",children:t.children})]})}function f7e(){const{t}=ke(),e=Re();return Es(e).isCasting?Y("div",{className:"flex flex-col items-center justify-center gap-4",children:[E("div",{className:"rounded-full bg-denim-200 p-3 brightness-100 grayscale",children:E(Ve,{icon:ue.CASTING})}),E("p",{className:"text-center text-gray-300",children:t("casting.casting")})]}):null}var hn={fullscreenEnabled:0,fullscreenElement:1,requestFullscreen:2,exitFullscreen:3,fullscreenchange:4,fullscreenerror:5,fullscreen:6},z6=["webkitFullscreenEnabled","webkitFullscreenElement","webkitRequestFullscreen","webkitExitFullscreen","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],G6=["mozFullScreenEnabled","mozFullScreenElement","mozRequestFullScreen","mozCancelFullScreen","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],V6=["msFullscreenEnabled","msFullscreenElement","msRequestFullscreen","msExitFullscreen","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"],Gr=typeof window<"u"&&typeof window.document<"u"?window.document:{},Dn="fullscreenEnabled"in Gr&&Object.keys(hn)||z6[0]in Gr&&z6||G6[0]in Gr&&G6||V6[0]in Gr&&V6||[],d7e={requestFullscreen:function(t){return t[Dn[hn.requestFullscreen]]()},requestFullscreenFunction:function(t){return t[Dn[hn.requestFullscreen]]},get exitFullscreen(){return Gr[Dn[hn.exitFullscreen]].bind(Gr)},get fullscreenPseudoClass(){return":"+Dn[hn.fullscreen]},addEventListener:function(t,e,r){return Gr.addEventListener(Dn[hn[t]],e,r)},removeEventListener:function(t,e,r){return Gr.removeEventListener(Dn[hn[t]],e,r)},get fullscreenEnabled(){return!!Gr[Dn[hn.fullscreenEnabled]]},set fullscreenEnabled(t){},get fullscreenElement(){return Gr[Dn[hn.fullscreenElement]]},set fullscreenElement(t){},get onfullscreenchange(){return Gr[("on"+Dn[hn.fullscreenchange]).toLowerCase()]},set onfullscreenchange(t){return Gr[("on"+Dn[hn.fullscreenchange]).toLowerCase()]=t},get onfullscreenerror(){return Gr[("on"+Dn[hn.fullscreenerror]).toLowerCase()]},set onfullscreenerror(t){return Gr[("on"+Dn[hn.fullscreenerror]).toLowerCase()]=t}};const xn=d7e,h7e=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);let Vw=null;async function G0(){if(Vw===null){const t=new Promise(r=>{setTimeout(()=>r(!1),1e3)}),e=new Promise(r=>{const n=document.createElement("video"),i=()=>{n.removeEventListener("volumechange",i),r(!0)};n.addEventListener("volumechange",i),n.volume=.5});Vw=await Promise.race([e,t])}return Vw}function pE(){return xn.fullscreenEnabled}function dO(){return pE()||h7e}function hO(){return pE()||dO()}function iX(){return"pictureInPictureEnabled"in document}function aX(){return"webkitSupportsPresentationMode"in document.createElement("video")}function W6(t){const e=Re(),r=Bi(e),n=st(e),i=A.useCallback(()=>{r.isFullscreen?n.exitFullscreen():n.enterFullscreen()},[n,r]);return hO()?E(_s,{className:t.className,onClick:i,icon:r.isFullscreen?ue.COMPRESS:ue.EXPAND}):null}function p7e(t){const e=Re(),r=ui(e);return E(_c,{media:r==null?void 0:r.meta.meta,...t})}function sX(t){const[e,r]=A.useState(1),n=st(t),i=Cn(t);return{storedVolume:e,setStoredVolume:r,toggleVolume:(s=!1)=>{i.volume>0?(r(i.volume),n.setVolume(0,s)):n.setVolume(e>0?e:1,s)}}}function m7e(){const t=Re(),e=st(t),r=Bi(t),n=Cn(t),i=Xo(t),{toggleVolume:a}=sX(t),s=A.useRef(0);return A.useEffect(()=>{s.current=i.time},[i]),A.useEffect(()=>{const c=Sr(t).wrapperElement;if(!c)return;let l=!1;const u=f=>{if(r.isFocused)switch(f.key.toLowerCase()){case"f":r.isFullscreen?e.exitFullscreen():e.enterFullscreen();break;case"arrowleft":e.setTime(s.current-5);break;case"arrowright":e.setTime(s.current+5);break;case" ":n.isPaused?e.play():e.pause();break;case"m":a(!0);break;case"arrowdown":e.setVolume(Math.max(n.volume-.1,0),!0);break;case"arrowup":e.setVolume(Math.min(n.volume+.1,1),!0);break;case"r":if(l||f.ctrlKey||f.metaKey)return;l=!0,c.classList.add("roll"),setTimeout(()=>{l=!1,c.classList.remove("roll")},1e3);break}};return window.addEventListener("keydown",u),()=>{window.removeEventListener("keydown",u)}},[e,t,n,r,a]),null}function oX(t){return E("div",{className:["spinner",t.className??""].join(" ")})}function g7e(){const t=Re(),e=Cn(t),r=Es(t),n=e.isFirstLoading||e.isLoading,i=!r.isCasting;return!n||!i?null:E(oX,{})}function v7e(){const t=Re(),e=st(t),r=Cn(t),n=A.useCallback(()=>{r!=null&&r.isPlaying?e.pause():e.play()},[e,r]);return r.hasPlayedOnce||r.isPlaying||r.isFirstLoading?null:E("div",{onClick:n,className:"group pointer-events-auto flex h-16 w-16 items-center justify-center rounded-full bg-denim-400 text-white transition-[background-color,transform] hover:scale-125 hover:bg-denim-500 active:scale-100",children:E(Ve,{icon:ue.PLAY,className:"text-2xl transition-transform group-hover:scale-125"})})}function lX(t){const e=Re(),r=Cn(e),n=st(e),i=A.useCallback(()=>{r.isPlaying?n.pause():n.play()},[r,n]),a=r.isPlaying||r.isSeeking?ue.PAUSE:ue.PLAY;return E(_s,{iconSize:t.iconSize,className:t.className,icon:a,onClick:i})}function cX(){const t=Re(),e=st(t),r=Xo(t),n=()=>{e.setTime(r.time-10)};return E(_s,{icon:ue.SKIP_BACKWARD,onClick:n})}function uX(){const t=Re(),e=st(t),r=Xo(t),n=()=>{e.setTime(r.time+10)};return E(_s,{icon:ue.SKIP_FORWARD,onClick:n})}function y7e(t){return E("div",{className:t.className,children:Y("div",{className:"flex select-none items-center text-white",children:[E(cX,{}),E(uX,{})]})})}function x7e(){const t=Re(),e=Cn(t),r=e.isFirstLoading||e.isLoading;return Y("div",{className:"flex items-center space-x-8",children:[E(cX,{}),E(lX,{iconSize:"text-5xl",className:r?"pointer-events-none opacity-0":""}),E(uX,{})]})}function fX(t){const e=ui(t),{t:r}=ke(),n=A.useMemo(()=>{var o;return(o=e==null?void 0:e.seasons)==null?void 0:o.find(c=>{var l;return c.id===((l=e==null?void 0:e.episode)==null?void 0:l.seasonId)})},[e]),i=A.useMemo(()=>{var o;return(o=n==null?void 0:n.episodes)==null?void 0:o.find(c=>{var l;return c.id===((l=e==null?void 0:e.episode)==null?void 0:l.episodeId)})},[n,e]);return!((e==null?void 0:e.meta.meta.type)===ie.SERIES&&(e!=null&&e.episode))?{isSeries:!1}:{isSeries:!0,humanizedEpisodeId:r("videoPlayer.seasonAndEpisode",{season:n==null?void 0:n.number,episode:i==null?void 0:i.number}),currentSeasonInfo:n,currentEpisodeInfo:i,meta:e==null?void 0:e.meta}}function b7e(){const t=Re(),{isSeries:e,humanizedEpisodeId:r,meta:n}=fX(t);if(!n)return null;const i=e?`${n.meta.title} - ${r}`:n.meta.title;return E(va,{children:E("title",{children:i})})}function K6(t){const{isMobile:e}=Aa(),{t:r}=ke(),n=Re(),i=st(n),a=A.useCallback(()=>{i.togglePictureInPicture()},[i]);return!iX()&&!aX()?null:E(_s,{className:t.className,icon:ue.PICTURE_IN_PICTURE,onClick:a,text:e?r("videoPlayer.buttons.pictureInPicture"):""})}function Zv(t){return`${t.toFixed(2)}%`}function t0(t){return Number(Math.max(0,Math.min(t,100)).toFixed(2))}function E7e(t){return t.type==="mousedown"||t.type==="mouseup"||t.type==="mousemove"}const Ww=t=>E7e(t)?t.pageX:t.changedTouches[0].pageX;function dX(t,e,r=!1){const[n,i]=A.useState(!1),[a,s]=A.useState(0);A.useEffect(()=>{function c(u){if(!n||!t.current)return;const f=t.current.getBoundingClientRect(),d=(Ww(u)-f.left)/t.current.offsetWidth;s(d*100),r&&e(d)}function l(u){if(!n||(i(!1),document.body.removeAttribute("data-no-select"),!t.current))return;const f=t.current.getBoundingClientRect(),d=(Ww(u)-f.left)/t.current.offsetWidth;e(d)}return document.addEventListener("mousemove",c),document.addEventListener("touchmove",c),document.addEventListener("mouseup",l),document.addEventListener("touchend",l),()=>{document.removeEventListener("mousemove",c),document.removeEventListener("touchmove",c),document.removeEventListener("mouseup",l),document.removeEventListener("touchend",l)}},[n,t,e,r]);const o=A.useCallback(c=>{if(i(!0),document.body.setAttribute("data-no-select","true"),!t.current)return;const l=t.current.getBoundingClientRect(),u=(Ww(c)-l.left)/t.current.offsetWidth*100;s(u)},[s,t]);return{dragging:n,dragPercentage:a,dragMouseDown:o}}function S7e(){const t=Re(),e=st(t),r=Xo(t),n=A.useRef(null),i=A.useRef(!1),a=A.useRef(e);A.useEffect(()=>{a.current=e},[e]);const s=A.useCallback(d=>{e.setTime(d*r.duration)},[e,r]),{dragging:o,dragPercentage:c,dragMouseDown:l}=dX(n,s);A.useEffect(()=>{i.current!==o&&(i.current=o,e.setSeeking(o))},[i,o,e]),A.useEffect(()=>{if(o){const d=Sr(t);a.current.setDraggingTime(d.progress.duration*(c/100))}},[t,o,c]);let u=Zv(t0(r.time/r.duration*100));o&&(u=Zv(t0(c)));const f=Zv(t0(r.buffered/r.duration*100));return E("div",{className:"group pointer-events-auto w-full cursor-pointer rounded-full px-2",children:E("div",{ref:n,className:"-my-3 flex h-8 items-center",onMouseDown:l,onTouchStart:l,children:Y("div",{className:`relative h-1 flex-1 rounded-full bg-gray-500 bg-opacity-50 transition-[height] duration-100 group-hover:h-2 ${o?"!h-2":""}`,children:[E("div",{className:"absolute inset-y-0 left-0 flex items-center justify-end rounded-full bg-gray-300 bg-opacity-20",style:{width:f}}),E("div",{className:"absolute inset-y-0 left-0 flex items-center justify-end rounded-full bg-bink-600",style:{width:u},children:E("div",{className:`absolute h-1 w-1 translate-x-1/2 rounded-full bg-white opacity-0 transition-[transform,opacity] group-hover:scale-[400%] group-hover:opacity-100 ${o?"!scale-[400%] !opacity-100":""}`})})]})})})}function CA(t){return`__floating::anchor::${t}`}function hX(t){const e=A.useRef(null),r=A.useRef(null);return A.useEffect(()=>{if(!e.current)return;let n=!1;function i(){if(!n){if(e.current){const a=r.current,s=e.current.getBoundingClientRect(),o=JSON.stringify(s);if(a!==o){r.current=o;const c=CA(t.id);window[c]=s;const l=new CustomEvent(CA(t.id),{detail:s});document.dispatchEvent(l)}}window.requestAnimationFrame(i)}}return window.requestAnimationFrame(i),()=>{n=!0}},[t]),E("div",{ref:e,children:t.children})}function Y6(t){const{t:e}=ke(),r=Re(),n=ui(r),i=Bi(r),a=st(r);return(n==null?void 0:n.meta.meta.type)!==ie.SERIES?null:E("div",{className:t.className,children:E("div",{className:"relative",children:E(hX,{id:"episodes",children:E(_s,{active:i.popout==="episodes",icon:ue.EPISODES,text:e("videoPlayer.buttons.episodes"),wide:!0,onClick:()=>a.openPopout("episodes")})})})})}function _7e(){const t=Re(),{isSeries:e,currentEpisodeInfo:r,humanizedEpisodeId:n}=fX(t);return e?Y("p",{className:"ml-8 select-none space-x-2 text-white",children:[E("span",{children:n}),E("span",{className:"opacity-50",children:r==null?void 0:r.title})]}):null}var vl=(t=>(t[t.REGULAR=0]="REGULAR",t[t.REMAINING=1]="REMAINING",t))(vl||{});function w7e(t){return t>60*60}function Kw(t,e=!1){if(Number.isNaN(t))return e?"0:00:00":"0:00";let r=t;const n=Math.floor(r%60);r/=60;const i=Math.floor(r%60);r/=60;const a=Math.floor(r),s=n.toString().padStart(2,"0"),o=i.toString().padStart(2,"0");return e?[a,o,s].join(":"):[o,s].join(":")}function pX(t){const e=Re(),r=Xo(e),n=Cn(e),{setTimeFormat:i}=st(e),{timeFormat:a}=Bi(e),{isMobile:s}=Aa(),{t:o}=ke(),c=w7e(r.duration),l=Kw(n.isDragSeeking?r.draggingTime:r.time,c),u=Kw(r.duration,c),f=Kw((r.duration-r.time)/n.playbackSpeed,c),d=new Date(new Date().getTime()+(r.duration-r.time)*1e3/n.playbackSpeed),h=` - ${o("videoPlayer.finishAt",{timeFinished:d,formatParams:{timeFinished:{hour:"numeric",minute:"numeric"}}})}`;let p;return a===vl.REGULAR?p=`${l} ${t.noDuration?"":`/ ${u}`}`:a===vl.REMAINING&&!s?p=`${o("videoPlayer.timeLeft",{timeLeft:f})}${r.time===r.duration?"":h} `:a===vl.REMAINING&&s?p=`-${f}`:p="",E("button",{type:"button",className:["group pointer-events-auto text-white transition-transform duration-100 active:scale-110"].join(" "),onClick:()=>{i(a===vl.REGULAR?vl.REMAINING:vl.REGULAR)},children:E("div",{className:["flex items-center justify-center rounded-full bg-denim-600 bg-opacity-0 p-2 transition-colors duration-100 group-hover:bg-opacity-50 group-active:bg-denim-500 group-active:bg-opacity-100 sm:px-4"].join(" "),children:E("div",{className:t.className,children:E("p",{className:"select-none text-white",children:p})})})})}function T7e(t){const e=Re(),r=st(e),n=Cn(e),i=Bi(e),{setStoredVolume:a,toggleVolume:s}=sX(e),o=A.useRef(null),[c,l]=A.useState(!1),u=A.useCallback(y=>{r.setVolume(y),a(y)},[r,a]),{dragging:f,dragPercentage:d,dragMouseDown:h}=dX(o,u,!0);A.useEffect(()=>{i.leftControlHovering||l(!1)},[i]);const p=A.useCallback(()=>{s()},[s]),v=A.useCallback(async()=>{await G0()&&l(!0)},[l]);let m=t0(n.volume*100);f&&(m=t0(d));const g=Zv(m);return E("div",{className:t.className,children:Y("div",{className:"pointer-events-auto flex cursor-pointer items-center",onMouseEnter:v,children:[E("div",{className:"px-4 text-2xl text-white",onClick:p,children:E(Ve,{icon:m>0?ue.VOLUME:ue.VOLUME_X})}),E("div",{className:`linear -ml-2 w-0 overflow-hidden transition-[width,opacity] duration-300 ${c||f?"!w-24 opacity-100":"w-4 opacity-0"}`,children:E("div",{ref:o,className:"flex h-10 w-20 items-center px-2",onMouseDown:h,onTouchStart:h,children:E("div",{className:"relative h-1 flex-1 rounded-full bg-gray-500 bg-opacity-50",children:E("div",{className:"absolute inset-y-0 left-0 flex items-center justify-end rounded-full bg-bink-500",style:{width:g},children:E("div",{className:"absolute h-3 w-3 translate-x-1/2 rounded-full bg-white"})})})})})]})})}function mX(t){return{error:t.error}}function Yw(t,e){bc(t,"error",mX(e))}function R7e(t){const e=Sr(t),[r,n]=A.useState(mX(e));return A.useEffect(()=>{function i(a){n(a.detail)}return Ec(t,"error",i),()=>{Sc(t,"error",i)}},[t]),r}function A7e(t){const e=Re(),r=ui(e),i=R7e(e).error;return i?Y("div",{children:[Y("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-denim-100",children:[E(nn,{icon:ue.WARNING,className:"mb-6 text-red-400"}),E(lm,{children:"Failed to load media"}),Y("p",{className:"my-6 max-w-lg text-center",children:[i==null?void 0:i.name,": ",i==null?void 0:i.description]})]}),E("div",{className:"pointer-events-auto absolute inset-x-0 top-0 flex flex-col px-8 py-6 pb-2",children:E(_c,{media:r==null?void 0:r.meta.meta,onClick:t.onGoBack})})]}):t.children}var pO=pm(),Te=t=>hm(t,pO),mO=pm();Te.write=t=>hm(t,mO);var mE=pm();Te.onStart=t=>hm(t,mE);var gO=pm();Te.onFrame=t=>hm(t,gO);var vO=pm();Te.onFinish=t=>hm(t,vO);var Yu=[];Te.setTimeout=(t,e)=>{let r=Te.now()+e,n=()=>{let a=Yu.findIndex(s=>s.cancel==n);~a&&Yu.splice(a,1),ro-=~a?1:0},i={time:r,handler:t,cancel:n};return Yu.splice(gX(r),0,i),ro+=1,vX(),i};var gX=t=>~(~Yu.findIndex(e=>e.time>t)||~Yu.length);Te.cancel=t=>{mE.delete(t),gO.delete(t),vO.delete(t),pO.delete(t),mO.delete(t)};Te.sync=t=>{kA=!0,Te.batchedUpdates(t),kA=!1};Te.throttle=t=>{let e;function r(){try{t(...e)}finally{e=null}}function n(...i){e=i,Te.onStart(r)}return n.handler=t,n.cancel=()=>{mE.delete(r),e=null},n};var yO=typeof window<"u"?window.requestAnimationFrame:()=>{};Te.use=t=>yO=t;Te.now=typeof performance<"u"?()=>performance.now():Date.now;Te.batchedUpdates=t=>t();Te.catch=console.error;Te.frameLoop="always";Te.advance=()=>{Te.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):xX()};var to=-1,ro=0,kA=!1;function hm(t,e){kA?(e.delete(t),t(0)):(e.add(t),vX())}function vX(){to<0&&(to=0,Te.frameLoop!=="demand"&&yO(yX))}function I7e(){to=-1}function yX(){~to&&(yO(yX),Te.batchedUpdates(xX))}function xX(){let t=to;to=Te.now();let e=gX(to);if(e&&(bX(Yu.splice(0,e),r=>r.handler()),ro-=e),!ro){I7e();return}mE.flush(),pO.flush(t?Math.min(64,to-t):16.667),gO.flush(),mO.flush(),vO.flush()}function pm(){let t=new Set,e=t;return{add(r){ro+=e==t&&!t.has(r)?1:0,t.add(r)},delete(r){return ro-=e==t&&t.has(r)?1:0,t.delete(r)},flush(r){e.size&&(t=new Set,ro-=e.size,bX(e,n=>n(r)&&t.add(n)),ro+=t.size,e=t)}}}function bX(t,e){t.forEach(r=>{try{e(r)}catch(n){Te.catch(n)}})}var $7e=Object.defineProperty,C7e=(t,e)=>{for(var r in e)$7e(t,r,{get:e[r],enumerable:!0})},Pi={};C7e(Pi,{assign:()=>O7e,colors:()=>go,createStringInterpolator:()=>bO,skipAnimation:()=>SX,to:()=>EX,willAdvance:()=>EO});function OA(){}var k7e=(t,e,r)=>Object.defineProperty(t,e,{value:r,writable:!0,configurable:!0}),ne={arr:Array.isArray,obj:t=>!!t&&t.constructor.name==="Object",fun:t=>typeof t=="function",str:t=>typeof t=="string",num:t=>typeof t=="number",und:t=>t===void 0};function Ba(t,e){if(ne.arr(t)){if(!ne.arr(e)||t.length!==e.length)return!1;for(let r=0;rt.forEach(e);function ya(t,e,r){if(ne.arr(t)){for(let n=0;nne.und(t)?[]:ne.arr(t)?t:[t];function r0(t,e){if(t.size){let r=Array.from(t);t.clear(),Pe(r,e)}}var Ih=(t,...e)=>r0(t,r=>r(...e)),xO=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),bO,EX,go=null,SX=!1,EO=OA,O7e=t=>{t.to&&(EX=t.to),t.now&&(Te.now=t.now),t.colors!==void 0&&(go=t.colors),t.skipAnimation!=null&&(SX=t.skipAnimation),t.createStringInterpolator&&(bO=t.createStringInterpolator),t.requestAnimationFrame&&Te.use(t.requestAnimationFrame),t.batchedUpdates&&(Te.batchedUpdates=t.batchedUpdates),t.willAdvance&&(EO=t.willAdvance),t.frameLoop&&(Te.frameLoop=t.frameLoop)},n0=new Set,Kn=[],qw=[],T1=0,gE={get idle(){return!n0.size&&!Kn.length},start(t){T1>t.priority?(n0.add(t),Te.onStart(L7e)):(_X(t),Te(LA))},advance:LA,sort(t){if(T1)Te.onFrame(()=>gE.sort(t));else{let e=Kn.indexOf(t);~e&&(Kn.splice(e,1),wX(t))}},clear(){Kn=[],n0.clear()}};function L7e(){n0.forEach(_X),n0.clear(),Te(LA)}function _X(t){Kn.includes(t)||wX(t)}function wX(t){Kn.splice(P7e(Kn,e=>e.priority>t.priority),0,t)}function LA(t){let e=qw;for(let r=0;r0}function P7e(t,e){let r=t.findIndex(e);return r<0?t.length:r}var N7e=(t,e,r)=>Math.min(Math.max(r,t),e),D7e={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},Ii="[-+]?\\d*\\.?\\d+",R1=Ii+"%";function vE(...t){return"\\(\\s*("+t.join(")\\s*,\\s*(")+")\\s*\\)"}var M7e=new RegExp("rgb"+vE(Ii,Ii,Ii)),F7e=new RegExp("rgba"+vE(Ii,Ii,Ii,Ii)),B7e=new RegExp("hsl"+vE(Ii,R1,R1)),U7e=new RegExp("hsla"+vE(Ii,R1,R1,Ii)),j7e=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,H7e=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,z7e=/^#([0-9a-fA-F]{6})$/,G7e=/^#([0-9a-fA-F]{8})$/;function V7e(t){let e;return typeof t=="number"?t>>>0===t&&t>=0&&t<=4294967295?t:null:(e=z7e.exec(t))?parseInt(e[1]+"ff",16)>>>0:go&&go[t]!==void 0?go[t]:(e=M7e.exec(t))?(Kc(e[1])<<24|Kc(e[2])<<16|Kc(e[3])<<8|255)>>>0:(e=F7e.exec(t))?(Kc(e[1])<<24|Kc(e[2])<<16|Kc(e[3])<<8|Q6(e[4]))>>>0:(e=j7e.exec(t))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+"ff",16)>>>0:(e=G7e.exec(t))?parseInt(e[1],16)>>>0:(e=H7e.exec(t))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+e[4]+e[4],16)>>>0:(e=B7e.exec(t))?(q6(X6(e[1]),jg(e[2]),jg(e[3]))|255)>>>0:(e=U7e.exec(t))?(q6(X6(e[1]),jg(e[2]),jg(e[3]))|Q6(e[4]))>>>0:null}function Xw(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function q6(t,e,r){let n=r<.5?r*(1+e):r+e-r*e,i=2*r-n,a=Xw(i,n,t+1/3),s=Xw(i,n,t),o=Xw(i,n,t-1/3);return Math.round(a*255)<<24|Math.round(s*255)<<16|Math.round(o*255)<<8}function Kc(t){let e=parseInt(t,10);return e<0?0:e>255?255:e}function X6(t){return(parseFloat(t)%360+360)%360/360}function Q6(t){let e=parseFloat(t);return e<0?0:e>1?255:Math.round(e*255)}function jg(t){let e=parseFloat(t);return e<0?0:e>100?1:e/100}function Z6(t){let e=V7e(t);if(e===null)return t;e=e||0;let r=(e&4278190080)>>>24,n=(e&16711680)>>>16,i=(e&65280)>>>8,a=(e&255)/255;return`rgba(${r}, ${n}, ${i}, ${a})`}var V0=(t,e,r)=>{if(ne.fun(t))return t;if(ne.arr(t))return V0({range:t,output:e,extrapolate:r});if(ne.str(t.output[0]))return bO(t);let n=t,i=n.output,a=n.range||[0,1],s=n.extrapolateLeft||n.extrapolate||"extend",o=n.extrapolateRight||n.extrapolate||"extend",c=n.easing||(l=>l);return l=>{let u=K7e(l,a);return W7e(l,a[u],a[u+1],i[u],i[u+1],c,s,o,n.map)}};function W7e(t,e,r,n,i,a,s,o,c){let l=c?c(t):t;if(lr){if(o==="identity")return l;o==="clamp"&&(l=r)}return n===i?n:e===r?t<=e?n:i:(e===-1/0?l=-l:r===1/0?l=l-e:l=(l-e)/(r-e),l=a(l),n===-1/0?l=-l:i===1/0?l=l+n:l=l*(i-n)+n,l)}function K7e(t,e){for(var r=1;r=t);++r);return r-1}var Y7e=(t,e="end")=>r=>{r=e==="end"?Math.min(r,.999):Math.max(r,.001);let n=r*t,i=e==="end"?Math.floor(n):Math.ceil(n);return N7e(0,1,i/t)},A1=1.70158,Hg=A1*1.525,J6=A1+1,e5=2*Math.PI/3,t5=2*Math.PI/4.5,zg=t=>t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,PA={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>1-(1-t)*(1-t),easeInOutQuad:t=>t<.5?2*t*t:1-Math.pow(-2*t+2,2)/2,easeInCubic:t=>t*t*t,easeOutCubic:t=>1-Math.pow(1-t,3),easeInOutCubic:t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2,easeInQuart:t=>t*t*t*t,easeOutQuart:t=>1-Math.pow(1-t,4),easeInOutQuart:t=>t<.5?8*t*t*t*t:1-Math.pow(-2*t+2,4)/2,easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>1-Math.pow(1-t,5),easeInOutQuint:t=>t<.5?16*t*t*t*t*t:1-Math.pow(-2*t+2,5)/2,easeInSine:t=>1-Math.cos(t*Math.PI/2),easeOutSine:t=>Math.sin(t*Math.PI/2),easeInOutSine:t=>-(Math.cos(Math.PI*t)-1)/2,easeInExpo:t=>t===0?0:Math.pow(2,10*t-10),easeOutExpo:t=>t===1?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>t===0?0:t===1?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2,easeInCirc:t=>1-Math.sqrt(1-Math.pow(t,2)),easeOutCirc:t=>Math.sqrt(1-Math.pow(t-1,2)),easeInOutCirc:t=>t<.5?(1-Math.sqrt(1-Math.pow(2*t,2)))/2:(Math.sqrt(1-Math.pow(-2*t+2,2))+1)/2,easeInBack:t=>J6*t*t*t-A1*t*t,easeOutBack:t=>1+J6*Math.pow(t-1,3)+A1*Math.pow(t-1,2),easeInOutBack:t=>t<.5?Math.pow(2*t,2)*((Hg+1)*2*t-Hg)/2:(Math.pow(2*t-2,2)*((Hg+1)*(t*2-2)+Hg)+2)/2,easeInElastic:t=>t===0?0:t===1?1:-Math.pow(2,10*t-10)*Math.sin((t*10-10.75)*e5),easeOutElastic:t=>t===0?0:t===1?1:Math.pow(2,-10*t)*Math.sin((t*10-.75)*e5)+1,easeInOutElastic:t=>t===0?0:t===1?1:t<.5?-(Math.pow(2,20*t-10)*Math.sin((20*t-11.125)*t5))/2:Math.pow(2,-20*t+10)*Math.sin((20*t-11.125)*t5)/2+1,easeInBounce:t=>1-zg(1-t),easeOutBounce:zg,easeInOutBounce:t=>t<.5?(1-zg(1-2*t))/2:(1+zg(2*t-1))/2,steps:Y7e},wf=Symbol.for("FluidValue.get"),ec=Symbol.for("FluidValue.observers"),zn=t=>!!(t&&t[wf]),Yr=t=>t&&t[wf]?t[wf]():t,r5=t=>t[ec]||null;function q7e(t,e){t.eventObserved?t.eventObserved(e):t(e)}function W0(t,e){let r=t[ec];r&&r.forEach(n=>{q7e(n,e)})}var ipt,apt,z9,TX=(z9=class{constructor(t){le(this,ipt);le(this,apt);if(!t&&!(t=this.get))throw Error("Unknown getter");X7e(this,t)}},ipt=wf,apt=ec,z9),X7e=(t,e)=>RX(t,wf,e);function cd(t,e){if(t[wf]){let r=t[ec];r||RX(t,ec,r=new Set),r.has(e)||(r.add(e),t.observerAdded&&t.observerAdded(r.size,e))}return e}function K0(t,e){let r=t[ec];if(r&&r.has(e)){let n=r.size-1;n?r.delete(e):t[ec]=null,t.observerRemoved&&t.observerRemoved(n,e)}}var RX=(t,e,r)=>Object.defineProperty(t,e,{value:r,writable:!0,configurable:!0}),Jv=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,Q7e=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,n5=new RegExp(`(${Jv.source})(%|[a-z]+)`,"i"),Z7e=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,yE=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,AX=t=>{let[e,r]=J7e(t);if(!e||xO())return t;let n=window.getComputedStyle(document.documentElement).getPropertyValue(e);return n?n.trim():r&&r.startsWith("--")?window.getComputedStyle(document.documentElement).getPropertyValue(r)||t:r&&yE.test(r)?AX(r):r||t},J7e=t=>{let e=yE.exec(t);if(!e)return[,];let[,r,n]=e;return[r,n]},Qw,e9e=(t,e,r,n,i)=>`rgba(${Math.round(e)}, ${Math.round(r)}, ${Math.round(n)}, ${i})`,IX=t=>{Qw||(Qw=go?new RegExp(`(${Object.keys(go).join("|")})(?!\\w)`,"g"):/^\b$/);let e=t.output.map(i=>Yr(i).replace(yE,AX).replace(Q7e,Z6).replace(Qw,Z6)),r=e.map(i=>i.match(Jv).map(Number)),n=r[0].map((i,a)=>r.map(s=>{if(!(a in s))throw Error('The arity of each "output" value must be equal');return s[a]})).map(i=>V0({...t,output:i}));return i=>{var o;let a=!n5.test(e[0])&&((o=e.find(c=>n5.test(c)))==null?void 0:o.replace(Jv,"")),s=0;return e[0].replace(Jv,()=>`${n[s++](i)}${a||""}`).replace(Z7e,e9e)}},SO="react-spring: ",$X=t=>{let e=t,r=!1;if(typeof e!="function")throw new TypeError(`${SO}once requires a function parameter`);return(...n)=>{r||(e(...n),r=!0)}},t9e=$X(console.warn);function r9e(){t9e(`${SO}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var n9e=$X(console.warn);function i9e(){n9e(`${SO}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function xE(t){return ne.str(t)&&(t[0]=="#"||/\d/.test(t)||!xO()&&yE.test(t)||t in(go||{}))}function a9e(t){let e=A.useRef(null);return e.current===null&&(e.current=t()),e.current}var _O=xO()?A.useEffect:A.useLayoutEffect,s9e=()=>{let t=A.useRef(!1);return _O(()=>(t.current=!0,()=>{t.current=!1}),[]),t};function CX(){let t=A.useState()[1],e=s9e();return()=>{e.current&&t(Math.random())}}function o9e(t,e){let[r]=A.useState(()=>({inputs:e,result:t()})),n=A.useRef(),i=n.current,a=i;return a?e&&a.inputs&&l9e(e,a.inputs)||(a={inputs:e,result:t()}):a=r,A.useEffect(()=>{n.current=a,i==r&&(r.inputs=r.result=void 0)},[a]),a.result}function l9e(t,e){if(t.length!==e.length)return!1;for(let r=0;rA.useEffect(t,c9e),c9e=[];function i5(t){let e=A.useRef();return A.useEffect(()=>{e.current=t}),e.current}var Y0=Symbol.for("Animated:node"),u9e=t=>!!t&&t[Y0]===t,Zi=t=>t&&t[Y0],TO=(t,e)=>k7e(t,Y0,e),bE=t=>t&&t[Y0]&&t[Y0].getPayload(),kX=class{constructor(){le(this,"payload");TO(this,this)}getPayload(){return this.payload||[]}},mm=class extends kX{constructor(e){super();le(this,"done",!0);le(this,"elapsedTime");le(this,"lastPosition");le(this,"lastVelocity");le(this,"v0");le(this,"durationProgress",0);this._value=e,ne.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new mm(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,r){return ne.num(e)&&(this.lastPosition=e,r&&(e=Math.round(e/r)*r,this.done&&(this.lastPosition=e))),this._value===e?!1:(this._value=e,!0)}reset(){let{done:e}=this;this.done=!1,ne.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},q0=class extends mm{constructor(e){super(0);le(this,"_string",null);le(this,"_toString");this._toString=V0({output:[e,e]})}static create(e){return new q0(e)}getValue(){return this._string??(this._string=this._toString(this._value))}setValue(e){if(ne.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else if(super.setValue(e))this._string=null;else return!1;return!0}reset(e){e&&(this._toString=V0({output:[this.getValue(),e]})),this._value=0,super.reset()}},I1={dependencies:null},EE=class extends kX{constructor(t){super(),this.source=t,this.setValue(t)}getValue(t){let e={};return ya(this.source,(r,n)=>{u9e(r)?e[n]=r.getValue(t):zn(r)?e[n]=Yr(r):t||(e[n]=r)}),e}setValue(t){this.source=t,this.payload=this._makePayload(t)}reset(){this.payload&&Pe(this.payload,t=>t.reset())}_makePayload(t){if(t){let e=new Set;return ya(t,this._addToPayload,e),Array.from(e)}}_addToPayload(t){I1.dependencies&&zn(t)&&I1.dependencies.add(t);let e=bE(t);e&&Pe(e,r=>this.add(r))}},OX=class extends EE{constructor(e){super(e)}static create(e){return new OX(e)}getValue(){return this.source.map(e=>e.getValue())}setValue(e){let r=this.getPayload();return e.length==r.length?r.map((n,i)=>n.setValue(e[i])).some(Boolean):(super.setValue(e.map(f9e)),!0)}};function f9e(t){return(xE(t)?q0:mm).create(t)}function NA(t){let e=Zi(t);return e?e.constructor:ne.arr(t)?OX:xE(t)?q0:mm}var a5=(t,e)=>{let r=!ne.fun(t)||t.prototype&&t.prototype.isReactComponent;return A.forwardRef((n,i)=>{let a=A.useRef(null),s=r&&A.useCallback(p=>{a.current=p9e(i,p)},[i]),[o,c]=h9e(n,e),l=CX(),u=()=>{let p=a.current;r&&!p||(p?e.applyAnimatedValues(p,o.getValue(!0)):!1)===!1&&l()},f=new d9e(u,c),d=A.useRef();_O(()=>(d.current=f,Pe(c,p=>cd(p,f)),()=>{d.current&&(Pe(d.current.deps,p=>K0(p,d.current)),Te.cancel(d.current.update))})),A.useEffect(u,[]),wO(()=>()=>{let p=d.current;Pe(p.deps,v=>K0(v,p))});let h=e.getComponentProps(o.getValue());return A.createElement(t,{...h,ref:s})})},d9e=class{constructor(t,e){this.update=t,this.deps=e}eventObserved(t){t.type=="change"&&Te.write(this.update)}};function h9e(t,e){let r=new Set;return I1.dependencies=r,t.style&&(t={...t,style:e.createAnimatedStyle(t.style)}),t=new EE(t),I1.dependencies=null,[t,r]}function p9e(t,e){return t&&(ne.fun(t)?t(e):t.current=e),e}var s5=Symbol.for("AnimatedComponent"),m9e=(t,{applyAnimatedValues:e=()=>!1,createAnimatedStyle:r=i=>new EE(i),getComponentProps:n=i=>i}={})=>{let i={applyAnimatedValues:e,createAnimatedStyle:r,getComponentProps:n},a=s=>{let o=o5(s)||"Anonymous";return ne.str(s)?s=a[s]||(a[s]=a5(s,i)):s=s[s5]||(s[s5]=a5(s,i)),s.displayName=`Animated(${o})`,s};return ya(t,(s,o)=>{ne.arr(t)&&(o=o5(s)),a[o]=a(s)}),{animated:a}},o5=t=>ne.str(t)?t:t&&ne.str(t.displayName)?t.displayName:ne.fun(t)&&t.name||null;function wl(t,...e){return ne.fun(t)?t(...e):t}var i0=(t,e)=>t===!0||!!(e&&t&&(ne.fun(t)?t(e):En(t).includes(e))),LX=(t,e)=>ne.obj(t)?e&&t[e]:t,PX=(t,e)=>t.default===!0?t[e]:t.default?t.default[e]:void 0,g9e=t=>t,RO=(t,e=g9e)=>{let r=v9e;t.default&&t.default!==!0&&(t=t.default,r=Object.keys(t));let n={};for(let i of r){let a=e(t[i],i);ne.und(a)||(n[i]=a)}return n},v9e=["config","onProps","onStart","onChange","onPause","onResume","onRest"],y9e={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function x9e(t){let e={},r=0;if(ya(t,(n,i)=>{y9e[i]||(e[i]=n,r++)}),r)return e}function NX(t){let e=x9e(t);if(e){let r={to:e};return ya(t,(n,i)=>i in e||(r[i]=n)),r}return{...t}}function X0(t){return t=Yr(t),ne.arr(t)?t.map(X0):xE(t)?Pi.createStringInterpolator({range:[0,1],output:[t,t]})(1):t}function b9e(t){for(let e in t)return!0;return!1}function DA(t){return ne.fun(t)||ne.arr(t)&&ne.obj(t[0])}function E9e(t,e){var r;(r=t.ref)==null||r.delete(t),e==null||e.delete(t)}function S9e(t,e){var r;e&&t.ref!==e&&((r=t.ref)==null||r.delete(t),e.add(t),t.ref=e)}var MA={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}},FA={...MA.default,mass:1,damping:1,easing:PA.linear,clamp:!1},_9e=class{constructor(){le(this,"tension");le(this,"friction");le(this,"frequency");le(this,"damping");le(this,"mass");le(this,"velocity",0);le(this,"restVelocity");le(this,"precision");le(this,"progress");le(this,"duration");le(this,"easing");le(this,"clamp");le(this,"bounce");le(this,"decay");le(this,"round");Object.assign(this,FA)}};function w9e(t,e,r){r&&(r={...r},l5(r,e),e={...r,...e}),l5(t,e),Object.assign(t,e);for(let s in FA)t[s]==null&&(t[s]=FA[s]);let{frequency:n,damping:i}=t,{mass:a}=t;return ne.und(n)||(n<.01&&(n=.01),i<0&&(i=0),t.tension=Math.pow(2*Math.PI/n,2)*a,t.friction=4*Math.PI*i*a/n),t}function l5(t,e){if(!ne.und(e.decay))t.duration=void 0;else{let r=!ne.und(e.tension)||!ne.und(e.friction);(r||!ne.und(e.frequency)||!ne.und(e.damping)||!ne.und(e.mass))&&(t.duration=void 0,t.decay=void 0),r&&(t.frequency=void 0)}}var c5=[],T9e=class{constructor(){le(this,"changed",!1);le(this,"values",c5);le(this,"toValues",null);le(this,"fromValues",c5);le(this,"to");le(this,"from");le(this,"config",new _9e);le(this,"immediate",!1)}};function DX(t,{key:e,props:r,defaultProps:n,state:i,actions:a}){return new Promise((s,o)=>{let c,l,u=i0(r.cancel??(n==null?void 0:n.cancel),e);if(u)h();else{ne.und(r.pause)||(i.paused=i0(r.pause,e));let p=n==null?void 0:n.pause;p!==!0&&(p=i.paused||i0(p,e)),c=wl(r.delay||0,e),p?(i.resumeQueue.add(d),a.pause()):(a.resume(),d())}function f(){i.resumeQueue.add(d),i.timeouts.delete(l),l.cancel(),c=l.time-Te.now()}function d(){c>0&&!Pi.skipAnimation?(i.delayed=!0,l=Te.setTimeout(h,c),i.pauseQueue.add(f),i.timeouts.add(l)):h()}function h(){i.delayed&&(i.delayed=!1),i.pauseQueue.delete(f),i.timeouts.delete(l),t<=(i.cancelId||0)&&(u=!0);try{a.start({...r,callId:t,cancel:u},s)}catch(p){o(p)}}})}var AO=(t,e)=>e.length==1?e[0]:e.some(r=>r.cancelled)?qu(t.get()):e.every(r=>r.noop)?MX(t.get()):Ei(t.get(),e.every(r=>r.finished)),MX=t=>({value:t,noop:!0,finished:!0,cancelled:!1}),Ei=(t,e,r=!1)=>({value:t,finished:e,cancelled:r}),qu=t=>({value:t,cancelled:!0,finished:!1});function FX(t,e,r,n){let{callId:i,parentId:a,onRest:s}=e,{asyncTo:o,promise:c}=r;return!a&&t===o&&!e.reset?c:r.promise=(async()=>{r.asyncId=i,r.asyncTo=t;let l=RO(e,(m,g)=>g==="onRest"?void 0:m),u,f,d=new Promise((m,g)=>(u=m,f=g)),h=m=>{let g=i<=(r.cancelId||0)&&qu(n)||i!==r.asyncId&&Ei(n,!1);if(g)throw m.result=g,f(m),m},p=(m,g)=>{let y=new u5,x=new f5;return(async()=>{if(Pi.skipAnimation)throw Q0(r),x.result=Ei(n,!1),f(x),x;h(y);let b=ne.obj(m)?{...m}:{...g,to:m};b.parentId=i,ya(l,(S,w)=>{ne.und(b[w])&&(b[w]=S)});let _=await n.start(b);return h(y),r.paused&&await new Promise(S=>{r.resumeQueue.add(S)}),_})()},v;if(Pi.skipAnimation)return Q0(r),Ei(n,!1);try{let m;ne.arr(t)?m=(async g=>{for(let y of g)await p(y)})(t):m=Promise.resolve(t(p,n.stop.bind(n))),await Promise.all([m.then(u),d]),v=Ei(n.get(),!0,!1)}catch(m){if(m instanceof u5)v=m.result;else if(m instanceof f5)v=m.result;else throw m}finally{i==r.asyncId&&(r.asyncId=a,r.asyncTo=a?o:void 0,r.promise=a?c:void 0)}return ne.fun(s)&&Te.batchedUpdates(()=>{s(v,n,n.item)}),v})()}function Q0(t,e){r0(t.timeouts,r=>r.cancel()),t.pauseQueue.clear(),t.resumeQueue.clear(),t.asyncId=t.asyncTo=t.promise=void 0,e&&(t.cancelId=e)}var u5=class extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.");le(this,"result")}},f5=class extends Error{constructor(){super("SkipAnimationSignal");le(this,"result")}},BA=t=>t instanceof IO,R9e=1,IO=class extends TX{constructor(){super(...arguments);le(this,"id",R9e++);le(this,"_priority",0)}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){let e=Zi(this);return e&&e.getValue()}to(...e){return Pi.to(this,e)}interpolate(...e){return r9e(),Pi.to(this,e)}toJSON(){return this.get()}observerAdded(e){e==1&&this._attach()}observerRemoved(e){e==0&&this._detach()}_attach(){}_detach(){}_onChange(e,r=!1){W0(this,{type:"change",parent:this,value:e,idle:r})}_onPriorityChange(e){this.idle||gE.sort(this),W0(this,{type:"priority",parent:this,priority:e})}},tc=Symbol.for("SpringPhase"),BX=1,UA=2,jA=4,Zw=t=>(t[tc]&BX)>0,Ds=t=>(t[tc]&UA)>0,ah=t=>(t[tc]&jA)>0,d5=(t,e)=>e?t[tc]|=UA|BX:t[tc]&=~UA,h5=(t,e)=>e?t[tc]|=jA:t[tc]&=~jA,UX=class extends IO{constructor(e,r){super();le(this,"key");le(this,"animation",new T9e);le(this,"queue");le(this,"defaultProps",{});le(this,"_state",{paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set});le(this,"_pendingCalls",new Set);le(this,"_lastCallId",0);le(this,"_lastToId",0);le(this,"_memoizedDuration",0);if(!ne.und(e)||!ne.und(r)){let n=ne.obj(e)?{...e}:{...r,from:e};ne.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(Ds(this)||this._state.asyncTo)||ah(this)}get goal(){return Yr(this.animation.to)}get velocity(){let e=Zi(this);return e instanceof mm?e.lastVelocity||0:e.getPayload().map(r=>r.lastVelocity||0)}get hasAnimated(){return Zw(this)}get isAnimating(){return Ds(this)}get isPaused(){return ah(this)}get isDelayed(){return this._state.delayed}advance(e){let r=!0,n=!1,i=this.animation,{toValues:a}=i,{config:s}=i,o=bE(i.to);!o&&zn(i.to)&&(a=En(Yr(i.to))),i.values.forEach((u,f)=>{if(u.done)return;let d=u.constructor==q0?1:o?o[f].lastPosition:a[f],h=i.immediate,p=d;if(!h){if(p=u.lastPosition,s.tension<=0){u.done=!0;return}let v=u.elapsedTime+=e,m=i.fromValues[f],g=u.v0!=null?u.v0:u.v0=ne.arr(s.velocity)?s.velocity[f]:s.velocity,y,x=s.precision||(m==d?.005:Math.min(1,Math.abs(d-m)*.001));if(ne.und(s.duration))if(s.decay){let b=s.decay===!0?.998:s.decay,_=Math.exp(-(1-b)*v);p=m+g/(1-b)*(1-_),h=Math.abs(u.lastPosition-p)<=x,y=g*_}else{y=u.lastVelocity==null?g:u.lastVelocity;let b=s.restVelocity||x/10,_=s.clamp?0:s.bounce,S=!ne.und(_),w=m==d?u.v0>0:mb,!(!R&&(h=Math.abs(d-p)<=x,h)));++L){S&&(I=p==d||p>d==w,I&&(y=-y*_,p=d));let H=-s.tension*1e-6*(p-d),N=-s.friction*.001*y,P=(H+N)/s.mass;y=y+P*T,p=p+y*T}}else{let b=1;s.duration>0&&(this._memoizedDuration!==s.duration&&(this._memoizedDuration=s.duration,u.durationProgress>0&&(u.elapsedTime=s.duration*u.durationProgress,v=u.elapsedTime+=e)),b=(s.progress||0)+v/this._memoizedDuration,b=b>1?1:b<0?0:b,u.durationProgress=b),p=m+s.easing(b)*(d-m),y=(p-u.lastPosition)/e,h=b==1}u.lastVelocity=y,Number.isNaN(p)&&(console.warn("Got NaN while animating:",this),h=!0)}o&&!o[f].done&&(h=!1),h?u.done=!0:r=!1,u.setValue(p,s.round)&&(n=!0)});let c=Zi(this),l=c.getValue();if(r){let u=Yr(i.to);(l!==u||n)&&!s.decay?(c.setValue(u),this._onChange(u)):n&&s.decay&&this._onChange(l),this._stop()}else n&&this._onChange(l)}set(e){return Te.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(Ds(this)){let{to:e,config:r}=this.animation;Te.batchedUpdates(()=>{this._onStart(),r.decay||this._set(e,!1),this._stop()})}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,r){let n;return ne.und(e)?(n=this.queue||[],this.queue=[]):n=[ne.obj(e)?e:{...r,to:e}],Promise.all(n.map(i=>this._update(i))).then(i=>AO(this,i))}stop(e){let{to:r}=this.animation;return this._focus(this.get()),Q0(this._state,e&&this._lastCallId),Te.batchedUpdates(()=>this._stop(r,e)),this}reset(){this._update({reset:!0})}eventObserved(e){e.type=="change"?this._start():e.type=="priority"&&(this.priority=e.priority+1)}_prepareNode(e){let r=this.key||"",{to:n,from:i}=e;n=ne.obj(n)?n[r]:n,(n==null||DA(n))&&(n=void 0),i=ne.obj(i)?i[r]:i,i==null&&(i=void 0);let a={to:n,from:i};return Zw(this)||(e.reverse&&([n,i]=[i,n]),i=Yr(i),ne.und(i)?Zi(this)||this._set(n):this._set(i)),a}_update({...e},r){let{key:n,defaultProps:i}=this;e.default&&Object.assign(i,RO(e,(o,c)=>/^on/.test(c)?LX(o,n):o)),m5(this,e,"onProps"),oh(this,"onProps",e,this);let a=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");let s=this._state;return DX(++this._lastCallId,{key:n,props:e,defaultProps:i,state:s,actions:{pause:()=>{ah(this)||(h5(this,!0),Ih(s.pauseQueue),oh(this,"onPause",Ei(this,sh(this,this.animation.to)),this))},resume:()=>{ah(this)&&(h5(this,!1),Ds(this)&&this._resume(),Ih(s.resumeQueue),oh(this,"onResume",Ei(this,sh(this,this.animation.to)),this))},start:this._merge.bind(this,a)}}).then(o=>{if(e.loop&&o.finished&&!(r&&o.noop)){let c=jX(e);if(c)return this._update(c,!0)}return o})}_merge(e,r,n){if(r.cancel)return this.stop(!0),n(qu(this));let i=!ne.und(e.to),a=!ne.und(e.from);if(i||a)if(r.callId>this._lastToId)this._lastToId=r.callId;else return n(qu(this));let{key:s,defaultProps:o,animation:c}=this,{to:l,from:u}=c,{to:f=l,from:d=u}=e;a&&!i&&(!r.default||ne.und(f))&&(f=d),r.reverse&&([f,d]=[d,f]);let h=!Ba(d,u);h&&(c.from=d),d=Yr(d);let p=!Ba(f,l);p&&this._focus(f);let v=DA(r.to),{config:m}=c,{decay:g,velocity:y}=m;(i||a)&&(m.velocity=0),r.config&&!v&&w9e(m,wl(r.config,s),r.config!==o.config?wl(o.config,s):void 0);let x=Zi(this);if(!x||ne.und(f))return n(Ei(this,!0));let b=ne.und(r.reset)?a&&!r.default:!ne.und(d)&&i0(r.reset,s),_=b?d:this.get(),S=X0(f),w=ne.num(S)||ne.arr(S)||xE(S),R=!v&&(!w||i0(o.immediate||r.immediate,s));if(p){let L=NA(f);if(L!==x.constructor)if(R)x=this._set(S);else throw Error(`Cannot animate between ${x.constructor.name} and ${L.name}, as the "to" prop suggests`)}let I=x.constructor,T=zn(f),C=!1;if(!T){let L=b||!Zw(this)&&h;(p||L)&&(C=Ba(X0(_),S),T=!C),(!Ba(c.immediate,R)&&!R||!Ba(m.decay,g)||!Ba(m.velocity,y))&&(T=!0)}if(C&&Ds(this)&&(c.changed&&!b?T=!0:T||this._stop(l)),!v&&((T||zn(l))&&(c.values=x.getPayload(),c.toValues=zn(f)?null:I==q0?[1]:En(S)),c.immediate!=R&&(c.immediate=R,!R&&!b&&this._set(l)),T)){let{onRest:L}=c;Pe(I9e,N=>m5(this,r,N));let H=Ei(this,sh(this,l));Ih(this._pendingCalls,H),this._pendingCalls.add(n),c.changed&&Te.batchedUpdates(()=>{var N;c.changed=!b,L==null||L(H,this),b?wl(o.onRest,H):(N=c.onStart)==null||N.call(c,H,this)})}b&&this._set(_),v?n(FX(r.to,r,this._state,this)):T?this._start():Ds(this)&&!p?this._pendingCalls.add(n):n(MX(_))}_focus(e){let r=this.animation;e!==r.to&&(r5(this)&&this._detach(),r.to=e,r5(this)&&this._attach())}_attach(){let e=0,{to:r}=this.animation;zn(r)&&(cd(r,this),BA(r)&&(e=r.priority+1)),this.priority=e}_detach(){let{to:e}=this.animation;zn(e)&&K0(e,this)}_set(e,r=!0){let n=Yr(e);if(!ne.und(n)){let i=Zi(this);if(!i||!Ba(n,i.getValue())){let a=NA(n);!i||i.constructor!=a?TO(this,a.create(n)):i.setValue(n),i&&Te.batchedUpdates(()=>{this._onChange(n,r)})}}return Zi(this)}_onStart(){let e=this.animation;e.changed||(e.changed=!0,oh(this,"onStart",Ei(this,sh(this,e.to)),this))}_onChange(e,r){r||(this._onStart(),wl(this.animation.onChange,e,this)),wl(this.defaultProps.onChange,e,this),super._onChange(e,r)}_start(){let e=this.animation;Zi(this).reset(Yr(e.to)),e.immediate||(e.fromValues=e.values.map(r=>r.lastPosition)),Ds(this)||(d5(this,!0),ah(this)||this._resume())}_resume(){Pi.skipAnimation?this.finish():gE.start(this)}_stop(e,r){if(Ds(this)){d5(this,!1);let n=this.animation;Pe(n.values,a=>{a.done=!0}),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),W0(this,{type:"idle",parent:this});let i=r?qu(this.get()):Ei(this.get(),sh(this,e??n.to));Ih(this._pendingCalls,i),n.changed&&(n.changed=!1,oh(this,"onRest",i,this))}}};function sh(t,e){let r=X0(e),n=X0(t.get());return Ba(n,r)}function jX(t,e=t.loop,r=t.to){let n=wl(e);if(n){let i=n!==!0&&NX(n),a=(i||t).reverse,s=!i||i.reset;return Z0({...t,loop:e,default:!1,pause:void 0,to:!a||DA(r)?r:void 0,from:s?t.from:void 0,reset:s,...i})}}function Z0(t){let{to:e,from:r}=t=NX(t),n=new Set;return ne.obj(e)&&p5(e,n),ne.obj(r)&&p5(r,n),t.keys=n.size?Array.from(n):null,t}function A9e(t){let e=Z0(t);return ne.und(e.default)&&(e.default=RO(e)),e}function p5(t,e){ya(t,(r,n)=>r!=null&&e.add(n))}var I9e=["onStart","onRest","onChange","onPause","onResume"];function m5(t,e,r){t.animation[r]=e[r]!==PX(e,r)?LX(e[r],t.key):void 0}function oh(t,e,...r){var n,i,a,s;(i=(n=t.animation)[e])==null||i.call(n,...r),(s=(a=t.defaultProps)[e])==null||s.call(a,...r)}var $9e=["onStart","onChange","onRest"],C9e=1,k9e=class{constructor(t,e){le(this,"id",C9e++);le(this,"springs",{});le(this,"queue",[]);le(this,"ref");le(this,"_flush");le(this,"_initialProps");le(this,"_lastAsyncId",0);le(this,"_active",new Set);le(this,"_changed",new Set);le(this,"_started",!1);le(this,"_item");le(this,"_state",{paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set});le(this,"_events",{onStart:new Map,onChange:new Map,onRest:new Map});this._onFrame=this._onFrame.bind(this),e&&(this._flush=e),t&&this.start({default:!0,...t})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(t=>t.idle&&!t.isDelayed&&!t.isPaused)}get item(){return this._item}set item(t){this._item=t}get(){let t={};return this.each((e,r)=>t[r]=e.get()),t}set(t){for(let e in t){let r=t[e];ne.und(r)||this.springs[e].set(r)}}update(t){return t&&this.queue.push(Z0(t)),this}start(t){let{queue:e}=this;return t?e=En(t).map(Z0):this.queue=[],this._flush?this._flush(this,e):(WX(this,e),HA(this,e))}stop(t,e){if(t!==!!t&&(e=t),e){let r=this.springs;Pe(En(e),n=>r[n].stop(!!t))}else Q0(this._state,this._lastAsyncId),this.each(r=>r.stop(!!t));return this}pause(t){if(ne.und(t))this.start({pause:!0});else{let e=this.springs;Pe(En(t),r=>e[r].pause())}return this}resume(t){if(ne.und(t))this.start({pause:!1});else{let e=this.springs;Pe(En(t),r=>e[r].resume())}return this}each(t){ya(this.springs,t)}_onFrame(){let{onStart:t,onChange:e,onRest:r}=this._events,n=this._active.size>0,i=this._changed.size>0;(n&&!this._started||i&&!this._started)&&(this._started=!0,r0(t,([o,c])=>{c.value=this.get(),o(c,this,this._item)}));let a=!n&&this._started,s=i||a&&r.size?this.get():null;i&&e.size&&r0(e,([o,c])=>{c.value=s,o(c,this,this._item)}),a&&(this._started=!1,r0(r,([o,c])=>{c.value=s,o(c,this,this._item)}))}eventObserved(t){if(t.type=="change")this._changed.add(t.parent),t.idle||this._active.add(t.parent);else if(t.type=="idle")this._active.delete(t.parent);else return;Te.onFrame(this._onFrame)}};function HA(t,e){return Promise.all(e.map(r=>HX(t,r))).then(r=>AO(t,r))}async function HX(t,e,r){let{keys:n,to:i,from:a,loop:s,onRest:o,onResolve:c}=e,l=ne.obj(e.default)&&e.default;s&&(e.loop=!1),i===!1&&(e.to=null),a===!1&&(e.from=null);let u=ne.arr(i)||ne.fun(i)?i:void 0;u?(e.to=void 0,e.onRest=void 0,l&&(l.onRest=void 0)):Pe($9e,v=>{let m=e[v];if(ne.fun(m)){let g=t._events[v];e[v]=({finished:y,cancelled:x})=>{let b=g.get(m);b?(y||(b.finished=!1),x&&(b.cancelled=!0)):g.set(m,{value:null,finished:y||!1,cancelled:x||!1})},l&&(l[v]=e[v])}});let f=t._state;e.pause===!f.paused?(f.paused=e.pause,Ih(e.pause?f.pauseQueue:f.resumeQueue)):f.paused&&(e.pause=!0);let d=(n||Object.keys(t.springs)).map(v=>t.springs[v].start(e)),h=e.cancel===!0||PX(e,"cancel")===!0;(u||h&&f.asyncId)&&d.push(DX(++t._lastAsyncId,{props:e,state:f,actions:{pause:OA,resume:OA,start(v,m){h?(Q0(f,t._lastAsyncId),m(qu(t))):(v.onRest=o,m(FX(u,v,f,t)))}}})),f.paused&&await new Promise(v=>{f.resumeQueue.add(v)});let p=AO(t,await Promise.all(d));if(s&&p.finished&&!(r&&p.noop)){let v=jX(e,s,i);if(v)return WX(t,[v]),HX(t,v,!0)}return c&&Te.batchedUpdates(()=>c(p,t,t.item)),p}function g5(t,e){let r={...t.springs};return e&&Pe(En(e),n=>{ne.und(n.keys)&&(n=Z0(n)),ne.obj(n.to)||(n={...n,to:void 0}),VX(r,n,i=>GX(i))}),zX(t,r),r}function zX(t,e){ya(e,(r,n)=>{t.springs[n]||(t.springs[n]=r,cd(r,t))})}function GX(t,e){let r=new UX;return r.key=t,e&&cd(r,e),r}function VX(t,e,r){e.keys&&Pe(e.keys,n=>{(t[n]||(t[n]=r(n)))._prepareNode(e)})}function WX(t,e){Pe(e,r=>{VX(t.springs,r,n=>GX(n,t))})}var SE=({children:t,...e})=>{let r=A.useContext($1),n=e.pause||!!r.pause,i=e.immediate||!!r.immediate;e=o9e(()=>({pause:n,immediate:i}),[n,i]);let{Provider:a}=$1;return A.createElement(a,{value:e},t)},$1=O9e(SE,{});SE.Provider=$1.Provider;SE.Consumer=$1.Consumer;function O9e(t,e){return Object.assign(t,A.createContext(e)),t.Provider._context=t,t.Consumer._context=t,t}var L9e=()=>{let t=[],e=function(n){i9e();let i=[];return Pe(t,(a,s)=>{if(ne.und(n))i.push(a.start());else{let o=r(n,a,s);o&&i.push(a.start(o))}}),i};e.current=t,e.add=function(n){t.includes(n)||t.push(n)},e.delete=function(n){let i=t.indexOf(n);~i&&t.splice(i,1)},e.pause=function(){return Pe(t,n=>n.pause(...arguments)),this},e.resume=function(){return Pe(t,n=>n.resume(...arguments)),this},e.set=function(n){Pe(t,(i,a)=>{let s=ne.fun(n)?n(a,i):n;s&&i.set(s)})},e.start=function(n){let i=[];return Pe(t,(a,s)=>{if(ne.und(n))i.push(a.start());else{let o=this._getProps(n,a,s);o&&i.push(a.start(o))}}),i},e.stop=function(){return Pe(t,n=>n.stop(...arguments)),this},e.update=function(n){return Pe(t,(i,a)=>i.update(this._getProps(n,i,a))),this};let r=function(n,i,a){return ne.fun(n)?n(a,i):n};return e._getProps=r,e};function P9e(t,e,r){let n=ne.fun(e)&&e;n&&!r&&(r=[]);let i=A.useMemo(()=>n||arguments.length==3?L9e():void 0,[]),a=A.useRef(0),s=CX(),o=A.useMemo(()=>({ctrls:[],queue:[],flush(g,y){let x=g5(g,y);return a.current>0&&!o.queue.length&&!Object.keys(x).some(b=>!g.springs[b])?HA(g,y):new Promise(b=>{zX(g,x),o.queue.push(()=>{b(HA(g,y))}),s()})}}),[]),c=A.useRef([...o.ctrls]),l=[],u=i5(t)||0;A.useMemo(()=>{Pe(c.current.slice(t,u),g=>{E9e(g,i),g.stop(!0)}),c.current.length=t,f(u,t)},[t]),A.useMemo(()=>{f(0,Math.min(u,t))},r);function f(g,y){for(let x=g;xg5(g,l[y])),h=A.useContext(SE),p=i5(h),v=h!==p&&b9e(h);_O(()=>{a.current++,o.ctrls=c.current;let{queue:g}=o;g.length&&(o.queue=[],Pe(g,y=>y())),Pe(c.current,(y,x)=>{i==null||i.add(y),v&&y.start({default:h});let b=l[x];b&&(S9e(y,b.ref),y.ref?y.queue.push(b):y.start(b))})}),wO(()=>()=>{Pe(o.ctrls,g=>g.stop(!0))});let m=d.map(g=>({...g}));return i?[m,i]:m}function N9e(t,e){let r=ne.fun(t),[[n],i]=P9e(1,r?t:[t],r?e||[]:e);return r||arguments.length==2?[n,i]:n}var v5=(t,e)=>{let r=a9e(()=>new UX(t,e));return wO(()=>()=>{r.stop()}),r},D9e=class extends IO{constructor(e,r){super();le(this,"key");le(this,"idle",!0);le(this,"calc");le(this,"_active",new Set);this.source=e,this.calc=V0(...r);let n=this._get(),i=NA(n);TO(this,i.create(n))}advance(e){let r=this._get(),n=this.get();Ba(r,n)||(Zi(this).setValue(r),this._onChange(r,this.idle)),!this.idle&&y5(this._active)&&Jw(this)}_get(){let e=ne.arr(this.source)?this.source.map(Yr):En(Yr(this.source));return this.calc(...e)}_start(){this.idle&&!y5(this._active)&&(this.idle=!1,Pe(bE(this),e=>{e.done=!1}),Pi.skipAnimation?(Te.batchedUpdates(()=>this.advance()),Jw(this)):gE.start(this))}_attach(){let e=1;Pe(En(this.source),r=>{zn(r)&&cd(r,this),BA(r)&&(r.idle||this._active.add(r),e=Math.max(e,r.priority+1))}),this.priority=e,this._start()}_detach(){Pe(En(this.source),e=>{zn(e)&&K0(e,this)}),this._active.clear(),Jw(this)}eventObserved(e){e.type=="change"?e.idle?this.advance():(this._active.add(e.parent),this._start()):e.type=="idle"?this._active.delete(e.parent):e.type=="priority"&&(this.priority=En(this.source).reduce((r,n)=>Math.max(r,(BA(n)?n.priority:0)+1),0))}};function M9e(t){return t.idle!==!1}function y5(t){return!t.size||Array.from(t).every(M9e)}function Jw(t){t.idle||(t.idle=!0,Pe(bE(t),e=>{e.done=!0}),W0(t,{type:"idle",parent:t}))}Pi.assign({createStringInterpolator:IX,to:(t,e)=>new D9e(t,e)});var KX=/^--/;function F9e(t,e){return e==null||typeof e=="boolean"||e===""?"":typeof e=="number"&&e!==0&&!KX.test(t)&&!(a0.hasOwnProperty(t)&&a0[t])?e+"px":(""+e).trim()}var x5={};function B9e(t,e){if(!t.nodeType||!t.setAttribute)return!1;let r=t.nodeName==="filter"||t.parentNode&&t.parentNode.nodeName==="filter",{style:n,children:i,scrollTop:a,scrollLeft:s,viewBox:o,...c}=e,l=Object.values(c),u=Object.keys(c).map(f=>r||t.hasAttribute(f)?f:x5[f]||(x5[f]=f.replace(/([A-Z])/g,d=>"-"+d.toLowerCase())));i!==void 0&&(t.textContent=i);for(let f in n)if(n.hasOwnProperty(f)){let d=F9e(f,n[f]);KX.test(f)?t.style.setProperty(f,d):t.style[f]=d}u.forEach((f,d)=>{t.setAttribute(f,l[d])}),a!==void 0&&(t.scrollTop=a),s!==void 0&&(t.scrollLeft=s),o!==void 0&&t.setAttribute("viewBox",o)}var a0={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},U9e=(t,e)=>t+e.charAt(0).toUpperCase()+e.substring(1),j9e=["Webkit","Ms","Moz","O"];a0=Object.keys(a0).reduce((t,e)=>(j9e.forEach(r=>t[U9e(r,e)]=t[e]),t),a0);var H9e=/^(matrix|translate|scale|rotate|skew)/,z9e=/^(translate)/,G9e=/^(rotate|skew)/,eT=(t,e)=>ne.num(t)&&t!==0?t+e:t,ey=(t,e)=>ne.arr(t)?t.every(r=>ey(r,e)):ne.num(t)?t===e:parseFloat(t)===e,V9e=class extends EE{constructor({x:t,y:e,z:r,...n}){let i=[],a=[];(t||e||r)&&(i.push([t||0,e||0,r||0]),a.push(s=>[`translate3d(${s.map(o=>eT(o,"px")).join(",")})`,ey(s,0)])),ya(n,(s,o)=>{if(o==="transform")i.push([s||""]),a.push(c=>[c,c===""]);else if(H9e.test(o)){if(delete n[o],ne.und(s))return;let c=z9e.test(o)?"px":G9e.test(o)?"deg":"";i.push(En(s)),a.push(o==="rotate3d"?([l,u,f,d])=>[`rotate3d(${l},${u},${f},${eT(d,c)})`,ey(d,0)]:l=>[`${o}(${l.map(u=>eT(u,c)).join(",")})`,ey(l,o.startsWith("scale")?1:0)])}}),i.length&&(n.transform=new W9e(i,a)),super(n)}},W9e=class extends TX{constructor(e,r){super();le(this,"_value",null);this.inputs=e,this.transforms=r}get(){return this._value||(this._value=this._get())}_get(){let e="",r=!0;return Pe(this.inputs,(n,i)=>{let a=Yr(n[0]),[s,o]=this.transforms[i](ne.arr(a)?a:n.map(Yr));e+=" "+s,r=r&&o}),r?"none":e}observerAdded(e){e==1&&Pe(this.inputs,r=>Pe(r,n=>zn(n)&&cd(n,this)))}observerRemoved(e){e==0&&Pe(this.inputs,r=>Pe(r,n=>zn(n)&&K0(n,this)))}eventObserved(e){e.type=="change"&&(this._value=null),W0(this,e)}},K9e=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"];Pi.assign({batchedUpdates:ql.unstable_batchedUpdates,createStringInterpolator:IX,colors:D7e});var Y9e=m9e(K9e,{applyAnimatedValues:B9e,createAnimatedStyle:t=>new V9e(t),getComponentProps:({scrollTop:t,scrollLeft:e,...r})=>r}),YX=Y9e.animated;function q9e(t){const e=A.useRef(null),[r,n]=A.useState(0),[i,a]=A.useState(0),[s,o]=A.useState(null),[c,l]=A.useState(null),u=A.useCallback((f,d)=>{const h=f.left+f.width/2,p=window.innerHeight-f.bottom;a(window.innerHeight-p-f.height-d.height-30),n(Math.min(h-d.width/2,window.innerWidth-d.width-30))},[]);return A.useEffect(()=>{!c||!s||u(c,s)},[c,u,s]),A.useEffect(()=>{if(!e.current)return;function f(){var p;const h=(p=e.current)==null?void 0:p.getBoundingClientRect();o(h??null)}f();const d=new ResizeObserver(f);return d.observe(e.current),()=>{d.disconnect()}},[]),A.useEffect(()=>{const f=CA(t.id);window[f]&&l(window[f]);function d(h){l(h.detail)}return document.addEventListener(f,d),()=>{document.removeEventListener(f,d)}},[t.id]),E("div",{ref:e,style:{transform:`translateX(${r}px) translateY(${i}px)`},className:["pointer-events-auto z-10 inline-block origin-top-left touch-none overflow-hidden",t.className??""].join(" "),children:t.children})}function X9e(t,e,r){return Math.max(e,Math.min(t,r))}const vr={toVector(t,e){return t===void 0&&(t=e),Array.isArray(t)?t:[t,t]},add(t,e){return[t[0]+e[0],t[1]+e[1]]},sub(t,e){return[t[0]-e[0],t[1]-e[1]]},addTo(t,e){t[0]+=e[0],t[1]+=e[1]},subTo(t,e){t[0]-=e[0],t[1]-=e[1]}};function b5(t,e,r){return e===0||Math.abs(e)===1/0?Math.pow(t,r*5):t*e*r/(e+r*t)}function E5(t,e,r,n=.15){return n===0?X9e(t,e,r):tr?+b5(t-r,r-e,n)+r:t}function Q9e(t,[e,r],[n,i]){const[[a,s],[o,c]]=t;return[E5(e,a,s,n),E5(r,o,c,i)]}function Z9e(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function J9e(t){var e=Z9e(t,"string");return typeof e=="symbol"?e:String(e)}function Kr(t,e,r){return e=J9e(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function S5(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function xt(t){for(var e=1;e{var r,n;return e.target===t.currentTarget||((r=t.currentTarget)===null||r===void 0||(n=r.contains)===null||n===void 0?void 0:n.call(r,e.target))})}function oje(t){return t.type==="touchend"||t.type==="touchcancel"?t.changedTouches:t.targetTouches}function QX(t){return _E(t)?oje(t)[0]:t}function lje(t){return sje(t).map(e=>e.identifier)}function tT(t){const e=QX(t);return _E(t)?e.identifier:e.pointerId}function w5(t){const e=QX(t);return[e.clientX,e.clientY]}function cje(t){const e={};if("buttons"in t&&(e.buttons=t.buttons),"shiftKey"in t){const{shiftKey:r,altKey:n,metaKey:i,ctrlKey:a}=t;Object.assign(e,{shiftKey:r,altKey:n,metaKey:i,ctrlKey:a})}return e}function C1(t,...e){return typeof t=="function"?t(...e):t}function uje(){}function fje(...t){return t.length===0?uje:t.length===1?t[0]:function(){let e;for(const r of t)e=r.apply(this,arguments)||e;return e}}function T5(t,e){return Object.assign({},e,t||{})}const dje=32;class hje{constructor(e,r,n){this.ctrl=e,this.args=r,this.key=n,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:e,shared:r,ingKey:n,args:i}=this;r[n]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=i,e.axis=void 0,e.memo=void 0,e.elapsedTime=e.timeDelta=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){const r=this.state,n=this.config;r._active||(this.reset(),this.computeInitial(),r._active=!0,r.target=e.target,r.currentTarget=e.currentTarget,r.lastOffset=n.from?C1(n.from,r):r.offset,r.offset=r.lastOffset,r.startTime=r.timeStamp=e.timeStamp)}computeValues(e){const r=this.state;r._values=e,r.values=this.config.transform(e)}computeInitial(){const e=this.state;e._initial=e._values,e.initial=e.values}compute(e){const{state:r,config:n,shared:i}=this;r.args=this.args;let a=0;if(e&&(r.event=e,n.preventDefault&&e.cancelable&&r.event.preventDefault(),r.type=e.type,i.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,i.locked=!!document.pointerLockElement,Object.assign(i,cje(e)),i.down=i.pressed=i.buttons%2===1||i.touches>0,a=e.timeStamp-r.timeStamp,r.timeStamp=e.timeStamp,r.elapsedTime=r.timeStamp-r.startTime),r._active){const S=r._delta.map(Math.abs);vr.addTo(r._distance,S)}this.axisIntent&&this.axisIntent(e);const[s,o]=r._movement,[c,l]=n.threshold,{_step:u,values:f}=r;if(n.hasCustomTransform?(u[0]===!1&&(u[0]=Math.abs(s)>=c&&f[0]),u[1]===!1&&(u[1]=Math.abs(o)>=l&&f[1])):(u[0]===!1&&(u[0]=Math.abs(s)>=c&&Math.sign(s)*c),u[1]===!1&&(u[1]=Math.abs(o)>=l&&Math.sign(o)*l)),r.intentional=u[0]!==!1||u[1]!==!1,!r.intentional)return;const d=[0,0];if(n.hasCustomTransform){const[S,w]=f;d[0]=u[0]!==!1?S-u[0]:0,d[1]=u[1]!==!1?w-u[1]:0}else d[0]=u[0]!==!1?s-u[0]:0,d[1]=u[1]!==!1?o-u[1]:0;this.restrictToAxis&&!r._blocked&&this.restrictToAxis(d);const h=r.offset,p=r._active&&!r._blocked||r.active;p&&(r.first=r._active&&!r.active,r.last=!r._active&&r.active,r.active=i[this.ingKey]=r._active,e&&(r.first&&("bounds"in n&&(r._bounds=C1(n.bounds,r)),this.setup&&this.setup()),r.movement=d,this.computeOffset()));const[v,m]=r.offset,[[g,y],[x,b]]=r._bounds;r.overflow=[vy?1:0,mb?1:0],r._movementBound[0]=r.overflow[0]?r._movementBound[0]===!1?r._movement[0]:r._movementBound[0]:!1,r._movementBound[1]=r.overflow[1]?r._movementBound[1]===!1?r._movement[1]:r._movementBound[1]:!1;const _=r._active?n.rubberband||[0,0]:[0,0];if(r.offset=Q9e(r._bounds,r.offset,_),r.delta=vr.sub(r.offset,h),this.computeMovement(),p&&(!r.last||a>dje)){r.delta=vr.sub(r.offset,h);const S=r.delta.map(Math.abs);vr.addTo(r.distance,S),r.direction=r.delta.map(Math.sign),r._direction=r._delta.map(Math.sign),!r.first&&a>0&&(r.velocity=[S[0]/a,S[1]/a],r.timeDelta=a)}}emit(){const e=this.state,r=this.shared,n=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!n.triggerAllEvents)return;const i=this.handler(xt(xt(xt({},r),e),{},{[this.aliasKey]:e.values}));i!==void 0&&(e.memo=i)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function pje([t,e],r){const n=Math.abs(t),i=Math.abs(e);if(n>i&&n>r)return"x";if(i>n&&i>r)return"y"}class mje extends hje{constructor(...e){super(...e),Kr(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=vr.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=vr.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){const r=this.state,n=this.config;if(!r.axis&&e){const i=typeof n.axisThreshold=="object"?n.axisThreshold[XX(e)]:n.axisThreshold;r.axis=pje(r._movement,i)}r._blocked=(n.lockDirection||!!n.axis)&&!r.axis||!!n.axis&&n.axis!==r.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0;break}}}const gje=t=>t,R5=.15,ZX={enabled(t=!0){return t},eventOptions(t,e,r){return xt(xt({},r.shared.eventOptions),t)},preventDefault(t=!1){return t},triggerAllEvents(t=!1){return t},rubberband(t=0){switch(t){case!0:return[R5,R5];case!1:return[0,0];default:return vr.toVector(t)}},from(t){if(typeof t=="function")return t;if(t!=null)return vr.toVector(t)},transform(t,e,r){const n=t||r.shared.transform;return this.hasCustomTransform=!!n,n||gje},threshold(t){return vr.toVector(t,0)}},vje=0,gm=xt(xt({},ZX),{},{axis(t,e,{axis:r}){if(this.lockDirection=r==="lock",!this.lockDirection)return r},axisThreshold(t=vje){return t},bounds(t={}){if(typeof t=="function")return a=>gm.bounds(t(a));if("current"in t)return()=>t.current;if(typeof HTMLElement=="function"&&t instanceof HTMLElement)return t;const{left:e=-1/0,right:r=1/0,top:n=-1/0,bottom:i=1/0}=t;return[[e,r],[n,i]]}}),A5={ArrowRight:(t,e=1)=>[t*e,0],ArrowLeft:(t,e=1)=>[-1*t*e,0],ArrowUp:(t,e=1)=>[0,-1*t*e],ArrowDown:(t,e=1)=>[0,t*e]};class yje extends mje{constructor(...e){super(...e),Kr(this,"ingKey","dragging")}reset(){super.reset();const e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){const e=this.state;if(e._bounds instanceof HTMLElement){const r=e._bounds.getBoundingClientRect(),n=e.currentTarget.getBoundingClientRect(),i={left:r.left-n.left+e.offset[0],right:r.right-n.right+e.offset[0],top:r.top-n.top+e.offset[1],bottom:r.bottom-n.bottom+e.offset[1]};e._bounds=gm.bounds(i)}}cancel(){const e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){const r=this.config,n=this.state;if(e.buttons!=null&&(Array.isArray(r.pointerButtons)?!r.pointerButtons.includes(e.buttons):r.pointerButtons!==-1&&r.pointerButtons!==e.buttons))return;const i=this.ctrl.setEventIds(e);r.pointerCapture&&e.target.setPointerCapture(e.pointerId),!(i&&i.size>1&&n._pointerActive)&&(this.start(e),this.setupPointer(e),n._pointerId=tT(e),n._pointerActive=!0,this.computeValues(w5(e)),this.computeInitial(),r.preventScrollAxis&&XX(e)!=="mouse"?(n._active=!1,this.setupScrollPrevention(e)):r.delay>0?(this.setupDelayTrigger(e),r.triggerAllEvents&&(this.compute(e),this.emit())):this.startPointerDrag(e))}startPointerDrag(e){const r=this.state;r._active=!0,r._preventScroll=!0,r._delayed=!1,this.compute(e),this.emit()}pointerMove(e){const r=this.state,n=this.config;if(!r._pointerActive||r.type===e.type&&e.timeStamp===r.timeStamp)return;const i=tT(e);if(r._pointerId!==void 0&&i!==r._pointerId)return;const a=w5(e);if(document.pointerLockElement===e.target?r._delta=[e.movementX,e.movementY]:(r._delta=vr.sub(a,r._values),this.computeValues(a)),vr.addTo(r._movement,r._delta),this.compute(e),r._delayed&&r.intentional){this.timeoutStore.remove("dragDelay"),r.active=!1,this.startPointerDrag(e);return}if(n.preventScrollAxis&&!r._preventScroll)if(r.axis)if(r.axis===n.preventScrollAxis||n.preventScrollAxis==="xy"){r._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(e);return}else return;this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch{}const r=this.state,n=this.config;if(!r._active||!r._pointerActive)return;const i=tT(e);if(r._pointerId!==void 0&&i!==r._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);const[a,s]=r._distance;if(r.tap=a<=n.tapsThreshold&&s<=n.tapsThreshold,r.tap&&n.filterTaps)r._force=!0;else{const[o,c]=r._delta,[l,u]=r._movement,[f,d]=n.swipe.velocity,[h,p]=n.swipe.distance,v=n.swipe.duration;if(r.elapsedTimef&&Math.abs(l)>h&&(r.swipe[0]=Math.sign(o)),g>d&&Math.abs(u)>p&&(r.swipe[1]=Math.sign(c))}}this.emit()}pointerClick(e){!this.state.tap&&e.detail>0&&(e.preventDefault(),e.stopPropagation())}setupPointer(e){const r=this.config,n=r.device;r.pointerLock&&e.currentTarget.requestPointerLock(),r.pointerCapture||(this.eventStore.add(this.sharedConfig.window,n,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,n,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,n,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){this.state._preventScroll=!1,xje(e);const r=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",r),this.eventStore.add(this.sharedConfig.window,"touch","cancel",r),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(e)},this.config.delay)}keyDown(e){const r=A5[e.key];if(r){const n=this.state,i=e.shiftKey?10:e.altKey?.1:1;this.start(e),n._delta=r(this.config.keyboardDisplacement,i),n._keyboardActive=!0,vr.addTo(n._movement,n._delta),this.compute(e),this.emit()}}keyUp(e){e.key in A5&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){const r=this.config.device;e(r,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(e(r,"change",this.pointerMove.bind(this)),e(r,"end",this.pointerUp.bind(this)),e(r,"cancel",this.pointerUp.bind(this)),e("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(e("key","down",this.keyDown.bind(this)),e("key","up",this.keyUp.bind(this))),this.config.filterTaps&&e("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}}function xje(t){"persist"in t&&typeof t.persist=="function"&&t.persist()}const vm=typeof window<"u"&&window.document&&window.document.createElement;function bje(){return vm&&"ontouchstart"in window}function I5(){return bje()||vm&&window.navigator.maxTouchPoints>1}function Eje(){return vm&&"onpointerdown"in window}function Sje(){return vm&&"exitPointerLock"in window.document}function _je(){try{return"constructor"in GestureEvent}catch{return!1}}const Gn={isBrowser:vm,gesture:_je(),touch:I5(),touchscreen:I5(),pointer:Eje(),pointerLock:Sje()},wje=250,Tje=180,Rje=.5,Aje=50,Ije=250,$je=10,$5={mouse:0,touch:0,pen:8},Cje=xt(xt({},gm),{},{device(t,e,{pointer:{touch:r=!1,lock:n=!1,mouse:i=!1}={}}){return this.pointerLock=n&&Gn.pointerLock,Gn.touch&&r?"touch":this.pointerLock?"mouse":Gn.pointer&&!i?"pointer":Gn.touch?"touch":"mouse"},preventScrollAxis(t,e,{preventScroll:r}){if(this.preventScrollDelay=typeof r=="number"?r:r||r===void 0&&t?wje:void 0,!(!Gn.touchscreen||r===!1))return t||(r!==void 0?"y":void 0)},pointerCapture(t,e,{pointer:{capture:r=!0,buttons:n=1,keys:i=!0}={}}){return this.pointerButtons=n,this.keys=i,!this.pointerLock&&this.device==="pointer"&&r},threshold(t,e,{filterTaps:r=!1,tapsThreshold:n=3,axis:i=void 0}){const a=vr.toVector(t,r?n:i?1:0);return this.filterTaps=r,this.tapsThreshold=n,a},swipe({velocity:t=Rje,distance:e=Aje,duration:r=Ije}={}){return{velocity:this.transform(vr.toVector(t)),distance:this.transform(vr.toVector(e)),duration:r}},delay(t=0){switch(t){case!0:return Tje;case!1:return 0;default:return t}},axisThreshold(t){return t?xt(xt({},$5),t):$5},keyboardDisplacement(t=$je){return t}});xt(xt({},ZX),{},{device(t,e,{shared:r,pointer:{touch:n=!1}={}}){if(r.target&&!Gn.touch&&Gn.gesture)return"gesture";if(Gn.touch&&n)return"touch";if(Gn.touchscreen){if(Gn.pointer)return"pointer";if(Gn.touch)return"touch"}},bounds(t,e,{scaleBounds:r={},angleBounds:n={}}){const i=s=>{const o=T5(C1(r,s),{min:-1/0,max:1/0});return[o.min,o.max]},a=s=>{const o=T5(C1(n,s),{min:-1/0,max:1/0});return[o.min,o.max]};return typeof r!="function"&&typeof n!="function"?[i(),a()]:s=>[i(s),a(s)]},threshold(t,e,r){return this.lockDirection=r.axis==="lock",vr.toVector(t,this.lockDirection?[.1,3]:0)},modifierKey(t){return t===void 0?"ctrlKey":t},pinchOnWheel(t=!0){return t}});xt(xt({},gm),{},{mouseOnly:(t=!0)=>t});xt(xt({},gm),{},{mouseOnly:(t=!0)=>t});const JX=new Map,zA=new Map;function kje(t){JX.set(t.key,t.engine),zA.set(t.key,t.resolver)}const Oje={key:"drag",engine:yje,resolver:Cje};function Lje(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,a;for(a=0;a=0)&&(r[i]=t[i]);return r}function Pje(t,e){if(t==null)return{};var r=Lje(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}const Nje={target(t){if(t)return()=>"current"in t?t.current:t},enabled(t=!0){return t},window(t=Gn.isBrowser?window:void 0){return t},eventOptions({passive:t=!0,capture:e=!1}={}){return{passive:t,capture:e}},transform(t){return t}},Dje=["target","eventOptions","window","enabled","transform"];function ty(t={},e){const r={};for(const[n,i]of Object.entries(e))switch(typeof i){case"function":r[n]=i.call(r,t[n],n,t);break;case"object":r[n]=ty(t[n],i);break;case"boolean":i&&(r[n]=t[n]);break}return r}function Mje(t,e,r={}){const n=t,{target:i,eventOptions:a,window:s,enabled:o,transform:c}=n,l=Pje(n,Dje);if(r.shared=ty({target:i,eventOptions:a,window:s,enabled:o,transform:c},Nje),e){const u=zA.get(e);r[e]=ty(xt({shared:r.shared},l),u)}else for(const u in l){const f=zA.get(u);f&&(r[u]=ty(xt({shared:r.shared},l[u]),f))}return r}class eQ{constructor(e,r){Kr(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=r}add(e,r,n,i,a){const s=this._listeners,o=aje(r,n),c=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},l=xt(xt({},c),a);e.addEventListener(o,i,l);const u=()=>{e.removeEventListener(o,i,l),s.delete(u)};return s.add(u),u}clean(){this._listeners.forEach(e=>e()),this._listeners.clear()}}class Fje{constructor(){Kr(this,"_timeouts",new Map)}add(e,r,n=140,...i){this.remove(e),this._timeouts.set(e,window.setTimeout(r,n,...i))}remove(e){const r=this._timeouts.get(e);r&&window.clearTimeout(r)}clean(){this._timeouts.forEach(e=>void window.clearTimeout(e)),this._timeouts.clear()}}class Bje{constructor(e){Kr(this,"gestures",new Set),Kr(this,"_targetEventStore",new eQ(this)),Kr(this,"gestureEventStores",{}),Kr(this,"gestureTimeoutStores",{}),Kr(this,"handlers",{}),Kr(this,"config",{}),Kr(this,"pointerIds",new Set),Kr(this,"touchIds",new Set),Kr(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),Uje(this,e)}setEventIds(e){if(_E(e))return this.touchIds=new Set(lje(e)),this.touchIds;if("pointerId"in e)return e.type==="pointerup"||e.type==="pointercancel"?this.pointerIds.delete(e.pointerId):e.type==="pointerdown"&&this.pointerIds.add(e.pointerId),this.pointerIds}applyHandlers(e,r){this.handlers=e,this.nativeHandlers=r}applyConfig(e,r){this.config=Mje(e,r,this.config)}clean(){this._targetEventStore.clean();for(const e of this.gestures)this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){const r=this.config.shared,n={};let i;if(!(r.target&&(i=r.target(),!i))){if(r.enabled){for(const s of this.gestures){const o=this.config[s],c=C5(n,o.eventOptions,!!i);if(o.enabled){const l=JX.get(s);new l(this,e,s).bind(c)}}const a=C5(n,r.eventOptions,!!i);for(const s in this.nativeHandlers)a(s,"",o=>this.nativeHandlers[s](xt(xt({},this.state.shared),{},{event:o,args:e})),void 0,!0)}for(const a in n)n[a]=fje(...n[a]);if(!i)return n;for(const a in n){const{device:s,capture:o,passive:c}=ije(a);this._targetEventStore.add(i,s,"",n[a],{capture:o,passive:c})}}}}function Yc(t,e){t.gestures.add(e),t.gestureEventStores[e]=new eQ(t,e),t.gestureTimeoutStores[e]=new Fje}function Uje(t,e){e.drag&&Yc(t,"drag"),e.wheel&&Yc(t,"wheel"),e.scroll&&Yc(t,"scroll"),e.move&&Yc(t,"move"),e.pinch&&Yc(t,"pinch"),e.hover&&Yc(t,"hover")}const C5=(t,e,r)=>(n,i,a,s={},o=!1)=>{var c,l;const u=(c=s.capture)!==null&&c!==void 0?c:e.capture,f=(l=s.passive)!==null&&l!==void 0?l:e.passive;let d=o?n:rje(n,i,u);r&&f&&(d+="Passive"),t[d]=t[d]||[],t[d].push(a)};function jje(t,e={},r,n){const i=ce.useMemo(()=>new Bje(t),[]);if(i.applyHandlers(t,n),i.applyConfig(e,r),ce.useEffect(i.effect.bind(i)),ce.useEffect(()=>i.clean.bind(i),[]),e.target===void 0)return i.bind.bind(i)}function Hje(t,e){return kje(Oje),jje({drag:t},e||{},"drag")}function zje(t){const e=A.useRef(null),r=A.useRef(!1),[n,i]=A.useState(null),[{y:a},s]=N9e(()=>({y:0,onRest(){r.current&&t.onClose&&t.onClose()}})),o=Hje(({last:c,velocity:[,l],direction:[,u],movement:[,f],...d})=>{if(r.current||d.target.closest(".overflow-y-auto"))return;const p=(n==null?void 0:n.height)??0;c?f>p*.5||l>.5&&u>0&&f>20?(s.start({y:p*1.2,immediate:!1,config:{...MA.wobbly,velocity:l,clamp:!0}}),r.current=!0):s.start({y:0,immediate:!1,config:MA.wobbly}):s.start({y:f,immediate:!0})},{from:()=>[0,a.get()],filterTaps:!0,bounds:{top:0},rubberband:!0});return A.useEffect(()=>{if(!e.current)return;function c(){var f;const u=(f=e.current)==null?void 0:f.getBoundingClientRect();i(u??null)}c();const l=new ResizeObserver(c);return l.observe(e.current),()=>{l.disconnect()}},[]),E("div",{className:"is-mobile-view absolute inset-x-0 mx-auto max-w-[400px] origin-bottom-left touch-none",style:{transform:`translateY(${window.innerHeight-((n==null?void 0:n.height)??0)+200}px)`},children:E(YX.div,{ref:e,className:[t.className??"","touch-none"].join(" "),style:{y:a},...o(),children:t.children})})}function tQ(t){const e=t.radius??40;return Y("svg",{className:`${t.className??""} -rotate-90`,viewBox:"0 0 100 100",children:[E("circle",{className:`fill-transparent stroke-denim-700 stroke-[15] opacity-25 ${t.backingRingClassname??""}`,r:e,cx:"50",cy:"50"}),E("circle",{className:"fill-transparent stroke-current stroke-[15] transition-[stroke-dashoffset] duration-150",r:e,cx:"50",cy:"50",style:{strokeDasharray:`${2*Math.PI*e} ${2*Math.PI*e}`,strokeDashoffset:`${2*Math.PI*e-t.percentage/100*(2*Math.PI*e)}`}})]})}function Gje(t){const e=A.createRef(),r=A.useRef(!1),n=30;return A.useEffect(()=>{if(r.current||!e.current)return;const i=e.current,a=i.classList.contains("overflow-y-auto")?i:i.closest(".overflow-y-auto"),s=a==null?void 0:a.querySelector(".active");if(a&&s){let o=0,c=0,l=0,u=0;if((()=>{const h=s.getBoundingClientRect(),p=a.getBoundingClientRect();o=p.height,l=h.height,c=h.top-p.top+a.scrollTop,u=a.scrollTop})(),c+lu+n){const h=c+l/2,p=o/2,v=h-p;a.scrollTo({top:v})}}r.current=!0},[e]),E("div",{className:t.className,ref:e,children:t.children})}function Tf(t){return E(Gje,{className:["p-5",t.className||""].join(" "),children:t.children})}function rQ(t){const e=t.isOnDarkBackground?"bg-ash-200":"bg-ash-400",r=t.isOnDarkBackground?"hover:bg-ash-200":"hover:bg-ash-400";return Y("div",{className:["group -mx-2 flex cursor-pointer items-center justify-between space-x-1 rounded p-2 font-semibold transition-[background-color,color] duration-150",r,t.active?`${e} active text-white outline-denim-700`:"text-denim-700 hover:text-white"].join(" "),onClick:t.onClick,children:[t.active&&E("div",{className:"absolute left-0 h-8 w-0.5 bg-bink-500"}),E("span",{className:"truncate",children:t.children}),Y("div",{className:"relative min-h-[1rem] min-w-[1rem]",children:[!t.noChevron&&E(Ve,{className:"absolute inset-0 translate-x-2 text-white opacity-0 transition-[opacity,transform] duration-100 group-hover:translate-x-0 group-hover:opacity-100",icon:ue.CHEVRON_RIGHT}),t.right]})]})}function rs(t){return E(rQ,{isOnDarkBackground:t.isOnDarkBackground,active:t.active,onClick:t.onClick,noChevron:t.loading||t.errored,right:Y(xr,{children:[t.errored&&E(Ve,{icon:ue.WARNING,className:"absolute inset-0 text-rose-400"}),t.loading&&!t.errored&&E(oX,{className:"absolute inset-0 text-base [--color:#9C93B5]"}),t.percentageCompleted&&!t.loading&&!t.errored?E(tQ,{className:"absolute inset-0 text-bink-600 opacity-100 transition-[opacity] group-hover:opacity-0",backingRingClassname:"stroke-ash-500",percentage:t.percentageCompleted>90?100:t.percentageCompleted}):""]}),children:t.children})}function wE(t){const e=E(rQ,{active:t.active,isOnDarkBackground:t.isOnDarkBackground,right:t.right,onClick:t.href?void 0:t.onClick,noChevron:t.noChevron,children:Y("div",{className:"flex items-center space-x-3",children:[t.icon?E(Ve,{className:"text-xl",icon:t.icon}):null,E("div",{children:t.children})]})});return t.href?E("a",{href:t.href?t.href:void 0,rel:"noreferrer",target:"_blank",download:t.download?t.download:void 0,onClick:t.onClick,children:e}):e}function nQ(){const{isMobile:t}=Aa();return t?E("div",{className:"relative z-50 mx-auto my-3 -mb-3 h-1 w-12 rounded-full bg-ash-500 bg-opacity-30"}):null}function Vje(){const{isMobile:t}=Aa();return t?E("div",{className:"h-[200px]"}):null}function Wje(t){const e=A.useRef(null),{isMobile:r}=Aa(),n=v5(0,{config:{easing:PA.easeInOutSine,duration:300}}),i=v5(0,{config:{easing:PA.easeInOutSine,duration:300}}),[a,s]=A.useState(null),o=A.useCallback((c=!0)=>{if(!e.current)return;const l=e.current.querySelectorAll(":scope *[data-floating-page='true']");if(c&&s(l),l.length===0){n.start(0),i.start(0);return}const u=l[l.length-1],f=u.getBoundingClientRect(),d=u.scrollHeight;n.get()===0?(n.set(d),i.set(f.width)):(n.start(d),i.start(f.width))},[n,i]);return A.useEffect(()=>{if(!e.current)return;o();const c=new MutationObserver(()=>{o()});return c.observe(e.current,{attributes:!1,childList:!0,subtree:!1}),()=>{c.disconnect()}},[o]),A.useEffect(()=>{const c=new ResizeObserver(()=>{o(!1)});return a==null||a.forEach(l=>c.observe(l)),()=>{c.disconnect()}},[a,o]),E(YX.div,{ref:e,style:{height:n,width:r?"100%":i},className:"relative flex items-center justify-center overflow-hidden",children:t.children})}function Kje(t){const{isMobile:e}=Aa(),r=E(Wje,{children:t.children});return e?E(zje,{className:t.className,onClose:t.onClose,children:r}):E(q9e,{id:t.for,className:t.className,children:r})}function Yje(t){return E(Kje,{className:"overflow-hidden rounded-md bg-ash-300",...t})}const Ir={Header(t){const{t:e}=ke();let r=Y("div",{onClick:t.goBack,className:"flex cursor-pointer items-center space-x-2 transition-colors duration-200 hover:text-white",children:[E(Ve,{icon:ue.ARROW_LEFT}),E("span",{children:t.backText||e("videoPlayer.popouts.back")})]});return t.close&&(r=Y("div",{onClick:t.goBack,className:"flex cursor-pointer items-center space-x-2 transition-colors duration-200 hover:text-white",children:[E(Ve,{icon:ue.X}),E("span",{children:e("videoPlayer.popouts.close")})]})),Y("div",{className:"flex flex-col bg-[#1C161B]",children:[E(nQ,{}),Y(Tf,{children:[Y("div",{className:"flex justify-between",children:[E("div",{children:r}),E("div",{children:t.action??null})]}),E("h2",{className:"mb-2 mt-8 text-3xl font-bold text-white",children:t.title}),E("p",{children:t.description})]})]})},Content(t){return Y("div",{className:"grid h-full grid-rows-[1fr]",children:[t.noSection?E("div",{className:"relative h-full overflow-y-auto bg-ash-300",children:t.children}):E(Tf,{className:"relative h-full overflow-y-auto bg-ash-300",children:t.children}),E(Vje,{})]})}};function qje(t){const[e,r]=A.useState(null),n=A.useRef(null),i=A.useRef(null);A.useEffect(()=>{function s(o){i.current=o.target}return document.addEventListener("mousedown",s),()=>{document.removeEventListener("mousedown",s)}});const a=A.useCallback(s=>{const o=i.current;i.current=null,s.currentTarget===s.target&&o&&o.isEqualNode(s.currentTarget)&&t.onClose&&t.onClose()},[t]);return A.useEffect(()=>{var o;const s=(o=n.current)==null?void 0:o.closest(".popout-location");r(s??document.body)},[]),E("div",{ref:n,children:e?ql.createPortal(E($i,{show:t.show,animation:"none",children:Y("div",{className:"popout-wrapper pointer-events-auto fixed inset-0 z-[999] select-none",children:[E($i,{animation:"fade",isChild:!0,children:E("div",{onClick:a,className:["absolute inset-0",t.darken?"bg-black opacity-90":""].join(" ")})}),E($i,{animation:"slide-up",className:"h-0",isChild:!0,children:t.children})]})}),e):null})}function k5(t,e){const n=new URLSearchParams(t.search).get("modal");n?e.openPopout(n):e.closePopout()}function Xje(t){const e=xc(),r=Bi(t),n=st(t),i=rE(),a=A.useRef(null),s=A.useRef(n);A.useEffect(()=>{s.current=n},[n]),A.useEffect(()=>{const c=r.popout;if(a.current!==c)if(a.current=c,c){const l=new URLSearchParams([["modal",c]]).toString();e.push({search:l,state:"popout"})}else{if(!new URLSearchParams(e.location.search).has("modal"))return;e.length>0?e.goBack():e.replace({search:"",state:"popout"})}},[r,e]),A.useEffect(()=>{i.state!=="popout"&&k5(i,s.current)},[i]);const o=A.useRef(!1);A.useEffect(()=>{o.current||(k5(i,s.current),o.current=!0)},[i])}function No(t){const{isMobile:e}=Aa(),r=e?"100%":`${t.width}px`;return E($i,{animation:t.active?"slide-full-left":"slide-full-right",className:"absolute inset-0",durationClass:"duration-[400ms]",show:t.show,children:E("div",{className:[t.className??"","grid grid-rows-[auto,minmax(0,1fr)]"].join(" "),"data-floating-page":t.show?"true":void 0,style:{height:t.height?`${t.height}px`:void 0,maxHeight:"70vh",width:t.width?r:void 0},children:t.children})})}function iQ(t="/"){const[e,r]=A.useState(t.split("/").filter(d=>d.length>0)),[n,i]=A.useState(e),a=e[e.length-1]??"/";A.useLayoutEffect(()=>{n.length!==e.length&&setTimeout(()=>{i(e)},20)},[e,n]);function s(d){const h=d.split("/").filter(p=>p.length>0);h.length>n.length&&i(h),r(h)}function o(d){if(d==="/")return!0;const h=n.indexOf(d);return!(h===-1||h===n.length-1)}function c(d){return d===a}function l(d){return d==="/"?!0:e.includes(d)}function u(d){return{show:c(d),active:o(d)}}function f(){s("/")}return{navigate:s,reset:f,isLoaded:l,isCurrentPage:c,pageProps:u,isActive:o}}function Qje(){var b,_,S,w;const t=DY(),{t:e}=ke(),{pageProps:r,navigate:n}=iQ("/episodes"),i=Re(),a=ui(i),s=st(i),[o,c]=A.useState(null),[l,u,f]=od((R,I)=>v1(ie.SERIES,R,I)),d=A.useCallback(R=>{var I;c({seasonId:R,season:void 0}),l((I=oq(t.media))==null?void 0:I.id,R).then(T=>{(T==null?void 0:T.meta.type)===ie.SERIES&&c({seasonId:R,season:T==null?void 0:T.meta.seasonData})})},[l,t.media]),h=(o==null?void 0:o.seasonId)??((b=a==null?void 0:a.episode)==null?void 0:b.seasonId),p=A.useCallback((R,I)=>{s.closePopout(),setTimeout(()=>{s.setCurrentEpisode(R,I)},100)},[s]),v=A.useMemo(()=>{var R;return(R=a==null?void 0:a.seasons)==null?void 0:R.find(I=>I.id===h)},[a,h]),m=A.useMemo(()=>{var R,I,T,C;return o!=null&&o.season?(R=o==null?void 0:o.season)==null?void 0:R.episodes:(C=(T=(I=a==null?void 0:a.seasons)==null?void 0:I.find)==null?void 0:T.call(I,L=>L&&L.id===h))==null?void 0:C.episodes},[a,h,o]),g=R=>{d(R),c({seasonId:R}),n("/episodes")},{watched:y}=oE(),x=()=>{s.closePopout()};return Y(xr,{children:[Y(No,{...r("seasons"),height:600,width:375,children:[E(Ir.Header,{title:e("videoPlayer.popouts.seasons.title"),description:e("videoPlayer.popouts.descriptions.seasons"),goBack:()=>n("/episodes"),backText:v==null?void 0:v.title}),E(Ir.Content,{children:v?(S=(_=a==null?void 0:a.seasons)==null?void 0:_.map)==null?void 0:S.call(_,R=>{var I;return E(rs,{active:((I=a==null?void 0:a.episode)==null?void 0:I.seasonId)===R.id,onClick:()=>g(R.id),children:R.title},R.id)}):e("videoPlayer.popouts.seasons.noSeason")})]}),Y(No,{...r("episodes"),height:600,width:375,children:[E(Ir.Header,{title:(v==null?void 0:v.title)??e("videoPlayer.popouts.episodes.unknown"),description:e("videoPlayer.popouts.descriptions.episode"),goBack:x,close:!0,action:Y("button",{type:"button",onClick:()=>n("/episodes/seasons"),className:"flex cursor-pointer items-center space-x-2 transition-colors duration-200 hover:text-white",children:[E("span",{children:e("videoPlayer.popouts.seasons.other")}),E(Ve,{icon:ue.CHEVRON_RIGHT})]})}),E(Ir.Content,{children:u?E("div",{className:"flex h-full w-full items-center justify-center",children:E(cm,{})}):f?E("div",{className:"flex h-full w-full items-center justify-center",children:Y("div",{className:"flex flex-col flex-wrap items-center text-slate-400",children:[E(nn,{icon:ue.EYE_SLASH,className:"text-xl text-bink-600"}),E("p",{className:"mt-6 w-full text-center",children:e("videoPlayer.popouts.errors.loadingWentWrong",{seasonTitle:(w=v==null?void 0:v.title)==null?void 0:w.toLowerCase()})})]})}):E("div",{children:m&&v?m.map(R=>{var I,T;return E(rs,{active:R.id===((I=a==null?void 0:a.episode)==null?void 0:I.episodeId),onClick:()=>{var C;R.id===((C=a==null?void 0:a.episode)==null?void 0:C.episodeId)?s.closePopout():p(v.id,R.id)},percentageCompleted:(T=y.items.find(C=>{var L,H,N,P;return((H=(L=C.item)==null?void 0:L.series)==null?void 0:H.seasonId)===v.id&&((P=(N=C.item)==null?void 0:N.series)==null?void 0:P.episodeId)===R.id}))==null?void 0:T.percentage,children:e("videoPlayer.popouts.episode",{index:R.number,title:R.title})},R.id)}):e("videoPlayer.popouts.episodes.noEpisode")})})]})]})}function Zje(t){const{t:e}=ke();return E(wE,{icon:ue.CAPTIONS,onClick:t.onClick,children:e("videoPlayer.buttons.captions")})}function aQ(t){return{source:t.source?{...t.source}:null}}function no(t,e){bc(t,"source",aQ(e))}function ym(t){const e=Sr(t),[r,n]=A.useState(aQ(e));return A.useEffect(()=>{function i(a){n(a.detail)}return Ec(t,"source",i),()=>{Sc(t,"source",i)}},[t]),r}function Jje(){var s,o;const t=Re(),e=ym(t),{t:r}=ke(),n=ui(t),i=((s=e.source)==null?void 0:s.type)===Yt.HLS;if(i)return null;const a=n==null?void 0:n.meta.meta.title;return E(wE,{href:i||(o=e.source)==null?void 0:o.url,download:a?`${yA(a)}.mp4`:void 0,icon:ue.DOWNLOAD,children:r("videoPlayer.buttons.download")})}function eHe(t){const{t:e}=ke();return E(wE,{icon:ue.TACHOMETER,onClick:t.onClick,children:e("videoPlayer.buttons.playbackSpeed")})}function tHe(){const t=Re(),e=ym(t);return e.source?E("div",{className:"rounded-md bg-denim-300 px-2 py-1 transition-colors",children:E("p",{className:"text-center text-xs font-bold text-slate-300 transition-colors",children:e.source.quality})}):null}function rHe(t){const{t:e}=ke();return E(wE,{icon:ue.CLAPPER_BOARD,onClick:t.onClick,right:E(tHe,{}),noChevron:!0,children:e("videoPlayer.buttons.source")})}function nHe(t){var h,p;const{t:e}=ke(),r=Re(),n=ui(r),i=ym(r),a=st(r),s=A.useMemo(()=>(n==null?void 0:n.captions.map(v=>({...v,id:TA(v,!0)})))??[],[n]),o=A.useRef(""),[c,l,u]=od(async(v,m)=>{const g=TA(v,m);o.current=g;const y=await jq(v),b=await(await fetch(y)).text();Hq(b),a.setCaption(g,y),setTimeout(()=>{a.closePopout()},100)}),f=(p=(h=i.source)==null?void 0:h.caption)==null?void 0:p.id,d=A.useRef(null);return Y(No,{...t.router.pageProps(t.prefix),width:320,height:500,children:[E(Ir.Header,{title:e("videoPlayer.popouts.captions"),description:e("videoPlayer.popouts.descriptions.captions"),goBack:()=>t.router.navigate("/"),action:Y("button",{type:"button",onClick:()=>t.router.navigate(`${t.prefix}/caption-settings`),className:"flex cursor-pointer items-center space-x-2 transition-colors duration-200 hover:text-white",children:[E("span",{children:e("videoPlayer.popouts.captionPreferences.title")}),E(Ve,{icon:ue.GEAR})]})}),Y(Ir.Content,{noSection:!0,children:[Y(Tf,{children:[E(rs,{active:!f,onClick:()=>{a.clearCaption(),a.closePopout()},children:e("videoPlayer.popouts.noCaptions")}),Y(rs,{active:f===ih,loading:l&&o.current===ih,errored:u&&o.current===ih,onClick:()=>{var v;return(v=d.current)==null?void 0:v.click()},children:[e(f===ih?"videoPlayer.popouts.customCaption":"videoPlayer.popouts.uploadCustomCaption"),E("input",{className:"hidden",ref:d,accept:iO.join(","),type:"file",onChange:v=>{if(!v.target.files)return;const m={langIso:"custom",url:URL.createObjectURL(v.target.files[0]),type:Li.UNKNOWN};c(m,!1)}})]},ih)]}),Y("p",{className:"sticky top-0 z-10 flex items-center space-x-1 bg-ash-300 px-5 py-3 text-xs font-bold uppercase",children:[E(Ve,{className:"text-base",icon:ue.LINK}),E("span",{children:e("videoPlayer.popouts.linkedCaptions")})]}),E(Tf,{className:"pt-0",children:E("div",{children:s.map(v=>E(rs,{active:v.id===f,loading:l&&v.id===o.current,errored:u&&v.id===o.current,onClick:()=>{o.current=v.id,c(v,!0)},children:v.langIso},v.langIso))})})]})]})}const sQ=["#ffffff","#00ffff","#ffff00"];function oQ({color:t}){const{captionSettings:e,setCaptionColor:r}=sd();return Y("div",{className:`flex h-8 w-8 items-center justify-center rounded transition-[background-color,transform] duration-100 hover:bg-[#1c161b79] active:scale-110 ${t===e.style.color?"bg-[#1C161B]":""}`,onClick:()=>r(t),children:[E("div",{className:"h-4 w-4 cursor-pointer appearance-none rounded-full",style:{backgroundColor:t}}),E(Ve,{className:["absolute text-xs text-[#1C161B]",t===e.style.color?"":"hidden"].join(" "),icon:ue.CHECKMARK})]})}function Xu(t){const e=A.useRef(null);return A.useEffect(()=>{const r=e.current;r.style.setProperty("--value",r.value),r.style.setProperty("--min",r.min===""?"0":r.min),r.style.setProperty("--max",r.max===""?"100":r.max),r.addEventListener("input",()=>r.style.setProperty("--value",r.value))},[e]),Y("div",{className:"mb-6 flex flex-row gap-4",children:[Y("div",{className:"flex w-full flex-col gap-2",children:[t.label?E("label",{className:"font-bold",children:t.label}):null,E("input",{type:"range",ref:e,className:"styled-slider slider-progress mt-[20px]",onChange:t.onChange,value:t.value,max:t.max,min:t.min,step:t.step})]}),E("div",{className:"mt-1 aspect-[2/1] h-8 rounded-sm bg-[#1C161B] pt-1",children:E("div",{className:"text-center font-bold text-white",children:t.valueDisplay??t.value})})]})}function iHe(t){const{t:e}=ke(),{captionSettings:r,setCaptionBackgroundColor:n,setCaptionDelay:i,setCaptionFontSize:a}=sd();return Y(No,{...t.router.pageProps(t.prefix),width:375,children:[E(Ir.Header,{title:e("videoPlayer.popouts.captionPreferences.title"),description:e("videoPlayer.popouts.descriptions.captionPreferences"),goBack:()=>t.router.navigate("/captions")}),Y(Ir.Content,{children:[E(Xu,{label:e("videoPlayer.popouts.captionPreferences.delay"),max:10,min:-10,step:.1,valueDisplay:`${r.delay.toFixed(1)}s`,value:r.delay,onChange:s=>i(s.target.valueAsNumber)}),E(Xu,{label:e("videoPlayer.popouts.captionPreferences.fontSize"),min:14,step:1,max:60,value:r.style.fontSize,onChange:s=>a(s.target.valueAsNumber)}),E(Xu,{label:e("videoPlayer.popouts.captionPreferences.opacity"),step:1,min:0,max:255,valueDisplay:`${(parseInt(r.style.backgroundColor.substring(7,9),16)/255*100).toFixed(0)}%`,value:parseInt(r.style.backgroundColor.substring(7,9),16),onChange:s=>n(s.target.valueAsNumber)}),Y("div",{className:"flex flex-row justify-between",children:[E("label",{className:"font-bold",htmlFor:"color",children:e("videoPlayer.popouts.captionPreferences.color")}),E("div",{className:"flex flex-row gap-2",children:sQ.map(s=>E(oQ,{color:s}))})]})]})]})}const aHe=[.25,.5,.75,1,1.25,1.5,2];function sHe(t){const{t:e}=ke(),r=Re(),n=st(r),i=Cn(r);return Y(No,{...t.router.pageProps(t.prefix),width:320,height:500,children:[E(Ir.Header,{title:e("videoPlayer.popouts.playbackSpeed"),description:e("videoPlayer.popouts.descriptions.playbackSpeed"),goBack:()=>t.router.navigate("/")}),Y(Ir.Content,{noSection:!0,children:[E(Tf,{children:aHe.map(a=>Y(rs,{active:i.playbackSpeed===a,onClick:()=>{n.setPlaybackSpeed(a),n.closePopout()},children:[a,"x"]},a))}),Y("p",{className:"sticky top-0 z-10 flex items-center space-x-1 bg-ash-300 px-5 py-3 text-xs font-bold uppercase",children:[E(Ve,{className:"text-base",icon:ue.TACHOMETER}),E("span",{children:e("videoPlayer.popouts.customPlaybackSpeed")})]}),E(Tf,{className:"pt-0",children:E("div",{children:E(Xu,{min:.1,max:10,step:.1,value:i.playbackSpeed,valueDisplay:`${i.playbackSpeed}x`,onChange:a=>n.setPlaybackSpeed(a.target.valueAsNumber)})})})]})]})}function oHe(t){const[e,r,n]=od(async()=>{const i=cE(t.type);if(!i)throw new Error("Embed scraper not found");const a=await eO(i,{progress:()=>{},url:t.url});t.onSelect(a)});return E(rs,{isOnDarkBackground:!0,loading:r,errored:!!n,active:t.active,onClick:()=>{e()},children:t.name})}function lHe(t){const{t:e}=ke(),r=Re(),n=st(r),i=ui(r),{source:a}=ym(r),s=A.useRef(null),o=A.useMemo(()=>i?_q().filter(x=>x.type.includes(i.meta.meta.type)):[],[i]),[c,l]=A.useState(null),[u,f]=A.useState(null),d=A.useMemo(()=>o.find(x=>x.id===c)??null,[o,c]),[h,p,v]=od(async x=>{var _,S;const b=o.find(w=>w.id===x);if(!b)throw new Error("Invalid provider");if(!i)throw new Error("need meta");return wq(b,{media:i.meta,progress:()=>{},type:i.meta.meta.type,episode:(_=i.episode)==null?void 0:_.episodeId,season:(S=i.episode)==null?void 0:S.seasonId})});function m(x){n.setSource({quality:x.quality,source:x.streamUrl,type:x.type,embedId:x.embedId,providerId:s.current??void 0}),i&&n.setMeta({...i,captions:x.captions}),n.closePopout()}const g=x=>{if(!x){s.current=null,l(null),t.router.navigate(`/${t.prefix}/source`);return}h(x).then(async b=>{if(s.current){if(b&&b.embeds.length+(b.stream?1:0)===1){const S=b.stream;if(!S){const w=b==null?void 0:b.embeds[0];if(!w)throw new Error("Embed scraper not found");const R=cE(w.type);if(!R)throw new Error("Embed scraper not found");const I=await eO(R,{progress:()=>{},url:w.url});m(I);return}m(S);return}f(b??null)}}),s.current=x,l(x),t.router.navigate(`/${t.prefix}/source/embeds`)},y=A.useMemo(()=>{const x=(u==null?void 0:u.embeds)||[],b={};for(const S of x)S.type&&(b[S.type]||(b[S.type]=[]),b[S.type].push({...S,displayName:S.type}));return Object.entries(b).flatMap(([S,w])=>w.length>1?w.map((R,I)=>({...R,displayName:`${R.type} ${I+1}`})):w)},[u==null?void 0:u.embeds]);return Y(xr,{children:[Y(No,{...t.router.pageProps(t.prefix),width:320,height:500,children:[E(Ir.Header,{title:e("videoPlayer.popouts.sources"),description:e("videoPlayer.popouts.descriptions.sources"),goBack:()=>t.router.navigate("/")}),E(Ir.Content,{children:o.map(x=>E(rs,{active:x.id===(a==null?void 0:a.providerId),onClick:()=>{g(x.id)},children:x.displayName},x.id))})]}),Y(No,{...t.router.pageProps("embeds"),width:320,height:500,children:[E(Ir.Header,{title:(d==null?void 0:d.displayName)??"",description:e("videoPlayer.popouts.descriptions.embeds"),goBack:()=>t.router.navigate(`/${t.prefix}`)}),E(Ir.Content,{children:p?E("div",{className:"flex h-full w-full items-center justify-center",children:E(cm,{})}):v?E("div",{className:"flex h-full w-full items-center justify-center",children:Y("div",{className:"flex flex-col flex-wrap items-center text-slate-400",children:[E(nn,{icon:ue.EYE_SLASH,className:"text-xl text-bink-600"}),E("p",{className:"mt-6 w-full text-center",children:e("videoPlayer.popouts.errors.embedsError")})]})}):Y(xr,{children:[u!=null&&u.stream?E(rs,{isOnDarkBackground:!0,onClick:()=>{u.stream&&m(u.stream)},active:(d==null?void 0:d.id)===(a==null?void 0:a.providerId)&&(d==null?void 0:d.id)===(a==null?void 0:a.embedId),children:"Native source"}):null,((y==null?void 0:y.length)||0)>0?y==null?void 0:y.map(x=>E(oHe,{type:x.type,name:x.displayName??"",url:x.url,active:!1,onSelect:b=>{m(b)}},x.url)):E("div",{className:"flex h-full w-full items-center justify-center",children:Y("div",{className:"flex flex-col flex-wrap items-center text-slate-400",children:[E(nn,{icon:ue.EYE_SLASH,className:"text-xl text-bink-600"}),E("p",{className:"mt-6 w-full text-center",children:e("videoPlayer.popouts.noEmbeds")})]})})]})})]})]})}function cHe(){const t=iQ(),{pageProps:e,navigate:r}=t;return Y(xr,{children:[Y(No,{...e("/"),width:320,children:[E(nQ,{}),Y(Ir.Content,{children:[E(Jje,{}),E(rHe,{onClick:()=>r("/source")}),E(Zje,{onClick:()=>r("/captions")}),E(eHe,{onClick:()=>r("/playback-speed")})]})]}),E(lHe,{router:t,prefix:"source"}),E(nHe,{router:t,prefix:"captions"}),E(iHe,{router:t,prefix:"caption-settings"}),E(sHe,{router:t,prefix:"playback-speed"})]})}function uHe(t){return E(xr,{children:Object.entries({settings:E(cHe,{}),episodes:E(Qje,{})}).map(([r,n])=>E(qje,{show:t.popoutId===r,onClose:t.onClose,children:E(Yje,{for:r,onClose:t.onClose,children:n})},r))})}function fHe(){const t=Re(),e=Bi(t),r=st(t);Xje(t);const n=A.useCallback(()=>{r.closePopout()},[r]);return E(uHe,{popoutId:e.popout,onClose:n})}const dHe="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1",lQ=[];let GA=null;function hHe(t){GA=t,lQ.forEach(e=>e(t))}function pHe(t){if(GA!==null)return t(GA);lQ.push(t)}function mHe(){if(window.__onGCastApiAvailable=e=>{hHe(e)},!!!document.getElementById("chromecast-script")){const e=document.createElement("script");e.setAttribute("src",dHe),e.setAttribute("id","chromecast-script"),document.body.appendChild(e)}}function gHe(){const[t,e]=A.useState(null);return A.useEffect(()=>{pHe(r=>e(r))},[]),t}const cQ=aE().setKey("mw-volume").addVersion({version:0,create(){return{volume:1}}}).build();function uQ(){return cQ.get().volume}function fQ(t){cQ.save({volume:t})}function k1(t,e){const r=e;r.hlsInstance&&(r.hlsInstance.destroy(),r.hlsInstance=null),u5e(r),Jt(t,r),Xa(t,r),ld(t,r)}function vHe(t){const e=Sr(t),r=e.casting.instance,n=e.casting.player,i=e.casting.controller;return{getId(){return"casting"},play(){e.mediaPlaying.isPaused&&(i==null||i.playOrPause())},pause(){e.mediaPlaying.isPlaying&&(i==null||i.playOrPause())},exitFullscreen(){xn.fullscreenElement&&xn.exitFullscreen()},enterFullscreen(){if(!(!hO()||xn.fullscreenElement)){if(pE()){e.wrapperElement&&xn.requestFullscreen(e.wrapperElement);return}dO()&&n.webkitEnterFullscreen()}},startAirplay(){},setTime(a){let s=Math.min(a,(n==null?void 0:n.duration)??0);s=Math.max(0,s),!Number.isNaN(s)&&(n&&(n.currentTime=s),e.progress.time=s,i==null||i.seek(),Xa(t,e))},setSeeking(a){if(e.mediaPlaying.isSeeking=a,e.mediaPlaying.isDragSeeking=a,Jt(t,e),!a){e.pausedWhenSeeking||this.play();return}e.pausedWhenSeeking=e.mediaPlaying.isPaused,this.pause()},togglePictureInPicture(){},setPlaybackSpeed(a){var l,u,f;const s=new chrome.cast.media.MediaInfo(((l=e.meta)==null?void 0:l.meta.meta.id)??"video","video/mp4");s.contentUrl=(u=e.source)==null?void 0:u.url,s.streamType=chrome.cast.media.StreamType.BUFFERED,s.metadata=new chrome.cast.media.MovieMediaMetadata,s.metadata.title=((f=e.meta)==null?void 0:f.meta.meta.title)??"",s.customData={playbackRate:a};const o=new chrome.cast.media.LoadRequest(s);o.autoplay=!0;const c=r==null?void 0:r.getCurrentSession();c==null||c.loadMedia(o)},async setVolume(a){let s=Math.min(a,1);s=Math.max(0,s),await G0()&&n&&(n.volumeLevel=s),e.mediaPlaying.volume=s,i==null||i.setVolumeLevel(),Jt(t,e),fQ(s)},setSource(a){var u,f;if(!a){k1(t,e),i==null||i.stop(),e.source=null,no(t,e);return}const s=new chrome.cast.media.MovieMediaMetadata;s.title=((u=e.meta)==null?void 0:u.meta.meta.title)??"";const o=new chrome.cast.media.MediaInfo(((f=e.meta)==null?void 0:f.meta.meta.id)??"video","video/mp4");o.contentUrl=a==null?void 0:a.source,o.streamType=chrome.cast.media.StreamType.BUFFERED,o.metadata=s;const c=new chrome.cast.media.LoadRequest(o);c.autoplay=!0;const l=r==null?void 0:r.getCurrentSession();l==null||l.loadMedia(c),e.source={quality:a.quality,type:a.type,url:a.source,caption:null,embedId:a.embedId,providerId:a.providerId},k1(t,e),no(t,e)},setCaption(a,s){var o;e.source&&(S1((o=e.source.caption)==null?void 0:o.url),e.source.caption={id:a,url:s},no(t,e))},clearCaption(){var a;e.source&&(S1((a=e.source.caption)==null?void 0:a.url),e.source.caption=null,no(t,e))},providerStart(){var c,l,u;this.setVolume(uQ());const a=async f=>{switch(f.field){case"volumeLevel":await G0()&&(e.mediaPlaying.volume=f.value,Jt(t,e));break;case"currentTime":e.progress.time=f.value,Xa(t,e);break;case"mediaInfo":f.value&&(e.progress.duration=f.value.duration,Xa(t,e));break;case"playerState":e.mediaPlaying.isLoading=f.value==="BUFFERING",e.mediaPlaying.isPaused=f.value!=="PLAYING",e.mediaPlaying.isPlaying=f.value==="PLAYING",f.value==="PLAYING"&&(e.mediaPlaying.hasPlayedOnce=!0,e.mediaPlaying.isFirstLoading=!1),Jt(t,e);break;case"isMuted":e.mediaPlaying.volume=f.value?1:0,Jt(t,e);break;case"displayStatus":case"canSeek":case"title":case"isPaused":break;default:console.log(f.type,f.field,f.value);break}},s=()=>{e.interface.isFullscreen=!!document.fullscreenElement,gn(t,e)},o=f=>{e.interface.isFocused=f.type!=="mouseleave",gn(t,e)};return i==null||i.addEventListener(cast.framework.RemotePlayerEventType.ANY_CHANGE,a),(c=e.wrapperElement)==null||c.addEventListener("click",o),(l=e.wrapperElement)==null||l.addEventListener("mouseenter",o),(u=e.wrapperElement)==null||u.addEventListener("mouseleave",o),xn.addEventListener("fullscreenchange",s),e.source&&this.setSource({quality:e.source.quality,source:e.source.url,type:e.source.type,embedId:e.source.embedId,providerId:e.source.providerId}),{destroy:()=>{var f,d,h;i==null||i.removeEventListener(cast.framework.RemotePlayerEventType.ANY_CHANGE,a),(f=e.wrapperElement)==null||f.removeEventListener("click",o),(d=e.wrapperElement)==null||d.removeEventListener("mouseenter",o),(h=e.wrapperElement)==null||h.removeEventListener("mouseleave",o),xn.removeEventListener("fullscreenchange",s),r==null||r.endCurrentSession(!0)}}}}}function dQ(t,e){const r=Sr(t);r.stateProvider=e,r.initalized=!0,r.stateProviderId=e.getId(),ld(t,r)}function hQ(t,e){var n;const r=Sr(t);!r.stateProvider||((n=r.stateProvider)==null?void 0:n.getId())!==e||(r.stateProvider=null,r.stateProviderId="video",ld(t,r))}function yHe(t,e){for(let r=0;re.isCasting,[e]);return A.useEffect(()=>{if(r.current===i||(r.current=i,!i))return;const a=vHe(t);dQ(t,a);const{destroy:s}=a.providerStart();return()=>{try{hQ(t,a.getId())}catch{}s()}},[t,i]),A.useEffect(()=>{const a=Sr(t);if(!n)return;a.casting.instance=cast.framework.CastContext.getInstance(),a.casting.instance.setOptions({receiverApplicationId:chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID,autoJoinPolicy:chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED}),a.casting.player=new cast.framework.RemotePlayer,a.casting.controller=new cast.framework.RemotePlayerController(a.casting.player);function s(o){o.field==="isConnected"&&(a.casting.isCasting=o.value,ld(t,a))}return a.casting.controller.addEventListener(cast.framework.RemotePlayerEventType.IS_CONNECTED_CHANGED,s),()=>{var o;(o=a.casting.controller)==null||o.removeEventListener(cast.framework.RemotePlayerEventType.IS_CONNECTED_CHANGED,s)}},[n,t]),null}function bHe(t){const e=Re();return A.useEffect(()=>{const r=Sr(e);r.wrapperElement=t.wrapper,ld(e,r)},[t.wrapper,e]),null}class EHe extends A.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,r){if(console.error("Render error caught",e,r),e instanceof Error){const n=e;this.setState(i=>({...i,hasError:!0,error:{name:n.name,description:n.message,path:r.componentStack.split(` +`)[1]}}))}}render(){return this.state.hasError?Y("div",{className:"absolute inset-0 bg-denim-100",children:[E("div",{className:"pointer-events-auto absolute inset-x-0 top-0 flex flex-col px-8 py-6 pb-2",children:E(_c,{media:this.props.media,onClick:this.props.onGoBack})}),E(Kk,{error:this.state.error,localSize:!0,children:Y(Wk,{i18nKey:"videoPlayer.errors.fatalError",children:[E(m1,{url:Er().DISCORD_LINK,newTab:!0}),E(m1,{url:Er().GITHUB_LINK,newTab:!0})]})})]}):this.props.children}}function SHe(){const t=Re(),e=ui(t),r=Xo(t);return A.useEffect(()=>(window.meta||(window.meta={}),e&&(window.meta[t]={meta:e.meta,captions:e.captions,seasons:e.seasons,episode:e.episode,progress:{time:r.time,duration:r.duration}}),()=>{window.meta&&delete window.meta[t]}),[e,t,r]),null}var J0={},_He={get exports(){return J0},set exports(t){J0=t}};(function(t,e){(function(r){var n=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,i=/^(?=([^\/?#]*))\1([^]*)$/,a=/(?:\/|^)\.(?=\/)/g,s=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(c,l,u){if(u=u||{},c=c.trim(),l=l.trim(),!l){if(!u.alwaysNormalize)return c;var f=o.parseURL(c);if(!f)throw new Error("Error trying to parse base URL.");return f.path=o.normalizePath(f.path),o.buildURLFromParts(f)}var d=o.parseURL(l);if(!d)throw new Error("Error trying to parse relative URL.");if(d.scheme)return u.alwaysNormalize?(d.path=o.normalizePath(d.path),o.buildURLFromParts(d)):l;var h=o.parseURL(c);if(!h)throw new Error("Error trying to parse base URL.");if(!h.netLoc&&h.path&&h.path[0]!=="/"){var p=i.exec(h.path);h.netLoc=p[1],h.path=p[2]}h.netLoc&&!h.path&&(h.path="/");var v={scheme:h.scheme,netLoc:d.netLoc,path:null,params:d.params,query:d.query,fragment:d.fragment};if(!d.netLoc&&(v.netLoc=h.netLoc,d.path[0]!=="/"))if(!d.path)v.path=h.path,d.params||(v.params=h.params,d.query||(v.query=h.query));else{var m=h.path,g=m.substring(0,m.lastIndexOf("/")+1)+d.path;v.path=o.normalizePath(g)}return v.path===null&&(v.path=u.alwaysNormalize?o.normalizePath(d.path):d.path),o.buildURLFromParts(v)},parseURL:function(c){var l=n.exec(c);return l?{scheme:l[1]||"",netLoc:l[2]||"",path:l[3]||"",params:l[4]||"",query:l[5]||"",fragment:l[6]||""}:null},normalizePath:function(c){for(c=c.split("").reverse().join("").replace(a,"");c.length!==(c=c.replace(s,"")).length;);return c.split("").reverse().join("")},buildURLFromParts:function(c){return c.scheme+c.netLoc+c.path+c.params+c.query+c.fragment}};t.exports=o})()})(_He);function O5(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function sn(t){for(var e=1;e`):yl}function IHe(t,...e){e.forEach(function(r){s0[r]=t[r]?t[r].bind(t):AHe(r)})}function $He(t,e){if(self.console&&t===!0||typeof t=="object"){IHe(t,"debug","log","info","warn","error");try{s0.log(`Debug logs enabled for "${e}" in hls.js version 1.4.0`)}catch{s0=VA}}else s0=VA}const G=s0,CHe=/^(\d+)x(\d+)$/,L5=/(.+?)=(".*?"|.*?)(?:,|$)/g;class gt{constructor(e){typeof e=="string"&&(e=gt.parseAttrList(e));for(const r in e)e.hasOwnProperty(r)&&(r.substring(0,2)==="X-"&&(this.clientAttrs=this.clientAttrs||[],this.clientAttrs.push(r)),this[r]=e[r])}decimalInteger(e){const r=parseInt(this[e],10);return r>Number.MAX_SAFE_INTEGER?1/0:r}hexadecimalInteger(e){if(this[e]){let r=(this[e]||"0x").slice(2);r=(r.length&1?"0":"")+r;const n=new Uint8Array(r.length/2);for(let i=0;iNumber.MAX_SAFE_INTEGER?1/0:r}decimalFloatingPoint(e){return parseFloat(this[e])}optionalFloat(e,r){const n=this[e];return n?parseFloat(n):r}enumeratedString(e){return this[e]}bool(e){return this[e]==="YES"}decimalResolution(e){const r=CHe.exec(this[e]);if(r!==null)return{width:parseInt(r[1],10),height:parseInt(r[2],10)}}static parseAttrList(e){let r;const n={},i='"';for(L5.lastIndex=0;(r=L5.exec(e))!==null;){let a=r[2];a.indexOf(i)===0&&a.lastIndexOf(i)===a.length-1&&(a=a.slice(1,-1));const s=r[1].trim();n[s]=a}return n}}function kHe(t){return t!=="ID"&&t!=="CLASS"&&t!=="START-DATE"&&t!=="DURATION"&&t!=="END-DATE"&&t!=="END-ON-NEXT"}function OHe(t){return t==="SCTE35-OUT"||t==="SCTE35-IN"}class pQ{constructor(e,r){if(this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,r){const n=r.attr;for(const i in n)if(Object.prototype.hasOwnProperty.call(e,i)&&e[i]!==n[i]){G.warn(`DATERANGE tag attribute: "${i}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=i;break}e=Pt(new gt({}),n,e)}if(this.attr=e,this._startDate=new Date(e["START-DATE"]),"END-DATE"in this.attr){const n=new Date(this.attr["END-DATE"]);me(n.getTime())&&(this._endDate=n)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get startDate(){return this._startDate}get endDate(){if(this._endDate)return this._endDate;const e=this.duration;return e!==null?new Date(this._startDate.getTime()+e*1e3):null}get duration(){if("DURATION"in this.attr){const e=this.attr.decimalFloatingPoint("DURATION");if(me(e))return e}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}get plannedDuration(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}get endOnNext(){return this.attr.bool("END-ON-NEXT")}get isValid(){return!!this.id&&!this._badValueForSameId&&me(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)}}class TE{constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}}var Qe={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class mQ{constructor(e){this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams={[Qe.AUDIO]:null,[Qe.VIDEO]:null,[Qe.AUDIOVIDEO]:null},this.baseurl=e}setByteRange(e,r){const n=e.split("@",2),i=[];n.length===1?i[0]=r?r.byteRangeEndOffset:0:i[0]=parseInt(n[1]),i[1]=parseInt(n[0])+i[0],this._byteRange=i}get byteRange(){return this._byteRange?this._byteRange:[]}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=J0.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}}class rT extends mQ{constructor(e,r){super(r),this._decryptdata=null,this.rawProgramDateTime=null,this.programDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.stats=new TE,this.urlId=0,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.type=e}get decryptdata(){const{levelkeys:e}=this;if(!e&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){const r=this.levelkeys.identity;if(r)this._decryptdata=r.getDecryptData(this.sn);else{const n=Object.keys(this.levelkeys);if(n.length===1)return this._decryptdata=this.levelkeys[n[0]].getDecryptData(this.sn)}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null||!me(this.programDateTime))return null;const e=me(this.duration)?this.duration:0;return this.programDateTime+e*1e3}get encrypted(){var e;if((e=this._decryptdata)!=null&&e.encrypted)return!0;if(this.levelkeys){const r=Object.keys(this.levelkeys),n=r.length;if(n>1||n===1&&this.levelkeys[r[0]].encrypted)return!0}return!1}setKeyFormat(e){if(this.levelkeys){const r=this.levelkeys[e];r&&!this._decryptdata&&(this._decryptdata=r.getDecryptData(this.sn))}}abortRequests(){var e,r;(e=this.loader)==null||e.abort(),(r=this.keyLoader)==null||r.abort()}setElementaryStreamInfo(e,r,n,i,a,s=!1){const{elementaryStreams:o}=this,c=o[e];if(!c){o[e]={startPTS:r,endPTS:n,startDTS:i,endDTS:a,partial:s};return}c.startPTS=Math.min(c.startPTS,r),c.endPTS=Math.max(c.endPTS,n),c.startDTS=Math.min(c.startDTS,i),c.endDTS=Math.max(c.endDTS,a)}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[Qe.AUDIO]=null,e[Qe.VIDEO]=null,e[Qe.AUDIOVIDEO]=null}}class LHe extends mQ{constructor(e,r,n,i,a){super(n),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.stats=new TE,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=r,this.index=i;const s=e.enumeratedString("BYTERANGE");s&&this.setByteRange(s,a),a&&(this.fragOffset=a.fragOffset+a.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}}const PHe=10;class NHe{constructor(e){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=e}reloaded(e){if(!e){this.advanced=!0,this.updated=!0;return}const r=this.lastPartSn-e.lastPartSn,n=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!n||!!r,this.advanced=this.endSN>e.endSN||r>0||r===0&&n>0,this.updated||this.advanced?this.misses=Math.floor(e.misses*.6):this.misses=e.misses+1,this.availabilityDelay=e.availabilityDelay}get hasProgramDateTime(){return this.fragments.length?me(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||PHe}get drift(){const e=this.driftEndTime-this.driftStartTime;return e>0?(this.driftEnd-this.driftStart)*1e3/e:1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){var e;return(e=this.fragments)!=null&&e.length?this.fragments[this.fragments.length-1].end:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].index:-1}get lastPartSn(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}function $O(t){return Uint8Array.from(atob(t),e=>e.charCodeAt(0))}function DHe(t){const e=gQ(t).subarray(0,16),r=new Uint8Array(16);return r.set(e,16-e.length),r}function MHe(t){const e=function(n,i,a){const s=n[i];n[i]=n[a],n[a]=s};e(t,0,3),e(t,1,2),e(t,4,5),e(t,6,7)}function FHe(t){const e=t.split(":");let r=null;if(e[0]==="data"&&e.length===2){const n=e[1].split(";"),i=n[n.length-1].split(",");if(i.length===2){const a=i[0]==="base64",s=i[1];a?(n.splice(-1,1),r=$O(s)):r=DHe(s)}}return r}function gQ(t){return Uint8Array.from(unescape(encodeURIComponent(t)),e=>e.charCodeAt(0))}var vt={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},Xr={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function P5(t){switch(t){case Xr.FAIRPLAY:return vt.FAIRPLAY;case Xr.PLAYREADY:return vt.PLAYREADY;case Xr.WIDEVINE:return vt.WIDEVINE;case Xr.CLEARKEY:return vt.CLEARKEY}}var vQ={WIDEVINE:"edef8ba979d64acea3c827dcd51d21ed"};function BHe(t){if(t===vQ.WIDEVINE)return vt.WIDEVINE}function N5(t){switch(t){case vt.FAIRPLAY:return Xr.FAIRPLAY;case vt.PLAYREADY:return Xr.PLAYREADY;case vt.WIDEVINE:return Xr.WIDEVINE;case vt.CLEARKEY:return Xr.CLEARKEY}}function nT(t){const{drmSystems:e,widevineLicenseUrl:r}=t,n=e?[vt.FAIRPLAY,vt.WIDEVINE,vt.PLAYREADY,vt.CLEARKEY].filter(i=>!!e[i]):[];return!n[vt.WIDEVINE]&&r&&n.push(vt.WIDEVINE),n}const yQ=function(){return typeof self<"u"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function UHe(t,e,r,n){let i;switch(t){case vt.FAIRPLAY:i=["cenc","sinf"];break;case vt.WIDEVINE:case vt.PLAYREADY:i=["cenc"];break;case vt.CLEARKEY:i=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${t}`)}return jHe(i,e,r,n)}function jHe(t,e,r,n){return[{initDataTypes:t,persistentState:n.persistentState||"not-allowed",distinctiveIdentifier:n.distinctiveIdentifier||"not-allowed",sessionTypes:n.sessionTypes||[n.sessionType||"temporary"],audioCapabilities:e.map(a=>({contentType:`audio/mp4; codecs="${a}"`,robustness:n.audioRobustness||"",encryptionScheme:n.audioEncryptionScheme||null})),videoCapabilities:r.map(a=>({contentType:`video/mp4; codecs="${a}"`,robustness:n.videoRobustness||"",encryptionScheme:n.videoEncryptionScheme||null}))}]}function Hl(t,e,r){return Uint8Array.prototype.slice?t.slice(e,r):new Uint8Array(Array.prototype.slice.call(t,e,r))}const CO=(t,e)=>e+10<=t.length&&t[e]===73&&t[e+1]===68&&t[e+2]===51&&t[e+3]<255&&t[e+4]<255&&t[e+6]<128&&t[e+7]<128&&t[e+8]<128&&t[e+9]<128,xQ=(t,e)=>e+10<=t.length&&t[e]===51&&t[e+1]===68&&t[e+2]===73&&t[e+3]<255&&t[e+4]<255&&t[e+6]<128&&t[e+7]<128&&t[e+8]<128&&t[e+9]<128,O1=(t,e)=>{const r=e;let n=0;for(;CO(t,e);){n+=10;const i=RE(t,e+6);n+=i,xQ(t,e+10)&&(n+=10),e+=n}if(n>0)return t.subarray(r,r+n)},RE=(t,e)=>{let r=0;return r=(t[e]&127)<<21,r|=(t[e+1]&127)<<14,r|=(t[e+2]&127)<<7,r|=t[e+3]&127,r},HHe=(t,e)=>CO(t,e)&&RE(t,e+6)+10<=t.length-e,zHe=t=>{const e=EQ(t);for(let r=0;rt&&t.key==="PRIV"&&t.info==="com.apple.streaming.transportStreamTimestamp",GHe=t=>{const e=String.fromCharCode(t[0],t[1],t[2],t[3]),r=RE(t,4),n=10;return{type:e,size:r,data:t.subarray(n,n+r)}},EQ=t=>{let e=0;const r=[];for(;CO(t,e);){const n=RE(t,e+6);e+=10;const i=e+n;for(;e+8t.type==="PRIV"?WHe(t):t.type[0]==="W"?YHe(t):KHe(t),WHe=t=>{if(t.size<2)return;const e=fa(t.data,!0),r=new Uint8Array(t.data.subarray(e.length+1));return{key:t.type,info:e,data:r.buffer}},KHe=t=>{if(t.size<2)return;if(t.type==="TXXX"){let r=1;const n=fa(t.data.subarray(r),!0);r+=n.length+1;const i=fa(t.data.subarray(r));return{key:t.type,info:n,data:i}}const e=fa(t.data.subarray(1));return{key:t.type,data:e}},YHe=t=>{if(t.type==="WXXX"){if(t.size<2)return;let r=1;const n=fa(t.data.subarray(r),!0);r+=n.length+1;const i=fa(t.data.subarray(r));return{key:t.type,info:n,data:i}}const e=fa(t.data);return{key:t.type,data:e}},qHe=t=>{if(t.data.byteLength===8){const e=new Uint8Array(t.data),r=e[3]&1;let n=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return n/=45,r&&(n+=4772185884e-2),Math.round(n)}},fa=(t,e=!1)=>{const r=XHe();if(r){const l=r.decode(t);if(e){const u=l.indexOf("\0");return u!==-1?l.substring(0,u):l}return l.replace(/\0/g,"")}const n=t.length;let i,a,s,o="",c=0;for(;c>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:o+=String.fromCharCode(i);break;case 12:case 13:a=t[c++],o+=String.fromCharCode((i&31)<<6|a&63);break;case 14:a=t[c++],s=t[c++],o+=String.fromCharCode((i&15)<<12|(a&63)<<6|(s&63)<<0);break}}return o};let iT;function XHe(){return!iT&&typeof self.TextDecoder<"u"&&(iT=new self.TextDecoder("utf-8")),iT}const Ji={hexDump:function(t){let e="";for(let r=0;r>24,t[e+1]=r>>16&255,t[e+2]=r>>8&255,t[e+3]=r&255}function Be(t,e){const r=[];if(!e.length)return r;const n=t.byteLength;for(let i=0;i1?i+a:n;if(s===e[0])if(e.length===1)r.push(t.subarray(i+8,o));else{const c=Be(t.subarray(i+8,o),e.slice(1));c.length&&QHe.apply(r,c)}i=o}return r}function ZHe(t){const e=[],r=t[0];let n=8;const i=Ee(t,n);n+=4;const a=0,s=0;r===0?n+=8:n+=16,n+=2;let o=t.length+s;const c=_Q(t,n);n+=2;for(let l=0;l>>31===1)return G.warn("SIDX has hierarchical references (not supported)"),null;const p=Ee(t,u);u+=4,e.push({referenceSize:d,subsegmentDuration:p,info:{duration:p/i,start:o,end:o+d-1}}),o+=d,u+=4,n=u}return{earliestPresentationTime:a,timescale:i,version:r,referencesCount:c,references:e}}function TQ(t){const e=[],r=Be(t,["moov","trak"]);for(let i=0;i{const a=Ee(i,4),s=e[a];s&&(s.default={duration:Ee(i,12),flags:Ee(i,20)})}),e}function JHe(t,e){if(!t||!e)return t;const r=e.keyId;return r&&e.isCommonEncryption&&Be(t,["moov","trak"]).forEach(i=>{const s=Be(i,["mdia","minf","stbl","stsd"])[0].subarray(8);let o=Be(s,["enca"]);const c=o.length>0;c||(o=Be(s,["encv"])),o.forEach(l=>{const u=c?l.subarray(28):l.subarray(78);Be(u,["sinf"]).forEach(d=>{const h=RQ(d);if(h){const p=h.subarray(8,24);p.some(v=>v!==0)||(G.log(`[eme] Patching keyId in 'enc${c?"a":"v"}>sinf>>tenc' box: ${Ji.hexDump(p)} -> ${Ji.hexDump(r)}`),h.set(r,8))}})})}),t}function RQ(t){const e=Be(t,["schm"])[0];if(e){const r=Qt(e.subarray(4,8));if(r==="cbcs"||r==="cenc")return Be(t,["schi","tenc"])[0]}return G.error("[eme] missing 'schm' box"),null}function eze(t,e){return Be(e,["moof","traf"]).reduce((r,n)=>{const i=Be(n,["tfdt"])[0],a=i[0],s=Be(n,["tfhd"]).reduce((o,c)=>{const l=Ee(c,4),u=t[l];if(u){let f=Ee(i,4);if(a===1){if(f===L1)return G.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"),o;f*=L1+1,f+=Ee(i,8)}const d=u.timescale||9e4,h=f/d;if(isFinite(h)&&(o===null||hu+f.info.duration||0,0))}return s}return n||i}function rze(t){const e=Ee(t,0);let r=8;e&1&&(r+=4),e&4&&(r+=4);let n=0;const i=Ee(t,4);for(let a=0;a{Be(n,["tfhd"]).forEach(i=>{const a=Ee(i,4),s=t[a];if(!s)return;const o=s.timescale||9e4;Be(n,["tfdt"]).forEach(c=>{const l=c[0];let u=Ee(c,4);if(l===0)u-=r*o,u=Math.max(u,0),aT(c,4,u);else{u*=Math.pow(2,32),u+=Ee(c,8),u-=r*o,u=Math.max(u,0);const f=Math.floor(u/(L1+1)),d=Math.floor(u%(L1+1));aT(c,4,f),aT(c,8,d)}})})})}function ize(t){const e={valid:null,remainder:null},r=Be(t,["moof"]);if(r){if(r.length<2)return e.remainder=t,e}else return e;const n=r[r.length-1];return e.valid=Hl(t,0,n.byteOffset-8),e.remainder=Hl(t,n.byteOffset-8),e}function rc(t,e){const r=new Uint8Array(t.length+e.length);return r.set(t),r.set(e,t.length),r}function D5(t,e){const r=[],n=e.samples,i=e.timescale,a=e.id;let s=!1;return Be(n,["moof"]).map(c=>{const l=c.byteOffset-8;Be(c,["traf"]).map(f=>{const d=Be(f,["tfdt"]).map(h=>{const p=h[0];let v=Ee(h,4);return p===1&&(v*=Math.pow(2,32),v+=Ee(h,8)),v/i})[0];return d!==void 0&&(t=d),Be(f,["tfhd"]).map(h=>{const p=Ee(h,4),v=Ee(h,0)&16777215,m=(v&1)!==0,g=(v&2)!==0,y=(v&8)!==0;let x=0;const b=(v&16)!==0;let _=0;const S=(v&32)!==0;let w=8;p===a&&(m&&(w+=8),g&&(w+=4),y&&(x=Ee(h,w),w+=4),b&&(_=Ee(h,w),w+=4),S&&(w+=4),e.type==="video"&&(s=aze(e.codec)),Be(f,["trun"]).map(R=>{const I=R[0],T=Ee(R,0)&16777215,C=(T&1)!==0;let L=0;const H=(T&4)!==0,N=(T&256)!==0;let P=0;const B=(T&512)!==0;let V=0;const M=(T&1024)!==0,U=(T&2048)!==0;let W=0;const k=Ee(R,4);let O=8;C&&(L=Ee(R,O),O+=4),H&&(O+=4);let F=L+l;for(let D=0;D>1&63;return r===39||r===40}else return(e&31)===6}function AQ(t,e,r,n){const i=IQ(t);let a=0;a+=e;let s=0,o=0,c=!1,l=0;for(;a=i.length)break;l=i[a++],s+=l}while(l===255);o=0;do{if(a>=i.length)break;l=i[a++],o+=l}while(l===255);const u=i.length-a;if(!c&&s===4&&a16){const f=[];for(let p=0;p<16;p++){const v=i[a++].toString(16);f.push(v.length==1?"0"+v:v),(p===3||p===5||p===7||p===9)&&f.push("-")}const d=o-16,h=new Uint8Array(d);for(let p=0;pu)break}}function IQ(t){const e=t.byteLength,r=[];let n=1;for(;n>24&255,a[1]=n>>16&255,a[2]=n>>8&255,a[3]=n&255,a.set(t,4),i=0,n=8;i0?(a=new Uint8Array(4),e.length>0&&new DataView(a.buffer).setUint32(0,e.length,!1)):a=new Uint8Array;const s=new Uint8Array(4);return r&&r.byteLength>0&&new DataView(s.buffer).setUint32(0,r.byteLength,!1),lze([112,115,115,104],new Uint8Array([n,0,0,0]),t,a,i,s,r||new Uint8Array)}function uze(t){if(!(t instanceof ArrayBuffer)||t.byteLength<32)return null;const e={version:0,systemId:"",kids:null,data:null},r=new DataView(t),n=r.getUint32(0);if(t.byteLength!==n&&n>44||r.getUint32(4)!==1886614376||(e.version=r.getUint32(8)>>>24,e.version>1))return null;e.systemId=Ji.hexDump(new Uint8Array(t,12,16));const a=r.getUint32(28);if(e.version===0){if(n-32=22&&(this.keyId=r.subarray(r.length-22,r.length-6));break;case Xr.PLAYREADY:{const n=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=cze(n,null,r);const i=new Uint16Array(r.buffer,r.byteOffset,r.byteLength/2),a=String.fromCharCode.apply(null,Array.from(i)),s=a.substring(a.indexOf("<"),a.length),l=new DOMParser().parseFromString(s,"text/xml").getElementsByTagName("KID")[0];if(l){const u=l.childNodes[0]?l.childNodes[0].nodeValue:l.getAttribute("VALUE");if(u){const f=$O(u).subarray(0,16);MHe(f),this.keyId=f}}break}default:{let n=r.subarray(0,16);if(n.length!==16){const i=new Uint8Array(16);i.set(n,16-n.length),n=i}this.keyId=n;break}}if(!this.keyId||this.keyId.byteLength!==16){let n=Gg[this.uri];if(!n){const i=Object.keys(Gg).length%Number.MAX_SAFE_INTEGER;n=new Uint8Array(16),new DataView(n.buffer,12,4).setUint32(0,i),Gg[this.uri]=n}this.keyId=n}return this}}function fze(t){const e=new Uint8Array(16);for(let r=12;r<16;r++)e[r]=t>>8*(15-r)&255;return e}const $Q=/\{\$([a-zA-Z0-9-_]+)\}/g;function M5(t){return $Q.test(t)}function Hr(t,e,r){if(t.variableList!==null||t.hasVariableRefs)for(let n=r.length;n--;){const i=r[n],a=e[i];a&&(e[i]=WA(t,a))}}function WA(t,e){if(t.variableList!==null||t.hasVariableRefs){const r=t.variableList;return e.replace($Q,n=>{const i=n.substring(2,n.length-1),a=r==null?void 0:r[i];return a===void 0?(t.playlistParsingError||(t.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${i}"`)),n):a})}return e}function F5(t,e,r){let n=t.variableList;n||(t.variableList=n={});let i,a;if("QUERYPARAM"in e){i=e.QUERYPARAM;try{const s=new self.URL(r).searchParams;if(s.has(i))a=s.get(i);else throw new Error(`"${i}" does not match any query parameter in URI: "${r}"`)}catch(s){t.playlistParsingError||(t.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${s.message}`))}}else i=e.NAME,a=e.VALUE;i in n?t.playlistParsingError||(t.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${i}"`)):n[i]=a||""}function dze(t,e,r){const n=e.IMPORT;if(r&&n in r){let i=t.variableList;i||(t.variableList=i={}),i[n]=r[n]}else t.playlistParsingError||(t.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${n}"`))}const hze={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dva1:!0,dvav:!0,dvh1:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function pze(t,e){const r=hze[e];return!!r&&r[t.slice(0,4)]===!0}function sT(t,e){return MediaSource.isTypeSupported(`${e||"video"}/mp4;codecs="${t}"`)}const B5=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g,U5=/#EXT-X-MEDIA:(.*)/g,mze=/^#EXT(?:INF|-X-TARGETDURATION):/m,j5=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),gze=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(DATERANGE|DEFINE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|"));class wi{static findGroup(e,r){for(let n=0;n2){let n=r.shift()+".";return n+=parseInt(r.shift()).toString(16),n+=("000"+parseInt(r.shift()).toString(16)).slice(-4),n}return e}static resolve(e,r){return J0.buildAbsoluteURL(r,e,{alwaysNormalize:!0})}static isMediaPlaylist(e){return mze.test(e)}static parseMasterPlaylist(e,r){const n=M5(e),i={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:n},a=[];B5.lastIndex=0;let s;for(;(s=B5.exec(e))!=null;)if(s[1]){var o;const l=new gt(s[1]);Hr(i,l,["CODECS","SUPPLEMENTAL-CODECS","ALLOWED-CPC","PATHWAY-ID","STABLE-VARIANT-ID","AUDIO","VIDEO","SUBTITLES","CLOSED-CAPTIONS","NAME"]);const u=WA(i,s[2]),f={attrs:l,bitrate:l.decimalInteger("AVERAGE-BANDWIDTH")||l.decimalInteger("BANDWIDTH"),name:l.NAME,url:wi.resolve(u,r)},d=l.decimalResolution("RESOLUTION");d&&(f.width=d.width,f.height=d.height),vze((l.CODECS||"").split(/[ ,]+/).filter(h=>h),f),f.videoCodec&&f.videoCodec.indexOf("avc1")!==-1&&(f.videoCodec=wi.convertAVC1ToAVCOTI(f.videoCodec)),(o=f.unknownCodecs)!=null&&o.length||a.push(f),i.levels.push(f)}else if(s[3]){const l=s[3],u=s[4];switch(l){case"SESSION-DATA":{const f=new gt(u);Hr(i,f,["DATA-ID","LANGUAGE","VALUE","URI"]);const d=f["DATA-ID"];d&&(i.sessionData===null&&(i.sessionData={}),i.sessionData[d]=f);break}case"SESSION-KEY":{const f=H5(u,r,i);f.encrypted&&f.isSupported()?(i.sessionKeys===null&&(i.sessionKeys=[]),i.sessionKeys.push(f)):G.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${u}"`);break}case"DEFINE":{{const f=new gt(u);Hr(i,f,["NAME","VALUE","QUERYPARAM"]),F5(i,f,r)}break}case"CONTENT-STEERING":{const f=new gt(u);Hr(i,f,["SERVER-URI","PATHWAY-ID"]),i.contentSteering={uri:wi.resolve(f["SERVER-URI"],r),pathwayId:f["PATHWAY-ID"]||"."};break}case"START":{i.startTimeOffset=z5(u);break}}}const c=a.length>0&&a.length({id:l.attrs.AUDIO,audioCodec:l.audioCodec})),SUBTITLES:s.map(l=>({id:l.attrs.SUBTITLES,textCodec:l.textCodec})),"CLOSED-CAPTIONS":[]};let c=0;for(U5.lastIndex=0;(i=U5.exec(e))!==null;){const l=new gt(i[1]),u=l.TYPE;if(u){const f=o[u],d=a[u]||[];a[u]=d,Hr(n,l,["URI","GROUP-ID","LANGUAGE","ASSOC-LANGUAGE","STABLE-RENDITION-ID","NAME","INSTREAM-ID","CHARACTERISTICS","CHANNELS"]);const h={attrs:l,bitrate:0,id:c++,groupId:l["GROUP-ID"]||"",instreamId:l["INSTREAM-ID"],name:l.NAME||l.LANGUAGE||"",type:u,default:l.bool("DEFAULT"),autoselect:l.bool("AUTOSELECT"),forced:l.bool("FORCED"),lang:l.LANGUAGE,url:l.URI?wi.resolve(l.URI,r):""};if(f!=null&&f.length){const p=wi.findGroup(f,h.groupId)||f[0];G5(h,p,"audioCodec"),G5(h,p,"textCodec")}d.push(h)}}return a}static parseLevelPlaylist(e,r,n,i,a,s){const o=new NHe(r),c=o.fragments;let l=null,u=0,f=0,d=0,h=0,p=null,v=new rT(i,r),m,g,y,x=-1,b=!1;for(j5.lastIndex=0,o.m3u8=e,o.hasVariableRefs=M5(e);(m=j5.exec(e))!==null;){b&&(b=!1,v=new rT(i,r),v.start=d,v.sn=u,v.cc=h,v.level=n,l&&(v.initSegment=l,v.rawProgramDateTime=l.rawProgramDateTime,l.rawProgramDateTime=null));const R=m[1];if(R){v.duration=parseFloat(R);const I=(" "+m[2]).slice(1);v.title=I||null,v.tagList.push(I?["INF",R,I]:["INF",R])}else if(m[3]){if(me(v.duration)){v.start=d,y&&K5(v,y,o),v.sn=u,v.level=n,v.cc=h,v.urlId=a,c.push(v);const I=(" "+m[3]).slice(1);v.relurl=WA(o,I),V5(v,p),p=v,d+=v.duration,u++,f=0,b=!0}}else if(m[4]){const I=(" "+m[4]).slice(1);p?v.setByteRange(I,p):v.setByteRange(I)}else if(m[5])v.rawProgramDateTime=(" "+m[5]).slice(1),v.tagList.push(["PROGRAM-DATE-TIME",v.rawProgramDateTime]),x===-1&&(x=c.length);else{if(m=m[0].match(gze),!m){G.warn("No matches on slow regex match for level playlist!");continue}for(g=1;g0&&L.bool("CAN-SKIP-DATERANGES"),o.partHoldBack=L.optionalFloat("PART-HOLD-BACK",0),o.holdBack=L.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{const L=new gt(T);o.partTarget=L.decimalFloatingPoint("PART-TARGET");break}case"PART":{let L=o.partList;L||(L=o.partList=[]);const H=f>0?L[L.length-1]:void 0,N=f++,P=new gt(T);Hr(o,P,["BYTERANGE","URI"]);const B=new LHe(P,v,r,N,H);L.push(B),v.duration+=B.duration;break}case"PRELOAD-HINT":{const L=new gt(T);Hr(o,L,["URI"]),o.preloadHint=L;break}case"RENDITION-REPORT":{const L=new gt(T);Hr(o,L,["URI"]),o.renditionReports=o.renditionReports||[],o.renditionReports.push(L);break}default:G.warn(`line parsed but not handled: ${m}`);break}}}p&&!p.relurl?(c.pop(),d-=p.duration,o.partList&&(o.fragmentHint=p)):o.partList&&(V5(v,p),v.cc=h,o.fragmentHint=v,y&&K5(v,y,o));const _=c.length,S=c[0],w=c[_-1];if(d+=o.skippedSegments*o.targetduration,d>0&&_&&w){o.averagetargetduration=d/_;const R=w.sn;o.endSN=R!=="initSegment"?R:0,o.live||(w.endList=!0),S&&(o.startCC=S.cc)}else o.endSN=0,o.startCC=0;return o.fragmentHint&&(d+=o.fragmentHint.duration),o.totalduration=d,o.endCC=h,x>0&&yze(c,x),o}}function H5(t,e,r){var n,i;const a=new gt(t);Hr(r,a,["KEYFORMAT","KEYFORMATVERSIONS","URI","IV","URI"]);const s=(n=a.METHOD)!=null?n:"",o=a.URI,c=a.hexadecimalInteger("IV"),l=a.KEYFORMATVERSIONS,u=(i=a.KEYFORMAT)!=null?i:"identity";o&&a.IV&&!c&&G.error(`Invalid IV: ${a.IV}`);const f=o?wi.resolve(o,e):"",d=(l||"1").split("/").map(Number).filter(Number.isFinite);return new ep(s,f,u,d,c)}function z5(t){const r=new gt(t).decimalFloatingPoint("TIME-OFFSET");return me(r)?r:null}function vze(t,e){["video","audio","text"].forEach(r=>{const n=t.filter(i=>pze(i,r));if(n.length){const i=n.filter(a=>a.lastIndexOf("avc1",0)===0||a.lastIndexOf("mp4a",0)===0);e[`${r}Codec`]=i.length>0?i[0]:n[0],t=t.filter(a=>n.indexOf(a)===-1)}}),e.unknownCodecs=t}function G5(t,e,r){const n=e[r];n&&(t[r]=n)}function yze(t,e){let r=t[e];for(let n=e;n--;){const i=t[n];if(!i)return;i.programDateTime=r.programDateTime-i.duration*1e3,r=i}}function V5(t,e){t.rawProgramDateTime?t.programDateTime=Date.parse(t.rawProgramDateTime):e!=null&&e.programDateTime&&(t.programDateTime=e.endProgramDateTime),me(t.programDateTime)||(t.programDateTime=null,t.rawProgramDateTime=null)}function W5(t,e,r,n){t.relurl=e.URI,e.BYTERANGE&&t.setByteRange(e.BYTERANGE),t.level=r,t.sn="initSegment",n&&(t.levelkeys=n),t.initSegment=null}function K5(t,e,r){t.levelkeys=e;const{encryptedFragments:n}=r;(!n.length||n[n.length-1].levelkeys!==e)&&Object.keys(e).some(i=>e[i].isCommonEncryption)&&n.push(t)}var He={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},xe={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};function Y5(t){const{type:e}=t;switch(e){case He.AUDIO_TRACK:return xe.AUDIO;case He.SUBTITLE_TRACK:return xe.SUBTITLE;default:return xe.MAIN}}function oT(t,e){let r=t.url;return(r===void 0||r.indexOf("data:")===0)&&(r=e.url),r}class xze{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:e}=this;e.on($.MANIFEST_LOADING,this.onManifestLoading,this),e.on($.LEVEL_LOADING,this.onLevelLoading,this),e.on($.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on($.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}unregisterListeners(){const{hls:e}=this;e.off($.MANIFEST_LOADING,this.onManifestLoading,this),e.off($.LEVEL_LOADING,this.onLevelLoading,this),e.off($.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off($.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}createInternalLoader(e){const r=this.hls.config,n=r.pLoader,i=r.loader,a=n||i,s=new a(r);return this.loaders[e.type]=s,s}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(const e in this.loaders){const r=this.loaders[e];r&&r.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,r){const{url:n}=r;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:He.MANIFEST,url:n,deliveryDirectives:null})}onLevelLoading(e,r){const{id:n,level:i,url:a,deliveryDirectives:s}=r;this.load({id:n,level:i,responseType:"text",type:He.LEVEL,url:a,deliveryDirectives:s})}onAudioTrackLoading(e,r){const{id:n,groupId:i,url:a,deliveryDirectives:s}=r;this.load({id:n,groupId:i,level:null,responseType:"text",type:He.AUDIO_TRACK,url:a,deliveryDirectives:s})}onSubtitleTrackLoading(e,r){const{id:n,groupId:i,url:a,deliveryDirectives:s}=r;this.load({id:n,groupId:i,level:null,responseType:"text",type:He.SUBTITLE_TRACK,url:a,deliveryDirectives:s})}load(e){var r;const n=this.hls.config;let i=this.getInternalLoader(e);if(i){const l=i.context;if(l&&l.url===e.url){G.trace("[playlist-loader]: playlist request ongoing");return}G.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),i.abort()}let a;if(e.type===He.MANIFEST?a=n.manifestLoadPolicy.default:a=Pt({},n.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),i=this.createInternalLoader(e),(r=e.deliveryDirectives)!=null&&r.part){let l;if(e.type===He.LEVEL&&e.level!==null?l=this.hls.levels[e.level].details:e.type===He.AUDIO_TRACK&&e.id!==null?l=this.hls.audioTracks[e.id].details:e.type===He.SUBTITLE_TRACK&&e.id!==null&&(l=this.hls.subtitleTracks[e.id].details),l){const u=l.partTarget,f=l.targetduration;if(u&&f){const d=Math.max(u*3,f*.8)*1e3;a=Pt({},a,{maxTimeToFirstByteMs:Math.min(d,a.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(d,a.maxTimeToFirstByteMs)})}}}const s=a.errorRetry||a.timeoutRetry||{},o={loadPolicy:a,timeout:a.maxLoadTimeMs,maxRetry:s.maxNumRetry||0,retryDelay:s.retryDelayMs||0,maxRetryDelay:s.maxRetryDelayMs||0},c={onSuccess:(l,u,f,d)=>{const h=this.getInternalLoader(f);this.resetInternalLoader(f.type);const p=l.data;if(p.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(l,f,new Error("no EXTM3U delimiter"),d||null,u);return}u.parsing.start=performance.now(),wi.isMediaPlaylist(p)?this.handleTrackOrLevelPlaylist(l,u,f,d||null,h):this.handleMasterPlaylist(l,u,f,d)},onError:(l,u,f,d)=>{this.handleNetworkError(u,f,!1,l,d)},onTimeout:(l,u,f)=>{this.handleNetworkError(u,f,!0,void 0,l)}};i.load(e,o,c)}handleMasterPlaylist(e,r,n,i){const a=this.hls,s=e.data,o=oT(e,n),c=wi.parseMasterPlaylist(s,o);if(c.playlistParsingError){this.handleManifestParsingError(e,n,c.playlistParsingError,i,r);return}const{contentSteering:l,levels:u,sessionData:f,sessionKeys:d,startTimeOffset:h,variableList:p}=c;this.variableList=p;const{AUDIO:v=[],SUBTITLES:m,"CLOSED-CAPTIONS":g}=wi.parseMasterPlaylistMedia(s,o,c);v.length&&!v.some(x=>!x.url)&&u[0].audioCodec&&!u[0].attrs.AUDIO&&(G.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),v.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new gt({}),bitrate:0,url:""})),a.trigger($.MANIFEST_LOADED,{levels:u,audioTracks:v,subtitles:m,captions:g,contentSteering:l,url:o,stats:r,networkDetails:i,sessionData:f,sessionKeys:d,startTimeOffset:h,variableList:p})}handleTrackOrLevelPlaylist(e,r,n,i,a){const s=this.hls,{id:o,level:c,type:l}=n,u=oT(e,n),f=me(o)?o:0,d=me(c)?c:f,h=Y5(n),p=wi.parseLevelPlaylist(e.data,u,d,h,f,this.variableList);if(l===He.MANIFEST){const v={attrs:new gt({}),bitrate:0,details:p,name:"",url:u};s.trigger($.MANIFEST_LOADED,{levels:[v],audioTracks:[],url:u,stats:r,networkDetails:i,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}r.parsing.end=performance.now(),n.levelDetails=p,this.handlePlaylistLoaded(p,e,r,n,i,a)}handleManifestParsingError(e,r,n,i,a){this.hls.trigger($.ERROR,{type:ye.NETWORK_ERROR,details:q.MANIFEST_PARSING_ERROR,fatal:r.type===He.MANIFEST,url:e.url,err:n,error:n,reason:n.message,response:e,context:r,networkDetails:i,stats:a})}handleNetworkError(e,r,n=!1,i,a){let s=`A network ${n?"timeout":"error"+(i?" (status "+i.code+")":"")} occurred while loading ${e.type}`;e.type===He.LEVEL?s+=`: ${e.level} id: ${e.id}`:(e.type===He.AUDIO_TRACK||e.type===He.SUBTITLE_TRACK)&&(s+=` id: ${e.id} group-id: "${e.groupId}"`);const o=new Error(s);G.warn(`[playlist-loader]: ${s}`);let c=q.UNKNOWN,l=!1;const u=this.getInternalLoader(e);switch(e.type){case He.MANIFEST:c=n?q.MANIFEST_LOAD_TIMEOUT:q.MANIFEST_LOAD_ERROR,l=!0;break;case He.LEVEL:c=n?q.LEVEL_LOAD_TIMEOUT:q.LEVEL_LOAD_ERROR,l=!1;break;case He.AUDIO_TRACK:c=n?q.AUDIO_TRACK_LOAD_TIMEOUT:q.AUDIO_TRACK_LOAD_ERROR,l=!1;break;case He.SUBTITLE_TRACK:c=n?q.SUBTITLE_TRACK_LOAD_TIMEOUT:q.SUBTITLE_LOAD_ERROR,l=!1;break}u&&this.resetInternalLoader(e.type);const f={type:ye.NETWORK_ERROR,details:c,fatal:l,url:e.url,loader:u,context:e,error:o,networkDetails:r,stats:a};if(i){const d=(r==null?void 0:r.url)||e.url;f.response=sn({url:d,data:void 0},i)}this.hls.trigger($.ERROR,f)}handlePlaylistLoaded(e,r,n,i,a,s){const o=this.hls,{type:c,level:l,id:u,groupId:f,deliveryDirectives:d}=i,h=oT(r,i),p=Y5(i),v=typeof i.level=="number"&&p===xe.MAIN?l:void 0;if(!e.fragments.length){const g=new Error("No Segments found in Playlist");o.trigger($.ERROR,{type:ye.NETWORK_ERROR,details:q.LEVEL_EMPTY_ERROR,fatal:!1,url:h,error:g,reason:g.message,response:r,context:i,level:v,parent:p,networkDetails:a,stats:n});return}e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));const m=e.playlistParsingError;if(m){o.trigger($.ERROR,{type:ye.NETWORK_ERROR,details:q.LEVEL_PARSING_ERROR,fatal:!1,url:h,error:m,reason:m.message,response:r,context:i,level:v,parent:p,networkDetails:a,stats:n});return}switch(e.live&&s&&(s.getCacheAge&&(e.ageHeader=s.getCacheAge()||0),(!s.getCacheAge||isNaN(e.ageHeader))&&(e.ageHeader=0)),c){case He.MANIFEST:case He.LEVEL:o.trigger($.LEVEL_LOADED,{details:e,level:v||0,id:u||0,stats:n,networkDetails:a,deliveryDirectives:d});break;case He.AUDIO_TRACK:o.trigger($.AUDIO_TRACK_LOADED,{details:e,id:u||0,groupId:f||"",stats:n,networkDetails:a,deliveryDirectives:d});break;case He.SUBTITLE_TRACK:o.trigger($.SUBTITLE_TRACK_LOADED,{details:e,id:u||0,groupId:f||"",stats:n,networkDetails:a,deliveryDirectives:d});break}}}function CQ(t,e){let r;try{r=new Event("addtrack")}catch{r=document.createEvent("Event"),r.initEvent("addtrack",!1,!1)}r.track=t,e.dispatchEvent(r)}function kQ(t,e){const r=t.mode;if(r==="disabled"&&(t.mode="hidden"),t.cues&&!t.cues.getCueById(e.id))try{if(t.addCue(e),!t.cues.getCueById(e.id))throw new Error(`addCue is failed for: ${e}`)}catch(n){G.debug(`[texttrack-utils]: ${n}`);const i=new self.TextTrackCue(e.startTime,e.endTime,e.text);i.id=e.id,t.addCue(i)}r==="disabled"&&(t.mode=r)}function Ru(t){const e=t.mode;if(e==="disabled"&&(t.mode="hidden"),t.cues)for(let r=t.cues.length;r--;)t.removeCue(t.cues[r]);e==="disabled"&&(t.mode=e)}function KA(t,e,r,n){const i=t.mode;if(i==="disabled"&&(t.mode="hidden"),t.cues&&t.cues.length>0){const a=Eze(t.cues,e,r);for(let s=0;st[r].endTime)return-1;let n=0,i=r;for(;n<=i;){const a=Math.floor((i+n)/2);if(et[a].startTime&&n-1)for(let a=i,s=t.length;a=e&&o.endTime<=r)n.push(o);else if(o.startTime>r)return n}return n}var Si={audioId3:"org.id3",dateRange:"com.apple.quicktime.HLS",emsg:"https://aomedia.org/emsg/ID3"};const Sze=.25;function YA(){if(!(typeof self>"u"))return self.WebKitDataCue||self.VTTCue||self.TextTrackCue}const Vg=(()=>{const t=YA();try{new t(0,Number.POSITIVE_INFINITY,"")}catch{return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function lT(t,e){return t.getTime()/1e3-e}function _ze(t){return Uint8Array.from(t.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}class wze{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=null}_registerListeners(){const{hls:e}=this;e.on($.MEDIA_ATTACHED,this.onMediaAttached,this),e.on($.MEDIA_DETACHING,this.onMediaDetaching,this),e.on($.MANIFEST_LOADING,this.onManifestLoading,this),e.on($.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on($.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on($.LEVEL_UPDATED,this.onLevelUpdated,this)}_unregisterListeners(){const{hls:e}=this;e.off($.MEDIA_ATTACHED,this.onMediaAttached,this),e.off($.MEDIA_DETACHING,this.onMediaDetaching,this),e.off($.MANIFEST_LOADING,this.onManifestLoading,this),e.off($.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off($.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off($.LEVEL_UPDATED,this.onLevelUpdated,this)}onMediaAttached(e,r){this.media=r.media}onMediaDetaching(){this.id3Track&&(Ru(this.id3Track),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(e){const r=this.getID3Track(e.textTracks);return r.mode="hidden",r}getID3Track(e){if(this.media){for(let r=0;rVg&&(f=Vg),f-u<=0&&(f=u+Sze);for(let h=0;hu.type===Si.audioId3&&c:i==="video"?l=u=>u.type===Si.emsg&&o:l=u=>u.type===Si.audioId3&&c||u.type===Si.emsg&&o,KA(a,r,n,l)}}onLevelUpdated(e,{details:r}){if(!this.media||!r.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)return;const{dateRangeCuesAppended:n,id3Track:i}=this,{dateRanges:a}=r,s=Object.keys(a);if(i){const u=Object.keys(n).filter(f=>!s.includes(f));for(let f=u.length;f--;){const d=u[f];Object.keys(n[d].cues).forEach(h=>{i.removeCue(n[d].cues[h])}),delete n[d]}}const o=r.fragments[r.fragments.length-1];if(s.length===0||!me(o==null?void 0:o.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const c=o.programDateTime/1e3-o.start,l=YA();for(let u=0;u{const w=a[S];return w.class===d.class&&w.id!==S&&w.startDate>d.startDate&&_.push(w),_},[]).sort((_,S)=>_.startDate.getTime()-S.startDate.getTime())[0];b&&(g=lT(b.startDate,c),v=!0)}const x=Object.keys(d.attr);for(let b=0;bthis.timeupdate(),this.hls=e,this.config=e.config,this.registerListeners()}get latency(){return this._latency||0}get maxLatency(){const{config:e,levelDetails:r}=this;return e.liveMaxLatencyDuration!==void 0?e.liveMaxLatencyDuration:r?e.liveMaxLatencyDurationCount*r.targetduration:0}get targetLatency(){const{levelDetails:e}=this;if(e===null)return null;const{holdBack:r,partHoldBack:n,targetduration:i}=e,{liveSyncDuration:a,liveSyncDurationCount:s,lowLatencyMode:o}=this.config,c=this.hls.userConfig;let l=o&&n||r;(c.liveSyncDuration||c.liveSyncDurationCount||l===0)&&(l=a!==void 0?a:s*i);const u=i,f=1;return l+Math.min(this.stallCount*f,u)}get liveSyncPosition(){const e=this.estimateLiveEdge(),r=this.targetLatency,n=this.levelDetails;if(e===null||r===null||n===null)return null;const i=n.edge,a=e-r-this.edgeStalled,s=i-n.totalduration,o=i-(this.config.lowLatencyMode&&n.partTarget||n.targetduration);return Math.min(Math.max(s,a),o)}get drift(){const{levelDetails:e}=this;return e===null?1:e.drift}get edgeStalled(){const{levelDetails:e}=this;if(e===null)return 0;const r=(this.config.lowLatencyMode&&e.partTarget||e.targetduration)*3;return Math.max(e.age-r,0)}get forwardBufferLength(){const{media:e,levelDetails:r}=this;if(!e||!r)return 0;const n=e.buffered.length;return(n?e.buffered.end(n-1):r.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null}registerListeners(){this.hls.on($.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on($.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on($.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on($.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on($.ERROR,this.onError,this)}unregisterListeners(){this.hls.off($.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off($.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.off($.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off($.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.off($.ERROR,this.onError,this)}onMediaAttached(e,r){this.media=r.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)}onManifestLoading(){this.levelDetails=null,this._latency=null,this.stallCount=0}onLevelUpdated(e,{details:r}){this.levelDetails=r,r.advanced&&this.timeupdate(),!r.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)}onError(e,r){var n;r.details===q.BUFFER_STALLED_ERROR&&(this.stallCount++,(n=this.levelDetails)!=null&&n.live&&G.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))}timeupdate(){const{media:e,levelDetails:r}=this;if(!e||!r)return;this.currentTime=e.currentTime;const n=this.computeLatency();if(n===null)return;this._latency=n;const{lowLatencyMode:i,maxLiveSyncPlaybackRate:a}=this.config;if(!i||a===1)return;const s=this.targetLatency;if(s===null)return;const o=n-s,c=Math.min(this.maxLatency,s+r.targetduration),l=o.05&&this.forwardBufferLength>1){const u=Math.min(2,Math.max(1,a)),f=Math.round(2/(1+Math.exp(-.75*o-this.edgeStalled))*20)/20;e.playbackRate=Math.min(u,Math.max(1,f))}else e.playbackRate!==1&&e.playbackRate!==0&&(e.playbackRate=1)}estimateLiveEdge(){const{levelDetails:e}=this;return e===null?null:e.edge+e.age}computeLatency(){const e=this.estimateLiveEdge();return e===null?null:e-this.currentTime}}const qA=["NONE","TYPE-0","TYPE-1",null];var o0={No:"",Yes:"YES",v2:"v2"};function Rze(t,e){const{canSkipUntil:r,canSkipDateRanges:n,endSN:i}=t,a=e!==void 0?e-i:0;return r&&ar).join(",").replace(/\.[^.,]+/g,"")}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get attrs(){return this._attrs[this._urlId]}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get uri(){return this.url[this._urlId]||""}get urlId(){return this._urlId}set urlId(e){const r=e%this.url.length;this._urlId!==r&&(this.fragmentError=0,this.loadError=0,this.details=void 0,this._urlId=r)}get audioGroupId(){var e;return(e=this.audioGroupIds)==null?void 0:e[this.urlId]}get textGroupId(){var e;return(e=this.textGroupIds)==null?void 0:e[this.urlId]}addFallback(e){this.url.push(e.url),this._attrs.push(e.attrs)}}function cT(t,e){const r=e.startPTS;if(me(r)){let n=0,i;e.sn>t.sn?(n=r-t.start,i=t):(n=t.start-r,i=e),i.duration!==n&&(i.duration=n)}else e.sn>t.sn?t.cc===e.cc&&t.minEndPTS?e.start=t.start+(t.minEndPTS-t.start):e.start=t.start+t.duration:e.start=Math.max(t.start-e.duration,0)}function OQ(t,e,r,n,i,a){n-r<=0&&(G.warn("Fragment should have a positive duration",e),n=r+e.duration,a=i+e.duration);let o=r,c=n;const l=e.startPTS,u=e.endPTS;if(me(l)){const m=Math.abs(l-r);me(e.deltaPTS)?e.deltaPTS=Math.max(m,e.deltaPTS):e.deltaPTS=m,o=Math.max(r,l),r=Math.min(r,l),i=Math.min(i,e.startDTS),c=Math.min(n,u),n=Math.max(n,u),a=Math.max(a,e.endDTS)}const f=r-e.start;e.start!==0&&(e.start=r),e.duration=n-e.start,e.startPTS=r,e.maxStartPTS=o,e.startDTS=i,e.endPTS=n,e.minEndPTS=c,e.endDTS=a;const d=e.sn;if(!t||dt.endSN)return 0;let h;const p=d-t.startSN,v=t.fragments;for(v[p]=e,h=p;h>0;h--)cT(v[h],v[h-1]);for(h=p;h=0;c--){const l=n[c].initSegment;if(l){r=l;break}}t.fragmentHint&&delete t.fragmentHint.endPTS;let i=0,a;if(Cze(t,e,(c,l)=>{c.relurl&&(i=c.cc-l.cc),me(c.startPTS)&&me(c.endPTS)&&(l.start=l.startPTS=c.startPTS,l.startDTS=c.startDTS,l.maxStartPTS=c.maxStartPTS,l.endPTS=c.endPTS,l.endDTS=c.endDTS,l.minEndPTS=c.minEndPTS,l.duration=c.endPTS-c.startPTS,l.duration&&(a=l),e.PTSKnown=e.alignedSliding=!0),l.elementaryStreams=c.elementaryStreams,l.loader=c.loader,l.stats=c.stats,l.urlId=c.urlId,c.initSegment&&(l.initSegment=c.initSegment,r=c.initSegment)}),r&&(e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments).forEach(l=>{var u;(!l.initSegment||l.initSegment.relurl===((u=r)==null?void 0:u.relurl))&&(l.initSegment=r)}),e.skippedSegments)if(e.deltaUpdateFailed=e.fragments.some(c=>!c),e.deltaUpdateFailed){G.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let c=e.skippedSegments;c--;)e.fragments.shift();e.startSN=e.fragments[0].sn,e.startCC=e.fragments[0].cc}else e.canSkipDateRanges&&(e.dateRanges=Ize(t.dateRanges,e.dateRanges,e.recentlyRemovedDateranges));const s=e.fragments;if(i){G.warn("discontinuity sliding from playlist, take drift into account");for(let c=0;c{l.elementaryStreams=c.elementaryStreams,l.stats=c.stats}),a?OQ(e,a,a.startPTS,a.endPTS,a.startDTS,a.endDTS):LQ(t,e),s.length&&(e.totalduration=e.edge-s[0].start),e.driftStartTime=t.driftStartTime,e.driftStart=t.driftStart;const o=e.advancedDateTime;if(e.advanced&&o){const c=e.edge;e.driftStart||(e.driftStartTime=o,e.driftStart=c),e.driftEndTime=o,e.driftEnd=c}else e.driftEndTime=t.driftEndTime,e.driftEnd=t.driftEnd,e.advancedDateTime=t.advancedDateTime}function Ize(t,e,r){const n=Pt({},t);return r&&r.forEach(i=>{delete n[i]}),Object.keys(e).forEach(i=>{const a=new pQ(e[i].attr,n[i]);a.isValid?n[i]=a:G.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${JSON.stringify(e[i].attr)}"`)}),n}function $ze(t,e,r){if(t&&e){let n=0;for(let i=0,a=t.length;i<=a;i++){const s=t[i],o=e[i+n];s&&o&&s.index===o.index&&s.fragment.sn===o.fragment.sn?r(s,o):n--}}}function Cze(t,e,r){const n=e.skippedSegments,i=Math.max(t.startSN,e.startSN)-e.startSN,a=(t.fragmentHint?1:0)+(n?e.endSN:Math.min(t.endSN,e.endSN))-e.startSN,s=e.startSN-t.startSN,o=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,c=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments;for(let l=i;l<=a;l++){const u=c[s+l];let f=o[l];n&&!f&&l=n.length||XA(e,n[r].start)}function XA(t,e){if(e){const r=t.fragments;for(let n=t.skippedSegments;ne){const a=n[n.length-1].duration*1e3;a499)}const NQ={search:function(t,e){let r=0,n=t.length-1,i=null,a=null;for(;r<=n;){i=(r+n)/2|0,a=t[i];const s=e(a);if(s>0)r=i+1;else if(s<0)n=i-1;else return a}return null}};function Pze(t,e,r){if(e===null||!Array.isArray(t)||!t.length||!me(e))return null;const n=t[0].programDateTime;if(e<(n||0))return null;const i=t[t.length-1].endProgramDateTime;if(e>=(i||0))return null;r=r||0;for(let a=0;at)return 0;const n=Math.min(e,r.duration+(r.deltaPTS?r.deltaPTS:0));return r.start+r.duration-n<=t?1:r.start-n>t&&r.start?-1:0}function Nze(t,e,r){const n=Math.min(e,r.duration+(r.deltaPTS?r.deltaPTS:0))*1e3;return(r.endProgramDateTime||0)-n>t}function Dze(t,e){return NQ.search(t,r=>r.cce?-1:0)}const Mze=3e5;var zr={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},Bn={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,SwitchToSDR:4};class Fze{constructor(e){this.hls=void 0,this.playlistError=0,this.penalizedRenditions={},this.log=void 0,this.warn=void 0,this.error=void 0,this.hls=e,this.log=G.log.bind(G,"[info]:"),this.warn=G.warn.bind(G,"[warning]:"),this.error=G.error.bind(G,"[error]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on($.ERROR,this.onError,this),e.on($.MANIFEST_LOADING,this.onManifestLoading,this)}unregisterListeners(){const e=this.hls;e&&(e.off($.ERROR,this.onError,this),e.off($.ERROR,this.onErrorOut,this),e.off($.MANIFEST_LOADING,this.onManifestLoading,this))}destroy(){this.unregisterListeners(),this.hls=null,this.penalizedRenditions={}}startLoad(e){this.playlistError=0}stopLoad(){}getVariantLevelIndex(e){return(e==null?void 0:e.type)===xe.MAIN?e.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onError(e,r){var n;if(r.fatal)return;const i=this.hls,a=r.context;switch(r.details){case q.FRAG_LOAD_ERROR:case q.FRAG_LOAD_TIMEOUT:case q.KEY_LOAD_ERROR:case q.KEY_LOAD_TIMEOUT:r.errorAction=this.getFragRetryOrSwitchAction(r);return;case q.FRAG_GAP:case q.FRAG_PARSING_ERROR:case q.FRAG_DECRYPT_ERROR:{r.errorAction=this.getFragRetryOrSwitchAction(r),r.errorAction.action=zr.SendAlternateToPenaltyBox;return}case q.LEVEL_EMPTY_ERROR:case q.LEVEL_PARSING_ERROR:{var s,o;const c=r.parent===xe.MAIN?r.level:i.loadLevel;r.details===q.LEVEL_EMPTY_ERROR&&((s=r.context)!=null&&(o=s.levelDetails)!=null&&o.live)?r.errorAction=this.getPlaylistRetryOrSwitchAction(r,c):(r.levelRetry=!1,r.errorAction=this.getLevelSwitchAction(r,c))}return;case q.LEVEL_LOAD_ERROR:case q.LEVEL_LOAD_TIMEOUT:typeof(a==null?void 0:a.level)=="number"&&(r.errorAction=this.getPlaylistRetryOrSwitchAction(r,a.level));return;case q.AUDIO_TRACK_LOAD_ERROR:case q.AUDIO_TRACK_LOAD_TIMEOUT:case q.SUBTITLE_LOAD_ERROR:case q.SUBTITLE_TRACK_LOAD_TIMEOUT:if(a){const c=i.levels[i.loadLevel];if(c&&(a.type===He.AUDIO_TRACK&&a.groupId===c.audioGroupId||a.type===He.SUBTITLE_TRACK&&a.groupId===c.textGroupId)){r.errorAction=this.getPlaylistRetryOrSwitchAction(r,i.loadLevel),r.errorAction.action=zr.SendAlternateToPenaltyBox,r.errorAction.flags=Bn.MoveAllAlternatesMatchingHost;return}}return;case q.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const c=i.levels[i.loadLevel],l=c==null?void 0:c.attrs["HDCP-LEVEL"];l&&(r.errorAction={action:zr.SendAlternateToPenaltyBox,flags:Bn.MoveAllAlternatesMatchingHDCP,hdcpLevel:l})}return;case q.BUFFER_ADD_CODEC_ERROR:case q.REMUX_ALLOC_ERROR:r.errorAction=this.getLevelSwitchAction(r,(n=r.level)!=null?n:i.loadLevel);return;case q.INTERNAL_EXCEPTION:case q.BUFFER_APPENDING_ERROR:case q.BUFFER_APPEND_ERROR:case q.BUFFER_FULL_ERROR:case q.LEVEL_SWITCH_ERROR:case q.BUFFER_STALLED_ERROR:case q.BUFFER_SEEK_OVER_HOLE:case q.BUFFER_NUDGE_ON_STALL:r.errorAction={action:zr.DoNothing,flags:Bn.None};return}if(r.type===ye.KEY_SYSTEM_ERROR){const c=this.getVariantLevelIndex(r.frag);r.levelRetry=!1,r.errorAction=this.getLevelSwitchAction(r,c);return}}getPlaylistRetryOrSwitchAction(e,r){var n,i;const a=this.hls,s=Q5(a.config.playlistLoadPolicy,e),o=this.playlistError++,c=(n=e.response)==null?void 0:n.code;return N1(s,o,P1(e),c)?{action:zr.RetryRequest,flags:Bn.None,retryConfig:s,retryCount:o}:(i=e.context)!=null&&i.deliveryDirectives?{action:zr.DoNothing,flags:Bn.None,retryConfig:s||{maxNumRetry:0,retryDelayMs:0,maxRetryDelayMs:0},retryCount:o}:this.getLevelSwitchAction(e,r)}getFragRetryOrSwitchAction(e){const r=this.hls,n=this.getVariantLevelIndex(e.frag),i=r.levels[n],{fragLoadPolicy:a,keyLoadPolicy:s}=r.config,o=Q5(e.details.startsWith("key")?s:a,e),c=r.levels.reduce((f,d)=>f+d.fragmentError,0);if(i){var l;e.details!==q.FRAG_GAP&&i.fragmentError++;const f=(l=e.response)==null?void 0:l.code;if(N1(o,c,P1(e),f))return{action:zr.RetryRequest,flags:Bn.None,retryConfig:o,retryCount:c}}const u=this.getLevelSwitchAction(e,n);return o&&(u.retryConfig=o,u.retryCount=c),u}getLevelSwitchAction(e,r){const n=this.hls;r==null&&(r=n.loadLevel);const i=this.hls.levels[r];if(i&&(i.loadError++,n.autoLevelEnabled)){var a,s;let o=-1;const c=n.levels,l=(a=e.frag)==null?void 0:a.type,{type:u,groupId:f}=(s=e.context)!=null?s:{};for(let d=c.length;d--;){const h=(d+n.loadLevel)%c.length;if(h!==n.loadLevel&&c[h].loadError===0){const p=c[h];if(e.details===q.FRAG_GAP&&e.frag){const v=c[h].details;if(v){const m=rp(e.frag,v.fragments,e.frag.start);if(m!=null&&m.gap)continue}}else{if(u===He.AUDIO_TRACK&&f===p.audioGroupId||u===He.SUBTITLE_TRACK&&f===p.textGroupId)continue;if(l===xe.AUDIO&&i.audioGroupId===p.audioGroupId||l===xe.SUBTITLE&&i.textGroupId===p.textGroupId)continue}o=h;break}}if(o>-1&&n.loadLevel!==o)return e.levelRetry=!0,{action:zr.SendAlternateToPenaltyBox,flags:Bn.None,nextAutoLevel:o}}return{action:zr.SendAlternateToPenaltyBox,flags:Bn.MoveAllAlternatesMatchingHost}}onErrorOut(e,r){var n;switch((n=r.errorAction)==null?void 0:n.action){case zr.DoNothing:break;case zr.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(r),!r.errorAction.resolved&&r.details!==q.FRAG_GAP&&(r.fatal=!0);break}if(r.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(e){const r=this.hls,n=e.errorAction;if(!n)return;const{flags:i,hdcpLevel:a,nextAutoLevel:s}=n;switch(i){case Bn.None:this.switchLevel(e,s);break;case Bn.MoveAllAlternatesMatchingHost:n.resolved||(n.resolved=this.redundantFailover(e));break;case Bn.MoveAllAlternatesMatchingHDCP:a&&(r.maxHdcpLevel=qA[qA.indexOf(a)-1],n.resolved=!0),this.warn(`Restricting playback to HDCP-LEVEL of "${r.maxHdcpLevel}" or lower`);break}n.resolved||this.switchLevel(e,s)}switchLevel(e,r){r!==void 0&&e.errorAction&&(this.warn(`switching to level ${r} after ${e.details}`),this.hls.nextAutoLevel=r,e.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel)}redundantFailover(e){const{hls:r,penalizedRenditions:n}=this,i=e.parent===xe.MAIN?e.level:r.loadLevel,a=r.levels[i],s=a.url.length,o=e.frag?e.frag.urlId:a.urlId;a.urlId===o&&(!e.frag||a.details)&&this.penalizeRendition(a,e);for(let c=1;c{f.urlId=l}),r.nextLoadLevel=i,!0}return!1}penalizeRendition(e,r){const{penalizedRenditions:n}=this,i=n[e.urlId]||{lastErrorPerfMs:0,errors:[],details:void 0};i.lastErrorPerfMs=performance.now(),i.errors.push(r),i.details=e.details,n[e.urlId]=i}}function Bze(t,e,r){if(performance.now()-t.lastErrorPerfMs>Mze)return!0;const n=t.details;if(e.details===q.FRAG_GAP&&n&&e.frag){const i=e.frag.start,a=rp(null,n.fragments,i);if(a&&!a.gap)return!0}if(r&&t.errors.lengthn.targetduration*3)return!0}return!1}class OO{constructor(e,r){this.hls=void 0,this.timer=-1,this.requestScheduled=-1,this.canLoad=!1,this.log=void 0,this.warn=void 0,this.log=G.log.bind(G,`${r}:`),this.warn=G.warn.bind(G,`${r}:`),this.hls=e}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){clearTimeout(this.timer),this.timer=-1}startLoad(){this.canLoad=!0,this.requestScheduled=-1,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(e,r){const n=r==null?void 0:r.renditionReports;if(n){let i=-1;for(let a=0;a=0&&c>r.partTarget&&(o+=1)}return new q5(s,o>=0?o:void 0,o0.No)}}}loadPlaylist(e){this.requestScheduled===-1&&(this.requestScheduled=self.performance.now())}shouldLoadPlaylist(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)}shouldReloadPlaylist(e){return this.timer===-1&&this.requestScheduled===-1&&this.shouldLoadPlaylist(e)}playlistLoaded(e,r,n){const{details:i,stats:a}=r,s=self.performance.now(),o=a.loading.first?Math.max(0,s-a.loading.first):0;if(i.advancedDateTime=Date.now()-o,i.live||n!=null&&n.live){if(i.reloaded(n),n&&this.log(`live playlist ${e} ${i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:"MISSED"}`),n&&i.fragments.length>0&&Aze(n,i),!this.canLoad||!i.live)return;let c,l,u;if(i.canBlockReload&&i.endSN&&i.advanced){const m=this.hls.config.lowLatencyMode,g=i.lastPartSn,y=i.endSN,x=i.lastPartIndex,b=x!==-1,_=g===y,S=m?0:x;b?(l=_?y+1:g,u=_?S:x+1):l=y+1;const w=i.age,R=w+i.ageHeader;let I=Math.min(R-i.partTarget,i.targetduration*1.5);if(I>0){if(n&&I>n.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${n.tuneInGoal} to: ${I} with playlist age: ${i.age}`),I=0;else{const T=Math.floor(I/i.targetduration);if(l+=T,u!==void 0){const C=Math.round(I%i.targetduration/i.partTarget);u+=C}this.log(`CDN Tune-in age: ${i.ageHeader}s last advanced ${w.toFixed(2)}s goal: ${I} skip sn ${T} to part ${u}`)}i.tuneInGoal=I}if(c=this.getDeliveryDirectives(i,r.deliveryDirectives,l,u),m||!_){this.loadPlaylist(c);return}}else i.canBlockReload&&(c=this.getDeliveryDirectives(i,r.deliveryDirectives,l,u));const f=this.hls.mainForwardBufferInfo,d=f?f.end-f.len:0,h=(i.edge-d)*1e3,p=kze(i,h);i.updated&&s>this.requestScheduled+p&&(this.requestScheduled=a.loading.start),l!==void 0&&i.canBlockReload?this.requestScheduled=a.loading.first+p-(i.partTarget*1e3||1e3):this.requestScheduled===-1||this.requestScheduled+pthis.loadPlaylist(c),v)}else this.clearTimer()}getDeliveryDirectives(e,r,n,i){let a=Rze(e,n);return r!=null&&r.skip&&e.deltaUpdateFailed&&(n=r.msn,i=r.part,a=o0.No),new q5(n,i,a)}checkRetry(e){const r=e.details,n=P1(e),i=e.errorAction,{action:a,retryCount:s=0,retryConfig:o}=i||{},c=a===zr.RetryRequest&&!!i&&!!o;if(c){var l;if(this.requestScheduled=-1,n&&(l=e.context)!=null&&l.deliveryDirectives)this.warn(`Retrying playlist loading ${s+1}/${o.maxNumRetry} after "${r}" without delivery-directives`),this.loadPlaylist();else{const u=kO(o,s);this.timer=self.setTimeout(()=>this.loadPlaylist(),u),this.warn(`Retrying playlist loading ${s+1}/${o.maxNumRetry} after "${r}" in ${u}ms`)}e.levelRetry=!0,i.resolved=!0}return c}}let uT;class Uze extends OO{constructor(e,r){super(e,"[level-controller]"),this._levels=[],this._firstLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=r,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on($.MANIFEST_LOADING,this.onManifestLoading,this),e.on($.MANIFEST_LOADED,this.onManifestLoaded,this),e.on($.LEVEL_LOADED,this.onLevelLoaded,this),e.on($.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on($.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on($.FRAG_LOADED,this.onFragLoaded,this),e.on($.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off($.MANIFEST_LOADING,this.onManifestLoading,this),e.off($.MANIFEST_LOADED,this.onManifestLoaded,this),e.off($.LEVEL_LOADED,this.onLevelLoaded,this),e.off($.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off($.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off($.FRAG_LOADED,this.onFragLoaded,this),e.off($.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}startLoad(){this._levels.forEach(r=>{r.loadError=0,r.fragmentError=0}),super.startLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[]}onManifestLoading(e,r){this.resetLevels()}onManifestLoaded(e,r){const n=[],i={};let a;r.levels.forEach(s=>{var o;const c=s.attrs;((o=s.audioCodec)==null?void 0:o.indexOf("mp4a.40.34"))!==-1&&(uT||(uT=/chrome|firefox/i.test(navigator.userAgent)),uT&&(s.audioCodec=void 0));const{AUDIO:l,CODECS:u,"FRAME-RATE":f,"PATHWAY-ID":d,RESOLUTION:h,SUBTITLES:p}=c,m=`${`${d||"."}-`}${s.bitrate}-${h}-${f}-${u}`;a=i[m],a?a.addFallback(s):(a=new tp(s),i[m]=a,n.push(a)),D1(a,"audio",l),D1(a,"text",p)}),this.filterAndSortMediaOptions(n,r)}filterAndSortMediaOptions(e,r){let n=[],i=[],a=!1,s=!1,o=!1,c=e.filter(({audioCodec:h,videoCodec:p,width:v,height:m,unknownCodecs:g})=>(a||(a=!!(v&&m)),s||(s=!!p),o||(o=!!h),!(g!=null&&g.length)&&(!h||sT(h,"audio"))&&(!p||sT(p,"video"))));if((a||s)&&o&&(c=c.filter(({videoCodec:h,width:p,height:v})=>!!h||!!(p&&v))),c.length===0){Promise.resolve().then(()=>{if(this.hls){const h=new Error("no level with compatible codecs found in manifest");this.hls.trigger($.ERROR,{type:ye.MEDIA_ERROR,details:q.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:r.url,error:h,reason:h.message})}});return}r.audioTracks&&(n=r.audioTracks.filter(h=>!h.audioCodec||sT(h.audioCodec,"audio")),J5(n)),r.subtitles&&(i=r.subtitles,J5(i));const l=c.slice(0);c.sort((h,p)=>h.attrs["HDCP-LEVEL"]!==p.attrs["HDCP-LEVEL"]?(h.attrs["HDCP-LEVEL"]||"")>(p.attrs["HDCP-LEVEL"]||"")?1:-1:h.bitrate!==p.bitrate?h.bitrate-p.bitrate:h.attrs["FRAME-RATE"]!==p.attrs["FRAME-RATE"]?h.attrs.decimalFloatingPoint("FRAME-RATE")-p.attrs.decimalFloatingPoint("FRAME-RATE"):h.attrs.SCORE!==p.attrs.SCORE?h.attrs.decimalFloatingPoint("SCORE")-p.attrs.decimalFloatingPoint("SCORE"):a&&h.height!==p.height?h.height-p.height:0);let u=l[0];if(this.steering&&(c=this.steering.filterParsedLevels(c),c.length!==l.length)){for(let h=0;h!!h.url)};this.hls.trigger($.MANIFEST_PARSED,d),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}get levels(){return this._levels.length===0?null:this._levels}get level(){return this.currentLevelIndex}set level(e){const r=this._levels;if(r.length===0)return;if(e<0||e>=r.length){const u=new Error("invalid level idx"),f=e<0;if(this.hls.trigger($.ERROR,{type:ye.OTHER_ERROR,details:q.LEVEL_SWITCH_ERROR,level:e,fatal:f,error:u,reason:u.message}),f)return;e=Math.min(e,r.length-1)}const n=this.currentLevelIndex,i=this.currentLevel,a=i?i.attrs["PATHWAY-ID"]:void 0,s=r[e],o=s.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=s,n===e&&s.details&&i&&a===o)return;this.log(`Switching to level ${e}${o?" with Pathway "+o:""} from level ${n}${a?" with Pathway "+a:""}`);const c=Pt({},s,{level:e,maxBitrate:s.maxBitrate,attrs:s.attrs,uri:s.uri,urlId:s.urlId});delete c._attrs,delete c._urlId,this.hls.trigger($.LEVEL_SWITCHING,c);const l=s.details;if(!l||l.live){const u=this.switchParams(s.uri,i==null?void 0:i.details);this.loadPlaylist(u)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(e){this.manualLevelIndex=e,this._startLevel===void 0&&(this._startLevel=e),e!==-1&&(this.level=e)}get firstLevel(){return this._firstLevel}set firstLevel(e){this._firstLevel=e}get startLevel(){if(this._startLevel===void 0){const e=this.hls.config.startLevel;return e!==void 0?e:this._firstLevel}else return this._startLevel}set startLevel(e){this._startLevel=e}onError(e,r){r.fatal||!r.context||r.context.type===He.LEVEL&&r.context.level===this.level&&this.checkRetry(r)}onFragLoaded(e,{frag:r}){if(r!==void 0&&r.type===xe.MAIN){const n=this._levels[r.level];n!==void 0&&(n.loadError=0)}}onLevelLoaded(e,r){var n;const{level:i,details:a}=r,s=this._levels[i];if(!s){var o;this.warn(`Invalid level index ${i}`),(o=r.deliveryDirectives)!=null&&o.skip&&(a.deltaUpdateFailed=!0);return}i===this.currentLevelIndex?(s.fragmentError===0&&(s.loadError=0),this.playlistLoaded(i,r,s.details)):(n=r.deliveryDirectives)!=null&&n.skip&&(a.deltaUpdateFailed=!0)}onAudioTrackSwitched(e,r){const n=this.currentLevel;if(!n)return;const i=this.hls.audioTracks[r.id].groupId;if(n.audioGroupIds&&n.audioGroupId!==i){let a=-1;for(let s=0;ss!==r,i=this._levels.filter((a,s)=>s!==e?!0:a.url.length>1&&r!==void 0?(a.url=a.url.filter(n),a.audioGroupIds&&(a.audioGroupIds=a.audioGroupIds.filter(n)),a.textGroupIds&&(a.textGroupIds=a.textGroupIds.filter(n)),a.urlId=0,!0):(this.steering&&this.steering.removeLevel(a),!1));this.hls.trigger($.LEVELS_UPDATED,{levels:i})}onLevelsUpdated(e,{levels:r}){r.forEach((n,i)=>{const{details:a}=n;a!=null&&a.fragments&&a.fragments.forEach(s=>{s.level=i})}),this._levels=r}}function D1(t,e,r){r&&(e==="audio"?(t.audioGroupIds||(t.audioGroupIds=[]),t.audioGroupIds[t.url.length-1]=r):e==="text"&&(t.textGroupIds||(t.textGroupIds=[]),t.textGroupIds[t.url.length-1]=r))}function J5(t){const e={};t.forEach(r=>{const n=r.groupId||"";r.id=e[n]=e[n]||0,e[n]++})}var Tr={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class jze{constructor(e){this.mainFragEntity=null,this.activeParts=null,this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=e,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on($.BUFFER_APPENDED,this.onBufferAppended,this),e.on($.FRAG_BUFFERED,this.onFragBuffered,this),e.on($.FRAG_LOADED,this.onFragLoaded,this)}_unregisterListeners(){const{hls:e}=this;e.off($.BUFFER_APPENDED,this.onBufferAppended,this),e.off($.FRAG_BUFFERED,this.onFragBuffered,this),e.off($.FRAG_LOADED,this.onFragLoaded,this)}destroy(){this._unregisterListeners(),this.fragments=this.endListFragments=this.timeRanges=this.mainFragEntity=this.activeParts=null}getAppendedFrag(e,r){if(r===xe.MAIN){const{mainFragEntity:n,activeParts:i}=this;if(n){if(n&&i)for(let a=i.length;a--;){const s=i[a],o=s?s.end:n.appendedPTS;if(s.start<=e&&o!==null&&e<=o)return a>9&&(this.activeParts=i.slice(a-9)),s}else if(n.body.start<=e&&n.appendedPTS!==null&&e<=n.appendedPTS)return n.body}}return this.getBufferedFrag(e,r)}getBufferedFrag(e,r){const{fragments:n}=this,i=Object.keys(n);for(let a=i.length;a--;){const s=n[i[a]];if((s==null?void 0:s.body.type)===r&&s.buffered){const o=s.body;if(o.start<=e&&e<=o.end)return o}}return null}detectEvictedFragments(e,r,n){this.timeRanges&&(this.timeRanges[e]=r),Object.keys(this.fragments).forEach(i=>{const a=this.fragments[i];if(!a)return;if(!a.buffered&&!a.loaded){a.body.type===n&&this.removeFragment(a.body);return}const s=a.range[e];s&&s.time.some(o=>{const c=!this.isTimeBuffered(o.startPTS,o.endPTS,r);return c&&this.removeFragment(a.body),c})})}detectPartialFragments(e){const r=this.timeRanges,{frag:n,part:i}=e;if(!r||n.sn==="initSegment")return;const a=Ms(n),s=this.fragments[a];s&&(Object.keys(r).forEach(o=>{const c=n.elementaryStreams[o];if(!c)return;const l=r[o],u=i!==null||c.partial===!0;s.range[o]=this.getBufferedTimes(n,i,u,l)}),s.loaded=null,Object.keys(s.range).length?(s.buffered=!0,s.body.endList&&(this.endListFragments[s.body.type]=s)):this.removeFragment(s.body))}fragBuffered(e,r){const n=Ms(e);let i=this.fragments[n];!i&&r&&(i=this.fragments[n]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),i&&(i.loaded=null,i.buffered=!0)}getBufferedTimes(e,r,n,i){const a={time:[],partial:n},s=r?r.start:e.start,o=r?r.end:e.end,c=e.minEndPTS||o,l=e.maxStartPTS||s;for(let u=0;u=f&&c<=d){a.time.push({startPTS:Math.max(s,i.start(u)),endPTS:Math.min(o,i.end(u))});break}else if(sf)a.partial=!0,a.time.push({startPTS:Math.max(s,i.start(u)),endPTS:Math.min(o,i.end(u))});else if(o<=f)break}return a}getPartialFragment(e){let r=null,n,i,a,s=0;const{bufferPadding:o,fragments:c}=this;return Object.keys(c).forEach(l=>{const u=c[l];u&&fT(u)&&(i=u.body.start-o,a=u.body.end+o,e>=i&&e<=a&&(n=Math.min(e-i,a-e),s<=n&&(r=u.body,s=n)))}),r}isEndListAppended(e){const r=this.endListFragments[e];return r!==void 0&&(r.buffered||fT(r))}getState(e){const r=Ms(e),n=this.fragments[r];return n?n.buffered?fT(n)?Tr.PARTIAL:Tr.OK:Tr.APPENDING:Tr.NOT_LOADED}isTimeBuffered(e,r,n){let i,a;for(let s=0;s=i&&r<=a)return!0;if(r<=i)return!1}return!1}onFragLoaded(e,r){const{frag:n,part:i}=r;if(n.sn==="initSegment"||n.bitrateTest||i)return;const a=Ms(n);this.fragments[a]={body:n,appendedPTS:null,loaded:r,buffered:!1,range:Object.create(null)}}onBufferAppended(e,r){const{frag:n,part:i,timeRanges:a}=r;let s=this.mainFragEntity;if(n.type===xe.MAIN){const o=s?s.body:null;if(o!==n){s&&o&&o.sn!==n.sn&&(s.buffered=!0,this.fragments[Ms(o)]=s);const c=Ms(n);s=this.mainFragEntity=this.fragments[c]||{body:n,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)}}if(i){let c=this.activeParts;c||(this.activeParts=c=[]),c.push(i)}else this.activeParts=null}this.timeRanges=a,Object.keys(a).forEach(o=>{const c=a[o];if(this.detectEvictedFragments(o,c),!i&&s){const l=n.elementaryStreams[o];if(!l)return;for(let u=0;ul.startPTS?s.appendedPTS=Math.max(f,s.appendedPTS||0):s.appendedPTS=l.endPTS}}})}onFragBuffered(e,r){this.detectPartialFragments(r)}hasFragment(e){const r=Ms(e);return!!this.fragments[r]}removeFragmentsInRange(e,r,n,i,a){i&&!this.hasGaps||Object.keys(this.fragments).forEach(s=>{const o=this.fragments[s];if(!o)return;const c=o.body;c.type!==n||i&&!c.gap||c.starte&&(o.buffered||a)&&this.removeFragment(c)})}removeFragment(e){const r=Ms(e);e.stats.loaded=0,e.clearElementaryStreamInfo(),this.mainFragEntity===this.fragments[r]&&(this.mainFragEntity=null),delete this.fragments[r],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.mainFragEntity=null,this.activeParts=null,this.hasGaps=!1}}function fT(t){var e,r;return t.buffered&&(t.body.gap||((e=t.range.video)==null?void 0:e.partial)||((r=t.range.audio)==null?void 0:r.partial))}function Ms(t){return`${t.type}_${t.level}_${t.urlId}_${t.sn}`}const eB=Math.pow(2,17);class Hze{constructor(e){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=e}destroy(){this.loader&&(this.loader.destroy(),this.loader=null)}abort(){this.loader&&this.loader.abort()}load(e,r){const n=e.url;if(!n)return Promise.reject(new Ua({type:ye.NETWORK_ERROR,details:q.FRAG_LOAD_ERROR,fatal:!1,frag:e,error:new Error(`Fragment does not have a ${n?"part list":"url"}`),networkDetails:null}));this.abort();const i=this.config,a=i.fLoader,s=i.loader;return new Promise((o,c)=>{if(this.loader&&this.loader.destroy(),e.gap){c(rB(e));return}const l=this.loader=e.loader=a?new a(i):new s(i),u=tB(e),f=Z5(i.fragLoadPolicy.default),d={loadPolicy:f,timeout:f.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:e.sn==="initSegment"?1/0:eB};e.stats=l.stats,l.load(u,d,{onSuccess:(h,p,v,m)=>{this.resetLoader(e,l);let g=h.data;v.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(g.slice(0,16)),g=g.slice(16)),o({frag:e,part:null,payload:g,networkDetails:m})},onError:(h,p,v,m)=>{this.resetLoader(e,l),c(new Ua({type:ye.NETWORK_ERROR,details:q.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:sn({url:n,data:void 0},h),error:new Error(`HTTP Error ${h.code} ${h.text}`),networkDetails:v,stats:m}))},onAbort:(h,p,v)=>{this.resetLoader(e,l),c(new Ua({type:ye.NETWORK_ERROR,details:q.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:v,stats:h}))},onTimeout:(h,p,v)=>{this.resetLoader(e,l),c(new Ua({type:ye.NETWORK_ERROR,details:q.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${d.timeout}ms`),networkDetails:v,stats:h}))},onProgress:(h,p,v,m)=>{r&&r({frag:e,part:null,payload:v,networkDetails:m})}})})}loadPart(e,r,n){this.abort();const i=this.config,a=i.fLoader,s=i.loader;return new Promise((o,c)=>{if(this.loader&&this.loader.destroy(),e.gap||r.gap){c(rB(e,r));return}const l=this.loader=e.loader=a?new a(i):new s(i),u=tB(e,r),f=Z5(i.fragLoadPolicy.default),d={loadPolicy:f,timeout:f.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:eB};r.stats=l.stats,l.load(u,d,{onSuccess:(h,p,v,m)=>{this.resetLoader(e,l),this.updateStatsFromPart(e,r);const g={frag:e,part:r,payload:h.data,networkDetails:m};n(g),o(g)},onError:(h,p,v,m)=>{this.resetLoader(e,l),c(new Ua({type:ye.NETWORK_ERROR,details:q.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:r,response:sn({url:u.url,data:void 0},h),error:new Error(`HTTP Error ${h.code} ${h.text}`),networkDetails:v,stats:m}))},onAbort:(h,p,v)=>{e.stats.aborted=r.stats.aborted,this.resetLoader(e,l),c(new Ua({type:ye.NETWORK_ERROR,details:q.INTERNAL_ABORTED,fatal:!1,frag:e,part:r,error:new Error("Aborted"),networkDetails:v,stats:h}))},onTimeout:(h,p,v)=>{this.resetLoader(e,l),c(new Ua({type:ye.NETWORK_ERROR,details:q.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:r,error:new Error(`Timeout after ${d.timeout}ms`),networkDetails:v,stats:h}))}})})}updateStatsFromPart(e,r){const n=e.stats,i=r.stats,a=i.total;if(n.loaded+=i.loaded,a){const c=Math.round(e.duration/r.duration),l=Math.min(Math.round(n.loaded/a),c),f=(c-l)*Math.round(n.loaded/l);n.total=n.loaded+f}else n.total=Math.max(n.loaded,n.total);const s=n.loading,o=i.loading;s.start?s.first+=o.first-o.start:(s.start=o.start,s.first=o.first),s.end=o.end}resetLoader(e,r){e.loader=null,this.loader===r&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),r.destroy()}}function tB(t,e=null){const r=e||t,n={frag:t,part:e,responseType:"arraybuffer",url:r.url,headers:{},rangeStart:0,rangeEnd:0},i=r.byteRangeStartOffset,a=r.byteRangeEndOffset;if(me(i)&&me(a)){var s;let o=i,c=a;if(t.sn==="initSegment"&&((s=t.decryptdata)==null?void 0:s.method)==="AES-128"){const l=a-i;l%16&&(c=a+(16-l%16)),i!==0&&(n.resetIV=!0,o=i-16)}n.rangeStart=o,n.rangeEnd=c}return n}function rB(t,e){const r=new Error(`GAP ${t.gap?"tag":"attribute"} found`),n={type:ye.MEDIA_ERROR,details:q.FRAG_GAP,fatal:!1,frag:t,error:r,networkDetails:null};return e&&(n.part=e),(e||t).stats.aborted=!0,new Ua(n)}class Ua extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class zze{constructor(e){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=e}abort(){for(const e in this.keyUriToKeyInfo){const r=this.keyUriToKeyInfo[e].loader;r&&r.abort()}}detach(){for(const e in this.keyUriToKeyInfo){const r=this.keyUriToKeyInfo[e];(r.mediaKeySessionContext||r.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyUriToKeyInfo){const r=this.keyUriToKeyInfo[e].loader;r&&r.destroy()}this.keyUriToKeyInfo={}}createKeyLoadError(e,r=q.KEY_LOAD_ERROR,n,i,a){return new Ua({type:ye.NETWORK_ERROR,details:r,fatal:!1,frag:e,response:a,error:n,networkDetails:i})}loadClear(e,r){if(this.emeController&&this.config.emeEnabled){const{sn:n,cc:i}=e;for(let a=0;a{s.setKeyFormat(o)});break}}}}load(e){return!e.decryptdata&&e.encrypted&&this.emeController?this.emeController.selectKeySystemFormat(e).then(r=>this.loadInternal(e,r)):this.loadInternal(e)}loadInternal(e,r){var n,i;r&&e.setKeyFormat(r);const a=e.decryptdata;if(!a){const l=new Error(r?`Expected frag.decryptdata to be defined after setting format ${r}`:"Missing decryption data on fragment in onKeyLoading");return Promise.reject(this.createKeyLoadError(e,q.KEY_LOAD_ERROR,l))}const s=a.uri;if(!s)return Promise.reject(this.createKeyLoadError(e,q.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${s}"`)));let o=this.keyUriToKeyInfo[s];if((n=o)!=null&&n.decryptdata.key)return a.key=o.decryptdata.key,Promise.resolve({frag:e,keyInfo:o});if((i=o)!=null&&i.keyLoadPromise){var c;switch((c=o.mediaKeySessionContext)==null?void 0:c.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return o.keyLoadPromise.then(l=>(a.key=l.keyInfo.decryptdata.key,{frag:e,keyInfo:o}))}}switch(o=this.keyUriToKeyInfo[s]={decryptdata:a,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},a.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return a.keyFormat==="identity"?this.loadKeyHTTP(o,e):this.loadKeyEME(o,e);case"AES-128":return this.loadKeyHTTP(o,e);default:return Promise.reject(this.createKeyLoadError(e,q.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${a.method}"`)))}}loadKeyEME(e,r){const n={frag:r,keyInfo:e};if(this.emeController&&this.config.emeEnabled){const i=this.emeController.loadKey(n);if(i)return(e.keyLoadPromise=i.then(a=>(e.mediaKeySessionContext=a,n))).catch(a=>{throw e.keyLoadPromise=null,a})}return Promise.resolve(n)}loadKeyHTTP(e,r){const n=this.config,i=n.loader,a=new i(n);return r.keyLoader=e.loader=a,e.keyLoadPromise=new Promise((s,o)=>{const c={keyInfo:e,frag:r,responseType:"arraybuffer",url:e.decryptdata.uri},l=n.keyLoadPolicy.default,u={loadPolicy:l,timeout:l.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},f={onSuccess:(d,h,p,v)=>{const{frag:m,keyInfo:g,url:y}=p;if(!m.decryptdata||g!==this.keyUriToKeyInfo[y])return o(this.createKeyLoadError(m,q.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),v));g.decryptdata.key=m.decryptdata.key=new Uint8Array(d.data),m.keyLoader=null,g.loader=null,s({frag:m,keyInfo:g})},onError:(d,h,p,v)=>{this.resetLoader(h),o(this.createKeyLoadError(r,q.KEY_LOAD_ERROR,new Error(`HTTP Error ${d.code} loading key ${d.text}`),p,sn({url:c.url,data:void 0},d)))},onTimeout:(d,h,p)=>{this.resetLoader(h),o(this.createKeyLoadError(r,q.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),p))},onAbort:(d,h,p)=>{this.resetLoader(h),o(this.createKeyLoadError(r,q.INTERNAL_ABORTED,new Error("key loading aborted"),p))}};a.load(c,u,f)})}resetLoader(e){const{frag:r,keyInfo:n,url:i}=e,a=n.loader;r.keyLoader===a&&(r.keyLoader=null,n.loader=null),delete this.keyUriToKeyInfo[i],a&&a.destroy()}}class Gze{constructor(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}destroy(){this.onHandlerDestroying(),this.onHandlerDestroyed()}onHandlerDestroying(){this.clearNextTick(),this.clearInterval()}onHandlerDestroyed(){}hasInterval(){return!!this._tickInterval}hasNextTick(){return!!this._tickTimer}setInterval(e){return this._tickInterval?!1:(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,e),!0)}clearInterval(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1}clearNextTick(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1}tick(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}const Vze={length:0,start:()=>0,end:()=>0};class ct{static isBuffered(e,r){try{if(e){const n=ct.getBuffered(e);for(let i=0;i=n.start(i)&&r<=n.end(i))return!0}}catch{}return!1}static bufferInfo(e,r,n){try{if(e){const i=ct.getBuffered(e),a=[];let s;for(s=0;sf&&(i[u-1].end=e[l].end):i.push(e[l])}else i.push(e[l])}else i=e;let a=0,s,o=r,c=r;for(let l=0;l=u&&rr.startCC||t&&t.cc>>8^g&255^99,e[p]=g,r[g]=p;const y=h[p],x=h[y],b=h[x];let _=h[g]*257^g*16843008;i[p]=_<<24|_>>>8,a[p]=_<<16|_>>>16,s[p]=_<<8|_>>>24,o[p]=_,_=b*16843009^x*65537^y*257^p*16843008,l[g]=_<<24|_>>>8,u[g]=_<<16|_>>>16,f[g]=_<<8|_>>>24,d[g]=_,p?(p=y^h[h[h[b^y]]],v^=h[h[v]]):p=v=1}}expandKey(e){const r=this.uint8ArrayToUint32Array_(e);let n=!0,i=0;for(;ii?(this.logOnce("WebCrypto AES decrypt"),new Qze(i,new Uint8Array(n)).decrypt(e.buffer,a)):Promise.reject(new Error("web crypto not initialized"))).catch(a=>(G.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${a.name}: ${a.message}`),this.onWebCryptoError(e,r,n)))}onWebCryptoError(e,r,n){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,r,n);const i=this.flush();if(i)return i.buffer;throw new Error("WebCrypto and softwareDecrypt: failed to decrypt data")}getValidChunk(e){let r=e;const n=e.length-e.length%tGe;return n!==e.length&&(r=Hl(e,0,n),this.remainderData=Hl(e,n)),r}logOnce(e){this.logEnabled&&(G.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const rGe={toString:function(t){let e="";const r=t.length;for(let n=0;no.end){const f=s>u;(s{if(this.fragContextChanged(e)){this.warn(`Fragment ${e.sn}${a.part?" p: "+a.part.index:""} of level ${e.level} was dropped during download.`),this.fragmentTracker.removeFragment(e);return}e.stats.chunkCount++,this._handleFragmentLoadProgress(a)};this._doFragLoad(e,r,n,i).then(a=>{if(!a)return;const s=this.state;if(this.fragContextChanged(e)){(s===X.FRAG_LOADING||!this.fragCurrent&&s===X.PARSING)&&(this.fragmentTracker.removeFragment(e),this.state=X.IDLE);return}"payload"in a&&(this.log(`Loaded fragment ${e.sn} of level ${e.level}`),this.hls.trigger($.FRAG_LOADED,a)),this._handleFragmentLoadComplete(a)}).catch(a=>{this.state===X.STOPPED||this.state===X.ERROR||(this.warn(a),this.resetFragmentLoading(e))})}clearTrackerIfNeeded(e){var r;if(this.fragmentTracker.getState(e)===Tr.APPENDING){const i=e.type,a=this.getFwdBufferInfo(this.mediaBuffer,i),s=Math.max(e.duration,a?a.len:this.config.maxBufferLength);this.reduceMaxBufferLength(s)&&this.fragmentTracker.removeFragment(e)}else((r=this.mediaBuffer)==null?void 0:r.buffered.length)===0&&this.fragmentTracker.removeAllFragments()}flushMainBuffer(e,r,n=null){if(!(e-r))return;const i={startOffset:e,endOffset:r,type:n};this.hls.trigger($.BUFFER_FLUSHING,i)}_loadInitSegment(e,r){this._doFragLoad(e,r).then(n=>{if(!n||this.fragContextChanged(e)||!this.levels)throw new Error("init load aborted");return n}).then(n=>{const{hls:i}=this,{payload:a}=n,s=e.decryptdata;if(a&&a.byteLength>0&&s&&s.key&&s.iv&&s.method==="AES-128"){const o=self.performance.now();return this.decrypter.decrypt(new Uint8Array(a),s.key.buffer,s.iv.buffer).catch(c=>{throw i.trigger($.ERROR,{type:ye.MEDIA_ERROR,details:q.FRAG_DECRYPT_ERROR,fatal:!1,error:c,reason:c.message,frag:e}),c}).then(c=>{const l=self.performance.now();return i.trigger($.FRAG_DECRYPTED,{frag:e,payload:c,stats:{tstart:o,tdecrypt:l}}),n.payload=c,n})}return n}).then(n=>{const{fragCurrent:i,hls:a,levels:s}=this;if(!s)throw new Error("init load aborted, missing levels");const o=e.stats;this.state=X.IDLE,r.fragmentError=0,e.data=new Uint8Array(n.payload),o.parsing.start=o.buffering.start=self.performance.now(),o.parsing.end=o.buffering.end=self.performance.now(),n.frag===i&&a.trigger($.FRAG_BUFFERED,{stats:o,frag:i,part:null,id:e.type}),this.tick()}).catch(n=>{this.state===X.STOPPED||this.state===X.ERROR||(this.warn(n),this.resetFragmentLoading(e))})}fragContextChanged(e){const{fragCurrent:r}=this;return!e||!r||e.level!==r.level||e.sn!==r.sn||e.urlId!==r.urlId}fragBufferedComplete(e,r){var n,i,a,s;const o=this.mediaBuffer?this.mediaBuffer:this.media;this.log(`Buffered ${e.type} sn: ${e.sn}${r?" part: "+r.index:""} of ${this.logPrefix==="[stream-controller]"?"level":"track"} ${e.level} (frag:[${((n=e.startPTS)!=null?n:NaN).toFixed(3)}-${((i=e.endPTS)!=null?i:NaN).toFixed(3)}] > buffer:${o?rGe.toString(ct.getBuffered(o)):"(detached)"})`),this.state=X.IDLE,o&&(!this.loadedmetadata&&e.type==xe.MAIN&&o.buffered.length&&((a=this.fragCurrent)==null?void 0:a.sn)===((s=this.fragPrevious)==null?void 0:s.sn)&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick())}seekToStartPos(){}_handleFragmentLoadComplete(e){const{transmuxer:r}=this;if(!r)return;const{frag:n,part:i,partsLoaded:a}=e,s=!a||a.length===0||a.some(c=>!c),o=new LO(n.level,n.sn,n.stats.chunkCount+1,0,i?i.index:-1,!s);r.flush(o)}_handleFragmentLoadProgress(e){}_doFragLoad(e,r,n=null,i){var a;const s=r==null?void 0:r.details;if(!this.levels||!s)throw new Error(`frag load aborted, missing level${s?"":" detail"}s`);let o=null;if(e.encrypted&&!((a=e.decryptdata)!=null&&a.key)?(this.log(`Loading key for ${e.sn} of [${s.startSN}-${s.endSN}], ${this.logPrefix==="[stream-controller]"?"level":"track"} ${e.level}`),this.state=X.KEY_LOADING,this.fragCurrent=e,o=this.keyLoader.load(e).then(u=>{if(!this.fragContextChanged(u.frag))return this.hls.trigger($.KEY_LOADED,u),this.state===X.KEY_LOADING&&(this.state=X.IDLE),u}),this.hls.trigger($.KEY_LOADING,{frag:e}),this.fragCurrent===null&&(o=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))):!e.encrypted&&s.encryptedFragments.length&&this.keyLoader.loadClear(e,s.encryptedFragments),n=Math.max(e.start,n||0),this.config.lowLatencyMode){const u=s.partList;if(u&&i){n>e.end&&s.fragmentHint&&(e=s.fragmentHint);const f=this.getNextPart(u,e,n);if(f>-1){const d=u[f];this.log(`Loading part sn: ${e.sn} p: ${d.index} cc: ${e.cc} of playlist [${s.startSN}-${s.endSN}] parts [0-${f}-${u.length-1}] ${this.logPrefix==="[stream-controller]"?"level":"track"}: ${e.level}, target: ${parseFloat(n.toFixed(3))}`),this.nextLoadPosition=d.start+d.duration,this.state=X.FRAG_LOADING;let h;return o?h=o.then(p=>!p||this.fragContextChanged(p.frag)?null:this.doFragPartsLoad(e,d,r,i)).catch(p=>this.handleFragLoadError(p)):h=this.doFragPartsLoad(e,d,r,i).catch(p=>this.handleFragLoadError(p)),this.hls.trigger($.FRAG_LOADING,{frag:e,part:d,targetBufferTime:n}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):h}else if(!e.url||this.loadedEndOfParts(u,n))return Promise.resolve(null)}}this.log(`Loading fragment ${e.sn} cc: ${e.cc} ${s?"of ["+s.startSN+"-"+s.endSN+"] ":""}${this.logPrefix==="[stream-controller]"?"level":"track"}: ${e.level}, target: ${parseFloat(n.toFixed(3))}`),me(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=X.FRAG_LOADING;const c=this.config.progressive;let l;return c&&o?l=o.then(u=>!u||this.fragContextChanged(u==null?void 0:u.frag)?null:this.fragmentLoader.load(e,i)).catch(u=>this.handleFragLoadError(u)):l=Promise.all([this.fragmentLoader.load(e,c?i:void 0),o]).then(([u])=>(!c&&u&&i&&i(u),u)).catch(u=>this.handleFragLoadError(u)),this.hls.trigger($.FRAG_LOADING,{frag:e,targetBufferTime:n}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):l}doFragPartsLoad(e,r,n,i){return new Promise((a,s)=>{var o;const c=[],l=(o=n.details)==null?void 0:o.partList,u=f=>{this.fragmentLoader.loadPart(e,f,i).then(d=>{c[f.index]=d;const h=d.part;this.hls.trigger($.FRAG_LOADED,d);const p=X5(n,e.sn,f.index+1)||PQ(l,e.sn,f.index+1);if(p)u(p);else return a({frag:e,part:h,partsLoaded:c})}).catch(s)};u(r)})}handleFragLoadError(e){if("data"in e){const r=e.data;e.data&&r.details===q.INTERNAL_ABORTED?this.handleFragLoadAborted(r.frag,r.part):this.hls.trigger($.ERROR,r)}else this.hls.trigger($.ERROR,{type:ye.OTHER_ERROR,details:q.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const r=this.getCurrentContext(e);if(!r||this.state!==X.PARSING){!this.fragCurrent&&this.state!==X.STOPPED&&this.state!==X.ERROR&&(this.state=X.IDLE);return}const{frag:n,part:i,level:a}=r,s=self.performance.now();n.stats.parsing.end=s,i&&(i.stats.parsing.end=s),this.updateLevelTiming(n,i,a,e.partial)}getCurrentContext(e){const{levels:r,fragCurrent:n}=this,{level:i,sn:a,part:s}=e;if(!(r!=null&&r[i]))return this.warn(`Levels object was unset while buffering fragment ${a} of level ${i}. The current chunk will not be buffered.`),null;const o=r[i],c=s>-1?X5(o,a,s):null,l=c?c.fragment:Oze(o,a,n);return l?(n&&n!==l&&(l.stats=n.stats),{frag:l,part:c,level:o}):null}bufferFragmentData(e,r,n,i){var a;if(!e||this.state!==X.PARSING)return;const{data1:s,data2:o}=e;let c=s;if(s&&o&&(c=rc(s,o)),!((a=c)!=null&&a.length))return;const l={type:e.type,frag:r,part:n,chunkMeta:i,parent:r.type,data:c};this.hls.trigger($.BUFFER_APPENDING,l),e.dropped&&e.independent&&!n&&this.flushBufferGap(r)}flushBufferGap(e){const r=this.media;if(!r)return;if(!ct.isBuffered(r,r.currentTime)){this.flushMainBuffer(0,e.start);return}const n=r.currentTime,i=ct.bufferInfo(r,n,0),a=e.duration,s=Math.min(this.config.maxFragLookUpTolerance*2,a*.25),o=Math.max(Math.min(e.start-s,i.end-s),n+s);e.start-o>s&&this.flushMainBuffer(o,e.start)}getFwdBufferInfo(e,r){const n=this.getLoadPosition();return me(n)?this.getFwdBufferInfoAtPos(e,n,r):null}getFwdBufferInfoAtPos(e,r,n){const{config:{maxBufferHole:i}}=this,a=ct.bufferInfo(e,r,i);if(a.len===0&&a.nextStart!==void 0){const s=this.fragmentTracker.getBufferedFrag(r,n);if(s&&a.nextStart=n?(r.maxMaxBufferLength/=2,this.warn(`Reduce max buffer length to ${r.maxMaxBufferLength}s`),!0):!1}getNextFragment(e,r){const n=r.fragments,i=n.length;if(!i)return null;const{config:a}=this,s=n[0].start;let o;if(r.live){const c=a.initialLiveManifestSize;if(ir}getNextFragmentLoopLoading(e,r,n,i,a){const s=e.gap,o=this.getNextFragment(this.nextLoadPosition,r);if(o===null)return o;if(e=o,s&&e&&!e.gap&&n.nextStart){const c=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,n.nextStart,i);if(c!==null&&n.len+c.len>=a)return this.log(`buffer full after gaps in "${i}" playlist starting at sn: ${e.sn}`),null}return e}mapToInitFragWhenRequired(e){return e!=null&&e.initSegment&&!(e!=null&&e.initSegment.data)&&!this.bitrateTest?e.initSegment:e}getNextPart(e,r,n){let i=-1,a=!1,s=!0;for(let o=0,c=e.length;o-1&&nn.start&&n.loaded}getInitialLiveFragment(e,r){const n=this.fragPrevious;let i=null;if(n){if(e.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${n.programDateTime}`),i=Pze(r,n.endProgramDateTime,this.config.maxFragLookUpTolerance)),!i){const a=n.sn+1;if(a>=e.startSN&&a<=e.endSN){const s=r[a-e.startSN];n.cc===s.cc&&(i=s,this.log(`Live playlist, switching playlist, load frag with next SN: ${i.sn}`))}i||(i=Dze(r,n.cc),i&&this.log(`Live playlist, switching playlist, load frag with same CC: ${i.sn}`))}}else{const a=this.hls.liveSyncPosition;a!==null&&(i=this.getFragmentAtPosition(a,this.bitrateTest?e.fragmentEnd:e.edge,e))}return i}getFragmentAtPosition(e,r,n){const{config:i}=this;let{fragPrevious:a}=this,{fragments:s,endSN:o}=n;const{fragmentHint:c}=n,l=i.maxFragLookUpTolerance,u=!!(i.lowLatencyMode&&n.partList&&c);u&&c&&!this.bitrateTest&&(s=s.concat(c),o=c.sn);let f;if(er-l?0:l;f=rp(a,s,e,d)}else f=s[s.length-1];if(f){const d=f.sn-n.startSN,h=this.fragmentTracker.getState(f);if((h===Tr.OK||h===Tr.PARTIAL&&f.gap)&&(a=f),a&&f.sn===a.sn&&!u&&a&&f.level===a.level){const v=s[d+1];f.sn=s-r.maxFragLookUpTolerance&&a<=o;if(i!==null&&n.duration>i&&(a${e.startSN} prev-sn: ${a?a.sn:"na"} fragments: ${o}`),f}return c}waitForCdnTuneIn(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,e.partTarget*3)}setStartPosition(e,r){let n=this.startPosition;if(n ${(i=this.fragCurrent)==null?void 0:i.url}`);return}const a=r.details===q.FRAG_GAP;a&&this.fragmentTracker.fragBuffered(n,!0);const s=r.errorAction,{action:o,retryCount:c=0,retryConfig:l}=s||{};if(s&&o===zr.RetryRequest&&l){this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition);const u=kO(l,c);this.warn(`Fragment ${n.sn} of ${e} ${n.level} errored with ${r.details}, retrying loading ${c+1}/${l.maxNumRetry} in ${u}ms`),s.resolved=!0,this.retryDate=self.performance.now()+u,this.state=X.FRAG_LOADING_WAITING_RETRY}else l&&s?(this.resetFragmentErrors(e),c.5;i&&this.reduceMaxBufferLength(n.len);const a=!i;return a&&this.warn(`Buffer full error while media.currentTime is not buffered, flush ${r} buffer`),e.frag&&(this.fragmentTracker.removeFragment(e.frag),this.nextLoadPosition=e.frag.start),this.resetLoadingState(),a}return!1}resetFragmentErrors(e){e===xe.AUDIO&&(this.fragCurrent=null),this.loadedmetadata||(this.startFragRequested=!1),this.state!==X.STOPPED&&(this.state=X.IDLE)}afterBufferFlushed(e,r,n){if(!e)return;const i=ct.getBuffered(e);this.fragmentTracker.detectEvictedFragments(r,i,n),this.state===X.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state=X.IDLE}resetStartWhenNotLoaded(e){if(!this.loadedmetadata){this.startFragRequested=!1;const r=this.levels?this.levels[e].details:null;r!=null&&r.live?(this.startPosition=-1,this.setStartPosition(r,0),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(e){this.warn(`The loading context changed while buffering fragment ${e.sn} of level ${e.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(e.level),this.resetLoadingState()}removeUnbufferedFrags(e=0){this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}updateLevelTiming(e,r,n,i){var a;const s=n.details;if(!s){this.warn("level.details undefined");return}if(Object.keys(e.elementaryStreams).reduce((c,l)=>{const u=e.elementaryStreams[l];if(u){const f=u.endPTS-u.startPTS;if(f<=0)return this.warn(`Could not parse fragment ${e.sn} ${l} duration reliably (${f})`),c||!1;const d=i?0:OQ(s,e,u.startPTS,u.endPTS,u.startDTS,u.endDTS);return this.hls.trigger($.LEVEL_PTS_UPDATED,{details:s,level:n,drift:d,type:l,frag:e,start:u.startPTS,end:u.endPTS}),!0}return c},!1))n.fragmentError=0;else if(((a=this.transmuxer)==null?void 0:a.error)===null){const c=new Error(`Found no media in fragment ${e.sn} of level ${n.id} resetting transmuxer to fallback to playlist timing`);if(this.warn(c.message),this.hls.trigger($.ERROR,{type:ye.MEDIA_ERROR,details:q.FRAG_PARSING_ERROR,fatal:!1,error:c,frag:e,reason:`Found no media in msn ${e.sn} of level "${n.url}"`}),!this.hls)return;this.resetTransmuxer()}this.state=X.PARSED,this.hls.trigger($.FRAG_PARSED,{frag:e,part:r})}resetTransmuxer(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)}recoverWorkerError(e){e.event==="demuxerWorker"&&(this.resetTransmuxer(),this.resetLoadingState())}set state(e){const r=this._state;r!==e&&(this._state=e,this.log(`${r}->${e}`))}get state(){return this._state}}function MO(){if(!(typeof self>"u"))return self.MediaSource||self.WebKitMediaSource}function FQ(){return self.SourceBuffer||self.WebKitSourceBuffer}function nGe(){const t=MO();if(!t)return!1;const e=FQ(),r=t&&typeof t.isTypeSupported=="function"&&t.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),n=!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function";return!!r&&!!n}function iGe(){var t;const e=FQ();return typeof(e==null||(t=e.prototype)==null?void 0:t.changeType)=="function"}function aGe(){return typeof __HLS_WORKER_BUNDLE__=="function"}function sGe(){const t=new self.Blob([`var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(${__HLS_WORKER_BUNDLE__.toString()})(true);`],{type:"text/javascript"}),e=self.URL.createObjectURL(t);return{worker:new self.Worker(e),objectURL:e}}function oGe(t){const e=new self.URL(t,self.location.href).href;return{worker:new self.Worker(e),scriptURL:e}}function ta(t="",e=9e4){return{type:t,id:-1,pid:-1,inputTimeScale:e,sequenceNumber:-1,samples:[],dropped:0}}class BQ{constructor(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}resetInitSegment(e,r,n,i){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}}resetTimeStamp(e){this.initPTS=e,this.resetContiguity()}resetContiguity(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0}canParse(e,r){return!1}appendFrame(e,r,n){}demux(e,r){this.cachedData&&(e=rc(this.cachedData,e),this.cachedData=null);let n=O1(e,0),i=n?n.length:0,a;const s=this._audioTrack,o=this._id3Track,c=n?zHe(n):void 0,l=e.length;for((this.basePTS===null||this.frameIndex===0&&me(c))&&(this.basePTS=lGe(c,r,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),n&&n.length>0&&o.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:Si.audioId3,duration:Number.POSITIVE_INFINITY});i{if(me(t))return t*90;const n=r?r.baseTime*9e4/r.timescale:0;return e*9e4+n};function cGe(t,e,r,n){let i,a,s,o;const c=navigator.userAgent.toLowerCase(),l=n,u=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];i=((e[r+2]&192)>>>6)+1;const f=(e[r+2]&60)>>>2;if(f>u.length-1){t.trigger($.ERROR,{type:ye.MEDIA_ERROR,details:q.FRAG_PARSING_ERROR,fatal:!0,reason:`invalid ADTS sampling index:${f}`});return}return s=(e[r+2]&1)<<2,s|=(e[r+3]&192)>>>6,G.log(`manifest codec:${n}, ADTS type:${i}, samplingIndex:${f}`),/firefox/i.test(c)?f>=6?(i=5,o=new Array(4),a=f-3):(i=2,o=new Array(2),a=f):c.indexOf("android")!==-1?(i=2,o=new Array(2),a=f):(i=5,o=new Array(4),n&&(n.indexOf("mp4a.40.29")!==-1||n.indexOf("mp4a.40.5")!==-1)||!n&&f>=6?a=f-3:((n&&n.indexOf("mp4a.40.2")!==-1&&(f>=6&&s===1||/vivaldi/i.test(c))||!n&&s===1)&&(i=2,o=new Array(2)),a=f)),o[0]=i<<3,o[0]|=(f&14)>>1,o[1]|=(f&1)<<7,o[1]|=s<<3,i===5&&(o[1]|=(a&14)>>1,o[2]=(a&1)<<7,o[2]|=2<<2,o[3]=0),{config:o,samplerate:u[f],channelCount:s,codec:"mp4a.40."+i,manifestCodec:l}}function UQ(t,e){return t[e]===255&&(t[e+1]&246)===240}function jQ(t,e){return t[e+1]&1?7:9}function FO(t,e){return(t[e+3]&3)<<11|t[e+4]<<3|(t[e+5]&224)>>>5}function uGe(t,e){return e+5=t.length)return!1;const n=FO(t,e);if(n<=r)return!1;const i=e+n;return i===t.length||M1(t,i)}return!1}function HQ(t,e,r,n,i){if(!t.samplerate){const a=cGe(e,r,n,i);if(!a)return;t.config=a.config,t.samplerate=a.samplerate,t.channelCount=a.channelCount,t.codec=a.codec,t.manifestCodec=a.manifestCodec,G.log(`parsed codec:${t.codec}, rate:${a.samplerate}, channels:${a.channelCount}`)}}function zQ(t){return 1024*9e4/t}function hGe(t,e){const r=jQ(t,e);if(e+r<=t.length){const n=FO(t,e)-r;if(n>0)return{headerLength:r,frameLength:n}}}function GQ(t,e,r,n,i){const a=zQ(t.samplerate),s=n+i*a,o=hGe(e,r);let c;if(o){const{frameLength:f,headerLength:d}=o,h=d+f,p=Math.max(0,r+h-e.length);p?(c=new Uint8Array(h-d),c.set(e.subarray(r+d,e.length),0)):c=e.subarray(r+d,r+h);const v={unit:c,pts:s};return p||t.samples.push(v),{sample:v,length:h,missing:p}}const l=e.length-r;return c=new Uint8Array(l),c.set(e.subarray(r,e.length),0),{sample:{unit:c,pts:s},length:l,missing:-1}}class pGe extends BQ{constructor(e,r){super(),this.observer=void 0,this.config=void 0,this.observer=e,this.config=r}resetInitSegment(e,r,n,i){super.resetInitSegment(e,r,n,i),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:r,duration:i,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;let n=(O1(e,0)||[]).length;for(let i=e.length;n16384?e.subarray(0,16384):e,Be(e,["moof"]).length>0}demux(e,r){this.timeOffset=r;let n=e;const i=this.videoTrack,a=this.txtTrack;if(this.config.progressive){this.remainderData&&(n=rc(this.remainderData,e));const o=ize(n);this.remainderData=o.remainder,i.samples=o.valid||new Uint8Array}else i.samples=n;const s=this.extractID3Track(i,r);return a.samples=D5(r,i),{videoTrack:i,audioTrack:this.audioTrack,id3Track:s,textTrack:this.txtTrack}}flush(){const e=this.timeOffset,r=this.videoTrack,n=this.txtTrack;r.samples=this.remainderData||new Uint8Array,this.remainderData=null;const i=this.extractID3Track(r,this.timeOffset);return n.samples=D5(e,r),{videoTrack:r,audioTrack:ta(),id3Track:i,textTrack:ta()}}extractID3Track(e,r){const n=this.id3Track;if(e.samples.length){const i=Be(e.samples,["emsg"]);i&&i.forEach(a=>{const s=oze(a);if(mGe.test(s.schemeIdUri)){const o=me(s.presentationTime)?s.presentationTime/s.timeScale:r+s.presentationTimeDelta/s.timeScale;let c=s.eventDuration===4294967295?Number.POSITIVE_INFINITY:s.eventDuration/s.timeScale;c<=.001&&(c=Number.POSITIVE_INFINITY);const l=s.payload;n.samples.push({data:l,len:l.byteLength,dts:o,pts:o,type:Si.emsg,duration:c})}})}return n}demuxSampleAes(e,r,n){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){}}let Kg=null;const vGe=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],yGe=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],xGe=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],bGe=[0,1,1,4];function VQ(t,e,r,n,i){if(r+24>e.length)return;const a=WQ(e,r);if(a&&r+a.frameLength<=e.length){const s=a.samplesPerFrame*9e4/a.sampleRate,o=n+i*s,c={unit:e.subarray(r,r+a.frameLength),pts:o,dts:o};return t.config=[],t.channelCount=a.channelCount,t.samplerate=a.sampleRate,t.samples.push(c),{sample:c,length:a.frameLength,missing:0}}}function WQ(t,e){const r=t[e+1]>>3&3,n=t[e+1]>>1&3,i=t[e+2]>>4&15,a=t[e+2]>>2&3;if(r!==1&&i!==0&&i!==15&&a!==3){const s=t[e+2]>>1&1,o=t[e+3]>>6,c=r===3?3-n:n===3?3:4,l=vGe[c*14+i-1]*1e3,f=yGe[(r===3?0:r===2?1:2)*3+a],d=o===3?1:2,h=xGe[r][n],p=bGe[n],v=h*8*p,m=Math.floor(h*l/f+s)*p;if(Kg===null){const x=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Kg=x?parseInt(x[1]):0}return!!Kg&&Kg<=87&&n===2&&l>=224e3&&o===0&&(t[e+3]=t[e+3]|128),{sampleRate:f,channelCount:d,frameLength:m,samplesPerFrame:v}}}function BO(t,e){return t[e]===255&&(t[e+1]&224)===224&&(t[e+1]&6)!==0}function KQ(t,e){return e+1e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,r=e>>3,e-=r<<3,this.bytesAvailable-=r,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}readBits(e){let r=Math.min(this.bitsAvailable,e);const n=this.word>>>32-r;if(e>32&&G.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=r,this.bitsAvailable>0)this.word<<=r;else if(this.bytesAvailable>0)this.loadWord();else throw new Error("no bits available");return r=e-r,r>0&&this.bitsAvailable?n<>>e)return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){const e=this.skipLZ();return this.readBits(e+1)-1}readEG(){const e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}readBoolean(){return this.readBits(1)===1}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}skipScalingList(e){let r=8,n=8,i;for(let a=0;a{const c=new Uint8Array(o);i.set(c,16),this.decrypter.isSync()||this.decryptAacSamples(e,r+1,n)})}decryptAacSamples(e,r,n){for(;;r++){if(r>=e.length){n();return}if(!(e[r].unit.length<32)&&(this.decryptAacSample(e,r,n),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const r=Math.floor((e.length-48)/160)*16+16,n=new Int8Array(r);let i=0;for(let a=32;a{a.data=this.getAvcDecryptedUnit(s,c),this.decrypter.isSync()||this.decryptAvcSamples(e,r,n+1,i)})}decryptAvcSamples(e,r,n,i){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;r++,n=0){if(r>=e.length){i();return}const a=e[r].units;for(;!(n>=a.length);n++){const s=a[n];if(!(s.data.length<=48||s.type!==1&&s.type!==5)&&(this.decryptAvcSample(e,r,n,i,s),!this.decrypter.isSync()))return}}}}const Br=188;class js{constructor(e,r,n){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=e,this.config=r,this.typeSupported=n}static probe(e){const r=js.syncOffset(e);return r>0&&G.warn(`MPEG2-TS detected but first sync word found @ offset ${r}`),r!==-1}static syncOffset(e){const r=e.length,n=Math.min(Br*5,e.length-Br)+1;let i=0;for(;in)return i;i++}return-1}static createTrack(e,r){return{container:e==="video"||e==="audio"?"video/mp2t":void 0,type:e,id:SQ[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:e==="audio"?r:void 0}}resetInitSegment(e,r,n,i){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=js.createTrack("video"),this._audioTrack=js.createTrack("audio",i),this._id3Track=js.createTrack("id3"),this._txtTrack=js.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.audioCodec=r,this.videoCodec=n,this._duration=i}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_avcTrack:r,_id3Track:n}=this;e&&(e.pesData=null),r&&(r.pesData=null),n&&(n.pesData=null),this.aacOverFlow=null,this.avcSample=null,this.remainderData=null}demux(e,r,n=!1,i=!1){n||(this.sampleAes=null);let a;const s=this._avcTrack,o=this._audioTrack,c=this._id3Track,l=this._txtTrack;let u=s.pid,f=s.pesData,d=o.pid,h=c.pid,p=o.pesData,v=c.pesData,m=null,g=this.pmtParsed,y=this._pmtId,x=e.length;if(this.remainderData&&(e=rc(this.remainderData,e),x=e.length,this.remainderData=null),x>4;let C;if(T>1){if(C=w+5+e[w+4],C===w+Br)continue}else C=w+4;switch(I){case u:R&&(f&&(a=qc(f))&&this.parseAVCPES(s,l,a,!1),f={data:[],size:0}),f&&(f.data.push(e.subarray(C,w+Br)),f.size+=w+Br-C);break;case d:if(R){if(p&&(a=qc(p)))switch(o.segmentCodec){case"aac":this.parseAACPES(o,a);break;case"mp3":this.parseMPEGPES(o,a);break}p={data:[],size:0}}p&&(p.data.push(e.subarray(C,w+Br)),p.size+=w+Br-C);break;case h:R&&(v&&(a=qc(v))&&this.parseID3PES(c,a),v={data:[],size:0}),v&&(v.data.push(e.subarray(C,w+Br)),v.size+=w+Br-C);break;case 0:R&&(C+=e[C]+1),y=this._pmtId=wGe(e,C);break;case y:{R&&(C+=e[C]+1);const L=TGe(e,C,this.typeSupported,n);u=L.avc,u>0&&(s.pid=u),d=L.audio,d>0&&(o.pid=d,o.segmentCodec=L.segmentCodec),h=L.id3,h>0&&(c.pid=h),m!==null&&!g&&(G.warn(`MPEG-TS PMT found at ${w} after unknown PID '${m}'. Backtracking to sync byte @${b} to parse all TS packets.`),m=null,w=b-188),g=this.pmtParsed=!0;break}case 17:case 8191:break;default:m=I;break}}else _++;if(_>0){const w=new Error(`Found ${_} TS packet/s that do not start with 0x47`);this.observer.emit($.ERROR,$.ERROR,{type:ye.MEDIA_ERROR,details:q.FRAG_PARSING_ERROR,fatal:!1,error:w,reason:w.message})}s.pesData=f,o.pesData=p,c.pesData=v;const S={audioTrack:o,videoTrack:s,id3Track:c,textTrack:l};return i&&this.extractRemainingSamples(S),S}flush(){const{remainderData:e}=this;this.remainderData=null;let r;return e?r=this.demux(e,-1,!1,!0):r={videoTrack:this._avcTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(r),this.sampleAes?this.decrypt(r,this.sampleAes):r}extractRemainingSamples(e){const{audioTrack:r,videoTrack:n,id3Track:i,textTrack:a}=e,s=n.pesData,o=r.pesData,c=i.pesData;let l;if(s&&(l=qc(s))?(this.parseAVCPES(n,a,l,!0),n.pesData=null):n.pesData=s,o&&(l=qc(o))){switch(r.segmentCodec){case"aac":this.parseAACPES(r,l);break;case"mp3":this.parseMPEGPES(r,l);break}r.pesData=null}else o!=null&&o.size&&G.log("last AAC PES packet truncated,might overlap between fragments"),r.pesData=o;c&&(l=qc(c))?(this.parseID3PES(i,l),i.pesData=null):i.pesData=c}demuxSampleAes(e,r,n){const i=this.demux(e,n,!0,!this.config.progressive),a=this.sampleAes=new _Ge(this.observer,this.config,r);return this.decrypt(i,a)}decrypt(e,r){return new Promise(n=>{const{audioTrack:i,videoTrack:a}=e;i.samples&&i.segmentCodec==="aac"?r.decryptAacSamples(i.samples,0,()=>{a.samples?r.decryptAvcSamples(a.samples,0,0,()=>{n(e)}):n(e)}):a.samples&&r.decryptAvcSamples(a.samples,0,0,()=>{n(e)})})}destroy(){this._duration=0}parseAVCPES(e,r,n,i){const a=this.parseAVCNALu(e,n.data);let s=this.avcSample,o,c=!1;n.data=null,s&&a.length&&!e.audFound&&(dT(s,e),s=this.avcSample=Yg(!1,n.pts,n.dts,"")),a.forEach(l=>{switch(l.type){case 1:{o=!0,s||(s=this.avcSample=Yg(!0,n.pts,n.dts,"")),s.frame=!0;const u=l.data;if(c&&u.length>4){const f=new iB(u).readSliceType();(f===2||f===4||f===7||f===9)&&(s.key=!0)}break}case 5:o=!0,s||(s=this.avcSample=Yg(!0,n.pts,n.dts,"")),s.key=!0,s.frame=!0;break;case 6:{o=!0,AQ(l.data,1,n.pts,r.samples);break}case 7:if(o=!0,c=!0,!e.sps){const u=l.data,d=new iB(u).readSPS();e.width=d.width,e.height=d.height,e.pixelRatio=d.pixelRatio,e.sps=[u],e.duration=this._duration;const h=u.subarray(1,4);let p="avc1.";for(let v=0;v<3;v++){let m=h[v].toString(16);m.length<2&&(m="0"+m),p+=m}e.codec=p}break;case 8:o=!0,e.pps||(e.pps=[l.data]);break;case 9:o=!1,e.audFound=!0,s&&dT(s,e),s=this.avcSample=Yg(!1,n.pts,n.dts,"");break;case 12:o=!0;break;default:o=!1,s&&(s.debug+="unknown NAL "+l.type+" ");break}s&&o&&s.units.push(l)}),i&&s&&(dT(s,e),this.avcSample=null)}getLastNalUnit(e){var r;let n=this.avcSample,i;if((!n||n.units.length===0)&&(n=e[e.length-1]),(r=n)!=null&&r.units){const a=n.units;i=a[a.length-1]}return i}parseAVCNALu(e,r){const n=r.byteLength;let i=e.naluState||0;const a=i,s=[];let o=0,c,l,u,f=-1,d=0;for(i===-1&&(f=0,d=r[0]&31,i=0,o=1);o=0){const h={data:r.subarray(f,o-i-1),type:d};s.push(h)}else{const h=this.getLastNalUnit(e.samples);if(h&&(a&&o<=4-a&&h.state&&(h.data=h.data.subarray(0,h.data.byteLength-a)),l=o-i-1,l>0)){const p=new Uint8Array(h.data.byteLength+l);p.set(h.data,0),p.set(r.subarray(0,l),h.data.byteLength),h.data=p,h.state=0}}o=0&&i>=0){const h={data:r.subarray(f,n),type:d,state:i};s.push(h)}if(s.length===0){const h=this.getLastNalUnit(e.samples);if(h){const p=new Uint8Array(h.data.byteLength+r.byteLength);p.set(h.data,0),p.set(r,h.data.byteLength),h.data=p}}return e.naluState=i,s}parseAACPES(e,r){let n=0;const i=this.aacOverFlow;let a=r.data;if(i){this.aacOverFlow=null;const f=i.missing,d=i.sample.unit.byteLength;if(f===-1){const h=new Uint8Array(d+a.byteLength);h.set(i.sample.unit,0),h.set(a,d),a=h}else{const h=d-f;i.sample.unit.set(a.subarray(0,f),h),e.samples.push(i.sample),n=i.missing}}let s,o;for(s=n,o=a.length;s1;){const l=new Uint8Array(o[0].length+o[1].length);l.set(o[0]),l.set(o[1],o[0].length),o[0]=l,o.splice(1,1)}if(r=o[0],(r[0]<<16)+(r[1]<<8)+r[2]===1){if(n=(r[4]<<8)+r[5],n&&n>t.size-6)return null;const l=r[7];l&192&&(a=(r[9]&14)*536870912+(r[10]&255)*4194304+(r[11]&254)*16384+(r[12]&255)*128+(r[13]&254)/2,l&64?(s=(r[14]&14)*536870912+(r[15]&255)*4194304+(r[16]&254)*16384+(r[17]&255)*128+(r[18]&254)/2,a-s>60*9e4&&(G.warn(`${Math.round((a-s)/9e4)}s delta between PTS and DTS, align them`),a=s)):s=a),i=r[8];let u=i+9;if(t.size<=u)return null;t.size-=u;const f=new Uint8Array(t.size);for(let d=0,h=o.length;dp){u-=p;continue}else r=r.subarray(u),p-=u,u=0;f.set(r,e),e+=p}return n&&(n-=i+3),{data:f,pts:a,dts:s,len:n}}return null}function dT(t,e){if(t.units.length&&t.frame){if(t.pts===void 0){const r=e.samples,n=r.length;if(n){const i=r[n-1];t.pts=i.pts,t.dts=i.dts}else{e.dropped++;return}}e.samples.push(t)}t.debug.length&&G.log(t.pts+"/"+t.dts+":"+t.debug)}class RGe extends BQ{resetInitSegment(e,r,n,i){super.resetInitSegment(e,r,n,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:r,duration:i,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;let n=(O1(e,0)||[]).length;for(let i=e.length;n>24&255,s[1]=n>>16&255,s[2]=n>>8&255,s[3]=n&255,s.set(e,4),i=0,n=8;i>24&255,e>>16&255,e>>8&255,e&255,n>>24,n>>16&255,n>>8&255,n&255,i>>24,i>>16&255,i>>8&255,i&255,85,196,0,0]))}static mdia(e){return K.box(K.types.mdia,K.mdhd(e.timescale,e.duration),K.hdlr(e.type),K.minf(e))}static mfhd(e){return K.box(K.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,e&255]))}static minf(e){return e.type==="audio"?K.box(K.types.minf,K.box(K.types.smhd,K.SMHD),K.DINF,K.stbl(e)):K.box(K.types.minf,K.box(K.types.vmhd,K.VMHD),K.DINF,K.stbl(e))}static moof(e,r,n){return K.box(K.types.moof,K.mfhd(e),K.traf(n,r))}static moov(e){let r=e.length;const n=[];for(;r--;)n[r]=K.trak(e[r]);return K.box.apply(null,[K.types.moov,K.mvhd(e[0].timescale,e[0].duration)].concat(n).concat(K.mvex(e)))}static mvex(e){let r=e.length;const n=[];for(;r--;)n[r]=K.trex(e[r]);return K.box.apply(null,[K.types.mvex,...n])}static mvhd(e,r){r*=e;const n=Math.floor(r/(Fs+1)),i=Math.floor(r%(Fs+1)),a=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,n>>24,n>>16&255,n>>8&255,n&255,i>>24,i>>16&255,i>>8&255,i&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return K.box(K.types.mvhd,a)}static sdtp(e){const r=e.samples||[],n=new Uint8Array(4+r.length);let i,a;for(i=0;i>>8&255),r.push(s&255),r=r.concat(Array.prototype.slice.call(a));for(i=0;i>>8&255),n.push(s&255),n=n.concat(Array.prototype.slice.call(a));const o=K.box(K.types.avcC,new Uint8Array([1,r[3],r[4],r[5],255,224|e.sps.length].concat(r).concat([e.pps.length]).concat(n))),c=e.width,l=e.height,u=e.pixelRatio[0],f=e.pixelRatio[1];return K.box(K.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,c>>8&255,c&255,l>>8&255,l&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o,K.box(K.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),K.box(K.types.pasp,new Uint8Array([u>>24,u>>16&255,u>>8&255,u&255,f>>24,f>>16&255,f>>8&255,f&255])))}static esds(e){const r=e.config.length;return new Uint8Array([0,0,0,0,3,23+r,0,1,0,4,15+r,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([r]).concat(e.config).concat([6,1,2]))}static mp4a(e){const r=e.samplerate;return K.box(K.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,r>>8&255,r&255,0,0]),K.box(K.types.esds,K.esds(e)))}static mp3(e){const r=e.samplerate;return K.box(K.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,r>>8&255,r&255,0,0]))}static stsd(e){return e.type==="audio"?e.segmentCodec==="mp3"&&e.codec==="mp3"?K.box(K.types.stsd,K.STSD,K.mp3(e)):K.box(K.types.stsd,K.STSD,K.mp4a(e)):K.box(K.types.stsd,K.STSD,K.avc1(e))}static tkhd(e){const r=e.id,n=e.duration*e.timescale,i=e.width,a=e.height,s=Math.floor(n/(Fs+1)),o=Math.floor(n%(Fs+1));return K.box(K.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,r>>24&255,r>>16&255,r>>8&255,r&255,0,0,0,0,s>>24,s>>16&255,s>>8&255,s&255,o>>24,o>>16&255,o>>8&255,o&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,i>>8&255,i&255,0,0,a>>8&255,a&255,0,0]))}static traf(e,r){const n=K.sdtp(e),i=e.id,a=Math.floor(r/(Fs+1)),s=Math.floor(r%(Fs+1));return K.box(K.types.traf,K.box(K.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,i&255])),K.box(K.types.tfdt,new Uint8Array([1,0,0,0,a>>24,a>>16&255,a>>8&255,a&255,s>>24,s>>16&255,s>>8&255,s&255])),K.trun(e,n.length+16+20+8+16+8+8),n)}static trak(e){return e.duration=e.duration||4294967295,K.box(K.types.trak,K.tkhd(e),K.mdia(e))}static trex(e){const r=e.id;return K.box(K.types.trex,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,r&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(e,r){const n=e.samples||[],i=n.length,a=12+16*i,s=new Uint8Array(a);let o,c,l,u,f,d;for(r+=8+a,s.set([e.type==="video"?1:0,0,15,1,i>>>24&255,i>>>16&255,i>>>8&255,i&255,r>>>24&255,r>>>16&255,r>>>8&255,r&255],0),o=0;o>>24&255,l>>>16&255,l>>>8&255,l&255,u>>>24&255,u>>>16&255,u>>>8&255,u&255,f.isLeading<<2|f.dependsOn,f.isDependedOn<<6|f.hasRedundancy<<4|f.paddingValue<<1|f.isNonSync,f.degradPrio&240<<8,f.degradPrio&15,d>>>24&255,d>>>16&255,d>>>8&255,d&255],12+16*o);return K.box(K.types.trun,s)}static initSegment(e){K.types||K.init();const r=K.moov(e),n=new Uint8Array(K.FTYP.byteLength+r.byteLength);return n.set(K.FTYP),n.set(r,K.FTYP.byteLength),n}}K.types=void 0;K.HDLR_TYPES=void 0;K.STTS=void 0;K.STSC=void 0;K.STCO=void 0;K.STSZ=void 0;K.VMHD=void 0;K.SMHD=void 0;K.STSD=void 0;K.FTYP=void 0;K.DINF=void 0;const YQ=9e4;function UO(t,e,r=1,n=!1){const i=t*e*r;return n?Math.round(i):i}function AGe(t,e,r=1,n=!1){return UO(t,e,1/r,n)}function lh(t,e=!1){return UO(t,1e3,1/YQ,e)}function IGe(t,e=1){return UO(t,YQ,1/e)}const $Ge=10*1e3,sB=1024,CGe=1152;let qg=null,hT=null;class pT{constructor(e,r,n,i=""){if(this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=e,this.config=r,this.typeSupported=n,this.ISGenerated=!1,qg===null){const s=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);qg=s?parseInt(s[1]):0}if(hT===null){const a=navigator.userAgent.match(/Safari\/(\d+)/i);hT=a?parseInt(a[1]):0}}destroy(){}resetTimeStamp(e){G.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=e}resetNextTimestamp(){G.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){G.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1}getVideoStartPts(e){let r=!1;const n=e.reduce((i,a)=>{const s=a.pts-i;return s<-4294967296?(r=!0,jn(i,a.pts)):s>0?i:a.pts},e[0].pts);return r&&G.debug("PTS rollover detected"),n}remux(e,r,n,i,a,s,o,c){let l,u,f,d,h,p,v=a,m=a;const g=e.pid>-1,y=r.pid>-1,x=r.samples.length,b=e.samples.length>0,_=o&&x>0||x>1;if((!g||b)&&(!y||_)||this.ISGenerated||o){this.ISGenerated||(f=this.generateIS(e,r,a,s));const w=this.isVideoContiguous;let R=-1,I;if(_&&(R=kGe(r.samples),!w&&this.config.forceKeyFrameOnDiscontinuity))if(p=!0,R>0){G.warn(`[mp4-remuxer]: Dropped ${R} out of ${x} video samples due to a missing keyframe`);const T=this.getVideoStartPts(r.samples);r.samples=r.samples.slice(R),r.dropped+=R,m+=(r.samples[0].pts-T)/r.inputTimeScale,I=m}else R===-1&&(G.warn(`[mp4-remuxer]: No keyframe found out of ${x} video samples`),p=!1);if(this.ISGenerated){if(b&&_){const T=this.getVideoStartPts(r.samples),L=(jn(e.samples[0].pts,T)-T)/r.inputTimeScale;v+=Math.max(0,L),m+=Math.max(0,-L)}if(b){if(e.samplerate||(G.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),f=this.generateIS(e,r,a,s)),u=this.remuxAudio(e,v,this.isAudioContiguous,s,y||_||c===xe.AUDIO?m:void 0),_){const T=u?u.endPTS-u.startPTS:0;r.inputTimeScale||(G.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),f=this.generateIS(e,r,a,s)),l=this.remuxVideo(r,m,w,T)}}else _&&(l=this.remuxVideo(r,m,w,0));l&&(l.firstKeyFrame=R,l.independent=R!==-1,l.firstKeyFramePTS=I)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(n.samples.length&&(h=qQ(n,a,this._initPTS,this._initDTS)),i.samples.length&&(d=XQ(i,a,this._initPTS))),{audio:u,video:l,initSegment:f,independent:p,text:d,id3:h}}generateIS(e,r,n,i){const a=e.samples,s=r.samples,o=this.typeSupported,c={},l=this._initPTS;let u=!l||i,f="audio/mp4",d,h,p;if(u&&(d=h=1/0),e.config&&a.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":o.mpeg?(f="audio/mpeg",e.codec=""):o.mp3&&(e.codec="mp3");break}c.audio={id:"audio",container:f,codec:e.codec,initSegment:e.segmentCodec==="mp3"&&o.mpeg?new Uint8Array(0):K.initSegment([e]),metadata:{channelCount:e.channelCount}},u&&(p=e.inputTimeScale,!l||p!==l.timescale?d=h=a[0].pts-Math.round(p*n):u=!1)}if(r.sps&&r.pps&&s.length&&(r.timescale=r.inputTimeScale,c.video={id:"main",container:"video/mp4",codec:r.codec,initSegment:K.initSegment([r]),metadata:{width:r.width,height:r.height}},u))if(p=r.inputTimeScale,!l||p!==l.timescale){const v=this.getVideoStartPts(s),m=Math.round(p*n);h=Math.min(h,jn(s[0].dts,v)-m),d=Math.min(d,v-m)}else u=!1;if(Object.keys(c).length)return this.ISGenerated=!0,u?(this._initPTS={baseTime:d,timescale:p},this._initDTS={baseTime:h,timescale:p}):d=p=void 0,{tracks:c,initPTS:d,timescale:p}}remuxVideo(e,r,n,i){const a=e.inputTimeScale,s=e.samples,o=[],c=s.length,l=this._initPTS;let u=this.nextAvcDts,f=8,d=this.videoSampleDuration,h,p,v=Number.POSITIVE_INFINITY,m=Number.NEGATIVE_INFINITY,g=!1;if(!n||u===null){const M=r*a,U=s[0].pts-jn(s[0].dts,s[0].pts);u=M-U}const y=l.baseTime*a/l.timescale;for(let M=0;M0?M-1:M].dts&&(g=!0)}g&&s.sort(function(M,U){const W=M.dts-U.dts,k=M.pts-U.pts;return W||k}),h=s[0].dts,p=s[s.length-1].dts;const x=p-h,b=x?Math.round(x/(c-1)):d||e.inputTimeScale/30;if(n){const M=h-u,U=M>b,W=M<-1;if((U||W)&&(U?G.warn(`AVC: ${lh(M,!0)} ms (${M}dts) hole between fragments detected, filling it`):G.warn(`AVC: ${lh(-M,!0)} ms (${M}dts) overlapping between fragments detected`),!W||u>s[0].pts)){h=u;const k=s[0].pts-M;s[0].dts=h,s[0].pts=k,G.log(`Video: First PTS/DTS adjusted: ${lh(k,!0)}/${lh(h,!0)}, delta: ${lh(M,!0)} ms`)}}h=Math.max(0,h);let _=0,S=0;for(let M=0;M0?U.dts-s[M-1].dts:b;if(O=M>0?U.pts-s[M-1].pts:b,D.stretchShortVideoTrack&&this.nextAudioPts!==null){const ee=Math.floor(D.maxBufferHole*a),de=(i?v+i*a:this.nextAudioPts)-U.pts;de>ee?(d=de-Q,d<0?d=Q:T=!0,G.log(`[mp4-remuxer]: It is approximately ${de/90} ms to the next segment; using duration ${d/90} ms for the last video frame.`)):d=Q}else d=Q}const F=Math.round(U.pts-U.dts);C=Math.min(C,d),H=Math.max(H,d),L=Math.min(L,O),N=Math.max(N,O),o.push(new oB(U.key,d,k,F))}if(o.length){if(qg){if(qg<70){const M=o[0].flags;M.dependsOn=2,M.isNonSync=0}}else if(hT&&N-L0&&(i&&Math.abs(y-g)<9e3||Math.abs(jn(v[0].pts-x,y)-g)<20*u),v.forEach(function(B){B.pts=jn(B.pts-x,y)}),!n||g<0){if(v=v.filter(B=>B.pts>=0),!v.length)return;a===0?g=0:i&&!p?g=Math.max(0,y):g=v[0].pts}if(e.segmentCodec==="aac"){const B=this.config.maxAudioFramesDrift;for(let V=0,M=g;V=B*u&&O<$Ge&&p){let F=Math.round(k/u);M=W-F*u,M<0&&(F--,M+=u),V===0&&(this.nextAudioPts=g=M),G.warn(`[mp4-remuxer]: Injecting ${F} audio frame @ ${(M/s).toFixed(3)}s due to ${Math.round(1e3*k/s)} ms gap.`);for(let D=0;D0){w+=m;try{S=new Uint8Array(w)}catch(O){this.observer.emit($.ERROR,$.ERROR,{type:ye.MUX_ERROR,details:q.REMUX_ALLOC_ERROR,fatal:!1,error:O,bytes:w,reason:`fail allocating audio mdat ${w}`});return}d||(new DataView(S.buffer).setUint32(0,w),S.set(K.types.mdat,4))}else return;S.set(U,m);const k=U.byteLength;m+=k,h.push(new oB(!0,l,k,0)),_=W}const I=h.length;if(!I)return;const T=h[h.length-1];this.nextAudioPts=g=_+c*T.duration;const C=d?new Uint8Array(0):K.moof(e.sequenceNumber++,b/c,Pt({},e,{samples:h}));e.samples=[];const L=b/s,H=g/s,P={data1:C,data2:S,startPTS:L,endPTS:H,startDTS:L,endDTS:H,type:"audio",hasAudio:!0,hasVideo:!1,nb:I};return this.isAudioContiguous=!0,P}remuxEmptyAudio(e,r,n,i){const a=e.inputTimeScale,s=e.samplerate?e.samplerate:a,o=a/s,c=this.nextAudioPts,l=this._initDTS,u=l.baseTime*9e4/l.timescale,f=(c!==null?c:i.startDTS*a)+u,d=i.endDTS*a+u,h=o*sB,p=Math.ceil((d-f)/h),v=aB.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(G.warn("[mp4-remuxer]: remux empty Audio"),!v){G.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}const m=[];for(let g=0;g4294967296;)t+=r;return t}function kGe(t){for(let e=0;es.pts-o.pts);const a=t.samples;return t.samples=[],{samples:a}}class oB{constructor(e,r,n,i){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=r,this.size=n,this.cts=i,this.flags=new OGe(e)}}class OGe{constructor(e){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=e?2:1,this.isNonSync=e?0:1}}class LGe{constructor(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null}destroy(){}resetTimeStamp(e){this.initPTS=e,this.lastEndTime=null}resetNextTimestamp(){this.lastEndTime=null}resetInitSegment(e,r,n,i){this.audioCodec=r,this.videoCodec=n,this.generateInitSegment(JHe(e,i)),this.emitInitSegment=!0}generateInitSegment(e){let{audioCodec:r,videoCodec:n}=this;if(!(e!=null&&e.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const i=this.initData=TQ(e);r||(r=lB(i.audio,Qe.AUDIO)),n||(n=lB(i.video,Qe.VIDEO));const a={};i.audio&&i.video?a.audiovideo={container:"video/mp4",codec:r+","+n,initSegment:e,id:"main"}:i.audio?a.audio={container:"audio/mp4",codec:r,initSegment:e,id:"audio"}:i.video?a.video={container:"video/mp4",codec:n,initSegment:e,id:"main"}:G.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=a}remux(e,r,n,i,a,s){var o,c;let{initPTS:l,lastEndTime:u}=this;const f={audio:void 0,video:void 0,text:i,id3:n,initSegment:void 0};me(u)||(u=this.lastEndTime=a||0);const d=r.samples;if(!(d!=null&&d.length))return f;const h={initPTS:void 0,timescale:1};let p=this.initData;if((o=p)!=null&&o.length||(this.generateInitSegment(d),p=this.initData),!((c=p)!=null&&c.length))return G.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),f;this.emitInitSegment&&(h.tracks=this.initTracks,this.emitInitSegment=!1);const v=eze(p,d),m=v===null?a:v;(PGe(l,m,a)||h.timescale!==l.timescale&&s)&&(h.initPTS=m-a,this.initPTS=l={baseTime:h.initPTS,timescale:1});const g=tze(d,p),y=e?m-l.baseTime/l.timescale:u,x=y+g;nze(p,d,l.baseTime/l.timescale),g>0?this.lastEndTime=x:(G.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const b=!!p.audio,_=!!p.video;let S="";b&&(S+="audio"),_&&(S+="video");const w={data1:d,startPTS:y,startDTS:y,endPTS:x,endDTS:x,type:S,hasAudio:b,hasVideo:_,nb:1,dropped:0};return f.audio=w.type==="audio"?w:void 0,f.video=w.type!=="audio"?w:void 0,f.initSegment=h,f.id3=qQ(n,a,l,l),i.samples.length&&(f.text=XQ(i,a,l)),f}}function PGe(t,e,r){if(t===null)return!0;const n=e-t.baseTime/t.timescale;return n<0&&Math.abs(n-r)>1}function lB(t,e){const r=t==null?void 0:t.codec;return r&&r.length>4?r:r==="hvc1"||r==="hev1"?"hvc1.1.c.L120.90":r==="av01"?"av01.0.04M.08":r==="avc1"||e===Qe.VIDEO?"avc1.42e01e":"mp4a.40.5"}let ja;try{ja=self.performance.now.bind(self.performance)}catch{G.debug("Unable to use Performance API on this environment"),ja=typeof self<"u"&&self.Date.now}const mT=[{demux:gGe,remux:LGe},{demux:js,remux:pT},{demux:pGe,remux:pT},{demux:RGe,remux:pT}];class cB{constructor(e,r,n,i,a){this.async=!1,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=e,this.typeSupported=r,this.config=n,this.vendor=i,this.id=a}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,r,n,i){const a=n.transmuxing;a.executeStart=ja();let s=new Uint8Array(e);const{currentTransmuxState:o,transmuxConfig:c}=this;i&&(this.currentTransmuxState=i);const{contiguous:l,discontinuity:u,trackSwitch:f,accurateTimeOffset:d,timeOffset:h,initSegmentChange:p}=i||o,{audioCodec:v,videoCodec:m,defaultInitPts:g,duration:y,initSegmentData:x}=c,b=NGe(s,r);if(b&&b.method==="AES-128"){const R=this.getDecrypter();if(R.isSync()){let I=R.softwareDecrypt(s,b.key.buffer,b.iv.buffer);if(n.part>-1&&(I=R.flush()),!I)return a.executeEnd=ja(),gT(n);s=new Uint8Array(I)}else return this.decryptionPromise=R.webCryptoDecrypt(s,b.key.buffer,b.iv.buffer).then(I=>{const T=this.push(I,null,n);return this.decryptionPromise=null,T}),this.decryptionPromise}const _=this.needsProbing(u,f);if(_){const R=this.configureTransmuxer(s);if(R)return G.warn(`[transmuxer] ${R.message}`),this.observer.emit($.ERROR,$.ERROR,{type:ye.MEDIA_ERROR,details:q.FRAG_PARSING_ERROR,fatal:!1,error:R,reason:R.message}),a.executeEnd=ja(),gT(n)}(u||f||p||_)&&this.resetInitSegment(x,v,m,y,r),(u||p||_)&&this.resetInitialTimestamp(g),l||this.resetContiguity();const S=this.transmux(s,b,h,d,n),w=this.currentTransmuxState;return w.contiguous=!0,w.discontinuity=!1,w.trackSwitch=!1,a.executeEnd=ja(),S}flush(e){const r=e.transmuxing;r.executeStart=ja();const{decrypter:n,currentTransmuxState:i,decryptionPromise:a}=this;if(a)return a.then(()=>this.flush(e));const s=[],{timeOffset:o}=i;if(n){const f=n.flush();f&&s.push(this.push(f,null,e))}const{demuxer:c,remuxer:l}=this;if(!c||!l)return r.executeEnd=ja(),[gT(e)];const u=c.flush(o);return ry(u)?u.then(f=>(this.flushRemux(s,f,e),s)):(this.flushRemux(s,u,e),s)}flushRemux(e,r,n){const{audioTrack:i,videoTrack:a,id3Track:s,textTrack:o}=r,{accurateTimeOffset:c,timeOffset:l}=this.currentTransmuxState;G.log(`[transmuxer.ts]: Flushed fragment ${n.sn}${n.part>-1?" p: "+n.part:""} of level ${n.level}`);const u=this.remuxer.remux(i,a,s,o,l,c,!0,this.id);e.push({remuxResult:u,chunkMeta:n}),n.transmuxing.executeEnd=ja()}resetInitialTimestamp(e){const{demuxer:r,remuxer:n}=this;!r||!n||(r.resetTimeStamp(e),n.resetTimeStamp(e))}resetContiguity(){const{demuxer:e,remuxer:r}=this;!e||!r||(e.resetContiguity(),r.resetNextTimestamp())}resetInitSegment(e,r,n,i,a){const{demuxer:s,remuxer:o}=this;!s||!o||(s.resetInitSegment(e,r,n,i),o.resetInitSegment(e,r,n,a))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,r,n,i,a){let s;return r&&r.method==="SAMPLE-AES"?s=this.transmuxSampleAes(e,r,n,i,a):s=this.transmuxUnencrypted(e,n,i,a),s}transmuxUnencrypted(e,r,n,i){const{audioTrack:a,videoTrack:s,id3Track:o,textTrack:c}=this.demuxer.demux(e,r,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(a,s,o,c,r,n,!1,this.id),chunkMeta:i}}transmuxSampleAes(e,r,n,i,a){return this.demuxer.demuxSampleAes(e,r,n).then(s=>({remuxResult:this.remuxer.remux(s.audioTrack,s.videoTrack,s.id3Track,s.textTrack,n,i,!1,this.id),chunkMeta:a}))}configureTransmuxer(e){const{config:r,observer:n,typeSupported:i,vendor:a}=this;let s;for(let f=0,d=mT.length;f0&&e!=null&&e.key!=null&&e.iv!==null&&e.method!=null&&(r=e),r}const gT=t=>({remuxResult:{},chunkMeta:t});function ry(t){return"then"in t&&t.then instanceof Function}class DGe{constructor(e,r,n,i,a){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=e,this.videoCodec=r,this.initSegmentData=n,this.duration=i,this.defaultInitPts=a||null}}class MGe{constructor(e,r,n,i,a,s){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=e,this.contiguous=r,this.accurateTimeOffset=n,this.trackSwitch=i,this.timeOffset=a,this.initSegmentChange=s}}var np={},FGe={get exports(){return np},set exports(t){np=t}};(function(t){var e=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(c,l,u){this.fn=c,this.context=l,this.once=u||!1}function a(c,l,u,f,d){if(typeof u!="function")throw new TypeError("The listener must be a function");var h=new i(u,f||c,d),p=r?r+l:l;return c._events[p]?c._events[p].fn?c._events[p]=[c._events[p],h]:c._events[p].push(h):(c._events[p]=h,c._eventsCount++),c}function s(c,l){--c._eventsCount===0?c._events=new n:delete c._events[l]}function o(){this._events=new n,this._eventsCount=0}o.prototype.eventNames=function(){var l=[],u,f;if(this._eventsCount===0)return l;for(f in u=this._events)e.call(u,f)&&l.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(u)):l},o.prototype.listeners=function(l){var u=r?r+l:l,f=this._events[u];if(!f)return[];if(f.fn)return[f.fn];for(var d=0,h=f.length,p=new Array(h);d!1};class QQ{constructor(e,r,n,i){this.error=null,this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.workerContext=null,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0;const a=e.config;this.hls=e,this.id=r,this.useWorker=!!a.enableWorker,this.onTransmuxComplete=n,this.onFlush=i;const s=(l,u)=>{u=u||{},u.frag=this.frag,u.id=this.id,l===$.ERROR&&(this.error=u.error),this.hls.trigger(l,u)};this.observer=new np,this.observer.on($.FRAG_DECRYPTED,s),this.observer.on($.ERROR,s);const o={mp4:vT.isTypeSupported("video/mp4"),mpeg:vT.isTypeSupported("audio/mpeg"),mp3:vT.isTypeSupported('audio/mp4; codecs="mp3"')},c=navigator.vendor;if(this.useWorker&&typeof Worker<"u"&&(a.workerPath||aGe())){try{a.workerPath?(G.log(`loading Web Worker ${a.workerPath} for "${r}"`),this.workerContext=oGe(a.workerPath)):(G.log(`injecting Web Worker for "${r}"`),this.workerContext=sGe()),this.onwmsg=f=>this.onWorkerMessage(f);const{worker:u}=this.workerContext;u.addEventListener("message",this.onwmsg),u.onerror=f=>{const d=new Error(`${f.message} (${f.filename}:${f.lineno})`);a.enableWorker=!1,G.warn(`Error in "${r}" Web Worker, fallback to inline`),this.hls.trigger($.ERROR,{type:ye.OTHER_ERROR,details:q.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:d})},u.postMessage({cmd:"init",typeSupported:o,vendor:c,id:r,config:JSON.stringify(a)})}catch(u){G.warn(`Error setting up "${r}" Web Worker, fallback to inline`,u),this.resetWorker(),this.error=null,this.transmuxer=new cB(this.observer,o,a,c,r)}return}this.transmuxer=new cB(this.observer,o,a,c,r)}resetWorker(){if(this.workerContext){const{worker:e,objectURL:r}=this.workerContext;r&&self.URL.revokeObjectURL(r),e.removeEventListener("message",this.onwmsg),e.onerror=null,e.terminate(),this.workerContext=null}}destroy(){if(this.workerContext)this.resetWorker(),this.onwmsg=void 0;else{const r=this.transmuxer;r&&(r.destroy(),this.transmuxer=null)}const e=this.observer;e&&e.removeAllListeners(),this.frag=null,this.observer=null,this.hls=null}push(e,r,n,i,a,s,o,c,l,u){var f,d;l.transmuxing.start=self.performance.now();const{transmuxer:h}=this,p=s?s.start:a.start,v=a.decryptdata,m=this.frag,g=!(m&&a.cc===m.cc),y=!(m&&l.level===m.level),x=m?l.sn-m.sn:-1,b=this.part?l.part-this.part.index:-1,_=x===0&&l.id>1&&l.id===(m==null?void 0:m.stats.chunkCount),S=!y&&(x===1||x===0&&(b===1||_&&b<=0)),w=self.performance.now();(y||x||a.stats.parsing.start===0)&&(a.stats.parsing.start=w),s&&(b||!S)&&(s.stats.parsing.start=w);const R=!(m&&((f=a.initSegment)==null?void 0:f.url)===((d=m.initSegment)==null?void 0:d.url)),I=new MGe(g,S,c,y,p,R);if(!S||g||R){G.log(`[transmuxer-interface, ${a.type}]: Starting new transmux session for sn: ${l.sn} p: ${l.part} level: ${l.level} id: ${l.id} + discontinuity: ${g} + trackSwitch: ${y} + contiguous: ${S} + accurateTimeOffset: ${c} + timeOffset: ${p} + initSegmentChange: ${R}`);const T=new DGe(n,i,r,o,u);this.configureTransmuxer(T)}if(this.frag=a,this.part=s,this.workerContext)this.workerContext.worker.postMessage({cmd:"demux",data:e,decryptdata:v,chunkMeta:l,state:I},e instanceof ArrayBuffer?[e]:[]);else if(h){const T=h.push(e,v,l,I);ry(T)?(h.async=!0,T.then(C=>{this.handleTransmuxComplete(C)}).catch(C=>{this.transmuxerError(C,l,"transmuxer-interface push error")})):(h.async=!1,this.handleTransmuxComplete(T))}}flush(e){e.transmuxing.start=self.performance.now();const{transmuxer:r}=this;if(this.workerContext)this.workerContext.worker.postMessage({cmd:"flush",chunkMeta:e});else if(r){let n=r.flush(e);ry(n)||r.async?(ry(n)||(n=Promise.resolve(n)),n.then(a=>{this.handleFlushResult(a,e)}).catch(a=>{this.transmuxerError(a,e,"transmuxer-interface flush error")})):this.handleFlushResult(n,e)}}transmuxerError(e,r,n){this.hls&&(this.error=e,this.hls.trigger($.ERROR,{type:ye.MEDIA_ERROR,details:q.FRAG_PARSING_ERROR,chunkMeta:r,fatal:!1,error:e,err:e,reason:n}))}handleFlushResult(e,r){e.forEach(n=>{this.handleTransmuxComplete(n)}),this.onFlush(r)}onWorkerMessage(e){const r=e.data,n=this.hls;switch(r.event){case"init":{var i;const a=(i=this.workerContext)==null?void 0:i.objectURL;a&&self.URL.revokeObjectURL(a);break}case"transmuxComplete":{this.handleTransmuxComplete(r.data);break}case"flush":{this.onFlush(r.data);break}case"workerLog":G[r.data.logType]&&G[r.data.logType](r.data.message);break;default:{r.data=r.data||{},r.data.frag=this.frag,r.data.id=this.id,n.trigger(r.event,r.data);break}}}configureTransmuxer(e){const{transmuxer:r}=this;this.workerContext?this.workerContext.worker.postMessage({cmd:"configure",config:e}):r&&r.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}const BGe=250,yT=2,UGe=.1,jGe=.05;class HGe{constructor(e,r,n,i){this.config=void 0,this.media=null,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=e,this.media=r,this.fragmentTracker=n,this.hls=i}destroy(){this.media=null,this.hls=this.fragmentTracker=null}poll(e,r){const{config:n,media:i,stalled:a}=this;if(i===null)return;const{currentTime:s,seeking:o}=i,c=this.seeking&&!o,l=!this.seeking&&o;if(this.seeking=o,s!==e){if(this.moved=!0,a!==null){if(this.stallReported){const g=self.performance.now()-a;G.warn(`playback not stuck anymore @${s}, after ${Math.round(g)}ms`),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if(l||c){this.stalled=null;return}if(i.paused&&!o||i.ended||i.playbackRate===0||!ct.getBuffered(i).length)return;const u=ct.bufferInfo(i,s,0),f=u.len>0,d=u.nextStart||0;if(!f&&!d)return;if(o){const g=u.len>yT,y=!d||r&&r.start<=s||d-s>yT&&!this.fragmentTracker.getPartialFragment(s);if(g||y)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var h;const g=Math.max(d,u.start||0)-s,y=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,b=(y==null||(h=y.details)==null?void 0:h.live)?y.details.targetduration*2:yT,_=this.fragmentTracker.getPartialFragment(s);if(g>0&&(g<=b||_)){this._trySkipBufferHole(_);return}}const p=self.performance.now();if(a===null){this.stalled=p;return}const v=p-a;if(!o&&v>=BGe&&(this._reportStall(u),!this.media))return;const m=ct.bufferInfo(i,s,n.maxBufferHole);this._tryFixBufferStall(m,v)}_tryFixBufferStall(e,r){const{config:n,fragmentTracker:i,media:a}=this;if(a===null)return;const s=a.currentTime,o=i.getPartialFragment(s);o&&(this._trySkipBufferHole(o)||!this.media)||(e.len>n.maxBufferHole||e.nextStart&&e.nextStart-sn.highBufferWatchdogPeriod*1e3&&(G.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}_reportStall(e){const{hls:r,media:n,stallReported:i}=this;if(!i&&n){this.stallReported=!0;const a=new Error(`Playback stalling at @${n.currentTime} due to low buffer (${JSON.stringify(e)})`);G.warn(a.message),r.trigger($.ERROR,{type:ye.MEDIA_ERROR,details:q.BUFFER_STALLED_ERROR,fatal:!1,error:a,buffer:e.len})}}_trySkipBufferHole(e){const{config:r,hls:n,media:i}=this;if(i===null)return 0;const a=i.currentTime,s=ct.bufferInfo(i,a,0),o=a0&&s.len<1&&i.readyState<3,u=o-a;if(u>0&&(c||l)){if(u>r.maxBufferHole){const{fragmentTracker:d}=this;let h=!1;if(a===0){const p=d.getAppendedFrag(0,xe.MAIN);p&&o1?(i=0,this.bitrateTest=!0):i=n.nextAutoLevel),this.level=n.nextLoadLevel=i,this.loadedmetadata=!1}r>0&&e===-1&&(this.log(`Override startPosition with lastCurrentTime @${r.toFixed(3)}`),e=r),this.state=X.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this._forceStartLoad=!0,this.state=X.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case X.WAITING_LEVEL:{var e;const{levels:n,level:i}=this,a=n==null||(e=n[i])==null?void 0:e.details;if(a&&(!a.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(a))break;this.state=X.IDLE;break}break}case X.FRAG_LOADING_WAITING_RETRY:{var r;const n=self.performance.now(),i=this.retryDate;(!i||n>=i||(r=this.media)!=null&&r.seeking)&&(this.resetStartWhenNotLoaded(this.level),this.state=X.IDLE)}break}this.state===X.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){super.onTickEnd(),this.checkBuffer(),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:r,levels:n,media:i}=this,{config:a,nextLoadLevel:s}=e;if(r===null||!i&&(this.startFragRequested||!a.startFragPrefetch)||this.altAudio&&this.audioOnly||!(n!=null&&n[s]))return;const o=n[s],c=this.getMainFwdBufferInfo();if(c===null)return;const l=this.getLevelDetails();if(l&&this._streamEnded(c,l)){const m={};this.altAudio&&(m.type="video"),this.hls.trigger($.BUFFER_EOS,m),this.state=X.ENDED;return}e.loadLevel!==s&&e.manualLevel===-1&&this.log(`Adapting to level ${s} from level ${this.level}`),this.level=e.nextLoadLevel=s;const u=o.details;if(!u||this.state===X.WAITING_LEVEL||u.live&&this.levelLastLoaded!==s){this.level=s,this.state=X.WAITING_LEVEL;return}const f=c.len,d=this.getMaxBufferLength(o.maxBitrate);if(f>=d)return;this.backtrackFragment&&this.backtrackFragment.start>c.end&&(this.backtrackFragment=null);const h=this.backtrackFragment?this.backtrackFragment.start:c.end;let p=this.getNextFragment(h,u);if(this.couldBacktrack&&!this.fragPrevious&&p&&p.sn!=="initSegment"&&this.fragmentTracker.getState(p)!==Tr.OK){var v;const g=((v=this.backtrackFragment)!=null?v:p).sn-u.startSN,y=u.fragments[g-1];y&&p.cc===y.cc&&(p=y,this.fragmentTracker.removeFragment(y))}else this.backtrackFragment&&c.len&&(this.backtrackFragment=null);if(p&&this.isLoopLoading(p,h)){if(!p.gap){const g=this.audioOnly&&!this.altAudio?Qe.AUDIO:Qe.VIDEO,y=(g===Qe.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;y&&this.afterBufferFlushed(y,g,xe.MAIN)}p=this.getNextFragmentLoopLoading(p,u,c,xe.MAIN,d)}p&&(p.initSegment&&!p.initSegment.data&&!this.bitrateTest&&(p=p.initSegment),this.loadFragment(p,o,h))}loadFragment(e,r,n){const i=this.fragmentTracker.getState(e);this.fragCurrent=e,i===Tr.NOT_LOADED?e.sn==="initSegment"?this._loadInitSegment(e,r):this.bitrateTest?(this.log(`Fragment ${e.sn} of level ${e.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(e,r)):(this.startFragRequested=!0,super.loadFragment(e,r,n)):this.clearTrackerIfNeeded(e)}getAppendedFrag(e){const r=this.fragmentTracker.getAppendedFrag(e,xe.MAIN);return r&&"fragment"in r?r.fragment:r}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,xe.MAIN)}followingBufferedFrag(e){return e?this.getBufferedFrag(e.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:e,media:r}=this;if(r!=null&&r.readyState){let n;const i=this.getAppendedFrag(r.currentTime);if(i&&i.start>1&&this.flushMainBuffer(0,i.start-1),!r.paused&&e){const s=this.hls.nextLoadLevel,o=e[s],c=this.fragLastKbps;c&&this.fragCurrent?n=this.fragCurrent.duration*o.maxBitrate/(1e3*c)+1:n=0}else n=0;const a=this.getBufferedFrag(r.currentTime+n);if(a){const s=this.followingBufferedFrag(a);if(s){this.abortCurrentFrag();const o=s.maxStartPTS?s.maxStartPTS:s.start,c=s.duration,l=Math.max(a.end,o+Math.min(Math.max(c-this.config.maxFragLookUpTolerance,c*.5),c*.75));this.flushMainBuffer(l,Number.POSITIVE_INFINITY)}}}}abortCurrentFrag(){const e=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,e&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.state){case X.KEY_LOADING:case X.FRAG_LOADING:case X.FRAG_LOADING_WAITING_RETRY:case X.PARSING:case X.PARSED:this.state=X.IDLE;break}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(e,r){super.flushMainBuffer(e,r,this.altAudio?"video":null)}onMediaAttached(e,r){super.onMediaAttached(e,r);const n=r.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),n.addEventListener("playing",this.onvplaying),n.addEventListener("seeked",this.onvseeked),this.gapController=new HGe(this.config,n,this.fragmentTracker,this.hls)}onMediaDetaching(){const{media:e}=this;e&&this.onvplaying&&this.onvseeked&&(e.removeEventListener("playing",this.onvplaying),e.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),super.onMediaDetaching()}onMediaPlaying(){this.tick()}onMediaSeeked(){const e=this.media,r=e?e.currentTime:null;me(r)&&this.log(`Media seeked to ${r.toFixed(3)}`);const n=this.getMainFwdBufferInfo();if(n===null||n.len===0){this.warn(`Main forward buffer length on "seeked" event ${n?n.len:"empty"})`);return}this.tick()}onManifestLoading(){this.log("Trigger BUFFER_RESET"),this.hls.trigger($.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null,this.backtrackFragment=null}onManifestParsed(e,r){let n=!1,i=!1,a;r.levels.forEach(s=>{a=s.audioCodec,a&&(a.indexOf("mp4a.40.2")!==-1&&(n=!0),a.indexOf("mp4a.40.5")!==-1&&(i=!0))}),this.audioCodecSwitch=n&&i&&!iGe(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=r.levels,this.startFragRequested=!1}onLevelLoading(e,r){const{levels:n}=this;if(!n||this.state!==X.IDLE)return;const i=n[r.level];(!i.details||i.details.live&&this.levelLastLoaded!==r.level||this.waitForCdnTuneIn(i.details))&&(this.state=X.WAITING_LEVEL)}onLevelLoaded(e,r){var n;const{levels:i}=this,a=r.level,s=r.details,o=s.totalduration;if(!i){this.warn(`Levels were reset while loading level ${a}`);return}this.log(`Level ${a} loaded [${s.startSN},${s.endSN}], cc [${s.startCC}, ${s.endCC}] duration:${o}`);const c=i[a],l=this.fragCurrent;l&&(this.state===X.FRAG_LOADING||this.state===X.FRAG_LOADING_WAITING_RETRY)&&(l.level!==r.level||l.urlId!==c.urlId)&&l.loader&&this.abortCurrentFrag();let u=0;if(s.live||(n=c.details)!=null&&n.live){if(s.fragments[0]||(s.deltaUpdateFailed=!0),s.deltaUpdateFailed)return;u=this.alignPlaylists(s,c.details)}if(c.details=s,this.levelLastLoaded=a,this.hls.trigger($.LEVEL_UPDATED,{details:s,level:a}),this.state===X.WAITING_LEVEL){if(this.waitForCdnTuneIn(s))return;this.state=X.IDLE}this.startFragRequested?s.live&&this.synchronizeToLiveEdge(s):this.setStartPosition(s,u),this.tick()}_handleFragmentLoadProgress(e){var r;const{frag:n,part:i,payload:a}=e,{levels:s}=this;if(!s){this.warn(`Levels were reset while fragment load was in progress. Fragment ${n.sn} of level ${n.level} will not be buffered`);return}const o=s[n.level],c=o.details;if(!c){this.warn(`Dropping fragment ${n.sn} of level ${n.level} after level details were reset`),this.fragmentTracker.removeFragment(n);return}const l=o.videoCodec,u=c.PTSKnown||!c.live,f=(r=n.initSegment)==null?void 0:r.data,d=this._getAudioCodec(o),h=this.transmuxer=this.transmuxer||new QQ(this.hls,xe.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),p=i?i.index:-1,v=p!==-1,m=new LO(n.level,n.sn,n.stats.chunkCount,a.byteLength,p,v),g=this.initPTS[n.cc];h.push(a,f,d,l,n,i,c.totalduration,u,m,g)}onAudioTrackSwitching(e,r){const n=this.altAudio;if(!!!r.url){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const s=this.fragCurrent;s&&(this.log("Switching to main audio track, cancel main fragment load"),s.abortRequests(),this.fragmentTracker.removeFragment(s)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();const a=this.hls;n&&(a.trigger($.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null}),this.fragmentTracker.removeAllFragments()),a.trigger($.AUDIO_TRACK_SWITCHED,r)}}onAudioTrackSwitched(e,r){const n=r.id,i=!!this.hls.audioTracks[n].url;if(i){const a=this.videoBuffer;a&&this.mediaBuffer!==a&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=a)}this.altAudio=i,this.tick()}onBufferCreated(e,r){const n=r.tracks;let i,a,s=!1;for(const o in n){const c=n[o];if(c.id==="main"){if(a=o,i=c,o==="video"){const l=n[o];l&&(this.videoBuffer=l.buffer)}}else s=!0}s&&i?(this.log(`Alternate track found, use ${a}.buffered to schedule main fragment loading`),this.mediaBuffer=i.buffer):this.mediaBuffer=this.media}onFragBuffered(e,r){const{frag:n,part:i}=r;if(n&&n.type!==xe.MAIN)return;if(this.fragContextChanged(n)){this.warn(`Fragment ${n.sn}${i?" p: "+i.index:""} of level ${n.level} finished buffering, but was aborted. state: ${this.state}`),this.state===X.PARSED&&(this.state=X.IDLE);return}const a=i?i.stats:n.stats;this.fragLastKbps=Math.round(8*a.total/(a.buffering.end-a.loading.first)),n.sn!=="initSegment"&&(this.fragPrevious=n),this.fragBufferedComplete(n,i)}onError(e,r){var n;if(r.fatal){this.state=X.ERROR;return}switch(r.details){case q.FRAG_GAP:case q.FRAG_PARSING_ERROR:case q.FRAG_DECRYPT_ERROR:case q.FRAG_LOAD_ERROR:case q.FRAG_LOAD_TIMEOUT:case q.KEY_LOAD_ERROR:case q.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(xe.MAIN,r);break;case q.LEVEL_LOAD_ERROR:case q.LEVEL_LOAD_TIMEOUT:case q.LEVEL_PARSING_ERROR:!r.levelRetry&&this.state===X.WAITING_LEVEL&&((n=r.context)==null?void 0:n.type)===He.LEVEL&&(this.state=X.IDLE);break;case q.BUFFER_FULL_ERROR:if(!r.parent||r.parent!=="main")return;this.reduceLengthAndFlushBuffer(r)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case q.INTERNAL_EXCEPTION:this.recoverWorkerError(r);break}}checkBuffer(){const{media:e,gapController:r}=this;if(!(!e||!r||!e.readyState)){if(this.loadedmetadata||!ct.getBuffered(e).length){const n=this.state!==X.IDLE?this.fragCurrent:null;r.poll(this.lastCurrentTime,n)}this.lastCurrentTime=e.currentTime}}onFragLoadEmergencyAborted(){this.state=X.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()}onBufferFlushed(e,{type:r}){if(r!==Qe.AUDIO||this.audioOnly&&!this.altAudio){const n=(r===Qe.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(n,r,xe.MAIN)}}onLevelsUpdated(e,r){this.levels=r.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:e}=this;if(!e)return;const r=e.currentTime;let n=this.startPosition;if(n>=0&&r0&&(s{const{hls:i}=this;if(!n||this.fragContextChanged(e))return;r.fragmentError=0,this.state=X.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const a=e.stats;a.parsing.start=a.parsing.end=a.buffering.start=a.buffering.end=self.performance.now(),i.trigger($.FRAG_LOADED,n),e.bitrateTest=!1})}_handleTransmuxComplete(e){var r;const n="main",{hls:i}=this,{remuxResult:a,chunkMeta:s}=e,o=this.getCurrentContext(s);if(!o){this.resetWhenMissingContext(s);return}const{frag:c,part:l,level:u}=o,{video:f,text:d,id3:h,initSegment:p}=a,{details:v}=u,m=this.altAudio?void 0:a.audio;if(this.fragContextChanged(c)){this.fragmentTracker.removeFragment(c);return}if(this.state=X.PARSING,p){p.tracks&&(this._bufferInitSegment(u,p.tracks,c,s),i.trigger($.FRAG_PARSING_INIT_SEGMENT,{frag:c,id:n,tracks:p.tracks}));const g=p.initPTS,y=p.timescale;me(g)&&(this.initPTS[c.cc]={baseTime:g,timescale:y},i.trigger($.INIT_PTS_FOUND,{frag:c,id:n,initPTS:g,timescale:y}))}if(f&&a.independent!==!1){if(v){const{startPTS:g,endPTS:y,startDTS:x,endDTS:b}=f;if(l)l.elementaryStreams[f.type]={startPTS:g,endPTS:y,startDTS:x,endDTS:b};else if(f.firstKeyFrame&&f.independent&&s.id===1&&(this.couldBacktrack=!0),f.dropped&&f.independent){const _=this.getMainFwdBufferInfo(),S=(_?_.end:this.getLoadPosition())+this.config.maxBufferHole,w=f.firstKeyFramePTS?f.firstKeyFramePTS:g;if(S{const u=r[c].initSegment;u!=null&&u.byteLength&&this.hls.trigger($.BUFFER_APPENDING,{type:c,data:u,frag:n,part:null,chunkMeta:i,parent:n.type})}),this.tick()}getMainFwdBufferInfo(){return this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,xe.MAIN)}backtrack(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=X.IDLE}checkFragmentChanged(){const e=this.media;let r=null;if(e&&e.readyState>1&&e.seeking===!1){const n=e.currentTime;if(ct.isBuffered(e,n)?r=this.getAppendedFrag(n):ct.isBuffered(e,n+.1)&&(r=this.getAppendedFrag(n+.1)),r){this.backtrackFragment=null;const i=this.fragPlaying,a=r.level;(!i||r.sn!==i.sn||i.level!==a||r.urlId!==i.urlId)&&(this.fragPlaying=r,this.hls.trigger($.FRAG_CHANGED,{frag:r}),(!i||i.level!==a)&&this.hls.trigger($.LEVEL_SWITCHED,{level:a}))}}}get nextLevel(){const e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){const e=this.media;return e?this.fragPlaying||this.getAppendedFrag(e.currentTime):null}get currentProgramDateTime(){const e=this.media;if(e){const r=e.currentTime,n=this.currentFrag;if(n&&me(r)&&me(n.programDateTime)){const i=n.programDateTime+(r-n.start)*1e3;return new Date(i)}}return null}get currentLevel(){const e=this.currentFrag;return e?e.level:-1}get nextBufferedFrag(){const e=this.currentFrag;return e?this.followingBufferedFrag(e):null}get forceStartLoad(){return this._forceStartLoad}}class Xc{constructor(e,r=0,n=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=r,this.totalWeight_=n}sample(e,r){const n=Math.pow(this.alpha_,e);this.estimate_=r*(1-n)+n*this.estimate_,this.totalWeight_+=e}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_}}class VGe{constructor(e,r,n,i=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=n,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new Xc(e),this.fast_=new Xc(r),this.defaultTTFB_=i,this.ttfb_=new Xc(e)}update(e,r){const{slow_:n,fast_:i,ttfb_:a}=this;n.halfLife!==e&&(this.slow_=new Xc(e,n.getEstimate(),n.getTotalWeight())),i.halfLife!==r&&(this.fast_=new Xc(r,i.getEstimate(),i.getTotalWeight())),a.halfLife!==e&&(this.ttfb_=new Xc(e,a.getEstimate(),a.getTotalWeight()))}sample(e,r){e=Math.max(e,this.minDelayMs_);const n=8*r,i=e/1e3,a=n/i;this.fast_.sample(i,a),this.slow_.sample(i,a)}sampleTTFB(e){const r=e/1e3,n=Math.sqrt(2)*Math.exp(-Math.pow(r,2)/2);this.ttfb_.sample(n,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}destroy(){}}class WGe{constructor(e){this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=-1,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=e;const r=e.config;this.bwEstimator=new VGe(r.abrEwmaSlowVoD,r.abrEwmaFastVoD,r.abrEwmaDefaultEstimate),this.registerListeners()}registerListeners(){const{hls:e}=this;e.on($.FRAG_LOADING,this.onFragLoading,this),e.on($.FRAG_LOADED,this.onFragLoaded,this),e.on($.FRAG_BUFFERED,this.onFragBuffered,this),e.on($.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on($.LEVEL_LOADED,this.onLevelLoaded,this)}unregisterListeners(){const{hls:e}=this;e.off($.FRAG_LOADING,this.onFragLoading,this),e.off($.FRAG_LOADED,this.onFragLoaded,this),e.off($.FRAG_BUFFERED,this.onFragBuffered,this),e.off($.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off($.LEVEL_LOADED,this.onLevelLoaded,this)}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null}onFragLoading(e,r){var n;const i=r.frag;this.ignoreFragment(i)||(this.fragCurrent=i,this.partCurrent=(n=r.part)!=null?n:null,this.clearTimer(),this.timer=self.setInterval(this.onCheck,100))}onLevelSwitching(e,r){this.clearTimer()}getTimeToLoadFrag(e,r,n,i){const a=e+n/r,s=i?this.lastLevelLoadSec:0;return a+s}onLevelLoaded(e,r){const n=this.hls.config,{total:i,bwEstimate:a}=r.stats;me(i)&&me(a)&&(this.lastLevelLoadSec=8*i/a),r.details.live?this.bwEstimator.update(n.abrEwmaSlowLive,n.abrEwmaFastLive):this.bwEstimator.update(n.abrEwmaSlowVoD,n.abrEwmaFastVoD)}_abandonRulesCheck(){const{fragCurrent:e,partCurrent:r,hls:n}=this,{autoLevelEnabled:i,media:a}=n;if(!e||!a)return;const s=performance.now(),o=r?r.stats:e.stats,c=r?r.duration:e.duration,l=s-o.loading.start;if(o.aborted||o.loaded&&o.loaded===o.total||e.level===0){this.clearTimer(),this._nextAutoLevel=-1;return}if(!i||a.paused||!a.playbackRate||!a.readyState)return;const u=n.mainForwardBufferInfo;if(u===null)return;const f=this.bwEstimator.getEstimateTTFB(),d=Math.abs(a.playbackRate);if(l<=Math.max(f,1e3*(c/(d*2))))return;const h=u.len/d;if(h>=2*c/d)return;const p=o.loading.first?o.loading.first-o.loading.start:-1,v=o.loaded&&p>-1,m=this.bwEstimator.getEstimate(),{levels:g,minAutoLevel:y}=n,x=g[e.level],b=o.total||Math.max(o.loaded,Math.round(c*x.maxBitrate/8));let _=l-p;_<1&&v&&(_=Math.min(l,o.loaded*8/m));const S=v?o.loaded*1e3/_:0,w=S?(b-o.loaded)/S:b*8/m+f/1e3;if(w<=h)return;const R=S?S*8:m;let I=Number.POSITIVE_INFINITY,T;for(T=e.level-1;T>y;T--){const C=g[T].maxBitrate;if(I=this.getTimeToLoadFrag(f/1e3,R,c*C,!g[T].details),I=w||I>c*10||(n.nextLoadLevel=T,v?this.bwEstimator.sample(l-Math.min(f,p),o.loaded):this.bwEstimator.sampleTTFB(l),this.clearTimer(),G.warn(`[abr] Fragment ${e.sn}${r?" part "+r.index:""} of level ${e.level} is loading too slowly; + Time to underbuffer: ${h.toFixed(3)} s + Estimated load time for current fragment: ${w.toFixed(3)} s + Estimated load time for down switch fragment: ${I.toFixed(3)} s + TTFB estimate: ${p} + Current BW estimate: ${me(m)?(m/1024).toFixed(3):"Unknown"} Kb/s + New BW estimate: ${(this.bwEstimator.getEstimate()/1024).toFixed(3)} Kb/s + Aborting and switching to level ${T}`),e.loader&&(this.fragCurrent=this.partCurrent=null,e.abortRequests()),n.trigger($.FRAG_LOAD_EMERGENCY_ABORTED,{frag:e,part:r,stats:o}))}onFragLoaded(e,{frag:r,part:n}){const i=n?n.stats:r.stats;if(r.type===xe.MAIN&&this.bwEstimator.sampleTTFB(i.loading.first-i.loading.start),!this.ignoreFragment(r)){if(this.clearTimer(),this.lastLoadedFragLevel=r.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){const a=n?n.duration:r.duration,s=this.hls.levels[r.level],o=(s.loaded?s.loaded.bytes:0)+i.loaded,c=(s.loaded?s.loaded.duration:0)+a;s.loaded={bytes:o,duration:c},s.realBitrate=Math.round(8*o/c)}if(r.bitrateTest){const a={stats:i,frag:r,part:n,id:r.type};this.onFragBuffered($.FRAG_BUFFERED,a),r.bitrateTest=!1}}}onFragBuffered(e,r){const{frag:n,part:i}=r,a=i!=null&&i.stats.loaded?i.stats:n.stats;if(a.aborted||this.ignoreFragment(n))return;const s=a.parsing.end-a.loading.start-Math.min(a.loading.first-a.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(s,a.loaded),a.bwEstimate=this.bwEstimator.getEstimate(),n.bitrateTest?this.bitrateTestDelay=s/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==xe.MAIN||e.sn==="initSegment"}clearTimer(){self.clearInterval(this.timer)}get nextAutoLevel(){const e=this._nextAutoLevel,r=this.bwEstimator;if(e!==-1&&!r.canEstimate())return e;let n=this.getNextABRAutoLevel();if(e!==-1){const i=this.hls.levels;if(i.length>Math.max(e,n)&&i[e].loadError<=i[n].loadError)return e}return e!==-1&&(n=Math.min(e,n)),n}getNextABRAutoLevel(){const{fragCurrent:e,partCurrent:r,hls:n}=this,{maxAutoLevel:i,config:a,minAutoLevel:s,media:o}=n,c=r?r.duration:e?e.duration:0,l=o&&o.playbackRate!==0?Math.abs(o.playbackRate):1,u=this.bwEstimator?this.bwEstimator.getEstimate():a.abrEwmaDefaultEstimate,f=n.mainForwardBufferInfo,d=(f?f.len:0)/l;let h=this.findBestLevel(u,s,i,d,a.abrBandWidthFactor,a.abrBandWidthUpFactor);if(h>=0)return h;G.trace(`[abr] ${d?"rebuffering expected":"buffer is empty"}, finding optimal quality level`);let p=c?Math.min(c,a.maxStarvationDelay):a.maxStarvationDelay,v=a.abrBandWidthFactor,m=a.abrBandWidthUpFactor;if(!d){const g=this.bitrateTestDelay;g&&(p=(c?Math.min(c,a.maxLoadingDelay):a.maxLoadingDelay)-g,G.trace(`[abr] bitrate test took ${Math.round(1e3*g)}ms, set first fragment max fetchDuration to ${Math.round(1e3*p)} ms`),v=m=1)}return h=this.findBestLevel(u,s,i,d+p,v,m),Math.max(h,0)}findBestLevel(e,r,n,i,a,s){var o;const{fragCurrent:c,partCurrent:l,lastLoadedFragLevel:u}=this,{levels:f}=this.hls,d=f[u],h=!!(d!=null&&(o=d.details)!=null&&o.live),p=d==null?void 0:d.codecSet,v=l?l.duration:c?c.duration:0,m=this.bwEstimator.getEstimateTTFB()/1e3;let g=r,y=-1;for(let x=n;x>=r;x--){const b=f[x];if(!b||p&&b.codecSet!==p){b&&(g=Math.min(x,g),y=Math.max(x,y));continue}y!==-1&&G.trace(`[abr] Skipped level(s) ${g}-${y} with CODECS:"${f[y].attrs.CODECS}"; not compatible with "${d.attrs.CODECS}"`);const _=b.details,S=(l?_==null?void 0:_.partTarget:_==null?void 0:_.averagetargetduration)||v;let w;x<=u?w=a*e:w=s*e;const R=f[x].maxBitrate,I=this.getTimeToLoadFrag(m,w,R*S,_===void 0);if(G.trace(`[abr] level:${x} adjustedbw-bitrate:${Math.round(w-R)} avgDuration:${S.toFixed(1)} maxFetchDuration:${i.toFixed(1)} fetchDuration:${I.toFixed(1)}`),w>R&&(I===0||!me(I)||h&&!this.bitrateTestDelay||I0&&e===-1?(this.log(`Override startPosition with lastCurrentTime @${r.toFixed(3)}`),e=r,this.state=X.IDLE):(this.loadedmetadata=!1,this.state=X.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}doTick(){switch(this.state){case X.IDLE:this.doTickIdle();break;case X.WAITING_TRACK:{var e;const{levels:n,trackId:i}=this,a=n==null||(e=n[i])==null?void 0:e.details;if(a){if(this.waitForCdnTuneIn(a))break;this.state=X.WAITING_INIT_PTS}break}case X.FRAG_LOADING_WAITING_RETRY:{var r;const n=performance.now(),i=this.retryDate;(!i||n>=i||(r=this.media)!=null&&r.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded(this.trackId),this.state=X.IDLE);break}case X.WAITING_INIT_PTS:{const n=this.waitingData;if(n){const{frag:i,part:a,cache:s,complete:o}=n;if(this.initPTS[i.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=X.FRAG_LOADING;const c=s.flush(),l={frag:i,part:a,payload:c,networkDetails:null};this._handleFragmentLoadProgress(l),o&&super._handleFragmentLoadComplete(l)}else if(this.videoTrackCC!==this.waitingVideoCC)this.log(`Waiting fragment cc (${i.cc}) cancelled because video is at cc ${this.videoTrackCC}`),this.clearWaitingFragment();else{const c=this.getLoadPosition(),l=ct.bufferInfo(this.mediaBuffer,c,this.config.maxBufferHole);QA(l.end,this.config.maxFragLookUpTolerance,i)<0&&(this.log(`Waiting fragment cc (${i.cc}) @ ${i.start} cancelled because another fragment at ${l.end} is needed`),this.clearWaitingFragment())}}else this.state=X.IDLE}}this.onTickEnd()}clearWaitingFragment(){const e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=X.IDLE)}resetLoadingState(){this.clearWaitingFragment(),super.resetLoadingState()}onTickEnd(){const{media:e}=this;e!=null&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){const{hls:e,levels:r,media:n,trackId:i}=this,a=e.config;if(!(r!=null&&r[i])||!n&&(this.startFragRequested||!a.startFragPrefetch))return;const s=r[i],o=s.details;if(!o||o.live&&this.levelLastLoaded!==i||this.waitForCdnTuneIn(o)){this.state=X.WAITING_TRACK;return}const c=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&c&&(this.bufferFlushed=!1,this.afterBufferFlushed(c,Qe.AUDIO,xe.AUDIO));const l=this.getFwdBufferInfo(c,xe.AUDIO);if(l===null)return;const{bufferedTrack:u,switchingTrack:f}=this;if(!f&&this._streamEnded(l,o)){e.trigger($.BUFFER_EOS,{type:"audio"}),this.state=X.ENDED;return}const d=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,xe.MAIN),h=l.len,p=this.getMaxBufferLength(d==null?void 0:d.len);if(h>=p&&!f)return;const m=o.fragments[0].start;let g=l.end;if(f&&n){const _=this.getLoadPosition();u&&f.attrs!==u.attrs&&(g=_),o.PTSKnown&&_m||l.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),n.currentTime=m+.05)}let y=this.getNextFragment(g,o),x=!1;if(y&&this.isLoopLoading(y,g)&&(x=!!y.gap,y=this.getNextFragmentLoopLoading(y,o,l,xe.MAIN,p)),!y){this.bufferFlushed=!0;return}const b=d&&y.start>d.end+o.targetduration;if(b||!(d!=null&&d.len)&&l.len){const _=this.fragmentTracker.getBufferedFrag(y.start,xe.MAIN);if(_===null||(x||(x=!!_.gap||!!b&&d.len===0),b&&!x||x&&l.nextStart&&l.nextStart<_.end))return}this.loadFragment(y,s,g)}getMaxBufferLength(e){const r=super.getMaxBufferLength();return e?Math.min(Math.max(r,e),this.config.maxMaxBufferLength):r}onMediaDetaching(){this.videoBuffer=null,super.onMediaDetaching()}onAudioTracksUpdated(e,{audioTracks:r}){this.resetTransmuxer(),this.levels=r.map(n=>new tp(n))}onAudioTrackSwitching(e,r){const n=!!r.url;this.trackId=r.id;const{fragCurrent:i}=this;i&&(i.abortRequests(),this.removeUnbufferedFrags(i.start)),this.resetLoadingState(),n?this.setInterval(uB):this.resetTransmuxer(),n?(this.switchingTrack=r,this.state=X.IDLE):(this.switchingTrack=null,this.bufferedTrack=r,this.state=X.STOPPED),this.tick()}onManifestLoading(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1,this.bufferedTrack=null,this.switchingTrack=null}onLevelLoaded(e,r){this.mainDetails=r.details,this.cachedTrackLoadedData!==null&&(this.hls.trigger($.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData),this.cachedTrackLoadedData=null)}onAudioTrackLoaded(e,r){var n;if(this.mainDetails==null){this.cachedTrackLoadedData=r;return}const{levels:i}=this,{details:a,id:s}=r;if(!i){this.warn(`Audio tracks were reset while loading level ${s}`);return}this.log(`Track ${s} loaded [${a.startSN},${a.endSN}],duration:${a.totalduration}`);const o=i[s];let c=0;if(a.live||(n=o.details)!=null&&n.live){const l=this.mainDetails;if(a.fragments[0]||(a.deltaUpdateFailed=!0),a.deltaUpdateFailed||!l)return;!o.details&&a.hasProgramDateTime&&l.hasProgramDateTime?(MQ(a,l),c=a.fragments[0].start):c=this.alignPlaylists(a,o.details)}o.details=a,this.levelLastLoaded=s,!this.startFragRequested&&(this.mainDetails||!a.live)&&this.setStartPosition(o.details,c),this.state===X.WAITING_TRACK&&!this.waitForCdnTuneIn(a)&&(this.state=X.IDLE),this.tick()}_handleFragmentLoadProgress(e){var r;const{frag:n,part:i,payload:a}=e,{config:s,trackId:o,levels:c}=this;if(!c){this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${n.sn} of level ${n.level} will not be buffered`);return}const l=c[o];if(!l){this.warn("Audio track is undefined on fragment load progress");return}const u=l.details;if(!u){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(n.start);return}const f=s.defaultAudioCodec||l.audioCodec||"mp4a.40.2";let d=this.transmuxer;d||(d=this.transmuxer=new QQ(this.hls,xe.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const h=this.initPTS[n.cc],p=(r=n.initSegment)==null?void 0:r.data;if(h!==void 0){const m=i?i.index:-1,g=m!==-1,y=new LO(n.level,n.sn,n.stats.chunkCount,a.byteLength,m,g);d.push(a,p,f,"",n,i,u.totalduration,!1,y,h)}else{this.log(`Unknown video PTS for cc ${n.cc}, waiting for video PTS before demuxing audio frag ${n.sn} of [${u.startSN} ,${u.endSN}],track ${o}`);const{cache:v}=this.waitingData=this.waitingData||{frag:n,part:i,cache:new ZQ,complete:!1};v.push(new Uint8Array(a)),this.waitingVideoCC=this.videoTrackCC,this.state=X.WAITING_INIT_PTS}}_handleFragmentLoadComplete(e){if(this.waitingData){this.waitingData.complete=!0;return}super._handleFragmentLoadComplete(e)}onBufferReset(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1}onBufferCreated(e,r){const n=r.tracks.audio;n&&(this.mediaBuffer=n.buffer||null),r.tracks.video&&(this.videoBuffer=r.tracks.video.buffer||null)}onFragBuffered(e,r){const{frag:n,part:i}=r;if(n.type!==xe.AUDIO){if(!this.loadedmetadata&&n.type===xe.MAIN){var a;(a=this.videoBuffer||this.media)!=null&&a.buffered.length&&(this.loadedmetadata=!0)}return}if(this.fragContextChanged(n)){this.warn(`Fragment ${n.sn}${i?" p: "+i.index:""} of level ${n.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);return}if(n.sn!=="initSegment"){this.fragPrevious=n;const s=this.switchingTrack;s&&(this.bufferedTrack=s,this.switchingTrack=null,this.hls.trigger($.AUDIO_TRACK_SWITCHED,sn({},s)))}this.fragBufferedComplete(n,i)}onError(e,r){var n;if(r.fatal){this.state=X.ERROR;return}switch(r.details){case q.FRAG_GAP:case q.FRAG_PARSING_ERROR:case q.FRAG_DECRYPT_ERROR:case q.FRAG_LOAD_ERROR:case q.FRAG_LOAD_TIMEOUT:case q.KEY_LOAD_ERROR:case q.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(xe.AUDIO,r);break;case q.AUDIO_TRACK_LOAD_ERROR:case q.AUDIO_TRACK_LOAD_TIMEOUT:case q.LEVEL_PARSING_ERROR:!r.levelRetry&&this.state===X.WAITING_TRACK&&((n=r.context)==null?void 0:n.type)===He.AUDIO_TRACK&&(this.state=X.IDLE);break;case q.BUFFER_FULL_ERROR:if(!r.parent||r.parent!=="audio")return;this.reduceLengthAndFlushBuffer(r)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case q.INTERNAL_EXCEPTION:this.recoverWorkerError(r);break}}onBufferFlushed(e,{type:r}){r===Qe.AUDIO&&(this.bufferFlushed=!0,this.state===X.ENDED&&(this.state=X.IDLE))}_handleTransmuxComplete(e){var r;const n="audio",{hls:i}=this,{remuxResult:a,chunkMeta:s}=e,o=this.getCurrentContext(s);if(!o){this.resetWhenMissingContext(s);return}const{frag:c,part:l,level:u}=o,{details:f}=u,{audio:d,text:h,id3:p,initSegment:v}=a;if(this.fragContextChanged(c)||!f){this.fragmentTracker.removeFragment(c);return}if(this.state=X.PARSING,this.switchingTrack&&d&&this.completeAudioSwitch(this.switchingTrack),v!=null&&v.tracks&&(this._bufferInitSegment(v.tracks,c,s),i.trigger($.FRAG_PARSING_INIT_SEGMENT,{frag:c,id:n,tracks:v.tracks})),d){const{startPTS:m,endPTS:g,startDTS:y,endDTS:x}=d;l&&(l.elementaryStreams[Qe.AUDIO]={startPTS:m,endPTS:g,startDTS:y,endDTS:x}),c.setElementaryStreamInfo(Qe.AUDIO,m,g,y,x),this.bufferFragmentData(d,c,l,s)}if(p!=null&&(r=p.samples)!=null&&r.length){const m=Pt({id:n,frag:c,details:f},p);i.trigger($.FRAG_PARSING_METADATA,m)}if(h){const m=Pt({id:n,frag:c,details:f},h);i.trigger($.FRAG_PARSING_USERDATA,m)}}_bufferInitSegment(e,r,n){if(this.state!==X.PARSING)return;e.video&&delete e.video;const i=e.audio;if(!i)return;i.levelCodec=i.codec,i.id="audio",this.log(`Init audio buffer, container:${i.container}, codecs[parsed]=[${i.codec}]`),this.hls.trigger($.BUFFER_CODECS,e);const a=i.initSegment;if(a!=null&&a.byteLength){const s={type:"audio",frag:r,part:null,chunkMeta:n,parent:r.type,data:a};this.hls.trigger($.BUFFER_APPENDING,s)}this.tick()}loadFragment(e,r,n){const i=this.fragmentTracker.getState(e);if(this.fragCurrent=e,this.switchingTrack||i===Tr.NOT_LOADED||i===Tr.PARTIAL){var a;e.sn==="initSegment"?this._loadInitSegment(e,r):(a=r.details)!=null&&a.live&&!this.initPTS[e.cc]?(this.log(`Waiting for video PTS in continuity counter ${e.cc} of live stream before loading audio fragment ${e.sn} of level ${this.trackId}`),this.state=X.WAITING_INIT_PTS):(this.startFragRequested=!0,super.loadFragment(e,r,n))}else this.clearTrackerIfNeeded(e)}completeAudioSwitch(e){const{hls:r,media:n,bufferedTrack:i}=this,a=i==null?void 0:i.attrs,s=e.attrs;n&&a&&(a.CHANNELS!==s.CHANNELS||a.NAME!==s.NAME||a.LANGUAGE!==s.LANGUAGE)&&(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio")),this.bufferedTrack=e,this.switchingTrack=null,r.trigger($.AUDIO_TRACK_SWITCHED,sn({},e))}}class qGe extends OO{constructor(e){super(e,"[audio-track-controller]"),this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:e}=this;e.on($.MANIFEST_LOADING,this.onManifestLoading,this),e.on($.MANIFEST_PARSED,this.onManifestParsed,this),e.on($.LEVEL_LOADING,this.onLevelLoading,this),e.on($.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on($.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on($.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off($.MANIFEST_LOADING,this.onManifestLoading,this),e.off($.MANIFEST_PARSED,this.onManifestParsed,this),e.off($.LEVEL_LOADING,this.onLevelLoading,this),e.off($.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off($.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off($.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(e,r){this.tracks=r.audioTracks||[]}onAudioTrackLoaded(e,r){const{id:n,groupId:i,details:a}=r,s=this.tracksInGroup[n];if(!s||s.groupId!==i){this.warn(`Track with id:${n} and group:${i} not found in active group ${s.groupId}`);return}const o=s.details;s.details=r.details,this.log(`audio-track ${n} "${s.name}" lang:${s.lang} group:${i} loaded [${a.startSN}-${a.endSN}]`),n===this.trackId&&this.playlistLoaded(n,r,o)}onLevelLoading(e,r){this.switchLevel(r.level)}onLevelSwitching(e,r){this.switchLevel(r.level)}switchLevel(e){const r=this.hls.levels[e];if(!(r!=null&&r.audioGroupIds))return;const n=r.audioGroupIds[r.urlId];if(this.groupId!==n){this.groupId=n||null;const i=this.tracks.filter(s=>!n||s.groupId===n);this.selectDefaultTrack&&!i.some(s=>s.default)&&(this.selectDefaultTrack=!1),this.tracksInGroup=i;const a={audioTracks:i};this.log(`Updating audio tracks, ${i.length} track(s) found in group:${n}`),this.hls.trigger($.AUDIO_TRACKS_UPDATED,a),this.selectInitialTrack()}else this.shouldReloadPlaylist(this.currentTrack)&&this.setAudioTrack(this.trackId)}onError(e,r){r.fatal||!r.context||r.context.type===He.AUDIO_TRACK&&r.context.id===this.trackId&&r.context.groupId===this.groupId&&(this.requestScheduled=-1,this.checkRetry(r))}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}setAudioTrack(e){const r=this.tracksInGroup;if(e<0||e>=r.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();const n=this.currentTrack;r[this.trackId];const i=r[e],{groupId:a,name:s}=i;if(this.log(`Switching to audio-track ${e} "${s}" lang:${i.lang} group:${a}`),this.trackId=e,this.currentTrack=i,this.selectDefaultTrack=!1,this.hls.trigger($.AUDIO_TRACK_SWITCHING,sn({},i)),i.details&&!i.details.live)return;const o=this.switchParams(i.url,n==null?void 0:n.details);this.loadPlaylist(o)}selectInitialTrack(){const e=this.tracksInGroup,r=this.findTrackId(this.currentTrack)|this.findTrackId(null);if(r!==-1)this.setAudioTrack(r);else{const n=new Error(`No track found for running audio group-ID: ${this.groupId} track count: ${e.length}`);this.warn(n.message),this.hls.trigger($.ERROR,{type:ye.MEDIA_ERROR,details:q.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:n})}}findTrackId(e){const r=this.tracksInGroup;for(let n=0;nt[n]!==e[n])}const fB=500;class QGe extends DO{constructor(e,r,n){super(e,r,n,"[subtitle-stream-controller]",xe.SUBTITLE),this.levels=[],this.currentTrackId=-1,this.tracksBuffered=[],this.mainDetails=null,this._registerListeners()}onHandlerDestroying(){this._unregisterListeners(),this.mainDetails=null}_registerListeners(){const{hls:e}=this;e.on($.MEDIA_ATTACHED,this.onMediaAttached,this),e.on($.MEDIA_DETACHING,this.onMediaDetaching,this),e.on($.MANIFEST_LOADING,this.onManifestLoading,this),e.on($.LEVEL_LOADED,this.onLevelLoaded,this),e.on($.ERROR,this.onError,this),e.on($.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on($.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on($.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on($.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on($.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on($.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off($.MEDIA_ATTACHED,this.onMediaAttached,this),e.off($.MEDIA_DETACHING,this.onMediaDetaching,this),e.off($.MANIFEST_LOADING,this.onManifestLoading,this),e.off($.LEVEL_LOADED,this.onLevelLoaded,this),e.off($.ERROR,this.onError,this),e.off($.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off($.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off($.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off($.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off($.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off($.FRAG_BUFFERED,this.onFragBuffered,this)}startLoad(e){this.stopLoad(),this.state=X.IDLE,this.setInterval(fB),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}onManifestLoading(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()}onMediaDetaching(){this.tracksBuffered=[],super.onMediaDetaching()}onLevelLoaded(e,r){this.mainDetails=r.details}onSubtitleFragProcessed(e,r){const{frag:n,success:i}=r;if(this.fragPrevious=n,this.state=X.IDLE,!i)return;const a=this.tracksBuffered[this.currentTrackId];if(!a)return;let s;const o=n.start;for(let l=0;l=a[l].start&&o<=a[l].end){s=a[l];break}const c=n.start+n.duration;s?s.end=c:(s={start:o,end:c},a.push(s)),this.fragmentTracker.fragBuffered(n)}onBufferFlushing(e,r){const{startOffset:n,endOffset:i}=r;if(n===0&&i!==Number.POSITIVE_INFINITY){const{currentTrackId:a,levels:s}=this;if(!s.length||!s[a]||!s[a].details)return;const c=s[a].details.targetduration,l=i-c;if(l<=0)return;r.endOffsetSubtitles=Math.max(0,l),this.tracksBuffered.forEach(u=>{for(let f=0;fnew tp(n));return}this.tracksBuffered=[],this.levels=r.map(n=>{const i=new tp(n);return this.tracksBuffered[i.id]=[],i}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,xe.SUBTITLE),this.fragPrevious=null,this.mediaBuffer=null}onSubtitleTrackSwitch(e,r){if(this.currentTrackId=r.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}const n=this.levels[this.currentTrackId];n!=null&&n.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,n&&this.setInterval(fB)}onSubtitleTrackLoaded(e,r){var n;const{details:i,id:a}=r,{currentTrackId:s,levels:o}=this;if(!o.length)return;const c=o[s];if(a>=o.length||a!==s||!c)return;this.mediaBuffer=this.mediaBufferTimeRanges;let l=0;if(i.live||(n=c.details)!=null&&n.live){const u=this.mainDetails;if(i.deltaUpdateFailed||!u)return;const f=u.fragments[0];c.details?(l=this.alignPlaylists(i,c.details),l===0&&f&&(l=f.start,XA(i,l))):i.hasProgramDateTime&&u.hasProgramDateTime?(MQ(i,u),l=i.fragments[0].start):f&&(l=f.start,XA(i,l))}c.details=i,this.levelLastLoaded=a,!this.startFragRequested&&(this.mainDetails||!i.live)&&this.setStartPosition(c.details,l),this.tick(),i.live&&!this.fragCurrent&&this.media&&this.state===X.IDLE&&(rp(null,i.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),c.details=void 0))}_handleFragmentLoadComplete(e){const{frag:r,payload:n}=e,i=r.decryptdata,a=this.hls;if(!this.fragContextChanged(r)&&n&&n.byteLength>0&&i&&i.key&&i.iv&&i.method==="AES-128"){const s=performance.now();this.decrypter.decrypt(new Uint8Array(n),i.key.buffer,i.iv.buffer).catch(o=>{throw a.trigger($.ERROR,{type:ye.MEDIA_ERROR,details:q.FRAG_DECRYPT_ERROR,fatal:!1,error:o,reason:o.message,frag:r}),o}).then(o=>{const c=performance.now();a.trigger($.FRAG_DECRYPTED,{frag:r,payload:o,stats:{tstart:s,tdecrypt:c}})}).catch(o=>{this.warn(`${o.name}: ${o.message}`),this.state=X.IDLE})}}doTick(){if(!this.media){this.state=X.IDLE;return}if(this.state===X.IDLE){const{currentTrackId:e,levels:r}=this,n=r[e];if(!r.length||!n||!n.details)return;const i=n.details,a=i.targetduration,{config:s}=this,o=this.getLoadPosition(),c=ct.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],o-a,s.maxBufferHole),{end:l,len:u}=c,f=this.getFwdBufferInfo(this.media,xe.MAIN),d=this.getMaxBufferLength(f==null?void 0:f.len)+a;if(u>d)return;const h=i.fragments,p=h.length,v=i.edge;let m=null;const g=this.fragPrevious;if(l{if(i=i>>>0,i>a-1)throw new DOMException(`Failed to execute '${n}' on 'TimeRanges': The index provided (${i}) is greater than the maximum bound (${a})`);return e[i][n]};this.buffered={get length(){return e.length},end(n){return r("end",n,e.length)},start(n){return r("start",n,e.length)}}}}class JGe extends OO{constructor(e){super(e,"[subtitle-track-controller]"),this.media=null,this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0,this.queuedDefaultTrack=-1,this.trackChangeListener=()=>this.onTextTracksChanged(),this.asyncPollTrackChange=()=>this.pollTrackChange(0),this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.registerListeners()}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,super.destroy()}get subtitleDisplay(){return this._subtitleDisplay}set subtitleDisplay(e){this._subtitleDisplay=e,this.trackId>-1&&this.toggleTrackModes(this.trackId)}registerListeners(){const{hls:e}=this;e.on($.MEDIA_ATTACHED,this.onMediaAttached,this),e.on($.MEDIA_DETACHING,this.onMediaDetaching,this),e.on($.MANIFEST_LOADING,this.onManifestLoading,this),e.on($.MANIFEST_PARSED,this.onManifestParsed,this),e.on($.LEVEL_LOADING,this.onLevelLoading,this),e.on($.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on($.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on($.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off($.MEDIA_ATTACHED,this.onMediaAttached,this),e.off($.MEDIA_DETACHING,this.onMediaDetaching,this),e.off($.MANIFEST_LOADING,this.onManifestLoading,this),e.off($.MANIFEST_PARSED,this.onManifestParsed,this),e.off($.LEVEL_LOADING,this.onLevelLoading,this),e.off($.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off($.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off($.ERROR,this.onError,this)}onMediaAttached(e,r){this.media=r.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))}pollTrackChange(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,e)}onMediaDetaching(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),xT(this.media.textTracks).forEach(r=>{Ru(r)}),this.subtitleTrack=-1,this.media=null}onManifestLoading(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(e,r){this.tracks=r.subtitleTracks}onSubtitleTrackLoaded(e,r){const{id:n,details:i}=r,{trackId:a}=this,s=this.tracksInGroup[a];if(!s){this.warn(`Invalid subtitle track id ${n}`);return}const o=s.details;s.details=r.details,this.log(`subtitle track ${n} loaded [${i.startSN}-${i.endSN}]`),n===this.trackId&&this.playlistLoaded(n,r,o)}onLevelLoading(e,r){this.switchLevel(r.level)}onLevelSwitching(e,r){this.switchLevel(r.level)}switchLevel(e){const r=this.hls.levels[e];if(!(r!=null&&r.textGroupIds))return;const n=r.textGroupIds[r.urlId],i=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;if(this.groupId!==n){const a=this.tracks.filter(c=>!n||c.groupId===n);this.tracksInGroup=a;const s=this.findTrackId(i==null?void 0:i.name)||this.findTrackId();this.groupId=n||null;const o={subtitleTracks:a};this.log(`Updating subtitle tracks, ${a.length} track(s) found in "${n}" group-id`),this.hls.trigger($.SUBTITLE_TRACKS_UPDATED,o),s!==-1&&this.setSubtitleTrack(s,i)}else this.shouldReloadPlaylist(i)&&this.setSubtitleTrack(this.trackId,i)}findTrackId(e){const r=this.tracksInGroup;for(let n=0;no.groupId===this.groupId);if(e===-1)[].slice.call(i).forEach(o=>{o.mode="disabled"});else{const o=a[n];o&&(o.mode="disabled")}const s=a[e];s&&(s.mode=this.subtitleDisplay?"showing":"hidden")}setSubtitleTrack(e,r){var n;const i=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=e;return}if(this.trackId!==e&&this.toggleTrackModes(e),this.trackId===e&&(e===-1||(n=i[e])!=null&&n.details)||e<-1||e>=i.length)return;this.clearTimer();const a=i[e];if(this.log(`Switching to subtitle-track ${e}`+(a?` "${a.name}" lang:${a.lang} group:${a.groupId}`:"")),this.trackId=e,a){const{id:s,groupId:o="",name:c,type:l,url:u}=a;this.hls.trigger($.SUBTITLE_TRACK_SWITCH,{id:s,groupId:o,name:c,type:l,url:u});const f=this.switchParams(a.url,r==null?void 0:r.details);this.loadPlaylist(f)}else this.hls.trigger($.SUBTITLE_TRACK_SWITCH,{id:e})}onTextTracksChanged(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let e=-1;const r=xT(this.media.textTracks);for(let n=0;n{r=a}),i={execute:r,onStart:()=>{},onComplete:()=>{},onError:()=>{}};return this.append(i,e),n}executeNext(e){const{buffers:r,queues:n}=this,i=r[e],a=n[e];if(a.length){const s=a[0];try{s.execute()}catch(o){G.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),s.onError(o),i!=null&&i.updating||(a.shift(),this.executeNext(e))}}}shiftAndExecuteNext(e){this.queues[e].shift(),this.executeNext(e)}current(e){return this.queues[e][0]}}const dB=MO(),hB=/([ha]vc.)(?:\.[^.,]+)+/;class tVe{constructor(e){this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=()=>{const{media:r,mediaSource:n}=this;G.log("[buffer-controller]: Media source opened"),r&&(r.removeEventListener("emptied",this._onMediaEmptied),this.updateMediaElementDuration(),this.hls.trigger($.MEDIA_ATTACHED,{media:r})),n&&n.removeEventListener("sourceopen",this._onMediaSourceOpen),this.checkPendingTracks()},this._onMediaSourceClose=()=>{G.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=()=>{G.log("[buffer-controller]: Media source ended")},this._onMediaEmptied=()=>{const{media:r,_objectUrl:n}=this;r&&r.src!==n&&G.error(`Media element src was set while attaching MediaSource (${n} > ${r.src})`)},this.hls=e,this._initSourceBuffer(),this.registerListeners()}hasSourceTypes(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=null}registerListeners(){const{hls:e}=this;e.on($.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on($.MEDIA_DETACHING,this.onMediaDetaching,this),e.on($.MANIFEST_PARSED,this.onManifestParsed,this),e.on($.BUFFER_RESET,this.onBufferReset,this),e.on($.BUFFER_APPENDING,this.onBufferAppending,this),e.on($.BUFFER_CODECS,this.onBufferCodecs,this),e.on($.BUFFER_EOS,this.onBufferEos,this),e.on($.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on($.LEVEL_UPDATED,this.onLevelUpdated,this),e.on($.FRAG_PARSED,this.onFragParsed,this),e.on($.FRAG_CHANGED,this.onFragChanged,this)}unregisterListeners(){const{hls:e}=this;e.off($.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off($.MEDIA_DETACHING,this.onMediaDetaching,this),e.off($.MANIFEST_PARSED,this.onManifestParsed,this),e.off($.BUFFER_RESET,this.onBufferReset,this),e.off($.BUFFER_APPENDING,this.onBufferAppending,this),e.off($.BUFFER_CODECS,this.onBufferCodecs,this),e.off($.BUFFER_EOS,this.onBufferEos,this),e.off($.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off($.LEVEL_UPDATED,this.onLevelUpdated,this),e.off($.FRAG_PARSED,this.onFragParsed,this),e.off($.FRAG_CHANGED,this.onFragChanged,this)}_initSourceBuffer(){this.sourceBuffer={},this.operationQueue=new eVe(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]},this.lastMpegAudioChunk=null}onManifestParsed(e,r){let n=2;(r.audio&&!r.video||!r.altAudio)&&(n=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=n,this.details=null,G.log(`${this.bufferCodecEventsExpected} bufferCodec event(s) expected`)}onMediaAttaching(e,r){const n=this.media=r.media;if(n&&dB){const i=this.mediaSource=new dB;i.addEventListener("sourceopen",this._onMediaSourceOpen),i.addEventListener("sourceended",this._onMediaSourceEnded),i.addEventListener("sourceclose",this._onMediaSourceClose),n.src=self.URL.createObjectURL(i),this._objectUrl=n.src,n.addEventListener("emptied",this._onMediaEmptied)}}onMediaDetaching(){const{media:e,mediaSource:r,_objectUrl:n}=this;if(r){if(G.log("[buffer-controller]: media source detaching"),r.readyState==="open")try{r.endOfStream()}catch(i){G.warn(`[buffer-controller]: onMediaDetaching: ${i.message} while calling endOfStream`)}this.onBufferReset(),r.removeEventListener("sourceopen",this._onMediaSourceOpen),r.removeEventListener("sourceended",this._onMediaSourceEnded),r.removeEventListener("sourceclose",this._onMediaSourceClose),e&&(e.removeEventListener("emptied",this._onMediaEmptied),n&&self.URL.revokeObjectURL(n),e.src===n?(e.removeAttribute("src"),e.load()):G.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger($.MEDIA_DETACHED,void 0)}onBufferReset(){this.getSourceBufferTypes().forEach(e=>{const r=this.sourceBuffer[e];try{r&&(this.removeBufferListeners(e),this.mediaSource&&this.mediaSource.removeSourceBuffer(r),this.sourceBuffer[e]=void 0)}catch(n){G.warn(`[buffer-controller]: Failed to reset the ${e} buffer`,n)}}),this._initSourceBuffer()}onBufferCodecs(e,r){const n=this.getSourceBufferTypes().length;Object.keys(r).forEach(i=>{if(n){const a=this.tracks[i];if(a&&typeof a.buffer.changeType=="function"){const{id:s,codec:o,levelCodec:c,container:l,metadata:u}=r[i],f=(a.levelCodec||a.codec).replace(hB,"$1"),d=(c||o).replace(hB,"$1");if(f!==d){const h=`${l};codecs=${c||o}`;this.appendChangeType(i,h),G.log(`[buffer-controller]: switching codec ${f} to ${d}`),this.tracks[i]={buffer:a.buffer,codec:o,container:l,levelCodec:c,metadata:u,id:s}}}}else this.pendingTracks[i]=r[i]}),!n&&(this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks())}appendChangeType(e,r){const{operationQueue:n}=this,i={execute:()=>{const a=this.sourceBuffer[e];a&&(G.log(`[buffer-controller]: changing ${e} sourceBuffer type to ${r}`),a.changeType(r)),n.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:a=>{G.warn(`[buffer-controller]: Failed to change ${e} SourceBuffer type`,a)}};n.append(i,e)}onBufferAppending(e,r){const{hls:n,operationQueue:i,tracks:a}=this,{data:s,type:o,frag:c,part:l,chunkMeta:u}=r,f=u.buffering[o],d=self.performance.now();f.start=d;const h=c.stats.buffering,p=l?l.stats.buffering:null;h.start===0&&(h.start=d),p&&p.start===0&&(p.start=d);const v=a.audio;let m=!1;o==="audio"&&(v==null?void 0:v.container)==="audio/mpeg"&&(m=!this.lastMpegAudioChunk||u.id===1||this.lastMpegAudioChunk.sn!==u.sn,this.lastMpegAudioChunk=u);const g=c.start,y={execute:()=>{if(f.executeStart=self.performance.now(),m){const x=this.sourceBuffer[o];if(x){const b=g-x.timestampOffset;Math.abs(b)>=.1&&(G.log(`[buffer-controller]: Updating audio SourceBuffer timestampOffset to ${g} (delta: ${b}) sn: ${c.sn})`),x.timestampOffset=g)}}this.appendExecutor(s,o)},onStart:()=>{},onComplete:()=>{const x=self.performance.now();f.executeEnd=f.end=x,h.first===0&&(h.first=x),p&&p.first===0&&(p.first=x);const{sourceBuffer:b}=this,_={};for(const S in b)_[S]=ct.getBuffered(b[S]);this.appendError=0,this.hls.trigger($.BUFFER_APPENDED,{type:o,frag:c,part:l,chunkMeta:u,parent:c.type,timeRanges:_})},onError:x=>{G.error(`[buffer-controller]: Error encountered while trying to append to the ${o} SourceBuffer`,x);const b={type:ye.MEDIA_ERROR,parent:c.type,details:q.BUFFER_APPEND_ERROR,frag:c,part:l,chunkMeta:u,error:x,err:x,fatal:!1};x.code===DOMException.QUOTA_EXCEEDED_ERR?b.details=q.BUFFER_FULL_ERROR:(this.appendError++,b.details=q.BUFFER_APPEND_ERROR,this.appendError>n.config.appendErrorMaxRetry&&(G.error(`[buffer-controller]: Failed ${n.config.appendErrorMaxRetry} times to append segment in sourceBuffer`),b.fatal=!0)),n.trigger($.ERROR,b)}};i.append(y,o)}onBufferFlushing(e,r){const{operationQueue:n}=this,i=a=>({execute:this.removeExecutor.bind(this,a,r.startOffset,r.endOffset),onStart:()=>{},onComplete:()=>{this.hls.trigger($.BUFFER_FLUSHED,{type:a})},onError:s=>{G.warn(`[buffer-controller]: Failed to remove from ${a} SourceBuffer`,s)}});r.type?n.append(i(r.type),r.type):this.getSourceBufferTypes().forEach(a=>{n.append(i(a),a)})}onFragParsed(e,r){const{frag:n,part:i}=r,a=[],s=i?i.elementaryStreams:n.elementaryStreams;s[Qe.AUDIOVIDEO]?a.push("audiovideo"):(s[Qe.AUDIO]&&a.push("audio"),s[Qe.VIDEO]&&a.push("video"));const o=()=>{const c=self.performance.now();n.stats.buffering.end=c,i&&(i.stats.buffering.end=c);const l=i?i.stats:n.stats;this.hls.trigger($.FRAG_BUFFERED,{frag:n,part:i,stats:l,id:n.type})};a.length===0&&G.warn(`Fragments must have at least one ElementaryStreamType set. type: ${n.type} level: ${n.level} sn: ${n.sn}`),this.blockBuffers(o,a)}onFragChanged(e,r){this.flushBackBuffer()}onBufferEos(e,r){this.getSourceBufferTypes().reduce((i,a)=>{const s=this.sourceBuffer[a];return s&&(!r.type||r.type===a)&&(s.ending=!0,s.ended||(s.ended=!0,G.log(`[buffer-controller]: ${a} sourceBuffer now EOS`))),i&&!!(!s||s.ended)},!0)&&(G.log("[buffer-controller]: Queueing mediaSource.endOfStream()"),this.blockBuffers(()=>{this.getSourceBufferTypes().forEach(a=>{const s=this.sourceBuffer[a];s&&(s.ending=!1)});const{mediaSource:i}=this;if(!i||i.readyState!=="open"){i&&G.info(`[buffer-controller]: Could not call mediaSource.endOfStream(). mediaSource.readyState: ${i.readyState}`);return}G.log("[buffer-controller]: Calling mediaSource.endOfStream()"),i.endOfStream()}))}onLevelUpdated(e,{details:r}){r.fragments.length&&(this.details=r,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())}flushBackBuffer(){const{hls:e,details:r,media:n,sourceBuffer:i}=this;if(!n||r===null)return;const a=this.getSourceBufferTypes();if(!a.length)return;const s=r.live&&e.config.liveBackBufferLength!==null?e.config.liveBackBufferLength:e.config.backBufferLength;if(!me(s)||s<0)return;const o=n.currentTime,c=r.levelTargetDuration,l=Math.max(s,c),u=Math.floor(o/c)*c-l;a.forEach(f=>{const d=i[f];if(d){const h=ct.getBuffered(d);if(h.length>0&&u>h.start(0)){if(e.trigger($.BACK_BUFFER_REACHED,{bufferEnd:u}),r.live)e.trigger($.LIVE_BACK_BUFFER_REACHED,{bufferEnd:u});else if(d.ended&&h.end(h.length-1)-oo&&a>s||!me(s))&&(G.log(`[buffer-controller]: Updating Media Source duration to ${a.toFixed(3)}`),i.duration=a)}updateSeekableRange(e){const r=this.mediaSource,n=e.fragments;if(n.length&&e.live&&r!=null&&r.setLiveSeekableRange){const a=Math.max(0,n[0].start),s=Math.max(a,a+e.totalduration);r.setLiveSeekableRange(a,s)}}checkPendingTracks(){const{bufferCodecEventsExpected:e,operationQueue:r,pendingTracks:n}=this,i=Object.keys(n).length;if(i&&!e||i===2){this.createSourceBuffers(n),this.pendingTracks={};const a=this.getSourceBufferTypes();if(a.length)this.hls.trigger($.BUFFER_CREATED,{tracks:this.tracks}),a.forEach(s=>{r.executeNext(s)});else{const s=new Error("could not create source buffer for media codec(s)");this.hls.trigger($.ERROR,{type:ye.MEDIA_ERROR,details:q.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:s,reason:s.message})}}}createSourceBuffers(e){const{sourceBuffer:r,mediaSource:n}=this;if(!n)throw Error("createSourceBuffers called when mediaSource was null");for(const i in e)if(!r[i]){const a=e[i];if(!a)throw Error(`source buffer exists for track ${i}, however track does not`);const s=a.levelCodec||a.codec,o=`${a.container};codecs=${s}`;G.log(`[buffer-controller]: creating sourceBuffer(${o})`);try{const c=r[i]=n.addSourceBuffer(o),l=i;this.addBufferListener(l,"updatestart",this._onSBUpdateStart),this.addBufferListener(l,"updateend",this._onSBUpdateEnd),this.addBufferListener(l,"error",this._onSBUpdateError),this.tracks[i]={buffer:c,codec:s,container:a.container,levelCodec:a.levelCodec,metadata:a.metadata,id:a.id}}catch(c){G.error(`[buffer-controller]: error while trying to add sourceBuffer: ${c.message}`),this.hls.trigger($.ERROR,{type:ye.MEDIA_ERROR,details:q.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:c,mimeType:o})}}}_onSBUpdateStart(e){const{operationQueue:r}=this;r.current(e).onStart()}_onSBUpdateEnd(e){const{operationQueue:r}=this;r.current(e).onComplete(),r.shiftAndExecuteNext(e)}_onSBUpdateError(e,r){const n=new Error(`${e} SourceBuffer error`);G.error(`[buffer-controller]: ${n}`,r),this.hls.trigger($.ERROR,{type:ye.MEDIA_ERROR,details:q.BUFFER_APPENDING_ERROR,error:n,fatal:!1});const i=this.operationQueue.current(e);i&&i.onError(r)}removeExecutor(e,r,n){const{media:i,mediaSource:a,operationQueue:s,sourceBuffer:o}=this,c=o[e];if(!i||!a||!c){G.warn(`[buffer-controller]: Attempting to remove from the ${e} SourceBuffer, but it does not exist`),s.shiftAndExecuteNext(e);return}const l=me(i.duration)?i.duration:1/0,u=me(a.duration)?a.duration:1/0,f=Math.max(0,r),d=Math.min(n,l,u);d>f&&!c.ending?(c.ended=!1,G.log(`[buffer-controller]: Removing [${f},${d}] from the ${e} SourceBuffer`),c.remove(f,d)):s.shiftAndExecuteNext(e)}appendExecutor(e,r){const{operationQueue:n,sourceBuffer:i}=this,a=i[r];if(!a){G.warn(`[buffer-controller]: Attempting to append to the ${r} SourceBuffer, but it does not exist`),n.shiftAndExecuteNext(r);return}a.ended=!1,a.appendBuffer(e)}blockBuffers(e,r=this.getSourceBufferTypes()){if(!r.length){G.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(e);return}const{operationQueue:n}=this,i=r.map(a=>n.appendBlocker(a));Promise.all(i).then(()=>{e(),r.forEach(a=>{const s=this.sourceBuffer[a];s!=null&&s.updating||n.shiftAndExecuteNext(a)})})}getSourceBufferTypes(){return Object.keys(this.sourceBuffer)}addBufferListener(e,r,n){const i=this.sourceBuffer[e];if(!i)return;const a=n.bind(this,e);this.listeners[e].push({event:r,listener:a}),i.addEventListener(r,a)}removeBufferListeners(e){const r=this.sourceBuffer[e];r&&this.listeners[e].forEach(n=>{r.removeEventListener(n.event,n.listener)})}}const pB={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},eZ=function(e){let r=e;return pB.hasOwnProperty(e)&&(r=pB[e]),String.fromCharCode(r)},yi=15,Oa=100,rVe={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},nVe={17:2,18:4,21:6,22:8,23:10,19:13,20:15},iVe={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},aVe={25:2,26:4,29:6,30:8,31:10,27:13,28:15},sVe=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class oVe{constructor(){this.time=null,this.verboseLevel=0}log(e,r){if(this.verboseLevel>=e){const n=typeof r=="function"?r():r;G.log(`${this.time} [${e}] ${n}`)}}}const pl=function(e){const r=[];for(let n=0;nOa&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=Oa)}moveCursor(e){const r=this.pos+e;if(e>1)for(let n=this.pos+1;n=144&&this.backSpace();const r=eZ(e);if(this.pos>=Oa){this.logger.log(0,()=>"Cannot insert "+e.toString(16)+" ("+r+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(r,this.currPenState),this.moveCursor(1)}clearFromPos(e){let r;for(r=e;r"pacData = "+JSON.stringify(e));let r=e.row-1;if(this.nrRollUpRows&&r"bkgData = "+JSON.stringify(e)),this.backSpace(),this.setPen(e),this.insertChar(32)}setRollUpRows(e){this.nrRollUpRows=e}rollUp(){if(this.nrRollUpRows===null){this.logger.log(3,"roll_up but nrRollUpRows not set yet");return}this.logger.log(1,()=>this.getDisplayText());const e=this.currRow+1-this.nrRollUpRows,r=this.rows.splice(e,1)[0];r.clear(),this.rows.splice(this.currRow,0,r),this.logger.log(2,"Rolling up")}getDisplayText(e){e=e||!1;const r=[];let n="",i=-1;for(let a=0;a0&&(e?n="["+r.join(" | ")+"]":n=r.join(` +`)),n}getTextAndFormat(){return this.rows}}class mB{constructor(e,r,n){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=e,this.outputFilter=r,this.mode=null,this.verbose=0,this.displayedMemory=new bT(n),this.nonDisplayedMemory=new bT(n),this.lastOutputScreen=new bT(n),this.currRollUpRow=this.displayedMemory.rows[yi-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=n}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[yi-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(e){this.outputFilter=e}setPAC(e){this.writeScreen.setPAC(e)}setBkgData(e){this.writeScreen.setBkgData(e)}setMode(e){e!==this.mode&&(this.mode=e,this.logger.log(2,()=>"MODE="+e),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)}insertChars(e){for(let n=0;nr+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(1,()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),this.mode!=="MODE_TEXT"&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(e){this.logger.log(2,"RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){const e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,()=>"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)}ccTO(e){this.logger.log(2,"TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)}ccMIDROW(e){const r={flash:!1};if(r.underline=e%2===1,r.italics=e>=46,r.italics)r.foreground="white";else{const n=Math.floor(e/2)-16,i=["white","green","blue","cyan","red","yellow","magenta"];r.foreground=i[n]}this.logger.log(2,"MIDROW: "+JSON.stringify(r)),this.writeScreen.setPen(r)}outputDataUpdate(e=!1){const r=this.logger.time;r!==null&&this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=r:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,r,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:r),this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}}class gB{constructor(e,r,n){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;const i=new oVe;this.channels=[null,new mB(e,r,i),new mB(e+1,n,i)],this.cmdHistory=yB(),this.logger=i}getHandler(e){return this.channels[e].getHandler()}setHandler(e,r){this.channels[e].setHandler(r)}addData(e,r){let n,i,a,s=!1;this.logger.time=e;for(let o=0;o ("+pl([i,a])+")"),n=this.parseCmd(i,a),n||(n=this.parseMidrow(i,a)),n||(n=this.parsePAC(i,a)),n||(n=this.parseBackgroundAttributes(i,a)),!n&&(s=this.parseChars(i,a),s)){const c=this.currentChannel;c&&c>0?this.channels[c].insertChars(s):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!n&&!s&&this.logger.log(2,"Couldn't parse cleaned data "+pl([i,a])+" orig: "+pl([r[o],r[o+1]]))}}parseCmd(e,r){const{cmdHistory:n}=this,i=(e===20||e===28||e===21||e===29)&&r>=32&&r<=47,a=(e===23||e===31)&&r>=33&&r<=35;if(!(i||a))return!1;if(vB(e,r,n))return Qc(null,null,n),this.logger.log(3,"Repeated command ("+pl([e,r])+") is dropped"),!0;const s=e===20||e===21||e===23?1:2,o=this.channels[s];return e===20||e===21||e===28||e===29?r===32?o.ccRCL():r===33?o.ccBS():r===34?o.ccAOF():r===35?o.ccAON():r===36?o.ccDER():r===37?o.ccRU(2):r===38?o.ccRU(3):r===39?o.ccRU(4):r===40?o.ccFON():r===41?o.ccRDC():r===42?o.ccTR():r===43?o.ccRTD():r===44?o.ccEDM():r===45?o.ccCR():r===46?o.ccENM():r===47&&o.ccEOC():o.ccTO(r-32),Qc(e,r,n),this.currentChannel=s,!0}parseMidrow(e,r){let n=0;if((e===17||e===25)&&r>=32&&r<=47){if(e===17?n=1:n=2,n!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const i=this.channels[n];return i?(i.ccMIDROW(r),this.logger.log(3,"MIDROW ("+pl([e,r])+")"),!0):!1}return!1}parsePAC(e,r){let n;const i=this.cmdHistory,a=(e>=17&&e<=23||e>=25&&e<=31)&&r>=64&&r<=127,s=(e===16||e===24)&&r>=64&&r<=95;if(!(a||s))return!1;if(vB(e,r,i))return Qc(null,null,i),!0;const o=e<=23?1:2;r>=64&&r<=95?n=o===1?rVe[e]:iVe[e]:n=o===1?nVe[e]:aVe[e];const c=this.channels[o];return c?(c.setPAC(this.interpretPAC(n,r)),Qc(e,r,i),this.currentChannel=o,!0):!1}interpretPAC(e,r){let n;const i={color:null,italics:!1,indent:null,underline:!1,row:e};return r>95?n=r-96:n=r-64,i.underline=(n&1)===1,n<=13?i.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(n/2)]:n<=15?(i.italics=!0,i.color="white"):i.indent=Math.floor((n-16)/2)*4,i}parseChars(e,r){let n,i=null,a=null;if(e>=25?(n=2,a=e-8):(n=1,a=e),a>=17&&a<=19){let s;a===17?s=r+80:a===18?s=r+112:s=r+144,this.logger.log(2,"Special char '"+eZ(s)+"' in channel "+n),i=[s]}else e>=32&&e<=127&&(i=r===0?[e]:[e,r]);if(i){const s=pl(i);this.logger.log(3,"Char codes = "+s.join(",")),Qc(e,r,this.cmdHistory)}return i}parseBackgroundAttributes(e,r){const n=(e===16||e===24)&&r>=32&&r<=47,i=(e===23||e===31)&&r>=45&&r<=47;if(!(n||i))return!1;let a;const s={};e===16||e===24?(a=Math.floor((r-32)/2),s.background=sVe[a],r%2===1&&(s.background=s.background+"_semi")):r===45?s.background="transparent":(s.foreground="black",r===47&&(s.underline=!0));const o=e<=23?1:2;return this.channels[o].setBkgData(s),Qc(e,r,this.cmdHistory),!0}reset(){for(let e=0;ee)&&(this.startTime=e),this.endTime=r,this.screen=n,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}var jO=function(){if(typeof self<"u"&&self.VTTCue)return self.VTTCue;const t=["","lr","rl"],e=["start","middle","end","left","right"];function r(o,c){if(typeof c!="string"||!Array.isArray(o))return!1;const l=c.toLowerCase();return~o.indexOf(l)?l:!1}function n(o){return r(t,o)}function i(o){return r(e,o)}function a(o,...c){let l=1;for(;l100)throw new Error("Position must be between 0 and 100.");S=T,this.hasBeenReset=!0}})),Object.defineProperty(u,"positionAlign",a({},f,{get:function(){return w},set:function(T){const C=i(T);if(!C)throw new SyntaxError("An invalid or illegal string was specified.");w=C,this.hasBeenReset=!0}})),Object.defineProperty(u,"size",a({},f,{get:function(){return R},set:function(T){if(T<0||T>100)throw new Error("Size must be between 0 and 100.");R=T,this.hasBeenReset=!0}})),Object.defineProperty(u,"align",a({},f,{get:function(){return I},set:function(T){const C=i(T);if(!C)throw new SyntaxError("An invalid or illegal string was specified.");I=C,this.hasBeenReset=!0}})),u.displayState=void 0}return s.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},s}();class uVe{decode(e,r){if(!e)return"";if(typeof e!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function rZ(t){function e(n,i,a,s){return(n|0)*3600+(i|0)*60+(a|0)+parseFloat(s||0)}const r=t.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return r?parseFloat(r[2])>59?e(r[2],r[3],0,r[4]):e(r[1],r[2],r[3],r[4]):null}class fVe{constructor(){this.values=Object.create(null)}set(e,r){!this.get(e)&&r!==""&&(this.values[e]=r)}get(e,r,n){return n?this.has(e)?this.values[e]:r[n]:this.has(e)?this.values[e]:r}has(e){return e in this.values}alt(e,r,n){for(let i=0;i=0&&n<=100)return this.set(e,n),!0}return!1}}function nZ(t,e,r,n){const i=n?t.split(n):[t];for(const a in i){if(typeof i[a]!="string")continue;const s=i[a].split(r);if(s.length!==2)continue;const o=s[0],c=s[1];e(o,c)}}const JA=new jO(0,0,""),Qg=JA.align==="middle"?"middle":"center";function dVe(t,e,r){const n=t;function i(){const o=rZ(t);if(o===null)throw new Error("Malformed timestamp: "+n);return t=t.replace(/^[^\sa-zA-Z-]+/,""),o}function a(o,c){const l=new fVe;nZ(o,function(d,h){let p;switch(d){case"region":for(let v=r.length-1;v>=0;v--)if(r[v].id===h){l.set(d,r[v].region);break}break;case"vertical":l.alt(d,h,["rl","lr"]);break;case"line":p=h.split(","),l.integer(d,p[0]),l.percent(d,p[0])&&l.set("snapToLines",!1),l.alt(d,p[0],["auto"]),p.length===2&&l.alt("lineAlign",p[1],["start",Qg,"end"]);break;case"position":p=h.split(","),l.percent(d,p[0]),p.length===2&&l.alt("positionAlign",p[1],["start",Qg,"end","line-left","line-right","auto"]);break;case"size":l.percent(d,h);break;case"align":l.alt(d,h,["start",Qg,"end","left","right"]);break}},/:/,/\s/),c.region=l.get("region",null),c.vertical=l.get("vertical","");let u=l.get("line","auto");u==="auto"&&JA.line===-1&&(u=-1),c.line=u,c.lineAlign=l.get("lineAlign","start"),c.snapToLines=l.get("snapToLines",!0),c.size=l.get("size",100),c.align=l.get("align",Qg);let f=l.get("position","auto");f==="auto"&&JA.position===50&&(f=c.align==="start"||c.align==="left"?0:c.align==="end"||c.align==="right"?100:50),c.position=f}function s(){t=t.replace(/^\s+/,"")}if(s(),e.startTime=i(),s(),t.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+n);t=t.slice(3),s(),e.endTime=i(),s(),a(t,e)}function iZ(t){return t.replace(//gi,` +`)}class hVe{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new uVe,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(e){const r=this;e&&(r.buffer+=r.decoder.decode(e,{stream:!0}));function n(){let a=r.buffer,s=0;for(a=iZ(a);s")===-1){r.cue.id=a;continue}case"CUE":if(!r.cue){r.state="BADCUE";continue}try{dVe(a,r.cue,r.regionList)}catch{r.cue=null,r.state="BADCUE";continue}r.state="CUETEXT";continue;case"CUETEXT":{const o=a.indexOf("-->")!==-1;if(!a||o&&(s=!0)){r.oncue&&r.cue&&r.oncue(r.cue),r.cue=null,r.state="ID";continue}if(r.cue===null)continue;r.cue.text&&(r.cue.text+=` +`),r.cue.text+=a}continue;case"BADCUE":a||(r.state="ID")}}}catch{r.state==="CUETEXT"&&r.cue&&r.oncue&&r.oncue(r.cue),r.cue=null,r.state=r.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this}flush(){const e=this;try{if((e.cue||e.state==="HEADER")&&(e.buffer+=` + +`,e.parse()),e.state==="INITIAL"||e.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(r){e.onparsingerror&&e.onparsingerror(r)}return e.onflush&&e.onflush(),this}}const pVe=/\r\n|\n\r|\n|\r/g,ET=function(e,r,n=0){return e.slice(n,n+r.length)===r},mVe=function(e){let r=parseInt(e.slice(-3));const n=parseInt(e.slice(-6,-4)),i=parseInt(e.slice(-9,-7)),a=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!me(r)||!me(n)||!me(i)||!me(a))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return r+=1e3*n,r+=60*1e3*i,r+=60*60*1e3*a,r},ST=function(e){let r=5381,n=e.length;for(;n;)r=r*33^e.charCodeAt(--n);return(r>>>0).toString()};function HO(t,e,r){return ST(t.toString())+ST(e.toString())+ST(r)}const gVe=function(e,r,n){let i=e[r],a=e[i.prevCC];if(!a||!a.new&&i.new){e.ccOffset=e.presentationOffset=i.start,i.new=!1;return}for(;(s=a)!=null&&s.new;){var s;e.ccOffset+=i.start-a.start,i.new=!1,i=a,a=e[i.prevCC]}e.presentationOffset=n};function vVe(t,e,r,n,i,a,s){const o=new hVe,c=fa(new Uint8Array(t)).trim().replace(pVe,` +`).split(` +`),l=[],u=IGe(e.baseTime,e.timescale);let f="00:00.000",d=0,h=0,p,v=!0;o.oncue=function(m){const g=r[n];let y=r.ccOffset;const x=(d-u)/9e4;g!=null&&g.new&&(h!==void 0?y=r.ccOffset=g.start:gVe(r,n,x)),x&&(y=x-r.presentationOffset);const b=m.endTime-m.startTime,_=jn((m.startTime+y-h)*9e4,i*9e4)/9e4;m.startTime=Math.max(_,0),m.endTime=Math.max(_+b,0);const S=m.text.trim();m.text=decodeURIComponent(encodeURIComponent(S)),m.id||(m.id=HO(m.startTime,m.endTime,S)),m.endTime>0&&l.push(m)},o.onparsingerror=function(m){p=m},o.onflush=function(){if(p){s(p);return}a(l)},c.forEach(m=>{if(v)if(ET(m,"X-TIMESTAMP-MAP=")){v=!1,m.slice(16).split(",").forEach(g=>{ET(g,"LOCAL:")?f=g.slice(6):ET(g,"MPEGTS:")&&(d=parseInt(g.slice(7)))});try{h=mVe(f)/1e3}catch(g){p=g}return}else m===""&&(v=!1);o.parse(m+` +`)}),o.flush()}const _T="stpp.ttml.im1t",aZ=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,sZ=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,yVe={left:"start",center:"center",right:"end",start:"start",end:"end"};function xB(t,e,r,n){const i=Be(new Uint8Array(t),["mdat"]);if(i.length===0){n(new Error("Could not parse IMSC1 mdat"));return}const a=i.map(o=>fa(o)),s=AGe(e.baseTime,1,e.timescale);try{a.forEach(o=>r(xVe(o,s)))}catch(o){n(o)}}function xVe(t,e){const i=new DOMParser().parseFromString(t,"text/xml").getElementsByTagName("tt")[0];if(!i)throw new Error("Invalid ttml");const a={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},s=Object.keys(a).reduce((f,d)=>(f[d]=i.getAttribute(`ttp:${d}`)||a[d],f),{}),o=i.getAttribute("xml:space")!=="preserve",c=bB(wT(i,"styling","style")),l=bB(wT(i,"layout","region")),u=wT(i,"body","[begin]");return[].map.call(u,f=>{const d=oZ(f,o);if(!d||!f.hasAttribute("begin"))return null;const h=RT(f.getAttribute("begin"),s),p=RT(f.getAttribute("dur"),s);let v=RT(f.getAttribute("end"),s);if(h===null)throw EB(f);if(v===null){if(p===null)throw EB(f);v=h+p}const m=new jO(h-e,v-e,d);m.id=HO(m.startTime,m.endTime,m.text);const g=l[f.getAttribute("region")],y=c[f.getAttribute("style")],x=bVe(g,y,c),{textAlign:b}=x;if(b){const _=yVe[b];_&&(m.lineAlign=_),m.align=b}return Pt(m,x),m}).filter(f=>f!==null)}function wT(t,e,r){const n=t.getElementsByTagName(e)[0];return n?[].slice.call(n.querySelectorAll(r)):[]}function bB(t){return t.reduce((e,r)=>{const n=r.getAttribute("xml:id");return n&&(e[n]=r),e},{})}function oZ(t,e){return[].slice.call(t.childNodes).reduce((r,n,i)=>{var a;return n.nodeName==="br"&&i?r+` +`:(a=n.childNodes)!=null&&a.length?oZ(n,e):e?r+n.textContent.trim().replace(/\s+/g," "):r+n.textContent},"")}function bVe(t,e,r){const n="http://www.w3.org/ns/ttml#styling";let i=null;const a=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],s=t!=null&&t.hasAttribute("style")?t.getAttribute("style"):null;return s&&r.hasOwnProperty(s)&&(i=r[s]),a.reduce((o,c)=>{const l=TT(e,n,c)||TT(t,n,c)||TT(i,n,c);return l&&(o[c]=l),o},{})}function TT(t,e,r){return t&&t.hasAttributeNS(e,r)?t.getAttributeNS(e,r):null}function EB(t){return new Error(`Could not parse ttml timestamp ${t}`)}function RT(t,e){if(!t)return null;let r=rZ(t);return r===null&&(aZ.test(t)?r=EVe(t,e):sZ.test(t)&&(r=SVe(t,e))),r}function EVe(t,e){const r=aZ.exec(t),n=(r[4]|0)+(r[5]|0)/e.subFrameRate;return(r[1]|0)*3600+(r[2]|0)*60+(r[3]|0)+n/e.frameRate}function SVe(t,e){const r=sZ.exec(t),n=Number(r[1]);switch(r[2]){case"h":return n*3600;case"m":return n*60;case"ms":return n*1e3;case"f":return n/e.frameRate;case"t":return n/e.tickRate}return n}class _Ve{constructor(e){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=SB(),this.captionsProperties=void 0,this.hls=e,this.config=e.config,this.Cues=e.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){const r=new Xg(this,"textTrack1"),n=new Xg(this,"textTrack2"),i=new Xg(this,"textTrack3"),a=new Xg(this,"textTrack4");this.cea608Parser1=new gB(1,r,n),this.cea608Parser2=new gB(3,i,a)}e.on($.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on($.MEDIA_DETACHING,this.onMediaDetaching,this),e.on($.MANIFEST_LOADING,this.onManifestLoading,this),e.on($.MANIFEST_LOADED,this.onManifestLoaded,this),e.on($.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on($.FRAG_LOADING,this.onFragLoading,this),e.on($.FRAG_LOADED,this.onFragLoaded,this),e.on($.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on($.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on($.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on($.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on($.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off($.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off($.MEDIA_DETACHING,this.onMediaDetaching,this),e.off($.MANIFEST_LOADING,this.onManifestLoading,this),e.off($.MANIFEST_LOADED,this.onManifestLoaded,this),e.off($.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off($.FRAG_LOADING,this.onFragLoading,this),e.off($.FRAG_LOADED,this.onFragLoaded,this),e.off($.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off($.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off($.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off($.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off($.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null}addCues(e,r,n,i,a){let s=!1;for(let o=a.length;o--;){const c=a[o],l=TVe(c[0],c[1],r,n);if(l>=0&&(c[0]=Math.min(c[0],r),c[1]=Math.max(c[1],n),s=!0,l/(n-r)>.5))return}if(s||a.push([r,n]),this.config.renderTextTracksNatively){const o=this.captionsTracks[e];this.Cues.newCue(o,r,n,i)}else{const o=this.Cues.newCue(null,r,n,i);this.hls.trigger($.CUES_PARSED,{type:"captions",cues:o,track:e})}}onInitPtsFound(e,{frag:r,id:n,initPTS:i,timescale:a}){const{unparsedVttFrags:s}=this;n==="main"&&(this.initPTS[r.cc]={baseTime:i,timescale:a}),s.length&&(this.unparsedVttFrags=[],s.forEach(o=>{this.onFragLoaded($.FRAG_LOADED,o)}))}getExistingTrack(e){const{media:r}=this;if(r)for(let n=0;n{Ru(e[r]),delete e[r]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=SB(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){const{media:e}=this;if(!e)return;const r=e.textTracks;if(r)for(let n=0;na.textCodec===_T);if(this.config.enableWebVTT||i&&this.config.enableIMSC1){if(JQ(this.tracks,n)){this.tracks=n;return}if(this.textTracks=[],this.tracks=n,this.config.renderTextTracksNatively){const s=this.media?this.media.textTracks:null;this.tracks.forEach((o,c)=>{let l;if(s&&c({label:o.name,kind:o.type.toLowerCase(),default:o.default,subtitleTrack:o}));this.hls.trigger($.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:s})}}}_captionsOrSubtitlesFromCharacteristics(e){if(e.attrs.CHARACTERISTICS){const r=/transcribes-spoken-dialog/gi.test(e.attrs.CHARACTERISTICS),n=/describes-music-and-sound/gi.test(e.attrs.CHARACTERISTICS);if(r&&n)return"captions"}return"subtitles"}onManifestLoaded(e,r){this.config.enableCEA708Captions&&r.captions&&r.captions.forEach(n=>{const i=/(?:CC|SERVICE)([1-4])/.exec(n.instreamId);if(!i)return;const a=`textTrack${i[1]}`,s=this.captionsProperties[a];s&&(s.label=n.name,n.lang&&(s.languageCode=n.lang),s.media=n)})}closedCaptionsForLevel(e){const r=this.hls.levels[e.level];return r==null?void 0:r.attrs["CLOSED-CAPTIONS"]}onFragLoading(e,r){const{cea608Parser1:n,cea608Parser2:i,lastSn:a,lastPartIndex:s}=this;if(!(!this.enabled||!(n&&i))&&r.frag.type===xe.MAIN){var o,c;const l=r.frag.sn,u=(o=r==null||(c=r.part)==null?void 0:c.index)!=null?o:-1;l===a+1||l===a&&u===s+1||(n.reset(),i.reset()),this.lastSn=l,this.lastPartIndex=u}}onFragLoaded(e,r){const{frag:n,payload:i}=r,{initPTS:a,unparsedVttFrags:s}=this;if(n.type===xe.SUBTITLE)if(i.byteLength){if(!a[n.cc]){s.push(r),a.length&&this.hls.trigger($.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:new Error("Missing initial subtitle PTS")});return}const o=n.decryptdata,c="stats"in r;if(o==null||!o.encrypted||c){const l=this.tracks[n.level],u=this.vttCCs;u[n.cc]||(u[n.cc]={start:n.start,prevCC:this.prevCC,new:!0},this.prevCC=n.cc),l&&l.textCodec===_T?this._parseIMSC1(n,i):this._parseVTTs(n,i,u)}}else this.hls.trigger($.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,r){const n=this.hls;xB(r,this.initPTS[e.cc],i=>{this._appendCues(i,e.level),n.trigger($.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},i=>{G.log(`Failed to parse IMSC1: ${i}`),n.trigger($.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:i})})}_parseVTTs(e,r,n){var i;const a=this.hls,s=(i=e.initSegment)!=null&&i.data?rc(e.initSegment.data,new Uint8Array(r)):r;vVe(s,this.initPTS[e.cc],n,e.cc,e.start,o=>{this._appendCues(o,e.level),a.trigger($.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},o=>{this._fallbackToIMSC1(e,r),G.log(`Failed to parse VTT cue: ${o}`),a.trigger($.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:o})})}_fallbackToIMSC1(e,r){const n=this.tracks[e.level];n.textCodec||xB(r,this.initPTS[e.cc],()=>{n.textCodec=_T,this._parseIMSC1(e,r)},()=>{n.textCodec="wvtt"})}_appendCues(e,r){const n=this.hls;if(this.config.renderTextTracksNatively){const i=this.textTracks[r];if(!i||i.mode==="disabled")return;e.forEach(a=>kQ(i,a))}else{const i=this.tracks[r];if(!i)return;const a=i.default?"default":"subtitles"+r;n.trigger($.CUES_PARSED,{type:"subtitles",cues:e,track:a})}}onFragDecrypted(e,r){const{frag:n}=r;if(n.type===xe.SUBTITLE){if(!this.initPTS[n.cc]){this.unparsedVttFrags.push(r);return}this.onFragLoaded($.FRAG_LOADED,r)}}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,r){const{cea608Parser1:n,cea608Parser2:i}=this;if(!this.enabled||!(n&&i))return;const{frag:a,samples:s}=r;if(!(a.type===xe.MAIN&&this.closedCaptionsForLevel(a)==="NONE"))for(let o=0;oKA(o[c],r,n))}if(this.config.renderTextTracksNatively&&r===0&&i!==void 0){const{textTracks:o}=this;Object.keys(o).forEach(c=>KA(o[c],r,i))}}}extractCea608Data(e){const r=[[],[]],n=e[0]&31;let i=2;for(let a=0;a0&&this.mediaWidth>0){const e=this.hls.levels;if(e.length){const r=this.hls;r.autoLevelCapping=this.getMaxLevel(e.length-1),r.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=r.autoLevelCapping}}}getMaxLevel(e){const r=this.hls.levels;if(!r.length)return-1;const n=r.filter((i,a)=>this.isLevelAllowed(i)&&a<=e);return this.clientRect=null,zO.getMaxLevelByMediaSize(n,this.mediaWidth,this.mediaHeight)}startCapping(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}stopCapping(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)}getDimensions(){if(this.clientRect)return this.clientRect;const e=this.media,r={width:0,height:0};if(e){const n=e.getBoundingClientRect();r.width=n.width,r.height=n.height,!r.width&&!r.height&&(r.width=n.right-n.left||e.width||0,r.height=n.bottom-n.top||e.height||0)}return this.clientRect=r,r}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let e=1;if(!this.hls.config.ignoreDevicePixelRatio)try{e=self.devicePixelRatio}catch{}return e}isLevelAllowed(e){return!this.restrictedLevels.some(n=>e.bitrate===n.bitrate&&e.width===n.width&&e.height===n.height)}static getMaxLevelByMediaSize(e,r,n){if(!(e!=null&&e.length))return-1;const i=(s,o)=>o?s.width!==o.width||s.height!==o.height:!0;let a=e.length-1;for(let s=0;s=r||o.height>=n)&&i(o,e[s+1])){a=s;break}}return a}}class RVe{constructor(e){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=e,this.registerListeners()}setStreamController(e){this.streamController=e}registerListeners(){this.hls.on($.MEDIA_ATTACHING,this.onMediaAttaching,this)}unregisterListeners(){this.hls.off($.MEDIA_ATTACHING,this.onMediaAttaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,r){const n=this.hls.config;if(n.capLevelOnFPSDrop){const i=r.media instanceof self.HTMLVideoElement?r.media:null;this.media=i,i&&typeof i.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),n.fpsDroppedMonitoringPeriod)}}checkFPS(e,r,n){const i=performance.now();if(r){if(this.lastTime){const a=i-this.lastTime,s=n-this.lastDroppedFrames,o=r-this.lastDecodedFrames,c=1e3*s/a,l=this.hls;if(l.trigger($.FPS_DROP,{currentDropped:s,currentDecoded:o,totalDroppedFrames:n}),c>0&&s>l.config.fpsDroppedMonitoringThreshold*o){let u=l.currentLevel;G.warn("drop FPS ratio greater than max allowed value for currentLevel: "+u),u>0&&(l.autoLevelCapping===-1||l.autoLevelCapping>=u)&&(u=u-1,l.trigger($.FPS_DROP_LEVEL_CAPPING,{level:u,droppedLevel:l.currentLevel}),l.autoLevelCapping=u,this.streamController.nextLevelSwitch())}}this.lastTime=i,this.lastDroppedFrames=n,this.lastDecodedFrames=r}}checkFPSInterval(){const e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){const r=e.getVideoPlaybackQuality();this.checkFPS(e,r.totalVideoFrames,r.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}}const Zg="[eme]";class Qu{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.setMediaKeysQueue=Qu.CDMCleanupPromise?[Qu.CDMCleanupPromise]:[],this.onMediaEncrypted=this._onMediaEncrypted.bind(this),this.onWaitingForKey=this._onWaitingForKey.bind(this),this.debug=G.debug.bind(G,Zg),this.log=G.log.bind(G,Zg),this.warn=G.warn.bind(G,Zg),this.error=G.error.bind(G,Zg),this.hls=e,this.config=e.config,this.registerListeners()}destroy(){this.unregisterListeners(),this.onMediaDetached();const e=this.config;e.requestMediaKeySystemAccessFunc=null,e.licenseXhrSetup=e.licenseResponseCallback=void 0,e.drmSystems=e.drmSystemOptions={},this.hls=this.onMediaEncrypted=this.onWaitingForKey=this.keyIdToKeySessionPromise=null,this.config=null}registerListeners(){this.hls.on($.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on($.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on($.MANIFEST_LOADED,this.onManifestLoaded,this)}unregisterListeners(){this.hls.off($.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off($.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off($.MANIFEST_LOADED,this.onManifestLoaded,this)}getLicenseServerUrl(e){const{drmSystems:r,widevineLicenseUrl:n}=this.config,i=r[e];if(i)return i.licenseUrl;if(e===vt.WIDEVINE&&n)return n;throw new Error(`no license server URL configured for key-system "${e}"`)}getServerCertificateUrl(e){const{drmSystems:r}=this.config,n=r[e];if(n)return n.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const r=this.hls.levels,n=(s,o,c)=>!!s&&c.indexOf(s)===o,i=r.map(s=>s.audioCodec).filter(n),a=r.map(s=>s.videoCodec).filter(n);return i.length+a.length===0&&a.push("avc1.42e01e"),new Promise((s,o)=>{const c=l=>{const u=l.shift();this.getMediaKeysPromise(u,i,a).then(f=>s({keySystem:u,mediaKeys:f})).catch(f=>{l.length?c(l):f instanceof Mn?o(f):o(new Mn({type:ye.KEY_SYSTEM_ERROR,details:q.KEY_SYSTEM_NO_ACCESS,error:f,fatal:!0},f.message))})};c(e)})}requestMediaKeySystemAccess(e,r){const{requestMediaKeySystemAccessFunc:n}=this.config;if(typeof n!="function"){let i=`Configured requestMediaKeySystemAccess is not a function ${n}`;return yQ===null&&self.location.protocol==="http:"&&(i=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(i))}return n(e,r)}getMediaKeysPromise(e,r,n){const i=UHe(e,r,n,this.config.drmSystemOptions),a=this.keySystemAccessPromises[e];let s=a==null?void 0:a.keySystemAccess;if(!s){this.log(`Requesting encrypted media "${e}" key-system access with config: ${JSON.stringify(i)}`),s=this.requestMediaKeySystemAccess(e,i);const o=this.keySystemAccessPromises[e]={keySystemAccess:s};return s.catch(c=>{this.log(`Failed to obtain access to key-system "${e}": ${c}`)}),s.then(c=>{this.log(`Access for key-system "${c.keySystem}" obtained`);const l=this.fetchServerCertificate(e);return this.log(`Create media-keys for "${e}"`),o.mediaKeys=c.createMediaKeys().then(u=>(this.log(`Media-keys created for "${e}"`),l.then(f=>f?this.setMediaKeysServerCertificate(u,e,f):u))),o.mediaKeys.catch(u=>{this.error(`Failed to create media-keys for "${e}"}: ${u}`)}),o.mediaKeys})}return s.then(()=>a.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:r,mediaKeys:n}){this.log(`Creating key-system session "${r}" keyId: ${Ji.hexDump(e.keyId||[])}`);const i=n.createSession(),a={decryptdata:e,keySystem:r,mediaKeys:n,mediaKeysSession:i,keyStatus:"status-pending"};return this.mediaKeySessions.push(a),a}renewKeySession(e){const r=e.decryptdata;if(r.pssh){const n=this.createMediaKeySessionContext(e),i=this.getKeyIdString(r),a="cenc";this.keyIdToKeySessionPromise[i]=this.generateRequestWithPreferredKeySession(n,a,r.pssh,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(e)}getKeyIdString(e){if(!e)throw new Error("Could not read keyId of undefined decryptdata");if(e.keyId===null)throw new Error("keyId is null");return Ji.hexDump(e.keyId)}updateKeySession(e,r){var n;const i=e.mediaKeysSession;return this.log(`Updating key-session "${i.sessionId}" for keyID ${Ji.hexDump(((n=e.decryptdata)==null?void 0:n.keyId)||[])} + } (data length: ${r&&r.byteLength})`),i.update(r)}selectKeySystemFormat(e){const r=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${r.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(r)),this.keyFormatPromise}getKeyFormatPromise(e){return new Promise((r,n)=>{const i=nT(this.config),a=e.map(P5).filter(s=>!!s&&i.indexOf(s)!==-1);return this.getKeySystemSelectionPromise(a).then(({keySystem:s})=>{const o=N5(s);o?r(o):n(new Error(`Unable to find format for key-system "${s}"`))}).catch(n)})}loadKey(e){const r=e.keyInfo.decryptdata,n=this.getKeyIdString(r),i=`(keyId: ${n} format: "${r.keyFormat}" method: ${r.method} uri: ${r.uri})`;this.log(`Starting session for key ${i}`);let a=this.keyIdToKeySessionPromise[n];return a||(a=this.keyIdToKeySessionPromise[n]=this.getKeySystemForKeyPromise(r).then(({keySystem:s,mediaKeys:o})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${i}`),this.attemptSetMediaKeys(s,o).then(()=>{this.throwIfDestroyed();const c=this.createMediaKeySessionContext({keySystem:s,mediaKeys:o,decryptdata:r}),l="cenc";return this.generateRequestWithPreferredKeySession(c,l,r.pssh,"playlist-key")}))),a.catch(s=>this.handleError(s))),a}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e){this.hls&&(this.error(e.message),e instanceof Mn?this.hls.trigger($.ERROR,e.data):this.hls.trigger($.ERROR,{type:ye.KEY_SYSTEM_ERROR,details:q.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}getKeySystemForKeyPromise(e){const r=this.getKeyIdString(e),n=this.keyIdToKeySessionPromise[r];if(!n){const i=P5(e.keyFormat),a=i?[i]:nT(this.config);return this.attemptKeySystemAccess(a)}return n}getKeySystemSelectionPromise(e){if(e.length||(e=nT(this.config)),e.length===0)throw new Mn({type:ye.KEY_SYSTEM_ERROR,details:q.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${JSON.stringify({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}_onMediaEncrypted(e){const{initDataType:r,initData:n}=e;if(this.debug(`"${e.type}" event: init data type: "${r}"`),n===null)return;let i,a;if(r==="sinf"&&this.config.drmSystems[vt.FAIRPLAY]){const u=Qt(new Uint8Array(n));try{const f=$O(JSON.parse(u).sinf),d=RQ(new Uint8Array(f));if(!d)return;i=d.subarray(8,24),a=vt.FAIRPLAY}catch{this.warn('Failed to parse sinf "encrypted" event message initData');return}}else{const u=uze(n);if(u===null)return;u.version===0&&u.systemId===vQ.WIDEVINE&&u.data&&(i=u.data.subarray(8,24)),a=BHe(u.systemId)}if(!a||!i)return;const s=Ji.hexDump(i),{keyIdToKeySessionPromise:o,mediaKeySessions:c}=this;let l=o[s];for(let u=0;uthis.generateRequestWithPreferredKeySession(f,r,n,"encrypted-event-key-match"));break}}l||(l=o[s]=this.getKeySystemSelectionPromise([a]).then(({keySystem:u,mediaKeys:f})=>{var d;this.throwIfDestroyed();const h=new ep("ISO-23001-7",s,(d=N5(u))!=null?d:"");return h.pssh=new Uint8Array(n),h.keyId=i,this.attemptSetMediaKeys(u,f).then(()=>{this.throwIfDestroyed();const p=this.createMediaKeySessionContext({decryptdata:h,keySystem:u,mediaKeys:f});return this.generateRequestWithPreferredKeySession(p,r,n,"encrypted-event-no-match")})})),l.catch(u=>this.handleError(u))}_onWaitingForKey(e){this.log(`"${e.type}" event`)}attemptSetMediaKeys(e,r){const n=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const i=Promise.all(n).then(()=>{if(!this.media)throw new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(r)});return this.setMediaKeysQueue.push(i),i.then(()=>{this.log(`Media-keys set for "${e}"`),n.push(i),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(a=>n.indexOf(a)===-1)})}generateRequestWithPreferredKeySession(e,r,n,i){var a,s;const o=(a=this.config.drmSystems)==null||(s=a[e.keySystem])==null?void 0:s.generateRequest;if(o)try{const d=o.call(this.hls,r,n,e);if(!d)throw new Error("Invalid response from configured generateRequest filter");r=d.initDataType,n=e.decryptdata.pssh=d.initData?new Uint8Array(d.initData):null}catch(d){var c;if(this.warn(d.message),(c=this.hls)!=null&&c.config.debug)throw d}if(n===null)return this.log(`Skipping key-session request for "${i}" (no initData)`),Promise.resolve(e);const l=this.getKeyIdString(e.decryptdata);this.log(`Generating key-session request for "${i}": ${l} (init data type: ${r} length: ${n?n.byteLength:null})`);const u=new np;e.mediaKeysSession.onmessage=d=>{const h=e.mediaKeysSession;if(!h){u.emit("error",new Error("invalid state"));return}const{messageType:p,message:v}=d;this.log(`"${p}" message event for session "${h.sessionId}" message size: ${v.byteLength}`),p==="license-request"||p==="license-renewal"?this.renewLicense(e,v).catch(m=>{this.handleError(m),u.emit("error",m)}):p==="license-release"?e.keySystem===vt.FAIRPLAY&&(this.updateKeySession(e,gQ("acknowledged")),this.removeSession(e)):this.warn(`unhandled media key message type "${p}"`)},e.mediaKeysSession.onkeystatuseschange=d=>{if(!e.mediaKeysSession){u.emit("error",new Error("invalid state"));return}this.onKeyStatusChange(e);const p=e.keyStatus;u.emit("keyStatus",p),p==="expired"&&(this.warn(`${e.keySystem} expired for key ${l}`),this.renewKeySession(e))};const f=new Promise((d,h)=>{u.on("error",h),u.on("keyStatus",p=>{p.startsWith("usable")?d():p==="output-restricted"?h(new Mn({type:ye.KEY_SYSTEM_ERROR,details:q.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):p==="internal-error"?h(new Mn({type:ye.KEY_SYSTEM_ERROR,details:q.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${p}"`)):p==="expired"?h(new Error("key expired while generating request")):this.warn(`unhandled key status change "${p}"`)})});return e.mediaKeysSession.generateRequest(r,n).then(()=>{var d;this.log(`Request generated for key-session "${(d=e.mediaKeysSession)==null?void 0:d.sessionId}" keyId: ${l}`)}).catch(d=>{throw new Mn({type:ye.KEY_SYSTEM_ERROR,details:q.KEY_SYSTEM_NO_SESSION,error:d,fatal:!1},`Error generating key-session request: ${d}`)}).then(()=>f).catch(d=>{throw u.removeAllListeners(),this.removeSession(e),d}).then(()=>(u.removeAllListeners(),e))}onKeyStatusChange(e){e.mediaKeysSession.keyStatuses.forEach((r,n)=>{this.log(`key status change "${r}" for keyStatuses keyId: ${Ji.hexDump("buffer"in n?new Uint8Array(n.buffer,n.byteOffset,n.byteLength):new Uint8Array(n))} session keyId: ${Ji.hexDump(new Uint8Array(e.decryptdata.keyId||[]))} uri: ${e.decryptdata.uri}`),e.keyStatus=r})}fetchServerCertificate(e){const r=this.config,n=r.loader,i=new n(r),a=this.getServerCertificateUrl(e);return a?(this.log(`Fetching serverCertificate for "${e}"`),new Promise((s,o)=>{const c={responseType:"arraybuffer",url:a},l=r.certLoadPolicy.default,u={loadPolicy:l,timeout:l.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},f={onSuccess:(d,h,p,v)=>{s(d.data)},onError:(d,h,p,v)=>{o(new Mn({type:ye.KEY_SYSTEM_ERROR,details:q.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:p,response:sn({url:c.url,data:void 0},d)},`"${e}" certificate request failed (${a}). Status: ${d.code} (${d.text})`))},onTimeout:(d,h,p)=>{o(new Mn({type:ye.KEY_SYSTEM_ERROR,details:q.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:p,response:{url:c.url,data:void 0}},`"${e}" certificate request timed out (${a})`))},onAbort:(d,h,p)=>{o(new Error("aborted"))}};i.load(c,u,f)})):Promise.resolve()}setMediaKeysServerCertificate(e,r,n){return new Promise((i,a)=>{e.setServerCertificate(n).then(s=>{this.log(`setServerCertificate ${s?"success":"not supported by CDM"} (${n==null?void 0:n.byteLength}) on "${r}"`),i(e)}).catch(s=>{a(new Mn({type:ye.KEY_SYSTEM_ERROR,details:q.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:s,fatal:!0},s.message))})})}renewLicense(e,r){return this.requestLicense(e,new Uint8Array(r)).then(n=>this.updateKeySession(e,new Uint8Array(n)).catch(i=>{throw new Mn({type:ye.KEY_SYSTEM_ERROR,details:q.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:i,fatal:!0},i.message)}))}setupLicenseXHR(e,r,n,i){const a=this.config.licenseXhrSetup;return a?Promise.resolve().then(()=>{if(!n.decryptdata)throw new Error("Key removed");return a.call(this.hls,e,r,n,i)}).catch(s=>{if(!n.decryptdata)throw s;return e.open("POST",r,!0),a.call(this.hls,e,r,n,i)}).then(s=>(e.readyState||e.open("POST",r,!0),{xhr:e,licenseChallenge:s||i})):(e.open("POST",r,!0),Promise.resolve({xhr:e,licenseChallenge:i}))}requestLicense(e,r){const n=this.config.keyLoadPolicy.default;return new Promise((i,a)=>{const s=this.getLicenseServerUrl(e.keySystem);this.log(`Sending license request to URL: ${s}`);const o=new XMLHttpRequest;o.responseType="arraybuffer",o.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return a(new Error("invalid state"));if(o.readyState===4)if(o.status===200){this._requestLicenseFailureCount=0;let c=o.response;this.log(`License received ${c instanceof ArrayBuffer?c.byteLength:c}`);const l=this.config.licenseResponseCallback;if(l)try{c=l.call(this.hls,o,s,e)}catch(u){this.error(u)}i(c)}else{const c=n.errorRetry,l=c?c.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>l||o.status>=400&&o.status<500)a(new Mn({type:ye.KEY_SYSTEM_ERROR,details:q.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:o,response:{url:s,data:void 0,code:o.status,text:o.statusText}},`License Request XHR failed (${s}). Status: ${o.status} (${o.statusText})`));else{const u=l-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${u} attempts left`),this.requestLicense(e,r).then(i,a)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=o,this.setupLicenseXHR(o,s,e,r).then(({xhr:c,licenseChallenge:l})=>{c.send(l)})})}onMediaAttached(e,r){if(!this.config.emeEnabled)return;const n=r.media;this.media=n,n.addEventListener("encrypted",this.onMediaEncrypted),n.addEventListener("waitingforkey",this.onWaitingForKey)}onMediaDetached(){const e=this.media,r=this.mediaKeySessions;e&&(e.removeEventListener("encrypted",this.onMediaEncrypted),e.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null),this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},ep.clearKeyUriToKeyIdMap();const n=r.length;Qu.CDMCleanupPromise=Promise.all(r.map(i=>this.removeSession(i)).concat(e==null?void 0:e.setMediaKeys(null).catch(i=>{this.log(`Could not clear media keys: ${i}. media.src: ${e==null?void 0:e.src}`)}))).then(()=>{n&&(this.log("finished closing key sessions and clearing media keys"),r.length=0)}).catch(i=>{this.log(`Could not close sessions and clear media keys: ${i}. media.src: ${e==null?void 0:e.src}`)})}onManifestLoaded(e,{sessionKeys:r}){if(!(!r||!this.config.emeEnabled)&&!this.keyFormatPromise){const n=r.reduce((i,a)=>(i.indexOf(a.keyFormat)===-1&&i.push(a.keyFormat),i),[]);this.log(`Selecting key-system from session-keys ${n.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(n)}}removeSession(e){const{mediaKeysSession:r,licenseXhr:n}=e;if(r){this.log(`Remove licenses and keys and close session ${r.sessionId}`),r.onmessage=null,r.onkeystatuseschange=null,n&&n.readyState!==XMLHttpRequest.DONE&&n.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const i=this.mediaKeySessions.indexOf(e);return i>-1&&this.mediaKeySessions.splice(i,1),r.remove().catch(a=>{this.log(`Could not remove session: ${a}`)}).then(()=>r.close()).catch(a=>{this.log(`Could not close session: ${a}`)})}}}Qu.CDMCleanupPromise=void 0;class Mn extends Error{constructor(e,r){super(r),this.data=void 0,e.error||(e.error=new Error(r)),this.data=e,e.err=e.error}}const AVe=1;var Ur={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"};const IVe="h";class Hs{constructor(e){this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=()=>{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1},this.applyPlaylistData=i=>{try{this.apply(i,{ot:Ur.MANIFEST,su:!this.initialized})}catch(a){G.warn("Could not generate manifest CMCD data.",a)}},this.applyFragmentData=i=>{try{const a=i.frag,s=this.hls.levels[a.level],o=this.getObjectType(a),c={d:a.duration*1e3,ot:o};(o===Ur.VIDEO||o===Ur.AUDIO||o==Ur.MUXED)&&(c.br=s.bitrate/1e3,c.tb=this.getTopBandwidth(o)/1e3,c.bl=this.getBufferLength(o)),this.apply(i,c)}catch(a){G.warn("Could not generate segment CMCD data.",a)}},this.hls=e;const r=this.config=e.config,{cmcd:n}=r;n!=null&&(r.pLoader=this.createPlaylistLoader(),r.fLoader=this.createFragmentLoader(),this.sid=n.sessionId||Hs.uuid(),this.cid=n.contentId,this.useHeaders=n.useHeaders===!0,this.registerListeners())}registerListeners(){const e=this.hls;e.on($.MEDIA_ATTACHED,this.onMediaAttached,this),e.on($.MEDIA_DETACHED,this.onMediaDetached,this),e.on($.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off($.MEDIA_ATTACHED,this.onMediaAttached,this),e.off($.MEDIA_DETACHED,this.onMediaDetached,this),e.off($.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null}onMediaAttached(e,r){this.media=r.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}onMediaDetached(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}onBufferCreated(e,r){var n,i;this.audioBuffer=(n=r.tracks.audio)==null?void 0:n.buffer,this.videoBuffer=(i=r.tracks.video)==null?void 0:i.buffer}createData(){var e;return{v:AVe,sf:IVe,sid:this.sid,cid:this.cid,pr:(e=this.media)==null?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,r={}){Pt(r,this.createData());const n=r.ot===Ur.INIT||r.ot===Ur.VIDEO||r.ot===Ur.MUXED;if(this.starved&&n&&(r.bs=!0,r.su=!0,this.starved=!1),r.su==null&&(r.su=this.buffering),this.useHeaders){const i=Hs.toHeaders(r);if(!Object.keys(i).length)return;e.headers||(e.headers={}),Pt(e.headers,i)}else{const i=Hs.toQuery(r);if(!i)return;e.url=Hs.appendQueryToUri(e.url,i)}}getObjectType(e){const{type:r}=e;if(r==="subtitle")return Ur.TIMED_TEXT;if(e.sn==="initSegment")return Ur.INIT;if(r==="audio")return Ur.AUDIO;if(r==="main")return this.hls.audioTracks.length?Ur.VIDEO:Ur.MUXED}getTopBandwidth(e){let r=0,n;const i=this.hls;if(e===Ur.AUDIO)n=i.audioTracks;else{const a=i.maxAutoLevel,s=a>-1?a+1:i.levels.length;n=i.levels.slice(0,s)}for(const a of n)a.bitrate>r&&(r=a.bitrate);return r>0?r:NaN}getBufferLength(e){const r=this.hls.media,n=e===Ur.AUDIO?this.audioBuffer:this.videoBuffer;return!n||!r?NaN:ct.bufferInfo(n,r.currentTime,this.config.maxBufferHole).len*1e3}createPlaylistLoader(){const{pLoader:e}=this.config,r=this.applyPlaylistData,n=e||this.config.loader;return class{constructor(a){this.loader=void 0,this.loader=new n(a)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(a,s,o){r(a),this.loader.load(a,s,o)}}}createFragmentLoader(){const{fLoader:e}=this.config,r=this.applyFragmentData,n=e||this.config.loader;return class{constructor(a){this.loader=void 0,this.loader=new n(a)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(a,s,o){r(a),this.loader.load(a,s,o)}}}static uuid(){const e=URL.createObjectURL(new Blob),r=e.toString();return URL.revokeObjectURL(e),r.slice(r.lastIndexOf("/")+1)}static serialize(e){const r=[],n=l=>!Number.isNaN(l)&&l!=null&&l!==""&&l!==!1,i=l=>Math.round(l),a=l=>i(l/100)*100,o={br:i,d:i,bl:a,dl:a,mtp:a,nor:l=>encodeURIComponent(l),rtp:a,tb:i},c=Object.keys(e||{}).sort();for(const l of c){let u=e[l];if(!n(u)||l==="v"&&u===1||l=="pr"&&u===1)continue;const f=o[l];f&&(u=f(u));const d=typeof u;let h;l==="ot"||l==="sf"||l==="st"?h=`${l}=${u}`:d==="boolean"?h=l:d==="number"?h=`${l}=${u}`:h=`${l}=${JSON.stringify(u)}`,r.push(h)}return r.join(",")}static toHeaders(e){const r=Object.keys(e),n={},i=["Object","Request","Session","Status"],a=[{},{},{},{}],s={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3};for(const o of r){const c=s[o]!=null?s[o]:1;a[c][o]=e[o]}for(let o=0;on!==e))}onManifestLoading(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}onManifestLoaded(e,r){const{contentSteering:n}=r;n!==null&&(this.pathwayId=n.pathwayId,this.uri=n.uri,this.started&&this.startLoad())}onManifestParsed(e,r){this.audioTracks=r.audioTracks,this.subtitleTracks=r.subtitleTracks}onError(e,r){const{errorAction:n}=r;if((n==null?void 0:n.action)===zr.SendAlternateToPenaltyBox&&n.flags===Bn.MoveAllAlternatesMatchingHost){let i=this.pathwayPriority;const a=this.pathwayId;this.penalizedPathways[a]||(this.penalizedPathways[a]=performance.now()),!i&&this.levels&&(i=this.levels.reduce((s,o)=>(s.indexOf(o.pathwayId)===-1&&s.push(o.pathwayId),s),[])),i&&i.length>1&&(this.updatePathwayPriority(i),n.resolved=this.pathwayId!==a)}}filterParsedLevels(e){this.levels=e;let r=this.getLevelsForPathway(this.pathwayId);if(r.length===0){const n=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${n}"`),r=this.getLevelsForPathway(n),this.pathwayId=n}return r.length!==e.length?(this.log(`Found ${r.length}/${e.length} levels in Pathway "${this.pathwayId}"`),r):e}getLevelsForPathway(e){return this.levels===null?[]:this.levels.filter(r=>e===r.pathwayId)}updatePathwayPriority(e){this.pathwayPriority=e;let r;const n=this.penalizedPathways,i=performance.now();Object.keys(n).forEach(a=>{i-n[a]>$Ve&&delete n[a]});for(let a=0;a0){this.log(`Setting Pathway to "${s}"`),this.pathwayId=s,this.hls.trigger($.LEVELS_UPDATED,{levels:r});const l=this.hls.levels[o];c&&l&&this.levels&&(l.attrs["STABLE-VARIANT-ID"]!==c.attrs["STABLE-VARIANT-ID"]&&l.bitrate!==c.bitrate&&this.log(`Unstable Pathways change from bitrate ${c.bitrate} to ${l.bitrate}`),this.hls.nextLoadLevel=o);break}}}clonePathways(e){const r=this.levels;if(!r)return;const n={},i={};e.forEach(a=>{const{ID:s,"BASE-ID":o,"URI-REPLACEMENT":c}=a;if(r.some(u=>u.pathwayId===s))return;const l=this.getLevelsForPathway(o).map(u=>{const f=Pt({},u);f.details=void 0,f.url=lZ(u.uri,u.attrs["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",c);const d=new gt(u.attrs);d["PATHWAY-ID"]=s;const h=d.AUDIO&&`${d.AUDIO}_clone_${s}`,p=d.SUBTITLES&&`${d.SUBTITLES}_clone_${s}`;h&&(n[d.AUDIO]=h,d.AUDIO=h),p&&(i[d.SUBTITLES]=p,d.SUBTITLES=p),f.attrs=d;const v=new tp(f);return D1(v,"audio",h),D1(v,"text",p),v});r.push(...l),_B(this.audioTracks,n,c,s),_B(this.subtitleTracks,i,c,s)})}loadSteeringManifest(e){const r=this.hls.config,n=r.loader;this.loader&&this.loader.destroy(),this.loader=new n(r);let i;try{i=new self.URL(e)}catch{this.enabled=!1,this.log(`Failed to parse Steering Manifest URI: ${e}`);return}if(i.protocol!=="data:"){const u=(this.hls.bandwidthEstimate||r.abrEwmaDefaultEstimate)|0;i.searchParams.set("_HLS_pathway",this.pathwayId),i.searchParams.set("_HLS_throughput",""+u)}const a={responseType:"json",url:i.href},s=r.steeringManifestLoadPolicy.default,o=s.errorRetry||s.timeoutRetry||{},c={loadPolicy:s,timeout:s.maxLoadTimeMs,maxRetry:o.maxNumRetry||0,retryDelay:o.retryDelayMs||0,maxRetryDelay:o.maxRetryDelayMs||0},l={onSuccess:(u,f,d,h)=>{this.log(`Loaded steering manifest: "${i}"`);const p=u.data;if(p.VERSION!==1){this.log(`Steering VERSION ${p.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=p.TTL;const{"RELOAD-URI":v,"PATHWAY-CLONES":m,"PATHWAY-PRIORITY":g}=p;if(v)try{this.uri=new self.URL(v,i).href}catch{this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${v}`);return}this.scheduleRefresh(this.uri||d.url),m&&this.clonePathways(m),g&&this.updatePathwayPriority(g)},onError:(u,f,d,h)=>{if(this.log(`Error loading steering manifest: ${u.code} ${u.text} (${f.url})`),this.stopLoad(),u.code===410){this.enabled=!1,this.log(`Steering manifest ${f.url} no longer available`);return}let p=this.timeToLoad*1e3;if(u.code===429){const v=this.loader;if(typeof(v==null?void 0:v.getResponseHeader)=="function"){const m=v.getResponseHeader("Retry-After");m&&(p=parseFloat(m)*1e3)}this.log(`Steering manifest ${f.url} rate limited`);return}this.scheduleRefresh(this.uri||f.url,p)},onTimeout:(u,f,d)=>{this.log(`Timeout loading steering manifest (${f.url})`),this.scheduleRefresh(this.uri||f.url)}};this.log(`Requesting steering manifest: ${i}`),this.loader.load(a,c,l)}scheduleRefresh(e,r=this.timeToLoad*1e3){self.clearTimeout(this.reloadTimer),this.reloadTimer=self.setTimeout(()=>{this.loadSteeringManifest(e)},r)}}function _B(t,e,r,n){t&&Object.keys(e).forEach(i=>{const a=t.filter(s=>s.groupId===i).map(s=>{const o=Pt({},s);return o.details=void 0,o.attrs=new gt(o.attrs),o.url=o.attrs.URI=lZ(s.url,s.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",r),o.groupId=o.attrs["GROUP-ID"]=e[i],o.attrs["PATHWAY-ID"]=n,o});t.push(...a)})}function lZ(t,e,r,n){const{HOST:i,PARAMS:a,[r]:s}=n;let o;e&&(o=s==null?void 0:s[e],o&&(t=o));const c=new self.URL(t);return i&&!o&&(c.host=i),a&&Object.keys(a).sort().forEach(l=>{l&&c.searchParams.set(l,a[l])}),c.href}const kVe=/^age:\s*[\d.]+\s*$/im;class cZ{constructor(e){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=e&&e.xhrSetup||null,this.stats=new TE,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null}abortInternal(){const e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,e.readyState!==4&&(this.stats.aborted=!0,e.abort()))}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(e,r,n){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=r,this.callbacks=n,this.loadInternal()}loadInternal(){const{config:e,context:r}=this;if(!e)return;const n=this.loader=new self.XMLHttpRequest,i=this.stats;i.loading.first=0,i.loaded=0;const a=this.xhrSetup;a?Promise.resolve().then(()=>{if(!this.stats.aborted)return a(n,r.url)}).catch(s=>(n.open("GET",r.url,!0),a(n,r.url))).then(()=>{this.stats.aborted||this.openAndSendXhr(n,r,e)}).catch(s=>{this.callbacks.onError({code:n.status,text:s.message},r,n,i)}):this.openAndSendXhr(n,r,e)}openAndSendXhr(e,r,n){e.readyState||e.open("GET",r.url,!0);const i=this.context.headers,{maxTimeToFirstByteMs:a,maxLoadTimeMs:s}=n.loadPolicy;if(i)for(const o in i)e.setRequestHeader(o,i[o]);r.rangeEnd&&e.setRequestHeader("Range","bytes="+r.rangeStart+"-"+(r.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=r.responseType,self.clearTimeout(this.requestTimeout),n.timeout=a&&me(a)?a:s,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),n.timeout),e.send()}readystatechange(){const{context:e,loader:r,stats:n}=this;if(!e||!r)return;const i=r.readyState,a=this.config;if(!n.aborted&&i>=2&&(n.loading.first===0&&(n.loading.first=Math.max(self.performance.now(),n.loading.start),a.timeout!==a.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),a.timeout=a.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),a.loadPolicy.maxLoadTimeMs-(n.loading.first-n.loading.start)))),i===4)){self.clearTimeout(this.requestTimeout),r.onreadystatechange=null,r.onprogress=null;const s=r.status,o=r.responseType!=="text";if(s>=200&&s<300&&(o&&r.response||r.responseText!==null)){n.loading.end=Math.max(self.performance.now(),n.loading.first);const c=o?r.response:r.responseText,l=r.responseType==="arraybuffer"?c.byteLength:c.length;if(n.loaded=n.total=l,n.bwEstimate=n.total*8e3/(n.loading.end-n.loading.first),!this.callbacks)return;const u=this.callbacks.onProgress;if(u&&u(n,e,c,r),!this.callbacks)return;const f={url:r.responseURL,data:c,code:s};this.callbacks.onSuccess(f,n,e,r)}else{const c=a.loadPolicy.errorRetry,l=n.retry;N1(c,l,!1,s)?this.retry(c):(G.error(`${s} while loading ${e.url}`),this.callbacks.onError({code:s,text:r.statusText},e,r,n))}}}loadtimeout(){var e;const r=(e=this.config)==null?void 0:e.loadPolicy.timeoutRetry,n=this.stats.retry;if(N1(r,n,!0))this.retry(r);else{G.warn(`timeout while loading ${this.context.url}`);const i=this.callbacks;i&&(this.abortInternal(),i.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:r,stats:n}=this;this.retryDelay=kO(e,n.retry),n.retry++,G.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${r.url}, retrying ${n.retry}/${e.maxNumRetry} in ${this.retryDelay}ms`),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(e){const r=this.stats;r.loaded=e.loaded,e.lengthComputable&&(r.total=e.total)}getCacheAge(){let e=null;if(this.loader&&kVe.test(this.loader.getAllResponseHeaders())){const r=this.loader.getResponseHeader("age");e=r?parseFloat(r):null}return e}getResponseHeader(e){return this.loader&&new RegExp(`^${e}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null}}function OVe(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch{}return!1}const LVe=/(\d+)-(\d+)\/(\d+)/;class wB{constructor(e){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=e.fetchSetup||MVe,this.controller=new self.AbortController,this.stats=new TE}destroy(){this.loader=this.callbacks=null,this.abortInternal()}abortInternal(){const e=this.response;e!=null&&e.ok||(this.stats.aborted=!0,this.controller.abort())}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(e,r,n){const i=this.stats;if(i.loading.start)throw new Error("Loader can only be used once.");i.loading.start=self.performance.now();const a=PVe(e,this.controller.signal),s=n.onProgress,o=e.responseType==="arraybuffer",c=o?"byteLength":"length",{maxTimeToFirstByteMs:l,maxLoadTimeMs:u}=r.loadPolicy;this.context=e,this.config=r,this.callbacks=n,this.request=this.fetchSetup(e,a),self.clearTimeout(this.requestTimeout),r.timeout=l&&me(l)?l:u,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),n.onTimeout(i,e,this.response)},r.timeout),self.fetch(this.request).then(f=>{this.response=this.loader=f;const d=Math.max(self.performance.now(),i.loading.start);if(self.clearTimeout(this.requestTimeout),r.timeout=u,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),n.onTimeout(i,e,this.response)},u-(d-i.loading.start)),!f.ok){const{status:h,statusText:p}=f;throw new FVe(p||"fetch, bad network response",h,f)}return i.loading.first=d,i.total=DVe(f.headers)||i.total,s&&me(r.highWaterMark)?this.loadProgressively(f,i,e,r.highWaterMark,s):o?f.arrayBuffer():e.responseType==="json"?f.json():f.text()}).then(f=>{const{response:d}=this;self.clearTimeout(this.requestTimeout),i.loading.end=Math.max(self.performance.now(),i.loading.first);const h=f[c];h&&(i.loaded=i.total=h);const p={url:d.url,data:f,code:d.status};s&&!me(r.highWaterMark)&&s(i,e,f,d),n.onSuccess(p,i,e,d)}).catch(f=>{if(self.clearTimeout(this.requestTimeout),i.aborted)return;const d=f&&f.code||0,h=f?f.message:null;n.onError({code:d,text:h},e,f?f.details:null,i)})}getCacheAge(){let e=null;if(this.response){const r=this.response.headers.get("age");e=r?parseFloat(r):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,r,n,i=0,a){const s=new ZQ,o=e.body.getReader(),c=()=>o.read().then(l=>{if(l.done)return s.dataLength&&a(r,n,s.flush(),e),Promise.resolve(new ArrayBuffer(0));const u=l.value,f=u.length;return r.loaded+=f,f=i&&a(r,n,s.flush(),e)):a(r,n,u,e),c()}).catch(()=>Promise.reject());return c()}}function PVe(t,e){const r={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(Pt({},t.headers))};return t.rangeEnd&&r.headers.set("Range","bytes="+t.rangeStart+"-"+String(t.rangeEnd-1)),r}function NVe(t){const e=LVe.exec(t);if(e)return parseInt(e[2])-parseInt(e[1])+1}function DVe(t){const e=t.get("Content-Range");if(e){const n=NVe(e);if(me(n))return n}const r=t.get("Content-Length");if(r)return parseInt(r)}function MVe(t,e){return new self.Request(t.url,e)}class FVe extends Error{constructor(e,r,n){super(e),this.code=void 0,this.details=void 0,this.code=r,this.details=n}}const BVe=/\s/,UVe={newCue(t,e,r,n){const i=[];let a,s,o,c,l;const u=self.VTTCue||self.TextTrackCue;for(let d=0;d=16?c--:c++;const h=iZ(l.trim()),p=HO(e,r,h);t!=null&&(f=t.cues)!=null&&f.getCueById(p)||(s=new u(e,r,h),s.id=p,s.line=d+1,s.align="left",s.position=10+Math.min(80,Math.floor(c*8/32)*10),i.push(s))}return t&&i.length&&(i.sort((d,h)=>d.line==="auto"||h.line==="auto"?0:d.line>8&&h.line>8?h.line-d.line:d.line-h.line),i.forEach(d=>kQ(t,d))),i}},jVe={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},HVe=sn(sn({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:cZ,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:WGe,bufferController:tVe,capLevelController:zO,errorController:Fze,fpsController:RVe,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:yQ,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0,certLoadPolicy:{default:jVe},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},zVe()),{},{subtitleStreamController:QGe,subtitleTrackController:JGe,timelineController:_Ve,audioStreamController:YGe,audioTrackController:qGe,emeController:Qu,cmcdController:Hs,contentSteeringController:CVe});function zVe(){return{cueHandler:UVe,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function GVe(t,e){if((e.liveSyncDurationCount||e.liveMaxLatencyDurationCount)&&(e.liveSyncDuration||e.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(e.liveMaxLatencyDurationCount!==void 0&&(e.liveSyncDurationCount===void 0||e.liveMaxLatencyDurationCount<=e.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(e.liveMaxLatencyDuration!==void 0&&(e.liveSyncDuration===void 0||e.liveMaxLatencyDuration<=e.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const r=eI(t),n=["manifest","level","frag"],i=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return n.forEach(a=>{const s=`${a==="level"?"playlist":a}LoadPolicy`,o=e[s]===void 0,c=[];i.forEach(l=>{const u=`${a}Loading${l}`,f=e[u];if(f!==void 0&&o){c.push(u);const d=r[s].default;switch(e[s]={default:d},l){case"TimeOut":d.maxLoadTimeMs=f,d.maxTimeToFirstByteMs=f;break;case"MaxRetry":d.errorRetry.maxNumRetry=f,d.timeoutRetry.maxNumRetry=f;break;case"RetryDelay":d.errorRetry.retryDelayMs=f,d.timeoutRetry.retryDelayMs=f;break;case"MaxRetryTimeout":d.errorRetry.maxRetryDelayMs=f,d.timeoutRetry.maxRetryDelayMs=f;break}}}),c.length&&G.warn(`hls.js config: "${c.join('", "')}" setting(s) are deprecated, use "${s}": ${JSON.stringify(e[s])}`)}),sn(sn({},r),e)}function eI(t){return t&&typeof t=="object"?Array.isArray(t)?t.map(eI):Object.keys(t).reduce((e,r)=>(e[r]=eI(t[r]),e),{}):t}function VVe(t){const e=t.loader;e!==wB&&e!==cZ?(G.log("[config]: Custom loader detected, cannot enable progressive streaming"),t.progressive=!1):OVe()&&(t.loader=wB,t.progressive=!0,t.enableSoftwareAES=!0,G.log("[config]: Progressive streaming enabled, using FetchLoader"))}class Za{static get version(){return"1.4.0"}static isSupported(){return nGe()}static get Events(){return $}static get ErrorTypes(){return ye}static get ErrorDetails(){return q}static get DefaultConfig(){return Za.defaultConfig?Za.defaultConfig:HVe}static set DefaultConfig(e){Za.defaultConfig=e}constructor(e={}){this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new np,this._autoLevelCapping=void 0,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null,$He(e.debug||!1,"Hls instance");const r=this.config=GVe(Za.DefaultConfig,e);this.userConfig=e,this._autoLevelCapping=-1,r.progressive&&VVe(r);const{abrController:n,bufferController:i,capLevelController:a,errorController:s,fpsController:o}=r,c=new s(this),l=this.abrController=new n(this),u=this.bufferController=new i(this),f=this.capLevelController=new a(this),d=new o(this),h=new xze(this),p=new wze(this),v=r.contentSteeringController,m=v?new v(this):null,g=this.levelController=new Uze(this,m),y=new jze(this),x=new zze(this.config),b=this.streamController=new GGe(this,y,x);f.setStreamController(b),d.setStreamController(b);const _=[h,g,b];m&&_.splice(1,0,m),this.networkControllers=_;const S=[l,u,f,d,p,y];this.audioTrackController=this.createController(r.audioTrackController,_);const w=r.audioStreamController;w&&_.push(new w(this,y,x)),this.subtitleTrackController=this.createController(r.subtitleTrackController,_);const R=r.subtitleStreamController;R&&_.push(new R(this,y,x)),this.createController(r.timelineController,S),x.emeController=this.emeController=this.createController(r.emeController,S),this.cmcdController=this.createController(r.cmcdController,S),this.latencyController=this.createController(Tze,S),this.coreComponents=S,_.push(c);const I=c.onErrorOut;typeof I=="function"&&this.on($.ERROR,I,c)}createController(e,r){if(e){const n=new e(this);return r&&r.push(n),n}return null}on(e,r,n=this){this._emitter.on(e,r,n)}once(e,r,n=this){this._emitter.once(e,r,n)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,r,n=this,i){this._emitter.off(e,r,n,i)}listeners(e){return this._emitter.listeners(e)}emit(e,r,n){return this._emitter.emit(e,r,n)}trigger(e,r){if(this.config.debug)return this.emit(e,e,r);try{return this.emit(e,e,r)}catch(n){G.error("An internal error happened while handling event "+e+'. Error message: "'+n.message+'". Here is a stacktrace:',n),this.trigger($.ERROR,{type:ye.OTHER_ERROR,details:q.INTERNAL_EXCEPTION,fatal:!1,event:e,error:n})}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){G.log("destroy"),this.trigger($.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(r=>r.destroy()),this.networkControllers.length=0,this.coreComponents.forEach(r=>r.destroy()),this.coreComponents.length=0;const e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}attachMedia(e){G.log("attachMedia"),this._media=e,this.trigger($.MEDIA_ATTACHING,{media:e})}detachMedia(){G.log("detachMedia"),this.trigger($.MEDIA_DETACHING,void 0),this._media=null}loadSource(e){this.stopLoad();const r=this.media,n=this.url,i=this.url=J0.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});G.log(`loadSource:${i}`),r&&n&&n!==i&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(r)),this.trigger($.MANIFEST_LOADING,{url:e})}startLoad(e=-1){G.log(`startLoad(${e})`),this.networkControllers.forEach(r=>{r.startLoad(e)})}stopLoad(){G.log("stopLoad"),this.networkControllers.forEach(e=>{e.stopLoad()})}swapAudioCodec(){G.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){G.log("recoverMediaError");const e=this._media;this.detachMedia(),e&&this.attachMedia(e)}removeLevel(e,r=0){this.levelController.removeLevel(e,r)}get levels(){const e=this.levelController.levels;return e||[]}get currentLevel(){return this.streamController.currentLevel}set currentLevel(e){G.log(`set currentLevel:${e}`),this.loadLevel=e,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){G.log(`set nextLevel:${e}`),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){G.log(`set loadLevel:${e}`),this.levelController.manualLevel=e}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(e){this.levelController.nextLoadLevel=e}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(e){G.log(`set firstLevel:${e}`),this.levelController.firstLevel=e}get startLevel(){return this.levelController.startLevel}set startLevel(e){G.log(`set startLevel:${e}`),e!==-1&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(e){const r=!!e;r!==this.config.capLevelToPlayerSize&&(r?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=r)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimate():NaN}get ttfbEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimateTTFB():NaN}set autoLevelCapping(e){this._autoLevelCapping!==e&&(G.log(`set autoLevelCapping:${e}`),this._autoLevelCapping=e)}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){qA.indexOf(e)>-1&&(this._maxHdcpLevel=e)}get autoLevelEnabled(){return this.levelController.manualLevel===-1}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:e,config:{minAutoBitrate:r}}=this;if(!e)return 0;const n=e.length;for(let i=0;i=r)return i;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:r,maxHdcpLevel:n}=this;let i;if(r===-1&&e&&e.length?i=e.length-1:i=r,n)for(let a=i;a--;){const s=e[a].attrs["HDCP-LEVEL"];if(s&&s<=n)return a}return i}get nextAutoLevel(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)}set nextAutoLevel(e){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,e)}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}get audioTracks(){const e=this.audioTrackController;return e?e.audioTracks:[]}get audioTrack(){const e=this.audioTrackController;return e?e.audioTrack:-1}set audioTrack(e){const r=this.audioTrackController;r&&(r.audioTrack=e)}get subtitleTracks(){const e=this.subtitleTrackController;return e?e.subtitleTracks:[]}get subtitleTrack(){const e=this.subtitleTrackController;return e?e.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(e){const r=this.subtitleTrackController;r&&(r.subtitleTrack=e)}get subtitleDisplay(){const e=this.subtitleTrackController;return e?e.subtitleDisplay:!1}set subtitleDisplay(e){const r=this.subtitleTrackController;r&&(r.subtitleDisplay=e)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(e){this.config.lowLatencyMode=e}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}}Za.defaultConfig=void 0;function WVe(t){switch(t.code){case MediaError.MEDIA_ERR_ABORTED:return{code:"ABORTED",description:"Video was aborted"};case MediaError.MEDIA_ERR_NETWORK:return{code:"NETWORK_ERROR",description:"A network error occured, the video failed to stream"};case MediaError.MEDIA_ERR_DECODE:return{code:"DECODE_ERROR",description:"Video stream could not be decoded"};case MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:return{code:"SRC_NOT_SUPPORTED",description:"The video type is not supported by your browser"};default:return{code:"UNKNOWN_ERROR",description:"Unknown media error occured"}}}function KVe(t,e){const r=e,n=Sr(t);return{getId(){return"video"},play(){r.play()},pause(){r.pause()},exitFullscreen(){xn.fullscreenElement&&xn.exitFullscreen()},enterFullscreen(){if(!(!hO()||xn.fullscreenElement)){if(pE()){n.wrapperElement&&xn.requestFullscreen(n.wrapperElement);return}dO()&&r.webkitEnterFullscreen()}},startAirplay(){const i=r;i.webkitShowPlaybackTargetPicker&&i.webkitShowPlaybackTargetPicker()},setTime(i){let a=Math.min(i,r.duration);a=Math.max(0,a),!Number.isNaN(a)&&(r.currentTime=a,n.progress.time=a,Xa(t,n))},setSeeking(i){if(n.mediaPlaying.isSeeking=i,n.mediaPlaying.isDragSeeking=i,Jt(t,n),!i){n.pausedWhenSeeking||this.play();return}n.pausedWhenSeeking=n.mediaPlaying.isPaused,this.pause()},async setVolume(i){let a=Math.min(i,1);a=Math.max(0,a),await G0()&&(r.volume=a),n.mediaPlaying.volume=a,Jt(t,n),fQ(a)},setSource(i){if(!i){k1(t,n),r.removeAttribute("src"),r.load(),n.source=null,no(t,n);return}if(k1(t,n),(i==null?void 0:i.type)===Yt.HLS)if(r.canPlayType("application/vnd.apple.mpegurl"))r.src=i.source;else{if(!Za.isSupported()){n.error={name:"Not supported",description:"Your browser does not support HLS video"},Yw(t,n);return}const a=new Za({enableWorker:!1});n.hlsInstance=a,a.on(Za.Events.ERROR,(s,o)=>{var c;o.fatal&&(n.error={name:`error ${o.details}`,description:((c=o.error)==null?void 0:c.message)??"Something went wrong"},Yw(t,n)),console.error("HLS error",o)}),a.attachMedia(r),a.loadSource(i.source)}else i.type===Yt.MP4&&(r.src=i.source);n.source={quality:i.quality,type:i.type,url:i.source,caption:null,embedId:i.embedId,providerId:i.providerId},no(t,n)},setCaption(i,a){var s;n.source&&(S1((s=n.source.caption)==null?void 0:s.url),n.source.caption={id:i,url:a},no(t,n))},clearCaption(){var i;n.source&&(S1((i=n.source.caption)==null?void 0:i.url),n.source.caption=null,no(t,n))},togglePictureInPicture(){if(aX()){const i=r;i.webkitSetPresentationMode(i.webkitPresentationMode==="picture-in-picture"?"inline":"picture-in-picture")}iX()&&(r!==document.pictureInPictureElement?r.requestPictureInPicture():document.exitPictureInPicture())},setPlaybackSpeed(i){r.playbackRate=i,n.mediaPlaying.playbackSpeed=i,Jt(t,n)},providerStart(){var x,b,_;this.setVolume(uQ());const i=()=>{n.mediaPlaying.isPaused=!0,n.mediaPlaying.isPlaying=!1,Jt(t,n)},a=()=>{n.mediaPlaying.isPaused=!1,n.mediaPlaying.isPlaying=!0,n.mediaPlaying.isLoading=!1,n.mediaPlaying.hasPlayedOnce=!0,Jt(t,n)},s=()=>{n.mediaPlaying.isLoading=!0,Jt(t,n)},o=()=>{n.mediaPlaying.isSeeking=!0,Jt(t,n)},c=()=>{n.mediaPlaying.isSeeking=!1,Jt(t,n)},l=()=>{n.progress.duration=r.duration,Xa(t,n)},u=()=>{n.progress.duration=r.duration,n.progress.time=r.currentTime,Xa(t,n)},f=()=>{n.progress.buffered=yHe(r.currentTime,r.buffered),Xa(t,n)},d=()=>{n.mediaPlaying.isFirstLoading=!1,n.mediaPlaying.isLoading=!1,Jt(t,n)},h=()=>{n.mediaPlaying.playbackSpeed=r.playbackRate,Jt(t,n)},p=()=>{n.interface.isFullscreen=!!document.fullscreenElement||!!document.webkitFullscreenElement,gn(t,n)},v=async()=>{await G0()&&(n.mediaPlaying.volume=r.volume,Jt(t,n))},m=S=>{n.interface.isFocused=S.type!=="mouseleave",gn(t,n)},g=S=>{S.availability==="available"&&(n.canAirplay=!0,ld(t,n))},y=()=>{if(r.error){const S=WVe(r.error);console.error("Native video player threw error",r.error),n.error={description:S.description,name:`Error ${S.code}`},this.pause()}else n.error=null;Yw(t,n)};return(x=n.wrapperElement)==null||x.addEventListener("click",m),(b=n.wrapperElement)==null||b.addEventListener("mouseenter",m),(_=n.wrapperElement)==null||_.addEventListener("mouseleave",m),r.addEventListener("volumechange",v),r.addEventListener("pause",i),r.addEventListener("playing",a),r.addEventListener("seeking",o),r.addEventListener("seeked",c),r.addEventListener("progress",f),r.addEventListener("waiting",s),r.addEventListener("timeupdate",u),r.addEventListener("loadedmetadata",l),r.addEventListener("canplay",d),r.addEventListener("ratechange",h),xn.addEventListener("fullscreenchange",p),r.addEventListener("error",y),r.addEventListener("webkitplaybacktargetavailabilitychanged",g),n.source&&this.setSource({quality:n.source.quality,source:n.source.url,type:n.source.type,embedId:n.source.embedId,providerId:n.source.providerId}),{destroy:()=>{var S,w,R;r.removeEventListener("pause",i),r.removeEventListener("playing",a),r.removeEventListener("seeking",o),r.removeEventListener("volumechange",v),r.removeEventListener("seeked",c),r.removeEventListener("timeupdate",u),r.removeEventListener("loadedmetadata",l),r.removeEventListener("progress",f),r.removeEventListener("waiting",s),r.removeEventListener("error",y),r.removeEventListener("canplay",d),xn.removeEventListener("fullscreenchange",p),(S=n.wrapperElement)==null||S.removeEventListener("click",m),(w=n.wrapperElement)==null||w.removeEventListener("mouseenter",m),(R=n.wrapperElement)==null||R.removeEventListener("mouseleave",m),r.removeEventListener("webkitplaybacktargetavailabilitychanged",g)}}}}}function YVe(t){const e=Re(),r=Cn(e),n=Es(e),i=A.useRef(null),a=A.useMemo(()=>!!n.wrapperInitialized,[n]),s=A.useMemo(()=>n.stateProviderId,[n]);return A.useEffect(()=>{if(!a||!i.current)return;const o=KVe(e,i.current);dQ(e,o);const{destroy:c}=o.providerStart();return()=>{try{hQ(e,o.getId())}catch{}c()}},[e,a,s]),E("video",{ref:i,autoPlay:t.autoPlay,muted:r.volume===0,playsInline:!0,className:"z-0 h-full w-full"})}function qVe(t){const e=Re();return Es(e).stateProviderId!=="video"?null:E(YVe,{...t})}function XVe(t){const e=A.useRef(null),r=Re(),n=Bi(r),i=ui(r),a=typeof t.children=="function"?t.children({isFullscreen:n.isFullscreen}):t.children;return E(EHe,{onGoBack:t.onGoBack,media:i==null?void 0:i.meta.meta,children:Y("div",{ref:e,className:["is-video-player popout-location relative h-full w-full select-none overflow-hidden bg-black",t.includeSafeArea||n.isFullscreen?"[border-left:env(safe-area-inset-left)_solid_transparent] [border-right:env(safe-area-inset-right)_solid_transparent]":""].join(" "),children:[E(SHe,{}),E(qVe,{autoPlay:t.autoPlay}),E(xHe,{}),E(bHe,{wrapper:e.current}),E("div",{className:"absolute inset-0",children:a})]})})}function QVe(t){return E(p5e,{children:E(XVe,{...t})})}function uZ({text:t,scale:e}){const{captionSettings:r}=sd(),n=(t||"").replaceAll(/\r?\n/g,"
"),i=JBe(n,{ALLOWED_TAGS:["c","b","i","u","span","ruby","rt","br"],ADD_TAGS:["v","lang"],ALLOWED_ATTR:["title","lang"]});return E("p",{className:"pointer-events-none mb-1 select-none rounded px-4 py-1 text-center [text-shadow:0_2px_4px_rgba(0,0,0,0.5)]",style:{...r.style,fontSize:r.style.fontSize*(e??1)},children:E("span",{dangerouslySetInnerHTML:{__html:i},dir:"auto"})})}function ZVe({isControlsShown:t}){var u,f;const e=Re(),r=ym(e).source,n=Xo(e).time,{captionSettings:i,setCaptionDelay:a}=sd(),s=A.useRef([]),o=A.useRef(a);A.useEffect(()=>{o.current=a},[a]),HFe(async()=>{var h;const d=(h=r==null?void 0:r.caption)==null?void 0:h.url;if(d){const v=await(await fetch(d)).text();try{s.current=Hq(v)}catch{s.current=[]}a(0)}else s.current=[]},[(u=r==null?void 0:r.caption)==null?void 0:u.url]),A.useEffect(()=>{o.current(0)},[(f=r==null?void 0:r.caption)==null?void 0:f.url]);const c=A.useCallback((d,h,p,v)=>{const m=d/1e3+p,g=h/1e3+p;return Math.max(0,m)<=v&&Math.max(0,g)>=v},[]);if(!s.current.length)return null;const l=s.current.filter(({start:d,end:h})=>c(d,h,i.delay,n));return E($i,{className:["pointer-events-none absolute flex w-full flex-col items-center transition-[bottom]",t?"bottom-24":"bottom-12"].join(" "),animation:"slide-up",show:!0,children:l.map(({start:d,end:h,content:p})=>E(uZ,{text:p},`${d}-${h}`))})}function JVe(){const t=Re(),e=ui(t);return(e==null?void 0:e.meta.meta.type)!==ie.SERIES?null:E("div",{className:"mx-2 h-6 w-px bg-white opacity-50"})}function TB(t){const{t:e}=ke(),r=Re(),n=st(r),i=Bi(r),{isMobile:a}=Aa(!1);return E("div",{className:t.className,children:E("div",{className:"relative",children:E(hX,{id:"settings",children:E(_s,{active:i.popout==="settings",className:t.className,onClick:()=>n.openPopout("settings"),text:a?e("videoPlayer.buttons.settings"):void 0,icon:ue.GEAR})})})})}function eWe(){const t=Re(),e=Bi(t),r=Cn(t);return Y("div",{className:[e.volumeChangedWithKeybind?"mt-10 scale-100 opacity-100":"mt-5 scale-75 opacity-0","absolute left-1/2 z-[100] flex -translate-x-1/2 items-center space-x-4 rounded-full bg-bink-300 bg-opacity-50 px-5 py-2 transition-all duration-100"].join(" "),children:[E(Ve,{icon:r.volume>0?ue.VOLUME:ue.VOLUME_X,className:"text-xl text-white"}),E("div",{className:"h-2 w-44 overflow-hidden rounded-full bg-denim-100",children:E("div",{className:"h-full rounded-r-full bg-bink-500 transition-[width] duration-100",style:{width:`${r.volume*100}%`}})})]})}function AT(t){return E("div",{className:"absolute inset-0 flex items-center justify-center",children:t.children})}function tWe(){const t=Re(),e=st(t),r=A.useCallback(()=>{e.setLeftControlsHover(!0)},[e]),n=A.useCallback(()=>{e.setLeftControlsHover(!1)},[e]);return Y(xr,{children:[Y("div",{className:"flex items-center px-2",onMouseLeave:n,onMouseEnter:r,children:[E(lX,{}),E(y7e,{}),E(T7e,{className:"mr-2"}),E(pX,{})]}),E(_7e,{})]})}function rWe(t){const[e,r]=A.useState(!1),{isMobile:n}=Aa(),i=A.useCallback(a=>{r(a)},[r]);return E(QVe,{autoPlay:t.autoPlay,includeSafeArea:t.includeSafeArea,onGoBack:t.onGoBack,children:({isFullscreen:a})=>Y(xr,{children:[E(m7e,{}),E(b7e,{}),E(eWe,{}),Y(A7e,{onGoBack:t.onGoBack,children:[Y(u7e,{onBackdropChange:i,children:[E(AT,{children:E(g7e,{})}),E(AT,{children:E(f7e,{})}),E(AT,{children:E(v7e,{})}),n?E($i,{animation:"fade",show:e,className:"absolute inset-0 flex items-center justify-center",children:E(x7e,{})}):"",E($i,{animation:"slide-down",show:e,className:"pointer-events-auto absolute inset-x-0 top-0 flex flex-col px-8 py-6 pb-2",children:E(p7e,{showControls:n,onClick:t.onGoBack,isFullScreen:!0})}),Y($i,{animation:"slide-up",show:e,className:["pointer-events-auto absolute inset-x-0 bottom-0 flex flex-col px-4 pb-2",t.includeSafeArea||a?"[margin-bottom:env(safe-area-inset-bottom)]":""].join(" "),children:[Y("div",{className:"flex w-full items-center space-x-3",children:[n&&E(pX,{noDuration:!0}),E(S7e,{})]}),E("div",{className:"flex items-center",children:n?Y("div",{className:"grid w-full grid-cols-[56px,1fr,56px] items-center",children:[E("div",{}),Y("div",{className:"flex items-center justify-center",children:[E(Y6,{}),E(K6,{}),E(TB,{})]}),E(W6,{})]}):Y(xr,{children:[E(tWe,{}),E("div",{className:"flex-1"}),E(Y6,{}),E(JVe,{}),E(TB,{}),E(Vq,{}),E(Gq,{}),E(K6,{}),E(W6,{})]})})]}),e?E(fHe,{}):null]}),E(ZVe,{isControlsShown:e}),t.children]})]})})}function nWe(){const{t}=ke(),e=lE();return Y("div",{className:"flex-1",children:[E(va,{children:E("title",{children:t("media.errors.failedMeta")})}),E("div",{className:"fixed inset-x-0 top-0 px-8 py-6",children:E(_c,{onClick:e})}),E(Kk,{children:E("p",{className:"my-6 max-w-lg",children:t("media.errors.mediaFailed")})})]})}function RB(){return E("div",{className:"h-9 w-[220px] rounded-full bg-slate-800 opacity-50"})}function iWe({event:t}){return Y("div",{className:"flex h-9 w-[220px] items-center rounded-full bg-slate-800 p-3 text-denim-700",children:[E("div",{className:"mr-2 flex w-[18px] items-center justify-center",children:t.errored?E(Ve,{icon:ue.X,className:"text-[0.85em] text-rose-400"}):E(tQ,{className:"h-[18px] w-[18px] text-bink-700",percentage:t.percentage,radius:40})}),E("div",{className:"flex-1 overflow-hidden",children:E("p",{className:`overflow-hidden text-ellipsis whitespace-nowrap ${t.errored?"text-rose-400":""}`,children:t.id})})]})}function aWe(t){return Y("div",{className:"relative h-16 w-[400px] overflow-hidden",children:[E("div",{className:"absolute inset-0 flex items-center justify-center",children:E("div",{className:"relative flex h-full w-[220px] items-center",children:Y("div",{className:"absolute inset-y-0 left-0 flex items-center gap-[16px] transition-transform duration-200",style:{transform:`translateX(${-1*(220+16)*t.events.length}px)`},children:[E(RB,{}),t.events.map(e=>E(iWe,{event:e},e.eventId)),E(RB,{})]})})}),E("div",{className:"absolute inset-y-0 left-0 w-40 bg-gradient-to-r from-denim-100 to-transparent"}),E("div",{className:"absolute inset-y-0 right-0 w-40 bg-gradient-to-l from-denim-100 to-transparent"})]})}function AB(t){return E("div",{className:"relative my-4 max-w-[18rem]",children:E(Ug,{value:t.selectedItem,onChange:t.setSelectedItem,children:({open:e})=>Y(xr,{children:[Y(Ug.Button,{className:"relative w-full cursor-default rounded-lg bg-denim-500 py-2 pl-3 pr-10 text-left text-white shadow-md focus:outline-none focus-visible:border-indigo-500 focus-visible:ring-2 focus-visible:ring-bink-500 focus-visible:ring-opacity-75 focus-visible:ring-offset-2 focus-visible:ring-offset-bink-300 sm:text-sm",children:[E("span",{className:"block truncate",children:t.selectedItem.name}),E("span",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2",children:E(Ve,{icon:ue.CHEVRON_DOWN,className:`transform transition-transform ${e?"rotate-180":""}`})})]}),E($A,{as:A.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:E(Ug.Options,{className:"absolute left-0 right-0 top-10 z-10 mt-1 max-h-60 overflow-auto rounded-md bg-denim-500 py-1 text-white shadow-lg ring-1 ring-black ring-opacity-5 scrollbar-thin scrollbar-track-denim-400 scrollbar-thumb-denim-200 focus:outline-none sm:top-10 sm:text-sm",children:t.options.map(r=>E(Ug.Option,{className:({active:n})=>`relative cursor-default select-none py-2 pl-10 pr-4 ${n?"bg-denim-400 text-bink-700":"text-white"}`,value:r,children:r.name},r.id))})})]})})})}function sWe(t){return Y(xr,{children:[E(va,{children:E("body",{"data-no-scroll":!0})}),Y("div",{className:"fixed inset-0 z-[99999]",children:[E($i,{animation:"fade",className:"absolute inset-0 bg-[rgba(8,6,18,0.85)]",isChild:!0}),t.children]})]})}function oWe(t){return E($i,{className:"fixed inset-0 z-[9999]",animation:"none",show:t.show,children:E(sWe,{children:E($i,{isChild:!0,className:"flex h-full w-full items-center justify-center",animation:"slide-up",children:t.children})})})}function fZ(t){return ql.createPortal(E(oWe,{show:t.show,children:t.children}),document.body)}function dZ(t){return E("div",{className:["relative mx-2 w-[500px] overflow-hidden rounded-lg bg-denim-300 px-10 py-10 sm:w-[500px] md:w-[500px] lg:w-[1000px]",t.className??""].join(" "),children:t.children})}function vo(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function AE(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&u1(t,e)}function xm(t,e){if(e&&(Gt(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return vo(t)}function xa(t){return xa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},xa(t)}function lWe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function cWe(t){return GY(t)||lWe(t)||VY(t)||WY()}function IB(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function $B(t){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:{};Di(this,t),this.init(e,r)}return Mi(t,[{key:"init",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=r||uWe,this.options=n,this.debug=n.debug}},{key:"setDebug",value:function(r){this.debug=r}},{key:"log",value:function(){for(var r=arguments.length,n=new Array(r),i=0;i1?n-1:0),a=1;a-1?o.replace(/###/g,"."):o}function i(){return!t||typeof t=="string"}for(var a=typeof e!="string"?[].concat(e):e.split(".");a.length>1;){if(i())return{};var s=n(a.shift());!t[s]&&r&&(t[s]=new r),Object.prototype.hasOwnProperty.call(t,s)?t=t[s]:t={}}return i()?{}:{obj:t,k:n(a.shift())}}function kB(t,e,r){var n=GO(t,e,Object),i=n.obj,a=n.k;i[a]=r}function hWe(t,e,r,n){var i=GO(t,e,Object),a=i.obj,s=i.k;a[s]=a[s]||[],n&&(a[s]=a[s].concat(r)),n||a[s].push(r)}function F1(t,e){var r=GO(t,e),n=r.obj,i=r.k;if(n)return n[i]}function pWe(t,e,r){var n=F1(t,r);return n!==void 0?n:F1(e,r)}function hZ(t,e,r){for(var n in e)n!=="__proto__"&&n!=="constructor"&&(n in t?typeof t[n]=="string"||t[n]instanceof String||typeof e[n]=="string"||e[n]instanceof String?r&&(t[n]=e[n]):hZ(t[n],e[n],r):t[n]=e[n]);return t}function Zc(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var mWe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function gWe(t){return typeof t=="string"?t.replace(/[&<>"'\/]/g,function(e){return mWe[e]}):t}var IE=typeof window<"u"&&window.navigator&&typeof window.navigator.userAgentData>"u"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,vWe=[" ",",","?","!",";"];function yWe(t,e,r){e=e||"",r=r||"";var n=vWe.filter(function(o){return e.indexOf(o)<0&&r.indexOf(o)<0});if(n.length===0)return!0;var i=new RegExp("(".concat(n.map(function(o){return o==="?"?"\\?":o}).join("|"),")")),a=!i.test(t);if(!a){var s=t.indexOf(r);s>0&&!i.test(t.substring(0,s))&&(a=!0)}return a}function B1(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(t){if(t[e])return t[e];for(var n=e.split(r),i=t,a=0;aa+s;)s++,o=n.slice(a,a+s).join(r),c=i[o];if(c===void 0)return;if(c===null)return null;if(e.endsWith(o)){if(typeof c=="string")return c;if(o&&typeof c[o]=="string")return c[o]}var l=n.slice(a+s).join(r);return l?B1(c,l,r):void 0}i=i[n[a]]}return i}}function OB(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Jg(t){for(var e=1;e"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var EWe=function(t){AE(r,t);var e=xWe(r);function r(n){var i,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return Di(this,r),i=e.call(this),IE&&Do.call(vo(i)),i.data=n||{},i.options=a,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.options.ignoreJSONStructure===void 0&&(i.options.ignoreJSONStructure=!0),i}return Mi(r,[{key:"addNamespaces",value:function(i){this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}},{key:"removeNamespaces",value:function(i){var a=this.options.ns.indexOf(i);a>-1&&this.options.ns.splice(a,1)}},{key:"getResource",value:function(i,a,s){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},c=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,l=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure,u=[i,a];s&&typeof s!="string"&&(u=u.concat(s)),s&&typeof s=="string"&&(u=u.concat(c?s.split(c):s)),i.indexOf(".")>-1&&(u=i.split("."));var f=F1(this.data,u);return f||!l||typeof s!="string"?f:B1(this.data&&this.data[i]&&this.data[i][a],s,c)}},{key:"addResource",value:function(i,a,s,o){var c=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},l=this.options.keySeparator;l===void 0&&(l=".");var u=[i,a];s&&(u=u.concat(l?s.split(l):s)),i.indexOf(".")>-1&&(u=i.split("."),o=a,a=u[1]),this.addNamespaces(a),kB(this.data,u,o),c.silent||this.emit("added",i,a,s,o)}},{key:"addResources",value:function(i,a,s){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var c in s)(typeof s[c]=="string"||Object.prototype.toString.apply(s[c])==="[object Array]")&&this.addResource(i,a,c,s[c],{silent:!0});o.silent||this.emit("added",i,a,s)}},{key:"addResourceBundle",value:function(i,a,s,o,c){var l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},u=[i,a];i.indexOf(".")>-1&&(u=i.split("."),o=s,s=a,a=u[1]),this.addNamespaces(a);var f=F1(this.data,u)||{};o?hZ(f,s,c):f=Jg(Jg({},f),s),kB(this.data,u,f),l.silent||this.emit("added",i,a,s)}},{key:"removeResourceBundle",value:function(i,a){this.hasResourceBundle(i,a)&&delete this.data[i][a],this.removeNamespaces(a),this.emit("removed",i,a)}},{key:"hasResourceBundle",value:function(i,a){return this.getResource(i,a)!==void 0}},{key:"getResourceBundle",value:function(i,a){return a||(a=this.options.defaultNS),this.options.compatibilityAPI==="v1"?Jg(Jg({},{}),this.getResource(i,a)):this.getResource(i,a)}},{key:"getDataByLanguage",value:function(i){return this.data[i]}},{key:"hasLanguageSomeTranslations",value:function(i){var a=this.getDataByLanguage(i),s=a&&Object.keys(a)||[];return!!s.find(function(o){return a[o]&&Object.keys(a[o]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),r}(Do),pZ={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,r,n,i,a){var s=this;return e.forEach(function(o){s.processors[o]&&(r=s.processors[o].process(r,n,i,a))}),r}};function LB(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function fr(t){for(var e=1;e"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var PB={},NB=function(t){AE(r,t);var e=SWe(r);function r(n){var i,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Di(this,r),i=e.call(this),IE&&Do.call(vo(i)),dWe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],n,vo(i)),i.options=a,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.logger=la.create("translator"),i}return Mi(r,[{key:"changeLanguage",value:function(i){i&&(this.language=i)}},{key:"exists",value:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(i==null)return!1;var s=this.resolve(i,a);return s&&s.res!==void 0}},{key:"extractFromKey",value:function(i,a){var s=a.nsSeparator!==void 0?a.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");var o=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,c=a.ns||this.options.defaultNS||[],l=s&&i.indexOf(s)>-1,u=!this.options.userDefinedKeySeparator&&!a.keySeparator&&!this.options.userDefinedNsSeparator&&!a.nsSeparator&&!yWe(i,s,o);if(l&&!u){var f=i.match(this.interpolator.nestingRegexp);if(f&&f.length>0)return{key:i,namespaces:c};var d=i.split(s);(s!==o||s===o&&this.options.ns.indexOf(d[0])>-1)&&(c=d.shift()),i=d.join(o)}return typeof c=="string"&&(c=[c]),{key:i,namespaces:c}}},{key:"translate",value:function(i,a,s){var o=this;if(Gt(a)!=="object"&&this.options.overloadTranslationOptionHandler&&(a=this.options.overloadTranslationOptionHandler(arguments)),Gt(a)==="object"&&(a=fr({},a)),a||(a={}),i==null)return"";Array.isArray(i)||(i=[String(i)]);var c=a.returnDetails!==void 0?a.returnDetails:this.options.returnDetails,l=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,u=this.extractFromKey(i[i.length-1],a),f=u.key,d=u.namespaces,h=d[d.length-1],p=a.lng||this.language,v=a.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(p&&p.toLowerCase()==="cimode"){if(v){var m=a.nsSeparator||this.options.nsSeparator;return c?{res:"".concat(h).concat(m).concat(f),usedKey:f,exactUsedKey:f,usedLng:p,usedNS:h}:"".concat(h).concat(m).concat(f)}return c?{res:f,usedKey:f,exactUsedKey:f,usedLng:p,usedNS:h}:f}var g=this.resolve(i,a),y=g&&g.res,x=g&&g.usedKey||f,b=g&&g.exactUsedKey||f,_=Object.prototype.toString.apply(y),S=["[object Number]","[object Function]","[object RegExp]"],w=a.joinArrays!==void 0?a.joinArrays:this.options.joinArrays,R=!this.i18nFormat||this.i18nFormat.handleAsObject,I=typeof y!="string"&&typeof y!="boolean"&&typeof y!="number";if(R&&y&&I&&S.indexOf(_)<0&&!(typeof w=="string"&&_==="[object Array]")){if(!a.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var T=this.options.returnedObjectHandler?this.options.returnedObjectHandler(x,y,fr(fr({},a),{},{ns:d})):"key '".concat(f," (").concat(this.language,")' returned an object instead of string.");return c?(g.res=T,g):T}if(l){var C=_==="[object Array]",L=C?[]:{},H=C?b:x;for(var N in y)if(Object.prototype.hasOwnProperty.call(y,N)){var P="".concat(H).concat(l).concat(N);L[N]=this.translate(P,fr(fr({},a),{joinArrays:!1,ns:d})),L[N]===P&&(L[N]=y[N])}y=L}}else if(R&&typeof w=="string"&&_==="[object Array]")y=y.join(w),y&&(y=this.extendTranslation(y,i,a,s));else{var B=!1,V=!1,M=a.count!==void 0&&typeof a.count!="string",U=r.hasDefaultValue(a),W=M?this.pluralResolver.getSuffix(p,a.count,a):"",k=a["defaultValue".concat(W)]||a.defaultValue;!this.isValidLookup(y)&&U&&(B=!0,y=k),this.isValidLookup(y)||(V=!0,y=f);var O=a.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,F=O&&V?void 0:y,D=U&&k!==y&&this.options.updateMissing;if(V||B||D){if(this.logger.log(D?"updateKey":"missingKey",p,h,f,D?k:y),l){var Q=this.resolve(f,fr(fr({},a),{},{keySeparator:!1}));Q&&Q.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var ee=[],de=this.languageUtils.getFallbackCodes(this.options.fallbackLng,a.lng||this.language);if(this.options.saveMissingTo==="fallback"&&de&&de[0])for(var oe=0;oe1&&arguments[1]!==void 0?arguments[1]:{},o,c,l,u,f;return typeof i=="string"&&(i=[i]),i.forEach(function(d){if(!a.isValidLookup(o)){var h=a.extractFromKey(d,s),p=h.key;c=p;var v=h.namespaces;a.options.fallbackNS&&(v=v.concat(a.options.fallbackNS));var m=s.count!==void 0&&typeof s.count!="string",g=m&&!s.ordinal&&s.count===0&&a.pluralResolver.shouldUseIntlApi(),y=s.context!==void 0&&(typeof s.context=="string"||typeof s.context=="number")&&s.context!=="",x=s.lngs?s.lngs:a.languageUtils.toResolveHierarchy(s.lng||a.language,s.fallbackLng);v.forEach(function(b){a.isValidLookup(o)||(f=b,!PB["".concat(x[0],"-").concat(b)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(f)&&(PB["".concat(x[0],"-").concat(b)]=!0,a.logger.warn('key "'.concat(c,'" for languages "').concat(x.join(", "),`" won't get resolved as namespace "`).concat(f,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),x.forEach(function(_){if(!a.isValidLookup(o)){u=_;var S=[p];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(S,p,_,b,s);else{var w;m&&(w=a.pluralResolver.getSuffix(_,s.count,s));var R="".concat(a.options.pluralSeparator,"zero");if(m&&(S.push(p+w),g&&S.push(p+R)),y){var I="".concat(p).concat(a.options.contextSeparator).concat(s.context);S.push(I),m&&(S.push(I+w),g&&S.push(I+R))}}for(var T;T=S.pop();)a.isValidLookup(o)||(l=T,o=a.getResource(_,b,T,s))}}))})}}),{res:o,usedKey:c,exactUsedKey:l,usedLng:u,usedNS:f}}},{key:"isValidLookup",value:function(i){return i!==void 0&&!(!this.options.returnNull&&i===null)&&!(!this.options.returnEmptyString&&i==="")}},{key:"getResource",value:function(i,a,s){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(i,a,s,o):this.resourceStore.getResource(i,a,s,o)}}],[{key:"hasDefaultValue",value:function(i){var a="defaultValue";for(var s in i)if(Object.prototype.hasOwnProperty.call(i,s)&&a===s.substring(0,a.length)&&i[s]!==void 0)return!0;return!1}}]),r}(Do);function IT(t){return t.charAt(0).toUpperCase()+t.slice(1)}var DB=function(){function t(e){Di(this,t),this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=la.create("languageUtils")}return Mi(t,[{key:"getScriptPartFromCode",value:function(r){if(!r||r.indexOf("-")<0)return null;var n=r.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}},{key:"getLanguagePartFromCode",value:function(r){if(!r||r.indexOf("-")<0)return r;var n=r.split("-");return this.formatLanguageCode(n[0])}},{key:"formatLanguageCode",value:function(r){if(typeof r=="string"&&r.indexOf("-")>-1){var n=["hans","hant","latn","cyrl","cans","mong","arab"],i=r.split("-");return this.options.lowerCaseLng?i=i.map(function(a){return a.toLowerCase()}):i.length===2?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),n.indexOf(i[1].toLowerCase())>-1&&(i[1]=IT(i[1].toLowerCase()))):i.length===3&&(i[0]=i[0].toLowerCase(),i[1].length===2&&(i[1]=i[1].toUpperCase()),i[0]!=="sgn"&&i[2].length===2&&(i[2]=i[2].toUpperCase()),n.indexOf(i[1].toLowerCase())>-1&&(i[1]=IT(i[1].toLowerCase())),n.indexOf(i[2].toLowerCase())>-1&&(i[2]=IT(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?r.toLowerCase():r}},{key:"isSupportedCode",value:function(r){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(r=this.getLanguagePartFromCode(r)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(r)>-1}},{key:"getBestMatchFromCodes",value:function(r){var n=this;if(!r)return null;var i;return r.forEach(function(a){if(!i){var s=n.formatLanguageCode(a);(!n.options.supportedLngs||n.isSupportedCode(s))&&(i=s)}}),!i&&this.options.supportedLngs&&r.forEach(function(a){if(!i){var s=n.getLanguagePartFromCode(a);if(n.isSupportedCode(s))return i=s;i=n.options.supportedLngs.find(function(o){if(o===s)return o;if(!(o.indexOf("-")<0&&s.indexOf("-")<0)&&o.indexOf(s)===0)return o})}}),i||(i=this.getFallbackCodes(this.options.fallbackLng)[0]),i}},{key:"getFallbackCodes",value:function(r,n){if(!r)return[];if(typeof r=="function"&&(r=r(n)),typeof r=="string"&&(r=[r]),Object.prototype.toString.apply(r)==="[object Array]")return r;if(!n)return r.default||[];var i=r[n];return i||(i=r[this.getScriptPartFromCode(n)]),i||(i=r[this.formatLanguageCode(n)]),i||(i=r[this.getLanguagePartFromCode(n)]),i||(i=r.default),i||[]}},{key:"toResolveHierarchy",value:function(r,n){var i=this,a=this.getFallbackCodes(n||this.options.fallbackLng||[],r),s=[],o=function(l){l&&(i.isSupportedCode(l)?s.push(l):i.logger.warn("rejecting language code not found in supportedLngs: ".concat(l)))};return typeof r=="string"&&r.indexOf("-")>-1?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(r)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(r)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(r))):typeof r=="string"&&o(this.formatLanguageCode(r)),a.forEach(function(c){s.indexOf(c)<0&&o(i.formatLanguageCode(c))}),s}}]),t}(),wWe=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],TWe={1:function(e){return+(e>1)},2:function(e){return+(e!=1)},3:function(e){return 0},4:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},5:function(e){return e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},6:function(e){return e==1?0:e>=2&&e<=4?1:2},7:function(e){return e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},8:function(e){return e==1?0:e==2?1:e!=8&&e!=11?2:3},9:function(e){return+(e>=2)},10:function(e){return e==1?0:e==2?1:e<7?2:e<11?3:4},11:function(e){return e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3},12:function(e){return+(e%10!=1||e%100==11)},13:function(e){return+(e!==0)},14:function(e){return e==1?0:e==2?1:e==3?2:3},15:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2},16:function(e){return e%10==1&&e%100!=11?0:e!==0?1:2},17:function(e){return e==1||e%10==1&&e%100!=11?0:1},18:function(e){return e==0?0:e==1?1:2},19:function(e){return e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3},20:function(e){return e==1?0:e==0||e%100>0&&e%100<20?1:2},21:function(e){return e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0},22:function(e){return e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3}},RWe=["v1","v2","v3"],MB={zero:0,one:1,two:2,few:3,many:4,other:5};function AWe(){var t={};return wWe.forEach(function(e){e.lngs.forEach(function(r){t[r]={numbers:e.nr,plurals:TWe[e.fc]}})}),t}var IWe=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Di(this,t),this.languageUtils=e,this.options=r,this.logger=la.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=AWe()}return Mi(t,[{key:"addRule",value:function(r,n){this.rules[r]=n}},{key:"getRule",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(r,{type:n.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[r]||this.rules[this.languageUtils.getLanguagePartFromCode(r)]}},{key:"needsPlural",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.getRule(r,n);return this.shouldUseIntlApi()?i&&i.resolvedOptions().pluralCategories.length>1:i&&i.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(r,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(r,i).map(function(a){return"".concat(n).concat(a)})}},{key:"getSuffixes",value:function(r){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=this.getRule(r,i);return a?this.shouldUseIntlApi()?a.resolvedOptions().pluralCategories.sort(function(s,o){return MB[s]-MB[o]}).map(function(s){return"".concat(n.options.prepend).concat(s)}):a.numbers.map(function(s){return n.getSuffix(r,s,i)}):[]}},{key:"getSuffix",value:function(r,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=this.getRule(r,i);return a?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(a.select(n)):this.getSuffixRetroCompatible(a,n):(this.logger.warn("no plural rule found for: ".concat(r)),"")}},{key:"getSuffixRetroCompatible",value:function(r,n){var i=this,a=r.noAbs?r.plurals(n):r.plurals(Math.abs(n)),s=r.numbers[a];this.options.simplifyPluralSuffix&&r.numbers.length===2&&r.numbers[0]===1&&(s===2?s="plural":s===1&&(s=""));var o=function(){return i.options.prepend&&s.toString()?i.options.prepend+s.toString():s.toString()};return this.options.compatibilityJSON==="v1"?s===1?"":typeof s=="number"?"_plural_".concat(s.toString()):o():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&r.numbers.length===2&&r.numbers[0]===1?o():this.options.prepend&&a.toString()?this.options.prepend+a.toString():a.toString()}},{key:"shouldUseIntlApi",value:function(){return!RWe.includes(this.options.compatibilityJSON)}}]),t}();function FB(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function vi(t){for(var e=1;e3&&arguments[3]!==void 0?arguments[3]:".",i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=pWe(t,e,r);return!a&&i&&typeof r=="string"&&(a=B1(t,r,n),a===void 0&&(a=B1(e,r,n))),a}var $We=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Di(this,t),this.logger=la.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||function(r){return r},this.init(e)}return Mi(t,[{key:"init",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};r.interpolation||(r.interpolation={escapeValue:!0});var n=r.interpolation;this.escape=n.escape!==void 0?n.escape:gWe,this.escapeValue=n.escapeValue!==void 0?n.escapeValue:!0,this.useRawValueToEscape=n.useRawValueToEscape!==void 0?n.useRawValueToEscape:!1,this.prefix=n.prefix?Zc(n.prefix):n.prefixEscaped||"{{",this.suffix=n.suffix?Zc(n.suffix):n.suffixEscaped||"}}",this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||",",this.unescapePrefix=n.unescapeSuffix?"":n.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":n.unescapeSuffix||"",this.nestingPrefix=n.nestingPrefix?Zc(n.nestingPrefix):n.nestingPrefixEscaped||Zc("$t("),this.nestingSuffix=n.nestingSuffix?Zc(n.nestingSuffix):n.nestingSuffixEscaped||Zc(")"),this.nestingOptionsSeparator=n.nestingOptionsSeparator?n.nestingOptionsSeparator:n.nestingOptionsSeparator||",",this.maxReplaces=n.maxReplaces?n.maxReplaces:1e3,this.alwaysFormat=n.alwaysFormat!==void 0?n.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var r="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(r,"g");var n="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(n,"g");var i="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(i,"g")}},{key:"interpolate",value:function(r,n,i,a){var s=this,o,c,l,u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function f(m){return m.replace(/\$/g,"$$$$")}var d=function(g){if(g.indexOf(s.formatSeparator)<0){var y=BB(n,u,g,s.options.keySeparator,s.options.ignoreJSONStructure);return s.alwaysFormat?s.format(y,void 0,i,vi(vi(vi({},a),n),{},{interpolationkey:g})):y}var x=g.split(s.formatSeparator),b=x.shift().trim(),_=x.join(s.formatSeparator).trim();return s.format(BB(n,u,b,s.options.keySeparator,s.options.ignoreJSONStructure),_,i,vi(vi(vi({},a),n),{},{interpolationkey:b}))};this.resetRegExp();var h=a&&a.missingInterpolationHandler||this.options.missingInterpolationHandler,p=a&&a.interpolation&&a.interpolation.skipOnVariables!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,v=[{regex:this.regexpUnescape,safeValue:function(g){return f(g)}},{regex:this.regexp,safeValue:function(g){return s.escapeValue?f(s.escape(g)):f(g)}}];return v.forEach(function(m){for(l=0;o=m.regex.exec(r);){var g=o[1].trim();if(c=d(g),c===void 0)if(typeof h=="function"){var y=h(r,o,a);c=typeof y=="string"?y:""}else if(a&&Object.prototype.hasOwnProperty.call(a,g))c="";else if(p){c=o[0];continue}else s.logger.warn("missed to pass in variable ".concat(g," for interpolating ").concat(r)),c="";else typeof c!="string"&&!s.useRawValueToEscape&&(c=CB(c));var x=m.safeValue(c);if(r=r.replace(o[0],x),p?(m.regex.lastIndex+=c.length,m.regex.lastIndex-=o[0].length):m.regex.lastIndex=0,l++,l>=s.maxReplaces)break}}),r}},{key:"nest",value:function(r,n){var i=this,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,o,c;function l(h,p){var v=this.nestingOptionsSeparator;if(h.indexOf(v)<0)return h;var m=h.split(new RegExp("".concat(v,"[ ]*{"))),g="{".concat(m[1]);h=m[0],g=this.interpolate(g,c);var y=g.match(/'/g),x=g.match(/"/g);(y&&y.length%2===0&&!x||x.length%2!==0)&&(g=g.replace(/'/g,'"'));try{c=JSON.parse(g),p&&(c=vi(vi({},p),c))}catch(b){return this.logger.warn("failed parsing options string in nesting for key ".concat(h),b),"".concat(h).concat(v).concat(g)}return delete c.defaultValue,h}for(;s=this.nestingRegexp.exec(r);){var u=[];c=vi({},a),c=c.replace&&typeof c.replace!="string"?c.replace:c,c.applyPostProcessor=!1,delete c.defaultValue;var f=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){var d=s[1].split(this.formatSeparator).map(function(h){return h.trim()});s[1]=d.shift(),u=d,f=!0}if(o=n(l.call(this,s[1].trim(),c),c),o&&s[0]===r&&typeof o!="string")return o;typeof o!="string"&&(o=CB(o)),o||(this.logger.warn("missed to resolve ".concat(s[1]," for nesting ").concat(r)),o=""),f&&(o=u.reduce(function(h,p){return i.format(h,p,a.lng,vi(vi({},a),{},{interpolationkey:s[1].trim()}))},o.trim())),r=r.replace(s[0],o),this.regexp.lastIndex=0}return r}}]),t}();function UB(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function La(t){for(var e=1;e-1){var n=t.split("(");e=n[0].toLowerCase().trim();var i=n[1].substring(0,n[1].length-1);if(e==="currency"&&i.indexOf(":")<0)r.currency||(r.currency=i.trim());else if(e==="relativetime"&&i.indexOf(":")<0)r.range||(r.range=i.trim());else{var a=i.split(";");a.forEach(function(s){if(s){var o=s.split(":"),c=cWe(o),l=c[0],u=c.slice(1),f=u.join(":").trim().replace(/^'+|'+$/g,"");r[l.trim()]||(r[l.trim()]=f),f==="false"&&(r[l.trim()]=!1),f==="true"&&(r[l.trim()]=!0),isNaN(f)||(r[l.trim()]=parseInt(f,10))}})}}return{formatName:e,formatOptions:r}}function Jc(t){var e={};return function(n,i,a){var s=i+JSON.stringify(a),o=e[s];return o||(o=t(i,a),e[s]=o),o(n)}}var kWe=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Di(this,t),this.logger=la.create("formatter"),this.options=e,this.formats={number:Jc(function(r,n){var i=new Intl.NumberFormat(r,La({},n));return function(a){return i.format(a)}}),currency:Jc(function(r,n){var i=new Intl.NumberFormat(r,La(La({},n),{},{style:"currency"}));return function(a){return i.format(a)}}),datetime:Jc(function(r,n){var i=new Intl.DateTimeFormat(r,La({},n));return function(a){return i.format(a)}}),relativetime:Jc(function(r,n){var i=new Intl.RelativeTimeFormat(r,La({},n));return function(a){return i.format(a,n.range||"day")}}),list:Jc(function(r,n){var i=new Intl.ListFormat(r,La({},n));return function(a){return i.format(a)}})},this.init(e)}return Mi(t,[{key:"init",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},i=n.interpolation;this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||","}},{key:"add",value:function(r,n){this.formats[r.toLowerCase().trim()]=n}},{key:"addCached",value:function(r,n){this.formats[r.toLowerCase().trim()]=Jc(n)}},{key:"format",value:function(r,n,i){var a=this,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},o=n.split(this.formatSeparator),c=o.reduce(function(l,u){var f=CWe(u),d=f.formatName,h=f.formatOptions;if(a.formats[d]){var p=l;try{var v=s&&s.formatParams&&s.formatParams[s.interpolationkey]||{},m=v.locale||v.lng||s.locale||s.lng||i;p=a.formats[d](l,m,La(La(La({},h),s),v))}catch(g){a.logger.warn(g)}return p}else a.logger.warn("there was no format function for ".concat(d));return l},r);return c}}]),t}();function jB(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function HB(t){for(var e=1;e"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function PWe(t,e){t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)}var NWe=function(t){AE(r,t);var e=OWe(r);function r(n,i,a){var s,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return Di(this,r),s=e.call(this),IE&&Do.call(vo(s)),s.backend=n,s.store=i,s.services=a,s.languageUtils=a.languageUtils,s.options=o,s.logger=la.create("backendConnector"),s.waitingReads=[],s.maxParallelReads=o.maxParallelReads||10,s.readingCalls=0,s.maxRetries=o.maxRetries>=0?o.maxRetries:5,s.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,s.state={},s.queue=[],s.backend&&s.backend.init&&s.backend.init(a,o.backend,o),s}return Mi(r,[{key:"queueLoad",value:function(i,a,s,o){var c=this,l={},u={},f={},d={};return i.forEach(function(h){var p=!0;a.forEach(function(v){var m="".concat(h,"|").concat(v);!s.reload&&c.store.hasResourceBundle(h,v)?c.state[m]=2:c.state[m]<0||(c.state[m]===1?u[m]===void 0&&(u[m]=!0):(c.state[m]=1,p=!1,u[m]===void 0&&(u[m]=!0),l[m]===void 0&&(l[m]=!0),d[v]===void 0&&(d[v]=!0)))}),p||(f[h]=!0)}),(Object.keys(l).length||Object.keys(u).length)&&this.queue.push({pending:u,pendingCount:Object.keys(u).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(l),pending:Object.keys(u),toLoadLanguages:Object.keys(f),toLoadNamespaces:Object.keys(d)}}},{key:"loaded",value:function(i,a,s){var o=i.split("|"),c=o[0],l=o[1];a&&this.emit("failedLoading",c,l,a),s&&this.store.addResourceBundle(c,l,s),this.state[i]=a?-1:2;var u={};this.queue.forEach(function(f){hWe(f.loaded,[c],l),PWe(f,i),a&&f.errors.push(a),f.pendingCount===0&&!f.done&&(Object.keys(f.loaded).forEach(function(d){u[d]||(u[d]={});var h=f.loaded[d];h.length&&h.forEach(function(p){u[d][p]===void 0&&(u[d][p]=!0)})}),f.done=!0,f.errors.length?f.callback(f.errors):f.callback())}),this.emit("loaded",u),this.queue=this.queue.filter(function(f){return!f.done})}},{key:"read",value:function(i,a,s){var o=this,c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,u=arguments.length>5?arguments[5]:void 0;if(!i.length)return u(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:i,ns:a,fcName:s,tried:c,wait:l,callback:u});return}this.readingCalls++;var f=function(v,m){if(o.readingCalls--,o.waitingReads.length>0){var g=o.waitingReads.shift();o.read(g.lng,g.ns,g.fcName,g.tried,g.wait,g.callback)}if(v&&m&&c2&&arguments[2]!==void 0?arguments[2]:{},c=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),c&&c();typeof i=="string"&&(i=this.languageUtils.toResolveHierarchy(i)),typeof a=="string"&&(a=[a]);var l=this.queueLoad(i,a,o,c);if(!l.toLoad.length)return l.pending.length||c(),null;l.toLoad.forEach(function(u){s.loadOne(u)})}},{key:"load",value:function(i,a,s){this.prepareLoading(i,a,{},s)}},{key:"reload",value:function(i,a,s){this.prepareLoading(i,a,{reload:!0},s)}},{key:"loadOne",value:function(i){var a=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",o=i.split("|"),c=o[0],l=o[1];this.read(c,l,"read",void 0,void 0,function(u,f){u&&a.logger.warn("".concat(s,"loading namespace ").concat(l," for language ").concat(c," failed"),u),!u&&f&&a.logger.log("".concat(s,"loaded namespace ").concat(l," for language ").concat(c),f),a.loaded(i,u,f)})}},{key:"saveMissing",value:function(i,a,s,o,c){var l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},u=arguments.length>6&&arguments[6]!==void 0?arguments[6]:function(){};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(a)){this.logger.warn('did not save key "'.concat(s,'" as the namespace "').concat(a,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(s==null||s==="")){if(this.backend&&this.backend.create){var f=HB(HB({},l),{},{isUpdate:c}),d=this.backend.create.bind(this.backend);if(d.length<6)try{var h;d.length===5?h=d(i,a,s,o,f):h=d(i,a,s,o),h&&typeof h.then=="function"?h.then(function(p){return u(null,p)}).catch(u):u(null,h)}catch(p){u(p)}else d(i,a,s,o,u,f)}!i||!i[0]||this.store.addResource(i[0],a,s,o)}}}]),r}(Do);function zB(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var r={};if(Gt(e[1])==="object"&&(r=e[1]),typeof e[1]=="string"&&(r.defaultValue=e[1]),typeof e[2]=="string"&&(r.tDescription=e[2]),Gt(e[2])==="object"||Gt(e[3])==="object"){var n=e[3]||e[2];Object.keys(n).forEach(function(i){r[i]=n[i]})}return r},interpolation:{escapeValue:!0,format:function(e,r,n,i){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function GB(t){return typeof t.ns=="string"&&(t.ns=[t.ns]),typeof t.fallbackLng=="string"&&(t.fallbackLng=[t.fallbackLng]),typeof t.fallbackNS=="string"&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t}function VB(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Yi(t){for(var e=1;e"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ev(){}function FWe(t){var e=Object.getOwnPropertyNames(Object.getPrototypeOf(t));e.forEach(function(r){typeof t[r]=="function"&&(t[r]=t[r].bind(t))})}var U1=function(t){AE(r,t);var e=DWe(r);function r(){var n,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;if(Di(this,r),n=e.call(this),IE&&Do.call(vo(n)),n.options=GB(i),n.services={},n.logger=la,n.modules={external:[]},FWe(vo(n)),a&&!n.isInitialized&&!i.isClone){if(!n.options.initImmediate)return n.init(i,a),xm(n,vo(n));setTimeout(function(){n.init(i,a)},0)}return n}return Mi(r,[{key:"init",value:function(){var i=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;typeof a=="function"&&(s=a,a={}),!a.defaultNS&&a.defaultNS!==!1&&a.ns&&(typeof a.ns=="string"?a.defaultNS=a.ns:a.ns.indexOf("translation")<0&&(a.defaultNS=a.ns[0]));var o=zB();this.options=Yi(Yi(Yi({},o),this.options),GB(a)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=Yi(Yi({},o.interpolation),this.options.interpolation)),a.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=a.keySeparator),a.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=a.nsSeparator);function c(g){return g?typeof g=="function"?new g:g:null}if(!this.options.isClone){this.modules.logger?la.init(c(this.modules.logger),this.options):la.init(null,this.options);var l;this.modules.formatter?l=this.modules.formatter:typeof Intl<"u"&&(l=kWe);var u=new DB(this.options);this.store=new EWe(this.options.resources,this.options);var f=this.services;f.logger=la,f.resourceStore=this.store,f.languageUtils=u,f.pluralResolver=new IWe(u,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),l&&(!this.options.interpolation.format||this.options.interpolation.format===o.interpolation.format)&&(f.formatter=c(l),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new $We(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new NWe(c(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(g){for(var y=arguments.length,x=new Array(y>1?y-1:0),b=1;b1?y-1:0),b=1;b0&&d[0]!=="dev"&&(this.options.lng=d[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var h=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];h.forEach(function(g){i[g]=function(){var y;return(y=i.store)[g].apply(y,arguments)}});var p=["addResource","addResources","addResourceBundle","removeResourceBundle"];p.forEach(function(g){i[g]=function(){var y;return(y=i.store)[g].apply(y,arguments),i}});var v=ch(),m=function(){var y=function(b,_){i.isInitialized&&!i.initializedStoreOnce&&i.logger.warn("init: i18next is already initialized. You should call init just once!"),i.isInitialized=!0,i.options.isClone||i.logger.log("initialized",i.options),i.emit("initialized",i.options),v.resolve(_),s(b,_)};if(i.languages&&i.options.compatibilityAPI!=="v1"&&!i.isInitialized)return y(null,i.t.bind(i));i.changeLanguage(i.options.lng,y)};return this.options.resources||!this.options.initImmediate?m():setTimeout(m,0),v}},{key:"loadResources",value:function(i){var a=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ev,o=s,c=typeof i=="string"?i:this.language;if(typeof i=="function"&&(o=i),!this.options.resources||this.options.partialBundledLanguages){if(c&&c.toLowerCase()==="cimode")return o();var l=[],u=function(h){if(h){var p=a.services.languageUtils.toResolveHierarchy(h);p.forEach(function(v){l.indexOf(v)<0&&l.push(v)})}};if(c)u(c);else{var f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.forEach(function(d){return u(d)})}this.options.preload&&this.options.preload.forEach(function(d){return u(d)}),this.services.backendConnector.load(l,this.options.ns,function(d){!d&&!a.resolvedLanguage&&a.language&&a.setResolvedLanguage(a.language),o(d)})}else o(null)}},{key:"reloadResources",value:function(i,a,s){var o=ch();return i||(i=this.languages),a||(a=this.options.ns),s||(s=ev),this.services.backendConnector.reload(i,a,function(c){o.resolve(),s(c)}),o}},{key:"use",value:function(i){if(!i)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!i.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return i.type==="backend"&&(this.modules.backend=i),(i.type==="logger"||i.log&&i.warn&&i.error)&&(this.modules.logger=i),i.type==="languageDetector"&&(this.modules.languageDetector=i),i.type==="i18nFormat"&&(this.modules.i18nFormat=i),i.type==="postProcessor"&&pZ.addPostProcessor(i),i.type==="formatter"&&(this.modules.formatter=i),i.type==="3rdParty"&&this.modules.external.push(i),this}},{key:"setResolvedLanguage",value:function(i){if(!(!i||!this.languages)&&!(["cimode","dev"].indexOf(i)>-1))for(var a=0;a-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}}},{key:"changeLanguage",value:function(i,a){var s=this;this.isLanguageChangingTo=i;var o=ch();this.emit("languageChanging",i);var c=function(d){s.language=d,s.languages=s.services.languageUtils.toResolveHierarchy(d),s.resolvedLanguage=void 0,s.setResolvedLanguage(d)},l=function(d,h){h?(c(h),s.translator.changeLanguage(h),s.isLanguageChangingTo=void 0,s.emit("languageChanged",h),s.logger.log("languageChanged",h)):s.isLanguageChangingTo=void 0,o.resolve(function(){return s.t.apply(s,arguments)}),a&&a(d,function(){return s.t.apply(s,arguments)})},u=function(d){!i&&!d&&s.services.languageDetector&&(d=[]);var h=typeof d=="string"?d:s.services.languageUtils.getBestMatchFromCodes(d);h&&(s.language||c(h),s.translator.language||s.translator.changeLanguage(h),s.services.languageDetector&&s.services.languageDetector.cacheUserLanguage&&s.services.languageDetector.cacheUserLanguage(h)),s.loadResources(h,function(p){l(p,h)})};return!i&&this.services.languageDetector&&!this.services.languageDetector.async?u(this.services.languageDetector.detect()):!i&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(u):this.services.languageDetector.detect(u):u(i),o}},{key:"getFixedT",value:function(i,a,s){var o=this,c=function l(u,f){var d;if(Gt(f)!=="object"){for(var h=arguments.length,p=new Array(h>2?h-2:0),v=2;v1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var o=this.resolvedLanguage||this.languages[0],c=this.options?this.options.fallbackLng:!1,l=this.languages[this.languages.length-1];if(o.toLowerCase()==="cimode")return!0;var u=function(h,p){var v=a.services.backendConnector.state["".concat(h,"|").concat(p)];return v===-1||v===2};if(s.precheck){var f=s.precheck(this,u);if(f!==void 0)return f}return!!(this.hasResourceBundle(o,i)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||u(o,i)&&(!c||u(l,i)))}},{key:"loadNamespaces",value:function(i,a){var s=this,o=ch();return this.options.ns?(typeof i=="string"&&(i=[i]),i.forEach(function(c){s.options.ns.indexOf(c)<0&&s.options.ns.push(c)}),this.loadResources(function(c){o.resolve(),a&&a(c)}),o):(a&&a(),Promise.resolve())}},{key:"loadLanguages",value:function(i,a){var s=ch();typeof i=="string"&&(i=[i]);var o=this.options.preload||[],c=i.filter(function(l){return o.indexOf(l)<0});return c.length?(this.options.preload=o.concat(c),this.loadResources(function(l){s.resolve(),a&&a(l)}),s):(a&&a(),Promise.resolve())}},{key:"dir",value:function(i){if(i||(i=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!i)return"rtl";var a=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],s=this.services&&this.services.languageUtils||new DB(zB());return a.indexOf(s.getLanguagePartFromCode(i))>-1||i.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var i=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ev,o=Yi(Yi(Yi({},this.options),a),{isClone:!0}),c=new r(o);(a.debug!==void 0||a.prefix!==void 0)&&(c.logger=c.logger.clone(a));var l=["store","services","language"];return l.forEach(function(u){c[u]=i[u]}),c.services=Yi({},this.services),c.services.utils={hasLoadedNamespace:c.hasLoadedNamespace.bind(c)},c.translator=new NB(c.services,c.options),c.translator.on("*",function(u){for(var f=arguments.length,d=new Array(f>1?f-1:0),h=1;h0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return new U1(t,e)});var lr=U1.createInstance();lr.createInstance=U1.createInstance;lr.createInstance;lr.dir;lr.init;lr.loadResources;lr.reloadResources;lr.use;lr.changeLanguage;lr.getFixedT;lr.t;lr.exists;lr.setDefaultNamespace;lr.hasLoadedNamespace;lr.loadNamespaces;lr.loadLanguages;const BWe={name:"movie-web"},UWe={loading_series:"Načítání Vašich oblíbených seriálů...",loading_movie:"Načítání Vašich oblíbených filmů...",loading:"Načítání...",allResults:"To je vše co máme!",noResults:"Nemohli jsme nic najít!",allFailed:"Nepodařilo se najít média, zkuste to znovu!",headingTitle:"Výsledky vyhledávání",bookmarks:"Záložky",continueWatching:"Pokračujte ve sledování",title:"Co si přejete sledovat?",placeholder:"Co si přejete sledovat?"},jWe={movie:"Filmy",series:"Seriály",stopEditing:"Zastavit upravování",errors:{genericTitle:"Jejda, rozbilo se to!",failedMeta:"Nepovedlo se načíst meta",mediaFailed:"Nepodařilo se nám požádat o Vaše média, zkontrolujte své internetové připojení a zkuste to znovu.",videoFailed:"Při přehrávání požadovaného videa došlo k chybě. Pokud se tohle opakuje prosím nahlašte nám to na <0>Discord serveru nebo na <1>GitHubu."}},HWe={seasonAndEpisode:"S{{season}} E{{episode}}"},zWe={genericTitle:"Nenalezeno",backArrow:"Zpátky domů",media:{title:"Nemohli jsme najít Vaše média.",description:"Nemohli jsme najít média o které jste požádali. Buďto jsme ho nemohli najít, nebo jste manipulovali s URL."},provider:{title:"Tento poskytovatel byl zakázán",description:"Měli jsme s tímto poskytovatelem problémy, nebo byl moc nestabilní na používání, a tak jsme ho museli zakázat."},page:{title:"Tuto stránku se nepodařilo najít",description:"Dívali jsme se všude: pod koši, ve skříni, za proxy, ale nakonec jsme nemohli najít stránku, kterou hledáte."}},GWe={movie:"Film",series:"Seriál",Search:"Hledání"},VWe={findingBestVideo:"Hledáme pro Vás nejlepší video",noVideos:"Jejda, nemohli jsme žádné video najít",loading:"Načítání...",backToHome:"Zpátky domů",backToHomeShort:"Zpět",seasonAndEpisode:"S{{season}} E{{episode}}",timeLeft:"Zbývá {{timeLeft}}",finishAt:"Končí ve {{timeFinished, datetime}}",buttons:{episodes:"Epizody",source:"Zdroj",captions:"Titulky",download:"Stáhnout",settings:"Nastavení",pictureInPicture:"Obraz v obraze",playbackSpeed:"Rychlost přehrávání"},popouts:{back:"Zpět",sources:"Zdroje",seasons:"Sezóny",captions:"Titulky",playbackSpeed:"Rychlost přehrávání",customPlaybackSpeed:"Vlastní rychlost přehrávání",captionPreferences:{title:"Upravit",delay:"Zpoždení",fontSize:"Velikost",opacity:"Průhlednost",color:"Barva"},episode:"E{{index}} - {{title}}",noCaptions:"Žádné titulky",linkedCaptions:"Propojené titulky",customCaption:"Vlastní titulky",uploadCustomCaption:"Nahrát titulky",noEmbeds:"Nebyla nalezena žádná vložení pro tento zdroj",errors:{loadingWentWong:"Něco se nepovedlo při načítání epizod pro {{seasonTitle}}",embedsError:"Něco se povedlo při načítání vložení pro tuhle věc, kterou máte tak rádi"},descriptions:{sources:"Jakého poskytovatele chcete použít?",embeds:"Vyberte video, které chcete sledovat",seasons:"Vyberte sérii, kterou chcete sledovat",episode:"Vyberte epizodu",captions:"Vyberte jazyk titulků",captionPreferences:"Upravte titulky tak, jak se Vám budou líbit",playbackSpeed:"Změňtě rychlost přehrávání"}},errors:{fatalError:"Došlo k závažné chybě v přehrávači videa, prosím nahlašte ji na <0>Discord serveru nebo na <1>GitHubu."}},WWe={title:"Nastavení",language:"Jazyk",captionLanguage:"Jazyk titulků"},KWe={newSiteTitle:"Je dostupná nová verze!",newDomain:"https://movie-web.app",newDomainText:"movie-web se brzy přesune na novou doménu: <0>https://movie-web.app. Nezapomeňte si aktualizovat záložky, protože <1>stará stránka přestane fungovat {{date}}.",tireless:"Pracovali jsme neúnavně na této nové aktualizaci, a tak doufáme, že se Vám bude líbit co jsme v posledních měsících kuchtili.",leaveAnnouncement:"Vezměte mě tam!"},YWe={casting:"Přehrávání do zařízení..."},qWe={offline:"Zkontrolujte své internetové připojení"},XWe={global:BWe,search:UWe,media:jWe,seasons:HWe,notFound:zWe,searchBar:GWe,videoPlayer:VWe,settings:WWe,v3:KWe,casting:YWe,errors:qWe},QWe={name:"movie-web"},ZWe={loading_series:"Auf der Suche nach deiner Lieblingsserie...",loading_movie:"Auf der Suche nach deinen Lieblingsfilmen...",loading:"Wird geladen...",allResults:"Das ist alles, was wir haben!",noResults:"Wir haben nichts gefunden!",allFailed:"Das Medium wurde nicht gefunden, bitte versuchen Sie es erneut!",headingTitle:"Suchergebnisse",bookmarks:"Favoriten",continueWatching:"Weiter ansehen",title:"Was willst du gucken?",placeholder:"Was willst du gucken?"},JWe={movie:"Filme",series:"Serie",stopEditing:"Beenden die Bearbeitung",errors:{genericTitle:"Hoppla, etwas ist schiefgegangen!",failedMeta:"Metadaten konnten nicht geladen werden",mediaFailed:"Wir konnten die angeforderten Medien nicht abrufen.",videoFailed:"Beim Abspielen des angeforderten Videos ist ein Fehler aufgetreten. <0>Discord Oder weiter <1>GitHub."}},eKe={seasonAndEpisode:"S{{season}} E{{episode}}"},tKe={genericTitle:"Nicht gefunden",backArrow:"Zurück zur Startseite",media:{title:"Das Medium konnte nicht gefunden werden",description:"Wir konnten die angeforderten Medien nicht finden."},provider:{title:"Dieser Anbieter wurde deaktiviert",description:"Wir hatten Probleme mit dem Anbieter oder er war zu instabil, sodass wir ihn deaktivieren mussten."},page:{title:"Diese Seite kann nicht gefunden werden",description:"Wir haben überall gesucht, aber am Ende konnten wir die gesuchte Seite nicht finden."}},rKe={movie:"Film",series:"Serie",Search:"Suchen"},nKe={findingBestVideo:"Auf der Suche nach dem besten Video für Sie",noVideos:"Entschuldigung, wir konnten keine Videos finden",loading:"Wird geladen...",backToHome:"Zurück zur Startseite",backToHomeShort:"Rückmeldung",seasonAndEpisode:"S{{season}} E{{episode}}",timeLeft:"{{timeLeft}} verbleibend",finishAt:"Endet um {{timeFinished, datetime}}",buttons:{episodes:"Folgen",source:"Quelle",captions:"Untertitel",download:"Herunterladen",settings:"Einstellungen",pictureInPicture:"Bild-im-Bild",playbackSpeed:"Wiedergabegeschwindigkeit"},popouts:{back:"Zurück",sources:"Quellen",seasons:"Staffel",captions:"Untertitel",playbackSpeed:"Lesegeschwindigkeit",customPlaybackSpeed:"Benutzerdefinierte Wiedergabegeschwindigkeit",captionPreferences:{title:"Bearbeiten",delay:"Verzögerung",fontSize:"Größe",opacity:"Opazität",color:"Farbe"},episode:"E{{index}} - {{title}}",noCaptions:"Keine Untertitel",linkedCaptions:"Verbundene Untertitel",customCaption:"Benutzerdefinierte Untertitel",uploadCustomCaption:"Untertitel hochladen",noEmbeds:"Für diese Quelle wurde kein eingebetteter Inhalt gefunden",errors:{loadingWentWong:"Beim Laden der Folgen für {{seasonTitle}} ist ein Problem aufgetreten ",embedsError:"Beim Laden der eingebetteter Medien ist ein Problem aufgetreten"},descriptions:{sources:"Welchen Anbieter möchtest du nutzen?",embeds:"Wähle das Video aus, das du ansehen möchten",seasons:"Wähle die Staffel aus, die du sehen möchten",episode:"Wähle eine Folge aus",captions:"Wähle eine Untertitelsprache",captionPreferences:"Passe das Erscheinungsbild von Untertiteln an",playbackSpeed:"Wiedergabegeschwindigkeit ändern"}},errors:{fatalError:"Der Videoplayer hat einen Fehler festgestellt, bitte melde ihn dem Server <0>Discord Oder weiter <1>GitHub."}},iKe={title:"Einstellungen",language:"Sprache",captionLanguage:"Untertitelsprache"},aKe={newSiteTitle:"Neue Version verfügbar!",newDomain:"https://movie-web.app",newDomainText:"movie-web zieht in Kürze auf eine neue Domain um: <0>https://movie-web.app. <1>Die alte Website funktioniert nicht mehr {{date}}.",tireless:"Wir haben unermüdlich an diesem neuen Update gearbeitet und hoffen, dass dir gefällt, was wir in den letzten Monaten vorbereitet haben.",leaveAnnouncement:"Bring mich dahin!"},sKe={casting:"An Gerät übertragen..."},oKe={offline:"Internetverbindung ist instabil"},lKe={global:QWe,search:ZWe,media:JWe,seasons:eKe,notFound:tKe,searchBar:rKe,videoPlayer:nKe,settings:iKe,v3:aKe,casting:sKe,errors:oKe},cKe={name:"movie-web"},uKe={loading_series:"Fetching your favourite series...",loading_movie:"Fetching your favourite movies...",loading:"Loading...",allResults:"That's all we have!",noResults:"We couldn't find anything!",allFailed:"Failed to find media, try again!",headingTitle:"Search results",bookmarks:"Bookmarks",continueWatching:"Continue Watching",title:"What do you want to watch?",placeholder:"What do you want to watch?"},fKe={movie:"Movie",series:"Series",stopEditing:"Stop editing",errors:{genericTitle:"Whoops, it broke!",failedMeta:"Failed to load meta",mediaFailed:"We failed to request the media you asked for, check your internet connection and try again.",videoFailed:"We encountered an error while playing the video you requested. If this keeps happening please report the issue to the <0>Discord server or on <1>GitHub."}},dKe={seasonAndEpisode:"S{{season}} E{{episode}}"},hKe={genericTitle:"Not found",backArrow:"Back to home",media:{title:"Couldn't find that media",description:"We couldn't find the media you requested. Either it's been removed or you tampered with the URL"},provider:{title:"This provider has been disabled",description:"We had issues with the provider or it was too unstable to use, so we had to disable it."},page:{title:"Couldn't find that page",description:"We looked everywhere: under the bins, in the closet, behind the proxy but ultimately couldn't find the page you are looking for."}},pKe={movie:"Movie",series:"Series",Search:"Search"},mKe={findingBestVideo:"Finding the best video for you",noVideos:"Whoops, couldn't find any videos for you",loading:"Loading...",backToHome:"Back to home",backToHomeShort:"Back",seasonAndEpisode:"S{{season}} E{{episode}}",timeLeft:"{{timeLeft}} left",finishAt:"Finish at {{timeFinished, datetime}}",buttons:{episodes:"Episodes",source:"Source",captions:"Captions",download:"Download",settings:"Settings",pictureInPicture:"Picture in Picture",playbackSpeed:"Playback speed"},popouts:{back:"Go back",sources:"Sources",close:"Close",seasons:{title:"Seasons",other:"Other seasons",noSeason:"No season"},episodes:{unknown:"Unknown episode",noEpisode:"No episode"},captions:"Captions",playbackSpeed:"Playback speed",customPlaybackSpeed:"Custom playback speed",captionPreferences:{title:"Customize",delay:"Delay",fontSize:"Size",opacity:"Opacity",color:"Color"},episode:"E{{index}} - {{title}}",noCaptions:"No captions",linkedCaptions:"Linked captions",customCaption:"Custom caption",uploadCustomCaption:"Upload caption",noEmbeds:"No embeds were found for this source",errors:{loadingWentWong:"Something went wrong loading the episodes for {{seasonTitle}}",embedsError:"Something went wrong loading the embeds for this thing that you like"},descriptions:{sources:"What provider do you want to use?",embeds:"Choose which video to view",seasons:"Choose which season you want to watch",episode:"Pick an episode",captions:"Choose a subtitle language",captionPreferences:"Make subtitles look how you want it",playbackSpeed:"Change the playback speed"}},errors:{fatalError:"The video player encounted a fatal error, please report it to the <0>Discord server or on <1>GitHub."}},gKe={title:"Settings",language:"Language",captionLanguage:"Caption Language"},vKe={newSiteTitle:"New version now released!",newDomain:"https://movie-web.app",newDomainText:"movie-web will soon be moving to a new domain: <0>https://movie-web.app. Make sure to update all your bookmarks as <1>the old website will stop working on {{date}}.",tireless:"We've worked tirelessly on this new update, we hope you will enjoy what we've been cooking up for the past months.",leaveAnnouncement:"Take me there!"},yKe={casting:"Casting to device..."},xKe={offline:"Check your internet connection"},bKe={global:cKe,search:uKe,media:fKe,seasons:dKe,notFound:hKe,searchBar:pKe,videoPlayer:mKe,settings:gKe,v3:vKe,casting:yKe,errors:xKe},EKe={name:"movie-web"},SKe={loading_series:"Recherche de votre série préférée...",loading_movie:"Recherche de vos films préférés...",loading:"Chargement...",allResults:"C'est tout ce que nous avons!",noResults:"Nous n'avons rien trouvé!",allFailed:"Le média n'a pas été trouvé, veuillez réessayez!",headingTitle:"Résultats de la recherche",bookmarks:"Favoris",continueWatching:"Continuer le visionnage",title:"Que voulez-vous voir?",placeholder:"Que voulez-vous voir?"},_Ke={movie:"Films",series:"Séries",stopEditing:"Arrêter l'édition",errors:{genericTitle:"Oups, c'est coupé !",failedMeta:"Impossible de charger les métadonnées",mediaFailed:"Nous n'avons pas réussi à récupérer le média que vous avez demandé. Veuillez vérifier votre connexion Internet et réessayer.",videoFailed:"Nous avons rencontré une erreur lors de la lecture de la vidéo que vous avez demandée. Si cela se reproduit, veuillez signaler le problème au serveur <0>Discord ou sur <1>GitHub."}},wKe={seasonAndEpisode:"S{{season}} E{{episode}}"},TKe={genericTitle:"Introuvable",backArrow:"Retour à l'accueil",media:{title:"Impossible de trouver ce média",description:"Nous n'avons pas trouvé le média que vous avez demandé. Soit il a été supprimé, soit vous avez modifié l'URL."},provider:{title:"Ce fournisseur a été désactivé",description:"Nous avons eu des problèmes avec le fournisseur ou il était trop instable pour être utilisé, nous avons donc dû le désactiver."},page:{title:"Impossible de trouver cette page",description:"Nous avons cherché partout : sous les poubelles, dans le placard, derrière le proxy, mais nous n'avons finalement pas trouvé la page que vous cherchez."}},RKe={movie:"Film",series:"Série",Search:"Rechercher"},AKe={findingBestVideo:"Recherche de la meilleure vidéo pour vous",noVideos:"Désolé, nous n'avons pas pu trouver de vidéos pour vous",loading:"Chargement...",backToHome:"Retour à la page d'accueil",backToHomeShort:"Retour",seasonAndEpisode:"S{{season}} E{{episode}}",timeLeft:"{{timeLeft}} restant",finishAt:"Terminer à {{timeFinished, datetime}}",buttons:{episodes:"Épisodes",source:"Source",captions:"Sous-titres",download:"Télécharger",settings:"Paramètres",pictureInPicture:"Image dans l'image",playbackSpeed:"Vitesse"},popouts:{back:"Retourner",sources:"Sources",seasons:"Saisons",captions:"Sous-titres",playbackSpeed:"Vitesse de lecture",customPlaybackSpeed:"Vitesse de lecture personnalisée",captionPreferences:{title:"Personnaliser",delay:"Délai",fontSize:"Taille",opacity:"Opacité",color:"Couleur"},episode:"E{{index}} - {{title}}",noCaptions:"Pas de sous-titres",linkedCaptions:"Sous-titres liés",customCaption:"Sous-titres personnalisés",uploadCustomCaption:"Télécharger des sous-titres",noEmbeds:"Aucun contenu intégré n'a été trouvé pour cette source",errors:{loadingWentWong:"Un problème est survenu lors du chargement des épisodes pour {{seasonTitle}}",embedsError:"Un problème est survenu lors du chargement des contenus intégrés pour cet élément que vous aimez"},descriptions:{sources:"Quel fournisseur voulez-vous utiliser ?",embeds:"Choisissez quelle vidéo regarder",seasons:"Choisissez la saison que vous voulez regarder",episode:"Sélectionnez un épisode",captions:"Choisissez une langue de sous-titres",captionPreferences:"Personnalisez l'apparence des sous-titres",playbackSpeed:"Changer la vitesse de lecture"}},errors:{fatalError:"Le lecteur vidéo a rencontré une erreur fatale, veuillez la signaler au serveur <0>Discord ou sur <1>GitHub."}},IKe={title:"Paramètres",language:"Language",captionLanguage:"Langue des sous-titres"},$Ke={newSiteTitle:"Nouvelle version disponible!",newDomain:"https://movie-web.app",newDomainText:"movie-web déménagera bientôt vers un nouveau domaine : <0>https://movie-web.app. Veillez à mettre à jour tous vos favoris car <1>l'ancien site web cessera de fonctionner le {{date}}.",tireless:"Nous avons travaillé sans relâche sur cette nouvelle mise à jour et nous espérons que vous apprécierez ce que nous avons préparé ces derniers mois.",leaveAnnouncement:"Emmenez-moi là!"},CKe={casting:"Transmission à l'appareil..."},kKe={offline:"Vérifiez votre connexion internet"},OKe={global:EKe,search:SKe,media:_Ke,seasons:wKe,notFound:TKe,searchBar:RKe,videoPlayer:AKe,settings:IKe,v3:$Ke,casting:CKe,errors:kKe},LKe={name:"movie-web"},PKe={loading_series:"Recupero delle tue serie preferite...",loading_movie:"Recupero dei tuoi film preferiti...",loading:"Caricamento...",allResults:"Ecco tutto ciò che abbiamo!",noResults:"Non abbiamo trovato nulla!",allFailed:"Impossibile trovare i media, riprova!",headingTitle:"Risultati della ricerca",bookmarks:"Segnalibri",continueWatching:"Continua a guardare",title:"Cosa vuoi guardare?",placeholder:"Cosa vuoi guardare?"},NKe={movie:"Film",series:"Serie",stopEditing:"Interrompi modifica",errors:{genericTitle:"Ops, qualcosa si è rotto!",failedMeta:"Caricamento dei metadati non riuscito",mediaFailed:"Impossibile richiedere il media che hai richiesto, controlla la tua connessione internet e riprova.",videoFailed:"Si è verificato un errore durante la riproduzione del video che hai richiesto. Se ciò continua a accadere, segnala il problema sul <0>server Discord o su <1>GitHub."}},DKe={seasonAndEpisode:"S{{season}} E{{episode}}"},MKe={genericTitle:"Non trovato",backArrow:"Torna alla home",media:{title:"Impossibile trovare quel media",description:"Non siamo riusciti a trovare il media richiesto. È stato rimosso o hai manomesso l'URL."},provider:{title:"Questo provider è stato disabilitato",description:"Abbiamo riscontrato problemi con il provider o era troppo instabile da utilizzare, quindi abbiamo dovuto disabilitarlo."},page:{title:"Impossibile trovare quella pagina",description:"Abbiamo cercato ovunque: sotto i bidoni, nell'armadio, dietro il proxy, ma alla fine non siamo riusciti a trovare la pagina che stai cercando."}},FKe={movie:"Film",series:"Serie",Search:"Cerca"},BKe={findingBestVideo:"Ricerca del miglior video per te",noVideos:"Ops, non è stato possibile trovare alcun video per te",loading:"Caricamento...",backToHome:"Torna alla home",backToHomeShort:"Indietro",seasonAndEpisode:"S{{season}} E{{episode}}",timeLeft:"{{timeLeft}} rimanente",finishAt:"Fine alle {{timeFinished, datetime}}",buttons:{episodes:"Episodi",source:"Fonte",captions:"Sottotitoli",download:"Download",settings:"Impostazioni",pictureInPicture:"Picture in Picture",playbackSpeed:"Velocità di riproduzione"},popouts:{back:"Torna indietro",sources:"Fonti",seasons:"Stagioni",captions:"Sottotitoli",playbackSpeed:"Velocità di riproduzione",customPlaybackSpeed:"Velocità di riproduzione personalizzata",captionPreferences:{title:"Personalizza",delay:"Ritardo",fontSize:"Dimensione carattere",opacity:"Opacità",color:"Colore"},episode:"E{{index}} - {{title}}",noCaptions:"Nessun sottotitolo",linkedCaptions:"Sottotitoli collegati",customCaption:"Sottotitolo personalizzato",uploadCustomCaption:"Carica sottotitolo",noEmbeds:"Nessun embed è stato trovato per questa fonte",errors:{loadingWentWong:"Si è verificato un problema durante il caricamento degli episodi per {{seasonTitle}}",embedsError:"Si è verificato un problema durante il caricamento degli embed per questa cosa che ti piace"},descriptions:{sources:"Quale provider desideri utilizzare?",embeds:"Scegli quale video visualizzare",seasons:"Scegli quale stagione vuoi guardare",episode:"Scegli un episodio",captions:"Scegli una lingua per i sottotitoli",captionPreferences:"Personalizza l'aspetto dei sottotitoli",playbackSpeed:"Cambia la velocità di riproduzione"}},errors:{fatalError:"Il lettore video ha riscontrato un errore fatale, segnalalo sul <0>server Discord o su <1>GitHub."}},UKe={title:"Impostazioni",language:"Lingua",captionLanguage:"Lingua dei sottotitoli"},jKe={newSiteTitle:"Nuova versione ora disponibile!",newDomain:"https://movie-web.app",newDomainText:"movie-web si sposterà presto su un nuovo dominio: <0>https://movie-web.app. Assicurati di aggiornare tutti i tuoi segnalibri poiché <1>il vecchio sito smetterà di funzionare il {{date}}.",tireless:"Abbiamo lavorato instancabilmente su questo nuovo aggiornamento, speriamo che ti piaccia quello su cui abbiamo lavorato negli ultimi mesi.",leaveAnnouncement:"Portami lì!"},HKe={casting:"Trasmissione su dispositivo in corso..."},zKe={offline:"Controlla la tua connessione internet"},GKe={global:LKe,search:PKe,media:NKe,seasons:DKe,notFound:MKe,searchBar:FKe,videoPlayer:BKe,settings:UKe,v3:jKe,casting:HKe,errors:zKe},VKe={name:"movie-web"},WKe={loading_series:"We zoeken je favoriete series...",loading_movie:"We zoeken je favoriete films...",loading:"Aan het zoeken...",allResults:"Dat is het!",noResults:"We konden helaas niets vinden.",allFailed:"Het is niet gelukt de media te laden, probeer het nog eens.",headingTitle:"Zoekresultaten",bookmarks:"Opgeslagen",continueWatching:"Kijk verder",title:"Wat wil je graag kijken?",placeholder:"Wat wil je graag kijken?"},KKe={movie:"Film",series:"Serie",stopEditing:"Stop met bewerken",errors:{genericTitle:"Oeps, hier ging iets mis!",failedMeta:"Het is niet gelukt de meta-informatie op te halen/",mediaFailed:"Het is niet gelukt deze media op te halen. Controleer of je een internetverbinding hebt en probeer het nog een keer.",videoFailed:"Er ging iets mis tijdens het spelen van deze video. Als dit blijft gebeuren, deel het dan in de <0>Discord server of maak een <1>GitHub issue."}},YKe={seasonAndEpisode:"S{{season}} A{{episode}}"},qKe={genericTitle:"Pagina niet gevonden",backArrow:"Naar de home-pagina",media:{title:"We konden deze media niet vinden.",description:"We konden dit stukje media niet vinden. Het is mogelijk verwijderd, of jij hebt zelf de URL aangepast."},provider:{title:"Deze bron is niet langer beschikbaar",description:"Deze bron was helaas te instabiel, we hebben hem jammer genoeg uit moeten zetten."},page:{title:"Pagina niet gevonden",description:"We hebben echt alles geprobeerd, zelfs tijdrijzen; echter hebben we deze pagina helaas niet kunnen vinden."}},XKe={movie:"Films",series:"Series",Search:"Zoeken"},QKe={findingBestVideo:"De beste video voor jou aan het zoeken...",noVideos:"Helaas konden we dat filmpje niet vinden",loading:"Aan het laden...",backToHome:"Naar de home-pagina",backToHomeShort:"Terug",seasonAndEpisode:"S{{season}} A{{episode}}",timeLeft:"Nog {{timeLeft}}",finishAt:"Afgelopen om {{timeFinished, datetime}}",buttons:{episodes:"Afleveringen",source:"Bron",captions:"Ondertiteling",download:"Download",settings:"Instellingen",pictureInPicture:"Beeld-in-beeld",playbackSpeed:"Afspeelsnelheid"},popouts:{back:"Terug",sources:"Bronnen",seasons:"Seizoenen",captions:"Ondertiteling",playbackSpeed:"Afspeelsnelheid",customPlaybackSpeed:"Andere snelheden",captionPreferences:{title:"Instellingen",delay:"Vertraging",fontSize:"Lettergrootte",opacity:"Doorzichtbaarheid",color:"Kleur"},episode:"A{{index}} - {{title}}",noCaptions:"Geen ondertiteling",linkedCaptions:"Gelinkte ondertiteling",customCaption:"Eigen ondertiteling",uploadCustomCaption:"Ondertiteling uploaden",noEmbeds:"We hebben geen filmpjes kunnen vinden voor deze bron.",errors:{loadingWentWong:"Er ging iets mis tijdens het laden van de afleveringen voor {{seasonTitle}}",embedsError:"Er ging iets mis tijdens het laden van de embeds voor dit dingetje dat je waarschijnlijk leuk vindt"},descriptions:{sources:"Welke bron wil je graag gebruiken",embeds:"Welk filmpje wil je gebruiken?",seasons:"Welk seizoen wil je kijken?",episode:"Kies een aflevering",captions:"Kies een taal voor de ondertiteling",captionPreferences:"Pas de ondertiteling aan aan je voorkeuren",playbackSpeed:"Pas de afspeelsnelhijd aan"}},errors:{fatalError:"De videospeler is helaas ontploft, rapporteer deze fout op de <0>Discord server of op <1>GitHub."}},ZKe={title:"Instellingen",language:"Taal",captionLanguage:"Taal voor de Ondertiteling"},JKe={newSiteTitle:"De nieuwe versie is uit!",newDomain:"https://movie-web.app",newDomainText:"We gaan binnenkort verhuizen naar een nieuw domein: <0>https://movie-web.app. Pas je bladwijzers aan naar het nieuwe domein, want het oude domein gaat stoppen met werken op {{date}}.",tireless:"We hebben mega hard gewerkt aan deze nieuwe versie, dus we hopen dat je er van gaat genieten.",leaveAnnouncement:"Let's go!"},eYe={casting:"Aan het casten..."},tYe={offline:"Controleer je internetverbinding"},rYe={global:VKe,search:WKe,media:KKe,seasons:YKe,notFound:qKe,searchBar:XKe,videoPlayer:QKe,settings:ZKe,v3:JKe,casting:eYe,errors:tYe},nYe={name:"movie-web"},iYe={loading_series:"Fetchin' yer favorite series...",loading_movie:"Fetchin' yer favorite movies...","loadin'":"Loadin'...",allResults:"That be all we 'ave, me hearty!",noResults:"We couldn't find anythin' that matches yer search!",allFailed:"Failed t' find media, walk the plank and try again!",headingTitle:"Search results",bookmarks:"Treasure Maps","continueWatchin'":"Continue Watchin'",title:"Wha' be ye wantin' to watch, me matey?",placeholder:"Wha' be ye searchin' for?"},aYe={movie:"Movie",series:"Series","stopEditin'":"Stop editin'",errors:{genericTitle:"Shiver me timbers! It broke!",failedMeta:"Ye can't trust the compass, failed to load meta",mediaFailed:"We failed t' request the media ye asked fer, check yer internet connection, or Davy Jones's locker awaits ye!",videoFailed:"Blimey! We encountered an error while playin' the video ye requested. If this keeps happening please report the issue to the <0>Discord server or on <1>GitHub."}},sYe={seasonAndEpisode:"S{{season}} E{{episode}}"},oYe={genericTitle:"Ahoy! I see nothin' on the horizon.",backArrow:"Back to the port",media:{title:"Avast ye! Couldn't find that media",description:"We couldn't find the media ye requested. Either it's been scuttled or ye tampered with the URL, ye scallywag!"},provider:{title:"Walk the plank! This provider has been disabled",description:"We had issues wit' the provider or 'twas too unstable t' use, so we had t' disable it. Try another one, arrr!"},page:{title:"Avast ye! Couldn't find that page.",description:"Arrr! We searched every inch o' the vessel: from the bilge to the crow's nest, from the keel to the topmast, but avast! We couldn't find the page ye be lookin' fer, me heartie."}},lYe={movie:"Movie",series:"Series",Search:"Search"},cYe={findingBestVideo:"Finding the best video fer ye, hoist the colors!",noVideos:"Blistering barnacles, couldn't find any videos fer ye. Ye need a better map!",loading:"Loading...",backToHome:"Back to the port, mates!",backToHomeShort:"Back",seasonAndEpisode:"S{{season}} E{{episode}}",timeLeft:"{{timeLeft}} left",finishAt:"Finish at {{timeFinished}}",buttons:{episodes:"Episodes",source:"Source",captions:"Captions",download:"Download",settings:"Settings",pictureInPicture:"Spyglass view",playbackSpeed:"Set sail!"},popouts:{back:"Avast ye, go back!",sources:"Wha' provider do ye want to use?",seasons:"Choose which season you wants to watch!",captions:"Select a subtitle language, me hearty!",playbackSpeed:"Change the speed of Blackbeard's ship!",customPlaybackSpeed:"Set a custom playback speed",captionPreferences:{title:"Customize yer captions",delay:"Delay",fontSize:"Size",opacity:"Opacity",color:"Color"},episode:"E{{index}} - {{title}}",noCaptions:"No captions, hoist the Jolly Roger!",linkedCaptions:"Linked captions, drop anchor!",customCaption:"Custom caption, arrr!",uploadCustomCaption:"Upload yer own caption!",noEmbeds:"No embeds we be found fer this source",errors:{loadingWentWong:"Shiver me timbers! Somethin' went wrong loadin' the episodes fer {{seasonTitle}}",embedsError:"Blimey! Somethin' went wrong loadin' the embeds fer this thin' that ye like"},descriptions:{sources:"Wha' provider do ye wants to use?",embeds:"Choose which video to view",seasons:"Choose which season ye wants to watch",episode:"Pick an episode",captions:"Choose a subtitle language",captionPreferences:"Make subtitles look how ye wants it",playbackSpeed:"Change the playback speed"}},errors:{fatalError:"Blow me down! The video player encounted a fatal error, please report it to the <0>Discord server or on <1>GitHub."}},uYe={title:"Settings",language:"Language",captionLanguage:"Caption Language"},fYe={newSiteTitle:"New version now released!",newDomain:"https://movie-web.app",newDomainText:"movie-web will soon be movin' to a new domain: <0>https://movie-web.app. Make sure to update all yer bookmarks as <1>the ole website will stop workin' on {{date}}.",tireless:"We've worked tirelessly on this new update, we hope ye will enjoy wha' we've been cookin' up fer the past months.",leaveAnnouncement:"Take me thar!"},dYe={casting:"Casting to device..."},hYe={offline:"Avast! Check yer internet connection"},pYe={global:nYe,search:iYe,media:aYe,seasons:sYe,notFound:oYe,searchBar:lYe,videoPlayer:cYe,settings:uYe,v3:fYe,casting:dYe,errors:hYe},mYe={name:"movie-web"},gYe={loading_series:"Szukamy twoich ulubionych seriali...",loading_movie:"Szukamy twoich ulubionych filmów...",loading:"Wczytywanie...",allResults:"To wszystko co mamy!",noResults:"Nie mogliśmy niczego znaleźć!",allFailed:"Nie udało się znaleźć mediów, Spróbuj ponownie!",headingTitle:"Wyniki wyszukiwania",bookmarks:"Zakładki",continueWatching:"Kontynuuj oglądanie",title:"Co chciałbyś obejrzeć?",placeholder:"Co chciałbyś obejrzeć?"},vYe={movie:"Film",series:"Serial",stopEditing:"Zatrzymaj edycje",errors:{genericTitle:"Ups, popsuło się!",failedMeta:"Nie udało się wczytać metadanych",mediaFailed:"Nie udało nam się zarządać mediów, sprawdź połączenie sieciowe i spróbuj ponownie.",videoFailed:"Napotkaliśmy błąd podczas odtwarzania rządanego video. Jeśli problem będzie się powtarzać prosimy o zgłoszenie problemu na <0>Serwer Discord lub na <1>GitHub."}},yYe={seasonAndEpisode:"S{{season}} E{{episode}}"},xYe={genericTitle:"Nie znaleziono",backArrow:"Wróć na stronę główną",media:{title:"Nie można znaleźć multimediów",description:"Nie mogliśmy znaleźć rządanych multimediów. Albo zostały usunięte, albo grzebałeś przy adresie URL."},provider:{title:"Ten dostawca został wyłączony",description:"Mieliśmy problemy z tym dostawcą, albo był zbyt niestabilny, więc musieliśmy go wyłączyć."},page:{title:"Nie można znaleźć tej strony",description:"Szukaliśmy wszędzie: w koszu, w szafie a nawet w piwnicy, ale nie byliśmy w stanie znaleźć strony której szukasz."}},bYe={movie:"Filmy",series:"Seriale",Search:"Szukaj"},EYe={findingBestVideo:"Szukamy najlepszego video dla ciebie",noVideos:"Oj, Nie mogliśmy znaleźć żadnego video",loading:"Wczytywanie...",backToHome:"Wróć na stronę główną",backToHomeShort:"Wróć",seasonAndEpisode:"S{{season}} E{{episode}}",timeLeft:"Pozostało {{timeLeft}}",finishAt:"Zakończ na {{timeFinished, datetime}}",buttons:{episodes:"Odcinki",source:"Źródło",captions:"Napisy",download:"Pobierz",settings:"Ustawienia",pictureInPicture:"Obraz w obrazie (PIP)",playbackSpeed:"Prędkość odtwarzania"},popouts:{close:"Zamknąć",seasons:{title:"Sezony",other:"Inne sezony",noSeason:"Brak sezonu"},episodes:{unknown:"Nieznany odcinki",noEpisode:"Brak odcinki"},back:"Wróć",sources:"Źródła",captions:"Napisy",playbackSpeed:"Prędkość odtwarzania",customPlaybackSpeed:"Niestandardowa prędkość odtwarzania",captionPreferences:{title:"Personalizuj",delay:"Opóźnienie",fontSize:"Rozmiar",opacity:"Przeźroczystość",color:"Kolor"},episode:"E{{index}} - {{title}}",noCaptions:"Brak napisów",linkedCaptions:"Załączone napisy",customCaption:"Napisy niestandardowe",uploadCustomCaption:"Załącz",noEmbeds:"Nie znaleziono osadzonych mediów dla tego źródła",errors:{loadingWentWong:"Coś poszło nie tak {{seasonTitle}}",embedsError:"Coś poszło nie tak przy wczytywaniu osadzonych mediów"},descriptions:{sources:"Którego dostawcy chciałbyś używać?",embeds:"Wybierz, które video chcesz zobaczyć",seasons:"Wybierz, który sezon chcesz obejrzeć",episode:"Wybierz odcinek",captions:"Zmień język napisów",captionPreferences:"Ustaw napisy, tak jak ci to odpowiada",playbackSpeed:"Zmień prędkość odtwarzania"}},errors:{fatalError:"Odtwarzacz napotkał poważny błąd, Prosimy o złoszenie tego na <0>Serwer Discord lub na <1>GitHub."}},SYe={title:"Ustawienia",language:"Język",captionLanguage:"Język napisów"},_Ye={newSiteTitle:"Nowa wersja została wydana!",newDomain:"https://movie-web.app",newDomainText:"movie-web przeniesie się wkrótce na nowy adres: <0>https://movie-web.app. Prosimy zaaktualizować swoje zakładki ponieważ <1>stara strona przestanie działać {{date}}.",tireless:"Pracowaliśmy niestrudzenie nad tą aktualizacją, Mamy nadzieję że będziecie zadowoleni z tego nad czym pracowaliśmy przez ostatnie parę miesięcy.",leaveAnnouncement:"Zabierz mnie tam!"},wYe={casting:"Przesyłanie do urządzenia..."},TYe={offline:"Sprawdź swoje połączenie sieciowe"},RYe={global:mYe,search:gYe,media:vYe,seasons:yYe,notFound:xYe,searchBar:bYe,videoPlayer:EYe,settings:SYe,v3:_Ye,casting:wYe,errors:TYe},AYe={name:"movie-web"},IYe={loading_series:"Favori dizileriniz aranıyor...",loading_movie:"Favori filmleriniz aranıyor...",loading:"Yükleniyor...",allResults:"Bu kadarını bulabildik!",noResults:"Hiçbir şey bulamadık!",allFailed:"Medya bulunamadı, tekrar deneyin!",headingTitle:"Arama sonuçları",bookmarks:"Yerimleri",continueWatching:"İzlemeye devam edin",title:"Ne izlemek istersiniz?",placeholder:"Ne izlemek istersiniz?"},$Ye={movie:"Film",series:"Dizi",stopEditing:"Düzenlemeyi durdur",errors:{genericTitle:"Hay aksi, bozuldu!",failedMeta:"Önbilgi yüklenemedi",mediaFailed:"İstediğiniz medyaya istek atarken hata oluştu, internet bağlantınızı kontrol edin ve tekrar deneyin.",videoFailed:"İstediğiniz videoyu oynatırken bir sorunla karşılaştık. Bu durum devam ederse lütfen bunu <0>Discord sunucumuza veya <1>GitHub üzerinden bildiriniz."}},CYe={seasonAndEpisode:"S{{season}} B{{episode}}"},kYe={genericTitle:"Bulunamadı",backArrow:"Geri",media:{title:"Medya bulunamadı",description:"İstediğiniz medyayı bulamadık. URL'i yanlış girdiniz ya da medya kaldırıldı."},provider:{title:"Bu sağlayıcı devre dışı bırakıldı",description:"Sağlayıcı ile ilgili bir sorun oluştu ya da kullanılacak kadar stabil değildi bu yüzden devre dışı bırakmak zorunda kaldık."},page:{title:"Sayfa bulunamadı",description:"Her yere baktık: bazanın altına, dolabın içine hatta ara sunucuya ama maalesef aradığınız sayfayı bulamadık."}},OYe={movie:"Film",series:"Dizi",Search:"Ara"},LYe={findingBestVideo:"Sizin için en iyi videoyu buluyoruz...",noVideos:"Hay aksi, hiçbir video bulamadık",loading:"Yükleniyor...",backToHome:"Ana sayfaya dön",backToHomeShort:"Geri",seasonAndEpisode:"S{{season}} B{{episode}}",timeLeft:"{{timeLeft}} kaldı",finishAt:"{{timeFinished, datetime}}'de/da bitiyor",buttons:{episodes:"Bölümler",source:"Kaynak",captions:"Altyazılar",download:"İndir",settings:"Ayarlar",pictureInPicture:"Resim içinde Resim",playbackSpeed:"Oynatma Hızı"},popouts:{back:"Geri git",sources:"Kaynaklar",close:"Kapat",seasons:{title:"Sezonlar",other:"Diğer sezonlar",noSeason:"Sezon yok"},episodes:{unknown:"Bilinmeyen bölüm",noEpisode:"Bölüm yok"},captions:"Altyazılar",playbackSpeed:"Oynatma hızı",customPlaybackSpeed:"Özel oynatma hızı",captionPreferences:{title:"Kişiselleştirme",delay:"Gecikme",fontSize:"Boyut",opacity:"Opaklık",color:"Renk"},episode:"B{{index}} - {{title}}",noCaptions:"Altyazı yok",linkedCaptions:"Kaynak Altyazıları",customCaption:"Özel altyazı",uploadCustomCaption:"Altyazı yükle",noEmbeds:"Bu kaynak için gömülü video bulunamadı",errors:{loadingWentWong:"{{seasonTitle}} için bölümler yüklenirken bir hata oluştu",embedsError:"İstediğiniz şey için gömülü video bulunurken bir hata oluştu"},descriptions:{sources:"Hangi sağlayıcıyı kullanmak istersiniz?",embeds:"Görüntülemek istediğiniz videoyu seçiniz",seasons:"İzlemek istediğiniz sezonu seçiniz",episode:"Bir bölüm seçiniz",captions:"Altyazı dili seçiniz",captionPreferences:"Altyazıları istediğiniz gibi ayarlayın",playbackSpeed:"Oynatma hızınızı değiştirin"}},errors:{fatalError:"Video oynatıcıda bir hata oluştu, lütfen bunu <0>Discord sunucumuzda ya da <1>GitHub üzeriden bildiriniz."}},PYe={title:"Ayarlar",language:"Dil",captionLanguage:"Altyazı Dili"},NYe={newSiteTitle:"Yeni sürüm yayınlandı!",newDomain:"https://movie-web.app",newDomainText:"movie-web yakında yeni bir alan adına taşınacak: <0>https://movie-web.app. <1>{{date}} tarihinde eski site çalışmayacağı için yerimlerinizi güncellemeyi unutmayın.",tireless:"Bu yeni güncelleme için gece gündüz çalıştık, umarız aylardan beri hazırladığımız bu güncellemeyi beğenirsiniz.",leaveAnnouncement:"Götür beni!"},DYe={casting:"Cihaza aktarılıyor..."},MYe={offline:"İnternet bağlantınızı kontrol ediniz"},FYe={global:AYe,search:IYe,media:$Ye,seasons:CYe,notFound:kYe,searchBar:OYe,videoPlayer:LYe,settings:PYe,v3:NYe,casting:DYe,errors:MYe},BYe={name:"movie-web"},UYe={loading_series:"Đang tìm chương trình yêu thích của bạn...",loading_movie:"Đang tìm bộ phim yêu thích của bạn...",loading:"Đang tải...",allResults:"Đó là tất cả chúng tôi có!",noResults:"Chúng tôi không thể tìm thấy gì!",allFailed:"Không thể tìm thấy nội dung, hãy thử lại!",headingTitle:"Kết quả tìm kiếm",bookmarks:"Đánh dấu",continueWatching:"Tiếp tục xem",title:"Bạn muốn xem gì?",placeholder:"Bạn muốn xem gì?"},jYe={movie:"Phim",series:"Chương trình truyền hình",stopEditing:"Hãy dừng chỉnh sửa",errors:{genericTitle:"Rất tiếc, đã hỏng!",failedMeta:"Không thể tải meta",mediaFailed:"Chúng tôi không thể tìm thấy nội dung mà bạn yêu cầu, hãy kiểm tra kết nối internet của bạn và thử lại.",videoFailed:"Chúng tôi đã gặp lỗi khi phát nội dung mà bạn yêu cầu. Nếu điều này tiếp tục xảy ra, vui lòng báo cáo sự cố trên <0>máy chủ Discord hoặc trên <1>GitHub."}},HYe={seasonAndEpisode:"M{{season}} T{{episode}}"},zYe={genericTitle:"Không tìm thấy",backArrow:"Quay lại trang chính",media:{title:"Không thể tìm thấy nội dung",description:"Chúng tôi không thể tìm thấy nội dung mà bạn yêu cầu. Hoặc là nó đã bị xóa, hoặc bạn đã xáo trộn URL"},provider:{title:"Nhà cung cấp này đã bị vô hiệu hóa",description:"Chúng tôi đã gặp vấn đề với nhà cung cấp hoặc nó quá bất ổn để sử dụng, cho nên chúng tôi đã phải vô hiệu hóa nó."},page:{title:"Không thể tìm thấy trang",description:"Chúng tôi đã tìm kiếm khắp nơi: dưới thùng rác, trong tủ quần áo, đằng sau máy chủ proxy nhưng vẫn không thể tìm thấy trang bạn đang tìm kiếm."}},GYe={movie:"Phim",series:"Chương trình truyền hình",Search:"Tìm kiếm"},VYe={findingBestVideo:"Đang tìm nội dung tốt nhất cho bạn",noVideos:"Rất tiếc, không tìm thấy nội dung nào cho bạn",loading:"Đang tải...",backToHome:"Quay lại trang chính",backToHomeShort:"Quay lại",seasonAndEpisode:"M{{season}} T{{episode}}",timeLeft:"Còn {{timeLeft}}",finishAt:"Kết thúc vào {{timeFinished, datetime}}",buttons:{episodes:"Tập",source:"Source",captions:"Phụ đề",download:"Tải xuống",settings:"Cài đặt",pictureInPicture:"Hình trong hình",playbackSpeed:"Tốc độ phát"},popouts:{back:"Quay lại",sources:"Nguồn",seasons:"Mùa",captions:"Phụ đề",playbackSpeed:"Tốc độ phát",customPlaybackSpeed:"Tủy chỉnh tốc độ phát",captionPreferences:{title:"Tùy chỉnh",delay:"Trì hoãn",fontSize:"Kích cỡ",opacity:"Độ mờ",color:"Màu sắc"},episode:"T{{index}} - {{title}}",noCaptions:"Không phụ đề",linkedCaptions:"Phụ đề được liên kết",customCaption:"Phụ đề tùy chỉnh",uploadCustomCaption:"Tải phụ đề lên",noEmbeds:"Không tìm thấy nội dung nhúng nào cho nguồn này",errors:{loadingWentWong:"Đã xảy ra lỗi khi tải các tập phim cho {{seasonTitle}}",embedsError:"Đã xảy ra lỗi khi tải nội dung nhúng cho nội dung bạn thích này"},descriptions:{sources:"Bạn muốn sử dụng nhà cung cấp nào?",embeds:"Chọn video để xem",seasons:"Chọn mùa bạn muốn xem",episode:"Chọn một tập",captions:"Chọn ngôn ngữ của phụ đề",captionPreferences:"Làm cho phụ đề trông như thế nào bạn muốn",playbackSpeed:"Thay đổi tốc độ phát"}},errors:{fatalError:"Trình phát video đã gặp phải lỗi nghiêm trọng, vui lòng báo cáo sự cố trên <0>máy chủ Discord hoặc trên <1>GitHub."}},WYe={title:"Cài đặt",language:"Ngôn ngữ",captionLanguage:"Ngôn ngữ phụ đề"},KYe={newSiteTitle:"Phiên bản mới đã được phát hành!",newDomain:"https://movie-web.app",newDomainText:"movie-web sẽ sớm chuyển sang trang mới: <0>https://movie-web.app. Hãy đảm bảo rằng các đánh dấu đã được cập nhật vì <1>trang web cũ sẽ dừng hoạt động vào {{date}}.",tireless:"Chúng tôi đã làm việc vất vả để tạo phiên bản mới này, chúng tôi hy vọng bạn sẽ thích những gì chúng tôi đã nung nấu trong những tháng qua.",leaveAnnouncement:"Hãy đưa tôi đến đó!"},YYe={casting:"Đang truyền tới thiết bị..."},qYe={offline:"Hãy kiểm tra kết nối Internet của bạn"},XYe={global:BYe,search:UYe,media:jYe,seasons:HYe,notFound:zYe,searchBar:GYe,videoPlayer:VYe,settings:WYe,v3:KYe,casting:YYe,errors:qYe},QYe={name:"movie-web"},ZYe={loading_series:"正在获取您最喜欢的连续剧……",loading_movie:"正在获取您最喜欢的影片……",loading:"载入中……",allResults:"以上是我们能找到的所有结果!",noResults:"我们找不到任何结果!",allFailed:"查找媒体失败,请重试!",headingTitle:"搜索结果",bookmarks:"书签",continueWatching:"继续观看",title:"您想看些什么?",placeholder:"您想看些什么?"},JYe={movie:"电影",series:"连续剧",stopEditing:"退出编辑",errors:{genericTitle:"哎呀,出问题了!",failedMeta:"加载元数据失败",mediaFailed:"我们未能请求到您要求的媒体,检查互联网连接并重试。",videoFailed:"我们在播放您要求的视频时遇到了错误。如果错误持续发生,请向 <0>Discord 服务器或 <1>GitHub 提交问题报告。"}},eqe={seasonAndEpisode:"第{{season}}季 第{{episode}}集"},tqe={genericTitle:"未找到",backArrow:"返回首页",media:{title:"无法找到媒体",description:"我们无法找到您请求的媒体。它可能已被删除,或您篡改了 URL"},provider:{title:"该内容提供者已被停用",description:"我们的提供者出现问题,或是太不稳定,导致无法使用,所以我们不得不将其停用。"},page:{title:"无法找到页面",description:"我们已经到处找过了:不管是垃圾桶下、橱柜里或是代理之后。但最终并没有发现您查找的页面。"}},rqe={movie:"电影",series:"连续剧",Search:"搜索"},nqe={findingBestVideo:"正在为您探测最佳视频",noVideos:"哎呀,无法为您找到任何视频",loading:"载入中……",backToHome:"返回首页",backToHomeShort:"返回",seasonAndEpisode:"第{{season}}季 第{{episode}}集",timeLeft:"还剩余 {{timeLeft}}",finishAt:"在 {{timeFinished, datetime}} 结束",buttons:{episodes:"分集",source:"视频源",captions:"字幕",download:"下载",settings:"设置",pictureInPicture:"画中画",playbackSpeed:"播放速度"},popouts:{back:"返回",sources:"视频源",seasons:"分季",captions:"字幕",playbackSpeed:"播放速度",customPlaybackSpeed:"自定义播放速度",captionPreferences:{title:"自定义",delay:"延迟",fontSize:"尺寸",opacity:"透明度",color:"颜色"},episode:"第{{index}}集 - {{title}}",noCaptions:"没有字幕",linkedCaptions:"已链接字幕",customCaption:"自定义字幕",uploadCustomCaption:"上传字幕",noEmbeds:"未发现该视频源的嵌入内容",errors:{loadingWentWong:"加载 {{seasonTitle}} 的分集时出现了一些问题",embedsError:"为您喜欢的这一东西加载嵌入内容时出现了一些问题"},descriptions:{sources:"您想使用哪个内容提供者?",embeds:"选择要观看的视频",seasons:"选择您要观看的季",episode:"选择一个分集",captions:"选择字幕语言",captionPreferences:"让字幕看起来如您所想",playbackSpeed:"改变播放速度"}},errors:{fatalError:"视频播放器遇到致命错误,请向 <0>Discord 服务器或 <1>GitHub 报告。"}},iqe={title:"设置",language:"语言",captionLanguage:"字幕语言"},aqe={newSiteTitle:"新的版本现已发布!",newDomain:"https://movie-web.app",newDomainText:"movie-web 将很快转移到新的域名:<0>https://movie-web.app。请确保已经更新全部书签链接,<1>旧网站将于 {{date}} 停止工作。",tireless:"为了这一新版本,我们不懈努力,希望您会喜欢我们在过去几个月中所做的一切。",leaveAnnouncement:"请带我去!"},sqe={casting:"正在投射到设备……"},oqe={offline:"检查您的互联网连接"},lqe={global:QYe,search:ZYe,media:JYe,seasons:eqe,notFound:tqe,searchBar:rqe,videoPlayer:nqe,settings:iqe,v3:aqe,casting:sqe,errors:oqe},mZ={en:{translation:bKe},it:{translation:GKe},nl:{translation:rYe},tr:{translation:FYe},fr:{translation:OKe},de:{translation:lKe},zh:{translation:lqe},cs:{translation:XWe},pirate:{translation:pYe},vi:{translation:XYe},pl:{translation:RYe}};lr.use(SMe).init({fallbackLng:"en",resources:mZ,interpolation:{escapeValue:!1}});const WB=_1.filter(t=>Object.keys(mZ).includes(t.id));function cqe(t){const{captionSettings:e,language:r,setLanguage:n,setCaptionLanguage:i,setCaptionBackgroundColor:a,setCaptionFontSize:s}=sd(),{t:o,i18n:c}=ke(),l=A.useMemo(()=>_1.find(d=>d.id===e.language),[e.language]),u=A.useMemo(()=>WB.find(d=>d.id===r),[r]),f=(parseInt(e.style.backgroundColor.substring(7,9),16)/255*100).toFixed(0);return E(fZ,{show:t.show,children:Y(dZ,{className:"text-white",children:[Y("div",{className:"flex flex-col gap-4",children:[Y("div",{className:"flex flex-row justify-between",children:[E("span",{className:"text-xl font-bold",children:o("settings.title")}),E("div",{onClick:()=>t.onClose(),className:"hover:cursor-pointer",children:E(Ve,{icon:ue.X})})]}),Y("div",{className:"flex flex-col gap-10 lg:flex-row",children:[Y("div",{className:"lg:w-1/2",children:[Y("div",{className:"flex flex-col justify-between",children:[E("label",{className:"text-md font-semibold",children:o("settings.language")}),E(AB,{selectedItem:u,setSelectedItem:d=>{c.changeLanguage(d.id),n(d.id)},options:WB})]}),Y("div",{className:"flex flex-col justify-between",children:[E("label",{className:"text-md font-semibold",children:o("settings.captionLanguage")}),E(AB,{selectedItem:l,setSelectedItem:d=>{i(d.id)},options:_1})]}),Y("div",{className:"flex flex-col justify-between",children:[E(Xu,{label:o("videoPlayer.popouts.captionPreferences.fontSize"),min:14,step:1,max:60,value:e.style.fontSize,onChange:d=>s(d.target.valueAsNumber)}),E(Xu,{label:o("videoPlayer.popouts.captionPreferences.opacity"),step:1,min:0,max:255,valueDisplay:`${f}%`,value:parseInt(e.style.backgroundColor.substring(7,9),16),onChange:d=>a(d.target.valueAsNumber)}),Y("div",{className:"flex flex-row justify-between",children:[E("label",{className:"font-bold",htmlFor:"color",children:o("videoPlayer.popouts.captionPreferences.color")}),E("div",{className:"flex flex-row gap-2",children:sQ.map(d=>E(oQ,{color:d}))})]})]}),E("div",{})]}),E("div",{className:"flex w-full flex-col justify-center",children:E("div",{className:"flex aspect-video flex-col justify-end rounded bg-zinc-800",children:E("div",{className:"pointer-events-none flex w-full flex-col items-center transition-[bottom]",children:E(uZ,{scale:.5,text:l.nativeName})})})})]})]}),Y("div",{className:"float-right mt-1 text-sm",children:["v",Er().APP_VERSION]})]})})}function gZ(t){const e=iE(),[r,n]=A.useState(!1);return Y("div",{className:"fixed left-0 right-0 top-0 z-20 min-h-[150px] bg-gradient-to-b from-denim-300 via-denim-300 to-transparent sm:from-transparent",style:{top:`${e}px`},children:[Y("div",{className:"fixed left-0 right-0 flex items-center justify-between px-7 py-5",children:[E("div",{className:`${t.bg?"opacity-100":"opacity-0"} absolute inset-0 block bg-denim-100 transition-opacity duration-300`,children:E("div",{className:"pointer-events-none absolute -bottom-24 h-24 w-full bg-gradient-to-b from-denim-100 to-transparent"})}),Y("div",{className:"relative flex w-full items-center justify-center sm:w-fit",children:[E("div",{className:"mr-auto sm:mr-6",children:E(om,{to:"/",children:E(zq,{clickable:!0})})}),t.children]}),Y("div",{className:`${t.children?"hidden sm:flex":"flex"} relative flex-row gap-4`,children:[E(nn,{className:"text-2xl text-white",icon:ue.GEAR,clickable:!0,onClick:()=>{n(!0)}}),E("a",{href:Er().DISCORD_LINK,target:"_blank",rel:"noreferrer",className:"text-2xl text-white",children:E(nn,{icon:ue.DISCORD,clickable:!0})}),E("a",{href:Er().GITHUB_LINK,target:"_blank",rel:"noreferrer",className:"text-2xl text-white",children:E(nn,{icon:ue.GITHUB,clickable:!0})})]})]}),E(cqe,{show:r,onClose:()=>n(!1)})]})}function vZ(t){const e=t.direction||"right",r=!!t.url,n=!!t.to,i=Y("span",{className:"group mt-1 inline-flex cursor-pointer items-center space-x-1 pr-1 font-bold text-bink-600 hover:text-bink-700 active:scale-95",children:[e==="left"?E("span",{className:"text-xl transition-transform group-hover:-translate-x-1",children:E(Ve,{icon:ue.ARROW_LEFT})}):null,E("span",{className:"flex-1",children:t.linkText}),e==="right"?E("span",{className:"text-xl transition-transform group-hover:translate-x-1",children:E(Ve,{icon:ue.ARROW_RIGHT})}):null]});return r?E("a",{href:t.url,children:i}):n?E(om,{to:t.to,children:i}):E("span",{onClick:()=>t.onClick&&t.onClick(),children:i})}function yZ(t){const{t:e}=ke(),r=lE();return Y("div",{className:"relative flex flex-1 flex-col",children:[E(va,{children:E("title",{children:e("notFound.genericTitle")})}),t.video?E("div",{className:"absolute inset-x-0 top-0 px-8 py-6",children:E(_c,{onClick:r})}):E(gZ,{}),E("div",{className:"flex h-full flex-1 flex-col items-center justify-center p-5 text-center",children:t.children})]})}function uqe(){const{t}=ke();return Y("div",{className:"flex flex-1 flex-col items-center justify-center p-5 text-center",children:[E(nn,{icon:ue.EYE_SLASH,className:"mb-6 text-xl text-bink-600"}),E(lm,{children:t("notFound.media.title")}),E("p",{className:"mb-12 mt-5 max-w-sm",children:t("notFound.media.description")}),E(vZ,{to:"/",linkText:t("notFound.backArrow")})]})}function fqe(){const{t}=ke();return Y(yZ,{children:[E(nn,{icon:ue.EYE_SLASH,className:"mb-6 text-xl text-bink-600"}),E(lm,{children:t("notFound.page.title")}),E("p",{className:"mb-12 mt-5 max-w-sm",children:t("notFound.page.description")}),E(vZ,{to:"/",linkText:t("notFound.backArrow")})]})}function dqe(t){const{t:e}=ke();return Y("div",{className:"relative flex flex-1 items-center justify-center",children:[E(va,{children:E("title",{children:e("videoPlayer.loading")})}),E("div",{className:"absolute inset-x-0 top-0 px-8 py-6",children:E(_c,{onClick:t.onGoBack})}),Y("div",{className:"flex flex-col items-center",children:[E(cm,{className:"mb-4"}),E("p",{className:"mb-8 text-denim-700",children:e("videoPlayer.findingBestVideo")})]})]})}function hqe(t){const{eventLog:e,stream:r,pending:n}=a5e(t.meta,t.selected),{t:i}=ke();return A.useEffect(()=>{r&&t.onStream(r)},[r,t]),Y("div",{className:"relative flex flex-1 items-center justify-center",children:[E(va,{children:E("title",{children:t.meta.meta.title})}),E("div",{className:"absolute inset-x-0 top-0 px-8 py-6",children:E(_c,{onClick:t.onGoBack,media:t.meta.meta})}),Y("div",{className:"flex flex-col items-center transition-opacity duration-200",children:[n?Y(xr,{children:[E(cm,{}),E("p",{className:"mb-8 text-denim-700",children:i("videoPlayer.findingBestVideo")})]}):Y(xr,{children:[E(nn,{icon:ue.EYE_SLASH,className:"mb-8 text-bink-700"}),E("p",{className:"mb-8 text-denim-700",children:i("videoPlayer.noVideos")})]}),E("div",{className:`flex flex-col items-center transition-opacity duration-200 ${n?"opacity-100":"opacity-0"}`,children:E(aWe,{events:e})})]})]})}function pqe(t){const e=lE(),{updateProgress:r,watchedItem:n}=y6e(t.meta,t.selected.episode),i=A.useRef(n==null?void 0:n.progress);A.useEffect(()=>{i.current=n==null?void 0:n.progress},[t.stream]);const a={meta:t.meta,captions:[]};let s;return t.selected.type===ie.SERIES&&t.meta.meta.type===ie.SERIES&&(a.episode={seasonId:t.selected.season,episodeId:t.selected.episode},a.seasons=t.meta.meta.seasons,s=t.meta.meta.seasonData),Y("div",{className:"fixed left-0 top-0 h-[100dvh] w-screen",children:[E(va,{children:E("html",{"data-full":"true"})}),Y(rWe,{includeSafeArea:!0,autoPlay:!0,onGoBack:e,children:[E(g5e,{data:a,seasonData:s,linkedCaptions:t.stream.captions}),E(rUe,{source:t.stream.streamUrl,type:t.stream.type,quality:t.stream.quality,embedId:t.stream.embedId,providerId:t.stream.providerId,captions:t.stream.captions}),E(D5e,{startAt:i.current,onProgress:r}),E(M5e,{onSelect:o=>{var c;return o.seasonId&&o.episodeId&&((c=t.onChangeStream)==null?void 0:c.call(t,o.seasonId,o.episodeId))}})]})]})}function KB(){const t=DY(),e=lE(),r=xc(),[n,i]=A.useState(null),[a,s]=A.useState(null),[o,c,l]=od(async(h,p)=>{const v=oq(h);return v?v1(v.type,v.id,p):null}),[u,f]=A.useState(null),d=A.useRef(null);return A.useEffect(()=>{const h=[t.media,t.season,t.episode],p=d.current,v=(p==null?void 0:p[0])===h[0]&&((p==null?void 0:p[1])===h[1]||!(p!=null&&p[1]))&&((p==null?void 0:p[2])===h[2]||!(p!=null&&p[2]));d.current=h,!(v&&p!==null)&&(i(null),f(null),s(null),o(t.media,t.season).then(m=>{if(i(m??null),f(null),m)if(m.meta.type!==ie.SERIES)s({type:m.meta.type,season:void 0,episode:void 0});else{const g=t.season??m.meta.seasonData.id,y=t.episode??m.meta.seasonData.episodes[0].id;s({type:ie.SERIES,season:g,episode:y}),(g!==t.season||y!==t.episode)&&r.replace(`/media/${encodeURIComponent(t.media)}/${encodeURIComponent(g)}/${encodeURIComponent(y)}`)}else s(null)}))},[o,r,t]),c?E(dqe,{onGoBack:e}):l?E(nWe,{}):!n||!a?E(yZ,{video:!0,children:E(uqe,{})}):u?E(pqe,{meta:n,stream:u,selected:a,onChangeStream:(h,p)=>{r.replace(`/media/${encodeURIComponent(t.media)}/${encodeURIComponent(h)}/${encodeURIComponent(p)}`)}}):E(hqe,{meta:n,selected:a,onGoBack:e,onStream:f})}/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const mqe=4,YB=0,qB=1,gqe=2;function ud(t){let e=t.length;for(;--e>=0;)t[e]=0}const vqe=0,xZ=1,yqe=2,xqe=3,bqe=258,VO=29,bm=256,ip=bm+1+VO,Zu=30,WO=19,bZ=2*ip+1,Ol=15,$T=16,Eqe=7,KO=256,EZ=16,SZ=17,_Z=18,tI=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),ny=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),Sqe=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),wZ=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),_qe=512,Va=new Array((ip+2)*2);ud(Va);const l0=new Array(Zu*2);ud(l0);const ap=new Array(_qe);ud(ap);const sp=new Array(bqe-xqe+1);ud(sp);const YO=new Array(VO);ud(YO);const j1=new Array(Zu);ud(j1);function CT(t,e,r,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}let TZ,RZ,AZ;function kT(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}const IZ=t=>t<256?ap[t]:ap[256+(t>>>7)],op=(t,e)=>{t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255},en=(t,e,r)=>{t.bi_valid>$T-r?(t.bi_buf|=e<>$T-t.bi_valid,t.bi_valid+=r-$T):(t.bi_buf|=e<{en(t,r[e*2],r[e*2+1])},$Z=(t,e)=>{let r=0;do r|=t&1,t>>>=1,r<<=1;while(--e>0);return r>>>1},wqe=t=>{t.bi_valid===16?(op(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)},Tqe=(t,e)=>{const r=e.dyn_tree,n=e.max_code,i=e.stat_desc.static_tree,a=e.stat_desc.has_stree,s=e.stat_desc.extra_bits,o=e.stat_desc.extra_base,c=e.stat_desc.max_length;let l,u,f,d,h,p,v=0;for(d=0;d<=Ol;d++)t.bl_count[d]=0;for(r[t.heap[t.heap_max]*2+1]=0,l=t.heap_max+1;lc&&(d=c,v++),r[u*2+1]=d,!(u>n)&&(t.bl_count[d]++,h=0,u>=o&&(h=s[u-o]),p=r[u*2],t.opt_len+=p*(d+h),a&&(t.static_len+=p*(i[u*2+1]+h)));if(v!==0){do{for(d=c-1;t.bl_count[d]===0;)d--;t.bl_count[d]--,t.bl_count[d+1]+=2,t.bl_count[c]--,v-=2}while(v>0);for(d=c;d!==0;d--)for(u=t.bl_count[d];u!==0;)f=t.heap[--l],!(f>n)&&(r[f*2+1]!==d&&(t.opt_len+=(d-r[f*2+1])*r[f*2],r[f*2+1]=d),u--)}},CZ=(t,e,r)=>{const n=new Array(Ol+1);let i=0,a,s;for(a=1;a<=Ol;a++)i=i+r[a-1]<<1,n[a]=i;for(s=0;s<=e;s++){let o=t[s*2+1];o!==0&&(t[s*2]=$Z(n[o]++,o))}},Rqe=()=>{let t,e,r,n,i;const a=new Array(Ol+1);for(r=0,n=0;n>=7;n{let e;for(e=0;e{t.bi_valid>8?op(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},XB=(t,e,r,n)=>{const i=e*2,a=r*2;return t[i]{const n=t.heap[r];let i=r<<1;for(;i<=t.heap_len&&(i{let n,i,a=0,s,o;if(t.sym_next!==0)do n=t.pending_buf[t.sym_buf+a++]&255,n+=(t.pending_buf[t.sym_buf+a++]&255)<<8,i=t.pending_buf[t.sym_buf+a++],n===0?ra(t,i,e):(s=sp[i],ra(t,s+bm+1,e),o=tI[s],o!==0&&(i-=YO[s],en(t,i,o)),n--,s=IZ(n),ra(t,s,r),o=ny[s],o!==0&&(n-=j1[s],en(t,n,o)));while(a{const r=e.dyn_tree,n=e.stat_desc.static_tree,i=e.stat_desc.has_stree,a=e.stat_desc.elems;let s,o,c=-1,l;for(t.heap_len=0,t.heap_max=bZ,s=0;s>1;s>=1;s--)OT(t,r,s);l=a;do s=t.heap[1],t.heap[1]=t.heap[t.heap_len--],OT(t,r,1),o=t.heap[1],t.heap[--t.heap_max]=s,t.heap[--t.heap_max]=o,r[l*2]=r[s*2]+r[o*2],t.depth[l]=(t.depth[s]>=t.depth[o]?t.depth[s]:t.depth[o])+1,r[s*2+1]=r[o*2+1]=l,t.heap[1]=l++,OT(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],Tqe(t,e),CZ(r,c,t.bl_count)},ZB=(t,e,r)=>{let n,i=-1,a,s=e[0*2+1],o=0,c=7,l=4;for(s===0&&(c=138,l=3),e[(r+1)*2+1]=65535,n=0;n<=r;n++)a=s,s=e[(n+1)*2+1],!(++o{let n,i=-1,a,s=e[0*2+1],o=0,c=7,l=4;for(s===0&&(c=138,l=3),n=0;n<=r;n++)if(a=s,s=e[(n+1)*2+1],!(++o{let e;for(ZB(t,t.dyn_ltree,t.l_desc.max_code),ZB(t,t.dyn_dtree,t.d_desc.max_code),rI(t,t.bl_desc),e=WO-1;e>=3&&t.bl_tree[wZ[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e},Iqe=(t,e,r,n)=>{let i;for(en(t,e-257,5),en(t,r-1,5),en(t,n-4,4),i=0;i{let e=4093624447,r;for(r=0;r<=31;r++,e>>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return YB;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return qB;for(r=32;r{eU||(Rqe(),eU=!0),t.l_desc=new kT(t.dyn_ltree,TZ),t.d_desc=new kT(t.dyn_dtree,RZ),t.bl_desc=new kT(t.bl_tree,AZ),t.bi_buf=0,t.bi_valid=0,kZ(t)},LZ=(t,e,r,n)=>{en(t,(vqe<<1)+(n?1:0),3),OZ(t),op(t,r),op(t,~r),r&&t.pending_buf.set(t.window.subarray(e,e+r),t.pending),t.pending+=r},kqe=t=>{en(t,xZ<<1,3),ra(t,KO,Va),wqe(t)},Oqe=(t,e,r,n)=>{let i,a,s=0;t.level>0?(t.strm.data_type===gqe&&(t.strm.data_type=$qe(t)),rI(t,t.l_desc),rI(t,t.d_desc),s=Aqe(t),i=t.opt_len+3+7>>>3,a=t.static_len+3+7>>>3,a<=i&&(i=a)):i=a=r+5,r+4<=i&&e!==-1?LZ(t,e,r,n):t.strategy===mqe||a===i?(en(t,(xZ<<1)+(n?1:0),3),QB(t,Va,l0)):(en(t,(yqe<<1)+(n?1:0),3),Iqe(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),QB(t,t.dyn_ltree,t.dyn_dtree)),kZ(t),n&&OZ(t)},Lqe=(t,e,r)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=r,e===0?t.dyn_ltree[r*2]++:(t.matches++,e--,t.dyn_ltree[(sp[r]+bm+1)*2]++,t.dyn_dtree[IZ(e)*2]++),t.sym_next===t.sym_end);var Pqe=Cqe,Nqe=LZ,Dqe=Oqe,Mqe=Lqe,Fqe=kqe,Bqe={_tr_init:Pqe,_tr_stored_block:Nqe,_tr_flush_block:Dqe,_tr_tally:Mqe,_tr_align:Fqe};const Uqe=(t,e,r,n)=>{let i=t&65535|0,a=t>>>16&65535|0,s=0;for(;r!==0;){s=r>2e3?2e3:r,r-=s;do i=i+e[n++]|0,a=a+i|0;while(--s);i%=65521,a%=65521}return i|a<<16|0};var lp=Uqe;const jqe=()=>{let t,e=[];for(var r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=t&1?3988292384^t>>>1:t>>>1;e[r]=t}return e},Hqe=new Uint32Array(jqe()),zqe=(t,e,r,n)=>{const i=Hqe,a=n+r;t^=-1;for(let s=n;s>>8^i[(t^e[s])&255];return t^-1};var Ht=zqe,nc={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Tc={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:Gqe,_tr_stored_block:nI,_tr_flush_block:Vqe,_tr_tally:yo,_tr_align:Wqe}=Bqe,{Z_NO_FLUSH:xo,Z_PARTIAL_FLUSH:Kqe,Z_FULL_FLUSH:Yqe,Z_FINISH:Yn,Z_BLOCK:tU,Z_OK:Zt,Z_STREAM_END:rU,Z_STREAM_ERROR:da,Z_DATA_ERROR:qqe,Z_BUF_ERROR:LT,Z_DEFAULT_COMPRESSION:Xqe,Z_FILTERED:Qqe,Z_HUFFMAN_ONLY:tv,Z_RLE:Zqe,Z_FIXED:Jqe,Z_DEFAULT_STRATEGY:eXe,Z_UNKNOWN:tXe,Z_DEFLATED:$E}=Tc,rXe=9,nXe=15,iXe=8,aXe=29,sXe=256,iI=sXe+1+aXe,oXe=30,lXe=19,cXe=2*iI+1,uXe=15,Le=3,io=258,ha=io+Le+1,fXe=32,Rf=42,qO=57,aI=69,sI=73,oI=91,lI=103,Ll=113,$h=666,$r=1,fd=2,ic=3,dd=4,dXe=3,Pl=(t,e)=>(t.msg=nc[e],e),nU=t=>t*2-(t>4?9:0),Ks=t=>{let e=t.length;for(;--e>=0;)t[e]=0},hXe=t=>{let e,r,n,i=t.w_size;e=t.hash_size,n=e;do r=t.head[--n],t.head[n]=r>=i?r-i:0;while(--e);e=i,n=e;do r=t.prev[--n],t.prev[n]=r>=i?r-i:0;while(--e)};let pXe=(t,e,r)=>(e<{const e=t.state;let r=e.pending;r>t.avail_out&&(r=t.avail_out),r!==0&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+r),t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,e.pending===0&&(e.pending_out=0))},Sn=(t,e)=>{Vqe(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,pn(t.strm)},ze=(t,e)=>{t.pending_buf[t.pending++]=e},uh=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255},cI=(t,e,r,n)=>{let i=t.avail_in;return i>n&&(i=n),i===0?0:(t.avail_in-=i,e.set(t.input.subarray(t.next_in,t.next_in+i),r),t.state.wrap===1?t.adler=lp(t.adler,e,i,r):t.state.wrap===2&&(t.adler=Ht(t.adler,e,i,r)),t.next_in+=i,t.total_in+=i,i)},PZ=(t,e)=>{let r=t.max_chain_length,n=t.strstart,i,a,s=t.prev_length,o=t.nice_match;const c=t.strstart>t.w_size-ha?t.strstart-(t.w_size-ha):0,l=t.window,u=t.w_mask,f=t.prev,d=t.strstart+io;let h=l[n+s-1],p=l[n+s];t.prev_length>=t.good_match&&(r>>=2),o>t.lookahead&&(o=t.lookahead);do if(i=e,!(l[i+s]!==p||l[i+s-1]!==h||l[i]!==l[n]||l[++i]!==l[n+1])){n+=2,i++;do;while(l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&ns){if(t.match_start=e,s=a,a>=o)break;h=l[n+s-1],p=l[n+s]}}while((e=f[e&u])>c&&--r!==0);return s<=t.lookahead?s:t.lookahead},Af=t=>{const e=t.w_size;let r,n,i;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-ha)&&(t.window.set(t.window.subarray(e,e+e-n),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),hXe(t),n+=e),t.strm.avail_in===0)break;if(r=cI(t.strm,t.window,t.strstart+t.lookahead,n),t.lookahead+=r,t.lookahead+t.insert>=Le)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=bo(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=bo(t,t.ins_h,t.window[i+Le-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert{let r=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,n,i,a,s=0,o=t.strm.avail_in;do{if(n=65535,a=t.bi_valid+42>>3,t.strm.avail_outi+t.strm.avail_in&&(n=i+t.strm.avail_in),n>a&&(n=a),n>8,t.pending_buf[t.pending-2]=~n,t.pending_buf[t.pending-1]=~n>>8,pn(t.strm),i&&(i>n&&(i=n),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+i),t.strm.next_out),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i,t.block_start+=i,n-=i),n&&(cI(t.strm,t.strm.output,t.strm.next_out,n),t.strm.next_out+=n,t.strm.avail_out-=n,t.strm.total_out+=n)}while(s===0);return o-=t.strm.avail_in,o&&(o>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=o&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-o,t.strm.next_in),t.strstart),t.strstart+=o,t.insert+=o>t.w_size-t.insert?t.w_size-t.insert:o),t.block_start=t.strstart),t.high_watera&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,a+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),a>t.strm.avail_in&&(a=t.strm.avail_in),a&&(cI(t.strm,t.window,t.strstart,a),t.strstart+=a,t.insert+=a>t.w_size-t.insert?t.w_size-t.insert:a),t.high_water>3,a=t.pending_buf_size-a>65535?65535:t.pending_buf_size-a,r=a>t.w_size?t.w_size:a,i=t.strstart-t.block_start,(i>=r||(i||e===Yn)&&e!==xo&&t.strm.avail_in===0&&i<=a)&&(n=i>a?a:i,s=e===Yn&&t.strm.avail_in===0&&n===i?1:0,nI(t,t.block_start,n,s),t.block_start+=n,pn(t.strm)),s?ic:$r)},PT=(t,e)=>{let r,n;for(;;){if(t.lookahead=Le&&(t.ins_h=bo(t,t.ins_h,t.window[t.strstart+Le-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),r!==0&&t.strstart-r<=t.w_size-ha&&(t.match_length=PZ(t,r)),t.match_length>=Le)if(n=yo(t,t.strstart-t.match_start,t.match_length-Le),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=Le){t.match_length--;do t.strstart++,t.ins_h=bo(t,t.ins_h,t.window[t.strstart+Le-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(--t.match_length!==0);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=bo(t,t.ins_h,t.window[t.strstart+1]);else n=yo(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Sn(t,!1),t.strm.avail_out===0))return $r}return t.insert=t.strstart{let r,n,i;for(;;){if(t.lookahead=Le&&(t.ins_h=bo(t,t.ins_h,t.window[t.strstart+Le-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=Le-1,r!==0&&t.prev_length4096)&&(t.match_length=Le-1)),t.prev_length>=Le&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-Le,n=yo(t,t.strstart-1-t.prev_match,t.prev_length-Le),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=i&&(t.ins_h=bo(t,t.ins_h,t.window[t.strstart+Le-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(--t.prev_length!==0);if(t.match_available=0,t.match_length=Le-1,t.strstart++,n&&(Sn(t,!1),t.strm.avail_out===0))return $r}else if(t.match_available){if(n=yo(t,0,t.window[t.strstart-1]),n&&Sn(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return $r}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=yo(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart{let r,n,i,a;const s=t.window;for(;;){if(t.lookahead<=io){if(Af(t),t.lookahead<=io&&e===xo)return $r;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=Le&&t.strstart>0&&(i=t.strstart-1,n=s[i],n===s[++i]&&n===s[++i]&&n===s[++i])){a=t.strstart+io;do;while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&it.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=Le?(r=yo(t,1,t.match_length-Le),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=yo(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(Sn(t,!1),t.strm.avail_out===0))return $r}return t.insert=0,e===Yn?(Sn(t,!0),t.strm.avail_out===0?ic:dd):t.sym_next&&(Sn(t,!1),t.strm.avail_out===0)?$r:fd},gXe=(t,e)=>{let r;for(;;){if(t.lookahead===0&&(Af(t),t.lookahead===0)){if(e===xo)return $r;break}if(t.match_length=0,r=yo(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(Sn(t,!1),t.strm.avail_out===0))return $r}return t.insert=0,e===Yn?(Sn(t,!0),t.strm.avail_out===0?ic:dd):t.sym_next&&(Sn(t,!1),t.strm.avail_out===0)?$r:fd};function qi(t,e,r,n,i){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=n,this.func=i}const Ch=[new qi(0,0,0,0,NZ),new qi(4,4,8,4,PT),new qi(4,5,16,8,PT),new qi(4,6,32,32,PT),new qi(4,4,16,16,eu),new qi(8,16,32,32,eu),new qi(8,16,128,128,eu),new qi(8,32,128,256,eu),new qi(32,128,258,1024,eu),new qi(32,258,258,4096,eu)],vXe=t=>{t.window_size=2*t.w_size,Ks(t.head),t.max_lazy_match=Ch[t.level].max_lazy,t.good_match=Ch[t.level].good_length,t.nice_match=Ch[t.level].nice_length,t.max_chain_length=Ch[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=Le-1,t.match_available=0,t.ins_h=0};function yXe(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=$E,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(cXe*2),this.dyn_dtree=new Uint16Array((2*oXe+1)*2),this.bl_tree=new Uint16Array((2*lXe+1)*2),Ks(this.dyn_ltree),Ks(this.dyn_dtree),Ks(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(uXe+1),this.heap=new Uint16Array(2*iI+1),Ks(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*iI+1),Ks(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Em=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.status!==Rf&&e.status!==qO&&e.status!==aI&&e.status!==sI&&e.status!==oI&&e.status!==lI&&e.status!==Ll&&e.status!==$h?1:0},DZ=t=>{if(Em(t))return Pl(t,da);t.total_in=t.total_out=0,t.data_type=tXe;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?qO:e.wrap?Rf:Ll,t.adler=e.wrap===2?0:1,e.last_flush=-2,Gqe(e),Zt},MZ=t=>{const e=DZ(t);return e===Zt&&vXe(t.state),e},xXe=(t,e)=>Em(t)||t.state.wrap!==2?da:(t.state.gzhead=e,Zt),FZ=(t,e,r,n,i,a)=>{if(!t)return da;let s=1;if(e===Xqe&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),i<1||i>rXe||r!==$E||n<8||n>15||e<0||e>9||a<0||a>Jqe||n===8&&s!==1)return Pl(t,da);n===8&&(n=9);const o=new yXe;return t.state=o,o.strm=t,o.status=Rf,o.wrap=s,o.gzhead=null,o.w_bits=n,o.w_size=1<FZ(t,e,$E,nXe,iXe,eXe),EXe=(t,e)=>{if(Em(t)||e>tU||e<0)return t?Pl(t,da):da;const r=t.state;if(!t.output||t.avail_in!==0&&!t.input||r.status===$h&&e!==Yn)return Pl(t,t.avail_out===0?LT:da);const n=r.last_flush;if(r.last_flush=e,r.pending!==0){if(pn(t),t.avail_out===0)return r.last_flush=-1,Zt}else if(t.avail_in===0&&nU(e)<=nU(n)&&e!==Yn)return Pl(t,LT);if(r.status===$h&&t.avail_in!==0)return Pl(t,LT);if(r.status===Rf&&r.wrap===0&&(r.status=Ll),r.status===Rf){let i=$E+(r.w_bits-8<<4)<<8,a=-1;if(r.strategy>=tv||r.level<2?a=0:r.level<6?a=1:r.level===6?a=2:a=3,i|=a<<6,r.strstart!==0&&(i|=fXe),i+=31-i%31,uh(r,i),r.strstart!==0&&(uh(r,t.adler>>>16),uh(r,t.adler&65535)),t.adler=1,r.status=Ll,pn(t),r.pending!==0)return r.last_flush=-1,Zt}if(r.status===qO){if(t.adler=0,ze(r,31),ze(r,139),ze(r,8),r.gzhead)ze(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),ze(r,r.gzhead.time&255),ze(r,r.gzhead.time>>8&255),ze(r,r.gzhead.time>>16&255),ze(r,r.gzhead.time>>24&255),ze(r,r.level===9?2:r.strategy>=tv||r.level<2?4:0),ze(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(ze(r,r.gzhead.extra.length&255),ze(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=Ht(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=aI;else if(ze(r,0),ze(r,0),ze(r,0),ze(r,0),ze(r,0),ze(r,r.level===9?2:r.strategy>=tv||r.level<2?4:0),ze(r,dXe),r.status=Ll,pn(t),r.pending!==0)return r.last_flush=-1,Zt}if(r.status===aI){if(r.gzhead.extra){let i=r.pending,a=(r.gzhead.extra.length&65535)-r.gzindex;for(;r.pending+a>r.pending_buf_size;){let o=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+o),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>i&&(t.adler=Ht(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex+=o,pn(t),r.pending!==0)return r.last_flush=-1,Zt;i=0,a-=o}let s=new Uint8Array(r.gzhead.extra);r.pending_buf.set(s.subarray(r.gzindex,r.gzindex+a),r.pending),r.pending+=a,r.gzhead.hcrc&&r.pending>i&&(t.adler=Ht(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex=0}r.status=sI}if(r.status===sI){if(r.gzhead.name){let i=r.pending,a;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>i&&(t.adler=Ht(t.adler,r.pending_buf,r.pending-i,i)),pn(t),r.pending!==0)return r.last_flush=-1,Zt;i=0}r.gzindexi&&(t.adler=Ht(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex=0}r.status=oI}if(r.status===oI){if(r.gzhead.comment){let i=r.pending,a;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>i&&(t.adler=Ht(t.adler,r.pending_buf,r.pending-i,i)),pn(t),r.pending!==0)return r.last_flush=-1,Zt;i=0}r.gzindexi&&(t.adler=Ht(t.adler,r.pending_buf,r.pending-i,i))}r.status=lI}if(r.status===lI){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(pn(t),r.pending!==0))return r.last_flush=-1,Zt;ze(r,t.adler&255),ze(r,t.adler>>8&255),t.adler=0}if(r.status=Ll,pn(t),r.pending!==0)return r.last_flush=-1,Zt}if(t.avail_in!==0||r.lookahead!==0||e!==xo&&r.status!==$h){let i=r.level===0?NZ(r,e):r.strategy===tv?gXe(r,e):r.strategy===Zqe?mXe(r,e):Ch[r.level].func(r,e);if((i===ic||i===dd)&&(r.status=$h),i===$r||i===ic)return t.avail_out===0&&(r.last_flush=-1),Zt;if(i===fd&&(e===Kqe?Wqe(r):e!==tU&&(nI(r,0,0,!1),e===Yqe&&(Ks(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),pn(t),t.avail_out===0))return r.last_flush=-1,Zt}return e!==Yn?Zt:r.wrap<=0?rU:(r.wrap===2?(ze(r,t.adler&255),ze(r,t.adler>>8&255),ze(r,t.adler>>16&255),ze(r,t.adler>>24&255),ze(r,t.total_in&255),ze(r,t.total_in>>8&255),ze(r,t.total_in>>16&255),ze(r,t.total_in>>24&255)):(uh(r,t.adler>>>16),uh(r,t.adler&65535)),pn(t),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?Zt:rU)},SXe=t=>{if(Em(t))return da;const e=t.state.status;return t.state=null,e===Ll?Pl(t,qqe):Zt},_Xe=(t,e)=>{let r=e.length;if(Em(t))return da;const n=t.state,i=n.wrap;if(i===2||i===1&&n.status!==Rf||n.lookahead)return da;if(i===1&&(t.adler=lp(t.adler,e,r,0)),n.wrap=0,r>=n.w_size){i===0&&(Ks(n.head),n.strstart=0,n.block_start=0,n.insert=0);let c=new Uint8Array(n.w_size);c.set(e.subarray(r-n.w_size,r),0),e=c,r=n.w_size}const a=t.avail_in,s=t.next_in,o=t.input;for(t.avail_in=r,t.next_in=0,t.input=e,Af(n);n.lookahead>=Le;){let c=n.strstart,l=n.lookahead-(Le-1);do n.ins_h=bo(n,n.ins_h,n.window[c+Le-1]),n.prev[c&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=c,c++;while(--l);n.strstart=c,n.lookahead=Le-1,Af(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=Le-1,n.match_available=0,t.next_in=s,t.input=o,t.avail_in=a,n.wrap=i,Zt};var wXe=bXe,TXe=FZ,RXe=MZ,AXe=DZ,IXe=xXe,$Xe=EXe,CXe=SXe,kXe=_Xe,OXe="pako deflate (from Nodeca project)",c0={deflateInit:wXe,deflateInit2:TXe,deflateReset:RXe,deflateResetKeep:AXe,deflateSetHeader:IXe,deflate:$Xe,deflateEnd:CXe,deflateSetDictionary:kXe,deflateInfo:OXe};const LXe=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var PXe=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const r=e.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(const n in r)LXe(r,n)&&(t[n]=r[n])}}return t},NXe=t=>{let e=0;for(let n=0,i=t.length;n=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;cp[254]=cp[254]=1;var DXe=t=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(t);let e,r,n,i,a,s=t.length,o=0;for(i=0;i>>6,e[a++]=128|r&63):r<65536?(e[a++]=224|r>>>12,e[a++]=128|r>>>6&63,e[a++]=128|r&63):(e[a++]=240|r>>>18,e[a++]=128|r>>>12&63,e[a++]=128|r>>>6&63,e[a++]=128|r&63);return e};const MXe=(t,e)=>{if(e<65534&&t.subarray&&BZ)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let r="";for(let n=0;n{const r=e||t.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(t.subarray(0,e));let n,i;const a=new Array(r*2);for(i=0,n=0;n4){a[i++]=65533,n+=o-1;continue}for(s&=o===2?31:o===3?15:7;o>1&&n1){a[i++]=65533;continue}s<65536?a[i++]=s:(s-=65536,a[i++]=55296|s>>10&1023,a[i++]=56320|s&1023)}return MXe(a,i)},BXe=(t,e)=>{e=e||t.length,e>t.length&&(e=t.length);let r=e-1;for(;r>=0&&(t[r]&192)===128;)r--;return r<0||r===0?e:r+cp[t[r]]>e?r:e},up={string2buf:DXe,buf2string:FXe,utf8border:BXe};function UXe(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var UZ=UXe;const jZ=Object.prototype.toString,{Z_NO_FLUSH:jXe,Z_SYNC_FLUSH:HXe,Z_FULL_FLUSH:zXe,Z_FINISH:GXe,Z_OK:H1,Z_STREAM_END:VXe,Z_DEFAULT_COMPRESSION:WXe,Z_DEFAULT_STRATEGY:KXe,Z_DEFLATED:YXe}=Tc;function Sm(t){this.options=CE.assign({level:WXe,method:YXe,chunkSize:16384,windowBits:15,memLevel:8,strategy:KXe},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new UZ,this.strm.avail_out=0;let r=c0.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==H1)throw new Error(nc[r]);if(e.header&&c0.deflateSetHeader(this.strm,e.header),e.dictionary){let n;if(typeof e.dictionary=="string"?n=up.string2buf(e.dictionary):jZ.call(e.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(e.dictionary):n=e.dictionary,r=c0.deflateSetDictionary(this.strm,n),r!==H1)throw new Error(nc[r]);this._dict_set=!0}}Sm.prototype.push=function(t,e){const r=this.strm,n=this.options.chunkSize;let i,a;if(this.ended)return!1;for(e===~~e?a=e:a=e===!0?GXe:jXe,typeof t=="string"?r.input=up.string2buf(t):jZ.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){if(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(a===HXe||a===zXe)&&r.avail_out<=6){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(i=c0.deflate(r,a),i===VXe)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),i=c0.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===H1;if(r.avail_out===0){this.onData(r.output);continue}if(a>0&&r.next_out>0){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(r.avail_in===0)break}return!0};Sm.prototype.onData=function(t){this.chunks.push(t)};Sm.prototype.onEnd=function(t){t===H1&&(this.result=CE.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function XO(t,e){const r=new Sm(e);if(r.push(t,!0),r.err)throw r.msg||nc[r.err];return r.result}function qXe(t,e){return e=e||{},e.raw=!0,XO(t,e)}function XXe(t,e){return e=e||{},e.gzip=!0,XO(t,e)}var QXe=Sm,ZXe=XO,JXe=qXe,eQe=XXe,tQe=Tc,rQe={Deflate:QXe,deflate:ZXe,deflateRaw:JXe,gzip:eQe,constants:tQe};const rv=16209,nQe=16191;var iQe=function(e,r){let n,i,a,s,o,c,l,u,f,d,h,p,v,m,g,y,x,b,_,S,w,R,I,T;const C=e.state;n=e.next_in,I=e.input,i=n+(e.avail_in-5),a=e.next_out,T=e.output,s=a-(r-e.avail_out),o=a+(e.avail_out-257),c=C.dmax,l=C.wsize,u=C.whave,f=C.wnext,d=C.window,h=C.hold,p=C.bits,v=C.lencode,m=C.distcode,g=(1<>>24,h>>>=b,p-=b,b=x>>>16&255,b===0)T[a++]=x&65535;else if(b&16){_=x&65535,b&=15,b&&(p>>=b,p-=b),p<15&&(h+=I[n++]<>>24,h>>>=b,p-=b,b=x>>>16&255,b&16){if(S=x&65535,b&=15,pc){e.msg="invalid distance too far back",C.mode=rv;break e}if(h>>>=b,p-=b,b=a-s,S>b){if(b=S-b,b>u&&C.sane){e.msg="invalid distance too far back",C.mode=rv;break e}if(w=0,R=d,f===0){if(w+=l-b,b<_){_-=b;do T[a++]=d[w++];while(--b);w=a-S,R=T}}else if(f2;)T[a++]=R[w++],T[a++]=R[w++],T[a++]=R[w++],_-=3;_&&(T[a++]=R[w++],_>1&&(T[a++]=R[w++]))}else{w=a-S;do T[a++]=T[w++],T[a++]=T[w++],T[a++]=T[w++],_-=3;while(_>2);_&&(T[a++]=T[w++],_>1&&(T[a++]=T[w++]))}}else if(b&64){e.msg="invalid distance code",C.mode=rv;break e}else{x=m[(x&65535)+(h&(1<>3,n-=_,p-=_<<3,h&=(1<{const c=o.bits;let l=0,u=0,f=0,d=0,h=0,p=0,v=0,m=0,g=0,y=0,x,b,_,S,w,R=null,I;const T=new Uint16Array(tu+1),C=new Uint16Array(tu+1);let L=null,H,N,P;for(l=0;l<=tu;l++)T[l]=0;for(u=0;u=1&&T[d]===0;d--);if(h>d&&(h=d),d===0)return i[a++]=1<<24|64<<16|0,i[a++]=1<<24|64<<16|0,o.bits=1,0;for(f=1;f0&&(t===sU||d!==1))return-1;for(C[1]=0,l=1;liU||t===oU&&g>aU)return 1;for(;;){H=l-v,s[u]+1=I?(N=L[s[u]-I],P=R[s[u]-I]):(N=32+64,P=0),x=1<>v)+b]=H<<24|N<<16|P|0;while(b!==0);for(x=1<>=1;if(x!==0?(y&=x-1,y+=x):y=0,u++,--T[l]===0){if(l===d)break;l=e[r+s[u]]}if(l>h&&(y&S)!==_){for(v===0&&(v=h),w+=f,p=l-v,m=1<iU||t===oU&&g>aU)return 1;_=y&S,i[_]=h<<24|p<<16|w-a|0}}return y!==0&&(i[w+y]=l-v<<24|64<<16|0),o.bits=h,0};var u0=cQe;const uQe=0,HZ=1,zZ=2,{Z_FINISH:lU,Z_BLOCK:fQe,Z_TREES:nv,Z_OK:ac,Z_STREAM_END:dQe,Z_NEED_DICT:hQe,Z_STREAM_ERROR:ti,Z_DATA_ERROR:GZ,Z_MEM_ERROR:VZ,Z_BUF_ERROR:pQe,Z_DEFLATED:cU}=Tc,kE=16180,uU=16181,fU=16182,dU=16183,hU=16184,pU=16185,mU=16186,gU=16187,vU=16188,yU=16189,z1=16190,Pa=16191,DT=16192,xU=16193,MT=16194,bU=16195,EU=16196,SU=16197,_U=16198,iv=16199,av=16200,wU=16201,TU=16202,RU=16203,AU=16204,IU=16205,FT=16206,$U=16207,CU=16208,ot=16209,WZ=16210,KZ=16211,mQe=852,gQe=592,vQe=15,yQe=vQe,kU=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);function xQe(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Rc=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.modeKZ?1:0},YZ=t=>{if(Rc(t))return ti;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=kE,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(mQe),e.distcode=e.distdyn=new Int32Array(gQe),e.sane=1,e.back=-1,ac},qZ=t=>{if(Rc(t))return ti;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,YZ(t)},XZ=(t,e)=>{let r;if(Rc(t))return ti;const n=t.state;return e<0?(r=0,e=-e):(r=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?ti:(n.window!==null&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,qZ(t))},QZ=(t,e)=>{if(!t)return ti;const r=new xQe;t.state=r,r.strm=t,r.window=null,r.mode=kE;const n=XZ(t,e);return n!==ac&&(t.state=null),n},bQe=t=>QZ(t,yQe);let OU=!0,BT,UT;const EQe=t=>{if(OU){BT=new Int32Array(512),UT=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(u0(HZ,t.lens,0,288,BT,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;u0(zZ,t.lens,0,32,UT,0,t.work,{bits:5}),OU=!1}t.lencode=BT,t.lenbits=9,t.distcode=UT,t.distbits=5},ZZ=(t,e,r,n)=>{let i;const a=t.state;return a.window===null&&(a.wsize=1<=a.wsize?(a.window.set(e.subarray(r-a.wsize,r),0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>n&&(i=n),a.window.set(e.subarray(r-n,r-n+i),a.wnext),n-=i,n?(a.window.set(e.subarray(r-n,r),0),a.wnext=n,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave{let r,n,i,a,s,o,c,l,u,f,d,h,p,v,m=0,g,y,x,b,_,S,w,R;const I=new Uint8Array(4);let T,C;const L=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Rc(t)||!t.output||!t.input&&t.avail_in!==0)return ti;r=t.state,r.mode===Pa&&(r.mode=DT),s=t.next_out,i=t.output,c=t.avail_out,a=t.next_in,n=t.input,o=t.avail_in,l=r.hold,u=r.bits,f=o,d=c,R=ac;e:for(;;)switch(r.mode){case kE:if(r.wrap===0){r.mode=DT;break}for(;u<16;){if(o===0)break e;o--,l+=n[a++]<>>8&255,r.check=Ht(r.check,I,2,0),l=0,u=0,r.mode=uU;break}if(r.head&&(r.head.done=!1),!(r.wrap&1)||(((l&255)<<8)+(l>>8))%31){t.msg="incorrect header check",r.mode=ot;break}if((l&15)!==cU){t.msg="unknown compression method",r.mode=ot;break}if(l>>>=4,u-=4,w=(l&15)+8,r.wbits===0&&(r.wbits=w),w>15||w>r.wbits){t.msg="invalid window size",r.mode=ot;break}r.dmax=1<>8&1),r.flags&512&&r.wrap&4&&(I[0]=l&255,I[1]=l>>>8&255,r.check=Ht(r.check,I,2,0)),l=0,u=0,r.mode=fU;case fU:for(;u<32;){if(o===0)break e;o--,l+=n[a++]<>>8&255,I[2]=l>>>16&255,I[3]=l>>>24&255,r.check=Ht(r.check,I,4,0)),l=0,u=0,r.mode=dU;case dU:for(;u<16;){if(o===0)break e;o--,l+=n[a++]<>8),r.flags&512&&r.wrap&4&&(I[0]=l&255,I[1]=l>>>8&255,r.check=Ht(r.check,I,2,0)),l=0,u=0,r.mode=hU;case hU:if(r.flags&1024){for(;u<16;){if(o===0)break e;o--,l+=n[a++]<>>8&255,r.check=Ht(r.check,I,2,0)),l=0,u=0}else r.head&&(r.head.extra=null);r.mode=pU;case pU:if(r.flags&1024&&(h=r.length,h>o&&(h=o),h&&(r.head&&(w=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(a,a+h),w)),r.flags&512&&r.wrap&4&&(r.check=Ht(r.check,n,h,a)),o-=h,a+=h,r.length-=h),r.length))break e;r.length=0,r.mode=mU;case mU:if(r.flags&2048){if(o===0)break e;h=0;do w=n[a+h++],r.head&&w&&r.length<65536&&(r.head.name+=String.fromCharCode(w));while(w&&h>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=Pa;break;case yU:for(;u<32;){if(o===0)break e;o--,l+=n[a++]<>>=u&7,u-=u&7,r.mode=FT;break}for(;u<3;){if(o===0)break e;o--,l+=n[a++]<>>=1,u-=1,l&3){case 0:r.mode=xU;break;case 1:if(EQe(r),r.mode=iv,e===nv){l>>>=2,u-=2;break e}break;case 2:r.mode=EU;break;case 3:t.msg="invalid block type",r.mode=ot}l>>>=2,u-=2;break;case xU:for(l>>>=u&7,u-=u&7;u<32;){if(o===0)break e;o--,l+=n[a++]<>>16^65535)){t.msg="invalid stored block lengths",r.mode=ot;break}if(r.length=l&65535,l=0,u=0,r.mode=MT,e===nv)break e;case MT:r.mode=bU;case bU:if(h=r.length,h){if(h>o&&(h=o),h>c&&(h=c),h===0)break e;i.set(n.subarray(a,a+h),s),o-=h,a+=h,c-=h,s+=h,r.length-=h;break}r.mode=Pa;break;case EU:for(;u<14;){if(o===0)break e;o--,l+=n[a++]<>>=5,u-=5,r.ndist=(l&31)+1,l>>>=5,u-=5,r.ncode=(l&15)+4,l>>>=4,u-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=ot;break}r.have=0,r.mode=SU;case SU:for(;r.have>>=3,u-=3}for(;r.have<19;)r.lens[L[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,T={bits:r.lenbits},R=u0(uQe,r.lens,0,19,r.lencode,0,r.work,T),r.lenbits=T.bits,R){t.msg="invalid code lengths set",r.mode=ot;break}r.have=0,r.mode=_U;case _U:for(;r.have>>24,y=m>>>16&255,x=m&65535,!(g<=u);){if(o===0)break e;o--,l+=n[a++]<>>=g,u-=g,r.lens[r.have++]=x;else{if(x===16){for(C=g+2;u>>=g,u-=g,r.have===0){t.msg="invalid bit length repeat",r.mode=ot;break}w=r.lens[r.have-1],h=3+(l&3),l>>>=2,u-=2}else if(x===17){for(C=g+3;u>>=g,u-=g,w=0,h=3+(l&7),l>>>=3,u-=3}else{for(C=g+7;u>>=g,u-=g,w=0,h=11+(l&127),l>>>=7,u-=7}if(r.have+h>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=ot;break}for(;h--;)r.lens[r.have++]=w}}if(r.mode===ot)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=ot;break}if(r.lenbits=9,T={bits:r.lenbits},R=u0(HZ,r.lens,0,r.nlen,r.lencode,0,r.work,T),r.lenbits=T.bits,R){t.msg="invalid literal/lengths set",r.mode=ot;break}if(r.distbits=6,r.distcode=r.distdyn,T={bits:r.distbits},R=u0(zZ,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,T),r.distbits=T.bits,R){t.msg="invalid distances set",r.mode=ot;break}if(r.mode=iv,e===nv)break e;case iv:r.mode=av;case av:if(o>=6&&c>=258){t.next_out=s,t.avail_out=c,t.next_in=a,t.avail_in=o,r.hold=l,r.bits=u,iQe(t,d),s=t.next_out,i=t.output,c=t.avail_out,a=t.next_in,n=t.input,o=t.avail_in,l=r.hold,u=r.bits,r.mode===Pa&&(r.back=-1);break}for(r.back=0;m=r.lencode[l&(1<>>24,y=m>>>16&255,x=m&65535,!(g<=u);){if(o===0)break e;o--,l+=n[a++]<>b)],g=m>>>24,y=m>>>16&255,x=m&65535,!(b+g<=u);){if(o===0)break e;o--,l+=n[a++]<>>=b,u-=b,r.back+=b}if(l>>>=g,u-=g,r.back+=g,r.length=x,y===0){r.mode=IU;break}if(y&32){r.back=-1,r.mode=Pa;break}if(y&64){t.msg="invalid literal/length code",r.mode=ot;break}r.extra=y&15,r.mode=wU;case wU:if(r.extra){for(C=r.extra;u>>=r.extra,u-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=TU;case TU:for(;m=r.distcode[l&(1<>>24,y=m>>>16&255,x=m&65535,!(g<=u);){if(o===0)break e;o--,l+=n[a++]<>b)],g=m>>>24,y=m>>>16&255,x=m&65535,!(b+g<=u);){if(o===0)break e;o--,l+=n[a++]<>>=b,u-=b,r.back+=b}if(l>>>=g,u-=g,r.back+=g,y&64){t.msg="invalid distance code",r.mode=ot;break}r.offset=x,r.extra=y&15,r.mode=RU;case RU:if(r.extra){for(C=r.extra;u>>=r.extra,u-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=ot;break}r.mode=AU;case AU:if(c===0)break e;if(h=d-c,r.offset>h){if(h=r.offset-h,h>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=ot;break}h>r.wnext?(h-=r.wnext,p=r.wsize-h):p=r.wnext-h,h>r.length&&(h=r.length),v=r.window}else v=i,p=s-r.offset,h=r.length;h>c&&(h=c),c-=h,r.length-=h;do i[s++]=v[p++];while(--h);r.length===0&&(r.mode=av);break;case IU:if(c===0)break e;i[s++]=r.length,c--,r.mode=av;break;case FT:if(r.wrap){for(;u<32;){if(o===0)break e;o--,l|=n[a++]<{if(Rc(t))return ti;let e=t.state;return e.window&&(e.window=null),t.state=null,ac},wQe=(t,e)=>{if(Rc(t))return ti;const r=t.state;return r.wrap&2?(r.head=e,e.done=!1,ac):ti},TQe=(t,e)=>{const r=e.length;let n,i,a;return Rc(t)||(n=t.state,n.wrap!==0&&n.mode!==z1)?ti:n.mode===z1&&(i=1,i=lp(i,e,r,0),i!==n.check)?GZ:(a=ZZ(t,e,r,r),a?(n.mode=WZ,VZ):(n.havedict=1,ac))};var RQe=qZ,AQe=XZ,IQe=YZ,$Qe=bQe,CQe=QZ,kQe=SQe,OQe=_Qe,LQe=wQe,PQe=TQe,NQe="pako inflate (from Nodeca project)",Wa={inflateReset:RQe,inflateReset2:AQe,inflateResetKeep:IQe,inflateInit:$Qe,inflateInit2:CQe,inflate:kQe,inflateEnd:OQe,inflateGetHeader:LQe,inflateSetDictionary:PQe,inflateInfo:NQe};function DQe(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var MQe=DQe;const JZ=Object.prototype.toString,{Z_NO_FLUSH:FQe,Z_FINISH:BQe,Z_OK:fp,Z_STREAM_END:jT,Z_NEED_DICT:HT,Z_STREAM_ERROR:UQe,Z_DATA_ERROR:LU,Z_MEM_ERROR:jQe}=Tc;function _m(t){this.options=CE.assign({chunkSize:1024*64,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new UZ,this.strm.avail_out=0;let r=Wa.inflateInit2(this.strm,e.windowBits);if(r!==fp)throw new Error(nc[r]);if(this.header=new MQe,Wa.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=up.string2buf(e.dictionary):JZ.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=Wa.inflateSetDictionary(this.strm,e.dictionary),r!==fp)))throw new Error(nc[r])}_m.prototype.push=function(t,e){const r=this.strm,n=this.options.chunkSize,i=this.options.dictionary;let a,s,o;if(this.ended)return!1;for(e===~~e?s=e:s=e===!0?BQe:FQe,JZ.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){for(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),a=Wa.inflate(r,s),a===HT&&i&&(a=Wa.inflateSetDictionary(r,i),a===fp?a=Wa.inflate(r,s):a===LU&&(a=HT));r.avail_in>0&&a===jT&&r.state.wrap>0&&t[r.next_in]!==0;)Wa.inflateReset(r),a=Wa.inflate(r,s);switch(a){case UQe:case LU:case HT:case jQe:return this.onEnd(a),this.ended=!0,!1}if(o=r.avail_out,r.next_out&&(r.avail_out===0||a===jT))if(this.options.to==="string"){let c=up.utf8border(r.output,r.next_out),l=r.next_out-c,u=up.buf2string(r.output,c);r.next_out=l,r.avail_out=n-l,l&&r.output.set(r.output.subarray(c,c+l),0),this.onData(u)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(!(a===fp&&o===0)){if(a===jT)return a=Wa.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(r.avail_in===0)break}}return!0};_m.prototype.onData=function(t){this.chunks.push(t)};_m.prototype.onEnd=function(t){t===fp&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=CE.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function QO(t,e){const r=new _m(e);if(r.push(t),r.err)throw r.msg||nc[r.err];return r.result}function HQe(t,e){return e=e||{},e.raw=!0,QO(t,e)}var zQe=_m,GQe=QO,VQe=HQe,WQe=QO,KQe=Tc,YQe={Inflate:zQe,inflate:GQe,inflateRaw:VQe,ungzip:WQe,constants:KQe};const{Deflate:qQe,deflate:XQe,deflateRaw:QQe,gzip:ZQe}=rQe,{Inflate:JQe,inflate:eZe,inflateRaw:tZe,ungzip:rZe}=YQe;var nZe=qQe,iZe=XQe,aZe=QQe,sZe=ZQe,oZe=JQe,lZe=eZe,cZe=tZe,uZe=rZe,fZe=Tc,dZe={Deflate:nZe,deflate:iZe,deflateRaw:aZe,gzip:sZe,Inflate:oZe,inflate:lZe,inflateRaw:cZe,ungzip:uZe,constants:fZe};function hZe(t){const e=new Uint8Array(t.length);return[...t].forEach((r,n)=>{e[n]=r.charCodeAt(0)}),e}function eJ({data:t,time:e}){const r=localStorage.getItem("mw-migration-date");return r&&new Date(r)>=e?!1:(t.bookmarks&&localStorage.setItem("mw-bookmarks",JSON.stringify(t.bookmarks)),t.videoProgress&&localStorage.setItem("video-progress",JSON.stringify(t.videoProgress)),localStorage.setItem("mw-migration-date",e.toISOString()),!0)}function pZe(){let t=!1;const e=r=>{const n=r.data;n&&n.isMigrationData&&!t&&(t=!0,eJ({data:n.data,time:n.date})&&window.location.reload())};return A.useEffect(()=>(window.addEventListener("message",e),()=>{window.removeEventListener("message",e)})),E("iframe",{src:"https://movie.squeezebox.dev",hidden:!0})}function mZe(){const[t,e]=A.useState(!1);return A.useEffect(()=>{const r=new URLSearchParams(window.location.search??"");if(!r.has("m-time")||!r.has("m-data")){e(!0);return}const n=JSON.parse(dZe.inflate(hZe(atob(r.get("m-data"))),{to:"string"})),i=new Date(r.get("m-time"));eJ({data:n,time:i}),e(!0)},[]),A.useEffect(()=>{if(!t)return;const r=new URL(window.location.href),n=[];r.searchParams.forEach((i,a)=>n.push(a)),n.forEach(i=>r.searchParams.delete(i)),r.searchParams.append("migrated","1"),r.hash=Er().NORMAL_ROUTER?"":`/search/${ie.MOVIE}`,r.pathname=Er().NORMAL_ROUTER?`/search/${ie.MOVIE}`:"",window.location.href=r.toString()},[t]),null}var gZe=typeof ve=="object"&&ve&&ve.Object===Object&&ve,tJ=gZe,vZe=tJ,yZe=typeof self=="object"&&self&&self.Object===Object&&self,xZe=vZe||yZe||Function("return this")(),Ui=xZe,bZe=Ui,EZe=bZe.Symbol,ZO=EZe,PU=ZO,rJ=Object.prototype,SZe=rJ.hasOwnProperty,_Ze=rJ.toString,fh=PU?PU.toStringTag:void 0;function wZe(t){var e=SZe.call(t,fh),r=t[fh];try{t[fh]=void 0;var n=!0}catch{}var i=_Ze.call(t);return n&&(e?t[fh]=r:delete t[fh]),i}var TZe=wZe,RZe=Object.prototype,AZe=RZe.toString;function IZe(t){return AZe.call(t)}var $Ze=IZe,NU=ZO,CZe=TZe,kZe=$Ze,OZe="[object Null]",LZe="[object Undefined]",DU=NU?NU.toStringTag:void 0;function PZe(t){return t==null?t===void 0?LZe:OZe:DU&&DU in Object(t)?CZe(t):kZe(t)}var wm=PZe;function NZe(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Ts=NZe,DZe=wm,MZe=Ts,FZe="[object AsyncFunction]",BZe="[object Function]",UZe="[object GeneratorFunction]",jZe="[object Proxy]";function HZe(t){if(!MZe(t))return!1;var e=DZe(t);return e==BZe||e==UZe||e==FZe||e==jZe}var nJ=HZe,zZe=Ui,GZe=zZe["__core-js_shared__"],VZe=GZe,zT=VZe,MU=function(){var t=/[^.]+$/.exec(zT&&zT.keys&&zT.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function WZe(t){return!!MU&&MU in t}var KZe=WZe,YZe=Function.prototype,qZe=YZe.toString;function XZe(t){if(t!=null){try{return qZe.call(t)}catch{}try{return t+""}catch{}}return""}var iJ=XZe,QZe=nJ,ZZe=KZe,JZe=Ts,eJe=iJ,tJe=/[\\^$.*+?()[\]{}|]/g,rJe=/^\[object .+?Constructor\]$/,nJe=Function.prototype,iJe=Object.prototype,aJe=nJe.toString,sJe=iJe.hasOwnProperty,oJe=RegExp("^"+aJe.call(sJe).replace(tJe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function lJe(t){if(!JZe(t)||ZZe(t))return!1;var e=QZe(t)?oJe:rJe;return e.test(eJe(t))}var cJe=lJe;function uJe(t,e){return t==null?void 0:t[e]}var fJe=uJe,dJe=cJe,hJe=fJe;function pJe(t,e){var r=hJe(t,e);return dJe(r)?r:void 0}var Ac=pJe,mJe=Ac,gJe=function(){try{var t=mJe(Object,"defineProperty");return t({},"",{}),t}catch{}}(),aJ=gJe,FU=aJ;function vJe(t,e,r){e=="__proto__"&&FU?FU(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var sJ=vJe;function yJe(t,e){return t===e||t!==t&&e!==e}var JO=yJe,xJe=sJ,bJe=JO,EJe=Object.prototype,SJe=EJe.hasOwnProperty;function _Je(t,e,r){var n=t[e];(!(SJe.call(t,e)&&bJe(n,r))||r===void 0&&!(e in t))&&xJe(t,e,r)}var eL=_Je,wJe=eL,TJe=sJ;function RJe(t,e,r,n){var i=!r;r||(r={});for(var a=-1,s=e.length;++a0){if(++e>=BJe)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var zJe=HJe,GJe=FJe,VJe=zJe,WJe=VJe(GJe),KJe=WJe,YJe=oJ,qJe=OJe,XJe=KJe;function QJe(t,e){return XJe(qJe(t,e,YJe),t+"")}var ZJe=QJe,JJe=9007199254740991;function eet(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=JJe}var lJ=eet,tet=nJ,ret=lJ;function net(t){return t!=null&&ret(t.length)&&!tet(t)}var OE=net,iet=9007199254740991,aet=/^(?:0|[1-9]\d*)$/;function set(t,e){var r=typeof t;return e=e??iet,!!e&&(r=="number"||r!="symbol"&&aet.test(t))&&t>-1&&t%1==0&&t1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,s&&met(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++n-1}var vrt=grt,yrt=NE;function xrt(t,e){var r=this.__data__,n=yrt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}var brt=xrt,Ert=irt,Srt=frt,_rt=prt,wrt=vrt,Trt=brt;function pd(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e=e||w<0||f&&R>=a}function g(){var S=GT();if(m(S))return y(S);o=setTimeout(g,v(S))}function y(S){return o=void 0,d&&n?h(S):(n=i=void 0,s)}function x(){o!==void 0&&clearTimeout(o),l=0,n=c=i=o=void 0}function b(){return o===void 0?s:y(GT())}function _(){var S=GT(),w=m(S);if(n=arguments,i=this,c=S,w){if(o===void 0)return p(c);if(f)return clearTimeout(o),o=setTimeout(g,e),h(c)}return o===void 0&&(o=setTimeout(g,e)),s}return _.cancel=x,_.flush=b,_}var ylt=vlt,xlt=ylt,blt=Ts,Elt="Expected a function";function Slt(t,e,r){var n=!0,i=!0;if(typeof t!="function")throw new TypeError(Elt);return blt(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),xlt(t,e,{leading:n,maxWait:e,trailing:i})}var _lt=Slt;function wlt(){}var Tlt=wlt,Rlt=function(){function t(e,r){for(var n=0;n0&&arguments[0]!==void 0?arguments[0]:{};Alt(this,t);var r=(e.mainType||"").toLowerCase(),n=(e.subType||"").toLowerCase();this.mainType=r,this.subType=n,this.type=r+n.charAt(0).toUpperCase()+n.slice(1)||"",this.scroll=$lt,this.resize=Ilt,this.touch=Clt}return Rlt(t,[{key:"update",value:function(r){var n=this.mainType,i=this.subType,a=document.documentElement;if(Qr.enableScrollInfo&&(n==="scroll"||n==="touchmove")){var s=a.scrollTop+document.body.scrollTop;s!==this.scroll.top&&(this.scroll.delta=s-this.scroll.top,this.scroll.top=s)}if(Qr.enableResizeInfo&&n==="resize"&&(this.resize.width=window.innerWidth||a.clientWidth,this.resize.height=window.innerHeight||a.clientHeight),Qr.enableTouchInfo&&r.touches&&(n==="touchstart"||n==="touchmove"||n==="touchend")){var o=void 0,c=void 0,l=void 0;n==="touchstart"||i==="start"?(o=h7(r.touches[0]),this.touch.axisIntention="",this.touch.startX=o.x,this.touch.startY=o.y,this.touch.deltaX=0,this.touch.deltaY=0):n==="touchmove"&&(o=h7(r.touches[0]),this.touch.deltaX=o.x-this.touch.startX,this.touch.deltaY=o.y-this.touch.startY,this.touch.axisIntention===""&&(c=Math.abs(this.touch.deltaX),l=Math.abs(this.touch.deltaY),c>d7&&c>=l?this.touch.axisIntention="x":l>d7&&l>c&&(this.touch.axisIntention="y")))}}}]),t}(),$f={},klt={get exports(){return $f},set exports(t){$f=t}},gI={},sv={get exports(){return gI},set exports(t){gI=t}};(function(){var t,e,r,n,i,a;typeof performance<"u"&&performance!==null&&performance.now?sv.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(sv.exports=function(){return(t()-i)/1e6},e=process.hrtime,t=function(){var s;return s=e(),s[0]*1e9+s[1]},n=t(),a=process.uptime()*1e9,i=n-a):Date.now?(sv.exports=function(){return Date.now()-r},r=Date.now()):(sv.exports=function(){return new Date().getTime()-r},r=new Date().getTime())}).call(ve);var Olt=gI,ns=typeof window>"u"?ve:window,ov=["moz","webkit"],Ju="AnimationFrame",Cf=ns["request"+Ju],hp=ns["cancel"+Ju]||ns["cancelRequest"+Ju];for(var dh=0;!Cf&&dh1&&arguments[1]!==void 0?arguments[1]:15,r=void 0,n=void 0,i=0,a=0,s=function o(){var c=Plt(),l=e-(c-i);l<=0?(i=c,a=0,t.apply(r,n)):a=$f(o)};return function(){r=this,n=arguments,a||(a=$f(s))}}var m7=100,Dlt=50,lv=Qr.connections,ef=Qr.EE,kf=Qr.listeners,f0=Qr.removers,vI=void 0,zs=void 0,fu=void 0,Mlt=0;typeof window<"u"&&(zs=window,vI=zs.document||document,fu=vI.body);function RJ(t){return t.id||"target-id-"+Mlt++}function AJ(t,e,r,n){return ef.on(t,e||Tlt,r),n=n||t,lv[n]=(lv[n]||0)+1,{_type:t,_cb:e,_ctx:r,unsubscribe:function(){if(this._type){ef.removeListener(t,e,r),lv[n]--,lv[n]===0&&(kf[n].remove(),kf[n]=void 0),this._type=void 0,this._cb=void 0,this._ctx=void 0;for(var a=f0.length-1;a>=0;a--){var s=f0[a];if(s===this){f0.splice(a,1);break}}}}}}function Na(t,e,r){return function(i,a,s,o){var c=s.context,l=s.target,u=l&&RJ(l),f=u?":"+u:"",d=e+"Start:"+i+f,h=e+"End:"+i+f,p=e+":"+i+f,v=r+":"+i+f,m=AJ(v,a,c,p);if(f0.push(m),kf[p])return m;var g={start:new ay({mainType:e,subType:"start"}),main:new ay({mainType:e}),end:new ay({mainType:e,subType:"end"})};i==="raf"?(i=16,b=Nlt(b)):i>0&&(b=_lt(b,i));var y=void 0;function x(_){g.end.update(_),ef.emit(h,_,g.end),y=null}function b(_){y||(g.start.update(_),ef.emit(d,_,g.start)),clearTimeout(y),g.main.update(_),ef.emit(p,_,g.main),gJ?y=setTimeout(function(){x(zot(_))},i+m7):y=setTimeout(x.bind(null,_),i+m7)}return kf[p]=pJ(l||t,e,b,o),m}}function WT(t,e){return function(n,i,a,s){var o=a.context,c=a.target,l=c&&RJ(c),u=e+":0"+(l?":"+l:""),f=AJ(u,i,o);if(f0.push(f),kf[u])return f;var d=new ay({mainType:e});function h(p){d.update(p),ef.emit(u,p,d)}return kf[u]=pJ(c||t,e,h,s),f}}const Flt={scrollStart:Na(zs,"scroll","scrollStart"),scrollEnd:Na(zs,"scroll","scrollEnd"),scroll:Na(zs,"scroll","scroll"),resizeStart:Na(zs,"resize","resizeStart"),resizeEnd:Na(zs,"resize","resizeEnd"),resize:Na(zs,"resize","resize"),visibilitychange:WT(vI,"visibilitychange"),touchmoveStart:Na(fu,"touchmove","touchmoveStart"),touchmoveEnd:Na(fu,"touchmove","touchmoveEnd"),touchmove:Na(fu,"touchmove","touchmove"),touchstart:WT(fu,"touchstart"),touchend:WT(fu,"touchend")};function Blt(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=r.useRAF||!1,i=parseInt(r.throttleRate,10),a=r.eventOptions;return isNaN(i)&&(i=Dlt),n&&(i="raf"),gJ&&(i=0),Qr.enableScrollInfo=Qr.enableScrollInfo||r.enableScrollInfo||!1,Qr.enableResizeInfo=Qr.enableResizeInfo||r.enableResizeInfo||!1,Qr.enableTouchInfo=Qr.enableTouchInfo||r.enableTouchInfo||!1,Flt[t](i,e,r,a)}var Ult=typeof window<"u";function jlt(){}var KT=Ult?Blt:jlt,yI={},Hlt={get exports(){return yI},set exports(t){yI=t}};/*! + Copyright (c) 2018 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/(function(t){(function(){var e={}.hasOwnProperty;function r(){for(var n=[],i=0;i"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function W1(t){return W1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},W1(t)}var du=0,oy=1,bl=2,y7="transform",hh,x7,XT,b7=!0,ph,E7=0,QT,cv=-1,Mo=function(t){Vlt(r,t);var e=Wlt(r);function r(n,i){var a;return zlt(this,r),a=e.call(this,n,i),a.handleResize=a.handleResize.bind(sy(a)),a.handleScroll=a.handleScroll.bind(sy(a)),a.handleScrollStart=a.handleScrollStart.bind(sy(a)),a.delta=0,a.stickyTop=0,a.stickyBottom=0,a.frozen=!1,a.skipNextScrollEvent=!1,a.scrollTop=-1,a.bottomBoundaryTarget,a.topTarget,a.subscribers,a.state={top:0,bottom:0,width:0,height:0,x:0,y:0,topBoundary:0,bottomBoundary:1/0,status:du,pos:0,activated:!1},a}return Glt(r,[{key:"getTargetHeight",value:function(i){return i&&i.offsetHeight||0}},{key:"getTopPosition",value:function(i){return i=i||this.props.top||0,typeof i=="string"&&(this.topTarget||(this.topTarget=hh.querySelector(i)),i=this.getTargetHeight(this.topTarget)),i}},{key:"getTargetBottom",value:function(i){if(!i)return-1;var a=i.getBoundingClientRect();return this.scrollTop+a.bottom}},{key:"getBottomBoundary",value:function(i){var a=i||this.props.bottomBoundary;return V1(a)==="object"&&(a=a.value||a.target||0),typeof a=="string"&&(this.bottomBoundaryTarget||(this.bottomBoundaryTarget=hh.querySelector(a)),a=this.getTargetBottom(this.bottomBoundaryTarget)),a&&a>0?a:1/0}},{key:"reset",value:function(){this.setState({status:du,pos:0})}},{key:"release",value:function(i){this.setState({status:oy,pos:i-this.state.y})}},{key:"fix",value:function(i){this.setState({status:bl,pos:i})}},{key:"updateInitialDimension",value:function(i){if(i=i||{},!(!this.outerElement||!this.innerElement)){var a=this.outerElement.getBoundingClientRect(),s=this.innerElement.getBoundingClientRect(),o=a.width||a.right-a.left,c=s.height||s.bottom-s.top,l=a.top+this.scrollTop;this.setState({top:this.getTopPosition(i.top),bottom:Math.min(this.state.top+c,cv),width:o,height:c,x:a.left,y:l,bottomBoundary:this.getBottomBoundary(i.bottomBoundary),topBoundary:l})}}},{key:"handleResize",value:function(i,a){this.props.shouldFreeze()||(cv=a.resize.height,this.updateInitialDimension(),this.update())}},{key:"handleScrollStart",value:function(i,a){this.frozen=this.props.shouldFreeze(),!this.frozen&&(this.scrollTop===a.scroll.top?this.skipNextScrollEvent=!0:(this.scrollTop=a.scroll.top,this.updateInitialDimension()))}},{key:"handleScroll",value:function(i,a){if(this.skipNextScrollEvent){this.skipNextScrollEvent=!1;return}E7=a.scroll.delta,this.scrollTop=a.scroll.top,this.update()}},{key:"update",value:function(){var i=!this.props.enabled||this.state.bottomBoundary-this.state.topBoundary<=this.state.height||this.state.width===0&&this.state.height===0;if(i){this.state.status!==du&&this.reset();return}var a=E7,s=this.scrollTop+this.state.top,o=this.scrollTop+this.state.bottom;if(s<=this.state.topBoundary)this.reset();else if(o>=this.state.bottomBoundary)this.stickyBottom=this.state.bottomBoundary,this.stickyTop=this.stickyBottom-this.state.height,this.release(this.stickyTop);else if(this.state.height>cv-this.state.top)switch(this.state.status){case du:this.release(this.state.y),this.stickyTop=this.state.y,this.stickyBottom=this.stickyTop+this.state.height;case oy:this.stickyBottom=this.stickyTop+this.state.height,a>0&&o>this.stickyBottom?this.fix(this.state.bottom-this.state.height):a<0&&s0&&l===this.state.top)this.stickyTop=s-a,this.stickyBottom=this.stickyTop+u;else if(a<0&&l===this.state.bottom-u)this.stickyBottom=o-a,this.stickyTop=this.stickyBottom-u;else if(l!==this.state.bottom-u&&l!==this.state.top){var f=l+u-this.state.bottom;this.stickyBottom=o-a+f,this.stickyTop=this.stickyBottom-u}else c=!1;c&&this.release(this.stickyTop);break}else this.fix(this.state.top);this.delta=a}},{key:"componentDidUpdate",value:function(i,a){var s=this;a.status!==this.state.status&&this.props.onStateChange&&this.props.onStateChange({status:this.state.status}),this.props.top!==a.top&&(this.updateInitialDimension(),this.update());var o=!YT(this.props,i);o&&(i.enabled!==this.props.enabled?this.props.enabled?this.setState({activated:!0},function(){s.updateInitialDimension(),s.update()}):this.setState({activated:!1},function(){s.reset()}):(i.top!==this.props.top||i.bottomBoundary!==this.props.bottomBoundary)&&(this.updateInitialDimension(),this.update()))}},{key:"componentWillUnmount",value:function(){for(var i=this.subscribers||[],a=i.length-1;a>=0;a--)this.subscribers[a].unsubscribe()}},{key:"componentDidMount",value:function(){QT||(QT=window,hh=document,XT=hh.documentElement,x7=hh.body,cv=QT.innerHeight||XT.clientHeight,ph=window.Modernizr,ph&&ph.prefixed&&(b7=ph.csstransforms3d,y7=ph.prefixed("transform"))),this.scrollTop=x7.scrollTop+XT.scrollTop,this.props.enabled&&(this.setState({activated:!0}),this.updateInitialDimension(),this.update()),this.subscribers=[KT("scrollStart",this.handleScrollStart.bind(this),{useRAF:!0}),KT("scroll",this.handleScroll.bind(this),{useRAF:!0,enableScrollInfo:!0}),KT("resize",this.handleResize.bind(this),{enableResizeInfo:!0})]}},{key:"translate",value:function(i,a){var s=b7&&this.props.enableTransforms;s&&this.state.activated?i[y7]="translate3d(0,"+Math.round(a)+"px,0)":i.top=a+"px"}},{key:"shouldComponentUpdate",value:function(i,a){return!this.props.shouldFreeze()&&!(YT(this.props,i)&&YT(this.state,a))}},{key:"render",value:function(){var i,a=this,s={position:this.state.status===bl?"fixed":"relative",top:this.state.status===bl?"0px":"",zIndex:this.props.innerZ},o={};this.translate(s,this.state.pos),this.state.status!==du&&(s.width=this.state.width+"px",o.height=this.state.height+"px");var c=g7("sticky-outer-wrapper",this.props.className,(i={},qT(i,this.props.activeClass,this.state.status===bl),qT(i,this.props.releasedClass,this.state.status===oy),i)),l=g7("sticky-inner-wrapper",this.props.innerClass,qT({},this.props.innerActiveClass,this.state.status===bl)),u=this.props.children;return ce.createElement("div",{ref:function(d){a.outerElement=d},className:c,style:o},ce.createElement("div",{ref:function(d){a.innerElement=d},className:l,style:s},typeof u=="function"?u({status:this.state.status}):u))}}]),r}(A.Component);Mo.displayName="Sticky";Mo.defaultProps={shouldFreeze:function(){return!1},enabled:!0,top:0,bottomBoundary:0,enableTransforms:!0,activeClass:"active",releasedClass:"released",onStateChange:null,innerClass:"",innerActiveClass:""};Mo.propTypes={enabled:be.bool,top:be.oneOfType([be.string,be.number]),bottomBoundary:be.oneOfType([be.object,be.string,be.number]),enableTransforms:be.bool,activeClass:be.string,releasedClass:be.string,innerClass:be.string,innerActiveClass:be.string,className:be.string,onStateChange:be.func,shouldFreeze:be.func,innerZ:be.oneOfType([be.string,be.number])};Mo.STATUS_ORIGINAL=du;Mo.STATUS_RELEASED=oy;Mo.STATUS_FIXED=bl;function qlt(t){return E("div",{className:`mx-auto w-[600px] max-w-full px-2 sm:px-0 ${t.classNames||""}`,children:t.children})}function Xlt(t){return E("div",{className:`mx-auto w-[700px] max-w-full px-8 sm:px-4 ${t.classNames||""}`,children:t.children})}const Qlt=(t=!1)=>{const[e,r]=A.useState(t),[n,i]=A.useState(e);return A.useEffect(()=>{e&&i(!0)},[e]),[n,r,{style:{animation:`${e?"fadeIn":"fadeOut"} .3s`},onAnimationEnd:()=>{e||i(!1)}}]};function Zlt(){const[t,e]=A.useState(!1),[r,n]=A.useState(!1);return[o=>{e(o),o&&n(!0)},{active:t,onBackdropHide(){n(!1)}},{style:r?{zIndex:"1000",position:"relative"}:{}}]}function Jlt(t){const e=t.onClick||(()=>{}),r=t.onBackdropHide||(()=>{}),[n,i,a]=Qlt();return A.useEffect(()=>{i(!!t.active)},[t.active,i]),A.useEffect(()=>{n||r()},[n]),n?E("div",{className:`pointer-events-auto fixed left-0 right-0 top-0 h-screen w-screen bg-black bg-opacity-50 opacity-100 transition-opacity ${n?"":"opacity-0"}`,...a,onClick:s=>e(s.nativeEvent)}):null}function ect(t){const e=A.createRef(),r=A.createRef();return A.useEffect(()=>{let n=-1;function i(){if(e.current&&r.current){const a=e.current.getBoundingClientRect();r.current.style.top=`${a.top}px`,r.current.style.left=`${a.left}px`,r.current.style.width=`${a.width}px`,r.current.style.height=`${a.height}px`}n=window.requestAnimationFrame(i)}return i(),()=>{window.cancelAnimationFrame(n)}},[e,r]),Y("div",{ref:e,children:[ql.createPortal(Y("div",{className:"pointer-events-none fixed left-0 top-0 z-[999]",children:[E(Jlt,{active:t.active,...t}),E("div",{ref:r,className:"pointer-events-auto absolute",children:t.children})]}),document.body),E("div",{className:"invisible",children:t.children})]})}function IJ({onClick:t,children:e,className:r}){return E("button",{onClick:t,className:r,type:"button",children:e})}function tct({option:t,onClick:e,tabIndex:r}){return Y("div",{className:"flex h-10 cursor-pointer items-center space-x-2 px-4 py-2 text-left text-denim-700 transition-colors hover:text-white",onClick:e,tabIndex:r,children:[E(Ve,{icon:t.icon}),E("input",{type:"radio",className:"hidden",id:t.id}),E("label",{htmlFor:t.id,className:"cursor-pointer ",children:E("div",{className:"item",children:t.name})})]})}const rct=ce.forwardRef((t,e)=>{const[r,n,i]=Zlt(),[a,s]=A.useState(t.selectedItem);A.useEffect(()=>{let l;return t.open?s(t.selectedItem):l=setTimeout(()=>{s(t.selectedItem)},200),()=>{l&&clearTimeout(l)}},[t.open]);const o=t.options.find(l=>l.id===t.selectedItem)||{id:"movie",name:"movie",icon:ue.ARROW_LEFT};A.useEffect(()=>{r(t.open)},[t.open]);const c=(l,u)=>{l.stopPropagation(),t.setSelectedItem(u.id),t.setOpen(!1)};return E("div",{className:"w-full min-w-[140px] sm:w-auto",children:E("div",{ref:e,className:"relative w-full sm:w-auto",...i,children:Y(ect,{onClick:()=>t.setOpen(!1),...n,children:[Y(IJ,{...t,className:"sm:justify-left relative z-20 flex h-10 w-full items-center justify-center space-x-2 rounded-[20px] bg-bink-400 px-4 py-2 text-white hover:bg-bink-300",children:[E(Ve,{icon:o.icon}),E("span",{className:"flex-1",children:o.name}),E(Ve,{icon:ue.CHEVRON_DOWN,className:`transition-transform ${t.open?"rotate-180":""}`})]}),E("div",{className:`absolute top-0 z-10 w-full rounded-[20px] bg-denim-300 pt-[40px] transition-all duration-200 ${t.open?"block max-h-60 opacity-100":"invisible max-h-0 opacity-0"}`,children:t.options.filter(l=>l.id!==a).map(l=>E(tct,{option:l,onClick:u=>c(u,l),tabIndex:t.open?0:void 0},l.id))})]})})})});function nct({onChange:t,onUnFocus:e,value:r,label:n,className:i,placeholder:a}){const s=E("input",{type:"text",className:i,placeholder:a,onChange:o=>t&&t(o.target.value),value:r,onBlur:()=>e&&e()});return n?Y("label",{children:[E("span",{children:n}),s]}):s}function ict(t){const{t:e}=ke(),[r,n]=A.useState(!1);function i(s){t.onChange({...t.value,searchQuery:s},!1)}function a(s){t.onChange({...t.value,type:s},!0)}return Y("div",{className:"relative flex flex-col rounded-[28px] bg-denim-400 transition-colors focus-within:bg-denim-400 hover:bg-denim-500 sm:flex-row sm:items-center",children:[E("div",{className:"pointer-events-none absolute bottom-0 left-5 top-0 flex max-h-14 items-center",children:E(Ve,{icon:ue.SEARCH})}),E(nct,{onUnFocus:t.onUnFocus,onChange:s=>i(s),value:t.value.searchQuery,className:"w-full flex-1 bg-transparent px-4 py-4 pl-12 text-white placeholder-denim-700 focus:outline-none sm:py-4 sm:pr-2",placeholder:t.placeholder}),E("div",{className:"px-4 py-4 pt-0 sm:px-2 sm:py-2",children:E(rct,{icon:ue.SEARCH,open:r,setOpen:s=>n(s),selectedItem:t.value.type,setSelectedItem:s=>a(s),options:[{id:ie.MOVIE,name:e("searchBar.movie"),icon:ue.FILM},{id:ie.SERIES,name:e("searchBar.series"),icon:ue.CLAPPER_BOARD}],onClick:()=>n(s=>!s),children:t.buttonText||e("searchBar.search")})})]})}function act(t){const e=Object.values(ie).find(n=>t.type===n)||ie.MOVIE,r=decodeURIComponent(t.query||"");return{type:e,searchQuery:r}}function $J(){const t=xc(),{path:e,params:r}=W8e(),[n,i]=A.useState(act(r));return[n,(o,c)=>{const l={...n};Object.assign(l,o),i(l),c&&t.replace(d1(e,{query:l.searchQuery.length===0?void 0:o.searchQuery,type:l.type}))},()=>{t.replace(d1(e,{query:n.searchQuery.length===0?void 0:n.searchQuery,type:n.type}))}]}function sct(t,e){const[r,n]=A.useState(t);return A.useEffect(()=>{const i=setTimeout(()=>{n(t)},e);return()=>{clearTimeout(i)}},[t,e]),r}const CJ=new Set,an=new WeakMap,tf=new WeakMap,sc=new WeakMap,bI=new WeakMap,oct=new WeakMap,Of=new WeakMap,K1=new WeakMap,kh=new WeakSet;let oc;const Ja="__aa_tgt",EI="__aa_del",lct=t=>{const e=hct(t);e&&e.forEach(r=>pct(r))},cct=t=>{t.forEach(e=>{e.target===oc&&fct(),an.has(e.target)&&Ic(e.target)})};function uct(t){const e=bI.get(t);e==null||e.disconnect();let r=an.get(t),n=0;const i=5;r||(r=Lf(t),an.set(t,r));const{offsetWidth:a,offsetHeight:s}=oc,c=[r.top-i,a-(r.left+i+r.width),s-(r.top+i+r.height),r.left-i].map(u=>`${-1*Math.floor(u)}px`).join(" "),l=new IntersectionObserver(()=>{++n>1&&Ic(t)},{root:oc,threshold:1,rootMargin:c});l.observe(t),bI.set(t,l)}function Ic(t){clearTimeout(K1.get(t));const e=BE(t),r=typeof e=="function"?500:e.duration;K1.set(t,setTimeout(async()=>{const n=sc.get(t);try{await(n==null?void 0:n.finished),an.set(t,Lf(t)),uct(t)}catch{}},r))}function fct(){clearTimeout(K1.get(oc)),K1.set(oc,setTimeout(()=>{CJ.forEach(t=>PJ(t,e=>kJ(()=>Ic(e))))},100))}function dct(t){setTimeout(()=>{oct.set(t,setInterval(()=>kJ(Ic.bind(null,t)),2e3))},Math.round(2e3*Math.random()))}function kJ(t){typeof requestIdleCallback=="function"?requestIdleCallback(()=>t()):requestAnimationFrame(()=>t())}let SI,Au;typeof window<"u"&&(oc=document.documentElement,SI=new MutationObserver(lct),Au=new ResizeObserver(cct),Au.observe(oc));function hct(t){return t.reduce((n,i)=>[...n,...Array.from(i.addedNodes),...Array.from(i.removedNodes)],[]).every(n=>n.nodeName==="#comment")?!1:t.reduce((n,i)=>{if(n===!1)return!1;if(i.target instanceof Element){if(ZT(i.target),!n.has(i.target)){n.add(i.target);for(let a=0;ar(t,Of.has(t)));for(let r=0;ri(n,Of.has(n)))}}function mct(t){const e=an.get(t),r=Lf(t);if(!lL(t))return an.set(t,r);let n;if(!e)return;const i=BE(t);if(typeof i!="function"){const a=e.left-r.left,s=e.top-r.top,[o,c,l,u]=OJ(t,e,r),f={transform:`translate(${a}px, ${s}px)`},d={transform:"translate(0, 0)"};o!==c&&(f.width=`${o}px`,d.width=`${c}px`),l!==u&&(f.height=`${l}px`,d.height=`${u}px`),n=t.animate([f,d],{duration:i.duration,easing:i.easing})}else n=new Animation(i(t,"remain",e,r)),n.play();sc.set(t,n),an.set(t,r),n.addEventListener("finish",Ic.bind(null,t))}function gct(t){const e=Lf(t);an.set(t,e);const r=BE(t);if(!lL(t))return;let n;typeof r!="function"?n=t.animate([{transform:"scale(.98)",opacity:0},{transform:"scale(0.98)",opacity:0,offset:.5},{transform:"scale(1)",opacity:1}],{duration:r.duration*1.5,easing:"ease-in"}):(n=new Animation(r(t,"add",e)),n.play()),sc.set(t,n),n.addEventListener("finish",Ic.bind(null,t))}function vct(t){var e;if(!tf.has(t)||!an.has(t))return;const[r,n]=tf.get(t);Object.defineProperty(t,EI,{value:!0}),n&&n.parentNode&&n.parentNode instanceof Element?n.parentNode.insertBefore(t,n):r&&r.parentNode?r.parentNode.appendChild(t):(e=LJ(t))===null||e===void 0||e.appendChild(t);function i(){var d;t.remove(),an.delete(t),tf.delete(t),sc.delete(t),(d=bI.get(t))===null||d===void 0||d.disconnect()}if(!lL(t))return i();const[a,s,o,c]=yct(t),l=BE(t),u=an.get(t);let f;Object.assign(t.style,{position:"absolute",top:`${a}px`,left:`${s}px`,width:`${o}px`,height:`${c}px`,margin:0,pointerEvents:"none",transformOrigin:"center",zIndex:100}),typeof l!="function"?f=t.animate([{transform:"scale(1)",opacity:1},{transform:"scale(.98)",opacity:0}],{duration:l.duration,easing:"ease-out"}):(f=new Animation(l(t,"remove",u)),f.play()),sc.set(t,f),f.addEventListener("finish",i)}function yct(t){const e=an.get(t),[r,,n]=OJ(t,e,Lf(t));let i=t.parentElement;for(;i&&(getComputedStyle(i).position==="static"||i instanceof HTMLBodyElement);)i=i.parentElement;i||(i=document.body);const a=getComputedStyle(i),s=an.get(i)||Lf(i),o=Math.round(e.top-s.top)-Xi(a.borderTopWidth),c=Math.round(e.left-s.left)-Xi(a.borderLeftWidth);return[o,c,r,n]}function xct(t,e={}){return SI&&Au&&(window.matchMedia("(prefers-reduced-motion: reduce)").matches&&typeof e!="function"&&!e.disrespectUserMotionPreference||(kh.add(t),getComputedStyle(t).position==="static"&&Object.assign(t.style,{position:"relative"}),PJ(t,Ic,dct,i=>Au==null?void 0:Au.observe(i)),typeof e=="function"?Of.set(t,e):Of.set(t,{duration:250,easing:"ease-in-out",...e}),SI.observe(t,{childList:!0}),CJ.add(t))),Object.freeze({parent:t,enable:()=>{kh.add(t)},disable:()=>{kh.delete(t)},isEnabled:()=>kh.has(t)})}function cL(t){const[e,r]=A.useState();return[A.useCallback(a=>{a instanceof HTMLElement?r(xct(a,t)):r(void 0)},[]),a=>{e&&(a?e.enable():e.disable())}]}function bct(t){return Y("button",{type:"button",onClick:t.onClick,className:"inline-flex items-center justify-center rounded-lg bg-white px-8 py-3 font-bold text-black transition-[transform,background-color] duration-100 hover:bg-gray-200 active:scale-105 md:px-16",children:[t.icon?E("span",{className:"mr-3 hidden md:inline-block",children:E(Ve,{icon:t.icon})}):null,t.children]})}function NJ(t){const{t:e}=ke(),[r]=cL(),n=A.useCallback(()=>{var i;(i=t.onEdit)==null||i.call(t,!t.editing)},[t]);return E(IJ,{onClick:n,className:"flex h-12 items-center overflow-hidden rounded-full bg-denim-400 px-4 py-2 text-white transition-[background-color,transform] hover:bg-denim-500 active:scale-105",children:E("span",{ref:r,children:t.editing?E("span",{className:"mx-4 whitespace-nowrap",children:e("media.stopEditing")}):E(Ve,{icon:ue.EDIT})})})}function uL(t){return E("div",{className:t.className,children:Y("div",{className:"mb-5 flex items-center",children:[Y("p",{className:"flex flex-1 items-center font-bold uppercase text-denim-700",children:[t.icon?E("span",{className:"mr-2 text-xl",children:E(Ve,{icon:t.icon})}):null,t.title]}),t.children]})})}const fL=A.forwardRef((t,e)=>E("div",{className:"grid grid-cols-2 gap-6 sm:grid-cols-3",ref:e,children:t.children}));function Ect(t){return E("p",{className:`font-semibold text-denim-700 ${t.className||""}`,children:t.content.map((e,r)=>Y("span",{children:[r!==0?E("span",{className:"mx-[0.6em] text-[1em]",children:"●"}):null,e]},e))})}function Sct({media:t,linkable:e,series:r,percentage:n,closable:i,onClose:a}){const{t:s}=ke(),o=`${Math.round(n??0).toFixed(0)}%`,c=e&&!i,l=[s(`media.${t.type}`)];return t.year&&l.push(t.year),E("div",{className:`group -m-3 mb-2 rounded-xl bg-denim-300 bg-opacity-0 transition-colors duration-100 ${c?"hover:bg-opacity-100":""}`,children:Y("article",{className:`pointer-events-auto relative mb-2 p-3 transition-transform duration-100 ${c?"group-hover:scale-95":""}`,children:[Y("div",{className:["relative mb-4 aspect-[2/3] w-full overflow-hidden rounded-xl bg-denim-500 bg-cover bg-center transition-[border-radius] duration-100",i?"":"group-hover:rounded-lg"].join(" "),style:{backgroundImage:t.poster?`url(${t.poster})`:void 0},children:[r?E("div",{className:["absolute right-2 top-2 rounded-md bg-denim-200 px-2 py-1 transition-colors",i?"":"group-hover:bg-denim-500"].join(" "),children:E("p",{className:["text-center text-xs font-bold text-slate-400 transition-colors",i?"":"group-hover:text-white"].join(" "),children:s("seasons.seasonAndEpisode",{season:r.season||1,episode:r.episode})})}):null,n!==void 0?Y(xr,{children:[E("div",{className:`absolute inset-x-0 bottom-0 h-12 bg-gradient-to-t from-denim-300 to-transparent transition-colors ${c?"group-hover:from-denim-100":""}`}),E("div",{className:`absolute inset-x-0 bottom-0 h-12 bg-gradient-to-t from-denim-300 to-transparent transition-colors ${c?"group-hover:from-denim-100":""}`}),E("div",{className:"absolute inset-x-0 bottom-0 p-3",children:E("div",{className:"relative h-1 overflow-hidden rounded-full bg-denim-600",children:E("div",{className:"absolute inset-y-0 left-0 rounded-full bg-bink-700",style:{width:o}})})})]}):null,E("div",{className:`absolute inset-0 flex items-center justify-center bg-denim-200 bg-opacity-80 transition-opacity duration-200 ${i?"opacity-100":"pointer-events-none opacity-0"}`,children:E(nn,{clickable:!0,className:"text-2xl text-slate-400",onClick:()=>i&&(a==null?void 0:a()),icon:ue.X})})]}),E("h1",{className:"mb-1 line-clamp-3 max-h-[4.5rem] text-ellipsis break-words font-bold text-white",children:E("span",{children:t.title})}),E(Ect,{className:"text-xs",content:l})]})})}function _ct(t){const e=E(Sct,{...t}),r=t.linkable&&!t.closable;let n=r?`/media/${encodeURIComponent(FFe(t.media))}`:"#";return r&&t.series&&(t.series.season===0&&!t.series.episodeId?n+=`/${encodeURIComponent(t.series.seasonId)}`:n+=`/${encodeURIComponent(t.series.seasonId)}/${encodeURIComponent(t.series.episodeId)}`),t.linkable?E(om,{to:n,className:t.closable?"hover:cursor-default":"",children:e}):E("span",{children:e})}function wct(t){if(t)return{season:t.season,episode:t.episode,episodeId:t.episodeId,seasonId:t.seasonId}}function dL(t){var n;const{watched:e}=oE(),r=A.useMemo(()=>e.items.sort((i,a)=>a.watchedAt-i.watchedAt).find(i=>i.item.meta.id===t.media.id),[e,t.media]);return E(_ct,{media:t.media,series:wct((n=r==null?void 0:r.item)==null?void 0:n.series),linkable:!0,percentage:r==null?void 0:r.percentage,onClose:t.onClose,closable:t.closable})}function Tct(){const{t}=ke(),{getFilteredBookmarks:e,setItemBookmark:r}=Jk(),n=e(),[i,a]=A.useState(!1),[s]=cL(),{watched:o}=oE(),c=A.useMemo(()=>n.map(l=>({...l,watched:o.items.sort((u,f)=>f.watchedAt-u.watchedAt).find(u=>u.item.meta.id===l.id)})).sort((l,u)=>{var f,d;return(((f=u.watched)==null?void 0:f.watchedAt)||0)-(((d=l.watched)==null?void 0:d.watchedAt)||0)}),[o.items,n]);return n.length===0?null:Y("div",{children:[E(uL,{title:t("search.bookmarks")||"Bookmarks",icon:ue.BOOKMARK,children:E(NJ,{editing:i,onEdit:a})}),E(fL,{ref:s,children:c.map(l=>E(dL,{media:l,closable:i,onClose:()=>r(l,!1)},l.id))})]})}function Rct(){const{t}=ke(),{getFilteredBookmarks:e}=Jk(),{getFilteredWatched:r,removeProgress:n}=oE(),[i,a]=A.useState(!1),[s]=cL(),o=e(),c=r().filter(l=>!mq(o,l.item.meta));return c.length===0?null:Y("div",{children:[E(uL,{title:t("search.continueWatching")||"Continue Watching",icon:ue.CLOCK,children:E(NJ,{editing:i,onEdit:a})}),E(fL,{ref:s,children:c.map(l=>E(dL,{media:l.item.meta,closable:i,onClose:()=>n(l.item.meta.id)},l.item.meta.id))})]})}function Act(){const[t,e]=A.useState(new URLSearchParams(window.location.search).get("migrated")==="1"||localStorage.getItem("mw-show-domain-modal")==="true"),[r,n]=A.useState(!1),i=xc(),{t:a}=ke(),s=A.useCallback(()=>{localStorage.setItem("mw-show-domain-modal","false"),e(!1)},[]);A.useEffect(()=>{const d=new URLSearchParams(i.location.search);d.delete("migrated"),d.get("migrated")==="1"&&localStorage.setItem("mw-show-domain-modal","true"),i.replace({search:d.toString()})},[i]),A.useEffect(()=>{setTimeout(()=>{n(!0)},500)},[]);const o=1e3*60*60*24,c=["January","February","March","April","May","June","July","August","September","October","November","December"],l=new Date(localStorage.getItem("firstVisitToSite")||Date.now());localStorage.setItem("firstVisitToSite",l.toISOString());const u=new Date(l.getTime()+14*o),f=`${u.getDate()} ${c[u.getMonth()]} ${u.getFullYear()}`;return E(fZ,{show:t&&r,children:Y(dZ,{children:[Y("div",{className:"mb-12",children:[E("div",{className:"absolute left-0 top-0 h-[300px] w-full -translate-y-1/2 opacity-50",style:{backgroundImage:"radial-gradient(ellipse 70% 9rem, #7831C1 0%, transparent 100%)"}}),E("div",{className:"relative flex items-center justify-center",children:E("div",{className:"rounded-full bg-bink-200 px-12 py-4 text-center text-sm font-bold text-white md:text-xl",children:a("v3.newDomain")})})]}),Y("div",{className:"space-y-6",children:[E("h2",{className:"text-2xl font-bold text-white",children:a("v3.newSiteTitle")}),E("p",{className:"leading-7",children:Y(Wk,{i18nKey:"v3.newDomainText",values:{date:f},children:[E("span",{className:"text-slate-300"}),E("span",{className:"font-bold text-white"})]})}),E("p",{children:a("v3.tireless")})]}),E("div",{className:"mb-6 mt-16 flex items-center justify-center",children:E(bct,{icon:ue.PLAY,onClick:()=>s(),children:a("v3.leaveAnnouncement")})})]})})}function Ict(){return Y("div",{className:"mb-16",children:[E(pZe,{}),E(Act,{}),E(Tct,{}),E(Rct,{})]})}function DJ(){const{t}=ke(),[e]=$J();return E(cm,{className:"mb-24 mt-40 ",text:t(`search.loading_${e.type}`)||t("search.loading")||"Fetching your favourite shows..."})}function S7(t){const{t:e}=ke(),r=t.failed?ue.WARNING:ue.EYE_SLASH;return Y("div",{className:"mb-24 mt-40 flex flex-col items-center justify-center space-y-3 text-center",children:[E(nn,{icon:r,className:`text-xl ${t.failed?"text-red-400":"text-bink-600"}`}),t.failed?null:E("div",{children:(t.results??0)>0?E("p",{children:e("search.allResults")}):E("p",{children:e("search.noResults")})}),t.failed?E("div",{children:E("p",{children:e("search.allFailed")})}):null]})}function $ct({searchQuery:t}){const{t:e}=ke(),[r,n]=A.useState([]),[i,a,s]=od(o=>fq(o));return A.useEffect(()=>{async function o(c){const l=await i(c);l&&n(l)}t.searchQuery!==""&&o(t)},[t,i]),a?E(DJ,{}):s?E(S7,{failed:!0}):r?Y("div",{children:[r.length>0?Y("div",{children:[E(uL,{title:e("search.headingTitle")||"Search results",icon:ue.SEARCH}),E(fL,{children:r.map(o=>E(dL,{media:o},o.id.toString()))})]}):null,E(S7,{results:r.length})]}):null}function Cct({search:t}){const[e,r]=A.useState(!1),[n,i]=A.useState(!1),a=sct(t,500);return A.useEffect(()=>{r(t.searchQuery!==""),i(t.searchQuery!=="")},[t]),A.useEffect(()=>{i(!1)},[a]),A.useMemo(()=>n?E(DJ,{}):e?E($ct,{searchQuery:a}):E(Ict,{}),[n,e,a])}function kct(){const{t}=ke(),[e,r,n]=$J(),[i,a]=A.useState(!1),s=iE(),o=A.useCallback(({status:c})=>a(c===Mo.STATUS_FIXED),[a]);return Y(xr,{children:[Y("div",{className:"relative z-10 mb-16 sm:mb-24",children:[E(va,{children:E("title",{children:t("global.name")})}),E(gZ,{bg:i}),E(qlt,{children:Y("div",{className:"mt-44 space-y-16 text-center",children:[E("div",{className:"absolute bottom-0 left-0 right-0 flex h-0 justify-center",children:E("div",{className:"absolute bottom-4 h-[100vh] w-[3000px] rounded-[100%] bg-denim-300 md:w-[200vw]"})}),E("div",{className:"relative z-10 mb-16",children:E(lm,{className:"mx-auto max-w-xs",children:t("search.title")})}),E("div",{className:"relative z-30",children:E(Mo,{enabled:!0,top:16+s,onStateChange:o,children:E(ict,{onChange:r,value:e,onUnFocus:n,placeholder:t("search.placeholder")||"What do you want to watch?"})})})]})})]}),E(Xlt,{children:E(Cct,{search:e})})]})}function _7({children:t}){const e=rE(),{replace:r}=xc();return A.useEffect(()=>{const n=e.pathname;vA(n)&&BFe(e.pathname).then(i=>{r(i??"/")})},[e.pathname,r]),vA(e.pathname)?null:t}function Oct(){return E(f6e,{children:E(g6e,{children:E(u6e,{children:E(YFe,{children:E(ZFe,{children:Y(V8e,{children:[E(Ps,{exact:!0,path:"/v2-migration",component:mZe}),E(Ps,{exact:!0,path:"/",children:E(B8e,{to:`/search/${ie.MOVIE}`})}),E(Ps,{exact:!0,path:"/media/:media",children:E(_7,{children:E(KB,{})})}),E(Ps,{exact:!0,path:"/media/:media/:season/:episode",children:E(_7,{children:E(KB,{})})}),E(Ps,{exact:!0,path:"/search/:type/:query?",component:kct}),E(Ps,{exact:!0,path:"/dev",component:A.lazy(()=>hA(()=>import("./DeveloperView-6fc51757.js"),[]))}),E(Ps,{exact:!0,path:"/dev/video",component:A.lazy(()=>hA(()=>import("./VideoTesterView-90119065.js"),[]))}),null,E(Ps,{path:"*",component:fqe})]})})})})})})}var MJ={},FJ={},BJ={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(){for(var i=arguments.length,a=new Array(i),s=0;s"u"&&(window.dataLayer=window.dataLayer||[],window.gtag=function(){window.dataLayer.push(arguments)}),(o=window).gtag.apply(o,a)}},r=e;t.default=r})(BJ);var UJ={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var e=/^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|vs?\.?|via)$/i;function r(o){return o.toString().trim().replace(/[A-Za-z0-9\u00C0-\u00FF]+[^\s-]*/g,function(c,l,u){return l>0&&l+c.length!==u.length&&c.search(e)>-1&&u.charAt(l-2)!==":"&&(u.charAt(l+c.length)!=="-"||u.charAt(l-1)==="-")&&u.charAt(l-1).search(/[^\s-]/)<0?c.toLowerCase():c.substr(1).search(/[A-Z]|\../)>-1?c:c.charAt(0).toUpperCase()+c.substr(1)})}function n(o){return typeof o=="string"&&o.indexOf("@")!==-1}var i="REDACTED (Potential Email Address)";function a(o){return n(o)?(console.warn("This arg looks like an email address, redacting."),i):o}function s(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,u=o||"";return c&&(u=r(o)),l&&(u=a(u)),u}})(UJ);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.GA4=void 0;var e=s(BJ),r=s(UJ),n=["eventCategory","eventAction","eventLabel","eventValue","hitType"],i=["title","location"],a=["page","hitType"];function s(N){return N&&N.__esModule?N:{default:N}}function o(N,P){if(N==null)return{};var B=c(N,P),V,M;if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(N);for(M=0;M=0)&&Object.prototype.propertyIsEnumerable.call(N,V)&&(B[V]=N[V])}return B}function c(N,P){if(N==null)return{};var B={},V=Object.keys(N),M,U;for(U=0;U=0)&&(B[M]=N[M]);return B}function l(N){return l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(P){return typeof P}:function(P){return P&&typeof Symbol=="function"&&P.constructor===Symbol&&P!==Symbol.prototype?"symbol":typeof P},l(N)}function u(N){return h(N)||d(N)||y(N)||f()}function f(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function d(N){if(typeof Symbol<"u"&&N[Symbol.iterator]!=null||N["@@iterator"]!=null)return Array.from(N)}function h(N){if(Array.isArray(N))return x(N)}function p(N,P){var B=Object.keys(N);if(Object.getOwnPropertySymbols){var V=Object.getOwnPropertySymbols(N);P&&(V=V.filter(function(M){return Object.getOwnPropertyDescriptor(N,M).enumerable})),B.push.apply(B,V)}return B}function v(N){for(var P=1;PN.length)&&(P=N.length);for(var B=0,V=new Array(P);B2&&arguments[2]!==void 0?arguments[2]:"https://www.googletagmanager.com/gtag/js";if(!(typeof window>"u"||typeof document>"u")&&!P._hasLoadedGA){var U=document.createElement("script");U.async=!0,U.src="".concat(M,"?id=").concat(B),V&&U.setAttribute("nonce",V),document.body.appendChild(U),window.dataLayer=window.dataLayer||[],window.gtag=function(){window.dataLayer.push(arguments)},P._hasLoadedGA=!0}}),I(this,"_toGtagOptions",function(B){if(B){var V={cookieUpdate:"cookie_update",cookieExpires:"cookie_expires",cookieDomain:"cookie_domain",cookieFlags:"cookie_flags",userId:"user_id",clientId:"client_id",anonymizeIp:"anonymize_ip",contentGroup1:"content_group1",contentGroup2:"content_group2",contentGroup3:"content_group3",contentGroup4:"content_group4",contentGroup5:"content_group5",allowAdFeatures:"allow_google_signals",allowAdPersonalizationSignals:"allow_ad_personalization_signals",nonInteraction:"non_interaction",page:"page_path",hitCallback:"event_callback"},M=Object.entries(B).reduce(function(U,W){var k=m(W,2),O=k[0],F=k[1];return V[O]?U[V[O]]=F:U[O]=F,U},{});return M}}),I(this,"initialize",function(B){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!B)throw new Error("Require GA_MEASUREMENT_ID");var M=typeof B=="string"?[{trackingId:B}]:B;P._currentMeasurementId=M[0].trackingId;var U=V.gaOptions,W=V.gtagOptions,k=V.nonce,O=V.testMode,F=O===void 0?!1:O,D=V.gtagUrl;if(P._testMode=F,F||P._loadGA(P._currentMeasurementId,k,D),P.isInitialized||(P._gtag("js",new Date),M.forEach(function(de){var oe=v(v(v({},P._toGtagOptions(v(v({},U),de.gaOptions))),W),de.gtagOptions);Object.keys(oe).length?P._gtag("config",de.trackingId,oe):P._gtag("config",de.trackingId)})),P.isInitialized=!0,!F){var Q=u(P._queueGtag);for(P._queueGtag=[],P._isQueuing=!1;Q.length;){var ee=Q.shift();P._gtag.apply(P,u(ee)),ee[0]==="get"&&(P._isQueuing=!0)}}}),I(this,"set",function(B){if(!B){console.warn("`fieldsObject` is required in .set()");return}if(l(B)!=="object"){console.warn("Expected `fieldsObject` arg to be an Object");return}Object.keys(B).length===0&&console.warn("empty `fieldsObject` given to .set()"),P._gaCommand("set",B)}),I(this,"_gaCommandSendEvent",function(B,V,M,U,W){P._gtag("event",V,v(v({event_category:B,event_label:M,value:U},W&&{non_interaction:W.nonInteraction}),P._toGtagOptions(W)))}),I(this,"_gaCommandSendEventParameters",function(){for(var B=arguments.length,V=new Array(B),M=0;M1?V-1:0),U=1;U1&&s+i.length*c+l.length>=f));)i.push(l),s+=l.length,r=r.parentNode;return i.reverse().join(o)}catch{return""}}function Bct(t,e){const r=t,n=[];let i,a,s,o,c;if(!r||!r.tagName)return"";n.push(r.tagName.toLowerCase());const l=e&&e.length?e.filter(f=>r.getAttribute(f)).map(f=>[f,r.getAttribute(f)]):null;if(l&&l.length)l.forEach(f=>{n.push(`[${f[0]}="${f[1]}"]`)});else if(r.id&&n.push(`#${r.id}`),i=r.className,i&&Fo(i))for(a=i.split(/\s+/),c=0;c1&&(c=u.slice(0,-1).join("/"),l=u.pop()),l){const f=l.match(/^\d+/);f&&(l=f[0])}return WJ({host:a,pass:i,path:c,projectId:l,port:s,protocol:r,publicKey:n})}function WJ(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function Vct(t){if(!(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__))return;const{port:e,projectId:r,protocol:n}=t;if(["protocol","publicKey","host","projectId"].forEach(a=>{if(!t[a])throw new mr(`Invalid Sentry Dsn: ${a} missing`)}),!r.match(/^\d+$/))throw new mr(`Invalid Sentry Dsn: Invalid projectId ${r}`);if(!zct(n))throw new mr(`Invalid Sentry Dsn: Invalid protocol ${n}`);if(e&&isNaN(parseInt(e,10)))throw new mr(`Invalid Sentry Dsn: Invalid port ${e}`);return!0}function Wct(t){const e=typeof t=="string"?Gct(t):WJ(t);return Vct(e),e}const Kct="Sentry Logger ",pp=["debug","info","warn","error","log","assert","trace"];function KJ(t){if(!("console"in Vt))return t();const e=Vt.console,r={};pp.forEach(n=>{const i=e[n]&&e[n].__sentry_original__;n in e&&i&&(r[n]=e[n],e[n]=i)});try{return t()}finally{Object.keys(r).forEach(n=>{e[n]=r[n]})}}function T7(){let t=!1;const e={enable:()=>{t=!0},disable:()=>{t=!1}};return typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?pp.forEach(r=>{e[r]=(...n)=>{t&&KJ(()=>{Vt.console[r](`${Kct}[${r}]:`,...n)})}}):pp.forEach(r=>{e[r]=()=>{}}),e}let J;typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?J=mL("logger",T7):J=T7();function d0(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function Y1(t,e){if(!Array.isArray(t))return"";const r=[];for(let n=0;nYct(t,n,r))}function Wt(t,e,r){if(!(e in t))return;const n=t[e],i=r(n);if(typeof i=="function")try{YJ(i,n)}catch{}t[e]=i}function gL(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,configurable:!0})}function YJ(t,e){const r=e.prototype||{};t.prototype=e.prototype=r,gL(t,"__sentry_original__",e)}function vL(t){return t.__sentry_original__}function qct(t){return Object.keys(t).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`).join("&")}function qJ(t){if(HJ(t))return{message:t.message,name:t.name,stack:t.stack,...A7(t)};if(hL(t)){const e={type:t.type,target:R7(t.target),currentTarget:R7(t.currentTarget),...A7(t)};return typeof CustomEvent<"u"&&Bo(t,CustomEvent)&&(e.detail=t.detail),e}else return t}function R7(t){try{return Nct(t)?Nf(t):Object.prototype.toString.call(t)}catch{return""}}function A7(t){if(typeof t=="object"&&t!==null){const e={};for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}else return{}}function Xct(t,e=40){const r=Object.keys(qJ(t));if(r.sort(),!r.length)return"[object has no keys]";if(r[0].length>=e)return d0(r[0],e);for(let n=r.length;n>0;n--){const i=r.slice(0,n).join(", ");if(!(i.length>e))return n===r.length?i:d0(i,e)}return""}function Eo(t){return _I(t,new Map)}function _I(t,e){if(Pf(t)){const r=e.get(t);if(r!==void 0)return r;const n={};e.set(t,n);for(const i of Object.keys(t))typeof t[i]<"u"&&(n[i]=_I(t[i],e));return n}if(Array.isArray(t)){const r=e.get(t);if(r!==void 0)return r;const n=[];return e.set(t,n),t.forEach(i=>{n.push(_I(i,e))}),n}return t}const XJ=50,I7=/\(error: (.*)\)/;function QJ(...t){const e=t.sort((r,n)=>r[0]-n[0]).map(r=>r[1]);return(r,n=0)=>{const i=[],a=r.split(` +`);for(let s=n;s1024)continue;const c=I7.test(o)?o.replace(I7,"$1"):o;if(!c.match(/\S*Error: /)){for(const l of e){const u=l(c);if(u){i.push(u);break}}if(i.length>=XJ)break}}return Zct(i)}}function Qct(t){return Array.isArray(t)?QJ(...t):t}function Zct(t){if(!t.length)return[];const e=t.slice(0,XJ),r=e[e.length-1].function;r&&/sentryWrapped/.test(r)&&e.pop(),e.reverse();const n=e[e.length-1].function;return n&&/captureMessage|captureException/.test(n)&&e.pop(),e.map(i=>({...i,filename:i.filename||e[e.length-1].filename,function:i.function||"?"}))}const JT="";function Uo(t){try{return!t||typeof t!="function"?JT:t.name||JT}catch{return JT}}const wI=Rm();function ZJ(){if(!("fetch"in wI))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function TI(t){return t&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function JJ(){if(!ZJ())return!1;if(TI(wI.fetch))return!0;let t=!1;const e=wI.document;if(e&&typeof e.createElement=="function")try{const r=e.createElement("iframe");r.hidden=!0,e.head.appendChild(r),r.contentWindow&&r.contentWindow.fetch&&(t=TI(r.contentWindow.fetch)),e.head.removeChild(r)}catch(r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",r)}return t}const fv=Rm();function Jct(){const t=fv.chrome,e=t&&t.app&&t.app.runtime,r="history"in fv&&!!fv.history.pushState&&!!fv.history.replaceState;return!e&&r}const ut=Rm(),Nl="__sentry_xhr_v2__",h0={},$7={};function eut(t){if(!$7[t])switch($7[t]=!0,t){case"console":tut();break;case"dom":cut();break;case"xhr":iut();break;case"fetch":rut();break;case"history":aut();break;case"error":uut();break;case"unhandledrejection":fut();break;default:(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.warn("unknown instrumentation type:",t);return}}function Rr(t,e){h0[t]=h0[t]||[],h0[t].push(e),eut(t)}function Ci(t,e){if(!(!t||!h0[t]))for(const r of h0[t]||[])try{r(e)}catch(n){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.error(`Error while triggering instrumentation handler. +Type: ${t} +Name: ${Uo(r)} +Error:`,n)}}function tut(){"console"in ut&&pp.forEach(function(t){t in ut.console&&Wt(ut.console,t,function(e){return function(...r){Ci("console",{args:r,level:t}),e&&e.apply(ut.console,r)}})})}function rut(){JJ()&&Wt(ut,"fetch",function(t){return function(...e){const{method:r,url:n}=nut(e),i={args:e,fetchData:{method:r,url:n},startTimestamp:Date.now()};return Ci("fetch",{...i}),t.apply(ut,e).then(a=>(Ci("fetch",{...i,endTimestamp:Date.now(),response:a}),a),a=>{throw Ci("fetch",{...i,endTimestamp:Date.now(),error:a}),a})}})}function RI(t,e){return!!t&&typeof t=="object"&&!!t[e]}function C7(t){return typeof t=="string"?t:t?RI(t,"url")?t.url:t.toString?t.toString():"":""}function nut(t){if(t.length===0)return{method:"GET",url:""};if(t.length===2){const[r,n]=t;return{url:C7(r),method:RI(n,"method")?String(n.method).toUpperCase():"GET"}}const e=t[0];return{url:C7(e),method:RI(e,"method")?String(e.method).toUpperCase():"GET"}}function iut(){if(!("XMLHttpRequest"in ut))return;const t=XMLHttpRequest.prototype;Wt(t,"open",function(e){return function(...r){const n=r[1],i=this[Nl]={method:Fo(r[0])?r[0].toUpperCase():r[0],url:r[1],request_headers:{}};Fo(n)&&i.method==="POST"&&n.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const a=()=>{const s=this[Nl];if(s&&this.readyState===4){try{s.status_code=this.status}catch{}Ci("xhr",{args:r,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:this})}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?Wt(this,"onreadystatechange",function(s){return function(...o){return a(),s.apply(this,o)}}):this.addEventListener("readystatechange",a),Wt(this,"setRequestHeader",function(s){return function(...o){const[c,l]=o,u=this[Nl];return u&&(u.request_headers[c.toLowerCase()]=l),s.apply(this,o)}}),e.apply(this,r)}}),Wt(t,"send",function(e){return function(...r){const n=this[Nl];return n&&r[0]!==void 0&&(n.body=r[0]),Ci("xhr",{args:r,startTimestamp:Date.now(),xhr:this}),e.apply(this,r)}})}let dv;function aut(){if(!Jct())return;const t=ut.onpopstate;ut.onpopstate=function(...r){const n=ut.location.href,i=dv;if(dv=n,Ci("history",{from:i,to:n}),t)try{return t.apply(this,r)}catch{}};function e(r){return function(...n){const i=n.length>2?n[2]:void 0;if(i){const a=dv,s=String(i);dv=s,Ci("history",{from:a,to:s})}return r.apply(this,n)}}Wt(ut.history,"pushState",e),Wt(ut.history,"replaceState",e)}const sut=1e3;let hv,pv;function out(t,e){if(!t||t.type!==e.type)return!0;try{if(t.target!==e.target)return!0}catch{}return!1}function lut(t){if(t.type!=="keypress")return!1;try{const e=t.target;if(!e||!e.tagName)return!0;if(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable)return!1}catch{}return!0}function k7(t,e=!1){return r=>{if(!r||pv===r||lut(r))return;const n=r.type==="keypress"?"input":r.type;hv===void 0?(t({event:r,name:n,global:e}),pv=r):out(pv,r)&&(t({event:r,name:n,global:e}),pv=r),clearTimeout(hv),hv=ut.setTimeout(()=>{hv=void 0},sut)}}function cut(){if(!("document"in ut))return;const t=Ci.bind(null,"dom"),e=k7(t,!0);ut.document.addEventListener("click",e,!1),ut.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(r=>{const n=ut[r]&&ut[r].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty("addEventListener")||(Wt(n,"addEventListener",function(i){return function(a,s,o){if(a==="click"||a=="keypress")try{const c=this,l=c.__sentry_instrumentation_handlers__=c.__sentry_instrumentation_handlers__||{},u=l[a]=l[a]||{refCount:0};if(!u.handler){const f=k7(t);u.handler=f,i.call(this,a,f,o)}u.refCount++}catch{}return i.call(this,a,s,o)}}),Wt(n,"removeEventListener",function(i){return function(a,s,o){if(a==="click"||a=="keypress")try{const c=this,l=c.__sentry_instrumentation_handlers__||{},u=l[a];u&&(u.refCount--,u.refCount<=0&&(i.call(this,a,u.handler,o),u.handler=void 0,delete l[a]),Object.keys(l).length===0&&delete c.__sentry_instrumentation_handlers__)}catch{}return i.call(this,a,s,o)}}))})}let mv=null;function uut(){mv=ut.onerror,ut.onerror=function(t,e,r,n,i){return Ci("error",{column:n,error:i,line:r,msg:t,url:e}),mv&&!mv.__SENTRY_LOADER__?mv.apply(this,arguments):!1},ut.onerror.__SENTRY_INSTRUMENTED__=!0}let gv=null;function fut(){gv=ut.onunhandledrejection,ut.onunhandledrejection=function(t){return Ci("unhandledrejection",t),gv&&!gv.__SENTRY_LOADER__?gv.apply(this,arguments):!0},ut.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}function dut(){const t=typeof WeakSet=="function",e=t?new WeakSet:[];function r(i){if(t)return e.has(i)?!0:(e.add(i),!1);for(let a=0;ae.getRandomValues(new Uint8Array(1))[0]:()=>Math.random()*16;return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,n=>(n^(r()&15)>>n/4).toString(16))}function eee(t){return t.exception&&t.exception.values?t.exception.values[0]:void 0}function Ys(t){const{message:e,event_id:r}=t;if(e)return e;const n=eee(t);return n?n.type&&n.value?`${n.type}: ${n.value}`:n.type||n.value||r||"":r||""}function AI(t,e,r){const n=t.exception=t.exception||{},i=n.values=n.values||[],a=i[0]=i[0]||{};a.value||(a.value=e||""),a.type||(a.type=r||"Error")}function Df(t,e){const r=eee(t);if(!r)return;const n={type:"generic",handled:!0},i=r.mechanism;if(r.mechanism={...n,...i,...e},e&&"data"in e){const a={...i&&i.data,...e.data};r.mechanism.data=a}}function O7(t){if(t&&t.__sentry_captured__)return!0;try{gL(t,"__sentry_captured__",!0)}catch{}return!1}function tee(t){return Array.isArray(t)?t:[t]}function hut(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function put(){return"npm"}function mut(){return!hut()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function gut(t,e){return t.require(e)}function Gs(t,e=1/0,r=1/0){try{return II("",t,e,r)}catch(n){return{ERROR:`**non-serializable** (${n})`}}}function ree(t,e=3,r=100*1024){const n=Gs(t,e);return but(n)>r?ree(t,e-1,r):n}function II(t,e,r=1/0,n=1/0,i=dut()){const[a,s]=i;if(e===null||["number","boolean","string"].includes(typeof e)&&!VJ(e))return e;const o=vut(t,e);if(!o.startsWith("[object "))return o;if(e.__sentry_skip_normalization__)return e;let c=r;if(typeof e.__sentry_override_normalization_depth__=="number"&&(c=e.__sentry_override_normalization_depth__),c===0)return o.replace("object ","");if(a(e))return"[Circular ~]";const l=e;if(l&&typeof l.toJSON=="function")try{const h=l.toJSON();return II("",h,c-1,n,i)}catch{}const u=Array.isArray(e)?[]:{};let f=0;const d=qJ(e);for(const h in d){if(!Object.prototype.hasOwnProperty.call(d,h))continue;if(f>=n){u[h]="[MaxProperties ~]";break}const p=d[h];u[h]=II(h,p,c-1,n,i),f++}return s(e),u}function vut(t,e){try{if(t==="domain"&&e&&typeof e=="object"&&e._events)return"[Domain]";if(t==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&e===global)return"[Global]";if(typeof window<"u"&&e===window)return"[Window]";if(typeof document<"u"&&e===document)return"[Document]";if(Mct(e))return"[SyntheticEvent]";if(typeof e=="number"&&e!==e)return"[NaN]";if(e===void 0)return"[undefined]";if(typeof e=="function")return`[Function: ${Uo(e)}]`;if(typeof e=="symbol")return`[${String(e)}]`;if(typeof e=="bigint")return`[BigInt: ${String(e)}]`;const r=yut(e);return/^HTML(\w*)Element$/.test(r)?`[HTMLElement: ${r}]`:`[object ${r}]`}catch(r){return`**non-serializable** (${r})`}}function yut(t){const e=Object.getPrototypeOf(t);return e?e.constructor.name:"null prototype"}function xut(t){return~-encodeURI(t).split(/%..|./).length}function but(t){return xut(JSON.stringify(t))}var Ha;(function(t){t[t.PENDING=0]="PENDING";const r=1;t[t.RESOLVED=r]="RESOLVED";const n=2;t[t.REJECTED=n]="REJECTED"})(Ha||(Ha={}));function lc(t){return new wr(e=>{e(t)})}function q1(t){return new wr((e,r)=>{r(t)})}class wr{__init(){this._state=Ha.PENDING}__init2(){this._handlers=[]}constructor(e){wr.prototype.__init.call(this),wr.prototype.__init2.call(this),wr.prototype.__init3.call(this),wr.prototype.__init4.call(this),wr.prototype.__init5.call(this),wr.prototype.__init6.call(this);try{e(this._resolve,this._reject)}catch(r){this._reject(r)}}then(e,r){return new wr((n,i)=>{this._handlers.push([!1,a=>{if(!e)n(a);else try{n(e(a))}catch(s){i(s)}},a=>{if(!r)i(a);else try{n(r(a))}catch(s){i(s)}}]),this._executeHandlers()})}catch(e){return this.then(r=>r,e)}finally(e){return new wr((r,n)=>{let i,a;return this.then(s=>{a=!1,i=s,e&&e()},s=>{a=!0,i=s,e&&e()}).then(()=>{if(a){n(i);return}r(i)})})}__init3(){this._resolve=e=>{this._setResult(Ha.RESOLVED,e)}}__init4(){this._reject=e=>{this._setResult(Ha.REJECTED,e)}}__init5(){this._setResult=(e,r)=>{if(this._state===Ha.PENDING){if(pL(r)){r.then(this._resolve,this._reject);return}this._state=e,this._value=r,this._executeHandlers()}}}__init6(){this._executeHandlers=()=>{if(this._state===Ha.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach(r=>{r[0]||(this._state===Ha.RESOLVED&&r[1](this._value),this._state===Ha.REJECTED&&r[2](this._value),r[0]=!0)})}}}function Eut(t){const e=[];function r(){return t===void 0||e.lengthn(o)).then(null,()=>n(o).then(null,()=>{})),o}function a(s){return new wr((o,c)=>{let l=e.length;if(!l)return o(!0);const u=setTimeout(()=>{s&&s>0&&o(!1)},s);e.forEach(f=>{lc(f).then(()=>{--l||(clearTimeout(u),o(!0))},c)})})}return{$:e,add:i,drain:a}}function e2(t){if(!t)return{};const e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};const r=e[6]||"",n=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:r,hash:n,relative:e[5]+r+n}}const Sut=["fatal","error","warning","log","info","debug"];function nee(t){return t==="warn"?"warning":Sut.includes(t)?t:"log"}const iee=Rm(),$I={nowSeconds:()=>Date.now()/1e3};function _ut(){const{performance:t}=iee;if(!t||!t.now)return;const e=Date.now()-t.now();return{now:()=>t.now(),timeOrigin:e}}function wut(){try{return gut(module,"perf_hooks").performance}catch{return}}const t2=mut()?wut():_ut(),L7=t2===void 0?$I:{nowSeconds:()=>(t2.timeOrigin+t2.now())/1e3},jE=$I.nowSeconds.bind($I),cc=L7.nowSeconds.bind(L7),jo=(()=>{const{performance:t}=iee;if(!t||!t.now)return;const e=3600*1e3,r=t.now(),n=Date.now(),i=t.timeOrigin?Math.abs(t.timeOrigin+r-n):e,a=ii+a.length,0),r=new Uint8Array(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return r}function Cut(t,e){const r=typeof t.data=="string"?CI(t.data,e):t.data;return[Eo({type:"attachment",length:r.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType}),r]}const kut={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor"};function N7(t){return kut[t]}function aee(t){if(!t||!t.sdk)return;const{name:e,version:r}=t.sdk;return{name:e,version:r}}function Out(t,e,r,n){const i=t.sdkProcessingMetadata&&t.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:t.event_id,sent_at:new Date().toISOString(),...e&&{sdk:e},...!!r&&{dsn:UE(n)},...i&&{trace:Eo({...i})}}}function Lut(t,e,r){const n=[{type:"client_report"},{timestamp:r||jE(),discarded_events:t}];return Im(e?{dsn:e}:{},[n])}const Put=60*1e3;function Nut(t,e=Date.now()){const r=parseInt(`${t}`,10);if(!isNaN(r))return r*1e3;const n=Date.parse(`${t}`);return isNaN(n)?Put:n-e}function Dut(t,e){return t[e]||t.all||0}function Mut(t,e,r=Date.now()){return Dut(t,e)>r}function Fut(t,{statusCode:e,headers:r},n=Date.now()){const i={...t},a=r&&r["x-sentry-rate-limits"],s=r&&r["retry-after"];if(a)for(const o of a.trim().split(",")){const[c,l]=o.split(":",2),u=parseInt(c,10),f=(isNaN(u)?60:u)*1e3;if(!l)i.all=n+f;else for(const d of l.split(";"))i[d]=n+f}else s?i.all=n+Nut(s,n):e===429&&(i.all=n+60*1e3);return i}const kI="baggage",see="sentry-",But=/^sentry-/,Uut=8192;function jut(t){if(!Fo(t)&&!Array.isArray(t))return;let e={};if(Array.isArray(t))e=t.reduce((n,i)=>{const a=D7(i);return{...n,...a}},{});else{if(!t)return;e=D7(t)}const r=Object.entries(e).reduce((n,[i,a])=>{if(i.match(But)){const s=i.slice(see.length);n[s]=a}return n},{});if(Object.keys(r).length>0)return r}function oee(t){const e=Object.entries(t).reduce((r,[n,i])=>(i&&(r[`${see}${n}`]=i),r),{});return Hut(e)}function D7(t){return t.split(",").map(e=>e.split("=").map(r=>decodeURIComponent(r.trim()))).reduce((e,[r,n])=>(e[r]=n,e),{})}function Hut(t){if(Object.keys(t).length!==0)return Object.entries(t).reduce((e,[r,n],i)=>{const a=`${encodeURIComponent(r)}=${encodeURIComponent(n)}`,s=i===0?a:`${e},${a}`;return s.length>Uut?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.warn(`Not adding key: ${r} with val: ${n} to baggage header due to exceeding baggage size limits.`),e):s},"")}class Dl{static __initStatic(){this.id="CaptureConsole"}__init(){this.name=Dl.id}__init2(){this._levels=pp}constructor(e={}){Dl.prototype.__init.call(this),Dl.prototype.__init2.call(this),e.levels&&(this._levels=e.levels)}setupOnce(e,r){"console"in Vt&&this._levels.forEach(n=>{n in Vt.console&&Wt(Vt.console,n,i=>(...a)=>{const s=r();s.getIntegration(Dl)&&s.withScope(o=>{o.setLevel(nee(n)),o.setExtra("arguments",a),o.addEventProcessor(l=>(l.logger="console",l));let c=Y1(a," ");n==="assert"?a[0]===!1&&(c=`Assertion failed: ${Y1(a.slice(1)," ")||"console.assert"}`,o.setExtra("arguments",a.slice(1)),s.captureMessage(c)):n==="error"&&a[0]instanceof Error?s.captureException(a[0]):s.captureMessage(c)}),i&&i.apply(Vt.console,a)})})}}Dl.__initStatic();function zut(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}class mp{static __initStatic(){this.id="HttpClient"}__init(){this.name=mp.id}constructor(e){mp.prototype.__init.call(this),this._options={failedRequestStatusCodes:[[500,599]],failedRequestTargets:[/.*/],...e}}setupOnce(e,r){this._getCurrentHub=r,this._wrapFetch(),this._wrapXHR()}_fetchResponseHandler(e,r,n){if(this._getCurrentHub&&this._shouldCaptureResponse(r.status,r.url)){const i=Gut(e,n),a=this._getCurrentHub();let s,o,c,l;a.shouldSendDefaultPii()&&([{headers:s,cookies:c},{headers:o,cookies:l}]=[{cookieHeader:"Cookie",obj:i},{cookieHeader:"Set-Cookie",obj:r}].map(({cookieHeader:f,obj:d})=>{const h=this._extractFetchHeaders(d.headers);let p;try{const v=h[f]||h[f.toLowerCase()]||void 0;v&&(p=this._parseCookieString(v))}catch{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.log(`Could not extract cookies from header ${f}`)}return{headers:h,cookies:p}}));const u=this._createEvent({url:i.url,method:i.method,status:r.status,requestHeaders:s,responseHeaders:o,requestCookies:c,responseCookies:l});a.captureEvent(u)}}_xhrResponseHandler(e,r,n){if(this._getCurrentHub&&this._shouldCaptureResponse(e.status,e.responseURL)){let i,a,s;const o=this._getCurrentHub();if(o.shouldSendDefaultPii()){try{const l=e.getResponseHeader("Set-Cookie")||e.getResponseHeader("set-cookie")||void 0;l&&(a=this._parseCookieString(l))}catch{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.log("Could not extract cookies from response headers")}try{s=this._getXHRResponseHeaders(e)}catch{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.log("Could not extract headers from response")}i=n}const c=this._createEvent({url:e.responseURL,method:r,status:e.status,requestHeaders:i,responseHeaders:s,responseCookies:a});o.captureEvent(c)}}_getResponseSizeFromHeaders(e){if(e){const r=e["Content-Length"]||e["content-length"];if(r)return parseInt(r,10)}}_parseCookieString(e){return e.split("; ").reduce((r,n)=>{const[i,a]=n.split("=");return r[i]=a,r},{})}_extractFetchHeaders(e){const r={};return e.forEach((n,i)=>{r[i]=n}),r}_getXHRResponseHeaders(e){const r=e.getAllResponseHeaders();return r?r.split(`\r +`).reduce((n,i)=>{const[a,s]=i.split(": ");return n[a]=s,n},{}):{}}_isInGivenRequestTargets(e){return this._options.failedRequestTargets?this._options.failedRequestTargets.some(r=>typeof r=="string"?e.includes(r):r.test(e)):!1}_isInGivenStatusRanges(e){return this._options.failedRequestStatusCodes?this._options.failedRequestStatusCodes.some(r=>typeof r=="number"?r===e:e>=r[0]&&e<=r[1]):!1}_wrapFetch(){JJ()&&Rr("fetch",e=>{const{response:r,args:n}=e,[i,a]=n;r&&this._fetchResponseHandler(i,r,a)})}_wrapXHR(){"XMLHttpRequest"in Vt&&Rr("xhr",e=>{const{xhr:r}=e,n=r[Nl];if(!n)return;const{method:i,request_headers:a}=n;if(i)try{this._xhrResponseHandler(r,i,a)}catch(s){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.warn("Error while extracting response event form XHR response",s)}})}_isSentryRequest(e){const r=this._getCurrentHub&&this._getCurrentHub().getClient();if(!r)return!1;const n=r.getDsn();return n?e.includes(n.host):!1}_shouldCaptureResponse(e,r){return this._isInGivenStatusRanges(e)&&this._isInGivenRequestTargets(r)&&!this._isSentryRequest(r)}_createEvent(e){const r=`HTTP Client Error with status code: ${e.status}`,n={message:r,exception:{values:[{type:"Error",value:r}]},request:{url:e.url,method:e.method,headers:e.requestHeaders,cookies:e.requestCookies},contexts:{response:{status_code:e.status,headers:e.responseHeaders,cookies:e.responseCookies,body_size:this._getResponseSizeFromHeaders(e.responseHeaders)}}};return Df(n,{type:"http.client"}),n}}mp.__initStatic();function Gut(t,e){return!e&&t instanceof Request||t instanceof Request&&t.bodyUsed?t:new Request(t,e)}const yL="production";function Vut(t){const e=cc(),r={sid:So(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>Kut(r)};return t&&Mf(r,t),r}function Mf(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),!t.did&&!e.did&&(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||cc(),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=e.sid.length===32?e.sid:So()),e.init!==void 0&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),typeof e.started=="number"&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if(typeof e.duration=="number")t.duration=e.duration;else{const r=t.timestamp-t.started;t.duration=r>=0?r:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),typeof e.errors=="number"&&(t.errors=e.errors),e.status&&(t.status=e.status)}function Wut(t,e){let r={};e?r={status:e}:t.status==="ok"&&(r={status:"exited"}),Mf(t,r)}function Kut(t){return Eo({sid:`${t.sid}`,init:t.init,started:new Date(t.started*1e3).toISOString(),timestamp:new Date(t.timestamp*1e3).toISOString(),status:t.status,errors:t.errors,did:typeof t.did=="number"||typeof t.did=="string"?`${t.did}`:void 0,duration:t.duration,attrs:{release:t.release,environment:t.environment,ip_address:t.ipAddress,user_agent:t.userAgent}})}const Yut=100;class zl{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={}}static clone(e){const r=new zl;return e&&(r._breadcrumbs=[...e._breadcrumbs],r._tags={...e._tags},r._extra={...e._extra},r._contexts={...e._contexts},r._user=e._user,r._level=e._level,r._span=e._span,r._session=e._session,r._transactionName=e._transactionName,r._fingerprint=e._fingerprint,r._eventProcessors=[...e._eventProcessors],r._requestSession=e._requestSession,r._attachments=[...e._attachments],r._sdkProcessingMetadata={...e._sdkProcessingMetadata}),r}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{},this._session&&Mf(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,r){return this._tags={...this._tags,[e]:r},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,r){return this._extra={...this._extra,[e]:r},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,r){return r===null?delete this._contexts[e]:this._contexts[e]=r,this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){const e=this.getSpan();return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;if(typeof e=="function"){const r=e(this);return r instanceof zl?r:this}return e instanceof zl?(this._tags={...this._tags,...e._tags},this._extra={...this._extra,...e._extra},this._contexts={...this._contexts,...e._contexts},e._user&&Object.keys(e._user).length&&(this._user=e._user),e._level&&(this._level=e._level),e._fingerprint&&(this._fingerprint=e._fingerprint),e._requestSession&&(this._requestSession=e._requestSession)):Pf(e)&&(e=e,this._tags={...this._tags,...e.tags},this._extra={...this._extra,...e.extra},this._contexts={...this._contexts,...e.contexts},e.user&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint&&(this._fingerprint=e.fingerprint),e.requestSession&&(this._requestSession=e.requestSession)),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this}addBreadcrumb(e,r){const n=typeof r=="number"?r:Yut;if(n<=0)return this;const i={timestamp:jE(),...e};return this._breadcrumbs=[...this._breadcrumbs,i].slice(-n),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(e,r={}){if(this._extra&&Object.keys(this._extra).length&&(e.extra={...this._extra,...e.extra}),this._tags&&Object.keys(this._tags).length&&(e.tags={...this._tags,...e.tags}),this._user&&Object.keys(this._user).length&&(e.user={...this._user,...e.user}),this._contexts&&Object.keys(this._contexts).length&&(e.contexts={...this._contexts,...e.contexts}),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts={trace:this._span.getTraceContext(),...e.contexts};const n=this._span.transaction;if(n){e.sdkProcessingMetadata={dynamicSamplingContext:n.getDynamicSamplingContext(),...e.sdkProcessingMetadata};const i=n.name;i&&(e.tags={transaction:i,...e.tags})}}return this._applyFingerprint(e),e.breadcrumbs=[...e.breadcrumbs||[],...this._breadcrumbs],e.breadcrumbs=e.breadcrumbs.length>0?e.breadcrumbs:void 0,e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...this._sdkProcessingMetadata},this._notifyEventProcessors([...lee(),...this._eventProcessors],e,r)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}_notifyEventProcessors(e,r,n,i=0){return new wr((a,s)=>{const o=e[i];if(r===null||typeof o!="function")a(r);else{const c=o({...r},n);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&o.id&&c===null&&J.log(`Event processor "${o.id}" dropped event`),pL(c)?c.then(l=>this._notifyEventProcessors(e,l,n,i+1).then(a)).then(null,s):this._notifyEventProcessors(e,c,n,i+1).then(a).then(null,s)}})}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}_applyFingerprint(e){e.fingerprint=e.fingerprint?tee(e.fingerprint):[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}}function lee(){return mL("globalEventProcessors",()=>[])}function xL(t){lee().push(t)}const cee=4,qut=100;class uee{constructor(e,r=new zl,n=cee){this._version=n,this._stack=[{scope:r}],e&&this.bindClient(e)}isOlderThan(e){return this._version{a.captureException(e,{originalException:e,syntheticException:i,...r,event_id:n},s)}),n}captureMessage(e,r,n){const i=this._lastEventId=n&&n.event_id?n.event_id:So(),a=new Error(e);return this._withClient((s,o)=>{s.captureMessage(e,r,{originalException:e,syntheticException:a,...n,event_id:i},o)}),i}captureEvent(e,r){const n=r&&r.event_id?r.event_id:So();return e.type||(this._lastEventId=n),this._withClient((i,a)=>{i.captureEvent(e,{...r,event_id:n},a)}),n}lastEventId(){return this._lastEventId}addBreadcrumb(e,r){const{scope:n,client:i}=this.getStackTop();if(!i)return;const{beforeBreadcrumb:a=null,maxBreadcrumbs:s=qut}=i.getOptions&&i.getOptions()||{};if(s<=0)return;const c={timestamp:jE(),...e},l=a?KJ(()=>a(c,r)):c;l!==null&&(i.emit&&i.emit("beforeAddBreadcrumb",l,r),n.addBreadcrumb(l,s))}setUser(e){this.getScope().setUser(e)}setTags(e){this.getScope().setTags(e)}setExtras(e){this.getScope().setExtras(e)}setTag(e,r){this.getScope().setTag(e,r)}setExtra(e,r){this.getScope().setExtra(e,r)}setContext(e,r){this.getScope().setContext(e,r)}configureScope(e){const{scope:r,client:n}=this.getStackTop();n&&e(r)}run(e){const r=M7(this);try{e(this)}finally{M7(r)}}getIntegration(e){const r=this.getClient();if(!r)return null;try{return r.getIntegration(e)}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,r){const n=this._callExtensionMethod("startTransaction",e,r);return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&!n&&console.warn(`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init': +Sentry.addTracingExtensions(); +Sentry.init({...}); +`),n}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){const r=this.getStackTop().scope,n=r.getSession();n&&Wut(n),this._sendSessionUpdate(),r.setSession()}startSession(e){const{scope:r,client:n}=this.getStackTop(),{release:i,environment:a=yL}=n&&n.getOptions()||{},{userAgent:s}=Vt.navigator||{},o=Vut({release:i,environment:a,user:r.getUser(),...s&&{userAgent:s},...e}),c=r.getSession&&r.getSession();return c&&c.status==="ok"&&Mf(c,{status:"exited"}),this.endSession(),r.setSession(o),o}shouldSendDefaultPii(){const e=this.getClient(),r=e&&e.getOptions();return!!(r&&r.sendDefaultPii)}_sendSessionUpdate(){const{scope:e,client:r}=this.getStackTop(),n=e.getSession();n&&r&&r.captureSession&&r.captureSession(n)}_withClient(e){const{scope:r,client:n}=this.getStackTop();n&&e(n,r)}_callExtensionMethod(e,...r){const i=$m().__SENTRY__;if(i&&i.extensions&&typeof i.extensions[e]=="function")return i.extensions[e].apply(this,r);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function $m(){return Vt.__SENTRY__=Vt.__SENTRY__||{extensions:{},hub:void 0},Vt}function M7(t){const e=$m(),r=OI(e);return fee(e,t),r}function dt(){const t=$m();if(t.__SENTRY__&&t.__SENTRY__.acs){const e=t.__SENTRY__.acs.getCurrentHub();if(e)return e}return Xut(t)}function Xut(t=$m()){return(!Qut(t)||OI(t).isOlderThan(cee))&&fee(t,new uee),OI(t)}function Qut(t){return!!(t&&t.__SENTRY__&&t.__SENTRY__.hub)}function OI(t){return mL("hub",()=>new uee,t)}function fee(t,e){if(!t)return!1;const r=t.__SENTRY__=t.__SENTRY__||{};return r.hub=e,!0}function bL(t){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const e=dt().getClient(),r=t||e&&e.getOptions();return!!r&&(r.enableTracing||"tracesSampleRate"in r||"tracesSampler"in r)}function Cm(t){return(t||dt()).getScope().getTransaction()}let F7=!1;function Zut(){F7||(F7=!0,Rr("error",LI),Rr("unhandledrejection",LI))}function LI(){const t=Cm();if(t){const e="internal_error";(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.log(`[Tracing] Transaction: ${e} -> Global error occured`),t.setStatus(e)}}LI.tag="sentry_tracingErrorCallback";class HE{__init(){this.spans=[]}constructor(e=1e3){HE.prototype.__init.call(this),this._maxlen=e}add(e){this.spans.length>this._maxlen?e.spanRecorder=void 0:this.spans.push(e)}}class za{__init2(){this.traceId=So()}__init3(){this.spanId=So().substring(16)}__init4(){this.startTimestamp=cc()}__init5(){this.tags={}}__init6(){this.data={}}__init7(){this.instrumenter="sentry"}constructor(e){if(za.prototype.__init2.call(this),za.prototype.__init3.call(this),za.prototype.__init4.call(this),za.prototype.__init5.call(this),za.prototype.__init6.call(this),za.prototype.__init7.call(this),!e)return this;e.traceId&&(this.traceId=e.traceId),e.spanId&&(this.spanId=e.spanId),e.parentSpanId&&(this.parentSpanId=e.parentSpanId),"sampled"in e&&(this.sampled=e.sampled),e.op&&(this.op=e.op),e.description&&(this.description=e.description),e.data&&(this.data=e.data),e.tags&&(this.tags=e.tags),e.status&&(this.status=e.status),e.startTimestamp&&(this.startTimestamp=e.startTimestamp),e.endTimestamp&&(this.endTimestamp=e.endTimestamp),e.instrumenter&&(this.instrumenter=e.instrumenter)}startChild(e){const r=new za({...e,parentSpanId:this.spanId,sampled:this.sampled,traceId:this.traceId});if(r.spanRecorder=this.spanRecorder,r.spanRecorder&&r.spanRecorder.add(r),r.transaction=this.transaction,(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&r.transaction){const n=e&&e.op||"< unknown op >",i=r.transaction.name||"< unknown name >",a=r.transaction.spanId,s=`[Tracing] Starting '${n}' span on transaction '${i}' (${a}).`;r.transaction.metadata.spanMetadata[r.spanId]={logMessage:s},J.log(s)}return r}setTag(e,r){return this.tags={...this.tags,[e]:r},this}setData(e,r){return this.data={...this.data,[e]:r},this}setStatus(e){return this.status=e,this}setHttpStatus(e){this.setTag("http.status_code",String(e));const r=Jut(e);return r!=="unknown_error"&&this.setStatus(r),this}isSuccess(){return this.status==="ok"}finish(e){if((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&this.transaction&&this.transaction.spanId!==this.spanId){const{logMessage:r}=this.transaction.metadata.spanMetadata[this.spanId];r&&J.log(r.replace("Starting","Finishing"))}this.endTimestamp=typeof e=="number"?e:cc()}toTraceparent(){let e="";return this.sampled!==void 0&&(e=this.sampled?"-1":"-0"),`${this.traceId}-${this.spanId}${e}`}toContext(){return Eo({data:this.data,description:this.description,endTimestamp:this.endTimestamp,op:this.op,parentSpanId:this.parentSpanId,sampled:this.sampled,spanId:this.spanId,startTimestamp:this.startTimestamp,status:this.status,tags:this.tags,traceId:this.traceId})}updateWithContext(e){return this.data=e.data||{},this.description=e.description,this.endTimestamp=e.endTimestamp,this.op=e.op,this.parentSpanId=e.parentSpanId,this.sampled=e.sampled,this.spanId=e.spanId||this.spanId,this.startTimestamp=e.startTimestamp||this.startTimestamp,this.status=e.status,this.tags=e.tags||{},this.traceId=e.traceId||this.traceId,this}getTraceContext(){return Eo({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,trace_id:this.traceId})}toJSON(){return Eo({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,start_timestamp:this.startTimestamp,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,timestamp:this.endTimestamp,trace_id:this.traceId})}}function Jut(t){if(t<400&&t>=100)return"ok";if(t>=400&&t<500)switch(t){case 401:return"unauthenticated";case 403:return"permission_denied";case 404:return"not_found";case 409:return"already_exists";case 413:return"failed_precondition";case 429:return"resource_exhausted";default:return"invalid_argument"}if(t>=500&&t<600)switch(t){case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline_exceeded";default:return"internal_error"}return"unknown_error"}class rf extends za{__init(){this._measurements={}}__init2(){this._contexts={}}__init3(){this._frozenDynamicSamplingContext=void 0}constructor(e,r){super(e),rf.prototype.__init.call(this),rf.prototype.__init2.call(this),rf.prototype.__init3.call(this),this._hub=r||dt(),this._name=e.name||"",this.metadata={source:"custom",...e.metadata,spanMetadata:{}},this._trimEnd=e.trimEnd,this.transaction=this;const n=this.metadata.dynamicSamplingContext;n&&(this._frozenDynamicSamplingContext={...n})}get name(){return this._name}set name(e){this.setName(e)}setName(e,r="custom"){this._name=e,this.metadata.source=r}initSpanRecorder(e=1e3){this.spanRecorder||(this.spanRecorder=new HE(e)),this.spanRecorder.add(this)}setContext(e,r){r===null?delete this._contexts[e]:this._contexts[e]=r}setMeasurement(e,r,n=""){this._measurements[e]={value:r,unit:n}}setMetadata(e){this.metadata={...this.metadata,...e}}finish(e){if(this.endTimestamp!==void 0)return;this.name||((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.warn("Transaction has no name, falling back to ``."),this.name=""),super.finish(e);const r=this._hub.getClient();if(r&&r.emit&&r.emit("finishTransaction",this),this.sampled!==!0){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."),r&&r.recordDroppedEvent("sample_rate","transaction");return}const n=this.spanRecorder?this.spanRecorder.spans.filter(o=>o!==this&&o.endTimestamp):[];this._trimEnd&&n.length>0&&(this.endTimestamp=n.reduce((o,c)=>o.endTimestamp&&c.endTimestamp?o.endTimestamp>c.endTimestamp?o:c:o).endTimestamp);const i=this.metadata,a={contexts:{...this._contexts,trace:this.getTraceContext()},spans:n,start_timestamp:this.startTimestamp,tags:this.tags,timestamp:this.endTimestamp,transaction:this.name,type:"transaction",sdkProcessingMetadata:{...i,dynamicSamplingContext:this.getDynamicSamplingContext()},...i.source&&{transaction_info:{source:i.source}}};return Object.keys(this._measurements).length>0&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),a.measurements=this._measurements),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.log(`[Tracing] Finishing ${this.op} transaction: ${this.name}.`),this._hub.captureEvent(a)}toContext(){const e=super.toContext();return Eo({...e,name:this.name,trimEnd:this._trimEnd})}updateWithContext(e){return super.updateWithContext(e),this.name=e.name||"",this._trimEnd=e.trimEnd,this}getDynamicSamplingContext(){if(this._frozenDynamicSamplingContext)return this._frozenDynamicSamplingContext;const e=this._hub||dt(),r=e&&e.getClient();if(!r)return{};const{environment:n,release:i}=r.getOptions()||{},{publicKey:a}=r.getDsn()||{},s=this.metadata.sampleRate,o=s!==void 0?s.toString():void 0,{segment:c}=e.getScope().getUser()||{},l=this.metadata.source,u=l&&l!=="url"?this.name:void 0,f=Eo({environment:n||yL,release:i,transaction:u,user_segment:c,public_key:a,trace_id:this.traceId,sample_rate:o});return r.emit&&r.emit("createDsc",f),f}setHub(e){this._hub=e}}const cy={idleTimeout:1e3,finalTimeout:3e4,heartbeatInterval:5e3},eft="finishReason",ru=["heartbeatFailed","idleTimeout","documentHidden","finalTimeout","externalFinish","cancelled"];class tft extends HE{constructor(e,r,n,i){super(i),this._pushActivity=e,this._popActivity=r,this.transactionSpanId=n}add(e){e.spanId!==this.transactionSpanId&&(e.finish=r=>{e.endTimestamp=typeof r=="number"?r:cc(),this._popActivity(e.spanId)},e.endTimestamp===void 0&&this._pushActivity(e.spanId)),super.add(e)}}class Vs extends rf{__init(){this.activities={}}__init2(){this._heartbeatCounter=0}__init3(){this._finished=!1}__init4(){this._idleTimeoutCanceledPermanently=!1}__init5(){this._beforeFinishCallbacks=[]}__init6(){this._finishReason=ru[4]}constructor(e,r,n=cy.idleTimeout,i=cy.finalTimeout,a=cy.heartbeatInterval,s=!1){super(e,r),this._idleHub=r,this._idleTimeout=n,this._finalTimeout=i,this._heartbeatInterval=a,this._onScope=s,Vs.prototype.__init.call(this),Vs.prototype.__init2.call(this),Vs.prototype.__init3.call(this),Vs.prototype.__init4.call(this),Vs.prototype.__init5.call(this),Vs.prototype.__init6.call(this),s&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.log(`Setting idle transaction on scope. Span ID: ${this.spanId}`),r.configureScope(o=>o.setSpan(this))),this._restartIdleTimeout(),setTimeout(()=>{this._finished||(this.setStatus("deadline_exceeded"),this._finishReason=ru[3],this.finish())},this._finalTimeout)}finish(e=cc()){if(this._finished=!0,this.activities={},this.op==="ui.action.click"&&this.setTag(eft,this._finishReason),this.spanRecorder){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.log("[Tracing] finishing IdleTransaction",new Date(e*1e3).toISOString(),this.op);for(const r of this._beforeFinishCallbacks)r(this,e);this.spanRecorder.spans=this.spanRecorder.spans.filter(r=>{if(r.spanId===this.spanId)return!0;r.endTimestamp||(r.endTimestamp=e,r.setStatus("cancelled"),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.log("[Tracing] cancelling span since transaction ended early",JSON.stringify(r,void 0,2)));const n=r.startTimestamp"u"||__SENTRY_DEBUG__)&&J.log("[Tracing] discarding Span since it happened after Transaction was finished",JSON.stringify(r,void 0,2)),n}),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.log("[Tracing] flushing IdleTransaction")}else(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.log("[Tracing] No active IdleTransaction");if(this._onScope){const r=this._idleHub.getScope();r.getTransaction()===this&&r.setSpan(void 0)}return super.finish(e)}registerBeforeFinishCallback(e){this._beforeFinishCallbacks.push(e)}initSpanRecorder(e){if(!this.spanRecorder){const r=i=>{this._finished||this._pushActivity(i)},n=i=>{this._finished||this._popActivity(i)};this.spanRecorder=new tft(r,n,this.spanId,e),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.log("Starting heartbeat"),this._pingHeartbeat()}this.spanRecorder.add(this)}cancelIdleTimeout(e,{restartOnChildSpanChange:r}={restartOnChildSpanChange:!0}){this._idleTimeoutCanceledPermanently=r===!1,this._idleTimeoutID&&(clearTimeout(this._idleTimeoutID),this._idleTimeoutID=void 0,Object.keys(this.activities).length===0&&this._idleTimeoutCanceledPermanently&&(this._finishReason=ru[5],this.finish(e)))}setFinishReason(e){this._finishReason=e}_restartIdleTimeout(e){this.cancelIdleTimeout(),this._idleTimeoutID=setTimeout(()=>{!this._finished&&Object.keys(this.activities).length===0&&(this._finishReason=ru[1],this.finish(e))},this._idleTimeout)}_pushActivity(e){this.cancelIdleTimeout(void 0,{restartOnChildSpanChange:!this._idleTimeoutCanceledPermanently}),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.log(`[Tracing] pushActivity: ${e}`),this.activities[e]=!0,(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.log("[Tracing] new activities count",Object.keys(this.activities).length)}_popActivity(e){if(this.activities[e]&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.log(`[Tracing] popActivity ${e}`),delete this.activities[e],(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.log("[Tracing] new activities count",Object.keys(this.activities).length)),Object.keys(this.activities).length===0){const r=cc();this._idleTimeoutCanceledPermanently?(this._finishReason=ru[5],this.finish(r)):this._restartIdleTimeout(r+this._idleTimeout/1e3)}}_beat(){if(this._finished)return;const e=Object.keys(this.activities).join("");e===this._prevHeartbeatString?this._heartbeatCounter++:this._heartbeatCounter=1,this._prevHeartbeatString=e,this._heartbeatCounter>=3?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus("deadline_exceeded"),this._finishReason=ru[0],this.finish()):this._pingHeartbeat()}_pingHeartbeat(){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`),setTimeout(()=>{this._beat()},this._heartbeatInterval)}}function rft(){const e=this.getScope().getSpan();return e?{"sentry-trace":e.toTraceparent()}:{}}function dee(t,e,r){if(!bL(e))return t.sampled=!1,t;if(t.sampled!==void 0)return t.setMetadata({sampleRate:Number(t.sampled)}),t;let n;return typeof e.tracesSampler=="function"?(n=e.tracesSampler(r),t.setMetadata({sampleRate:Number(n)})):r.parentSampled!==void 0?n=r.parentSampled:typeof e.tracesSampleRate<"u"?(n=e.tracesSampleRate,t.setMetadata({sampleRate:Number(n)})):(n=1,t.setMetadata({sampleRate:n})),nft(n)?n?(t.sampled=Math.random()"u"||__SENTRY_DEBUG__)&&J.log(`[Tracing] starting ${t.op} transaction - ${t.name}`),t):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(n)})`),t)):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),t.sampled=!1,t):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.warn("[Tracing] Discarding transaction because of invalid sample rate."),t.sampled=!1,t)}function nft(t){return VJ(t)||!(typeof t=="number"||typeof t=="boolean")?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(t)} of type ${JSON.stringify(typeof t)}.`),!1):t<0||t>1?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${t}.`),!1):!0}function ift(t,e){const r=this.getClient(),n=r&&r.getOptions()||{},i=n.instrumenter||"sentry",a=t.instrumenter||"sentry";i!==a&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.error(`A transaction was started with instrumenter=\`${a}\`, but the SDK is configured with the \`${i}\` instrumenter. +The transaction will not be sampled. Please use the ${i} instrumentation to start transactions.`),t.sampled=!1);let s=new rf(t,this);return s=dee(s,n,{parentSampled:t.parentSampled,transactionContext:t,...e}),s.sampled&&s.initSpanRecorder(n._experiments&&n._experiments.maxSpans),r&&r.emit&&r.emit("startTransaction",s),s}function B7(t,e,r,n,i,a,s){const o=t.getClient(),c=o&&o.getOptions()||{};let l=new Vs(e,t,r,n,s,i);return l=dee(l,c,{parentSampled:e.parentSampled,transactionContext:e,...a}),l.sampled&&l.initSpanRecorder(c._experiments&&c._experiments.maxSpans),o&&o.emit&&o.emit("startTransaction",l),l}function aft(){const t=$m();t.__SENTRY__&&(t.__SENTRY__.extensions=t.__SENTRY__.extensions||{},t.__SENTRY__.extensions.startTransaction||(t.__SENTRY__.extensions.startTransaction=ift),t.__SENTRY__.extensions.traceHeaders||(t.__SENTRY__.extensions.traceHeaders=rft),Zut())}function sft(t,e){return dt().captureException(t,{captureContext:e})}function oft(t){dt().withScope(t)}const lft="7";function cft(t){const e=t.protocol?`${t.protocol}:`:"",r=t.port?`:${t.port}`:"";return`${e}//${t.host}${r}${t.path?`/${t.path}`:""}/api/`}function uft(t){return`${cft(t)}${t.projectId}/envelope/`}function fft(t,e){return qct({sentry_key:t.publicKey,sentry_version:lft,...e&&{sentry_client:`${e.name}/${e.version}`}})}function dft(t,e={}){const r=typeof e=="string"?e:e.tunnel,n=typeof e=="string"||!e._metadata?void 0:e._metadata.sdk;return r||`${uft(t)}?${fft(t,n)}`}function hft(t,e){return e&&(t.sdk=t.sdk||{},t.sdk.name=t.sdk.name||e.name,t.sdk.version=t.sdk.version||e.version,t.sdk.integrations=[...t.sdk.integrations||[],...e.integrations||[]],t.sdk.packages=[...t.sdk.packages||[],...e.packages||[]]),t}function pft(t,e,r,n){const i=aee(r),a={sent_at:new Date().toISOString(),...i&&{sdk:i},...!!n&&{dsn:UE(e)}},s="aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t];return Im(a,[s])}function mft(t,e,r,n){const i=aee(r),a=t.type&&t.type!=="replay_event"?t.type:"event";hft(t,r&&r.sdk);const s=Out(t,i,n,e);return delete t.sdkProcessingMetadata,Im(s,[[{type:a},t]])}const U7=[];function gft(t){const e={};return t.forEach(r=>{const{name:n}=r,i=e[n];i&&!i.isDefaultInstance&&r.isDefaultInstance||(e[n]=r)}),Object.keys(e).map(r=>e[r])}function vft(t){const e=t.defaultIntegrations||[],r=t.integrations;e.forEach(s=>{s.isDefaultInstance=!0});let n;Array.isArray(r)?n=[...e,...r]:typeof r=="function"?n=tee(r(e)):n=e;const i=gft(n),a=xft(i,s=>s.name==="Debug");if(a!==-1){const[s]=i.splice(a,1);i.push(s)}return i}function yft(t){const e={};return t.forEach(r=>{r&&hee(r,e)}),e}function hee(t,e){e[t.name]=t,U7.indexOf(t.name)===-1&&(t.setupOnce(xL,dt),U7.push(t.name),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.log(`Integration installed: ${t.name}`))}function xft(t,e){for(let r=0;ru.name);Eft(s,t),_ft(s,o),e.type===void 0&&Sft(s,t.stackParser);let c=n;r.captureContext&&(c=zl.clone(c).update(r.captureContext));let l=lc(s);if(c){if(c.getAttachments){const u=[...r.attachments||[],...c.getAttachments()];u.length&&(r.attachments=u)}l=c.applyToEvent(s,r)}return l.then(u=>typeof i=="number"&&i>0?wft(u,i,a):u)}function Eft(t,e){const{environment:r,release:n,dist:i,maxValueLength:a=250}=e;"environment"in t||(t.environment="environment"in e?r:yL),t.release===void 0&&n!==void 0&&(t.release=n),t.dist===void 0&&i!==void 0&&(t.dist=i),t.message&&(t.message=d0(t.message,a));const s=t.exception&&t.exception.values&&t.exception.values[0];s&&s.value&&(s.value=d0(s.value,a));const o=t.request;o&&o.url&&(o.url=d0(o.url,a))}const j7=new WeakMap;function Sft(t,e){const r=Vt._sentryDebugIds;if(!r)return;let n;const i=j7.get(e);i?n=i:(n=new Map,j7.set(e,n));const a=Object.keys(r).reduce((c,l)=>{let u;const f=n.get(l);f?u=f:(u=e(l),n.set(l,u));for(let d=u.length-1;d>=0;d--){const h=u[d];if(h.filename){c[h.filename]=r[l];break}}return c},{}),s=new Set;try{t.exception.values.forEach(c=>{c.stacktrace.frames.forEach(l=>{l.filename&&s.add(l.filename)})})}catch{}t.debug_meta=t.debug_meta||{},t.debug_meta.images=t.debug_meta.images||[];const o=t.debug_meta.images;s.forEach(c=>{a[c]&&o.push({type:"sourcemap",code_file:c,debug_id:a[c]})})}function _ft(t,e){e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...e])}function wft(t,e,r){if(!t)return null;const n={...t,...t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map(i=>({...i,...i.data&&{data:Gs(i.data,e,r)}}))},...t.user&&{user:Gs(t.user,e,r)},...t.contexts&&{contexts:Gs(t.contexts,e,r)},...t.extra&&{extra:Gs(t.extra,e,r)}};return t.contexts&&t.contexts.trace&&n.contexts&&(n.contexts.trace=t.contexts.trace,t.contexts.trace.data&&(n.contexts.trace.data=Gs(t.contexts.trace.data,e,r))),t.spans&&(n.spans=t.spans.map(i=>(i.data&&(i.data=Gs(i.data,e,r)),i))),n}const H7="Not capturing exception because it's already been captured.";class Tl{__init(){this._integrations={}}__init2(){this._integrationsInitialized=!1}__init3(){this._numProcessing=0}__init4(){this._outcomes={}}__init5(){this._hooks={}}constructor(e){if(Tl.prototype.__init.call(this),Tl.prototype.__init2.call(this),Tl.prototype.__init3.call(this),Tl.prototype.__init4.call(this),Tl.prototype.__init5.call(this),this._options=e,e.dsn){this._dsn=Wct(e.dsn);const r=dft(this._dsn,e);this._transport=e.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:r})}else(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.warn("No DSN provided, client will not do anything.")}captureException(e,r,n){if(O7(e)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.log(H7);return}let i=r&&r.event_id;return this._process(this.eventFromException(e,r).then(a=>this._captureEvent(a,r,n)).then(a=>{i=a})),i}captureMessage(e,r,n,i){let a=n&&n.event_id;const s=GJ(e)?this.eventFromMessage(String(e),r,n):this.eventFromException(e,n);return this._process(s.then(o=>this._captureEvent(o,n,i)).then(o=>{a=o})),a}captureEvent(e,r,n){if(r&&r.originalException&&O7(r.originalException)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.log(H7);return}let i=r&&r.event_id;return this._process(this._captureEvent(e,r,n).then(a=>{i=a})),i}captureSession(e){if(!this._isEnabled()){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.warn("SDK not enabled, will not capture session.");return}typeof e.release!="string"?(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),Mf(e,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){const r=this._transport;return r?this._isClientDoneProcessing(e).then(n=>r.flush(e).then(i=>n&&i)):lc(!0)}close(e){return this.flush(e).then(r=>(this.getOptions().enabled=!1,r))}setupIntegrations(){this._isEnabled()&&!this._integrationsInitialized&&(this._integrations=yft(this._options.integrations),this._integrationsInitialized=!0)}getIntegrationById(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){hee(e,this._integrations)}sendEvent(e,r={}){if(this._dsn){let n=mft(e,this._dsn,this._options._metadata,this._options.tunnel);for(const a of r.attachments||[])n=Aut(n,Cut(a,this._options.transportOptions&&this._options.transportOptions.textEncoder));const i=this._sendEnvelope(n);i&&i.then(a=>this.emit("afterSendEvent",e,a),null)}}sendSession(e){if(this._dsn){const r=pft(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(r)}}recordDroppedEvent(e,r,n){if(this._options.sendClientReports){const i=`${e}:${r}`;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.log(`Adding outcome: "${i}"`),this._outcomes[i]=this._outcomes[i]+1||1}}on(e,r){this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(r)}emit(e,...r){this._hooks[e]&&this._hooks[e].forEach(n=>n(...r))}_updateSessionFromEvent(e,r){let n=!1,i=!1;const a=r.exception&&r.exception.values;if(a){i=!0;for(const c of a){const l=c.mechanism;if(l&&l.handled===!1){n=!0;break}}}const s=e.status==="ok";(s&&e.errors===0||s&&n)&&(Mf(e,{...n&&{status:"crashed"},errors:e.errors||Number(i||n)}),this.captureSession(e))}_isClientDoneProcessing(e){return new wr(r=>{let n=0;const i=1,a=setInterval(()=>{this._numProcessing==0?(clearInterval(a),r(!0)):(n+=i,e&&n>=e&&(clearInterval(a),r(!1)))},i)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._dsn!==void 0}_prepareEvent(e,r,n){const i=this.getOptions(),a=Object.keys(this._integrations);return!r.integrations&&a.length>0&&(r.integrations=a),bft(i,e,r,n)}_captureEvent(e,r={},n){return this._processEvent(e,r,n).then(i=>i.event_id,i=>{if(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__){const a=i;a.logLevel==="log"?J.log(a.message):J.warn(a)}})}_processEvent(e,r,n){const i=this.getOptions(),{sampleRate:a}=i;if(!this._isEnabled())return q1(new mr("SDK not enabled, will not capture event.","log"));const s=mee(e),o=pee(e),c=e.type||"error",l=`before send for type \`${c}\``;if(o&&typeof a=="number"&&Math.random()>a)return this.recordDroppedEvent("sample_rate","error",e),q1(new mr(`Discarding event because it's not included in the random sample (sampling rate = ${a})`,"log"));const u=c==="replay_event"?"replay":c;return this._prepareEvent(e,r,n).then(f=>{if(f===null)throw this.recordDroppedEvent("event_processor",u,e),new mr("An event processor returned `null`, will not send event.","log");if(r.data&&r.data.__sentry__===!0)return f;const h=Rft(i,f,r);return Tft(h,l)}).then(f=>{if(f===null)throw this.recordDroppedEvent("before_send",u,e),new mr(`${l} returned \`null\`, will not send event.`,"log");const d=n&&n.getSession();!s&&d&&this._updateSessionFromEvent(d,f);const h=f.transaction_info;if(s&&h&&f.transaction!==e.transaction){const p="custom";f.transaction_info={...h,source:p}}return this.sendEvent(f,r),f}).then(null,f=>{throw f instanceof mr?f:(this.captureException(f,{data:{__sentry__:!0},originalException:f}),new mr(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event. +Reason: ${f}`))})}_process(e){this._numProcessing++,e.then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r))}_sendEnvelope(e){if(this._transport&&this._dsn)return this.emit("beforeEnvelope",e),this._transport.send(e).then(null,r=>{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.error("Error while sending event:",r)});(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.error("Transport disabled")}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.keys(e).map(r=>{const[n,i]=r.split(":");return{reason:n,category:i,quantity:e[r]}})}}function Tft(t,e){const r=`${e} must return \`null\` or a valid event.`;if(pL(t))return t.then(n=>{if(!Pf(n)&&n!==null)throw new mr(r);return n},n=>{throw new mr(`${e} rejected with ${n}`)});if(!Pf(t)&&t!==null)throw new mr(r);return t}function Rft(t,e,r){const{beforeSend:n,beforeSendTransaction:i}=t;return pee(e)&&n?n(e,r):mee(e)&&i?i(e,r):e}function pee(t){return t.type===void 0}function mee(t){return t.type==="transaction"}function Aft(t,e){e.debug===!0&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?J.enable():console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle."));const r=dt();r.getScope().update(e.initialScope);const i=new t(e);r.bindClient(i)}const Ift=30;function gee(t,e,r=Eut(t.bufferSize||Ift)){let n={};const i=s=>r.drain(s);function a(s){const o=[];if(P7(s,(f,d)=>{const h=N7(d);if(Mut(n,h)){const p=z7(f,d);t.recordDroppedEvent("ratelimit_backoff",h,p)}else o.push(f)}),o.length===0)return lc();const c=Im(s[0],o),l=f=>{P7(c,(d,h)=>{const p=z7(d,h);t.recordDroppedEvent(f,N7(h),p)})},u=()=>e({body:Iut(c,t.textEncoder)}).then(f=>(f.statusCode!==void 0&&(f.statusCode<200||f.statusCode>=300)&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.warn(`Sentry responded with status code ${f.statusCode} to sent event.`),n=Fut(n,f),f),f=>{throw l("network_error"),f});return r.add(u).then(f=>f,f=>{if(f instanceof mr)return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.error("Skipped sending event because buffer is full."),l("queue_overflow"),lc();throw f})}return a.__sentry__baseTransport__=!0,{send:a,flush:i}}function z7(t,e){if(!(e!=="event"&&e!=="transaction"))return Array.isArray(t)?t[1]:void 0}const X1="7.49.0";let G7;class gp{constructor(){gp.prototype.__init.call(this)}static __initStatic(){this.id="FunctionToString"}__init(){this.name=gp.id}setupOnce(){G7=Function.prototype.toString,Function.prototype.toString=function(...e){const r=vL(this)||this;return G7.apply(r,e)}}}gp.__initStatic();const $ft=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/];class nf{static __initStatic(){this.id="InboundFilters"}__init(){this.name=nf.id}constructor(e={}){this._options=e,nf.prototype.__init.call(this)}setupOnce(e,r){const n=i=>{const a=r();if(a){const s=a.getIntegration(nf);if(s){const o=a.getClient(),c=o?o.getOptions():{},l=Cft(s._options,c);return kft(i,l)?null:i}}return i};n.id=this.name,e(n)}}nf.__initStatic();function Cft(t={},e={}){return{allowUrls:[...t.allowUrls||[],...e.allowUrls||[]],denyUrls:[...t.denyUrls||[],...e.denyUrls||[]],ignoreErrors:[...t.ignoreErrors||[],...e.ignoreErrors||[],...$ft],ignoreTransactions:[...t.ignoreTransactions||[],...e.ignoreTransactions||[]],ignoreInternal:t.ignoreInternal!==void 0?t.ignoreInternal:!0}}function kft(t,e){return e.ignoreInternal&&Mft(t)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.warn(`Event dropped due to being internal Sentry Error. +Event: ${Ys(t)}`),!0):Oft(t,e.ignoreErrors)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.warn(`Event dropped due to being matched by \`ignoreErrors\` option. +Event: ${Ys(t)}`),!0):Lft(t,e.ignoreTransactions)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.warn(`Event dropped due to being matched by \`ignoreTransactions\` option. +Event: ${Ys(t)}`),!0):Pft(t,e.denyUrls)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.warn(`Event dropped due to being matched by \`denyUrls\` option. +Event: ${Ys(t)}. +Url: ${Q1(t)}`),!0):Nft(t,e.allowUrls)?!1:((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.warn(`Event dropped due to not being matched by \`allowUrls\` option. +Event: ${Ys(t)}. +Url: ${Q1(t)}`),!0)}function Oft(t,e){return t.type||!e||!e.length?!1:Dft(t).some(r=>Am(r,e))}function Lft(t,e){if(t.type!=="transaction"||!e||!e.length)return!1;const r=t.transaction;return r?Am(r,e):!1}function Pft(t,e){if(!e||!e.length)return!1;const r=Q1(t);return r?Am(r,e):!1}function Nft(t,e){if(!e||!e.length)return!0;const r=Q1(t);return r?Am(r,e):!0}function Dft(t){if(t.message)return[t.message];if(t.exception)try{const{type:e="",value:r=""}=t.exception.values&&t.exception.values[0]||{};return[`${r}`,`${e}: ${r}`]}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.error(`Cannot extract message for event ${Ys(t)}`),[]}return[]}function Mft(t){try{return t.exception.values[0].type==="SentryError"}catch{}return!1}function Fft(t=[]){for(let e=t.length-1;e>=0;e--){const r=t[e];if(r&&r.filename!==""&&r.filename!=="[native code]")return r.filename||null}return null}function Q1(t){try{let e;try{e=t.exception.values[0].stacktrace.frames}catch{}return e?Fft(e):null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.error(`Cannot extract url for event ${Ys(t)}`),null}}const Ze=Vt;let PI=0;function vee(){return PI>0}function Bft(){PI++,setTimeout(()=>{PI--})}function Ff(t,e={},r){if(typeof t!="function")return t;try{const i=t.__sentry_wrapped__;if(i)return i;if(vL(t))return t}catch{return t}const n=function(){const i=Array.prototype.slice.call(arguments);try{r&&typeof r=="function"&&r.apply(this,arguments);const a=i.map(s=>Ff(s,e));return t.apply(this,a)}catch(a){throw Bft(),oft(s=>{s.addEventProcessor(o=>(e.mechanism&&(AI(o,void 0,void 0),Df(o,e.mechanism)),o.extra={...o.extra,arguments:i},o)),sft(a)}),a}};try{for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}catch{}YJ(n,t),gL(t,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get(){return t.name}})}catch{}return n}function yee(t,e){const r=EL(t,e),n={type:e&&e.name,value:zft(e)};return r.length&&(n.stacktrace={frames:r}),n.type===void 0&&n.value===""&&(n.value="Unrecoverable error caught"),n}function Uft(t,e,r,n){const a=dt().getClient(),s=a&&a.getOptions().normalizeDepth,o={exception:{values:[{type:hL(e)?e.constructor.name:n?"UnhandledRejection":"Error",value:`Non-Error ${n?"promise rejection":"exception"} captured with keys: ${Xct(e)}`}]},extra:{__serialized__:ree(e,s)}};if(r){const c=EL(t,r);c.length&&(o.exception.values[0].stacktrace={frames:c})}return o}function r2(t,e){return{exception:{values:[yee(t,e)]}}}function EL(t,e){const r=e.stacktrace||e.stack||"",n=Hft(e);try{return t(r,n)}catch{}return[]}const jft=/Minified React error #\d+;/i;function Hft(t){if(t){if(typeof t.framesToPop=="number")return t.framesToPop;if(jft.test(t.message))return 1}return 0}function zft(t){const e=t&&t.message;return e?e.error&&typeof e.error.message=="string"?e.error.message:e:"No error message"}function Gft(t,e,r,n){const i=r&&r.syntheticException||void 0,a=SL(t,e,i,n);return Df(a),a.level="error",r&&r.event_id&&(a.event_id=r.event_id),lc(a)}function Vft(t,e,r="info",n,i){const a=n&&n.syntheticException||void 0,s=NI(t,e,a,i);return s.level=r,n&&n.event_id&&(s.event_id=n.event_id),lc(s)}function SL(t,e,r,n,i){let a;if(zJ(e)&&e.error)return r2(t,e.error);if(w7(e)||Pct(e)){const s=e;if("stack"in e)a=r2(t,e);else{const o=s.name||(w7(s)?"DOMError":"DOMException"),c=s.message?`${o}: ${s.message}`:o;a=NI(t,c,r,n),AI(a,c)}return"code"in s&&(a.tags={...a.tags,"DOMException.code":`${s.code}`}),a}return HJ(e)?r2(t,e):Pf(e)||hL(e)?(a=Uft(t,e,r,i),Df(a,{synthetic:!0}),a):(a=NI(t,e,r,n),AI(a,`${e}`,void 0),Df(a,{synthetic:!0}),a)}function NI(t,e,r,n){const i={message:e};if(n&&r){const a=EL(t,r);a.length&&(i.exception={values:[{value:e,stacktrace:{frames:a}}]})}return i}const vv=1024,xee="Breadcrumbs";class vp{static __initStatic(){this.id=xee}__init(){this.name=vp.id}constructor(e){vp.prototype.__init.call(this),this.options={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e}}setupOnce(){this.options.console&&Rr("console",Kft),this.options.dom&&Rr("dom",Wft(this.options.dom)),this.options.xhr&&Rr("xhr",Yft),this.options.fetch&&Rr("fetch",qft),this.options.history&&Rr("history",Xft)}addSentryBreadcrumb(e){this.options.sentry&&dt().addBreadcrumb({category:`sentry.${e.type==="transaction"?"transaction":"event"}`,event_id:e.event_id,level:e.level,message:Ys(e)},{event:e})}}vp.__initStatic();function Wft(t){function e(r){let n,i=typeof t=="object"?t.serializeAttribute:void 0,a=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;a&&a>vv&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.warn(`\`dom.maxStringLength\` cannot exceed ${vv}, but a value of ${a} was configured. Sentry will use ${vv} instead.`),a=vv),typeof i=="string"&&(i=[i]);try{const s=r.event;n=Qft(s)?Nf(s.target,{keyAttrs:i,maxStringLength:a}):Nf(s,{keyAttrs:i,maxStringLength:a})}catch{n=""}n.length!==0&&dt().addBreadcrumb({category:`ui.${r.name}`,message:n},{event:r.event,name:r.name,global:r.global})}return e}function Kft(t){for(let r=0;r{Ze.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(e,r){return Gft(this._options.stackParser,e,r,this._options.attachStacktrace)}eventFromMessage(e,r="info",n){return Vft(this._options.stackParser,e,r,n,this._options.attachStacktrace)}sendEvent(e,r){const n=this.getIntegrationById(xee);n&&n.addSentryBreadcrumb&&n.addSentryBreadcrumb(e),super.sendEvent(e,r)}captureUserFeedback(e){if(!this._isEnabled()){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.warn("SDK not enabled, will not capture user feedback.");return}const r=Zft(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this._sendEnvelope(r)}_prepareEvent(e,r,n){return e.platform=e.platform||"javascript",super._prepareEvent(e,r,n)}_flushOutcomes(){const e=this._clearOutcomes();if(e.length===0){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.log("No outcomes to send");return}if(!this._dsn){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.log("No dsn provided, will not send outcomes");return}(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.log("Sending outcomes:",e);const r=Lut(e,this._options.tunnel&&UE(this._dsn));this._sendEnvelope(r)}}let Oh;function tdt(){if(Oh)return Oh;if(TI(Ze.fetch))return Oh=Ze.fetch.bind(Ze);const t=Ze.document;let e=Ze.fetch;if(t&&typeof t.createElement=="function")try{const r=t.createElement("iframe");r.hidden=!0,t.head.appendChild(r);const n=r.contentWindow;n&&n.fetch&&(e=n.fetch),t.head.removeChild(r)}catch(r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",r)}return Oh=e.bind(Ze)}function rdt(){Oh=void 0}function ndt(t,e=tdt()){let r=0,n=0;function i(a){const s=a.body.length;r+=s,n++;const o={body:a.body,method:"POST",referrerPolicy:"origin",headers:t.headers,keepalive:r<=6e4&&n<15,...t.fetchOptions};try{return e(t.url,o).then(c=>(r-=s,n--,{statusCode:c.status,headers:{"x-sentry-rate-limits":c.headers.get("X-Sentry-Rate-Limits"),"retry-after":c.headers.get("Retry-After")}}))}catch(c){return rdt(),r-=s,n--,q1(c)}}return gee(t,i)}const idt=4;function adt(t){function e(r){return new wr((n,i)=>{const a=new XMLHttpRequest;a.onerror=i,a.onreadystatechange=()=>{a.readyState===idt&&n({statusCode:a.status,headers:{"x-sentry-rate-limits":a.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":a.getResponseHeader("Retry-After")}})},a.open("POST",t.url);for(const s in t.headers)Object.prototype.hasOwnProperty.call(t.headers,s)&&a.setRequestHeader(s,t.headers[s]);a.send(r.body)})}return gee(t,e)}const zE="?",sdt=30,odt=40,ldt=50;function _L(t,e,r,n){const i={filename:t,function:e,in_app:!0};return r!==void 0&&(i.lineno=r),n!==void 0&&(i.colno=n),i}const cdt=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,udt=/\((\S*)(?::(\d+))(?::(\d+))\)/,fdt=t=>{const e=cdt.exec(t);if(e){if(e[2]&&e[2].indexOf("eval")===0){const a=udt.exec(e[2]);a&&(e[2]=a[1],e[3]=a[2],e[4]=a[3])}const[n,i]=bee(e[1]||zE,e[2]);return _L(i,n,e[3]?+e[3]:void 0,e[4]?+e[4]:void 0)}},ddt=[sdt,fdt],hdt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,pdt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,mdt=t=>{const e=hdt.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){const a=pdt.exec(e[3]);a&&(e[1]=e[1]||"eval",e[3]=a[1],e[4]=a[2],e[5]="")}let n=e[3],i=e[1]||zE;return[i,n]=bee(i,n),_L(n,i,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},gdt=[ldt,mdt],vdt=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,ydt=t=>{const e=vdt.exec(t);return e?_L(e[2],e[1]||zE,+e[3],e[4]?+e[4]:void 0):void 0},xdt=[odt,ydt],bdt=[ddt,gdt,xdt],Edt=QJ(...bdt),bee=(t,e)=>{const r=t.indexOf("safari-extension")!==-1,n=t.indexOf("safari-web-extension")!==-1;return r||n?[t.indexOf("@")!==-1?t.split("@")[0]:zE,r?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]};class _o{static __initStatic(){this.id="GlobalHandlers"}__init(){this.name=_o.id}__init2(){this._installFunc={onerror:Sdt,onunhandledrejection:_dt}}constructor(e){_o.prototype.__init.call(this),_o.prototype.__init2.call(this),this._options={onerror:!0,onunhandledrejection:!0,...e}}setupOnce(){Error.stackTraceLimit=50;const e=this._options;for(const r in e){const n=this._installFunc[r];n&&e[r]&&(Rdt(r),n(),this._installFunc[r]=void 0)}}}_o.__initStatic();function Sdt(){Rr("error",t=>{const[e,r,n]=_ee();if(!e.getIntegration(_o))return;const{msg:i,url:a,line:s,column:o,error:c}=t;if(vee()||c&&c.__sentry_own_request__)return;const l=c===void 0&&Fo(i)?Tdt(i,a,s,o):Eee(SL(r,c||i,void 0,n,!1),a,s,o);l.level="error",See(e,c,l,"onerror")})}function _dt(){Rr("unhandledrejection",t=>{const[e,r,n]=_ee();if(!e.getIntegration(_o))return;let i=t;try{"reason"in t?i=t.reason:"detail"in t&&"reason"in t.detail&&(i=t.detail.reason)}catch{}if(vee()||i&&i.__sentry_own_request__)return!0;const a=GJ(i)?wdt(i):SL(r,i,void 0,n,!0);a.level="error",See(e,i,a,"onunhandledrejection")})}function wdt(t){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(t)}`}]}}}function Tdt(t,e,r,n){const i=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let a=zJ(t)?t.message:t,s="Error";const o=a.match(i);return o&&(s=o[1],a=o[2]),Eee({exception:{values:[{type:s,value:a}]}},e,r,n)}function Eee(t,e,r,n){const i=t.exception=t.exception||{},a=i.values=i.values||[],s=a[0]=a[0]||{},o=s.stacktrace=s.stacktrace||{},c=o.frames=o.frames||[],l=isNaN(parseInt(n,10))?void 0:n,u=isNaN(parseInt(r,10))?void 0:r,f=Fo(e)&&e.length>0?e:Uct();return c.length===0&&c.push({colno:l,filename:f,function:"?",in_app:!0,lineno:u}),t}function Rdt(t){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.log(`Global Handler attached: ${t}`)}function See(t,e,r,n){Df(r,{handled:!1,type:n}),t.captureEvent(r,{originalException:e})}function _ee(){const t=dt(),e=t.getClient(),r=e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1};return[t,r.stackParser,r.attachStacktrace]}const Adt=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"];class yp{static __initStatic(){this.id="TryCatch"}__init(){this.name=yp.id}constructor(e){yp.prototype.__init.call(this),this._options={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e}}setupOnce(){this._options.setTimeout&&Wt(Ze,"setTimeout",V7),this._options.setInterval&&Wt(Ze,"setInterval",V7),this._options.requestAnimationFrame&&Wt(Ze,"requestAnimationFrame",Idt),this._options.XMLHttpRequest&&"XMLHttpRequest"in Ze&&Wt(XMLHttpRequest.prototype,"send",$dt);const e=this._options.eventTarget;e&&(Array.isArray(e)?e:Adt).forEach(Cdt)}}yp.__initStatic();function V7(t){return function(...e){const r=e[0];return e[0]=Ff(r,{mechanism:{data:{function:Uo(t)},handled:!0,type:"instrument"}}),t.apply(this,e)}}function Idt(t){return function(e){return t.apply(this,[Ff(e,{mechanism:{data:{function:"requestAnimationFrame",handler:Uo(t)},handled:!0,type:"instrument"}})])}}function $dt(t){return function(...e){const r=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(i=>{i in r&&typeof r[i]=="function"&&Wt(r,i,function(a){const s={mechanism:{data:{function:i,handler:Uo(a)},handled:!0,type:"instrument"}},o=vL(a);return o&&(s.mechanism.data.handler=Uo(o)),Ff(a,s)})}),t.apply(this,e)}}function Cdt(t){const e=Ze,r=e[t]&&e[t].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(Wt(r,"addEventListener",function(n){return function(i,a,s){try{typeof a.handleEvent=="function"&&(a.handleEvent=Ff(a.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Uo(a),target:t},handled:!0,type:"instrument"}}))}catch{}return n.apply(this,[i,Ff(a,{mechanism:{data:{function:"addEventListener",handler:Uo(a),target:t},handled:!0,type:"instrument"}}),s])}}),Wt(r,"removeEventListener",function(n){return function(i,a,s){const o=a;try{const c=o&&o.__sentry_wrapped__;c&&n.call(this,i,c,s)}catch{}return n.call(this,i,o,s)}}))}const kdt="cause",Odt=5;class af{static __initStatic(){this.id="LinkedErrors"}__init(){this.name=af.id}constructor(e={}){af.prototype.__init.call(this),this._key=e.key||kdt,this._limit=e.limit||Odt}setupOnce(){const e=dt().getClient();e&&xL((r,n)=>{const i=dt().getIntegration(af);return i?Ldt(e.getOptions().stackParser,i._key,i._limit,r,n):r})}}af.__initStatic();function Ldt(t,e,r,n,i){if(!n.exception||!n.exception.values||!i||!Bo(i.originalException,Error))return n;const a=wee(t,r,i.originalException,e);return n.exception.values=[...a,...n.exception.values],n}function wee(t,e,r,n,i=[]){if(!Bo(r[n],Error)||i.length+1>=e)return i;const a=yee(t,r[n]);return wee(t,e,r[n],n,[a,...i])}class sf{constructor(){sf.prototype.__init.call(this)}static __initStatic(){this.id="HttpContext"}__init(){this.name=sf.id}setupOnce(){xL(e=>{if(dt().getIntegration(sf)){if(!Ze.navigator&&!Ze.location&&!Ze.document)return e;const r=e.request&&e.request.url||Ze.location&&Ze.location.href,{referrer:n}=Ze.document||{},{userAgent:i}=Ze.navigator||{},a={...e.request&&e.request.headers,...n&&{Referer:n},...i&&{"User-Agent":i}},s={...e.request,...r&&{url:r},headers:a};return{...e,request:s}}return e})}}sf.__initStatic();class of{constructor(){of.prototype.__init.call(this)}static __initStatic(){this.id="Dedupe"}__init(){this.name=of.id}setupOnce(e,r){const n=i=>{if(i.type)return i;const a=r().getIntegration(of);if(a){try{if(Pdt(i,a._previousEvent))return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{return a._previousEvent=i}return a._previousEvent=i}return i};n.id=this.name,e(n)}}of.__initStatic();function Pdt(t,e){return e?!!(Ndt(t,e)||Ddt(t,e)):!1}function Ndt(t,e){const r=t.message,n=e.message;return!(!r&&!n||r&&!n||!r&&n||r!==n||!Ree(t,e)||!Tee(t,e))}function Ddt(t,e){const r=W7(e),n=W7(t);return!(!r||!n||r.type!==n.type||r.value!==n.value||!Ree(t,e)||!Tee(t,e))}function Tee(t,e){let r=K7(t),n=K7(e);if(!r&&!n)return!0;if(r&&!n||!r&&n||(r=r,n=n,n.length!==r.length))return!1;for(let i=0;i"u"){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.warn("Session tracking in non-browser environment with @sentry/browser is not supported.");return}const t=dt();t.captureSession&&(Y7(t),Rr("history",({from:e,to:r})=>{e===void 0||e===r||Y7(dt())}))}const Je=Vt;function Udt(){Je&&Je.document?Je.document.addEventListener("visibilitychange",()=>{const t=Cm();if(Je.document.hidden&&t){const e="cancelled";(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.log(`[Tracing] Transaction: ${e} -> since tab moved to the background, op: ${t.op}`),t.status||t.setStatus(e),t.setTag("visibilitychange","document.hidden"),t.finish()}}):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const wL=(t,e,r)=>{let n,i;return a=>{e.value>=0&&(a||r)&&(i=e.value-(n||0),(i||n===void 0)&&(n=e.value,e.delta=i,t(e)))}},jdt=()=>`v3-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,Hdt=()=>{const t=Je.performance.timing,e=Je.performance.navigation.type,r={entryType:"navigation",startTime:0,type:e==2?"back_forward":e===1?"reload":"navigate"};for(const n in t)n!=="navigationStart"&&n!=="toJSON"&&(r[n]=Math.max(t[n]-t.navigationStart,0));return r},Aee=()=>Je.__WEB_VITALS_POLYFILL__?Je.performance&&(performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]||Hdt()):Je.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0],Iee=()=>{const t=Aee();return t&&t.activationStart||0},TL=(t,e)=>{const r=Aee();let n="navigate";return r&&(Je.document.prerendering||Iee()>0?n="prerender":n=r.type.replace(/_/g,"-")),{name:t,value:typeof e>"u"?-1:e,rating:"good",delta:0,entries:[],id:jdt(),navigationType:n}},km=(t,e,r)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){const n=new PerformanceObserver(i=>{e(i.getEntries())});return n.observe(Object.assign({type:t,buffered:!0},r||{})),n}}catch{}},GE=(t,e)=>{const r=n=>{(n.type==="pagehide"||Je.document.visibilityState==="hidden")&&(t(n),e&&(removeEventListener("visibilitychange",r,!0),removeEventListener("pagehide",r,!0)))};addEventListener("visibilitychange",r,!0),addEventListener("pagehide",r,!0)},zdt=t=>{const e=TL("CLS",0);let r,n=0,i=[];const a=o=>{o.forEach(c=>{if(!c.hadRecentInput){const l=i[0],u=i[i.length-1];n&&i.length!==0&&c.startTime-u.startTime<1e3&&c.startTime-l.startTime<5e3?(n+=c.value,i.push(c)):(n=c.value,i=[c]),n>e.value&&(e.value=n,e.entries=i,r&&r())}})},s=km("layout-shift",a);if(s){r=wL(t,e);const o=()=>{a(s.takeRecords()),r(!0)};return GE(o),o}};let uy=-1;const Gdt=()=>Je.document.visibilityState==="hidden"&&!Je.document.prerendering?0:1/0,Vdt=()=>{GE(({timeStamp:t})=>{uy=t},!0)},RL=()=>(uy<0&&(uy=Gdt(),Vdt()),{get firstHiddenTime(){return uy}}),Wdt=t=>{const e=RL(),r=TL("FID");let n;const i=o=>{o.startTime{o.forEach(i)},s=km("first-input",a);n=wL(t,r),s&&GE(()=>{a(s.takeRecords()),s.disconnect()},!0)},q7={},Kdt=t=>{const e=RL(),r=TL("LCP");let n;const i=s=>{const o=s[s.length-1];if(o){const c=Math.max(o.startTime-Iee(),0);c{q7[r.id]||(i(a.takeRecords()),a.disconnect(),q7[r.id]=!0,n(!0))};return["keydown","click"].forEach(o=>{addEventListener(o,s,{once:!0,capture:!0})}),GE(s,!0),s}};function n2(t){return typeof t=="number"&&isFinite(t)}function Bf(t,{startTimestamp:e,...r}){return e&&t.startTimestamp>e&&(t.startTimestamp=e),t.startChild({startTimestamp:e,...r})}function Ot(t){return t/1e3}function $ee(){return Je&&Je.addEventListener&&Je.performance}let X7=0,bt={},Qi,p0;function Ydt(){const t=$ee();if(t&&jo){t.mark&&Je.performance.mark("sentry-tracing-init"),Jdt();const e=Qdt(),r=Zdt();return()=>{e&&e(),r&&r()}}return()=>{}}function qdt(){km("longtask",e=>{for(const r of e){const n=Cm();if(!n)return;const i=Ot(jo+r.startTime),a=Ot(r.duration);n.startChild({description:"Main UI thread blocked",op:"ui.long-task",startTimestamp:i,endTimestamp:i+a})}})}function Xdt(){km("event",e=>{for(const r of e){const n=Cm();if(!n)return;if(r.name==="click"){const i=Ot(jo+r.startTime),a=Ot(r.duration);n.startChild({description:Nf(r.target),op:`ui.interaction.${r.name}`,startTimestamp:i,endTimestamp:i+a})}}},{durationThreshold:0})}function Qdt(){return zdt(t=>{const e=t.entries.pop();e&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.log("[Measurements] Adding CLS"),bt.cls={value:t.value,unit:""},p0=e)})}function Zdt(){return Kdt(t=>{const e=t.entries.pop();e&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.log("[Measurements] Adding LCP"),bt.lcp={value:t.value,unit:"millisecond"},Qi=e)})}function Jdt(){Wdt(t=>{const e=t.entries.pop();if(!e)return;const r=Ot(jo),n=Ot(e.startTime);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.log("[Measurements] Adding FID"),bt.fid={value:t.value,unit:"millisecond"},bt["mark.fid"]={value:r+n,unit:"second"}})}function eht(t){const e=$ee();if(!e||!Je.performance.getEntries||!jo)return;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.log("[Tracing] Adding & adjusting spans using Performance API");const r=Ot(jo),n=e.getEntries();let i,a;if(n.slice(X7).forEach(s=>{const o=Ot(s.startTime),c=Ot(s.duration);if(!(t.op==="navigation"&&r+o"u"||__SENTRY_DEBUG__)&&J.log("[Measurements] Adding FP"),bt.fp={value:s.startTime,unit:"millisecond"}),s.name==="first-contentful-paint"&&u&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.log("[Measurements] Adding FCP"),bt.fcp={value:s.startTime,unit:"millisecond"});break}case"resource":{const l=s.name.replace(Je.location.origin,"");iht(t,s,l,o,c,r);break}}}),X7=Math.max(n.length-1,0),aht(t),t.op==="pageload"){typeof i=="number"&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.log("[Measurements] Adding TTFB"),bt.ttfb={value:(i-t.startTimestamp)*1e3,unit:"millisecond"},typeof a=="number"&&a<=i&&(bt["ttfb.requestTime"]={value:(i-a)*1e3,unit:"millisecond"})),["fcp","fp","lcp"].forEach(o=>{if(!bt[o]||r>=t.startTimestamp)return;const c=bt[o].value,l=r+Ot(c),u=Math.abs((l-t.startTimestamp)*1e3),f=u-c;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.log(`[Measurements] Normalized ${o} from ${c} to ${u} (${f})`),bt[o].value=u});const s=bt["mark.fid"];s&&bt.fid&&(Bf(t,{description:"first input delay",endTimestamp:s.value+Ot(bt.fid.value),op:"ui.action",startTimestamp:s.value}),delete bt["mark.fid"]),"fcp"in bt||delete bt.cls,Object.keys(bt).forEach(o=>{t.setMeasurement(o,bt[o].value,bt[o].unit)}),sht(t)}Qi=void 0,p0=void 0,bt={}}function tht(t,e,r,n,i){const a=i+r,s=a+n;return Bf(t,{description:e.name,endTimestamp:s,op:e.entryType,startTimestamp:a}),a}function rht(t,e,r){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(n=>{yv(t,e,n,r)}),yv(t,e,"secureConnection",r,"TLS/SSL","connectEnd"),yv(t,e,"fetch",r,"cache","domainLookupStart"),yv(t,e,"domainLookup",r,"DNS"),nht(t,e,r)}function yv(t,e,r,n,i,a){const s=a?e[a]:e[`${r}End`],o=e[`${r}Start`];!o||!s||Bf(t,{op:"browser",description:i||r,startTimestamp:n+Ot(o),endTimestamp:n+Ot(s)})}function nht(t,e,r){Bf(t,{op:"browser",description:"request",startTimestamp:r+Ot(e.requestStart),endTimestamp:r+Ot(e.responseEnd)}),Bf(t,{op:"browser",description:"response",startTimestamp:r+Ot(e.responseStart),endTimestamp:r+Ot(e.responseEnd)})}function iht(t,e,r,n,i,a){if(e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch")return;const s={};"transferSize"in e&&(s["Transfer Size"]=e.transferSize),"encodedBodySize"in e&&(s["Encoded Body Size"]=e.encodedBodySize),"decodedBodySize"in e&&(s["Decoded Body Size"]=e.decodedBodySize),"renderBlockingStatus"in e&&(s["resource.render_blocking_status"]=e.renderBlockingStatus);const o=a+n,c=o+i;Bf(t,{description:r,endTimestamp:c,op:e.initiatorType?`resource.${e.initiatorType}`:"resource.other",startTimestamp:o,data:s})}function aht(t){const e=Je.navigator;if(!e)return;const r=e.connection;r&&(r.effectiveType&&t.setTag("effectiveConnectionType",r.effectiveType),r.type&&t.setTag("connectionType",r.type),n2(r.rtt)&&(bt["connection.rtt"]={value:r.rtt,unit:"millisecond"})),n2(e.deviceMemory)&&t.setTag("deviceMemory",`${e.deviceMemory} GB`),n2(e.hardwareConcurrency)&&t.setTag("hardwareConcurrency",String(e.hardwareConcurrency))}function sht(t){Qi&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.log("[Measurements] Adding LCP Data"),Qi.element&&t.setTag("lcp.element",Nf(Qi.element)),Qi.id&&t.setTag("lcp.id",Qi.id),Qi.url&&t.setTag("lcp.url",Qi.url.trim().slice(0,200)),t.setTag("lcp.size",Qi.size)),p0&&p0.sources&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.log("[Measurements] Adding CLS Data"),p0.sources.forEach((e,r)=>t.setTag(`cls.source.${r+1}`,Nf(e.node))))}const DI=["localhost",/^\//],MI={traceFetch:!0,traceXHR:!0,tracingOrigins:DI,tracePropagationTargets:DI};function oht(t){const{traceFetch:e,traceXHR:r,tracePropagationTargets:n,tracingOrigins:i,shouldCreateSpanForRequest:a}={traceFetch:MI.traceFetch,traceXHR:MI.traceXHR,...t},s=typeof a=="function"?a:l=>!0,o=l=>lht(l,n||i),c={};e&&Rr("fetch",l=>{cht(l,s,o,c)}),r&&Rr("xhr",l=>{fht(l,s,o,c)})}function lht(t,e){return Am(t,e||DI)}function cht(t,e,r,n){if(!bL()||!(t.fetchData&&e(t.fetchData.url)))return;if(t.endTimestamp){const o=t.fetchData.__span;if(!o)return;const c=n[o];c&&(t.response?c.setHttpStatus(t.response.status):t.error&&c.setStatus("internal_error"),c.finish(),delete n[o]);return}const i=dt().getScope(),a=i&&i.getSpan(),s=a&&a.transaction;if(a&&s){const o=a.startChild({data:{...t.fetchData,type:"fetch"},description:`${t.fetchData.method} ${t.fetchData.url}`,op:"http.client"});t.fetchData.__span=o.spanId,n[o.spanId]=o;const c=t.args[0];t.args[1]=t.args[1]||{};const l=t.args[1];r(t.fetchData.url)&&(l.headers=uht(c,s.getDynamicSamplingContext(),o,l))}}function uht(t,e,r,n){const i=oee(e),a=r.toTraceparent(),s=typeof Request<"u"&&Bo(t,Request)?t.headers:n.headers;if(s)if(typeof Headers<"u"&&Bo(s,Headers)){const o=new Headers(s);return o.append("sentry-trace",a),i&&o.append(kI,i),o}else if(Array.isArray(s)){const o=[...s,["sentry-trace",a]];return i&&o.push([kI,i]),o}else{const o="baggage"in s?s.baggage:void 0,c=[];return Array.isArray(o)?c.push(...o):o&&c.push(o),i&&c.push(i),{...s,"sentry-trace":a,baggage:c.length>0?c.join(","):void 0}}else return{"sentry-trace":a,baggage:i}}function fht(t,e,r,n){const i=t.xhr,a=i&&i[Nl];if(!bL()||i&&i.__sentry_own_request__||!(i&&a&&e(a.url)))return;if(t.endTimestamp){const l=i.__sentry_xhr_span_id__;if(!l)return;const u=n[l];u&&(u.setHttpStatus(a.status_code),u.finish(),delete n[l]);return}const s=dt().getScope(),o=s&&s.getSpan(),c=o&&o.transaction;if(o&&c){const l=o.startChild({data:{...a.data,type:"xhr",method:a.method,url:a.url},description:`${a.method} ${a.url}`,op:"http.client"});if(i.__sentry_xhr_span_id__=l.spanId,n[i.__sentry_xhr_span_id__]=l,i.setRequestHeader&&r(a.url))try{i.setRequestHeader("sentry-trace",l.toTraceparent());const u=c.getDynamicSamplingContext(),f=oee(u);f&&i.setRequestHeader(kI,f)}catch{}}}function dht(t,e=!0,r=!0){if(!Je||!Je.location){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.warn("Could not initialize routing instrumentation due to invalid location");return}let n=Je.location.href,i;e&&(i=t({name:Je.location.pathname,startTimestamp:jo?jo/1e3:void 0,op:"pageload",metadata:{source:"url"}})),r&&Rr("history",({to:a,from:s})=>{if(s===void 0&&n&&n.indexOf(a)!==-1){n=void 0;return}s!==a&&(n=void 0,i&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.log(`[Tracing] Finishing current transaction with op: ${i.op}`),i.finish()),i=t({name:Je.location.pathname,op:"navigation",metadata:{source:"url"}}))})}const hht="BrowserTracing",pht={...cy,markBackgroundTransactions:!0,routingInstrumentation:dht,startTransactionOnLocationChange:!0,startTransactionOnPageLoad:!0,enableLongTask:!0,_experiments:{},...MI};class AL{__init(){this.name=hht}constructor(e){AL.prototype.__init.call(this),aft(),this.options={...pht,...e},this.options._experiments.enableLongTask!==void 0&&(this.options.enableLongTask=this.options._experiments.enableLongTask),e&&!e.tracePropagationTargets&&e.tracingOrigins&&(this.options.tracePropagationTargets=e.tracingOrigins),this._collectWebVitals=Ydt(),this.options.enableLongTask&&qdt(),this.options._experiments.enableInteractions&&Xdt()}setupOnce(e,r){this._getCurrentHub=r;const{routingInstrumentation:n,startTransactionOnLocationChange:i,startTransactionOnPageLoad:a,markBackgroundTransactions:s,traceFetch:o,traceXHR:c,tracePropagationTargets:l,shouldCreateSpanForRequest:u,_experiments:f}=this.options;n(d=>{const h=this._createRouteTransaction(d);return this.options._experiments.onStartRouteTransaction&&this.options._experiments.onStartRouteTransaction(h,d,r),h},a,i),s&&Udt(),f.enableInteractions&&this._registerInteractionListener(),oht({traceFetch:o,traceXHR:c,tracePropagationTargets:l,shouldCreateSpanForRequest:u})}_createRouteTransaction(e){if(!this._getCurrentHub){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.warn(`[Tracing] Did not create ${e.op} transaction because _getCurrentHub is invalid.`);return}const{beforeNavigate:r,idleTimeout:n,finalTimeout:i,heartbeatInterval:a}=this.options,s=e.op==="pageload",o=s?Q7("sentry-trace"):null,c=s?Q7("baggage"):null,l=o?Rut(o):void 0,u=c?jut(c):void 0,f={...e,...l,metadata:{...e.metadata,dynamicSamplingContext:l&&!u?{}:u},trimEnd:!0},d=typeof r=="function"?r(f):f,h=d===void 0?{...f,sampled:!1}:d;h.metadata=h.name!==f.name?{...h.metadata,source:"custom"}:h.metadata,this._latestRouteName=h.name,this._latestRouteSource=h.metadata&&h.metadata.source,h.sampled===!1&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.log(`[Tracing] Will not send ${h.op} transaction because of beforeNavigate.`),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.log(`[Tracing] Starting ${h.op} transaction on scope`);const p=this._getCurrentHub(),{location:v}=Je,m=B7(p,h,n,i,!0,{location:v},a);return m.registerBeforeFinishCallback(g=>{this._collectWebVitals(),eht(g)}),m}_registerInteractionListener(){let e;const r=()=>{const{idleTimeout:n,finalTimeout:i,heartbeatInterval:a}=this.options,s="ui.action.click",o=Cm();if(o&&o.op&&["navigation","pageload"].includes(o.op)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.warn(`[Tracing] Did not create ${s} transaction because a pageload or navigation transaction is in progress.`);return}if(e&&(e.setFinishReason("interactionInterrupted"),e.finish(),e=void 0),!this._getCurrentHub){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.warn(`[Tracing] Did not create ${s} transaction because _getCurrentHub is invalid.`);return}if(!this._latestRouteName){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&J.warn(`[Tracing] Did not create ${s} transaction because _latestRouteName is missing.`);return}const c=this._getCurrentHub(),{location:l}=Je,u={name:this._latestRouteName,op:s,trimEnd:!0,metadata:{source:this._latestRouteSource||"url"}};e=B7(c,u,n,i,!0,{location:l},a)};["click"].forEach(n=>{addEventListener(n,r,{once:!1,capture:!0})})}}function Q7(t){const e=jct(`meta[name=${t}]`);return e?e.getAttribute("content"):null}function mht(t){t._metadata=t._metadata||{},t._metadata.sdk=t._metadata.sdk||{name:"sentry.javascript.react",packages:[{name:"npm:@sentry/react",version:X1}],version:X1},Fdt(t)}mht({dsn:NMe,release:`movie-web@${Er().APP_VERSION}`,sampleRate:.5,integrations:[new AL,new Dl,new mp]});var Lr=(t=>(t.M4UFREE="m4ufree",t.STREAMM4U="streamm4u",t.PLAYM4U="playm4u",t.UPCLOUD="upcloud",t.STREAMSB="streamsb",t.MP4UPLOAD="mp4upload",t))(Lr||{});const IL="https://flixhq.to";async function ght(t){const e=t.split("/")[0],r=t.split("-"),n=r[r.length-1],i=await ge(`/ajax/${e}/episodes/${n}`,{baseURL:IL});return[...new DOMParser().parseFromString(i,"text/html").querySelectorAll(".nav-item > a")].map(o=>{const c=o.getAttribute("title"),l=o.getAttribute("data-linkid");if(!c||!l)throw new Error("invalid sources");return{embed:c,episodeId:l}})}async function vht(t){return(await ge(`/ajax/sources/${t}`,{baseURL:IL})).link}async function yht(t){const e=await ge(`/search/${t.title.replaceAll(/[^a-z0-9A-Z]/g,"-")}`,{baseURL:IL}),i=[...new DOMParser().parseFromString(e,"text/html").querySelectorAll(".film_list-wrap > div.flw-item")].map(a=>{var l,u,f,d;const s=(u=(l=a.querySelector("div.film-poster > a"))==null?void 0:l.getAttribute("href"))==null?void 0:u.slice(1),o=(f=a.querySelector("div.film-detail > h2 > a"))==null?void 0:f.getAttribute("title"),c=(d=a.querySelector("div.film-detail > div.fd-infor > span:nth-child(1)"))==null?void 0:d.textContent;return!s||!o||!c?null:{id:s,title:o,year:c}}).find(a=>a&&Zk(t.title,a.title)&&t.year===a.year);return i?i.id:null}Fi({id:"flixhq",displayName:"FlixHQ",rank:100,type:[ie.MOVIE,ie.SERIES],async scrape({media:t}){const e=await yht(t.meta);if(!e)throw new Error("flixhq no matching item found");const n=(await ght(e)).find(i=>i.embed.toLowerCase()==="upcloud");if(!n)throw new Error("upcloud stream not found for flixhq");return{embeds:[{type:Lr.UPCLOUD,url:await vht(n.episodeId)}]}}});var xp={},xht={get exports(){return xp},set exports(t){xp=t}},Z1={},bht={get exports(){return Z1},set exports(t){Z1=t}};const Eht={},Sht=Object.freeze(Object.defineProperty({__proto__:null,default:Eht},Symbol.toStringTag,{value:"Module"})),_ht=Uee(Sht);var Z7;function Fe(){return Z7||(Z7=1,function(t,e){(function(r,n){t.exports=n()})(ve,function(){var r=r||function(n,i){var a;if(typeof window<"u"&&window.crypto&&(a=window.crypto),typeof self<"u"&&self.crypto&&(a=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(a=globalThis.crypto),!a&&typeof window<"u"&&window.msCrypto&&(a=window.msCrypto),!a&&typeof ve<"u"&&ve.crypto&&(a=ve.crypto),!a&&typeof zut=="function")try{a=_ht}catch{}var s=function(){if(a){if(typeof a.getRandomValues=="function")try{return a.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof a.randomBytes=="function")try{return a.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function y(){}return function(x){var b;return y.prototype=x,b=new y,y.prototype=null,b}}(),c={},l=c.lib={},u=l.Base=function(){return{extend:function(y){var x=o(this);return y&&x.mixIn(y),(!x.hasOwnProperty("init")||this.init===x.init)&&(x.init=function(){x.$super.init.apply(this,arguments)}),x.init.prototype=x,x.$super=this,x},create:function(){var y=this.extend();return y.init.apply(y,arguments),y},init:function(){},mixIn:function(y){for(var x in y)y.hasOwnProperty(x)&&(this[x]=y[x]);y.hasOwnProperty("toString")&&(this.toString=y.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),f=l.WordArray=u.extend({init:function(y,x){y=this.words=y||[],x!=i?this.sigBytes=x:this.sigBytes=y.length*4},toString:function(y){return(y||h).stringify(this)},concat:function(y){var x=this.words,b=y.words,_=this.sigBytes,S=y.sigBytes;if(this.clamp(),_%4)for(var w=0;w>>2]>>>24-w%4*8&255;x[_+w>>>2]|=R<<24-(_+w)%4*8}else for(var I=0;I>>2]=b[I>>>2];return this.sigBytes+=S,this},clamp:function(){var y=this.words,x=this.sigBytes;y[x>>>2]&=4294967295<<32-x%4*8,y.length=n.ceil(x/4)},clone:function(){var y=u.clone.call(this);return y.words=this.words.slice(0),y},random:function(y){for(var x=[],b=0;b>>2]>>>24-S%4*8&255;_.push((w>>>4).toString(16)),_.push((w&15).toString(16))}return _.join("")},parse:function(y){for(var x=y.length,b=[],_=0;_>>3]|=parseInt(y.substr(_,2),16)<<24-_%8*4;return new f.init(b,x/2)}},p=d.Latin1={stringify:function(y){for(var x=y.words,b=y.sigBytes,_=[],S=0;S>>2]>>>24-S%4*8&255;_.push(String.fromCharCode(w))}return _.join("")},parse:function(y){for(var x=y.length,b=[],_=0;_>>2]|=(y.charCodeAt(_)&255)<<24-_%4*8;return new f.init(b,x)}},v=d.Utf8={stringify:function(y){try{return decodeURIComponent(escape(p.stringify(y)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(y){return p.parse(unescape(encodeURIComponent(y)))}},m=l.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new f.init,this._nDataBytes=0},_append:function(y){typeof y=="string"&&(y=v.parse(y)),this._data.concat(y),this._nDataBytes+=y.sigBytes},_process:function(y){var x,b=this._data,_=b.words,S=b.sigBytes,w=this.blockSize,R=w*4,I=S/R;y?I=n.ceil(I):I=n.max((I|0)-this._minBufferSize,0);var T=I*w,C=n.min(T*4,S);if(T){for(var L=0;L>>2]|=c[f]<<24-f%4*8;s.call(this,u,l)}else s.apply(this,arguments)};o.prototype=a}}(),r.lib.WordArray})}(Tht)),ex}var tx={},Aht={get exports(){return tx},set exports(t){tx=t}},t9;function Iht(){return t9||(t9=1,function(t,e){(function(r,n){t.exports=n(Fe())})(ve,function(r){return function(){var n=r,i=n.lib,a=i.WordArray,s=n.enc;s.Utf16=s.Utf16BE={stringify:function(c){for(var l=c.words,u=c.sigBytes,f=[],d=0;d>>2]>>>16-d%4*8&65535;f.push(String.fromCharCode(h))}return f.join("")},parse:function(c){for(var l=c.length,u=[],f=0;f>>1]|=c.charCodeAt(f)<<16-f%2*16;return a.create(u,l*2)}},s.Utf16LE={stringify:function(c){for(var l=c.words,u=c.sigBytes,f=[],d=0;d>>2]>>>16-d%4*8&65535);f.push(String.fromCharCode(h))}return f.join("")},parse:function(c){for(var l=c.length,u=[],f=0;f>>1]|=o(c.charCodeAt(f)<<16-f%2*16);return a.create(u,l*2)}};function o(c){return c<<8&4278255360|c>>>8&16711935}}(),r.enc.Utf16})}(Aht)),tx}var rx={},$ht={get exports(){return rx},set exports(t){rx=t}},r9;function $c(){return r9||(r9=1,function(t,e){(function(r,n){t.exports=n(Fe())})(ve,function(r){return function(){var n=r,i=n.lib,a=i.WordArray,s=n.enc;s.Base64={stringify:function(c){var l=c.words,u=c.sigBytes,f=this._map;c.clamp();for(var d=[],h=0;h>>2]>>>24-h%4*8&255,v=l[h+1>>>2]>>>24-(h+1)%4*8&255,m=l[h+2>>>2]>>>24-(h+2)%4*8&255,g=p<<16|v<<8|m,y=0;y<4&&h+y*.75>>6*(3-y)&63));var x=f.charAt(64);if(x)for(;d.length%4;)d.push(x);return d.join("")},parse:function(c){var l=c.length,u=this._map,f=this._reverseMap;if(!f){f=this._reverseMap=[];for(var d=0;d>>6-h%4*2,m=p|v;f[d>>>2]|=m<<24-d%4*8,d++}return a.create(f,d)}}(),r.enc.Base64})}($ht)),rx}var nx={},Cht={get exports(){return nx},set exports(t){nx=t}},n9;function kht(){return n9||(n9=1,function(t,e){(function(r,n){t.exports=n(Fe())})(ve,function(r){return function(){var n=r,i=n.lib,a=i.WordArray,s=n.enc;s.Base64url={stringify:function(c,l=!0){var u=c.words,f=c.sigBytes,d=l?this._safe_map:this._map;c.clamp();for(var h=[],p=0;p>>2]>>>24-p%4*8&255,m=u[p+1>>>2]>>>24-(p+1)%4*8&255,g=u[p+2>>>2]>>>24-(p+2)%4*8&255,y=v<<16|m<<8|g,x=0;x<4&&p+x*.75>>6*(3-x)&63));var b=d.charAt(64);if(b)for(;h.length%4;)h.push(b);return h.join("")},parse:function(c,l=!0){var u=c.length,f=l?this._safe_map:this._map,d=this._reverseMap;if(!d){d=this._reverseMap=[];for(var h=0;h>>6-h%4*2,m=p|v;f[d>>>2]|=m<<24-d%4*8,d++}return a.create(f,d)}}(),r.enc.Base64url})}(Cht)),nx}var ix={},Oht={get exports(){return ix},set exports(t){ix=t}},i9;function bd(){return i9||(i9=1,function(t,e){(function(r,n){t.exports=n(Fe())})(ve,function(r){return function(n){var i=r,a=i.lib,s=a.WordArray,o=a.Hasher,c=i.algo,l=[];(function(){for(var v=0;v<64;v++)l[v]=n.abs(n.sin(v+1))*4294967296|0})();var u=c.MD5=o.extend({_doReset:function(){this._hash=new s.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(v,m){for(var g=0;g<16;g++){var y=m+g,x=v[y];v[y]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360}var b=this._hash.words,_=v[m+0],S=v[m+1],w=v[m+2],R=v[m+3],I=v[m+4],T=v[m+5],C=v[m+6],L=v[m+7],H=v[m+8],N=v[m+9],P=v[m+10],B=v[m+11],V=v[m+12],M=v[m+13],U=v[m+14],W=v[m+15],k=b[0],O=b[1],F=b[2],D=b[3];k=f(k,O,F,D,_,7,l[0]),D=f(D,k,O,F,S,12,l[1]),F=f(F,D,k,O,w,17,l[2]),O=f(O,F,D,k,R,22,l[3]),k=f(k,O,F,D,I,7,l[4]),D=f(D,k,O,F,T,12,l[5]),F=f(F,D,k,O,C,17,l[6]),O=f(O,F,D,k,L,22,l[7]),k=f(k,O,F,D,H,7,l[8]),D=f(D,k,O,F,N,12,l[9]),F=f(F,D,k,O,P,17,l[10]),O=f(O,F,D,k,B,22,l[11]),k=f(k,O,F,D,V,7,l[12]),D=f(D,k,O,F,M,12,l[13]),F=f(F,D,k,O,U,17,l[14]),O=f(O,F,D,k,W,22,l[15]),k=d(k,O,F,D,S,5,l[16]),D=d(D,k,O,F,C,9,l[17]),F=d(F,D,k,O,B,14,l[18]),O=d(O,F,D,k,_,20,l[19]),k=d(k,O,F,D,T,5,l[20]),D=d(D,k,O,F,P,9,l[21]),F=d(F,D,k,O,W,14,l[22]),O=d(O,F,D,k,I,20,l[23]),k=d(k,O,F,D,N,5,l[24]),D=d(D,k,O,F,U,9,l[25]),F=d(F,D,k,O,R,14,l[26]),O=d(O,F,D,k,H,20,l[27]),k=d(k,O,F,D,M,5,l[28]),D=d(D,k,O,F,w,9,l[29]),F=d(F,D,k,O,L,14,l[30]),O=d(O,F,D,k,V,20,l[31]),k=h(k,O,F,D,T,4,l[32]),D=h(D,k,O,F,H,11,l[33]),F=h(F,D,k,O,B,16,l[34]),O=h(O,F,D,k,U,23,l[35]),k=h(k,O,F,D,S,4,l[36]),D=h(D,k,O,F,I,11,l[37]),F=h(F,D,k,O,L,16,l[38]),O=h(O,F,D,k,P,23,l[39]),k=h(k,O,F,D,M,4,l[40]),D=h(D,k,O,F,_,11,l[41]),F=h(F,D,k,O,R,16,l[42]),O=h(O,F,D,k,C,23,l[43]),k=h(k,O,F,D,N,4,l[44]),D=h(D,k,O,F,V,11,l[45]),F=h(F,D,k,O,W,16,l[46]),O=h(O,F,D,k,w,23,l[47]),k=p(k,O,F,D,_,6,l[48]),D=p(D,k,O,F,L,10,l[49]),F=p(F,D,k,O,U,15,l[50]),O=p(O,F,D,k,T,21,l[51]),k=p(k,O,F,D,V,6,l[52]),D=p(D,k,O,F,R,10,l[53]),F=p(F,D,k,O,P,15,l[54]),O=p(O,F,D,k,S,21,l[55]),k=p(k,O,F,D,H,6,l[56]),D=p(D,k,O,F,W,10,l[57]),F=p(F,D,k,O,C,15,l[58]),O=p(O,F,D,k,M,21,l[59]),k=p(k,O,F,D,I,6,l[60]),D=p(D,k,O,F,B,10,l[61]),F=p(F,D,k,O,w,15,l[62]),O=p(O,F,D,k,N,21,l[63]),b[0]=b[0]+k|0,b[1]=b[1]+O|0,b[2]=b[2]+F|0,b[3]=b[3]+D|0},_doFinalize:function(){var v=this._data,m=v.words,g=this._nDataBytes*8,y=v.sigBytes*8;m[y>>>5]|=128<<24-y%32;var x=n.floor(g/4294967296),b=g;m[(y+64>>>9<<4)+15]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,m[(y+64>>>9<<4)+14]=(b<<8|b>>>24)&16711935|(b<<24|b>>>8)&4278255360,v.sigBytes=(m.length+1)*4,this._process();for(var _=this._hash,S=_.words,w=0;w<4;w++){var R=S[w];S[w]=(R<<8|R>>>24)&16711935|(R<<24|R>>>8)&4278255360}return _},clone:function(){var v=o.clone.call(this);return v._hash=this._hash.clone(),v}});function f(v,m,g,y,x,b,_){var S=v+(m&g|~m&y)+x+_;return(S<>>32-b)+m}function d(v,m,g,y,x,b,_){var S=v+(m&y|g&~y)+x+_;return(S<>>32-b)+m}function h(v,m,g,y,x,b,_){var S=v+(m^g^y)+x+_;return(S<>>32-b)+m}function p(v,m,g,y,x,b,_){var S=v+(g^(m|~y))+x+_;return(S<>>32-b)+m}i.MD5=o._createHelper(u),i.HmacMD5=o._createHmacHelper(u)}(Math),r.MD5})}(Oht)),ix}var ax={},Lht={get exports(){return ax},set exports(t){ax=t}},a9;function $L(){return a9||(a9=1,function(t,e){(function(r,n){t.exports=n(Fe())})(ve,function(r){return function(){var n=r,i=n.lib,a=i.WordArray,s=i.Hasher,o=n.algo,c=[],l=o.SHA1=s.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(u,f){for(var d=this._hash.words,h=d[0],p=d[1],v=d[2],m=d[3],g=d[4],y=0;y<80;y++){if(y<16)c[y]=u[f+y]|0;else{var x=c[y-3]^c[y-8]^c[y-14]^c[y-16];c[y]=x<<1|x>>>31}var b=(h<<5|h>>>27)+g+c[y];y<20?b+=(p&v|~p&m)+1518500249:y<40?b+=(p^v^m)+1859775393:y<60?b+=(p&v|p&m|v&m)-1894007588:b+=(p^v^m)-899497514,g=m,m=v,v=p<<30|p>>>2,p=h,h=b}d[0]=d[0]+h|0,d[1]=d[1]+p|0,d[2]=d[2]+v|0,d[3]=d[3]+m|0,d[4]=d[4]+g|0},_doFinalize:function(){var u=this._data,f=u.words,d=this._nDataBytes*8,h=u.sigBytes*8;return f[h>>>5]|=128<<24-h%32,f[(h+64>>>9<<4)+14]=Math.floor(d/4294967296),f[(h+64>>>9<<4)+15]=d,u.sigBytes=f.length*4,this._process(),this._hash},clone:function(){var u=s.clone.call(this);return u._hash=this._hash.clone(),u}});n.SHA1=s._createHelper(l),n.HmacSHA1=s._createHmacHelper(l)}(),r.SHA1})}(Lht)),ax}var sx={},Pht={get exports(){return sx},set exports(t){sx=t}},s9;function Cee(){return s9||(s9=1,function(t,e){(function(r,n){t.exports=n(Fe())})(ve,function(r){return function(n){var i=r,a=i.lib,s=a.WordArray,o=a.Hasher,c=i.algo,l=[],u=[];(function(){function h(g){for(var y=n.sqrt(g),x=2;x<=y;x++)if(!(g%x))return!1;return!0}function p(g){return(g-(g|0))*4294967296|0}for(var v=2,m=0;m<64;)h(v)&&(m<8&&(l[m]=p(n.pow(v,1/2))),u[m]=p(n.pow(v,1/3)),m++),v++})();var f=[],d=c.SHA256=o.extend({_doReset:function(){this._hash=new s.init(l.slice(0))},_doProcessBlock:function(h,p){for(var v=this._hash.words,m=v[0],g=v[1],y=v[2],x=v[3],b=v[4],_=v[5],S=v[6],w=v[7],R=0;R<64;R++){if(R<16)f[R]=h[p+R]|0;else{var I=f[R-15],T=(I<<25|I>>>7)^(I<<14|I>>>18)^I>>>3,C=f[R-2],L=(C<<15|C>>>17)^(C<<13|C>>>19)^C>>>10;f[R]=T+f[R-7]+L+f[R-16]}var H=b&_^~b&S,N=m&g^m&y^g&y,P=(m<<30|m>>>2)^(m<<19|m>>>13)^(m<<10|m>>>22),B=(b<<26|b>>>6)^(b<<21|b>>>11)^(b<<7|b>>>25),V=w+B+H+u[R]+f[R],M=P+N;w=S,S=_,_=b,b=x+V|0,x=y,y=g,g=m,m=V+M|0}v[0]=v[0]+m|0,v[1]=v[1]+g|0,v[2]=v[2]+y|0,v[3]=v[3]+x|0,v[4]=v[4]+b|0,v[5]=v[5]+_|0,v[6]=v[6]+S|0,v[7]=v[7]+w|0},_doFinalize:function(){var h=this._data,p=h.words,v=this._nDataBytes*8,m=h.sigBytes*8;return p[m>>>5]|=128<<24-m%32,p[(m+64>>>9<<4)+14]=n.floor(v/4294967296),p[(m+64>>>9<<4)+15]=v,h.sigBytes=p.length*4,this._process(),this._hash},clone:function(){var h=o.clone.call(this);return h._hash=this._hash.clone(),h}});i.SHA256=o._createHelper(d),i.HmacSHA256=o._createHmacHelper(d)}(Math),r.SHA256})}(Pht)),sx}var ox={},Nht={get exports(){return ox},set exports(t){ox=t}},o9;function Dht(){return o9||(o9=1,function(t,e){(function(r,n,i){t.exports=n(Fe(),Cee())})(ve,function(r){return function(){var n=r,i=n.lib,a=i.WordArray,s=n.algo,o=s.SHA256,c=s.SHA224=o.extend({_doReset:function(){this._hash=new a.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var l=o._doFinalize.call(this);return l.sigBytes-=4,l}});n.SHA224=o._createHelper(c),n.HmacSHA224=o._createHmacHelper(c)}(),r.SHA224})}(Nht)),ox}var lx={},Mht={get exports(){return lx},set exports(t){lx=t}},l9;function kee(){return l9||(l9=1,function(t,e){(function(r,n,i){t.exports=n(Fe(),VE())})(ve,function(r){return function(){var n=r,i=n.lib,a=i.Hasher,s=n.x64,o=s.Word,c=s.WordArray,l=n.algo;function u(){return o.create.apply(o,arguments)}var f=[u(1116352408,3609767458),u(1899447441,602891725),u(3049323471,3964484399),u(3921009573,2173295548),u(961987163,4081628472),u(1508970993,3053834265),u(2453635748,2937671579),u(2870763221,3664609560),u(3624381080,2734883394),u(310598401,1164996542),u(607225278,1323610764),u(1426881987,3590304994),u(1925078388,4068182383),u(2162078206,991336113),u(2614888103,633803317),u(3248222580,3479774868),u(3835390401,2666613458),u(4022224774,944711139),u(264347078,2341262773),u(604807628,2007800933),u(770255983,1495990901),u(1249150122,1856431235),u(1555081692,3175218132),u(1996064986,2198950837),u(2554220882,3999719339),u(2821834349,766784016),u(2952996808,2566594879),u(3210313671,3203337956),u(3336571891,1034457026),u(3584528711,2466948901),u(113926993,3758326383),u(338241895,168717936),u(666307205,1188179964),u(773529912,1546045734),u(1294757372,1522805485),u(1396182291,2643833823),u(1695183700,2343527390),u(1986661051,1014477480),u(2177026350,1206759142),u(2456956037,344077627),u(2730485921,1290863460),u(2820302411,3158454273),u(3259730800,3505952657),u(3345764771,106217008),u(3516065817,3606008344),u(3600352804,1432725776),u(4094571909,1467031594),u(275423344,851169720),u(430227734,3100823752),u(506948616,1363258195),u(659060556,3750685593),u(883997877,3785050280),u(958139571,3318307427),u(1322822218,3812723403),u(1537002063,2003034995),u(1747873779,3602036899),u(1955562222,1575990012),u(2024104815,1125592928),u(2227730452,2716904306),u(2361852424,442776044),u(2428436474,593698344),u(2756734187,3733110249),u(3204031479,2999351573),u(3329325298,3815920427),u(3391569614,3928383900),u(3515267271,566280711),u(3940187606,3454069534),u(4118630271,4000239992),u(116418474,1914138554),u(174292421,2731055270),u(289380356,3203993006),u(460393269,320620315),u(685471733,587496836),u(852142971,1086792851),u(1017036298,365543100),u(1126000580,2618297676),u(1288033470,3409855158),u(1501505948,4234509866),u(1607167915,987167468),u(1816402316,1246189591)],d=[];(function(){for(var p=0;p<80;p++)d[p]=u()})();var h=l.SHA512=a.extend({_doReset:function(){this._hash=new c.init([new o.init(1779033703,4089235720),new o.init(3144134277,2227873595),new o.init(1013904242,4271175723),new o.init(2773480762,1595750129),new o.init(1359893119,2917565137),new o.init(2600822924,725511199),new o.init(528734635,4215389547),new o.init(1541459225,327033209)])},_doProcessBlock:function(p,v){for(var m=this._hash.words,g=m[0],y=m[1],x=m[2],b=m[3],_=m[4],S=m[5],w=m[6],R=m[7],I=g.high,T=g.low,C=y.high,L=y.low,H=x.high,N=x.low,P=b.high,B=b.low,V=_.high,M=_.low,U=S.high,W=S.low,k=w.high,O=w.low,F=R.high,D=R.low,Q=I,ee=T,de=C,oe=L,rt=H,Mt=N,Mr=P,un=B,wt=V,Tt=M,Ia=U,Rs=W,Zo=k,Jo=O,el=F,fi=D,Ft=0;Ft<80;Ft++){var Ct,di,tl=d[Ft];if(Ft<16)di=tl.high=p[v+Ft*2]|0,Ct=tl.low=p[v+Ft*2+1]|0;else{var Ed=d[Ft-15],ji=Ed.high,As=Ed.low,kc=(ji>>>1|As<<31)^(ji>>>8|As<<24)^ji>>>7,rl=(As>>>1|ji<<31)^(As>>>8|ji<<24)^(As>>>7|ji<<25),kn=d[Ft-2],fn=kn.high,$a=kn.low,Sd=(fn>>>19|$a<<13)^(fn<<3|$a>>>29)^fn>>>6,Om=($a>>>19|fn<<13)^($a<<3|fn>>>29)^($a>>>6|fn<<26),Hi=d[Ft-7],WE=Hi.high,KE=Hi.low,Rt=d[Ft-16],Is=Rt.high,Lm=Rt.low;Ct=rl+KE,di=kc+WE+(Ct>>>0>>0?1:0),Ct=Ct+Om,di=di+Sd+(Ct>>>0>>0?1:0),Ct=Ct+Lm,di=di+Is+(Ct>>>0>>0?1:0),tl.high=di,tl.low=Ct}var Pm=wt&Ia^~wt&Zo,Oc=Tt&Rs^~Tt&Jo,Nm=Q&de^Q&rt^de&rt,Dm=ee&oe^ee&Mt^oe&Mt,YE=(Q>>>28|ee<<4)^(Q<<30|ee>>>2)^(Q<<25|ee>>>7),nl=(ee>>>28|Q<<4)^(ee<<30|Q>>>2)^(ee<<25|Q>>>7),_d=(wt>>>14|Tt<<18)^(wt>>>18|Tt<<14)^(wt<<23|Tt>>>9),qE=(Tt>>>14|wt<<18)^(Tt>>>18|wt<<14)^(Tt<<23|wt>>>9),zi=f[Ft],wd=zi.high,Td=zi.low,ur=fi+qE,Gi=el+_d+(ur>>>0>>0?1:0),ur=ur+Oc,Gi=Gi+Pm+(ur>>>0>>0?1:0),ur=ur+Td,Gi=Gi+wd+(ur>>>0>>0?1:0),ur=ur+Ct,Gi=Gi+di+(ur>>>0>>0?1:0),il=nl+Dm,hi=YE+Nm+(il>>>0>>0?1:0);el=Zo,fi=Jo,Zo=Ia,Jo=Rs,Ia=wt,Rs=Tt,Tt=un+ur|0,wt=Mr+Gi+(Tt>>>0>>0?1:0)|0,Mr=rt,un=Mt,rt=de,Mt=oe,de=Q,oe=ee,ee=ur+il|0,Q=Gi+hi+(ee>>>0>>0?1:0)|0}T=g.low=T+ee,g.high=I+Q+(T>>>0>>0?1:0),L=y.low=L+oe,y.high=C+de+(L>>>0>>0?1:0),N=x.low=N+Mt,x.high=H+rt+(N>>>0>>0?1:0),B=b.low=B+un,b.high=P+Mr+(B>>>0>>0?1:0),M=_.low=M+Tt,_.high=V+wt+(M>>>0>>0?1:0),W=S.low=W+Rs,S.high=U+Ia+(W>>>0>>0?1:0),O=w.low=O+Jo,w.high=k+Zo+(O>>>0>>0?1:0),D=R.low=D+fi,R.high=F+el+(D>>>0>>0?1:0)},_doFinalize:function(){var p=this._data,v=p.words,m=this._nDataBytes*8,g=p.sigBytes*8;v[g>>>5]|=128<<24-g%32,v[(g+128>>>10<<5)+30]=Math.floor(m/4294967296),v[(g+128>>>10<<5)+31]=m,p.sigBytes=v.length*4,this._process();var y=this._hash.toX32();return y},clone:function(){var p=a.clone.call(this);return p._hash=this._hash.clone(),p},blockSize:1024/32});n.SHA512=a._createHelper(h),n.HmacSHA512=a._createHmacHelper(h)}(),r.SHA512})}(Mht)),lx}var cx={},Fht={get exports(){return cx},set exports(t){cx=t}},c9;function Bht(){return c9||(c9=1,function(t,e){(function(r,n,i){t.exports=n(Fe(),VE(),kee())})(ve,function(r){return function(){var n=r,i=n.x64,a=i.Word,s=i.WordArray,o=n.algo,c=o.SHA512,l=o.SHA384=c.extend({_doReset:function(){this._hash=new s.init([new a.init(3418070365,3238371032),new a.init(1654270250,914150663),new a.init(2438529370,812702999),new a.init(355462360,4144912697),new a.init(1731405415,4290775857),new a.init(2394180231,1750603025),new a.init(3675008525,1694076839),new a.init(1203062813,3204075428)])},_doFinalize:function(){var u=c._doFinalize.call(this);return u.sigBytes-=16,u}});n.SHA384=c._createHelper(l),n.HmacSHA384=c._createHmacHelper(l)}(),r.SHA384})}(Fht)),cx}var ux={},Uht={get exports(){return ux},set exports(t){ux=t}},u9;function jht(){return u9||(u9=1,function(t,e){(function(r,n,i){t.exports=n(Fe(),VE())})(ve,function(r){return function(n){var i=r,a=i.lib,s=a.WordArray,o=a.Hasher,c=i.x64,l=c.Word,u=i.algo,f=[],d=[],h=[];(function(){for(var m=1,g=0,y=0;y<24;y++){f[m+5*g]=(y+1)*(y+2)/2%64;var x=g%5,b=(2*m+3*g)%5;m=x,g=b}for(var m=0;m<5;m++)for(var g=0;g<5;g++)d[m+5*g]=g+(2*m+3*g)%5*5;for(var _=1,S=0;S<24;S++){for(var w=0,R=0,I=0;I<7;I++){if(_&1){var T=(1<>>24)&16711935|(_<<24|_>>>8)&4278255360,S=(S<<8|S>>>24)&16711935|(S<<24|S>>>8)&4278255360;var w=y[b];w.high^=S,w.low^=_}for(var R=0;R<24;R++){for(var I=0;I<5;I++){for(var T=0,C=0,L=0;L<5;L++){var w=y[I+5*L];T^=w.high,C^=w.low}var H=p[I];H.high=T,H.low=C}for(var I=0;I<5;I++)for(var N=p[(I+4)%5],P=p[(I+1)%5],B=P.high,V=P.low,T=N.high^(B<<1|V>>>31),C=N.low^(V<<1|B>>>31),L=0;L<5;L++){var w=y[I+5*L];w.high^=T,w.low^=C}for(var M=1;M<25;M++){var T,C,w=y[M],U=w.high,W=w.low,k=f[M];k<32?(T=U<>>32-k,C=W<>>32-k):(T=W<>>64-k,C=U<>>64-k);var O=p[d[M]];O.high=T,O.low=C}var F=p[0],D=y[0];F.high=D.high,F.low=D.low;for(var I=0;I<5;I++)for(var L=0;L<5;L++){var M=I+5*L,w=y[M],Q=p[M],ee=p[(I+1)%5+5*L],de=p[(I+2)%5+5*L];w.high=Q.high^~ee.high&de.high,w.low=Q.low^~ee.low&de.low}var w=y[0],oe=h[R];w.high^=oe.high,w.low^=oe.low}},_doFinalize:function(){var m=this._data,g=m.words;this._nDataBytes*8;var y=m.sigBytes*8,x=this.blockSize*32;g[y>>>5]|=1<<24-y%32,g[(n.ceil((y+1)/x)*x>>>5)-1]|=128,m.sigBytes=g.length*4,this._process();for(var b=this._state,_=this.cfg.outputLength/8,S=_/8,w=[],R=0;R>>24)&16711935|(T<<24|T>>>8)&4278255360,C=(C<<8|C>>>24)&16711935|(C<<24|C>>>8)&4278255360,w.push(C),w.push(T)}return new s.init(w,_)},clone:function(){for(var m=o.clone.call(this),g=m._state=this._state.slice(0),y=0;y<25;y++)g[y]=g[y].clone();return m}});i.SHA3=o._createHelper(v),i.HmacSHA3=o._createHmacHelper(v)}(Math),r.SHA3})}(Uht)),ux}var fx={},Hht={get exports(){return fx},set exports(t){fx=t}},f9;function zht(){return f9||(f9=1,function(t,e){(function(r,n){t.exports=n(Fe())})(ve,function(r){/** @preserve + (c) 2012 by Cédric Mesnil. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */return function(n){var i=r,a=i.lib,s=a.WordArray,o=a.Hasher,c=i.algo,l=s.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),u=s.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),f=s.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),d=s.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),h=s.create([0,1518500249,1859775393,2400959708,2840853838]),p=s.create([1352829926,1548603684,1836072691,2053994217,0]),v=c.RIPEMD160=o.extend({_doReset:function(){this._hash=s.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(S,w){for(var R=0;R<16;R++){var I=w+R,T=S[I];S[I]=(T<<8|T>>>24)&16711935|(T<<24|T>>>8)&4278255360}var C=this._hash.words,L=h.words,H=p.words,N=l.words,P=u.words,B=f.words,V=d.words,M,U,W,k,O,F,D,Q,ee,de;F=M=C[0],D=U=C[1],Q=W=C[2],ee=k=C[3],de=O=C[4];for(var oe,R=0;R<80;R+=1)oe=M+S[w+N[R]]|0,R<16?oe+=m(U,W,k)+L[0]:R<32?oe+=g(U,W,k)+L[1]:R<48?oe+=y(U,W,k)+L[2]:R<64?oe+=x(U,W,k)+L[3]:oe+=b(U,W,k)+L[4],oe=oe|0,oe=_(oe,B[R]),oe=oe+O|0,M=O,O=k,k=_(W,10),W=U,U=oe,oe=F+S[w+P[R]]|0,R<16?oe+=b(D,Q,ee)+H[0]:R<32?oe+=x(D,Q,ee)+H[1]:R<48?oe+=y(D,Q,ee)+H[2]:R<64?oe+=g(D,Q,ee)+H[3]:oe+=m(D,Q,ee)+H[4],oe=oe|0,oe=_(oe,V[R]),oe=oe+de|0,F=de,de=ee,ee=_(Q,10),Q=D,D=oe;oe=C[1]+W+ee|0,C[1]=C[2]+k+de|0,C[2]=C[3]+O+F|0,C[3]=C[4]+M+D|0,C[4]=C[0]+U+Q|0,C[0]=oe},_doFinalize:function(){var S=this._data,w=S.words,R=this._nDataBytes*8,I=S.sigBytes*8;w[I>>>5]|=128<<24-I%32,w[(I+64>>>9<<4)+14]=(R<<8|R>>>24)&16711935|(R<<24|R>>>8)&4278255360,S.sigBytes=(w.length+1)*4,this._process();for(var T=this._hash,C=T.words,L=0;L<5;L++){var H=C[L];C[L]=(H<<8|H>>>24)&16711935|(H<<24|H>>>8)&4278255360}return T},clone:function(){var S=o.clone.call(this);return S._hash=this._hash.clone(),S}});function m(S,w,R){return S^w^R}function g(S,w,R){return S&w|~S&R}function y(S,w,R){return(S|~w)^R}function x(S,w,R){return S&R|w&~R}function b(S,w,R){return S^(w|~R)}function _(S,w){return S<>>32-w}i.RIPEMD160=o._createHelper(v),i.HmacRIPEMD160=o._createHmacHelper(v)}(),r.RIPEMD160})}(Hht)),fx}var dx={},Ght={get exports(){return dx},set exports(t){dx=t}},d9;function CL(){return d9||(d9=1,function(t,e){(function(r,n){t.exports=n(Fe())})(ve,function(r){(function(){var n=r,i=n.lib,a=i.Base,s=n.enc,o=s.Utf8,c=n.algo;c.HMAC=a.extend({init:function(l,u){l=this._hasher=new l.init,typeof u=="string"&&(u=o.parse(u));var f=l.blockSize,d=f*4;u.sigBytes>d&&(u=l.finalize(u)),u.clamp();for(var h=this._oKey=u.clone(),p=this._iKey=u.clone(),v=h.words,m=p.words,g=0;g>>2]&255;T.sigBytes-=C}};a.BlockCipher=h.extend({cfg:h.cfg.extend({mode:m,padding:y}),reset:function(){var T;h.reset.call(this);var C=this.cfg,L=C.iv,H=C.mode;this._xformMode==this._ENC_XFORM_MODE?T=H.createEncryptor:(T=H.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==T?this._mode.init(this,L&&L.words):(this._mode=T.call(H,this,L&&L.words),this._mode.__creator=T)},_doProcessBlock:function(T,C){this._mode.processBlock(T,C)},_doFinalize:function(){var T,C=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(C.pad(this._data,this.blockSize),T=this._process(!0)):(T=this._process(!0),C.unpad(T)),T},blockSize:128/32});var x=a.CipherParams=s.extend({init:function(T){this.mixIn(T)},toString:function(T){return(T||this.formatter).stringify(this)}}),b=i.format={},_=b.OpenSSL={stringify:function(T){var C,L=T.ciphertext,H=T.salt;return H?C=o.create([1398893684,1701076831]).concat(H).concat(L):C=L,C.toString(u)},parse:function(T){var C,L=u.parse(T),H=L.words;return H[0]==1398893684&&H[1]==1701076831&&(C=o.create(H.slice(2,4)),H.splice(0,4),L.sigBytes-=16),x.create({ciphertext:L,salt:C})}},S=a.SerializableCipher=s.extend({cfg:s.extend({format:_}),encrypt:function(T,C,L,H){H=this.cfg.extend(H);var N=T.createEncryptor(L,H),P=N.finalize(C),B=N.cfg;return x.create({ciphertext:P,key:L,iv:B.iv,algorithm:T,mode:B.mode,padding:B.padding,blockSize:T.blockSize,formatter:H.format})},decrypt:function(T,C,L,H){H=this.cfg.extend(H),C=this._parse(C,H.format);var N=T.createDecryptor(L,H).finalize(C.ciphertext);return N},_parse:function(T,C){return typeof T=="string"?C.parse(T,this):T}}),w=i.kdf={},R=w.OpenSSL={execute:function(T,C,L,H){H||(H=o.random(64/8));var N=d.create({keySize:C+L}).compute(T,H),P=o.create(N.words.slice(C),L*4);return N.sigBytes=C*4,x.create({key:N,iv:P,salt:H})}},I=a.PasswordBasedCipher=S.extend({cfg:S.cfg.extend({kdf:R}),encrypt:function(T,C,L,H){H=this.cfg.extend(H);var N=H.kdf.execute(L,T.keySize,T.ivSize);H.iv=N.iv;var P=S.encrypt.call(this,T,C,N.key,H);return P.mixIn(N),P},decrypt:function(T,C,L,H){H=this.cfg.extend(H),C=this._parse(C,H.format);var N=H.kdf.execute(L,T.keySize,T.ivSize,C.salt);H.iv=N.iv;var P=S.decrypt.call(this,T,C,N.key,H);return P}})}()})}(Yht)),mx}var gx={},qht={get exports(){return gx},set exports(t){gx=t}},g9;function Xht(){return g9||(g9=1,function(t,e){(function(r,n,i){t.exports=n(Fe(),cr())})(ve,function(r){return r.mode.CFB=function(){var n=r.lib.BlockCipherMode.extend();n.Encryptor=n.extend({processBlock:function(a,s){var o=this._cipher,c=o.blockSize;i.call(this,a,s,c,o),this._prevBlock=a.slice(s,s+c)}}),n.Decryptor=n.extend({processBlock:function(a,s){var o=this._cipher,c=o.blockSize,l=a.slice(s,s+c);i.call(this,a,s,c,o),this._prevBlock=l}});function i(a,s,o,c){var l,u=this._iv;u?(l=u.slice(0),this._iv=void 0):l=this._prevBlock,c.encryptBlock(l,0);for(var f=0;f>24&255)===255){var c=o>>16&255,l=o>>8&255,u=o&255;c===255?(c=0,l===255?(l=0,u===255?u=0:++u):++l):++c,o=0,o+=c<<16,o+=l<<8,o+=u}else o+=1<<24;return o}function a(o){return(o[0]=i(o[0]))===0&&(o[1]=i(o[1])),o}var s=n.Encryptor=n.extend({processBlock:function(o,c){var l=this._cipher,u=l.blockSize,f=this._iv,d=this._counter;f&&(d=this._counter=f.slice(0),this._iv=void 0),a(d);var h=d.slice(0);l.encryptBlock(h,0);for(var p=0;p>>2]|=o<<24-c%4*8,n.sigBytes+=o},unpad:function(n){var i=n.words[n.sigBytes-1>>>2]&255;n.sigBytes-=i}},r.pad.Ansix923})}(a0t)),Ex}var Sx={},o0t={get exports(){return Sx},set exports(t){Sx=t}},S9;function l0t(){return S9||(S9=1,function(t,e){(function(r,n,i){t.exports=n(Fe(),cr())})(ve,function(r){return r.pad.Iso10126={pad:function(n,i){var a=i*4,s=a-n.sigBytes%a;n.concat(r.lib.WordArray.random(s-1)).concat(r.lib.WordArray.create([s<<24],1))},unpad:function(n){var i=n.words[n.sigBytes-1>>>2]&255;n.sigBytes-=i}},r.pad.Iso10126})}(o0t)),Sx}var _x={},c0t={get exports(){return _x},set exports(t){_x=t}},_9;function u0t(){return _9||(_9=1,function(t,e){(function(r,n,i){t.exports=n(Fe(),cr())})(ve,function(r){return r.pad.Iso97971={pad:function(n,i){n.concat(r.lib.WordArray.create([2147483648],1)),r.pad.ZeroPadding.pad(n,i)},unpad:function(n){r.pad.ZeroPadding.unpad(n),n.sigBytes--}},r.pad.Iso97971})}(c0t)),_x}var wx={},f0t={get exports(){return wx},set exports(t){wx=t}},w9;function d0t(){return w9||(w9=1,function(t,e){(function(r,n,i){t.exports=n(Fe(),cr())})(ve,function(r){return r.pad.ZeroPadding={pad:function(n,i){var a=i*4;n.clamp(),n.sigBytes+=a-(n.sigBytes%a||a)},unpad:function(n){for(var i=n.words,a=n.sigBytes-1,a=n.sigBytes-1;a>=0;a--)if(i[a>>>2]>>>24-a%4*8&255){n.sigBytes=a+1;break}}},r.pad.ZeroPadding})}(f0t)),wx}var Tx={},h0t={get exports(){return Tx},set exports(t){Tx=t}},T9;function p0t(){return T9||(T9=1,function(t,e){(function(r,n,i){t.exports=n(Fe(),cr())})(ve,function(r){return r.pad.NoPadding={pad:function(){},unpad:function(){}},r.pad.NoPadding})}(h0t)),Tx}var Rx={},m0t={get exports(){return Rx},set exports(t){Rx=t}},R9;function g0t(){return R9||(R9=1,function(t,e){(function(r,n,i){t.exports=n(Fe(),cr())})(ve,function(r){return function(n){var i=r,a=i.lib,s=a.CipherParams,o=i.enc,c=o.Hex,l=i.format;l.Hex={stringify:function(u){return u.ciphertext.toString(c)},parse:function(u){var f=c.parse(u);return s.create({ciphertext:f})}}}(),r.format.Hex})}(m0t)),Rx}var Ax={},v0t={get exports(){return Ax},set exports(t){Ax=t}},A9;function y0t(){return A9||(A9=1,function(t,e){(function(r,n,i){t.exports=n(Fe(),$c(),bd(),Cc(),cr())})(ve,function(r){return function(){var n=r,i=n.lib,a=i.BlockCipher,s=n.algo,o=[],c=[],l=[],u=[],f=[],d=[],h=[],p=[],v=[],m=[];(function(){for(var x=[],b=0;b<256;b++)b<128?x[b]=b<<1:x[b]=b<<1^283;for(var _=0,S=0,b=0;b<256;b++){var w=S^S<<1^S<<2^S<<3^S<<4;w=w>>>8^w&255^99,o[_]=w,c[w]=_;var R=x[_],I=x[R],T=x[I],C=x[w]*257^w*16843008;l[_]=C<<24|C>>>8,u[_]=C<<16|C>>>16,f[_]=C<<8|C>>>24,d[_]=C;var C=T*16843009^I*65537^R*257^_*16843008;h[w]=C<<24|C>>>8,p[w]=C<<16|C>>>16,v[w]=C<<8|C>>>24,m[w]=C,_?(_=R^x[x[x[T^R]]],S^=x[x[S]]):_=S=1}})();var g=[0,1,2,4,8,16,32,64,128,27,54],y=s.AES=a.extend({_doReset:function(){var x;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var b=this._keyPriorReset=this._key,_=b.words,S=b.sigBytes/4,w=this._nRounds=S+6,R=(w+1)*4,I=this._keySchedule=[],T=0;T6&&T%S==4&&(x=o[x>>>24]<<24|o[x>>>16&255]<<16|o[x>>>8&255]<<8|o[x&255]):(x=x<<8|x>>>24,x=o[x>>>24]<<24|o[x>>>16&255]<<16|o[x>>>8&255]<<8|o[x&255],x^=g[T/S|0]<<24),I[T]=I[T-S]^x);for(var C=this._invKeySchedule=[],L=0;L>>24]]^p[o[x>>>16&255]]^v[o[x>>>8&255]]^m[o[x&255]]}}},encryptBlock:function(x,b){this._doCryptBlock(x,b,this._keySchedule,l,u,f,d,o)},decryptBlock:function(x,b){var _=x[b+1];x[b+1]=x[b+3],x[b+3]=_,this._doCryptBlock(x,b,this._invKeySchedule,h,p,v,m,c);var _=x[b+1];x[b+1]=x[b+3],x[b+3]=_},_doCryptBlock:function(x,b,_,S,w,R,I,T){for(var C=this._nRounds,L=x[b]^_[0],H=x[b+1]^_[1],N=x[b+2]^_[2],P=x[b+3]^_[3],B=4,V=1;V>>24]^w[H>>>16&255]^R[N>>>8&255]^I[P&255]^_[B++],U=S[H>>>24]^w[N>>>16&255]^R[P>>>8&255]^I[L&255]^_[B++],W=S[N>>>24]^w[P>>>16&255]^R[L>>>8&255]^I[H&255]^_[B++],k=S[P>>>24]^w[L>>>16&255]^R[H>>>8&255]^I[N&255]^_[B++];L=M,H=U,N=W,P=k}var M=(T[L>>>24]<<24|T[H>>>16&255]<<16|T[N>>>8&255]<<8|T[P&255])^_[B++],U=(T[H>>>24]<<24|T[N>>>16&255]<<16|T[P>>>8&255]<<8|T[L&255])^_[B++],W=(T[N>>>24]<<24|T[P>>>16&255]<<16|T[L>>>8&255]<<8|T[H&255])^_[B++],k=(T[P>>>24]<<24|T[L>>>16&255]<<16|T[H>>>8&255]<<8|T[N&255])^_[B++];x[b]=M,x[b+1]=U,x[b+2]=W,x[b+3]=k},keySize:256/32});n.AES=a._createHelper(y)}(),r.AES})}(v0t)),Ax}var Ix={},x0t={get exports(){return Ix},set exports(t){Ix=t}},I9;function b0t(){return I9||(I9=1,function(t,e){(function(r,n,i){t.exports=n(Fe(),$c(),bd(),Cc(),cr())})(ve,function(r){return function(){var n=r,i=n.lib,a=i.WordArray,s=i.BlockCipher,o=n.algo,c=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],l=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],u=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],f=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],d=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],h=o.DES=s.extend({_doReset:function(){for(var g=this._key,y=g.words,x=[],b=0;b<56;b++){var _=c[b]-1;x[b]=y[_>>>5]>>>31-_%32&1}for(var S=this._subKeys=[],w=0;w<16;w++){for(var R=S[w]=[],I=u[w],b=0;b<24;b++)R[b/6|0]|=x[(l[b]-1+I)%28]<<31-b%6,R[4+(b/6|0)]|=x[28+(l[b+24]-1+I)%28]<<31-b%6;R[0]=R[0]<<1|R[0]>>>31;for(var b=1;b<7;b++)R[b]=R[b]>>>(b-1)*4+3;R[7]=R[7]<<5|R[7]>>>27}for(var T=this._invSubKeys=[],b=0;b<16;b++)T[b]=S[15-b]},encryptBlock:function(g,y){this._doCryptBlock(g,y,this._subKeys)},decryptBlock:function(g,y){this._doCryptBlock(g,y,this._invSubKeys)},_doCryptBlock:function(g,y,x){this._lBlock=g[y],this._rBlock=g[y+1],p.call(this,4,252645135),p.call(this,16,65535),v.call(this,2,858993459),v.call(this,8,16711935),p.call(this,1,1431655765);for(var b=0;b<16;b++){for(var _=x[b],S=this._lBlock,w=this._rBlock,R=0,I=0;I<8;I++)R|=f[I][((w^_[I])&d[I])>>>0];this._lBlock=w,this._rBlock=S^R}var T=this._lBlock;this._lBlock=this._rBlock,this._rBlock=T,p.call(this,1,1431655765),v.call(this,8,16711935),v.call(this,2,858993459),p.call(this,16,65535),p.call(this,4,252645135),g[y]=this._lBlock,g[y+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function p(g,y){var x=(this._lBlock>>>g^this._rBlock)&y;this._rBlock^=x,this._lBlock^=x<>>g^this._lBlock)&y;this._lBlock^=x,this._rBlock^=x<192.");var x=y.slice(0,2),b=y.length<4?y.slice(0,2):y.slice(2,4),_=y.length<6?y.slice(0,2):y.slice(4,6);this._des1=h.createEncryptor(a.create(x)),this._des2=h.createEncryptor(a.create(b)),this._des3=h.createEncryptor(a.create(_))},encryptBlock:function(g,y){this._des1.encryptBlock(g,y),this._des2.decryptBlock(g,y),this._des3.encryptBlock(g,y)},decryptBlock:function(g,y){this._des3.decryptBlock(g,y),this._des2.encryptBlock(g,y),this._des1.decryptBlock(g,y)},keySize:192/32,ivSize:64/32,blockSize:64/32});n.TripleDES=s._createHelper(m)}(),r.TripleDES})}(x0t)),Ix}var $x={},E0t={get exports(){return $x},set exports(t){$x=t}},$9;function S0t(){return $9||($9=1,function(t,e){(function(r,n,i){t.exports=n(Fe(),$c(),bd(),Cc(),cr())})(ve,function(r){return function(){var n=r,i=n.lib,a=i.StreamCipher,s=n.algo,o=s.RC4=a.extend({_doReset:function(){for(var u=this._key,f=u.words,d=u.sigBytes,h=this._S=[],p=0;p<256;p++)h[p]=p;for(var p=0,v=0;p<256;p++){var m=p%d,g=f[m>>>2]>>>24-m%4*8&255;v=(v+h[p]+g)%256;var y=h[p];h[p]=h[v],h[v]=y}this._i=this._j=0},_doProcessBlock:function(u,f){u[f]^=c.call(this)},keySize:256/32,ivSize:0});function c(){for(var u=this._S,f=this._i,d=this._j,h=0,p=0;p<4;p++){f=(f+1)%256,d=(d+u[f])%256;var v=u[f];u[f]=u[d],u[d]=v,h|=u[(u[f]+u[d])%256]<<24-p*8}return this._i=f,this._j=d,h}n.RC4=a._createHelper(o);var l=s.RC4Drop=o.extend({cfg:o.cfg.extend({drop:192}),_doReset:function(){o._doReset.call(this);for(var u=this.cfg.drop;u>0;u--)c.call(this)}});n.RC4Drop=a._createHelper(l)}(),r.RC4})}(E0t)),$x}var Cx={},_0t={get exports(){return Cx},set exports(t){Cx=t}},C9;function w0t(){return C9||(C9=1,function(t,e){(function(r,n,i){t.exports=n(Fe(),$c(),bd(),Cc(),cr())})(ve,function(r){return function(){var n=r,i=n.lib,a=i.StreamCipher,s=n.algo,o=[],c=[],l=[],u=s.Rabbit=a.extend({_doReset:function(){for(var d=this._key.words,h=this.cfg.iv,p=0;p<4;p++)d[p]=(d[p]<<8|d[p]>>>24)&16711935|(d[p]<<24|d[p]>>>8)&4278255360;var v=this._X=[d[0],d[3]<<16|d[2]>>>16,d[1],d[0]<<16|d[3]>>>16,d[2],d[1]<<16|d[0]>>>16,d[3],d[2]<<16|d[1]>>>16],m=this._C=[d[2]<<16|d[2]>>>16,d[0]&4294901760|d[1]&65535,d[3]<<16|d[3]>>>16,d[1]&4294901760|d[2]&65535,d[0]<<16|d[0]>>>16,d[2]&4294901760|d[3]&65535,d[1]<<16|d[1]>>>16,d[3]&4294901760|d[0]&65535];this._b=0;for(var p=0;p<4;p++)f.call(this);for(var p=0;p<8;p++)m[p]^=v[p+4&7];if(h){var g=h.words,y=g[0],x=g[1],b=(y<<8|y>>>24)&16711935|(y<<24|y>>>8)&4278255360,_=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,S=b>>>16|_&4294901760,w=_<<16|b&65535;m[0]^=b,m[1]^=S,m[2]^=_,m[3]^=w,m[4]^=b,m[5]^=S,m[6]^=_,m[7]^=w;for(var p=0;p<4;p++)f.call(this)}},_doProcessBlock:function(d,h){var p=this._X;f.call(this),o[0]=p[0]^p[5]>>>16^p[3]<<16,o[1]=p[2]^p[7]>>>16^p[5]<<16,o[2]=p[4]^p[1]>>>16^p[7]<<16,o[3]=p[6]^p[3]>>>16^p[1]<<16;for(var v=0;v<4;v++)o[v]=(o[v]<<8|o[v]>>>24)&16711935|(o[v]<<24|o[v]>>>8)&4278255360,d[h+v]^=o[v]},blockSize:128/32,ivSize:64/32});function f(){for(var d=this._X,h=this._C,p=0;p<8;p++)c[p]=h[p];h[0]=h[0]+1295307597+this._b|0,h[1]=h[1]+3545052371+(h[0]>>>0>>0?1:0)|0,h[2]=h[2]+886263092+(h[1]>>>0>>0?1:0)|0,h[3]=h[3]+1295307597+(h[2]>>>0>>0?1:0)|0,h[4]=h[4]+3545052371+(h[3]>>>0>>0?1:0)|0,h[5]=h[5]+886263092+(h[4]>>>0>>0?1:0)|0,h[6]=h[6]+1295307597+(h[5]>>>0>>0?1:0)|0,h[7]=h[7]+3545052371+(h[6]>>>0>>0?1:0)|0,this._b=h[7]>>>0>>0?1:0;for(var p=0;p<8;p++){var v=d[p]+h[p],m=v&65535,g=v>>>16,y=((m*m>>>17)+m*g>>>15)+g*g,x=((v&4294901760)*v|0)+((v&65535)*v|0);l[p]=y^x}d[0]=l[0]+(l[7]<<16|l[7]>>>16)+(l[6]<<16|l[6]>>>16)|0,d[1]=l[1]+(l[0]<<8|l[0]>>>24)+l[7]|0,d[2]=l[2]+(l[1]<<16|l[1]>>>16)+(l[0]<<16|l[0]>>>16)|0,d[3]=l[3]+(l[2]<<8|l[2]>>>24)+l[1]|0,d[4]=l[4]+(l[3]<<16|l[3]>>>16)+(l[2]<<16|l[2]>>>16)|0,d[5]=l[5]+(l[4]<<8|l[4]>>>24)+l[3]|0,d[6]=l[6]+(l[5]<<16|l[5]>>>16)+(l[4]<<16|l[4]>>>16)|0,d[7]=l[7]+(l[6]<<8|l[6]>>>24)+l[5]|0}n.Rabbit=a._createHelper(u)}(),r.Rabbit})}(_0t)),Cx}var kx={},T0t={get exports(){return kx},set exports(t){kx=t}},k9;function R0t(){return k9||(k9=1,function(t,e){(function(r,n,i){t.exports=n(Fe(),$c(),bd(),Cc(),cr())})(ve,function(r){return function(){var n=r,i=n.lib,a=i.StreamCipher,s=n.algo,o=[],c=[],l=[],u=s.RabbitLegacy=a.extend({_doReset:function(){var d=this._key.words,h=this.cfg.iv,p=this._X=[d[0],d[3]<<16|d[2]>>>16,d[1],d[0]<<16|d[3]>>>16,d[2],d[1]<<16|d[0]>>>16,d[3],d[2]<<16|d[1]>>>16],v=this._C=[d[2]<<16|d[2]>>>16,d[0]&4294901760|d[1]&65535,d[3]<<16|d[3]>>>16,d[1]&4294901760|d[2]&65535,d[0]<<16|d[0]>>>16,d[2]&4294901760|d[3]&65535,d[1]<<16|d[1]>>>16,d[3]&4294901760|d[0]&65535];this._b=0;for(var m=0;m<4;m++)f.call(this);for(var m=0;m<8;m++)v[m]^=p[m+4&7];if(h){var g=h.words,y=g[0],x=g[1],b=(y<<8|y>>>24)&16711935|(y<<24|y>>>8)&4278255360,_=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,S=b>>>16|_&4294901760,w=_<<16|b&65535;v[0]^=b,v[1]^=S,v[2]^=_,v[3]^=w,v[4]^=b,v[5]^=S,v[6]^=_,v[7]^=w;for(var m=0;m<4;m++)f.call(this)}},_doProcessBlock:function(d,h){var p=this._X;f.call(this),o[0]=p[0]^p[5]>>>16^p[3]<<16,o[1]=p[2]^p[7]>>>16^p[5]<<16,o[2]=p[4]^p[1]>>>16^p[7]<<16,o[3]=p[6]^p[3]>>>16^p[1]<<16;for(var v=0;v<4;v++)o[v]=(o[v]<<8|o[v]>>>24)&16711935|(o[v]<<24|o[v]>>>8)&4278255360,d[h+v]^=o[v]},blockSize:128/32,ivSize:64/32});function f(){for(var d=this._X,h=this._C,p=0;p<8;p++)c[p]=h[p];h[0]=h[0]+1295307597+this._b|0,h[1]=h[1]+3545052371+(h[0]>>>0>>0?1:0)|0,h[2]=h[2]+886263092+(h[1]>>>0>>0?1:0)|0,h[3]=h[3]+1295307597+(h[2]>>>0>>0?1:0)|0,h[4]=h[4]+3545052371+(h[3]>>>0>>0?1:0)|0,h[5]=h[5]+886263092+(h[4]>>>0>>0?1:0)|0,h[6]=h[6]+1295307597+(h[5]>>>0>>0?1:0)|0,h[7]=h[7]+3545052371+(h[6]>>>0>>0?1:0)|0,this._b=h[7]>>>0>>0?1:0;for(var p=0;p<8;p++){var v=d[p]+h[p],m=v&65535,g=v>>>16,y=((m*m>>>17)+m*g>>>15)+g*g,x=((v&4294901760)*v|0)+((v&65535)*v|0);l[p]=y^x}d[0]=l[0]+(l[7]<<16|l[7]>>>16)+(l[6]<<16|l[6]>>>16)|0,d[1]=l[1]+(l[0]<<8|l[0]>>>24)+l[7]|0,d[2]=l[2]+(l[1]<<16|l[1]>>>16)+(l[0]<<16|l[0]>>>16)|0,d[3]=l[3]+(l[2]<<8|l[2]>>>24)+l[1]|0,d[4]=l[4]+(l[3]<<16|l[3]>>>16)+(l[2]<<16|l[2]>>>16)|0,d[5]=l[5]+(l[4]<<8|l[4]>>>24)+l[3]|0,d[6]=l[6]+(l[5]<<16|l[5]>>>16)+(l[4]<<16|l[4]>>>16)|0,d[7]=l[7]+(l[6]<<8|l[6]>>>24)+l[5]|0}n.RabbitLegacy=a._createHelper(u)}(),r.RabbitLegacy})}(T0t)),kx}(function(t,e){(function(r,n,i){t.exports=n(Fe(),VE(),Rht(),Iht(),$c(),kht(),bd(),$L(),Cee(),Dht(),kee(),Bht(),jht(),zht(),CL(),Wht(),Cc(),cr(),Xht(),Zht(),e0t(),r0t(),i0t(),s0t(),l0t(),u0t(),d0t(),p0t(),g0t(),y0t(),b0t(),S0t(),w0t(),R0t())})(ve,function(r){return r})})(xht);const hu=xp,A0t=l5e("0123456789abcdef",32),O9={"360p":Ge.Q360P,"480p":Ge.Q480P,"720p":Ge.Q720P,"1080p":Ge.Q1080P},I0t=atob("d0VpcGhUbiE="),Oee=atob("MTIzZDZjZWRmNjI2ZHk1NDIzM2FhMXc2"),L9=[atob("aHR0cHM6Ly9zaG93Ym94LnNoZWd1Lm5ldC9hcGkvYXBpX2NsaWVudC9pbmRleC8="),atob("aHR0cHM6Ly9tYnBhcGkuc2hlZ3UubmV0L2FwaS9hcGlfY2xpZW50L2luZGV4Lw==")],P9=atob("bW92aWVib3g="),$0t=atob("Y29tLnRkby5zaG93Ym94"),N9={encrypt(t){return hu.TripleDES.encrypt(t,hu.enc.Utf8.parse(Oee),{iv:hu.enc.Utf8.parse(I0t)}).toString()},getVerify(t,e,r){return t?hu.MD5(hu.MD5(e).toString()+r+t).toString():null}},C0t=()=>Math.floor(Date.now()/1e3+60*60*12),mh=(t,e=!1)=>{const r={childmode:"0",app_version:"11.5",appid:$0t,lang:"en",expired_date:`${C0t()}`,platform:"android",channel:"Website"},n=N9.encrypt(JSON.stringify({...r,...t})),i=hu.MD5(P9).toString(),a=N9.getVerify(n,P9,Oee),s=JSON.stringify({app_key:i,verify:a,encrypt_data:n}),o=btoa(s),c=new URLSearchParams;c.append("data",o),c.append("appid","27"),c.append("platform","android"),c.append("version","129"),c.append("medium","Website");const l=e?L9[1]:L9[0];return ge(l,{method:"POST",parseResponse:JSON.parse,headers:{Platform:"android","Content-Type":"application/x-www-form-urlencoded"},body:`${c.toString()}&token${A0t()}`})},D9=t=>t.find(e=>e.quality==="1080p"&&e.path)??t.find(e=>e.quality==="720p"&&e.path)??t.find(e=>e.quality==="480p"&&e.path)??t.find(e=>e.quality==="360p"&&e.path),M9=t=>{let e=t.subtitles;if(e=e.map(n=>{if(!Uq(n.file_path))return null;const a=ZBe(n.file_path);return{...n,type:a}}).filter(Boolean),e.length===0)return null;const r=e[0];return{needsProxy:!0,langIso:t.language,url:r.file_path,type:r.type}};Fi({id:"superstream",displayName:"Superstream",rank:300,type:[ie.MOVIE,ie.SERIES],async scrape({media:t,episode:e,progress:r}){var h,p;const n={module:"Search3",page:"1",type:"all",keyword:t.meta.title,pagelimit:"20"},i=(await mh(n,!0)).data;r(33);const a=i.find(v=>Zk(v.title,t.meta.title)&&v.year===Number(t.meta.year));if(!a)throw new Error("No entry found on SuperStream");const s=a.id;if(t.meta.type===ie.MOVIE){const m=(await mh({uid:"",module:"Movie_downloadurl_v3",mid:s,oss:"1",group:""})).data;r(50);const g=D9(m.list);if(!g)throw new Error("No quality could be found.");const y={fid:g.fid,uid:"",module:"Movie_srt_list_v2",mid:s},b=(await mh(y)).data.list.map(M9).filter(Boolean);return{embeds:[],stream:{streamUrl:g.path,quality:O9[g.quality],type:Yt.MP4,captions:b}}}if(t.meta.type!==ie.SERIES)throw new Error("Unsupported type");const o={uid:"",module:"TV_downloadurl_v3",tid:s,season:t.meta.seasonData.number.toString(),episode:(((h=t.meta.seasonData.episodes.find(v=>v.id===e))==null?void 0:h.number)??1).toString(),oss:"1",group:""},c=(await mh(o)).data;r(66);const l=D9(c.list);if(!l)throw new Error("No quality could be found.");const u={fid:l.fid,uid:"",module:"TV_srt_list_v2",episode:((p=t.meta.seasonData.episodes.find(v=>v.id===e))==null?void 0:p.number)??1,tid:s,season:t.meta.seasonData.number.toString()},d=(await mh(u)).data.list.map(M9).filter(Boolean);return{embeds:[],stream:{quality:O9[l.quality],streamUrl:l.path,type:Yt.MP4,captions:d}}}});const xv="https://net-film.vercel.app",F9={360:Ge.Q360P,540:Ge.Q540P,480:Ge.Q480P,720:Ge.Q720P,1080:Ge.Q1080P};Fi({id:"netfilm",displayName:"NetFilm",rank:15,type:[ie.MOVIE,ie.SERIES],disabled:!0,async scrape({media:t,episode:e,progress:r}){var v;if(!this.type.includes(t.meta.type))throw new Error("Unsupported type");const i=(await ge(`/api/search?keyword=${encodeURIComponent(t.meta.title)}`,{baseURL:xv})).data.results;if(r(25),t.meta.type===ie.MOVIE){const m=i.find(S=>S.name===t.meta.title&&S.releaseTime===t.meta.year);if(!m)throw new Error("No watchable item found");const g=m.id;r(75);const x=(await ge(`/api/episode?id=${g}`,{baseURL:xv})).data,b=x.qualities.reduce((S,w)=>w.quality>S.quality?w:S),_=x.subtitles.map(S=>({needsProxy:!1,url:S.url.replace("https://convert-srt-to-vtt.vercel.app/?url=",""),type:Li.SRT,langIso:S.language}));return{embeds:[],stream:{streamUrl:b.url.replace("akm-cdn","aws-cdn").replace("gg-cdn","aws-cdn"),quality:F9[b.quality],type:Yt.HLS,captions:_}}}if(t.meta.type!==ie.SERIES)throw new Error("Unsupported type");const a=t.meta.seasonData.number,o=i.filter(m=>m.name.includes(t.meta.title)).map(m=>({...m,season:parseInt(m.name.split(" ").at(-1),10)||1})).find(m=>m.season===a);r(50);const c=await ge(`/api/detail?id=${o.id}&category=${o.categoryTag[0].id}`,{baseURL:xv}),l=(v=t.meta.seasonData.episodes.find(m=>m.id===e))==null?void 0:v.number,u=c.data.episodeVo.find(m=>m.seriesNo===l);r(75);const d=(await ge(`/api/episode?id=${o.id}&category=1&episode=${u.id}`,{baseURL:xv})).data,h=d.qualities.reduce((m,g)=>g.quality>m.quality?g:m),p=d.subtitles.map(m=>({needsProxy:!1,url:m.url.replace("https://convert-srt-to-vtt.vercel.app/?url=",""),type:Li.SRT,langIso:m.language}));return{embeds:[],stream:{streamUrl:h.url.replace("akm-cdn","aws-cdn").replace("gg-cdn","aws-cdn"),quality:F9[h.quality],type:Yt.HLS,captions:p}}}});const k0t="m4ufree.com",bp=`https://${k0t}`,O0t=`${bp}/search`,L0t=`${bp}/ajax`,P0t=`${bp}/ajaxtv`,N0t=/(.*) \(?(\d*|\d*-|\d*-\d*)\)?$/,D0t=/.*-(movie|tvshow)-online-free-m4ufree\.html/,M0t=/XSRF-TOKEN=(.*?);.*laravel_session=(.*?);/,F0t=/S(\d*)-E(\d*)/;function bv(t){return new DOMParser().parseFromString(t,"text/html")}Fi({id:"m4ufree",displayName:"m4ufree",rank:-1,disabled:!0,type:[ie.MOVIE,ie.SERIES],async scrape({media:t,type:e,episode:r,season:n}){var g,y,x,b,_;const i=((y=(g=t.meta.seasons)==null?void 0:g.find(S=>S.id===n))==null?void 0:y.number)||1,a=t.meta.type===ie.SERIES?((x=t.meta.seasonData.episodes.find(S=>S.id===r))==null?void 0:x.number)||1:void 0,s=[],o=await ge(`${O0t}/${encodeURIComponent(t.meta.title)}.html`);let c=bv(o);const u=[...c.querySelectorAll(".item")].map(S=>{var N;const w=(N=S.querySelector(".tiptitle p"))==null?void 0:N.innerHTML;if(!w)return;let R=N0t.exec(w);if(!R||!R[1]||!R[2])return;const I=R[1],T=Number(R[2].slice(0,4)),C=S.querySelector("a");if(!C)return;const L=C.href;if(R=D0t.exec(L),!R||!R[1])return;let H=R[1];return H=H==="tvshow"?"show":"movie",{type:H,title:I,year:T,href:L}}).filter(S=>S).find(S=>S&&S.title===t.meta.title&&S.year.toString()===t.meta.year);if(!u)return{embeds:s};let f="";const d=await ge(u.href,{onResponse(S){f=S.response.headers.get("X-Set-Cookie")}});c=bv(d);let h=M0t.exec(f);if(!h||!h[1]||!h[2])throw new Error("No regexResults, yikesssssss kinda gross idk");const p=`XSRF-TOKEN=${h[1]}; laravel_session=${h[2]}`,v=(b=c.querySelector('meta[name="csrf-token"]'))==null?void 0:b.getAttribute("content");if(!v)return{embeds:s};if(e===ie.SERIES){const w=[...c.querySelectorAll(".episode")].map(T=>{if(h=F0t.exec(T.innerHTML),!h||!h[1]||!h[2])return;const C=Number(h[1]),L=Number(h[2]);return{id:T.getAttribute("idepisode"),episode:C,season:L}}).filter(T=>T).find(T=>T&&T.episode===a&&T.season===i);if(!w)return{embeds:s};const R=`idepisode=${w.id}&_token=${v}`,I=await ge(P0t,{method:"POST",headers:{Accept:"*/*","Accept-Encoding":"gzip, deflate, br","Accept-Language":"en-US,en;q=0.9","Content-Type":"application/x-www-form-urlencoded;charset=UTF-8","X-Requested-With":"XMLHttpRequest","Sec-CH-UA":'"Not?A_Brand";v="8", "Chromium";v="108", "Microsoft Edge";v="108"',"Sec-CH-UA-Mobile":"?0","Sec-CH-UA-Platform":'"Linux"',"Sec-Fetch-Site":"same-origin","Sec-Fetch-Mode":"cors","Sec-Fetch-Dest":"empty","X-Cookie":p,"X-Origin":bp,"X-Referer":u.href},body:R});c=bv(I)}const m=[...c.querySelectorAll(".singlemv")].map(S=>S.getAttribute("data"));for(const S of m){const w=`m4u=${S}&_token=${v}`,R=await ge(L0t,{method:"POST",headers:{Accept:"*/*","Accept-Encoding":"gzip, deflate, br","Accept-Language":"en-US,en;q=0.9","Content-Type":"application/x-www-form-urlencoded;charset=UTF-8","X-Requested-With":"XMLHttpRequest","Sec-CH-UA":'"Not?A_Brand";v="8", "Chromium";v="108", "Microsoft Edge";v="108"',"Sec-CH-UA-Mobile":"?0","Sec-CH-UA-Platform":'"Linux"',"Sec-Fetch-Site":"same-origin","Sec-Fetch-Mode":"cors","Sec-Fetch-Dest":"empty","X-Cookie":p,"X-Origin":bp,"X-Referer":u.href},body:w}),T=(_=bv(R).querySelector("iframe"))==null?void 0:_.src,C=H=>H.startsWith("https://streamm4u.club")?Lr.STREAMM4U:H.startsWith("https://play.playm4u.xyz")?Lr.PLAYM4U:null;if(!T)continue;const L=C(T);L&&s.push({url:T,type:L})}return console.log(s),{embeds:s}}});const Ox="https://www.hdwatched.xyz",B0t={360:Ge.Q360P,540:Ge.Q540P,480:Ge.Q480P,720:Ge.Q720P,1080:Ge.Q1080P};function Lee(t){const r=new DOMParser().parseFromString(t,"text/html").querySelector("#vjsplayer > source");if(!r)throw new Error("Unable to fetch stream");const n=r.getAttribute("src"),i=r.getAttribute("res");if(!n||!i)throw new Error("Unable to find stream");return{streamUrl:n,quality:i&&typeof+i=="number"?B0t[+i]:Ge.QUNKNOWN}}async function U0t(t){const e=await ge(`/embed/${t.id}`,{baseURL:Ox});if(!new DOMParser().parseFromString(e,"text/html").querySelector("#vjsplayer > source"))throw new Error("Unable to fetch movie stream");return Lee(e)}async function j0t(t,{media:e,episode:r,progress:n}){var p;if(e.meta.type!==ie.SERIES)throw new Error("Media type mismatch");const i=e.meta.seasonData.number,a=(p=e.meta.seasonData.episodes.find(v=>v.id===r))==null?void 0:p.number;if(!i||!a)throw new Error("Unable to get season or episode number");const s=await ge(`${t.href}?season=${e.meta.seasonData.number}`,{baseURL:Ox}),c=new DOMParser().parseFromString(s,"text/html").querySelectorAll("div.i-container"),l=[];c.forEach(v=>{var y,x;const m=((y=v.querySelector("a"))==null?void 0:y.getAttribute("href"))||"",g=((x=v==null?void 0:v.querySelector("span.content-title"))==null?void 0:x.textContent)||"";l.push({title:g,href:m,id:m.split("/")[2]})});const u=l.find(v=>v.title.trim().toLowerCase()===`episode ${a}`);if(!u)throw new Error("Unable to find episode");n(70);const f=await ge(`/embed/${u.id}`,{baseURL:Ox});if(!new DOMParser().parseFromString(f,"text/html").querySelector("#vjsplayer > source"))throw new Error("Unable to fetch movie stream");return Lee(f)}Fi({id:"hdwatched",displayName:"HDwatched",rank:150,disabled:!0,type:[ie.MOVIE,ie.SERIES],async scrape(t){const{media:e,progress:r}=t;if(!e.imdbId)throw new Error("not enough info");if(!this.type.includes(e.meta.type))throw new Error("Unsupported type");const n=await ge(`/search/${e.imdbId}`,{baseURL:Ox}),a=new DOMParser().parseFromString(n,"text/html").querySelectorAll("div.i-container"),s=[];a.forEach(l=>{var h,p,v,m,g,y;const u=((h=l.querySelector("a"))==null?void 0:h.getAttribute("href"))||"",f=((p=l==null?void 0:l.querySelector("span.content-title"))==null?void 0:p.textContent)||"",d=parseInt(((y=(g=(m=(v=l==null?void 0:l.querySelector("div.duration"))==null?void 0:v.textContent)==null?void 0:m.trim())==null?void 0:g.split(" "))==null?void 0:y.pop())||"",10)||0;s.push({title:f,year:d,href:u,id:u.split("/")[2]})}),r(20);const o=s.find(l=>l.year===(e.meta.year?+e.meta.year:0));if(!o)throw new Error("Could not find stream");if(r(40),e.meta.type===ie.SERIES){const l=await j0t(o,t);return{embeds:[],stream:{streamUrl:l.streamUrl,quality:l.quality,type:Yt.MP4,captions:[]}}}const c=await U0t(o);return{embeds:[],stream:{streamUrl:c.streamUrl,quality:c.quality,type:Yt.MP4,captions:[]}}}});var H0t=$c();const Pee=Lx(H0t);var FI={},z0t={get exports(){return FI},set exports(t){FI=t}};(function(t,e){(function(r,n){t.exports=n(Fe())})(ve,function(r){return r.enc.Utf8})})(z0t);const Nee=FI,Gl="https://www.2embed.to";async function G0t(t){var l;const e=Pee.stringify(Nee.parse(Gl)).replace(/=/g,"."),r=await ge(`https://www.google.com/recaptcha/api.js?render=${t}`),n=r.substring(r.indexOf("/releases/")+10,r.indexOf("/recaptcha__en.js")),i=await ge(`https://www.google.com/recaptcha/api2/anchor?ar=1&hl=en&size=invisible&cb=flicklax&k=${t}&co=${e}&v=${n}`),a=(l=new DOMParser().parseFromString(i,"text/html").getElementById("recaptcha-token"))==null?void 0:l.getAttribute("value");if(!a)throw new Error("Unable to find cToken");const s={v:n,reason:"q",k:t,c:a,sa:"",co:Gl},c=(await ge(`https://www.google.com/recaptcha/api2/reload?${new URLSearchParams(s).toString()}`,{headers:{referer:"https://www.google.com/recaptcha/api2/"},method:"POST"})).match('rresp","(.+?)"');return c?c[1]:null}async function V0t(t,e){var b,_,S,w;const r=await ge(`${Gl}/ajax/embed/play?id=${t}&_token=${e}`,{headers:{Referer:Gl}}),n=new URL(r.link),i=n.pathname.split("/"),a=i[i.length-1],s=await ge(`${n.origin}/embed/m-download/${a}`,{headers:{referer:Gl}}),o=new DOMParser().parseFromString(s,"text/html"),c=Array.from(o.querySelectorAll(".dls-brand")).find(R=>{var I;return((I=R.textContent)==null?void 0:I.trim())==="Streamlare"});if(!c)throw new Error("Unable to find streamlare element");const l=(_=(b=c.nextElementSibling)==null?void 0:b.querySelector("a"))==null?void 0:_.href;if(!l)throw new Error("Unable to parse streamlare url");const u=[];o.querySelectorAll("#user_menu .dropdown-item").forEach(R=>{var C;const I=R.getAttribute("href"),T=(C=R.textContent)==null?void 0:C.trim().replace("Download","").trim();I&&T&&u.push({url:I,lang:T})});const d=await ge(l),p=(S=new DOMParser().parseFromString(d,"text/html").querySelector("head > meta:nth-child(3)"))==null?void 0:S.getAttribute("content");if(!p)throw new Error("Unable to find CSRF token");const v=(w=l.match("/[ve]/([^?#&/]+)"))==null?void 0:w[1];if(!v)throw new Error("Unable to get streamlare video id");const m=await ge(`${new URL(l).origin}/api/video/download/get`,{method:"POST",body:JSON.stringify({id:v}),headers:{"X-Requested-With":"XMLHttpRequest","X-CSRF-Token":p}});if(m.message!=="OK")throw new Error("Unable to fetch stream");const g=Array.isArray(m.result)?m.result[0]:m.result.Original;if(!g)throw new Error("Unable to get stream data");return{url:(await kFe(g.url,{method:"HEAD",referrer:new URL(l).origin})).headers.get("X-Final-Destination"),subtitles:u}}Fi({id:"2embed",displayName:"2Embed",rank:125,type:[ie.MOVIE,ie.SERIES],disabled:!0,async scrape({media:t,episode:e,progress:r}){var d,h;let n=`${Gl}/embed/tmdb/movie?id=${t.tmdbId}`;if(t.meta.type===ie.SERIES){const p=t.meta.seasonData.number,v=(d=t.meta.seasonData.episodes.find(m=>m.id===e))==null?void 0:d.number;n=`${Gl}/embed/tmdb/tv?id=${t.tmdbId}&s=${p}&e=${v}`}const i=await ge(n);r(20);const a=new DOMParser().parseFromString(i,"text/html"),o=Array.from(a.querySelectorAll(".item-server")).find(p=>{var v;return(v=p.textContent)==null?void 0:v.includes("Vidcloud")}),c=o?o.getAttribute("data-id"):null;if(!c)throw new Error("Unable to get source id");const l=(h=a.querySelector("body"))==null?void 0:h.getAttribute("data-recaptcha-key");if(!l)throw new Error("Unable to get site key");const u=await G0t(l);if(!u)throw new Error("Unable to fetch captcha token");r(35);const f=await V0t(c,u);if(!f.url)throw new Error("Unable to find stream url");return{embeds:[],stream:{streamUrl:f.url,quality:Ge.QUNKNOWN,type:Yt.MP4,captions:f.subtitles.map(p=>({langIso:p.lang,url:`https://cc.2cdns.com${new URL(p.url).pathname}`,type:Li.VTT}))}}}});const W0t="https://sflix.video";Fi({id:"sflix",displayName:"Sflix",rank:50,disabled:!0,type:[ie.MOVIE,ie.SERIES],async scrape({media:t,episode:e,progress:r}){var v,m,g,y,x;let n=`${t.meta.title} `;t.meta.type===ie.MOVIE&&(n+=t.meta.year??""),t.meta.type===ie.SERIES&&(n+=`S${String(t.meta.seasonData.number).padStart(2,"0")}`);const i=await ge(`/?s=${encodeURIComponent(n)}`,{baseURL:W0t}),s=(v=new DOMParser().parseFromString(i,"text/html").querySelector(".movies-list .ml-item:first-child a"))==null?void 0:v.getAttribute("href");if(!s)throw new Error("Movie does not exist");r(25);const o=await ge(s),c=new DOMParser().parseFromString(o,"text/html");r(45);let l=null;if(t.meta.type===ie.MOVIE)l=(m=c.querySelector("iframe"))==null?void 0:m.getAttribute("data-lazy-src");else if(t.meta.type===ie.SERIES){const b=Array.from(c.querySelectorAll(".desc p a")).map(w=>({title:w.getAttribute("title"),link:w.getAttribute("href")})),_=(g=t.meta.seasonData.episodes.find(w=>w.id===e))==null?void 0:g.number,S=b.find(w=>{var R;return(R=w.title)==null?void 0:R.endsWith(String(_).padStart(2,"0"))});if(!S)throw new Error("Episode does not exist");l=S.link}if(!l)throw new Error("Outer embed source not found");r(65);const u=await ge(l),d=(y=new DOMParser().parseFromString(u,"text/html").querySelector("iframe"))==null?void 0:y.getAttribute("src");if(!d)throw new Error("Embed source not found");const p=(x=(await ge(d)).match(/file\s*:\s*"([^"]+\.mp4)"/))==null?void 0:x[1];if(!p)throw new Error("Unable to get stream");return{embeds:[],stream:{streamUrl:p,quality:Ge.Q1080P,type:Yt.MP4,captions:[]}}}});const nu="https://gomovies.sx";Fi({id:"gomovies",displayName:"GOmovies",rank:200,type:[ie.MOVIE,ie.SERIES],async scrape({media:t,episode:e}){var d,h;const r=await ge("/ajax/search",{baseURL:nu,method:"POST",body:JSON.stringify({keyword:t.meta.title}),headers:{"X-Requested-With":"XMLHttpRequest"}}),i=new DOMParser().parseFromString(r,"text/html").querySelectorAll("a.nav-item"),s=Array.from(i).map(p=>{var y,x;const v=(y=p==null?void 0:p.querySelector("h3.film-name"))==null?void 0:y.textContent,m=(x=p==null?void 0:p.querySelector("div.film-infor span:first-of-type"))==null?void 0:x.textContent,g=p.getAttribute("href");return{name:v,year:m,path:g}}).find(p=>p.name===t.meta.title&&(t.meta.type===ie.MOVIE?p.year===t.meta.year:!0));if(!(s!=null&&s.path))throw new Error("Media not found");let o=(d=s.path.split("-").pop())==null?void 0:d.replace("/",""),c=null;if(t.meta.type===ie.SERIES){const p=await ge(`/ajax/v2/tv/seasons/${o}`,{baseURL:nu,headers:{"X-Requested-With":"XMLHttpRequest"}}),m=[...new DOMParser().parseFromString(p,"text/html").querySelectorAll(".ss-item")].map(R=>({number:R.innerHTML.replace("Season ",""),dataId:R.getAttribute("data-id")})),g=t.meta.seasonData.number,y=m.find(R=>+R.number===g);if(!y)throw new Error("Season not found");const x=await ge(`/ajax/v2/season/episodes/${y.dataId}`,{baseURL:nu,headers:{"X-Requested-With":"XMLHttpRequest"}}),b=new DOMParser().parseFromString(x,"text/html").querySelectorAll(".eps-item"),_=Array.from(b).map(R=>{var I,T;return{dataId:R.getAttribute("data-id"),number:(T=(I=R.querySelector("strong"))==null?void 0:I.textContent)==null?void 0:T.replace("Eps","").replace(":","").trim()}}),S=(h=t.meta.seasonData.episodes.find(R=>R.id===e))==null?void 0:h.number,w=_.find(R=>R.number?+R.number===S:!1);if(!(w!=null&&w.dataId))throw new Error("Episode not found");o=w.dataId,c=await ge(`/ajax/v2/episode/servers/${o}`,{baseURL:nu,headers:{"X-Requested-With":"XMLHttpRequest"}})}else c=await ge(`/ajax/movie/episodes/${o}`,{baseURL:nu,headers:{"X-Requested-With":"XMLHttpRequest"}});const l=new DOMParser().parseFromString(c,"text/html").querySelector('a[title*="upcloud" i]'),u=(l==null?void 0:l.getAttribute("data-id"))??(l==null?void 0:l.getAttribute("data-linkid"));if(!u)throw new Error("Upcloud source not available");const f=await ge(`/ajax/sources/${u}`,{baseURL:nu,headers:{"X-Requested-With":"XMLHttpRequest"}});if(!f.link||f.type!=="iframe")throw new Error("No upcloud stream found");return{embeds:[{type:Lr.UPCLOUD,url:f.link}]}}});const B9="https://kissasian.li",K0t=[{type:Lr.MP4UPLOAD,id:"mp"},{type:Lr.STREAMSB,id:"sb"}];Fi({id:"kissasian",displayName:"KissAsian",rank:130,type:[ie.MOVIE,ie.SERIES],async scrape({media:t,episode:e,progress:r}){var m;let n="",i="";t.meta.type===ie.SERIES&&(n=t.meta.seasonData.number===1?"":`${t.meta.seasonData.number}`,i=`${((m=t.meta.seasonData.episodes.find(g=>g.id===e))==null?void 0:m.number)??""}`);const a=new FormData;a.append("keyword",`${t.meta.title} ${n}`.trim()),a.append("type","Drama");const s=await ge("/Search/SearchSuggest",{baseURL:B9,method:"POST",body:a}),o=new DOMParser().parseFromString(s,"text/html"),c=Array.from(o.querySelectorAll("a")).map(g=>({name:g.textContent,url:g.href})),l=c.find(g=>{var y;return((y=g.name)==null?void 0:y.toLowerCase())===t.meta.title.toLowerCase()})??c[0];if(!l)throw new Error("Drama not found");r(30);const u=await ge(l.url),d=new DOMParser().parseFromString(u,"text/html").querySelectorAll("tbody tr:not(:first-child)"),h=Array.from(d).map(g=>{var b,_,S,w;const y=(S=(_=(b=g==null?void 0:g.querySelector("td.episodeSub a"))==null?void 0:b.textContent)==null?void 0:_.split("Episode")[1])==null?void 0:S.trim(),x=(w=g==null?void 0:g.querySelector("td.episodeSub a"))==null?void 0:w.getAttribute("href");return{number:y,url:x}}).filter(g=>!!g.url),p=t.meta.type===ie.MOVIE?h[0]:h.find(g=>g.number===`${i}`);if(!(p!=null&&p.url))throw new Error("Episode not found");r(70);let v=await Promise.all(K0t.map(async g=>{var _;const y=await ge(`${p.url}&s=${g.id}`,{baseURL:B9}),b=(_=new DOMParser().parseFromString(y,"text/html").querySelector("iframe[id=my_video_1]"))==null?void 0:_.getAttribute("src");return{type:g.type,url:b??""}}));return v=v.filter(g=>g.url!==""),{embeds:v}}});const Y0t="https://us-west2-compute-proxied.streamflix.one",q0t={360:Ge.Q360P,540:Ge.Q540P,480:Ge.Q480P,720:Ge.Q720P,1080:Ge.Q1080P};Fi({id:"streamflix",displayName:"StreamFlix",disabled:!1,rank:69,type:[ie.MOVIE,ie.SERIES],async scrape({media:t,episode:e,progress:r}){var o;if(!this.type.includes(t.meta.type))throw new Error("Unsupported type");r(30);const n=t.meta.type===ie.MOVIE?"movies":"tv";let i,a;t.meta.type===ie.SERIES&&(i=t.meta.seasonData.number,a=(o=t.meta.seasonData.episodes.find(c=>c.id===e))==null?void 0:o.number);const s=await ge(`/api/player/${n}`,{baseURL:Y0t,params:{id:t.tmdbId,s:i,e:a}});if(!s.headers.Referer)throw new Error("No watchable item found");return r(90),{embeds:[],stream:{streamUrl:s.sources[0].url,quality:q0t[s.sources[0].quality],type:Yt.HLS,captions:s.subtitles.map(c=>({needsProxy:!0,url:c.url,type:Li.VTT,langIso:c.lang}))}}}});const X0t="https://fsa.remotestre.am";Fi({id:"remotestream",displayName:"Remote Stream",disabled:!1,rank:55,type:[ie.MOVIE,ie.SERIES],async scrape({media:t,episode:e,progress:r}){var s;if(!this.type.includes(t.meta.type))throw new Error("Unsupported type");r(30);const n=t.meta.type===ie.MOVIE?"Movies":"Shows";let i=`${X0t}/${n}/${t.tmdbId}`;if(t.meta.type===ie.SERIES){const o=t.meta.seasonData.number,c=(s=t.meta.seasonData.episodes.find(l=>l.id===e))==null?void 0:s.number;i+=`/${o}/${c}/${c}.m3u8`}else i+=`/${t.tmdbId}.m3u8`;if((await qk(i)).type!=="application/x-mpegurl")throw new Error("No watchable item found");return r(90),{embeds:[],stream:{streamUrl:i,quality:Ge.QUNKNOWN,type:Yt.HLS,captions:[]}}}});const Dee="streamm4u.club",Q0t=`https://${Dee}`,Z0t=`${Q0t}/api`,U9=`${Z0t}/source`;async function J0t(t){const e=[],r=t.split("/").pop();console.log(`${U9}/${r}`);const n=await ge(`${U9}/${r}`,{method:"POST",body:`r=&d=${Dee}`});if(n.success){const i=n.data;for(const a of i)e.push({embedId:"",streamUrl:a.file,quality:a.label,type:a.type,captions:[]})}return e}um({id:"streamm4u",displayName:"streamm4u",for:Lr.STREAMM4U,rank:100,async getStream({progress:t,url:e}){const n=(await J0t(e)).sort((i,a)=>Number(a.quality.replace("p",""))-Number(i.quality.replace("p","")))[0];if(!n)throw new Error("No source found");return t(100),n}});um({id:"playm4u",displayName:"playm4u",for:Lr.PLAYM4U,rank:0,async getStream(){return{embedId:"",streamUrl:"",quality:Ge.Q1080P,captions:[],type:Yt.MP4}}});function ept(t){try{return JSON.parse(t),!0}catch{return!1}}um({id:"upcloud",displayName:"UpCloud",for:Lr.UPCLOUD,rank:200,async getStream({url:t}){const e=new URL(t.replace("embed-5","embed-4")),r=e.pathname.split("/"),n=r[r.length-1],i=await ge(`${e.origin}/ajax/embed-4/getSources?id=${n}`,{headers:{Referer:e.origin,"X-Requested-With":"XMLHttpRequest"}});let a=null;if(!ept(i.sources)){const s=JSON.parse(await ge("https://raw.githubusercontent.com/enimax-anime/key/e4/key.txt"));let o="";const c=i.sources.split("");for(const f of s)for(let d=f[0];ds.kind==="captions").map(s=>({langIso:s.label,url:s.file,type:s.file.endsWith("vtt")?Li.VTT:Li.UNKNOWN}))}}});const j9=[Ge.Q1080P,Ge.Q720P,Ge.Q480P,Ge.Q360P];async function tpt(t,e){var u;const r=Pee.stringify(Nee.parse(t)).replace(/=/g,"."),n=await ge(`https://www.google.com/recaptcha/api.js?render=${e}`),i=n.substring(n.indexOf("/releases/")+10,n.indexOf("/recaptcha__en.js")),a=await ge(`https://www.google.com/recaptcha/api2/anchor?ar=1&hl=en&size=invisible&cb=flicklax&k=${e}&co=${r}&v=${i}`),s=(u=new DOMParser().parseFromString(a,"text/html").getElementById("recaptcha-token"))==null?void 0:u.getAttribute("value");if(!s)throw new Error("Unable to find cToken");const o={v:i,reason:"q",k:e,c:s,sa:"",co:t},l=(await ge(`https://www.google.com/recaptcha/api2/reload?${new URLSearchParams(o).toString()}`,{headers:{referer:"https://www.google.com/recaptcha/api2/"},method:"POST"})).match('rresp","(.+?)"');return l?l[1]:null}um({id:"streamsb",displayName:"StreamSB",for:Lr.STREAMSB,rank:150,async getStream({url:t,progress:e}){var d;const r=t.replace(".html","").replace("embed-","").replace("e/","").replace("d/",""),n=new URL(r),i=await ge(`${n.origin}/d${n.pathname}`);e(20);const a=n.searchParams.get("caption_1"),s=n.searchParams.get("sub_1"),c=new DOMParser().parseFromString(i,"text/html").querySelectorAll("[onclick^=download_video]");let l=[];for(const h of c){const p=h.getAttribute("onclick"),m=/download_video\('(.+?)','(.+?)','(.+?)'\)/.exec(p??"");if(m!==null){const g=(d=h.querySelector("span"))==null?void 0:d.textContent,x=/(.+?) \((.+?)\)/.exec(g??"");x!==null&&l.push({parameters:[m[1],m[2],m[3]],quality:{label:x[1].trim(),size:x[2]}})}}l=l.sort((h,p)=>{const v=j9.indexOf(h.quality.label),m=j9.indexOf(p.quality.label);return v-m}),e(40);let u=await Promise.all(l.map(async h=>{var _,S;const p=await ge(`/dl?op=download_orig&id=${h.parameters[0]}&mode=${h.parameters[1]}&hash=${h.parameters[2]}`,{baseURL:n.origin}),m=(_=new DOMParser().parseFromString(p,"text/html").querySelector(".g-recaptcha"))==null?void 0:_.getAttribute("data-sitekey");if(!m)throw new Error("Unable to get captcha key");const g=await tpt(n.origin,m);if(!g)throw new Error("Unable to get captcha token");const y=new FormData;y.append("op","download_orig"),y.append("id",h.parameters[0]),y.append("mode",h.parameters[1]),y.append("hash",h.parameters[2]),y.append("g-recaptcha-response",g);const x=await ge(`/dl?op=download_orig&id=${h.parameters[0]}&mode=${h.parameters[1]}&hash=${h.parameters[2]}`,{baseURL:n.origin,method:"POST",body:y}),b=(S=new DOMParser().parseFromString(x,"text/html").querySelector(".btn.btn-light.btn-lg"))==null?void 0:S.getAttribute("href");return{quality:h.quality.label,url:b,size:h.quality.size,captions:a&&s?[{url:a,langIso:s,type:Li.VTT}]:[]}}));u=u.filter(h=>!!h.url),e(60);const f=u[0];if(!f.url)throw new Error("No stream url found");return{embedId:Lr.STREAMSB,streamUrl:f.url,quality:f.quality,captions:f.captions,type:Yt.MP4}}});um({id:"mp4upload",displayName:"mp4upload",for:Lr.MP4UPLOAD,rank:170,async getStream({url:t}){const e=await ge(t),r=new RegExp('(?<=player\\.src\\()\\s*{\\s*type:\\s*"[^"]+",\\s*src:\\s*"([^"]+)"\\s*}\\s*(?=\\);)',"s"),i=e.match(r)[1];if(!i)throw new Error("Stream url not found");return{embedId:Lr.MP4UPLOAD,streamUrl:i,quality:Ge.Q1080P,captions:[],type:Yt.MP4}}});e5e();var G9;const H9=((G9=window==null?void 0:window.__CONFIG__)==null?void 0:G9.VITE_KEY)??{}.VITE_KEY??null;H9&&window.initMW(Er().PROXY_URLS,H9);mHe();eMe({immediate:!0});const rpt=ce.lazy(async()=>(await MMe(),await JFe(),lr.changeLanguage(gq.get().language??"en"),{default:Oct}));function npt(t){return Er().NORMAL_ROUTER?E(K8e,{children:t.children}):E(Y8e,{children:t.children})}W4e.render(E(ce.StrictMode,{children:E(BMe,{children:E(npt,{children:E(A.Suspense,{fallback:"",children:E(rpt,{})})})})}),document.getElementById("root"));export{vZ as A,bct as B,AB as D,va as H,Yt as M,gZ as N,rUe as S,qlt as T,rWe as V,E as a,lm as b,g5e as c,Ge as d,ie as e,Y as j,A as r}; diff --git a/RetroTV/assets/index-a6b6f969.css b/RetroTV/assets/index-a6b6f969.css new file mode 100644 index 00000000..b5f72a46 --- /dev/null +++ b/RetroTV/assets/index-a6b6f969.css @@ -0,0 +1 @@ +.spinner{font-size:48px;width:1em;height:1em;border:.12em solid var(--color,white);border-bottom-color:transparent;border-radius:50%;display:inline-block;box-sizing:border-box;animation:spinner-rotation .8s linear infinite}@keyframes spinner-rotation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*{scrollbar-color:initial;scrollbar-width:initial}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.invisible{visibility:hidden}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0px}.inset-x-0{left:0px;right:0px}.inset-y-0{top:0px;bottom:0px}.-bottom-24{bottom:-6rem}.bottom-0{bottom:0px}.bottom-10{bottom:2.5rem}.bottom-12{bottom:3rem}.bottom-24{bottom:6rem}.bottom-4{bottom:1rem}.left-0{left:0px}.left-1\/2{left:50%}.left-5{left:1.25rem}.right-0{right:0px}.right-2{right:.5rem}.top-0{top:0px}.top-10{top:2.5rem}.top-2{top:.5rem}.z-0{z-index:0}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-50{z-index:50}.z-\[1000\]{z-index:1000}.z-\[100\]{z-index:100}.z-\[99999\]{z-index:99999}.z-\[9999\]{z-index:9999}.z-\[999\]{z-index:999}.float-right{float:right}.-m-3{margin:-.75rem}.-mx-2{margin-left:-.5rem;margin-right:-.5rem}.-my-3{margin-top:-.75rem;margin-bottom:-.75rem}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-8{margin-left:2rem;margin-right:2rem}.mx-\[0\.6em\]{margin-left:.6em;margin-right:.6em}.mx-auto{margin-left:auto;margin-right:auto}.my-3{margin-top:.75rem;margin-bottom:.75rem}.my-4{margin-top:1rem;margin-bottom:1rem}.my-6{margin-top:1.5rem;margin-bottom:1.5rem}.-mb-3{margin-bottom:-.75rem}.-ml-2{margin-left:-.5rem}.mb-1{margin-bottom:.25rem}.mb-12{margin-bottom:3rem}.mb-16{margin-bottom:4rem}.mb-2{margin-bottom:.5rem}.mb-24{margin-bottom:6rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-2{margin-left:.5rem}.ml-8{margin-left:2rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mr-auto{margin-right:auto}.mt-1{margin-top:.25rem}.mt-10{margin-top:2.5rem}.mt-12{margin-top:3rem}.mt-16{margin-top:4rem}.mt-3{margin-top:.75rem}.mt-40{margin-top:10rem}.mt-44{margin-top:11rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.mt-\[20px\]{margin-top:20px}.line-clamp-3{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.aspect-\[2\/1\]{aspect-ratio:2/1}.aspect-\[2\/3\]{aspect-ratio:2/3}.aspect-video{aspect-ratio:16 / 9}.\!h-2{height:.5rem!important}.h-0{height:0px}.h-1{height:.25rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-16{height:4rem}.h-2{height:.5rem}.h-24{height:6rem}.h-3{height:.75rem}.h-4{height:1rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-96{height:24rem}.h-\[100dvh\]{height:100dvh}.h-\[100vh\]{height:100vh}.h-\[18px\]{height:18px}.h-\[20\%\]{height:20%}.h-\[200px\]{height:200px}.h-\[300px\]{height:300px}.h-full{height:100%}.h-screen{height:100vh}.max-h-0{max-height:0px}.max-h-14{max-height:3.5rem}.max-h-60{max-height:15rem}.max-h-\[4\.5rem\]{max-height:4.5rem}.min-h-\[150px\]{min-height:150px}.min-h-\[1rem\]{min-height:1rem}.min-h-screen{min-height:100vh}.\!w-24{width:6rem!important}.w-0{width:0px}.w-0\.5{width:.125rem}.w-1{width:.25rem}.w-10{width:2.5rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-20{width:5rem}.w-3{width:.75rem}.w-4{width:1rem}.w-40{width:10rem}.w-44{width:11rem}.w-48{width:12rem}.w-72{width:18rem}.w-8{width:2rem}.w-\[1\.5px\]{width:1.5px}.w-\[18px\]{width:18px}.w-\[220px\]{width:220px}.w-\[3000px\]{width:3000px}.w-\[400px\]{width:400px}.w-\[500px\]{width:500px}.w-\[600px\]{width:600px}.w-\[700px\]{width:700px}.w-full{width:100%}.w-px{width:1px}.w-screen{width:100vw}.min-w-0{min-width:0px}.min-w-\[140px\]{min-width:140px}.min-w-\[1rem\]{min-width:1rem}.max-w-\[18rem\]{max-width:18rem}.max-w-\[400px\]{max-width:400px}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-sm{max-width:24rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.origin-bottom-left{transform-origin:bottom left}.origin-top-left{transform-origin:top left}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-x-full{--tw-translate-x: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-4{--tw-translate-y: -1rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-1\/2{--tw-translate-x: 50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-2{--tw-translate-x: .5rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-full{--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-4{--tw-translate-y: 1rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rotate-90{--tw-rotate: -90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-\[30deg\]{--tw-rotate: 30deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\!scale-\[400\%\]{--tw-scale-x: 400% !important;--tw-scale-y: 400% !important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.scale-100{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-75{--tw-scale-x: .75;--tw-scale-y: .75;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes loading-pin{0%,40%,to{height:.5em;background-color:#282336}20%{height:1em;background-color:#fff}}.animate-loading-pin{animation:loading-pin 1.8s ease-in-out infinite}.cursor-default{cursor:default}.cursor-none{cursor:none}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize{resize:both}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-\[56px\,1fr\,56px\]{grid-template-columns:56px 1fr 56px}.grid-rows-\[1fr\]{grid-template-rows:1fr}.grid-rows-\[auto\,minmax\(0\,1fr\)\]{grid-template-rows:auto minmax(0,1fr)}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-10{gap:2.5rem}.gap-2{gap:.5rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-\[16px\]{gap:16px}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.75rem * var(--tw-space-x-reverse));margin-left:calc(.75rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-8>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(2rem * var(--tw-space-x-reverse));margin-left:calc(2rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-16>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(4rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(4rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-\[100\%\]{border-radius:100%}.rounded-\[20px\]{border-radius:20px}.rounded-\[28px\]{border-radius:28px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.rounded-r-full{border-top-right-radius:9999px;border-bottom-right-radius:9999px}.border-2{border-width:2px}.border-bink-600{--tw-border-opacity: 1;border-color:rgb(168 127 209 / var(--tw-border-opacity))}.border-transparent{border-color:transparent}.\!bg-denim-500{--tw-bg-opacity: 1 !important;background-color:rgb(56 51 74 / var(--tw-bg-opacity))!important}.bg-\[\#1C161B\]{--tw-bg-opacity: 1;background-color:rgb(28 22 27 / var(--tw-bg-opacity))}.bg-\[\#C93957\]{--tw-bg-opacity: 1;background-color:rgb(201 57 87 / var(--tw-bg-opacity))}.bg-\[rgba\(8\,6\,18\,0\.85\)\]{background-color:#080612d9}.bg-ash-200{--tw-bg-opacity: 1;background-color:rgb(43 40 54 / var(--tw-bg-opacity))}.bg-ash-300{--tw-bg-opacity: 1;background-color:rgb(44 41 58 / var(--tw-bg-opacity))}.bg-ash-400{--tw-bg-opacity: 1;background-color:rgb(61 57 77 / var(--tw-bg-opacity))}.bg-ash-500{--tw-bg-opacity: 1;background-color:rgb(156 147 181 / var(--tw-bg-opacity))}.bg-bink-100{--tw-bg-opacity: 1;background-color:rgb(67 36 73 / var(--tw-bg-opacity))}.bg-bink-200{--tw-bg-opacity: 1;background-color:rgb(65 43 87 / var(--tw-bg-opacity))}.bg-bink-300{--tw-bg-opacity: 1;background-color:rgb(83 54 112 / var(--tw-bg-opacity))}.bg-bink-400{--tw-bg-opacity: 1;background-color:rgb(113 76 151 / var(--tw-bg-opacity))}.bg-bink-500{--tw-bg-opacity: 1;background-color:rgb(141 102 181 / var(--tw-bg-opacity))}.bg-bink-600{--tw-bg-opacity: 1;background-color:rgb(168 127 209 / var(--tw-bg-opacity))}.bg-bink-700{--tw-bg-opacity: 1;background-color:rgb(205 151 214 / var(--tw-bg-opacity))}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}.bg-denim-100{--tw-bg-opacity: 1;background-color:rgb(18 15 29 / var(--tw-bg-opacity))}.bg-denim-200{--tw-bg-opacity: 1;background-color:rgb(25 21 38 / var(--tw-bg-opacity))}.bg-denim-300{--tw-bg-opacity: 1;background-color:rgb(33 29 48 / var(--tw-bg-opacity))}.bg-denim-400{--tw-bg-opacity: 1;background-color:rgb(43 38 61 / var(--tw-bg-opacity))}.bg-denim-500{--tw-bg-opacity: 1;background-color:rgb(56 51 74 / var(--tw-bg-opacity))}.bg-denim-600{--tw-bg-opacity: 1;background-color:rgb(80 75 100 / var(--tw-bg-opacity))}.bg-gray-300{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity))}.bg-gray-500{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity))}.bg-slate-800{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.bg-zinc-800{--tw-bg-opacity: 1;background-color:rgb(39 39 42 / var(--tw-bg-opacity))}.\!bg-opacity-100{--tw-bg-opacity: 1 !important}.bg-opacity-0{--tw-bg-opacity: 0}.bg-opacity-20{--tw-bg-opacity: .2}.bg-opacity-30{--tw-bg-opacity: .3}.bg-opacity-50{--tw-bg-opacity: .5}.bg-opacity-80{--tw-bg-opacity: .8}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.bg-gradient-to-l{background-image:linear-gradient(to left,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.from-black{--tw-gradient-from: #000 var(--tw-gradient-from-position);--tw-gradient-from-position: ;--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-from-position);--tw-gradient-to-position: ;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-denim-100{--tw-gradient-from: #120F1D var(--tw-gradient-from-position);--tw-gradient-from-position: ;--tw-gradient-to: rgb(18 15 29 / 0) var(--tw-gradient-from-position);--tw-gradient-to-position: ;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-denim-300{--tw-gradient-from: #211D30 var(--tw-gradient-from-position);--tw-gradient-from-position: ;--tw-gradient-to: rgb(33 29 48 / 0) var(--tw-gradient-from-position);--tw-gradient-to-position: ;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-denim-300{--tw-gradient-via-position: ;--tw-gradient-to: rgb(33 29 48 / 0) var(--tw-gradient-to-position);--tw-gradient-to-position: ;--tw-gradient-stops: var(--tw-gradient-from), #211D30 var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position);--tw-gradient-to-position: }.bg-cover{background-size:cover}.bg-center{background-position:center}.fill-transparent{fill:transparent}.stroke-ash-500{stroke:#9c93b5}.stroke-current{stroke:currentColor}.stroke-denim-700{stroke:#7a758f}.stroke-\[15\]{stroke-width:15}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-5{padding:1.25rem}.px-10{padding-left:2.5rem;padding-right:2.5rem}.px-12{padding-left:3rem;padding-right:3rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-7{padding-left:1.75rem;padding-right:1.75rem}.px-8{padding-left:2rem;padding-right:2rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-48{padding-top:12rem;padding-bottom:12rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-64{padding-top:16rem;padding-bottom:16rem}.pb-2{padding-bottom:.5rem}.pl-10{padding-left:2.5rem}.pl-12{padding-left:3rem}.pl-3{padding-left:.75rem}.pr-1{padding-right:.25rem}.pr-10{padding-right:2.5rem}.pr-2{padding-right:.5rem}.pr-4{padding-right:1rem}.pt-0{padding-top:0}.pt-1{padding-top:.25rem}.pt-\[40px\]{padding-top:40px}.text-left{text-align:left}.text-center{text-align:center}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-5xl{font-size:3rem;line-height:1}.text-\[0\.85em\]{font-size:.85em}.text-\[1em\]{font-size:1em}.text-base{font-size:1rem;line-height:1.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.leading-7{line-height:1.75rem}.text-\[\#1C161B\]{--tw-text-opacity: 1;color:rgb(28 22 27 / var(--tw-text-opacity))}.text-bink-600{--tw-text-opacity: 1;color:rgb(168 127 209 / var(--tw-text-opacity))}.text-bink-700{--tw-text-opacity: 1;color:rgb(205 151 214 / var(--tw-text-opacity))}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.text-denim-700{--tw-text-opacity: 1;color:rgb(122 117 143 / var(--tw-text-opacity))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity))}.text-rose-400{--tw-text-opacity: 1;color:rgb(251 113 133 / var(--tw-text-opacity))}.text-slate-300{--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.placeholder-denim-700::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(122 117 143 / var(--tw-placeholder-opacity))}.placeholder-denim-700::placeholder{--tw-placeholder-opacity: 1;color:rgb(122 117 143 / var(--tw-placeholder-opacity))}.\!opacity-0{opacity:0!important}.\!opacity-100{opacity:1!important}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-25{opacity:.25}.opacity-50{opacity:.5}.opacity-75{opacity:.75}.opacity-90{opacity:.9}.shadow-\[inset_0_0_0_2px\]{--tw-shadow: inset 0 0 0 2px;--tw-shadow-colored: inset 0 0 0 2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-bink-500{--tw-shadow-color: #8D66B5;--tw-shadow: var(--tw-shadow-colored)}.outline-denim-700{outline-color:#7a758f}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-black{--tw-ring-opacity: 1;--tw-ring-color: rgb(0 0 0 / var(--tw-ring-opacity))}.ring-opacity-5{--tw-ring-opacity: .05}.brightness-100{--tw-brightness: brightness(1);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.grayscale{--tw-grayscale: grayscale(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[background-color\,color\,transform\,border-color\]{transition-property:background-color,color,transform,border-color;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[background-color\,color\]{transition-property:background-color,color;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[background-color\,transform\]{transition-property:background-color,transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[border-radius\]{transition-property:border-radius;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[bottom\]{transition-property:bottom;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[height\]{transition-property:height;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[opacity\,transform\]{transition-property:opacity,transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[opacity\]{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[stroke-dashoffset\]{transition-property:stroke-dashoffset;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[transform\,background-color\]{transition-property:transform,background-color;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[transform\,opacity\]{transition-property:transform,opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[transform\]{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[width\,opacity\]{transition-property:width,opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[width\]{transition-property:width;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-100{transition-duration:.1s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-75{transition-duration:75ms}.duration-\[400ms\]{transition-duration:.4s}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.scrollbar-thin{--scrollbar-track: initial;--scrollbar-thumb: initial;--scrollbar-corner: initial;--scrollbar-track-hover: var(--scrollbar-track);--scrollbar-thumb-hover: var(--scrollbar-thumb);--scrollbar-corner-hover: var(--scrollbar-corner);--scrollbar-track-active: var(--scrollbar-track-hover);--scrollbar-thumb-active: var(--scrollbar-thumb-hover);--scrollbar-corner-active: var(--scrollbar-corner-hover);scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);overflow:overlay}.scrollbar-thin.overflow-x-hidden{overflow-x:hidden}.scrollbar-thin.overflow-y-hidden{overflow-y:hidden}.scrollbar-thin::-webkit-scrollbar-track{background-color:var(--scrollbar-track)}.scrollbar-thin::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb)}.scrollbar-thin::-webkit-scrollbar-corner{background-color:var(--scrollbar-corner)}.scrollbar-thin::-webkit-scrollbar-track:hover{background-color:var(--scrollbar-track-hover)}.scrollbar-thin::-webkit-scrollbar-thumb:hover{background-color:var(--scrollbar-thumb-hover)}.scrollbar-thin::-webkit-scrollbar-corner:hover{background-color:var(--scrollbar-corner-hover)}.scrollbar-thin::-webkit-scrollbar-track:active{background-color:var(--scrollbar-track-active)}.scrollbar-thin::-webkit-scrollbar-thumb:active{background-color:var(--scrollbar-thumb-active)}.scrollbar-thin::-webkit-scrollbar-corner:active{background-color:var(--scrollbar-corner-active)}.scrollbar-thin{scrollbar-width:thin}.scrollbar-thin::-webkit-scrollbar{width:8px;height:8px}.scrollbar-track-denim-400{--scrollbar-track: #2B263D !important}.scrollbar-thumb-denim-200{--scrollbar-thumb: #191526 !important}.\[--color\:\#9C93B5\]{--color: #9C93B5}.\[animation-delay\:150ms\]{animation-delay:.15s}.\[animation-delay\:300ms\]{animation-delay:.3s}.\[animation-delay\:450ms\]{animation-delay:.45s}.\[border-left\:env\(safe-area-inset-left\)_solid_transparent\]{border-left:env(safe-area-inset-left) solid transparent}.\[border-right\:env\(safe-area-inset-right\)_solid_transparent\]{border-right:env(safe-area-inset-right) solid transparent}.\[margin-bottom\:env\(safe-area-inset-bottom\)\]{margin-bottom:env(safe-area-inset-bottom)}.\[text-shadow\:0_2px_4px_rgba\(0\,0\,0\,0\.5\)\]{text-shadow:0 2px 4px rgba(0,0,0,.5)}html,body{overflow-x:hidden;--tw-bg-opacity: 1;background-color:rgb(18 15 29 / var(--tw-bg-opacity));font-family:Open Sans;--tw-text-opacity: 1;color:rgb(122 117 143 / var(--tw-text-opacity))}html.scrollbar,body.scrollbar,html.scrollbar-thin,body.scrollbar-thin{overflow-x:hidden}html,body{min-height:100vh;min-height:100dvh}html[data-full],html[data-full] body{overscroll-behavior-y:none}body[data-no-scroll]{overflow-y:hidden;height:100vh}#root{padding:.05px;min-height:100vh;min-height:100dvh;width:100%}body[data-no-select]{-webkit-user-select:none;-moz-user-select:none;user-select:none}.roll{animation:roll 1s}@keyframes roll{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.line-clamp{display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden}.google-cast-button:not(.casting) google-cast-launcher{--tw-brightness: brightness(500);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.is-mobile-view .overflow-y-auto{height:60vh}:root{--slider-height: .25rem;--slider-border-radius: 1em;--slider-progress-background: #8652bb}input[type=range].styled-slider{height:var(--slider-height);-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:var(--slider-border-radius);background:#1C161B}input[type=range].styled-slider.slider-progress{--range: calc(var(--max) - var(--min));--ratio: calc((var(--value) - var(--min)) / var(--range));--sx: calc(.5 * 1rem + var(--ratio) * (100% - 1rem))}input[type=range].styled-slider::-webkit-slider-thumb{-webkit-appearance:none;width:1rem;height:1rem;border-radius:var(--slider-border-radius);background:#FFFFFF;border:none;box-shadow:0 0 2px #000;margin-top:calc(.125em - .5rem)}input[type=range].styled-slider::-webkit-slider-runnable-track{height:var(--slider-height);border:none;box-shadow:none;border-radius:var(--slider-border-radius)}input[type=range].styled-slider::-webkit-slider-thumb:hover{background:#DCDCDC}input[type=range].styled-slider.slider-progress::-webkit-slider-runnable-track{background:linear-gradient(var(--slider-progress-background),var(--slider-progress-background)) 0/var(--sx) 100% no-repeat,#1C161B}input[type=range].styled-slider::-moz-range-thumb{width:1rem;height:1rem;border-radius:var(--slider-border-radius);background:#FFFFFF;border:none;box-shadow:0 0 2px #000}input[type=range].styled-slider::-moz-range-track{height:var(--slider-height);border:none;border-radius:var(--slider-border-radius);background:#1C161B;box-shadow:none}input[type=range].styled-slider::-moz-range-thumb:hover{background:#DCDCDC}input[type=range].styled-slider.slider-progress::-moz-range-track{background:linear-gradient(var(--slider-progress-background),var(--slider-progress-background)) 0/var(--sx) 100% no-repeat,#1C161B}input[type=range].styled-slider::-ms-fill-upper{background:transparent;border-color:transparent}input[type=range].styled-slider::-ms-fill-lower{background:transparent;border-color:transparent}input[type=range].styled-slider::-ms-thumb{width:1rem;height:1rem;border-radius:var(--slider-border-radius);background:#FFFFFF;border:none;box-shadow:0 0 2px #000;margin-top:0;box-sizing:border-box}input[type=range].styled-slider::-ms-track{height:var(--slider-height);border-radius:var(--slider-border-radius);background:#1C161B;border:none;box-shadow:none;box-sizing:border-box}input[type=range].styled-slider::-ms-thumb:hover{background:#DCDCDC}input[type=range].styled-slider.slider-progress::-ms-fill-lower{height:var(--slider-height);border-radius:var(--slider-border-radius) 0 0 5px;margin:-undefined 0 -undefined -undefined;background:var(--slider-progress-background);border:none;border-right-width:0}::-webkit-scrollbar-track{background-color:transparent}::-webkit-scrollbar-thumb{background-color:#38334a;border:5px solid transparent;border-left:0;background-clip:content-box}::-webkit-scrollbar{width:13px}.focus-within\:bg-denim-400:focus-within{--tw-bg-opacity: 1;background-color:rgb(43 38 61 / var(--tw-bg-opacity))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus-visible\:border-indigo-500:focus-visible{--tw-border-opacity: 1;border-color:rgb(99 102 241 / var(--tw-border-opacity))}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-bink-500:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: rgb(141 102 181 / var(--tw-ring-opacity))}.focus-visible\:ring-opacity-75:focus-visible{--tw-ring-opacity: .75}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-bink-300:focus-visible{--tw-ring-offset-color: #533670}.group:hover .group-hover\:h-2{height:.5rem}.group:hover .group-hover\:-translate-x-1{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:translate-x-1{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:scale-125{--tw-scale-x: 1.25;--tw-scale-y: 1.25;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:scale-95{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:scale-\[400\%\]{--tw-scale-x: 400%;--tw-scale-y: 400%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:rounded-lg{border-radius:.5rem}.group:hover .group-hover\:bg-denim-500{--tw-bg-opacity: 1;background-color:rgb(56 51 74 / var(--tw-bg-opacity))}.group:hover .group-hover\:bg-opacity-50{--tw-bg-opacity: .5}.group:hover .group-hover\:from-denim-100{--tw-gradient-from: #120F1D var(--tw-gradient-from-position);--tw-gradient-from-position: ;--tw-gradient-to: rgb(18 15 29 / 0) var(--tw-gradient-from-position);--tw-gradient-to-position: ;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.group:hover .group-hover\:text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.group:hover .group-hover\:opacity-0{opacity:0}.group:hover .group-hover\:opacity-100{opacity:1}.group:active .group-active\:bg-denim-500{--tw-bg-opacity: 1;background-color:rgb(56 51 74 / var(--tw-bg-opacity))}.group:active .group-active\:bg-opacity-100{--tw-bg-opacity: 1}.hover\:scale-105:hover{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:scale-110:hover{--tw-scale-x: 1.1;--tw-scale-y: 1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:scale-125:hover{--tw-scale-x: 1.25;--tw-scale-y: 1.25;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:cursor-default:hover{cursor:default}.hover\:cursor-pointer:hover{cursor:pointer}.hover\:bg-\[\#1c161b79\]:hover{background-color:#1c161b79}.hover\:bg-ash-200:hover{--tw-bg-opacity: 1;background-color:rgb(43 40 54 / var(--tw-bg-opacity))}.hover\:bg-ash-400:hover{--tw-bg-opacity: 1;background-color:rgb(61 57 77 / var(--tw-bg-opacity))}.hover\:bg-bink-300:hover{--tw-bg-opacity: 1;background-color:rgb(83 54 112 / var(--tw-bg-opacity))}.hover\:bg-bink-400:hover{--tw-bg-opacity: 1;background-color:rgb(113 76 151 / var(--tw-bg-opacity))}.hover\:bg-denim-400:hover{--tw-bg-opacity: 1;background-color:rgb(43 38 61 / var(--tw-bg-opacity))}.hover\:bg-denim-500:hover{--tw-bg-opacity: 1;background-color:rgb(56 51 74 / var(--tw-bg-opacity))}.hover\:bg-denim-600:hover{--tw-bg-opacity: 1;background-color:rgb(80 75 100 / var(--tw-bg-opacity))}.hover\:bg-gray-200:hover{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}.hover\:bg-opacity-100:hover{--tw-bg-opacity: 1}.hover\:bg-opacity-50:hover{--tw-bg-opacity: .5}.hover\:text-bink-700:hover{--tw-text-opacity: 1;color:rgb(205 151 214 / var(--tw-text-opacity))}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.hover\:opacity-100:hover{opacity:1}.active\:scale-100:active{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\:scale-105:active{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\:scale-110:active{--tw-scale-x: 1.1;--tw-scale-y: 1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\:scale-125:active{--tw-scale-x: 1.25;--tw-scale-y: 1.25;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\:scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@media (min-width: 640px){.sm\:top-10{top:2.5rem}.sm\:mb-24{margin-bottom:6rem}.sm\:mr-6{margin-right:1.5rem}.sm\:block{display:block}.sm\:flex{display:flex}.sm\:w-\[500px\]{width:500px}.sm\:w-auto{width:auto}.sm\:w-fit{width:-moz-fit-content;width:fit-content}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:from-transparent{--tw-gradient-from: transparent var(--tw-gradient-from-position);--tw-gradient-from-position: ;--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-from-position);--tw-gradient-to-position: ;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.sm\:px-0{padding-left:0;padding-right:0}.sm\:px-2{padding-left:.5rem;padding-right:.5rem}.sm\:px-4{padding-left:1rem;padding-right:1rem}.sm\:px-8{padding-left:2rem;padding-right:2rem}.sm\:py-2{padding-top:.5rem;padding-bottom:.5rem}.sm\:py-4{padding-top:1rem;padding-bottom:1rem}.sm\:py-8{padding-top:2rem;padding-bottom:2rem}.sm\:pr-2{padding-right:.5rem}.sm\:text-3xl{font-size:1.875rem;line-height:2.25rem}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}}@media (min-width: 768px){.md\:inline-block{display:inline-block}.md\:w-\[200vw\]{width:200vw}.md\:w-\[500px\]{width:500px}.md\:px-12{padding-left:3rem;padding-right:3rem}.md\:px-16{padding-left:4rem;padding-right:4rem}.md\:py-12{padding-top:3rem;padding-bottom:3rem}.md\:text-4xl{font-size:2.25rem;line-height:2.5rem}.md\:text-xl{font-size:1.25rem;line-height:1.75rem}}@media (min-width: 1024px){.lg\:w-1\/2{width:50%}.lg\:w-\[1000px\]{width:1000px}.lg\:flex-row{flex-direction:row}.lg\:rounded-xl{border-radius:.75rem}} diff --git a/RetroTV/assets/workbox-window.prod.es5-dc90f814.js b/RetroTV/assets/workbox-window.prod.es5-dc90f814.js new file mode 100644 index 00000000..11677df0 --- /dev/null +++ b/RetroTV/assets/workbox-window.prod.es5-dc90f814.js @@ -0,0 +1,2 @@ +try{self["workbox:window:6.5.3"]&&_()}catch{}function S(t,r){return new Promise(function(e){var i=new MessageChannel;i.port1.onmessage=function(f){e(f.data)},t.postMessage(r,[i.port2])})}function W(t,r){for(var e=0;et.length)&&(r=t.length);for(var e=0,i=new Array(r);e"u"||t[Symbol.iterator]==null){if(Array.isArray(t)||(e=function(f,d){if(f){if(typeof f=="string")return E(f,d);var h=Object.prototype.toString.call(f).slice(8,-1);return h==="Object"&&f.constructor&&(h=f.constructor.name),h==="Map"||h==="Set"?Array.from(f):h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h)?E(f,d):void 0}}(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return(e=t[Symbol.iterator]()).next.bind(e)}try{self["workbox:core:6.5.3"]&&_()}catch{}var y=function(){var t=this;this.promise=new Promise(function(r,e){t.resolve=r,t.reject=e})};function b(t,r){var e=location.href;return new URL(t,e).href===new URL(r,e).href}var g=function(t,r){this.type=t,Object.assign(this,r)};function p(t,r,e){return e?r?r(t):t:(t&&t.then||(t=Promise.resolve(t)),r?t.then(r):t)}function L(){}var j={type:"SKIP_WAITING"};function P(t,r){if(!r)return t&&t.then?t.then(L):Promise.resolve()}var x=function(t){var r,e;function i(v,c){var n,o;return c===void 0&&(c={}),(n=t.call(this)||this).nn={},n.tn=0,n.rn=new y,n.en=new y,n.on=new y,n.un=0,n.an=new Set,n.cn=function(){var s=n.fn,a=s.installing;n.tn>0||!b(a.scriptURL,n.sn.toString())||performance.now()>n.un+6e4?(n.vn=a,s.removeEventListener("updatefound",n.cn)):(n.hn=a,n.an.add(a),n.rn.resolve(a)),++n.tn,a.addEventListener("statechange",n.ln)},n.ln=function(s){var a=n.fn,u=s.target,l=u.state,m=u===n.vn,w={sw:u,isExternal:m,originalEvent:s};!m&&n.mn&&(w.isUpdate=!0),n.dispatchEvent(new g(l,w)),l==="installed"?n.wn=self.setTimeout(function(){l==="installed"&&a.waiting===u&&n.dispatchEvent(new g("waiting",w))},200):l==="activating"&&(clearTimeout(n.wn),m||n.en.resolve(u))},n.dn=function(s){var a=n.hn,u=a!==navigator.serviceWorker.controller;n.dispatchEvent(new g("controlling",{isExternal:u,originalEvent:s,sw:a,isUpdate:n.mn})),u||n.on.resolve(a)},n.gn=(o=function(s){var a=s.data,u=s.ports,l=s.source;return p(n.getSW(),function(){n.an.has(l)&&n.dispatchEvent(new g("message",{data:a,originalEvent:s,ports:u,sw:l}))})},function(){for(var s=[],a=0;a + + + + + #120f1d + + + diff --git a/RetroTV/config.js b/RetroTV/config.js new file mode 100644 index 00000000..6ad8d3a3 --- /dev/null +++ b/RetroTV/config.js @@ -0,0 +1,5 @@ +window.__CONFIG__ = { + // url must NOT end with a slash + VITE_CORS_PROXY_URL: "https://retromovie.mr-jmhowie.workers.dev/", + VITE_TMDB_READ_API_KEY: "eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJmOWU1MzgyN2Y3NDIwZTBiMzE4YzgxZDdkNTdhYTM3MCIsInN1YiI6IjY1MjQ4NjVmNzQ1MDdkMDBhYzRiNDI0MCIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.fk8a13lT6YxEXpwmuqu9_9wvrENpDCmCr45zxrUPics" +}; diff --git a/RetroTV/favicon-16x16.png b/RetroTV/favicon-16x16.png new file mode 100644 index 00000000..56d0a43b Binary files /dev/null and b/RetroTV/favicon-16x16.png differ diff --git a/RetroTV/favicon-32x32.png b/RetroTV/favicon-32x32.png new file mode 100644 index 00000000..ef644cbb Binary files /dev/null and b/RetroTV/favicon-32x32.png differ diff --git a/RetroTV/favicon.ico b/RetroTV/favicon.ico new file mode 100644 index 00000000..b48e0702 Binary files /dev/null and b/RetroTV/favicon.ico differ diff --git a/RetroTV/index.html b/RetroTV/index.html new file mode 100644 index 00000000..9449f383 --- /dev/null +++ b/RetroTV/index.html @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + movie-web + + + + + +
+ + + diff --git a/RetroTV/manifest.webmanifest b/RetroTV/manifest.webmanifest new file mode 100644 index 00000000..39b0bdd1 --- /dev/null +++ b/RetroTV/manifest.webmanifest @@ -0,0 +1 @@ +{"name":"movie-web","short_name":"movie-web","start_url":"/","display":"standalone","background_color":"#120f1d","lang":"en","scope":"/","description":"The place for your favourite movies & shows","theme_color":"#120f1d","icons":[{"src":"android-chrome-192x192.png","sizes":"192x192","type":"image/png","purpose":"any"},{"src":"android-chrome-512x512.png","sizes":"512x512","type":"image/png","purpose":"any"},{"src":"android-chrome-192x192.png","sizes":"192x192","type":"image/png","purpose":"maskable"},{"src":"android-chrome-512x512.png","sizes":"512x512","type":"image/png","purpose":"maskable"}]} diff --git a/RetroTV/mstile-150x150.png b/RetroTV/mstile-150x150.png new file mode 100644 index 00000000..a001008d Binary files /dev/null and b/RetroTV/mstile-150x150.png differ diff --git a/RetroTV/ping.txt b/RetroTV/ping.txt new file mode 100644 index 00000000..8e554694 --- /dev/null +++ b/RetroTV/ping.txt @@ -0,0 +1 @@ +pong diff --git a/RetroTV/robots.txt b/RetroTV/robots.txt new file mode 100644 index 00000000..e9e57dc4 --- /dev/null +++ b/RetroTV/robots.txt @@ -0,0 +1,3 @@ +# https://www.robotstxt.org/robotstxt.html +User-agent: * +Disallow: diff --git a/RetroTV/safari-pinned-tab.svg b/RetroTV/safari-pinned-tab.svg new file mode 100644 index 00000000..647fc295 --- /dev/null +++ b/RetroTV/safari-pinned-tab.svg @@ -0,0 +1,18 @@ + + + + +Created by potrace 1.14, written by Peter Selinger 2001-2017 + + + + + diff --git a/RetroTV/sw.js b/RetroTV/sw.js new file mode 100644 index 00000000..4b1c5664 --- /dev/null +++ b/RetroTV/sw.js @@ -0,0 +1 @@ +if(!self.define){let e,i={};const s=(s,n)=>(s=new URL(s+".js",n).href,i[s]||new Promise((i=>{if("document"in self){const e=document.createElement("script");e.src=s,e.onload=i,document.head.appendChild(e)}else e=s,importScripts(s),i()})).then((()=>{let e=i[s];if(!e)throw new Error(`Module ${s} didn’t register its module`);return e})));self.define=(n,r)=>{const o=e||("document"in self?document.currentScript.src:"")||location.href;if(i[o])return;let d={};const c=e=>s(e,o),l={module:{uri:o},exports:d,require:c};i[o]=Promise.all(n.map((e=>l[e]||c(e)))).then((e=>(r(...e),d)))}}define(["./workbox-3625d7b0"],(function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"assets/DeveloperView-6fc51757.js",revision:null},{url:"assets/index-a5d2672e.js",revision:null},{url:"assets/index-a6b6f969.css",revision:null},{url:"assets/VideoTesterView-90119065.js",revision:null},{url:"assets/workbox-window.prod.es5-dc90f814.js",revision:null},{url:"config.js",revision:"c3a5ddef583ef610437d8e826ee52fe2"},{url:"index.html",revision:"430b9e06b71adfbc0708f51ed42466ef"},{url:"favicon.ico",revision:"de7674bb092bad4dc08dd526e8464697"},{url:"apple-touch-icon.png",revision:"cae0ab92548ba98dd5aeb34235f9617f"},{url:"safari-pinned-tab.svg",revision:"fd363adc5ac206e38c78a8a9d9bbde85"},{url:"android-chrome-192x192.png",revision:"496c321c53778a12b16f31802f6f2bc3"},{url:"android-chrome-512x512.png",revision:"9c2ae7b2713faecc1a99c7918c885934"},{url:"manifest.webmanifest",revision:"31b651545b2cf072f732b7c1609d61c5"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))})); diff --git a/RetroTV/workbox-3625d7b0.js b/RetroTV/workbox-3625d7b0.js new file mode 100644 index 00000000..1b7d7ed2 --- /dev/null +++ b/RetroTV/workbox-3625d7b0.js @@ -0,0 +1 @@ +define(["exports"],(function(t){"use strict";try{self["workbox:core:6.5.3"]&&_()}catch(t){}const e=(t,...e)=>{let s=t;return e.length>0&&(s+=` :: ${JSON.stringify(e)}`),s};class s extends Error{constructor(t,s){super(e(t,s)),this.name=t,this.details=s}}try{self["workbox:routing:6.5.3"]&&_()}catch(t){}const n=t=>t&&"object"==typeof t?t:{handle:t};class i{constructor(t,e,s="GET"){this.handler=n(e),this.match=t,this.method=s}setCatchHandler(t){this.catchHandler=n(t)}}class r extends i{constructor(t,e,s){super((({url:e})=>{const s=t.exec(e.href);if(s&&(e.origin===location.origin||0===s.index))return s.slice(1)}),e,s)}}class o{constructor(){this.t=new Map,this.i=new Map}get routes(){return this.t}addFetchListener(){self.addEventListener("fetch",(t=>{const{request:e}=t,s=this.handleRequest({request:e,event:t});s&&t.respondWith(s)}))}addCacheListener(){self.addEventListener("message",(t=>{if(t.data&&"CACHE_URLS"===t.data.type){const{payload:e}=t.data,s=Promise.all(e.urlsToCache.map((e=>{"string"==typeof e&&(e=[e]);const s=new Request(...e);return this.handleRequest({request:s,event:t})})));t.waitUntil(s),t.ports&&t.ports[0]&&s.then((()=>t.ports[0].postMessage(!0)))}}))}handleRequest({request:t,event:e}){const s=new URL(t.url,location.href);if(!s.protocol.startsWith("http"))return;const n=s.origin===location.origin,{params:i,route:r}=this.findMatchingRoute({event:e,request:t,sameOrigin:n,url:s});let o=r&&r.handler;const c=t.method;if(!o&&this.i.has(c)&&(o=this.i.get(c)),!o)return;let a;try{a=o.handle({url:s,request:t,event:e,params:i})}catch(t){a=Promise.reject(t)}const h=r&&r.catchHandler;return a instanceof Promise&&(this.o||h)&&(a=a.catch((async n=>{if(h)try{return await h.handle({url:s,request:t,event:e,params:i})}catch(t){t instanceof Error&&(n=t)}if(this.o)return this.o.handle({url:s,request:t,event:e});throw n}))),a}findMatchingRoute({url:t,sameOrigin:e,request:s,event:n}){const i=this.t.get(s.method)||[];for(const r of i){let i;const o=r.match({url:t,sameOrigin:e,request:s,event:n});if(o)return i=o,(Array.isArray(i)&&0===i.length||o.constructor===Object&&0===Object.keys(o).length||"boolean"==typeof o)&&(i=void 0),{route:r,params:i}}return{}}setDefaultHandler(t,e="GET"){this.i.set(e,n(t))}setCatchHandler(t){this.o=n(t)}registerRoute(t){this.t.has(t.method)||this.t.set(t.method,[]),this.t.get(t.method).push(t)}unregisterRoute(t){if(!this.t.has(t.method))throw new s("unregister-route-but-not-found-with-method",{method:t.method});const e=this.t.get(t.method).indexOf(t);if(!(e>-1))throw new s("unregister-route-route-not-registered");this.t.get(t.method).splice(e,1)}}let c;const a=()=>(c||(c=new o,c.addFetchListener(),c.addCacheListener()),c);function h(t,e,n){let o;if("string"==typeof t){const s=new URL(t,location.href);o=new i((({url:t})=>t.href===s.href),e,n)}else if(t instanceof RegExp)o=new r(t,e,n);else if("function"==typeof t)o=new i(t,e,n);else{if(!(t instanceof i))throw new s("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});o=t}return a().registerRoute(o),o}const u={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!=typeof registration?registration.scope:""},l=t=>[u.prefix,t,u.suffix].filter((t=>t&&t.length>0)).join("-"),f=t=>t||l(u.precache),w=t=>t||l(u.runtime);function d(t,e){const s=e();return t.waitUntil(s),s}try{self["workbox:precaching:6.5.3"]&&_()}catch(t){}function p(t){if(!t)throw new s("add-to-cache-list-unexpected-type",{entry:t});if("string"==typeof t){const e=new URL(t,location.href);return{cacheKey:e.href,url:e.href}}const{revision:e,url:n}=t;if(!n)throw new s("add-to-cache-list-unexpected-type",{entry:t});if(!e){const t=new URL(n,location.href);return{cacheKey:t.href,url:t.href}}const i=new URL(n,location.href),r=new URL(n,location.href);return i.searchParams.set("__WB_REVISION__",e),{cacheKey:i.href,url:r.href}}class y{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:t,state:e})=>{e&&(e.originalRequest=t)},this.cachedResponseWillBeUsed=async({event:t,state:e,cachedResponse:s})=>{if("install"===t.type&&e&&e.originalRequest&&e.originalRequest instanceof Request){const t=e.originalRequest.url;s?this.notUpdatedURLs.push(t):this.updatedURLs.push(t)}return s}}}class g{constructor({precacheController:t}){this.cacheKeyWillBeUsed=async({request:t,params:e})=>{const s=(null==e?void 0:e.cacheKey)||this.h.getCacheKeyForURL(t.url);return s?new Request(s,{headers:t.headers}):t},this.h=t}}let R;async function m(t,e){let n=null;if(t.url){n=new URL(t.url).origin}if(n!==self.location.origin)throw new s("cross-origin-copy-response",{origin:n});const i=t.clone(),r={headers:new Headers(i.headers),status:i.status,statusText:i.statusText},o=e?e(r):r,c=function(){if(void 0===R){const t=new Response("");if("body"in t)try{new Response(t.body),R=!0}catch(t){R=!1}R=!1}return R}()?i.body:await i.blob();return new Response(c,o)}function v(t,e){const s=new URL(t);for(const t of e)s.searchParams.delete(t);return s.href}class q{constructor(){this.promise=new Promise(((t,e)=>{this.resolve=t,this.reject=e}))}}const U=new Set;try{self["workbox:strategies:6.5.3"]&&_()}catch(t){}function L(t){return"string"==typeof t?new Request(t):t}class b{constructor(t,e){this.u={},Object.assign(this,e),this.event=e.event,this.l=t,this.p=new q,this.g=[],this.R=[...t.plugins],this.m=new Map;for(const t of this.R)this.m.set(t,{});this.event.waitUntil(this.p.promise)}async fetch(t){const{event:e}=this;let n=L(t);if("navigate"===n.mode&&e instanceof FetchEvent&&e.preloadResponse){const t=await e.preloadResponse;if(t)return t}const i=this.hasCallback("fetchDidFail")?n.clone():null;try{for(const t of this.iterateCallbacks("requestWillFetch"))n=await t({request:n.clone(),event:e})}catch(t){if(t instanceof Error)throw new s("plugin-error-request-will-fetch",{thrownErrorMessage:t.message})}const r=n.clone();try{let t;t=await fetch(n,"navigate"===n.mode?void 0:this.l.fetchOptions);for(const s of this.iterateCallbacks("fetchDidSucceed"))t=await s({event:e,request:r,response:t});return t}catch(t){throw i&&await this.runCallbacks("fetchDidFail",{error:t,event:e,originalRequest:i.clone(),request:r.clone()}),t}}async fetchAndCachePut(t){const e=await this.fetch(t),s=e.clone();return this.waitUntil(this.cachePut(t,s)),e}async cacheMatch(t){const e=L(t);let s;const{cacheName:n,matchOptions:i}=this.l,r=await this.getCacheKey(e,"read"),o=Object.assign(Object.assign({},i),{cacheName:n});s=await caches.match(r,o);for(const t of this.iterateCallbacks("cachedResponseWillBeUsed"))s=await t({cacheName:n,matchOptions:i,cachedResponse:s,request:r,event:this.event})||void 0;return s}async cachePut(t,e){const n=L(t);var i;await(i=0,new Promise((t=>setTimeout(t,i))));const r=await this.getCacheKey(n,"write");if(!e)throw new s("cache-put-with-no-response",{url:(o=r.url,new URL(String(o),location.href).href.replace(new RegExp(`^${location.origin}`),""))});var o;const c=await this.v(e);if(!c)return!1;const{cacheName:a,matchOptions:h}=this.l,u=await self.caches.open(a),l=this.hasCallback("cacheDidUpdate"),f=l?await async function(t,e,s,n){const i=v(e.url,s);if(e.url===i)return t.match(e,n);const r=Object.assign(Object.assign({},n),{ignoreSearch:!0}),o=await t.keys(e,r);for(const e of o)if(i===v(e.url,s))return t.match(e,n)}(u,r.clone(),["__WB_REVISION__"],h):null;try{await u.put(r,l?c.clone():c)}catch(t){if(t instanceof Error)throw"QuotaExceededError"===t.name&&await async function(){for(const t of U)await t()}(),t}for(const t of this.iterateCallbacks("cacheDidUpdate"))await t({cacheName:a,oldResponse:f,newResponse:c.clone(),request:r,event:this.event});return!0}async getCacheKey(t,e){const s=`${t.url} | ${e}`;if(!this.u[s]){let n=t;for(const t of this.iterateCallbacks("cacheKeyWillBeUsed"))n=L(await t({mode:e,request:n,event:this.event,params:this.params}));this.u[s]=n}return this.u[s]}hasCallback(t){for(const e of this.l.plugins)if(t in e)return!0;return!1}async runCallbacks(t,e){for(const s of this.iterateCallbacks(t))await s(e)}*iterateCallbacks(t){for(const e of this.l.plugins)if("function"==typeof e[t]){const s=this.m.get(e),n=n=>{const i=Object.assign(Object.assign({},n),{state:s});return e[t](i)};yield n}}waitUntil(t){return this.g.push(t),t}async doneWaiting(){let t;for(;t=this.g.shift();)await t}destroy(){this.p.resolve(null)}async v(t){let e=t,s=!1;for(const t of this.iterateCallbacks("cacheWillUpdate"))if(e=await t({request:this.request,response:e,event:this.event})||void 0,s=!0,!e)break;return s||e&&200!==e.status&&(e=void 0),e}}class C{constructor(t={}){this.cacheName=w(t.cacheName),this.plugins=t.plugins||[],this.fetchOptions=t.fetchOptions,this.matchOptions=t.matchOptions}handle(t){const[e]=this.handleAll(t);return e}handleAll(t){t instanceof FetchEvent&&(t={event:t,request:t.request});const e=t.event,s="string"==typeof t.request?new Request(t.request):t.request,n="params"in t?t.params:void 0,i=new b(this,{event:e,request:s,params:n}),r=this.q(i,s,e);return[r,this.U(r,i,s,e)]}async q(t,e,n){let i;await t.runCallbacks("handlerWillStart",{event:n,request:e});try{if(i=await this.L(e,t),!i||"error"===i.type)throw new s("no-response",{url:e.url})}catch(s){if(s instanceof Error)for(const r of t.iterateCallbacks("handlerDidError"))if(i=await r({error:s,event:n,request:e}),i)break;if(!i)throw s}for(const s of t.iterateCallbacks("handlerWillRespond"))i=await s({event:n,request:e,response:i});return i}async U(t,e,s,n){let i,r;try{i=await t}catch(r){}try{await e.runCallbacks("handlerDidRespond",{event:n,request:s,response:i}),await e.doneWaiting()}catch(t){t instanceof Error&&(r=t)}if(await e.runCallbacks("handlerDidComplete",{event:n,request:s,response:i,error:r}),e.destroy(),r)throw r}}class E extends C{constructor(t={}){t.cacheName=f(t.cacheName),super(t),this._=!1!==t.fallbackToNetwork,this.plugins.push(E.copyRedirectedCacheableResponsesPlugin)}async L(t,e){const s=await e.cacheMatch(t);return s||(e.event&&"install"===e.event.type?await this.C(t,e):await this.O(t,e))}async O(t,e){let n;const i=e.params||{};if(!this._)throw new s("missing-precache-entry",{cacheName:this.cacheName,url:t.url});{const s=i.integrity,r=t.integrity,o=!r||r===s;n=await e.fetch(new Request(t,{integrity:"no-cors"!==t.mode?r||s:void 0})),s&&o&&"no-cors"!==t.mode&&(this.N(),await e.cachePut(t,n.clone()))}return n}async C(t,e){this.N();const n=await e.fetch(t);if(!await e.cachePut(t,n.clone()))throw new s("bad-precaching-response",{url:t.url,status:n.status});return n}N(){let t=null,e=0;for(const[s,n]of this.plugins.entries())n!==E.copyRedirectedCacheableResponsesPlugin&&(n===E.defaultPrecacheCacheabilityPlugin&&(t=s),n.cacheWillUpdate&&e++);0===e?this.plugins.push(E.defaultPrecacheCacheabilityPlugin):e>1&&null!==t&&this.plugins.splice(t,1)}}E.defaultPrecacheCacheabilityPlugin={cacheWillUpdate:async({response:t})=>!t||t.status>=400?null:t},E.copyRedirectedCacheableResponsesPlugin={cacheWillUpdate:async({response:t})=>t.redirected?await m(t):t};class O{constructor({cacheName:t,plugins:e=[],fallbackToNetwork:s=!0}={}){this.k=new Map,this.K=new Map,this.P=new Map,this.l=new E({cacheName:f(t),plugins:[...e,new g({precacheController:this})],fallbackToNetwork:s}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this.l}precache(t){this.addToCacheList(t),this.T||(self.addEventListener("install",this.install),self.addEventListener("activate",this.activate),this.T=!0)}addToCacheList(t){const e=[];for(const n of t){"string"==typeof n?e.push(n):n&&void 0===n.revision&&e.push(n.url);const{cacheKey:t,url:i}=p(n),r="string"!=typeof n&&n.revision?"reload":"default";if(this.k.has(i)&&this.k.get(i)!==t)throw new s("add-to-cache-list-conflicting-entries",{firstEntry:this.k.get(i),secondEntry:t});if("string"!=typeof n&&n.integrity){if(this.P.has(t)&&this.P.get(t)!==n.integrity)throw new s("add-to-cache-list-conflicting-integrities",{url:i});this.P.set(t,n.integrity)}if(this.k.set(i,t),this.K.set(i,r),e.length>0){const t=`Workbox is precaching URLs without revision info: ${e.join(", ")}\nThis is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(t)}}}install(t){return d(t,(async()=>{const e=new y;this.strategy.plugins.push(e);for(const[e,s]of this.k){const n=this.P.get(s),i=this.K.get(e),r=new Request(e,{integrity:n,cache:i,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:s},request:r,event:t}))}const{updatedURLs:s,notUpdatedURLs:n}=e;return{updatedURLs:s,notUpdatedURLs:n}}))}activate(t){return d(t,(async()=>{const t=await self.caches.open(this.strategy.cacheName),e=await t.keys(),s=new Set(this.k.values()),n=[];for(const i of e)s.has(i.url)||(await t.delete(i),n.push(i.url));return{deletedURLs:n}}))}getURLsToCacheKeys(){return this.k}getCachedURLs(){return[...this.k.keys()]}getCacheKeyForURL(t){const e=new URL(t,location.href);return this.k.get(e.href)}getIntegrityForCacheKey(t){return this.P.get(t)}async matchPrecache(t){const e=t instanceof Request?t.url:t,s=this.getCacheKeyForURL(e);if(s){return(await self.caches.open(this.strategy.cacheName)).match(s)}}createHandlerBoundToURL(t){const e=this.getCacheKeyForURL(t);if(!e)throw new s("non-precached-url",{url:t});return s=>(s.request=new Request(t),s.params=Object.assign({cacheKey:e},s.params),this.strategy.handle(s))}}let x;const N=()=>(x||(x=new O),x);class k extends i{constructor(t,e){super((({request:s})=>{const n=t.getURLsToCacheKeys();for(const i of function*(t,{ignoreURLParametersMatching:e=[/^utm_/,/^fbclid$/],directoryIndex:s="index.html",cleanURLs:n=!0,urlManipulation:i}={}){const r=new URL(t,location.href);r.hash="",yield r.href;const o=function(t,e=[]){for(const s of[...t.searchParams.keys()])e.some((t=>t.test(s)))&&t.searchParams.delete(s);return t}(r,e);if(yield o.href,s&&o.pathname.endsWith("/")){const t=new URL(o.href);t.pathname+=s,yield t.href}if(n){const t=new URL(o.href);t.pathname+=".html",yield t.href}if(i){const t=i({url:r});for(const e of t)yield e.href}}(s.url,e)){const e=n.get(i);if(e){return{cacheKey:e,integrity:t.getIntegrityForCacheKey(e)}}}}),t.strategy)}}t.NavigationRoute=class extends i{constructor(t,{allowlist:e=[/./],denylist:s=[]}={}){super((t=>this.W(t)),t),this.j=e,this.M=s}W({url:t,request:e}){if(e&&"navigate"!==e.mode)return!1;const s=t.pathname+t.search;for(const t of this.M)if(t.test(s))return!1;return!!this.j.some((t=>t.test(s)))}},t.cleanupOutdatedCaches=function(){self.addEventListener("activate",(t=>{const e=f();t.waitUntil((async(t,e="-precache-")=>{const s=(await self.caches.keys()).filter((s=>s.includes(e)&&s.includes(self.registration.scope)&&s!==t));return await Promise.all(s.map((t=>self.caches.delete(t)))),s})(e).then((t=>{})))}))},t.clientsClaim=function(){self.addEventListener("activate",(()=>self.clients.claim()))},t.createHandlerBoundToURL=function(t){return N().createHandlerBoundToURL(t)},t.precacheAndRoute=function(t,e){!function(t){N().precache(t)}(t),function(t){const e=N();h(new k(e,t))}(e)},t.registerRoute=h})); diff --git a/accessdenied.html b/accessdenied.html new file mode 100644 index 00000000..ab6509c0 --- /dev/null +++ b/accessdenied.html @@ -0,0 +1,22 @@ +

Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied Access Denied

+ diff --git a/cam/index.html b/cam/index.html new file mode 100644 index 00000000..72e328f4 --- /dev/null +++ b/cam/index.html @@ -0,0 +1,60 @@ + + + + RetroFiber + + + + + + +
+
+ + + + +
+

+

+

RetroFiber

+

Camera

+
+

FrontBack + +

+
+
+
+ + + + The screen capture will appear in this box. +
+ + diff --git a/cam/script.js b/cam/script.js new file mode 100644 index 00000000..73a17ada --- /dev/null +++ b/cam/script.js @@ -0,0 +1,108 @@ +/* +Please try with devices with camera! +*/ + +/* +Reference: +https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia +https://developers.google.com/web/updates/2015/07/mediastream-deprecations?hl=en#stop-ended-and-active +https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Taking_still_photos +*/ + +// reference to the current media stream +var mediaStream = null; + +// Prefer camera resolution nearest to 1280x720. +var constraints = { + audio: false, + video: { + width: {ideal: 640}, + height: {ideal: 480}, + facingMode: "environment" + } +}; + +async function getMediaStream(constraints) { + try { + mediaStream = await navigator.mediaDevices.getUserMedia(constraints); + let video = document.getElementById('cam'); + video.srcObject = mediaStream; + video.onloadedmetadata = (event) => { + video.play(); + }; + } catch (err) { + console.error(err.message); + } +}; + +async function switchCamera(cameraMode) { + try { + // stop the current video stream + if (mediaStream != null && mediaStream.active) { + var tracks = mediaStream.getVideoTracks(); + tracks.forEach(track => { + track.stop(); + }) + } + + // set the video source to null + document.getElementById('cam').srcObject = null; + + // change "facingMode" + constraints.video.facingMode = cameraMode; + + // get new media stream + await getMediaStream(constraints); + } catch (err) { + console.error(err.message); + alert(err.message); + } +} +document.addEventListener('DOMContentLoaded', function () { + var checkbox = document.querySelector('input[type="checkbox"]'); + + checkbox.addEventListener('change', function () { + if (checkbox.checked) { + switchCamera("enviroment"); + } else { + switchCamera("user"); + } + }); +}); +function takePicture() { + let canvas = document.getElementById('canvas'); + let video = document.getElementById('cam'); + let photo = document.getElementById('photo'); + let context = canvas.getContext('2d'); + + const height = video.videoHeight; + const width = video.videoWidth; + + if (width && height) { + canvas.width = width; + canvas.height = height; + context.drawImage(video, 0, 0, width, height); + var data = canvas.toDataURL('image/png'); + photo.setAttribute('src', data); + } else { + clearphoto(); + } +} + +function clearPhoto() { + let canvas = document.getElementById('canvas'); + let photo = document.getElementById('photo'); + let context = canvas.getContext('2d'); + + context.fillStyle = "#AAA"; + context.fillRect(0, 0, canvas.width, canvas.height); + var data = canvas.toDataURL('image/png'); + photo.setAttribute('src', data); +} + +document.getElementById('snapBtn').onclick = (event) => { + takePicture(); + event.preventDefault(); +} +switchCamera("enviroment"); +clearPhoto(); diff --git a/classicube-maps/index.html b/classicube-maps/index.html new file mode 100644 index 00000000..d9da4881 --- /dev/null +++ b/classicube-maps/index.html @@ -0,0 +1,59 @@ + + + + RetroFiber + + + + + + + RetroFiber + + + + + + +
+
+ + + + +
+

+ +

+

RetroFiber

+

Classicube Maps

+
    +
  1. MountResort
  2. +
  3. RetroWolf
  4. +
  5. BestCity
  6. +
  7. City
  8. +
+
+

2022 © RetroFiber - + Github + +

+
+
+
+ diff --git a/clockwork-app/4chan.js b/clockwork-app/4chan.js deleted file mode 100644 index e02d0803..00000000 --- a/clockwork-app/4chan.js +++ /dev/null @@ -1,34 +0,0 @@ -function start() { - - ////CONFIG//// - - var link = "https://clockwork-apps.glitch.me/service/gateway?url=https://www.4chan.org/"; // link to app webpage - var title = "4chan"; // title shown in navbar - var id = "https://redstone-nw.netlify.app/clockwork-app/4chan.js"; // set this to the url location of your script - - ////SCRIPT//// - - var ExampleLink = document.createElement("a"); - var ExampleIFrame = document.createElement("iframe"); - - ExampleIFrame.style = "display: none;"; - ExampleIFrame.className = "app "+id; - ExampleIFrame.id = id; - ExampleIFrame.src = "about:blank"; - - ExampleLink.href = "javascript:openapp('"+ ExampleIFrame.id +"','" + link + "');" ; - ExampleLink.innerHTML = title; - ExampleLink.className = id; - ExampleLink.addEventListener('dblclick', (e) => { - uninstallApp(ExampleIFrame.id); - }); - ExampleLink.addEventListener('contextmenu', (e) => { - e.preventDefault(); - closeApp(ExampleIFrame.id); - }); - - document.getElementById("navbar").appendChild(ExampleLink); - document.getElementById("main").appendChild(ExampleIFrame); -} - -start(); \ No newline at end of file diff --git a/clockwork-app/README.md b/clockwork-app/README.md deleted file mode 100644 index 68edc9d5..00000000 --- a/clockwork-app/README.md +++ /dev/null @@ -1,92 +0,0 @@ -# redstone-nw.netlify.app - - - -## Getting started - -To make it easy for you to get started with GitLab, here's a list of recommended next steps. - -Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)! - -## Add your files - -- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files -- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command: - -``` -cd existing_repo -git remote add origin https://gitlab.com/lukasexists/redstone-nw.netlify.app.git -git branch -M main -git push -uf origin main -``` - -## Integrate with your tools - -- [ ] [Set up project integrations](https://gitlab.com/lukasexists/redstone-nw.netlify.app/-/settings/integrations) - -## Collaborate with your team - -- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/) -- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html) -- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically) -- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/) -- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html) - -## Test and Deploy - -Use the built-in continuous integration in GitLab. - -- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html) -- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/) -- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html) -- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/) -- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html) - -*** - -# Editing this README - -When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template. - -## Suggestions for a good README -Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information. - -## Name -Choose a self-explaining name for your project. - -## Description -Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors. - -## Badges -On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge. - -## Visuals -Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method. - -## Installation -Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection. - -## Usage -Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README. - -## Support -Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc. - -## Roadmap -If you have ideas for releases in the future, it is a good idea to list them in the README. - -## Contributing -State if you are open to contributions and what your requirements are for accepting them. - -For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self. - -You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser. - -## Authors and acknowledgment -Show your appreciation to those who have contributed to the project. - -## License -For open source projects, say how it is licensed. - -## Project status -If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers. diff --git a/clockwork-app/appstyle.css b/clockwork-app/appstyle.css new file mode 100644 index 00000000..f4028f04 --- /dev/null +++ b/clockwork-app/appstyle.css @@ -0,0 +1,93 @@ +/*Main Styling*/ +td { + padding: 5px; +} + +#app { + text-align: center; + width: 135px; + cursor: pointer; +} + +#rcorners:hover { + transform: scale(1.05) +} + +#rcorners { + border-radius: 25px; + background-position: center; + background-repeat: no-repeat; + background-size: 150px; + padding: 20px; + height: 100px; + width: 100px; + text-align: center; + transition: 0.3s; +} + +.divider { + padding: 10px; + background-color: #181818; + color: white; + } + +div.xscroll { + overflow: auto; + white-space: nowrap; + background-color: #282820; +} + body { + background-color: #282820; + } + div#app > h3 > a { + color: white; + } + div.divider > button { + background-color: #282820; + cursor: pointer; + color: white; + } + +/*App Images*/ +#shadowproxy { + background: url(/assets/app-images/shadows-proxy.jpeg); +} +#tinyfishing { + background: url(/assets/app-images/tinyfishing.jpeg); +} +#retroarch { + background: url(/assets/app-images/retroarch.png); +} +#paperio2 { + background: url(/assets/app-images/paperio.jpeg); +} +#notepad { + background: url(/assets/app-images/notepad.png); +} +#chan { + background: url(/assets/app-images/chan.jpg); +} +#bitplanes { + background: url(/assets/app-images/bitplanes.jpeg); +} +#basket-random { + background: url(/assets/app-images/basket-random.png); +} +#tffe { + background: url(/assets/app-images/2048.png); +} +#mandalin { + background: url(/assets/app-images/mandalin.jpeg); +} + +/*Theme Images*/ +#softpurple { + background: purple; +} +#windows { + background: url(/assets/theme-images/windows.png); +} +#monospace { + background: url(/assets/theme-images/mono.png); + background-color: black; +} \ No newline at end of file diff --git a/clockwork-app/clockstyle.css b/clockwork-app/clockstyle.css index 652e69c9..a8d4afff 100644 --- a/clockwork-app/clockstyle.css +++ b/clockwork-app/clockstyle.css @@ -6,7 +6,7 @@ html { body { margin: 0; - background-color: black; + background-color: black !important; color: whitesmoke; font-family: Roboto, Arial, sans-serif; } @@ -41,6 +41,10 @@ body { font-size: 24px; } +.navbar .extra { + order: 99999; +} + .navbar a { background-color: red; color: black; @@ -70,6 +74,7 @@ body { width: 100%; height: calc(100vh - 36px); border: none; + background-color: black; } .iconbtn { @@ -83,4 +88,5 @@ body { .confont { font-family: Courier, Monospace, monospace; -} \ No newline at end of file + background-color: black !important; +} diff --git a/clockwork-app/clockwork.js b/clockwork-app/clockwork.js index 3cc9e182..001320d1 100644 --- a/clockwork-app/clockwork.js +++ b/clockwork-app/clockwork.js @@ -1,7 +1,13 @@ -var theme = localStorage.getItem("theme"); -if (theme != null) { - addTheme(theme); +localStorage.getItem("theme"); +if (localStorage.getItem("theme") == null) { + localStorage.setItem("theme", "https://redstone-nw.netlify.app/clockwork-app/clockstyle.css") + localStorage.setItem("facReset", "false"); } +if (localStorage.getItem("theme").length < 7 || localStorage.getItem("facReset") == "true") { + localStorage.setItem("theme", "https://redstone-nw.netlify.app/clockwork-app/clockstyle.css") + localStorage.setItem("facReset", "false"); +} +addTheme(localStorage.getItem("theme")); apps = JSON.parse(localStorage.getItem("apps")); console.log(apps); @@ -22,16 +28,19 @@ function scrollbarVisible(element) { function uninstallApp(unid) { var apps = JSON.parse(localStorage.getItem("apps")); if (confirm("Are you sure you want to delete this app? You'll lose all your saved data!") == true) { - var filtered = apps.filter(function(value, index, arr){ - return value != unid; - }); - localStorage.setItem("apps", JSON.stringify(filtered)); - var apps = filtered; + for (var i = apps.length - 1; i >= 0; --i) { + if (apps[i] == unid) { + apps.splice(i,1); + break; + } + } + localStorage.setItem("apps", JSON.stringify(apps)); var paras = document.getElementsByClassName(unid); while(paras[0]) { paras[0].parentNode.removeChild(paras[0]); } + alert("App uninstalled. You may need to restart Clockwork to finish uninstalling.") } apps = JSON.parse(localStorage.getItem("apps")); console.log(apps); @@ -69,7 +78,7 @@ function openapp(appname, appurl) { appname.style = "display: block;"; } else { - alert("// ERROR \nApp of name does not exist"); + console.log("// ERROR \nApp of name does not exist"); } } @@ -82,7 +91,7 @@ function closeApp(appname) { appname.style = "display: none;"; } else { - alert("// ERROR \nApp of name does not exist"); + console.log("// ERROR \nApp of name does not exist"); } } //https://sub64.netlify.app/clockwork-beta/clock2.css @@ -98,6 +107,30 @@ function addApp(scr) { document.getElementById("applist").appendChild(aelem); } +function installAppV2(source, script) { + var conf; + if (source.includes("clockwork-store.glitch.me") == false) { + conf = confirm(`//// READ THIS MESSAGE!!!! //// +An untrusted app is trying to install a script to Clockwork. Apps can easily install malicious scripts if you aren't careful. + +APP URL: `+script+` + +Are you ABSOULTELY SURE you want to continue with installation?`); + } else { + conf = confirm(`Are you sure you want to install this app?`); + } + if (conf == true) { + if (apps.includes(script) == true) { + alert("App is already installed!"); + } else { + apps.push(script); + addApp(script); + localStorage.setItem("apps", JSON.stringify(apps)); + console.log(apps); + } + } +} + function installApp(appscript) { openapp('appstoreinstalling','mongus'); if (appscript == null) { @@ -106,10 +139,10 @@ function installApp(appscript) { if (apps.includes(appscript) == true) { alert("App is already installed!"); } else { - apps.push(appscript); - addApp(appscript); - localStorage.setItem("apps", JSON.stringify(apps)); - console.log(apps); + console.warn("installApp() is deprecated! We've made it so it doesn't install apps forever for security reasons.\nPlease use installAppV2() instead") + if (confirm("This app is using outdated code - it may break at any time. Continue?") == true) { + addApp(appscript); + } } openapp('appstore','mongus'); } @@ -166,8 +199,9 @@ function unhide() { function factoryReset() { if (confirm("Are you ABSOLUTELY SURE you want to factory reset Clockwork?\nAll your themes and apps (and some data) will be gone!")) { - localStorage.setItem("theme", null); - localStorage.setItem("apps", null); + localStorage.setItem("apps", "[]"); + localStorage.setItem("facReset", "true"); + addTheme('https://redstone-nw.netlify.app/clockwork-app/clockstyle.css'); document.location.reload(); } } @@ -192,4 +226,20 @@ function showMenu() { function hideMenu() { document.getElementById("contextMenu").style.display = "none"; } -document.onclick = hideMenu; \ No newline at end of file +document.onclick = hideMenu; + +window.addEventListener('message', function(event) { + if (event.data.length > 1) { + if (event.data[0] == "install app") { //data.origin + installAppV2(event.origin,event.data[1]); + } + if (event.data[0] == "install theme") { //data.origin + addTheme(event.data[1]); + } + } +}); + +window.addEventListener('beforeunload', function (e) { + e.preventDefault(); + e.returnValue = ''; +}); diff --git a/clockwork-app/index.html b/clockwork-app/index.html index 3f710cd5..27721537 100644 --- a/clockwork-app/index.html +++ b/clockwork-app/index.html @@ -5,14 +5,14 @@ Clockwork, by Redstone Network + -
-
+
WELCOME TO CLOCKWORK, BY REDSTONE NETWORK
- USERS OF VERSIONS OLDER THAN 0.14.0, PLEASE UPDATE YOUR BOOKMARKLET HERE!
Clockwork is like a mini OS in your browser. It has unblocked games, apps, and tools!

If you ever need help, remember that there's a wiki for Clockwork:
@@ -59,37 +55,30 @@ If you want to learn how to get your own app working, there's a wiki for that too:
https://github.com/red-stone-network/clockwork/wiki/Dev-Tutorials

- The new Muenster has now been added! You can still access the old Muenster by - double-clicking the button for it. + IF YOU'VE FACTORY RESET CLOCKWORK AND THE THEME BROKE, PLEASE TRY TO FACTORY RESET AGAIN!
+ We've added the classic app store back for users who can't access Glitch (and themes) - you can find it in the Settings app.
+ + - - - -