Files
pgsql-jellyfin/Jellyfin.Server/wwwroot/node_modules.libpgs.d1eeb7be8d71b7ab114d.chunk.js
T
2026-07-08 13:13:46 -04:00

1 line
60 KiB
JavaScript

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[75748],{73639:function(t,e,r){r.r(e),r.d(e,{PgsRenderer:function(){return Qp}});var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},o=function(t){return t&&t.Math===Math&&t},i=o("object"==typeof globalThis&&globalThis)||o("object"==typeof window&&window)||o("object"==typeof self&&self)||o("object"==typeof n&&n)||o("object"==typeof n&&n)||function(){return this}()||Function("return this")(),a={},s=function(t){try{return!!t()}catch(t){return!0}},u=!s((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})),c=!s((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),f=c,h=Function.prototype.call,p=f?h.bind(h):function(){return h.apply(h,arguments)},d={},l={}.propertyIsEnumerable,y=Object.getOwnPropertyDescriptor,v=y&&!l.call({1:2},1);d.f=v?function(t){var e=y(this,t);return!!e&&e.enumerable}:l;var m,b,g=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},w=c,T=Function.prototype,O=T.call,S=w&&T.bind.bind(O,O),P=w?S:function(t){return function(){return O.apply(t,arguments)}},j=P,E=j({}.toString),I=j("".slice),A=function(t){return I(E(t),8,-1)},U=s,R=A,x=Object,D=P("".split),C=U((function(){return!x("z").propertyIsEnumerable(0)}))?function(t){return"String"===R(t)?D(t,""):x(t)}:x,B=function(t){return null==t},k=B,_=TypeError,F=function(t){if(k(t))throw new _("Can't call method on "+t);return t},L=C,N=F,M=function(t){return L(N(t))},$="object"==typeof document&&document.all,H=void 0===$&&void 0!==$?function(t){return"function"==typeof t||t===$}:function(t){return"function"==typeof t},W=H,q=function(t){return"object"==typeof t?null!==t:W(t)},G=i,V=H,z=function(t,e){return arguments.length<2?(r=G[t],V(r)?r:void 0):G[t]&&G[t][e];var r},X=P({}.isPrototypeOf),J=i.navigator,Y=J&&J.userAgent,K=Y?String(Y):"",Z=i,Q=K,tt=Z.process,et=Z.Deno,rt=tt&&tt.versions||et&&et.version,nt=rt&&rt.v8;nt&&(b=(m=nt.split("."))[0]>0&&m[0]<4?1:+(m[0]+m[1])),!b&&Q&&(!(m=Q.match(/Edge\/(\d+)/))||m[1]>=74)&&(m=Q.match(/Chrome\/(\d+)/))&&(b=+m[1]);var ot=b,it=ot,at=s,st=i.String,ut=!!Object.getOwnPropertySymbols&&!at((function(){var t=Symbol("symbol detection");return!st(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&it&&it<41})),ct=ut&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,ft=z,ht=H,pt=X,dt=Object,lt=ct?function(t){return"symbol"==typeof t}:function(t){var e=ft("Symbol");return ht(e)&&pt(e.prototype,dt(t))},yt=String,vt=function(t){try{return yt(t)}catch(t){return"Object"}},mt=H,bt=vt,gt=TypeError,wt=function(t){if(mt(t))return t;throw new gt(bt(t)+" is not a function")},Tt=wt,Ot=B,St=function(t,e){var r=t[e];return Ot(r)?void 0:Tt(r)},Pt=p,jt=H,Et=q,It=TypeError,At={exports:{}},Ut=i,Rt=Object.defineProperty,xt=function(t,e){try{Rt(Ut,t,{value:e,configurable:!0,writable:!0})}catch(r){Ut[t]=e}return e},Dt=i,Ct=xt,Bt="__core-js_shared__",kt=At.exports=Dt[Bt]||Ct(Bt,{});(kt.versions||(kt.versions=[])).push({version:"3.38.1",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.38.1/LICENSE",source:"https://github.com/zloirock/core-js"});var _t=At.exports,Ft=_t,Lt=function(t,e){return Ft[t]||(Ft[t]=e||{})},Nt=F,Mt=Object,$t=function(t){return Mt(Nt(t))},Ht=$t,Wt=P({}.hasOwnProperty),qt=Object.hasOwn||function(t,e){return Wt(Ht(t),e)},Gt=P,Vt=0,zt=Math.random(),Xt=Gt(1..toString),Jt=function(t){return"Symbol("+(void 0===t?"":t)+")_"+Xt(++Vt+zt,36)},Yt=Lt,Kt=qt,Zt=Jt,Qt=ut,te=ct,ee=i.Symbol,re=Yt("wks"),ne=te?ee.for||ee:ee&&ee.withoutSetter||Zt,oe=function(t){return Kt(re,t)||(re[t]=Qt&&Kt(ee,t)?ee[t]:ne("Symbol."+t)),re[t]},ie=p,ae=q,se=lt,ue=St,ce=TypeError,fe=oe("toPrimitive"),he=lt,pe=function(t){var e=function(t,e){if(!ae(t)||se(t))return t;var r,n=ue(t,fe);if(n){if(void 0===e&&(e="default"),r=ie(n,t,e),!ae(r)||se(r))return r;throw new ce("Can't convert object to primitive value")}return void 0===e&&(e="number"),function(t,e){var r,n;if("string"===e&&jt(r=t.toString)&&!Et(n=Pt(r,t)))return n;if(jt(r=t.valueOf)&&!Et(n=Pt(r,t)))return n;if("string"!==e&&jt(r=t.toString)&&!Et(n=Pt(r,t)))return n;throw new It("Can't convert object to primitive value")}(t,e)}(t,"string");return he(e)?e:e+""},de=q,le=i.document,ye=de(le)&&de(le.createElement),ve=function(t){return ye?le.createElement(t):{}},me=ve,be=!u&&!s((function(){return 7!==Object.defineProperty(me("div"),"a",{get:function(){return 7}}).a})),ge=u,we=p,Te=d,Oe=g,Se=M,Pe=pe,je=qt,Ee=be,Ie=Object.getOwnPropertyDescriptor;a.f=ge?Ie:function(t,e){if(t=Se(t),e=Pe(e),Ee)try{return Ie(t,e)}catch(t){}if(je(t,e))return Oe(!we(Te.f,t,e),t[e])};var Ae={},Ue=u&&s((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Re=q,xe=String,De=TypeError,Ce=function(t){if(Re(t))return t;throw new De(xe(t)+" is not an object")},Be=u,ke=be,_e=Ue,Fe=Ce,Le=pe,Ne=TypeError,Me=Object.defineProperty,$e=Object.getOwnPropertyDescriptor,He="enumerable",We="configurable",qe="writable";Ae.f=Be?_e?function(t,e,r){if(Fe(t),e=Le(e),Fe(r),"function"==typeof t&&"prototype"===e&&"value"in r&&qe in r&&!r[qe]){var n=$e(t,e);n&&n[qe]&&(t[e]=r.value,r={configurable:We in r?r[We]:n[We],enumerable:He in r?r[He]:n[He],writable:!1})}return Me(t,e,r)}:Me:function(t,e,r){if(Fe(t),e=Le(e),Fe(r),ke)try{return Me(t,e,r)}catch(t){}if("get"in r||"set"in r)throw new Ne("Accessors not supported");return"value"in r&&(t[e]=r.value),t};var Ge=Ae,Ve=g,ze=u?function(t,e,r){return Ge.f(t,e,Ve(1,r))}:function(t,e,r){return t[e]=r,t},Xe={exports:{}},Je=u,Ye=qt,Ke=Function.prototype,Ze=Je&&Object.getOwnPropertyDescriptor,Qe=Ye(Ke,"name"),tr={EXISTS:Qe,PROPER:Qe&&"something"===function(){}.name,CONFIGURABLE:Qe&&(!Je||Je&&Ze(Ke,"name").configurable)},er=H,rr=_t,nr=P(Function.toString);er(rr.inspectSource)||(rr.inspectSource=function(t){return nr(t)});var or,ir,ar,sr=rr.inspectSource,ur=H,cr=i.WeakMap,fr=ur(cr)&&/native code/.test(String(cr)),hr=Jt,pr=Lt("keys"),dr=function(t){return pr[t]||(pr[t]=hr(t))},lr={},yr=fr,vr=i,mr=q,br=ze,gr=qt,wr=_t,Tr=dr,Or=lr,Sr="Object already initialized",Pr=vr.TypeError,jr=vr.WeakMap;if(yr||wr.state){var Er=wr.state||(wr.state=new jr);Er.get=Er.get,Er.has=Er.has,Er.set=Er.set,or=function(t,e){if(Er.has(t))throw new Pr(Sr);return e.facade=t,Er.set(t,e),e},ir=function(t){return Er.get(t)||{}},ar=function(t){return Er.has(t)}}else{var Ir=Tr("state");Or[Ir]=!0,or=function(t,e){if(gr(t,Ir))throw new Pr(Sr);return e.facade=t,br(t,Ir,e),e},ir=function(t){return gr(t,Ir)?t[Ir]:{}},ar=function(t){return gr(t,Ir)}}var Ar={set:or,get:ir,has:ar,enforce:function(t){return ar(t)?ir(t):or(t,{})},getterFor:function(t){return function(e){var r;if(!mr(e)||(r=ir(e)).type!==t)throw new Pr("Incompatible receiver, "+t+" required");return r}}},Ur=P,Rr=s,xr=H,Dr=qt,Cr=u,Br=tr.CONFIGURABLE,kr=sr,_r=Ar.enforce,Fr=Ar.get,Lr=String,Nr=Object.defineProperty,Mr=Ur("".slice),$r=Ur("".replace),Hr=Ur([].join),Wr=Cr&&!Rr((function(){return 8!==Nr((function(){}),"length",{value:8}).length})),qr=String(String).split("String"),Gr=Xe.exports=function(t,e,r){"Symbol("===Mr(Lr(e),0,7)&&(e="["+$r(Lr(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!Dr(t,"name")||Br&&t.name!==e)&&(Cr?Nr(t,"name",{value:e,configurable:!0}):t.name=e),Wr&&r&&Dr(r,"arity")&&t.length!==r.arity&&Nr(t,"length",{value:r.arity});try{r&&Dr(r,"constructor")&&r.constructor?Cr&&Nr(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var n=_r(t);return Dr(n,"source")||(n.source=Hr(qr,"string"==typeof e?e:"")),t};Function.prototype.toString=Gr((function(){return xr(this)&&Fr(this).source||kr(this)}),"toString");var Vr=Xe.exports,zr=H,Xr=Ae,Jr=Vr,Yr=xt,Kr=function(t,e,r,n){n||(n={});var o=n.enumerable,i=void 0!==n.name?n.name:e;if(zr(r)&&Jr(r,i,n),n.global)o?t[e]=r:Yr(e,r);else{try{n.unsafe?t[e]&&(o=!0):delete t[e]}catch(t){}o?t[e]=r:Xr.f(t,e,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return t},Zr={},Qr=Math.ceil,tn=Math.floor,en=Math.trunc||function(t){var e=+t;return(e>0?tn:Qr)(e)},rn=function(t){var e=+t;return e!=e||0===e?0:en(e)},nn=rn,on=Math.max,an=Math.min,sn=rn,un=Math.min,cn=function(t){return function(t){var e=sn(t);return e>0?un(e,9007199254740991):0}(t.length)},fn=M,hn=cn,pn=function(t){return function(e,r,n){var o=fn(e),i=hn(o);if(0===i)return!t&&-1;var a,s=function(t,e){var r=nn(t);return r<0?on(r+e,0):an(r,e)}(n,i);if(t&&r!=r){for(;i>s;)if((a=o[s++])!=a)return!0}else for(;i>s;s++)if((t||s in o)&&o[s]===r)return t||s||0;return!t&&-1}},dn={includes:pn(!0),indexOf:pn(!1)},ln=qt,yn=M,vn=dn.indexOf,mn=lr,bn=P([].push),gn=function(t,e){var r,n=yn(t),o=0,i=[];for(r in n)!ln(mn,r)&&ln(n,r)&&bn(i,r);for(;e.length>o;)ln(n,r=e[o++])&&(~vn(i,r)||bn(i,r));return i},wn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Tn=gn,On=wn.concat("length","prototype");Zr.f=Object.getOwnPropertyNames||function(t){return Tn(t,On)};var Sn={};Sn.f=Object.getOwnPropertySymbols;var Pn=z,jn=Zr,En=Sn,In=Ce,An=P([].concat),Un=Pn("Reflect","ownKeys")||function(t){var e=jn.f(In(t)),r=En.f;return r?An(e,r(t)):e},Rn=qt,xn=Un,Dn=a,Cn=Ae,Bn=function(t,e,r){for(var n=xn(e),o=Cn.f,i=Dn.f,a=0;a<n.length;a++){var s=n[a];Rn(t,s)||r&&Rn(r,s)||o(t,s,i(e,s))}},kn=s,_n=H,Fn=/#|\.prototype\./,Ln=function(t,e){var r=Mn[Nn(t)];return r===Hn||r!==$n&&(_n(e)?kn(e):!!e)},Nn=Ln.normalize=function(t){return String(t).replace(Fn,".").toLowerCase()},Mn=Ln.data={},$n=Ln.NATIVE="N",Hn=Ln.POLYFILL="P",Wn=Ln,qn=i,Gn=a.f,Vn=ze,zn=Kr,Xn=xt,Jn=Bn,Yn=Wn,Kn=function(t,e){var r,n,o,i,a,s=t.target,u=t.global,c=t.stat;if(r=u?qn:c?qn[s]||Xn(s,{}):qn[s]&&qn[s].prototype)for(n in e){if(i=e[n],o=t.dontCallGetSet?(a=Gn(r,n))&&a.value:r[n],!Yn(u?n:s+(c?".":"#")+n,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;Jn(i,o)}(t.sham||o&&o.sham)&&Vn(i,"sham",!0),zn(r,n,i,t)}},Zn=!s((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),Qn=qt,to=H,eo=$t,ro=Zn,no=dr("IE_PROTO"),oo=Object,io=oo.prototype,ao=ro?oo.getPrototypeOf:function(t){var e=eo(t);if(Qn(e,no))return e[no];var r=e.constructor;return to(r)&&e instanceof r?r.prototype:e instanceof oo?io:null},so=P,uo=wt,co=q,fo=String,ho=TypeError,po=q,lo=F,yo=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=function(t){try{return so(uo(Object.getOwnPropertyDescriptor(t,"__proto__").set))}catch(t){}}(Object.prototype))(r,[]),e=r instanceof Array}catch(t){}return function(r,n){return lo(r),function(t){if(function(t){return co(t)||null===t}(t))return t;throw new ho("Can't set "+fo(t)+" as a prototype")}(n),po(r)?(e?t(r,n):r.__proto__=n,r):r}}():void 0),vo={},mo=gn,bo=wn,go=Object.keys||function(t){return mo(t,bo)},wo=u,To=Ue,Oo=Ae,So=Ce,Po=M,jo=go;vo.f=wo&&!To?Object.defineProperties:function(t,e){So(t);for(var r,n=Po(e),o=jo(e),i=o.length,a=0;i>a;)Oo.f(t,r=o[a++],n[r]);return t};var Eo,Io=z("document","documentElement"),Ao=Ce,Uo=vo,Ro=wn,xo=lr,Do=Io,Co=ve,Bo="prototype",ko="script",_o=dr("IE_PROTO"),Fo=function(){},Lo=function(t){return"<"+ko+">"+t+"</"+ko+">"},No=function(t){t.write(Lo("")),t.close();var e=t.parentWindow.Object;return t=null,e},Mo=function(){try{Eo=new ActiveXObject("htmlfile")}catch(t){}var t,e,r;Mo="undefined"!=typeof document?document.domain&&Eo?No(Eo):(e=Co("iframe"),r="java"+ko+":",e.style.display="none",Do.appendChild(e),e.src=String(r),(t=e.contentWindow.document).open(),t.write(Lo("document.F=Object")),t.close(),t.F):No(Eo);for(var n=Ro.length;n--;)delete Mo[Bo][Ro[n]];return Mo()};xo[_o]=!0;var $o=Object.create||function(t,e){var r;return null!==t?(Fo[Bo]=Ao(t),r=new Fo,Fo[Bo]=null,r[_o]=t):r=Mo(),void 0===e?r:Uo.f(r,e)},Ho=q,Wo=ze,qo=Error,Go=P("".replace),Vo=String(new qo("zxcasd").stack),zo=/\n\s*at [^:]*:[^\n]*/,Xo=zo.test(Vo),Jo=g,Yo=!s((function(){var t=new Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",Jo(1,7)),7!==t.stack)})),Ko=ze,Zo=Yo,Qo=Error.captureStackTrace,ti=A,ei=P,ri=function(t){if("Function"===ti(t))return ei(t)},ni=wt,oi=c,ii=ri(ri.bind),ai=function(t,e){return ni(t),void 0===e?t:oi?ii(t,e):function(){return t.apply(e,arguments)}},si={},ui=si,ci=oe("iterator"),fi=Array.prototype,hi={};hi[oe("toStringTag")]="z";var pi="[object z]"===String(hi),di=pi,li=H,yi=A,vi=oe("toStringTag"),mi=Object,bi="Arguments"===yi(function(){return arguments}()),gi=di?yi:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=mi(t),vi))?r:bi?yi(e):"Object"===(n=yi(e))&&li(e.callee)?"Arguments":n},wi=gi,Ti=St,Oi=B,Si=si,Pi=oe("iterator"),ji=function(t){if(!Oi(t))return Ti(t,Pi)||Ti(t,"@@iterator")||Si[wi(t)]},Ei=p,Ii=wt,Ai=Ce,Ui=vt,Ri=ji,xi=TypeError,Di=p,Ci=Ce,Bi=St,ki=ai,_i=p,Fi=Ce,Li=vt,Ni=cn,Mi=X,$i=ji,Hi=function(t,e,r){var n,o;Ci(t);try{if(!(n=Bi(t,"return"))){if("throw"===e)throw r;return r}n=Di(n,t)}catch(t){o=!0,n=t}if("throw"===e)throw r;if(o)throw n;return Ci(n),r},Wi=TypeError,qi=function(t,e){this.stopped=t,this.result=e},Gi=qi.prototype,Vi=function(t,e,r){var n,o,i,a,s,u,c,f=r&&r.that,h=!(!r||!r.AS_ENTRIES),p=!(!r||!r.IS_RECORD),d=!(!r||!r.IS_ITERATOR),l=!(!r||!r.INTERRUPTED),y=ki(e,f),v=function(t){return n&&Hi(n,"normal",t),new qi(!0,t)},m=function(t){return h?(Fi(t),l?y(t[0],t[1],v):y(t[0],t[1])):l?y(t,v):y(t)};if(p)n=t.iterator;else if(d)n=t;else{if(!(o=$i(t)))throw new Wi(Li(t)+" is not iterable");if(function(t){return void 0!==t&&(ui.Array===t||fi[ci]===t)}(o)){for(i=0,a=Ni(t);a>i;i++)if((s=m(t[i]))&&Mi(Gi,s))return s;return new qi(!1)}n=function(t,e){var r=arguments.length<2?Ri(t):e;if(Ii(r))return Ai(Ei(r,t));throw new xi(Ui(t)+" is not iterable")}(t,o)}for(u=p?t.next:n.next;!(c=_i(u,n)).done;){try{s=m(c.value)}catch(t){Hi(n,"throw",t)}if("object"==typeof s&&s&&Mi(Gi,s))return s}return new qi(!1)},zi=gi,Xi=String,Ji=function(t){if("Symbol"===zi(t))throw new TypeError("Cannot convert a Symbol value to a string");return Xi(t)},Yi=Ji,Ki=Kn,Zi=X,Qi=ao,ta=yo,ea=Bn,ra=$o,na=ze,oa=g,ia=Vi,aa=oe("toStringTag"),sa=Error,ua=[].push,ca=function(t,e){var r,n=Zi(fa,this);ta?r=ta(new sa,n?Qi(this):fa):(r=n?this:ra(fa),na(r,aa,"Error")),void 0!==e&&na(r,"message",function(t,e){return void 0===t?arguments.length<2?"":e:Yi(t)}(e)),function(t,e,r,n){Zo&&(Qo?Qo(t,e):Ko(t,"stack",function(t,e){if(Xo&&"string"==typeof t&&!qo.prepareStackTrace)for(;e--;)t=Go(t,zo,"");return t}(r,n)))}(r,ca,r.stack,1),arguments.length>2&&function(t,e){Ho(e)&&"cause"in e&&Wo(t,"cause",e.cause)}(r,arguments[2]);var o=[];return ia(t,ua,{that:o}),na(r,"errors",o),r};ta?ta(ca,sa):ea(ca,sa,{name:!0});var fa=ca.prototype=ra(sa.prototype,{constructor:oa(1,ca),message:oa(1,""),name:oa(1,"AggregateError")});Ki({global:!0,constructor:!0,arity:2},{AggregateError:ca});var ha=oe,pa=$o,da=Ae.f,la=ha("unscopables"),ya=Array.prototype;void 0===ya[la]&&da(ya,la,{configurable:!0,value:pa(null)});var va,ma,ba,ga=s,wa=H,Ta=q,Oa=ao,Sa=Kr,Pa=oe("iterator"),ja=!1;[].keys&&("next"in(ba=[].keys())?(ma=Oa(Oa(ba)))!==Object.prototype&&(va=ma):ja=!0);var Ea=!Ta(va)||ga((function(){var t={};return va[Pa].call(t)!==t}));Ea&&(va={}),wa(va[Pa])||Sa(va,Pa,(function(){return this}));var Ia={IteratorPrototype:va,BUGGY_SAFARI_ITERATORS:ja},Aa=Ae.f,Ua=qt,Ra=oe("toStringTag"),xa=function(t,e,r){t&&!r&&(t=t.prototype),t&&!Ua(t,Ra)&&Aa(t,Ra,{configurable:!0,value:e})},Da=Ia.IteratorPrototype,Ca=$o,Ba=g,ka=xa,_a=si,Fa=function(){return this},La=Kn,Na=p,Ma=H,$a=ao,Ha=yo,Wa=xa,qa=ze,Ga=Kr,Va=si,za=tr.PROPER,Xa=tr.CONFIGURABLE,Ja=Ia.IteratorPrototype,Ya=Ia.BUGGY_SAFARI_ITERATORS,Ka=oe("iterator"),Za="keys",Qa="values",ts="entries",es=function(){return this},rs=function(t,e,r,n,o,i,a){!function(t,e,r){var n=e+" Iterator";t.prototype=Ca(Da,{next:Ba(1,r)}),ka(t,n,!1),_a[n]=Fa}(r,e,n);var s,u,c,f=function(t){if(t===o&&y)return y;if(!Ya&&t&&t in d)return d[t];switch(t){case Za:case Qa:case ts:return function(){return new r(this,t)}}return function(){return new r(this)}},h=e+" Iterator",p=!1,d=t.prototype,l=d[Ka]||d["@@iterator"]||o&&d[o],y=!Ya&&l||f(o),v="Array"===e&&d.entries||l;if(v&&(s=$a(v.call(new t)))!==Object.prototype&&s.next&&($a(s)!==Ja&&(Ha?Ha(s,Ja):Ma(s[Ka])||Ga(s,Ka,es)),Wa(s,h,!0)),za&&o===Qa&&l&&l.name!==Qa&&(Xa?qa(d,"name",Qa):(p=!0,y=function(){return Na(l,this)})),o)if(u={values:f(Qa),keys:i?y:f(Za),entries:f(ts)},a)for(c in u)(Ya||p||!(c in d))&&Ga(d,c,u[c]);else La({target:e,proto:!0,forced:Ya||p},u);return d[Ka]!==y&&Ga(d,Ka,y,{name:o}),Va[e]=y,u},ns=function(t,e){return{value:t,done:e}},os=M,is=function(t){ya[la][t]=!0},as=si,ss=Ar,us=Ae.f,cs=rs,fs=ns,hs=u,ps="Array Iterator",ds=ss.set,ls=ss.getterFor(ps),ys=cs(Array,"Array",(function(t,e){ds(this,{type:ps,target:os(t),index:0,kind:e})}),(function(){var t=ls(this),e=t.target,r=t.index++;if(!e||r>=e.length)return t.target=null,fs(void 0,!0);switch(t.kind){case"keys":return fs(r,!1);case"values":return fs(e[r],!1)}return fs([r,e[r]],!1)}),"values"),vs=as.Arguments=as.Array;if(is("keys"),is("values"),is("entries"),hs&&"values"!==vs.name)try{us(vs,"name",{value:"values"})}catch(n){}var ms=gi,bs=pi?{}.toString:function(){return"[object "+ms(this)+"]"};pi||Kr(Object.prototype,"toString",bs,{unsafe:!0});var gs=i,ws=K,Ts=A,Os=function(t){return ws.slice(0,t.length)===t},Ss=Os("Bun/")?"BUN":Os("Cloudflare-Workers")?"CLOUDFLARE":Os("Deno/")?"DENO":Os("Node.js/")?"NODE":gs.Bun&&"string"==typeof Bun.version?"BUN":gs.Deno&&"object"==typeof Deno.version?"DENO":"process"===Ts(gs.process)?"NODE":gs.window&&gs.document?"BROWSER":"REST",Ps="NODE"===Ss,js=Vr,Es=Ae,Is=z,As=u,Us=oe("species"),Rs=X,xs=TypeError,Ds=P,Cs=s,Bs=H,ks=gi,_s=sr,Fs=function(){},Ls=z("Reflect","construct"),Ns=/^\s*(?:class|function)\b/,Ms=Ds(Ns.exec),$s=!Ns.test(Fs),Hs=function(t){if(!Bs(t))return!1;try{return Ls(Fs,[],t),!0}catch(t){return!1}},Ws=function(t){if(!Bs(t))return!1;switch(ks(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return $s||!!Ms(Ns,_s(t))}catch(t){return!0}};Ws.sham=!0;var qs,Gs,Vs,zs,Xs=!Ls||Cs((function(){var t;return Hs(Hs.call)||!Hs(Object)||!Hs((function(){t=!0}))||t}))?Ws:Hs,Js=Xs,Ys=vt,Ks=TypeError,Zs=Ce,Qs=B,tu=oe("species"),eu=function(t,e){var r,n=Zs(t).constructor;return void 0===n||Qs(r=Zs(n)[tu])?e:function(t){if(Js(t))return t;throw new Ks(Ys(t)+" is not a constructor")}(r)},ru=c,nu=Function.prototype,ou=nu.apply,iu=nu.call,au="object"==typeof Reflect&&Reflect.apply||(ru?iu.bind(ou):function(){return iu.apply(ou,arguments)}),su=P([].slice),uu=TypeError,cu=/(?:ipad|iphone|ipod).*applewebkit/i.test(K),fu=i,hu=au,pu=ai,du=H,lu=qt,yu=s,vu=Io,mu=su,bu=ve,gu=cu,wu=Ps,Tu=fu.setImmediate,Ou=fu.clearImmediate,Su=fu.process,Pu=fu.Dispatch,ju=fu.Function,Eu=fu.MessageChannel,Iu=fu.String,Au=0,Uu={},Ru="onreadystatechange";yu((function(){qs=fu.location}));var xu=function(t){if(lu(Uu,t)){var e=Uu[t];delete Uu[t],e()}},Du=function(t){return function(){xu(t)}},Cu=function(t){xu(t.data)},Bu=function(t){fu.postMessage(Iu(t),qs.protocol+"//"+qs.host)};Tu&&Ou||(Tu=function(t){!function(t){if(t<1)throw new uu("Not enough arguments")}(arguments.length);var e=du(t)?t:ju(t),r=mu(arguments,1);return Uu[++Au]=function(){hu(e,void 0,r)},Gs(Au),Au},Ou=function(t){delete Uu[t]},wu?Gs=function(t){Su.nextTick(Du(t))}:Pu&&Pu.now?Gs=function(t){Pu.now(Du(t))}:Eu&&!gu?(zs=(Vs=new Eu).port2,Vs.port1.onmessage=Cu,Gs=pu(zs.postMessage,zs)):fu.addEventListener&&du(fu.postMessage)&&!fu.importScripts&&qs&&"file:"!==qs.protocol&&!yu(Bu)?(Gs=Bu,fu.addEventListener("message",Cu,!1)):Gs=Ru in bu("script")?function(t){vu.appendChild(bu("script"))[Ru]=function(){vu.removeChild(this),xu(t)}}:function(t){setTimeout(Du(t),0)});var ku={set:Tu,clear:Ou},_u=i,Fu=u,Lu=Object.getOwnPropertyDescriptor,Nu=function(){this.head=null,this.tail=null};Nu.prototype={add:function(t){var e={item:t,next:null},r=this.tail;r?r.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return null===(this.head=t.next)&&(this.tail=null),t.item}};var Mu,$u,Hu,Wu,qu,Gu=Nu,Vu=/ipad|iphone|ipod/i.test(K)&&"undefined"!=typeof Pebble,zu=/web0s(?!.*chrome)/i.test(K),Xu=i,Ju=ai,Yu=ku.set,Ku=Gu,Zu=cu,Qu=Vu,tc=zu,ec=Ps,rc=Xu.MutationObserver||Xu.WebKitMutationObserver,nc=Xu.document,oc=Xu.process,ic=Xu.Promise,ac=function(t){if(!Fu)return _u[t];var e=Lu(_u,t);return e&&e.value}("queueMicrotask");if(!ac){var sc=new Ku,uc=function(){var t,e;for(ec&&(t=oc.domain)&&t.exit();e=sc.get();)try{e()}catch(t){throw sc.head&&Mu(),t}t&&t.enter()};Zu||ec||tc||!rc||!nc?!Qu&&ic&&ic.resolve?((Wu=ic.resolve(void 0)).constructor=ic,qu=Ju(Wu.then,Wu),Mu=function(){qu(uc)}):ec?Mu=function(){oc.nextTick(uc)}:(Yu=Ju(Yu,Xu),Mu=function(){Yu(uc)}):($u=!0,Hu=nc.createTextNode(""),new rc(uc).observe(Hu,{characterData:!0}),Mu=function(){Hu.data=$u=!$u}),ac=function(t){sc.head||Mu(),sc.add(t)}}var cc=ac,fc=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},hc=i.Promise,pc=i,dc=hc,lc=H,yc=Wn,vc=sr,mc=oe,bc=Ss,gc=ot;dc&&dc.prototype;var wc=mc("species"),Tc=!1,Oc=lc(pc.PromiseRejectionEvent),Sc=yc("Promise",(function(){var t=vc(dc),e=t!==String(dc);if(!e&&66===gc)return!0;if(!gc||gc<51||!/native code/.test(t)){var r=new dc((function(t){t(1)})),n=function(t){t((function(){}),(function(){}))};if((r.constructor={})[wc]=n,!(Tc=r.then((function(){}))instanceof n))return!0}return!(e||"BROWSER"!==bc&&"DENO"!==bc||Oc)})),Pc={CONSTRUCTOR:Sc,REJECTION_EVENT:Oc,SUBCLASSING:Tc},jc={},Ec=wt,Ic=TypeError,Ac=function(t){var e,r;this.promise=new t((function(t,n){if(void 0!==e||void 0!==r)throw new Ic("Bad Promise constructor");e=t,r=n})),this.resolve=Ec(e),this.reject=Ec(r)};jc.f=function(t){return new Ac(t)};var Uc,Rc,xc,Dc=Kn,Cc=Ps,Bc=i,kc=p,_c=Kr,Fc=yo,Lc=xa,Nc=wt,Mc=H,$c=q,Hc=eu,Wc=ku.set,qc=cc,Gc=fc,Vc=Gu,zc=Ar,Xc=hc,Jc=jc,Yc="Promise",Kc=Pc.CONSTRUCTOR,Zc=Pc.REJECTION_EVENT,Qc=Pc.SUBCLASSING,tf=zc.getterFor(Yc),ef=zc.set,rf=Xc&&Xc.prototype,nf=Xc,of=rf,af=Bc.TypeError,sf=Bc.document,uf=Bc.process,cf=Jc.f,ff=cf,hf=!!(sf&&sf.createEvent&&Bc.dispatchEvent),pf="unhandledrejection",df=function(t){var e;return!(!$c(t)||!Mc(e=t.then))&&e},lf=function(t,e){var r,n,o,i=e.value,a=1===e.state,s=a?t.ok:t.fail,u=t.resolve,c=t.reject,f=t.domain;try{s?(a||(2===e.rejection&&gf(e),e.rejection=1),!0===s?r=i:(f&&f.enter(),r=s(i),f&&(f.exit(),o=!0)),r===t.promise?c(new af("Promise-chain cycle")):(n=df(r))?kc(n,r,u,c):u(r)):c(i)}catch(t){f&&!o&&f.exit(),c(t)}},yf=function(t,e){t.notified||(t.notified=!0,qc((function(){for(var r,n=t.reactions;r=n.get();)lf(r,t);t.notified=!1,e&&!t.rejection&&mf(t)})))},vf=function(t,e,r){var n,o;hf?((n=sf.createEvent("Event")).promise=e,n.reason=r,n.initEvent(t,!1,!0),Bc.dispatchEvent(n)):n={promise:e,reason:r},!Zc&&(o=Bc["on"+t])?o(n):t===pf&&function(t,e){try{1===arguments.length?console.error(t):console.error(t,e)}catch(t){}}("Unhandled promise rejection",r)},mf=function(t){kc(Wc,Bc,(function(){var e,r=t.facade,n=t.value;if(bf(t)&&(e=Gc((function(){Cc?uf.emit("unhandledRejection",n,r):vf(pf,r,n)})),t.rejection=Cc||bf(t)?2:1,e.error))throw e.value}))},bf=function(t){return 1!==t.rejection&&!t.parent},gf=function(t){kc(Wc,Bc,(function(){var e=t.facade;Cc?uf.emit("rejectionHandled",e):vf("rejectionhandled",e,t.value)}))},wf=function(t,e,r){return function(n){t(e,n,r)}},Tf=function(t,e,r){t.done||(t.done=!0,r&&(t=r),t.value=e,t.state=2,yf(t,!0))},Of=function(t,e,r){if(!t.done){t.done=!0,r&&(t=r);try{if(t.facade===e)throw new af("Promise can't be resolved itself");var n=df(e);n?qc((function(){var r={done:!1};try{kc(n,e,wf(Of,r,t),wf(Tf,r,t))}catch(e){Tf(r,e,t)}})):(t.value=e,t.state=1,yf(t,!1))}catch(e){Tf({done:!1},e,t)}}};if(Kc&&(of=(nf=function(t){(function(t,e){if(Rs(e,t))return t;throw new xs("Incorrect invocation")})(this,of),Nc(t),kc(Uc,this);var e=tf(this);try{t(wf(Of,e),wf(Tf,e))}catch(t){Tf(e,t)}}).prototype,(Uc=function(t){ef(this,{type:Yc,done:!1,notified:!1,parent:!1,reactions:new Vc,rejection:!1,state:0,value:null})}).prototype=_c(of,"then",(function(t,e){var r=tf(this),n=cf(Hc(this,nf));return r.parent=!0,n.ok=!Mc(t)||t,n.fail=Mc(e)&&e,n.domain=Cc?uf.domain:void 0,0===r.state?r.reactions.add(n):qc((function(){lf(n,r)})),n.promise})),Rc=function(){var t=new Uc,e=tf(t);this.promise=t,this.resolve=wf(Of,e),this.reject=wf(Tf,e)},Jc.f=cf=function(t){return t===nf||void 0===t?new Rc(t):ff(t)},Mc(Xc)&&rf!==Object.prototype)){xc=rf.then,Qc||_c(rf,"then",(function(t,e){var r=this;return new nf((function(t,e){kc(xc,r,t,e)})).then(t,e)}),{unsafe:!0});try{delete rf.constructor}catch(n){}Fc&&Fc(rf,of)}Dc({global:!0,constructor:!0,wrap:!0,forced:Kc},{Promise:nf}),Lc(nf,Yc,!1),function(t){var e=Is(t);As&&e&&!e[Us]&&function(t,e,r){r.get&&js(r.get,e,{getter:!0}),r.set&&js(r.set,e,{setter:!0}),Es.f(t,e,r)}(e,Us,{configurable:!0,get:function(){return this}})}(Yc);var Sf=oe("iterator"),Pf=!1;try{var jf=0,Ef={next:function(){return{done:!!jf++}},return:function(){Pf=!0}};Ef[Sf]=function(){return this},Array.from(Ef,(function(){throw 2}))}catch(n){}var If=hc,Af=Pc.CONSTRUCTOR||!function(){try{if(!Pf)return!1}catch(t){return!1}var t=!1;try{var e={};e[Sf]=function(){return{next:function(){return{done:t=!0}}}},function(t){If.all(t).then(void 0,(function(){}))}(e)}catch(t){}return t}(),Uf=p,Rf=wt,xf=jc,Df=fc,Cf=Vi;Kn({target:"Promise",stat:!0,forced:Af},{all:function(t){var e=this,r=xf.f(e),n=r.resolve,o=r.reject,i=Df((function(){var r=Rf(e.resolve),i=[],a=0,s=1;Cf(t,(function(t){var u=a++,c=!1;s++,Uf(r,e,t).then((function(t){c||(c=!0,i[u]=t,--s||n(i))}),o)})),--s||n(i)}));return i.error&&o(i.value),r.promise}});var Bf=Kn,kf=Pc.CONSTRUCTOR,_f=hc,Ff=z,Lf=H,Nf=Kr,Mf=_f&&_f.prototype;if(Bf({target:"Promise",proto:!0,forced:kf,real:!0},{catch:function(t){return this.then(void 0,t)}}),Lf(_f)){var $f=Ff("Promise").prototype.catch;Mf.catch!==$f&&Nf(Mf,"catch",$f,{unsafe:!0})}var Hf=p,Wf=wt,qf=jc,Gf=fc,Vf=Vi;Kn({target:"Promise",stat:!0,forced:Af},{race:function(t){var e=this,r=qf.f(e),n=r.reject,o=Gf((function(){var o=Wf(e.resolve);Vf(t,(function(t){Hf(o,e,t).then(r.resolve,n)}))}));return o.error&&n(o.value),r.promise}});var zf=jc;Kn({target:"Promise",stat:!0,forced:Pc.CONSTRUCTOR},{reject:function(t){var e=zf.f(this);return(0,e.reject)(t),e.promise}});var Xf=Ce,Jf=q,Yf=jc,Kf=function(t,e){if(Xf(t),Jf(e)&&e.constructor===t)return e;var r=Yf.f(t);return(0,r.resolve)(e),r.promise},Zf=Kn,Qf=Pc.CONSTRUCTOR,th=Kf;z("Promise"),Zf({target:"Promise",stat:!0,forced:Qf},{resolve:function(t){return th(this,t)}});var eh=p,rh=wt,nh=jc,oh=fc,ih=Vi;Kn({target:"Promise",stat:!0,forced:Af},{allSettled:function(t){var e=this,r=nh.f(e),n=r.resolve,o=r.reject,i=oh((function(){var r=rh(e.resolve),o=[],i=0,a=1;ih(t,(function(t){var s=i++,u=!1;a++,eh(r,e,t).then((function(t){u||(u=!0,o[s]={status:"fulfilled",value:t},--a||n(o))}),(function(t){u||(u=!0,o[s]={status:"rejected",reason:t},--a||n(o))}))})),--a||n(o)}));return i.error&&o(i.value),r.promise}});var ah=p,sh=wt,uh=z,ch=jc,fh=fc,hh=Vi,ph="No one promise resolved";Kn({target:"Promise",stat:!0,forced:Af},{any:function(t){var e=this,r=uh("AggregateError"),n=ch.f(e),o=n.resolve,i=n.reject,a=fh((function(){var n=sh(e.resolve),a=[],s=0,u=1,c=!1;hh(t,(function(t){var f=s++,h=!1;u++,ah(n,e,t).then((function(t){h||c||(c=!0,o(t))}),(function(t){h||c||(h=!0,a[f]=t,--u||i(new r(a,ph)))}))})),--u||i(new r(a,ph))}));return a.error&&i(a.value),n.promise}});var dh=jc;Kn({target:"Promise",stat:!0},{withResolvers:function(){var t=dh.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}});var lh=Kn,yh=hc,vh=s,mh=z,bh=H,gh=eu,wh=Kf,Th=Kr,Oh=yh&&yh.prototype;if(lh({target:"Promise",proto:!0,real:!0,forced:!!yh&&vh((function(){Oh.finally.call({then:function(){}},(function(){}))}))},{finally:function(t){var e=gh(this,mh("Promise")),r=bh(t);return this.then(r?function(r){return wh(e,t()).then((function(){return r}))}:t,r?function(r){return wh(e,t()).then((function(){throw r}))}:t)}}),bh(yh)){var Sh=mh("Promise").prototype.finally;Oh.finally!==Sh&&Th(Oh,"finally",Sh,{unsafe:!0})}var Ph=P,jh=rn,Eh=Ji,Ih=F,Ah=Ph("".charAt),Uh=Ph("".charCodeAt),Rh=Ph("".slice),xh=function(t){return function(e,r){var n,o,i=Eh(Ih(e)),a=jh(r),s=i.length;return a<0||a>=s?t?"":void 0:(n=Uh(i,a))<55296||n>56319||a+1===s||(o=Uh(i,a+1))<56320||o>57343?t?Ah(i,a):n:t?Rh(i,a,a+2):o-56320+(n-55296<<10)+65536}},Dh=(xh(!1),xh(!0)),Ch=Ji,Bh=Ar,kh=rs,_h=ns,Fh="String Iterator",Lh=Bh.set,Nh=Bh.getterFor(Fh);kh(String,"String",(function(t){Lh(this,{type:Fh,string:Ch(t),index:0})}),(function(){var t,e=Nh(this),r=e.string,n=e.index;return n>=r.length?_h(void 0,!0):(t=Dh(r,n),e.index+=t.length,_h(t,!1))})),i.Promise;var Mh=ve("span").classList,$h=Mh&&Mh.constructor&&Mh.constructor.prototype,Hh=$h===Object.prototype?void 0:$h,Wh=i,qh={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},Gh=Hh,Vh=ys,zh=ze,Xh=xa,Jh=oe("iterator"),Yh=Vh.values,Kh=function(t,e){if(t){if(t[Jh]!==Yh)try{zh(t,Jh,Yh)}catch(e){t[Jh]=Yh}if(Xh(t,e,!0),qh[e])for(var r in Vh)if(t[r]!==Vh[r])try{zh(t,r,Vh[r])}catch(e){t[r]=Vh[r]}}};for(var Zh in qh)Kh(Wh[Zh]&&Wh[Zh].prototype,Zh);Kh(Gh,"DOMTokenList");var Qh="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||"undefined"!=typeof global&&global||{},tp="URLSearchParams"in Qh,ep="Symbol"in Qh&&"iterator"in Symbol,rp="FileReader"in Qh&&"Blob"in Qh&&function(){try{return new Blob,!0}catch(t){return!1}}(),np="FormData"in Qh,op="ArrayBuffer"in Qh;if(op)var ip=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],ap=ArrayBuffer.isView||function(t){return t&&ip.indexOf(Object.prototype.toString.call(t))>-1};function sp(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)throw new TypeError('Invalid character in header field name: "'+t+'"');return t.toLowerCase()}function up(t){return"string"!=typeof t&&(t=String(t)),t}function cp(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return ep&&(e[Symbol.iterator]=function(){return e}),e}function fp(t){this.map={},t instanceof fp?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){if(2!=t.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length);this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function hp(t){if(!t._noBody)return t.bodyUsed?Promise.reject(new TypeError("Already read")):void(t.bodyUsed=!0)}function pp(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function dp(t){var e=new FileReader,r=pp(e);return e.readAsArrayBuffer(t),r}function lp(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function yp(){return this.bodyUsed=!1,this._initBody=function(t){var e;this.bodyUsed=this.bodyUsed,this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:rp&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:np&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:tp&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():op&&rp&&(e=t)&&DataView.prototype.isPrototypeOf(e)?(this._bodyArrayBuffer=lp(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):op&&(ArrayBuffer.prototype.isPrototypeOf(t)||ap(t))?this._bodyArrayBuffer=lp(t):this._bodyText=t=Object.prototype.toString.call(t):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):tp&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},rp&&(this.blob=function(){var t=hp(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer)return hp(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer));if(rp)return this.blob().then(dp);throw new Error("could not read as ArrayBuffer")},this.text=function(){var t=hp(this);if(t)return t;if(this._bodyBlob)return function(t){var e=new FileReader,r=pp(e),n=/charset=([A-Za-z0-9_-]+)/.exec(t.type),o=n?n[1]:"utf-8";return e.readAsText(t,o),r}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n<e.length;n++)r[n]=String.fromCharCode(e[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},np&&(this.formData=function(){return this.text().then(bp)}),this.json=function(){return this.text().then(JSON.parse)},this}fp.prototype.append=function(t,e){t=sp(t),e=up(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},fp.prototype.delete=function(t){delete this.map[sp(t)]},fp.prototype.get=function(t){return t=sp(t),this.has(t)?this.map[t]:null},fp.prototype.has=function(t){return this.map.hasOwnProperty(sp(t))},fp.prototype.set=function(t,e){this.map[sp(t)]=up(e)},fp.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},fp.prototype.keys=function(){var t=[];return this.forEach((function(e,r){t.push(r)})),cp(t)},fp.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),cp(t)},fp.prototype.entries=function(){var t=[];return this.forEach((function(e,r){t.push([r,e])})),cp(t)},ep&&(fp.prototype[Symbol.iterator]=fp.prototype.entries);var vp=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function mp(t,e){if(!(this instanceof mp))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var r=(e=e||{}).body;if(t instanceof mp){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new fp(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,r||null==t._bodyInit||(r=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new fp(e.headers)),this.method=function(t){var e=t.toUpperCase();return vp.indexOf(e)>-1?e:t}(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal||function(){if("AbortController"in Qh)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(r),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==e.cache&&"no-cache"!==e.cache)){var n=/([?&])_=[^&]*/;n.test(this.url)?this.url=this.url.replace(n,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function bp(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(o))}})),e}function gp(t,e){if(!(this instanceof gp))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===e.statusText?"":""+e.statusText,this.headers=new fp(e.headers),this.url=e.url||"",this._initBody(t)}mp.prototype.clone=function(){return new mp(this,{body:this._bodyInit})},yp.call(mp.prototype),yp.call(gp.prototype),gp.prototype.clone=function(){return new gp(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new fp(this.headers),url:this.url})},gp.error=function(){var t=new gp(null,{status:200,statusText:""});return t.ok=!1,t.status=0,t.type="error",t};var wp=[301,302,303,307,308];gp.redirect=function(t,e){if(-1===wp.indexOf(e))throw new RangeError("Invalid status code");return new gp(null,{status:e,headers:{location:t}})};var Tp=Qh.DOMException;try{new Tp}catch(n){(Tp=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack}).prototype=Object.create(Error.prototype),Tp.prototype.constructor=Tp}function Op(t,e){return new Promise((function(r,n){var o=new mp(t,e);if(o.signal&&o.signal.aborted)return n(new Tp("Aborted","AbortError"));var i=new XMLHttpRequest;function a(){i.abort()}if(i.onload=function(){var t,e,n={statusText:i.statusText,headers:(t=i.getAllResponseHeaders()||"",e=new fp,t.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(t){return 0===t.indexOf("\n")?t.substr(1,t.length):t})).forEach((function(t){var r=t.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();try{e.append(n,o)}catch(t){console.warn("Response "+t.message)}}})),e)};0===o.url.indexOf("file://")&&(i.status<200||i.status>599)?n.status=200:n.status=i.status,n.url="responseURL"in i?i.responseURL:n.headers.get("X-Request-URL");var a="response"in i?i.response:i.responseText;setTimeout((function(){r(new gp(a,n))}),0)},i.onerror=function(){setTimeout((function(){n(new TypeError("Network request failed"))}),0)},i.ontimeout=function(){setTimeout((function(){n(new TypeError("Network request timed out"))}),0)},i.onabort=function(){setTimeout((function(){n(new Tp("Aborted","AbortError"))}),0)},i.open(o.method,function(t){try{return""===t&&Qh.location.href?Qh.location.href:t}catch(e){return t}}(o.url),!0),"include"===o.credentials?i.withCredentials=!0:"omit"===o.credentials&&(i.withCredentials=!1),"responseType"in i&&(rp?i.responseType="blob":op&&(i.responseType="arraybuffer")),e&&"object"==typeof e.headers&&!(e.headers instanceof fp||Qh.Headers&&e.headers instanceof Qh.Headers)){var s=[];Object.getOwnPropertyNames(e.headers).forEach((function(t){s.push(sp(t)),i.setRequestHeader(t,up(e.headers[t]))})),o.headers.forEach((function(t,e){-1===s.indexOf(e)&&i.setRequestHeader(e,t)}))}else o.headers.forEach((function(t,e){i.setRequestHeader(e,t)}));o.signal&&(o.signal.addEventListener("abort",a),i.onreadystatechange=function(){4===i.readyState&&o.signal.removeEventListener("abort",a)}),i.send(void 0===o._bodyInit?null:o._bodyInit)}))}Op.polyfill=!0,Qh.fetch||(Qh.fetch=Op,Qh.Headers=fp,Qh.Request=mp,Qh.Response=gp);var Sp=function(t,e){return Sp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},Sp(t,e)};function Pp(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}Sp(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function jp(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))}function Ep(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}"function"==typeof SuppressedError&&SuppressedError;var Ip,Ap=function(){function t(){}return t.getIndexFromTimestamps=function(t,e){var r=1e3*t*90,n=-1;if(e.length>0&&r<e[e.length-1])for(var o=0,i=e;o<i.length&&!(i[o]>r);o++)n++;return n},t}(),Up=function(){function t(){this.updateTimestamps=[],this.previousTimestampIndex=0}return t.prototype.setUpdateTimestamps=function(t){this.updateTimestamps=t,this.onTimestampsUpdated&&this.onTimestampsUpdated()},t.prototype.renderAtTimestamp=function(t){var e=Ap.getIndexFromTimestamps(t,this.updateTimestamps);this.renderAtIndex(e)},t.prototype.renderAtIndex=function(t){this.previousTimestampIndex!==t&&(this.previousTimestampIndex=t,this.render(t))},t}(),Rp=function(t){function e(e){var r,n=t.call(this)||this;n.$onWorkerMessage=function(t){n.onWorkerMessage(t)};var o=null!==(r=e.workerUrl)&&void 0!==r?r:"libpgs.worker.js";return n.worker=new Worker(o),n.worker.onmessage=n.$onWorkerMessage,n}return Pp(e,t),e.prototype.loadFromUrl=function(t){this.worker.postMessage({op:"loadFromUrl",url:t})},e.prototype.loadFromBuffer=function(t){this.worker.postMessage({op:"loadFromBuffer",buffer:t})},e.prototype.onWorkerMessage=function(t){"updateTimestamps"===t.data.op&&this.setUpdateTimestamps(t.data.updateTimestamps)},e.prototype.dispose=function(){this.worker.terminate()},e}(Up),xp=function(t){function e(e,r){var n=t.call(this,e)||this,o=r.transferControlToOffscreen();return n.worker.postMessage({op:"init",canvas:o},[o]),n}return Pp(e,t),e.prototype.render=function(t){this.worker.postMessage({op:"render",index:t})},e}(Rp),Dp=function(){function t(){this.empty=!0,this.x=0,this.y=0,this.width=0,this.height=0}return t.prototype.reset=function(){this.empty=!0,this.x=0,this.y=0,this.width=0,this.height=0},t.prototype.set=function(t,e,r,n){void 0===r&&(r=0),void 0===n&&(n=0),this.empty=!1,this.x=t,this.y=e,this.width=r,this.height=n},t.prototype.union=function(t,e,r,n){void 0===r&&(r=0),void 0===n&&(n=0),this.empty?(this.empty=!1,this.x=t,this.y=e,this.width=r,this.height=n):(t<this.x&&(this.width+=this.x-t,this.x=t),e<this.y&&(this.height+=this.y-e,this.y=e),t+r>this.x+this.width&&(this.width=t+r-this.x),e+n>this.y+this.height&&(this.height=e+n-this.y))},t}(),Cp=function(){function t(t){this.dirtyArea=new Dp,this.canvas=t,this.context=t.getContext("2d")}return t.prototype.draw=function(t){this.canvas&&this.context&&(this.dirtyArea.empty||(this.context.clearRect(this.dirtyArea.x,this.dirtyArea.y,this.dirtyArea.width,this.dirtyArea.height),this.dirtyArea.reset()),t&&(this.canvas.width==t.width&&this.canvas.height==t.height||(this.canvas.width=t.width,this.canvas.height=t.height),this.drawSubtitleData(t,this.dirtyArea)))},t.prototype.drawSubtitleData=function(t,e){for(var r=0,n=t.compositionData;r<n.length;r++){var o=n[r];this.drawSubtitleCompositionData(o,e)}},t.prototype.drawSubtitleCompositionData=function(t,e){var r,n,o=t.compositionObject;o.hasCropping?(null===(r=this.context)||void 0===r||r.putImageData(t.pixelData,o.horizontalPosition,o.verticalPosition,o.croppingHorizontalPosition,o.croppingVerticalPosition,o.croppingWidth,o.croppingHeight),null==e||e.union(o.horizontalPosition,o.verticalPosition,o.croppingWidth,o.croppingHeight)):(null===(n=this.context)||void 0===n||n.putImageData(t.pixelData,o.horizontalPosition,o.verticalPosition),null==e||e.union(o.horizontalPosition,o.verticalPosition,t.pixelData.width,t.pixelData.height))},t}(),Bp=function(){function t(t){this.$position=0,this.array=t}return Object.defineProperty(t.prototype,"position",{get:function(){return this.$position},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this.array.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"eof",{get:function(){return this.position>=this.length},enumerable:!1,configurable:!0}),t.prototype.readByte=function(){return this.array[this.$position++]},t.prototype.readBytes=function(t){var e=this.array.slice(this.$position,this.$position+t);return this.$position+=t,e},t}(),kp=function(){function t(t){t instanceof Uint8Array?this.baseReader=new Bp(t):this.baseReader=t}return Object.defineProperty(t.prototype,"position",{get:function(){return this.baseReader.position},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this.baseReader.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"eof",{get:function(){return this.baseReader.eof},enumerable:!1,configurable:!0}),t.prototype.readUInt8=function(){return this.baseReader.readByte()},t.prototype.readUInt16=function(){return(this.baseReader.readByte()<<8)+this.baseReader.readByte()},t.prototype.readUInt24=function(){return(this.baseReader.readByte()<<16)+(this.baseReader.readByte()<<8)+this.baseReader.readByte()},t.prototype.readUInt32=function(){return(this.baseReader.readByte()<<24)+(this.baseReader.readByte()<<16)+(this.baseReader.readByte()<<8)+this.baseReader.readByte()},t.prototype.readBytes=function(t){return this.baseReader.readBytes(t)},t}();!function(t){t[t.paletteDefinition=20]="paletteDefinition",t[t.objectDefinition=21]="objectDefinition",t[t.presentationComposition=22]="presentationComposition",t[t.windowDefinition=23]="windowDefinition",t[t.end=128]="end"}(Ip||(Ip={}));var _p,Fp=function(){function t(){this.id=0,this.windowId=0,this.croppedFlag=0,this.horizontalPosition=0,this.verticalPosition=0,this.croppingHorizontalPosition=0,this.croppingVerticalPosition=0,this.croppingWidth=0,this.croppingHeight=0}return Object.defineProperty(t.prototype,"hasCropping",{get:function(){return!!(128&this.croppedFlag)},enumerable:!1,configurable:!0}),t}(),Lp=function(){function t(){this.width=0,this.height=0,this.frameRate=0,this.compositionNumber=0,this.compositionState=0,this.paletteUpdateFlag=0,this.paletteId=0,this.compositionObjects=[]}return Object.defineProperty(t.prototype,"segmentType",{get:function(){return Ip.presentationComposition},enumerable:!1,configurable:!0}),t.prototype.read=function(t,e){this.width=t.readUInt16(),this.height=t.readUInt16(),this.frameRate=t.readUInt8(),this.compositionNumber=t.readUInt16(),this.compositionState=t.readUInt8(),this.paletteUpdateFlag=t.readUInt8(),this.paletteId=t.readUInt8();var r=t.readUInt8();this.compositionObjects=[];for(var n=0;n<r;n++){var o=new Fp;o.id=t.readUInt16(),o.windowId=t.readUInt8(),o.croppedFlag=t.readUInt8(),o.horizontalPosition=t.readUInt16(),o.verticalPosition=t.readUInt16(),o.hasCropping&&(o.croppingHorizontalPosition=t.readUInt16(),o.croppingVerticalPosition=t.readUInt16(),o.croppingWidth=t.readUInt16(),o.croppingHeight=t.readUInt16()),this.compositionObjects.push(o)}},t}(),Np=function(){function t(){this.id=0,this.versionNumber=0,this.rgba=[]}return Object.defineProperty(t.prototype,"segmentType",{get:function(){return Ip.paletteDefinition},enumerable:!1,configurable:!0}),t.prototype.read=function(e,r){this.id=e.readUInt8(),this.versionNumber=e.readUInt8();var n=(r-2)/5,o=new Uint32Array(1),i=new Uint8Array(o.buffer);this.rgba=[];for(var a=0;a<n;a++){var s=e.readUInt8(),u=e.readUInt8(),c=e.readUInt8()-128,f=e.readUInt8()-128,h=e.readUInt8(),p=t.clamp(Math.round(u+1.402*c),0,255),d=t.clamp(Math.round(u-.34414*f-.71414*c),0,255),l=t.clamp(Math.round(u+1.772*f),0,255);i[0]=p,i[1]=d,i[2]=l,i[3]=h,this.rgba[s]=o[0]}},t.clamp=function(t,e,r){return t<e?e:t>r?r:t},t}(),Mp=function(){function t(){this.id=0,this.versionNumber=0,this.lastInSequenceFlag=0,this.width=0,this.height=0,this.dataLength=0}return Object.defineProperty(t.prototype,"isFirstInSequence",{get:function(){return!!(128&this.lastInSequenceFlag)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isLastInSequence",{get:function(){return!!(64&this.lastInSequenceFlag)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"segmentType",{get:function(){return Ip.objectDefinition},enumerable:!1,configurable:!0}),t.prototype.read=function(t,e){this.id=t.readUInt16(),this.versionNumber=t.readUInt8(),this.lastInSequenceFlag=t.readUInt8(),this.isFirstInSequence?(this.dataLength=t.readUInt24(),this.width=t.readUInt16(),this.height=t.readUInt16(),this.data=t.readBytes(e-11)):this.data=t.readBytes(e-4)},t}(),$p=function(){this.id=0,this.horizontalPosition=0,this.verticalPosition=0,this.width=0,this.height=0},Hp=function(){function t(){this.windows=[]}return Object.defineProperty(t.prototype,"segmentType",{get:function(){return Ip.windowDefinition},enumerable:!1,configurable:!0}),t.prototype.read=function(t,e){var r=t.readUInt8();this.windows=[];for(var n=0;n<r;n++){var o=new $p;o.id=t.readUInt8(),o.horizontalPosition=t.readUInt16(),o.verticalPosition=t.readUInt16(),o.width=t.readUInt16(),o.height=t.readUInt16(),this.windows.push(o)}},t}(),Wp=function(){function t(){this.presentationTimestamp=0,this.decodingTimestamp=0,this.paletteDefinitions=[],this.objectDefinitions=[],this.windowDefinitions=[]}return t.prototype.read=function(t,e){return jp(this,void 0,void 0,(function(){var r,n,o,i,a,s,u,c,f;return Ep(this,(function(h){switch(h.label){case 0:this.presentationTimestamp=0,this.decodingTimestamp=0,this.presentationComposition=void 0,this.paletteDefinitions=[],this.objectDefinitions=[],this.windowDefinitions=[],r=void 0,"requestData"in t.baseReader&&(r=t.baseReader),h.label=1;case 1:return n=0,o=0,e?[4,null==r?void 0:r.requestData(10)]:[3,3];case 2:if(h.sent(),20551!=t.readUInt16())throw new Error("Invalid magic number!");n=t.readUInt32(),o=t.readUInt32(),h.label=3;case 3:return[4,null==r?void 0:r.requestData(3)];case 4:return h.sent(),i=t.readUInt8(),a=t.readUInt16(),[4,null==r?void 0:r.requestData(a)];case 5:switch(h.sent(),i){case Ip.paletteDefinition:(s=new Np).read(t,a),this.paletteDefinitions.push(s);break;case Ip.objectDefinition:(u=new Mp).read(t,a),this.objectDefinitions.push(u);break;case Ip.presentationComposition:(c=new Lp).read(t,a),this.presentationComposition=c,this.presentationTimestamp=n,this.decodingTimestamp=o;break;case Ip.windowDefinition:(f=new Hp).read(t,a),this.windowDefinitions.push(f);break;case Ip.end:return[2];default:throw new Error("Unsupported segment type ".concat(i))}return[3,1];case 6:return[2]}}))}))},t}(),qp=function(){function t(t){this.$position=0,this.subReaderIndex=0,this.subReaders=t.map((function(t){return t instanceof Uint8Array?new Bp(t):t}));for(var e=0,r=0,n=t;r<n.length;r++)e+=n[r].length;this.$length=e}return t.prototype.push=function(t){t instanceof Uint8Array?this.subReaders.push(new Bp(t)):this.subReaders.push(t),this.$length+=t.length},Object.defineProperty(t.prototype,"position",{get:function(){return this.$position},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this.$length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"eof",{get:function(){return this.position>=this.length},enumerable:!1,configurable:!0}),t.prototype.readByte=function(){for(;this.subReaders[this.subReaderIndex].position>=this.subReaders[this.subReaderIndex].length;)this.subReaderIndex++;return this.$position++,this.subReaders[this.subReaderIndex].readByte()},t.prototype.readBytes=function(t){for(var e=new Uint8Array(t),r=0;r<t;r++)e[r]=this.readByte();return e},t}(),Gp=function(){function t(t){this.$eof=!1,this.stream=t,this.reader=new qp([])}return Object.defineProperty(t.prototype,"position",{get:function(){return this.reader.position},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this.reader.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"eof",{get:function(){return this.$eof},enumerable:!1,configurable:!0}),t.prototype.readByte=function(){return this.reader.readByte()},t.prototype.readBytes=function(t){return this.reader.readBytes(t)},t.prototype.requestData=function(){return jp(this,arguments,void 0,(function(t){var e,r,n;return void 0===t&&(t=0),Ep(this,(function(o){switch(o.label){case 0:return this.reader.position+t+1>this.reader.length&&!this.$eof?[4,this.stream.read()]:[3,2];case 1:return e=o.sent(),r=e.value,n=e.done,r&&this.reader.push(r),n&&(this.$eof=!0),[3,0];case 2:return[2,this.reader.position+t<=this.reader.length]}}))}))},t}(),Vp=function(t,e,r){this.width=t,this.height=e,this.compositionData=r},zp=function(t,e,r){this.compositionObject=t,this.window=e,this.pixelData=r},Xp=function(){function t(){}return t.decode=function(t,e,r){t instanceof Uint8Array&&(t=new Bp(t));for(var n=0;t.position<t.length;){var o=t.readByte();if(0==o){var i=t.readByte();if(0!=i){var a=!!(128&i),s=63&i;64&i&&(s=(s<<8)+t.readByte());for(var u=a?t.readByte():0,c=0;c<s;c++)r[n++]=e[u]}}else r[n++]=e[o]}return n},t}(),Jp=function(){function t(){this.displaySets=[],this.updateTimestamps=[]}return t.prototype.loadFromUrl=function(t,e){return jp(this,void 0,void 0,(function(){var r,n,o,i,a;return Ep(this,(function(s){switch(s.label){case 0:return[4,fetch(t)];case 1:if(!(r=s.sent()).ok)throw new Error("HTTP error: ".concat(r.status));return(n=null===(a=r.body)||void 0===a?void 0:a.getReader())?(o=new Gp(n),[3,4]):[3,2];case 2:return[4,r.arrayBuffer()];case 3:i=s.sent(),o=new Bp(new Uint8Array(i)),s.label=4;case 4:return[4,this.loadFromReader(o,e)];case 5:return s.sent(),[2]}}))}))},t.prototype.loadFromBuffer=function(t,e){return jp(this,void 0,void 0,(function(){return Ep(this,(function(r){switch(r.label){case 0:return[4,this.loadFromReader(new Bp(new Uint8Array(t)),e)];case 1:return r.sent(),[2]}}))}))},t.prototype.loadFromReader=function(t,e){return jp(this,void 0,void 0,(function(){var r,n,o,i;return Ep(this,(function(a){switch(a.label){case 0:this.displaySets=[],this.updateTimestamps=[],this.cachedSubtitleData=void 0,r=performance.now(),n=new kp(t),a.label=1;case 1:return t.eof?[3,3]:[4,(o=new Wp).read(n,!0)];case 2:return a.sent(),this.displaySets.push(o),this.updateTimestamps.push(o.presentationTimestamp),(null==e?void 0:e.onProgress)&&(i=performance.now())>r+1e3&&(r=i,e.onProgress()),[3,1];case 3:return(null==e?void 0:e.onProgress)&&e.onProgress(),[2]}}))}))},t.prototype.cacheSubtitleAtIndex=function(t){var e=this.getSubtitleAtIndex(t);this.cachedSubtitleData={index:t,data:e}},t.prototype.getSubtitleAtTimestamp=function(t){var e=Ap.getIndexFromTimestamps(t,this.updateTimestamps);return this.getSubtitleAtIndex(e)},t.prototype.getSubtitleAtIndex=function(t){var e;if(this.cachedSubtitleData&&this.cachedSubtitleData.index===t)return this.cachedSubtitleData.data;if(!(t<0||t>=this.displaySets.length)){var r=this.displaySets[t];if(r.presentationComposition){for(var n=[],o=[],i=[],a=t;a>=0;){var s=this.displaySets[a];n.unshift.apply(n,s.objectDefinitions),o.unshift.apply(o,s.paletteDefinitions);for(var u=0,c=s.windowDefinitions;u<c.length;u++){var f=c[u];i.unshift.apply(i,f.windows)}if(0!==(null===(e=this.displaySets[a].presentationComposition)||void 0===e?void 0:e.compositionState))break;a--}var h=o.find((function(t){var e;return t.id===(null===(e=r.presentationComposition)||void 0===e?void 0:e.paletteId)}));if(h){for(var p=[],d=function(t){var e=i.find((function(e){return e.id===t.windowId}));if(!e)return"continue";var r=l.getPixelDataFromComposition(t,h,n);r&&p.push(new zp(t,e,r))},l=this,y=0,v=r.presentationComposition.compositionObjects;y<v.length;y++)d(v[y]);if(0!==p.length)return new Vp(r.presentationComposition.width,r.presentationComposition.height,p)}}}},t.prototype.getPixelDataFromComposition=function(t,e,r){for(var n=0,o=0,i=[],a=0,s=r;a<s.length;a++){var u=s[a];u.id==t.id&&(u.isFirstInSequence&&(n=u.width,o=u.height),u.data&&i.push(u.data))}if(0!=i.length){var c=new qp(i);if("undefined"!=typeof document){var f=document.createElement("canvas").getContext("2d").createImageData(n,o),h=new Uint32Array(f.data.buffer);return Xp.decode(c,e.rgba,h),f}return h=new Uint32Array(n*o),Xp.decode(c,e.rgba,h),new ImageData(new Uint8ClampedArray(h.buffer),n,o)}},t}(),Yp=function(t){function e(e,r){var n=t.call(this)||this;return n.pgs=new Jp,n.renderer=new Cp(r),n}return Pp(e,t),e.prototype.render=function(t){var e=this,r=this.pgs.getSubtitleAtIndex(t);requestAnimationFrame((function(){e.renderer.draw(r)})),this.pgs.cacheSubtitleAtIndex(t+1)},e.prototype.loadFromUrl=function(t){var e=this;this.pgs.loadFromUrl(t,{onProgress:function(){e.invokeTimestampsUpdate()}}).then((function(){e.invokeTimestampsUpdate()}))},e.prototype.loadFromBuffer=function(t){var e=this;this.pgs.loadFromBuffer(t).then((function(){e.invokeTimestampsUpdate()}))},e.prototype.invokeTimestampsUpdate=function(){this.setUpdateTimestamps(this.pgs.updateTimestamps)},e.prototype.dispose=function(){},e}(Up),Kp=function(t){function e(e,r){var n=t.call(this,e)||this;return n.renderer=new Cp(r),n.worker.postMessage({op:"init"}),n}return Pp(e,t),e.prototype.render=function(t){this.worker.postMessage({op:"requestSubtitleData",index:t})},e.prototype.onWorkerMessage=function(e){if("subtitleData"===e.data.op){var r=e.data.subtitleData;this.renderer&&this.renderer.draw(r)}else t.prototype.onWorkerMessage.call(this,e)},e}(Rp);!function(t){t.worker="worker",t.workerWithoutOffscreenCanvas="workerWithoutOffscreenCanvas",t.mainThread="mainThread"}(_p||(_p={}));var Zp=function(){function t(){}return t.isWorkerSupported=function(){return!!Worker},t.isOffscreenCanvasSupported=function(){return!!HTMLCanvasElement.prototype.transferControlToOffscreen},t.getRendererModeByPlatform=function(){var t=navigator.userAgent,e=/Chrome\/(\d+)/.exec(t),r=e?parseInt(e[1]):void 0,n=/Firefox\/(\d+)/.exec(t),o=n?parseInt(n[1]):void 0,i=navigator.userAgent.indexOf("Web0S")>=0;if(r&&r<36)return _p.mainThread;if(o&&o<25)return _p.mainThread;if(i&&void 0===r)return _p.mainThread;if(i&&r&&r<=68)return _p.mainThread;var a=this.isWorkerSupported(),s=this.isOffscreenCanvasSupported();return a?s?_p.worker:_p.workerWithoutOffscreenCanvas:_p.mainThread},t}(),Qp=function(){function t(t){var e,r=this;if(this.$timeOffset=0,this.onTimeUpdate=function(){r.renderAtVideoTimestamp()},this.$aspectRatio="contain",t.video&&(this.video=t.video),t.canvas)this.canvas=t.canvas,this.canvasOwner=!1;else{if(!this.video)throw new Error("No canvas or video element was provided!");this.canvas=this.createCanvasElement(),this.canvasOwner=!0,this.video.parentElement.appendChild(this.canvas)}this.implementation=this.createPgsRenderer(t),this.implementation.onTimestampsUpdated=function(){r.renderAtVideoTimestamp()},this.$timeOffset=null!==(e=t.timeOffset)&&void 0!==e?e:0,t.aspectRatio&&(this.aspectRatio=t.aspectRatio),t.subUrl&&this.loadFromUrl(t.subUrl),this.registerVideoEvents()}return t.prototype.createPgsRenderer=function(t){var e;switch(null!==(e=t.mode)&&void 0!==e?e:Zp.getRendererModeByPlatform()){case _p.worker:return new xp(t,this.canvas);case _p.workerWithoutOffscreenCanvas:return new Kp(t,this.canvas);case _p.mainThread:return new Yp(t,this.canvas)}},t.prototype.loadFromUrl=function(t){this.implementation.loadFromUrl(t)},t.prototype.loadFromBuffer=function(t){this.implementation.loadFromBuffer(t)},t.prototype.renderAtTimestamp=function(t){this.implementation.renderAtTimestamp(t)},Object.defineProperty(t.prototype,"timeOffset",{get:function(){return this.$timeOffset},set:function(t){this.$timeOffset!==t&&(this.$timeOffset=t,this.renderAtVideoTimestamp())},enumerable:!1,configurable:!0}),t.prototype.registerVideoEvents=function(){var t;null===(t=this.video)||void 0===t||t.addEventListener("timeupdate",this.onTimeUpdate)},t.prototype.unregisterVideoEvents=function(){var t;null===(t=this.video)||void 0===t||t.removeEventListener("timeupdate",this.onTimeUpdate)},t.prototype.renderAtVideoTimestamp=function(){this.video&&this.renderAtTimestamp(this.video.currentTime+this.$timeOffset)},t.prototype.createCanvasElement=function(){var t=document.createElement("canvas");return t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.right="0",t.style.bottom="0",t.style.pointerEvents="none",t.style.objectFit=this.$aspectRatio,t.style.width="100%",t.style.height="100%",t},t.prototype.destroyCanvasElement=function(){this.canvas.remove()},Object.defineProperty(t.prototype,"aspectRatio",{get:function(){return this.$aspectRatio},set:function(t){this.$aspectRatio=t,this.canvas.style.objectFit=this.$aspectRatio},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){this.implementation.dispose(),this.unregisterVideoEvents(),this.canvasOwner&&this.destroyCanvasElement()},t}()}}]);