@vouchfor/embeds 0.0.0-experiment.ea3c2e1 → 0.0.0-experiment.ed7c00c
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/es/embeds.js +4 -4
- package/dist/iife/dialog-embed/embed.iife.js +96 -96
- package/dist/iife/dialog-embed/embed.iife.js.map +1 -1
- package/dist/iife/embeds.iife.js +96 -96
- package/dist/iife/embeds.iife.js.map +1 -1
- package/dist/iife/player-embed/embed.iife.js +111 -111
- package/dist/iife/player-embed/embed.iife.js.map +1 -1
- package/package.json +4 -4
@@ -1,22 +1,22 @@
|
|
1
|
-
var playerEmbed=function(
|
1
|
+
var playerEmbed=function(tt){"use strict";/**
|
2
2
|
* @license
|
3
3
|
* Copyright 2019 Google LLC
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
5
|
-
*/var pd;const bi=globalThis,Xs=bi.ShadowRoot&&(bi.ShadyCSS===void 0||bi.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,js=Symbol(),
|
5
|
+
*/var pd;const bi=globalThis,Xs=bi.ShadowRoot&&(bi.ShadyCSS===void 0||bi.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,js=Symbol(),Il=new WeakMap;let Cl=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==js)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(Xs&&e===void 0){const n=t!==void 0&&t.length===1;n&&(e=Il.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Il.set(t,e))}return e}toString(){return this.cssText}};const Un=r=>new Cl(typeof r=="string"?r:r+"",void 0,js),gt=(r,...e)=>{const t=r.length===1?r[0]:e.reduce((n,i,s)=>n+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[s+1],r[0]);return new Cl(t,r,js)},Td=(r,e)=>{if(Xs)r.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const n=document.createElement("style"),i=bi.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=t.cssText,r.appendChild(n)}},vl=Xs?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return Un(t)})(r):r;/**
|
6
6
|
* @license
|
7
7
|
* Copyright 2017 Google LLC
|
8
8
|
* SPDX-License-Identifier: BSD-3-Clause
|
9
|
-
*/const{is:bd,defineProperty:xd,getOwnPropertyDescriptor:wd,getOwnPropertyNames:Sd,getOwnPropertySymbols:Rd,getPrototypeOf:Dd}=Object,xr=globalThis,
|
9
|
+
*/const{is:bd,defineProperty:xd,getOwnPropertyDescriptor:wd,getOwnPropertyNames:Sd,getOwnPropertySymbols:Rd,getPrototypeOf:Dd}=Object,xr=globalThis,yl=xr.trustedTypes,_d=yl?yl.emptyScript:"",zs=xr.reactiveElementPolyfillSupport,Gn=(r,e)=>r,xi={toAttribute(r,e){switch(e){case Boolean:r=r?_d:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,e){let t=r;switch(e){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},wi=(r,e)=>!bd(r,e),Bl={attribute:!0,type:String,converter:xi,reflect:!1,hasChanged:wi};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),xr.litPropertyMetadata??(xr.litPropertyMetadata=new WeakMap);class ln extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=Bl){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const n=Symbol(),i=this.getPropertyDescriptor(e,n,t);i!==void 0&&xd(this.prototype,e,i)}}static getPropertyDescriptor(e,t,n){const{get:i,set:s}=wd(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get(){return i==null?void 0:i.call(this)},set(o){const a=i==null?void 0:i.call(this);s.call(this,o),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Bl}static _$Ei(){if(this.hasOwnProperty(Gn("elementProperties")))return;const e=Dd(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Gn("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Gn("properties"))){const t=this.properties,n=[...Sd(t),...Rd(t)];for(const i of n)this.createProperty(i,t[i])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[n,i]of t)this.elementProperties.set(n,i)}this._$Eh=new Map;for(const[t,n]of this.elementProperties){const i=this._$Eu(t,n);i!==void 0&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const i of n)t.unshift(vl(i))}else e!==void 0&&t.push(vl(e));return t}static _$Eu(e,t){const n=t.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Td(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var n;return(n=t.hostConnected)==null?void 0:n.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var n;return(n=t.hostDisconnected)==null?void 0:n.call(t)})}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$EC(e,t){var s;const n=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,n);if(i!==void 0&&n.reflect===!0){const o=(((s=n.converter)==null?void 0:s.toAttribute)!==void 0?n.converter:xi).toAttribute(t,n.type);this._$Em=e,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(e,t){var s;const n=this.constructor,i=n._$Eh.get(e);if(i!==void 0&&this._$Em!==i){const o=n.getPropertyOptions(i),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((s=o.converter)==null?void 0:s.fromAttribute)!==void 0?o.converter:xi;this._$Em=i,this[i]=a.fromAttribute(t,o.type),this._$Em=null}}requestUpdate(e,t,n){if(e!==void 0){if(n??(n=this.constructor.getPropertyOptions(e)),!(n.hasChanged??wi)(this[e],t))return;this.P(e,t,n)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,t,n){this._$AL.has(e)||this._$AL.set(e,t),n.reflect===!0&&this._$Em!==e&&(this._$Ej??(this._$Ej=new Set)).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var n;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[s,o]of this._$Ep)this[s]=o;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[s,o]of i)o.wrapped!==!0||this._$AL.has(s)||this[s]===void 0||this.P(s,this[s],o)}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(n=this._$EO)==null||n.forEach(i=>{var s;return(s=i.hostUpdate)==null?void 0:s.call(i)}),this.update(t)):this._$EU()}catch(i){throw e=!1,this._$EU(),i}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(n=>{var i;return(i=n.hostUpdated)==null?void 0:i.call(n)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(t=>this._$EC(t,this[t]))),this._$EU()}updated(e){}firstUpdated(e){}}ln.elementStyles=[],ln.shadowRootOptions={mode:"open"},ln[Gn("elementProperties")]=new Map,ln[Gn("finalized")]=new Map,zs==null||zs({ReactiveElement:ln}),(xr.reactiveElementVersions??(xr.reactiveElementVersions=[])).push("2.0.4");/**
|
10
10
|
* @license
|
11
11
|
* Copyright 2017 Google LLC
|
12
12
|
* SPDX-License-Identifier: BSD-3-Clause
|
13
|
-
*/const Hn=globalThis,Si=Hn.trustedTypes,
|
14
|
-
\f\r]`,Vn=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
|
15
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),
|
13
|
+
*/const Hn=globalThis,Si=Hn.trustedTypes,Ql=Si?Si.createPolicy("lit-html",{createHTML:r=>r}):void 0,Zs="$lit$",gr=`lit$${(Math.random()+"").slice(9)}$`,eo="?"+gr,Ld=`<${eo}>`,Nr=document,$n=()=>Nr.createComment(""),Yn=r=>r===null||typeof r!="object"&&typeof r!="function",Tl=Array.isArray,bl=r=>Tl(r)||typeof(r==null?void 0:r[Symbol.iterator])=="function",to=`[
|
14
|
+
\f\r]`,Vn=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,xl=/-->/g,wl=/>/g,Mr=RegExp(`>|${to}(?:([^\\s"'>=/]+)(${to}*=${to}*(?:[^
|
15
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Sl=/'/g,Rl=/"/g,Dl=/^(?:script|style|textarea|title)$/i,Fd=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),Qe=Fd(1),Vt=Symbol.for("lit-noChange"),rt=Symbol.for("lit-nothing"),_l=new WeakMap,Pr=Nr.createTreeWalker(Nr,129);function Ll(r,e){if(!Array.isArray(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ql!==void 0?Ql.createHTML(e):e}const Fl=(r,e)=>{const t=r.length-1,n=[];let i,s=e===2?"<svg>":"",o=Vn;for(let a=0;a<t;a++){const l=r[a];let A,c,u=-1,h=0;for(;h<l.length&&(o.lastIndex=h,c=o.exec(l),c!==null);)h=o.lastIndex,o===Vn?c[1]==="!--"?o=xl:c[1]!==void 0?o=wl:c[2]!==void 0?(Dl.test(c[2])&&(i=RegExp("</"+c[2],"g")),o=Mr):c[3]!==void 0&&(o=Mr):o===Mr?c[0]===">"?(o=i??Vn,u=-1):c[1]===void 0?u=-2:(u=o.lastIndex-c[2].length,A=c[1],o=c[3]===void 0?Mr:c[3]==='"'?Rl:Sl):o===Rl||o===Sl?o=Mr:o===xl||o===wl?o=Vn:(o=Mr,i=void 0);const d=o===Mr&&r[a+1].startsWith("/>")?" ":"";s+=o===Vn?l+Ld:u>=0?(n.push(A),l.slice(0,u)+Zs+l.slice(u)+gr+d):l+gr+(u===-2?a:d)}return[Ll(r,s+(r[t]||"<?>")+(e===2?"</svg>":"")),n]};class Kn{constructor({strings:e,_$litType$:t},n){let i;this.parts=[];let s=0,o=0;const a=e.length-1,l=this.parts,[A,c]=Fl(e,t);if(this.el=Kn.createElement(A,n),Pr.currentNode=this.el.content,t===2){const u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(i=Pr.nextNode())!==null&&l.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(const u of i.getAttributeNames())if(u.endsWith(Zs)){const h=c[o++],d=i.getAttribute(u).split(gr),f=/([.?@])?(.*)/.exec(h);l.push({type:1,index:s,name:f[2],strings:d,ctor:f[1]==="."?Nl:f[1]==="?"?Ml:f[1]==="@"?Pl:Jn}),i.removeAttribute(u)}else u.startsWith(gr)&&(l.push({type:6,index:s}),i.removeAttribute(u));if(Dl.test(i.tagName)){const u=i.textContent.split(gr),h=u.length-1;if(h>0){i.textContent=Si?Si.emptyScript:"";for(let d=0;d<h;d++)i.append(u[d],$n()),Pr.nextNode(),l.push({type:2,index:++s});i.append(u[h],$n())}}}else if(i.nodeType===8)if(i.data===eo)l.push({type:2,index:s});else{let u=-1;for(;(u=i.data.indexOf(gr,u+1))!==-1;)l.push({type:7,index:s}),u+=gr.length-1}s++}}static createElement(e,t){const n=Nr.createElement("template");return n.innerHTML=e,n}}function Or(r,e,t=r,n){var o,a;if(e===Vt)return e;let i=n!==void 0?(o=t._$Co)==null?void 0:o[n]:t._$Cl;const s=Yn(e)?void 0:e._$litDirective$;return(i==null?void 0:i.constructor)!==s&&((a=i==null?void 0:i._$AO)==null||a.call(i,!1),s===void 0?i=void 0:(i=new s(r),i._$AT(r,t,n)),n!==void 0?(t._$Co??(t._$Co=[]))[n]=i:t._$Cl=i),i!==void 0&&(e=Or(r,i._$AS(r,e.values),i,n)),e}class kl{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:n}=this._$AD,i=((e==null?void 0:e.creationScope)??Nr).importNode(t,!0);Pr.currentNode=i;let s=Pr.nextNode(),o=0,a=0,l=n[0];for(;l!==void 0;){if(o===l.index){let A;l.type===2?A=new An(s,s.nextSibling,this,e):l.type===1?A=new l.ctor(s,l.name,l.strings,this,e):l.type===6&&(A=new Ol(s,this,e)),this._$AV.push(A),l=n[++a]}o!==(l==null?void 0:l.index)&&(s=Pr.nextNode(),o++)}return Pr.currentNode=Nr,i}p(e){let t=0;for(const n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}}class An{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,n,i){this.type=2,this._$AH=rt,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=i,this._$Cv=(i==null?void 0:i.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Or(this,e,t),Yn(e)?e===rt||e==null||e===""?(this._$AH!==rt&&this._$AR(),this._$AH=rt):e!==this._$AH&&e!==Vt&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):bl(e)?this.k(e):this._(e)}S(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.S(e))}_(e){this._$AH!==rt&&Yn(this._$AH)?this._$AA.nextSibling.data=e:this.T(Nr.createTextNode(e)),this._$AH=e}$(e){var s;const{values:t,_$litType$:n}=e,i=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=Kn.createElement(Ll(n.h,n.h[0]),this.options)),n);if(((s=this._$AH)==null?void 0:s._$AD)===i)this._$AH.p(t);else{const o=new kl(i,this),a=o.u(this.options);o.p(t),this.T(a),this._$AH=o}}_$AC(e){let t=_l.get(e.strings);return t===void 0&&_l.set(e.strings,t=new Kn(e)),t}k(e){Tl(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let n,i=0;for(const s of e)i===t.length?t.push(n=new An(this.S($n()),this.S($n()),this,this.options)):n=t[i],n._$AI(s),i++;i<t.length&&(this._$AR(n&&n._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){var n;for((n=this._$AP)==null?void 0:n.call(this,!1,!0,t);e&&e!==this._$AB;){const i=e.nextSibling;e.remove(),e=i}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}}class Jn{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,i,s){this.type=1,this._$AH=rt,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=s,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=rt}_$AI(e,t=this,n,i){const s=this.strings;let o=!1;if(s===void 0)e=Or(this,e,t,0),o=!Yn(e)||e!==this._$AH&&e!==Vt,o&&(this._$AH=e);else{const a=e;let l,A;for(e=s[0],l=0;l<s.length-1;l++)A=Or(this,a[n+l],t,l),A===Vt&&(A=this._$AH[l]),o||(o=!Yn(A)||A!==this._$AH[l]),A===rt?e=rt:e!==rt&&(e+=(A??"")+s[l+1]),this._$AH[l]=A}o&&!i&&this.j(e)}j(e){e===rt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class Nl extends Jn{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===rt?void 0:e}}class Ml extends Jn{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==rt)}}class Pl extends Jn{constructor(e,t,n,i,s){super(e,t,n,i,s),this.type=5}_$AI(e,t=this){if((e=Or(this,e,t,0)??rt)===Vt)return;const n=this._$AH,i=e===rt&&n!==rt||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,s=e!==rt&&(n===rt||i);i&&this.element.removeEventListener(this.name,this,n),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}}class Ol{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){Or(this,e)}}const kd={P:Zs,A:gr,C:eo,M:1,L:Fl,R:kl,D:bl,V:Or,I:An,H:Jn,N:Ml,U:Pl,B:Nl,F:Ol},ro=Hn.litHtmlPolyfillSupport;ro==null||ro(Kn,An),(Hn.litHtmlVersions??(Hn.litHtmlVersions=[])).push("3.1.2");const Nd=(r,e,t)=>{const n=(t==null?void 0:t.renderBefore)??e;let i=n._$litPart$;if(i===void 0){const s=(t==null?void 0:t.renderBefore)??null;n._$litPart$=i=new An(e.insertBefore($n(),s),s,void 0,t??{})}return i._$AI(r),i};/**
|
16
16
|
* @license
|
17
17
|
* Copyright 2017 Google LLC
|
18
18
|
* SPDX-License-Identifier: BSD-3-Clause
|
19
|
-
*/let
|
19
|
+
*/let cn=class extends ln{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Nd(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return Vt}};cn._$litElement$=!0,cn.finalized=!0,(pd=globalThis.litElementHydrateSupport)==null||pd.call(globalThis,{LitElement:cn});const no=globalThis.litElementPolyfillSupport;no==null||no({LitElement:cn}),(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.4");/**
|
20
20
|
* @license
|
21
21
|
* Copyright 2017 Google LLC
|
22
22
|
* SPDX-License-Identifier: BSD-3-Clause
|
@@ -24,7 +24,7 @@ var playerEmbed=function(et){"use strict";/**
|
|
24
24
|
* @license
|
25
25
|
* Copyright 2017 Google LLC
|
26
26
|
* SPDX-License-Identifier: BSD-3-Clause
|
27
|
-
*/const Pd={attribute:!0,type:String,converter:xi,reflect:!1,hasChanged:wi},Od=(r=Pd,e,t)=>{const{kind:n,metadata:i}=t;let s=globalThis.litPropertyMetadata.get(i);if(s===void 0&&globalThis.litPropertyMetadata.set(i,s=new Map),s.set(t.name,r),n==="accessor"){const{name:o}=t;return{set(a){const
|
27
|
+
*/const Pd={attribute:!0,type:String,converter:xi,reflect:!1,hasChanged:wi},Od=(r=Pd,e,t)=>{const{kind:n,metadata:i}=t;let s=globalThis.litPropertyMetadata.get(i);if(s===void 0&&globalThis.litPropertyMetadata.set(i,s=new Map),s.set(t.name,r),n==="accessor"){const{name:o}=t;return{set(a){const l=e.get.call(this);e.set.call(this,a),this.requestUpdate(o,l,r)},init(a){return a!==void 0&&this.P(o,void 0,r),a}}}if(n==="setter"){const{name:o}=t;return function(a){const l=this[o];e.call(this,a),this.requestUpdate(o,l,r)}}throw Error("Unsupported decorator location: "+n)};function oe(r){return(e,t)=>typeof t=="object"?Od(r,e,t):((n,i,s)=>{const o=i.hasOwnProperty(s);return i.constructor.createProperty(s,o?{...n,wrapped:!0}:n),o?Object.getOwnPropertyDescriptor(i,s):void 0})(r,e,t)}/**
|
28
28
|
* @license
|
29
29
|
* Copyright 2017 Google LLC
|
30
30
|
* SPDX-License-Identifier: BSD-3-Clause
|
@@ -32,67 +32,67 @@ var playerEmbed=function(et){"use strict";/**
|
|
32
32
|
* @license
|
33
33
|
* Copyright 2018 Google LLC
|
34
34
|
* SPDX-License-Identifier: BSD-3-Clause
|
35
|
-
*/const Ur=r=>r??
|
35
|
+
*/const Ur=r=>r??rt;/**
|
36
36
|
* @license
|
37
37
|
* Copyright 2020 Google LLC
|
38
38
|
* SPDX-License-Identifier: BSD-3-Clause
|
39
|
-
*/const{I:Ud}=kd,Gd=r=>r.strings===void 0,
|
39
|
+
*/const{I:Ud}=kd,Gd=r=>r.strings===void 0,Ul=()=>document.createComment(""),Wn=(r,e,t)=>{var s;const n=r._$AA.parentNode,i=e===void 0?r._$AB:e._$AA;if(t===void 0){const o=n.insertBefore(Ul(),i),a=n.insertBefore(Ul(),i);t=new Ud(o,a,r,r.options)}else{const o=t._$AB.nextSibling,a=t._$AM,l=a!==r;if(l){let A;(s=t._$AQ)==null||s.call(t,r),t._$AM=r,t._$AP!==void 0&&(A=r._$AU)!==a._$AU&&t._$AP(A)}if(o!==i||l){let A=t._$AA;for(;A!==o;){const c=A.nextSibling;n.insertBefore(A,i),A=c}}}return t},Gr=(r,e,t=r)=>(r._$AI(e,t),r),Hd={},$d=(r,e=Hd)=>r._$AH=e,Yd=r=>r._$AH,io=r=>{var n;(n=r._$AP)==null||n.call(r,!1,!0);let e=r._$AA;const t=r._$AB.nextSibling;for(;e!==t;){const i=e.nextSibling;e.remove(),e=i}};/**
|
40
40
|
* @license
|
41
41
|
* Copyright 2017 Google LLC
|
42
42
|
* SPDX-License-Identifier: BSD-3-Clause
|
43
|
-
*/const
|
43
|
+
*/const un={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},hn=r=>(...e)=>({_$litDirective$:r,values:e});let qn=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};/**
|
44
44
|
* @license
|
45
45
|
* Copyright 2017 Google LLC
|
46
46
|
* SPDX-License-Identifier: BSD-3-Clause
|
47
|
-
*/const Xn=(r,e)=>{var n;const t=r._$AN;if(t===void 0)return!1;for(const i of t)(n=i._$AO)==null||n.call(i,e,!1),Xn(i,e);return!0},Ri=r=>{let e,t;do{if((e=r._$AM)===void 0)break;t=e._$AN,t.delete(r),r=e}while((t==null?void 0:t.size)===0)},
|
47
|
+
*/const Xn=(r,e)=>{var n;const t=r._$AN;if(t===void 0)return!1;for(const i of t)(n=i._$AO)==null||n.call(i,e,!1),Xn(i,e);return!0},Ri=r=>{let e,t;do{if((e=r._$AM)===void 0)break;t=e._$AN,t.delete(r),r=e}while((t==null?void 0:t.size)===0)},Gl=r=>{for(let e;e=r._$AM;r=e){let t=e._$AN;if(t===void 0)e._$AN=t=new Set;else if(t.has(r))break;t.add(r),Jd(e)}};function Vd(r){this._$AN!==void 0?(Ri(this),this._$AM=r,Gl(this)):this._$AM=r}function Kd(r,e=!1,t=0){const n=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(e)if(Array.isArray(n))for(let s=t;s<n.length;s++)Xn(n[s],!1),Ri(n[s]);else n!=null&&(Xn(n,!1),Ri(n));else Xn(this,r)}const Jd=r=>{r.type==un.CHILD&&(r._$AP??(r._$AP=Kd),r._$AQ??(r._$AQ=Vd))};class Hl extends qn{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,n){super._$AT(e,t,n),Gl(this),this.isConnected=e._$AU}_$AO(e,t=!0){var n,i;e!==this.isConnected&&(this.isConnected=e,e?(n=this.reconnected)==null||n.call(this):(i=this.disconnected)==null||i.call(this)),t&&(Xn(this,e),Ri(this))}setValue(e){if(Gd(this._$Ct))this._$Ct._$AI(e,this);else{const t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}}/**
|
48
48
|
* @license
|
49
49
|
* Copyright 2020 Google LLC
|
50
50
|
* SPDX-License-Identifier: BSD-3-Clause
|
51
|
-
*/const vt=()=>new Wd;let Wd=class{};const so=new WeakMap,yt=
|
51
|
+
*/const vt=()=>new Wd;let Wd=class{};const so=new WeakMap,yt=hn(class extends Hl{render(r){return rt}update(r,[e]){var n;const t=e!==this.Y;return t&&this.Y!==void 0&&this.rt(void 0),(t||this.lt!==this.ct)&&(this.Y=e,this.ht=(n=r.options)==null?void 0:n.host,this.rt(this.ct=r.element)),rt}rt(r){if(typeof this.Y=="function"){const e=this.ht??globalThis;let t=so.get(e);t===void 0&&(t=new WeakMap,so.set(e,t)),t.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),t.set(this.Y,r),r!==void 0&&this.Y.call(this.ht,r)}else this.Y.value=r}get lt(){var r,e;return typeof this.Y=="function"?(r=so.get(this.ht??globalThis))==null?void 0:r.get(this.Y):(e=this.Y)==null?void 0:e.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});function qd(r,e,t){function n(i){t.dispatchEvent(new CustomEvent(i.type,i))}return e.addEventListener(r,n),()=>{e.removeEventListener(r,n)}}class Xd{constructor(e,t){this._events=[],this._cleanup=[],this._forwardElementRef=vt(),this.host=e,this._events=t,e.addController(this)}register(){return yt(this._forwardElementRef)}hostConnected(){requestAnimationFrame(()=>{this._events.forEach(e=>{this._forwardElementRef.value&&this._cleanup.push(qd(e,this._forwardElementRef.value,this.host))})})}hostDisconnected(){this._cleanup.forEach(e=>{e()}),this._cleanup=[]}}/**
|
52
52
|
* @license
|
53
53
|
* Copyright 2017 Google LLC
|
54
54
|
* SPDX-License-Identifier: BSD-3-Clause
|
55
|
-
*/const jd=Symbol();class Di{get taskComplete(){return this.t||(this.status===1?this.t=new Promise((e,t)=>{this.i=e,this.o=t}):this.status===3?this.t=Promise.reject(this.h):this.t=Promise.resolve(this.l)),this.t}constructor(e,t,n){var s;this.u=0,this.status=0,(this.p=e).addController(this);const i=typeof t=="object"?t:{task:t,args:n};this._=i.task,this.v=i.args,this.j=i.argsEqual??zd,this.m=i.onComplete,this.g=i.onError,this.autoRun=i.autoRun??!0,"initialValue"in i&&(this.l=i.initialValue,this.status=2,this.k=(s=this.A)==null?void 0:s.call(this))}hostUpdate(){this.autoRun===!0&&this.O()}hostUpdated(){this.autoRun==="afterUpdate"&&this.O()}A(){if(this.v===void 0)return;const e=this.v();if(!Array.isArray(e))throw Error("The args function must return an array");return e}async O(){const e=this.A(),t=this.k;this.k=e,e===t||e===void 0||t!==void 0&&this.j(t,e)||await this.run(e)}async run(e){var o,a,A,
|
56
|
-
${e}`,pf=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),mf=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Ef=(r,e,t)=>{const n=t===""?"":`with ${t.trim()}() `,i=gf.bind(null,n,e.toString());Object.defineProperty(i,"name",mf);const{writable:s,enumerable:o,configurable:a}=pf;Object.defineProperty(r,"toString",{value:i,writable:s,enumerable:o,configurable:a})};function If(r,e,{ignoreNonConfigurable:t=!1}={}){const{name:n}=r;for(const i of Reflect.ownKeys(e))hf(r,e,i,t);return ff(r,e),Ef(r,e,n),r}const Cf=new WeakMap,
|
55
|
+
*/const jd=Symbol();class Di{get taskComplete(){return this.t||(this.status===1?this.t=new Promise((e,t)=>{this.i=e,this.o=t}):this.status===3?this.t=Promise.reject(this.h):this.t=Promise.resolve(this.l)),this.t}constructor(e,t,n){var s;this.u=0,this.status=0,(this.p=e).addController(this);const i=typeof t=="object"?t:{task:t,args:n};this._=i.task,this.v=i.args,this.j=i.argsEqual??zd,this.m=i.onComplete,this.g=i.onError,this.autoRun=i.autoRun??!0,"initialValue"in i&&(this.l=i.initialValue,this.status=2,this.k=(s=this.A)==null?void 0:s.call(this))}hostUpdate(){this.autoRun===!0&&this.O()}hostUpdated(){this.autoRun==="afterUpdate"&&this.O()}A(){if(this.v===void 0)return;const e=this.v();if(!Array.isArray(e))throw Error("The args function must return an array");return e}async O(){const e=this.A(),t=this.k;this.k=e,e===t||e===void 0||t!==void 0&&this.j(t,e)||await this.run(e)}async run(e){var o,a,l,A,c;let t,n;e??(e=this.A()),this.k=e,this.status===1?(o=this.T)==null||o.abort():(this.t=void 0,this.i=void 0,this.o=void 0),this.status=1,this.autoRun==="afterUpdate"?queueMicrotask(()=>this.p.requestUpdate()):this.p.requestUpdate();const i=++this.u;this.T=new AbortController;let s=!1;try{t=await this._(e,{signal:this.T.signal})}catch(u){s=!0,n=u}if(this.u===i){if(t===jd)this.status=0;else{if(s===!1){try{(a=this.m)==null||a.call(this,t)}catch{}this.status=2,(l=this.i)==null||l.call(this,t)}else{try{(A=this.g)==null||A.call(this,n)}catch{}this.status=3,(c=this.o)==null||c.call(this,n)}this.l=t,this.h=n}this.p.requestUpdate()}}abort(e){var t;this.status===1&&((t=this.T)==null||t.abort(e))}get value(){return this.l}get error(){return this.h}render(e){var t,n,i,s;switch(this.status){case 0:return(t=e.initial)==null?void 0:t.call(e);case 1:return(n=e.pending)==null?void 0:n.call(e);case 2:return(i=e.complete)==null?void 0:i.call(e,this.value);case 3:return(s=e.error)==null?void 0:s.call(e,this.error);default:throw Error("Unexpected status: "+this.status)}}}const zd=(r,e)=>r===e||r.length===e.length&&r.every((t,n)=>!wi(t,e[n]));let _i;const Zd=new Uint8Array(16);function ef(){if(!_i&&(_i=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!_i))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return _i(Zd)}const pt=[];for(let r=0;r<256;++r)pt.push((r+256).toString(16).slice(1));function tf(r,e=0){return pt[r[e+0]]+pt[r[e+1]]+pt[r[e+2]]+pt[r[e+3]]+"-"+pt[r[e+4]]+pt[r[e+5]]+"-"+pt[r[e+6]]+pt[r[e+7]]+"-"+pt[r[e+8]]+pt[r[e+9]]+"-"+pt[r[e+10]]+pt[r[e+11]]+pt[r[e+12]]+pt[r[e+13]]+pt[r[e+14]]+pt[r[e+15]]}const $l={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Hr(r,e,t){if($l.randomUUID&&!e&&!r)return $l.randomUUID();r=r||{};const n=r.random||(r.rng||ef)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){t=t||0;for(let i=0;i<16;++i)e[t+i]=n[i];return e}return tf(n)}const Yl="https://d2rxhdlm2q91uk.cloudfront.net",rf="https://d1ix11aj5kfygl.cloudfront.net",nf="https://d157jlwnudd93d.cloudfront.net",Vl="https://bshyfw4h5a.execute-api.ap-southeast-2.amazonaws.com/dev",sf="https://gyzw7rpbq3.execute-api.ap-southeast-2.amazonaws.com/staging",of="https://vfcjuim1l3.execute-api.ap-southeast-2.amazonaws.com/prod",af="http://localhost:6060/v2",lf="https://embed-dev.vouchfor.com/v2",Af="https://embed-staging.vouchfor.com/v2",cf="https://embed.vouchfor.com/v2";function Li(r){if(!["local","dev","staging","prod"].includes(r))throw new Error(`Unknown environment: ${r}`);if(r==="local")return{videoUrl:Yl,publicApiUrl:Vl,embedApiUrl:af};if(r==="dev")return{videoUrl:Yl,publicApiUrl:Vl,embedApiUrl:lf};if(r==="staging")return{videoUrl:rf,publicApiUrl:sf,embedApiUrl:Af};if(r==="prod")return{videoUrl:nf,publicApiUrl:of,embedApiUrl:cf}}class uf{constructor(e){this._fetching=!1,this.getVouch=async(t,n,i)=>{var c;const{embedApiUrl:s}=Li(t),o=Hr(),a=await fetch(`${s}/vouches/${i}`,{method:"GET",headers:[["X-Api-Key",n],["X-Cache-Check",o]]}),l=await a.json();return this.host.dispatchEvent(new CustomEvent("vouch:loaded",{detail:l==null?void 0:l.id})),((c=a==null?void 0:a.headers)==null?void 0:c.get("X-Cache-Check"))!==o&&fetch(`${s}/vouches/${i}`,{method:"GET",headers:[["X-Api-Key",n],["Cache-Control","max-age=0"]]}),l},this.getTemplate=async(t,n,i)=>{var c;const{embedApiUrl:s}=Li(t),o=Hr(),a=await fetch(`${s}/templates/${i}`,{method:"GET",headers:[["X-Api-Key",n],["X-Cache-Check",o]]}),l=await a.json();return((c=a==null?void 0:a.headers)==null?void 0:c.get("X-Cache-Check"))!==o&&fetch(`${s}/templates/${i}`,{method:"GET",headers:[["X-Api-Key",n],["Cache-Control","max-age=0"]]}),l},this.host=e,new Di(this.host,async([t,n,i,s,o])=>{var a,l,A,c;try{if(e.vouch=void 0,e.template=void 0,i){let u;o&&(this.fetching=!0,u=await this.getTemplate(t,n,o)),this._vouch=i,e.template=u??((l=(a=i==null?void 0:i.settings)==null?void 0:a.template)==null?void 0:l.instance)}else if(s){this.fetching=!0;const[u,h]=await Promise.all([this.getVouch(t,n,s),o?this.getTemplate(t,n,o):null]);this._vouch=u,e.template=h??((c=(A=u==null?void 0:u.settings)==null?void 0:A.template)==null?void 0:c.instance)}}finally{this.fetching=!1}},()=>[e.env,e.apiKey,e.data,e.vouchId,e.templateId]),new Di(this.host,([t,n])=>{e.vouch=t?{...t,questions:{items:t==null?void 0:t.questions.items.filter((i,s)=>!(n!=null&&n.length)||(n==null?void 0:n.includes(s+1)))}}:void 0},()=>[this._vouch,e.questions])}set fetching(e){this._fetching!==e&&(this._fetching=e,this.host.requestUpdate())}get fetching(){return this._fetching}}const hf=(r,e,t,n)=>{if(t==="length"||t==="prototype"||t==="arguments"||t==="caller")return;const i=Object.getOwnPropertyDescriptor(r,t),s=Object.getOwnPropertyDescriptor(e,t);!df(i,s)&&n||Object.defineProperty(r,t,s)},df=function(r,e){return r===void 0||r.configurable||r.writable===e.writable&&r.enumerable===e.enumerable&&r.configurable===e.configurable&&(r.writable||r.value===e.value)},ff=(r,e)=>{const t=Object.getPrototypeOf(e);t!==Object.getPrototypeOf(r)&&Object.setPrototypeOf(r,t)},gf=(r,e)=>`/* Wrapped ${r}*/
|
56
|
+
${e}`,pf=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),mf=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Ef=(r,e,t)=>{const n=t===""?"":`with ${t.trim()}() `,i=gf.bind(null,n,e.toString());Object.defineProperty(i,"name",mf);const{writable:s,enumerable:o,configurable:a}=pf;Object.defineProperty(r,"toString",{value:i,writable:s,enumerable:o,configurable:a})};function If(r,e,{ignoreNonConfigurable:t=!1}={}){const{name:n}=r;for(const i of Reflect.ownKeys(e))hf(r,e,i,t);return ff(r,e),Ef(r,e,n),r}const Cf=new WeakMap,Kl=new WeakMap;function oo(r,{cacheKey:e,cache:t=new Map,maxAge:n}={}){if(n===0)return r;if(typeof n=="number"){if(n>2147483647)throw new TypeError("The `maxAge` option cannot exceed 2147483647.");if(n<0)throw new TypeError("The `maxAge` option should not be a negative number.")}const i=function(...s){var A;const o=e?e(s):s[0],a=t.get(o);if(a)return a.data;const l=r.apply(this,s);if(t.set(o,{data:l,maxAge:n?Date.now()+n:Number.POSITIVE_INFINITY}),typeof n=="number"&&n!==Number.POSITIVE_INFINITY){const c=setTimeout(()=>{t.delete(o)},n);(A=c.unref)==null||A.call(c);const u=Kl.get(r)??new Set;u.add(c),Kl.set(r,u)}return l};return If(i,r,{ignoreNonConfigurable:!0}),Cf.set(i,t),i}var dn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ao(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var lo={exports:{}};(function(r,e){(function(t,n){n(e)})(dn,function(t){function n(_){var S,F,W=new Error(_);return S=W,F=n.prototype,Object.setPrototypeOf?Object.setPrototypeOf(S,F):S.__proto__=F,W}function i(_,S,F){var W=S.slice(0,F).split(/\n/),Y=W.length,re=W[Y-1].length+1;throw n(_+=" at line "+Y+" col "+re+`:
|
57
57
|
|
58
58
|
`+S.split(/\n/)[Y-1]+`
|
59
|
-
`+Array(re).join(" ")+"^")}n.prototype=Object.create(Error.prototype,{name:{value:"Squirrelly Error",enumerable:!1}});var s=new Function("return this")().Promise,o=!1;try{o=new Function("return (async function(){}).constructor")()}catch(
|
60
|
-
`).replace(/^\s+|\s+$/gm,"")),c.lastIndex=0,u.lastIndex=0,h.lastIndex=0;var F=S.prefixes,
|
61
|
-
`)}}return Y}var R=function(){function
|
59
|
+
`+Array(re).join(" ")+"^")}n.prototype=Object.create(Error.prototype,{name:{value:"Squirrelly Error",enumerable:!1}});var s=new Function("return this")().Promise,o=!1;try{o=new Function("return (async function(){}).constructor")()}catch(_){if(!(_ instanceof SyntaxError))throw _}function a(_,S){return Object.prototype.hasOwnProperty.call(_,S)}function l(_,S,F){for(var W in S)a(S,W)&&(S[W]==null||typeof S[W]!="object"||W!=="storage"&&W!=="prefixes"||F?_[W]=S[W]:_[W]=l({},S[W]));return _}var A=/^async +/,c=/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\${)[^\\`])*`/g,u=/'(?:\\[\s\w"'\\`]|[^\n\r'\\])*?'/g,h=/"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g,d=/[.*+\-?^${}()|[\]\\]/g;function f(_){return d.test(_)?_.replace(d,"\\$&"):_}function g(_,S){S.rmWhitespace&&(_=_.replace(/[\r\n]+/g,`
|
60
|
+
`).replace(/^\s+|\s+$/gm,"")),c.lastIndex=0,u.lastIndex=0,h.lastIndex=0;var F=S.prefixes,W=[F.h,F.b,F.i,F.r,F.c,F.e].reduce(function(fe,Te){return fe&&Te?fe+"|"+f(Te):Te?f(Te):fe},""),Y=new RegExp("([|()]|=>)|('|\"|`|\\/\\*)|\\s*((\\/)?(-|_)?"+f(S.tags[1])+")","g"),re=new RegExp("([^]*?)"+f(S.tags[0])+"(-|_)?\\s*("+W+")?\\s*","g"),ce=0,pe=!1;function ge(fe,Te){var Me,we={f:[]},qe=0,Be="c";function Q(be){var De=_.slice(ce,be),ke=De.trim();if(Be==="f")ke==="safe"?we.raw=!0:S.async&&A.test(ke)?(ke=ke.replace(A,""),we.f.push([ke,"",!0])):we.f.push([ke,""]);else if(Be==="fp")we.f[we.f.length-1][1]+=ke;else if(Be==="err"){if(ke){var _e=De.search(/\S/);i("invalid syntax",_,ce+_e)}}else we[Be]=ke;ce=be+1}for(Te==="h"||Te==="b"||Te==="c"?Be="n":Te==="r"&&(we.raw=!0,Te="i"),Y.lastIndex=ce;(Me=Y.exec(_))!==null;){var m=Me[1],E=Me[2],w=Me[3],M=Me[4],z=Me[5],j=Me.index;if(m)m==="("?(qe===0&&(Be==="n"?(Q(j),Be="p"):Be==="f"&&(Q(j),Be="fp")),qe++):m===")"?--qe===0&&Be!=="c"&&(Q(j),Be="err"):qe===0&&m==="|"?(Q(j),Be="f"):m==="=>"&&(Q(j),ce+=1,Be="res");else if(E)if(E==="/*"){var Ie=_.indexOf("*/",Y.lastIndex);Ie===-1&&i("unclosed comment",_,Me.index),Y.lastIndex=Ie+2}else E==="'"?(u.lastIndex=Me.index,u.exec(_)?Y.lastIndex=u.lastIndex:i("unclosed string",_,Me.index)):E==='"'?(h.lastIndex=Me.index,h.exec(_)?Y.lastIndex=h.lastIndex:i("unclosed string",_,Me.index)):E==="`"&&(c.lastIndex=Me.index,c.exec(_)?Y.lastIndex=c.lastIndex:i("unclosed string",_,Me.index));else if(w)return Q(j),ce=j+Me[0].length,re.lastIndex=ce,pe=z,M&&Te==="h"&&(Te="s"),we.t=Te,we}return i("unclosed tag",_,fe),we}var Se=function fe(Te,Me){Te.b=[],Te.d=[];var we,qe=!1,Be=[];function Q(_e,Ft){_e&&(_e=function(ct,Nt,dr,fr){var Ct,q;return typeof Nt.autoTrim=="string"?Ct=q=Nt.autoTrim:Array.isArray(Nt.autoTrim)&&(Ct=Nt.autoTrim[1],q=Nt.autoTrim[0]),(dr||dr===!1)&&(Ct=dr),(fr||fr===!1)&&(q=fr),Ct==="slurp"&&q==="slurp"?ct.trim():(Ct==="_"||Ct==="slurp"?ct=String.prototype.trimLeft?ct.trimLeft():ct.replace(/^[\s\uFEFF\xA0]+/,""):Ct!=="-"&&Ct!=="nl"||(ct=ct.replace(/^(?:\n|\r|\r\n)/,"")),q==="_"||q==="slurp"?ct=String.prototype.trimRight?ct.trimRight():ct.replace(/[\s\uFEFF\xA0]+$/,""):q!=="-"&&q!=="nl"||(ct=ct.replace(/(?:\n|\r|\r\n)$/,"")),ct)}(_e,S,pe,Ft))&&(_e=_e.replace(/\\|'/g,"\\$&").replace(/\r\n|\n|\r/g,"\\n"),Be.push(_e))}for(;(we=re.exec(_))!==null;){var m,E=we[1],w=we[2],M=we[3]||"";for(var z in F)if(F[z]===M){m=z;break}Q(E,w),ce=we.index+we[0].length,m||i("unrecognized tag type: "+M,_,ce);var j=ge(we.index,m),Ie=j.t;if(Ie==="h"){var be=j.n||"";S.async&&A.test(be)&&(j.a=!0,j.n=be.replace(A,"")),j=fe(j),Be.push(j)}else if(Ie==="c"){if(Te.n===j.n)return qe?(qe.d=Be,Te.b.push(qe)):Te.d=Be,Te;i("Helper start and end don't match",_,we.index+we[0].length)}else if(Ie==="b"){qe?(qe.d=Be,Te.b.push(qe)):Te.d=Be;var De=j.n||"";S.async&&A.test(De)&&(j.a=!0,j.n=De.replace(A,"")),qe=j,Be=[]}else if(Ie==="s"){var ke=j.n||"";S.async&&A.test(ke)&&(j.a=!0,j.n=ke.replace(A,"")),Be.push(j)}else Be.push(j)}if(!Me)throw n('unclosed helper "'+Te.n+'"');return Q(_.slice(ce,_.length),!1),Te.d=Be,Te}({f:[]},!0);if(S.plugins)for(var Le=0;Le<S.plugins.length;Le++){var Ge=S.plugins[Le];Ge.processAST&&(Se.d=Ge.processAST(Se.d,S))}return Se.d}function p(_,S){var F=g(_,S),W="var tR='';"+(S.useWith?"with("+S.varName+"||{}){":"")+x(F,S)+"if(cb){cb(null,tR)} return tR"+(S.useWith?"}":"");if(S.plugins)for(var Y=0;Y<S.plugins.length;Y++){var re=S.plugins[Y];re.processFnString&&(W=re.processFnString(W,S))}return W}function C(_,S){for(var F=0;F<S.length;F++){var W=S[F][0],Y=S[F][1];_=(S[F][2]?"await ":"")+"c.l('F','"+W+"')("+_,Y&&(_+=","+Y),_+=")"}return _}function T(_,S,F,W,Y,re){var ce="{exec:"+(Y?"async ":"")+y(F,S,_)+",params:["+W+"]";return re&&(ce+=",name:'"+re+"'"),Y&&(ce+=",async:true"),ce+="}"}function b(_,S){for(var F="[",W=0;W<_.length;W++){var Y=_[W];F+=T(S,Y.res||"",Y.d,Y.p||"",Y.a,Y.n),W<_.length&&(F+=",")}return F+="]"}function y(_,S,F){return"function("+S+"){var tR='';"+x(_,F)+"return tR}"}function x(_,S){for(var F=0,W=_.length,Y="";F<W;F++){var re=_[F];if(typeof re=="string")Y+="tR+='"+re+"';";else{var ce=re.t,pe=re.c||"",ge=re.f,Se=re.n||"",Le=re.p||"",Ge=re.res||"",fe=re.b,Te=!!re.a;if(ce==="i"){S.defaultFilter&&(pe="c.l('F','"+S.defaultFilter+"')("+pe+")");var Me=C(pe,ge);!re.raw&&S.autoEscape&&(Me="c.l('F','e')("+Me+")"),Y+="tR+="+Me+";"}else if(ce==="h")if(S.storage.nativeHelpers.get(Se))Y+=S.storage.nativeHelpers.get(Se)(re,S);else{var we=(Te?"await ":"")+"c.l('H','"+Se+"')("+T(S,Ge,re.d,Le,Te);we+=fe?","+b(fe,S):",[]",Y+="tR+="+C(we+=",c)",ge)+";"}else ce==="s"?Y+="tR+="+C((Te?"await ":"")+"c.l('H','"+Se+"')({params:["+Le+"]},[],c)",ge)+";":ce==="e"&&(Y+=pe+`
|
61
|
+
`)}}return Y}var R=function(){function _(S){this.cache=S}return _.prototype.define=function(S,F){this.cache[S]=F},_.prototype.get=function(S){return this.cache[S]},_.prototype.remove=function(S){delete this.cache[S]},_.prototype.reset=function(){this.cache={}},_.prototype.load=function(S){l(this.cache,S,!0)},_}();function k(_,S,F,W){if(S&&S.length>0)throw n((W?"Native":"")+"Helper '"+_+"' doesn't accept blocks");if(F&&F.length>0)throw n((W?"Native":"")+"Helper '"+_+"' doesn't accept filters")}var $={"&":"&","<":"<",">":">",'"':""","'":"'"};function V(_){return $[_]}var O=new R({}),J=new R({each:function(_,S){var F="",W=_.params[0];if(k("each",S,!1),_.async)return new Promise(function(re){(function ce(pe,ge,Se,Le,Ge){Se(pe[ge],ge).then(function(fe){Le+=fe,ge===pe.length-1?Ge(Le):ce(pe,ge+1,Se,Le,Ge)})})(W,0,_.exec,F,re)});for(var Y=0;Y<W.length;Y++)F+=_.exec(W[Y],Y);return F},foreach:function(_,S){var F=_.params[0];if(k("foreach",S,!1),_.async)return new Promise(function(re){(function ce(pe,ge,Se,Le,Ge,fe){Le(ge[Se],pe[ge[Se]]).then(function(Te){Ge+=Te,Se===ge.length-1?fe(Ge):ce(pe,ge,Se+1,Le,Ge,fe)})})(F,Object.keys(F),0,_.exec,"",re)});var W="";for(var Y in F)a(F,Y)&&(W+=_.exec(Y,F[Y]));return W},include:function(_,S,F){k("include",S,!1);var W=F.storage.templates.get(_.params[0]);if(!W)throw n('Could not fetch template "'+_.params[0]+'"');return W(_.params[1],F)},extends:function(_,S,F){var W=_.params[1]||{};W.content=_.exec();for(var Y=0;Y<S.length;Y++){var re=S[Y];W[re.name]=re.exec()}var ce=F.storage.templates.get(_.params[0]);if(!ce)throw n('Could not fetch template "'+_.params[0]+'"');return ce(W,F)},useScope:function(_,S){return k("useScope",S,!1),_.exec(_.params[0])}}),ne=new R({if:function(_,S){k("if",!1,_.f,!0);var F="if("+_.p+"){"+x(_.d,S)+"}";if(_.b)for(var W=0;W<_.b.length;W++){var Y=_.b[W];Y.n==="else"?F+="else{"+x(Y.d,S)+"}":Y.n==="elif"&&(F+="else if("+Y.p+"){"+x(Y.d,S)+"}")}return F},try:function(_,S){if(k("try",!1,_.f,!0),!_.b||_.b.length!==1||_.b[0].n!=="catch")throw n("native helper 'try' only accepts 1 block, 'catch'");var F="try{"+x(_.d,S)+"}",W=_.b[0];return F+="catch"+(W.res?"("+W.res+")":"")+"{"+x(W.d,S)+"}"},block:function(_,S){return k("block",_.b,_.f,!0),"if(!"+S.varName+"["+_.p+"]){tR+=("+y(_.d,"",S)+")()}else{tR+="+S.varName+"["+_.p+"]}"}}),ee=new R({e:function(_){var S=String(_);return/[&<>"']/.test(S)?S.replace(/[&<>"']/g,V):S}}),le={varName:"it",autoTrim:[!1,"nl"],autoEscape:!0,defaultFilter:!1,tags:["{{","}}"],l:function(_,S){if(_==="H"){var F=this.storage.helpers.get(S);if(F)return F;throw n("Can't find helper '"+S+"'")}if(_==="F"){var W=this.storage.filters.get(S);if(W)return W;throw n("Can't find filter '"+S+"'")}},async:!1,storage:{helpers:J,nativeHelpers:ne,filters:ee,templates:O},prefixes:{h:"@",b:"#",i:"",r:"*",c:"/",e:"!"},cache:!1,plugins:[],useWith:!1};function D(_,S){var F={};return l(F,le),S&&l(F,S),_&&l(F,_),F.l.bind(F),F}function P(_,S){var F=D(S||{}),W=Function;if(F.async){if(!o)throw n("This environment doesn't support async/await");W=o}try{return new W(F.varName,"c","cb",p(_,F))}catch(Y){throw Y instanceof SyntaxError?n(`Bad template syntax
|
62
62
|
|
63
63
|
`+Y.message+`
|
64
64
|
`+Array(Y.message.length+1).join("=")+`
|
65
|
-
`+p(
|
66
|
-
${e}`,bf=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),xf=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),wf=(r,e,t)=>{const n=t===""?"":`with ${t.trim()}() `,i=Tf.bind(null,n,e.toString());Object.defineProperty(i,"name",xf),Object.defineProperty(r,"toString",{...bf,value:i})};function Sf(r,e,{ignoreNonConfigurable:t=!1}={}){const{name:n}=r;for(const i of Reflect.ownKeys(e))yf(r,e,i,t);return Qf(r,e),wf(r,e,n),r}const Rf=new WeakMap;function dn(r,{cacheKey:e=([n])=>n,cache:t=new Map}={}){const n=new Map,i=function(...s){const o=e(s);if(n.has(o))return n.get(o);const a=(async()=>{try{if(t&&await t.has(o))return await t.get(o);const l=await r.apply(this,s);try{return l}finally{t&&await t.set(o,l)}}finally{n.delete(o)}})();return n.set(o,a),a};return Sf(i,r,{ignoreNonConfigurable:!0}),Rf.set(i,t),i}var KA={},lo={},Re={};Object.defineProperty(Re,"__esModule",{value:!0}),Re.default=Re.Wrap=Re.Unit=Re.PrintOptions=Re.PositionType=Re.Overflow=Re.NodeType=Re.MeasureMode=Re.LogLevel=Re.Justify=Re.Gutter=Re.FlexDirection=Re.ExperimentalFeature=Re.Errata=Re.Edge=Re.Display=Re.Direction=Re.Dimension=Re.Align=void 0;let pr=function(r){return r[r.Auto=0]="Auto",r[r.FlexStart=1]="FlexStart",r[r.Center=2]="Center",r[r.FlexEnd=3]="FlexEnd",r[r.Stretch=4]="Stretch",r[r.Baseline=5]="Baseline",r[r.SpaceBetween=6]="SpaceBetween",r[r.SpaceAround=7]="SpaceAround",r}({});Re.Align=pr;let co=function(r){return r[r.Width=0]="Width",r[r.Height=1]="Height",r}({});Re.Dimension=co;let Fi=function(r){return r[r.Inherit=0]="Inherit",r[r.LTR=1]="LTR",r[r.RTL=2]="RTL",r}({});Re.Direction=Fi;let uo=function(r){return r[r.Flex=0]="Flex",r[r.None=1]="None",r}({});Re.Display=uo;let Zt=function(r){return r[r.Left=0]="Left",r[r.Top=1]="Top",r[r.Right=2]="Right",r[r.Bottom=3]="Bottom",r[r.Start=4]="Start",r[r.End=5]="End",r[r.Horizontal=6]="Horizontal",r[r.Vertical=7]="Vertical",r[r.All=8]="All",r}({});Re.Edge=Zt;let jn=function(r){return r[r.None=0]="None",r[r.StretchFlexBasis=1]="StretchFlexBasis",r[r.All=2147483647]="All",r[r.Classic=2147483646]="Classic",r}({});Re.Errata=jn;let ki=function(r){return r[r.WebFlexBasis=0]="WebFlexBasis",r[r.AbsolutePercentageAgainstPaddingEdge=1]="AbsolutePercentageAgainstPaddingEdge",r[r.FixJNILocalRefOverflows=2]="FixJNILocalRefOverflows",r}({});Re.ExperimentalFeature=ki;let zn=function(r){return r[r.Column=0]="Column",r[r.ColumnReverse=1]="ColumnReverse",r[r.Row=2]="Row",r[r.RowReverse=3]="RowReverse",r}({});Re.FlexDirection=zn;let Ni=function(r){return r[r.Column=0]="Column",r[r.Row=1]="Row",r[r.All=2]="All",r}({});Re.Gutter=Ni;let $r=function(r){return r[r.FlexStart=0]="FlexStart",r[r.Center=1]="Center",r[r.FlexEnd=2]="FlexEnd",r[r.SpaceBetween=3]="SpaceBetween",r[r.SpaceAround=4]="SpaceAround",r[r.SpaceEvenly=5]="SpaceEvenly",r}({});Re.Justify=$r;let Yr=function(r){return r[r.Error=0]="Error",r[r.Warn=1]="Warn",r[r.Info=2]="Info",r[r.Debug=3]="Debug",r[r.Verbose=4]="Verbose",r[r.Fatal=5]="Fatal",r}({});Re.LogLevel=Yr;let Mi=function(r){return r[r.Undefined=0]="Undefined",r[r.Exactly=1]="Exactly",r[r.AtMost=2]="AtMost",r}({});Re.MeasureMode=Mi;let ho=function(r){return r[r.Default=0]="Default",r[r.Text=1]="Text",r}({});Re.NodeType=ho;let Pi=function(r){return r[r.Visible=0]="Visible",r[r.Hidden=1]="Hidden",r[r.Scroll=2]="Scroll",r}({});Re.Overflow=Pi;let Oi=function(r){return r[r.Static=0]="Static",r[r.Relative=1]="Relative",r[r.Absolute=2]="Absolute",r}({});Re.PositionType=Oi;let Ui=function(r){return r[r.Layout=1]="Layout",r[r.Style=2]="Style",r[r.Children=4]="Children",r}({});Re.PrintOptions=Ui;let Zn=function(r){return r[r.Undefined=0]="Undefined",r[r.Point=1]="Point",r[r.Percent=2]="Percent",r[r.Auto=3]="Auto",r}({});Re.Unit=Zn;let Gi=function(r){return r[r.NoWrap=0]="NoWrap",r[r.Wrap=1]="Wrap",r[r.WrapReverse=2]="WrapReverse",r}({});Re.Wrap=Gi;var Df={ALIGN_AUTO:pr.Auto,ALIGN_FLEX_START:pr.FlexStart,ALIGN_CENTER:pr.Center,ALIGN_FLEX_END:pr.FlexEnd,ALIGN_STRETCH:pr.Stretch,ALIGN_BASELINE:pr.Baseline,ALIGN_SPACE_BETWEEN:pr.SpaceBetween,ALIGN_SPACE_AROUND:pr.SpaceAround,DIMENSION_WIDTH:co.Width,DIMENSION_HEIGHT:co.Height,DIRECTION_INHERIT:Fi.Inherit,DIRECTION_LTR:Fi.LTR,DIRECTION_RTL:Fi.RTL,DISPLAY_FLEX:uo.Flex,DISPLAY_NONE:uo.None,EDGE_LEFT:Zt.Left,EDGE_TOP:Zt.Top,EDGE_RIGHT:Zt.Right,EDGE_BOTTOM:Zt.Bottom,EDGE_START:Zt.Start,EDGE_END:Zt.End,EDGE_HORIZONTAL:Zt.Horizontal,EDGE_VERTICAL:Zt.Vertical,EDGE_ALL:Zt.All,ERRATA_NONE:jn.None,ERRATA_STRETCH_FLEX_BASIS:jn.StretchFlexBasis,ERRATA_ALL:jn.All,ERRATA_CLASSIC:jn.Classic,EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS:ki.WebFlexBasis,EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE:ki.AbsolutePercentageAgainstPaddingEdge,EXPERIMENTAL_FEATURE_FIX_JNILOCAL_REF_OVERFLOWS:ki.FixJNILocalRefOverflows,FLEX_DIRECTION_COLUMN:zn.Column,FLEX_DIRECTION_COLUMN_REVERSE:zn.ColumnReverse,FLEX_DIRECTION_ROW:zn.Row,FLEX_DIRECTION_ROW_REVERSE:zn.RowReverse,GUTTER_COLUMN:Ni.Column,GUTTER_ROW:Ni.Row,GUTTER_ALL:Ni.All,JUSTIFY_FLEX_START:$r.FlexStart,JUSTIFY_CENTER:$r.Center,JUSTIFY_FLEX_END:$r.FlexEnd,JUSTIFY_SPACE_BETWEEN:$r.SpaceBetween,JUSTIFY_SPACE_AROUND:$r.SpaceAround,JUSTIFY_SPACE_EVENLY:$r.SpaceEvenly,LOG_LEVEL_ERROR:Yr.Error,LOG_LEVEL_WARN:Yr.Warn,LOG_LEVEL_INFO:Yr.Info,LOG_LEVEL_DEBUG:Yr.Debug,LOG_LEVEL_VERBOSE:Yr.Verbose,LOG_LEVEL_FATAL:Yr.Fatal,MEASURE_MODE_UNDEFINED:Mi.Undefined,MEASURE_MODE_EXACTLY:Mi.Exactly,MEASURE_MODE_AT_MOST:Mi.AtMost,NODE_TYPE_DEFAULT:ho.Default,NODE_TYPE_TEXT:ho.Text,OVERFLOW_VISIBLE:Pi.Visible,OVERFLOW_HIDDEN:Pi.Hidden,OVERFLOW_SCROLL:Pi.Scroll,POSITION_TYPE_STATIC:Oi.Static,POSITION_TYPE_RELATIVE:Oi.Relative,POSITION_TYPE_ABSOLUTE:Oi.Absolute,PRINT_OPTIONS_LAYOUT:Ui.Layout,PRINT_OPTIONS_STYLE:Ui.Style,PRINT_OPTIONS_CHILDREN:Ui.Children,UNIT_UNDEFINED:Zn.Undefined,UNIT_POINT:Zn.Point,UNIT_PERCENT:Zn.Percent,UNIT_AUTO:Zn.Auto,WRAP_NO_WRAP:Gi.NoWrap,WRAP_WRAP:Gi.Wrap,WRAP_WRAP_REVERSE:Gi.WrapReverse};Re.default=Df,Object.defineProperty(lo,"__esModule",{value:!0}),lo.default=Lf;var wr=_f(Re);function JA(r){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(JA=function(n){return n?t:e})(r)}function _f(r,e){if(!e&&r&&r.__esModule)return r;if(r===null||typeof r!="object"&&typeof r!="function")return{default:r};var t=JA(e);if(t&&t.has(r))return t.get(r);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in r)if(s!=="default"&&Object.prototype.hasOwnProperty.call(r,s)){var o=i?Object.getOwnPropertyDescriptor(r,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=r[s]}return n.default=r,t&&t.set(r,n),n}function Lf(r){function e(i,s,o){const a=i[s];i[s]=function(){for(var A=arguments.length,l=new Array(A),c=0;c<A;c++)l[c]=arguments[c];return o.call(this,a,...l)}}for(const i of["setPosition","setMargin","setFlexBasis","setWidth","setHeight","setMinWidth","setMinHeight","setMaxWidth","setMaxHeight","setPadding"]){const s={[wr.Unit.Point]:r.Node.prototype[i],[wr.Unit.Percent]:r.Node.prototype[`${i}Percent`],[wr.Unit.Auto]:r.Node.prototype[`${i}Auto`]};e(r.Node.prototype,i,function(o){for(var a=arguments.length,A=new Array(a>1?a-1:0),l=1;l<a;l++)A[l-1]=arguments[l];const c=A.pop();let u,h;if(c==="auto")u=wr.Unit.Auto,h=void 0;else if(typeof c=="object")u=c.unit,h=c.valueOf();else if(u=typeof c=="string"&&c.endsWith("%")?wr.Unit.Percent:wr.Unit.Point,h=parseFloat(c),!Number.isNaN(c)&&Number.isNaN(h))throw new Error(`Invalid value ${c} for ${i}`);if(!s[u])throw new Error(`Failed to execute "${i}": Unsupported unit '${c}'`);return h!==void 0?s[u].call(this,...A,h):s[u].call(this,...A)})}function t(i){return r.MeasureCallback.implement({measure:function(){const{width:s,height:o}=i(...arguments);return{width:s??NaN,height:o??NaN}}})}e(r.Node.prototype,"setMeasureFunc",function(i,s){return s?i.call(this,t(s)):this.unsetMeasureFunc()});function n(i){return r.DirtiedCallback.implement({dirtied:i})}return e(r.Node.prototype,"setDirtiedFunc",function(i,s){i.call(this,n(s))}),e(r.Config.prototype,"free",function(){r.Config.destroy(this)}),e(r.Node,"create",(i,s)=>s?r.Node.createWithConfig(s):r.Node.createDefault()),e(r.Node.prototype,"free",function(){r.Node.destroy(this)}),e(r.Node.prototype,"freeRecursive",function(){for(let i=0,s=this.getChildCount();i<s;++i)this.getChild(0).freeRecursive();this.free()}),e(r.Node.prototype,"calculateLayout",function(i){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:NaN,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:NaN,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:wr.Direction.LTR;return i.call(this,s,o,a)}),{Config:r.Config,Node:r.Node,...wr.default}}var WA={exports:{}};(function(r,e){var t=(()=>{var n=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return function(i){i=i||{};var s;s||(s=typeof i<"u"?i:{});var o,a;s.ready=new Promise(function(C,B){o=C,a=B});var A=Object.assign({},s),l="";typeof document<"u"&&document.currentScript&&(l=document.currentScript.src),n&&(l=n),l.indexOf("blob:")!==0?l=l.substr(0,l.replace(/[?#].*/,"").lastIndexOf("/")+1):l="";var c=s.print||console.log.bind(console),u=s.printErr||console.warn.bind(console);Object.assign(s,A),A=null;var h;s.wasmBinary&&(h=s.wasmBinary),s.noExitRuntime,typeof WebAssembly!="object"&&X("no native wasm support detected");var d,f=!1;function g(C,B,L){L=B+L;for(var N="";!(B>=L);){var H=C[B++];if(!H)break;if(H&128){var Z=C[B++]&63;if((H&224)==192)N+=String.fromCharCode((H&31)<<6|Z);else{var ie=C[B++]&63;H=(H&240)==224?(H&15)<<12|Z<<6|ie:(H&7)<<18|Z<<12|ie<<6|C[B++]&63,65536>H?N+=String.fromCharCode(H):(H-=65536,N+=String.fromCharCode(55296|H>>10,56320|H&1023))}}else N+=String.fromCharCode(H)}return N}var p,v,T,b,y,w,R,k,$;function W(){var C=d.buffer;p=C,s.HEAP8=v=new Int8Array(C),s.HEAP16=b=new Int16Array(C),s.HEAP32=w=new Int32Array(C),s.HEAPU8=T=new Uint8Array(C),s.HEAPU16=y=new Uint16Array(C),s.HEAPU32=R=new Uint32Array(C),s.HEAPF32=k=new Float32Array(C),s.HEAPF64=$=new Float64Array(C)}var O,K=[],ne=[],ee=[];function Ae(){var C=s.preRun.shift();K.unshift(C)}var _=0,P=null;function X(C){throw s.onAbort&&s.onAbort(C),C="Aborted("+C+")",u(C),f=!0,C=new WebAssembly.RuntimeError(C+". Build with -sASSERTIONS for more info."),a(C),C}function D(C){return C.startsWith("data:application/octet-stream;base64,")}var S;if(S="data:application/octet-stream;base64,AGFzbQEAAAABvgM4YAF/AGACf38AYAF/AX9gA39/fwBgAn98AGACf38Bf2ADf39/AX9gAABgA39/fABgAX8BfGADf399AX1gBX9/f39/AX9gAn9/AXxgAAF/YAZ/f31/fX8AYAR/f39/AX9gAn9/AX1gBn9/f39/fwF/YAV/f39/fwBgBH9/f38AYAN/fn8BfmAHf39/f39/fwBgBn9/f39/fwBgAn19AX1gAX0Bf2ABfwF9YAZ/fH9/f38Bf2ACf30AYAR/fHx/AGAIf39/f39/f38AYA1/f39/f39/f39/f39/AGAKf39/f39/f39/fwBgBX9/f39/AXxgBH9/fX0BfWAEfHx/fwF9YA5/fX1/f399fX9/f39/fwF/YAZ/f319f38AYAJ+fwF/YAR/fX1/AX1gA399fQF9YAF8AXxgBH98fHwAYAV/f319fQF9YA5/fX1/f399fX9/f39/fwBgB39/fX99f38AYA1/fX99f31/fX19fX1/AX9gBX9/fX19AGAEf39+fgBgB39/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UH4ISEGCyAGKgIAIQRDAADAfyEFIAYoAgRBAWsOAgIBAwsgAUH/////e3FBgICAgAJqviEEIAFBgICAgARxRQ0BCyAEIAOUQwrXIzyUIQUMAQsgBCEFC0MAAAAAIQQCQCAAKALYASIAQfDhg/wHRg0AIABBj568/AdGDQRB8CEhAQJAIABBqtWq/QdHBEAgAL4iBCAEWw0BQfghIQELIAEqAgAhBCABKAIEQQFrDgIEAQYLIABB/////3txQYCAgIACar4hBCAAQYCAgIAEcUUNAwsgBCADlEMK1yM8lCEEDAILIAQhBQtDAAAAACEEAkAgACgC3AEiAEHw4YP8B0YNACAAQY+evPwHRg0CQfAhIQECQCAAQarVqv0HRwRAIAC+IgQgBFsNAUH4ISEBCyABKgIAIQQgASgCBEEBaw4CAgEECyAAQf////97cUGAgICAAmq+IQQgAEGAgICABHFFDQELIAQgA5RDCtcjPJQhBAsgBEMAAAAAYEUNAQsgAiAEXg0BCyAFQwAAAABgRQRAIAIPCyAFIAIgAiAFXRshBAsgBAsEACAAC74BAQN/IAAtAABBIHFFBEACQCABIQMCQCACIAAiASgCECIABH8gAAUgARB+DQEgASgCEAsgASgCFCIFa0sEQCABIAMgAiABKAIkEQYAGgwCCwJAIAEoAlBBAEgNACACIQADQCAAIgRFDQEgAyAEQQFrIgBqLQAAQQpHDQALIAEgAyAEIAEoAiQRBgAgBEkNASADIARqIQMgAiAEayECIAEoAhQhBQsgBSADIAIQKxogASABKAIUIAJqNgIUCwsLC20BAX8jAEGAAmsiBSQAIARBgMAEcSACIANMckUEQCAFIAFB/wFxIAIgA2siA0GAAiADQYACSSIBGxAqGiABRQRAA0AgACAFQYACECcgA0GAAmsiA0H/AUsNAAsLIAAgBSADECcLIAVBgAJqJAALzAIBBX8gAARAIABBBGsiASgCACIFIQMgASECIABBCGsoAgAiACAAQX5xIgRHBEAgASAEayICKAIEIgAgAigCCDYCCCACKAIIIAA2AgQgBCAFaiEDCyABIAVqIgQoAgAiASABIARqQQRrKAIARwRAIAQoAgQiAC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IQULIAUqAgAhAkMAAMB/ITcgBSgCBEEBaw4CAgEDCyADQf////97cUGAgICAAmq+IQIgA0GAgICABHFFDQELIAIgBpRDCtcjPJQhNwwBCyACITcLQwAAAAAhAgJAAkACQCAAKALUASIDQfDhg/wHRg0AIANBj568/AdGDQFB8CEhBQJAIANBqtWq/QdHBEAgA74iAiACWw0BQfghIQULIAUqAgAhAkMAAMB/ITQgBSgCBEEBaw4CAgEDCyADQf////97cUGAgICAAmq+IQIgA0GAgICABHFFDQELIAIgB5RDCtcjPJQhNAwBCyACITQLQwAAAAAhAgJAAkACQCAAKALcASIDQfDhg/wHRg0AIANBj568/AdGDQFB8CEhBQJAIANBqtWq/QdHBEAgA74iAiACWw0BQfghIQULIAUqAgAhAkMAAMB/ITkgBSgCBEEBaw4CAgEDCyADQf////97cUGAgICAAmq+IQIgA0GAgICABHFFDQELIAIgB5RDCtcjPJQhOQwBCyACITkLIAEgNCATQQFLIgMbIEGTIgIgAlsgAiAzXnENASA3IDkgAxsgQZMiAiACWyACIDNdcQ0BIAAoArgELQAQQQFxDQAgMyECIDpDAAAAAFsNAiAAKAKoBEUNAgJAAkAgACoCICIBIAFbBEAgASECDAELIAAqAhwiAkMAAAAAXkUNAQsgAiACXARAIDghAgwECyAAKgIgIQELIAEgAVwEQCAzIQIgACoCHCIBQwAAAABeRQ0DCyA4IQIgAUMAAAAAXA0CIDMhAgwCCyA4IQILIAIgAlwNACACIDOTITUMAQsgM0MAAAAAXUUNACAzjCE1CyACITggKUUEQAJAIBggIUYEQEMAAAAAITQMAQtDAAAAACE5IBghBQNAIAUoAgAiDyATIA8qArQCIgEgQxAlITcCQCA1QwAAAABdBEAgNyAPED2MlCICQwAAAABeIAJDAAAAAF1yRQ0BAn0gDyATIDUgP5UgApQgN5IiNCA4ECUiMyAzXCIDIA8gEyA2ECQgDyATECCSIA8gEyA2ECMgDyATECGSkiICIAJcckUEQCAzIAIQHgwBCyACIDMgAxsLIQIgNCA0XCACIAJcciACIDRbcg0B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QAIQf4BcSABcjoACAsMACAAKAIAIAE2AhALFwAgACgCACIAIAAoAhBBfnEgAXI2AhAL/QEBA38jAEEQayICJAAgACgCACEAIAFDAAAAAGBFBEAgAkHXETYCACMAQRBrIgMkACADIAI2AgwCQCAADQBB6DYtAAAEQEHkNigCACEADAELQRwQHSIAQoCAgPwDNwIUIABCADcCDCAAQQA2AgAgAEEAOgAIIABBATYCBEHkNiAANgIAQeg2QQE6AABB4DZB4DYoAgBBAWo2AgALIAAoAgQhBAJAIAAtAAhBCHEEQCAAQQBBBUEAQbwhIAIgBBERABoMAQsgAEEAQQVBvCEgAiAEEQsAGgsgA0EQaiQAECwACyAAQwAAAAAgASABQwAAAABbGzgCFCACQRBqJAALPAAgAUEDSQRAQQEgAXQhASAAKAIAIgACfyACBEAgACgCDCABcgwBCyAAKAIMIAFBf3NxCzYCDA8LEAQAC00BAn9BBBAdIQFBHBAdIgBCgICA/AM3AhQgAEIANwIMIABBADYCACAAQQA6AAggAEEBNgIEQeA2QeA2KAIAQQFqNgIAIAEgADYCACABCxAAIABBDTYCBCAAIAE2AgALEAAgAEEKNgIEIAAgATYCAAsQACAAQQc2AgQgACABNgIACyMAIAJBBUdBACACG0UEQEGoLCADIAQQYw8LQbgtIAMgBBBjCyIBAX4gASACrSADrUIghoQgBCAAERQAIgVCIIinJAEgBacLqAEBBX8gACgCVCIDKAIAIQUgAygCBCIEIAAoAhQgACgCHCIHayIGIAQgBkkbIgYEQCAFIAcgBhArGiADIAMoAgAgBmoiBTYCACADIAMoAgQgBmsiBDYCBAsgBCACIAIgBEsbIgQEQCAFIAEgBBArGiADIAMoAgAgBGoiBTYCACADIAMoAgQgBGs2AgQLIAVBADoAACAAIAAoAiwiATYCHCAAIAE2AhQgAgsEAEIACwQAQQALigUCBn4CfyABIAEoAgBBB2pBeHEiAUEQajYCACAAIQkgASkDACEDIAEpAwghBiMAQSBrIggkAAJAIAZC////////////AIMiBEKAgICAgIDAgDx9IARCgICAgICAwP/DAH1UBEAgBkIEhiADQjyIhCEEIANC//////////8PgyIDQoGAgICAgICACFoEQCAEQoGAgICAgICAwAB8IQIMAgsgBEKAgICAgICAgEB9IQIgA0KAgICAgICAgAhSDQEgAiAEQgGDfCECDAELIANQIARCgICAgICAwP//AFQgBEKAgICAgIDA//8AURtFBEAgBkIEhiADQjyIhEL/////////A4NCgICAgICAgPz/AIQhAgwBC0KAgICAgICA+P8AIQIgBEL///////+//8MAVg0AQgAhAiAEQjCIpyIAQZH3AEkNACADIQIgBkL///////8/g0KAgICAgIDAAIQiBSEHAkAgAEGB9wBrIgFBwABxBEAgAiABQUBqrYYhB0IAIQIMAQsgAUUNACAHIAGtIgSGIAJBwAAgAWutiIQhByACIASGIQILIAggAjcDECAIIAc3AxgCQEGB+AAgAGsiAEHAAHEEQCAFIABBQGqtiCEDQgAhBQwBCyAARQ0AIAVBwAAgAGuthiADIACtIgKIhCEDIAUgAoghBQsgCCADNwMAIAggBTcDCCAIKQMIQgSGIAgpAwAiA0I8iIQhAiAIKQMQIAgpAxiEQgBSrSADQv//////////D4OEIgNCgYCAgICAgIAIWgRAIAJCAXwhAgwBCyADQoCAgICAgICACFINACACQgGDIAJ8IQILIAhBIGokACAJIAIgBkKAgICAgICAgIB/g4S/OQMAC5gYAxJ/AXwDfiMAQbAEayIMJAAgDEEANgIsAkAgAb0iGUIAUwRAQQEhEUGZCSETIAGaIgG9IRkMAQsgBEGAEHEEQEEBIRFBnAkhEwwBC0GfCUGaCSAEQQFxIhEbIRMgEUUhFQsCQCAZQoCAgICAgID4/wCDQoCAgICAgID4/wBRBEAgAEEgIAIgEUEDaiIDIARB//97cRAoIAAgEyARECcgAEGTE0GDGyAFQSBxIgUbQbQWQYcbIAUbIAEgAWIbQQMQJyAAQSAgAiADIARBgMAAcxAoIAMgAiACIANIGyEKDAELIAxBEGohEgJAAn8CQCABIAxBLGoQdCIBIAGgIgFEAAAAAAAAAABiBEAgDCAMKAIsIgZBAWs2AiwgBUEgciIOQeEARw0BDAMLIAV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AIgASADQQFxBH8gASgCACAAaigCAAUgAAsRAQBBEBAdIgAgAikDCDcDCCAAIAIpAwA3AwAgAkEQaiQAIAALYwECfyMAQRBrIgMkACABIAAoAgQiBEEBdWohASAAKAIAIQAgAyABIAIgBEEBcQR/IAEoAgAgAGooAgAFIAALEQMAQRAQHSIAIAMpAwg3AwggACADKQMANwMAIANBEGokACAACzcBAX8gASAAKAIEIgNBAXVqIQEgACgCACEAIAEgAiADQQFxBH8gASgCACAAaigCAAUgAAsRBAALOQEBfyABIAAoAgQiBEEBdWohASAAKAIAIQAgASACIAMgBEEBcQR/IAEoAgAgAGooAgAFIAALEQgACwkAIAEgABECAAsFAEGbNwsPACABIAAoAgBqIAI2AgALDQAgASAAKAIAaigCAAsYAQF/QRAQHSIAQgA3AwggAEEANgIAIAALGAEBf0EQEB0iAEIANwMAIABCADcDCCAACwwAQTAQHUEAQTAQKgs3AQF/IAEgACgCBCIDQQF1aiEBIAAoAgAhACABIAIgA0EBcQR/IAEoAgAgAGooAgAFIAALERsACwUAQZY3CyEAIAAgASgCACABIAEsAAtBAEgbQZM3IAIoAgAQDzYCAAsqAQF/QQwQHSIBQQA6AAQgASAAKAIANgIIIABBADYCACABQcgjNgIAIAELBQBBkzcLBQBBkDcLIQAgACABKAIAIAEgASwAC0EASBtB/DYgAigCABAPNgIAC9gBAQR/IwBBIGsiAyQAIAEoAgAiBEHw////B0kEQAJAAkAgBEELTwRAIARBD3JBAWoiBRAdIQYgAyAFQYCAgIB4cjYCECADIAY2AgggAyAENgIMIAQgBmohBQwBCyADIAQ6ABMgA0EIaiIGIARqIQUgBEUNAQsgBiABQQRqIAQQKxoLIAVBADoAACADIAI2AgAgA0EYaiADQQhqIAMgABEDACADKAIYEBAgAygCGCIAEAYgAygCABAGIAMsABNBAEgEQCADKAIIECkLIANBIGokACAADwsQBAALKgEBf0EMEB0iAUEAOgAEIAEgACgCADYCCCAAQQA2AgAgAUHQIjYCACABCwUAQfw2C2kBAn8jAEEQayIGJAAg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gCACIAKgIgIgMgAbYiAlsgAiACXCADIANccXINACAAIAI4AiADQCAALQAEIgRBBHENASAAIARBBHI6AAQgACgCFCIEBEAgACAEEQAACyAAQYCAgP4HNgK0AiAAKAKoBCIADQALCwsPACAAKAIAQarVqv0HEEwLDgAgACgCACABthAxEEwLDgAgACgCACABthAvEEwLcAICfQF/AkAgACgCACIAKgIcIgMgAbYiAlsgAiACXCADIANccXINACAAIAI4AhwDQCAALQAEIgRBBHENASAAIARBBHI6AAQgACgCFCIEBEAgACAEEQAACyAAQYCAgP4HNgK0AiAAKAKoBCIADQALCwt3AQF/AkAgACgCACIAKAIYIgJBFnZBAXEgAUYNACAAIAJB////fXEgAUEWdEGAgIACcXI2AhgDQCAALQAEIgFBBHENASAAIAFBBHI6AAQgACgCFCIBBEAgACABEQAACyAAQYCAgP4HNgK0AiAAKAKoBCIADQALCwt3AQF/AkAgACgCACIAKAIYIgJBFHZBA3EgAUYNACAAIAJB//+/fnEgAUEUdEGAgMABcXI2AhgDQCAALQAEIgFBBHENASAAIAFBBHI6AAQgACgCFCIBBEAgACABEQAACyAAQYCAgP4HNgK0AiAAKAKoBCIADQALCwsRACAAKAIAIAFBqtWq/QcQSwsQACAAKAIAIAEgArYQMRBLCxAAIAAoAgAgASACthAvEEsLcwEBfwJAIAAoAgAiACgCGCICQQR2QQdxIAFGDQAgACACQY9/cSABQQR0QfAAcXI2AhgDQCAALQAEIgFBBHENASAAIAFBBHI6AAQgACgCFCIBBEAgACABEQAACyAAQYCAgP4HNgK0AiAAKAKoBCIADQALCwt1AQF/AkAgACgCACIAKAIYIgJBEnZBA3EgAUYNACAAIAJB//9PcSABQRJ0QYCAMHFyNgIYA0AgAC0ABCIBQQRxDQEgACABQQRyOgAEIAAoAhQiAQRAIAAgAREAAAsgAEGAgID+BzYCtAIgACgCqAQiAA0ACwsLC9IiIwBBgAgL5RlPbmx5IGxlYWYgbm9kZXMgd2l0aCBjdXN0b20gbWVhc3VyZSBmdW5jdGlvbnMgc2h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g0ZGRkADQAAAgAJDgAAAAkADgAADgBBuygLAQwAQccoCxUTAAAAABMAAAAACQwAAAAAAAwAAAwAQfUoCwEQAEGBKQsVDwAAAAQPAAAAAAkQAAAAAAAQAAAQAEGvKQsBEgBBuykLHhEAAAAAEQAAAAAJEgAAAAAAEgAAEgAAGgAAABoaGgBB8ikLDhoAAAAaGhoAAAAAAAAJAEGjKgsBFABBryoLFRcAAAAAFwAAAAAJFAAAAAAAFAAAFABB3SoLARYAQekqCycVAAAAABUAAAAACRYAAAAAABYAABYAADAxMjM0NTY3ODlBQkNERUYAQbQrCwHVAEHcKwsI//////////8AQaAsCwnwHwEAAAAAAAUAQbQsCwHQAEHMLAsK0QAAANIAAADUGwBB5CwLAQIAQfQsCwj//////////wBBuC0LAQUAQcQtCwHTAEHcLQsO0QAAANQAAADoGwAAAAQAQfQtCwEBAEGELgsF/////woAQcguCwHW",!D(S)){var F=S;S=s.locateFile?s.locateFile(F,l):l+F}function J(){var C=S;try{if(C==S&&h)return new Uint8Array(h);if(D(C))try{var B=jB(C.slice(37)),L=new Uint8Array(B.length);for(C=0;C<B.length;++C)L[C]=B.charCodeAt(C);var N=L}catch{throw Error("Converting base64 string to bytes failed.")}else N=void 0;var H=N;if(H)return H;throw"both async and sync fetching of the wasm failed"}catch(Z){X(Z)}}function Y(){return h||typeof fetch!="function"?Promise.resolve().then(function(){return J()}):fetch(S,{credentials:"same-origin"}).then(function(C){if(!C.ok)throw"failed to load wasm binary file at '"+S+"'";return C.arrayBuffer()}).catch(function(){return J()})}function re(C){for(;0<C.length;)C.shift()(s)}function ce(C){if(C===void 0)return"_unknown";C=C.replace(/[^a-zA-Z0-9_]/g,"$");var B=C.charCodeAt(0);return 48<=B&&57>=B?"_"+C:C}function pe(C,B){return C=ce(C),function(){return B.apply(this,arguments)}}var ge=[{},{value:void 0},{value:null},{value:!0},{value:!1}],Se=[];function Le(C){var B=Error,L=pe(C,function(N){this.name=C,this.message=N,N=Error(N).stack,N!==void 0&&(this.stack=this.toString()+`
|
67
|
-
`+N.replace(/^Error(:[^\n]*)?\n/,""))});return L.prototype=Object.create(B.prototype),L.prototype.constructor=L,L.prototype.toString=function(){return this.message===void 0?this.name:this.name+": "+this.message},L}var Ge=void 0;function fe(C){throw new Ge(C)}var Te=C=>(C||fe("Cannot use deleted val. handle = "+C),ge[C].value),Me=C=>{switch(C){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var B=Se.length?Se.pop():ge.length;return ge[B]={fa:1,value:C},B}},we=void 0,We=void 0;function Be(C){for(var B="";T[C];)B+=We[T[C++]];return B}var Q=[];function m(){for(;Q.length;){var C=Q.pop();C.L.Z=!1,C.delete()}}var E=void 0,x={};function M(C,B){for(B===void 0&&fe("ptr should not be undefined");C.P;)B=C.aa(B),C=C.P;return B}var z={};function j(C){C=vd(C);var B=Be(C);return Tr(C),B}function Ie(C,B){var L=z[C];return L===void 0&&fe(B+" has unknown type "+j(C)),L}function be(){}var De=!1;function ke(C){--C.count.value,C.count.value===0&&(C.S?C.T.V(C.S):C.O.M.V(C.N))}function _e(C,B,L){return B===L?C:L.P===void 0?null:(C=_e(C,B,L.P),C===null?null:L.ma(C))}var Ft={};function ct(C,B){return B=M(C,B),x[B]}var Nt=void 0;function dr(C){throw new Nt(C)}function fr(C,B){return B.O&&B.N||dr("makeClassHandle requires ptr and ptrType"),!!B.T!=!!B.S&&dr("Both smartPtrType and smartPtr must be specified"),B.count={value:1},Ct(Object.create(C,{L:{value:B}}))}function Ct(C){return typeof FinalizationRegistry>"u"?(Ct=B=>B,C):(De=new FinalizationRegistry(B=>{ke(B.L)}),Ct=B=>{var L=B.L;return L.S&&De.register(B,{L},B),B},be=B=>{De.unregister(B)},Ct(C))}var q={};function de(C){for(;C.length;){var B=C.pop();C.pop()(B)}}function Ce(C){return this.fromWireType(w[C>>2])}var Pe={},Fe={};function qe(C,B,L){function N(se){se=L(se),se.length!==C.length&&dr("Mismatched type converter count");for(var le=0;le<C.length;++le)bt(C[le],se[le])}C.forEach(function(se){Fe[se]=B});var H=Array(B.length),Z=[],ie=0;B.forEach((se,le)=>{z.hasOwnProperty(se)?H[le]=z[se]:(Z.push(se),Pe.hasOwnProperty(se)||(Pe[se]=[]),Pe[se].push(()=>{H[le]=z[se],++ie,ie===Z.length&&N(H)}))}),Z.length===0&&N(H)}function Tt(C){switch(C){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+C)}}function bt(C,B,L={}){if(!("argPackAdvance"in B))throw new TypeError("registerType registeredInstance requires argPackAdvance");var N=B.name;if(C||fe('type "'+N+'" must have a positive integer typeid pointer'),z.hasOwnProperty(C)){if(L.ta)return;fe("Cannot register type '"+N+"' twice")}z[C]=B,delete Fe[C],Pe.hasOwnProperty(C)&&(B=Pe[C],delete Pe[C],B.forEach(H=>H()))}function Mn(C){fe(C.L.O.M.name+" instance already deleted")}function xt(){}function on(C,B,L){if(C[B].R===void 0){var N=C[B];C[B]=function(){return C[B].R.hasOwnProperty(arguments.length)||fe("Function '"+L+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+C[B].R+")!"),C[B].R[arguments.length].apply(this,arguments)},C[B].R=[],C[B].R[N.Y]=N}}function Pn(C,B){s.hasOwnProperty(C)?(fe("Cannot register public name '"+C+"' twice"),on(s,C,C),s.hasOwnProperty(void 0)&&fe("Cannot register multiple overloads of a function with the same number of arguments (undefined)!"),s[C].R[void 0]=B):s[C]=B}function kr(C,B,L,N,H,Z,ie,se){this.name=C,this.constructor=B,this.W=L,this.V=N,this.P=H,this.oa=Z,this.aa=ie,this.ma=se,this.ia=[]}function Bi(C,B,L){for(;B!==L;)B.aa||fe("Expected null or instance of "+L.name+", got an instance of "+B.name),C=B.aa(C),B=B.P;return C}function Qi(C,B){return B===null?(this.da&&fe("null is not a valid "+this.name),0):(B.L||fe('Cannot pass "'+pA(B)+'" as a '+this.name),B.L.N||fe("Cannot pass deleted object as a pointer of type "+this.name),Bi(B.L.N,B.L.O.M,this.M))}function On(C,B){if(B===null){if(this.da&&fe("null is not a valid "+this.name),this.ca){var L=this.ea();return C!==null&&C.push(this.V,L),L}return 0}if(B.L||fe('Cannot pass "'+pA(B)+'" as a '+this.name),B.L.N||fe("Cannot pass deleted object as a pointer of type "+this.name),!this.ba&&B.L.O.ba&&fe("Cannot convert argument of type "+(B.L.T?B.L.T.name:B.L.O.name)+" to parameter type "+this.name),L=Bi(B.L.N,B.L.O.M,this.M),this.ca)switch(B.L.S===void 0&&fe("Passing raw pointer to smart pointer is illegal"),this.Aa){case 0:B.L.T===this?L=B.L.S:fe("Cannot convert argument of type "+(B.L.T?B.L.T.name:B.L.O.name)+" to parameter type "+this.name);break;case 1:L=B.L.S;break;case 2:if(B.L.T===this)L=B.L.S;else{var N=B.clone();L=this.wa(L,Me(function(){N.delete()})),C!==null&&C.push(this.V,L)}break;default:fe("Unsupporting sharing policy")}return L}function NB(C,B){return B===null?(this.da&&fe("null is not a valid "+this.name),0):(B.L||fe('Cannot pass "'+pA(B)+'" as a '+this.name),B.L.N||fe("Cannot pass deleted object as a pointer of type "+this.name),B.L.O.ba&&fe("Cannot convert argument of type "+B.L.O.name+" to parameter type "+this.name),Bi(B.L.N,B.L.O.M,this.M))}function Qr(C,B,L,N){this.name=C,this.M=B,this.da=L,this.ba=N,this.ca=!1,this.V=this.wa=this.ea=this.ja=this.Aa=this.va=void 0,B.P!==void 0?this.toWireType=On:(this.toWireType=N?Qi:NB,this.U=null)}function MB(C,B){s.hasOwnProperty(C)||dr("Replacing nonexistant public symbol"),s[C]=B,s[C].Y=void 0}function PB(C,B){var L=[];return function(){if(L.length=0,Object.assign(L,arguments),C.includes("j")){var N=s["dynCall_"+C];N=L&&L.length?N.apply(null,[B].concat(L)):N.call(null,B)}else N=O.get(B).apply(null,L);return N}}function jt(C,B){C=Be(C);var L=C.includes("j")?PB(C,B):O.get(B);return typeof L!="function"&&fe("unknown function pointer with signature "+C+": "+B),L}var md=void 0;function Ks(C,B){function L(Z){H[Z]||z[Z]||(Fe[Z]?Fe[Z].forEach(L):(N.push(Z),H[Z]=!0))}var N=[],H={};throw B.forEach(L),new md(C+": "+N.map(j).join([", "]))}function dA(C,B,L,N,H){var Z=B.length;2>Z&&fe("argTypes array size mismatch! Must at least get return value and 'this' types!");var ie=B[1]!==null&&L!==null,se=!1;for(L=1;L<B.length;++L)if(B[L]!==null&&B[L].U===void 0){se=!0;break}var le=B[0].name!=="void",ae=Z-2,ue=Array(ae),ve=[],Ue=[];return function(){if(arguments.length!==ae&&fe("function "+C+" called with "+arguments.length+" arguments, expected "+ae+" args!"),Ue.length=0,ve.length=ie?2:1,ve[0]=H,ie){var At=B[1].toWireType(Ue,this);ve[1]=At}for(var Ye=0;Ye<ae;++Ye)ue[Ye]=B[Ye+2].toWireType(Ue,arguments[Ye]),ve.push(ue[Ye]);if(Ye=N.apply(null,ve),se)de(Ue);else for(var Mt=ie?1:2;Mt<B.length;Mt++){var zt=Mt===1?At:ue[Mt-2];B[Mt].U!==null&&B[Mt].U(zt)}return At=le?B[0].fromWireType(Ye):void 0,At}}function fA(C,B){for(var L=[],N=0;N<C;N++)L.push(R[B+4*N>>2]);return L}function gA(C){4<C&&--ge[C].fa===0&&(ge[C]=void 0,Se.push(C))}function pA(C){if(C===null)return"null";var B=typeof C;return B==="object"||B==="array"||B==="function"?C.toString():""+C}function OB(C,B){switch(B){case 2:return function(L){return this.fromWireType(k[L>>2])};case 3:return function(L){return this.fromWireType($[L>>3])};default:throw new TypeError("Unknown float type: "+C)}}function UB(C,B,L){switch(B){case 0:return L?function(N){return v[N]}:function(N){return T[N]};case 1:return L?function(N){return b[N>>1]}:function(N){return y[N>>1]};case 2:return L?function(N){return w[N>>2]}:function(N){return R[N>>2]};default:throw new TypeError("Unknown integer type: "+C)}}function GB(C,B){for(var L="",N=0;!(N>=B/2);++N){var H=b[C+2*N>>1];if(H==0)break;L+=String.fromCharCode(H)}return L}function HB(C,B,L){if(L===void 0&&(L=2147483647),2>L)return 0;L-=2;var N=B;L=L<2*C.length?L/2:C.length;for(var H=0;H<L;++H)b[B>>1]=C.charCodeAt(H),B+=2;return b[B>>1]=0,B-N}function $B(C){return 2*C.length}function YB(C,B){for(var L=0,N="";!(L>=B/4);){var H=w[C+4*L>>2];if(H==0)break;++L,65536<=H?(H-=65536,N+=String.fromCharCode(55296|H>>10,56320|H&1023)):N+=String.fromCharCode(H)}return N}function VB(C,B,L){if(L===void 0&&(L=2147483647),4>L)return 0;var N=B;L=N+L-4;for(var H=0;H<C.length;++H){var Z=C.charCodeAt(H);if(55296<=Z&&57343>=Z){var ie=C.charCodeAt(++H);Z=65536+((Z&1023)<<10)|ie&1023}if(w[B>>2]=Z,B+=4,B+4>L)break}return w[B>>2]=0,B-N}function KB(C){for(var B=0,L=0;L<C.length;++L){var N=C.charCodeAt(L);55296<=N&&57343>=N&&++L,B+=4}return B}var JB={};function Ed(C){var B=JB[C];return B===void 0?Be(C):B}var Js=[];function WB(C){var B=Js.length;return Js.push(C),B}function qB(C,B){for(var L=Array(C),N=0;N<C;++N)L[N]=Ie(R[B+4*N>>2],"parameter "+N);return L}var Id=[],XB=[null,[],[]];Ge=s.BindingError=Le("BindingError"),s.count_emval_handles=function(){for(var C=0,B=5;B<ge.length;++B)ge[B]!==void 0&&++C;return C},s.get_first_emval=function(){for(var C=5;C<ge.length;++C)if(ge[C]!==void 0)return ge[C];return null},we=s.PureVirtualError=Le("PureVirtualError");for(var Cd=Array(256),Ws=0;256>Ws;++Ws)Cd[Ws]=String.fromCharCode(Ws);We=Cd,s.getInheritedInstanceCount=function(){return Object.keys(x).length},s.getLiveInheritedInstances=function(){var C=[],B;for(B in x)x.hasOwnProperty(B)&&C.push(x[B]);return C},s.flushPendingDeletes=m,s.setDelayFunction=function(C){E=C,Q.length&&E&&E(m)},Nt=s.InternalError=Le("InternalError"),xt.prototype.isAliasOf=function(C){if(!(this instanceof xt&&C instanceof xt))return!1;var B=this.L.O.M,L=this.L.N,N=C.L.O.M;for(C=C.L.N;B.P;)L=B.aa(L),B=B.P;for(;N.P;)C=N.aa(C),N=N.P;return B===N&&L===C},xt.prototype.clone=function(){if(this.L.N||Mn(this),this.L.$)return this.L.count.value+=1,this;var C=Ct,B=Object,L=B.create,N=Object.getPrototypeOf(this),H=this.L;return C=C(L.call(B,N,{L:{value:{count:H.count,Z:H.Z,$:H.$,N:H.N,O:H.O,S:H.S,T:H.T}}})),C.L.count.value+=1,C.L.Z=!1,C},xt.prototype.delete=function(){this.L.N||Mn(this),this.L.Z&&!this.L.$&&fe("Object already scheduled for deletion"),be(this),ke(this.L),this.L.$||(this.L.S=void 0,this.L.N=void 0)},xt.prototype.isDeleted=function(){return!this.L.N},xt.prototype.deleteLater=function(){return this.L.N||Mn(this),this.L.Z&&!this.L.$&&fe("Object already scheduled for deletion"),Q.push(this),Q.length===1&&E&&E(m),this.L.Z=!0,this},Qr.prototype.pa=function(C){return this.ja&&(C=this.ja(C)),C},Qr.prototype.ga=function(C){this.V&&this.V(C)},Qr.prototype.argPackAdvance=8,Qr.prototype.readValueFromPointer=Ce,Qr.prototype.deleteObject=function(C){C!==null&&C.delete()},Qr.prototype.fromWireType=function(C){function B(){return this.ca?fr(this.M.W,{O:this.va,N:L,T:this,S:C}):fr(this.M.W,{O:this,N:C})}var L=this.pa(C);if(!L)return this.ga(C),null;var N=ct(this.M,L);if(N!==void 0)return N.L.count.value===0?(N.L.N=L,N.L.S=C,N.clone()):(N=N.clone(),this.ga(C),N);if(N=this.M.oa(L),N=Ft[N],!N)return B.call(this);N=this.ba?N.ka:N.pointerType;var H=_e(L,this.M,N.M);return H===null?B.call(this):this.ca?fr(N.M.W,{O:N,N:H,T:this,S:C}):fr(N.M.W,{O:N,N:H})},md=s.UnboundTypeError=Le("UnboundTypeError");var jB=typeof atob=="function"?atob:function(C){var B="",L=0;C=C.replace(/[^A-Za-z0-9\+\/=]/g,"");do{var N="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(C.charAt(L++)),H="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(C.charAt(L++)),Z="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(C.charAt(L++)),ie="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(C.charAt(L++));N=N<<2|H>>4,H=(H&15)<<4|Z>>2;var se=(Z&3)<<6|ie;B+=String.fromCharCode(N),Z!==64&&(B+=String.fromCharCode(H)),ie!==64&&(B+=String.fromCharCode(se))}while(L<C.length);return B},zB={p:function(C,B,L){C=Be(C),B=Ie(B,"wrapper"),L=Te(L);var N=[].slice,H=B.M,Z=H.W,ie=H.P.W,se=H.P.constructor;C=pe(C,function(){H.P.ia.forEach((function(ae){if(this[ae]===ie[ae])throw new we("Pure virtual function "+ae+" must be implemented in JavaScript")}).bind(this)),Object.defineProperty(this,"__parent",{value:Z}),this.__construct.apply(this,N.call(arguments))}),Z.__construct=function(){this===Z&&fe("Pass correct 'this' to __construct");var ae=se.implement.apply(void 0,[this].concat(N.call(arguments)));be(ae);var ue=ae.L;ae.notifyOnDestruction(),ue.$=!0,Object.defineProperties(this,{L:{value:ue}}),Ct(this),ae=ue.N,ae=M(H,ae),x.hasOwnProperty(ae)?fe("Tried to register registered instance: "+ae):x[ae]=this},Z.__destruct=function(){this===Z&&fe("Pass correct 'this' to __destruct"),be(this);var ae=this.L.N;ae=M(H,ae),x.hasOwnProperty(ae)?delete x[ae]:fe("Tried to unregister unregistered instance: "+ae)},C.prototype=Object.create(Z);for(var le in L)C.prototype[le]=L[le];return Me(C)},j:function(C){var B=q[C];delete q[C];var L=B.ea,N=B.V,H=B.ha,Z=H.map(ie=>ie.sa).concat(H.map(ie=>ie.ya));qe([C],Z,ie=>{var se={};return H.forEach((le,ae)=>{var ue=ie[ae],ve=le.qa,Ue=le.ra,At=ie[ae+H.length],Ye=le.xa,Mt=le.za;se[le.na]={read:zt=>ue.fromWireType(ve(Ue,zt)),write:(zt,Ti)=>{var br=[];Ye(Mt,zt,At.toWireType(br,Ti)),de(br)}}}),[{name:B.name,fromWireType:function(le){var ae={},ue;for(ue in se)ae[ue]=se[ue].read(le);return N(le),ae},toWireType:function(le,ae){for(var ue in se)if(!(ue in ae))throw new TypeError('Missing field: "'+ue+'"');var ve=L();for(ue in se)se[ue].write(ve,ae[ue]);return le!==null&&le.push(N,ve),ve},argPackAdvance:8,readValueFromPointer:Ce,U:N}]})},v:function(){},B:function(C,B,L,N,H){var Z=Tt(L);B=Be(B),bt(C,{name:B,fromWireType:function(ie){return!!ie},toWireType:function(ie,se){return se?N:H},argPackAdvance:8,readValueFromPointer:function(ie){if(L===1)var se=v;else if(L===2)se=b;else if(L===4)se=w;else throw new TypeError("Unknown boolean type size: "+B);return this.fromWireType(se[ie>>Z])},U:null})},f:function(C,B,L,N,H,Z,ie,se,le,ae,ue,ve,Ue){ue=Be(ue),Z=jt(H,Z),se&&(se=jt(ie,se)),ae&&(ae=jt(le,ae)),Ue=jt(ve,Ue);var At=ce(ue);Pn(At,function(){Ks("Cannot construct "+ue+" due to unbound types",[N])}),qe([C,B,L],N?[N]:[],function(Ye){if(Ye=Ye[0],N)var Mt=Ye.M,zt=Mt.W;else zt=xt.prototype;Ye=pe(At,function(){if(Object.getPrototypeOf(this)!==Ti)throw new Ge("Use 'new' to construct "+ue);if(br.X===void 0)throw new Ge(ue+" has no accessible constructor");var Qd=br.X[arguments.length];if(Qd===void 0)throw new Ge("Tried to invoke ctor of "+ue+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(br.X).toString()+") parameters instead!");return Qd.apply(this,arguments)});var Ti=Object.create(zt,{constructor:{value:Ye}});Ye.prototype=Ti;var br=new kr(ue,Ye,Ti,Ue,Mt,Z,se,ae);Mt=new Qr(ue,br,!0,!1),zt=new Qr(ue+"*",br,!1,!1);var Bd=new Qr(ue+" const*",br,!1,!0);return Ft[C]={pointerType:zt,ka:Bd},MB(At,Ye),[Mt,zt,Bd]})},c:function(C,B,L,N,H,Z,ie){var se=fA(L,N);B=Be(B),Z=jt(H,Z),qe([],[C],function(le){function ae(){Ks("Cannot call "+ue+" due to unbound types",se)}le=le[0];var ue=le.name+"."+B;B.startsWith("@@")&&(B=Symbol[B.substring(2)]);var ve=le.M.constructor;return ve[B]===void 0?(ae.Y=L-1,ve[B]=ae):(on(ve,B,ue),ve[B].R[L-1]=ae),qe([],se,function(Ue){return Ue=dA(ue,[Ue[0],null].concat(Ue.slice(1)),null,Z,ie),ve[B].R===void 0?(Ue.Y=L-1,ve[B]=Ue):ve[B].R[L-1]=Ue,[]}),[]})},o:function(C,B,L,N,H,Z){0<B||X();var ie=fA(B,L);H=jt(N,H),qe([],[C],function(se){se=se[0];var le="constructor "+se.name;if(se.M.X===void 0&&(se.M.X=[]),se.M.X[B-1]!==void 0)throw new Ge("Cannot register multiple constructors with identical number of parameters ("+(B-1)+") for class '"+se.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return se.M.X[B-1]=()=>{Ks("Cannot construct "+se.name+" due to unbound types",ie)},qe([],ie,function(ae){return ae.splice(1,0,null),se.M.X[B-1]=dA(le,ae,null,H,Z),[]}),[]})},a:function(C,B,L,N,H,Z,ie,se){var le=fA(L,N);B=Be(B),Z=jt(H,Z),qe([],[C],function(ae){function ue(){Ks("Cannot call "+ve+" due to unbound types",le)}ae=ae[0];var ve=ae.name+"."+B;B.startsWith("@@")&&(B=Symbol[B.substring(2)]),se&&ae.M.ia.push(B);var Ue=ae.M.W,At=Ue[B];return At===void 0||At.R===void 0&&At.className!==ae.name&&At.Y===L-2?(ue.Y=L-2,ue.className=ae.name,Ue[B]=ue):(on(Ue,B,ve),Ue[B].R[L-2]=ue),qe([],le,function(Ye){return Ye=dA(ve,Ye,ae,Z,ie),Ue[B].R===void 0?(Ye.Y=L-2,Ue[B]=Ye):Ue[B].R[L-2]=Ye,[]}),[]})},A:function(C,B){B=Be(B),bt(C,{name:B,fromWireType:function(L){var N=Te(L);return gA(L),N},toWireType:function(L,N){return Me(N)},argPackAdvance:8,readValueFromPointer:Ce,U:null})},m:function(C,B,L){L=Tt(L),B=Be(B),bt(C,{name:B,fromWireType:function(N){return N},toWireType:function(N,H){return H},argPackAdvance:8,readValueFromPointer:OB(B,L),U:null})},d:function(C,B,L,N,H){B=Be(B),H===-1&&(H=4294967295),H=Tt(L);var Z=se=>se;if(N===0){var ie=32-8*L;Z=se=>se<<ie>>>ie}L=B.includes("unsigned")?function(se,le){return le>>>0}:function(se,le){return le},bt(C,{name:B,fromWireType:Z,toWireType:L,argPackAdvance:8,readValueFromPointer:UB(B,H,N!==0),U:null})},b:function(C,B,L){function N(Z){Z>>=2;var ie=R;return new H(p,ie[Z+1],ie[Z])}var H=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][B];L=Be(L),bt(C,{name:L,fromWireType:N,argPackAdvance:8,readValueFromPointer:N},{ta:!0})},n:function(C,B){B=Be(B);var L=B==="std::string";bt(C,{name:B,fromWireType:function(N){var H=R[N>>2],Z=N+4;if(L)for(var ie=Z,se=0;se<=H;++se){var le=Z+se;if(se==H||T[le]==0){if(ie=ie?g(T,ie,le-ie):"",ae===void 0)var ae=ie;else ae+="\0",ae+=ie;ie=le+1}}else{for(ae=Array(H),se=0;se<H;++se)ae[se]=String.fromCharCode(T[Z+se]);ae=ae.join("")}return Tr(N),ae},toWireType:function(N,H){H instanceof ArrayBuffer&&(H=new Uint8Array(H));var Z,ie=typeof H=="string";if(ie||H instanceof Uint8Array||H instanceof Uint8ClampedArray||H instanceof Int8Array||fe("Cannot pass non-string to std::string"),L&&ie){var se=0;for(Z=0;Z<H.length;++Z){var le=H.charCodeAt(Z);127>=le?se++:2047>=le?se+=2:55296<=le&&57343>=le?(se+=4,++Z):se+=3}Z=se}else Z=H.length;if(se=mA(4+Z+1),le=se+4,R[se>>2]=Z,L&&ie){if(ie=le,le=Z+1,Z=T,0<le){le=ie+le-1;for(var ae=0;ae<H.length;++ae){var ue=H.charCodeAt(ae);if(55296<=ue&&57343>=ue){var ve=H.charCodeAt(++ae);ue=65536+((ue&1023)<<10)|ve&1023}if(127>=ue){if(ie>=le)break;Z[ie++]=ue}else{if(2047>=ue){if(ie+1>=le)break;Z[ie++]=192|ue>>6}else{if(65535>=ue){if(ie+2>=le)break;Z[ie++]=224|ue>>12}else{if(ie+3>=le)break;Z[ie++]=240|ue>>18,Z[ie++]=128|ue>>12&63}Z[ie++]=128|ue>>6&63}Z[ie++]=128|ue&63}}Z[ie]=0}}else if(ie)for(ie=0;ie<Z;++ie)ae=H.charCodeAt(ie),255<ae&&(Tr(le),fe("String has UTF-16 code units that do not fit in 8 bits")),T[le+ie]=ae;else for(ie=0;ie<Z;++ie)T[le+ie]=H[ie];return N!==null&&N.push(Tr,se),se},argPackAdvance:8,readValueFromPointer:Ce,U:function(N){Tr(N)}})},i:function(C,B,L){if(L=Be(L),B===2)var N=GB,H=HB,Z=$B,ie=()=>y,se=1;else B===4&&(N=YB,H=VB,Z=KB,ie=()=>R,se=2);bt(C,{name:L,fromWireType:function(le){for(var ae=R[le>>2],ue=ie(),ve,Ue=le+4,At=0;At<=ae;++At){var Ye=le+4+At*B;(At==ae||ue[Ye>>se]==0)&&(Ue=N(Ue,Ye-Ue),ve===void 0?ve=Ue:(ve+="\0",ve+=Ue),Ue=Ye+B)}return Tr(le),ve},toWireType:function(le,ae){typeof ae!="string"&&fe("Cannot pass non-string to C++ string type "+L);var ue=Z(ae),ve=mA(4+ue+B);return R[ve>>2]=ue>>se,H(ae,ve+4,ue+B),le!==null&&le.push(Tr,ve),ve},argPackAdvance:8,readValueFromPointer:Ce,U:function(le){Tr(le)}})},k:function(C,B,L,N,H,Z){q[C]={name:Be(B),ea:jt(L,N),V:jt(H,Z),ha:[]}},h:function(C,B,L,N,H,Z,ie,se,le,ae){q[C].ha.push({na:Be(B),sa:L,qa:jt(N,H),ra:Z,ya:ie,xa:jt(se,le),za:ae})},C:function(C,B){B=Be(B),bt(C,{ua:!0,name:B,argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})},s:function(C,B,L,N,H){C=Js[C],B=Te(B),L=Ed(L);var Z=[];return R[N>>2]=Me(Z),C(B,L,Z,H)},t:function(C,B,L,N){C=Js[C],B=Te(B),L=Ed(L),C(B,L,null,N)},g:gA,l:function(C,B){var L=qB(C,B),N=L[0];B=N.name+"_$"+L.slice(1).map(function(ie){return ie.name}).join("_")+"$";var H=Id[B];if(H!==void 0)return H;var Z=Array(C-1);return H=WB((ie,se,le,ae)=>{for(var ue=0,ve=0;ve<C-1;++ve)Z[ve]=L[ve+1].readValueFromPointer(ae+ue),ue+=L[ve+1].argPackAdvance;for(ie=ie[se].apply(ie,Z),ve=0;ve<C-1;++ve)L[ve+1].la&&L[ve+1].la(Z[ve]);if(!N.ua)return N.toWireType(le,ie)}),Id[B]=H},q:function(C){4<C&&(ge[C].fa+=1)},r:function(C){var B=Te(C);de(B),gA(C)},e:function(){X("")},x:function(C,B,L){T.copyWithin(C,B,B+L)},w:function(C){var B=T.length;if(C>>>=0,2147483648<C)return!1;for(var L=1;4>=L;L*=2){var N=B*(1+.2/L);N=Math.min(N,C+100663296);var H=Math;N=Math.max(C,N),H=H.min.call(H,2147483648,N+(65536-N%65536)%65536);e:{try{d.grow(H-p.byteLength+65535>>>16),W();var Z=1;break e}catch{}Z=void 0}if(Z)return!0}return!1},z:function(){return 52},u:function(){return 70},y:function(C,B,L,N){for(var H=0,Z=0;Z<L;Z++){var ie=R[B>>2],se=R[B+4>>2];B+=8;for(var le=0;le<se;le++){var ae=T[ie+le],ue=XB[C];ae===0||ae===10?((C===1?c:u)(g(ue,0)),ue.length=0):ue.push(ae)}H+=se}return R[N>>2]=H,0}};(function(){function C(H){s.asm=H.exports,d=s.asm.D,W(),O=s.asm.I,ne.unshift(s.asm.E),_--,s.monitorRunDependencies&&s.monitorRunDependencies(_),_==0&&P&&(H=P,P=null,H())}function B(H){C(H.instance)}function L(H){return Y().then(function(Z){return WebAssembly.instantiate(Z,N)}).then(function(Z){return Z}).then(H,function(Z){u("failed to asynchronously prepare wasm: "+Z),X(Z)})}var N={a:zB};if(_++,s.monitorRunDependencies&&s.monitorRunDependencies(_),s.instantiateWasm)try{return s.instantiateWasm(N,C)}catch(H){u("Module.instantiateWasm callback failed with error: "+H),a(H)}return function(){return h||typeof WebAssembly.instantiateStreaming!="function"||D(S)||typeof fetch!="function"?L(B):fetch(S,{credentials:"same-origin"}).then(function(H){return WebAssembly.instantiateStreaming(H,N).then(B,function(Z){return u("wasm streaming compile failed: "+Z),u("falling back to ArrayBuffer instantiation"),L(B)})})}().catch(a),{}})(),s.___wasm_call_ctors=function(){return(s.___wasm_call_ctors=s.asm.E).apply(null,arguments)};var vd=s.___getTypeName=function(){return(vd=s.___getTypeName=s.asm.F).apply(null,arguments)};s.__embind_initialize_bindings=function(){return(s.__embind_initialize_bindings=s.asm.G).apply(null,arguments)};var mA=s._malloc=function(){return(mA=s._malloc=s.asm.H).apply(null,arguments)},Tr=s._free=function(){return(Tr=s._free=s.asm.J).apply(null,arguments)};s.dynCall_jiji=function(){return(s.dynCall_jiji=s.asm.K).apply(null,arguments)};var qs;P=function C(){qs||yd(),qs||(P=C)};function yd(){function C(){if(!qs&&(qs=!0,s.calledRun=!0,!f)){if(re(ne),o(s),s.onRuntimeInitialized&&s.onRuntimeInitialized(),s.postRun)for(typeof s.postRun=="function"&&(s.postRun=[s.postRun]);s.postRun.length;){var B=s.postRun.shift();ee.unshift(B)}re(ee)}}if(!(0<_)){if(s.preRun)for(typeof s.preRun=="function"&&(s.preRun=[s.preRun]);s.preRun.length;)Ae();re(K),0<_||(s.setStatus?(s.setStatus("Running..."),setTimeout(function(){setTimeout(function(){s.setStatus("")},1),C()},1)):C())}}if(s.preInit)for(typeof s.preInit=="function"&&(s.preInit=[s.preInit]);0<s.preInit.length;)s.preInit.pop()();return yd(),i.ready}})();r.exports=t})(WA);var Ff=WA.exports;(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e={loadYoga:!0};r.loadYoga=o;var t=i(lo),n=Re;Object.keys(n).forEach(function(a){a==="default"||a==="__esModule"||Object.prototype.hasOwnProperty.call(e,a)||a in r&&r[a]===n[a]||Object.defineProperty(r,a,{enumerable:!0,get:function(){return n[a]}})});function i(a){return a&&a.__esModule?a:{default:a}}const s=Ff;async function o(){return(0,t.default)(await s())}})(KA);function kf(r){for(var e=new Array(r),t=0;t<r;++t)e[t]=t;return e}var Nf=kf;/*!
|
65
|
+
`+p(_,F)):Y}}function X(_,S){var F;return S.cache&&S.name&&S.storage.templates.get(S.name)?S.storage.templates.get(S.name):(F=typeof _=="function"?_:P(_,S),S.cache&&S.name&&S.storage.templates.define(S.name,F),F)}le.l.bind(le),t.compile=P,t.compileScope=x,t.compileScopeIntoFunction=y,t.compileToString=p,t.defaultConfig=le,t.filters=ee,t.getConfig=D,t.helpers=J,t.nativeHelpers=ne,t.parse=g,t.render=function(_,S,F,W){var Y=D(F||{});if(!Y.async)return X(_,Y)(S,Y);if(!W){if(typeof s=="function")return new s(function(re,ce){try{re(X(_,Y)(S,Y))}catch(pe){ce(pe)}});throw n("Please provide a callback function, this env doesn't support Promises")}try{X(_,Y)(S,Y,W)}catch(re){return W(re)}},t.templates=O,Object.defineProperty(t,"__esModule",{value:!0})})})(lo,lo.exports);var vf=lo.exports;const yf=(r,e,t,n)=>{if(t==="length"||t==="prototype"||t==="arguments"||t==="caller")return;const i=Object.getOwnPropertyDescriptor(r,t),s=Object.getOwnPropertyDescriptor(e,t);!Bf(i,s)&&n||Object.defineProperty(r,t,s)},Bf=function(r,e){return r===void 0||r.configurable||r.writable===e.writable&&r.enumerable===e.enumerable&&r.configurable===e.configurable&&(r.writable||r.value===e.value)},Qf=(r,e)=>{const t=Object.getPrototypeOf(e);t!==Object.getPrototypeOf(r)&&Object.setPrototypeOf(r,t)},Tf=(r,e)=>`/* Wrapped ${r}*/
|
66
|
+
${e}`,bf=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),xf=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),wf=(r,e,t)=>{const n=t===""?"":`with ${t.trim()}() `,i=Tf.bind(null,n,e.toString());Object.defineProperty(i,"name",xf),Object.defineProperty(r,"toString",{...bf,value:i})};function Sf(r,e,{ignoreNonConfigurable:t=!1}={}){const{name:n}=r;for(const i of Reflect.ownKeys(e))yf(r,e,i,t);return Qf(r,e),wf(r,e,n),r}const Rf=new WeakMap;function $r(r,{cacheKey:e=([n])=>n,cache:t=new Map}={}){const n=new Map,i=function(...s){const o=e(s);if(n.has(o))return n.get(o);const a=(async()=>{try{if(t&&await t.has(o))return await t.get(o);const A=await r.apply(this,s);try{return A}finally{t&&await t.set(o,A)}}finally{n.delete(o)}})();return n.set(o,a),a};return Sf(i,r,{ignoreNonConfigurable:!0}),Rf.set(i,t),i}var Jl={},Ao={},Re={};Object.defineProperty(Re,"__esModule",{value:!0}),Re.default=Re.Wrap=Re.Unit=Re.PrintOptions=Re.PositionType=Re.Overflow=Re.NodeType=Re.MeasureMode=Re.LogLevel=Re.Justify=Re.Gutter=Re.FlexDirection=Re.ExperimentalFeature=Re.Errata=Re.Edge=Re.Display=Re.Direction=Re.Dimension=Re.Align=void 0;let pr=function(r){return r[r.Auto=0]="Auto",r[r.FlexStart=1]="FlexStart",r[r.Center=2]="Center",r[r.FlexEnd=3]="FlexEnd",r[r.Stretch=4]="Stretch",r[r.Baseline=5]="Baseline",r[r.SpaceBetween=6]="SpaceBetween",r[r.SpaceAround=7]="SpaceAround",r}({});Re.Align=pr;let co=function(r){return r[r.Width=0]="Width",r[r.Height=1]="Height",r}({});Re.Dimension=co;let Fi=function(r){return r[r.Inherit=0]="Inherit",r[r.LTR=1]="LTR",r[r.RTL=2]="RTL",r}({});Re.Direction=Fi;let uo=function(r){return r[r.Flex=0]="Flex",r[r.None=1]="None",r}({});Re.Display=uo;let Zt=function(r){return r[r.Left=0]="Left",r[r.Top=1]="Top",r[r.Right=2]="Right",r[r.Bottom=3]="Bottom",r[r.Start=4]="Start",r[r.End=5]="End",r[r.Horizontal=6]="Horizontal",r[r.Vertical=7]="Vertical",r[r.All=8]="All",r}({});Re.Edge=Zt;let jn=function(r){return r[r.None=0]="None",r[r.StretchFlexBasis=1]="StretchFlexBasis",r[r.All=2147483647]="All",r[r.Classic=2147483646]="Classic",r}({});Re.Errata=jn;let ki=function(r){return r[r.WebFlexBasis=0]="WebFlexBasis",r[r.AbsolutePercentageAgainstPaddingEdge=1]="AbsolutePercentageAgainstPaddingEdge",r[r.FixJNILocalRefOverflows=2]="FixJNILocalRefOverflows",r}({});Re.ExperimentalFeature=ki;let zn=function(r){return r[r.Column=0]="Column",r[r.ColumnReverse=1]="ColumnReverse",r[r.Row=2]="Row",r[r.RowReverse=3]="RowReverse",r}({});Re.FlexDirection=zn;let Ni=function(r){return r[r.Column=0]="Column",r[r.Row=1]="Row",r[r.All=2]="All",r}({});Re.Gutter=Ni;let Yr=function(r){return r[r.FlexStart=0]="FlexStart",r[r.Center=1]="Center",r[r.FlexEnd=2]="FlexEnd",r[r.SpaceBetween=3]="SpaceBetween",r[r.SpaceAround=4]="SpaceAround",r[r.SpaceEvenly=5]="SpaceEvenly",r}({});Re.Justify=Yr;let Vr=function(r){return r[r.Error=0]="Error",r[r.Warn=1]="Warn",r[r.Info=2]="Info",r[r.Debug=3]="Debug",r[r.Verbose=4]="Verbose",r[r.Fatal=5]="Fatal",r}({});Re.LogLevel=Vr;let Mi=function(r){return r[r.Undefined=0]="Undefined",r[r.Exactly=1]="Exactly",r[r.AtMost=2]="AtMost",r}({});Re.MeasureMode=Mi;let ho=function(r){return r[r.Default=0]="Default",r[r.Text=1]="Text",r}({});Re.NodeType=ho;let Pi=function(r){return r[r.Visible=0]="Visible",r[r.Hidden=1]="Hidden",r[r.Scroll=2]="Scroll",r}({});Re.Overflow=Pi;let Oi=function(r){return r[r.Static=0]="Static",r[r.Relative=1]="Relative",r[r.Absolute=2]="Absolute",r}({});Re.PositionType=Oi;let Ui=function(r){return r[r.Layout=1]="Layout",r[r.Style=2]="Style",r[r.Children=4]="Children",r}({});Re.PrintOptions=Ui;let Zn=function(r){return r[r.Undefined=0]="Undefined",r[r.Point=1]="Point",r[r.Percent=2]="Percent",r[r.Auto=3]="Auto",r}({});Re.Unit=Zn;let Gi=function(r){return r[r.NoWrap=0]="NoWrap",r[r.Wrap=1]="Wrap",r[r.WrapReverse=2]="WrapReverse",r}({});Re.Wrap=Gi;var Df={ALIGN_AUTO:pr.Auto,ALIGN_FLEX_START:pr.FlexStart,ALIGN_CENTER:pr.Center,ALIGN_FLEX_END:pr.FlexEnd,ALIGN_STRETCH:pr.Stretch,ALIGN_BASELINE:pr.Baseline,ALIGN_SPACE_BETWEEN:pr.SpaceBetween,ALIGN_SPACE_AROUND:pr.SpaceAround,DIMENSION_WIDTH:co.Width,DIMENSION_HEIGHT:co.Height,DIRECTION_INHERIT:Fi.Inherit,DIRECTION_LTR:Fi.LTR,DIRECTION_RTL:Fi.RTL,DISPLAY_FLEX:uo.Flex,DISPLAY_NONE:uo.None,EDGE_LEFT:Zt.Left,EDGE_TOP:Zt.Top,EDGE_RIGHT:Zt.Right,EDGE_BOTTOM:Zt.Bottom,EDGE_START:Zt.Start,EDGE_END:Zt.End,EDGE_HORIZONTAL:Zt.Horizontal,EDGE_VERTICAL:Zt.Vertical,EDGE_ALL:Zt.All,ERRATA_NONE:jn.None,ERRATA_STRETCH_FLEX_BASIS:jn.StretchFlexBasis,ERRATA_ALL:jn.All,ERRATA_CLASSIC:jn.Classic,EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS:ki.WebFlexBasis,EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE:ki.AbsolutePercentageAgainstPaddingEdge,EXPERIMENTAL_FEATURE_FIX_JNILOCAL_REF_OVERFLOWS:ki.FixJNILocalRefOverflows,FLEX_DIRECTION_COLUMN:zn.Column,FLEX_DIRECTION_COLUMN_REVERSE:zn.ColumnReverse,FLEX_DIRECTION_ROW:zn.Row,FLEX_DIRECTION_ROW_REVERSE:zn.RowReverse,GUTTER_COLUMN:Ni.Column,GUTTER_ROW:Ni.Row,GUTTER_ALL:Ni.All,JUSTIFY_FLEX_START:Yr.FlexStart,JUSTIFY_CENTER:Yr.Center,JUSTIFY_FLEX_END:Yr.FlexEnd,JUSTIFY_SPACE_BETWEEN:Yr.SpaceBetween,JUSTIFY_SPACE_AROUND:Yr.SpaceAround,JUSTIFY_SPACE_EVENLY:Yr.SpaceEvenly,LOG_LEVEL_ERROR:Vr.Error,LOG_LEVEL_WARN:Vr.Warn,LOG_LEVEL_INFO:Vr.Info,LOG_LEVEL_DEBUG:Vr.Debug,LOG_LEVEL_VERBOSE:Vr.Verbose,LOG_LEVEL_FATAL:Vr.Fatal,MEASURE_MODE_UNDEFINED:Mi.Undefined,MEASURE_MODE_EXACTLY:Mi.Exactly,MEASURE_MODE_AT_MOST:Mi.AtMost,NODE_TYPE_DEFAULT:ho.Default,NODE_TYPE_TEXT:ho.Text,OVERFLOW_VISIBLE:Pi.Visible,OVERFLOW_HIDDEN:Pi.Hidden,OVERFLOW_SCROLL:Pi.Scroll,POSITION_TYPE_STATIC:Oi.Static,POSITION_TYPE_RELATIVE:Oi.Relative,POSITION_TYPE_ABSOLUTE:Oi.Absolute,PRINT_OPTIONS_LAYOUT:Ui.Layout,PRINT_OPTIONS_STYLE:Ui.Style,PRINT_OPTIONS_CHILDREN:Ui.Children,UNIT_UNDEFINED:Zn.Undefined,UNIT_POINT:Zn.Point,UNIT_PERCENT:Zn.Percent,UNIT_AUTO:Zn.Auto,WRAP_NO_WRAP:Gi.NoWrap,WRAP_WRAP:Gi.Wrap,WRAP_WRAP_REVERSE:Gi.WrapReverse};Re.default=Df,Object.defineProperty(Ao,"__esModule",{value:!0}),Ao.default=Lf;var wr=_f(Re);function Wl(r){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(Wl=function(n){return n?t:e})(r)}function _f(r,e){if(!e&&r&&r.__esModule)return r;if(r===null||typeof r!="object"&&typeof r!="function")return{default:r};var t=Wl(e);if(t&&t.has(r))return t.get(r);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in r)if(s!=="default"&&Object.prototype.hasOwnProperty.call(r,s)){var o=i?Object.getOwnPropertyDescriptor(r,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=r[s]}return n.default=r,t&&t.set(r,n),n}function Lf(r){function e(i,s,o){const a=i[s];i[s]=function(){for(var l=arguments.length,A=new Array(l),c=0;c<l;c++)A[c]=arguments[c];return o.call(this,a,...A)}}for(const i of["setPosition","setMargin","setFlexBasis","setWidth","setHeight","setMinWidth","setMinHeight","setMaxWidth","setMaxHeight","setPadding"]){const s={[wr.Unit.Point]:r.Node.prototype[i],[wr.Unit.Percent]:r.Node.prototype[`${i}Percent`],[wr.Unit.Auto]:r.Node.prototype[`${i}Auto`]};e(r.Node.prototype,i,function(o){for(var a=arguments.length,l=new Array(a>1?a-1:0),A=1;A<a;A++)l[A-1]=arguments[A];const c=l.pop();let u,h;if(c==="auto")u=wr.Unit.Auto,h=void 0;else if(typeof c=="object")u=c.unit,h=c.valueOf();else if(u=typeof c=="string"&&c.endsWith("%")?wr.Unit.Percent:wr.Unit.Point,h=parseFloat(c),!Number.isNaN(c)&&Number.isNaN(h))throw new Error(`Invalid value ${c} for ${i}`);if(!s[u])throw new Error(`Failed to execute "${i}": Unsupported unit '${c}'`);return h!==void 0?s[u].call(this,...l,h):s[u].call(this,...l)})}function t(i){return r.MeasureCallback.implement({measure:function(){const{width:s,height:o}=i(...arguments);return{width:s??NaN,height:o??NaN}}})}e(r.Node.prototype,"setMeasureFunc",function(i,s){return s?i.call(this,t(s)):this.unsetMeasureFunc()});function n(i){return r.DirtiedCallback.implement({dirtied:i})}return e(r.Node.prototype,"setDirtiedFunc",function(i,s){i.call(this,n(s))}),e(r.Config.prototype,"free",function(){r.Config.destroy(this)}),e(r.Node,"create",(i,s)=>s?r.Node.createWithConfig(s):r.Node.createDefault()),e(r.Node.prototype,"free",function(){r.Node.destroy(this)}),e(r.Node.prototype,"freeRecursive",function(){for(let i=0,s=this.getChildCount();i<s;++i)this.getChild(0).freeRecursive();this.free()}),e(r.Node.prototype,"calculateLayout",function(i){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:NaN,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:NaN,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:wr.Direction.LTR;return i.call(this,s,o,a)}),{Config:r.Config,Node:r.Node,...wr.default}}var ql={exports:{}};(function(r,e){var t=(()=>{var n=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return function(i){i=i||{};var s;s||(s=typeof i<"u"?i:{});var o,a;s.ready=new Promise(function(v,B){o=v,a=B});var l=Object.assign({},s),A="";typeof document<"u"&&document.currentScript&&(A=document.currentScript.src),n&&(A=n),A.indexOf("blob:")!==0?A=A.substr(0,A.replace(/[?#].*/,"").lastIndexOf("/")+1):A="";var c=s.print||console.log.bind(console),u=s.printErr||console.warn.bind(console);Object.assign(s,l),l=null;var h;s.wasmBinary&&(h=s.wasmBinary),s.noExitRuntime,typeof WebAssembly!="object"&&X("no native wasm support detected");var d,f=!1;function g(v,B,L){L=B+L;for(var N="";!(B>=L);){var H=v[B++];if(!H)break;if(H&128){var Z=v[B++]&63;if((H&224)==192)N+=String.fromCharCode((H&31)<<6|Z);else{var ie=v[B++]&63;H=(H&240)==224?(H&15)<<12|Z<<6|ie:(H&7)<<18|Z<<12|ie<<6|v[B++]&63,65536>H?N+=String.fromCharCode(H):(H-=65536,N+=String.fromCharCode(55296|H>>10,56320|H&1023))}}else N+=String.fromCharCode(H)}return N}var p,C,T,b,y,x,R,k,$;function V(){var v=d.buffer;p=v,s.HEAP8=C=new Int8Array(v),s.HEAP16=b=new Int16Array(v),s.HEAP32=x=new Int32Array(v),s.HEAPU8=T=new Uint8Array(v),s.HEAPU16=y=new Uint16Array(v),s.HEAPU32=R=new Uint32Array(v),s.HEAPF32=k=new Float32Array(v),s.HEAPF64=$=new Float64Array(v)}var O,J=[],ne=[],ee=[];function le(){var v=s.preRun.shift();J.unshift(v)}var D=0,P=null;function X(v){throw s.onAbort&&s.onAbort(v),v="Aborted("+v+")",u(v),f=!0,v=new WebAssembly.RuntimeError(v+". Build with -sASSERTIONS for more info."),a(v),v}function _(v){return v.startsWith("data:application/octet-stream;base64,")}var S;if(S="data:application/octet-stream;base64,AGFzbQEAAAABvgM4YAF/AGACf38AYAF/AX9gA39/fwBgAn98AGACf38Bf2ADf39/AX9gAABgA39/fABgAX8BfGADf399AX1gBX9/f39/AX9gAn9/AXxgAAF/YAZ/f31/fX8AYAR/f39/AX9gAn9/AX1gBn9/f39/fwF/YAV/f39/fwBgBH9/f38AYAN/fn8BfmAHf39/f39/fwBgBn9/f39/fwBgAn19AX1gAX0Bf2ABfwF9YAZ/fH9/f38Bf2ACf30AYAR/fHx/AGAIf39/f39/f38AYA1/f39/f39/f39/f39/AGAKf39/f39/f39/fwBgBX9/f39/AXxgBH9/fX0BfWAEfHx/fwF9YA5/fX1/f399fX9/f39/fwF/YAZ/f319f38AYAJ+fwF/YAR/fX1/AX1gA399fQF9YAF8AXxgBH98fHwAYAV/f319fQF9YA5/fX1/f399fX9/f39/fwBgB39/fX99f38AYA1/fX99f31/fX19fX1/AX9gBX9/fX19AGAEf39+fgBgB39/f39/f38Bf2ACfH8BfGAFf398fH8AYAN/f38BfWADf39/AXxgBH9/f3wAYAN/f30AYAZ/f31/fX8BfwKvAR0BYQFhAB0BYQFiAAMBYQFjABUBYQFkABIBYQFlAAcBYQFmAB4BYQFnAAABYQFoAB8BYQFpAAMBYQFqAAABYQFrABYBYQFsAAUBYQFtAAMBYQFuAAEBYQFvABYBYQFwAAYBYQFxAAABYQFyAAABYQFzACABYQF0ABMBYQF1AAsBYQF2ABUBYQF3AAIBYQF4AAMBYQF5AA8BYQF6AAIBYQFBAA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Q0AIAAgAToAACAAIAJqIgNBAWsgAToAACACQQNJDQAgACABOgACIAAgAToAASADQQNrIAE6AAAgA0ECayABOgAAIAJBB0kNACAAIAE6AAMgA0EEayABOgAAIAJBCUkNACAAQQAgAGtBA3EiBGoiAyABQf8BcUGBgoQIbCIBNgIAIAMgAiAEa0F8cSIEaiICQQRrIAE2AgAgBEEJSQ0AIAMgATYCCCADIAE2AgQgAkEIayABNgIAIAJBDGsgATYCACAEQRlJDQAgAyABNgIYIAMgATYCFCADIAE2AhAgAyABNgIMIAJBEGsgATYCACACQRRrIAE2AgAgAkEYayABNgIAIAJBHGsgATYCACAEIANBBHFBGHIiBGsiAkEgSQ0AIAGtQoGAgIAQfiEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkEgayICQR9LDQALCyAAC4AEAQN/IAJBgARPBEAgACABIAIQFyAADwsgACACaiEDAkAgACABc0EDcUUEQAJAIABBA3FFBEAgACECDAELIAJFBEAgACECDAELIAAhAgNAIAIgAS0AADoAACABQQFqIQEgAkEBaiICQQNxRQ0BIAIgA0kNAAsLAkAgA0F8cSIEQcAASQ0AIAIgBEFAaiIFSw0AA0AgAiABKAIANgIAIAIgASgCBDYCBCACIAEoAgg2AgggAiABKAIMNgIMIAIgASgCEDYCECACIAEoAhQ2AhQgAiABKAIYNgIYIAIgASgCHDYCHCACIAEoAiA2AiAgAiABKAIkNgIkIAIgASgCKDYCKCACIAEoAiw2AiwgAiABKAIwNgIwIAIgASgCNDYCNCACIAEoAjg2AjggAiABKAI8NgI8IAFBQGshASACQUBrIgIgBU0NAAsLIAIgBE8NAQNAIAIgASgCADYCACABQQRqIQEgAkEEaiICIARJDQALDAELIANBBEkEQCAAIQIMAQsgACADQQRrIgRLBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAAE6AAEgAiABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAA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yAJKgIAIQZDAADAfyEHIAkoAgRBAWsOAgIBAwsgCEH/////e3FBgICAgAJqviEGIAhBgICAgARxRQ0BCyAGIAKUQwrXIzyUIQcMAQsgBiEHCyAHIAAgASADEB8gACABIAMQIpKSIQMCQAJAAkACQCAEKAIADgMBAAADCyAFKgIAIgIgAiADIAIgA10bIAMgA1wbIQMMAQsgAyADXA0BIARBAjYCAAsgBSADOAIACwtvAQF/AkAgAEEYaiIDECYgAUECdGooArABIAJGDQAgAxAmIAFBAnRqIAI2ArABA0AgAC0ABCIBQQRxDQEgACABQQRyOgAEIAAoAhQiAQRAIAAgAREAAAsgAEGAgID+BzYCtAIgACgCqAQiAA0ACwsLVgECfSAAKAKoBEUEQEMAAAAADwsCQCAAKgIkIgEgAVsNAEMAAIA/IQEgACgCuAQtAAhBAXENAEMAAAAAIQEgACoCHCICQwAAAABdRQ0AIAKMIQELIAELhQECA38BfgJAIABCgICAgBBUBEAgACEFDAELA0AgAUEBayIBIABCCoAiBUL2AX4gAHynQTByOgAAIABC/////58BViECIAUhACACDQALCyAFpyICBEADQCABQQFrIgEgAkEKbiIDQfYBbCACakEwcjoAACACQQlLIQQgAyECIAQNAAsLIAELNwECf0EEEB0iAiABNgIAQQQQHSIDIAE2AgBBmTcgAEG6N0HqJEHCASACQbo3Qe4kQcMBIAMQBwteAQF/IABBADYCDCAAIAM2AhACQCABBEAgAUGAgICABE8NASABQQJ0EB0hBAsgACAENgIAIAAgBCACQQJ0aiICNgIIIAAgBCABQQJ0ajYCDCAAIAI2AgQgAA8LEFAAC9QBAgJ9AX8gAEHQAGohACABQQJ0QdAhaigCACEFAkACQAJAAn8gAUF+cUECRgRAIABBBSAFQY+evPwHEDMMAQsgACAFQY+evPwHEDILIgFB8OGD/AdGDQAgAUGPnrz8B0YNAkHwISEAAkAgAUGq1ar9B0cEQCABviIDIANbDQFB+CEhAAsgACoCACEDQwAAwH8hBCAAKAIEQQFrDgIDAQILIAFB/////3txQYCAgIACar4hAyABQYCAgIA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oAgAiAUEEajYCACAAIAEwAAA3AwAPCyACIAIoAgAiAUEEajYCACAAIAExAAA3AwAPCwALIAIgAigCAEEHakF4cSIBQQhqNgIAIAAgASsDADkDAA8LIAAgAiADEQEACw8LIAIgAigCACIBQQRqNgIAIAAgATQCADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATUCADcDAA8LIAIgAigCAEEHakF4cSIBQQhqNgIAIAAgASkDADcDAAtdAQR/IAAoAgAhAgNAIAIsAAAiAxBGBEBBfyEEIAAgAkEBaiICNgIAIAFBzJmz5gBNBH9BfyADQTBrIgMgAUEKbCIEaiADIARB/////wdzShsFIAQLIQEMAQsLIAELqBQCEn8BfiMAQdAAayIIJAAgCCABNgJMIAhBN2ohFyAIQThqIRQCQAJAAkACQANAIAEhDSAHIA5B/////wdzSg0BIAcgDmohDgJAAkACQCANIgctAAAiCQRAA0ACQAJAIAlB/wFxIgFFBEAgByEBDAELIAFBJUcNASAHIQkDQCAJLQABQSVHBEAgCSEBDAILIAdBAWohByAJLQACIQogCUECaiIBIQkgCkElRg0ACwsgByANayIHIA5B/////wdzIhhKDQcgAARAIAAgDSAHECcLIAcNBiAIIAE2AkwgAUEBaiEHQX8hEgJAIAEsAAEiChBGRQ0AIAEtAAJBJEcNACABQQNqIQcgCkEwayESQQEhFQsgCCAHNgJMQQAhDAJAIAcsAAAiCUEgayIBQR9LBEAgByEKDAELIAchCkEBIAF0IgFBidEEcUUNAANAIAggB0EBaiIKNgJMIAEgDHIhDCAHLAABIglBIGsiAUEgTw0BIAohB0EBIAF0IgFBidEEcQ0ACwsCQCAJQSpGBEACfwJAIAosAAEiARBGRQ0AIAotAAJBJEcNACABQQJ0IARqQcABa0EKNgIAIApBA2ohCUEBIRUgCiwAAUEDdCADakGAA2soAgAMAQsgFQ0GIApBAWohCSAARQRAIAggCTYCTEEAIRVBACETDAMLIAIgAigCACIBQQRqNgIAQQAhFSABKAIACyETIAggCTYCTCATQQBODQFBACATayETIAxBgMAAciEMDAELIAhBzABq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UEAQbwhIAIgBBERABoMAQsgAEEAQQVBvCEgAiAEEQsAGgsgA0EQaiQAECwACyAAQwAAAAAgASABQwAAAABbGzgCFCACQRBqJAALPAAgAUEDSQRAQQEgAXQhASAAKAIAIgACfyACBEAgACgCDCABcgwBCyAAKAIMIAFBf3NxCzYCDA8LEAQAC00BAn9BBBAdIQFBHBAdIgBCgICA/AM3AhQgAEIANwIMIABBADYCACAAQQA6AAggAEEBNgIEQeA2QeA2KAIAQQFqNgIAIAEgADYCACABCxAAIABBDTYCBCAAIAE2AgALEAAgAEEKNgIEIAAgATYCAAsQACAAQQc2AgQgACABNgIACyMAIAJBBUdBACACG0UEQEGoLCADIAQQYw8LQbgtIAMgBBBjCyIBAX4gASACrSADrUIghoQgBCAAERQAIgVCIIinJAEgBacLqAEBBX8gACgCVCIDKAIAIQUgAygCBCIEIAAoAhQgACgCHCIHayIGIAQgBkkbIgYEQCAFIAcgBhArGiADIAMoAgAgBmoiBTYCACADIAMoAgQgBmsiBDYCBAsgBCACIAIgBEsbIgQEQCAFIAEgBBArGiADIAMoAgAgBGoiBTYCACADIAMoAgQgBGs2AgQLIAVBADoAACAAIAAoAiwiATYCHCAAIAE2AhQgAgsEAEIACwQAQQALigUCBn4CfyABIAEoAgBBB2pBeHEiAUEQajYCACAAIQkgASkDACEDIAEpAwghBiMAQSBrIggkAAJAIAZC////////////AIMiBEKAgICAgIDAgDx9IARCgICAgICAwP/DAH1UBEAgBkIEhiADQjyIhCEEIANC//////////8PgyIDQoGAgICAgICACFoEQCAEQoGAgICAgICAwAB8IQIMAgsgBEKAgICAgICAgEB9IQIgA0KAgICAgICAgAhSDQEgAiAEQgGDfCECDAELIANQIARCgICAgICAwP//AFQgBEKAgICAgIDA//8AURtFBEAgBkIEhiADQjyIhEL/////////A4NCgICAgICAgPz/AIQhAgwBC0KAgICAgICA+P8AIQIgBEL///////+//8MAVg0AQgAhAiAEQjCIpyIAQZH3AEkNACADIQIgBkL///////8/g0KAgICAgIDAAIQiBS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ohASAAKAIAIQAgASACIAMgBEEBcQR/IAEoAgAgAGooAgAFIAALEQgACwkAIAEgABECAAsFAEGbNwsPACABIAAoAgBqIAI2AgALDQAgASAAKAIAaigCAAsYAQF/QRAQHSIAQgA3AwggAEEANgIAIAALGAEBf0EQEB0iAEIANwMAIABCADcDCCAACwwAQTAQHUEAQTAQKgs3AQF/IAEgACgCBCIDQQF1aiEBIAAoAgAhACABIAIgA0EBcQR/IAEoAgAgAGooAgAFIAALERsACwUAQZY3CyEAIAAgASgCACABIAEsAAtBAEgbQZM3IAIoAgAQDzYCAAsqAQF/QQwQHSIBQQA6AAQgASAAKAIANgIIIABBADYCACABQcgjNgIAIAELBQBBkzcLBQBBkDcLIQAgACABKAIAIAEgASwAC0EASBtB/DYgAigCABAPNgIAC9gBAQR/IwBBIGsiAyQAIAEoAgAiBEHw////B0kEQAJAAkAgBEELTwRAIARBD3JBAWoiBRAdIQYgAyAFQYCAgIB4cjYCECADIAY2AgggAyAENgIMIAQgBmohBQwBCyADIAQ6ABMgA0EIaiIGIARqIQUgBEUNAQsgBiABQQRqIAQQKxoLIAVBADoAACADIAI2AgAgA0EYaiADQQhqIAMgABEDACADKAIYEBAgAygCGCIAEAYgAygCABAGIAMsABNBAEgEQCADKAIIECkLIANBIGokACAADwsQBAALKgEBf0EMEB0iAUEAOgAEIAEgACgCADYCCCAAQQA2AgAgAUHQIjYCACABCwUAQfw2C2kBAn8jAEEQayIGJAAgASAAKAIEIgdBAXVqIQEgACgCACEAIAYgASACIAMgBCAFIAdBAXEEfyABKAIAIABqKAIABSAACxEOAEEQEB0iACAGKQMINwMIIAAgBikDADcDACAGQRBqJAAgAAsFAEH4NgubAQIBfwF9IwBBEGsiAiQAIAAoAgAhACABQQZIBEACfwJAAkACQCABQQRrDgIAAQILIABBpAJqIAAtAKwCQQNxQQJGDQIaIABBnAJqDAILIABBnAJqIAAtAKwCQQNxQQJGDQEaIABBpAJqDAELIAAgAUECdGpBnAJqCyoCACEDIAJBEGokACADu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jM0NTY3ODlBQkNERUYAQbQrCwHVAEHcKwsI//////////8AQaAsCwnwHwEAAAAAAAUAQbQsCwHQAEHMLAsK0QAAANIAAADUGwBB5CwLAQIAQfQsCwj//////////wBBuC0LAQUAQcQtCwHTAEHcLQsO0QAAANQAAADoGwAAAAQAQfQtCwEBAEGELgsF/////woAQcguCwHW",!_(S)){var F=S;S=s.locateFile?s.locateFile(F,A):A+F}function W(){var v=S;try{if(v==S&&h)return new Uint8Array(h);if(_(v))try{var B=zB(v.slice(37)),L=new Uint8Array(B.length);for(v=0;v<B.length;++v)L[v]=B.charCodeAt(v);var N=L}catch{throw Error("Converting base64 string to bytes failed.")}else N=void 0;var H=N;if(H)return H;throw"both async and sync fetching of the wasm failed"}catch(Z){X(Z)}}function Y(){return h||typeof fetch!="function"?Promise.resolve().then(function(){return W()}):fetch(S,{credentials:"same-origin"}).then(function(v){if(!v.ok)throw"failed to load wasm binary file at '"+S+"'";return v.arrayBuffer()}).catch(function(){return W()})}function re(v){for(;0<v.length;)v.shift()(s)}function ce(v){if(v===void 0)return"_unknown";v=v.replace(/[^a-zA-Z0-9_]/g,"$");var B=v.charCodeAt(0);return 48<=B&&57>=B?"_"+v:v}function pe(v,B){return v=ce(v),function(){return B.apply(this,arguments)}}var ge=[{},{value:void 0},{value:null},{value:!0},{value:!1}],Se=[];function Le(v){var B=Error,L=pe(v,function(N){this.name=v,this.message=N,N=Error(N).stack,N!==void 0&&(this.stack=this.toString()+`
|
67
|
+
`+N.replace(/^Error(:[^\n]*)?\n/,""))});return L.prototype=Object.create(B.prototype),L.prototype.constructor=L,L.prototype.toString=function(){return this.message===void 0?this.name:this.name+": "+this.message},L}var Ge=void 0;function fe(v){throw new Ge(v)}var Te=v=>(v||fe("Cannot use deleted val. handle = "+v),ge[v].value),Me=v=>{switch(v){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var B=Se.length?Se.pop():ge.length;return ge[B]={fa:1,value:v},B}},we=void 0,qe=void 0;function Be(v){for(var B="";T[v];)B+=qe[T[v++]];return B}var Q=[];function m(){for(;Q.length;){var v=Q.pop();v.L.Z=!1,v.delete()}}var E=void 0,w={};function M(v,B){for(B===void 0&&fe("ptr should not be undefined");v.P;)B=v.aa(B),v=v.P;return B}var z={};function j(v){v=vd(v);var B=Be(v);return Tr(v),B}function Ie(v,B){var L=z[v];return L===void 0&&fe(B+" has unknown type "+j(v)),L}function be(){}var De=!1;function ke(v){--v.count.value,v.count.value===0&&(v.S?v.T.V(v.S):v.O.M.V(v.N))}function _e(v,B,L){return B===L?v:L.P===void 0?null:(v=_e(v,B,L.P),v===null?null:L.ma(v))}var Ft={};function ct(v,B){return B=M(v,B),w[B]}var Nt=void 0;function dr(v){throw new Nt(v)}function fr(v,B){return B.O&&B.N||dr("makeClassHandle requires ptr and ptrType"),!!B.T!=!!B.S&&dr("Both smartPtrType and smartPtr must be specified"),B.count={value:1},Ct(Object.create(v,{L:{value:B}}))}function Ct(v){return typeof FinalizationRegistry>"u"?(Ct=B=>B,v):(De=new FinalizationRegistry(B=>{ke(B.L)}),Ct=B=>{var L=B.L;return L.S&&De.register(B,{L},B),B},be=B=>{De.unregister(B)},Ct(v))}var q={};function de(v){for(;v.length;){var B=v.pop();v.pop()(B)}}function Ce(v){return this.fromWireType(x[v>>2])}var Pe={},Fe={};function Xe(v,B,L){function N(se){se=L(se),se.length!==v.length&&dr("Mismatched type converter count");for(var Ae=0;Ae<v.length;++Ae)bt(v[Ae],se[Ae])}v.forEach(function(se){Fe[se]=B});var H=Array(B.length),Z=[],ie=0;B.forEach((se,Ae)=>{z.hasOwnProperty(se)?H[Ae]=z[se]:(Z.push(se),Pe.hasOwnProperty(se)||(Pe[se]=[]),Pe[se].push(()=>{H[Ae]=z[se],++ie,ie===Z.length&&N(H)}))}),Z.length===0&&N(H)}function Tt(v){switch(v){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+v)}}function bt(v,B,L={}){if(!("argPackAdvance"in B))throw new TypeError("registerType registeredInstance requires argPackAdvance");var N=B.name;if(v||fe('type "'+N+'" must have a positive integer typeid pointer'),z.hasOwnProperty(v)){if(L.ta)return;fe("Cannot register type '"+N+"' twice")}z[v]=B,delete Fe[v],Pe.hasOwnProperty(v)&&(B=Pe[v],delete Pe[v],B.forEach(H=>H()))}function Mn(v){fe(v.L.O.M.name+" instance already deleted")}function xt(){}function an(v,B,L){if(v[B].R===void 0){var N=v[B];v[B]=function(){return v[B].R.hasOwnProperty(arguments.length)||fe("Function '"+L+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+v[B].R+")!"),v[B].R[arguments.length].apply(this,arguments)},v[B].R=[],v[B].R[N.Y]=N}}function Pn(v,B){s.hasOwnProperty(v)?(fe("Cannot register public name '"+v+"' twice"),an(s,v,v),s.hasOwnProperty(void 0)&&fe("Cannot register multiple overloads of a function with the same number of arguments (undefined)!"),s[v].R[void 0]=B):s[v]=B}function kr(v,B,L,N,H,Z,ie,se){this.name=v,this.constructor=B,this.W=L,this.V=N,this.P=H,this.oa=Z,this.aa=ie,this.ma=se,this.ia=[]}function Bi(v,B,L){for(;B!==L;)B.aa||fe("Expected null or instance of "+L.name+", got an instance of "+B.name),v=B.aa(v),B=B.P;return v}function Qi(v,B){return B===null?(this.da&&fe("null is not a valid "+this.name),0):(B.L||fe('Cannot pass "'+ml(B)+'" as a '+this.name),B.L.N||fe("Cannot pass deleted object as a pointer of type "+this.name),Bi(B.L.N,B.L.O.M,this.M))}function On(v,B){if(B===null){if(this.da&&fe("null is not a valid "+this.name),this.ca){var L=this.ea();return v!==null&&v.push(this.V,L),L}return 0}if(B.L||fe('Cannot pass "'+ml(B)+'" as a '+this.name),B.L.N||fe("Cannot pass deleted object as a pointer of type "+this.name),!this.ba&&B.L.O.ba&&fe("Cannot convert argument of type "+(B.L.T?B.L.T.name:B.L.O.name)+" to parameter type "+this.name),L=Bi(B.L.N,B.L.O.M,this.M),this.ca)switch(B.L.S===void 0&&fe("Passing raw pointer to smart pointer is illegal"),this.Aa){case 0:B.L.T===this?L=B.L.S:fe("Cannot convert argument of type "+(B.L.T?B.L.T.name:B.L.O.name)+" to parameter type "+this.name);break;case 1:L=B.L.S;break;case 2:if(B.L.T===this)L=B.L.S;else{var N=B.clone();L=this.wa(L,Me(function(){N.delete()})),v!==null&&v.push(this.V,L)}break;default:fe("Unsupporting sharing policy")}return L}function MB(v,B){return B===null?(this.da&&fe("null is not a valid "+this.name),0):(B.L||fe('Cannot pass "'+ml(B)+'" as a '+this.name),B.L.N||fe("Cannot pass deleted object as a pointer of type "+this.name),B.L.O.ba&&fe("Cannot convert argument of type "+B.L.O.name+" to parameter type "+this.name),Bi(B.L.N,B.L.O.M,this.M))}function Qr(v,B,L,N){this.name=v,this.M=B,this.da=L,this.ba=N,this.ca=!1,this.V=this.wa=this.ea=this.ja=this.Aa=this.va=void 0,B.P!==void 0?this.toWireType=On:(this.toWireType=N?Qi:MB,this.U=null)}function PB(v,B){s.hasOwnProperty(v)||dr("Replacing nonexistant public symbol"),s[v]=B,s[v].Y=void 0}function OB(v,B){var L=[];return function(){if(L.length=0,Object.assign(L,arguments),v.includes("j")){var N=s["dynCall_"+v];N=L&&L.length?N.apply(null,[B].concat(L)):N.call(null,B)}else N=O.get(B).apply(null,L);return N}}function jt(v,B){v=Be(v);var L=v.includes("j")?OB(v,B):O.get(B);return typeof L!="function"&&fe("unknown function pointer with signature "+v+": "+B),L}var md=void 0;function Ks(v,B){function L(Z){H[Z]||z[Z]||(Fe[Z]?Fe[Z].forEach(L):(N.push(Z),H[Z]=!0))}var N=[],H={};throw B.forEach(L),new md(v+": "+N.map(j).join([", "]))}function fl(v,B,L,N,H){var Z=B.length;2>Z&&fe("argTypes array size mismatch! Must at least get return value and 'this' types!");var ie=B[1]!==null&&L!==null,se=!1;for(L=1;L<B.length;++L)if(B[L]!==null&&B[L].U===void 0){se=!0;break}var Ae=B[0].name!=="void",ae=Z-2,ue=Array(ae),ve=[],Ue=[];return function(){if(arguments.length!==ae&&fe("function "+v+" called with "+arguments.length+" arguments, expected "+ae+" args!"),Ue.length=0,ve.length=ie?2:1,ve[0]=H,ie){var lt=B[1].toWireType(Ue,this);ve[1]=lt}for(var Ye=0;Ye<ae;++Ye)ue[Ye]=B[Ye+2].toWireType(Ue,arguments[Ye]),ve.push(ue[Ye]);if(Ye=N.apply(null,ve),se)de(Ue);else for(var Mt=ie?1:2;Mt<B.length;Mt++){var zt=Mt===1?lt:ue[Mt-2];B[Mt].U!==null&&B[Mt].U(zt)}return lt=Ae?B[0].fromWireType(Ye):void 0,lt}}function gl(v,B){for(var L=[],N=0;N<v;N++)L.push(R[B+4*N>>2]);return L}function pl(v){4<v&&--ge[v].fa===0&&(ge[v]=void 0,Se.push(v))}function ml(v){if(v===null)return"null";var B=typeof v;return B==="object"||B==="array"||B==="function"?v.toString():""+v}function UB(v,B){switch(B){case 2:return function(L){return this.fromWireType(k[L>>2])};case 3:return function(L){return this.fromWireType($[L>>3])};default:throw new TypeError("Unknown float type: "+v)}}function GB(v,B,L){switch(B){case 0:return L?function(N){return C[N]}:function(N){return T[N]};case 1:return L?function(N){return b[N>>1]}:function(N){return y[N>>1]};case 2:return L?function(N){return x[N>>2]}:function(N){return R[N>>2]};default:throw new TypeError("Unknown integer type: "+v)}}function HB(v,B){for(var L="",N=0;!(N>=B/2);++N){var H=b[v+2*N>>1];if(H==0)break;L+=String.fromCharCode(H)}return L}function $B(v,B,L){if(L===void 0&&(L=2147483647),2>L)return 0;L-=2;var N=B;L=L<2*v.length?L/2:v.length;for(var H=0;H<L;++H)b[B>>1]=v.charCodeAt(H),B+=2;return b[B>>1]=0,B-N}function YB(v){return 2*v.length}function VB(v,B){for(var L=0,N="";!(L>=B/4);){var H=x[v+4*L>>2];if(H==0)break;++L,65536<=H?(H-=65536,N+=String.fromCharCode(55296|H>>10,56320|H&1023)):N+=String.fromCharCode(H)}return N}function KB(v,B,L){if(L===void 0&&(L=2147483647),4>L)return 0;var N=B;L=N+L-4;for(var H=0;H<v.length;++H){var Z=v.charCodeAt(H);if(55296<=Z&&57343>=Z){var ie=v.charCodeAt(++H);Z=65536+((Z&1023)<<10)|ie&1023}if(x[B>>2]=Z,B+=4,B+4>L)break}return x[B>>2]=0,B-N}function JB(v){for(var B=0,L=0;L<v.length;++L){var N=v.charCodeAt(L);55296<=N&&57343>=N&&++L,B+=4}return B}var WB={};function Ed(v){var B=WB[v];return B===void 0?Be(v):B}var Js=[];function qB(v){var B=Js.length;return Js.push(v),B}function XB(v,B){for(var L=Array(v),N=0;N<v;++N)L[N]=Ie(R[B+4*N>>2],"parameter "+N);return L}var Id=[],jB=[null,[],[]];Ge=s.BindingError=Le("BindingError"),s.count_emval_handles=function(){for(var v=0,B=5;B<ge.length;++B)ge[B]!==void 0&&++v;return v},s.get_first_emval=function(){for(var v=5;v<ge.length;++v)if(ge[v]!==void 0)return ge[v];return null},we=s.PureVirtualError=Le("PureVirtualError");for(var Cd=Array(256),Ws=0;256>Ws;++Ws)Cd[Ws]=String.fromCharCode(Ws);qe=Cd,s.getInheritedInstanceCount=function(){return Object.keys(w).length},s.getLiveInheritedInstances=function(){var v=[],B;for(B in w)w.hasOwnProperty(B)&&v.push(w[B]);return v},s.flushPendingDeletes=m,s.setDelayFunction=function(v){E=v,Q.length&&E&&E(m)},Nt=s.InternalError=Le("InternalError"),xt.prototype.isAliasOf=function(v){if(!(this instanceof xt&&v instanceof xt))return!1;var B=this.L.O.M,L=this.L.N,N=v.L.O.M;for(v=v.L.N;B.P;)L=B.aa(L),B=B.P;for(;N.P;)v=N.aa(v),N=N.P;return B===N&&L===v},xt.prototype.clone=function(){if(this.L.N||Mn(this),this.L.$)return this.L.count.value+=1,this;var v=Ct,B=Object,L=B.create,N=Object.getPrototypeOf(this),H=this.L;return v=v(L.call(B,N,{L:{value:{count:H.count,Z:H.Z,$:H.$,N:H.N,O:H.O,S:H.S,T:H.T}}})),v.L.count.value+=1,v.L.Z=!1,v},xt.prototype.delete=function(){this.L.N||Mn(this),this.L.Z&&!this.L.$&&fe("Object already scheduled for deletion"),be(this),ke(this.L),this.L.$||(this.L.S=void 0,this.L.N=void 0)},xt.prototype.isDeleted=function(){return!this.L.N},xt.prototype.deleteLater=function(){return this.L.N||Mn(this),this.L.Z&&!this.L.$&&fe("Object already scheduled for deletion"),Q.push(this),Q.length===1&&E&&E(m),this.L.Z=!0,this},Qr.prototype.pa=function(v){return this.ja&&(v=this.ja(v)),v},Qr.prototype.ga=function(v){this.V&&this.V(v)},Qr.prototype.argPackAdvance=8,Qr.prototype.readValueFromPointer=Ce,Qr.prototype.deleteObject=function(v){v!==null&&v.delete()},Qr.prototype.fromWireType=function(v){function B(){return this.ca?fr(this.M.W,{O:this.va,N:L,T:this,S:v}):fr(this.M.W,{O:this,N:v})}var L=this.pa(v);if(!L)return this.ga(v),null;var N=ct(this.M,L);if(N!==void 0)return N.L.count.value===0?(N.L.N=L,N.L.S=v,N.clone()):(N=N.clone(),this.ga(v),N);if(N=this.M.oa(L),N=Ft[N],!N)return B.call(this);N=this.ba?N.ka:N.pointerType;var H=_e(L,this.M,N.M);return H===null?B.call(this):this.ca?fr(N.M.W,{O:N,N:H,T:this,S:v}):fr(N.M.W,{O:N,N:H})},md=s.UnboundTypeError=Le("UnboundTypeError");var zB=typeof atob=="function"?atob:function(v){var B="",L=0;v=v.replace(/[^A-Za-z0-9\+\/=]/g,"");do{var N="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(v.charAt(L++)),H="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(v.charAt(L++)),Z="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(v.charAt(L++)),ie="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(v.charAt(L++));N=N<<2|H>>4,H=(H&15)<<4|Z>>2;var se=(Z&3)<<6|ie;B+=String.fromCharCode(N),Z!==64&&(B+=String.fromCharCode(H)),ie!==64&&(B+=String.fromCharCode(se))}while(L<v.length);return B},ZB={p:function(v,B,L){v=Be(v),B=Ie(B,"wrapper"),L=Te(L);var N=[].slice,H=B.M,Z=H.W,ie=H.P.W,se=H.P.constructor;v=pe(v,function(){H.P.ia.forEach((function(ae){if(this[ae]===ie[ae])throw new we("Pure virtual function "+ae+" must be implemented in JavaScript")}).bind(this)),Object.defineProperty(this,"__parent",{value:Z}),this.__construct.apply(this,N.call(arguments))}),Z.__construct=function(){this===Z&&fe("Pass correct 'this' to __construct");var ae=se.implement.apply(void 0,[this].concat(N.call(arguments)));be(ae);var ue=ae.L;ae.notifyOnDestruction(),ue.$=!0,Object.defineProperties(this,{L:{value:ue}}),Ct(this),ae=ue.N,ae=M(H,ae),w.hasOwnProperty(ae)?fe("Tried to register registered instance: "+ae):w[ae]=this},Z.__destruct=function(){this===Z&&fe("Pass correct 'this' to __destruct"),be(this);var ae=this.L.N;ae=M(H,ae),w.hasOwnProperty(ae)?delete w[ae]:fe("Tried to unregister unregistered instance: "+ae)},v.prototype=Object.create(Z);for(var Ae in L)v.prototype[Ae]=L[Ae];return Me(v)},j:function(v){var B=q[v];delete q[v];var L=B.ea,N=B.V,H=B.ha,Z=H.map(ie=>ie.sa).concat(H.map(ie=>ie.ya));Xe([v],Z,ie=>{var se={};return H.forEach((Ae,ae)=>{var ue=ie[ae],ve=Ae.qa,Ue=Ae.ra,lt=ie[ae+H.length],Ye=Ae.xa,Mt=Ae.za;se[Ae.na]={read:zt=>ue.fromWireType(ve(Ue,zt)),write:(zt,Ti)=>{var br=[];Ye(Mt,zt,lt.toWireType(br,Ti)),de(br)}}}),[{name:B.name,fromWireType:function(Ae){var ae={},ue;for(ue in se)ae[ue]=se[ue].read(Ae);return N(Ae),ae},toWireType:function(Ae,ae){for(var ue in se)if(!(ue in ae))throw new TypeError('Missing field: "'+ue+'"');var ve=L();for(ue in se)se[ue].write(ve,ae[ue]);return Ae!==null&&Ae.push(N,ve),ve},argPackAdvance:8,readValueFromPointer:Ce,U:N}]})},v:function(){},B:function(v,B,L,N,H){var Z=Tt(L);B=Be(B),bt(v,{name:B,fromWireType:function(ie){return!!ie},toWireType:function(ie,se){return se?N:H},argPackAdvance:8,readValueFromPointer:function(ie){if(L===1)var se=C;else if(L===2)se=b;else if(L===4)se=x;else throw new TypeError("Unknown boolean type size: "+B);return this.fromWireType(se[ie>>Z])},U:null})},f:function(v,B,L,N,H,Z,ie,se,Ae,ae,ue,ve,Ue){ue=Be(ue),Z=jt(H,Z),se&&(se=jt(ie,se)),ae&&(ae=jt(Ae,ae)),Ue=jt(ve,Ue);var lt=ce(ue);Pn(lt,function(){Ks("Cannot construct "+ue+" due to unbound types",[N])}),Xe([v,B,L],N?[N]:[],function(Ye){if(Ye=Ye[0],N)var Mt=Ye.M,zt=Mt.W;else zt=xt.prototype;Ye=pe(lt,function(){if(Object.getPrototypeOf(this)!==Ti)throw new Ge("Use 'new' to construct "+ue);if(br.X===void 0)throw new Ge(ue+" has no accessible constructor");var Qd=br.X[arguments.length];if(Qd===void 0)throw new Ge("Tried to invoke ctor of "+ue+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(br.X).toString()+") parameters instead!");return Qd.apply(this,arguments)});var Ti=Object.create(zt,{constructor:{value:Ye}});Ye.prototype=Ti;var br=new kr(ue,Ye,Ti,Ue,Mt,Z,se,ae);Mt=new Qr(ue,br,!0,!1),zt=new Qr(ue+"*",br,!1,!1);var Bd=new Qr(ue+" const*",br,!1,!0);return Ft[v]={pointerType:zt,ka:Bd},PB(lt,Ye),[Mt,zt,Bd]})},c:function(v,B,L,N,H,Z,ie){var se=gl(L,N);B=Be(B),Z=jt(H,Z),Xe([],[v],function(Ae){function ae(){Ks("Cannot call "+ue+" due to unbound types",se)}Ae=Ae[0];var ue=Ae.name+"."+B;B.startsWith("@@")&&(B=Symbol[B.substring(2)]);var ve=Ae.M.constructor;return ve[B]===void 0?(ae.Y=L-1,ve[B]=ae):(an(ve,B,ue),ve[B].R[L-1]=ae),Xe([],se,function(Ue){return Ue=fl(ue,[Ue[0],null].concat(Ue.slice(1)),null,Z,ie),ve[B].R===void 0?(Ue.Y=L-1,ve[B]=Ue):ve[B].R[L-1]=Ue,[]}),[]})},o:function(v,B,L,N,H,Z){0<B||X();var ie=gl(B,L);H=jt(N,H),Xe([],[v],function(se){se=se[0];var Ae="constructor "+se.name;if(se.M.X===void 0&&(se.M.X=[]),se.M.X[B-1]!==void 0)throw new Ge("Cannot register multiple constructors with identical number of parameters ("+(B-1)+") for class '"+se.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return se.M.X[B-1]=()=>{Ks("Cannot construct "+se.name+" due to unbound types",ie)},Xe([],ie,function(ae){return ae.splice(1,0,null),se.M.X[B-1]=fl(Ae,ae,null,H,Z),[]}),[]})},a:function(v,B,L,N,H,Z,ie,se){var Ae=gl(L,N);B=Be(B),Z=jt(H,Z),Xe([],[v],function(ae){function ue(){Ks("Cannot call "+ve+" due to unbound types",Ae)}ae=ae[0];var ve=ae.name+"."+B;B.startsWith("@@")&&(B=Symbol[B.substring(2)]),se&&ae.M.ia.push(B);var Ue=ae.M.W,lt=Ue[B];return lt===void 0||lt.R===void 0&<.className!==ae.name&<.Y===L-2?(ue.Y=L-2,ue.className=ae.name,Ue[B]=ue):(an(Ue,B,ve),Ue[B].R[L-2]=ue),Xe([],Ae,function(Ye){return Ye=fl(ve,Ye,ae,Z,ie),Ue[B].R===void 0?(Ye.Y=L-2,Ue[B]=Ye):Ue[B].R[L-2]=Ye,[]}),[]})},A:function(v,B){B=Be(B),bt(v,{name:B,fromWireType:function(L){var N=Te(L);return pl(L),N},toWireType:function(L,N){return Me(N)},argPackAdvance:8,readValueFromPointer:Ce,U:null})},m:function(v,B,L){L=Tt(L),B=Be(B),bt(v,{name:B,fromWireType:function(N){return N},toWireType:function(N,H){return H},argPackAdvance:8,readValueFromPointer:UB(B,L),U:null})},d:function(v,B,L,N,H){B=Be(B),H===-1&&(H=4294967295),H=Tt(L);var Z=se=>se;if(N===0){var ie=32-8*L;Z=se=>se<<ie>>>ie}L=B.includes("unsigned")?function(se,Ae){return Ae>>>0}:function(se,Ae){return Ae},bt(v,{name:B,fromWireType:Z,toWireType:L,argPackAdvance:8,readValueFromPointer:GB(B,H,N!==0),U:null})},b:function(v,B,L){function N(Z){Z>>=2;var ie=R;return new H(p,ie[Z+1],ie[Z])}var H=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][B];L=Be(L),bt(v,{name:L,fromWireType:N,argPackAdvance:8,readValueFromPointer:N},{ta:!0})},n:function(v,B){B=Be(B);var L=B==="std::string";bt(v,{name:B,fromWireType:function(N){var H=R[N>>2],Z=N+4;if(L)for(var ie=Z,se=0;se<=H;++se){var Ae=Z+se;if(se==H||T[Ae]==0){if(ie=ie?g(T,ie,Ae-ie):"",ae===void 0)var ae=ie;else ae+="\0",ae+=ie;ie=Ae+1}}else{for(ae=Array(H),se=0;se<H;++se)ae[se]=String.fromCharCode(T[Z+se]);ae=ae.join("")}return Tr(N),ae},toWireType:function(N,H){H instanceof ArrayBuffer&&(H=new Uint8Array(H));var Z,ie=typeof H=="string";if(ie||H instanceof Uint8Array||H instanceof Uint8ClampedArray||H instanceof Int8Array||fe("Cannot pass non-string to std::string"),L&&ie){var se=0;for(Z=0;Z<H.length;++Z){var Ae=H.charCodeAt(Z);127>=Ae?se++:2047>=Ae?se+=2:55296<=Ae&&57343>=Ae?(se+=4,++Z):se+=3}Z=se}else Z=H.length;if(se=El(4+Z+1),Ae=se+4,R[se>>2]=Z,L&&ie){if(ie=Ae,Ae=Z+1,Z=T,0<Ae){Ae=ie+Ae-1;for(var ae=0;ae<H.length;++ae){var ue=H.charCodeAt(ae);if(55296<=ue&&57343>=ue){var ve=H.charCodeAt(++ae);ue=65536+((ue&1023)<<10)|ve&1023}if(127>=ue){if(ie>=Ae)break;Z[ie++]=ue}else{if(2047>=ue){if(ie+1>=Ae)break;Z[ie++]=192|ue>>6}else{if(65535>=ue){if(ie+2>=Ae)break;Z[ie++]=224|ue>>12}else{if(ie+3>=Ae)break;Z[ie++]=240|ue>>18,Z[ie++]=128|ue>>12&63}Z[ie++]=128|ue>>6&63}Z[ie++]=128|ue&63}}Z[ie]=0}}else if(ie)for(ie=0;ie<Z;++ie)ae=H.charCodeAt(ie),255<ae&&(Tr(Ae),fe("String has UTF-16 code units that do not fit in 8 bits")),T[Ae+ie]=ae;else for(ie=0;ie<Z;++ie)T[Ae+ie]=H[ie];return N!==null&&N.push(Tr,se),se},argPackAdvance:8,readValueFromPointer:Ce,U:function(N){Tr(N)}})},i:function(v,B,L){if(L=Be(L),B===2)var N=HB,H=$B,Z=YB,ie=()=>y,se=1;else B===4&&(N=VB,H=KB,Z=JB,ie=()=>R,se=2);bt(v,{name:L,fromWireType:function(Ae){for(var ae=R[Ae>>2],ue=ie(),ve,Ue=Ae+4,lt=0;lt<=ae;++lt){var Ye=Ae+4+lt*B;(lt==ae||ue[Ye>>se]==0)&&(Ue=N(Ue,Ye-Ue),ve===void 0?ve=Ue:(ve+="\0",ve+=Ue),Ue=Ye+B)}return Tr(Ae),ve},toWireType:function(Ae,ae){typeof ae!="string"&&fe("Cannot pass non-string to C++ string type "+L);var ue=Z(ae),ve=El(4+ue+B);return R[ve>>2]=ue>>se,H(ae,ve+4,ue+B),Ae!==null&&Ae.push(Tr,ve),ve},argPackAdvance:8,readValueFromPointer:Ce,U:function(Ae){Tr(Ae)}})},k:function(v,B,L,N,H,Z){q[v]={name:Be(B),ea:jt(L,N),V:jt(H,Z),ha:[]}},h:function(v,B,L,N,H,Z,ie,se,Ae,ae){q[v].ha.push({na:Be(B),sa:L,qa:jt(N,H),ra:Z,ya:ie,xa:jt(se,Ae),za:ae})},C:function(v,B){B=Be(B),bt(v,{ua:!0,name:B,argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})},s:function(v,B,L,N,H){v=Js[v],B=Te(B),L=Ed(L);var Z=[];return R[N>>2]=Me(Z),v(B,L,Z,H)},t:function(v,B,L,N){v=Js[v],B=Te(B),L=Ed(L),v(B,L,null,N)},g:pl,l:function(v,B){var L=XB(v,B),N=L[0];B=N.name+"_$"+L.slice(1).map(function(ie){return ie.name}).join("_")+"$";var H=Id[B];if(H!==void 0)return H;var Z=Array(v-1);return H=qB((ie,se,Ae,ae)=>{for(var ue=0,ve=0;ve<v-1;++ve)Z[ve]=L[ve+1].readValueFromPointer(ae+ue),ue+=L[ve+1].argPackAdvance;for(ie=ie[se].apply(ie,Z),ve=0;ve<v-1;++ve)L[ve+1].la&&L[ve+1].la(Z[ve]);if(!N.ua)return N.toWireType(Ae,ie)}),Id[B]=H},q:function(v){4<v&&(ge[v].fa+=1)},r:function(v){var B=Te(v);de(B),pl(v)},e:function(){X("")},x:function(v,B,L){T.copyWithin(v,B,B+L)},w:function(v){var B=T.length;if(v>>>=0,2147483648<v)return!1;for(var L=1;4>=L;L*=2){var N=B*(1+.2/L);N=Math.min(N,v+100663296);var H=Math;N=Math.max(v,N),H=H.min.call(H,2147483648,N+(65536-N%65536)%65536);e:{try{d.grow(H-p.byteLength+65535>>>16),V();var Z=1;break e}catch{}Z=void 0}if(Z)return!0}return!1},z:function(){return 52},u:function(){return 70},y:function(v,B,L,N){for(var H=0,Z=0;Z<L;Z++){var ie=R[B>>2],se=R[B+4>>2];B+=8;for(var Ae=0;Ae<se;Ae++){var ae=T[ie+Ae],ue=jB[v];ae===0||ae===10?((v===1?c:u)(g(ue,0)),ue.length=0):ue.push(ae)}H+=se}return R[N>>2]=H,0}};(function(){function v(H){s.asm=H.exports,d=s.asm.D,V(),O=s.asm.I,ne.unshift(s.asm.E),D--,s.monitorRunDependencies&&s.monitorRunDependencies(D),D==0&&P&&(H=P,P=null,H())}function B(H){v(H.instance)}function L(H){return Y().then(function(Z){return WebAssembly.instantiate(Z,N)}).then(function(Z){return Z}).then(H,function(Z){u("failed to asynchronously prepare wasm: "+Z),X(Z)})}var N={a:ZB};if(D++,s.monitorRunDependencies&&s.monitorRunDependencies(D),s.instantiateWasm)try{return s.instantiateWasm(N,v)}catch(H){u("Module.instantiateWasm callback failed with error: "+H),a(H)}return function(){return h||typeof WebAssembly.instantiateStreaming!="function"||_(S)||typeof fetch!="function"?L(B):fetch(S,{credentials:"same-origin"}).then(function(H){return WebAssembly.instantiateStreaming(H,N).then(B,function(Z){return u("wasm streaming compile failed: "+Z),u("falling back to ArrayBuffer instantiation"),L(B)})})}().catch(a),{}})(),s.___wasm_call_ctors=function(){return(s.___wasm_call_ctors=s.asm.E).apply(null,arguments)};var vd=s.___getTypeName=function(){return(vd=s.___getTypeName=s.asm.F).apply(null,arguments)};s.__embind_initialize_bindings=function(){return(s.__embind_initialize_bindings=s.asm.G).apply(null,arguments)};var El=s._malloc=function(){return(El=s._malloc=s.asm.H).apply(null,arguments)},Tr=s._free=function(){return(Tr=s._free=s.asm.J).apply(null,arguments)};s.dynCall_jiji=function(){return(s.dynCall_jiji=s.asm.K).apply(null,arguments)};var qs;P=function v(){qs||yd(),qs||(P=v)};function yd(){function v(){if(!qs&&(qs=!0,s.calledRun=!0,!f)){if(re(ne),o(s),s.onRuntimeInitialized&&s.onRuntimeInitialized(),s.postRun)for(typeof s.postRun=="function"&&(s.postRun=[s.postRun]);s.postRun.length;){var B=s.postRun.shift();ee.unshift(B)}re(ee)}}if(!(0<D)){if(s.preRun)for(typeof s.preRun=="function"&&(s.preRun=[s.preRun]);s.preRun.length;)le();re(J),0<D||(s.setStatus?(s.setStatus("Running..."),setTimeout(function(){setTimeout(function(){s.setStatus("")},1),v()},1)):v())}}if(s.preInit)for(typeof s.preInit=="function"&&(s.preInit=[s.preInit]);0<s.preInit.length;)s.preInit.pop()();return yd(),i.ready}})();r.exports=t})(ql);var Ff=ql.exports;(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e={loadYoga:!0};r.loadYoga=o;var t=i(Ao),n=Re;Object.keys(n).forEach(function(a){a==="default"||a==="__esModule"||Object.prototype.hasOwnProperty.call(e,a)||a in r&&r[a]===n[a]||Object.defineProperty(r,a,{enumerable:!0,get:function(){return n[a]}})});function i(a){return a&&a.__esModule?a:{default:a}}const s=Ff;async function o(){return(0,t.default)(await s())}})(Jl);function kf(r){for(var e=new Array(r),t=0;t<r;++t)e[t]=t;return e}var Nf=kf;/*!
|
68
68
|
* Determine if an object is a Buffer
|
69
69
|
*
|
70
70
|
* @author Feross Aboukhadijeh <https://feross.org>
|
71
71
|
* @license MIT
|
72
|
-
*/var Mf=function(r){return r!=null&&(
|
73
|
-
`));return g(Hi[r],$f)}function Vf(r){if(Uf(r))return"buffer";if(Gf)switch(Object.prototype.toString.call(r)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object Uint8ClampedArray]":return"uint8_clamped";case"[object BigInt64Array]":return"bigint64";case"[object BigUint64Array]":return"biguint64"}return Array.isArray(r)?"array":"generic"}var Hi={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],bigint64:[],biguint64:[],buffer:[],generic:[]};function Kf(r,e,t,n){if(r===void 0){var
|
74
|
-
`)}function Zf(r,e,t,n){for(var i=e.length,s=t.arrayArgs.length,o=t.blockSize,a=t.indexArgs.length>0,
|
75
|
-
`)}function eg(r){for(var e=0,t=r[0].length;e<t;){for(var n=1;n<r.length;++n)if(r[n][e]!==r[0][e])return e;++e}return e}function fo(r,e,t){for(var n=r.body,i=[],s=[],o=0;o<r.args.length;++o){var a=r.args[o];if(!(a.count<=0)){var
|
72
|
+
*/var Mf=function(r){return r!=null&&(Xl(r)||Pf(r)||!!r._isBuffer)};function Xl(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function Pf(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&Xl(r.slice(0,0))}var Of=Nf,Uf=Mf,Gf=typeof Float64Array<"u";function Hf(r,e){return r[0]-e[0]}function $f(){var r=this.stride,e=new Array(r.length),t;for(t=0;t<e.length;++t)e[t]=[Math.abs(r[t]),t];e.sort(Hf);var n=new Array(e.length);for(t=0;t<n.length;++t)n[t]=e[t][1];return n}function Yf(r,e){var t=["View",e,"d",r].join("");e<0&&(t="View_Nil"+r);var n=r==="generic";if(e===-1){var i="function "+t+"(a){this.data=a;};var proto="+t+".prototype;proto.dtype='"+r+"';proto.index=function(){return -1};proto.size=0;proto.dimension=-1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function(){return new "+t+"(this.data);};proto.get=proto.set=function(){};proto.pick=function(){return null};return function construct_"+t+"(a){return new "+t+"(a);}",g=new Function(i);return g()}else if(e===0){var i="function "+t+"(a,d) {this.data = a;this.offset = d};var proto="+t+".prototype;proto.dtype='"+r+"';proto.index=function(){return this.offset};proto.dimension=0;proto.size=1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function "+t+"_copy() {return new "+t+"(this.data,this.offset)};proto.pick=function "+t+"_pick(){return TrivialArray(this.data);};proto.valueOf=proto.get=function "+t+"_get(){return "+(n?"this.data.get(this.offset)":"this.data[this.offset]")+"};proto.set=function "+t+"_set(v){return "+(n?"this.data.set(this.offset,v)":"this.data[this.offset]=v")+"};return function construct_"+t+"(a,b,c,d){return new "+t+"(a,d)}",g=new Function("TrivialArray",i);return g(Hi[r][0])}var i=["'use strict'"],s=Of(e),o=s.map(function(p){return"i"+p}),a="this.offset+"+s.map(function(p){return"this.stride["+p+"]*i"+p}).join("+"),l=s.map(function(p){return"b"+p}).join(","),A=s.map(function(p){return"c"+p}).join(",");i.push("function "+t+"(a,"+l+","+A+",d){this.data=a","this.shape=["+l+"]","this.stride=["+A+"]","this.offset=d|0}","var proto="+t+".prototype","proto.dtype='"+r+"'","proto.dimension="+e),i.push("Object.defineProperty(proto,'size',{get:function "+t+"_size(){return "+s.map(function(p){return"this.shape["+p+"]"}).join("*"),"}})"),e===1?i.push("proto.order=[0]"):(i.push("Object.defineProperty(proto,'order',{get:"),e<4?(i.push("function "+t+"_order(){"),e===2?i.push("return (Math.abs(this.stride[0])>Math.abs(this.stride[1]))?[1,0]:[0,1]}})"):e===3&&i.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):i.push("ORDER})")),i.push("proto.set=function "+t+"_set("+o.join(",")+",v){"),n?i.push("return this.data.set("+a+",v)}"):i.push("return this.data["+a+"]=v}"),i.push("proto.get=function "+t+"_get("+o.join(",")+"){"),n?i.push("return this.data.get("+a+")}"):i.push("return this.data["+a+"]}"),i.push("proto.index=function "+t+"_index(",o.join(),"){return "+a+"}"),i.push("proto.hi=function "+t+"_hi("+o.join(",")+"){return new "+t+"(this.data,"+s.map(function(p){return["(typeof i",p,"!=='number'||i",p,"<0)?this.shape[",p,"]:i",p,"|0"].join("")}).join(",")+","+s.map(function(p){return"this.stride["+p+"]"}).join(",")+",this.offset)}");var c=s.map(function(p){return"a"+p+"=this.shape["+p+"]"}),u=s.map(function(p){return"c"+p+"=this.stride["+p+"]"});i.push("proto.lo=function "+t+"_lo("+o.join(",")+"){var b=this.offset,d=0,"+c.join(",")+","+u.join(","));for(var h=0;h<e;++h)i.push("if(typeof i"+h+"==='number'&&i"+h+">=0){d=i"+h+"|0;b+=c"+h+"*d;a"+h+"-=d}");i.push("return new "+t+"(this.data,"+s.map(function(p){return"a"+p}).join(",")+","+s.map(function(p){return"c"+p}).join(",")+",b)}"),i.push("proto.step=function "+t+"_step("+o.join(",")+"){var "+s.map(function(p){return"a"+p+"=this.shape["+p+"]"}).join(",")+","+s.map(function(p){return"b"+p+"=this.stride["+p+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(var h=0;h<e;++h)i.push("if(typeof i"+h+"==='number'){d=i"+h+"|0;if(d<0){c+=b"+h+"*(a"+h+"-1);a"+h+"=ceil(-a"+h+"/d)}else{a"+h+"=ceil(a"+h+"/d)}b"+h+"*=d}");i.push("return new "+t+"(this.data,"+s.map(function(p){return"a"+p}).join(",")+","+s.map(function(p){return"b"+p}).join(",")+",c)}");for(var d=new Array(e),f=new Array(e),h=0;h<e;++h)d[h]="a[i"+h+"]",f[h]="b[i"+h+"]";i.push("proto.transpose=function "+t+"_transpose("+o+"){"+o.map(function(p,C){return p+"=("+p+"===undefined?"+C+":"+p+"|0)"}).join(";"),"var a=this.shape,b=this.stride;return new "+t+"(this.data,"+d.join(",")+","+f.join(",")+",this.offset)}"),i.push("proto.pick=function "+t+"_pick("+o+"){var a=[],b=[],c=this.offset");for(var h=0;h<e;++h)i.push("if(typeof i"+h+"==='number'&&i"+h+">=0){c=(c+this.stride["+h+"]*i"+h+")|0}else{a.push(this.shape["+h+"]);b.push(this.stride["+h+"])}");i.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),i.push("return function construct_"+t+"(data,shape,stride,offset){return new "+t+"(data,"+s.map(function(p){return"shape["+p+"]"}).join(",")+","+s.map(function(p){return"stride["+p+"]"}).join(",")+",offset)}");var g=new Function("CTOR_LIST","ORDER",i.join(`
|
73
|
+
`));return g(Hi[r],$f)}function Vf(r){if(Uf(r))return"buffer";if(Gf)switch(Object.prototype.toString.call(r)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object Uint8ClampedArray]":return"uint8_clamped";case"[object BigInt64Array]":return"bigint64";case"[object BigUint64Array]":return"biguint64"}return Array.isArray(r)?"array":"generic"}var Hi={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],bigint64:[],biguint64:[],buffer:[],generic:[]};function Kf(r,e,t,n){if(r===void 0){var A=Hi.array[0];return A([])}else typeof r=="number"&&(r=[r]);e===void 0&&(e=[r.length]);var i=e.length;if(t===void 0){t=new Array(i);for(var s=i-1,o=1;s>=0;--s)t[s]=o,o*=e[s]}if(n===void 0){n=0;for(var s=0;s<i;++s)t[s]<0&&(n-=(e[s]-1)*t[s])}for(var a=Vf(r),l=Hi[a];l.length<=i+1;)l.push(Yf(a,l.length-1));var A=l[i+1];return A(r,e,t,n)}var Jf=Kf,jl={};function Wf(r,e){for(var t=1,n=r.length,i=r[0],s=r[0],o=1;o<n;++o)if(s=i,i=r[o],e(i,s)){if(o===t){t++;continue}r[t++]=i}return r.length=t,r}function qf(r){for(var e=1,t=r.length,n=r[0],i=r[0],s=1;s<t;++s,i=n)if(i=n,n=r[s],n!==i){if(s===e){e++;continue}r[e++]=n}return r.length=e,r}function Xf(r,e,t){return r.length===0?r:e?(t||r.sort(e),Wf(r,e)):(t||r.sort(),qf(r))}var jf=Xf,zf=jf;function zl(r,e,t){var n=r.length,i=e.arrayArgs.length,s=e.indexArgs.length>0,o=[],a=[],l=0,A=0,c,u;for(c=0;c<n;++c)a.push(["i",c,"=0"].join(""));for(u=0;u<i;++u)for(c=0;c<n;++c)A=l,l=r[c],c===0?a.push(["d",u,"s",c,"=t",u,"p",l].join("")):a.push(["d",u,"s",c,"=(t",u,"p",l,"-s",A,"*t",u,"p",A,")"].join(""));for(a.length>0&&o.push("var "+a.join(",")),c=n-1;c>=0;--c)l=r[c],o.push(["for(i",c,"=0;i",c,"<s",l,";++i",c,"){"].join(""));for(o.push(t),c=0;c<n;++c){for(A=l,l=r[c],u=0;u<i;++u)o.push(["p",u,"+=d",u,"s",c].join(""));s&&(c>0&&o.push(["index[",A,"]-=s",A].join("")),o.push(["++index[",l,"]"].join(""))),o.push("}")}return o.join(`
|
74
|
+
`)}function Zf(r,e,t,n){for(var i=e.length,s=t.arrayArgs.length,o=t.blockSize,a=t.indexArgs.length>0,l=[],A=0;A<s;++A)l.push(["var offset",A,"=p",A].join(""));for(var A=r;A<i;++A)l.push(["for(var j"+A+"=SS[",e[A],"]|0;j",A,">0;){"].join("")),l.push(["if(j",A,"<",o,"){"].join("")),l.push(["s",e[A],"=j",A].join("")),l.push(["j",A,"=0"].join("")),l.push(["}else{s",e[A],"=",o].join("")),l.push(["j",A,"-=",o,"}"].join("")),a&&l.push(["index[",e[A],"]=j",A].join(""));for(var A=0;A<s;++A){for(var c=["offset"+A],u=r;u<i;++u)c.push(["j",u,"*t",A,"p",e[u]].join(""));l.push(["p",A,"=(",c.join("+"),")"].join(""))}l.push(zl(e,t,n));for(var A=r;A<i;++A)l.push("}");return l.join(`
|
75
|
+
`)}function eg(r){for(var e=0,t=r[0].length;e<t;){for(var n=1;n<r.length;++n)if(r[n][e]!==r[0][e])return e;++e}return e}function fo(r,e,t){for(var n=r.body,i=[],s=[],o=0;o<r.args.length;++o){var a=r.args[o];if(!(a.count<=0)){var l=new RegExp(a.name,"g"),A="",c=e.arrayArgs.indexOf(o);switch(e.argTypes[o]){case"offset":var u=e.offsetArgIndex.indexOf(o),h=e.offsetArgs[u];c=h.array,A="+q"+u;case"array":A="p"+c+A;var d="l"+o,f="a"+c;if(e.arrayBlockIndices[c]===0)a.count===1?t[c]==="generic"?a.lvalue?(i.push(["var ",d,"=",f,".get(",A,")"].join("")),n=n.replace(l,d),s.push([f,".set(",A,",",d,")"].join(""))):n=n.replace(l,[f,".get(",A,")"].join("")):n=n.replace(l,[f,"[",A,"]"].join("")):t[c]==="generic"?(i.push(["var ",d,"=",f,".get(",A,")"].join("")),n=n.replace(l,d),a.lvalue&&s.push([f,".set(",A,",",d,")"].join(""))):(i.push(["var ",d,"=",f,"[",A,"]"].join("")),n=n.replace(l,d),a.lvalue&&s.push([f,"[",A,"]=",d].join("")));else{for(var g=[a.name],p=[A],C=0;C<Math.abs(e.arrayBlockIndices[c]);C++)g.push("\\s*\\[([^\\]]+)\\]"),p.push("$"+(C+1)+"*t"+c+"b"+C);if(l=new RegExp(g.join(""),"g"),A=p.join("+"),t[c]==="generic")throw new Error("cwise: Generic arrays not supported in combination with blocks!");n=n.replace(l,[f,"[",A,"]"].join(""))}break;case"scalar":n=n.replace(l,"Y"+e.scalarArgs.indexOf(o));break;case"index":n=n.replace(l,"index");break;case"shape":n=n.replace(l,"shape");break}}}return[i.join(`
|
76
76
|
`),n,s.join(`
|
77
77
|
`)].join(`
|
78
|
-
`).trim()}function tg(r){for(var e=new Array(r.length),t=!0,n=0;n<r.length;++n){var i=r[n],s=i.match(/\d+/);s?s=s[0]:s="",i.charAt(0)===0?e[n]="u"+i.charAt(1)+s:e[n]=i.charAt(0)+s,n>0&&(t=t&&e[n]===e[n-1])}return t?e[0]:e.join("")}function rg(r,e){for(var t=e[1].length-Math.abs(r.arrayBlockIndices[0])|0,n=new Array(r.arrayArgs.length),i=new Array(r.arrayArgs.length),s=0;s<r.arrayArgs.length;++s)i[s]=e[2*s],n[s]=e[2*s+1];for(var o=[],a=[],
|
78
|
+
`).trim()}function tg(r){for(var e=new Array(r.length),t=!0,n=0;n<r.length;++n){var i=r[n],s=i.match(/\d+/);s?s=s[0]:s="",i.charAt(0)===0?e[n]="u"+i.charAt(1)+s:e[n]=i.charAt(0)+s,n>0&&(t=t&&e[n]===e[n-1])}return t?e[0]:e.join("")}function rg(r,e){for(var t=e[1].length-Math.abs(r.arrayBlockIndices[0])|0,n=new Array(r.arrayArgs.length),i=new Array(r.arrayArgs.length),s=0;s<r.arrayArgs.length;++s)i[s]=e[2*s],n[s]=e[2*s+1];for(var o=[],a=[],l=[],A=[],c=[],s=0;s<r.arrayArgs.length;++s){r.arrayBlockIndices[s]<0?(l.push(0),A.push(t),o.push(t),a.push(t+r.arrayBlockIndices[s])):(l.push(r.arrayBlockIndices[s]),A.push(r.arrayBlockIndices[s]+t),o.push(0),a.push(r.arrayBlockIndices[s]));for(var u=[],h=0;h<n[s].length;h++)l[s]<=n[s][h]&&n[s][h]<A[s]&&u.push(n[s][h]-l[s]);c.push(u)}for(var d=["SS"],f=["'use strict'"],g=[],h=0;h<t;++h)g.push(["s",h,"=SS[",h,"]"].join(""));for(var s=0;s<r.arrayArgs.length;++s){d.push("a"+s),d.push("t"+s),d.push("p"+s);for(var h=0;h<t;++h)g.push(["t",s,"p",h,"=t",s,"[",l[s]+h,"]"].join(""));for(var h=0;h<Math.abs(r.arrayBlockIndices[s]);++h)g.push(["t",s,"b",h,"=t",s,"[",o[s]+h,"]"].join(""))}for(var s=0;s<r.scalarArgs.length;++s)d.push("Y"+s);if(r.shapeArgs.length>0&&g.push("shape=SS.slice(0)"),r.indexArgs.length>0){for(var p=new Array(t),s=0;s<t;++s)p[s]="0";g.push(["index=[",p.join(","),"]"].join(""))}for(var s=0;s<r.offsetArgs.length;++s){for(var C=r.offsetArgs[s],T=[],h=0;h<C.offset.length;++h)C.offset[h]!==0&&(C.offset[h]===1?T.push(["t",C.array,"p",h].join("")):T.push([C.offset[h],"*t",C.array,"p",h].join("")));T.length===0?g.push("q"+s+"=0"):g.push(["q",s,"=",T.join("+")].join(""))}var b=zf([].concat(r.pre.thisVars).concat(r.body.thisVars).concat(r.post.thisVars));g=g.concat(b),g.length>0&&f.push("var "+g.join(","));for(var s=0;s<r.arrayArgs.length;++s)f.push("p"+s+"|=0");r.pre.body.length>3&&f.push(fo(r.pre,r,i));var y=fo(r.body,r,i),x=eg(c);x<t?f.push(Zf(x,c[0],r,y)):f.push(zl(c[0],r,y)),r.post.body.length>3&&f.push(fo(r.post,r,i)),r.debug&&console.log("-----Generated cwise routine for ",e,`:
|
79
79
|
`+f.join(`
|
80
80
|
`)+`
|
81
|
-
----------`);var R=[r.funcName||"unnamed","_cwise_loop_",n[0].join("s"),"m",
|
82
|
-
`),"} return ",R].join(""));return k()}var ng=rg,ig=ng;function sg(r){var e=["'use strict'","var CACHED={}"],t=[],n=r.funcName+"_cwise_thunk";e.push(["return function ",n,"(",r.shimArgs.join(","),"){"].join(""));for(var i=[],s=[],o=[["array",r.arrayArgs[0],".shape.slice(",Math.max(0,r.arrayBlockIndices[0]),r.arrayBlockIndices[0]<0?","+r.arrayBlockIndices[0]+")":")"].join("")],a=[],
|
81
|
+
----------`);var R=[r.funcName||"unnamed","_cwise_loop_",n[0].join("s"),"m",x,tg(i)].join(""),k=new Function(["function ",R,"(",d.join(","),"){",f.join(`
|
82
|
+
`),"} return ",R].join(""));return k()}var ng=rg,ig=ng;function sg(r){var e=["'use strict'","var CACHED={}"],t=[],n=r.funcName+"_cwise_thunk";e.push(["return function ",n,"(",r.shimArgs.join(","),"){"].join(""));for(var i=[],s=[],o=[["array",r.arrayArgs[0],".shape.slice(",Math.max(0,r.arrayBlockIndices[0]),r.arrayBlockIndices[0]<0?","+r.arrayBlockIndices[0]+")":")"].join("")],a=[],l=[],A=0;A<r.arrayArgs.length;++A){var c=r.arrayArgs[A];t.push(["t",c,"=array",c,".dtype,","r",c,"=array",c,".order"].join("")),i.push("t"+c),i.push("r"+c),s.push("t"+c),s.push("r"+c+".join()"),o.push("array"+c+".data"),o.push("array"+c+".stride"),o.push("array"+c+".offset|0"),A>0&&(a.push("array"+r.arrayArgs[0]+".shape.length===array"+c+".shape.length+"+(Math.abs(r.arrayBlockIndices[0])-Math.abs(r.arrayBlockIndices[A]))),l.push("array"+r.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,r.arrayBlockIndices[0])+"]===array"+c+".shape[shapeIndex+"+Math.max(0,r.arrayBlockIndices[A])+"]"))}r.arrayArgs.length>1&&(e.push("if (!("+a.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),e.push("for(var shapeIndex=array"+r.arrayArgs[0]+".shape.length-"+Math.abs(r.arrayBlockIndices[0])+"; shapeIndex-->0;) {"),e.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),e.push("}"));for(var A=0;A<r.scalarArgs.length;++A)o.push("scalar"+r.scalarArgs[A]);t.push(["type=[",s.join(","),"].join()"].join("")),t.push("proc=CACHED[type]"),e.push("var "+t.join(",")),e.push(["if(!proc){","CACHED[type]=proc=compile([",i.join(","),"])}","return proc(",o.join(","),")}"].join("")),r.debug&&console.log(`-----Generated thunk:
|
83
83
|
`+e.join(`
|
84
84
|
`)+`
|
85
85
|
----------`);var u=new Function("compile",e.join(`
|
86
|
-
`));return u(ig.bind(void 0,r))}var og=sg,ag=og;function Ag(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1}function lg(r){var e=new Ag;e.pre=r.pre,e.body=r.body,e.post=r.post;var t=r.args.slice(0);e.argTypes=t;for(var n=0;n<t.length;++n){var i=t[n];if(i==="array"||typeof i=="object"&&i.blockIndices){if(e.argTypes[n]="array",e.arrayArgs.push(n),e.arrayBlockIndices.push(i.blockIndices?i.blockIndices:0),e.shimArgs.push("array"+n),n<e.pre.args.length&&e.pre.args[n].count>0)throw new Error("cwise: pre() block may not reference array args");if(n<e.post.args.length&&e.post.args[n].count>0)throw new Error("cwise: post() block may not reference array args")}else if(i==="scalar")e.scalarArgs.push(n),e.shimArgs.push("scalar"+n);else if(i==="index"){if(e.indexArgs.push(n),n<e.pre.args.length&&e.pre.args[n].count>0)throw new Error("cwise: pre() block may not reference array index");if(n<e.body.args.length&&e.body.args[n].lvalue)throw new Error("cwise: body() block may not write to array index");if(n<e.post.args.length&&e.post.args[n].count>0)throw new Error("cwise: post() block may not reference array index")}else if(i==="shape"){if(e.shapeArgs.push(n),n<e.pre.args.length&&e.pre.args[n].lvalue)throw new Error("cwise: pre() block may not write to array shape");if(n<e.body.args.length&&e.body.args[n].lvalue)throw new Error("cwise: body() block may not write to array shape");if(n<e.post.args.length&&e.post.args[n].lvalue)throw new Error("cwise: post() block may not write to array shape")}else if(typeof i=="object"&&i.offset)e.argTypes[n]="offset",e.offsetArgs.push({array:i.array,offset:i.offset}),e.offsetArgIndex.push(n);else throw new Error("cwise: Unknown argument type "+t[n])}if(e.arrayArgs.length<=0)throw new Error("cwise: No array arguments specified");if(e.pre.args.length>t.length)throw new Error("cwise: Too many arguments in pre() block");if(e.body.args.length>t.length)throw new Error("cwise: Too many arguments in body() block");if(e.post.args.length>t.length)throw new Error("cwise: Too many arguments in post() block");return e.debug=!!r.printCode||!!r.debug,e.funcName=r.funcName||"cwise",e.blockSize=r.blockSize||64,ag(e)}var cg=lg;(function(r){var e=cg,t={body:"",args:[],thisVars:[],localVars:[]};function n(h){if(!h)return t;for(var d=0;d<h.args.length;++d){var f=h.args[d];d===0?h.args[d]={name:f,lvalue:!0,rvalue:!!h.rvalue,count:h.count||1}:h.args[d]={name:f,lvalue:!1,rvalue:!0,count:1}}return h.thisVars||(h.thisVars=[]),h.localVars||(h.localVars=[]),h}function i(h){return e({args:h.args,pre:n(h.pre),body:n(h.body),post:n(h.proc),funcName:h.funcName})}function s(h){for(var d=[],f=0;f<h.args.length;++f)d.push("a"+f);var g=new Function("P",["return function ",h.funcName,"_ndarrayops(",d.join(","),") {P(",d.join(","),");return a0}"].join(""));return g(i(h))}var o={add:"+",sub:"-",mul:"*",div:"/",mod:"%",band:"&",bor:"|",bxor:"^",lshift:"<<",rshift:">>",rrshift:">>>"};(function(){for(var h in o){var d=o[h];r[h]=s({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+d+"c"},funcName:h}),r[h+"eq"]=s({args:["array","array"],body:{args:["a","b"],body:"a"+d+"=b"},rvalue:!0,funcName:h+"eq"}),r[h+"s"]=s({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+d+"s"},funcName:h+"s"}),r[h+"seq"]=s({args:["array","scalar"],body:{args:["a","s"],body:"a"+d+"=s"},rvalue:!0,funcName:h+"seq"})}})();var a={not:"!",bnot:"~",neg:"-",recip:"1.0/"};(function(){for(var h in a){var d=a[h];r[h]=s({args:["array","array"],body:{args:["a","b"],body:"a="+d+"b"},funcName:h}),r[h+"eq"]=s({args:["array"],body:{args:["a"],body:"a="+d+"a"},rvalue:!0,count:2,funcName:h+"eq"})}})();var A={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};(function(){for(var h in A){var d=A[h];r[h]=s({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+d+"c"},funcName:h}),r[h+"s"]=s({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+d+"s"},funcName:h+"s"}),r[h+"eq"]=s({args:["array","array"],body:{args:["a","b"],body:"a=a"+d+"b"},rvalue:!0,count:2,funcName:h+"eq"}),r[h+"seq"]=s({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+d+"s"},rvalue:!0,count:2,funcName:h+"seq"})}})();var l=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];(function(){for(var h=0;h<l.length;++h){var d=l[h];r[d]=s({args:["array","array"],pre:{args:[],body:"this_f=Math."+d,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b)",thisVars:["this_f"]},funcName:d}),r[d+"eq"]=s({args:["array"],pre:{args:[],body:"this_f=Math."+d,thisVars:["this_f"]},body:{args:["a"],body:"a=this_f(a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:d+"eq"})}})();var c=["max","min","atan2","pow"];(function(){for(var h=0;h<c.length;++h){var d=c[h];r[d]=s({args:["array","array","array"],pre:{args:[],body:"this_f=Math."+d,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(b,c)",thisVars:["this_f"]},funcName:d}),r[d+"s"]=s({args:["array","array","scalar"],pre:{args:[],body:"this_f=Math."+d,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(b,c)",thisVars:["this_f"]},funcName:d+"s"}),r[d+"eq"]=s({args:["array","array"],pre:{args:[],body:"this_f=Math."+d,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(a,b)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:d+"eq"}),r[d+"seq"]=s({args:["array","scalar"],pre:{args:[],body:"this_f=Math."+d,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(a,b)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:d+"seq"})}})();var u=["atan2","pow"];(function(){for(var h=0;h<u.length;++h){var d=u[h];r[d+"op"]=s({args:["array","array","array"],pre:{args:[],body:"this_f=Math."+d,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(c,b)",thisVars:["this_f"]},funcName:d+"op"}),r[d+"ops"]=s({args:["array","array","scalar"],pre:{args:[],body:"this_f=Math."+d,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(c,b)",thisVars:["this_f"]},funcName:d+"ops"}),r[d+"opeq"]=s({args:["array","array"],pre:{args:[],body:"this_f=Math."+d,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b,a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:d+"opeq"}),r[d+"opseq"]=s({args:["array","scalar"],pre:{args:[],body:"this_f=Math."+d,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b,a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:d+"opseq"})}})(),r.any=e({args:["array"],pre:t,body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"if(a){return true}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return false"},funcName:"any"}),r.all=e({args:["array"],pre:t,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1}],body:"if(!x){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"all"}),r.sum=e({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"this_s+=a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"sum"}),r.prod=e({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=1"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"this_s*=a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"prod"}),r.norm2squared=e({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:2}],body:"this_s+=a*a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm2squared"}),r.norm2=e({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:2}],body:"this_s+=a*a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return Math.sqrt(this_s)"},funcName:"norm2"}),r.norminf=e({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:4}],body:"if(-a>this_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),r.norm1=e({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),r.sup=e({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),r.inf=e({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_<this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),r.argmin=e({args:["index","array","shape"],pre:{body:"{this_v=Infinity;this_i=_inline_0_arg2_.slice(0)}",args:[{name:"_inline_0_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_i","this_v"],localVars:[]},body:{body:"{if(_inline_1_arg1_<this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),r.argmax=e({args:["index","array","shape"],pre:{body:"{this_v=-Infinity;this_i=_inline_0_arg2_.slice(0)}",args:[{name:"_inline_0_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_i","this_v"],localVars:[]},body:{body:"{if(_inline_1_arg1_>this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),r.random=s({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),r.assign=s({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),r.assigns=s({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),r.equals=e({args:["array","array"],pre:t,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})})(XA);var Ne={},ze={},go=32;ze.INT_BITS=go,ze.INT_MAX=2147483647,ze.INT_MIN=-1<<go-1,ze.sign=function(r){return(r>0)-(r<0)},ze.abs=function(r){var e=r>>go-1;return(r^e)-e},ze.min=function(r,e){return e^(r^e)&-(r<e)},ze.max=function(r,e){return r^(r^e)&-(r<e)},ze.isPow2=function(r){return!(r&r-1)&&!!r},ze.log2=function(r){var e,t;return e=(r>65535)<<4,r>>>=e,t=(r>255)<<3,r>>>=t,e|=t,t=(r>15)<<2,r>>>=t,e|=t,t=(r>3)<<1,r>>>=t,e|=t,e|r>>1},ze.log10=function(r){return r>=1e9?9:r>=1e8?8:r>=1e7?7:r>=1e6?6:r>=1e5?5:r>=1e4?4:r>=1e3?3:r>=100?2:r>=10?1:0},ze.popCount=function(r){return r=r-(r>>>1&1431655765),r=(r&858993459)+(r>>>2&858993459),(r+(r>>>4)&252645135)*16843009>>>24};function zA(r){var e=32;return r&=-r,r&&e--,r&65535&&(e-=16),r&16711935&&(e-=8),r&252645135&&(e-=4),r&858993459&&(e-=2),r&1431655765&&(e-=1),e}ze.countTrailingZeros=zA,ze.nextPow2=function(r){return r+=r===0,--r,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r+1},ze.prevPow2=function(r){return r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r-(r>>>1)},ze.parity=function(r){return r^=r>>>16,r^=r>>>8,r^=r>>>4,r&=15,27030>>>r&1};var ei=new Array(256);(function(r){for(var e=0;e<256;++e){var t=e,n=e,i=7;for(t>>>=1;t;t>>>=1)n<<=1,n|=t&1,--i;r[e]=n<<i&255}})(ei),ze.reverse=function(r){return ei[r&255]<<24|ei[r>>>8&255]<<16|ei[r>>>16&255]<<8|ei[r>>>24&255]},ze.interleave2=function(r,e){return r&=65535,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,e&=65535,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,r|e<<1},ze.deinterleave2=function(r,e){return r=r>>>e&1431655765,r=(r|r>>>1)&858993459,r=(r|r>>>2)&252645135,r=(r|r>>>4)&16711935,r=(r|r>>>16)&65535,r<<16>>16},ze.interleave3=function(r,e,t){return r&=1023,r=(r|r<<16)&4278190335,r=(r|r<<8)&251719695,r=(r|r<<4)&3272356035,r=(r|r<<2)&1227133513,e&=1023,e=(e|e<<16)&4278190335,e=(e|e<<8)&251719695,e=(e|e<<4)&3272356035,e=(e|e<<2)&1227133513,r|=e<<1,t&=1023,t=(t|t<<16)&4278190335,t=(t|t<<8)&251719695,t=(t|t<<4)&3272356035,t=(t|t<<2)&1227133513,r|t<<2},ze.deinterleave3=function(r,e){return r=r>>>e&1227133513,r=(r|r>>>2)&3272356035,r=(r|r>>>4)&251719695,r=(r|r>>>8)&4278190335,r=(r|r>>>16)&1023,r<<22>>22},ze.nextCombination=function(r){var e=r|r-1;return e+1|(~e&-~e)-1>>>zA(r)+1};function ZA(r,e,t){var n=r[t]|0;if(n<=0)return[];var i=new Array(n),s;if(t===r.length-1)for(s=0;s<n;++s)i[s]=e;else for(s=0;s<n;++s)i[s]=ZA(r,e,t+1);return i}function ug(r,e){var t,n;for(t=new Array(r),n=0;n<r;++n)t[n]=e;return t}function hg(r,e){switch(typeof e>"u"&&(e=0),typeof r){case"number":if(r>0)return ug(r|0,e);break;case"object":if(typeof r.length=="number")return ZA(r,e,0);break}return[]}var dg=hg,el={},$i={};$i.byteLength=pg,$i.toByteArray=Eg,$i.fromByteArray=vg;for(var er=[],Pt=[],fg=typeof Uint8Array<"u"?Uint8Array:Array,po="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fn=0,gg=po.length;fn<gg;++fn)er[fn]=po[fn],Pt[po.charCodeAt(fn)]=fn;Pt[45]=62,Pt[95]=63;function tl(r){var e=r.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=r.indexOf("=");t===-1&&(t=e);var n=t===e?0:4-t%4;return[t,n]}function pg(r){var e=tl(r),t=e[0],n=e[1];return(t+n)*3/4-n}function mg(r,e,t){return(e+t)*3/4-t}function Eg(r){var e,t=tl(r),n=t[0],i=t[1],s=new fg(mg(r,n,i)),o=0,a=i>0?n-4:n,A;for(A=0;A<a;A+=4)e=Pt[r.charCodeAt(A)]<<18|Pt[r.charCodeAt(A+1)]<<12|Pt[r.charCodeAt(A+2)]<<6|Pt[r.charCodeAt(A+3)],s[o++]=e>>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=Pt[r.charCodeAt(A)]<<2|Pt[r.charCodeAt(A+1)]>>4,s[o++]=e&255),i===1&&(e=Pt[r.charCodeAt(A)]<<10|Pt[r.charCodeAt(A+1)]<<4|Pt[r.charCodeAt(A+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function Ig(r){return er[r>>18&63]+er[r>>12&63]+er[r>>6&63]+er[r&63]}function Cg(r,e,t){for(var n,i=[],s=e;s<t;s+=3)n=(r[s]<<16&16711680)+(r[s+1]<<8&65280)+(r[s+2]&255),i.push(Ig(n));return i.join("")}function vg(r){for(var e,t=r.length,n=t%3,i=[],s=16383,o=0,a=t-n;o<a;o+=s)i.push(Cg(r,o,o+s>a?a:o+s));return n===1?(e=r[t-1],i.push(er[e>>2]+er[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],i.push(er[e>>10]+er[e>>4&63]+er[e<<2&63]+"=")),i.join("")}var mo={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */mo.read=function(r,e,t,n,i){var s,o,a=i*8-n-1,A=(1<<a)-1,l=A>>1,c=-7,u=t?i-1:0,h=t?-1:1,d=r[e+u];for(u+=h,s=d&(1<<-c)-1,d>>=-c,c+=a;c>0;s=s*256+r[e+u],u+=h,c-=8);for(o=s&(1<<-c)-1,s>>=-c,c+=n;c>0;o=o*256+r[e+u],u+=h,c-=8);if(s===0)s=1-l;else{if(s===A)return o?NaN:(d?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-l}return(d?-1:1)*o*Math.pow(2,s-n)},mo.write=function(r,e,t,n,i,s){var o,a,A,l=s*8-i-1,c=(1<<l)-1,u=c>>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:s-1,f=n?1:-1,g=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(A=Math.pow(2,-o))<1&&(o--,A*=2),o+u>=1?e+=h/A:e+=h*Math.pow(2,1-u),e*A>=2&&(o++,A/=2),o+u>=c?(a=0,o=c):o+u>=1?(a=(e*A-1)*Math.pow(2,i),o=o+u):(a=e*Math.pow(2,u-1)*Math.pow(2,i),o=0));i>=8;r[t+d]=a&255,d+=f,a/=256,i-=8);for(o=o<<i|a,l+=i;l>0;r[t+d]=o&255,d+=f,o/=256,l-=8);r[t+d-f]|=g*128};/*!
|
86
|
+
`));return u(ig.bind(void 0,r))}var og=sg,ag=og;function lg(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1}function Ag(r){var e=new lg;e.pre=r.pre,e.body=r.body,e.post=r.post;var t=r.args.slice(0);e.argTypes=t;for(var n=0;n<t.length;++n){var i=t[n];if(i==="array"||typeof i=="object"&&i.blockIndices){if(e.argTypes[n]="array",e.arrayArgs.push(n),e.arrayBlockIndices.push(i.blockIndices?i.blockIndices:0),e.shimArgs.push("array"+n),n<e.pre.args.length&&e.pre.args[n].count>0)throw new Error("cwise: pre() block may not reference array args");if(n<e.post.args.length&&e.post.args[n].count>0)throw new Error("cwise: post() block may not reference array args")}else if(i==="scalar")e.scalarArgs.push(n),e.shimArgs.push("scalar"+n);else if(i==="index"){if(e.indexArgs.push(n),n<e.pre.args.length&&e.pre.args[n].count>0)throw new Error("cwise: pre() block may not reference array index");if(n<e.body.args.length&&e.body.args[n].lvalue)throw new Error("cwise: body() block may not write to array index");if(n<e.post.args.length&&e.post.args[n].count>0)throw new Error("cwise: post() block may not reference array index")}else if(i==="shape"){if(e.shapeArgs.push(n),n<e.pre.args.length&&e.pre.args[n].lvalue)throw new Error("cwise: pre() block may not write to array shape");if(n<e.body.args.length&&e.body.args[n].lvalue)throw new Error("cwise: body() block may not write to array shape");if(n<e.post.args.length&&e.post.args[n].lvalue)throw new Error("cwise: post() block may not write to array shape")}else if(typeof i=="object"&&i.offset)e.argTypes[n]="offset",e.offsetArgs.push({array:i.array,offset:i.offset}),e.offsetArgIndex.push(n);else throw new Error("cwise: Unknown argument type "+t[n])}if(e.arrayArgs.length<=0)throw new Error("cwise: No array arguments specified");if(e.pre.args.length>t.length)throw new Error("cwise: Too many arguments in pre() block");if(e.body.args.length>t.length)throw new Error("cwise: Too many arguments in body() block");if(e.post.args.length>t.length)throw new Error("cwise: Too many arguments in post() block");return e.debug=!!r.printCode||!!r.debug,e.funcName=r.funcName||"cwise",e.blockSize=r.blockSize||64,ag(e)}var cg=Ag;(function(r){var e=cg,t={body:"",args:[],thisVars:[],localVars:[]};function n(h){if(!h)return t;for(var d=0;d<h.args.length;++d){var f=h.args[d];d===0?h.args[d]={name:f,lvalue:!0,rvalue:!!h.rvalue,count:h.count||1}:h.args[d]={name:f,lvalue:!1,rvalue:!0,count:1}}return h.thisVars||(h.thisVars=[]),h.localVars||(h.localVars=[]),h}function i(h){return e({args:h.args,pre:n(h.pre),body:n(h.body),post:n(h.proc),funcName:h.funcName})}function s(h){for(var d=[],f=0;f<h.args.length;++f)d.push("a"+f);var g=new Function("P",["return function ",h.funcName,"_ndarrayops(",d.join(","),") {P(",d.join(","),");return a0}"].join(""));return g(i(h))}var o={add:"+",sub:"-",mul:"*",div:"/",mod:"%",band:"&",bor:"|",bxor:"^",lshift:"<<",rshift:">>",rrshift:">>>"};(function(){for(var h in o){var d=o[h];r[h]=s({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+d+"c"},funcName:h}),r[h+"eq"]=s({args:["array","array"],body:{args:["a","b"],body:"a"+d+"=b"},rvalue:!0,funcName:h+"eq"}),r[h+"s"]=s({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+d+"s"},funcName:h+"s"}),r[h+"seq"]=s({args:["array","scalar"],body:{args:["a","s"],body:"a"+d+"=s"},rvalue:!0,funcName:h+"seq"})}})();var a={not:"!",bnot:"~",neg:"-",recip:"1.0/"};(function(){for(var h in a){var d=a[h];r[h]=s({args:["array","array"],body:{args:["a","b"],body:"a="+d+"b"},funcName:h}),r[h+"eq"]=s({args:["array"],body:{args:["a"],body:"a="+d+"a"},rvalue:!0,count:2,funcName:h+"eq"})}})();var l={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};(function(){for(var h in l){var d=l[h];r[h]=s({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+d+"c"},funcName:h}),r[h+"s"]=s({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+d+"s"},funcName:h+"s"}),r[h+"eq"]=s({args:["array","array"],body:{args:["a","b"],body:"a=a"+d+"b"},rvalue:!0,count:2,funcName:h+"eq"}),r[h+"seq"]=s({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+d+"s"},rvalue:!0,count:2,funcName:h+"seq"})}})();var A=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];(function(){for(var h=0;h<A.length;++h){var d=A[h];r[d]=s({args:["array","array"],pre:{args:[],body:"this_f=Math."+d,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b)",thisVars:["this_f"]},funcName:d}),r[d+"eq"]=s({args:["array"],pre:{args:[],body:"this_f=Math."+d,thisVars:["this_f"]},body:{args:["a"],body:"a=this_f(a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:d+"eq"})}})();var c=["max","min","atan2","pow"];(function(){for(var h=0;h<c.length;++h){var d=c[h];r[d]=s({args:["array","array","array"],pre:{args:[],body:"this_f=Math."+d,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(b,c)",thisVars:["this_f"]},funcName:d}),r[d+"s"]=s({args:["array","array","scalar"],pre:{args:[],body:"this_f=Math."+d,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(b,c)",thisVars:["this_f"]},funcName:d+"s"}),r[d+"eq"]=s({args:["array","array"],pre:{args:[],body:"this_f=Math."+d,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(a,b)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:d+"eq"}),r[d+"seq"]=s({args:["array","scalar"],pre:{args:[],body:"this_f=Math."+d,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(a,b)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:d+"seq"})}})();var u=["atan2","pow"];(function(){for(var h=0;h<u.length;++h){var d=u[h];r[d+"op"]=s({args:["array","array","array"],pre:{args:[],body:"this_f=Math."+d,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(c,b)",thisVars:["this_f"]},funcName:d+"op"}),r[d+"ops"]=s({args:["array","array","scalar"],pre:{args:[],body:"this_f=Math."+d,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(c,b)",thisVars:["this_f"]},funcName:d+"ops"}),r[d+"opeq"]=s({args:["array","array"],pre:{args:[],body:"this_f=Math."+d,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b,a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:d+"opeq"}),r[d+"opseq"]=s({args:["array","scalar"],pre:{args:[],body:"this_f=Math."+d,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b,a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:d+"opseq"})}})(),r.any=e({args:["array"],pre:t,body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"if(a){return true}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return false"},funcName:"any"}),r.all=e({args:["array"],pre:t,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1}],body:"if(!x){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"all"}),r.sum=e({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"this_s+=a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"sum"}),r.prod=e({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=1"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"this_s*=a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"prod"}),r.norm2squared=e({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:2}],body:"this_s+=a*a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm2squared"}),r.norm2=e({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:2}],body:"this_s+=a*a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return Math.sqrt(this_s)"},funcName:"norm2"}),r.norminf=e({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:4}],body:"if(-a>this_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),r.norm1=e({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),r.sup=e({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),r.inf=e({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_<this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),r.argmin=e({args:["index","array","shape"],pre:{body:"{this_v=Infinity;this_i=_inline_0_arg2_.slice(0)}",args:[{name:"_inline_0_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_i","this_v"],localVars:[]},body:{body:"{if(_inline_1_arg1_<this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),r.argmax=e({args:["index","array","shape"],pre:{body:"{this_v=-Infinity;this_i=_inline_0_arg2_.slice(0)}",args:[{name:"_inline_0_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_i","this_v"],localVars:[]},body:{body:"{if(_inline_1_arg1_>this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),r.random=s({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),r.assign=s({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),r.assigns=s({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),r.equals=e({args:["array","array"],pre:t,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})})(jl);var Ne={},ze={},go=32;ze.INT_BITS=go,ze.INT_MAX=2147483647,ze.INT_MIN=-1<<go-1,ze.sign=function(r){return(r>0)-(r<0)},ze.abs=function(r){var e=r>>go-1;return(r^e)-e},ze.min=function(r,e){return e^(r^e)&-(r<e)},ze.max=function(r,e){return r^(r^e)&-(r<e)},ze.isPow2=function(r){return!(r&r-1)&&!!r},ze.log2=function(r){var e,t;return e=(r>65535)<<4,r>>>=e,t=(r>255)<<3,r>>>=t,e|=t,t=(r>15)<<2,r>>>=t,e|=t,t=(r>3)<<1,r>>>=t,e|=t,e|r>>1},ze.log10=function(r){return r>=1e9?9:r>=1e8?8:r>=1e7?7:r>=1e6?6:r>=1e5?5:r>=1e4?4:r>=1e3?3:r>=100?2:r>=10?1:0},ze.popCount=function(r){return r=r-(r>>>1&1431655765),r=(r&858993459)+(r>>>2&858993459),(r+(r>>>4)&252645135)*16843009>>>24};function Zl(r){var e=32;return r&=-r,r&&e--,r&65535&&(e-=16),r&16711935&&(e-=8),r&252645135&&(e-=4),r&858993459&&(e-=2),r&1431655765&&(e-=1),e}ze.countTrailingZeros=Zl,ze.nextPow2=function(r){return r+=r===0,--r,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r+1},ze.prevPow2=function(r){return r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r-(r>>>1)},ze.parity=function(r){return r^=r>>>16,r^=r>>>8,r^=r>>>4,r&=15,27030>>>r&1};var ei=new Array(256);(function(r){for(var e=0;e<256;++e){var t=e,n=e,i=7;for(t>>>=1;t;t>>>=1)n<<=1,n|=t&1,--i;r[e]=n<<i&255}})(ei),ze.reverse=function(r){return ei[r&255]<<24|ei[r>>>8&255]<<16|ei[r>>>16&255]<<8|ei[r>>>24&255]},ze.interleave2=function(r,e){return r&=65535,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,e&=65535,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,r|e<<1},ze.deinterleave2=function(r,e){return r=r>>>e&1431655765,r=(r|r>>>1)&858993459,r=(r|r>>>2)&252645135,r=(r|r>>>4)&16711935,r=(r|r>>>16)&65535,r<<16>>16},ze.interleave3=function(r,e,t){return r&=1023,r=(r|r<<16)&4278190335,r=(r|r<<8)&251719695,r=(r|r<<4)&3272356035,r=(r|r<<2)&1227133513,e&=1023,e=(e|e<<16)&4278190335,e=(e|e<<8)&251719695,e=(e|e<<4)&3272356035,e=(e|e<<2)&1227133513,r|=e<<1,t&=1023,t=(t|t<<16)&4278190335,t=(t|t<<8)&251719695,t=(t|t<<4)&3272356035,t=(t|t<<2)&1227133513,r|t<<2},ze.deinterleave3=function(r,e){return r=r>>>e&1227133513,r=(r|r>>>2)&3272356035,r=(r|r>>>4)&251719695,r=(r|r>>>8)&4278190335,r=(r|r>>>16)&1023,r<<22>>22},ze.nextCombination=function(r){var e=r|r-1;return e+1|(~e&-~e)-1>>>Zl(r)+1};function eA(r,e,t){var n=r[t]|0;if(n<=0)return[];var i=new Array(n),s;if(t===r.length-1)for(s=0;s<n;++s)i[s]=e;else for(s=0;s<n;++s)i[s]=eA(r,e,t+1);return i}function ug(r,e){var t,n;for(t=new Array(r),n=0;n<r;++n)t[n]=e;return t}function hg(r,e){switch(typeof e>"u"&&(e=0),typeof r){case"number":if(r>0)return ug(r|0,e);break;case"object":if(typeof r.length=="number")return eA(r,e,0);break}return[]}var dg=hg,tA={},$i={};$i.byteLength=pg,$i.toByteArray=Eg,$i.fromByteArray=vg;for(var er=[],Pt=[],fg=typeof Uint8Array<"u"?Uint8Array:Array,po="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fn=0,gg=po.length;fn<gg;++fn)er[fn]=po[fn],Pt[po.charCodeAt(fn)]=fn;Pt[45]=62,Pt[95]=63;function rA(r){var e=r.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=r.indexOf("=");t===-1&&(t=e);var n=t===e?0:4-t%4;return[t,n]}function pg(r){var e=rA(r),t=e[0],n=e[1];return(t+n)*3/4-n}function mg(r,e,t){return(e+t)*3/4-t}function Eg(r){var e,t=rA(r),n=t[0],i=t[1],s=new fg(mg(r,n,i)),o=0,a=i>0?n-4:n,l;for(l=0;l<a;l+=4)e=Pt[r.charCodeAt(l)]<<18|Pt[r.charCodeAt(l+1)]<<12|Pt[r.charCodeAt(l+2)]<<6|Pt[r.charCodeAt(l+3)],s[o++]=e>>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=Pt[r.charCodeAt(l)]<<2|Pt[r.charCodeAt(l+1)]>>4,s[o++]=e&255),i===1&&(e=Pt[r.charCodeAt(l)]<<10|Pt[r.charCodeAt(l+1)]<<4|Pt[r.charCodeAt(l+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function Ig(r){return er[r>>18&63]+er[r>>12&63]+er[r>>6&63]+er[r&63]}function Cg(r,e,t){for(var n,i=[],s=e;s<t;s+=3)n=(r[s]<<16&16711680)+(r[s+1]<<8&65280)+(r[s+2]&255),i.push(Ig(n));return i.join("")}function vg(r){for(var e,t=r.length,n=t%3,i=[],s=16383,o=0,a=t-n;o<a;o+=s)i.push(Cg(r,o,o+s>a?a:o+s));return n===1?(e=r[t-1],i.push(er[e>>2]+er[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],i.push(er[e>>10]+er[e>>4&63]+er[e<<2&63]+"=")),i.join("")}var mo={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */mo.read=function(r,e,t,n,i){var s,o,a=i*8-n-1,l=(1<<a)-1,A=l>>1,c=-7,u=t?i-1:0,h=t?-1:1,d=r[e+u];for(u+=h,s=d&(1<<-c)-1,d>>=-c,c+=a;c>0;s=s*256+r[e+u],u+=h,c-=8);for(o=s&(1<<-c)-1,s>>=-c,c+=n;c>0;o=o*256+r[e+u],u+=h,c-=8);if(s===0)s=1-A;else{if(s===l)return o?NaN:(d?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-A}return(d?-1:1)*o*Math.pow(2,s-n)},mo.write=function(r,e,t,n,i,s){var o,a,l,A=s*8-i-1,c=(1<<A)-1,u=c>>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:s-1,f=n?1:-1,g=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+u>=1?e+=h/l:e+=h*Math.pow(2,1-u),e*l>=2&&(o++,l/=2),o+u>=c?(a=0,o=c):o+u>=1?(a=(e*l-1)*Math.pow(2,i),o=o+u):(a=e*Math.pow(2,u-1)*Math.pow(2,i),o=0));i>=8;r[t+d]=a&255,d+=f,a/=256,i-=8);for(o=o<<i|a,A+=i;A>0;r[t+d]=o&255,d+=f,o/=256,A-=8);r[t+d-f]|=g*128};/*!
|
87
87
|
* The buffer module from node.js, for the browser.
|
88
88
|
*
|
89
89
|
* @author Feross Aboukhadijeh <https://feross.org>
|
90
90
|
* @license MIT
|
91
|
-
*/(function(r){var e=$i,t=mo,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;r.Buffer=a,r.SlowBuffer=T,r.INSPECT_MAX_BYTES=50;var i=2147483647;r.kMaxLength=i,a.TYPED_ARRAY_SUPPORT=s(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function s(){try{var Q=new Uint8Array(1),m={foo:function(){return 42}};return Object.setPrototypeOf(m,Uint8Array.prototype),Object.setPrototypeOf(Q,m),Q.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function o(Q){if(Q>i)throw new RangeError('The value "'+Q+'" is invalid for option "size"');var m=new Uint8Array(Q);return Object.setPrototypeOf(m,a.prototype),m}function a(Q,m,E){if(typeof Q=="number"){if(typeof m=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return u(Q)}return A(Q,m,E)}a.poolSize=8192;function A(Q,m,E){if(typeof Q=="string")return h(Q,m);if(ArrayBuffer.isView(Q))return f(Q);if(Q==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Q);if(we(Q,ArrayBuffer)||Q&&we(Q.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(we(Q,SharedArrayBuffer)||Q&&we(Q.buffer,SharedArrayBuffer)))return g(Q,m,E);if(typeof Q=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var x=Q.valueOf&&Q.valueOf();if(x!=null&&x!==Q)return a.from(x,m,E);var M=p(Q);if(M)return M;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Q[Symbol.toPrimitive]=="function")return a.from(Q[Symbol.toPrimitive]("string"),m,E);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Q)}a.from=function(Q,m,E){return A(Q,m,E)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function l(Q){if(typeof Q!="number")throw new TypeError('"size" argument must be of type number');if(Q<0)throw new RangeError('The value "'+Q+'" is invalid for option "size"')}function c(Q,m,E){return l(Q),Q<=0?o(Q):m!==void 0?typeof E=="string"?o(Q).fill(m,E):o(Q).fill(m):o(Q)}a.alloc=function(Q,m,E){return c(Q,m,E)};function u(Q){return l(Q),o(Q<0?0:v(Q)|0)}a.allocUnsafe=function(Q){return u(Q)},a.allocUnsafeSlow=function(Q){return u(Q)};function h(Q,m){if((typeof m!="string"||m==="")&&(m="utf8"),!a.isEncoding(m))throw new TypeError("Unknown encoding: "+m);var E=b(Q,m)|0,x=o(E),M=x.write(Q,m);return M!==E&&(x=x.slice(0,M)),x}function d(Q){for(var m=Q.length<0?0:v(Q.length)|0,E=o(m),x=0;x<m;x+=1)E[x]=Q[x]&255;return E}function f(Q){if(we(Q,Uint8Array)){var m=new Uint8Array(Q);return g(m.buffer,m.byteOffset,m.byteLength)}return d(Q)}function g(Q,m,E){if(m<0||Q.byteLength<m)throw new RangeError('"offset" is outside of buffer bounds');if(Q.byteLength<m+(E||0))throw new RangeError('"length" is outside of buffer bounds');var x;return m===void 0&&E===void 0?x=new Uint8Array(Q):E===void 0?x=new Uint8Array(Q,m):x=new Uint8Array(Q,m,E),Object.setPrototypeOf(x,a.prototype),x}function p(Q){if(a.isBuffer(Q)){var m=v(Q.length)|0,E=o(m);return E.length===0||Q.copy(E,0,0,m),E}if(Q.length!==void 0)return typeof Q.length!="number"||We(Q.length)?o(0):d(Q);if(Q.type==="Buffer"&&Array.isArray(Q.data))return d(Q.data)}function v(Q){if(Q>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return Q|0}function T(Q){return+Q!=Q&&(Q=0),a.alloc(+Q)}a.isBuffer=function(m){return m!=null&&m._isBuffer===!0&&m!==a.prototype},a.compare=function(m,E){if(we(m,Uint8Array)&&(m=a.from(m,m.offset,m.byteLength)),we(E,Uint8Array)&&(E=a.from(E,E.offset,E.byteLength)),!a.isBuffer(m)||!a.isBuffer(E))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(m===E)return 0;for(var x=m.length,M=E.length,z=0,j=Math.min(x,M);z<j;++z)if(m[z]!==E[z]){x=m[z],M=E[z];break}return x<M?-1:M<x?1:0},a.isEncoding=function(m){switch(String(m).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(m,E){if(!Array.isArray(m))throw new TypeError('"list" argument must be an Array of Buffers');if(m.length===0)return a.alloc(0);var x;if(E===void 0)for(E=0,x=0;x<m.length;++x)E+=m[x].length;var M=a.allocUnsafe(E),z=0;for(x=0;x<m.length;++x){var j=m[x];if(we(j,Uint8Array))z+j.length>M.length?a.from(j).copy(M,z):Uint8Array.prototype.set.call(M,j,z);else if(a.isBuffer(j))j.copy(M,z);else throw new TypeError('"list" argument must be an Array of Buffers');z+=j.length}return M};function b(Q,m){if(a.isBuffer(Q))return Q.length;if(ArrayBuffer.isView(Q)||we(Q,ArrayBuffer))return Q.byteLength;if(typeof Q!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Q);var E=Q.length,x=arguments.length>2&&arguments[2]===!0;if(!x&&E===0)return 0;for(var M=!1;;)switch(m){case"ascii":case"latin1":case"binary":return E;case"utf8":case"utf-8":return Le(Q).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E*2;case"hex":return E>>>1;case"base64":return Te(Q).length;default:if(M)return x?-1:Le(Q).length;m=(""+m).toLowerCase(),M=!0}}a.byteLength=b;function y(Q,m,E){var x=!1;if((m===void 0||m<0)&&(m=0),m>this.length||((E===void 0||E>this.length)&&(E=this.length),E<=0)||(E>>>=0,m>>>=0,E<=m))return"";for(Q||(Q="utf8");;)switch(Q){case"hex":return S(this,m,E);case"utf8":case"utf-8":return Ae(this,m,E);case"ascii":return X(this,m,E);case"latin1":case"binary":return D(this,m,E);case"base64":return ee(this,m,E);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,m,E);default:if(x)throw new TypeError("Unknown encoding: "+Q);Q=(Q+"").toLowerCase(),x=!0}}a.prototype._isBuffer=!0;function w(Q,m,E){var x=Q[m];Q[m]=Q[E],Q[E]=x}a.prototype.swap16=function(){var m=this.length;if(m%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var E=0;E<m;E+=2)w(this,E,E+1);return this},a.prototype.swap32=function(){var m=this.length;if(m%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var E=0;E<m;E+=4)w(this,E,E+3),w(this,E+1,E+2);return this},a.prototype.swap64=function(){var m=this.length;if(m%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var E=0;E<m;E+=8)w(this,E,E+7),w(this,E+1,E+6),w(this,E+2,E+5),w(this,E+3,E+4);return this},a.prototype.toString=function(){var m=this.length;return m===0?"":arguments.length===0?Ae(this,0,m):y.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(m){if(!a.isBuffer(m))throw new TypeError("Argument must be a Buffer");return this===m?!0:a.compare(this,m)===0},a.prototype.inspect=function(){var m="",E=r.INSPECT_MAX_BYTES;return m=this.toString("hex",0,E).replace(/(.{2})/g,"$1 ").trim(),this.length>E&&(m+=" ... "),"<Buffer "+m+">"},n&&(a.prototype[n]=a.prototype.inspect),a.prototype.compare=function(m,E,x,M,z){if(we(m,Uint8Array)&&(m=a.from(m,m.offset,m.byteLength)),!a.isBuffer(m))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof m);if(E===void 0&&(E=0),x===void 0&&(x=m?m.length:0),M===void 0&&(M=0),z===void 0&&(z=this.length),E<0||x>m.length||M<0||z>this.length)throw new RangeError("out of range index");if(M>=z&&E>=x)return 0;if(M>=z)return-1;if(E>=x)return 1;if(E>>>=0,x>>>=0,M>>>=0,z>>>=0,this===m)return 0;for(var j=z-M,Ie=x-E,be=Math.min(j,Ie),De=this.slice(M,z),ke=m.slice(E,x),_e=0;_e<be;++_e)if(De[_e]!==ke[_e]){j=De[_e],Ie=ke[_e];break}return j<Ie?-1:Ie<j?1:0};function R(Q,m,E,x,M){if(Q.length===0)return-1;if(typeof E=="string"?(x=E,E=0):E>2147483647?E=2147483647:E<-2147483648&&(E=-2147483648),E=+E,We(E)&&(E=M?0:Q.length-1),E<0&&(E=Q.length+E),E>=Q.length){if(M)return-1;E=Q.length-1}else if(E<0)if(M)E=0;else return-1;if(typeof m=="string"&&(m=a.from(m,x)),a.isBuffer(m))return m.length===0?-1:k(Q,m,E,x,M);if(typeof m=="number")return m=m&255,typeof Uint8Array.prototype.indexOf=="function"?M?Uint8Array.prototype.indexOf.call(Q,m,E):Uint8Array.prototype.lastIndexOf.call(Q,m,E):k(Q,[m],E,x,M);throw new TypeError("val must be string, number or Buffer")}function k(Q,m,E,x,M){var z=1,j=Q.length,Ie=m.length;if(x!==void 0&&(x=String(x).toLowerCase(),x==="ucs2"||x==="ucs-2"||x==="utf16le"||x==="utf-16le")){if(Q.length<2||m.length<2)return-1;z=2,j/=2,Ie/=2,E/=2}function be(ct,Nt){return z===1?ct[Nt]:ct.readUInt16BE(Nt*z)}var De;if(M){var ke=-1;for(De=E;De<j;De++)if(be(Q,De)===be(m,ke===-1?0:De-ke)){if(ke===-1&&(ke=De),De-ke+1===Ie)return ke*z}else ke!==-1&&(De-=De-ke),ke=-1}else for(E+Ie>j&&(E=j-Ie),De=E;De>=0;De--){for(var _e=!0,Ft=0;Ft<Ie;Ft++)if(be(Q,De+Ft)!==be(m,Ft)){_e=!1;break}if(_e)return De}return-1}a.prototype.includes=function(m,E,x){return this.indexOf(m,E,x)!==-1},a.prototype.indexOf=function(m,E,x){return R(this,m,E,x,!0)},a.prototype.lastIndexOf=function(m,E,x){return R(this,m,E,x,!1)};function $(Q,m,E,x){E=Number(E)||0;var M=Q.length-E;x?(x=Number(x),x>M&&(x=M)):x=M;var z=m.length;x>z/2&&(x=z/2);for(var j=0;j<x;++j){var Ie=parseInt(m.substr(j*2,2),16);if(We(Ie))return j;Q[E+j]=Ie}return j}function W(Q,m,E,x){return Me(Le(m,Q.length-E),Q,E,x)}function O(Q,m,E,x){return Me(Ge(m),Q,E,x)}function K(Q,m,E,x){return Me(Te(m),Q,E,x)}function ne(Q,m,E,x){return Me(fe(m,Q.length-E),Q,E,x)}a.prototype.write=function(m,E,x,M){if(E===void 0)M="utf8",x=this.length,E=0;else if(x===void 0&&typeof E=="string")M=E,x=this.length,E=0;else if(isFinite(E))E=E>>>0,isFinite(x)?(x=x>>>0,M===void 0&&(M="utf8")):(M=x,x=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var z=this.length-E;if((x===void 0||x>z)&&(x=z),m.length>0&&(x<0||E<0)||E>this.length)throw new RangeError("Attempt to write outside buffer bounds");M||(M="utf8");for(var j=!1;;)switch(M){case"hex":return $(this,m,E,x);case"utf8":case"utf-8":return W(this,m,E,x);case"ascii":case"latin1":case"binary":return O(this,m,E,x);case"base64":return K(this,m,E,x);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ne(this,m,E,x);default:if(j)throw new TypeError("Unknown encoding: "+M);M=(""+M).toLowerCase(),j=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ee(Q,m,E){return m===0&&E===Q.length?e.fromByteArray(Q):e.fromByteArray(Q.slice(m,E))}function Ae(Q,m,E){E=Math.min(Q.length,E);for(var x=[],M=m;M<E;){var z=Q[M],j=null,Ie=z>239?4:z>223?3:z>191?2:1;if(M+Ie<=E){var be,De,ke,_e;switch(Ie){case 1:z<128&&(j=z);break;case 2:be=Q[M+1],(be&192)===128&&(_e=(z&31)<<6|be&63,_e>127&&(j=_e));break;case 3:be=Q[M+1],De=Q[M+2],(be&192)===128&&(De&192)===128&&(_e=(z&15)<<12|(be&63)<<6|De&63,_e>2047&&(_e<55296||_e>57343)&&(j=_e));break;case 4:be=Q[M+1],De=Q[M+2],ke=Q[M+3],(be&192)===128&&(De&192)===128&&(ke&192)===128&&(_e=(z&15)<<18|(be&63)<<12|(De&63)<<6|ke&63,_e>65535&&_e<1114112&&(j=_e))}}j===null?(j=65533,Ie=1):j>65535&&(j-=65536,x.push(j>>>10&1023|55296),j=56320|j&1023),x.push(j),M+=Ie}return P(x)}var _=4096;function P(Q){var m=Q.length;if(m<=_)return String.fromCharCode.apply(String,Q);for(var E="",x=0;x<m;)E+=String.fromCharCode.apply(String,Q.slice(x,x+=_));return E}function X(Q,m,E){var x="";E=Math.min(Q.length,E);for(var M=m;M<E;++M)x+=String.fromCharCode(Q[M]&127);return x}function D(Q,m,E){var x="";E=Math.min(Q.length,E);for(var M=m;M<E;++M)x+=String.fromCharCode(Q[M]);return x}function S(Q,m,E){var x=Q.length;(!m||m<0)&&(m=0),(!E||E<0||E>x)&&(E=x);for(var M="",z=m;z<E;++z)M+=Be[Q[z]];return M}function F(Q,m,E){for(var x=Q.slice(m,E),M="",z=0;z<x.length-1;z+=2)M+=String.fromCharCode(x[z]+x[z+1]*256);return M}a.prototype.slice=function(m,E){var x=this.length;m=~~m,E=E===void 0?x:~~E,m<0?(m+=x,m<0&&(m=0)):m>x&&(m=x),E<0?(E+=x,E<0&&(E=0)):E>x&&(E=x),E<m&&(E=m);var M=this.subarray(m,E);return Object.setPrototypeOf(M,a.prototype),M};function J(Q,m,E){if(Q%1!==0||Q<0)throw new RangeError("offset is not uint");if(Q+m>E)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(m,E,x){m=m>>>0,E=E>>>0,x||J(m,E,this.length);for(var M=this[m],z=1,j=0;++j<E&&(z*=256);)M+=this[m+j]*z;return M},a.prototype.readUintBE=a.prototype.readUIntBE=function(m,E,x){m=m>>>0,E=E>>>0,x||J(m,E,this.length);for(var M=this[m+--E],z=1;E>0&&(z*=256);)M+=this[m+--E]*z;return M},a.prototype.readUint8=a.prototype.readUInt8=function(m,E){return m=m>>>0,E||J(m,1,this.length),this[m]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(m,E){return m=m>>>0,E||J(m,2,this.length),this[m]|this[m+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(m,E){return m=m>>>0,E||J(m,2,this.length),this[m]<<8|this[m+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(m,E){return m=m>>>0,E||J(m,4,this.length),(this[m]|this[m+1]<<8|this[m+2]<<16)+this[m+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(m,E){return m=m>>>0,E||J(m,4,this.length),this[m]*16777216+(this[m+1]<<16|this[m+2]<<8|this[m+3])},a.prototype.readIntLE=function(m,E,x){m=m>>>0,E=E>>>0,x||J(m,E,this.length);for(var M=this[m],z=1,j=0;++j<E&&(z*=256);)M+=this[m+j]*z;return z*=128,M>=z&&(M-=Math.pow(2,8*E)),M},a.prototype.readIntBE=function(m,E,x){m=m>>>0,E=E>>>0,x||J(m,E,this.length);for(var M=E,z=1,j=this[m+--M];M>0&&(z*=256);)j+=this[m+--M]*z;return z*=128,j>=z&&(j-=Math.pow(2,8*E)),j},a.prototype.readInt8=function(m,E){return m=m>>>0,E||J(m,1,this.length),this[m]&128?(255-this[m]+1)*-1:this[m]},a.prototype.readInt16LE=function(m,E){m=m>>>0,E||J(m,2,this.length);var x=this[m]|this[m+1]<<8;return x&32768?x|4294901760:x},a.prototype.readInt16BE=function(m,E){m=m>>>0,E||J(m,2,this.length);var x=this[m+1]|this[m]<<8;return x&32768?x|4294901760:x},a.prototype.readInt32LE=function(m,E){return m=m>>>0,E||J(m,4,this.length),this[m]|this[m+1]<<8|this[m+2]<<16|this[m+3]<<24},a.prototype.readInt32BE=function(m,E){return m=m>>>0,E||J(m,4,this.length),this[m]<<24|this[m+1]<<16|this[m+2]<<8|this[m+3]},a.prototype.readFloatLE=function(m,E){return m=m>>>0,E||J(m,4,this.length),t.read(this,m,!0,23,4)},a.prototype.readFloatBE=function(m,E){return m=m>>>0,E||J(m,4,this.length),t.read(this,m,!1,23,4)},a.prototype.readDoubleLE=function(m,E){return m=m>>>0,E||J(m,8,this.length),t.read(this,m,!0,52,8)},a.prototype.readDoubleBE=function(m,E){return m=m>>>0,E||J(m,8,this.length),t.read(this,m,!1,52,8)};function Y(Q,m,E,x,M,z){if(!a.isBuffer(Q))throw new TypeError('"buffer" argument must be a Buffer instance');if(m>M||m<z)throw new RangeError('"value" argument is out of bounds');if(E+x>Q.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(m,E,x,M){if(m=+m,E=E>>>0,x=x>>>0,!M){var z=Math.pow(2,8*x)-1;Y(this,m,E,x,z,0)}var j=1,Ie=0;for(this[E]=m&255;++Ie<x&&(j*=256);)this[E+Ie]=m/j&255;return E+x},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(m,E,x,M){if(m=+m,E=E>>>0,x=x>>>0,!M){var z=Math.pow(2,8*x)-1;Y(this,m,E,x,z,0)}var j=x-1,Ie=1;for(this[E+j]=m&255;--j>=0&&(Ie*=256);)this[E+j]=m/Ie&255;return E+x},a.prototype.writeUint8=a.prototype.writeUInt8=function(m,E,x){return m=+m,E=E>>>0,x||Y(this,m,E,1,255,0),this[E]=m&255,E+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(m,E,x){return m=+m,E=E>>>0,x||Y(this,m,E,2,65535,0),this[E]=m&255,this[E+1]=m>>>8,E+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(m,E,x){return m=+m,E=E>>>0,x||Y(this,m,E,2,65535,0),this[E]=m>>>8,this[E+1]=m&255,E+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(m,E,x){return m=+m,E=E>>>0,x||Y(this,m,E,4,4294967295,0),this[E+3]=m>>>24,this[E+2]=m>>>16,this[E+1]=m>>>8,this[E]=m&255,E+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(m,E,x){return m=+m,E=E>>>0,x||Y(this,m,E,4,4294967295,0),this[E]=m>>>24,this[E+1]=m>>>16,this[E+2]=m>>>8,this[E+3]=m&255,E+4},a.prototype.writeIntLE=function(m,E,x,M){if(m=+m,E=E>>>0,!M){var z=Math.pow(2,8*x-1);Y(this,m,E,x,z-1,-z)}var j=0,Ie=1,be=0;for(this[E]=m&255;++j<x&&(Ie*=256);)m<0&&be===0&&this[E+j-1]!==0&&(be=1),this[E+j]=(m/Ie>>0)-be&255;return E+x},a.prototype.writeIntBE=function(m,E,x,M){if(m=+m,E=E>>>0,!M){var z=Math.pow(2,8*x-1);Y(this,m,E,x,z-1,-z)}var j=x-1,Ie=1,be=0;for(this[E+j]=m&255;--j>=0&&(Ie*=256);)m<0&&be===0&&this[E+j+1]!==0&&(be=1),this[E+j]=(m/Ie>>0)-be&255;return E+x},a.prototype.writeInt8=function(m,E,x){return m=+m,E=E>>>0,x||Y(this,m,E,1,127,-128),m<0&&(m=255+m+1),this[E]=m&255,E+1},a.prototype.writeInt16LE=function(m,E,x){return m=+m,E=E>>>0,x||Y(this,m,E,2,32767,-32768),this[E]=m&255,this[E+1]=m>>>8,E+2},a.prototype.writeInt16BE=function(m,E,x){return m=+m,E=E>>>0,x||Y(this,m,E,2,32767,-32768),this[E]=m>>>8,this[E+1]=m&255,E+2},a.prototype.writeInt32LE=function(m,E,x){return m=+m,E=E>>>0,x||Y(this,m,E,4,2147483647,-2147483648),this[E]=m&255,this[E+1]=m>>>8,this[E+2]=m>>>16,this[E+3]=m>>>24,E+4},a.prototype.writeInt32BE=function(m,E,x){return m=+m,E=E>>>0,x||Y(this,m,E,4,2147483647,-2147483648),m<0&&(m=4294967295+m+1),this[E]=m>>>24,this[E+1]=m>>>16,this[E+2]=m>>>8,this[E+3]=m&255,E+4};function re(Q,m,E,x,M,z){if(E+x>Q.length)throw new RangeError("Index out of range");if(E<0)throw new RangeError("Index out of range")}function ce(Q,m,E,x,M){return m=+m,E=E>>>0,M||re(Q,m,E,4),t.write(Q,m,E,x,23,4),E+4}a.prototype.writeFloatLE=function(m,E,x){return ce(this,m,E,!0,x)},a.prototype.writeFloatBE=function(m,E,x){return ce(this,m,E,!1,x)};function pe(Q,m,E,x,M){return m=+m,E=E>>>0,M||re(Q,m,E,8),t.write(Q,m,E,x,52,8),E+8}a.prototype.writeDoubleLE=function(m,E,x){return pe(this,m,E,!0,x)},a.prototype.writeDoubleBE=function(m,E,x){return pe(this,m,E,!1,x)},a.prototype.copy=function(m,E,x,M){if(!a.isBuffer(m))throw new TypeError("argument should be a Buffer");if(x||(x=0),!M&&M!==0&&(M=this.length),E>=m.length&&(E=m.length),E||(E=0),M>0&&M<x&&(M=x),M===x||m.length===0||this.length===0)return 0;if(E<0)throw new RangeError("targetStart out of bounds");if(x<0||x>=this.length)throw new RangeError("Index out of range");if(M<0)throw new RangeError("sourceEnd out of bounds");M>this.length&&(M=this.length),m.length-E<M-x&&(M=m.length-E+x);var z=M-x;return this===m&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(E,x,M):Uint8Array.prototype.set.call(m,this.subarray(x,M),E),z},a.prototype.fill=function(m,E,x,M){if(typeof m=="string"){if(typeof E=="string"?(M=E,E=0,x=this.length):typeof x=="string"&&(M=x,x=this.length),M!==void 0&&typeof M!="string")throw new TypeError("encoding must be a string");if(typeof M=="string"&&!a.isEncoding(M))throw new TypeError("Unknown encoding: "+M);if(m.length===1){var z=m.charCodeAt(0);(M==="utf8"&&z<128||M==="latin1")&&(m=z)}}else typeof m=="number"?m=m&255:typeof m=="boolean"&&(m=Number(m));if(E<0||this.length<E||this.length<x)throw new RangeError("Out of range index");if(x<=E)return this;E=E>>>0,x=x===void 0?this.length:x>>>0,m||(m=0);var j;if(typeof m=="number")for(j=E;j<x;++j)this[j]=m;else{var Ie=a.isBuffer(m)?m:a.from(m,M),be=Ie.length;if(be===0)throw new TypeError('The value "'+m+'" is invalid for argument "value"');for(j=0;j<x-E;++j)this[j+E]=Ie[j%be]}return this};var ge=/[^+/0-9A-Za-z-_]/g;function Se(Q){if(Q=Q.split("=")[0],Q=Q.trim().replace(ge,""),Q.length<2)return"";for(;Q.length%4!==0;)Q=Q+"=";return Q}function Le(Q,m){m=m||1/0;for(var E,x=Q.length,M=null,z=[],j=0;j<x;++j){if(E=Q.charCodeAt(j),E>55295&&E<57344){if(!M){if(E>56319){(m-=3)>-1&&z.push(239,191,189);continue}else if(j+1===x){(m-=3)>-1&&z.push(239,191,189);continue}M=E;continue}if(E<56320){(m-=3)>-1&&z.push(239,191,189),M=E;continue}E=(M-55296<<10|E-56320)+65536}else M&&(m-=3)>-1&&z.push(239,191,189);if(M=null,E<128){if((m-=1)<0)break;z.push(E)}else if(E<2048){if((m-=2)<0)break;z.push(E>>6|192,E&63|128)}else if(E<65536){if((m-=3)<0)break;z.push(E>>12|224,E>>6&63|128,E&63|128)}else if(E<1114112){if((m-=4)<0)break;z.push(E>>18|240,E>>12&63|128,E>>6&63|128,E&63|128)}else throw new Error("Invalid code point")}return z}function Ge(Q){for(var m=[],E=0;E<Q.length;++E)m.push(Q.charCodeAt(E)&255);return m}function fe(Q,m){for(var E,x,M,z=[],j=0;j<Q.length&&!((m-=2)<0);++j)E=Q.charCodeAt(j),x=E>>8,M=E%256,z.push(M),z.push(x);return z}function Te(Q){return e.toByteArray(Se(Q))}function Me(Q,m,E,x){for(var M=0;M<x&&!(M+E>=m.length||M>=Q.length);++M)m[M+E]=Q[M];return M}function we(Q,m){return Q instanceof m||Q!=null&&Q.constructor!=null&&Q.constructor.name!=null&&Q.constructor.name===m.name}function We(Q){return Q!==Q}var Be=function(){for(var Q="0123456789abcdef",m=new Array(256),E=0;E<16;++E)for(var x=E*16,M=0;M<16;++M)m[x+M]=Q[E]+Q[M];return m}()})(el);var Sr=ze,mt=dg,rl=el.Buffer;hn.__TYPEDARRAY_POOL||(hn.__TYPEDARRAY_POOL={UINT8:mt([32,0]),UINT16:mt([32,0]),UINT32:mt([32,0]),BIGUINT64:mt([32,0]),INT8:mt([32,0]),INT16:mt([32,0]),INT32:mt([32,0]),BIGINT64:mt([32,0]),FLOAT:mt([32,0]),DOUBLE:mt([32,0]),DATA:mt([32,0]),UINT8C:mt([32,0]),BUFFER:mt([32,0])});var yg=typeof Uint8ClampedArray<"u",Bg=typeof BigUint64Array<"u",Qg=typeof BigInt64Array<"u",rt=hn.__TYPEDARRAY_POOL;rt.UINT8C||(rt.UINT8C=mt([32,0])),rt.BIGUINT64||(rt.BIGUINT64=mt([32,0])),rt.BIGINT64||(rt.BIGINT64=mt([32,0])),rt.BUFFER||(rt.BUFFER=mt([32,0]));var Yi=rt.DATA,Vi=rt.BUFFER;Ne.free=function(e){if(rl.isBuffer(e))Vi[Sr.log2(e.length)].push(e);else{if(Object.prototype.toString.call(e)!=="[object ArrayBuffer]"&&(e=e.buffer),!e)return;var t=e.length||e.byteLength,n=Sr.log2(t)|0;Yi[n].push(e)}};function nl(r){if(r){var e=r.length||r.byteLength,t=Sr.log2(e);Yi[t].push(r)}}function Tg(r){nl(r.buffer)}Ne.freeUint8=Ne.freeUint16=Ne.freeUint32=Ne.freeBigUint64=Ne.freeInt8=Ne.freeInt16=Ne.freeInt32=Ne.freeBigInt64=Ne.freeFloat32=Ne.freeFloat=Ne.freeFloat64=Ne.freeDouble=Ne.freeUint8Clamped=Ne.freeDataView=Tg,Ne.freeArrayBuffer=nl,Ne.freeBuffer=function(e){Vi[Sr.log2(e.length)].push(e)},Ne.malloc=function(e,t){if(t===void 0||t==="arraybuffer")return St(e);switch(t){case"uint8":return Eo(e);case"uint16":return il(e);case"uint32":return sl(e);case"int8":return ol(e);case"int16":return al(e);case"int32":return Al(e);case"float":case"float32":return ll(e);case"double":case"float64":return cl(e);case"uint8_clamped":return ul(e);case"bigint64":return dl(e);case"biguint64":return hl(e);case"buffer":return gl(e);case"data":case"dataview":return fl(e);default:return null}return null};function St(e){var e=Sr.nextPow2(e),t=Sr.log2(e),n=Yi[t];return n.length>0?n.pop():new ArrayBuffer(e)}Ne.mallocArrayBuffer=St;function Eo(r){return new Uint8Array(St(r),0,r)}Ne.mallocUint8=Eo;function il(r){return new Uint16Array(St(2*r),0,r)}Ne.mallocUint16=il;function sl(r){return new Uint32Array(St(4*r),0,r)}Ne.mallocUint32=sl;function ol(r){return new Int8Array(St(r),0,r)}Ne.mallocInt8=ol;function al(r){return new Int16Array(St(2*r),0,r)}Ne.mallocInt16=al;function Al(r){return new Int32Array(St(4*r),0,r)}Ne.mallocInt32=Al;function ll(r){return new Float32Array(St(4*r),0,r)}Ne.mallocFloat32=Ne.mallocFloat=ll;function cl(r){return new Float64Array(St(8*r),0,r)}Ne.mallocFloat64=Ne.mallocDouble=cl;function ul(r){return yg?new Uint8ClampedArray(St(r),0,r):Eo(r)}Ne.mallocUint8Clamped=ul;function hl(r){return Bg?new BigUint64Array(St(8*r),0,r):null}Ne.mallocBigUint64=hl;function dl(r){return Qg?new BigInt64Array(St(8*r),0,r):null}Ne.mallocBigInt64=dl;function fl(r){return new DataView(St(r),0,r)}Ne.mallocDataView=fl;function gl(r){r=Sr.nextPow2(r);var e=Sr.log2(r),t=Vi[e];return t.length>0?t.pop():new rl(r)}Ne.mallocBuffer=gl,Ne.clearCache=function(){for(var e=0;e<32;++e)rt.UINT8[e].length=0,rt.UINT16[e].length=0,rt.UINT32[e].length=0,rt.INT8[e].length=0,rt.INT16[e].length=0,rt.INT32[e].length=0,rt.FLOAT[e].length=0,rt.DOUBLE[e].length=0,rt.BIGUINT64[e].length=0,rt.BIGINT64[e].length=0,rt.UINT8C[e].length=0,Yi[e].length=0,Vi[e].length=0};var Ki=Jf,Io=XA,gn=Ne,bg=Dg,Ji=null,Co=null,Wi=null;function xg(r){Ji=[r.LINEAR,r.NEAREST_MIPMAP_LINEAR,r.LINEAR_MIPMAP_NEAREST,r.LINEAR_MIPMAP_NEAREST],Co=[r.NEAREST,r.LINEAR,r.NEAREST_MIPMAP_NEAREST,r.NEAREST_MIPMAP_LINEAR,r.LINEAR_MIPMAP_NEAREST,r.LINEAR_MIPMAP_LINEAR],Wi=[r.REPEAT,r.CLAMP_TO_EDGE,r.MIRRORED_REPEAT]}function pl(r){return typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement||typeof HTMLImageElement<"u"&&r instanceof HTMLImageElement||typeof HTMLVideoElement<"u"&&r instanceof HTMLVideoElement||typeof ImageData<"u"&&r instanceof ImageData}var ml=function(r,e){Io.muls(r,e,255)};function vo(r,e,t){var n=r.gl,i=n.getParameter(n.MAX_TEXTURE_SIZE);if(e<0||e>i||t<0||t>i)throw new Error("gl-texture2d: Invalid texture size");return r._shape=[e,t],r.bind(),n.texImage2D(n.TEXTURE_2D,0,r.format,e,t,0,r.format,r.type,null),r._mipLevels=[0],r}function qi(r,e,t,n,i,s){this.gl=r,this.handle=e,this.format=i,this.type=s,this._shape=[t,n],this._mipLevels=[0],this._magFilter=r.NEAREST,this._minFilter=r.NEAREST,this._wrapS=r.CLAMP_TO_EDGE,this._wrapT=r.CLAMP_TO_EDGE,this._anisoSamples=1;var o=this,a=[this._wrapS,this._wrapT];Object.defineProperties(a,[{get:function(){return o._wrapS},set:function(l){return o.wrapS=l}},{get:function(){return o._wrapT},set:function(l){return o.wrapT=l}}]),this._wrapVector=a;var A=[this._shape[0],this._shape[1]];Object.defineProperties(A,[{get:function(){return o._shape[0]},set:function(l){return o.width=l}},{get:function(){return o._shape[1]},set:function(l){return o.height=l}}]),this._shapeVector=A}var ti=qi.prototype;Object.defineProperties(ti,{minFilter:{get:function(){return this._minFilter},set:function(r){this.bind();var e=this.gl;if(this.type===e.FLOAT&&Ji.indexOf(r)>=0&&(e.getExtension("OES_texture_float_linear")||(r=e.NEAREST)),Co.indexOf(r)<0)throw new Error("gl-texture2d: Unknown filter mode "+r);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,r),this._minFilter=r}},magFilter:{get:function(){return this._magFilter},set:function(r){this.bind();var e=this.gl;if(this.type===e.FLOAT&&Ji.indexOf(r)>=0&&(e.getExtension("OES_texture_float_linear")||(r=e.NEAREST)),Co.indexOf(r)<0)throw new Error("gl-texture2d: Unknown filter mode "+r);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,r),this._magFilter=r}},mipSamples:{get:function(){return this._anisoSamples},set:function(r){var e=this._anisoSamples;if(this._anisoSamples=Math.max(r,1)|0,e!==this._anisoSamples){var t=this.gl.getExtension("EXT_texture_filter_anisotropic");t&&this.gl.texParameterf(this.gl.TEXTURE_2D,t.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(r){if(this.bind(),Wi.indexOf(r)<0)throw new Error("gl-texture2d: Unknown wrap mode "+r);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,r),this._wrapS=r}},wrapT:{get:function(){return this._wrapT},set:function(r){if(this.bind(),Wi.indexOf(r)<0)throw new Error("gl-texture2d: Unknown wrap mode "+r);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,r),this._wrapT=r}},wrap:{get:function(){return this._wrapVector},set:function(r){if(Array.isArray(r)||(r=[r,r]),r.length!==2)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var e=0;e<2;++e)if(Wi.indexOf(r[e])<0)throw new Error("gl-texture2d: Unknown wrap mode "+r);this._wrapS=r[0],this._wrapT=r[1];var t=this.gl;return this.bind(),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,this._wrapS),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,this._wrapT),r}},shape:{get:function(){return this._shapeVector},set:function(r){if(!Array.isArray(r))r=[r|0,r|0];else if(r.length!==2)throw new Error("gl-texture2d: Invalid texture shape");return vo(this,r[0]|0,r[1]|0),[r[0]|0,r[1]|0]}},width:{get:function(){return this._shape[0]},set:function(r){return r=r|0,vo(this,r,this._shape[1]),r}},height:{get:function(){return this._shape[1]},set:function(r){return r=r|0,vo(this,this._shape[0],r),r}}}),ti.bind=function(r){var e=this.gl;return r!==void 0&&e.activeTexture(e.TEXTURE0+(r|0)),e.bindTexture(e.TEXTURE_2D,this.handle),r!==void 0?r|0:e.getParameter(e.ACTIVE_TEXTURE)-e.TEXTURE0},ti.dispose=function(){this.gl.deleteTexture(this.handle)},ti.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var r=Math.min(this._shape[0],this._shape[1]),e=0;r>0;++e,r>>>=1)this._mipLevels.indexOf(e)<0&&this._mipLevels.push(e)},ti.setPixels=function(r,e,t,n){var i=this.gl;this.bind(),Array.isArray(e)?(n=t,t=e[1]|0,e=e[0]|0):(e=e||0,t=t||0),n=n||0;var s=pl(r)?r:r.raw;if(s){var o=this._mipLevels.indexOf(n)<0;o?(i.texImage2D(i.TEXTURE_2D,0,this.format,this.format,this.type,s),this._mipLevels.push(n)):i.texSubImage2D(i.TEXTURE_2D,n,e,t,this.format,this.type,s)}else if(r.shape&&r.stride&&r.data){if(r.shape.length<2||e+r.shape[1]>this._shape[1]>>>n||t+r.shape[0]>this._shape[0]>>>n||e<0||t<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");wg(i,e,t,n,this.format,this.type,this._mipLevels,r)}else throw new Error("gl-texture2d: Unsupported data type")};function El(r,e){return r.length===3?e[2]===1&&e[1]===r[0]*r[2]&&e[0]===r[2]:e[0]===1&&e[1]===r[0]}function wg(r,e,t,n,i,s,o,a){var A=a.dtype,l=a.shape.slice();if(l.length<2||l.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var c=0,u=0,h=El(l,a.stride.slice());if(A==="float32"?c=r.FLOAT:A==="float64"?(c=r.FLOAT,h=!1,A="float32"):A==="uint8"?c=r.UNSIGNED_BYTE:(c=r.UNSIGNED_BYTE,h=!1,A="uint8"),l.length===2)u=r.LUMINANCE,l=[l[0],l[1],1],a=Ki(a.data,l,[a.stride[0],a.stride[1],1],a.offset);else if(l.length===3){if(l[2]===1)u=r.ALPHA;else if(l[2]===2)u=r.LUMINANCE_ALPHA;else if(l[2]===3)u=r.RGB;else if(l[2]===4)u=r.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");l[2]}else throw new Error("gl-texture2d: Invalid shape for texture");if((u===r.LUMINANCE||u===r.ALPHA)&&(i===r.LUMINANCE||i===r.ALPHA)&&(u=i),u!==i)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var d=a.size,f=o.indexOf(n)<0;if(f&&o.push(n),c===s&&h)a.offset===0&&a.data.length===d?f?r.texImage2D(r.TEXTURE_2D,n,i,l[0],l[1],0,i,s,a.data):r.texSubImage2D(r.TEXTURE_2D,n,e,t,l[0],l[1],i,s,a.data):f?r.texImage2D(r.TEXTURE_2D,n,i,l[0],l[1],0,i,s,a.data.subarray(a.offset,a.offset+d)):r.texSubImage2D(r.TEXTURE_2D,n,e,t,l[0],l[1],i,s,a.data.subarray(a.offset,a.offset+d));else{var g;s===r.FLOAT?g=gn.mallocFloat32(d):g=gn.mallocUint8(d);var p=Ki(g,l,[l[2],l[2]*l[0],1]);c===r.FLOAT&&s===r.UNSIGNED_BYTE?ml(p,a):Io.assign(p,a),f?r.texImage2D(r.TEXTURE_2D,n,i,l[0],l[1],0,i,s,g.subarray(0,d)):r.texSubImage2D(r.TEXTURE_2D,n,e,t,l[0],l[1],i,s,g.subarray(0,d)),s===r.FLOAT?gn.freeFloat32(g):gn.freeUint8(g)}}function yo(r){var e=r.createTexture();return r.bindTexture(r.TEXTURE_2D,e),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),e}function Il(r,e,t,n,i){var s=r.getParameter(r.MAX_TEXTURE_SIZE);if(e<0||e>s||t<0||t>s)throw new Error("gl-texture2d: Invalid texture shape");if(i===r.FLOAT&&!r.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var o=yo(r);return r.texImage2D(r.TEXTURE_2D,0,n,e,t,0,n,i,null),new qi(r,o,e,t,n,i)}function Sg(r,e,t,n,i,s){var o=yo(r);return r.texImage2D(r.TEXTURE_2D,0,i,i,s,e),new qi(r,o,t,n,i,s)}function Rg(r,e){var t=e.dtype,n=e.shape.slice(),i=r.getParameter(r.MAX_TEXTURE_SIZE);if(n[0]<0||n[0]>i||n[1]<0||n[1]>i)throw new Error("gl-texture2d: Invalid texture size");var s=El(n,e.stride.slice()),o=0;t==="float32"?o=r.FLOAT:t==="float64"?(o=r.FLOAT,s=!1,t="float32"):t==="uint8"?o=r.UNSIGNED_BYTE:(o=r.UNSIGNED_BYTE,s=!1,t="uint8");var a=0;if(n.length===2)a=r.LUMINANCE,n=[n[0],n[1],1],e=Ki(e.data,n,[e.stride[0],e.stride[1],1],e.offset);else if(n.length===3)if(n[2]===1)a=r.ALPHA;else if(n[2]===2)a=r.LUMINANCE_ALPHA;else if(n[2]===3)a=r.RGB;else if(n[2]===4)a=r.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");else throw new Error("gl-texture2d: Invalid shape for texture");o===r.FLOAT&&!r.getExtension("OES_texture_float")&&(o=r.UNSIGNED_BYTE,s=!1);var A,l,c=e.size;if(s)e.offset===0&&e.data.length===c?A=e.data:A=e.data.subarray(e.offset,e.offset+c);else{var u=[n[2],n[2]*n[0],1];l=gn.malloc(c,t);var h=Ki(l,n,u,0);(t==="float32"||t==="float64")&&o===r.UNSIGNED_BYTE?ml(h,e):Io.assign(h,e),A=l.subarray(0,c)}var d=yo(r);return r.texImage2D(r.TEXTURE_2D,0,a,n[0],n[1],0,a,o,A),s||gn.free(l),new qi(r,d,n[0],n[1],a,o)}function Dg(r){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(Ji||xg(r),typeof arguments[1]=="number")return Il(r,arguments[1],arguments[2],arguments[3]||r.RGBA,arguments[4]||r.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return Il(r,arguments[1][0]|0,arguments[1][1]|0,arguments[2]||r.RGBA,arguments[3]||r.UNSIGNED_BYTE);if(typeof arguments[1]=="object"){var e=arguments[1],t=pl(e)?e:e.raw;if(t)return Sg(r,t,e.width|0,e.height|0,arguments[2]||r.RGBA,arguments[3]||r.UNSIGNED_BYTE);if(e.shape&&e.data&&e.stride)return Rg(r,e)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")}const Xi=ao(bg);var Cl={},vl=_g;function _g(r,e){for(var t={},n=0;n<r.length;++n)for(var i=r[n].name,s=i.split("."),o=t,a=0;a<s.length;++a){var A=s[a].split("[");if(A.length>1){A[0]in o||(o[A[0]]=[]),o=o[A[0]];for(var l=1;l<A.length;++l){var c=parseInt(A[l]);l<A.length-1||a<s.length-1?(c in o||(l<A.length-1?o[c]=[]:o[c]={}),o=o[c]):e?o[c]=n:o[c]=r[n].type}}else a<s.length-1?(A[0]in o||(o[A[0]]={}),o=o[A[0]]):e?o[A[0]]=n:o[A[0]]=r[n].type}return t}function ri(r,e,t){this.shortMessage=e||"",this.longMessage=t||"",this.rawError=r||"",this.message="gl-shader: "+(e||r||"")+(t?`
|
92
|
-
`+t:""),this.stack=new Error().stack}ri.prototype=new Error,ri.prototype.name="GLError",ri.prototype.constructor=ri;var ji=ri,Lg=vl,Vr=ji,Fg=kg;function yl(r){return function(){return r}}function Bo(r,e){for(var t=new Array(r),n=0;n<r;++n)t[n]=e;return t}function kg(r,e,t,n){function i(u){return function(h,d,f){return h.getUniform(d.program,f[u])}}function s(u){return function(d){for(var f=o("",u),g=0;g<f.length;++g){var p=f[g],v=p[0],T=p[1];if(n[T]){var b=d;if(typeof v=="string"&&(v.indexOf(".")===0||v.indexOf("[")===0)){var y=v;if(v.indexOf(".")===0&&(y=v.slice(1)),y.indexOf("]")===y.length-1){var w=y.indexOf("["),R=y.slice(0,w),k=y.slice(w+1,y.length-1);b=R?d[R][k]:d[k]}else b=d[y]}var $=t[T].type,W;switch($){case"bool":case"int":case"sampler2D":case"samplerCube":r.uniform1i(n[T],b);break;case"float":r.uniform1f(n[T],b);break;default:var O=$.indexOf("vec");if(0<=O&&O<=1&&$.length===4+O){if(W=$.charCodeAt($.length-1)-48,W<2||W>4)throw new Vr("","Invalid data type");switch($.charAt(0)){case"b":case"i":r["uniform"+W+"iv"](n[T],b);break;case"v":r["uniform"+W+"fv"](n[T],b);break;default:throw new Vr("","Unrecognized data type for vector "+name+": "+$)}}else if($.indexOf("mat")===0&&$.length===4){if(W=$.charCodeAt($.length-1)-48,W<2||W>4)throw new Vr("","Invalid uniform dimension type for matrix "+name+": "+$);r["uniformMatrix"+W+"fv"](n[T],!1,b);break}else throw new Vr("","Unknown uniform data type for "+name+": "+$)}}}}}function o(u,h){if(typeof h!="object")return[[u,h]];var d=[];for(var f in h){var g=h[f],p=u;parseInt(f)+""===f?p+="["+f+"]":p+="."+f,typeof g=="object"?d.push.apply(d,o(p,g)):d.push([p,g])}return d}function a(u){switch(u){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":return 0;case"float":return 0;default:var h=u.indexOf("vec");if(0<=h&&h<=1&&u.length===4+h){var d=u.charCodeAt(u.length-1)-48;if(d<2||d>4)throw new Vr("","Invalid data type");return u.charAt(0)==="b"?Bo(d,!1):Bo(d,0)}else if(u.indexOf("mat")===0&&u.length===4){var d=u.charCodeAt(u.length-1)-48;if(d<2||d>4)throw new Vr("","Invalid uniform dimension type for matrix "+name+": "+u);return Bo(d*d,0)}else throw new Vr("","Unknown uniform data type for "+name+": "+u)}}function A(u,h,d){if(typeof d=="object"){var f=l(d);Object.defineProperty(u,h,{get:yl(f),set:s(d),enumerable:!0,configurable:!1})}else n[d]?Object.defineProperty(u,h,{get:i(d),set:s(d),enumerable:!0,configurable:!1}):u[h]=a(t[d].type)}function l(u){var h;if(Array.isArray(u)){h=new Array(u.length);for(var d=0;d<u.length;++d)A(h,d,u[d])}else{h={};for(var f in u)A(h,f,u[f])}return h}var c=Lg(t,!0);return{get:yl(l(c)),set:s(c),enumerable:!0,configurable:!0}}var Ng=Og,Qo=ji;function Bl(r,e,t,n,i,s){this._gl=r,this._wrapper=e,this._index=t,this._locations=n,this._dimension=i,this._constFunc=s}var To=Bl.prototype;To.pointer=function(e,t,n,i){var s=this,o=s._gl,a=s._locations[s._index];o.vertexAttribPointer(a,s._dimension,e||o.FLOAT,!!t,n||0,i||0),o.enableVertexAttribArray(a)},To.set=function(r,e,t,n){return this._constFunc(this._locations[this._index],r,e,t,n)},Object.defineProperty(To,"location",{get:function(){return this._locations[this._index]},set:function(r){return r!==this._locations[this._index]&&(this._locations[this._index]=r|0,this._wrapper.program=null),r|0}});var Mg=[function(r,e,t){return t.length===void 0?r.vertexAttrib1f(e,t):r.vertexAttrib1fv(e,t)},function(r,e,t,n){return t.length===void 0?r.vertexAttrib2f(e,t,n):r.vertexAttrib2fv(e,t)},function(r,e,t,n,i){return t.length===void 0?r.vertexAttrib3f(e,t,n,i):r.vertexAttrib3fv(e,t)},function(r,e,t,n,i,s){return t.length===void 0?r.vertexAttrib4f(e,t,n,i,s):r.vertexAttrib4fv(e,t)}];function bo(r,e,t,n,i,s,o){var a=Mg[i],A=new Bl(r,e,t,n,i,a);Object.defineProperty(s,o,{set:function(l){return r.disableVertexAttribArray(n[t]),a(r,n[t],l),l},get:function(){return A},enumerable:!0})}function Pg(r,e,t,n,i,s,o){for(var a=new Array(i),A=new Array(i),l=0;l<i;++l)bo(r,e,t[l],n,i,a,l),A[l]=a[l];Object.defineProperty(a,"location",{set:function(h){if(Array.isArray(h))for(var d=0;d<i;++d)A[d].location=h[d];else for(var d=0;d<i;++d)A[d].location=h+d;return h},get:function(){for(var h=new Array(i),d=0;d<i;++d)h[d]=n[t[d]];return h},enumerable:!0}),a.pointer=function(h,d,f,g){h=h||r.FLOAT,d=!!d,f=f||i*i,g=g||0;for(var p=0;p<i;++p){var v=n[t[p]];r.vertexAttribPointer(v,i,h,d,f,g+p*i),r.enableVertexAttribArray(v)}};var c=new Array(i),u=r["vertexAttrib"+i+"fv"];Object.defineProperty(s,o,{set:function(h){for(var d=0;d<i;++d){var f=n[t[d]];if(r.disableVertexAttribArray(f),Array.isArray(h[0]))u.call(r,f,h[d]);else{for(var g=0;g<i;++g)c[g]=h[i*d+g];u.call(r,f,c)}}return h},get:function(){return a},enumerable:!0})}function Og(r,e,t,n){for(var i={},s=0,o=t.length;s<o;++s){var a=t[s],A=a.name,l=a.type,c=a.locations;switch(l){case"bool":case"int":case"float":bo(r,e,c[0],n,1,i,A);break;default:if(l.indexOf("vec")>=0){var u=l.charCodeAt(l.length-1)-48;if(u<2||u>4)throw new Qo("","Invalid data type for attribute "+A+": "+l);bo(r,e,c[0],n,u,i,A)}else if(l.indexOf("mat")>=0){var u=l.charCodeAt(l.length-1)-48;if(u<2||u>4)throw new Qo("","Invalid data type for attribute "+A+": "+l);Pg(r,e,c,n,u,i,A)}else throw new Qo("","Unknown data type for attribute "+A+": "+l);break}}return i}var xo={},Ql={};(function(r){(function(){var e={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function t(a){return i(o(a),arguments)}function n(a,A){return t.apply(null,[a].concat(A||[]))}function i(a,A){var l=1,c=a.length,u,h="",d,f,g,p,v,T,b,y;for(d=0;d<c;d++)if(typeof a[d]=="string")h+=a[d];else if(typeof a[d]=="object"){if(g=a[d],g.keys)for(u=A[l],f=0;f<g.keys.length;f++){if(u==null)throw new Error(t('[sprintf] Cannot access property "%s" of undefined value "%s"',g.keys[f],g.keys[f-1]));u=u[g.keys[f]]}else g.param_no?u=A[g.param_no]:u=A[l++];if(e.not_type.test(g.type)&&e.not_primitive.test(g.type)&&u instanceof Function&&(u=u()),e.numeric_arg.test(g.type)&&typeof u!="number"&&isNaN(u))throw new TypeError(t("[sprintf] expecting number but found %T",u));switch(e.number.test(g.type)&&(b=u>=0),g.type){case"b":u=parseInt(u,10).toString(2);break;case"c":u=String.fromCharCode(parseInt(u,10));break;case"d":case"i":u=parseInt(u,10);break;case"j":u=JSON.stringify(u,null,g.width?parseInt(g.width):0);break;case"e":u=g.precision?parseFloat(u).toExponential(g.precision):parseFloat(u).toExponential();break;case"f":u=g.precision?parseFloat(u).toFixed(g.precision):parseFloat(u);break;case"g":u=g.precision?String(Number(u.toPrecision(g.precision))):parseFloat(u);break;case"o":u=(parseInt(u,10)>>>0).toString(8);break;case"s":u=String(u),u=g.precision?u.substring(0,g.precision):u;break;case"t":u=String(!!u),u=g.precision?u.substring(0,g.precision):u;break;case"T":u=Object.prototype.toString.call(u).slice(8,-1).toLowerCase(),u=g.precision?u.substring(0,g.precision):u;break;case"u":u=parseInt(u,10)>>>0;break;case"v":u=u.valueOf(),u=g.precision?u.substring(0,g.precision):u;break;case"x":u=(parseInt(u,10)>>>0).toString(16);break;case"X":u=(parseInt(u,10)>>>0).toString(16).toUpperCase();break}e.json.test(g.type)?h+=u:(e.number.test(g.type)&&(!b||g.sign)?(y=b?"+":"-",u=u.toString().replace(e.sign,"")):y="",v=g.pad_char?g.pad_char==="0"?"0":g.pad_char.charAt(1):" ",T=g.width-(y+u).length,p=g.width&&T>0?v.repeat(T):"",h+=g.align?y+u+p:v==="0"?y+p+u:p+y+u)}return h}var s=Object.create(null);function o(a){if(s[a])return s[a];for(var A=a,l,c=[],u=0;A;){if((l=e.text.exec(A))!==null)c.push(l[0]);else if((l=e.modulo.exec(A))!==null)c.push("%");else if((l=e.placeholder.exec(A))!==null){if(l[2]){u|=1;var h=[],d=l[2],f=[];if((f=e.key.exec(d))!==null)for(h.push(f[1]);(d=d.substring(f[0].length))!=="";)if((f=e.key_access.exec(d))!==null)h.push(f[1]);else if((f=e.index_access.exec(d))!==null)h.push(f[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");l[2]=h}else u|=2;if(u===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");c.push({placeholder:l[0],param_no:l[1],keys:l[2],sign:l[3],pad_char:l[4],align:l[5],width:l[6],precision:l[7],type:l[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");A=A.substring(l[0].length)}return s[a]=c}r.sprintf=t,r.vsprintf=n,typeof window<"u"&&(window.sprintf=t,window.vsprintf=n)})()})(Ql);var Ug={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34e3:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",34070:"TEXTURE_CUBE_MAP_NEGATIVE_X",34071:"TEXTURE_CUBE_MAP_POSITIVE_Y",34072:"TEXTURE_CUBE_MAP_NEGATIVE_Y",34073:"TEXTURE_CUBE_MAP_POSITIVE_Z",34074:"TEXTURE_CUBE_MAP_NEGATIVE_Z",34076:"MAX_CUBE_MAP_TEXTURE_SIZE",34338:"VERTEX_ATTRIB_ARRAY_ENABLED",34339:"VERTEX_ATTRIB_ARRAY_SIZE",34340:"VERTEX_ATTRIB_ARRAY_STRIDE",34341:"VERTEX_ATTRIB_ARRAY_TYPE",34342:"CURRENT_VERTEX_ATTRIB",34373:"VERTEX_ATTRIB_ARRAY_POINTER",34466:"NUM_COMPRESSED_TEXTURE_FORMATS",34467:"COMPRESSED_TEXTURE_FORMATS",34660:"BUFFER_SIZE",34661:"BUFFER_USAGE",34816:"STENCIL_BACK_FUNC",34817:"STENCIL_BACK_FAIL",34818:"STENCIL_BACK_PASS_DEPTH_FAIL",34819:"STENCIL_BACK_PASS_DEPTH_PASS",34877:"BLEND_EQUATION_ALPHA",34921:"MAX_VERTEX_ATTRIBS",34922:"VERTEX_ATTRIB_ARRAY_NORMALIZED",34930:"MAX_TEXTURE_IMAGE_UNITS",34962:"ARRAY_BUFFER",34963:"ELEMENT_ARRAY_BUFFER",34964:"ARRAY_BUFFER_BINDING",34965:"ELEMENT_ARRAY_BUFFER_BINDING",34975:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",35040:"STREAM_DRAW",35044:"STATIC_DRAW",35048:"DYNAMIC_DRAW",35632:"FRAGMENT_SHADER",35633:"VERTEX_SHADER",35660:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",35661:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",35663:"SHADER_TYPE",35664:"FLOAT_VEC2",35665:"FLOAT_VEC3",35666:"FLOAT_VEC4",35667:"INT_VEC2",35668:"INT_VEC3",35669:"INT_VEC4",35670:"BOOL",35671:"BOOL_VEC2",35672:"BOOL_VEC3",35673:"BOOL_VEC4",35674:"FLOAT_MAT2",35675:"FLOAT_MAT3",35676:"FLOAT_MAT4",35678:"SAMPLER_2D",35680:"SAMPLER_CUBE",35712:"DELETE_STATUS",35713:"COMPILE_STATUS",35714:"LINK_STATUS",35715:"VALIDATE_STATUS",35716:"INFO_LOG_LENGTH",35717:"ATTACHED_SHADERS",35718:"ACTIVE_UNIFORMS",35719:"ACTIVE_UNIFORM_MAX_LENGTH",35720:"SHADER_SOURCE_LENGTH",35721:"ACTIVE_ATTRIBUTES",35722:"ACTIVE_ATTRIBUTE_MAX_LENGTH",35724:"SHADING_LANGUAGE_VERSION",35725:"CURRENT_PROGRAM",36003:"STENCIL_BACK_REF",36004:"STENCIL_BACK_VALUE_MASK",36005:"STENCIL_BACK_WRITEMASK",36006:"FRAMEBUFFER_BINDING",36007:"RENDERBUFFER_BINDING",36048:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",36049:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",36050:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",36051:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",36053:"FRAMEBUFFER_COMPLETE",36054:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",36055:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",36057:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",36061:"FRAMEBUFFER_UNSUPPORTED",36064:"COLOR_ATTACHMENT0",36096:"DEPTH_ATTACHMENT",36128:"STENCIL_ATTACHMENT",36160:"FRAMEBUFFER",36161:"RENDERBUFFER",36162:"RENDERBUFFER_WIDTH",36163:"RENDERBUFFER_HEIGHT",36164:"RENDERBUFFER_INTERNAL_FORMAT",36168:"STENCIL_INDEX8",36176:"RENDERBUFFER_RED_SIZE",36177:"RENDERBUFFER_GREEN_SIZE",36178:"RENDERBUFFER_BLUE_SIZE",36179:"RENDERBUFFER_ALPHA_SIZE",36180:"RENDERBUFFER_DEPTH_SIZE",36181:"RENDERBUFFER_STENCIL_SIZE",36194:"RGB565",36336:"LOW_FLOAT",36337:"MEDIUM_FLOAT",36338:"HIGH_FLOAT",36339:"LOW_INT",36340:"MEDIUM_INT",36341:"HIGH_INT",36346:"SHADER_COMPILER",36347:"MAX_VERTEX_UNIFORM_VECTORS",36348:"MAX_VARYING_VECTORS",36349:"MAX_FRAGMENT_UNIFORM_VECTORS",37440:"UNPACK_FLIP_Y_WEBGL",37441:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",37442:"CONTEXT_LOST_WEBGL",37443:"UNPACK_COLORSPACE_CONVERSION_WEBGL",37444:"BROWSER_DEFAULT_WEBGL"},Gg=Ug,Hg=function(e){return Gg[e]},Tl=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","uint","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"],$g=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"],bl=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"],Yg=Tl,Vg=Yg.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"]),wo=bl;wo=wo.slice().filter(function(r){return!/^(gl\_|texture)/.test(r)});var Kg=wo.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"]),Jg=n0,Wg=Tl,xl=$g,qg=bl,Xg=Vg,jg=Kg,Kt=999,wl=9999,So=0,Ro=1,Sl=2,Rl=3,Dl=4,ni=5,zg=6,Zg=7,e0=8,_l=9,t0=10,Ll=11,r0=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"];function n0(r){var e=0,t=0,n=Kt,i,s,o=[],a=[],A=1,l=0,c=0,u=!1,h=!1,d="",f;r=r||{};var g=qg,p=Wg;r.version==="300 es"&&(g=jg,p=Xg);for(var v={},T={},e=0;e<g.length;e++)v[g[e]]=!0;for(var e=0;e<p.length;e++)T[p[e]]=!0;return function(X){return a=[],X!==null?y(X):w()};function b(X){X.length&&a.push({type:r0[n],data:X,position:c,line:A,column:l})}function y(X){e=0,X.toString&&(X=X.toString()),d+=X.replace(/\r\n/g,`
|
93
|
-
`),f=d.length;for(var
|
94
|
-
`:
|
95
|
-
`)&&s!=="\\"?(b(o.join("")),n=Kt,e):(o.push(i),s=i,e+1)}function
|
91
|
+
*/(function(r){var e=$i,t=mo,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;r.Buffer=a,r.SlowBuffer=T,r.INSPECT_MAX_BYTES=50;var i=2147483647;r.kMaxLength=i,a.TYPED_ARRAY_SUPPORT=s(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function s(){try{var Q=new Uint8Array(1),m={foo:function(){return 42}};return Object.setPrototypeOf(m,Uint8Array.prototype),Object.setPrototypeOf(Q,m),Q.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function o(Q){if(Q>i)throw new RangeError('The value "'+Q+'" is invalid for option "size"');var m=new Uint8Array(Q);return Object.setPrototypeOf(m,a.prototype),m}function a(Q,m,E){if(typeof Q=="number"){if(typeof m=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return u(Q)}return l(Q,m,E)}a.poolSize=8192;function l(Q,m,E){if(typeof Q=="string")return h(Q,m);if(ArrayBuffer.isView(Q))return f(Q);if(Q==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Q);if(we(Q,ArrayBuffer)||Q&&we(Q.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(we(Q,SharedArrayBuffer)||Q&&we(Q.buffer,SharedArrayBuffer)))return g(Q,m,E);if(typeof Q=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var w=Q.valueOf&&Q.valueOf();if(w!=null&&w!==Q)return a.from(w,m,E);var M=p(Q);if(M)return M;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Q[Symbol.toPrimitive]=="function")return a.from(Q[Symbol.toPrimitive]("string"),m,E);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Q)}a.from=function(Q,m,E){return l(Q,m,E)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function A(Q){if(typeof Q!="number")throw new TypeError('"size" argument must be of type number');if(Q<0)throw new RangeError('The value "'+Q+'" is invalid for option "size"')}function c(Q,m,E){return A(Q),Q<=0?o(Q):m!==void 0?typeof E=="string"?o(Q).fill(m,E):o(Q).fill(m):o(Q)}a.alloc=function(Q,m,E){return c(Q,m,E)};function u(Q){return A(Q),o(Q<0?0:C(Q)|0)}a.allocUnsafe=function(Q){return u(Q)},a.allocUnsafeSlow=function(Q){return u(Q)};function h(Q,m){if((typeof m!="string"||m==="")&&(m="utf8"),!a.isEncoding(m))throw new TypeError("Unknown encoding: "+m);var E=b(Q,m)|0,w=o(E),M=w.write(Q,m);return M!==E&&(w=w.slice(0,M)),w}function d(Q){for(var m=Q.length<0?0:C(Q.length)|0,E=o(m),w=0;w<m;w+=1)E[w]=Q[w]&255;return E}function f(Q){if(we(Q,Uint8Array)){var m=new Uint8Array(Q);return g(m.buffer,m.byteOffset,m.byteLength)}return d(Q)}function g(Q,m,E){if(m<0||Q.byteLength<m)throw new RangeError('"offset" is outside of buffer bounds');if(Q.byteLength<m+(E||0))throw new RangeError('"length" is outside of buffer bounds');var w;return m===void 0&&E===void 0?w=new Uint8Array(Q):E===void 0?w=new Uint8Array(Q,m):w=new Uint8Array(Q,m,E),Object.setPrototypeOf(w,a.prototype),w}function p(Q){if(a.isBuffer(Q)){var m=C(Q.length)|0,E=o(m);return E.length===0||Q.copy(E,0,0,m),E}if(Q.length!==void 0)return typeof Q.length!="number"||qe(Q.length)?o(0):d(Q);if(Q.type==="Buffer"&&Array.isArray(Q.data))return d(Q.data)}function C(Q){if(Q>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return Q|0}function T(Q){return+Q!=Q&&(Q=0),a.alloc(+Q)}a.isBuffer=function(m){return m!=null&&m._isBuffer===!0&&m!==a.prototype},a.compare=function(m,E){if(we(m,Uint8Array)&&(m=a.from(m,m.offset,m.byteLength)),we(E,Uint8Array)&&(E=a.from(E,E.offset,E.byteLength)),!a.isBuffer(m)||!a.isBuffer(E))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(m===E)return 0;for(var w=m.length,M=E.length,z=0,j=Math.min(w,M);z<j;++z)if(m[z]!==E[z]){w=m[z],M=E[z];break}return w<M?-1:M<w?1:0},a.isEncoding=function(m){switch(String(m).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(m,E){if(!Array.isArray(m))throw new TypeError('"list" argument must be an Array of Buffers');if(m.length===0)return a.alloc(0);var w;if(E===void 0)for(E=0,w=0;w<m.length;++w)E+=m[w].length;var M=a.allocUnsafe(E),z=0;for(w=0;w<m.length;++w){var j=m[w];if(we(j,Uint8Array))z+j.length>M.length?a.from(j).copy(M,z):Uint8Array.prototype.set.call(M,j,z);else if(a.isBuffer(j))j.copy(M,z);else throw new TypeError('"list" argument must be an Array of Buffers');z+=j.length}return M};function b(Q,m){if(a.isBuffer(Q))return Q.length;if(ArrayBuffer.isView(Q)||we(Q,ArrayBuffer))return Q.byteLength;if(typeof Q!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Q);var E=Q.length,w=arguments.length>2&&arguments[2]===!0;if(!w&&E===0)return 0;for(var M=!1;;)switch(m){case"ascii":case"latin1":case"binary":return E;case"utf8":case"utf-8":return Le(Q).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E*2;case"hex":return E>>>1;case"base64":return Te(Q).length;default:if(M)return w?-1:Le(Q).length;m=(""+m).toLowerCase(),M=!0}}a.byteLength=b;function y(Q,m,E){var w=!1;if((m===void 0||m<0)&&(m=0),m>this.length||((E===void 0||E>this.length)&&(E=this.length),E<=0)||(E>>>=0,m>>>=0,E<=m))return"";for(Q||(Q="utf8");;)switch(Q){case"hex":return S(this,m,E);case"utf8":case"utf-8":return le(this,m,E);case"ascii":return X(this,m,E);case"latin1":case"binary":return _(this,m,E);case"base64":return ee(this,m,E);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,m,E);default:if(w)throw new TypeError("Unknown encoding: "+Q);Q=(Q+"").toLowerCase(),w=!0}}a.prototype._isBuffer=!0;function x(Q,m,E){var w=Q[m];Q[m]=Q[E],Q[E]=w}a.prototype.swap16=function(){var m=this.length;if(m%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var E=0;E<m;E+=2)x(this,E,E+1);return this},a.prototype.swap32=function(){var m=this.length;if(m%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var E=0;E<m;E+=4)x(this,E,E+3),x(this,E+1,E+2);return this},a.prototype.swap64=function(){var m=this.length;if(m%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var E=0;E<m;E+=8)x(this,E,E+7),x(this,E+1,E+6),x(this,E+2,E+5),x(this,E+3,E+4);return this},a.prototype.toString=function(){var m=this.length;return m===0?"":arguments.length===0?le(this,0,m):y.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(m){if(!a.isBuffer(m))throw new TypeError("Argument must be a Buffer");return this===m?!0:a.compare(this,m)===0},a.prototype.inspect=function(){var m="",E=r.INSPECT_MAX_BYTES;return m=this.toString("hex",0,E).replace(/(.{2})/g,"$1 ").trim(),this.length>E&&(m+=" ... "),"<Buffer "+m+">"},n&&(a.prototype[n]=a.prototype.inspect),a.prototype.compare=function(m,E,w,M,z){if(we(m,Uint8Array)&&(m=a.from(m,m.offset,m.byteLength)),!a.isBuffer(m))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof m);if(E===void 0&&(E=0),w===void 0&&(w=m?m.length:0),M===void 0&&(M=0),z===void 0&&(z=this.length),E<0||w>m.length||M<0||z>this.length)throw new RangeError("out of range index");if(M>=z&&E>=w)return 0;if(M>=z)return-1;if(E>=w)return 1;if(E>>>=0,w>>>=0,M>>>=0,z>>>=0,this===m)return 0;for(var j=z-M,Ie=w-E,be=Math.min(j,Ie),De=this.slice(M,z),ke=m.slice(E,w),_e=0;_e<be;++_e)if(De[_e]!==ke[_e]){j=De[_e],Ie=ke[_e];break}return j<Ie?-1:Ie<j?1:0};function R(Q,m,E,w,M){if(Q.length===0)return-1;if(typeof E=="string"?(w=E,E=0):E>2147483647?E=2147483647:E<-2147483648&&(E=-2147483648),E=+E,qe(E)&&(E=M?0:Q.length-1),E<0&&(E=Q.length+E),E>=Q.length){if(M)return-1;E=Q.length-1}else if(E<0)if(M)E=0;else return-1;if(typeof m=="string"&&(m=a.from(m,w)),a.isBuffer(m))return m.length===0?-1:k(Q,m,E,w,M);if(typeof m=="number")return m=m&255,typeof Uint8Array.prototype.indexOf=="function"?M?Uint8Array.prototype.indexOf.call(Q,m,E):Uint8Array.prototype.lastIndexOf.call(Q,m,E):k(Q,[m],E,w,M);throw new TypeError("val must be string, number or Buffer")}function k(Q,m,E,w,M){var z=1,j=Q.length,Ie=m.length;if(w!==void 0&&(w=String(w).toLowerCase(),w==="ucs2"||w==="ucs-2"||w==="utf16le"||w==="utf-16le")){if(Q.length<2||m.length<2)return-1;z=2,j/=2,Ie/=2,E/=2}function be(ct,Nt){return z===1?ct[Nt]:ct.readUInt16BE(Nt*z)}var De;if(M){var ke=-1;for(De=E;De<j;De++)if(be(Q,De)===be(m,ke===-1?0:De-ke)){if(ke===-1&&(ke=De),De-ke+1===Ie)return ke*z}else ke!==-1&&(De-=De-ke),ke=-1}else for(E+Ie>j&&(E=j-Ie),De=E;De>=0;De--){for(var _e=!0,Ft=0;Ft<Ie;Ft++)if(be(Q,De+Ft)!==be(m,Ft)){_e=!1;break}if(_e)return De}return-1}a.prototype.includes=function(m,E,w){return this.indexOf(m,E,w)!==-1},a.prototype.indexOf=function(m,E,w){return R(this,m,E,w,!0)},a.prototype.lastIndexOf=function(m,E,w){return R(this,m,E,w,!1)};function $(Q,m,E,w){E=Number(E)||0;var M=Q.length-E;w?(w=Number(w),w>M&&(w=M)):w=M;var z=m.length;w>z/2&&(w=z/2);for(var j=0;j<w;++j){var Ie=parseInt(m.substr(j*2,2),16);if(qe(Ie))return j;Q[E+j]=Ie}return j}function V(Q,m,E,w){return Me(Le(m,Q.length-E),Q,E,w)}function O(Q,m,E,w){return Me(Ge(m),Q,E,w)}function J(Q,m,E,w){return Me(Te(m),Q,E,w)}function ne(Q,m,E,w){return Me(fe(m,Q.length-E),Q,E,w)}a.prototype.write=function(m,E,w,M){if(E===void 0)M="utf8",w=this.length,E=0;else if(w===void 0&&typeof E=="string")M=E,w=this.length,E=0;else if(isFinite(E))E=E>>>0,isFinite(w)?(w=w>>>0,M===void 0&&(M="utf8")):(M=w,w=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var z=this.length-E;if((w===void 0||w>z)&&(w=z),m.length>0&&(w<0||E<0)||E>this.length)throw new RangeError("Attempt to write outside buffer bounds");M||(M="utf8");for(var j=!1;;)switch(M){case"hex":return $(this,m,E,w);case"utf8":case"utf-8":return V(this,m,E,w);case"ascii":case"latin1":case"binary":return O(this,m,E,w);case"base64":return J(this,m,E,w);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ne(this,m,E,w);default:if(j)throw new TypeError("Unknown encoding: "+M);M=(""+M).toLowerCase(),j=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ee(Q,m,E){return m===0&&E===Q.length?e.fromByteArray(Q):e.fromByteArray(Q.slice(m,E))}function le(Q,m,E){E=Math.min(Q.length,E);for(var w=[],M=m;M<E;){var z=Q[M],j=null,Ie=z>239?4:z>223?3:z>191?2:1;if(M+Ie<=E){var be,De,ke,_e;switch(Ie){case 1:z<128&&(j=z);break;case 2:be=Q[M+1],(be&192)===128&&(_e=(z&31)<<6|be&63,_e>127&&(j=_e));break;case 3:be=Q[M+1],De=Q[M+2],(be&192)===128&&(De&192)===128&&(_e=(z&15)<<12|(be&63)<<6|De&63,_e>2047&&(_e<55296||_e>57343)&&(j=_e));break;case 4:be=Q[M+1],De=Q[M+2],ke=Q[M+3],(be&192)===128&&(De&192)===128&&(ke&192)===128&&(_e=(z&15)<<18|(be&63)<<12|(De&63)<<6|ke&63,_e>65535&&_e<1114112&&(j=_e))}}j===null?(j=65533,Ie=1):j>65535&&(j-=65536,w.push(j>>>10&1023|55296),j=56320|j&1023),w.push(j),M+=Ie}return P(w)}var D=4096;function P(Q){var m=Q.length;if(m<=D)return String.fromCharCode.apply(String,Q);for(var E="",w=0;w<m;)E+=String.fromCharCode.apply(String,Q.slice(w,w+=D));return E}function X(Q,m,E){var w="";E=Math.min(Q.length,E);for(var M=m;M<E;++M)w+=String.fromCharCode(Q[M]&127);return w}function _(Q,m,E){var w="";E=Math.min(Q.length,E);for(var M=m;M<E;++M)w+=String.fromCharCode(Q[M]);return w}function S(Q,m,E){var w=Q.length;(!m||m<0)&&(m=0),(!E||E<0||E>w)&&(E=w);for(var M="",z=m;z<E;++z)M+=Be[Q[z]];return M}function F(Q,m,E){for(var w=Q.slice(m,E),M="",z=0;z<w.length-1;z+=2)M+=String.fromCharCode(w[z]+w[z+1]*256);return M}a.prototype.slice=function(m,E){var w=this.length;m=~~m,E=E===void 0?w:~~E,m<0?(m+=w,m<0&&(m=0)):m>w&&(m=w),E<0?(E+=w,E<0&&(E=0)):E>w&&(E=w),E<m&&(E=m);var M=this.subarray(m,E);return Object.setPrototypeOf(M,a.prototype),M};function W(Q,m,E){if(Q%1!==0||Q<0)throw new RangeError("offset is not uint");if(Q+m>E)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(m,E,w){m=m>>>0,E=E>>>0,w||W(m,E,this.length);for(var M=this[m],z=1,j=0;++j<E&&(z*=256);)M+=this[m+j]*z;return M},a.prototype.readUintBE=a.prototype.readUIntBE=function(m,E,w){m=m>>>0,E=E>>>0,w||W(m,E,this.length);for(var M=this[m+--E],z=1;E>0&&(z*=256);)M+=this[m+--E]*z;return M},a.prototype.readUint8=a.prototype.readUInt8=function(m,E){return m=m>>>0,E||W(m,1,this.length),this[m]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(m,E){return m=m>>>0,E||W(m,2,this.length),this[m]|this[m+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(m,E){return m=m>>>0,E||W(m,2,this.length),this[m]<<8|this[m+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(m,E){return m=m>>>0,E||W(m,4,this.length),(this[m]|this[m+1]<<8|this[m+2]<<16)+this[m+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(m,E){return m=m>>>0,E||W(m,4,this.length),this[m]*16777216+(this[m+1]<<16|this[m+2]<<8|this[m+3])},a.prototype.readIntLE=function(m,E,w){m=m>>>0,E=E>>>0,w||W(m,E,this.length);for(var M=this[m],z=1,j=0;++j<E&&(z*=256);)M+=this[m+j]*z;return z*=128,M>=z&&(M-=Math.pow(2,8*E)),M},a.prototype.readIntBE=function(m,E,w){m=m>>>0,E=E>>>0,w||W(m,E,this.length);for(var M=E,z=1,j=this[m+--M];M>0&&(z*=256);)j+=this[m+--M]*z;return z*=128,j>=z&&(j-=Math.pow(2,8*E)),j},a.prototype.readInt8=function(m,E){return m=m>>>0,E||W(m,1,this.length),this[m]&128?(255-this[m]+1)*-1:this[m]},a.prototype.readInt16LE=function(m,E){m=m>>>0,E||W(m,2,this.length);var w=this[m]|this[m+1]<<8;return w&32768?w|4294901760:w},a.prototype.readInt16BE=function(m,E){m=m>>>0,E||W(m,2,this.length);var w=this[m+1]|this[m]<<8;return w&32768?w|4294901760:w},a.prototype.readInt32LE=function(m,E){return m=m>>>0,E||W(m,4,this.length),this[m]|this[m+1]<<8|this[m+2]<<16|this[m+3]<<24},a.prototype.readInt32BE=function(m,E){return m=m>>>0,E||W(m,4,this.length),this[m]<<24|this[m+1]<<16|this[m+2]<<8|this[m+3]},a.prototype.readFloatLE=function(m,E){return m=m>>>0,E||W(m,4,this.length),t.read(this,m,!0,23,4)},a.prototype.readFloatBE=function(m,E){return m=m>>>0,E||W(m,4,this.length),t.read(this,m,!1,23,4)},a.prototype.readDoubleLE=function(m,E){return m=m>>>0,E||W(m,8,this.length),t.read(this,m,!0,52,8)},a.prototype.readDoubleBE=function(m,E){return m=m>>>0,E||W(m,8,this.length),t.read(this,m,!1,52,8)};function Y(Q,m,E,w,M,z){if(!a.isBuffer(Q))throw new TypeError('"buffer" argument must be a Buffer instance');if(m>M||m<z)throw new RangeError('"value" argument is out of bounds');if(E+w>Q.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(m,E,w,M){if(m=+m,E=E>>>0,w=w>>>0,!M){var z=Math.pow(2,8*w)-1;Y(this,m,E,w,z,0)}var j=1,Ie=0;for(this[E]=m&255;++Ie<w&&(j*=256);)this[E+Ie]=m/j&255;return E+w},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(m,E,w,M){if(m=+m,E=E>>>0,w=w>>>0,!M){var z=Math.pow(2,8*w)-1;Y(this,m,E,w,z,0)}var j=w-1,Ie=1;for(this[E+j]=m&255;--j>=0&&(Ie*=256);)this[E+j]=m/Ie&255;return E+w},a.prototype.writeUint8=a.prototype.writeUInt8=function(m,E,w){return m=+m,E=E>>>0,w||Y(this,m,E,1,255,0),this[E]=m&255,E+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(m,E,w){return m=+m,E=E>>>0,w||Y(this,m,E,2,65535,0),this[E]=m&255,this[E+1]=m>>>8,E+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(m,E,w){return m=+m,E=E>>>0,w||Y(this,m,E,2,65535,0),this[E]=m>>>8,this[E+1]=m&255,E+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(m,E,w){return m=+m,E=E>>>0,w||Y(this,m,E,4,4294967295,0),this[E+3]=m>>>24,this[E+2]=m>>>16,this[E+1]=m>>>8,this[E]=m&255,E+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(m,E,w){return m=+m,E=E>>>0,w||Y(this,m,E,4,4294967295,0),this[E]=m>>>24,this[E+1]=m>>>16,this[E+2]=m>>>8,this[E+3]=m&255,E+4},a.prototype.writeIntLE=function(m,E,w,M){if(m=+m,E=E>>>0,!M){var z=Math.pow(2,8*w-1);Y(this,m,E,w,z-1,-z)}var j=0,Ie=1,be=0;for(this[E]=m&255;++j<w&&(Ie*=256);)m<0&&be===0&&this[E+j-1]!==0&&(be=1),this[E+j]=(m/Ie>>0)-be&255;return E+w},a.prototype.writeIntBE=function(m,E,w,M){if(m=+m,E=E>>>0,!M){var z=Math.pow(2,8*w-1);Y(this,m,E,w,z-1,-z)}var j=w-1,Ie=1,be=0;for(this[E+j]=m&255;--j>=0&&(Ie*=256);)m<0&&be===0&&this[E+j+1]!==0&&(be=1),this[E+j]=(m/Ie>>0)-be&255;return E+w},a.prototype.writeInt8=function(m,E,w){return m=+m,E=E>>>0,w||Y(this,m,E,1,127,-128),m<0&&(m=255+m+1),this[E]=m&255,E+1},a.prototype.writeInt16LE=function(m,E,w){return m=+m,E=E>>>0,w||Y(this,m,E,2,32767,-32768),this[E]=m&255,this[E+1]=m>>>8,E+2},a.prototype.writeInt16BE=function(m,E,w){return m=+m,E=E>>>0,w||Y(this,m,E,2,32767,-32768),this[E]=m>>>8,this[E+1]=m&255,E+2},a.prototype.writeInt32LE=function(m,E,w){return m=+m,E=E>>>0,w||Y(this,m,E,4,2147483647,-2147483648),this[E]=m&255,this[E+1]=m>>>8,this[E+2]=m>>>16,this[E+3]=m>>>24,E+4},a.prototype.writeInt32BE=function(m,E,w){return m=+m,E=E>>>0,w||Y(this,m,E,4,2147483647,-2147483648),m<0&&(m=4294967295+m+1),this[E]=m>>>24,this[E+1]=m>>>16,this[E+2]=m>>>8,this[E+3]=m&255,E+4};function re(Q,m,E,w,M,z){if(E+w>Q.length)throw new RangeError("Index out of range");if(E<0)throw new RangeError("Index out of range")}function ce(Q,m,E,w,M){return m=+m,E=E>>>0,M||re(Q,m,E,4),t.write(Q,m,E,w,23,4),E+4}a.prototype.writeFloatLE=function(m,E,w){return ce(this,m,E,!0,w)},a.prototype.writeFloatBE=function(m,E,w){return ce(this,m,E,!1,w)};function pe(Q,m,E,w,M){return m=+m,E=E>>>0,M||re(Q,m,E,8),t.write(Q,m,E,w,52,8),E+8}a.prototype.writeDoubleLE=function(m,E,w){return pe(this,m,E,!0,w)},a.prototype.writeDoubleBE=function(m,E,w){return pe(this,m,E,!1,w)},a.prototype.copy=function(m,E,w,M){if(!a.isBuffer(m))throw new TypeError("argument should be a Buffer");if(w||(w=0),!M&&M!==0&&(M=this.length),E>=m.length&&(E=m.length),E||(E=0),M>0&&M<w&&(M=w),M===w||m.length===0||this.length===0)return 0;if(E<0)throw new RangeError("targetStart out of bounds");if(w<0||w>=this.length)throw new RangeError("Index out of range");if(M<0)throw new RangeError("sourceEnd out of bounds");M>this.length&&(M=this.length),m.length-E<M-w&&(M=m.length-E+w);var z=M-w;return this===m&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(E,w,M):Uint8Array.prototype.set.call(m,this.subarray(w,M),E),z},a.prototype.fill=function(m,E,w,M){if(typeof m=="string"){if(typeof E=="string"?(M=E,E=0,w=this.length):typeof w=="string"&&(M=w,w=this.length),M!==void 0&&typeof M!="string")throw new TypeError("encoding must be a string");if(typeof M=="string"&&!a.isEncoding(M))throw new TypeError("Unknown encoding: "+M);if(m.length===1){var z=m.charCodeAt(0);(M==="utf8"&&z<128||M==="latin1")&&(m=z)}}else typeof m=="number"?m=m&255:typeof m=="boolean"&&(m=Number(m));if(E<0||this.length<E||this.length<w)throw new RangeError("Out of range index");if(w<=E)return this;E=E>>>0,w=w===void 0?this.length:w>>>0,m||(m=0);var j;if(typeof m=="number")for(j=E;j<w;++j)this[j]=m;else{var Ie=a.isBuffer(m)?m:a.from(m,M),be=Ie.length;if(be===0)throw new TypeError('The value "'+m+'" is invalid for argument "value"');for(j=0;j<w-E;++j)this[j+E]=Ie[j%be]}return this};var ge=/[^+/0-9A-Za-z-_]/g;function Se(Q){if(Q=Q.split("=")[0],Q=Q.trim().replace(ge,""),Q.length<2)return"";for(;Q.length%4!==0;)Q=Q+"=";return Q}function Le(Q,m){m=m||1/0;for(var E,w=Q.length,M=null,z=[],j=0;j<w;++j){if(E=Q.charCodeAt(j),E>55295&&E<57344){if(!M){if(E>56319){(m-=3)>-1&&z.push(239,191,189);continue}else if(j+1===w){(m-=3)>-1&&z.push(239,191,189);continue}M=E;continue}if(E<56320){(m-=3)>-1&&z.push(239,191,189),M=E;continue}E=(M-55296<<10|E-56320)+65536}else M&&(m-=3)>-1&&z.push(239,191,189);if(M=null,E<128){if((m-=1)<0)break;z.push(E)}else if(E<2048){if((m-=2)<0)break;z.push(E>>6|192,E&63|128)}else if(E<65536){if((m-=3)<0)break;z.push(E>>12|224,E>>6&63|128,E&63|128)}else if(E<1114112){if((m-=4)<0)break;z.push(E>>18|240,E>>12&63|128,E>>6&63|128,E&63|128)}else throw new Error("Invalid code point")}return z}function Ge(Q){for(var m=[],E=0;E<Q.length;++E)m.push(Q.charCodeAt(E)&255);return m}function fe(Q,m){for(var E,w,M,z=[],j=0;j<Q.length&&!((m-=2)<0);++j)E=Q.charCodeAt(j),w=E>>8,M=E%256,z.push(M),z.push(w);return z}function Te(Q){return e.toByteArray(Se(Q))}function Me(Q,m,E,w){for(var M=0;M<w&&!(M+E>=m.length||M>=Q.length);++M)m[M+E]=Q[M];return M}function we(Q,m){return Q instanceof m||Q!=null&&Q.constructor!=null&&Q.constructor.name!=null&&Q.constructor.name===m.name}function qe(Q){return Q!==Q}var Be=function(){for(var Q="0123456789abcdef",m=new Array(256),E=0;E<16;++E)for(var w=E*16,M=0;M<16;++M)m[w+M]=Q[E]+Q[M];return m}()})(tA);var Sr=ze,mt=dg,nA=tA.Buffer;dn.__TYPEDARRAY_POOL||(dn.__TYPEDARRAY_POOL={UINT8:mt([32,0]),UINT16:mt([32,0]),UINT32:mt([32,0]),BIGUINT64:mt([32,0]),INT8:mt([32,0]),INT16:mt([32,0]),INT32:mt([32,0]),BIGINT64:mt([32,0]),FLOAT:mt([32,0]),DOUBLE:mt([32,0]),DATA:mt([32,0]),UINT8C:mt([32,0]),BUFFER:mt([32,0])});var yg=typeof Uint8ClampedArray<"u",Bg=typeof BigUint64Array<"u",Qg=typeof BigInt64Array<"u",nt=dn.__TYPEDARRAY_POOL;nt.UINT8C||(nt.UINT8C=mt([32,0])),nt.BIGUINT64||(nt.BIGUINT64=mt([32,0])),nt.BIGINT64||(nt.BIGINT64=mt([32,0])),nt.BUFFER||(nt.BUFFER=mt([32,0]));var Yi=nt.DATA,Vi=nt.BUFFER;Ne.free=function(e){if(nA.isBuffer(e))Vi[Sr.log2(e.length)].push(e);else{if(Object.prototype.toString.call(e)!=="[object ArrayBuffer]"&&(e=e.buffer),!e)return;var t=e.length||e.byteLength,n=Sr.log2(t)|0;Yi[n].push(e)}};function iA(r){if(r){var e=r.length||r.byteLength,t=Sr.log2(e);Yi[t].push(r)}}function Tg(r){iA(r.buffer)}Ne.freeUint8=Ne.freeUint16=Ne.freeUint32=Ne.freeBigUint64=Ne.freeInt8=Ne.freeInt16=Ne.freeInt32=Ne.freeBigInt64=Ne.freeFloat32=Ne.freeFloat=Ne.freeFloat64=Ne.freeDouble=Ne.freeUint8Clamped=Ne.freeDataView=Tg,Ne.freeArrayBuffer=iA,Ne.freeBuffer=function(e){Vi[Sr.log2(e.length)].push(e)},Ne.malloc=function(e,t){if(t===void 0||t==="arraybuffer")return St(e);switch(t){case"uint8":return Eo(e);case"uint16":return sA(e);case"uint32":return oA(e);case"int8":return aA(e);case"int16":return lA(e);case"int32":return AA(e);case"float":case"float32":return cA(e);case"double":case"float64":return uA(e);case"uint8_clamped":return hA(e);case"bigint64":return fA(e);case"biguint64":return dA(e);case"buffer":return pA(e);case"data":case"dataview":return gA(e);default:return null}return null};function St(e){var e=Sr.nextPow2(e),t=Sr.log2(e),n=Yi[t];return n.length>0?n.pop():new ArrayBuffer(e)}Ne.mallocArrayBuffer=St;function Eo(r){return new Uint8Array(St(r),0,r)}Ne.mallocUint8=Eo;function sA(r){return new Uint16Array(St(2*r),0,r)}Ne.mallocUint16=sA;function oA(r){return new Uint32Array(St(4*r),0,r)}Ne.mallocUint32=oA;function aA(r){return new Int8Array(St(r),0,r)}Ne.mallocInt8=aA;function lA(r){return new Int16Array(St(2*r),0,r)}Ne.mallocInt16=lA;function AA(r){return new Int32Array(St(4*r),0,r)}Ne.mallocInt32=AA;function cA(r){return new Float32Array(St(4*r),0,r)}Ne.mallocFloat32=Ne.mallocFloat=cA;function uA(r){return new Float64Array(St(8*r),0,r)}Ne.mallocFloat64=Ne.mallocDouble=uA;function hA(r){return yg?new Uint8ClampedArray(St(r),0,r):Eo(r)}Ne.mallocUint8Clamped=hA;function dA(r){return Bg?new BigUint64Array(St(8*r),0,r):null}Ne.mallocBigUint64=dA;function fA(r){return Qg?new BigInt64Array(St(8*r),0,r):null}Ne.mallocBigInt64=fA;function gA(r){return new DataView(St(r),0,r)}Ne.mallocDataView=gA;function pA(r){r=Sr.nextPow2(r);var e=Sr.log2(r),t=Vi[e];return t.length>0?t.pop():new nA(r)}Ne.mallocBuffer=pA,Ne.clearCache=function(){for(var e=0;e<32;++e)nt.UINT8[e].length=0,nt.UINT16[e].length=0,nt.UINT32[e].length=0,nt.INT8[e].length=0,nt.INT16[e].length=0,nt.INT32[e].length=0,nt.FLOAT[e].length=0,nt.DOUBLE[e].length=0,nt.BIGUINT64[e].length=0,nt.BIGINT64[e].length=0,nt.UINT8C[e].length=0,Yi[e].length=0,Vi[e].length=0};var Ki=Jf,Io=jl,gn=Ne,bg=Dg,Ji=null,Co=null,Wi=null;function xg(r){Ji=[r.LINEAR,r.NEAREST_MIPMAP_LINEAR,r.LINEAR_MIPMAP_NEAREST,r.LINEAR_MIPMAP_NEAREST],Co=[r.NEAREST,r.LINEAR,r.NEAREST_MIPMAP_NEAREST,r.NEAREST_MIPMAP_LINEAR,r.LINEAR_MIPMAP_NEAREST,r.LINEAR_MIPMAP_LINEAR],Wi=[r.REPEAT,r.CLAMP_TO_EDGE,r.MIRRORED_REPEAT]}function mA(r){return typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement||typeof HTMLImageElement<"u"&&r instanceof HTMLImageElement||typeof HTMLVideoElement<"u"&&r instanceof HTMLVideoElement||typeof ImageData<"u"&&r instanceof ImageData}var EA=function(r,e){Io.muls(r,e,255)};function vo(r,e,t){var n=r.gl,i=n.getParameter(n.MAX_TEXTURE_SIZE);if(e<0||e>i||t<0||t>i)throw new Error("gl-texture2d: Invalid texture size");return r._shape=[e,t],r.bind(),n.texImage2D(n.TEXTURE_2D,0,r.format,e,t,0,r.format,r.type,null),r._mipLevels=[0],r}function qi(r,e,t,n,i,s){this.gl=r,this.handle=e,this.format=i,this.type=s,this._shape=[t,n],this._mipLevels=[0],this._magFilter=r.NEAREST,this._minFilter=r.NEAREST,this._wrapS=r.CLAMP_TO_EDGE,this._wrapT=r.CLAMP_TO_EDGE,this._anisoSamples=1;var o=this,a=[this._wrapS,this._wrapT];Object.defineProperties(a,[{get:function(){return o._wrapS},set:function(A){return o.wrapS=A}},{get:function(){return o._wrapT},set:function(A){return o.wrapT=A}}]),this._wrapVector=a;var l=[this._shape[0],this._shape[1]];Object.defineProperties(l,[{get:function(){return o._shape[0]},set:function(A){return o.width=A}},{get:function(){return o._shape[1]},set:function(A){return o.height=A}}]),this._shapeVector=l}var ti=qi.prototype;Object.defineProperties(ti,{minFilter:{get:function(){return this._minFilter},set:function(r){this.bind();var e=this.gl;if(this.type===e.FLOAT&&Ji.indexOf(r)>=0&&(e.getExtension("OES_texture_float_linear")||(r=e.NEAREST)),Co.indexOf(r)<0)throw new Error("gl-texture2d: Unknown filter mode "+r);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,r),this._minFilter=r}},magFilter:{get:function(){return this._magFilter},set:function(r){this.bind();var e=this.gl;if(this.type===e.FLOAT&&Ji.indexOf(r)>=0&&(e.getExtension("OES_texture_float_linear")||(r=e.NEAREST)),Co.indexOf(r)<0)throw new Error("gl-texture2d: Unknown filter mode "+r);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,r),this._magFilter=r}},mipSamples:{get:function(){return this._anisoSamples},set:function(r){var e=this._anisoSamples;if(this._anisoSamples=Math.max(r,1)|0,e!==this._anisoSamples){var t=this.gl.getExtension("EXT_texture_filter_anisotropic");t&&this.gl.texParameterf(this.gl.TEXTURE_2D,t.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(r){if(this.bind(),Wi.indexOf(r)<0)throw new Error("gl-texture2d: Unknown wrap mode "+r);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,r),this._wrapS=r}},wrapT:{get:function(){return this._wrapT},set:function(r){if(this.bind(),Wi.indexOf(r)<0)throw new Error("gl-texture2d: Unknown wrap mode "+r);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,r),this._wrapT=r}},wrap:{get:function(){return this._wrapVector},set:function(r){if(Array.isArray(r)||(r=[r,r]),r.length!==2)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var e=0;e<2;++e)if(Wi.indexOf(r[e])<0)throw new Error("gl-texture2d: Unknown wrap mode "+r);this._wrapS=r[0],this._wrapT=r[1];var t=this.gl;return this.bind(),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,this._wrapS),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,this._wrapT),r}},shape:{get:function(){return this._shapeVector},set:function(r){if(!Array.isArray(r))r=[r|0,r|0];else if(r.length!==2)throw new Error("gl-texture2d: Invalid texture shape");return vo(this,r[0]|0,r[1]|0),[r[0]|0,r[1]|0]}},width:{get:function(){return this._shape[0]},set:function(r){return r=r|0,vo(this,r,this._shape[1]),r}},height:{get:function(){return this._shape[1]},set:function(r){return r=r|0,vo(this,this._shape[0],r),r}}}),ti.bind=function(r){var e=this.gl;return r!==void 0&&e.activeTexture(e.TEXTURE0+(r|0)),e.bindTexture(e.TEXTURE_2D,this.handle),r!==void 0?r|0:e.getParameter(e.ACTIVE_TEXTURE)-e.TEXTURE0},ti.dispose=function(){this.gl.deleteTexture(this.handle)},ti.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var r=Math.min(this._shape[0],this._shape[1]),e=0;r>0;++e,r>>>=1)this._mipLevels.indexOf(e)<0&&this._mipLevels.push(e)},ti.setPixels=function(r,e,t,n){var i=this.gl;this.bind(),Array.isArray(e)?(n=t,t=e[1]|0,e=e[0]|0):(e=e||0,t=t||0),n=n||0;var s=mA(r)?r:r.raw;if(s){var o=this._mipLevels.indexOf(n)<0;o?(i.texImage2D(i.TEXTURE_2D,0,this.format,this.format,this.type,s),this._mipLevels.push(n)):i.texSubImage2D(i.TEXTURE_2D,n,e,t,this.format,this.type,s)}else if(r.shape&&r.stride&&r.data){if(r.shape.length<2||e+r.shape[1]>this._shape[1]>>>n||t+r.shape[0]>this._shape[0]>>>n||e<0||t<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");wg(i,e,t,n,this.format,this.type,this._mipLevels,r)}else throw new Error("gl-texture2d: Unsupported data type")};function IA(r,e){return r.length===3?e[2]===1&&e[1]===r[0]*r[2]&&e[0]===r[2]:e[0]===1&&e[1]===r[0]}function wg(r,e,t,n,i,s,o,a){var l=a.dtype,A=a.shape.slice();if(A.length<2||A.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var c=0,u=0,h=IA(A,a.stride.slice());if(l==="float32"?c=r.FLOAT:l==="float64"?(c=r.FLOAT,h=!1,l="float32"):l==="uint8"?c=r.UNSIGNED_BYTE:(c=r.UNSIGNED_BYTE,h=!1,l="uint8"),A.length===2)u=r.LUMINANCE,A=[A[0],A[1],1],a=Ki(a.data,A,[a.stride[0],a.stride[1],1],a.offset);else if(A.length===3){if(A[2]===1)u=r.ALPHA;else if(A[2]===2)u=r.LUMINANCE_ALPHA;else if(A[2]===3)u=r.RGB;else if(A[2]===4)u=r.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");A[2]}else throw new Error("gl-texture2d: Invalid shape for texture");if((u===r.LUMINANCE||u===r.ALPHA)&&(i===r.LUMINANCE||i===r.ALPHA)&&(u=i),u!==i)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var d=a.size,f=o.indexOf(n)<0;if(f&&o.push(n),c===s&&h)a.offset===0&&a.data.length===d?f?r.texImage2D(r.TEXTURE_2D,n,i,A[0],A[1],0,i,s,a.data):r.texSubImage2D(r.TEXTURE_2D,n,e,t,A[0],A[1],i,s,a.data):f?r.texImage2D(r.TEXTURE_2D,n,i,A[0],A[1],0,i,s,a.data.subarray(a.offset,a.offset+d)):r.texSubImage2D(r.TEXTURE_2D,n,e,t,A[0],A[1],i,s,a.data.subarray(a.offset,a.offset+d));else{var g;s===r.FLOAT?g=gn.mallocFloat32(d):g=gn.mallocUint8(d);var p=Ki(g,A,[A[2],A[2]*A[0],1]);c===r.FLOAT&&s===r.UNSIGNED_BYTE?EA(p,a):Io.assign(p,a),f?r.texImage2D(r.TEXTURE_2D,n,i,A[0],A[1],0,i,s,g.subarray(0,d)):r.texSubImage2D(r.TEXTURE_2D,n,e,t,A[0],A[1],i,s,g.subarray(0,d)),s===r.FLOAT?gn.freeFloat32(g):gn.freeUint8(g)}}function yo(r){var e=r.createTexture();return r.bindTexture(r.TEXTURE_2D,e),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),e}function CA(r,e,t,n,i){var s=r.getParameter(r.MAX_TEXTURE_SIZE);if(e<0||e>s||t<0||t>s)throw new Error("gl-texture2d: Invalid texture shape");if(i===r.FLOAT&&!r.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var o=yo(r);return r.texImage2D(r.TEXTURE_2D,0,n,e,t,0,n,i,null),new qi(r,o,e,t,n,i)}function Sg(r,e,t,n,i,s){var o=yo(r);return r.texImage2D(r.TEXTURE_2D,0,i,i,s,e),new qi(r,o,t,n,i,s)}function Rg(r,e){var t=e.dtype,n=e.shape.slice(),i=r.getParameter(r.MAX_TEXTURE_SIZE);if(n[0]<0||n[0]>i||n[1]<0||n[1]>i)throw new Error("gl-texture2d: Invalid texture size");var s=IA(n,e.stride.slice()),o=0;t==="float32"?o=r.FLOAT:t==="float64"?(o=r.FLOAT,s=!1,t="float32"):t==="uint8"?o=r.UNSIGNED_BYTE:(o=r.UNSIGNED_BYTE,s=!1,t="uint8");var a=0;if(n.length===2)a=r.LUMINANCE,n=[n[0],n[1],1],e=Ki(e.data,n,[e.stride[0],e.stride[1],1],e.offset);else if(n.length===3)if(n[2]===1)a=r.ALPHA;else if(n[2]===2)a=r.LUMINANCE_ALPHA;else if(n[2]===3)a=r.RGB;else if(n[2]===4)a=r.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");else throw new Error("gl-texture2d: Invalid shape for texture");o===r.FLOAT&&!r.getExtension("OES_texture_float")&&(o=r.UNSIGNED_BYTE,s=!1);var l,A,c=e.size;if(s)e.offset===0&&e.data.length===c?l=e.data:l=e.data.subarray(e.offset,e.offset+c);else{var u=[n[2],n[2]*n[0],1];A=gn.malloc(c,t);var h=Ki(A,n,u,0);(t==="float32"||t==="float64")&&o===r.UNSIGNED_BYTE?EA(h,e):Io.assign(h,e),l=A.subarray(0,c)}var d=yo(r);return r.texImage2D(r.TEXTURE_2D,0,a,n[0],n[1],0,a,o,l),s||gn.free(A),new qi(r,d,n[0],n[1],a,o)}function Dg(r){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(Ji||xg(r),typeof arguments[1]=="number")return CA(r,arguments[1],arguments[2],arguments[3]||r.RGBA,arguments[4]||r.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return CA(r,arguments[1][0]|0,arguments[1][1]|0,arguments[2]||r.RGBA,arguments[3]||r.UNSIGNED_BYTE);if(typeof arguments[1]=="object"){var e=arguments[1],t=mA(e)?e:e.raw;if(t)return Sg(r,t,e.width|0,e.height|0,arguments[2]||r.RGBA,arguments[3]||r.UNSIGNED_BYTE);if(e.shape&&e.data&&e.stride)return Rg(r,e)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")}const Xi=ao(bg);var vA={},yA=_g;function _g(r,e){for(var t={},n=0;n<r.length;++n)for(var i=r[n].name,s=i.split("."),o=t,a=0;a<s.length;++a){var l=s[a].split("[");if(l.length>1){l[0]in o||(o[l[0]]=[]),o=o[l[0]];for(var A=1;A<l.length;++A){var c=parseInt(l[A]);A<l.length-1||a<s.length-1?(c in o||(A<l.length-1?o[c]=[]:o[c]={}),o=o[c]):e?o[c]=n:o[c]=r[n].type}}else a<s.length-1?(l[0]in o||(o[l[0]]={}),o=o[l[0]]):e?o[l[0]]=n:o[l[0]]=r[n].type}return t}function ri(r,e,t){this.shortMessage=e||"",this.longMessage=t||"",this.rawError=r||"",this.message="gl-shader: "+(e||r||"")+(t?`
|
92
|
+
`+t:""),this.stack=new Error().stack}ri.prototype=new Error,ri.prototype.name="GLError",ri.prototype.constructor=ri;var ji=ri,Lg=yA,Kr=ji,Fg=kg;function BA(r){return function(){return r}}function Bo(r,e){for(var t=new Array(r),n=0;n<r;++n)t[n]=e;return t}function kg(r,e,t,n){function i(u){return function(h,d,f){return h.getUniform(d.program,f[u])}}function s(u){return function(d){for(var f=o("",u),g=0;g<f.length;++g){var p=f[g],C=p[0],T=p[1];if(n[T]){var b=d;if(typeof C=="string"&&(C.indexOf(".")===0||C.indexOf("[")===0)){var y=C;if(C.indexOf(".")===0&&(y=C.slice(1)),y.indexOf("]")===y.length-1){var x=y.indexOf("["),R=y.slice(0,x),k=y.slice(x+1,y.length-1);b=R?d[R][k]:d[k]}else b=d[y]}var $=t[T].type,V;switch($){case"bool":case"int":case"sampler2D":case"samplerCube":r.uniform1i(n[T],b);break;case"float":r.uniform1f(n[T],b);break;default:var O=$.indexOf("vec");if(0<=O&&O<=1&&$.length===4+O){if(V=$.charCodeAt($.length-1)-48,V<2||V>4)throw new Kr("","Invalid data type");switch($.charAt(0)){case"b":case"i":r["uniform"+V+"iv"](n[T],b);break;case"v":r["uniform"+V+"fv"](n[T],b);break;default:throw new Kr("","Unrecognized data type for vector "+name+": "+$)}}else if($.indexOf("mat")===0&&$.length===4){if(V=$.charCodeAt($.length-1)-48,V<2||V>4)throw new Kr("","Invalid uniform dimension type for matrix "+name+": "+$);r["uniformMatrix"+V+"fv"](n[T],!1,b);break}else throw new Kr("","Unknown uniform data type for "+name+": "+$)}}}}}function o(u,h){if(typeof h!="object")return[[u,h]];var d=[];for(var f in h){var g=h[f],p=u;parseInt(f)+""===f?p+="["+f+"]":p+="."+f,typeof g=="object"?d.push.apply(d,o(p,g)):d.push([p,g])}return d}function a(u){switch(u){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":return 0;case"float":return 0;default:var h=u.indexOf("vec");if(0<=h&&h<=1&&u.length===4+h){var d=u.charCodeAt(u.length-1)-48;if(d<2||d>4)throw new Kr("","Invalid data type");return u.charAt(0)==="b"?Bo(d,!1):Bo(d,0)}else if(u.indexOf("mat")===0&&u.length===4){var d=u.charCodeAt(u.length-1)-48;if(d<2||d>4)throw new Kr("","Invalid uniform dimension type for matrix "+name+": "+u);return Bo(d*d,0)}else throw new Kr("","Unknown uniform data type for "+name+": "+u)}}function l(u,h,d){if(typeof d=="object"){var f=A(d);Object.defineProperty(u,h,{get:BA(f),set:s(d),enumerable:!0,configurable:!1})}else n[d]?Object.defineProperty(u,h,{get:i(d),set:s(d),enumerable:!0,configurable:!1}):u[h]=a(t[d].type)}function A(u){var h;if(Array.isArray(u)){h=new Array(u.length);for(var d=0;d<u.length;++d)l(h,d,u[d])}else{h={};for(var f in u)l(h,f,u[f])}return h}var c=Lg(t,!0);return{get:BA(A(c)),set:s(c),enumerable:!0,configurable:!0}}var Ng=Og,Qo=ji;function QA(r,e,t,n,i,s){this._gl=r,this._wrapper=e,this._index=t,this._locations=n,this._dimension=i,this._constFunc=s}var To=QA.prototype;To.pointer=function(e,t,n,i){var s=this,o=s._gl,a=s._locations[s._index];o.vertexAttribPointer(a,s._dimension,e||o.FLOAT,!!t,n||0,i||0),o.enableVertexAttribArray(a)},To.set=function(r,e,t,n){return this._constFunc(this._locations[this._index],r,e,t,n)},Object.defineProperty(To,"location",{get:function(){return this._locations[this._index]},set:function(r){return r!==this._locations[this._index]&&(this._locations[this._index]=r|0,this._wrapper.program=null),r|0}});var Mg=[function(r,e,t){return t.length===void 0?r.vertexAttrib1f(e,t):r.vertexAttrib1fv(e,t)},function(r,e,t,n){return t.length===void 0?r.vertexAttrib2f(e,t,n):r.vertexAttrib2fv(e,t)},function(r,e,t,n,i){return t.length===void 0?r.vertexAttrib3f(e,t,n,i):r.vertexAttrib3fv(e,t)},function(r,e,t,n,i,s){return t.length===void 0?r.vertexAttrib4f(e,t,n,i,s):r.vertexAttrib4fv(e,t)}];function bo(r,e,t,n,i,s,o){var a=Mg[i],l=new QA(r,e,t,n,i,a);Object.defineProperty(s,o,{set:function(A){return r.disableVertexAttribArray(n[t]),a(r,n[t],A),A},get:function(){return l},enumerable:!0})}function Pg(r,e,t,n,i,s,o){for(var a=new Array(i),l=new Array(i),A=0;A<i;++A)bo(r,e,t[A],n,i,a,A),l[A]=a[A];Object.defineProperty(a,"location",{set:function(h){if(Array.isArray(h))for(var d=0;d<i;++d)l[d].location=h[d];else for(var d=0;d<i;++d)l[d].location=h+d;return h},get:function(){for(var h=new Array(i),d=0;d<i;++d)h[d]=n[t[d]];return h},enumerable:!0}),a.pointer=function(h,d,f,g){h=h||r.FLOAT,d=!!d,f=f||i*i,g=g||0;for(var p=0;p<i;++p){var C=n[t[p]];r.vertexAttribPointer(C,i,h,d,f,g+p*i),r.enableVertexAttribArray(C)}};var c=new Array(i),u=r["vertexAttrib"+i+"fv"];Object.defineProperty(s,o,{set:function(h){for(var d=0;d<i;++d){var f=n[t[d]];if(r.disableVertexAttribArray(f),Array.isArray(h[0]))u.call(r,f,h[d]);else{for(var g=0;g<i;++g)c[g]=h[i*d+g];u.call(r,f,c)}}return h},get:function(){return a},enumerable:!0})}function Og(r,e,t,n){for(var i={},s=0,o=t.length;s<o;++s){var a=t[s],l=a.name,A=a.type,c=a.locations;switch(A){case"bool":case"int":case"float":bo(r,e,c[0],n,1,i,l);break;default:if(A.indexOf("vec")>=0){var u=A.charCodeAt(A.length-1)-48;if(u<2||u>4)throw new Qo("","Invalid data type for attribute "+l+": "+A);bo(r,e,c[0],n,u,i,l)}else if(A.indexOf("mat")>=0){var u=A.charCodeAt(A.length-1)-48;if(u<2||u>4)throw new Qo("","Invalid data type for attribute "+l+": "+A);Pg(r,e,c,n,u,i,l)}else throw new Qo("","Unknown data type for attribute "+l+": "+A);break}}return i}var xo={},TA={};(function(r){(function(){var e={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function t(a){return i(o(a),arguments)}function n(a,l){return t.apply(null,[a].concat(l||[]))}function i(a,l){var A=1,c=a.length,u,h="",d,f,g,p,C,T,b,y;for(d=0;d<c;d++)if(typeof a[d]=="string")h+=a[d];else if(typeof a[d]=="object"){if(g=a[d],g.keys)for(u=l[A],f=0;f<g.keys.length;f++){if(u==null)throw new Error(t('[sprintf] Cannot access property "%s" of undefined value "%s"',g.keys[f],g.keys[f-1]));u=u[g.keys[f]]}else g.param_no?u=l[g.param_no]:u=l[A++];if(e.not_type.test(g.type)&&e.not_primitive.test(g.type)&&u instanceof Function&&(u=u()),e.numeric_arg.test(g.type)&&typeof u!="number"&&isNaN(u))throw new TypeError(t("[sprintf] expecting number but found %T",u));switch(e.number.test(g.type)&&(b=u>=0),g.type){case"b":u=parseInt(u,10).toString(2);break;case"c":u=String.fromCharCode(parseInt(u,10));break;case"d":case"i":u=parseInt(u,10);break;case"j":u=JSON.stringify(u,null,g.width?parseInt(g.width):0);break;case"e":u=g.precision?parseFloat(u).toExponential(g.precision):parseFloat(u).toExponential();break;case"f":u=g.precision?parseFloat(u).toFixed(g.precision):parseFloat(u);break;case"g":u=g.precision?String(Number(u.toPrecision(g.precision))):parseFloat(u);break;case"o":u=(parseInt(u,10)>>>0).toString(8);break;case"s":u=String(u),u=g.precision?u.substring(0,g.precision):u;break;case"t":u=String(!!u),u=g.precision?u.substring(0,g.precision):u;break;case"T":u=Object.prototype.toString.call(u).slice(8,-1).toLowerCase(),u=g.precision?u.substring(0,g.precision):u;break;case"u":u=parseInt(u,10)>>>0;break;case"v":u=u.valueOf(),u=g.precision?u.substring(0,g.precision):u;break;case"x":u=(parseInt(u,10)>>>0).toString(16);break;case"X":u=(parseInt(u,10)>>>0).toString(16).toUpperCase();break}e.json.test(g.type)?h+=u:(e.number.test(g.type)&&(!b||g.sign)?(y=b?"+":"-",u=u.toString().replace(e.sign,"")):y="",C=g.pad_char?g.pad_char==="0"?"0":g.pad_char.charAt(1):" ",T=g.width-(y+u).length,p=g.width&&T>0?C.repeat(T):"",h+=g.align?y+u+p:C==="0"?y+p+u:p+y+u)}return h}var s=Object.create(null);function o(a){if(s[a])return s[a];for(var l=a,A,c=[],u=0;l;){if((A=e.text.exec(l))!==null)c.push(A[0]);else if((A=e.modulo.exec(l))!==null)c.push("%");else if((A=e.placeholder.exec(l))!==null){if(A[2]){u|=1;var h=[],d=A[2],f=[];if((f=e.key.exec(d))!==null)for(h.push(f[1]);(d=d.substring(f[0].length))!=="";)if((f=e.key_access.exec(d))!==null)h.push(f[1]);else if((f=e.index_access.exec(d))!==null)h.push(f[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");A[2]=h}else u|=2;if(u===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");c.push({placeholder:A[0],param_no:A[1],keys:A[2],sign:A[3],pad_char:A[4],align:A[5],width:A[6],precision:A[7],type:A[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");l=l.substring(A[0].length)}return s[a]=c}r.sprintf=t,r.vsprintf=n,typeof window<"u"&&(window.sprintf=t,window.vsprintf=n)})()})(TA);var Ug={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34e3:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",34070:"TEXTURE_CUBE_MAP_NEGATIVE_X",34071:"TEXTURE_CUBE_MAP_POSITIVE_Y",34072:"TEXTURE_CUBE_MAP_NEGATIVE_Y",34073:"TEXTURE_CUBE_MAP_POSITIVE_Z",34074:"TEXTURE_CUBE_MAP_NEGATIVE_Z",34076:"MAX_CUBE_MAP_TEXTURE_SIZE",34338:"VERTEX_ATTRIB_ARRAY_ENABLED",34339:"VERTEX_ATTRIB_ARRAY_SIZE",34340:"VERTEX_ATTRIB_ARRAY_STRIDE",34341:"VERTEX_ATTRIB_ARRAY_TYPE",34342:"CURRENT_VERTEX_ATTRIB",34373:"VERTEX_ATTRIB_ARRAY_POINTER",34466:"NUM_COMPRESSED_TEXTURE_FORMATS",34467:"COMPRESSED_TEXTURE_FORMATS",34660:"BUFFER_SIZE",34661:"BUFFER_USAGE",34816:"STENCIL_BACK_FUNC",34817:"STENCIL_BACK_FAIL",34818:"STENCIL_BACK_PASS_DEPTH_FAIL",34819:"STENCIL_BACK_PASS_DEPTH_PASS",34877:"BLEND_EQUATION_ALPHA",34921:"MAX_VERTEX_ATTRIBS",34922:"VERTEX_ATTRIB_ARRAY_NORMALIZED",34930:"MAX_TEXTURE_IMAGE_UNITS",34962:"ARRAY_BUFFER",34963:"ELEMENT_ARRAY_BUFFER",34964:"ARRAY_BUFFER_BINDING",34965:"ELEMENT_ARRAY_BUFFER_BINDING",34975:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",35040:"STREAM_DRAW",35044:"STATIC_DRAW",35048:"DYNAMIC_DRAW",35632:"FRAGMENT_SHADER",35633:"VERTEX_SHADER",35660:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",35661:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",35663:"SHADER_TYPE",35664:"FLOAT_VEC2",35665:"FLOAT_VEC3",35666:"FLOAT_VEC4",35667:"INT_VEC2",35668:"INT_VEC3",35669:"INT_VEC4",35670:"BOOL",35671:"BOOL_VEC2",35672:"BOOL_VEC3",35673:"BOOL_VEC4",35674:"FLOAT_MAT2",35675:"FLOAT_MAT3",35676:"FLOAT_MAT4",35678:"SAMPLER_2D",35680:"SAMPLER_CUBE",35712:"DELETE_STATUS",35713:"COMPILE_STATUS",35714:"LINK_STATUS",35715:"VALIDATE_STATUS",35716:"INFO_LOG_LENGTH",35717:"ATTACHED_SHADERS",35718:"ACTIVE_UNIFORMS",35719:"ACTIVE_UNIFORM_MAX_LENGTH",35720:"SHADER_SOURCE_LENGTH",35721:"ACTIVE_ATTRIBUTES",35722:"ACTIVE_ATTRIBUTE_MAX_LENGTH",35724:"SHADING_LANGUAGE_VERSION",35725:"CURRENT_PROGRAM",36003:"STENCIL_BACK_REF",36004:"STENCIL_BACK_VALUE_MASK",36005:"STENCIL_BACK_WRITEMASK",36006:"FRAMEBUFFER_BINDING",36007:"RENDERBUFFER_BINDING",36048:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",36049:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",36050:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",36051:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",36053:"FRAMEBUFFER_COMPLETE",36054:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",36055:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",36057:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",36061:"FRAMEBUFFER_UNSUPPORTED",36064:"COLOR_ATTACHMENT0",36096:"DEPTH_ATTACHMENT",36128:"STENCIL_ATTACHMENT",36160:"FRAMEBUFFER",36161:"RENDERBUFFER",36162:"RENDERBUFFER_WIDTH",36163:"RENDERBUFFER_HEIGHT",36164:"RENDERBUFFER_INTERNAL_FORMAT",36168:"STENCIL_INDEX8",36176:"RENDERBUFFER_RED_SIZE",36177:"RENDERBUFFER_GREEN_SIZE",36178:"RENDERBUFFER_BLUE_SIZE",36179:"RENDERBUFFER_ALPHA_SIZE",36180:"RENDERBUFFER_DEPTH_SIZE",36181:"RENDERBUFFER_STENCIL_SIZE",36194:"RGB565",36336:"LOW_FLOAT",36337:"MEDIUM_FLOAT",36338:"HIGH_FLOAT",36339:"LOW_INT",36340:"MEDIUM_INT",36341:"HIGH_INT",36346:"SHADER_COMPILER",36347:"MAX_VERTEX_UNIFORM_VECTORS",36348:"MAX_VARYING_VECTORS",36349:"MAX_FRAGMENT_UNIFORM_VECTORS",37440:"UNPACK_FLIP_Y_WEBGL",37441:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",37442:"CONTEXT_LOST_WEBGL",37443:"UNPACK_COLORSPACE_CONVERSION_WEBGL",37444:"BROWSER_DEFAULT_WEBGL"},Gg=Ug,Hg=function(e){return Gg[e]},bA=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","uint","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"],$g=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"],xA=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"],Yg=bA,Vg=Yg.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"]),wo=xA;wo=wo.slice().filter(function(r){return!/^(gl\_|texture)/.test(r)});var Kg=wo.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"]),Jg=n0,Wg=bA,wA=$g,qg=xA,Xg=Vg,jg=Kg,Kt=999,SA=9999,So=0,Ro=1,RA=2,DA=3,_A=4,ni=5,zg=6,Zg=7,e0=8,LA=9,t0=10,FA=11,r0=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"];function n0(r){var e=0,t=0,n=Kt,i,s,o=[],a=[],l=1,A=0,c=0,u=!1,h=!1,d="",f;r=r||{};var g=qg,p=Wg;r.version==="300 es"&&(g=jg,p=Xg);for(var C={},T={},e=0;e<g.length;e++)C[g[e]]=!0;for(var e=0;e<p.length;e++)T[p[e]]=!0;return function(X){return a=[],X!==null?y(X):x()};function b(X){X.length&&a.push({type:r0[n],data:X,position:c,line:l,column:A})}function y(X){e=0,X.toString&&(X=X.toString()),d+=X.replace(/\r\n/g,`
|
93
|
+
`),f=d.length;for(var _;i=d[e],e<f;){switch(_=e,n){case So:e=O();break;case Ro:e=V();break;case RA:e=$();break;case DA:e=J();break;case _A:e=le();break;case FA:e=ee();break;case ni:e=D();break;case SA:e=P();break;case LA:e=k();break;case Kt:e=R();break}if(_!==e)switch(d[_]){case`
|
94
|
+
`:A=0,++l;break;default:++A;break}}return t+=e,d=d.slice(e),a}function x(X){return o.length&&b(o.join("")),n=t0,b("(eof)"),a}function R(){return o=o.length?[]:o,s==="/"&&i==="*"?(c=t+e-1,n=So,s=i,e+1):s==="/"&&i==="/"?(c=t+e-1,n=Ro,s=i,e+1):i==="#"?(n=RA,c=t+e,e):/\s/.test(i)?(n=LA,c=t+e,e):(u=/\d/.test(i),h=/[^\w_]/.test(i),c=t+e,n=u?_A:h?DA:SA,e)}function k(){return/[^\s]/g.test(i)?(b(o.join("")),n=Kt,e):(o.push(i),s=i,e+1)}function $(){return(i==="\r"||i===`
|
95
|
+
`)&&s!=="\\"?(b(o.join("")),n=Kt,e):(o.push(i),s=i,e+1)}function V(){return $()}function O(){return i==="/"&&s==="*"?(o.push(i),b(o.join("")),n=Kt,e+1):(o.push(i),s=i,e+1)}function J(){if(s==="."&&/\d/.test(i))return n=ni,e;if(s==="/"&&i==="*")return n=So,e;if(s==="/"&&i==="/")return n=Ro,e;if(i==="."&&o.length){for(;ne(o););return n=ni,e}if(i===";"||i===")"||i==="("){if(o.length)for(;ne(o););return b(i),n=Kt,e+1}var X=o.length===2&&i!=="=";if(/[\w_\d\s]/.test(i)||X){for(;ne(o););return n=Kt,e}return o.push(i),s=i,e+1}function ne(X){var _=0,S,F;do{if(S=wA.indexOf(X.slice(0,X.length+_).join("")),F=wA[S],S===-1){if(_--+X.length>0)continue;F=X.slice(0,1).join("")}return b(F),c+=F.length,o=o.slice(F.length),o.length}while(!0)}function ee(){return/[^a-fA-F0-9]/.test(i)?(b(o.join("")),n=Kt,e):(o.push(i),s=i,e+1)}function le(){return i==="."||/[eE]/.test(i)?(o.push(i),n=ni,s=i,e+1):i==="x"&&o.length===1&&o[0]==="0"?(n=FA,o.push(i),s=i,e+1):/[^\d]/.test(i)?(b(o.join("")),n=Kt,e):(o.push(i),s=i,e+1)}function D(){return i==="f"&&(o.push(i),s=i,e+=1),/[eE]/.test(i)||(i==="-"||i==="+")&&/[eE]/.test(s)?(o.push(i),s=i,e+1):/[^\d]/.test(i)?(b(o.join("")),n=Kt,e):(o.push(i),s=i,e+1)}function P(){if(/[^\d\w_]/.test(i)){var X=o.join("");return T[X]?n=e0:C[X]?n=Zg:n=zg,b(o.join("")),n=Kt,e}return o.push(i),s=i,e+1}}var i0=Jg,s0=o0;function o0(r,e){var t=i0(e),n=[];return n=n.concat(t(r)),n=n.concat(t(null)),n}var a0=function(e){return atob(e)},l0=s0,A0=a0,c0=u0;function u0(r){for(var e=Array.isArray(r)?r:l0(r),t=0;t<e.length;t++){var n=e[t];if(n.type==="preprocessor"){var i=n.data.match(/\#define\s+SHADER_NAME(_B64)?\s+(.+)$/);if(i&&i[2]){var s=i[1],o=i[2];return(s?A0(o):o).trim()}}}}/*!
|
96
96
|
* repeat-string <https://github.com/jonschlinkert/repeat-string>
|
97
97
|
*
|
98
98
|
* Copyright (c) 2014-2015, Jon Schlinkert.
|
@@ -102,22 +102,22 @@ ${e}`,bf=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),xf=Objec
|
|
102
102
|
*
|
103
103
|
* Copyright (c) 2014-2015, Jon Schlinkert.
|
104
104
|
* Licensed under the MIT license.
|
105
|
-
*/var f0=h0,g0=function(e,t,n){return n=typeof n<"u"?n+"":" ",f0(n,t)+e},p0=g0,m0=E0;function E0(r,e,t){e=typeof e=="number"?e:1,t=t||": ";var n=r.split(/\r?\n/),i=String(n.length+e-1).length;return n.map(function(s,o){var a=o+e,
|
106
|
-
`)}var zi=
|
105
|
+
*/var f0=h0,g0=function(e,t,n){return n=typeof n<"u"?n+"":" ",f0(n,t)+e},p0=g0,m0=E0;function E0(r,e,t){e=typeof e=="number"?e:1,t=t||": ";var n=r.split(/\r?\n/),i=String(n.length+e-1).length;return n.map(function(s,o){var a=o+e,l=String(a).length,A=p0(a,i-l);return A+t+s}).join(`
|
106
|
+
`)}var zi=TA.sprintf,I0=Hg,C0=c0,v0=m0,y0=B0;function B0(r,e,t){var n=C0(e)||"of unknown name (see npm glsl-shader-name)",i="unknown type";t!==void 0&&(i=t===I0.FRAGMENT_SHADER?"fragment":"vertex");for(var s=zi(`Error compiling %s shader %s:
|
107
107
|
`,i,n),o=zi("%s%s",s,r),a=r.split(`
|
108
|
-
`),
|
109
|
-
`),
|
110
|
-
`,A
|
108
|
+
`),l={},A=0;A<a.length;A++){var c=a[A];if(!(c===""||c==="\0")){var u=parseInt(c.split(":")[2]);if(isNaN(u))throw new Error(zi("Could not parse error: %s",c));l[u]=c}}for(var h=v0(e).split(`
|
109
|
+
`),A=0;A<h.length;A++)if(!(!l[A+3]&&!l[A+2]&&!l[A+1])){var d=h[A];if(s+=d+`
|
110
|
+
`,l[A+1]){var f=l[A+1];f=f.substr(f.split(":",3).join(":").length+1).trim(),s+=zi(`^^^ %s
|
111
111
|
|
112
|
-
`,f)}}return{long:s.trim(),short:o.trim()}}var _o,
|
113
|
-
`+i)}throw new ko(i,s.short,s.long)}return n}
|
112
|
+
`,f)}}return{long:s.trim(),short:o.trim()}}var _o,kA;function Q0(){if(kA)return _o;kA=1,_o=r;function r(e,t){var n={identity:t},i=e.valueOf;return Object.defineProperty(e,"valueOf",{value:function(s){return s!==t?i.apply(this,arguments):n},writable:!0}),n}return _o}var Lo,NA;function T0(){if(NA)return Lo;NA=1;var r=Q0();Lo=e;function e(){var t={};return function(n){if((typeof n!="object"||n===null)&&typeof n!="function")throw new Error("Weakmap-shim: Key must be object");var i=n.valueOf(t);return i&&i.identity===t?i:r(n,t)}}return Lo}var Fo,MA;function b0(){if(MA)return Fo;MA=1;var r=T0();Fo=e;function e(){var t=r();return{get:function(n,i){var s=t(n);return s.hasOwnProperty("value")?s.value:i},set:function(n,i){return t(n).value=i,this},has:function(n){return"value"in t(n)},delete:function(n){return delete t(n).value}}}return Fo}xo.shader=_0,xo.program=L0;var ko=ji,x0=y0,w0=typeof WeakMap>"u"?b0():WeakMap,PA=new w0,S0=0;function OA(r,e,t,n,i,s,o){this.id=r,this.src=e,this.type=t,this.shader=n,this.count=s,this.programs=[],this.cache=o}OA.prototype.dispose=function(){if(--this.count===0){for(var r=this.cache,e=r.gl,t=this.programs,n=0,i=t.length;n<i;++n){var s=r.programs[t[n]];s&&(delete r.programs[n],e.deleteProgram(s))}e.deleteShader(this.shader),delete r.shaders[this.type===e.FRAGMENT_SHADER|0][this.src]}};function UA(r){this.gl=r,this.shaders=[{},{}],this.programs={}}var GA=UA.prototype;function R0(r,e,t){var n=r.createShader(e);if(r.shaderSource(n,t),r.compileShader(n),!r.getShaderParameter(n,r.COMPILE_STATUS)){var i=r.getShaderInfoLog(n);try{var s=x0(i,t,e)}catch(o){throw console.warn("Failed to format compiler error: "+o),new ko(i,`Error compiling shader:
|
113
|
+
`+i)}throw new ko(i,s.short,s.long)}return n}GA.getShaderReference=function(r,e){var t=this.gl,n=this.shaders[r===t.FRAGMENT_SHADER|0],i=n[e];if(!i||!t.isShader(i.shader)){var s=R0(t,r,e);i=n[e]=new OA(S0++,e,r,s,[],1,this)}else i.count+=1;return i};function D0(r,e,t,n,i){var s=r.createProgram();r.attachShader(s,e),r.attachShader(s,t);for(var o=0;o<n.length;++o)r.bindAttribLocation(s,i[o],n[o]);if(r.linkProgram(s),!r.getProgramParameter(s,r.LINK_STATUS)){var a=r.getProgramInfoLog(s);throw new ko(a,"Error linking program: "+a)}return s}GA.getProgram=function(r,e,t,n){var i=[r.id,e.id,t.join(":"),n.join(":")].join("@"),s=this.programs[i];return(!s||!this.gl.isProgram(s))&&(this.programs[i]=s=D0(this.gl,r.shader,e.shader,t,n),r.programs.push(i),e.programs.push(i)),s};function HA(r){var e=PA.get(r);return e||(e=new UA(r),PA.set(r,e)),e}function _0(r,e,t){return HA(r).getShaderReference(e,t)}function L0(r,e,t,n,i){return HA(r).getProgram(e,t,n,i)}var No={};No.uniforms=F0,No.attributes=k0;var $A={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},Zi=null;function YA(r,e){if(!Zi){var t=Object.keys($A);Zi={};for(var n=0;n<t.length;++n){var i=t[n];Zi[r[i]]=$A[i]}}return Zi[e]}function F0(r,e){for(var t=r.getProgramParameter(e,r.ACTIVE_UNIFORMS),n=[],i=0;i<t;++i){var s=r.getActiveUniform(e,i);if(s){var o=YA(r,s.type);if(s.size>1)for(var a=0;a<s.size;++a)n.push({name:s.name.replace("[0]","["+a+"]"),type:o});else n.push({name:s.name,type:o})}}return n}function k0(r,e){for(var t=r.getProgramParameter(e,r.ACTIVE_ATTRIBUTES),n=[],i=0;i<t;++i){var s=r.getActiveAttrib(e,i);s&&n.push({name:s.name,type:YA(r,s.type)})}return n}var N0=Fg,M0=Ng,VA=yA,Mo=xo,KA=No,P0=ji;function JA(r){this.gl=r,this.gl.lastAttribCount=0,this._vref=this._fref=this._relink=this.vertShader=this.fragShader=this.program=this.attributes=this.uniforms=this.types=null}var Po=JA.prototype;Po.bind=function(){this.program||this._relink();var r,e=this.gl.getProgramParameter(this.program,this.gl.ACTIVE_ATTRIBUTES),t=this.gl.lastAttribCount;if(e>t)for(r=t;r<e;r++)this.gl.enableVertexAttribArray(r);else if(t>e)for(r=e;r<t;r++)this.gl.disableVertexAttribArray(r);this.gl.lastAttribCount=e,this.gl.useProgram(this.program)},Po.dispose=function(){for(var r=this.gl.lastAttribCount,e=0;e<r;e++)this.gl.disableVertexAttribArray(e);this.gl.lastAttribCount=0,this._fref&&this._fref.dispose(),this._vref&&this._vref.dispose(),this.attributes=this.types=this.vertShader=this.fragShader=this.program=this._relink=this._fref=this._vref=null};function O0(r,e){return r.name<e.name?-1:1}Po.update=function(r,e,t,n){if(!e||arguments.length===1){var i=r;r=i.vertex,e=i.fragment,t=i.uniforms,n=i.attributes}var s=this,o=s.gl,a=s._vref;s._vref=Mo.shader(o,o.VERTEX_SHADER,r),a&&a.dispose(),s.vertShader=s._vref.shader;var l=this._fref;if(s._fref=Mo.shader(o,o.FRAGMENT_SHADER,e),l&&l.dispose(),s.fragShader=s._fref.shader,!t||!n){var A=o.createProgram();if(o.attachShader(A,s.fragShader),o.attachShader(A,s.vertShader),o.linkProgram(A),!o.getProgramParameter(A,o.LINK_STATUS)){var c=o.getProgramInfoLog(A);throw new P0(c,"Error linking program:"+c)}t=t||KA.uniforms(o,A),n=n||KA.attributes(o,A),o.deleteProgram(A)}n=n.slice(),n.sort(O0);var u=[],h=[],d=[],f;for(f=0;f<n.length;++f){var g=n[f];if(g.type.indexOf("mat")>=0){for(var p=g.type.charAt(g.type.length-1)|0,C=new Array(p),T=0;T<p;++T)C[T]=d.length,h.push(g.name+"["+T+"]"),typeof g.location=="number"?d.push(g.location+T):Array.isArray(g.location)&&g.location.length===p&&typeof g.location[T]=="number"?d.push(g.location[T]|0):d.push(-1);u.push({name:g.name,type:g.type,locations:C})}else u.push({name:g.name,type:g.type,locations:[d.length]}),h.push(g.name),typeof g.location=="number"?d.push(g.location|0):d.push(-1)}var b=0;for(f=0;f<d.length;++f)if(d[f]<0){for(;d.indexOf(b)>=0;)b+=1;d[f]=b}var y=new Array(t.length);function x(){s.program=Mo.program(o,s._vref,s._fref,h,d);for(var R=0;R<t.length;++R)y[R]=o.getUniformLocation(s.program,t[R].name)}x(),s._relink=x,s.types={uniforms:VA(t),attributes:VA(n)},s.attributes=M0(o,s,u,d),Object.defineProperty(s,"uniforms",N0(o,s,t,y))};function U0(r,e,t,n,i){var s=new JA(r);return s.update(e,t,n,i),s}var G0=U0;Object.defineProperty(vA,"__esModule",{value:!0});var H0=Object.assign||function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},$0=G0,Y0=V0($0);function V0(r){return r&&r.__esModule?r:{default:r}}var K0=`attribute vec2 _p;
|
114
114
|
varying vec2 _uv;
|
115
115
|
void main() {
|
116
116
|
gl_Position = vec4(_p,0.0,1.0);
|
117
117
|
_uv = vec2(0.5, 0.5) * (_p+vec2(1.0, 1.0));
|
118
118
|
}`,J0={cover:function(e){return".5+(uv-.5)*vec2(min(ratio/"+e+",1.),min("+e+"/ratio,1.))"},contain:function(e){return".5+(uv-.5)*vec2(max(ratio/"+e+",1.),max("+e+"/ratio,1.))"},stretch:function(){return"uv"}},W0=function(e,t){var n=J0[t];if(!n)throw new Error("invalid resizeMode="+t);return"precision highp float;varying vec2 _uv;uniform sampler2D from, to;uniform float progress, ratio, _fromR, _toR;vec4 getFromColor(vec2 uv){return texture2D(from,"+n("_fromR")+");}vec4 getToColor(vec2 uv){return texture2D(to,"+n("_toR")+`);}
|
119
119
|
`+e+`
|
120
|
-
void main(){gl_FragColor=transition(_uv);}`},
|
120
|
+
void main(){gl_FragColor=transition(_uv);}`},WA=vA.default=function(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=H0({resizeMode:"cover"},t),i=n.resizeMode,s=(0,Y0.default)(r,K0,W0(e.glsl,i));return s.bind(),s.attributes._p.pointer(),{draw:function(a,l,A){var c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:r.drawingBufferWidth,u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:r.drawingBufferHeight,h=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};s.bind(),s.uniforms.ratio=c/u,s.uniforms.progress=a,s.uniforms.from=l.bind(0),s.uniforms.to=A.bind(1),s.uniforms._fromR=l.shape[0]/l.shape[1],s.uniforms._toR=A.shape[0]/A.shape[1];var d=2;for(var f in e.paramsTypes){var g=f in h?h[f]:e.defaultParams[f];if(e.paramsTypes[f]==="sampler2D")if(!g)console.warn("uniform["+f+"]: A texture MUST be defined for uniform sampler2D of a texture");else{if(typeof g.bind!="function")throw new Error("uniform["+f+"]: A gl-texture2d API-like object was expected");s.uniforms[f]=g.bind(d++)}else s.uniforms[f]=g}r.drawArrays(r.TRIANGLES,0,3)},dispose:function(){s.dispose()}}},q0=[{name:"Bounce",paramsTypes:{shadow_colour:"vec4",shadow_height:"float",bounces:"float"},defaultParams:{shadow_colour:[0,0,0,.6],shadow_height:.075,bounces:3},glsl:`// Author: Adrian Purser
|
121
121
|
// License: MIT
|
122
122
|
|
123
123
|
uniform vec4 shadow_colour; // = vec4(0.,0.,0.,.6)
|
@@ -2450,46 +2450,46 @@ vec4 transition(vec2 uv) {
|
|
2450
2450
|
vec4 b=getToColor(p);
|
2451
2451
|
return mix(a, b, step(0.0+p.y,progress));
|
2452
2452
|
}
|
2453
|
-
`,author:"Jake Nelson",license:"MIT",createdAt:"Wed, 1 Nov 2017 15:24:36 -0500",updatedAt:"Thu, 2 Nov 2017 18:37:42 -0500"}];const
|
2454
|
-
`).flatMap(s=>{const o=s.split(" ").filter(Boolean);return o.length?o.slice(1).reduce((a,A,l)=>{const u=`${a[a.length-1].text} ${A}`.trim(),h=r.measureText(u);if(h.width>n)a=[...a,...jl({context:r,word:A,maxW:n})];else{const d=e[l%e.length];r.font=r.font.replace(ii,d.toString()),a[a.length-1]={text:u,metrics:h}}return a},jl({context:r,word:o[0],maxW:n})):{text:"",metrics:r.measureText("")}})}finally{r.restore()}},{cacheKey:([{fontSizes:r,text:e,maxW:t}])=>`${JSON.stringify(r)}_${e}_${t}`}),zl=[{family:"Noto Arabic",regex:new RegExp("\\p{Script=Arabic}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansArabic-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Chinese",regex:new RegExp("\\p{Script=Han}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansSC-VariableFont_wght.woff2",style:"normal"},{family:"Noto Hebrew",regex:new RegExp("\\p{Script=Hebrew}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansHebrew-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Hindi",regex:new RegExp("\\p{Script=Devanagari}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansDevanagari-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Japanese",regex:new RegExp("\\p{Script=Han}|\\p{Script=Katakana}|\\p{Script=Hiragana}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansJP-VariableFont_wght.woff2",style:"normal"},{family:"Noto Korean",regex:new RegExp("\\p{Script=Hangul}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansKR-VariableFont_wght.woff2",style:"normal"},{family:"Noto Color Emoji",regex:new RegExp("\\p{Extended_Pictographic}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoColorEmoji-Regular.woff2",style:"normal"}];function Z0({text:r,font:e}){let t=e;return zl.forEach(({family:n,regex:i})=>{i.exec(r)&&(t+=`, ${n}`)}),t}oo(({context:r,fontSizes:e,maxW:t=1/0,words:n})=>{try{return r.save(),r.font=r.font.replace(ii,e[0].toString()),n.length<=0?[]:n.slice(1).reduce((i,s)=>{var o;const a=s.text,l=`${(o=i[i.length-1])==null?void 0:o.text} ${a}`.trim(),c=r.measureText(l);if(c.width>t){const u=e[i.length%e.length];r.font=r.font.replace(ii,u.toString()),i=[...i,{text:a,metrics:r.measureText(a),words:[s]}]}else i[i.length-1]={text:l,metrics:c,words:[...i[i.length-1].words,s]};return i},[{text:n[0].text,metrics:r.measureText(n[0].text),words:[n[0]]}])}finally{r.restore()}},{cacheKey:([{fontSizes:r,words:e,maxW:t}])=>`${JSON.stringify(r)}_${JSON.stringify(e)}_${t}`});let es;const ep=new Uint8Array(16);function tp(){if(!es&&(es=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!es))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return es(ep)}const Et=[];for(let r=0;r<256;++r)Et.push((r+256).toString(16).slice(1));function rp(r,e=0){return Et[r[e+0]]+Et[r[e+1]]+Et[r[e+2]]+Et[r[e+3]]+"-"+Et[r[e+4]]+Et[r[e+5]]+"-"+Et[r[e+6]]+Et[r[e+7]]+"-"+Et[r[e+8]]+Et[r[e+9]]+"-"+Et[r[e+10]]+Et[r[e+11]]+Et[r[e+12]]+Et[r[e+13]]+Et[r[e+14]]+Et[r[e+15]]}const Zl={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function np(r,e,t){if(Zl.randomUUID&&!e&&!r)return Zl.randomUUID();r=r||{};const n=r.random||(r.rng||tp)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){t=t||0;for(let i=0;i<16;++i)e[t+i]=n[i];return e}return rp(n)}oo(({font:r,scale:e,context:t,maxW:n,maxH:i,text:s,minSize:o,maxSize:a})=>{var A,l;let c=0;if(a){c=(o??0)*e;let h=0;for(;a*e>c+1;){c+=1;const d=z0({context:t,fontSizes:[c],text:s,maxW:n});if(h=d.reduce((f,g)=>(g.metrics.width>f&&(f=g.metrics.width),f),0),h>n||d.length*c>i){c-=1;break}}}else c=parseFloat(((l=(A=r.match(ii))==null?void 0:A.groups)==null?void 0:l.value)??"0")*e;return c},{cacheKey:([{font:r,text:e,minSize:t,maxSize:n,scale:i,maxW:s,maxH:o}])=>`${r}_${e}_${t}_${n}_${i}_${s}_${o}`});function ip(r){if(r===null||typeof r!="object")return!1;if(Object.getPrototypeOf(r)===null)return!0;let e=r;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(r)===e}function sp(r){return r.replace(/\\/g,"\\\\").replace(/\//g,"\\/").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\f/g,"\\f").replace(/"/g,'\\"')}const op=dn(()=>KA.loadYoga());vf.filters.define("parse",r=>typeof r>"u"?null:typeof r=="string"?`"${sp(r)}"`:ip(r)||Array.isArray(r)?JSON.stringify(r):r);const ap="3";function Ap(r,e){return typeof r=="number"?{top:r*e,right:r*e,bottom:r*e,left:r*e}:{top:typeof r.top=="number"?r.top*e:r.top,right:typeof r.right=="number"?r.right*e:r.right,bottom:typeof r.bottom=="number"?r.bottom*e:r.bottom,left:typeof r.left=="number"?r.left*e:r.left}}function ec(r,e){return typeof r=="number"?{top:r*e,right:r*e,bottom:r*e,left:r*e}:{top:(typeof r.top=="number"?r.top*e:r.top)??0,right:(typeof r.right=="number"?r.right*e:r.right)??0,bottom:(typeof r.bottom=="number"?r.bottom*e:r.bottom)??0,left:(typeof r.left=="number"?r.left*e:r.left)??0}}function tc(r,e,{layout:t,scale:n=1}){const{position:i="relative",inset:s,width:o,height:a,minWidth:A,minHeight:l,maxWidth:c,maxHeight:u,flex:h,gap:d,margin:f,padding:g,direction:p="column",align:v="start",alignSelf:T,justify:b="start"}=t,y={static:r.POSITION_TYPE_STATIC,relative:r.POSITION_TYPE_RELATIVE,absolute:r.POSITION_TYPE_ABSOLUTE};if(e.setPositionType(y[i]),s){const{top:$,right:W,bottom:O,left:K}=Ap(s,n);typeof $<"u"&&e.setPosition(r.EDGE_TOP,$),typeof W<"u"&&e.setPosition(r.EDGE_RIGHT,W),typeof O<"u"&&e.setPosition(r.EDGE_BOTTOM,O),typeof K<"u"&&e.setPosition(r.EDGE_LEFT,K)}const w={row:r.FLEX_DIRECTION_ROW,column:r.FLEX_DIRECTION_COLUMN,"row-reverse":r.FLEX_DIRECTION_ROW_REVERSE,"column-reverse":r.FLEX_DIRECTION_COLUMN_REVERSE};e.setFlexDirection(w[p]);const R={start:r.ALIGN_FLEX_START,end:r.ALIGN_FLEX_END,center:r.ALIGN_CENTER,stretch:r.ALIGN_STRETCH};e.setAlignItems(R[v]),T&&e.setAlignSelf(R[T]);const k={start:r.JUSTIFY_FLEX_START,end:r.JUSTIFY_FLEX_END,center:r.JUSTIFY_CENTER,"space-between":r.JUSTIFY_SPACE_BETWEEN,"space-around":r.JUSTIFY_SPACE_AROUND,"space-evenly":r.JUSTIFY_SPACE_EVENLY};if(e.setJustifyContent(k[b]),f){const{top:$,right:W,bottom:O,left:K}=ec(f,n);e.setMargin(r.EDGE_TOP,$),e.setMargin(r.EDGE_RIGHT,W),e.setMargin(r.EDGE_BOTTOM,O),e.setMargin(r.EDGE_LEFT,K)}if(g){const{top:$,right:W,bottom:O,left:K}=ec(g,n);e.setPadding(r.EDGE_TOP,$),e.setPadding(r.EDGE_RIGHT,W),e.setPadding(r.EDGE_BOTTOM,O),e.setPadding(r.EDGE_LEFT,K)}typeof h<"u"&&e.setFlex(h),e.setGap(r.GUTTER_ALL,(d??0)*n),typeof o<"u"&&e.setWidth(typeof o=="number"?o*n:o),typeof a<"u"&&(typeof a=="function"?e.setHeight("100%"):e.setHeight(typeof a=="number"?a*n:a)),typeof A<"u"&&e.setMinWidth(typeof A=="number"?A*n:A),typeof l<"u"&&e.setMinHeight(typeof l=="number"?l*n:l),typeof c<"u"&&e.setMaxWidth(typeof c=="number"?c*n:c),typeof u<"u"&&e.setMaxHeight(typeof u=="number"?u*n:u)}async function rc({yoga:r,index:e,parent:t,element:n,resolvers:i}){var s;const{type:o,layout:a,options:A,renderer:l}=n,c=r.Node.create();tc(r,c,{layout:a}),t.insertChild(c,e);let u=null;(l.type==="image"||l.type==="video")&&(u=await i[l.type](A));const h=[];for await(const[d,f]of((s=n.children)==null?void 0:s.entries())??[])h.push(await rc({yoga:r,index:d,parent:c,element:f,resolvers:i}));return t.calculateLayout(),{type:o,node:c,element:n,renderer:l,options:A,dependencies:u,childNodes:h}}function nc(r,e,t=0,n=0){const{top:i,left:s}=r.getComputedLayout(),{top:o,left:a,width:A,height:l}=e.node.getComputedLayout(),c=t+a,u=n+o,h=e.childNodes.map(d=>nc(r,d,c,u));return{...e,x:s+c,y:i+u,width:A,height:l,childNodes:h}}async function Oo(r,e){for await(const{node:t,options:n,dependencies:i,renderer:s,childNodes:o}of r){const{width:a,height:A}=s;if(a){const l=await a({node:t,options:n,dependencies:i,measureCanvas:e});t.setWidth(l)}if(await Oo(o,e),A){const l=await A({node:t,options:n,dependencies:i,measureCanvas:e});t.setHeight(l)}await Oo(o,e)}}async function lp({yoga:r,root:e,resolvers:t,measureCanvas:n}){const i=r.Node.create();tc(r,i,{layout:e.layout});const s=await rc({yoga:r,index:0,parent:i,element:e.element,resolvers:t});await Oo([s],n),i.calculateLayout();const{top:o,left:a,width:A,height:l}=i.getComputedLayout(),c={root:{x:a,y:o,width:A,height:l},node:nc(i,s)};return i.freeRecursive(),c}const cp=(((ql=Wl)==null?void 0:ql.default)??Wl).reduce((r,e)=>(r[e.name]=e,r),{});function up({name:r,canvas:e,to:t,from:n,progress:i}){var s,o,a;const A=e.getContext("webgl",{alpha:!0});if(A){A.disable(A.DEPTH_TEST),A.pixelStorei(A.UNPACK_FLIP_Y_WEBGL,!0);const l=A.createBuffer();A.bindBuffer(A.ARRAY_BUFFER,l),A.bufferData(A.ARRAY_BUFFER,new Float32Array([-1,-1,-1,4,4,-1]),A.STATIC_DRAW),A.viewport(0,0,e.width,e.height);const c=(((s=Xi)==null?void 0:s.default)??Xi)(A,n);c.minFilter=A.LINEAR,c.magFilter=A.LINEAR;const u=(((o=Xi)==null?void 0:o.default)??Xi)(A,t);u.minFilter=A.LINEAR,u.magFilter=A.LINEAR;const h=(((a=Jl)==null?void 0:a.default)??Jl)(A,cp[r]);h.draw(i,c,u,e.width,e.height),c.dispose(),u.dispose(),h.dispose(),A.flush()}}async function hp(){return document.createElement("canvas")}function ts(r){let e=0;for(const t of r)Array.isArray(t)?e+=ts(t):e+=t;return e}function dp(r){return r.map(({type:e,duration:t},n)=>{var i,s,o,a;if(e==="transition"){const A=((i=r[n-2])==null?void 0:i.type)==="transition"?r[n-2]:null,l=((s=r[n-1])==null?void 0:s.duration)??1/0,c=((o=r[n+1])==null?void 0:o.duration)??1/0,u=((a=r[n+2])==null?void 0:a.type)==="transition"?r[n+2]:null;return Math.min(A?l/2:l,t,u?c/2:c)*-1}return t})}function ic(r){var e;return{...r,children:((e=r.children)==null?void 0:e.map(t=>{if(t.type!=="recipe")return ic(t)}).filter(Boolean))??[]}}function sc({node:r,scale:e,duration:t}){const n=[];r.type==="recipe"&&n.push({id:np(),type:"scene",x:r.x*e,y:r.y*e,scale:e,duration:t,root:{layout:{width:r.width,height:r.height},element:ic({...r.element,layout:{...r.element.layout,position:"static",width:"100%",height:"100%",margin:0,maxWidth:"100%",maxHeight:"100%"}})}});for(const i of r.childNodes)n.push(...sc({node:i,scale:e,duration:t}));return n}async function oc({node:r,canvases:e,sceneTime:t}){await r.renderer.render({canvases:e,sceneTime:t,dx:r.x,dy:r.y,dw:r.width,dh:r.height,options:r.options,dependencies:r.dependencies});for await(const n of r.childNodes)await oc({node:n,canvases:e,sceneTime:t})}async function fp({layout:r,canvases:e,sceneTime:t}){const{node:n}=r;await oc({node:n,canvases:e,sceneTime:t})}async function ac({config:r,resolvers:e,canvasFactory:t=hp}){const n=await op();async function i(A,l=0){const{x:c=0,y:u=0,scale:h=1,root:d,duration:f}=A,g=await t(),p=await t(),v=await t(),T=await t(),b=await t(),y=await t(),w=await lp({yoga:n,root:d,resolvers:e,measureCanvas:y});return{x:c,y:u,scale:h,draw:async k=>{const $=Math.max(0,k-l);g.width=g.height=0,g.width=w.node.width,g.height=w.node.height,await fp({layout:w,sceneTime:$,canvases:{sceneCanvas:g,cropCanvas:v,letterboxCanvas:T,posterCanvas:b}})},start:l,duration:f,layout:w,sceneCanvas:g,transitionCanvas:p,id:A.id,config:A,childScenes:sc({node:w.node,scale:h,duration:f})}}const s=await Promise.all(r.tracks.map(async A=>{const l=dp(A),c=await Promise.all(A.reduce((f,g,p)=>{if(g.type!=="scene")return f;const v=ts(l.slice(0,p));return f.push(i(g,v)),f},[])),u=A.reduce((f,g,p)=>{if(g.type!=="gap")return f;const v=ts(l.slice(0,p));return f.push({id:g.id,start:v,config:g,duration:g.duration}),f},[]),h=A.reduce((f,g,p)=>{if(g.type!=="transition")return f;const v=g.duration,T=ts(l.slice(0,p))-v;return f.push({id:g.id,name:g.name,start:T,duration:v,config:g,to:c.find(({id:b})=>{var y;return b===((y=A[p+1])==null?void 0:y.id)}),from:c.find(({id:b})=>{var y;return b===((y=A[p-1])==null?void 0:y.id)})}),f},[]),d=A.map(({id:f})=>c.find(({id:g})=>g===f)??u.find(({id:g})=>g===f)??h.find(({id:g})=>g===f)).filter(Boolean);return{drawScenes:c,gapScenes:u,transitions:h,scenes:d,config:A,duration:Math.max(...d.map(({start:f,duration:g})=>f+g)),trackCanvas:await t()}}));console.log({tracks:s});const o=await t();return{draw:async({canvas:A,currentTime:l})=>{const c=A.getContext("2d");if(c){c.globalAlpha=1,c.globalCompositeOperation="source-over",c.clearRect(0,0,A.width,A.height),c.save(),c.fillStyle="black",c.fillRect(0,0,A.width,A.height),c.restore();for await(const{drawScenes:u,transitions:h,trackCanvas:d}of s){d.width=d.height=0,d.width=A.width,d.height=A.height;const f=u.filter(({start:p,duration:v})=>l>=p&&l<p+v);if(f.length<=0)continue;const g=h.find(({start:p,duration:v})=>l>=p&&l<p+v);for await(const{id:p,x:v,y:T,scale:b,start:y,duration:w,sceneCanvas:R,transitionCanvas:k,draw:$}of f)if(await($==null?void 0:$(l)),!g)c.drawImage(R,v,T,R.width*b,R.height*b);else{const{name:W,to:O,from:K,duration:ne}=g;o.width=o.height=k.width=k.height=0,o.width=k.width=R.width,o.height=k.height=R.height;const ee=(O==null?void 0:O.id)===p,Ae=(K==null?void 0:K.id)===p,_=ee&&O.sceneCanvas||o,P=Ae&&K.sceneCanvas||o,X=ee?Math.min(1,Math.max(0,(l-y)/ne)):Math.min(1,Math.max(0,1-(y+w-l)/ne));up({name:W,progress:X,to:_,from:P,canvas:k});const D=d.getContext("2d");if(!D)return;D.globalCompositeOperation="lighter",D.drawImage(k,v,T,k.width*b,k.height*b)}c.drawImage(d,0,0,d.width,d.height)}}},tracks:s,audioTracks:r.audioTracks,duration:Math.max(...s.map(({duration:A})=>A),...r.audioTracks.map(({start:A,duration:l})=>A+l))}}const gp={name:"@vouchfor/embeds",version:"0.0.0-experiment.ea3c2e1",license:"MIT",author:"Aaron Williams",main:"dist/es/embeds.js",module:"dist/es/embeds.js",type:"module",types:"dist/es/src/index.d.ts",exports:{".":"./dist/es/embeds.js"},files:["dist","src"],publishConfig:{tag:"experiment",access:"public"},engines:{node:">=18.18.0"},scripts:{build:"rm -rf dist && tsc && yarn build:self","build:deps":"yarn --cwd ../media-player build","build:self":"vite build --mode iife && vite build --mode es && node scripts/build.cjs","build:package":"yarn build","build:storybook":"yarn prebuild && storybook build","generate:manifest":"wca src --outFile custom-elements.json",lint:"eslint . --quiet","lint:fix":"eslint . --fix","lint:staged":"lint-staged",prepublishOnly:"yarn build",size:"size-limit",storybook:"yarn prebuild && storybook dev -p 6007",prebuild:"yarn build:deps && yarn generate:manifest",test:"rm -rf test/lib && yarn prebuild && vite build --mode test && web-test-runner","test:ci":"yarn test --config web-test-runner.ci.config.js","test:watch":"yarn test --watch"},"lint-staged":{"**/*.{ts,tsx,js}":"eslint --fix --quiet","**/*.{md,json,yml}":"prettier --write"},dependencies:{"@a11y/focus-trap":"^1.0.5","@lit/task":"^1.0.0","@vouchfor/canvas-video":"0.0.0-experiment.ea3c2e1","@vouchfor/media-player":"0.0.0-experiment.ea3c2e1",uuid:"^9.0.1"},peerDependencies:{lit:"^3.1.2"},devDependencies:{"@esm-bundle/chai":"^4.3.4-fix.0","@open-wc/testing":"^4.0.0","@storybook/addon-essentials":"^8.0.4","@storybook/addon-links":"^8.0.4","@storybook/blocks":"^8.0.4","@storybook/web-components":"^8.0.4","@storybook/web-components-vite":"^8.0.4","@svgr/core":"^8.1.0","@types/flat":"^5.0.5","@types/mocha":"^10.0.6","@vouchfor/eslint-config":"^1.0.1","@vouchfor/prettier-config":"^1.0.1","@vouchfor/video-utils":"0.0.0-experiment.ea3c2e1","@web/dev-server-esbuild":"^1.0.2","@web/test-runner":"^0.18.1","@web/test-runner-browserstack":"^0.7.1","@web/test-runner-mocha":"^0.9.0","@web/test-runner-playwright":"^0.11.0",glob:"^10.3.10","lint-staged":"^15.2.2",lit:"^3.1.2",lodash:"^4.17.21",react:"^18.2.0","react-dom":"^18.2.0","rollup-plugin-tla":"^0.0.2",sinon:"^17.0.1",storybook:"^8.0.4",svgson:"^5.3.1",typescript:"^5.4.3",vite:"^5.2.2","vite-plugin-commonjs":"^0.10.1","vite-plugin-dts":"^3.7.3","web-component-analyzer":"^2.0.0"}};function pp(r){const{publicApiUrl:e}=Li(r),t=Hr();return navigator.sendBeacon(`${e}/api/visitor`,JSON.stringify({visitorId:t})),t}function mp(r){var s,o,a,A,l,c,u,h,d,f,g,p;if(typeof window>"u")return{client:null,tab:null,request:Hr()};let e=(o=(s=window.localStorage)==null?void 0:s.getItem)==null?void 0:o.call(s,"vouch-uid-visitor"),t=(A=(a=window.localStorage)==null?void 0:a.getItem)==null?void 0:A.call(a,"vouch-uid-client"),n=(c=(l=window.sessionStorage)==null?void 0:l.getItem)==null?void 0:c.call(l,"vouch-uid-tab");const i=Hr();return e||(e=pp(r),(h=(u=window.localStorage)==null?void 0:u.setItem)==null||h.call(u,"vouch-uid-visitor",e)),t||(t=Hr(),(f=(d=window.localStorage)==null?void 0:d.setItem)==null||f.call(d,"vouch-uid-client",t)),n||(n=Hr(),(p=(g=window.sessionStorage)==null?void 0:g.setItem)==null||p.call(g,"vouch-uid-tab",n)),{client:t,tab:n,request:i,visitor:e}}function Ep(r,e){return r&&"vouchId"in r?r.vouchId:(e==null?void 0:e.id)??null}function Ip(r="embedded_player"){var i,s;const[e,t]=((s=(i=Intl.DateTimeFormat().resolvedOptions().timeZone)==null?void 0:i.split)==null?void 0:s.call(i,"/"))??[],n={};return[...new URLSearchParams(location.search).entries()].forEach(([o,a])=>{if(/utm/.test(o)){const A=o.toLowerCase().replace(/[-_][a-z0-9]/g,l=>l.slice(-1).toUpperCase());n[A]=a}}),{source:r,time:new Date,region:t,country:e,screenHeight:window.screen.height,screenWidth:window.screen.width,referrer:document.referrer,currentUrl:location.href,embedType:"media-player-embed",embedVersion:gp.version,templateVersion:ap,...n}}const Ac=1;class Cp{constructor(e){this._batchedEvents=[],this._hasPlayed=!1,this._hasLoaded={},this._answersViewed={},this._streamStartTime={},this._streamLatestTime={},this._currentlyPlayingVideo=null,this._createTrackingEvent=(t,n)=>{const i=Ep(n,this.host.vouch);!i||this.host.disableTracking||this._batchedEvents.push({event:t,payload:{...n,vouchId:i,time:new Date().toISOString()}})},this._sendTrackingEvent=()=>{if(this._batchedEvents.length<=0)return;const{publicApiUrl:t}=Li(this.host.env),{client:n,tab:i,request:s,visitor:o}=mp(this.host.env);navigator.sendBeacon(`${t}/api/batchevents`,JSON.stringify({payload:{events:this._batchedEvents},context:{"x-uid-client":n,"x-uid-tab":i,"x-uid-request":s,"x-uid-visitor":o,"x-reporting-metadata":Ip(this.host.trackingSource)}})),this._batchedEvents=[]},this._streamEnded=()=>{if(this._currentlyPlayingVideo){const{id:t,key:n}=this._currentlyPlayingVideo;this._streamLatestTime[n]>this._streamStartTime[n]+Ac&&this._createTrackingEvent("VIDEO_STREAMED",{answerId:t,streamStart:this._streamStartTime[n],streamEnd:this._streamLatestTime[n]}),delete this._streamStartTime[n],delete this._streamLatestTime[n]}},this._handleVouchLoaded=({detail:t})=>{t&&(this._hasLoaded[t]||(this._createTrackingEvent("VOUCH_LOADED",{vouchId:t}),this._hasLoaded[t]=!0))},this._handlePlay=()=>{this._hasPlayed||(this._createTrackingEvent("VIDEO_PLAYED",{streamStart:this.host.currentTime}),this._hasPlayed=!0)},this._handleVideoPlay=({detail:{id:t,key:n}})=>{this._answersViewed[n]||(this._createTrackingEvent("VOUCH_RESPONSE_VIEWED",{answerId:t}),this._answersViewed[n]=!0)},this._handleVideoTimeUpdate=({detail:{id:t,key:n,node:i}})=>{this.host.paused||(this._currentlyPlayingVideo={id:t,key:n,node:i},this._streamLatestTime[n]=i.currentTime,this._streamStartTime[n]||(this._streamStartTime[n]=i.currentTime,this._streamLatestTime[n]=i.currentTime))},this._handleVideoPause=({detail:{id:t,key:n}})=>{this._streamLatestTime[n]>this._streamStartTime[n]+Ac&&this._createTrackingEvent("VIDEO_STREAMED",{answerId:t,streamStart:this._streamStartTime[n],streamEnd:this._streamLatestTime[n]}),delete this._streamStartTime[n],delete this._streamLatestTime[n]},this._pageUnloading=()=>{this._streamEnded(),this._sendTrackingEvent()},this._handleVisibilityChange=()=>{document.visibilityState==="hidden"&&this._pageUnloading()},this._handlePageHide=()=>{this._pageUnloading()},this.host=e,e.addController(this)}hostConnected(){requestAnimationFrame(()=>{var e,t,n,i;"onvisibilitychange"in document?document.addEventListener("visibilitychange",this._handleVisibilityChange):window.addEventListener("pagehide",this._handlePageHide),this.host.addEventListener("vouch:loaded",this._handleVouchLoaded),(e=this.host.mediaPlayer)==null||e.addEventListener("play",this._handlePlay),(t=this.host.mediaPlayer)==null||t.addEventListener("video:play",this._handleVideoPlay),(n=this.host.mediaPlayer)==null||n.addEventListener("video:pause",this._handleVideoPause),(i=this.host.mediaPlayer)==null||i.addEventListener("video:timeupdate",this._handleVideoTimeUpdate)})}hostDisconnected(){var e,t,n,i;this._pageUnloading(),"onvisibilitychange"in document?document.removeEventListener("visibilitychange",this._handleVisibilityChange):window.removeEventListener("pagehide",this._handlePageHide),this.host.removeEventListener("vouch:loaded",this._handleVouchLoaded),(e=this.host.mediaPlayer)==null||e.removeEventListener("play",this._handlePlay),(t=this.host.mediaPlayer)==null||t.removeEventListener("video:play",this._handleVideoPlay),(n=this.host.mediaPlayer)==null||n.removeEventListener("video:pause",this._handleVideoPause),(i=this.host.mediaPlayer)==null||i.removeEventListener("video:timeupdate",this._handleVideoTimeUpdate)}}var Uo={exports:{}};(function(r,e){var t=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof hn<"u"&&hn,n=function(){function s(){this.fetch=!1,this.DOMException=t.DOMException}return s.prototype=t,new s}();(function(s){(function(o){var a=typeof s<"u"&&s||typeof self<"u"&&self||typeof a<"u"&&a,A={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function l(_){return _&&DataView.prototype.isPrototypeOf(_)}if(A.arrayBuffer)var c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(_){return _&&c.indexOf(Object.prototype.toString.call(_))>-1};function h(_){if(typeof _!="string"&&(_=String(_)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(_)||_==="")throw new TypeError('Invalid character in header field name: "'+_+'"');return _.toLowerCase()}function d(_){return typeof _!="string"&&(_=String(_)),_}function f(_){var P={next:function(){var X=_.shift();return{done:X===void 0,value:X}}};return A.iterable&&(P[Symbol.iterator]=function(){return P}),P}function g(_){this.map={},_ instanceof g?_.forEach(function(P,X){this.append(X,P)},this):Array.isArray(_)?_.forEach(function(P){this.append(P[0],P[1])},this):_&&Object.getOwnPropertyNames(_).forEach(function(P){this.append(P,_[P])},this)}g.prototype.append=function(_,P){_=h(_),P=d(P);var X=this.map[_];this.map[_]=X?X+", "+P:P},g.prototype.delete=function(_){delete this.map[h(_)]},g.prototype.get=function(_){return _=h(_),this.has(_)?this.map[_]:null},g.prototype.has=function(_){return this.map.hasOwnProperty(h(_))},g.prototype.set=function(_,P){this.map[h(_)]=d(P)},g.prototype.forEach=function(_,P){for(var X in this.map)this.map.hasOwnProperty(X)&&_.call(P,this.map[X],X,this)},g.prototype.keys=function(){var _=[];return this.forEach(function(P,X){_.push(X)}),f(_)},g.prototype.values=function(){var _=[];return this.forEach(function(P){_.push(P)}),f(_)},g.prototype.entries=function(){var _=[];return this.forEach(function(P,X){_.push([X,P])}),f(_)},A.iterable&&(g.prototype[Symbol.iterator]=g.prototype.entries);function p(_){if(_.bodyUsed)return Promise.reject(new TypeError("Already read"));_.bodyUsed=!0}function v(_){return new Promise(function(P,X){_.onload=function(){P(_.result)},_.onerror=function(){X(_.error)}})}function T(_){var P=new FileReader,X=v(P);return P.readAsArrayBuffer(_),X}function b(_){var P=new FileReader,X=v(P);return P.readAsText(_),X}function y(_){for(var P=new Uint8Array(_),X=new Array(P.length),D=0;D<P.length;D++)X[D]=String.fromCharCode(P[D]);return X.join("")}function w(_){if(_.slice)return _.slice(0);var P=new Uint8Array(_.byteLength);return P.set(new Uint8Array(_)),P.buffer}function R(){return this.bodyUsed=!1,this._initBody=function(_){this.bodyUsed=this.bodyUsed,this._bodyInit=_,_?typeof _=="string"?this._bodyText=_:A.blob&&Blob.prototype.isPrototypeOf(_)?this._bodyBlob=_:A.formData&&FormData.prototype.isPrototypeOf(_)?this._bodyFormData=_:A.searchParams&&URLSearchParams.prototype.isPrototypeOf(_)?this._bodyText=_.toString():A.arrayBuffer&&A.blob&&l(_)?(this._bodyArrayBuffer=w(_.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):A.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(_)||u(_))?this._bodyArrayBuffer=w(_):this._bodyText=_=Object.prototype.toString.call(_):this._bodyText="",this.headers.get("content-type")||(typeof _=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):A.searchParams&&URLSearchParams.prototype.isPrototypeOf(_)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},A.blob&&(this.blob=function(){var _=p(this);if(_)return _;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){var _=p(this);return _||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else return this.blob().then(T)}),this.text=function(){var _=p(this);if(_)return _;if(this._bodyBlob)return b(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(y(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},A.formData&&(this.formData=function(){return this.text().then(O)}),this.json=function(){return this.text().then(JSON.parse)},this}var k=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function $(_){var P=_.toUpperCase();return k.indexOf(P)>-1?P:_}function W(_,P){if(!(this instanceof W))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');P=P||{};var X=P.body;if(_ instanceof W){if(_.bodyUsed)throw new TypeError("Already read");this.url=_.url,this.credentials=_.credentials,P.headers||(this.headers=new g(_.headers)),this.method=_.method,this.mode=_.mode,this.signal=_.signal,!X&&_._bodyInit!=null&&(X=_._bodyInit,_.bodyUsed=!0)}else this.url=String(_);if(this.credentials=P.credentials||this.credentials||"same-origin",(P.headers||!this.headers)&&(this.headers=new g(P.headers)),this.method=$(P.method||this.method||"GET"),this.mode=P.mode||this.mode||null,this.signal=P.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&X)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(X),(this.method==="GET"||this.method==="HEAD")&&(P.cache==="no-store"||P.cache==="no-cache")){var D=/([?&])_=[^&]*/;if(D.test(this.url))this.url=this.url.replace(D,"$1_="+new Date().getTime());else{var S=/\?/;this.url+=(S.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}W.prototype.clone=function(){return new W(this,{body:this._bodyInit})};function O(_){var P=new FormData;return _.trim().split("&").forEach(function(X){if(X){var D=X.split("="),S=D.shift().replace(/\+/g," "),F=D.join("=").replace(/\+/g," ");P.append(decodeURIComponent(S),decodeURIComponent(F))}}),P}function K(_){var P=new g,X=_.replace(/\r?\n[\t ]+/g," ");return X.split("\r").map(function(D){return D.indexOf(`
|
2455
|
-
`)===0?
|
2453
|
+
`,author:"Jake Nelson",license:"MIT",createdAt:"Wed, 1 Nov 2017 15:24:36 -0500",updatedAt:"Thu, 2 Nov 2017 18:37:42 -0500"}];const qA=ao(q0);var XA;function X0(r){if(typeof r=="string"){const[e,t]=r.split(":");return Math.min(parseFloat(e),parseFloat(t))}return r}function j0(r){if(typeof r=="string"){const[e,t]=r.split(":"),n=parseFloat(e),i=parseFloat(t);return n/i}return r}function Oo({resolution:r,aspectRatio:e}){const t=X0(r),n=j0(e),i=n>=1,s=Math.min(i?t*n:t/n,t),o=Math.max(i?t*n:t/n,t);return{resolution:t,aspectRatio:n,height:i?s:o,width:i?o:s}}const ii=/(?<value>\d+\.?\d*)(?=px)/;function jA({context:r,word:e,maxW:t=1/0}){const n=[],i=r.measureText(e);if(Math.floor(i.width)<=t)return[{text:e,metrics:i}];for(let s=0;s<e.length;s++){const o=n[n.length-1],a=((o==null?void 0:o.text)??"")+e[s],l=r.measureText(a);l.width<t?n[o?n.length-1:0]={text:a,metrics:l}:n.push({text:e[s],metrics:r.measureText(e[s])})}return n}const z0=oo(({context:r,fontSizes:e,text:t,maxW:n=1/0})=>{try{return r.save(),r.font=r.font.replace(ii,e[0].toString()),t.split(`
|
2454
|
+
`).flatMap(s=>{const o=s.split(" ").filter(Boolean);return o.length?o.slice(1).reduce((a,l,A)=>{const u=`${a[a.length-1].text} ${l}`.trim(),h=r.measureText(u);if(h.width>n)a=[...a,...jA({context:r,word:l,maxW:n})];else{const d=e[A%e.length];r.font=r.font.replace(ii,d.toString()),a[a.length-1]={text:u,metrics:h}}return a},jA({context:r,word:o[0],maxW:n})):{text:"",metrics:r.measureText("")}})}finally{r.restore()}},{cacheKey:([{fontSizes:r,text:e,maxW:t}])=>`${JSON.stringify(r)}_${e}_${t}`}),zA=[{family:"Noto Arabic",regex:new RegExp("\\p{Script=Arabic}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansArabic-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Chinese",regex:new RegExp("\\p{Script=Han}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansSC-VariableFont_wght.woff2",style:"normal"},{family:"Noto Hebrew",regex:new RegExp("\\p{Script=Hebrew}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansHebrew-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Hindi",regex:new RegExp("\\p{Script=Devanagari}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansDevanagari-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Japanese",regex:new RegExp("\\p{Script=Han}|\\p{Script=Katakana}|\\p{Script=Hiragana}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansJP-VariableFont_wght.woff2",style:"normal"},{family:"Noto Korean",regex:new RegExp("\\p{Script=Hangul}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansKR-VariableFont_wght.woff2",style:"normal"},{family:"Noto Color Emoji",regex:new RegExp("\\p{Extended_Pictographic}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoColorEmoji-Regular.woff2",style:"normal"}];function Z0({text:r,font:e}){let t=e;return zA.forEach(({family:n,regex:i})=>{i.exec(r)&&(t+=`, ${n}`)}),t}oo(({context:r,fontSizes:e,maxW:t=1/0,words:n})=>{try{return r.save(),r.font=r.font.replace(ii,e[0].toString()),n.length<=0?[]:n.slice(1).reduce((i,s)=>{var o;const a=s.text,A=`${(o=i[i.length-1])==null?void 0:o.text} ${a}`.trim(),c=r.measureText(A);if(c.width>t){const u=e[i.length%e.length];r.font=r.font.replace(ii,u.toString()),i=[...i,{text:a,metrics:r.measureText(a),words:[s]}]}else i[i.length-1]={text:A,metrics:c,words:[...i[i.length-1].words,s]};return i},[{text:n[0].text,metrics:r.measureText(n[0].text),words:[n[0]]}])}finally{r.restore()}},{cacheKey:([{fontSizes:r,words:e,maxW:t}])=>`${JSON.stringify(r)}_${JSON.stringify(e)}_${t}`});let es;const ep=new Uint8Array(16);function tp(){if(!es&&(es=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!es))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return es(ep)}const Et=[];for(let r=0;r<256;++r)Et.push((r+256).toString(16).slice(1));function rp(r,e=0){return Et[r[e+0]]+Et[r[e+1]]+Et[r[e+2]]+Et[r[e+3]]+"-"+Et[r[e+4]]+Et[r[e+5]]+"-"+Et[r[e+6]]+Et[r[e+7]]+"-"+Et[r[e+8]]+Et[r[e+9]]+"-"+Et[r[e+10]]+Et[r[e+11]]+Et[r[e+12]]+Et[r[e+13]]+Et[r[e+14]]+Et[r[e+15]]}const ZA={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function np(r,e,t){if(ZA.randomUUID&&!e&&!r)return ZA.randomUUID();r=r||{};const n=r.random||(r.rng||tp)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){t=t||0;for(let i=0;i<16;++i)e[t+i]=n[i];return e}return rp(n)}oo(({font:r,scale:e,context:t,maxW:n,maxH:i,text:s,minSize:o,maxSize:a})=>{var l,A;let c=0;if(a){c=(o??0)*e;let h=0;for(;a*e>c+1;){c+=1;const d=z0({context:t,fontSizes:[c],text:s,maxW:n});if(h=d.reduce((f,g)=>(g.metrics.width>f&&(f=g.metrics.width),f),0),h>n||d.length*c>i){c-=1;break}}}else c=parseFloat(((A=(l=r.match(ii))==null?void 0:l.groups)==null?void 0:A.value)??"0")*e;return c},{cacheKey:([{font:r,text:e,minSize:t,maxSize:n,scale:i,maxW:s,maxH:o}])=>`${r}_${e}_${t}_${n}_${i}_${s}_${o}`});function ip(r){if(r===null||typeof r!="object")return!1;if(Object.getPrototypeOf(r)===null)return!0;let e=r;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(r)===e}function sp(r){return r.replace(/\\/g,"\\\\").replace(/\//g,"\\/").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\f/g,"\\f").replace(/"/g,'\\"')}const op=$r(()=>Jl.loadYoga());vf.filters.define("parse",r=>typeof r>"u"?null:typeof r=="string"?`"${sp(r)}"`:ip(r)||Array.isArray(r)?JSON.stringify(r):r);const ap="3";function lp(r,e){return typeof r=="number"?{top:r*e,right:r*e,bottom:r*e,left:r*e}:{top:typeof r.top=="number"?r.top*e:r.top,right:typeof r.right=="number"?r.right*e:r.right,bottom:typeof r.bottom=="number"?r.bottom*e:r.bottom,left:typeof r.left=="number"?r.left*e:r.left}}function ec(r,e){return typeof r=="number"?{top:r*e,right:r*e,bottom:r*e,left:r*e}:{top:(typeof r.top=="number"?r.top*e:r.top)??0,right:(typeof r.right=="number"?r.right*e:r.right)??0,bottom:(typeof r.bottom=="number"?r.bottom*e:r.bottom)??0,left:(typeof r.left=="number"?r.left*e:r.left)??0}}function tc(r,e,{layout:t,scale:n=1}){const{position:i="relative",inset:s,width:o,height:a,minWidth:l,minHeight:A,maxWidth:c,maxHeight:u,flex:h,gap:d,margin:f,padding:g,direction:p="column",align:C="start",alignSelf:T,justify:b="start"}=t??{},y={static:r.POSITION_TYPE_STATIC,relative:r.POSITION_TYPE_RELATIVE,absolute:r.POSITION_TYPE_ABSOLUTE};if(e.setPositionType(y[i]),s){const{top:$,right:V,bottom:O,left:J}=lp(s,n);typeof $<"u"&&e.setPosition(r.EDGE_TOP,$),typeof V<"u"&&e.setPosition(r.EDGE_RIGHT,V),typeof O<"u"&&e.setPosition(r.EDGE_BOTTOM,O),typeof J<"u"&&e.setPosition(r.EDGE_LEFT,J)}const x={row:r.FLEX_DIRECTION_ROW,column:r.FLEX_DIRECTION_COLUMN,"row-reverse":r.FLEX_DIRECTION_ROW_REVERSE,"column-reverse":r.FLEX_DIRECTION_COLUMN_REVERSE};e.setFlexDirection(x[p]);const R={start:r.ALIGN_FLEX_START,end:r.ALIGN_FLEX_END,center:r.ALIGN_CENTER,stretch:r.ALIGN_STRETCH};e.setAlignItems(R[C]),T&&e.setAlignSelf(R[T]);const k={start:r.JUSTIFY_FLEX_START,end:r.JUSTIFY_FLEX_END,center:r.JUSTIFY_CENTER,"space-between":r.JUSTIFY_SPACE_BETWEEN,"space-around":r.JUSTIFY_SPACE_AROUND,"space-evenly":r.JUSTIFY_SPACE_EVENLY};if(e.setJustifyContent(k[b]),f){const{top:$,right:V,bottom:O,left:J}=ec(f,n);e.setMargin(r.EDGE_TOP,$),e.setMargin(r.EDGE_RIGHT,V),e.setMargin(r.EDGE_BOTTOM,O),e.setMargin(r.EDGE_LEFT,J)}if(g){const{top:$,right:V,bottom:O,left:J}=ec(g,n);e.setPadding(r.EDGE_TOP,$),e.setPadding(r.EDGE_RIGHT,V),e.setPadding(r.EDGE_BOTTOM,O),e.setPadding(r.EDGE_LEFT,J)}typeof h<"u"&&e.setFlex(h),e.setGap(r.GUTTER_ALL,(d??0)*n),typeof o<"u"&&e.setWidth(typeof o=="number"?o*n:o),typeof a<"u"&&(typeof a=="function"?e.setHeight("100%"):e.setHeight(typeof a=="number"?a*n:a)),typeof l<"u"&&e.setMinWidth(typeof l=="number"?l*n:l),typeof A<"u"&&e.setMinHeight(typeof A=="number"?A*n:A),typeof c<"u"&&e.setMaxWidth(typeof c=="number"?c*n:c),typeof u<"u"&&e.setMaxHeight(typeof u=="number"?u*n:u)}async function rc({yoga:r,index:e,parent:t,element:n,resolvers:i}){var s,o;const{type:a,layout:l={},config:A,options:c,renderer:u}=n,h=r.Node.create();tc(r,h,{layout:l}),t.insertChild(h,e);let d=null;i&&((u==null?void 0:u.type)==="text"||(u==null?void 0:u.type)==="image"||(u==null?void 0:u.type)==="video")&&(d=await((s=i[u.type])==null?void 0:s.call(i,{config:A,options:c}))??null);const f=[];for await(const[g,p]of((o=n.children)==null?void 0:o.entries())??[])f.push(await rc({yoga:r,index:g,parent:h,element:p,resolvers:i}));return t.calculateLayout(),{type:a,node:h,element:n,renderer:u,config:A,options:c,dependencies:d,childNodes:f}}function nc(r,e,t=0,n=0){const{top:i,left:s}=r.getComputedLayout(),{top:o,left:a,width:l,height:A}=e.node.getComputedLayout(),c=t+a,u=n+o,h=e.childNodes.map(d=>nc(r,d,c,u));return{...e,x:s+c,y:i+u,width:l,height:A,childNodes:h}}async function Uo(r,e,t){for await(const{node:n,options:i,dependencies:s,renderer:o,childNodes:a}of e){if(o){const{width:l,height:A}=o;if(l){const c=await l({node:n,options:i,dependencies:s,measureCanvas:t});n.setWidth(c)}if(await Uo(r,a,t),A){const c=await A({node:n,options:i,dependencies:s,measureCanvas:t});n.setHeight(c)}}await Uo(r,a,t)}r.calculateLayout()}async function Ap({root:r,resolvers:e,measureCanvas:t}){const n=await op(),i=n.Node.create();tc(n,i,{layout:r.layout});const s=await rc({yoga:n,index:0,parent:i,element:r.element,resolvers:e});await Uo(i,[s],t);const{top:o,left:a,width:l,height:A}=i.getComputedLayout(),c={root:{x:a,y:o,width:l,height:A},node:nc(i,s)};return i.freeRecursive(),c}const cp=(((XA=qA)==null?void 0:XA.default)??qA).reduce((r,e)=>(r[e.name]=e,r),{});function up({name:r,canvas:e,to:t,from:n,progress:i}){var s,o,a;const l=e.getContext("webgl",{alpha:!0});if(l){l.disable(l.DEPTH_TEST),l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL,!0);const A=l.createBuffer();l.bindBuffer(l.ARRAY_BUFFER,A),l.bufferData(l.ARRAY_BUFFER,new Float32Array([-1,-1,-1,4,4,-1]),l.STATIC_DRAW),l.viewport(0,0,e.width,e.height);const c=(((s=Xi)==null?void 0:s.default)??Xi)(l,n);c.minFilter=l.LINEAR,c.magFilter=l.LINEAR;const u=(((o=Xi)==null?void 0:o.default)??Xi)(l,t);u.minFilter=l.LINEAR,u.magFilter=l.LINEAR;const h=(((a=WA)==null?void 0:a.default)??WA)(l,cp[r]);h.draw(i,c,u,e.width,e.height),c.dispose(),u.dispose(),h.dispose(),l.flush()}}async function hp(){return document.createElement("canvas")}function ts(r){let e=0;for(const t of r)Array.isArray(t)?e+=ts(t):e+=t;return e}function dp(r){return r.map(({type:e,duration:t},n)=>{var i,s,o,a;if(e==="transition"){const l=((i=r[n-2])==null?void 0:i.type)==="transition"?r[n-2]:null,A=((s=r[n-1])==null?void 0:s.duration)??1/0,c=((o=r[n+1])==null?void 0:o.duration)??1/0,u=((a=r[n+2])==null?void 0:a.type)==="transition"?r[n+2]:null;return Math.min(l?A/2:A,t,u?c/2:c)*-1}return t})}function ic(r){var e;return{...r,children:((e=r.children)==null?void 0:e.map(t=>{if(t.type!=="recipe")return ic(t)}).filter(Boolean))??[]}}function sc({node:r,duration:e}){const t=[];r.type==="recipe"&&t.push({id:np(),type:"scene",x:r.x,y:r.y,width:r.width,height:r.height,duration:e,root:{element:ic({...r.element,layout:{...r.element.layout,position:"static",width:"100%",height:"100%",margin:0}})}});for(const n of r.childNodes)t.push(...sc({node:n,duration:e}));return t}async function oc({node:r,canvases:e,sceneTime:t}){var n;await((n=r.renderer)==null?void 0:n.render({canvases:e,sceneTime:t,dx:r.x,dy:r.y,dw:r.width,dh:r.height,options:r.options,dependencies:r.dependencies}));const{sceneCanvas:i}=e,s=i.getContext("2d");s&&(s.strokeStyle="red",s.strokeRect(r.x,r.y,r.width,r.height));for await(const o of r.childNodes)await oc({node:o,canvases:e,sceneTime:t})}async function fp({layout:r,canvases:e,sceneTime:t}){const{node:n}=r;await oc({node:n,canvases:e,sceneTime:t})}async function ac({config:r,resolvers:e,rootWidth:t,rootHeight:n,canvasFactory:i=hp}){async function s(A,c=0){var u,h;const{x:d,y:f,width:g,height:p,root:C,duration:T}=A,b=await i(),y=await i(),x=await i(),R=await i(),k=await i(),$=await i(),V=await Ap({root:{...C,layout:{...C.layout,width:t,height:n},element:{...C.element,layout:{...C.element.layout,...typeof d=="number"&&typeof f=="number"?{position:"absolute",inset:{top:f,left:d}}:{},width:g??((u=C.element.layout)==null?void 0:u.width),height:p??((h=C.element.layout)==null?void 0:h.height)}}},resolvers:e,measureCanvas:$});return{draw:async J=>{const ne=Math.max(0,J-c);b.width=b.height=0,b.width=t,b.height=n,await fp({layout:V,sceneTime:ne,canvases:{sceneCanvas:b,cropCanvas:x,letterboxCanvas:R,posterCanvas:k}})},start:c,duration:T,layout:V,sceneCanvas:b,transitionCanvas:y,id:A.id,config:A,childScenes:sc({node:V.node,duration:T})}}const o=await Promise.all(r.tracks.map(async A=>{const c=dp(A),u=await Promise.all(A.reduce((g,p,C)=>{if(p.type!=="scene")return g;const T=ts(c.slice(0,C));return g.push(s(p,T)),g},[])),h=A.reduce((g,p,C)=>{if(p.type!=="gap")return g;const T=ts(c.slice(0,C));return g.push({id:p.id,start:T,config:p,duration:p.duration}),g},[]),d=A.reduce((g,p,C)=>{if(p.type!=="transition")return g;const T=p.duration,b=ts(c.slice(0,C))-T;return g.push({id:p.id,name:p.name,start:b,duration:T,config:p,to:u.find(({id:y})=>{var x;return y===((x=A[C+1])==null?void 0:x.id)}),from:u.find(({id:y})=>{var x;return y===((x=A[C-1])==null?void 0:x.id)})}),g},[]),f=A.map(({id:g})=>u.find(({id:p})=>p===g)??h.find(({id:p})=>p===g)??d.find(({id:p})=>p===g)).filter(Boolean);return{drawScenes:u,gapScenes:h,transitions:d,scenes:f,config:A,duration:Math.max(...f.map(({start:g,duration:p})=>g+p)),trackCanvas:await i()}}));console.log({tracks:o});const a=await i();return{draw:async({canvas:A,currentTime:c})=>{const u=A.getContext("2d");if(u){u.globalAlpha=1,u.globalCompositeOperation="source-over",u.clearRect(0,0,A.width,A.height),u.save(),u.fillStyle="black",u.fillRect(0,0,A.width,A.height),u.restore();for await(const{drawScenes:h,transitions:d,trackCanvas:f}of o){f.width=f.height=0,f.width=A.width,f.height=A.height;const g=h.filter(({start:C,duration:T})=>c>=C&&c<C+T);if(g.length<=0)continue;const p=d.find(({start:C,duration:T})=>c>=C&&c<C+T);for await(const{id:C,start:T,duration:b,sceneCanvas:y,transitionCanvas:x,draw:R}of g)if(await(R==null?void 0:R(c)),!p)u.drawImage(y,0,0,y.width,y.height);else{const{name:k,to:$,from:V,duration:O}=p;a.width=a.height=x.width=x.height=0,a.width=x.width=y.width,a.height=x.height=y.height;const J=($==null?void 0:$.id)===C,ne=(V==null?void 0:V.id)===C,ee=J&&$.sceneCanvas||a,le=ne&&V.sceneCanvas||a,D=J?Math.min(1,Math.max(0,(c-T)/O)):Math.min(1,Math.max(0,1-(T+b-c)/O));up({name:k,progress:D,to:ee,from:le,canvas:x});const P=f.getContext("2d");if(!P)return;P.globalCompositeOperation="lighter",P.drawImage(x,0,0,x.width,x.height)}u.drawImage(f,0,0,f.width,f.height)}}},tracks:o,audioTracks:r.audioTracks,duration:Math.max(...o.map(({duration:A})=>A),...r.audioTracks.map(({start:A,duration:c})=>A+c))}}const gp={name:"@vouchfor/embeds",version:"0.0.0-experiment.ed7c00c",license:"MIT",author:"Aaron Williams",main:"dist/es/embeds.js",module:"dist/es/embeds.js",type:"module",types:"dist/es/src/index.d.ts",exports:{".":"./dist/es/embeds.js"},files:["dist","src"],publishConfig:{tag:"experiment",access:"public"},engines:{node:">=18.18.0"},scripts:{build:"rm -rf dist && tsc && yarn build:self","build:deps":"yarn --cwd ../media-player build","build:self":"vite build --mode iife && vite build --mode es && node scripts/build.cjs","build:package":"yarn build","build:storybook":"yarn prebuild && storybook build","generate:manifest":"wca src --outFile custom-elements.json",lint:"eslint . --quiet","lint:fix":"eslint . --fix","lint:staged":"lint-staged",prepublishOnly:"yarn build",size:"size-limit",storybook:"yarn prebuild && storybook dev -p 6007",prebuild:"yarn build:deps && yarn generate:manifest",test:"rm -rf test/lib && yarn prebuild && vite build --mode test && web-test-runner","test:ci":"yarn test --config web-test-runner.ci.config.js","test:watch":"yarn test --watch"},"lint-staged":{"**/*.{ts,tsx,js}":"eslint --fix --quiet","**/*.{md,json,yml}":"prettier --write"},dependencies:{"@a11y/focus-trap":"^1.0.5","@lit/task":"^1.0.0","@vouchfor/canvas-video":"0.0.0-experiment.ed7c00c","@vouchfor/media-player":"0.0.0-experiment.ed7c00c",uuid:"^9.0.1"},peerDependencies:{lit:"^3.1.2"},devDependencies:{"@esm-bundle/chai":"^4.3.4-fix.0","@open-wc/testing":"^4.0.0","@storybook/addon-essentials":"^8.0.4","@storybook/addon-links":"^8.0.4","@storybook/blocks":"^8.0.4","@storybook/web-components":"^8.0.4","@storybook/web-components-vite":"^8.0.4","@svgr/core":"^8.1.0","@types/flat":"^5.0.5","@types/mocha":"^10.0.6","@vouchfor/eslint-config":"^1.0.1","@vouchfor/prettier-config":"^1.0.1","@vouchfor/video-utils":"0.0.0-experiment.ed7c00c","@web/dev-server-esbuild":"^1.0.2","@web/test-runner":"^0.18.1","@web/test-runner-browserstack":"^0.7.1","@web/test-runner-mocha":"^0.9.0","@web/test-runner-playwright":"^0.11.0",glob:"^10.3.10","lint-staged":"^15.2.2",lit:"^3.1.2",lodash:"^4.17.21",react:"^18.2.0","react-dom":"^18.2.0","rollup-plugin-tla":"^0.0.2",sinon:"^17.0.1",storybook:"^8.0.4",svgson:"^5.3.1",typescript:"^5.4.3",vite:"^5.2.2","vite-plugin-commonjs":"^0.10.1","vite-plugin-dts":"^3.7.3","web-component-analyzer":"^2.0.0"}};function pp(r){const{publicApiUrl:e}=Li(r),t=Hr();return navigator.sendBeacon(`${e}/api/visitor`,JSON.stringify({visitorId:t})),t}function mp(r){var s,o,a,l,A,c,u,h,d,f,g,p;if(typeof window>"u")return{client:null,tab:null,request:Hr()};let e=(o=(s=window.localStorage)==null?void 0:s.getItem)==null?void 0:o.call(s,"vouch-uid-visitor"),t=(l=(a=window.localStorage)==null?void 0:a.getItem)==null?void 0:l.call(a,"vouch-uid-client"),n=(c=(A=window.sessionStorage)==null?void 0:A.getItem)==null?void 0:c.call(A,"vouch-uid-tab");const i=Hr();return e||(e=pp(r),(h=(u=window.localStorage)==null?void 0:u.setItem)==null||h.call(u,"vouch-uid-visitor",e)),t||(t=Hr(),(f=(d=window.localStorage)==null?void 0:d.setItem)==null||f.call(d,"vouch-uid-client",t)),n||(n=Hr(),(p=(g=window.sessionStorage)==null?void 0:g.setItem)==null||p.call(g,"vouch-uid-tab",n)),{client:t,tab:n,request:i,visitor:e}}function Ep(r,e){return r&&"vouchId"in r?r.vouchId:(e==null?void 0:e.id)??null}function Ip(r="embedded_player"){var i,s;const[e,t]=((s=(i=Intl.DateTimeFormat().resolvedOptions().timeZone)==null?void 0:i.split)==null?void 0:s.call(i,"/"))??[],n={};return[...new URLSearchParams(location.search).entries()].forEach(([o,a])=>{if(/utm/.test(o)){const l=o.toLowerCase().replace(/[-_][a-z0-9]/g,A=>A.slice(-1).toUpperCase());n[l]=a}}),{source:r,time:new Date,region:t,country:e,screenHeight:window.screen.height,screenWidth:window.screen.width,referrer:document.referrer,currentUrl:location.href,embedType:"media-player-embed",embedVersion:gp.version,templateVersion:ap,...n}}const lc=1;class Cp{constructor(e){this._batchedEvents=[],this._hasPlayed=!1,this._hasLoaded={},this._answersViewed={},this._streamStartTime={},this._streamLatestTime={},this._currentlyPlayingVideo=null,this._createTrackingEvent=(t,n)=>{const i=Ep(n,this.host.vouch);!i||this.host.disableTracking||this._batchedEvents.push({event:t,payload:{...n,vouchId:i,time:new Date().toISOString()}})},this._sendTrackingEvent=()=>{if(this._batchedEvents.length<=0)return;const{publicApiUrl:t}=Li(this.host.env),{client:n,tab:i,request:s,visitor:o}=mp(this.host.env);navigator.sendBeacon(`${t}/api/batchevents`,JSON.stringify({payload:{events:this._batchedEvents},context:{"x-uid-client":n,"x-uid-tab":i,"x-uid-request":s,"x-uid-visitor":o,"x-reporting-metadata":Ip(this.host.trackingSource)}})),this._batchedEvents=[]},this._streamEnded=()=>{if(this._currentlyPlayingVideo){const{id:t,key:n}=this._currentlyPlayingVideo;this._streamLatestTime[n]>this._streamStartTime[n]+lc&&this._createTrackingEvent("VIDEO_STREAMED",{answerId:t,streamStart:this._streamStartTime[n],streamEnd:this._streamLatestTime[n]}),delete this._streamStartTime[n],delete this._streamLatestTime[n]}},this._handleVouchLoaded=({detail:t})=>{t&&(this._hasLoaded[t]||(this._createTrackingEvent("VOUCH_LOADED",{vouchId:t}),this._hasLoaded[t]=!0))},this._handlePlay=()=>{this._hasPlayed||(this._createTrackingEvent("VIDEO_PLAYED",{streamStart:this.host.currentTime}),this._hasPlayed=!0)},this._handleVideoPlay=({detail:{id:t,key:n}})=>{this._answersViewed[n]||(this._createTrackingEvent("VOUCH_RESPONSE_VIEWED",{answerId:t}),this._answersViewed[n]=!0)},this._handleVideoTimeUpdate=({detail:{id:t,key:n,node:i}})=>{this.host.paused||(this._currentlyPlayingVideo={id:t,key:n,node:i},this._streamLatestTime[n]=i.currentTime,this._streamStartTime[n]||(this._streamStartTime[n]=i.currentTime,this._streamLatestTime[n]=i.currentTime))},this._handleVideoPause=({detail:{id:t,key:n}})=>{this._streamLatestTime[n]>this._streamStartTime[n]+lc&&this._createTrackingEvent("VIDEO_STREAMED",{answerId:t,streamStart:this._streamStartTime[n],streamEnd:this._streamLatestTime[n]}),delete this._streamStartTime[n],delete this._streamLatestTime[n]},this._pageUnloading=()=>{this._streamEnded(),this._sendTrackingEvent()},this._handleVisibilityChange=()=>{document.visibilityState==="hidden"&&this._pageUnloading()},this._handlePageHide=()=>{this._pageUnloading()},this.host=e,e.addController(this)}hostConnected(){requestAnimationFrame(()=>{var e,t,n,i;"onvisibilitychange"in document?document.addEventListener("visibilitychange",this._handleVisibilityChange):window.addEventListener("pagehide",this._handlePageHide),this.host.addEventListener("vouch:loaded",this._handleVouchLoaded),(e=this.host.mediaPlayer)==null||e.addEventListener("play",this._handlePlay),(t=this.host.mediaPlayer)==null||t.addEventListener("video:play",this._handleVideoPlay),(n=this.host.mediaPlayer)==null||n.addEventListener("video:pause",this._handleVideoPause),(i=this.host.mediaPlayer)==null||i.addEventListener("video:timeupdate",this._handleVideoTimeUpdate)})}hostDisconnected(){var e,t,n,i;this._pageUnloading(),"onvisibilitychange"in document?document.removeEventListener("visibilitychange",this._handleVisibilityChange):window.removeEventListener("pagehide",this._handlePageHide),this.host.removeEventListener("vouch:loaded",this._handleVouchLoaded),(e=this.host.mediaPlayer)==null||e.removeEventListener("play",this._handlePlay),(t=this.host.mediaPlayer)==null||t.removeEventListener("video:play",this._handleVideoPlay),(n=this.host.mediaPlayer)==null||n.removeEventListener("video:pause",this._handleVideoPause),(i=this.host.mediaPlayer)==null||i.removeEventListener("video:timeupdate",this._handleVideoTimeUpdate)}}var Go={exports:{}};(function(r,e){var t=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof dn<"u"&&dn,n=function(){function s(){this.fetch=!1,this.DOMException=t.DOMException}return s.prototype=t,new s}();(function(s){(function(o){var a=typeof s<"u"&&s||typeof self<"u"&&self||typeof a<"u"&&a,l={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function A(D){return D&&DataView.prototype.isPrototypeOf(D)}if(l.arrayBuffer)var c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(D){return D&&c.indexOf(Object.prototype.toString.call(D))>-1};function h(D){if(typeof D!="string"&&(D=String(D)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(D)||D==="")throw new TypeError('Invalid character in header field name: "'+D+'"');return D.toLowerCase()}function d(D){return typeof D!="string"&&(D=String(D)),D}function f(D){var P={next:function(){var X=D.shift();return{done:X===void 0,value:X}}};return l.iterable&&(P[Symbol.iterator]=function(){return P}),P}function g(D){this.map={},D instanceof g?D.forEach(function(P,X){this.append(X,P)},this):Array.isArray(D)?D.forEach(function(P){this.append(P[0],P[1])},this):D&&Object.getOwnPropertyNames(D).forEach(function(P){this.append(P,D[P])},this)}g.prototype.append=function(D,P){D=h(D),P=d(P);var X=this.map[D];this.map[D]=X?X+", "+P:P},g.prototype.delete=function(D){delete this.map[h(D)]},g.prototype.get=function(D){return D=h(D),this.has(D)?this.map[D]:null},g.prototype.has=function(D){return this.map.hasOwnProperty(h(D))},g.prototype.set=function(D,P){this.map[h(D)]=d(P)},g.prototype.forEach=function(D,P){for(var X in this.map)this.map.hasOwnProperty(X)&&D.call(P,this.map[X],X,this)},g.prototype.keys=function(){var D=[];return this.forEach(function(P,X){D.push(X)}),f(D)},g.prototype.values=function(){var D=[];return this.forEach(function(P){D.push(P)}),f(D)},g.prototype.entries=function(){var D=[];return this.forEach(function(P,X){D.push([X,P])}),f(D)},l.iterable&&(g.prototype[Symbol.iterator]=g.prototype.entries);function p(D){if(D.bodyUsed)return Promise.reject(new TypeError("Already read"));D.bodyUsed=!0}function C(D){return new Promise(function(P,X){D.onload=function(){P(D.result)},D.onerror=function(){X(D.error)}})}function T(D){var P=new FileReader,X=C(P);return P.readAsArrayBuffer(D),X}function b(D){var P=new FileReader,X=C(P);return P.readAsText(D),X}function y(D){for(var P=new Uint8Array(D),X=new Array(P.length),_=0;_<P.length;_++)X[_]=String.fromCharCode(P[_]);return X.join("")}function x(D){if(D.slice)return D.slice(0);var P=new Uint8Array(D.byteLength);return P.set(new Uint8Array(D)),P.buffer}function R(){return this.bodyUsed=!1,this._initBody=function(D){this.bodyUsed=this.bodyUsed,this._bodyInit=D,D?typeof D=="string"?this._bodyText=D:l.blob&&Blob.prototype.isPrototypeOf(D)?this._bodyBlob=D:l.formData&&FormData.prototype.isPrototypeOf(D)?this._bodyFormData=D:l.searchParams&&URLSearchParams.prototype.isPrototypeOf(D)?this._bodyText=D.toString():l.arrayBuffer&&l.blob&&A(D)?(this._bodyArrayBuffer=x(D.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):l.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(D)||u(D))?this._bodyArrayBuffer=x(D):this._bodyText=D=Object.prototype.toString.call(D):this._bodyText="",this.headers.get("content-type")||(typeof D=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):l.searchParams&&URLSearchParams.prototype.isPrototypeOf(D)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},l.blob&&(this.blob=function(){var D=p(this);if(D)return D;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){var D=p(this);return D||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else return this.blob().then(T)}),this.text=function(){var D=p(this);if(D)return D;if(this._bodyBlob)return b(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(y(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},l.formData&&(this.formData=function(){return this.text().then(O)}),this.json=function(){return this.text().then(JSON.parse)},this}var k=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function $(D){var P=D.toUpperCase();return k.indexOf(P)>-1?P:D}function V(D,P){if(!(this instanceof V))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');P=P||{};var X=P.body;if(D instanceof V){if(D.bodyUsed)throw new TypeError("Already read");this.url=D.url,this.credentials=D.credentials,P.headers||(this.headers=new g(D.headers)),this.method=D.method,this.mode=D.mode,this.signal=D.signal,!X&&D._bodyInit!=null&&(X=D._bodyInit,D.bodyUsed=!0)}else this.url=String(D);if(this.credentials=P.credentials||this.credentials||"same-origin",(P.headers||!this.headers)&&(this.headers=new g(P.headers)),this.method=$(P.method||this.method||"GET"),this.mode=P.mode||this.mode||null,this.signal=P.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&X)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(X),(this.method==="GET"||this.method==="HEAD")&&(P.cache==="no-store"||P.cache==="no-cache")){var _=/([?&])_=[^&]*/;if(_.test(this.url))this.url=this.url.replace(_,"$1_="+new Date().getTime());else{var S=/\?/;this.url+=(S.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}V.prototype.clone=function(){return new V(this,{body:this._bodyInit})};function O(D){var P=new FormData;return D.trim().split("&").forEach(function(X){if(X){var _=X.split("="),S=_.shift().replace(/\+/g," "),F=_.join("=").replace(/\+/g," ");P.append(decodeURIComponent(S),decodeURIComponent(F))}}),P}function J(D){var P=new g,X=D.replace(/\r?\n[\t ]+/g," ");return X.split("\r").map(function(_){return _.indexOf(`
|
2455
|
+
`)===0?_.substr(1,_.length):_}).forEach(function(_){var S=_.split(":"),F=S.shift().trim();if(F){var W=S.join(":").trim();P.append(F,W)}}),P}R.call(V.prototype);function ne(D,P){if(!(this instanceof ne))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');P||(P={}),this.type="default",this.status=P.status===void 0?200:P.status,this.ok=this.status>=200&&this.status<300,this.statusText=P.statusText===void 0?"":""+P.statusText,this.headers=new g(P.headers),this.url=P.url||"",this._initBody(D)}R.call(ne.prototype),ne.prototype.clone=function(){return new ne(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new g(this.headers),url:this.url})},ne.error=function(){var D=new ne(null,{status:0,statusText:""});return D.type="error",D};var ee=[301,302,303,307,308];ne.redirect=function(D,P){if(ee.indexOf(P)===-1)throw new RangeError("Invalid status code");return new ne(null,{status:P,headers:{location:D}})},o.DOMException=a.DOMException;try{new o.DOMException}catch{o.DOMException=function(P,X){this.message=P,this.name=X;var _=Error(P);this.stack=_.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function le(D,P){return new Promise(function(X,_){var S=new V(D,P);if(S.signal&&S.signal.aborted)return _(new o.DOMException("Aborted","AbortError"));var F=new XMLHttpRequest;function W(){F.abort()}F.onload=function(){var re={status:F.status,statusText:F.statusText,headers:J(F.getAllResponseHeaders()||"")};re.url="responseURL"in F?F.responseURL:re.headers.get("X-Request-URL");var ce="response"in F?F.response:F.responseText;setTimeout(function(){X(new ne(ce,re))},0)},F.onerror=function(){setTimeout(function(){_(new TypeError("Network request failed"))},0)},F.ontimeout=function(){setTimeout(function(){_(new TypeError("Network request failed"))},0)},F.onabort=function(){setTimeout(function(){_(new o.DOMException("Aborted","AbortError"))},0)};function Y(re){try{return re===""&&a.location.href?a.location.href:re}catch{return re}}F.open(S.method,Y(S.url),!0),S.credentials==="include"?F.withCredentials=!0:S.credentials==="omit"&&(F.withCredentials=!1),"responseType"in F&&(l.blob?F.responseType="blob":l.arrayBuffer&&S.headers.get("Content-Type")&&S.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(F.responseType="arraybuffer")),P&&typeof P.headers=="object"&&!(P.headers instanceof g)?Object.getOwnPropertyNames(P.headers).forEach(function(re){F.setRequestHeader(re,d(P.headers[re]))}):S.headers.forEach(function(re,ce){F.setRequestHeader(ce,re)}),S.signal&&(S.signal.addEventListener("abort",W),F.onreadystatechange=function(){F.readyState===4&&S.signal.removeEventListener("abort",W)}),F.send(typeof S._bodyInit>"u"?null:S._bodyInit)})}return le.polyfill=!0,a.fetch||(a.fetch=le,a.Headers=g,a.Request=V,a.Response=ne),o.Headers=g,o.Request=V,o.Response=ne,o.fetch=le,o})({})})(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=t.fetch?t:n;e=i.fetch,e.default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,r.exports=e})(Go,Go.exports);var vp=Go.exports;const Ac=ao(vp);async function yp(r){var e;try{if((e=await Ac(r,{method:"HEAD"}))!=null&&e.ok)return r}catch{return}}async function Ho({sources:r}){let e=null;const t=r==null?void 0:r.filter(Boolean),n=t==null?void 0:t.find(s=>s.startsWith("blob:")),i=t==null?void 0:t.find(s=>!s.startsWith("http")&&!s.startsWith("blob:"));if(n||i)return n??i;if(t.length>0){const s=t.map(o=>yp(o));e=(await Promise.all(s)).find(Boolean)}return e}async function Bp(r){try{return(await Ac(r)).text()}catch{return null}}async function Qp(r){return r=r.trim(),r.startsWith("http")||r.startsWith("blob:")?Bp(r):r}const Tp=$r(async({original:r,translation:e,originalLanguage:t="",translationLanguage:n=""},{language:i})=>{var s,o;const a={[(s=n==null?void 0:n.split("-"))==null?void 0:s[0]]:e,[(o=t==null?void 0:t.split("-"))==null?void 0:o[0]]:r},l=(i&&a[i])??r;return l?Qp(l):null},{cacheKey:([r,{language:e}])=>JSON.stringify({...r,language:e})});function bp(r){var e;return((e=r==null?void 0:r.items)==null?void 0:e.map(t=>{var n;return{text:(n=t.alternatives[0])==null?void 0:n.content,start:t.start_time,end:t.end_time}}))??[]}const xp=$r(async r=>{var e,t,n,i,s,o,a,l,A,c,u;const[h,d,f]=await Promise.all([Ho({sources:[(t=(e=r==null?void 0:r.answer)==null?void 0:e.media)==null?void 0:t.video,(i=(n=r==null?void 0:r.answer)==null?void 0:n.media)==null?void 0:i.input]}),Ho({sources:[(o=(s=r==null?void 0:r.answer)==null?void 0:s.media)==null?void 0:o.playlist]}),Ho({sources:[((l=(a=r==null?void 0:r.answer)==null?void 0:a.media)==null?void 0:l.reducedQuality)??((u=(c=(A=r==null?void 0:r.answer)==null?void 0:A.media)==null?void 0:c.videos)==null?void 0:u.xs)]})]);return{src:h,playlist:d,preview:f}},{cacheKey:([r])=>{var e,t,n,i,s,o,a,l,A,c,u;return JSON.stringify({video:(t=(e=r==null?void 0:r.answer)==null?void 0:e.media)==null?void 0:t.video,input:(i=(n=r==null?void 0:r.answer)==null?void 0:n.media)==null?void 0:i.input,playlist:(o=(s=r==null?void 0:r.answer)==null?void 0:s.media)==null?void 0:o.playlist,preview:((l=(a=r==null?void 0:r.answer)==null?void 0:a.media)==null?void 0:l.reducedQuality)??((u=(c=(A=r==null?void 0:r.answer)==null?void 0:A.media)==null?void 0:c.videos)==null?void 0:u.xs)})}});function cc(r){var e,t,n,i,s,o,a,l,A,c,u,h;const d=((t=(e=r==null?void 0:r.answer)==null?void 0:e.contact)==null?void 0:t.name)==="Anonymous"?"":((s=(i=(n=r==null?void 0:r.answer)==null?void 0:n.contact)==null?void 0:i.name)==null?void 0:s.trim())??"",f=((l=(a=(o=r==null?void 0:r.answer)==null?void 0:o.contact)==null?void 0:a.client)==null?void 0:l.name)==="Not Supplied"?"":((h=(u=(c=(A=r==null?void 0:r.answer)==null?void 0:A.contact)==null?void 0:c.client)==null?void 0:u.name)==null?void 0:h.trim())??"",[g,p]=d.split(" ");return{name:d,firstName:g,lastName:p,companyName:f}}const wp=$r(async(r,e,t)=>{var n,i,s;const o=(n=e==null?void 0:e.answer)==null?void 0:n.id;return((s=(i=r==null?void 0:r.questions)==null?void 0:i.items)==null?void 0:s.reduce((l,A)=>{var c;return((c=A==null?void 0:A.answer)==null?void 0:c.id)===o?(l??0)+1:l},0))<=1?o:`${o}-${t}`},{cacheKey:([r,e,t])=>{var n;return JSON.stringify({index:t,rootData:e,allQuestions:(n=r==null?void 0:r.questions)==null?void 0:n.items})}});async function $o({data:r,rootData:e,index:t},n){var i,s,o,a,l,A,c,u,h,d,f,g,p,C,T,b,y,x,R,k,$,V,O,J;const[ne,ee,le]=await Promise.all([wp(r,e,t),xp(e),Tp({original:((s=(i=e==null?void 0:e.answer)==null?void 0:i.media)==null?void 0:s.captions)??((a=(o=e==null?void 0:e.answer)==null?void 0:o.captions)==null?void 0:a.current),translation:((A=(l=e==null?void 0:e.answer)==null?void 0:l.media)==null?void 0:A.translation)??((u=(c=e==null?void 0:e.answer)==null?void 0:c.captions)==null?void 0:u.translation),originalLanguage:(d=(h=e==null?void 0:e.answer)==null?void 0:h.transcription)==null?void 0:d.language,translationLanguage:(p=(g=(f=e==null?void 0:e.answer)==null?void 0:f.transcription)==null?void 0:g.translation)==null?void 0:p.language},n)]),D=cc(e);return{...ee,...D,key:ne,captions:le,wordTimings:bp((C=e==null?void 0:e.answer)==null?void 0:C.transcription),answerLabel:((T=e==null?void 0:e.answer)==null?void 0:T.label)??(e==null?void 0:e.title),prevAnswerLabel:t?((R=(x=(y=(b=r==null?void 0:r.questions)==null?void 0:b.items)==null?void 0:y[t-1])==null?void 0:x.answer)==null?void 0:R.label)??((V=($=(k=r==null?void 0:r.questions)==null?void 0:k.items)==null?void 0:$[t-1])==null?void 0:V.title)??null:null,isFirstInstanceOfName:t?((J=(O=r==null?void 0:r.questions)==null?void 0:O.items)==null?void 0:J.findIndex(P=>cc(P).name===D.name))===t:!0}}const rs={af:"Afrikaans",sq:"Albanian",am:"Amharic",ar:"Arabic",hy:"Armenian",az:"Azerbaijani",eu:"Basque",be:"Belarusian",bn:"Bengali",bs:"Bosnian",bg:"Bulgarian",ca:"Catalan",zh:"Chinese (Simplified)",zh_TW:"Chinese (Traditional)",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch",en:"English",et:"Estonian",fi:"Finnish",fr:"French",fa:"Farsi",tl:"Filipino",ka:"Georgian",de:"German",el:"Greek",gu:"Gujarati",ht:"Haitian Creole",ha:"Hausa",he:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",ga:"Irish",it:"Italian",ja:"Japanese",kn:"Kannada",kk:"Kazakh",ko:"Korean",lv:"Latvian",lt:"Lithuanian",mk:"Macedonian",ms:"Malay",ml:"Malayalam",mt:"Maltese",mr:"Marathi",mn:"Mongolian",no:"Norwegian",ps:"Pashto",pl:"Polish",pt:"Portuguese",pa:"Punjabi",ro:"Romanian",ru:"Russian",sr:"Serbian",si:"Sinhala",sk:"Slovak",sl:"Slovenian",so:"Somali",es:"Spanish",sw:"Swahili",sv:"Swedish",ta:"Tamil",te:"Telugu",th:"Thai",tr:"Turkish",uk:"Ukrainian",ur:"Urdu",uz:"Uzbek",vi:"Vietnamese",cy:"Welsh"};function Sp({data:r}){var e,t;return((t=(e=r==null?void 0:r.questions)==null?void 0:e.items)==null?void 0:t.reduce((n,i)=>{var s,o,a,l,A,c,u;const h=(a=(o=(s=i==null?void 0:i.answer)==null?void 0:s.transcription)==null?void 0:o.language)==null?void 0:a.split("-")[0],d=(u=(c=(A=(l=i==null?void 0:i.answer)==null?void 0:l.transcription)==null?void 0:A.translation)==null?void 0:c.language)==null?void 0:u.split("-")[0];return h&&rs[h]&&!n.find(f=>f.value===h)&&n.push({value:h,label:rs[h]}),d&&rs[d]&&!n.find(f=>f.value===d)&&n.push({value:d,label:rs[d]}),n},[]))??[]}/**
|
2456
2456
|
* @license
|
2457
2457
|
* Copyright 2018 Google LLC
|
2458
2458
|
* SPDX-License-Identifier: BSD-3-Clause
|
2459
|
-
*/const Ke=
|
2459
|
+
*/const Ke=hn(class extends qn{constructor(r){var e;if(super(r),r.type!==un.ATTRIBUTE||r.name!=="class"||((e=r.strings)==null?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(r){return" "+Object.keys(r).filter(e=>r[e]).join(" ")+" "}update(r,[e]){var n,i;if(this.st===void 0){this.st=new Set,r.strings!==void 0&&(this.nt=new Set(r.strings.join(" ").split(/\s/).filter(s=>s!=="")));for(const s in e)e[s]&&!((n=this.nt)!=null&&n.has(s))&&this.st.add(s);return this.render(e)}const t=r.element.classList;for(const s of this.st)s in e||(t.remove(s),this.st.delete(s));for(const s in e){const o=!!e[s];o===this.st.has(s)||(i=this.nt)!=null&&i.has(s)||(o?(t.add(s),this.st.add(s)):(t.remove(s),this.st.delete(s)))}return Vt}});/**
|
2460
2460
|
* @license
|
2461
2461
|
* Copyright 2018 Google LLC
|
2462
2462
|
* SPDX-License-Identifier: BSD-3-Clause
|
2463
|
-
*/const uc="important",Rp=" !"+uc,$o=un(class extends qn{constructor(r){var e;if(super(r),r.type!==cn.ATTRIBUTE||r.name!=="style"||((e=r.strings)==null?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(r){return Object.keys(r).reduce((e,t)=>{const n=r[t];return n==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${n};`},"")}update(r,[e]){const{style:t}=r.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(const n of this.ft)e[n]==null&&(this.ft.delete(n),n.includes("-")?t.removeProperty(n):t[n]=null);for(const n in e){const i=e[n];if(i!=null){this.ft.add(n);const s=typeof i=="string"&&i.endsWith(Rp);n.includes("-")||s?t.setProperty(n,s?i.slice(0,-11):i,s?uc:""):t[n]=i}}return Vt}});function Dp(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var hc={exports:{}};(function(r,e){(function(t){var n=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,i=/^(?=([^\/?#]*))\1([^]*)$/,s=/(?:\/|^)\.(?=\/)/g,o=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,a={buildAbsoluteURL:function(A,l,c){if(c=c||{},A=A.trim(),l=l.trim(),!l){if(!c.alwaysNormalize)return A;var u=a.parseURL(A);if(!u)throw new Error("Error trying to parse base URL.");return u.path=a.normalizePath(u.path),a.buildURLFromParts(u)}var h=a.parseURL(l);if(!h)throw new Error("Error trying to parse relative URL.");if(h.scheme)return c.alwaysNormalize?(h.path=a.normalizePath(h.path),a.buildURLFromParts(h)):l;var d=a.parseURL(A);if(!d)throw new Error("Error trying to parse base URL.");if(!d.netLoc&&d.path&&d.path[0]!=="/"){var f=i.exec(d.path);d.netLoc=f[1],d.path=f[2]}d.netLoc&&!d.path&&(d.path="/");var g={scheme:d.scheme,netLoc:h.netLoc,path:null,params:h.params,query:h.query,fragment:h.fragment};if(!h.netLoc&&(g.netLoc=d.netLoc,h.path[0]!=="/"))if(!h.path)g.path=d.path,h.params||(g.params=d.params,h.query||(g.query=d.query));else{var p=d.path,v=p.substring(0,p.lastIndexOf("/")+1)+h.path;g.path=a.normalizePath(v)}return g.path===null&&(g.path=c.alwaysNormalize?a.normalizePath(h.path):h.path),a.buildURLFromParts(g)},parseURL:function(A){var l=n.exec(A);return l?{scheme:l[1]||"",netLoc:l[2]||"",path:l[3]||"",params:l[4]||"",query:l[5]||"",fragment:l[6]||""}:null},normalizePath:function(A){for(A=A.split("").reverse().join("").replace(s,"");A.length!==(A=A.replace(o,"")).length;);return A.split("").reverse().join("")},buildURLFromParts:function(A){return A.scheme+A.netLoc+A.path+A.params+A.query+A.fragment}};r.exports=a})()})(hc);var Yo=hc.exports;function dc(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function ut(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?dc(Object(t),!0).forEach(function(n){Fp(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):dc(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function _p(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Lp(r){var e=_p(r,"string");return typeof e=="symbol"?e:String(e)}function Fp(r,e,t){return e=Lp(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function st(){return st=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},st.apply(this,arguments)}const he=Number.isFinite||function(r){return typeof r=="number"&&isFinite(r)},kp=Number.isSafeInteger||function(r){return typeof r=="number"&&Math.abs(r)<=Np},Np=Number.MAX_SAFE_INTEGER||9007199254740991;let I=function(r){return r.MEDIA_ATTACHING="hlsMediaAttaching",r.MEDIA_ATTACHED="hlsMediaAttached",r.MEDIA_DETACHING="hlsMediaDetaching",r.MEDIA_DETACHED="hlsMediaDetached",r.BUFFER_RESET="hlsBufferReset",r.BUFFER_CODECS="hlsBufferCodecs",r.BUFFER_CREATED="hlsBufferCreated",r.BUFFER_APPENDING="hlsBufferAppending",r.BUFFER_APPENDED="hlsBufferAppended",r.BUFFER_EOS="hlsBufferEos",r.BUFFER_FLUSHING="hlsBufferFlushing",r.BUFFER_FLUSHED="hlsBufferFlushed",r.MANIFEST_LOADING="hlsManifestLoading",r.MANIFEST_LOADED="hlsManifestLoaded",r.MANIFEST_PARSED="hlsManifestParsed",r.LEVEL_SWITCHING="hlsLevelSwitching",r.LEVEL_SWITCHED="hlsLevelSwitched",r.LEVEL_LOADING="hlsLevelLoading",r.LEVEL_LOADED="hlsLevelLoaded",r.LEVEL_UPDATED="hlsLevelUpdated",r.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",r.LEVELS_UPDATED="hlsLevelsUpdated",r.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",r.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",r.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",r.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",r.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",r.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",r.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",r.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",r.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",r.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",r.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",r.CUES_PARSED="hlsCuesParsed",r.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",r.INIT_PTS_FOUND="hlsInitPtsFound",r.FRAG_LOADING="hlsFragLoading",r.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",r.FRAG_LOADED="hlsFragLoaded",r.FRAG_DECRYPTED="hlsFragDecrypted",r.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",r.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",r.FRAG_PARSING_METADATA="hlsFragParsingMetadata",r.FRAG_PARSED="hlsFragParsed",r.FRAG_BUFFERED="hlsFragBuffered",r.FRAG_CHANGED="hlsFragChanged",r.FPS_DROP="hlsFpsDrop",r.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",r.MAX_AUTO_LEVEL_UPDATED="hlsMaxAutoLevelUpdated",r.ERROR="hlsError",r.DESTROYING="hlsDestroying",r.KEY_LOADING="hlsKeyLoading",r.KEY_LOADED="hlsKeyLoaded",r.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",r.BACK_BUFFER_REACHED="hlsBackBufferReached",r.STEERING_MANIFEST_LOADED="hlsSteeringManifestLoaded",r}({}),ye=function(r){return r.NETWORK_ERROR="networkError",r.MEDIA_ERROR="mediaError",r.KEY_SYSTEM_ERROR="keySystemError",r.MUX_ERROR="muxError",r.OTHER_ERROR="otherError",r}({}),V=function(r){return r.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",r.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",r.KEY_SYSTEM_NO_SESSION="keySystemNoSession",r.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",r.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",r.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",r.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",r.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",r.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",r.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",r.MANIFEST_LOAD_ERROR="manifestLoadError",r.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",r.MANIFEST_PARSING_ERROR="manifestParsingError",r.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",r.LEVEL_EMPTY_ERROR="levelEmptyError",r.LEVEL_LOAD_ERROR="levelLoadError",r.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",r.LEVEL_PARSING_ERROR="levelParsingError",r.LEVEL_SWITCH_ERROR="levelSwitchError",r.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",r.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",r.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",r.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",r.FRAG_LOAD_ERROR="fragLoadError",r.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",r.FRAG_DECRYPT_ERROR="fragDecryptError",r.FRAG_PARSING_ERROR="fragParsingError",r.FRAG_GAP="fragGap",r.REMUX_ALLOC_ERROR="remuxAllocError",r.KEY_LOAD_ERROR="keyLoadError",r.KEY_LOAD_TIMEOUT="keyLoadTimeOut",r.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",r.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",r.BUFFER_APPEND_ERROR="bufferAppendError",r.BUFFER_APPENDING_ERROR="bufferAppendingError",r.BUFFER_STALLED_ERROR="bufferStalledError",r.BUFFER_FULL_ERROR="bufferFullError",r.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",r.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",r.INTERNAL_EXCEPTION="internalException",r.INTERNAL_ABORTED="aborted",r.UNKNOWN="unknown",r}({});const Kr=function(){},Vo={trace:Kr,debug:Kr,log:Kr,warn:Kr,info:Kr,error:Kr};let si=Vo;function Mp(r){const e=self.console[r];return e?e.bind(self.console,`[${r}] >`):Kr}function Pp(r,...e){e.forEach(function(t){si[t]=r[t]?r[t].bind(r):Mp(t)})}function Op(r,e){if(typeof console=="object"&&r===!0||typeof r=="object"){Pp(r,"debug","log","info","warn","error");try{si.log(`Debug logs enabled for "${e}" in hls.js version 1.5.11`)}catch{si=Vo}}else si=Vo}const U=si,Up=/^(\d+)x(\d+)$/,fc=/(.+?)=(".*?"|.*?)(?:,|$)/g;class Xe{constructor(e){typeof e=="string"&&(e=Xe.parseAttrList(e)),st(this,e)}get clientAttrs(){return Object.keys(this).filter(e=>e.substring(0,2)==="X-")}decimalInteger(e){const t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t}hexadecimalInteger(e){if(this[e]){let t=(this[e]||"0x").slice(2);t=(t.length&1?"0":"")+t;const n=new Uint8Array(t.length/2);for(let i=0;i<t.length/2;i++)n[i]=parseInt(t.slice(i*2,i*2+2),16);return n}else return null}hexadecimalIntegerAsNumber(e){const t=parseInt(this[e],16);return t>Number.MAX_SAFE_INTEGER?1/0:t}decimalFloatingPoint(e){return parseFloat(this[e])}optionalFloat(e,t){const n=this[e];return n?parseFloat(n):t}enumeratedString(e){return this[e]}bool(e){return this[e]==="YES"}decimalResolution(e){const t=Up.exec(this[e]);if(t!==null)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e){let t;const n={},i='"';for(fc.lastIndex=0;(t=fc.exec(e))!==null;){let s=t[2];s.indexOf(i)===0&&s.lastIndexOf(i)===s.length-1&&(s=s.slice(1,-1));const o=t[1].trim();n[o]=s}return n}}function Gp(r){return r!=="ID"&&r!=="CLASS"&&r!=="START-DATE"&&r!=="DURATION"&&r!=="END-DATE"&&r!=="END-ON-NEXT"}function Hp(r){return r==="SCTE35-OUT"||r==="SCTE35-IN"}class gc{constructor(e,t){if(this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,t){const n=t.attr;for(const i in n)if(Object.prototype.hasOwnProperty.call(e,i)&&e[i]!==n[i]){U.warn(`DATERANGE tag attribute: "${i}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=i;break}e=st(new Xe({}),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"]);he(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(he(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&&he(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)}}class ns{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 He={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class pc{constructor(e){this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams={[He.AUDIO]:null,[He.VIDEO]:null,[He.AUDIOVIDEO]:null},this.baseurl=e}setByteRange(e,t){const n=e.split("@",2);let i;n.length===1?i=(t==null?void 0:t.byteRangeEndOffset)||0:i=parseInt(n[1]),this._byteRange=[i,parseInt(n[0])+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=Yo.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}}class Ko extends pc{constructor(e,t){super(t),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 ns,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=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 t=this.levelkeys.identity;if(t)this._decryptdata=t.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||!he(this.programDateTime))return null;const e=he(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 t=Object.keys(this.levelkeys),n=t.length;if(n>1||n===1&&this.levelkeys[t[0]].encrypted)return!0}return!1}setKeyFormat(e){if(this.levelkeys){const t=this.levelkeys[e];t&&!this._decryptdata&&(this._decryptdata=t.getDecryptData(this.sn))}}abortRequests(){var e,t;(e=this.loader)==null||e.abort(),(t=this.keyLoader)==null||t.abort()}setElementaryStreamInfo(e,t,n,i,s,o=!1){const{elementaryStreams:a}=this,A=a[e];if(!A){a[e]={startPTS:t,endPTS:n,startDTS:i,endDTS:s,partial:o};return}A.startPTS=Math.min(A.startPTS,t),A.endPTS=Math.max(A.endPTS,n),A.startDTS=Math.min(A.startDTS,i),A.endDTS=Math.max(A.endDTS,s)}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[He.AUDIO]=null,e[He.VIDEO]=null,e[He.AUDIOVIDEO]=null}}class $p extends pc{constructor(e,t,n,i,s){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 ns,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=t,this.index=i;const o=e.enumeratedString("BYTERANGE");o&&this.setByteRange(o,s),s&&(this.fragOffset=s.fragOffset+s.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 Yp=10;class Vp{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 t=this.lastPartSn-e.lastPartSn,n=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!n||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||t===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?he(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||Yp}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 Jo(r){return Uint8Array.from(atob(r),e=>e.charCodeAt(0))}function Kp(r){const e=Wo(r).subarray(0,16),t=new Uint8Array(16);return t.set(e,16-e.length),t}function Jp(r){const e=function(n,i,s){const o=n[i];n[i]=n[s],n[s]=o};e(r,0,3),e(r,1,2),e(r,4,5),e(r,6,7)}function Wp(r){const e=r.split(":");let t=null;if(e[0]==="data"&&e.length===2){const n=e[1].split(";"),i=n[n.length-1].split(",");if(i.length===2){const s=i[0]==="base64",o=i[1];s?(n.splice(-1,1),t=Jo(o)):t=Kp(o)}}return t}function Wo(r){return Uint8Array.from(unescape(encodeURIComponent(r)),e=>e.charCodeAt(0))}const pn=typeof self<"u"?self:void 0;var Je={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},Rt={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function mc(r){switch(r){case Rt.FAIRPLAY:return Je.FAIRPLAY;case Rt.PLAYREADY:return Je.PLAYREADY;case Rt.WIDEVINE:return Je.WIDEVINE;case Rt.CLEARKEY:return Je.CLEARKEY}}var Ec={WIDEVINE:"edef8ba979d64acea3c827dcd51d21ed"};function qp(r){if(r===Ec.WIDEVINE)return Je.WIDEVINE}function Ic(r){switch(r){case Je.FAIRPLAY:return Rt.FAIRPLAY;case Je.PLAYREADY:return Rt.PLAYREADY;case Je.WIDEVINE:return Rt.WIDEVINE;case Je.CLEARKEY:return Rt.CLEARKEY}}function qo(r){const{drmSystems:e,widevineLicenseUrl:t}=r,n=e?[Je.FAIRPLAY,Je.WIDEVINE,Je.PLAYREADY,Je.CLEARKEY].filter(i=>!!e[i]):[];return!n[Je.WIDEVINE]&&t&&n.push(Je.WIDEVINE),n}const Cc=function(r){return pn!=null&&(r=pn.navigator)!=null&&r.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function Xp(r,e,t,n){let i;switch(r){case Je.FAIRPLAY:i=["cenc","sinf"];break;case Je.WIDEVINE:case Je.PLAYREADY:i=["cenc"];break;case Je.CLEARKEY:i=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${r}`)}return jp(i,e,t,n)}function jp(r,e,t,n){return[{initDataTypes:r,persistentState:n.persistentState||"optional",distinctiveIdentifier:n.distinctiveIdentifier||"optional",sessionTypes:n.sessionTypes||[n.sessionType||"temporary"],audioCapabilities:e.map(s=>({contentType:`audio/mp4; codecs="${s}"`,robustness:n.audioRobustness||"",encryptionScheme:n.audioEncryptionScheme||null})),videoCapabilities:t.map(s=>({contentType:`video/mp4; codecs="${s}"`,robustness:n.videoRobustness||"",encryptionScheme:n.videoEncryptionScheme||null}))}]}function Jr(r,e,t){return Uint8Array.prototype.slice?r.slice(e,t):new Uint8Array(Array.prototype.slice.call(r,e,t))}const Xo=(r,e)=>e+10<=r.length&&r[e]===73&&r[e+1]===68&&r[e+2]===51&&r[e+3]<255&&r[e+4]<255&&r[e+6]<128&&r[e+7]<128&&r[e+8]<128&&r[e+9]<128,vc=(r,e)=>e+10<=r.length&&r[e]===51&&r[e+1]===68&&r[e+2]===73&&r[e+3]<255&&r[e+4]<255&&r[e+6]<128&&r[e+7]<128&&r[e+8]<128&&r[e+9]<128,oi=(r,e)=>{const t=e;let n=0;for(;Xo(r,e);){n+=10;const i=is(r,e+6);n+=i,vc(r,e+10)&&(n+=10),e+=n}if(n>0)return r.subarray(t,t+n)},is=(r,e)=>{let t=0;return t=(r[e]&127)<<21,t|=(r[e+1]&127)<<14,t|=(r[e+2]&127)<<7,t|=r[e+3]&127,t},zp=(r,e)=>Xo(r,e)&&is(r,e+6)+10<=r.length-e,jo=r=>{const e=Bc(r);for(let t=0;t<e.length;t++){const n=e[t];if(yc(n))return im(n)}},yc=r=>r&&r.key==="PRIV"&&r.info==="com.apple.streaming.transportStreamTimestamp",Zp=r=>{const e=String.fromCharCode(r[0],r[1],r[2],r[3]),t=is(r,4),n=10;return{type:e,size:t,data:r.subarray(n,n+t)}},Bc=r=>{let e=0;const t=[];for(;Xo(r,e);){const n=is(r,e+6);e+=10;const i=e+n;for(;e+8<i;){const s=Zp(r.subarray(e)),o=em(s);o&&t.push(o),e+=s.size+10}vc(r,e)&&(e+=10)}return t},em=r=>r.type==="PRIV"?tm(r):r.type[0]==="W"?nm(r):rm(r),tm=r=>{if(r.size<2)return;const e=tr(r.data,!0),t=new Uint8Array(r.data.subarray(e.length+1));return{key:r.type,info:e,data:t.buffer}},rm=r=>{if(r.size<2)return;if(r.type==="TXXX"){let t=1;const n=tr(r.data.subarray(t),!0);t+=n.length+1;const i=tr(r.data.subarray(t));return{key:r.type,info:n,data:i}}const e=tr(r.data.subarray(1));return{key:r.type,data:e}},nm=r=>{if(r.type==="WXXX"){if(r.size<2)return;let t=1;const n=tr(r.data.subarray(t),!0);t+=n.length+1;const i=tr(r.data.subarray(t));return{key:r.type,info:n,data:i}}const e=tr(r.data);return{key:r.type,data:e}},im=r=>{if(r.data.byteLength===8){const e=new Uint8Array(r.data),t=e[3]&1;let n=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return n/=45,t&&(n+=4772185884e-2),Math.round(n)}},tr=(r,e=!1)=>{const t=sm();if(t){const l=t.decode(r);if(e){const c=l.indexOf("\0");return c!==-1?l.substring(0,c):l}return l.replace(/\0/g,"")}const n=r.length;let i,s,o,a="",A=0;for(;A<n;){if(i=r[A++],i===0&&e)return a;if(i===0||i===3)continue;switch(i>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:a+=String.fromCharCode(i);break;case 12:case 13:s=r[A++],a+=String.fromCharCode((i&31)<<6|s&63);break;case 14:s=r[A++],o=r[A++],a+=String.fromCharCode((i&15)<<12|(s&63)<<6|(o&63)<<0);break}}return a};let zo;function sm(){if(!navigator.userAgent.includes("PlayStation 4"))return!zo&&typeof self.TextDecoder<"u"&&(zo=new self.TextDecoder("utf-8")),zo}const rr={hexDump:function(r){let e="";for(let t=0;t<r.length;t++){let n=r[t].toString(16);n.length<2&&(n="0"+n),e+=n}return e}},ss=Math.pow(2,32)-1,om=[].push,Qc={video:1,audio:2,id3:3,text:4};function lt(r){return String.fromCharCode.apply(null,r)}function Tc(r,e){const t=r[e]<<8|r[e+1];return t<0?65536+t:t}function me(r,e){const t=xc(r,e);return t<0?4294967296+t:t}function bc(r,e){let t=me(r,e);return t*=Math.pow(2,32),t+=me(r,e+4),t}function xc(r,e){return r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3]}function Zo(r,e,t){r[e]=t>>24,r[e+1]=t>>16&255,r[e+2]=t>>8&255,r[e+3]=t&255}function am(r){const e=r.byteLength;for(let t=0;t<e;){const n=me(r,t);if(n>8&&r[t+4]===109&&r[t+5]===111&&r[t+6]===111&&r[t+7]===102)return!0;t=n>1?t+n:e}return!1}function xe(r,e){const t=[];if(!e.length)return t;const n=r.byteLength;for(let i=0;i<n;){const s=me(r,i),o=lt(r.subarray(i+4,i+8)),a=s>1?i+s:n;if(o===e[0])if(e.length===1)t.push(r.subarray(i+8,a));else{const A=xe(r.subarray(i+8,a),e.slice(1));A.length&&om.apply(t,A)}i=a}return t}function Am(r){const e=[],t=r[0];let n=8;const i=me(r,n);n+=4;let s=0,o=0;t===0?(s=me(r,n),o=me(r,n+4),n+=8):(s=bc(r,n),o=bc(r,n+8),n+=16),n+=2;let a=r.length+o;const A=Tc(r,n);n+=2;for(let l=0;l<A;l++){let c=n;const u=me(r,c);c+=4;const h=u&2147483647;if((u&2147483648)>>>31===1)return U.warn("SIDX has hierarchical references (not supported)"),null;const f=me(r,c);c+=4,e.push({referenceSize:h,subsegmentDuration:f,info:{duration:f/i,start:a,end:a+h-1}}),a+=h,c+=4,n=c}return{earliestPresentationTime:s,timescale:i,version:t,referencesCount:A,references:e}}function wc(r){const e=[],t=xe(r,["moov","trak"]);for(let i=0;i<t.length;i++){const s=t[i],o=xe(s,["tkhd"])[0];if(o){let a=o[0];const A=me(o,a===0?12:20),l=xe(s,["mdia","mdhd"])[0];if(l){a=l[0];const c=me(l,a===0?12:20),u=xe(s,["mdia","hdlr"])[0];if(u){const h=lt(u.subarray(8,12)),d={soun:He.AUDIO,vide:He.VIDEO}[h];if(d){const f=xe(s,["mdia","minf","stbl","stsd"])[0],g=lm(f);e[A]={timescale:c,type:d},e[d]=ut({timescale:c,id:A},g)}}}}}return xe(r,["moov","mvex","trex"]).forEach(i=>{const s=me(i,4),o=e[s];o&&(o.default={duration:me(i,12),flags:me(i,20)})}),e}function lm(r){const e=r.subarray(8),t=e.subarray(86),n=lt(e.subarray(4,8));let i=n;const s=n==="enca"||n==="encv";if(s){const a=xe(e,[n])[0].subarray(n==="enca"?28:78);xe(a,["sinf"]).forEach(l=>{const c=xe(l,["schm"])[0];if(c){const u=lt(c.subarray(4,8));if(u==="cbcs"||u==="cenc"){const h=xe(l,["frma"])[0];h&&(i=lt(h))}}})}switch(i){case"avc1":case"avc2":case"avc3":case"avc4":{const o=xe(t,["avcC"])[0];i+="."+os(o[1])+os(o[2])+os(o[3]);break}case"mp4a":{const o=xe(e,[n])[0],a=xe(o.subarray(28),["esds"])[0];if(a&&a.length>12){let A=4;if(a[A++]!==3)break;A=ea(a,A),A+=2;const l=a[A++];if(l&128&&(A+=2),l&64&&(A+=a[A++]),a[A++]!==4)break;A=ea(a,A);const c=a[A++];if(c===64)i+="."+os(c);else break;if(A+=12,a[A++]!==5)break;A=ea(a,A);const u=a[A++];let h=(u&248)>>3;h===31&&(h+=1+((u&7)<<3)+((a[A]&224)>>5)),i+="."+h}break}case"hvc1":case"hev1":{const o=xe(t,["hvcC"])[0],a=o[1],A=["","A","B","C"][a>>6],l=a&31,c=me(o,2),u=(a&32)>>5?"H":"L",h=o[12],d=o.subarray(6,12);i+="."+A+l,i+="."+c.toString(16).toUpperCase(),i+="."+u+h;let f="";for(let g=d.length;g--;){const p=d[g];(p||f)&&(f="."+p.toString(16).toUpperCase()+f)}i+=f;break}case"dvh1":case"dvhe":{const o=xe(t,["dvcC"])[0],a=o[2]>>1&127,A=o[2]<<5&32|o[3]>>3&31;i+="."+nr(a)+"."+nr(A);break}case"vp09":{const o=xe(t,["vpcC"])[0],a=o[4],A=o[5],l=o[6]>>4&15;i+="."+nr(a)+"."+nr(A)+"."+nr(l);break}case"av01":{const o=xe(t,["av1C"])[0],a=o[1]>>>5,A=o[1]&31,l=o[2]>>>7?"H":"M",c=(o[2]&64)>>6,u=(o[2]&32)>>5,h=a===2&&c?u?12:10:c?10:8,d=(o[2]&16)>>4,f=(o[2]&8)>>3,g=(o[2]&4)>>2,p=o[2]&3;i+="."+a+"."+nr(A)+l+"."+nr(h)+"."+d+"."+f+g+p+"."+nr(1)+"."+nr(1)+"."+nr(1)+"."+0;break}}return{codec:i,encrypted:s}}function ea(r,e){const t=e+5;for(;r[e++]&128&&e<t;);return e}function os(r){return("0"+r.toString(16).toUpperCase()).slice(-2)}function nr(r){return(r<10?"0":"")+r}function cm(r,e){if(!r||!e)return r;const t=e.keyId;return t&&e.isCommonEncryption&&xe(r,["moov","trak"]).forEach(i=>{const o=xe(i,["mdia","minf","stbl","stsd"])[0].subarray(8);let a=xe(o,["enca"]);const A=a.length>0;A||(a=xe(o,["encv"])),a.forEach(l=>{const c=A?l.subarray(28):l.subarray(78);xe(c,["sinf"]).forEach(h=>{const d=Sc(h);if(d){const f=d.subarray(8,24);f.some(g=>g!==0)||(U.log(`[eme] Patching keyId in 'enc${A?"a":"v"}>sinf>>tenc' box: ${rr.hexDump(f)} -> ${rr.hexDump(t)}`),d.set(t,8))}})})}),r}function Sc(r){const e=xe(r,["schm"])[0];if(e){const t=lt(e.subarray(4,8));if(t==="cbcs"||t==="cenc")return xe(r,["schi","tenc"])[0]}return U.error("[eme] missing 'schm' box"),null}function um(r,e){return xe(e,["moof","traf"]).reduce((t,n)=>{const i=xe(n,["tfdt"])[0],s=i[0],o=xe(n,["tfhd"]).reduce((a,A)=>{const l=me(A,4),c=r[l];if(c){let u=me(i,4);if(s===1){if(u===ss)return U.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"),a;u*=ss+1,u+=me(i,8)}const h=c.timescale||9e4,d=u/h;if(he(d)&&(a===null||d<a))return d}return a},null);return o!==null&&he(o)&&(t===null||o<t)?o:t},null)}function hm(r,e){let t=0,n=0,i=0;const s=xe(r,["moof","traf"]);for(let o=0;o<s.length;o++){const a=s[o],A=xe(a,["tfhd"])[0],l=me(A,4),c=e[l];if(!c)continue;const u=c.default,h=me(A,0)|(u==null?void 0:u.flags);let d=u==null?void 0:u.duration;h&8&&(h&2?d=me(A,12):d=me(A,8));const f=c.timescale||9e4,g=xe(a,["trun"]);for(let p=0;p<g.length;p++){if(t=dm(g[p]),!t&&d){const v=me(g[p],4);t=d*v}c.type===He.VIDEO?n+=t/f:c.type===He.AUDIO&&(i+=t/f)}}if(n===0&&i===0){let o=1/0,a=0,A=0;const l=xe(r,["sidx"]);for(let c=0;c<l.length;c++){const u=Am(l[c]);if(u!=null&&u.references){o=Math.min(o,u.earliestPresentationTime/u.timescale);const h=u.references.reduce((d,f)=>d+f.info.duration||0,0);a=Math.max(a,h+u.earliestPresentationTime/u.timescale),A=a-o}}if(A&&he(A))return A}return n||i}function dm(r){const e=me(r,0);let t=8;e&1&&(t+=4),e&4&&(t+=4);let n=0;const i=me(r,4);for(let s=0;s<i;s++){if(e&256){const o=me(r,t);n+=o,t+=4}e&512&&(t+=4),e&1024&&(t+=4),e&2048&&(t+=4)}return n}function fm(r,e,t){xe(e,["moof","traf"]).forEach(n=>{xe(n,["tfhd"]).forEach(i=>{const s=me(i,4),o=r[s];if(!o)return;const a=o.timescale||9e4;xe(n,["tfdt"]).forEach(A=>{const l=A[0],c=t*a;if(c){let u=me(A,4);if(l===0)u-=c,u=Math.max(u,0),Zo(A,4,u);else{u*=Math.pow(2,32),u+=me(A,8),u-=c,u=Math.max(u,0);const h=Math.floor(u/(ss+1)),d=Math.floor(u%(ss+1));Zo(A,4,h),Zo(A,8,d)}}})})})}function gm(r){const e={valid:null,remainder:null},t=xe(r,["moof"]);if(t.length<2)return e.remainder=r,e;const n=t[t.length-1];return e.valid=Jr(r,0,n.byteOffset-8),e.remainder=Jr(r,n.byteOffset-8),e}function Ot(r,e){const t=new Uint8Array(r.length+e.length);return t.set(r),t.set(e,r.length),t}function Rc(r,e){const t=[],n=e.samples,i=e.timescale,s=e.id;let o=!1;return xe(n,["moof"]).map(A=>{const l=A.byteOffset-8;xe(A,["traf"]).map(u=>{const h=xe(u,["tfdt"]).map(d=>{const f=d[0];let g=me(d,4);return f===1&&(g*=Math.pow(2,32),g+=me(d,8)),g/i})[0];return h!==void 0&&(r=h),xe(u,["tfhd"]).map(d=>{const f=me(d,4),g=me(d,0)&16777215,p=(g&1)!==0,v=(g&2)!==0,T=(g&8)!==0;let b=0;const y=(g&16)!==0;let w=0;const R=(g&32)!==0;let k=8;f===s&&(p&&(k+=8),v&&(k+=4),T&&(b=me(d,k),k+=4),y&&(w=me(d,k),k+=4),R&&(k+=4),e.type==="video"&&(o=pm(e.codec)),xe(u,["trun"]).map($=>{const W=$[0],O=me($,0)&16777215,K=(O&1)!==0;let ne=0;const ee=(O&4)!==0,Ae=(O&256)!==0;let _=0;const P=(O&512)!==0;let X=0;const D=(O&1024)!==0,S=(O&2048)!==0;let F=0;const J=me($,4);let Y=8;K&&(ne=me($,Y),Y+=4),ee&&(Y+=4);let re=ne+l;for(let ce=0;ce<J;ce++){if(Ae?(_=me($,Y),Y+=4):_=b,P?(X=me($,Y),Y+=4):X=w,D&&(Y+=4),S&&(W===0?F=me($,Y):F=xc($,Y),Y+=4),e.type===He.VIDEO){let pe=0;for(;pe<X;){const ge=me(n,re);if(re+=4,mm(o,n[re])){const Se=n.subarray(re,re+ge);Dc(Se,o?2:1,r+F/i,t)}re+=ge,pe+=ge+4}}r+=_/i}}))})})}),t}function pm(r){if(!r)return!1;const e=r.indexOf("."),t=e<0?r:r.substring(0,e);return t==="hvc1"||t==="hev1"||t==="dvh1"||t==="dvhe"}function mm(r,e){if(r){const t=e>>1&63;return t===39||t===40}else return(e&31)===6}function Dc(r,e,t,n){const i=_c(r);let s=0;s+=e;let o=0,a=0,A=0;for(;s<i.length;){o=0;do{if(s>=i.length)break;A=i[s++],o+=A}while(A===255);a=0;do{if(s>=i.length)break;A=i[s++],a+=A}while(A===255);const l=i.length-s;let c=s;if(a<l)s+=a;else if(a>l){U.error(`Malformed SEI payload. ${a} is too small, only ${l} bytes left to parse.`);break}if(o===4){if(i[c++]===181){const h=Tc(i,c);if(c+=2,h===49){const d=me(i,c);if(c+=4,d===1195456820){const f=i[c++];if(f===3){const g=i[c++],p=31&g,v=64&g,T=v?2+p*3:0,b=new Uint8Array(T);if(v){b[0]=g;for(let y=1;y<T;y++)b[y]=i[c++]}n.push({type:f,payloadType:o,pts:t,bytes:b})}}}}}else if(o===5&&a>16){const u=[];for(let f=0;f<16;f++){const g=i[c++].toString(16);u.push(g.length==1?"0"+g:g),(f===3||f===5||f===7||f===9)&&u.push("-")}const h=a-16,d=new Uint8Array(h);for(let f=0;f<h;f++)d[f]=i[c++];n.push({payloadType:o,pts:t,uuid:u.join(""),userData:tr(d),userDataBytes:d})}}}function _c(r){const e=r.byteLength,t=[];let n=1;for(;n<e-2;)r[n]===0&&r[n+1]===0&&r[n+2]===3?(t.push(n+2),n+=2):n++;if(t.length===0)return r;const i=e-t.length,s=new Uint8Array(i);let o=0;for(n=0;n<i;o++,n++)o===t[0]&&(o++,t.shift()),s[n]=r[o];return s}function Em(r){const e=r[0];let t="",n="",i=0,s=0,o=0,a=0,A=0,l=0;if(e===0){for(;lt(r.subarray(l,l+1))!=="\0";)t+=lt(r.subarray(l,l+1)),l+=1;for(t+=lt(r.subarray(l,l+1)),l+=1;lt(r.subarray(l,l+1))!=="\0";)n+=lt(r.subarray(l,l+1)),l+=1;n+=lt(r.subarray(l,l+1)),l+=1,i=me(r,12),s=me(r,16),a=me(r,20),A=me(r,24),l=28}else if(e===1){l+=4,i=me(r,l),l+=4;const u=me(r,l);l+=4;const h=me(r,l);for(l+=4,o=4294967296*u+h,kp(o)||(o=Number.MAX_SAFE_INTEGER,U.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),a=me(r,l),l+=4,A=me(r,l),l+=4;lt(r.subarray(l,l+1))!=="\0";)t+=lt(r.subarray(l,l+1)),l+=1;for(t+=lt(r.subarray(l,l+1)),l+=1;lt(r.subarray(l,l+1))!=="\0";)n+=lt(r.subarray(l,l+1)),l+=1;n+=lt(r.subarray(l,l+1)),l+=1}const c=r.subarray(l,r.byteLength);return{schemeIdUri:t,value:n,timeScale:i,presentationTime:o,presentationTimeDelta:s,eventDuration:a,id:A,payload:c}}function Im(r,...e){const t=e.length;let n=8,i=t;for(;i--;)n+=e[i].byteLength;const s=new Uint8Array(n);for(s[0]=n>>24&255,s[1]=n>>16&255,s[2]=n>>8&255,s[3]=n&255,s.set(r,4),i=0,n=8;i<t;i++)s.set(e[i],n),n+=e[i].byteLength;return s}function Cm(r,e,t){if(r.byteLength!==16)throw new RangeError("Invalid system id");let n,i;if(e){n=1,i=new Uint8Array(e.length*16);for(let a=0;a<e.length;a++){const A=e[a];if(A.byteLength!==16)throw new RangeError("Invalid key");i.set(A,a*16)}}else n=0,i=new Uint8Array;let s;n>0?(s=new Uint8Array(4),e.length>0&&new DataView(s.buffer).setUint32(0,e.length,!1)):s=new Uint8Array;const o=new Uint8Array(4);return t&&t.byteLength>0&&new DataView(o.buffer).setUint32(0,t.byteLength,!1),Im([112,115,115,104],new Uint8Array([n,0,0,0]),r,s,i,o,t||new Uint8Array)}function vm(r){if(!(r instanceof ArrayBuffer)||r.byteLength<32)return null;const e={version:0,systemId:"",kids:null,data:null},t=new DataView(r),n=t.getUint32(0);if(r.byteLength!==n&&n>44||t.getUint32(4)!==1886614376||(e.version=t.getUint32(8)>>>24,e.version>1))return null;e.systemId=rr.hexDump(new Uint8Array(r,12,16));const s=t.getUint32(28);if(e.version===0){if(n-32<s)return null;e.data=new Uint8Array(r,32,s)}else if(e.version===1){e.kids=[];for(let o=0;o<s;o++)e.kids.push(new Uint8Array(r,32+o*16,16))}return e}let as={};class ai{static clearKeyUriToKeyIdMap(){as={}}constructor(e,t,n,i=[1],s=null){this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=e,this.uri=t,this.keyFormat=n,this.keyFormatVersions=i,this.iv=s,this.encrypted=e?e!=="NONE":!1,this.isCommonEncryption=this.encrypted&&e!=="AES-128"}isSupported(){if(this.method){if(this.method==="AES-128"||this.method==="NONE")return!0;if(this.keyFormat==="identity")return this.method==="SAMPLE-AES";switch(this.keyFormat){case Rt.FAIRPLAY:case Rt.WIDEVINE:case Rt.PLAYREADY:case Rt.CLEARKEY:return["ISO-23001-7","SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)!==-1}}return!1}getDecryptData(e){if(!this.encrypted||!this.uri)return null;if(this.method==="AES-128"&&this.uri&&!this.iv){typeof e!="number"&&(this.method==="AES-128"&&!this.iv&&U.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),e=0);const n=ym(e);return new ai(this.method,this.uri,"identity",this.keyFormatVersions,n)}const t=Wp(this.uri);if(t)switch(this.keyFormat){case Rt.WIDEVINE:this.pssh=t,t.length>=22&&(this.keyId=t.subarray(t.length-22,t.length-6));break;case Rt.PLAYREADY:{const n=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=Cm(n,null,t);const i=new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2),s=String.fromCharCode.apply(null,Array.from(i)),o=s.substring(s.indexOf("<"),s.length),l=new DOMParser().parseFromString(o,"text/xml").getElementsByTagName("KID")[0];if(l){const c=l.childNodes[0]?l.childNodes[0].nodeValue:l.getAttribute("VALUE");if(c){const u=Jo(c).subarray(0,16);Jp(u),this.keyId=u}}break}default:{let n=t.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=as[this.uri];if(!n){const i=Object.keys(as).length%Number.MAX_SAFE_INTEGER;n=new Uint8Array(16),new DataView(n.buffer,12,4).setUint32(0,i),as[this.uri]=n}this.keyId=n}return this}}function ym(r){const e=new Uint8Array(16);for(let t=12;t<16;t++)e[t]=r>>8*(15-t)&255;return e}const Lc=/\{\$([a-zA-Z0-9-_]+)\}/g;function Fc(r){return Lc.test(r)}function Dt(r,e,t){if(r.variableList!==null||r.hasVariableRefs)for(let n=t.length;n--;){const i=t[n],s=e[i];s&&(e[i]=ta(r,s))}}function ta(r,e){if(r.variableList!==null||r.hasVariableRefs){const t=r.variableList;return e.replace(Lc,n=>{const i=n.substring(2,n.length-1),s=t==null?void 0:t[i];return s===void 0?(r.playlistParsingError||(r.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${i}"`)),n):s})}return e}function kc(r,e,t){let n=r.variableList;n||(r.variableList=n={});let i,s;if("QUERYPARAM"in e){i=e.QUERYPARAM;try{const o=new self.URL(t).searchParams;if(o.has(i))s=o.get(i);else throw new Error(`"${i}" does not match any query parameter in URI: "${t}"`)}catch(o){r.playlistParsingError||(r.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${o.message}`))}}else i=e.NAME,s=e.VALUE;i in n?r.playlistParsingError||(r.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${i}"`)):n[i]=s||""}function Bm(r,e,t){const n=e.IMPORT;if(t&&n in t){let i=r.variableList;i||(r.variableList=i={}),i[n]=t[n]}else r.playlistParsingError||(r.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${n}"`))}function Wr(r=!0){return typeof self>"u"?void 0:(r||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function Qm(r){return typeof self<"u"&&r===self.ManagedMediaSource}const As={audio:{a3ds:1,"ac-3":.95,"ac-4":1,alac:.9,alaw:1,dra1:1,"dts+":1,"dts-":1,dtsc:1,dtse:1,dtsh:1,"ec-3":.9,enca:1,fLaC:.9,flac:.9,FLAC:.9,g719:1,g726:1,m4ae:1,mha1:1,mha2:1,mhm1:1,mhm2:1,mlpa:1,mp4a:1,"raw ":1,Opus:1,opus:1,samr:1,sawb:1,sawp:1,sevc:1,sqcp:1,ssmv:1,twos:1,ulaw:1},video:{avc1:1,avc2:1,avc3:1,avc4:1,avcp:1,av01:.8,drac:1,dva1:1,dvav:1,dvh1:.7,dvhe:.7,encv:1,hev1:.75,hvc1:.75,mjp2:1,mp4v:1,mvc1:1,mvc2:1,mvc3:1,mvc4:1,resv:1,rv60:1,s263:1,svc1:1,svc2:1,"vc-1":1,vp08:1,vp09:.9},text:{stpp:1,wvtt:1}};function Tm(r,e){const t=As[e];return!!t&&!!t[r.slice(0,4)]}function ra(r,e,t=!0){return!r.split(",").some(n=>!Nc(n,e,t))}function Nc(r,e,t=!0){var n;const i=Wr(t);return(n=i==null?void 0:i.isTypeSupported(Ai(r,e)))!=null?n:!1}function Ai(r,e){return`${e}/mp4;codecs="${r}"`}function Mc(r){if(r){const e=r.substring(0,4);return As.video[e]}return 2}function ls(r){return r.split(",").reduce((e,t)=>{const n=As.video[t];return n?(n*2+e)/(e?3:2):(As.audio[t]+e)/(e?2:1)},0)}const na={};function bm(r,e=!0){if(na[r])return na[r];const t={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"]}[r];for(let n=0;n<t.length;n++)if(Nc(t[n],"audio",e))return na[r]=t[n],t[n];return r}const xm=/flac|opus/i;function cs(r,e=!0){return r.replace(xm,t=>bm(t.toLowerCase(),e))}function Pc(r,e){return r&&r!=="mp4a"?r:e&&e.split(",")[0]}function wm(r){const e=r.split(".");if(e.length>2){let t=e.shift()+".";return t+=parseInt(e.shift()).toString(16),t+=("000"+parseInt(e.shift()).toString(16)).slice(-4),t}return r}const Oc=/#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,Uc=/#EXT-X-MEDIA:(.*)/g,Sm=/^#EXT(?:INF|-X-TARGETDURATION):/m,Gc=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),Rm=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|INDEPENDENT-SEGMENTS)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|"));class ir{static findGroup(e,t){for(let n=0;n<e.length;n++){const i=e[n];if(i.id===t)return i}}static resolve(e,t){return Yo.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}static isMediaPlaylist(e){return Sm.test(e)}static parseMasterPlaylist(e,t){const n=Fc(e),i={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:n},s=[];Oc.lastIndex=0;let o;for(;(o=Oc.exec(e))!=null;)if(o[1]){var a;const l=new Xe(o[1]);Dt(i,l,["CODECS","SUPPLEMENTAL-CODECS","ALLOWED-CPC","PATHWAY-ID","STABLE-VARIANT-ID","AUDIO","VIDEO","SUBTITLES","CLOSED-CAPTIONS","NAME"]);const c=ta(i,o[2]),u={attrs:l,bitrate:l.decimalInteger("BANDWIDTH")||l.decimalInteger("AVERAGE-BANDWIDTH"),name:l.NAME,url:ir.resolve(c,t)},h=l.decimalResolution("RESOLUTION");h&&(u.width=h.width,u.height=h.height),Dm(l.CODECS,u),(a=u.unknownCodecs)!=null&&a.length||s.push(u),i.levels.push(u)}else if(o[3]){const l=o[3],c=o[4];switch(l){case"SESSION-DATA":{const u=new Xe(c);Dt(i,u,["DATA-ID","LANGUAGE","VALUE","URI"]);const h=u["DATA-ID"];h&&(i.sessionData===null&&(i.sessionData={}),i.sessionData[h]=u);break}case"SESSION-KEY":{const u=Hc(c,t,i);u.encrypted&&u.isSupported()?(i.sessionKeys===null&&(i.sessionKeys=[]),i.sessionKeys.push(u)):U.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${c}"`);break}case"DEFINE":{{const u=new Xe(c);Dt(i,u,["NAME","VALUE","QUERYPARAM"]),kc(i,u,t)}break}case"CONTENT-STEERING":{const u=new Xe(c);Dt(i,u,["SERVER-URI","PATHWAY-ID"]),i.contentSteering={uri:ir.resolve(u["SERVER-URI"],t),pathwayId:u["PATHWAY-ID"]||"."};break}case"START":{i.startTimeOffset=$c(c);break}}}const A=s.length>0&&s.length<i.levels.length;return i.levels=A?s:i.levels,i.levels.length===0&&(i.playlistParsingError=new Error("no levels found in manifest")),i}static parseMasterPlaylistMedia(e,t,n){let i;const s={},o=n.levels,a={AUDIO:o.map(l=>({id:l.attrs.AUDIO,audioCodec:l.audioCodec})),SUBTITLES:o.map(l=>({id:l.attrs.SUBTITLES,textCodec:l.textCodec})),"CLOSED-CAPTIONS":[]};let A=0;for(Uc.lastIndex=0;(i=Uc.exec(e))!==null;){const l=new Xe(i[1]),c=l.TYPE;if(c){const u=a[c],h=s[c]||[];s[c]=h,Dt(n,l,["URI","GROUP-ID","LANGUAGE","ASSOC-LANGUAGE","STABLE-RENDITION-ID","NAME","INSTREAM-ID","CHARACTERISTICS","CHANNELS"]);const d=l.LANGUAGE,f=l["ASSOC-LANGUAGE"],g=l.CHANNELS,p=l.CHARACTERISTICS,v=l["INSTREAM-ID"],T={attrs:l,bitrate:0,id:A++,groupId:l["GROUP-ID"]||"",name:l.NAME||d||"",type:c,default:l.bool("DEFAULT"),autoselect:l.bool("AUTOSELECT"),forced:l.bool("FORCED"),lang:d,url:l.URI?ir.resolve(l.URI,t):""};if(f&&(T.assocLang=f),g&&(T.channels=g),p&&(T.characteristics=p),v&&(T.instreamId=v),u!=null&&u.length){const b=ir.findGroup(u,T.groupId)||u[0];Yc(T,b,"audioCodec"),Yc(T,b,"textCodec")}h.push(T)}}return s}static parseLevelPlaylist(e,t,n,i,s,o){const a=new Vp(t),A=a.fragments;let l=null,c=0,u=0,h=0,d=0,f=null,g=new Ko(i,t),p,v,T,b=-1,y=!1,w=null;for(Gc.lastIndex=0,a.m3u8=e,a.hasVariableRefs=Fc(e);(p=Gc.exec(e))!==null;){y&&(y=!1,g=new Ko(i,t),g.start=h,g.sn=c,g.cc=d,g.level=n,l&&(g.initSegment=l,g.rawProgramDateTime=l.rawProgramDateTime,l.rawProgramDateTime=null,w&&(g.setByteRange(w),w=null)));const W=p[1];if(W){g.duration=parseFloat(W);const O=(" "+p[2]).slice(1);g.title=O||null,g.tagList.push(O?["INF",W,O]:["INF",W])}else if(p[3]){if(he(g.duration)){g.start=h,T&&Jc(g,T,a),g.sn=c,g.level=n,g.cc=d,A.push(g);const O=(" "+p[3]).slice(1);g.relurl=ta(a,O),Vc(g,f),f=g,h+=g.duration,c++,u=0,y=!0}}else if(p[4]){const O=(" "+p[4]).slice(1);f?g.setByteRange(O,f):g.setByteRange(O)}else if(p[5])g.rawProgramDateTime=(" "+p[5]).slice(1),g.tagList.push(["PROGRAM-DATE-TIME",g.rawProgramDateTime]),b===-1&&(b=A.length);else{if(p=p[0].match(Rm),!p){U.warn("No matches on slow regex match for level playlist!");continue}for(v=1;v<p.length&&!(typeof p[v]<"u");v++);const O=(" "+p[v]).slice(1),K=(" "+p[v+1]).slice(1),ne=p[v+2]?(" "+p[v+2]).slice(1):"";switch(O){case"PLAYLIST-TYPE":a.type=K.toUpperCase();break;case"MEDIA-SEQUENCE":c=a.startSN=parseInt(K);break;case"SKIP":{const ee=new Xe(K);Dt(a,ee,["RECENTLY-REMOVED-DATERANGES"]);const Ae=ee.decimalInteger("SKIPPED-SEGMENTS");if(he(Ae)){a.skippedSegments=Ae;for(let P=Ae;P--;)A.unshift(null);c+=Ae}const _=ee.enumeratedString("RECENTLY-REMOVED-DATERANGES");_&&(a.recentlyRemovedDateranges=_.split(" "));break}case"TARGETDURATION":a.targetduration=Math.max(parseInt(K),1);break;case"VERSION":a.version=parseInt(K);break;case"INDEPENDENT-SEGMENTS":case"EXTM3U":break;case"ENDLIST":a.live=!1;break;case"#":(K||ne)&&g.tagList.push(ne?[K,ne]:[K]);break;case"DISCONTINUITY":d++,g.tagList.push(["DIS"]);break;case"GAP":g.gap=!0,g.tagList.push([O]);break;case"BITRATE":g.tagList.push([O,K]);break;case"DATERANGE":{const ee=new Xe(K);Dt(a,ee,["ID","CLASS","START-DATE","END-DATE","SCTE35-CMD","SCTE35-OUT","SCTE35-IN"]),Dt(a,ee,ee.clientAttrs);const Ae=new gc(ee,a.dateRanges[ee.ID]);Ae.isValid||a.skippedSegments?a.dateRanges[Ae.id]=Ae:U.warn(`Ignoring invalid DATERANGE tag: "${K}"`),g.tagList.push(["EXT-X-DATERANGE",K]);break}case"DEFINE":{{const ee=new Xe(K);Dt(a,ee,["NAME","VALUE","IMPORT","QUERYPARAM"]),"IMPORT"in ee?Bm(a,ee,o):kc(a,ee,t)}break}case"DISCONTINUITY-SEQUENCE":d=parseInt(K);break;case"KEY":{const ee=Hc(K,t,a);if(ee.isSupported()){if(ee.method==="NONE"){T=void 0;break}T||(T={}),T[ee.keyFormat]&&(T=st({},T)),T[ee.keyFormat]=ee}else U.warn(`[Keys] Ignoring invalid EXT-X-KEY tag: "${K}"`);break}case"START":a.startTimeOffset=$c(K);break;case"MAP":{const ee=new Xe(K);if(Dt(a,ee,["BYTERANGE","URI"]),g.duration){const Ae=new Ko(i,t);Kc(Ae,ee,n,T),l=Ae,g.initSegment=l,l.rawProgramDateTime&&!g.rawProgramDateTime&&(g.rawProgramDateTime=l.rawProgramDateTime)}else{const Ae=g.byteRangeEndOffset;if(Ae){const _=g.byteRangeStartOffset;w=`${Ae-_}@${_}`}else w=null;Kc(g,ee,n,T),l=g,y=!0}break}case"SERVER-CONTROL":{const ee=new Xe(K);a.canBlockReload=ee.bool("CAN-BLOCK-RELOAD"),a.canSkipUntil=ee.optionalFloat("CAN-SKIP-UNTIL",0),a.canSkipDateRanges=a.canSkipUntil>0&&ee.bool("CAN-SKIP-DATERANGES"),a.partHoldBack=ee.optionalFloat("PART-HOLD-BACK",0),a.holdBack=ee.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{const ee=new Xe(K);a.partTarget=ee.decimalFloatingPoint("PART-TARGET");break}case"PART":{let ee=a.partList;ee||(ee=a.partList=[]);const Ae=u>0?ee[ee.length-1]:void 0,_=u++,P=new Xe(K);Dt(a,P,["BYTERANGE","URI"]);const X=new $p(P,g,t,_,Ae);ee.push(X),g.duration+=X.duration;break}case"PRELOAD-HINT":{const ee=new Xe(K);Dt(a,ee,["URI"]),a.preloadHint=ee;break}case"RENDITION-REPORT":{const ee=new Xe(K);Dt(a,ee,["URI"]),a.renditionReports=a.renditionReports||[],a.renditionReports.push(ee);break}default:U.warn(`line parsed but not handled: ${p}`);break}}}f&&!f.relurl?(A.pop(),h-=f.duration,a.partList&&(a.fragmentHint=f)):a.partList&&(Vc(g,f),g.cc=d,a.fragmentHint=g,T&&Jc(g,T,a));const R=A.length,k=A[0],$=A[R-1];if(h+=a.skippedSegments*a.targetduration,h>0&&R&&$){a.averagetargetduration=h/R;const W=$.sn;a.endSN=W!=="initSegment"?W:0,a.live||($.endList=!0),k&&(a.startCC=k.cc)}else a.endSN=0,a.startCC=0;return a.fragmentHint&&(h+=a.fragmentHint.duration),a.totalduration=h,a.endCC=d,b>0&&_m(A,b),a}}function Hc(r,e,t){var n,i;const s=new Xe(r);Dt(t,s,["KEYFORMAT","KEYFORMATVERSIONS","URI","IV","URI"]);const o=(n=s.METHOD)!=null?n:"",a=s.URI,A=s.hexadecimalInteger("IV"),l=s.KEYFORMATVERSIONS,c=(i=s.KEYFORMAT)!=null?i:"identity";a&&s.IV&&!A&&U.error(`Invalid IV: ${s.IV}`);const u=a?ir.resolve(a,e):"",h=(l||"1").split("/").map(Number).filter(Number.isFinite);return new ai(o,u,c,h,A)}function $c(r){const t=new Xe(r).decimalFloatingPoint("TIME-OFFSET");return he(t)?t:null}function Dm(r,e){let t=(r||"").split(/[ ,]+/).filter(n=>n);["video","audio","text"].forEach(n=>{const i=t.filter(s=>Tm(s,n));i.length&&(e[`${n}Codec`]=i.join(","),t=t.filter(s=>i.indexOf(s)===-1))}),e.unknownCodecs=t}function Yc(r,e,t){const n=e[t];n&&(r[t]=n)}function _m(r,e){let t=r[e];for(let n=e;n--;){const i=r[n];if(!i)return;i.programDateTime=t.programDateTime-i.duration*1e3,t=i}}function Vc(r,e){r.rawProgramDateTime?r.programDateTime=Date.parse(r.rawProgramDateTime):e!=null&&e.programDateTime&&(r.programDateTime=e.endProgramDateTime),he(r.programDateTime)||(r.programDateTime=null,r.rawProgramDateTime=null)}function Kc(r,e,t,n){r.relurl=e.URI,e.BYTERANGE&&r.setByteRange(e.BYTERANGE),r.level=t,r.sn="initSegment",n&&(r.levelkeys=n),r.initSegment=null}function Jc(r,e,t){r.levelkeys=e;const{encryptedFragments:n}=t;(!n.length||n[n.length-1].levelkeys!==e)&&Object.keys(e).some(i=>e[i].isCommonEncryption)&&n.push(r)}var Oe={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},Ee={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};function Wc(r){const{type:e}=r;switch(e){case Oe.AUDIO_TRACK:return Ee.AUDIO;case Oe.SUBTITLE_TRACK:return Ee.SUBTITLE;default:return Ee.MAIN}}function ia(r,e){let t=r.url;return(t===void 0||t.indexOf("data:")===0)&&(t=e.url),t}class Lm{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(I.MANIFEST_LOADING,this.onManifestLoading,this),e.on(I.LEVEL_LOADING,this.onLevelLoading,this),e.on(I.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(I.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}unregisterListeners(){const{hls:e}=this;e.off(I.MANIFEST_LOADING,this.onManifestLoading,this),e.off(I.LEVEL_LOADING,this.onLevelLoading,this),e.off(I.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(I.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}createInternalLoader(e){const t=this.hls.config,n=t.pLoader,i=t.loader,s=n||i,o=new s(t);return this.loaders[e.type]=o,o}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(const e in this.loaders){const t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,t){const{url:n}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:Oe.MANIFEST,url:n,deliveryDirectives:null})}onLevelLoading(e,t){const{id:n,level:i,pathwayId:s,url:o,deliveryDirectives:a}=t;this.load({id:n,level:i,pathwayId:s,responseType:"text",type:Oe.LEVEL,url:o,deliveryDirectives:a})}onAudioTrackLoading(e,t){const{id:n,groupId:i,url:s,deliveryDirectives:o}=t;this.load({id:n,groupId:i,level:null,responseType:"text",type:Oe.AUDIO_TRACK,url:s,deliveryDirectives:o})}onSubtitleTrackLoading(e,t){const{id:n,groupId:i,url:s,deliveryDirectives:o}=t;this.load({id:n,groupId:i,level:null,responseType:"text",type:Oe.SUBTITLE_TRACK,url:s,deliveryDirectives:o})}load(e){var t;const n=this.hls.config;let i=this.getInternalLoader(e);if(i){const l=i.context;if(l&&l.url===e.url&&l.level===e.level){U.trace("[playlist-loader]: playlist request ongoing");return}U.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),i.abort()}let s;if(e.type===Oe.MANIFEST?s=n.manifestLoadPolicy.default:s=st({},n.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),i=this.createInternalLoader(e),he((t=e.deliveryDirectives)==null?void 0:t.part)){let l;if(e.type===Oe.LEVEL&&e.level!==null?l=this.hls.levels[e.level].details:e.type===Oe.AUDIO_TRACK&&e.id!==null?l=this.hls.audioTracks[e.id].details:e.type===Oe.SUBTITLE_TRACK&&e.id!==null&&(l=this.hls.subtitleTracks[e.id].details),l){const c=l.partTarget,u=l.targetduration;if(c&&u){const h=Math.max(c*3,u*.8)*1e3;s=st({},s,{maxTimeToFirstByteMs:Math.min(h,s.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(h,s.maxTimeToFirstByteMs)})}}}const o=s.errorRetry||s.timeoutRetry||{},a={loadPolicy:s,timeout:s.maxLoadTimeMs,maxRetry:o.maxNumRetry||0,retryDelay:o.retryDelayMs||0,maxRetryDelay:o.maxRetryDelayMs||0},A={onSuccess:(l,c,u,h)=>{const d=this.getInternalLoader(u);this.resetInternalLoader(u.type);const f=l.data;if(f.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(l,u,new Error("no EXTM3U delimiter"),h||null,c);return}c.parsing.start=performance.now(),ir.isMediaPlaylist(f)?this.handleTrackOrLevelPlaylist(l,c,u,h||null,d):this.handleMasterPlaylist(l,c,u,h)},onError:(l,c,u,h)=>{this.handleNetworkError(c,u,!1,l,h)},onTimeout:(l,c,u)=>{this.handleNetworkError(c,u,!0,void 0,l)}};i.load(e,a,A)}handleMasterPlaylist(e,t,n,i){const s=this.hls,o=e.data,a=ia(e,n),A=ir.parseMasterPlaylist(o,a);if(A.playlistParsingError){this.handleManifestParsingError(e,n,A.playlistParsingError,i,t);return}const{contentSteering:l,levels:c,sessionData:u,sessionKeys:h,startTimeOffset:d,variableList:f}=A;this.variableList=f;const{AUDIO:g=[],SUBTITLES:p,"CLOSED-CAPTIONS":v}=ir.parseMasterPlaylistMedia(o,a,A);g.length&&!g.some(b=>!b.url)&&c[0].audioCodec&&!c[0].attrs.AUDIO&&(U.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),g.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new Xe({}),bitrate:0,url:""})),s.trigger(I.MANIFEST_LOADED,{levels:c,audioTracks:g,subtitles:p,captions:v,contentSteering:l,url:a,stats:t,networkDetails:i,sessionData:u,sessionKeys:h,startTimeOffset:d,variableList:f})}handleTrackOrLevelPlaylist(e,t,n,i,s){const o=this.hls,{id:a,level:A,type:l}=n,c=ia(e,n),u=0,h=he(A)?A:he(a)?a:0,d=Wc(n),f=ir.parseLevelPlaylist(e.data,c,h,d,u,this.variableList);if(l===Oe.MANIFEST){const g={attrs:new Xe({}),bitrate:0,details:f,name:"",url:c};o.trigger(I.MANIFEST_LOADED,{levels:[g],audioTracks:[],url:c,stats:t,networkDetails:i,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),n.levelDetails=f,this.handlePlaylistLoaded(f,e,t,n,i,s)}handleManifestParsingError(e,t,n,i,s){this.hls.trigger(I.ERROR,{type:ye.NETWORK_ERROR,details:V.MANIFEST_PARSING_ERROR,fatal:t.type===Oe.MANIFEST,url:e.url,err:n,error:n,reason:n.message,response:e,context:t,networkDetails:i,stats:s})}handleNetworkError(e,t,n=!1,i,s){let o=`A network ${n?"timeout":"error"+(i?" (status "+i.code+")":"")} occurred while loading ${e.type}`;e.type===Oe.LEVEL?o+=`: ${e.level} id: ${e.id}`:(e.type===Oe.AUDIO_TRACK||e.type===Oe.SUBTITLE_TRACK)&&(o+=` id: ${e.id} group-id: "${e.groupId}"`);const a=new Error(o);U.warn(`[playlist-loader]: ${o}`);let A=V.UNKNOWN,l=!1;const c=this.getInternalLoader(e);switch(e.type){case Oe.MANIFEST:A=n?V.MANIFEST_LOAD_TIMEOUT:V.MANIFEST_LOAD_ERROR,l=!0;break;case Oe.LEVEL:A=n?V.LEVEL_LOAD_TIMEOUT:V.LEVEL_LOAD_ERROR,l=!1;break;case Oe.AUDIO_TRACK:A=n?V.AUDIO_TRACK_LOAD_TIMEOUT:V.AUDIO_TRACK_LOAD_ERROR,l=!1;break;case Oe.SUBTITLE_TRACK:A=n?V.SUBTITLE_TRACK_LOAD_TIMEOUT:V.SUBTITLE_LOAD_ERROR,l=!1;break}c&&this.resetInternalLoader(e.type);const u={type:ye.NETWORK_ERROR,details:A,fatal:l,url:e.url,loader:c,context:e,error:a,networkDetails:t,stats:s};if(i){const h=(t==null?void 0:t.url)||e.url;u.response=ut({url:h,data:void 0},i)}this.hls.trigger(I.ERROR,u)}handlePlaylistLoaded(e,t,n,i,s,o){const a=this.hls,{type:A,level:l,id:c,groupId:u,deliveryDirectives:h}=i,d=ia(t,i),f=Wc(i),g=typeof i.level=="number"&&f===Ee.MAIN?l:void 0;if(!e.fragments.length){const v=new Error("No Segments found in Playlist");a.trigger(I.ERROR,{type:ye.NETWORK_ERROR,details:V.LEVEL_EMPTY_ERROR,fatal:!1,url:d,error:v,reason:v.message,response:t,context:i,level:g,parent:f,networkDetails:s,stats:n});return}e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));const p=e.playlistParsingError;if(p){a.trigger(I.ERROR,{type:ye.NETWORK_ERROR,details:V.LEVEL_PARSING_ERROR,fatal:!1,url:d,error:p,reason:p.message,response:t,context:i,level:g,parent:f,networkDetails:s,stats:n});return}switch(e.live&&o&&(o.getCacheAge&&(e.ageHeader=o.getCacheAge()||0),(!o.getCacheAge||isNaN(e.ageHeader))&&(e.ageHeader=0)),A){case Oe.MANIFEST:case Oe.LEVEL:a.trigger(I.LEVEL_LOADED,{details:e,level:g||0,id:c||0,stats:n,networkDetails:s,deliveryDirectives:h});break;case Oe.AUDIO_TRACK:a.trigger(I.AUDIO_TRACK_LOADED,{details:e,id:c||0,groupId:u||"",stats:n,networkDetails:s,deliveryDirectives:h});break;case Oe.SUBTITLE_TRACK:a.trigger(I.SUBTITLE_TRACK_LOADED,{details:e,id:c||0,groupId:u||"",stats:n,networkDetails:s,deliveryDirectives:h});break}}}function qc(r,e){let t;try{t=new Event("addtrack")}catch{t=document.createEvent("Event"),t.initEvent("addtrack",!1,!1)}t.track=r,e.dispatchEvent(t)}function Xc(r,e){const t=r.mode;if(t==="disabled"&&(r.mode="hidden"),r.cues&&!r.cues.getCueById(e.id))try{if(r.addCue(e),!r.cues.getCueById(e.id))throw new Error(`addCue is failed for: ${e}`)}catch(n){U.debug(`[texttrack-utils]: ${n}`);try{const i=new self.TextTrackCue(e.startTime,e.endTime,e.text);i.id=e.id,r.addCue(i)}catch(i){U.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${i}`)}}t==="disabled"&&(r.mode=t)}function mn(r){const e=r.mode;if(e==="disabled"&&(r.mode="hidden"),r.cues)for(let t=r.cues.length;t--;)r.removeCue(r.cues[t]);e==="disabled"&&(r.mode=e)}function sa(r,e,t,n){const i=r.mode;if(i==="disabled"&&(r.mode="hidden"),r.cues&&r.cues.length>0){const s=km(r.cues,e,t);for(let o=0;o<s.length;o++)(!n||n(s[o]))&&r.removeCue(s[o])}i==="disabled"&&(r.mode=i)}function Fm(r,e){if(e<r[0].startTime)return 0;const t=r.length-1;if(e>r[t].endTime)return-1;let n=0,i=t;for(;n<=i;){const s=Math.floor((i+n)/2);if(e<r[s].startTime)i=s-1;else if(e>r[s].startTime&&n<t)n=s+1;else return s}return r[n].startTime-e<e-r[i].startTime?n:i}function km(r,e,t){const n=[],i=Fm(r,e);if(i>-1)for(let s=i,o=r.length;s<o;s++){const a=r[s];if(a.startTime>=e&&a.endTime<=t)n.push(a);else if(a.startTime>t)return n}return n}function us(r){const e=[];for(let t=0;t<r.length;t++){const n=r[t];(n.kind==="subtitles"||n.kind==="captions")&&n.label&&e.push(r[t])}return e}var Jt={audioId3:"org.id3",dateRange:"com.apple.quicktime.HLS",emsg:"https://aomedia.org/emsg/ID3"};const Nm=.25;function oa(){if(!(typeof self>"u"))return self.VTTCue||self.TextTrackCue}function jc(r,e,t,n,i){let s=new r(e,t,"");try{s.value=n,i&&(s.type=i)}catch{s=new r(e,t,JSON.stringify(i?ut({type:i},n):n))}return s}const hs=(()=>{const r=oa();try{r&&new r(0,Number.POSITIVE_INFINITY,"")}catch{return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function aa(r,e){return r.getTime()/1e3-e}function Mm(r){return Uint8Array.from(r.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}class Pm{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(I.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(I.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(I.MANIFEST_LOADING,this.onManifestLoading,this),e.on(I.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(I.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(I.LEVEL_UPDATED,this.onLevelUpdated,this)}_unregisterListeners(){const{hls:e}=this;e.off(I.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(I.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(I.MANIFEST_LOADING,this.onManifestLoading,this),e.off(I.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(I.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(I.LEVEL_UPDATED,this.onLevelUpdated,this)}onMediaAttached(e,t){this.media=t.media}onMediaDetaching(){this.id3Track&&(mn(this.id3Track),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(e){const t=this.getID3Track(e.textTracks);return t.mode="hidden",t}getID3Track(e){if(this.media){for(let t=0;t<e.length;t++){const n=e[t];if(n.kind==="metadata"&&n.label==="id3")return qc(n,this.media),n}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(e,t){if(!this.media)return;const{hls:{config:{enableEmsgMetadataCues:n,enableID3MetadataCues:i}}}=this;if(!n&&!i)return;const{samples:s}=t;this.id3Track||(this.id3Track=this.createTrack(this.media));const o=oa();if(o)for(let a=0;a<s.length;a++){const A=s[a].type;if(A===Jt.emsg&&!n||!i)continue;const l=Bc(s[a].data);if(l){const c=s[a].pts;let u=c+s[a].duration;u>hs&&(u=hs),u-c<=0&&(u=c+Nm);for(let d=0;d<l.length;d++){const f=l[d];if(!yc(f)){this.updateId3CueEnds(c,A);const g=jc(o,c,u,f,A);g&&this.id3Track.addCue(g)}}}}}updateId3CueEnds(e,t){var n;const i=(n=this.id3Track)==null?void 0:n.cues;if(i)for(let s=i.length;s--;){const o=i[s];o.type===t&&o.startTime<e&&o.endTime===hs&&(o.endTime=e)}}onBufferFlushing(e,{startOffset:t,endOffset:n,type:i}){const{id3Track:s,hls:o}=this;if(!o)return;const{config:{enableEmsgMetadataCues:a,enableID3MetadataCues:A}}=o;if(s&&(a||A)){let l;i==="audio"?l=c=>c.type===Jt.audioId3&&A:i==="video"?l=c=>c.type===Jt.emsg&&a:l=c=>c.type===Jt.audioId3&&A||c.type===Jt.emsg&&a,sa(s,t,n,l)}}onLevelUpdated(e,{details:t}){if(!this.media||!t.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)return;const{dateRangeCuesAppended:n,id3Track:i}=this,{dateRanges:s}=t,o=Object.keys(s);if(i){const c=Object.keys(n).filter(u=>!o.includes(u));for(let u=c.length;u--;){const h=c[u];Object.keys(n[h].cues).forEach(d=>{i.removeCue(n[h].cues[d])}),delete n[h]}}const a=t.fragments[t.fragments.length-1];if(o.length===0||!he(a==null?void 0:a.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const A=a.programDateTime/1e3-a.start,l=oa();for(let c=0;c<o.length;c++){const u=o[c],h=s[u],d=aa(h.startDate,A),f=n[u],g=(f==null?void 0:f.cues)||{};let p=(f==null?void 0:f.durationKnown)||!1,v=hs;const T=h.endDate;if(T)v=aa(T,A),p=!0;else if(h.endOnNext&&!p){const y=o.reduce((w,R)=>{if(R!==h.id){const k=s[R];if(k.class===h.class&&k.startDate>h.startDate&&(!w||h.startDate<w.startDate))return k}return w},null);y&&(v=aa(y.startDate,A),p=!0)}const b=Object.keys(h.attr);for(let y=0;y<b.length;y++){const w=b[y];if(!Gp(w))continue;const R=g[w];if(R)p&&!f.durationKnown&&(R.endTime=v);else if(l){let k=h.attr[w];Hp(w)&&(k=Mm(k));const $=jc(l,d,v,{key:w,data:k},Jt.dateRange);$&&($.id=u,this.id3Track.addCue($),g[w]=$)}}n[u]={cues:g,dateRange:h,durationKnown:p}}}}class Om{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=()=>this.timeupdate(),this.hls=e,this.config=e.config,this.registerListeners()}get latency(){return this._latency||0}get maxLatency(){const{config:e,levelDetails:t}=this;return e.liveMaxLatencyDuration!==void 0?e.liveMaxLatencyDuration:t?e.liveMaxLatencyDurationCount*t.targetduration:0}get targetLatency(){const{levelDetails:e}=this;if(e===null)return null;const{holdBack:t,partHoldBack:n,targetduration:i}=e,{liveSyncDuration:s,liveSyncDurationCount:o,lowLatencyMode:a}=this.config,A=this.hls.userConfig;let l=a&&n||t;(A.liveSyncDuration||A.liveSyncDurationCount||l===0)&&(l=s!==void 0?s:o*i);const c=i;return l+Math.min(this.stallCount*1,c)}get liveSyncPosition(){const e=this.estimateLiveEdge(),t=this.targetLatency,n=this.levelDetails;if(e===null||t===null||n===null)return null;const i=n.edge,s=e-t-this.edgeStalled,o=i-n.totalduration,a=i-(this.config.lowLatencyMode&&n.partTarget||n.targetduration);return Math.min(Math.max(o,s),a)}get drift(){const{levelDetails:e}=this;return e===null?1:e.drift}get edgeStalled(){const{levelDetails:e}=this;if(e===null)return 0;const t=(this.config.lowLatencyMode&&e.partTarget||e.targetduration)*3;return Math.max(e.age-t,0)}get forwardBufferLength(){const{media:e,levelDetails:t}=this;if(!e||!t)return 0;const n=e.buffered.length;return(n?e.buffered.end(n-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null}registerListeners(){this.hls.on(I.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(I.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(I.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(I.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(I.ERROR,this.onError,this)}unregisterListeners(){this.hls.off(I.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(I.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.off(I.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(I.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.off(I.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.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:t}){this.levelDetails=t,t.advanced&&this.timeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)}onError(e,t){var n;t.details===V.BUFFER_STALLED_ERROR&&(this.stallCount++,(n=this.levelDetails)!=null&&n.live&&U.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))}timeupdate(){const{media:e,levelDetails:t}=this;if(!e||!t)return;this.currentTime=e.currentTime;const n=this.computeLatency();if(n===null)return;this._latency=n;const{lowLatencyMode:i,maxLiveSyncPlaybackRate:s}=this.config;if(!i||s===1||!t.live)return;const o=this.targetLatency;if(o===null)return;const a=n-o,A=Math.min(this.maxLatency,o+t.targetduration);if(a<A&&a>.05&&this.forwardBufferLength>1){const c=Math.min(2,Math.max(1,s)),u=Math.round(2/(1+Math.exp(-.75*a-this.edgeStalled))*20)/20;e.playbackRate=Math.min(c,Math.max(1,u))}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 Aa=["NONE","TYPE-0","TYPE-1",null];function Um(r){return Aa.indexOf(r)>-1}const ds=["SDR","PQ","HLG"];function Gm(r){return!!r&&ds.indexOf(r)>-1}var fs={No:"",Yes:"YES",v2:"v2"};function zc(r){const{canSkipUntil:e,canSkipDateRanges:t,age:n}=r,i=n<e/2;return e&&i?t?fs.v2:fs.Yes:fs.No}class Zc{constructor(e,t,n){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=e,this.part=t,this.skip=n}addDirectives(e){const t=new self.URL(e);return this.msn!==void 0&&t.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&t.searchParams.set("_HLS_part",this.part.toString()),this.skip&&t.searchParams.set("_HLS_skip",this.skip),t.href}}class En{constructor(e){this._attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.url=void 0,this.frameRate=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.supportedPromise=void 0,this.supportedResult=void 0,this._avgBitrate=0,this._audioGroups=void 0,this._subtitleGroups=void 0,this._urlId=0,this.url=[e.url],this._attrs=[e.attrs],this.bitrate=e.bitrate,e.details&&(this.details=e.details),this.id=e.id||0,this.name=e.name,this.width=e.width||0,this.height=e.height||0,this.frameRate=e.attrs.optionalFloat("FRAME-RATE",0),this._avgBitrate=e.attrs.decimalInteger("AVERAGE-BANDWIDTH"),this.audioCodec=e.audioCodec,this.videoCodec=e.videoCodec,this.codecSet=[e.videoCodec,e.audioCodec].filter(t=>!!t).map(t=>t.substring(0,4)).join(","),this.addGroupId("audio",e.attrs.AUDIO),this.addGroupId("text",e.attrs.SUBTITLES)}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get averageBitrate(){return this._avgBitrate||this.realBitrate||this.bitrate}get attrs(){return this._attrs[0]}get codecs(){return this.attrs.CODECS||""}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get videoRange(){return this.attrs["VIDEO-RANGE"]||"SDR"}get score(){return this.attrs.optionalFloat("SCORE",0)}get uri(){return this.url[0]||""}hasAudioGroup(e){return eu(this._audioGroups,e)}hasSubtitleGroup(e){return eu(this._subtitleGroups,e)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(e,t){if(t){if(e==="audio"){let n=this._audioGroups;n||(n=this._audioGroups=[]),n.indexOf(t)===-1&&n.push(t)}else if(e==="text"){let n=this._subtitleGroups;n||(n=this._subtitleGroups=[]),n.indexOf(t)===-1&&n.push(t)}}}get urlId(){return 0}set urlId(e){}get audioGroupIds(){return this.audioGroups?[this.audioGroupId]:void 0}get textGroupIds(){return this.subtitleGroups?[this.textGroupId]:void 0}get audioGroupId(){var e;return(e=this.audioGroups)==null?void 0:e[0]}get textGroupId(){var e;return(e=this.subtitleGroups)==null?void 0:e[0]}addFallback(){}}function eu(r,e){return!e||!r?!1:r.indexOf(e)!==-1}function la(r,e){const t=e.startPTS;if(he(t)){let n=0,i;e.sn>r.sn?(n=t-r.start,i=r):(n=r.start-t,i=e),i.duration!==n&&(i.duration=n)}else e.sn>r.sn?r.cc===e.cc&&r.minEndPTS?e.start=r.start+(r.minEndPTS-r.start):e.start=r.start+r.duration:e.start=Math.max(r.start-e.duration,0)}function tu(r,e,t,n,i,s){n-t<=0&&(U.warn("Fragment should have a positive duration",e),n=t+e.duration,s=i+e.duration);let a=t,A=n;const l=e.startPTS,c=e.endPTS;if(he(l)){const p=Math.abs(l-t);he(e.deltaPTS)?e.deltaPTS=Math.max(p,e.deltaPTS):e.deltaPTS=p,a=Math.max(t,l),t=Math.min(t,l),i=Math.min(i,e.startDTS),A=Math.min(n,c),n=Math.max(n,c),s=Math.max(s,e.endDTS)}const u=t-e.start;e.start!==0&&(e.start=t),e.duration=n-e.start,e.startPTS=t,e.maxStartPTS=a,e.startDTS=i,e.endPTS=n,e.minEndPTS=A,e.endDTS=s;const h=e.sn;if(!r||h<r.startSN||h>r.endSN)return 0;let d;const f=h-r.startSN,g=r.fragments;for(g[f]=e,d=f;d>0;d--)la(g[d],g[d-1]);for(d=f;d<g.length-1;d++)la(g[d],g[d+1]);return r.fragmentHint&&la(g[g.length-1],r.fragmentHint),r.PTSKnown=r.alignedSliding=!0,u}function Hm(r,e){let t=null;const n=r.fragments;for(let A=n.length-1;A>=0;A--){const l=n[A].initSegment;if(l){t=l;break}}r.fragmentHint&&delete r.fragmentHint.endPTS;let i=0,s;if(Vm(r,e,(A,l)=>{A.relurl&&(i=A.cc-l.cc),he(A.startPTS)&&he(A.endPTS)&&(l.start=l.startPTS=A.startPTS,l.startDTS=A.startDTS,l.maxStartPTS=A.maxStartPTS,l.endPTS=A.endPTS,l.endDTS=A.endDTS,l.minEndPTS=A.minEndPTS,l.duration=A.endPTS-A.startPTS,l.duration&&(s=l),e.PTSKnown=e.alignedSliding=!0),l.elementaryStreams=A.elementaryStreams,l.loader=A.loader,l.stats=A.stats,A.initSegment&&(l.initSegment=A.initSegment,t=A.initSegment)}),t&&(e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments).forEach(l=>{var c;l&&(!l.initSegment||l.initSegment.relurl===((c=t)==null?void 0:c.relurl))&&(l.initSegment=t)}),e.skippedSegments)if(e.deltaUpdateFailed=e.fragments.some(A=>!A),e.deltaUpdateFailed){U.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let A=e.skippedSegments;A--;)e.fragments.shift();e.startSN=e.fragments[0].sn,e.startCC=e.fragments[0].cc}else e.canSkipDateRanges&&(e.dateRanges=$m(r.dateRanges,e.dateRanges,e.recentlyRemovedDateranges));const o=e.fragments;if(i){U.warn("discontinuity sliding from playlist, take drift into account");for(let A=0;A<o.length;A++)o[A].cc+=i}e.skippedSegments&&(e.startCC=e.fragments[0].cc),Ym(r.partList,e.partList,(A,l)=>{l.elementaryStreams=A.elementaryStreams,l.stats=A.stats}),s?tu(e,s,s.startPTS,s.endPTS,s.startDTS,s.endDTS):ru(r,e),o.length&&(e.totalduration=e.edge-o[0].start),e.driftStartTime=r.driftStartTime,e.driftStart=r.driftStart;const a=e.advancedDateTime;if(e.advanced&&a){const A=e.edge;e.driftStart||(e.driftStartTime=a,e.driftStart=A),e.driftEndTime=a,e.driftEnd=A}else e.driftEndTime=r.driftEndTime,e.driftEnd=r.driftEnd,e.advancedDateTime=r.advancedDateTime}function $m(r,e,t){const n=st({},r);return t&&t.forEach(i=>{delete n[i]}),Object.keys(e).forEach(i=>{const s=new gc(e[i].attr,n[i]);s.isValid?n[i]=s:U.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${JSON.stringify(e[i].attr)}"`)}),n}function Ym(r,e,t){if(r&&e){let n=0;for(let i=0,s=r.length;i<=s;i++){const o=r[i],a=e[i+n];o&&a&&o.index===a.index&&o.fragment.sn===a.fragment.sn?t(o,a):n--}}}function Vm(r,e,t){const n=e.skippedSegments,i=Math.max(r.startSN,e.startSN)-e.startSN,s=(r.fragmentHint?1:0)+(n?e.endSN:Math.min(r.endSN,e.endSN))-e.startSN,o=e.startSN-r.startSN,a=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,A=r.fragmentHint?r.fragments.concat(r.fragmentHint):r.fragments;for(let l=i;l<=s;l++){const c=A[o+l];let u=a[l];n&&!u&&l<n&&(u=e.fragments[l]=c),c&&u&&t(c,u)}}function ru(r,e){const t=e.startSN+e.skippedSegments-r.startSN,n=r.fragments;t<0||t>=n.length||ca(e,n[t].start)}function ca(r,e){if(e){const t=r.fragments;for(let n=r.skippedSegments;n<t.length;n++)t[n].start+=e;r.fragmentHint&&(r.fragmentHint.start+=e)}}function Km(r,e=1/0){let t=1e3*r.targetduration;if(r.updated){const n=r.fragments;if(n.length&&t*4>e){const s=n[n.length-1].duration*1e3;s<t&&(t=s)}}else t/=2;return Math.round(t)}function Jm(r,e,t){if(!(r!=null&&r.details))return null;const n=r.details;let i=n.fragments[e-n.startSN];return i||(i=n.fragmentHint,i&&i.sn===e)?i:e<n.startSN&&t&&t.sn===e?t:null}function nu(r,e,t){var n;return r!=null&&r.details?iu((n=r.details)==null?void 0:n.partList,e,t):null}function iu(r,e,t){if(r)for(let n=r.length;n--;){const i=r[n];if(i.index===t&&i.fragment.sn===e)return i}return null}function su(r){r.forEach((e,t)=>{const{details:n}=e;n!=null&&n.fragments&&n.fragments.forEach(i=>{i.level=t})})}function gs(r){switch(r.details){case V.FRAG_LOAD_TIMEOUT:case V.KEY_LOAD_TIMEOUT:case V.LEVEL_LOAD_TIMEOUT:case V.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function ou(r,e){const t=gs(e);return r.default[`${t?"timeout":"error"}Retry`]}function ua(r,e){const t=r.backoff==="linear"?1:Math.pow(2,e);return Math.min(t*r.retryDelayMs,r.maxRetryDelayMs)}function au(r){return ut(ut({},r),{errorRetry:null,timeoutRetry:null})}function ps(r,e,t,n){if(!r)return!1;const i=n==null?void 0:n.code,s=e<r.maxNumRetry&&(Wm(i)||!!t);return r.shouldRetry?r.shouldRetry(r,e,t,n,s):s}function Wm(r){return r===0&&navigator.onLine===!1||!!r&&(r<400||r>499)}const Au={search:function(r,e){let t=0,n=r.length-1,i=null,s=null;for(;t<=n;){i=(t+n)/2|0,s=r[i];const o=e(s);if(o>0)t=i+1;else if(o<0)n=i-1;else return s}return null}};function qm(r,e,t){if(e===null||!Array.isArray(r)||!r.length||!he(e))return null;const n=r[0].programDateTime;if(e<(n||0))return null;const i=r[r.length-1].endProgramDateTime;if(e>=(i||0))return null;t=t||0;for(let s=0;s<r.length;++s){const o=r[s];if(jm(e,t,o))return o}return null}function ms(r,e,t=0,n=0,i=.005){let s=null;if(r){s=e[r.sn-e[0].sn+1]||null;const a=r.endDTS-t;a>0&&a<15e-7&&(t+=15e-7)}else t===0&&e[0].start===0&&(s=e[0]);if(s&&((!r||r.level===s.level)&&ha(t,n,s)===0||Xm(s,r,Math.min(i,n))))return s;const o=Au.search(e,ha.bind(null,t,n));return o&&(o!==r||!s)?o:s}function Xm(r,e,t){if(e&&e.start===0&&e.level<r.level&&(e.endPTS||0)>0){const n=e.tagList.reduce((i,s)=>(s[0]==="INF"&&(i+=parseFloat(s[1])),i),t);return r.start<=n}return!1}function ha(r=0,e=0,t){if(t.start<=r&&t.start+t.duration>r)return 0;const n=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0));return t.start+t.duration-n<=r?1:t.start-n>r&&t.start?-1:0}function jm(r,e,t){const n=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0))*1e3;return(t.endProgramDateTime||0)-n>r}function zm(r,e){return Au.search(r,t=>t.cc<e?1:t.cc>e?-1:0)}var It={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},Wt={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,SwitchToSDR:4};class Zm{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=U.log.bind(U,"[info]:"),this.warn=U.warn.bind(U,"[warning]:"),this.error=U.error.bind(U,"[error]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(I.ERROR,this.onError,this),e.on(I.MANIFEST_LOADING,this.onManifestLoading,this),e.on(I.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(I.ERROR,this.onError,this),e.off(I.ERROR,this.onErrorOut,this),e.off(I.MANIFEST_LOADING,this.onManifestLoading,this),e.off(I.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null,this.penalizedRenditions={}}startLoad(e){}stopLoad(){this.playlistError=0}getVariantLevelIndex(e){return(e==null?void 0:e.type)===Ee.MAIN?e.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onLevelUpdated(){this.playlistError=0}onError(e,t){var n,i;if(t.fatal)return;const s=this.hls,o=t.context;switch(t.details){case V.FRAG_LOAD_ERROR:case V.FRAG_LOAD_TIMEOUT:case V.KEY_LOAD_ERROR:case V.KEY_LOAD_TIMEOUT:t.errorAction=this.getFragRetryOrSwitchAction(t);return;case V.FRAG_PARSING_ERROR:if((n=t.frag)!=null&&n.gap){t.errorAction={action:It.DoNothing,flags:Wt.None};return}case V.FRAG_GAP:case V.FRAG_DECRYPT_ERROR:{t.errorAction=this.getFragRetryOrSwitchAction(t),t.errorAction.action=It.SendAlternateToPenaltyBox;return}case V.LEVEL_EMPTY_ERROR:case V.LEVEL_PARSING_ERROR:{var a,A;const l=t.parent===Ee.MAIN?t.level:s.loadLevel;t.details===V.LEVEL_EMPTY_ERROR&&((a=t.context)!=null&&(A=a.levelDetails)!=null&&A.live)?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,l):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,l))}return;case V.LEVEL_LOAD_ERROR:case V.LEVEL_LOAD_TIMEOUT:typeof(o==null?void 0:o.level)=="number"&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,o.level));return;case V.AUDIO_TRACK_LOAD_ERROR:case V.AUDIO_TRACK_LOAD_TIMEOUT:case V.SUBTITLE_LOAD_ERROR:case V.SUBTITLE_TRACK_LOAD_TIMEOUT:if(o){const l=s.levels[s.loadLevel];if(l&&(o.type===Oe.AUDIO_TRACK&&l.hasAudioGroup(o.groupId)||o.type===Oe.SUBTITLE_TRACK&&l.hasSubtitleGroup(o.groupId))){t.errorAction=this.getPlaylistRetryOrSwitchAction(t,s.loadLevel),t.errorAction.action=It.SendAlternateToPenaltyBox,t.errorAction.flags=Wt.MoveAllAlternatesMatchingHost;return}}return;case V.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const l=s.levels[s.loadLevel],c=l==null?void 0:l.attrs["HDCP-LEVEL"];c?t.errorAction={action:It.SendAlternateToPenaltyBox,flags:Wt.MoveAllAlternatesMatchingHDCP,hdcpLevel:c}:this.keySystemError(t)}return;case V.BUFFER_ADD_CODEC_ERROR:case V.REMUX_ALLOC_ERROR:case V.BUFFER_APPEND_ERROR:t.errorAction=this.getLevelSwitchAction(t,(i=t.level)!=null?i:s.loadLevel);return;case V.INTERNAL_EXCEPTION:case V.BUFFER_APPENDING_ERROR:case V.BUFFER_FULL_ERROR:case V.LEVEL_SWITCH_ERROR:case V.BUFFER_STALLED_ERROR:case V.BUFFER_SEEK_OVER_HOLE:case V.BUFFER_NUDGE_ON_STALL:t.errorAction={action:It.DoNothing,flags:Wt.None};return}t.type===ye.KEY_SYSTEM_ERROR&&this.keySystemError(t)}keySystemError(e){const t=this.getVariantLevelIndex(e.frag);e.levelRetry=!1,e.errorAction=this.getLevelSwitchAction(e,t)}getPlaylistRetryOrSwitchAction(e,t){const n=this.hls,i=ou(n.config.playlistLoadPolicy,e),s=this.playlistError++;if(ps(i,s,gs(e),e.response))return{action:It.RetryRequest,flags:Wt.None,retryConfig:i,retryCount:s};const a=this.getLevelSwitchAction(e,t);return i&&(a.retryConfig=i,a.retryCount=s),a}getFragRetryOrSwitchAction(e){const t=this.hls,n=this.getVariantLevelIndex(e.frag),i=t.levels[n],{fragLoadPolicy:s,keyLoadPolicy:o}=t.config,a=ou(e.details.startsWith("key")?o:s,e),A=t.levels.reduce((c,u)=>c+u.fragmentError,0);if(i&&(e.details!==V.FRAG_GAP&&i.fragmentError++,ps(a,A,gs(e),e.response)))return{action:It.RetryRequest,flags:Wt.None,retryConfig:a,retryCount:A};const l=this.getLevelSwitchAction(e,n);return a&&(l.retryConfig=a,l.retryCount=A),l}getLevelSwitchAction(e,t){const n=this.hls;t==null&&(t=n.loadLevel);const i=this.hls.levels[t];if(i){var s,o;const l=e.details;i.loadError++,l===V.BUFFER_APPEND_ERROR&&i.fragmentError++;let c=-1;const{levels:u,loadLevel:h,minAutoLevel:d,maxAutoLevel:f}=n;n.autoLevelEnabled||(n.loadLevel=-1);const g=(s=e.frag)==null?void 0:s.type,v=(g===Ee.AUDIO&&l===V.FRAG_PARSING_ERROR||e.sourceBufferName==="audio"&&(l===V.BUFFER_ADD_CODEC_ERROR||l===V.BUFFER_APPEND_ERROR))&&u.some(({audioCodec:R})=>i.audioCodec!==R),b=e.sourceBufferName==="video"&&(l===V.BUFFER_ADD_CODEC_ERROR||l===V.BUFFER_APPEND_ERROR)&&u.some(({codecSet:R,audioCodec:k})=>i.codecSet!==R&&i.audioCodec===k),{type:y,groupId:w}=(o=e.context)!=null?o:{};for(let R=u.length;R--;){const k=(R+h)%u.length;if(k!==h&&k>=d&&k<=f&&u[k].loadError===0){var a,A;const $=u[k];if(l===V.FRAG_GAP&&g===Ee.MAIN&&e.frag){const W=u[k].details;if(W){const O=ms(e.frag,W.fragments,e.frag.start);if(O!=null&&O.gap)continue}}else{if(y===Oe.AUDIO_TRACK&&$.hasAudioGroup(w)||y===Oe.SUBTITLE_TRACK&&$.hasSubtitleGroup(w))continue;if(g===Ee.AUDIO&&(a=i.audioGroups)!=null&&a.some(W=>$.hasAudioGroup(W))||g===Ee.SUBTITLE&&(A=i.subtitleGroups)!=null&&A.some(W=>$.hasSubtitleGroup(W))||v&&i.audioCodec===$.audioCodec||!v&&i.audioCodec!==$.audioCodec||b&&i.codecSet===$.codecSet)continue}c=k;break}}if(c>-1&&n.loadLevel!==c)return e.levelRetry=!0,this.playlistError=0,{action:It.SendAlternateToPenaltyBox,flags:Wt.None,nextAutoLevel:c}}return{action:It.SendAlternateToPenaltyBox,flags:Wt.MoveAllAlternatesMatchingHost}}onErrorOut(e,t){var n;switch((n=t.errorAction)==null?void 0:n.action){case It.DoNothing:break;case It.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(t),!t.errorAction.resolved&&t.details!==V.FRAG_GAP?t.fatal=!0:/MediaSource readyState: ended/.test(t.error.message)&&(this.warn(`MediaSource ended after "${t.sourceBufferName}" sourceBuffer append error. Attempting to recover from media error.`),this.hls.recoverMediaError());break}if(t.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(e){const t=this.hls,n=e.errorAction;if(!n)return;const{flags:i,hdcpLevel:s,nextAutoLevel:o}=n;switch(i){case Wt.None:this.switchLevel(e,o);break;case Wt.MoveAllAlternatesMatchingHDCP:s&&(t.maxHdcpLevel=Aa[Aa.indexOf(s)-1],n.resolved=!0),this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}n.resolved||this.switchLevel(e,o)}switchLevel(e,t){t!==void 0&&e.errorAction&&(this.warn(`switching to level ${t} after ${e.details}`),this.hls.nextAutoLevel=t,e.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel)}}class da{constructor(e,t){this.hls=void 0,this.timer=-1,this.requestScheduled=-1,this.canLoad=!1,this.log=void 0,this.warn=void 0,this.log=U.log.bind(U,`${t}:`),this.warn=U.warn.bind(U,`${t}:`),this.hls=e}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){this.timer!==-1&&(self.clearTimeout(this.timer),this.timer=-1)}startLoad(){this.canLoad=!0,this.requestScheduled=-1,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(e,t,n){const i=t==null?void 0:t.renditionReports;if(i){let s=-1;for(let o=0;o<i.length;o++){const a=i[o];let A;try{A=new self.URL(a.URI,t.url).href}catch(l){U.warn(`Could not construct new URL for Rendition Report: ${l}`),A=a.URI||""}if(A===e){s=o;break}else A===e.substring(0,A.length)&&(s=o)}if(s!==-1){const o=i[s],a=parseInt(o["LAST-MSN"])||(t==null?void 0:t.lastPartSn);let A=parseInt(o["LAST-PART"])||(t==null?void 0:t.lastPartIndex);if(this.hls.config.lowLatencyMode){const c=Math.min(t.age-t.partTarget,t.targetduration);A>=0&&c>t.partTarget&&(A+=1)}const l=n&&zc(n);return new Zc(a,A>=0?A:void 0,l)}}}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,t,n){const{details:i,stats:s}=t,o=self.performance.now(),a=s.loading.first?Math.max(0,o-s.loading.first):0;if(i.advancedDateTime=Date.now()-a,i.live||n!=null&&n.live){if(i.reloaded(n),n&&this.log(`live playlist ${e} ${i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:i.updated?"UPDATED":"MISSED"}`),n&&i.fragments.length>0&&Hm(n,i),!this.canLoad||!i.live)return;let A,l,c;if(i.canBlockReload&&i.endSN&&i.advanced){const p=this.hls.config.lowLatencyMode,v=i.lastPartSn,T=i.endSN,b=i.lastPartIndex,y=b!==-1,w=v===T,R=p?0:b;y?(l=w?T+1:v,c=w?R:b+1):l=T+1;const k=i.age,$=k+i.ageHeader;let W=Math.min($-i.partTarget,i.targetduration*1.5);if(W>0){if(n&&W>n.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${n.tuneInGoal} to: ${W} with playlist age: ${i.age}`),W=0;else{const O=Math.floor(W/i.targetduration);if(l+=O,c!==void 0){const K=Math.round(W%i.targetduration/i.partTarget);c+=K}this.log(`CDN Tune-in age: ${i.ageHeader}s last advanced ${k.toFixed(2)}s goal: ${W} skip sn ${O} to part ${c}`)}i.tuneInGoal=W}if(A=this.getDeliveryDirectives(i,t.deliveryDirectives,l,c),p||!w){this.loadPlaylist(A);return}}else(i.canBlockReload||i.canSkipUntil)&&(A=this.getDeliveryDirectives(i,t.deliveryDirectives,l,c));const u=this.hls.mainForwardBufferInfo,h=u?u.end-u.len:0,d=(i.edge-h)*1e3,f=Km(i,d);i.updated&&o>this.requestScheduled+f&&(this.requestScheduled=s.loading.start),l!==void 0&&i.canBlockReload?this.requestScheduled=s.loading.first+f-(i.partTarget*1e3||1e3):this.requestScheduled===-1||this.requestScheduled+f<o?this.requestScheduled=o:this.requestScheduled-o<=0&&(this.requestScheduled+=f);let g=this.requestScheduled-o;g=Math.max(0,g),this.log(`reload live playlist ${e} in ${Math.round(g)} ms`),this.timer=self.setTimeout(()=>this.loadPlaylist(A),g)}else this.clearTimer()}getDeliveryDirectives(e,t,n,i){let s=zc(e);return t!=null&&t.skip&&e.deltaUpdateFailed&&(n=t.msn,i=t.part,s=fs.No),new Zc(n,i,s)}checkRetry(e){const t=e.details,n=gs(e),i=e.errorAction,{action:s,retryCount:o=0,retryConfig:a}=i||{},A=!!i&&!!a&&(s===It.RetryRequest||!i.resolved&&s===It.SendAlternateToPenaltyBox);if(A){var l;if(this.requestScheduled=-1,o>=a.maxNumRetry)return!1;if(n&&(l=e.context)!=null&&l.deliveryDirectives)this.warn(`Retrying playlist loading ${o+1}/${a.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const c=ua(a,o);this.timer=self.setTimeout(()=>this.loadPlaylist(),c),this.warn(`Retrying playlist loading ${o+1}/${a.maxNumRetry} after "${t}" in ${c}ms`)}e.levelRetry=!0,i.resolved=!0}return A}}class In{constructor(e,t=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_=t,this.totalWeight_=n}sample(e,t){const n=Math.pow(this.alpha_,e);this.estimate_=t*(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 eE{constructor(e,t,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 In(e),this.fast_=new In(t),this.defaultTTFB_=i,this.ttfb_=new In(e)}update(e,t){const{slow_:n,fast_:i,ttfb_:s}=this;n.halfLife!==e&&(this.slow_=new In(e,n.getEstimate(),n.getTotalWeight())),i.halfLife!==t&&(this.fast_=new In(t,i.getEstimate(),i.getTotalWeight())),s.halfLife!==e&&(this.ttfb_=new In(e,s.getEstimate(),s.getTotalWeight()))}sample(e,t){e=Math.max(e,this.minDelayMs_);const n=8*t,i=e/1e3,s=n/i;this.fast_.sample(i,s),this.slow_.sample(i,s)}sampleTTFB(e){const t=e/1e3,n=Math.sqrt(2)*Math.exp(-Math.pow(t,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(){}}const lu={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]},cu={};function tE(r,e,t,n,i,s){const o=r.audioCodec?r.audioGroups:null,a=s==null?void 0:s.audioCodec,A=s==null?void 0:s.channels,l=A?parseInt(A):a?1/0:2;let c=null;if(o!=null&&o.length)try{o.length===1&&o[0]?c=e.groups[o[0]].channels:c=o.reduce((u,h)=>{if(h){const d=e.groups[h];if(!d)throw new Error(`Audio track group ${h} not found`);Object.keys(d.channels).forEach(f=>{u[f]=(u[f]||0)+d.channels[f]})}return u},{2:0})}catch{return!0}return r.videoCodec!==void 0&&(r.width>1920&&r.height>1088||r.height>1920&&r.width>1088||r.frameRate>Math.max(n,30)||r.videoRange!=="SDR"&&r.videoRange!==t||r.bitrate>Math.max(i,8e6))||!!c&&he(l)&&Object.keys(c).some(u=>parseInt(u)>l)}function rE(r,e,t){const n=r.videoCodec,i=r.audioCodec;if(!n||!i||!t)return Promise.resolve(lu);const s={width:r.width,height:r.height,bitrate:Math.ceil(Math.max(r.bitrate*.9,r.averageBitrate)),framerate:r.frameRate||30},o=r.videoRange;o!=="SDR"&&(s.transferFunction=o.toLowerCase());const a=n.split(",").map(A=>({type:"media-source",video:ut(ut({},s),{},{contentType:Ai(A,"video")})}));return i&&r.audioGroups&&r.audioGroups.forEach(A=>{var l;A&&((l=e.groups[A])==null||l.tracks.forEach(c=>{if(c.groupId===A){const u=c.channels||"",h=parseFloat(u);he(h)&&h>2&&a.push.apply(a,i.split(",").map(d=>({type:"media-source",audio:{contentType:Ai(d,"audio"),channels:""+h}})))}}))}),Promise.all(a.map(A=>{const l=nE(A);return cu[l]||(cu[l]=t.decodingInfo(A))})).then(A=>({supported:!A.some(l=>!l.supported),configurations:a,decodingInfoResults:A})).catch(A=>({supported:!1,configurations:a,decodingInfoResults:[],error:A}))}function nE(r){const{audio:e,video:t}=r,n=t||e;if(n){const i=n.contentType.split('"')[1];if(t)return`r${t.height}x${t.width}f${Math.ceil(t.framerate)}${t.transferFunction||"sd"}_${i}_${Math.ceil(t.bitrate/1e5)}`;if(e)return`c${e.channels}${e.spatialRendering?"s":"n"}_${i}`}return""}function iE(){if(typeof matchMedia=="function"){const r=matchMedia("(dynamic-range: high)"),e=matchMedia("bad query");if(r.media!==e.media)return r.matches===!0}return!1}function sE(r,e){let t=!1,n=[];return r&&(t=r!=="SDR",n=[r]),e&&(n=e.allowedVideoRanges||ds.slice(0),t=e.preferHDR!==void 0?e.preferHDR:iE(),t?n=n.filter(i=>i!=="SDR"):n=["SDR"]),{preferHDR:t,allowedVideoRanges:n}}function oE(r,e,t,n,i){const s=Object.keys(r),o=n==null?void 0:n.channels,a=n==null?void 0:n.audioCodec,A=o&&parseInt(o)===2;let l=!0,c=!1,u=1/0,h=1/0,d=1/0,f=0,g=[];const{preferHDR:p,allowedVideoRanges:v}=sE(e,i);for(let w=s.length;w--;){const R=r[s[w]];l=R.channels[2]>0,u=Math.min(u,R.minHeight),h=Math.min(h,R.minFramerate),d=Math.min(d,R.minBitrate);const k=v.filter($=>R.videoRanges[$]>0);k.length>0&&(c=!0,g=k)}u=he(u)?u:0,h=he(h)?h:0;const T=Math.max(1080,u),b=Math.max(30,h);return d=he(d)?d:t,t=Math.max(d,t),c||(e=void 0,g=[]),{codecSet:s.reduce((w,R)=>{const k=r[R];if(R===w)return w;if(k.minBitrate>t)return Er(R,`min bitrate of ${k.minBitrate} > current estimate of ${t}`),w;if(!k.hasDefaultAudio)return Er(R,"no renditions with default or auto-select sound found"),w;if(a&&R.indexOf(a.substring(0,4))%5!==0)return Er(R,`audio codec preference "${a}" not found`),w;if(o&&!A){if(!k.channels[o])return Er(R,`no renditions with ${o} channel sound found (channels options: ${Object.keys(k.channels)})`),w}else if((!a||A)&&l&&k.channels[2]===0)return Er(R,"no renditions with stereo sound found"),w;return k.minHeight>T?(Er(R,`min resolution of ${k.minHeight} > maximum of ${T}`),w):k.minFramerate>b?(Er(R,`min framerate of ${k.minFramerate} > maximum of ${b}`),w):g.some($=>k.videoRanges[$]>0)?k.maxScore<f?(Er(R,`max score of ${k.maxScore} < selected max of ${f}`),w):w&&(ls(R)>=ls(w)||k.fragmentError>r[w].fragmentError)?w:(f=k.maxScore,R):(Er(R,`no variants with VIDEO-RANGE of ${JSON.stringify(g)} found`),w)},void 0),videoRanges:g,preferHDR:p,minFramerate:h,minBitrate:d}}function Er(r,e){U.log(`[abr] start candidates with "${r}" ignored because ${e}`)}function aE(r){return r.reduce((e,t)=>{let n=e.groups[t.groupId];n||(n=e.groups[t.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),n.tracks.push(t);const i=t.channels||"2";return n.channels[i]=(n.channels[i]||0)+1,n.hasDefault=n.hasDefault||t.default,n.hasAutoSelect=n.hasAutoSelect||t.autoselect,n.hasDefault&&(e.hasDefaultAudio=!0),n.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function AE(r,e,t,n){return r.slice(t,n+1).reduce((i,s)=>{if(!s.codecSet)return i;const o=s.audioGroups;let a=i[s.codecSet];a||(i[s.codecSet]=a={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!o,fragmentError:0}),a.minBitrate=Math.min(a.minBitrate,s.bitrate);const A=Math.min(s.height,s.width);return a.minHeight=Math.min(a.minHeight,A),a.minFramerate=Math.min(a.minFramerate,s.frameRate),a.maxScore=Math.max(a.maxScore,s.score),a.fragmentError+=s.fragmentError,a.videoRanges[s.videoRange]=(a.videoRanges[s.videoRange]||0)+1,o&&o.forEach(l=>{if(!l)return;const c=e.groups[l];c&&(a.hasDefaultAudio=a.hasDefaultAudio||e.hasDefaultAudio?c.hasDefault:c.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(c.channels).forEach(u=>{a.channels[u]=(a.channels[u]||0)+c.channels[u]}))}),i},{})}function sr(r,e,t){if("attrs"in r){const n=e.indexOf(r);if(n!==-1)return n}for(let n=0;n<e.length;n++){const i=e[n];if(Cn(r,i,t))return n}return-1}function Cn(r,e,t){const{groupId:n,name:i,lang:s,assocLang:o,characteristics:a,default:A}=r,l=r.forced;return(n===void 0||e.groupId===n)&&(i===void 0||e.name===i)&&(s===void 0||e.lang===s)&&(s===void 0||e.assocLang===o)&&(A===void 0||e.default===A)&&(l===void 0||e.forced===l)&&(a===void 0||lE(a,e.characteristics))&&(t===void 0||t(r,e))}function lE(r,e=""){const t=r.split(","),n=e.split(",");return t.length===n.length&&!t.some(i=>n.indexOf(i)===-1)}function vn(r,e){const{audioCodec:t,channels:n}=r;return(t===void 0||(e.audioCodec||"").substring(0,4)===t.substring(0,4))&&(n===void 0||n===(e.channels||"2"))}function cE(r,e,t,n,i){const s=e[n],a=e.reduce((h,d,f)=>{const g=d.uri;return(h[g]||(h[g]=[])).push(f),h},{})[s.uri];a.length>1&&(n=Math.max.apply(Math,a));const A=s.videoRange,l=s.frameRate,c=s.codecSet.substring(0,4),u=uu(e,n,h=>{if(h.videoRange!==A||h.frameRate!==l||h.codecSet.substring(0,4)!==c)return!1;const d=h.audioGroups,f=t.filter(g=>!d||d.indexOf(g.groupId)!==-1);return sr(r,f,i)>-1});return u>-1?u:uu(e,n,h=>{const d=h.audioGroups,f=t.filter(g=>!d||d.indexOf(g.groupId)!==-1);return sr(r,f,i)>-1})}function uu(r,e,t){for(let n=e;n;n--)if(t(r[n]))return n;for(let n=e+1;n<r.length;n++)if(t(r[n]))return n;return-1}class uE{constructor(e){this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey="",this.audioTracksByGroup=null,this.codecTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this._abandonRulesCheck=()=>{const{fragCurrent:t,partCurrent:n,hls:i}=this,{autoLevelEnabled:s,media:o}=i;if(!t||!o)return;const a=performance.now(),A=n?n.stats:t.stats,l=n?n.duration:t.duration,c=a-A.loading.start,u=i.minAutoLevel;if(A.aborted||A.loaded&&A.loaded===A.total||t.level<=u){this.clearTimer(),this._nextAutoLevel=-1;return}if(!s||o.paused||!o.playbackRate||!o.readyState)return;const h=i.mainForwardBufferInfo;if(h===null)return;const d=this.bwEstimator.getEstimateTTFB(),f=Math.abs(o.playbackRate);if(c<=Math.max(d,1e3*(l/(f*2))))return;const g=h.len/f,p=A.loading.first?A.loading.first-A.loading.start:-1,v=A.loaded&&p>-1,T=this.getBwEstimate(),b=i.levels,y=b[t.level],w=A.total||Math.max(A.loaded,Math.round(l*y.averageBitrate/8));let R=v?c-p:c;R<1&&v&&(R=Math.min(c,A.loaded*8/T));const k=v?A.loaded*1e3/R:0,$=k?(w-A.loaded)/k:w*8/T+d/1e3;if($<=g)return;const W=k?k*8:T;let O=Number.POSITIVE_INFINITY,K;for(K=t.level-1;K>u;K--){const ee=b[K].maxBitrate;if(O=this.getTimeToLoadFrag(d/1e3,W,l*ee,!b[K].details),O<g)break}if(O>=$||O>l*10)return;i.nextLoadLevel=i.nextAutoLevel=K,v?this.bwEstimator.sample(c-Math.min(d,p),A.loaded):this.bwEstimator.sampleTTFB(c);const ne=b[K].maxBitrate;this.getBwEstimate()*this.hls.config.abrBandWidthUpFactor>ne&&this.resetEstimator(ne),this.clearTimer(),U.warn(`[abr] Fragment ${t.sn}${n?" part "+n.index:""} of level ${t.level} is loading too slowly;
|
2463
|
+
*/const uc="important",Rp=" !"+uc,Yo=hn(class extends qn{constructor(r){var e;if(super(r),r.type!==un.ATTRIBUTE||r.name!=="style"||((e=r.strings)==null?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(r){return Object.keys(r).reduce((e,t)=>{const n=r[t];return n==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${n};`},"")}update(r,[e]){const{style:t}=r.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(const n of this.ft)e[n]==null&&(this.ft.delete(n),n.includes("-")?t.removeProperty(n):t[n]=null);for(const n in e){const i=e[n];if(i!=null){this.ft.add(n);const s=typeof i=="string"&&i.endsWith(Rp);n.includes("-")||s?t.setProperty(n,s?i.slice(0,-11):i,s?uc:""):t[n]=i}}return Vt}});function Dp(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var hc={exports:{}};(function(r,e){(function(t){var n=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,i=/^(?=([^\/?#]*))\1([^]*)$/,s=/(?:\/|^)\.(?=\/)/g,o=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,a={buildAbsoluteURL:function(l,A,c){if(c=c||{},l=l.trim(),A=A.trim(),!A){if(!c.alwaysNormalize)return l;var u=a.parseURL(l);if(!u)throw new Error("Error trying to parse base URL.");return u.path=a.normalizePath(u.path),a.buildURLFromParts(u)}var h=a.parseURL(A);if(!h)throw new Error("Error trying to parse relative URL.");if(h.scheme)return c.alwaysNormalize?(h.path=a.normalizePath(h.path),a.buildURLFromParts(h)):A;var d=a.parseURL(l);if(!d)throw new Error("Error trying to parse base URL.");if(!d.netLoc&&d.path&&d.path[0]!=="/"){var f=i.exec(d.path);d.netLoc=f[1],d.path=f[2]}d.netLoc&&!d.path&&(d.path="/");var g={scheme:d.scheme,netLoc:h.netLoc,path:null,params:h.params,query:h.query,fragment:h.fragment};if(!h.netLoc&&(g.netLoc=d.netLoc,h.path[0]!=="/"))if(!h.path)g.path=d.path,h.params||(g.params=d.params,h.query||(g.query=d.query));else{var p=d.path,C=p.substring(0,p.lastIndexOf("/")+1)+h.path;g.path=a.normalizePath(C)}return g.path===null&&(g.path=c.alwaysNormalize?a.normalizePath(h.path):h.path),a.buildURLFromParts(g)},parseURL:function(l){var A=n.exec(l);return A?{scheme:A[1]||"",netLoc:A[2]||"",path:A[3]||"",params:A[4]||"",query:A[5]||"",fragment:A[6]||""}:null},normalizePath:function(l){for(l=l.split("").reverse().join("").replace(s,"");l.length!==(l=l.replace(o,"")).length;);return l.split("").reverse().join("")},buildURLFromParts:function(l){return l.scheme+l.netLoc+l.path+l.params+l.query+l.fragment}};r.exports=a})()})(hc);var Vo=hc.exports;function dc(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function ut(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?dc(Object(t),!0).forEach(function(n){Fp(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):dc(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function _p(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Lp(r){var e=_p(r,"string");return typeof e=="symbol"?e:String(e)}function Fp(r,e,t){return e=Lp(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function st(){return st=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},st.apply(this,arguments)}const he=Number.isFinite||function(r){return typeof r=="number"&&isFinite(r)},kp=Number.isSafeInteger||function(r){return typeof r=="number"&&Math.abs(r)<=Np},Np=Number.MAX_SAFE_INTEGER||9007199254740991;let I=function(r){return r.MEDIA_ATTACHING="hlsMediaAttaching",r.MEDIA_ATTACHED="hlsMediaAttached",r.MEDIA_DETACHING="hlsMediaDetaching",r.MEDIA_DETACHED="hlsMediaDetached",r.BUFFER_RESET="hlsBufferReset",r.BUFFER_CODECS="hlsBufferCodecs",r.BUFFER_CREATED="hlsBufferCreated",r.BUFFER_APPENDING="hlsBufferAppending",r.BUFFER_APPENDED="hlsBufferAppended",r.BUFFER_EOS="hlsBufferEos",r.BUFFER_FLUSHING="hlsBufferFlushing",r.BUFFER_FLUSHED="hlsBufferFlushed",r.MANIFEST_LOADING="hlsManifestLoading",r.MANIFEST_LOADED="hlsManifestLoaded",r.MANIFEST_PARSED="hlsManifestParsed",r.LEVEL_SWITCHING="hlsLevelSwitching",r.LEVEL_SWITCHED="hlsLevelSwitched",r.LEVEL_LOADING="hlsLevelLoading",r.LEVEL_LOADED="hlsLevelLoaded",r.LEVEL_UPDATED="hlsLevelUpdated",r.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",r.LEVELS_UPDATED="hlsLevelsUpdated",r.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",r.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",r.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",r.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",r.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",r.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",r.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",r.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",r.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",r.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",r.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",r.CUES_PARSED="hlsCuesParsed",r.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",r.INIT_PTS_FOUND="hlsInitPtsFound",r.FRAG_LOADING="hlsFragLoading",r.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",r.FRAG_LOADED="hlsFragLoaded",r.FRAG_DECRYPTED="hlsFragDecrypted",r.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",r.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",r.FRAG_PARSING_METADATA="hlsFragParsingMetadata",r.FRAG_PARSED="hlsFragParsed",r.FRAG_BUFFERED="hlsFragBuffered",r.FRAG_CHANGED="hlsFragChanged",r.FPS_DROP="hlsFpsDrop",r.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",r.MAX_AUTO_LEVEL_UPDATED="hlsMaxAutoLevelUpdated",r.ERROR="hlsError",r.DESTROYING="hlsDestroying",r.KEY_LOADING="hlsKeyLoading",r.KEY_LOADED="hlsKeyLoaded",r.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",r.BACK_BUFFER_REACHED="hlsBackBufferReached",r.STEERING_MANIFEST_LOADED="hlsSteeringManifestLoaded",r}({}),ye=function(r){return r.NETWORK_ERROR="networkError",r.MEDIA_ERROR="mediaError",r.KEY_SYSTEM_ERROR="keySystemError",r.MUX_ERROR="muxError",r.OTHER_ERROR="otherError",r}({}),K=function(r){return r.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",r.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",r.KEY_SYSTEM_NO_SESSION="keySystemNoSession",r.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",r.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",r.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",r.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",r.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",r.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",r.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",r.MANIFEST_LOAD_ERROR="manifestLoadError",r.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",r.MANIFEST_PARSING_ERROR="manifestParsingError",r.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",r.LEVEL_EMPTY_ERROR="levelEmptyError",r.LEVEL_LOAD_ERROR="levelLoadError",r.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",r.LEVEL_PARSING_ERROR="levelParsingError",r.LEVEL_SWITCH_ERROR="levelSwitchError",r.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",r.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",r.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",r.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",r.FRAG_LOAD_ERROR="fragLoadError",r.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",r.FRAG_DECRYPT_ERROR="fragDecryptError",r.FRAG_PARSING_ERROR="fragParsingError",r.FRAG_GAP="fragGap",r.REMUX_ALLOC_ERROR="remuxAllocError",r.KEY_LOAD_ERROR="keyLoadError",r.KEY_LOAD_TIMEOUT="keyLoadTimeOut",r.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",r.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",r.BUFFER_APPEND_ERROR="bufferAppendError",r.BUFFER_APPENDING_ERROR="bufferAppendingError",r.BUFFER_STALLED_ERROR="bufferStalledError",r.BUFFER_FULL_ERROR="bufferFullError",r.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",r.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",r.INTERNAL_EXCEPTION="internalException",r.INTERNAL_ABORTED="aborted",r.UNKNOWN="unknown",r}({});const Jr=function(){},Ko={trace:Jr,debug:Jr,log:Jr,warn:Jr,info:Jr,error:Jr};let si=Ko;function Mp(r){const e=self.console[r];return e?e.bind(self.console,`[${r}] >`):Jr}function Pp(r,...e){e.forEach(function(t){si[t]=r[t]?r[t].bind(r):Mp(t)})}function Op(r,e){if(typeof console=="object"&&r===!0||typeof r=="object"){Pp(r,"debug","log","info","warn","error");try{si.log(`Debug logs enabled for "${e}" in hls.js version 1.5.11`)}catch{si=Ko}}else si=Ko}const U=si,Up=/^(\d+)x(\d+)$/,fc=/(.+?)=(".*?"|.*?)(?:,|$)/g;class je{constructor(e){typeof e=="string"&&(e=je.parseAttrList(e)),st(this,e)}get clientAttrs(){return Object.keys(this).filter(e=>e.substring(0,2)==="X-")}decimalInteger(e){const t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t}hexadecimalInteger(e){if(this[e]){let t=(this[e]||"0x").slice(2);t=(t.length&1?"0":"")+t;const n=new Uint8Array(t.length/2);for(let i=0;i<t.length/2;i++)n[i]=parseInt(t.slice(i*2,i*2+2),16);return n}else return null}hexadecimalIntegerAsNumber(e){const t=parseInt(this[e],16);return t>Number.MAX_SAFE_INTEGER?1/0:t}decimalFloatingPoint(e){return parseFloat(this[e])}optionalFloat(e,t){const n=this[e];return n?parseFloat(n):t}enumeratedString(e){return this[e]}bool(e){return this[e]==="YES"}decimalResolution(e){const t=Up.exec(this[e]);if(t!==null)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e){let t;const n={},i='"';for(fc.lastIndex=0;(t=fc.exec(e))!==null;){let s=t[2];s.indexOf(i)===0&&s.lastIndexOf(i)===s.length-1&&(s=s.slice(1,-1));const o=t[1].trim();n[o]=s}return n}}function Gp(r){return r!=="ID"&&r!=="CLASS"&&r!=="START-DATE"&&r!=="DURATION"&&r!=="END-DATE"&&r!=="END-ON-NEXT"}function Hp(r){return r==="SCTE35-OUT"||r==="SCTE35-IN"}class gc{constructor(e,t){if(this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,t){const n=t.attr;for(const i in n)if(Object.prototype.hasOwnProperty.call(e,i)&&e[i]!==n[i]){U.warn(`DATERANGE tag attribute: "${i}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=i;break}e=st(new je({}),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"]);he(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(he(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&&he(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)}}class ns{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 He={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class pc{constructor(e){this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams={[He.AUDIO]:null,[He.VIDEO]:null,[He.AUDIOVIDEO]:null},this.baseurl=e}setByteRange(e,t){const n=e.split("@",2);let i;n.length===1?i=(t==null?void 0:t.byteRangeEndOffset)||0:i=parseInt(n[1]),this._byteRange=[i,parseInt(n[0])+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=Vo.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}}class Jo extends pc{constructor(e,t){super(t),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 ns,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=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 t=this.levelkeys.identity;if(t)this._decryptdata=t.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||!he(this.programDateTime))return null;const e=he(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 t=Object.keys(this.levelkeys),n=t.length;if(n>1||n===1&&this.levelkeys[t[0]].encrypted)return!0}return!1}setKeyFormat(e){if(this.levelkeys){const t=this.levelkeys[e];t&&!this._decryptdata&&(this._decryptdata=t.getDecryptData(this.sn))}}abortRequests(){var e,t;(e=this.loader)==null||e.abort(),(t=this.keyLoader)==null||t.abort()}setElementaryStreamInfo(e,t,n,i,s,o=!1){const{elementaryStreams:a}=this,l=a[e];if(!l){a[e]={startPTS:t,endPTS:n,startDTS:i,endDTS:s,partial:o};return}l.startPTS=Math.min(l.startPTS,t),l.endPTS=Math.max(l.endPTS,n),l.startDTS=Math.min(l.startDTS,i),l.endDTS=Math.max(l.endDTS,s)}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[He.AUDIO]=null,e[He.VIDEO]=null,e[He.AUDIOVIDEO]=null}}class $p extends pc{constructor(e,t,n,i,s){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 ns,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=t,this.index=i;const o=e.enumeratedString("BYTERANGE");o&&this.setByteRange(o,s),s&&(this.fragOffset=s.fragOffset+s.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 Yp=10;class Vp{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 t=this.lastPartSn-e.lastPartSn,n=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!n||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||t===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?he(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||Yp}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 Wo(r){return Uint8Array.from(atob(r),e=>e.charCodeAt(0))}function Kp(r){const e=qo(r).subarray(0,16),t=new Uint8Array(16);return t.set(e,16-e.length),t}function Jp(r){const e=function(n,i,s){const o=n[i];n[i]=n[s],n[s]=o};e(r,0,3),e(r,1,2),e(r,4,5),e(r,6,7)}function Wp(r){const e=r.split(":");let t=null;if(e[0]==="data"&&e.length===2){const n=e[1].split(";"),i=n[n.length-1].split(",");if(i.length===2){const s=i[0]==="base64",o=i[1];s?(n.splice(-1,1),t=Wo(o)):t=Kp(o)}}return t}function qo(r){return Uint8Array.from(unescape(encodeURIComponent(r)),e=>e.charCodeAt(0))}const pn=typeof self<"u"?self:void 0;var Je={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},Rt={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function mc(r){switch(r){case Rt.FAIRPLAY:return Je.FAIRPLAY;case Rt.PLAYREADY:return Je.PLAYREADY;case Rt.WIDEVINE:return Je.WIDEVINE;case Rt.CLEARKEY:return Je.CLEARKEY}}var Ec={WIDEVINE:"edef8ba979d64acea3c827dcd51d21ed"};function qp(r){if(r===Ec.WIDEVINE)return Je.WIDEVINE}function Ic(r){switch(r){case Je.FAIRPLAY:return Rt.FAIRPLAY;case Je.PLAYREADY:return Rt.PLAYREADY;case Je.WIDEVINE:return Rt.WIDEVINE;case Je.CLEARKEY:return Rt.CLEARKEY}}function Xo(r){const{drmSystems:e,widevineLicenseUrl:t}=r,n=e?[Je.FAIRPLAY,Je.WIDEVINE,Je.PLAYREADY,Je.CLEARKEY].filter(i=>!!e[i]):[];return!n[Je.WIDEVINE]&&t&&n.push(Je.WIDEVINE),n}const Cc=function(r){return pn!=null&&(r=pn.navigator)!=null&&r.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function Xp(r,e,t,n){let i;switch(r){case Je.FAIRPLAY:i=["cenc","sinf"];break;case Je.WIDEVINE:case Je.PLAYREADY:i=["cenc"];break;case Je.CLEARKEY:i=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${r}`)}return jp(i,e,t,n)}function jp(r,e,t,n){return[{initDataTypes:r,persistentState:n.persistentState||"optional",distinctiveIdentifier:n.distinctiveIdentifier||"optional",sessionTypes:n.sessionTypes||[n.sessionType||"temporary"],audioCapabilities:e.map(s=>({contentType:`audio/mp4; codecs="${s}"`,robustness:n.audioRobustness||"",encryptionScheme:n.audioEncryptionScheme||null})),videoCapabilities:t.map(s=>({contentType:`video/mp4; codecs="${s}"`,robustness:n.videoRobustness||"",encryptionScheme:n.videoEncryptionScheme||null}))}]}function Wr(r,e,t){return Uint8Array.prototype.slice?r.slice(e,t):new Uint8Array(Array.prototype.slice.call(r,e,t))}const jo=(r,e)=>e+10<=r.length&&r[e]===73&&r[e+1]===68&&r[e+2]===51&&r[e+3]<255&&r[e+4]<255&&r[e+6]<128&&r[e+7]<128&&r[e+8]<128&&r[e+9]<128,vc=(r,e)=>e+10<=r.length&&r[e]===51&&r[e+1]===68&&r[e+2]===73&&r[e+3]<255&&r[e+4]<255&&r[e+6]<128&&r[e+7]<128&&r[e+8]<128&&r[e+9]<128,oi=(r,e)=>{const t=e;let n=0;for(;jo(r,e);){n+=10;const i=is(r,e+6);n+=i,vc(r,e+10)&&(n+=10),e+=n}if(n>0)return r.subarray(t,t+n)},is=(r,e)=>{let t=0;return t=(r[e]&127)<<21,t|=(r[e+1]&127)<<14,t|=(r[e+2]&127)<<7,t|=r[e+3]&127,t},zp=(r,e)=>jo(r,e)&&is(r,e+6)+10<=r.length-e,zo=r=>{const e=Bc(r);for(let t=0;t<e.length;t++){const n=e[t];if(yc(n))return im(n)}},yc=r=>r&&r.key==="PRIV"&&r.info==="com.apple.streaming.transportStreamTimestamp",Zp=r=>{const e=String.fromCharCode(r[0],r[1],r[2],r[3]),t=is(r,4),n=10;return{type:e,size:t,data:r.subarray(n,n+t)}},Bc=r=>{let e=0;const t=[];for(;jo(r,e);){const n=is(r,e+6);e+=10;const i=e+n;for(;e+8<i;){const s=Zp(r.subarray(e)),o=em(s);o&&t.push(o),e+=s.size+10}vc(r,e)&&(e+=10)}return t},em=r=>r.type==="PRIV"?tm(r):r.type[0]==="W"?nm(r):rm(r),tm=r=>{if(r.size<2)return;const e=tr(r.data,!0),t=new Uint8Array(r.data.subarray(e.length+1));return{key:r.type,info:e,data:t.buffer}},rm=r=>{if(r.size<2)return;if(r.type==="TXXX"){let t=1;const n=tr(r.data.subarray(t),!0);t+=n.length+1;const i=tr(r.data.subarray(t));return{key:r.type,info:n,data:i}}const e=tr(r.data.subarray(1));return{key:r.type,data:e}},nm=r=>{if(r.type==="WXXX"){if(r.size<2)return;let t=1;const n=tr(r.data.subarray(t),!0);t+=n.length+1;const i=tr(r.data.subarray(t));return{key:r.type,info:n,data:i}}const e=tr(r.data);return{key:r.type,data:e}},im=r=>{if(r.data.byteLength===8){const e=new Uint8Array(r.data),t=e[3]&1;let n=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return n/=45,t&&(n+=4772185884e-2),Math.round(n)}},tr=(r,e=!1)=>{const t=sm();if(t){const A=t.decode(r);if(e){const c=A.indexOf("\0");return c!==-1?A.substring(0,c):A}return A.replace(/\0/g,"")}const n=r.length;let i,s,o,a="",l=0;for(;l<n;){if(i=r[l++],i===0&&e)return a;if(i===0||i===3)continue;switch(i>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:a+=String.fromCharCode(i);break;case 12:case 13:s=r[l++],a+=String.fromCharCode((i&31)<<6|s&63);break;case 14:s=r[l++],o=r[l++],a+=String.fromCharCode((i&15)<<12|(s&63)<<6|(o&63)<<0);break}}return a};let Zo;function sm(){if(!navigator.userAgent.includes("PlayStation 4"))return!Zo&&typeof self.TextDecoder<"u"&&(Zo=new self.TextDecoder("utf-8")),Zo}const rr={hexDump:function(r){let e="";for(let t=0;t<r.length;t++){let n=r[t].toString(16);n.length<2&&(n="0"+n),e+=n}return e}},ss=Math.pow(2,32)-1,om=[].push,Qc={video:1,audio:2,id3:3,text:4};function At(r){return String.fromCharCode.apply(null,r)}function Tc(r,e){const t=r[e]<<8|r[e+1];return t<0?65536+t:t}function me(r,e){const t=xc(r,e);return t<0?4294967296+t:t}function bc(r,e){let t=me(r,e);return t*=Math.pow(2,32),t+=me(r,e+4),t}function xc(r,e){return r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3]}function ea(r,e,t){r[e]=t>>24,r[e+1]=t>>16&255,r[e+2]=t>>8&255,r[e+3]=t&255}function am(r){const e=r.byteLength;for(let t=0;t<e;){const n=me(r,t);if(n>8&&r[t+4]===109&&r[t+5]===111&&r[t+6]===111&&r[t+7]===102)return!0;t=n>1?t+n:e}return!1}function xe(r,e){const t=[];if(!e.length)return t;const n=r.byteLength;for(let i=0;i<n;){const s=me(r,i),o=At(r.subarray(i+4,i+8)),a=s>1?i+s:n;if(o===e[0])if(e.length===1)t.push(r.subarray(i+8,a));else{const l=xe(r.subarray(i+8,a),e.slice(1));l.length&&om.apply(t,l)}i=a}return t}function lm(r){const e=[],t=r[0];let n=8;const i=me(r,n);n+=4;let s=0,o=0;t===0?(s=me(r,n),o=me(r,n+4),n+=8):(s=bc(r,n),o=bc(r,n+8),n+=16),n+=2;let a=r.length+o;const l=Tc(r,n);n+=2;for(let A=0;A<l;A++){let c=n;const u=me(r,c);c+=4;const h=u&2147483647;if((u&2147483648)>>>31===1)return U.warn("SIDX has hierarchical references (not supported)"),null;const f=me(r,c);c+=4,e.push({referenceSize:h,subsegmentDuration:f,info:{duration:f/i,start:a,end:a+h-1}}),a+=h,c+=4,n=c}return{earliestPresentationTime:s,timescale:i,version:t,referencesCount:l,references:e}}function wc(r){const e=[],t=xe(r,["moov","trak"]);for(let i=0;i<t.length;i++){const s=t[i],o=xe(s,["tkhd"])[0];if(o){let a=o[0];const l=me(o,a===0?12:20),A=xe(s,["mdia","mdhd"])[0];if(A){a=A[0];const c=me(A,a===0?12:20),u=xe(s,["mdia","hdlr"])[0];if(u){const h=At(u.subarray(8,12)),d={soun:He.AUDIO,vide:He.VIDEO}[h];if(d){const f=xe(s,["mdia","minf","stbl","stsd"])[0],g=Am(f);e[l]={timescale:c,type:d},e[d]=ut({timescale:c,id:l},g)}}}}}return xe(r,["moov","mvex","trex"]).forEach(i=>{const s=me(i,4),o=e[s];o&&(o.default={duration:me(i,12),flags:me(i,20)})}),e}function Am(r){const e=r.subarray(8),t=e.subarray(86),n=At(e.subarray(4,8));let i=n;const s=n==="enca"||n==="encv";if(s){const a=xe(e,[n])[0].subarray(n==="enca"?28:78);xe(a,["sinf"]).forEach(A=>{const c=xe(A,["schm"])[0];if(c){const u=At(c.subarray(4,8));if(u==="cbcs"||u==="cenc"){const h=xe(A,["frma"])[0];h&&(i=At(h))}}})}switch(i){case"avc1":case"avc2":case"avc3":case"avc4":{const o=xe(t,["avcC"])[0];i+="."+os(o[1])+os(o[2])+os(o[3]);break}case"mp4a":{const o=xe(e,[n])[0],a=xe(o.subarray(28),["esds"])[0];if(a&&a.length>12){let l=4;if(a[l++]!==3)break;l=ta(a,l),l+=2;const A=a[l++];if(A&128&&(l+=2),A&64&&(l+=a[l++]),a[l++]!==4)break;l=ta(a,l);const c=a[l++];if(c===64)i+="."+os(c);else break;if(l+=12,a[l++]!==5)break;l=ta(a,l);const u=a[l++];let h=(u&248)>>3;h===31&&(h+=1+((u&7)<<3)+((a[l]&224)>>5)),i+="."+h}break}case"hvc1":case"hev1":{const o=xe(t,["hvcC"])[0],a=o[1],l=["","A","B","C"][a>>6],A=a&31,c=me(o,2),u=(a&32)>>5?"H":"L",h=o[12],d=o.subarray(6,12);i+="."+l+A,i+="."+c.toString(16).toUpperCase(),i+="."+u+h;let f="";for(let g=d.length;g--;){const p=d[g];(p||f)&&(f="."+p.toString(16).toUpperCase()+f)}i+=f;break}case"dvh1":case"dvhe":{const o=xe(t,["dvcC"])[0],a=o[2]>>1&127,l=o[2]<<5&32|o[3]>>3&31;i+="."+nr(a)+"."+nr(l);break}case"vp09":{const o=xe(t,["vpcC"])[0],a=o[4],l=o[5],A=o[6]>>4&15;i+="."+nr(a)+"."+nr(l)+"."+nr(A);break}case"av01":{const o=xe(t,["av1C"])[0],a=o[1]>>>5,l=o[1]&31,A=o[2]>>>7?"H":"M",c=(o[2]&64)>>6,u=(o[2]&32)>>5,h=a===2&&c?u?12:10:c?10:8,d=(o[2]&16)>>4,f=(o[2]&8)>>3,g=(o[2]&4)>>2,p=o[2]&3;i+="."+a+"."+nr(l)+A+"."+nr(h)+"."+d+"."+f+g+p+"."+nr(1)+"."+nr(1)+"."+nr(1)+"."+0;break}}return{codec:i,encrypted:s}}function ta(r,e){const t=e+5;for(;r[e++]&128&&e<t;);return e}function os(r){return("0"+r.toString(16).toUpperCase()).slice(-2)}function nr(r){return(r<10?"0":"")+r}function cm(r,e){if(!r||!e)return r;const t=e.keyId;return t&&e.isCommonEncryption&&xe(r,["moov","trak"]).forEach(i=>{const o=xe(i,["mdia","minf","stbl","stsd"])[0].subarray(8);let a=xe(o,["enca"]);const l=a.length>0;l||(a=xe(o,["encv"])),a.forEach(A=>{const c=l?A.subarray(28):A.subarray(78);xe(c,["sinf"]).forEach(h=>{const d=Sc(h);if(d){const f=d.subarray(8,24);f.some(g=>g!==0)||(U.log(`[eme] Patching keyId in 'enc${l?"a":"v"}>sinf>>tenc' box: ${rr.hexDump(f)} -> ${rr.hexDump(t)}`),d.set(t,8))}})})}),r}function Sc(r){const e=xe(r,["schm"])[0];if(e){const t=At(e.subarray(4,8));if(t==="cbcs"||t==="cenc")return xe(r,["schi","tenc"])[0]}return U.error("[eme] missing 'schm' box"),null}function um(r,e){return xe(e,["moof","traf"]).reduce((t,n)=>{const i=xe(n,["tfdt"])[0],s=i[0],o=xe(n,["tfhd"]).reduce((a,l)=>{const A=me(l,4),c=r[A];if(c){let u=me(i,4);if(s===1){if(u===ss)return U.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"),a;u*=ss+1,u+=me(i,8)}const h=c.timescale||9e4,d=u/h;if(he(d)&&(a===null||d<a))return d}return a},null);return o!==null&&he(o)&&(t===null||o<t)?o:t},null)}function hm(r,e){let t=0,n=0,i=0;const s=xe(r,["moof","traf"]);for(let o=0;o<s.length;o++){const a=s[o],l=xe(a,["tfhd"])[0],A=me(l,4),c=e[A];if(!c)continue;const u=c.default,h=me(l,0)|(u==null?void 0:u.flags);let d=u==null?void 0:u.duration;h&8&&(h&2?d=me(l,12):d=me(l,8));const f=c.timescale||9e4,g=xe(a,["trun"]);for(let p=0;p<g.length;p++){if(t=dm(g[p]),!t&&d){const C=me(g[p],4);t=d*C}c.type===He.VIDEO?n+=t/f:c.type===He.AUDIO&&(i+=t/f)}}if(n===0&&i===0){let o=1/0,a=0,l=0;const A=xe(r,["sidx"]);for(let c=0;c<A.length;c++){const u=lm(A[c]);if(u!=null&&u.references){o=Math.min(o,u.earliestPresentationTime/u.timescale);const h=u.references.reduce((d,f)=>d+f.info.duration||0,0);a=Math.max(a,h+u.earliestPresentationTime/u.timescale),l=a-o}}if(l&&he(l))return l}return n||i}function dm(r){const e=me(r,0);let t=8;e&1&&(t+=4),e&4&&(t+=4);let n=0;const i=me(r,4);for(let s=0;s<i;s++){if(e&256){const o=me(r,t);n+=o,t+=4}e&512&&(t+=4),e&1024&&(t+=4),e&2048&&(t+=4)}return n}function fm(r,e,t){xe(e,["moof","traf"]).forEach(n=>{xe(n,["tfhd"]).forEach(i=>{const s=me(i,4),o=r[s];if(!o)return;const a=o.timescale||9e4;xe(n,["tfdt"]).forEach(l=>{const A=l[0],c=t*a;if(c){let u=me(l,4);if(A===0)u-=c,u=Math.max(u,0),ea(l,4,u);else{u*=Math.pow(2,32),u+=me(l,8),u-=c,u=Math.max(u,0);const h=Math.floor(u/(ss+1)),d=Math.floor(u%(ss+1));ea(l,4,h),ea(l,8,d)}}})})})}function gm(r){const e={valid:null,remainder:null},t=xe(r,["moof"]);if(t.length<2)return e.remainder=r,e;const n=t[t.length-1];return e.valid=Wr(r,0,n.byteOffset-8),e.remainder=Wr(r,n.byteOffset-8),e}function Ot(r,e){const t=new Uint8Array(r.length+e.length);return t.set(r),t.set(e,r.length),t}function Rc(r,e){const t=[],n=e.samples,i=e.timescale,s=e.id;let o=!1;return xe(n,["moof"]).map(l=>{const A=l.byteOffset-8;xe(l,["traf"]).map(u=>{const h=xe(u,["tfdt"]).map(d=>{const f=d[0];let g=me(d,4);return f===1&&(g*=Math.pow(2,32),g+=me(d,8)),g/i})[0];return h!==void 0&&(r=h),xe(u,["tfhd"]).map(d=>{const f=me(d,4),g=me(d,0)&16777215,p=(g&1)!==0,C=(g&2)!==0,T=(g&8)!==0;let b=0;const y=(g&16)!==0;let x=0;const R=(g&32)!==0;let k=8;f===s&&(p&&(k+=8),C&&(k+=4),T&&(b=me(d,k),k+=4),y&&(x=me(d,k),k+=4),R&&(k+=4),e.type==="video"&&(o=pm(e.codec)),xe(u,["trun"]).map($=>{const V=$[0],O=me($,0)&16777215,J=(O&1)!==0;let ne=0;const ee=(O&4)!==0,le=(O&256)!==0;let D=0;const P=(O&512)!==0;let X=0;const _=(O&1024)!==0,S=(O&2048)!==0;let F=0;const W=me($,4);let Y=8;J&&(ne=me($,Y),Y+=4),ee&&(Y+=4);let re=ne+A;for(let ce=0;ce<W;ce++){if(le?(D=me($,Y),Y+=4):D=b,P?(X=me($,Y),Y+=4):X=x,_&&(Y+=4),S&&(V===0?F=me($,Y):F=xc($,Y),Y+=4),e.type===He.VIDEO){let pe=0;for(;pe<X;){const ge=me(n,re);if(re+=4,mm(o,n[re])){const Se=n.subarray(re,re+ge);Dc(Se,o?2:1,r+F/i,t)}re+=ge,pe+=ge+4}}r+=D/i}}))})})}),t}function pm(r){if(!r)return!1;const e=r.indexOf("."),t=e<0?r:r.substring(0,e);return t==="hvc1"||t==="hev1"||t==="dvh1"||t==="dvhe"}function mm(r,e){if(r){const t=e>>1&63;return t===39||t===40}else return(e&31)===6}function Dc(r,e,t,n){const i=_c(r);let s=0;s+=e;let o=0,a=0,l=0;for(;s<i.length;){o=0;do{if(s>=i.length)break;l=i[s++],o+=l}while(l===255);a=0;do{if(s>=i.length)break;l=i[s++],a+=l}while(l===255);const A=i.length-s;let c=s;if(a<A)s+=a;else if(a>A){U.error(`Malformed SEI payload. ${a} is too small, only ${A} bytes left to parse.`);break}if(o===4){if(i[c++]===181){const h=Tc(i,c);if(c+=2,h===49){const d=me(i,c);if(c+=4,d===1195456820){const f=i[c++];if(f===3){const g=i[c++],p=31&g,C=64&g,T=C?2+p*3:0,b=new Uint8Array(T);if(C){b[0]=g;for(let y=1;y<T;y++)b[y]=i[c++]}n.push({type:f,payloadType:o,pts:t,bytes:b})}}}}}else if(o===5&&a>16){const u=[];for(let f=0;f<16;f++){const g=i[c++].toString(16);u.push(g.length==1?"0"+g:g),(f===3||f===5||f===7||f===9)&&u.push("-")}const h=a-16,d=new Uint8Array(h);for(let f=0;f<h;f++)d[f]=i[c++];n.push({payloadType:o,pts:t,uuid:u.join(""),userData:tr(d),userDataBytes:d})}}}function _c(r){const e=r.byteLength,t=[];let n=1;for(;n<e-2;)r[n]===0&&r[n+1]===0&&r[n+2]===3?(t.push(n+2),n+=2):n++;if(t.length===0)return r;const i=e-t.length,s=new Uint8Array(i);let o=0;for(n=0;n<i;o++,n++)o===t[0]&&(o++,t.shift()),s[n]=r[o];return s}function Em(r){const e=r[0];let t="",n="",i=0,s=0,o=0,a=0,l=0,A=0;if(e===0){for(;At(r.subarray(A,A+1))!=="\0";)t+=At(r.subarray(A,A+1)),A+=1;for(t+=At(r.subarray(A,A+1)),A+=1;At(r.subarray(A,A+1))!=="\0";)n+=At(r.subarray(A,A+1)),A+=1;n+=At(r.subarray(A,A+1)),A+=1,i=me(r,12),s=me(r,16),a=me(r,20),l=me(r,24),A=28}else if(e===1){A+=4,i=me(r,A),A+=4;const u=me(r,A);A+=4;const h=me(r,A);for(A+=4,o=4294967296*u+h,kp(o)||(o=Number.MAX_SAFE_INTEGER,U.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),a=me(r,A),A+=4,l=me(r,A),A+=4;At(r.subarray(A,A+1))!=="\0";)t+=At(r.subarray(A,A+1)),A+=1;for(t+=At(r.subarray(A,A+1)),A+=1;At(r.subarray(A,A+1))!=="\0";)n+=At(r.subarray(A,A+1)),A+=1;n+=At(r.subarray(A,A+1)),A+=1}const c=r.subarray(A,r.byteLength);return{schemeIdUri:t,value:n,timeScale:i,presentationTime:o,presentationTimeDelta:s,eventDuration:a,id:l,payload:c}}function Im(r,...e){const t=e.length;let n=8,i=t;for(;i--;)n+=e[i].byteLength;const s=new Uint8Array(n);for(s[0]=n>>24&255,s[1]=n>>16&255,s[2]=n>>8&255,s[3]=n&255,s.set(r,4),i=0,n=8;i<t;i++)s.set(e[i],n),n+=e[i].byteLength;return s}function Cm(r,e,t){if(r.byteLength!==16)throw new RangeError("Invalid system id");let n,i;if(e){n=1,i=new Uint8Array(e.length*16);for(let a=0;a<e.length;a++){const l=e[a];if(l.byteLength!==16)throw new RangeError("Invalid key");i.set(l,a*16)}}else n=0,i=new Uint8Array;let s;n>0?(s=new Uint8Array(4),e.length>0&&new DataView(s.buffer).setUint32(0,e.length,!1)):s=new Uint8Array;const o=new Uint8Array(4);return t&&t.byteLength>0&&new DataView(o.buffer).setUint32(0,t.byteLength,!1),Im([112,115,115,104],new Uint8Array([n,0,0,0]),r,s,i,o,t||new Uint8Array)}function vm(r){if(!(r instanceof ArrayBuffer)||r.byteLength<32)return null;const e={version:0,systemId:"",kids:null,data:null},t=new DataView(r),n=t.getUint32(0);if(r.byteLength!==n&&n>44||t.getUint32(4)!==1886614376||(e.version=t.getUint32(8)>>>24,e.version>1))return null;e.systemId=rr.hexDump(new Uint8Array(r,12,16));const s=t.getUint32(28);if(e.version===0){if(n-32<s)return null;e.data=new Uint8Array(r,32,s)}else if(e.version===1){e.kids=[];for(let o=0;o<s;o++)e.kids.push(new Uint8Array(r,32+o*16,16))}return e}let as={};class ai{static clearKeyUriToKeyIdMap(){as={}}constructor(e,t,n,i=[1],s=null){this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=e,this.uri=t,this.keyFormat=n,this.keyFormatVersions=i,this.iv=s,this.encrypted=e?e!=="NONE":!1,this.isCommonEncryption=this.encrypted&&e!=="AES-128"}isSupported(){if(this.method){if(this.method==="AES-128"||this.method==="NONE")return!0;if(this.keyFormat==="identity")return this.method==="SAMPLE-AES";switch(this.keyFormat){case Rt.FAIRPLAY:case Rt.WIDEVINE:case Rt.PLAYREADY:case Rt.CLEARKEY:return["ISO-23001-7","SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)!==-1}}return!1}getDecryptData(e){if(!this.encrypted||!this.uri)return null;if(this.method==="AES-128"&&this.uri&&!this.iv){typeof e!="number"&&(this.method==="AES-128"&&!this.iv&&U.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),e=0);const n=ym(e);return new ai(this.method,this.uri,"identity",this.keyFormatVersions,n)}const t=Wp(this.uri);if(t)switch(this.keyFormat){case Rt.WIDEVINE:this.pssh=t,t.length>=22&&(this.keyId=t.subarray(t.length-22,t.length-6));break;case Rt.PLAYREADY:{const n=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=Cm(n,null,t);const i=new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2),s=String.fromCharCode.apply(null,Array.from(i)),o=s.substring(s.indexOf("<"),s.length),A=new DOMParser().parseFromString(o,"text/xml").getElementsByTagName("KID")[0];if(A){const c=A.childNodes[0]?A.childNodes[0].nodeValue:A.getAttribute("VALUE");if(c){const u=Wo(c).subarray(0,16);Jp(u),this.keyId=u}}break}default:{let n=t.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=as[this.uri];if(!n){const i=Object.keys(as).length%Number.MAX_SAFE_INTEGER;n=new Uint8Array(16),new DataView(n.buffer,12,4).setUint32(0,i),as[this.uri]=n}this.keyId=n}return this}}function ym(r){const e=new Uint8Array(16);for(let t=12;t<16;t++)e[t]=r>>8*(15-t)&255;return e}const Lc=/\{\$([a-zA-Z0-9-_]+)\}/g;function Fc(r){return Lc.test(r)}function Dt(r,e,t){if(r.variableList!==null||r.hasVariableRefs)for(let n=t.length;n--;){const i=t[n],s=e[i];s&&(e[i]=ra(r,s))}}function ra(r,e){if(r.variableList!==null||r.hasVariableRefs){const t=r.variableList;return e.replace(Lc,n=>{const i=n.substring(2,n.length-1),s=t==null?void 0:t[i];return s===void 0?(r.playlistParsingError||(r.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${i}"`)),n):s})}return e}function kc(r,e,t){let n=r.variableList;n||(r.variableList=n={});let i,s;if("QUERYPARAM"in e){i=e.QUERYPARAM;try{const o=new self.URL(t).searchParams;if(o.has(i))s=o.get(i);else throw new Error(`"${i}" does not match any query parameter in URI: "${t}"`)}catch(o){r.playlistParsingError||(r.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${o.message}`))}}else i=e.NAME,s=e.VALUE;i in n?r.playlistParsingError||(r.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${i}"`)):n[i]=s||""}function Bm(r,e,t){const n=e.IMPORT;if(t&&n in t){let i=r.variableList;i||(r.variableList=i={}),i[n]=t[n]}else r.playlistParsingError||(r.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${n}"`))}function qr(r=!0){return typeof self>"u"?void 0:(r||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function Qm(r){return typeof self<"u"&&r===self.ManagedMediaSource}const ls={audio:{a3ds:1,"ac-3":.95,"ac-4":1,alac:.9,alaw:1,dra1:1,"dts+":1,"dts-":1,dtsc:1,dtse:1,dtsh:1,"ec-3":.9,enca:1,fLaC:.9,flac:.9,FLAC:.9,g719:1,g726:1,m4ae:1,mha1:1,mha2:1,mhm1:1,mhm2:1,mlpa:1,mp4a:1,"raw ":1,Opus:1,opus:1,samr:1,sawb:1,sawp:1,sevc:1,sqcp:1,ssmv:1,twos:1,ulaw:1},video:{avc1:1,avc2:1,avc3:1,avc4:1,avcp:1,av01:.8,drac:1,dva1:1,dvav:1,dvh1:.7,dvhe:.7,encv:1,hev1:.75,hvc1:.75,mjp2:1,mp4v:1,mvc1:1,mvc2:1,mvc3:1,mvc4:1,resv:1,rv60:1,s263:1,svc1:1,svc2:1,"vc-1":1,vp08:1,vp09:.9},text:{stpp:1,wvtt:1}};function Tm(r,e){const t=ls[e];return!!t&&!!t[r.slice(0,4)]}function na(r,e,t=!0){return!r.split(",").some(n=>!Nc(n,e,t))}function Nc(r,e,t=!0){var n;const i=qr(t);return(n=i==null?void 0:i.isTypeSupported(li(r,e)))!=null?n:!1}function li(r,e){return`${e}/mp4;codecs="${r}"`}function Mc(r){if(r){const e=r.substring(0,4);return ls.video[e]}return 2}function As(r){return r.split(",").reduce((e,t)=>{const n=ls.video[t];return n?(n*2+e)/(e?3:2):(ls.audio[t]+e)/(e?2:1)},0)}const ia={};function bm(r,e=!0){if(ia[r])return ia[r];const t={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"]}[r];for(let n=0;n<t.length;n++)if(Nc(t[n],"audio",e))return ia[r]=t[n],t[n];return r}const xm=/flac|opus/i;function cs(r,e=!0){return r.replace(xm,t=>bm(t.toLowerCase(),e))}function Pc(r,e){return r&&r!=="mp4a"?r:e&&e.split(",")[0]}function wm(r){const e=r.split(".");if(e.length>2){let t=e.shift()+".";return t+=parseInt(e.shift()).toString(16),t+=("000"+parseInt(e.shift()).toString(16)).slice(-4),t}return r}const Oc=/#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,Uc=/#EXT-X-MEDIA:(.*)/g,Sm=/^#EXT(?:INF|-X-TARGETDURATION):/m,Gc=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),Rm=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|INDEPENDENT-SEGMENTS)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|"));class ir{static findGroup(e,t){for(let n=0;n<e.length;n++){const i=e[n];if(i.id===t)return i}}static resolve(e,t){return Vo.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}static isMediaPlaylist(e){return Sm.test(e)}static parseMasterPlaylist(e,t){const n=Fc(e),i={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:n},s=[];Oc.lastIndex=0;let o;for(;(o=Oc.exec(e))!=null;)if(o[1]){var a;const A=new je(o[1]);Dt(i,A,["CODECS","SUPPLEMENTAL-CODECS","ALLOWED-CPC","PATHWAY-ID","STABLE-VARIANT-ID","AUDIO","VIDEO","SUBTITLES","CLOSED-CAPTIONS","NAME"]);const c=ra(i,o[2]),u={attrs:A,bitrate:A.decimalInteger("BANDWIDTH")||A.decimalInteger("AVERAGE-BANDWIDTH"),name:A.NAME,url:ir.resolve(c,t)},h=A.decimalResolution("RESOLUTION");h&&(u.width=h.width,u.height=h.height),Dm(A.CODECS,u),(a=u.unknownCodecs)!=null&&a.length||s.push(u),i.levels.push(u)}else if(o[3]){const A=o[3],c=o[4];switch(A){case"SESSION-DATA":{const u=new je(c);Dt(i,u,["DATA-ID","LANGUAGE","VALUE","URI"]);const h=u["DATA-ID"];h&&(i.sessionData===null&&(i.sessionData={}),i.sessionData[h]=u);break}case"SESSION-KEY":{const u=Hc(c,t,i);u.encrypted&&u.isSupported()?(i.sessionKeys===null&&(i.sessionKeys=[]),i.sessionKeys.push(u)):U.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${c}"`);break}case"DEFINE":{{const u=new je(c);Dt(i,u,["NAME","VALUE","QUERYPARAM"]),kc(i,u,t)}break}case"CONTENT-STEERING":{const u=new je(c);Dt(i,u,["SERVER-URI","PATHWAY-ID"]),i.contentSteering={uri:ir.resolve(u["SERVER-URI"],t),pathwayId:u["PATHWAY-ID"]||"."};break}case"START":{i.startTimeOffset=$c(c);break}}}const l=s.length>0&&s.length<i.levels.length;return i.levels=l?s:i.levels,i.levels.length===0&&(i.playlistParsingError=new Error("no levels found in manifest")),i}static parseMasterPlaylistMedia(e,t,n){let i;const s={},o=n.levels,a={AUDIO:o.map(A=>({id:A.attrs.AUDIO,audioCodec:A.audioCodec})),SUBTITLES:o.map(A=>({id:A.attrs.SUBTITLES,textCodec:A.textCodec})),"CLOSED-CAPTIONS":[]};let l=0;for(Uc.lastIndex=0;(i=Uc.exec(e))!==null;){const A=new je(i[1]),c=A.TYPE;if(c){const u=a[c],h=s[c]||[];s[c]=h,Dt(n,A,["URI","GROUP-ID","LANGUAGE","ASSOC-LANGUAGE","STABLE-RENDITION-ID","NAME","INSTREAM-ID","CHARACTERISTICS","CHANNELS"]);const d=A.LANGUAGE,f=A["ASSOC-LANGUAGE"],g=A.CHANNELS,p=A.CHARACTERISTICS,C=A["INSTREAM-ID"],T={attrs:A,bitrate:0,id:l++,groupId:A["GROUP-ID"]||"",name:A.NAME||d||"",type:c,default:A.bool("DEFAULT"),autoselect:A.bool("AUTOSELECT"),forced:A.bool("FORCED"),lang:d,url:A.URI?ir.resolve(A.URI,t):""};if(f&&(T.assocLang=f),g&&(T.channels=g),p&&(T.characteristics=p),C&&(T.instreamId=C),u!=null&&u.length){const b=ir.findGroup(u,T.groupId)||u[0];Yc(T,b,"audioCodec"),Yc(T,b,"textCodec")}h.push(T)}}return s}static parseLevelPlaylist(e,t,n,i,s,o){const a=new Vp(t),l=a.fragments;let A=null,c=0,u=0,h=0,d=0,f=null,g=new Jo(i,t),p,C,T,b=-1,y=!1,x=null;for(Gc.lastIndex=0,a.m3u8=e,a.hasVariableRefs=Fc(e);(p=Gc.exec(e))!==null;){y&&(y=!1,g=new Jo(i,t),g.start=h,g.sn=c,g.cc=d,g.level=n,A&&(g.initSegment=A,g.rawProgramDateTime=A.rawProgramDateTime,A.rawProgramDateTime=null,x&&(g.setByteRange(x),x=null)));const V=p[1];if(V){g.duration=parseFloat(V);const O=(" "+p[2]).slice(1);g.title=O||null,g.tagList.push(O?["INF",V,O]:["INF",V])}else if(p[3]){if(he(g.duration)){g.start=h,T&&Jc(g,T,a),g.sn=c,g.level=n,g.cc=d,l.push(g);const O=(" "+p[3]).slice(1);g.relurl=ra(a,O),Vc(g,f),f=g,h+=g.duration,c++,u=0,y=!0}}else if(p[4]){const O=(" "+p[4]).slice(1);f?g.setByteRange(O,f):g.setByteRange(O)}else if(p[5])g.rawProgramDateTime=(" "+p[5]).slice(1),g.tagList.push(["PROGRAM-DATE-TIME",g.rawProgramDateTime]),b===-1&&(b=l.length);else{if(p=p[0].match(Rm),!p){U.warn("No matches on slow regex match for level playlist!");continue}for(C=1;C<p.length&&!(typeof p[C]<"u");C++);const O=(" "+p[C]).slice(1),J=(" "+p[C+1]).slice(1),ne=p[C+2]?(" "+p[C+2]).slice(1):"";switch(O){case"PLAYLIST-TYPE":a.type=J.toUpperCase();break;case"MEDIA-SEQUENCE":c=a.startSN=parseInt(J);break;case"SKIP":{const ee=new je(J);Dt(a,ee,["RECENTLY-REMOVED-DATERANGES"]);const le=ee.decimalInteger("SKIPPED-SEGMENTS");if(he(le)){a.skippedSegments=le;for(let P=le;P--;)l.unshift(null);c+=le}const D=ee.enumeratedString("RECENTLY-REMOVED-DATERANGES");D&&(a.recentlyRemovedDateranges=D.split(" "));break}case"TARGETDURATION":a.targetduration=Math.max(parseInt(J),1);break;case"VERSION":a.version=parseInt(J);break;case"INDEPENDENT-SEGMENTS":case"EXTM3U":break;case"ENDLIST":a.live=!1;break;case"#":(J||ne)&&g.tagList.push(ne?[J,ne]:[J]);break;case"DISCONTINUITY":d++,g.tagList.push(["DIS"]);break;case"GAP":g.gap=!0,g.tagList.push([O]);break;case"BITRATE":g.tagList.push([O,J]);break;case"DATERANGE":{const ee=new je(J);Dt(a,ee,["ID","CLASS","START-DATE","END-DATE","SCTE35-CMD","SCTE35-OUT","SCTE35-IN"]),Dt(a,ee,ee.clientAttrs);const le=new gc(ee,a.dateRanges[ee.ID]);le.isValid||a.skippedSegments?a.dateRanges[le.id]=le:U.warn(`Ignoring invalid DATERANGE tag: "${J}"`),g.tagList.push(["EXT-X-DATERANGE",J]);break}case"DEFINE":{{const ee=new je(J);Dt(a,ee,["NAME","VALUE","IMPORT","QUERYPARAM"]),"IMPORT"in ee?Bm(a,ee,o):kc(a,ee,t)}break}case"DISCONTINUITY-SEQUENCE":d=parseInt(J);break;case"KEY":{const ee=Hc(J,t,a);if(ee.isSupported()){if(ee.method==="NONE"){T=void 0;break}T||(T={}),T[ee.keyFormat]&&(T=st({},T)),T[ee.keyFormat]=ee}else U.warn(`[Keys] Ignoring invalid EXT-X-KEY tag: "${J}"`);break}case"START":a.startTimeOffset=$c(J);break;case"MAP":{const ee=new je(J);if(Dt(a,ee,["BYTERANGE","URI"]),g.duration){const le=new Jo(i,t);Kc(le,ee,n,T),A=le,g.initSegment=A,A.rawProgramDateTime&&!g.rawProgramDateTime&&(g.rawProgramDateTime=A.rawProgramDateTime)}else{const le=g.byteRangeEndOffset;if(le){const D=g.byteRangeStartOffset;x=`${le-D}@${D}`}else x=null;Kc(g,ee,n,T),A=g,y=!0}break}case"SERVER-CONTROL":{const ee=new je(J);a.canBlockReload=ee.bool("CAN-BLOCK-RELOAD"),a.canSkipUntil=ee.optionalFloat("CAN-SKIP-UNTIL",0),a.canSkipDateRanges=a.canSkipUntil>0&&ee.bool("CAN-SKIP-DATERANGES"),a.partHoldBack=ee.optionalFloat("PART-HOLD-BACK",0),a.holdBack=ee.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{const ee=new je(J);a.partTarget=ee.decimalFloatingPoint("PART-TARGET");break}case"PART":{let ee=a.partList;ee||(ee=a.partList=[]);const le=u>0?ee[ee.length-1]:void 0,D=u++,P=new je(J);Dt(a,P,["BYTERANGE","URI"]);const X=new $p(P,g,t,D,le);ee.push(X),g.duration+=X.duration;break}case"PRELOAD-HINT":{const ee=new je(J);Dt(a,ee,["URI"]),a.preloadHint=ee;break}case"RENDITION-REPORT":{const ee=new je(J);Dt(a,ee,["URI"]),a.renditionReports=a.renditionReports||[],a.renditionReports.push(ee);break}default:U.warn(`line parsed but not handled: ${p}`);break}}}f&&!f.relurl?(l.pop(),h-=f.duration,a.partList&&(a.fragmentHint=f)):a.partList&&(Vc(g,f),g.cc=d,a.fragmentHint=g,T&&Jc(g,T,a));const R=l.length,k=l[0],$=l[R-1];if(h+=a.skippedSegments*a.targetduration,h>0&&R&&$){a.averagetargetduration=h/R;const V=$.sn;a.endSN=V!=="initSegment"?V:0,a.live||($.endList=!0),k&&(a.startCC=k.cc)}else a.endSN=0,a.startCC=0;return a.fragmentHint&&(h+=a.fragmentHint.duration),a.totalduration=h,a.endCC=d,b>0&&_m(l,b),a}}function Hc(r,e,t){var n,i;const s=new je(r);Dt(t,s,["KEYFORMAT","KEYFORMATVERSIONS","URI","IV","URI"]);const o=(n=s.METHOD)!=null?n:"",a=s.URI,l=s.hexadecimalInteger("IV"),A=s.KEYFORMATVERSIONS,c=(i=s.KEYFORMAT)!=null?i:"identity";a&&s.IV&&!l&&U.error(`Invalid IV: ${s.IV}`);const u=a?ir.resolve(a,e):"",h=(A||"1").split("/").map(Number).filter(Number.isFinite);return new ai(o,u,c,h,l)}function $c(r){const t=new je(r).decimalFloatingPoint("TIME-OFFSET");return he(t)?t:null}function Dm(r,e){let t=(r||"").split(/[ ,]+/).filter(n=>n);["video","audio","text"].forEach(n=>{const i=t.filter(s=>Tm(s,n));i.length&&(e[`${n}Codec`]=i.join(","),t=t.filter(s=>i.indexOf(s)===-1))}),e.unknownCodecs=t}function Yc(r,e,t){const n=e[t];n&&(r[t]=n)}function _m(r,e){let t=r[e];for(let n=e;n--;){const i=r[n];if(!i)return;i.programDateTime=t.programDateTime-i.duration*1e3,t=i}}function Vc(r,e){r.rawProgramDateTime?r.programDateTime=Date.parse(r.rawProgramDateTime):e!=null&&e.programDateTime&&(r.programDateTime=e.endProgramDateTime),he(r.programDateTime)||(r.programDateTime=null,r.rawProgramDateTime=null)}function Kc(r,e,t,n){r.relurl=e.URI,e.BYTERANGE&&r.setByteRange(e.BYTERANGE),r.level=t,r.sn="initSegment",n&&(r.levelkeys=n),r.initSegment=null}function Jc(r,e,t){r.levelkeys=e;const{encryptedFragments:n}=t;(!n.length||n[n.length-1].levelkeys!==e)&&Object.keys(e).some(i=>e[i].isCommonEncryption)&&n.push(r)}var Oe={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},Ee={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};function Wc(r){const{type:e}=r;switch(e){case Oe.AUDIO_TRACK:return Ee.AUDIO;case Oe.SUBTITLE_TRACK:return Ee.SUBTITLE;default:return Ee.MAIN}}function sa(r,e){let t=r.url;return(t===void 0||t.indexOf("data:")===0)&&(t=e.url),t}class Lm{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(I.MANIFEST_LOADING,this.onManifestLoading,this),e.on(I.LEVEL_LOADING,this.onLevelLoading,this),e.on(I.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(I.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}unregisterListeners(){const{hls:e}=this;e.off(I.MANIFEST_LOADING,this.onManifestLoading,this),e.off(I.LEVEL_LOADING,this.onLevelLoading,this),e.off(I.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(I.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}createInternalLoader(e){const t=this.hls.config,n=t.pLoader,i=t.loader,s=n||i,o=new s(t);return this.loaders[e.type]=o,o}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(const e in this.loaders){const t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,t){const{url:n}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:Oe.MANIFEST,url:n,deliveryDirectives:null})}onLevelLoading(e,t){const{id:n,level:i,pathwayId:s,url:o,deliveryDirectives:a}=t;this.load({id:n,level:i,pathwayId:s,responseType:"text",type:Oe.LEVEL,url:o,deliveryDirectives:a})}onAudioTrackLoading(e,t){const{id:n,groupId:i,url:s,deliveryDirectives:o}=t;this.load({id:n,groupId:i,level:null,responseType:"text",type:Oe.AUDIO_TRACK,url:s,deliveryDirectives:o})}onSubtitleTrackLoading(e,t){const{id:n,groupId:i,url:s,deliveryDirectives:o}=t;this.load({id:n,groupId:i,level:null,responseType:"text",type:Oe.SUBTITLE_TRACK,url:s,deliveryDirectives:o})}load(e){var t;const n=this.hls.config;let i=this.getInternalLoader(e);if(i){const A=i.context;if(A&&A.url===e.url&&A.level===e.level){U.trace("[playlist-loader]: playlist request ongoing");return}U.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),i.abort()}let s;if(e.type===Oe.MANIFEST?s=n.manifestLoadPolicy.default:s=st({},n.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),i=this.createInternalLoader(e),he((t=e.deliveryDirectives)==null?void 0:t.part)){let A;if(e.type===Oe.LEVEL&&e.level!==null?A=this.hls.levels[e.level].details:e.type===Oe.AUDIO_TRACK&&e.id!==null?A=this.hls.audioTracks[e.id].details:e.type===Oe.SUBTITLE_TRACK&&e.id!==null&&(A=this.hls.subtitleTracks[e.id].details),A){const c=A.partTarget,u=A.targetduration;if(c&&u){const h=Math.max(c*3,u*.8)*1e3;s=st({},s,{maxTimeToFirstByteMs:Math.min(h,s.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(h,s.maxTimeToFirstByteMs)})}}}const o=s.errorRetry||s.timeoutRetry||{},a={loadPolicy:s,timeout:s.maxLoadTimeMs,maxRetry:o.maxNumRetry||0,retryDelay:o.retryDelayMs||0,maxRetryDelay:o.maxRetryDelayMs||0},l={onSuccess:(A,c,u,h)=>{const d=this.getInternalLoader(u);this.resetInternalLoader(u.type);const f=A.data;if(f.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(A,u,new Error("no EXTM3U delimiter"),h||null,c);return}c.parsing.start=performance.now(),ir.isMediaPlaylist(f)?this.handleTrackOrLevelPlaylist(A,c,u,h||null,d):this.handleMasterPlaylist(A,c,u,h)},onError:(A,c,u,h)=>{this.handleNetworkError(c,u,!1,A,h)},onTimeout:(A,c,u)=>{this.handleNetworkError(c,u,!0,void 0,A)}};i.load(e,a,l)}handleMasterPlaylist(e,t,n,i){const s=this.hls,o=e.data,a=sa(e,n),l=ir.parseMasterPlaylist(o,a);if(l.playlistParsingError){this.handleManifestParsingError(e,n,l.playlistParsingError,i,t);return}const{contentSteering:A,levels:c,sessionData:u,sessionKeys:h,startTimeOffset:d,variableList:f}=l;this.variableList=f;const{AUDIO:g=[],SUBTITLES:p,"CLOSED-CAPTIONS":C}=ir.parseMasterPlaylistMedia(o,a,l);g.length&&!g.some(b=>!b.url)&&c[0].audioCodec&&!c[0].attrs.AUDIO&&(U.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),g.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new je({}),bitrate:0,url:""})),s.trigger(I.MANIFEST_LOADED,{levels:c,audioTracks:g,subtitles:p,captions:C,contentSteering:A,url:a,stats:t,networkDetails:i,sessionData:u,sessionKeys:h,startTimeOffset:d,variableList:f})}handleTrackOrLevelPlaylist(e,t,n,i,s){const o=this.hls,{id:a,level:l,type:A}=n,c=sa(e,n),u=0,h=he(l)?l:he(a)?a:0,d=Wc(n),f=ir.parseLevelPlaylist(e.data,c,h,d,u,this.variableList);if(A===Oe.MANIFEST){const g={attrs:new je({}),bitrate:0,details:f,name:"",url:c};o.trigger(I.MANIFEST_LOADED,{levels:[g],audioTracks:[],url:c,stats:t,networkDetails:i,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),n.levelDetails=f,this.handlePlaylistLoaded(f,e,t,n,i,s)}handleManifestParsingError(e,t,n,i,s){this.hls.trigger(I.ERROR,{type:ye.NETWORK_ERROR,details:K.MANIFEST_PARSING_ERROR,fatal:t.type===Oe.MANIFEST,url:e.url,err:n,error:n,reason:n.message,response:e,context:t,networkDetails:i,stats:s})}handleNetworkError(e,t,n=!1,i,s){let o=`A network ${n?"timeout":"error"+(i?" (status "+i.code+")":"")} occurred while loading ${e.type}`;e.type===Oe.LEVEL?o+=`: ${e.level} id: ${e.id}`:(e.type===Oe.AUDIO_TRACK||e.type===Oe.SUBTITLE_TRACK)&&(o+=` id: ${e.id} group-id: "${e.groupId}"`);const a=new Error(o);U.warn(`[playlist-loader]: ${o}`);let l=K.UNKNOWN,A=!1;const c=this.getInternalLoader(e);switch(e.type){case Oe.MANIFEST:l=n?K.MANIFEST_LOAD_TIMEOUT:K.MANIFEST_LOAD_ERROR,A=!0;break;case Oe.LEVEL:l=n?K.LEVEL_LOAD_TIMEOUT:K.LEVEL_LOAD_ERROR,A=!1;break;case Oe.AUDIO_TRACK:l=n?K.AUDIO_TRACK_LOAD_TIMEOUT:K.AUDIO_TRACK_LOAD_ERROR,A=!1;break;case Oe.SUBTITLE_TRACK:l=n?K.SUBTITLE_TRACK_LOAD_TIMEOUT:K.SUBTITLE_LOAD_ERROR,A=!1;break}c&&this.resetInternalLoader(e.type);const u={type:ye.NETWORK_ERROR,details:l,fatal:A,url:e.url,loader:c,context:e,error:a,networkDetails:t,stats:s};if(i){const h=(t==null?void 0:t.url)||e.url;u.response=ut({url:h,data:void 0},i)}this.hls.trigger(I.ERROR,u)}handlePlaylistLoaded(e,t,n,i,s,o){const a=this.hls,{type:l,level:A,id:c,groupId:u,deliveryDirectives:h}=i,d=sa(t,i),f=Wc(i),g=typeof i.level=="number"&&f===Ee.MAIN?A:void 0;if(!e.fragments.length){const C=new Error("No Segments found in Playlist");a.trigger(I.ERROR,{type:ye.NETWORK_ERROR,details:K.LEVEL_EMPTY_ERROR,fatal:!1,url:d,error:C,reason:C.message,response:t,context:i,level:g,parent:f,networkDetails:s,stats:n});return}e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));const p=e.playlistParsingError;if(p){a.trigger(I.ERROR,{type:ye.NETWORK_ERROR,details:K.LEVEL_PARSING_ERROR,fatal:!1,url:d,error:p,reason:p.message,response:t,context:i,level:g,parent:f,networkDetails:s,stats:n});return}switch(e.live&&o&&(o.getCacheAge&&(e.ageHeader=o.getCacheAge()||0),(!o.getCacheAge||isNaN(e.ageHeader))&&(e.ageHeader=0)),l){case Oe.MANIFEST:case Oe.LEVEL:a.trigger(I.LEVEL_LOADED,{details:e,level:g||0,id:c||0,stats:n,networkDetails:s,deliveryDirectives:h});break;case Oe.AUDIO_TRACK:a.trigger(I.AUDIO_TRACK_LOADED,{details:e,id:c||0,groupId:u||"",stats:n,networkDetails:s,deliveryDirectives:h});break;case Oe.SUBTITLE_TRACK:a.trigger(I.SUBTITLE_TRACK_LOADED,{details:e,id:c||0,groupId:u||"",stats:n,networkDetails:s,deliveryDirectives:h});break}}}function qc(r,e){let t;try{t=new Event("addtrack")}catch{t=document.createEvent("Event"),t.initEvent("addtrack",!1,!1)}t.track=r,e.dispatchEvent(t)}function Xc(r,e){const t=r.mode;if(t==="disabled"&&(r.mode="hidden"),r.cues&&!r.cues.getCueById(e.id))try{if(r.addCue(e),!r.cues.getCueById(e.id))throw new Error(`addCue is failed for: ${e}`)}catch(n){U.debug(`[texttrack-utils]: ${n}`);try{const i=new self.TextTrackCue(e.startTime,e.endTime,e.text);i.id=e.id,r.addCue(i)}catch(i){U.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${i}`)}}t==="disabled"&&(r.mode=t)}function mn(r){const e=r.mode;if(e==="disabled"&&(r.mode="hidden"),r.cues)for(let t=r.cues.length;t--;)r.removeCue(r.cues[t]);e==="disabled"&&(r.mode=e)}function oa(r,e,t,n){const i=r.mode;if(i==="disabled"&&(r.mode="hidden"),r.cues&&r.cues.length>0){const s=km(r.cues,e,t);for(let o=0;o<s.length;o++)(!n||n(s[o]))&&r.removeCue(s[o])}i==="disabled"&&(r.mode=i)}function Fm(r,e){if(e<r[0].startTime)return 0;const t=r.length-1;if(e>r[t].endTime)return-1;let n=0,i=t;for(;n<=i;){const s=Math.floor((i+n)/2);if(e<r[s].startTime)i=s-1;else if(e>r[s].startTime&&n<t)n=s+1;else return s}return r[n].startTime-e<e-r[i].startTime?n:i}function km(r,e,t){const n=[],i=Fm(r,e);if(i>-1)for(let s=i,o=r.length;s<o;s++){const a=r[s];if(a.startTime>=e&&a.endTime<=t)n.push(a);else if(a.startTime>t)return n}return n}function us(r){const e=[];for(let t=0;t<r.length;t++){const n=r[t];(n.kind==="subtitles"||n.kind==="captions")&&n.label&&e.push(r[t])}return e}var Jt={audioId3:"org.id3",dateRange:"com.apple.quicktime.HLS",emsg:"https://aomedia.org/emsg/ID3"};const Nm=.25;function aa(){if(!(typeof self>"u"))return self.VTTCue||self.TextTrackCue}function jc(r,e,t,n,i){let s=new r(e,t,"");try{s.value=n,i&&(s.type=i)}catch{s=new r(e,t,JSON.stringify(i?ut({type:i},n):n))}return s}const hs=(()=>{const r=aa();try{r&&new r(0,Number.POSITIVE_INFINITY,"")}catch{return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function la(r,e){return r.getTime()/1e3-e}function Mm(r){return Uint8Array.from(r.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}class Pm{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(I.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(I.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(I.MANIFEST_LOADING,this.onManifestLoading,this),e.on(I.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(I.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(I.LEVEL_UPDATED,this.onLevelUpdated,this)}_unregisterListeners(){const{hls:e}=this;e.off(I.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(I.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(I.MANIFEST_LOADING,this.onManifestLoading,this),e.off(I.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(I.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(I.LEVEL_UPDATED,this.onLevelUpdated,this)}onMediaAttached(e,t){this.media=t.media}onMediaDetaching(){this.id3Track&&(mn(this.id3Track),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(e){const t=this.getID3Track(e.textTracks);return t.mode="hidden",t}getID3Track(e){if(this.media){for(let t=0;t<e.length;t++){const n=e[t];if(n.kind==="metadata"&&n.label==="id3")return qc(n,this.media),n}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(e,t){if(!this.media)return;const{hls:{config:{enableEmsgMetadataCues:n,enableID3MetadataCues:i}}}=this;if(!n&&!i)return;const{samples:s}=t;this.id3Track||(this.id3Track=this.createTrack(this.media));const o=aa();if(o)for(let a=0;a<s.length;a++){const l=s[a].type;if(l===Jt.emsg&&!n||!i)continue;const A=Bc(s[a].data);if(A){const c=s[a].pts;let u=c+s[a].duration;u>hs&&(u=hs),u-c<=0&&(u=c+Nm);for(let d=0;d<A.length;d++){const f=A[d];if(!yc(f)){this.updateId3CueEnds(c,l);const g=jc(o,c,u,f,l);g&&this.id3Track.addCue(g)}}}}}updateId3CueEnds(e,t){var n;const i=(n=this.id3Track)==null?void 0:n.cues;if(i)for(let s=i.length;s--;){const o=i[s];o.type===t&&o.startTime<e&&o.endTime===hs&&(o.endTime=e)}}onBufferFlushing(e,{startOffset:t,endOffset:n,type:i}){const{id3Track:s,hls:o}=this;if(!o)return;const{config:{enableEmsgMetadataCues:a,enableID3MetadataCues:l}}=o;if(s&&(a||l)){let A;i==="audio"?A=c=>c.type===Jt.audioId3&&l:i==="video"?A=c=>c.type===Jt.emsg&&a:A=c=>c.type===Jt.audioId3&&l||c.type===Jt.emsg&&a,oa(s,t,n,A)}}onLevelUpdated(e,{details:t}){if(!this.media||!t.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)return;const{dateRangeCuesAppended:n,id3Track:i}=this,{dateRanges:s}=t,o=Object.keys(s);if(i){const c=Object.keys(n).filter(u=>!o.includes(u));for(let u=c.length;u--;){const h=c[u];Object.keys(n[h].cues).forEach(d=>{i.removeCue(n[h].cues[d])}),delete n[h]}}const a=t.fragments[t.fragments.length-1];if(o.length===0||!he(a==null?void 0:a.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const l=a.programDateTime/1e3-a.start,A=aa();for(let c=0;c<o.length;c++){const u=o[c],h=s[u],d=la(h.startDate,l),f=n[u],g=(f==null?void 0:f.cues)||{};let p=(f==null?void 0:f.durationKnown)||!1,C=hs;const T=h.endDate;if(T)C=la(T,l),p=!0;else if(h.endOnNext&&!p){const y=o.reduce((x,R)=>{if(R!==h.id){const k=s[R];if(k.class===h.class&&k.startDate>h.startDate&&(!x||h.startDate<x.startDate))return k}return x},null);y&&(C=la(y.startDate,l),p=!0)}const b=Object.keys(h.attr);for(let y=0;y<b.length;y++){const x=b[y];if(!Gp(x))continue;const R=g[x];if(R)p&&!f.durationKnown&&(R.endTime=C);else if(A){let k=h.attr[x];Hp(x)&&(k=Mm(k));const $=jc(A,d,C,{key:x,data:k},Jt.dateRange);$&&($.id=u,this.id3Track.addCue($),g[x]=$)}}n[u]={cues:g,dateRange:h,durationKnown:p}}}}class Om{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=()=>this.timeupdate(),this.hls=e,this.config=e.config,this.registerListeners()}get latency(){return this._latency||0}get maxLatency(){const{config:e,levelDetails:t}=this;return e.liveMaxLatencyDuration!==void 0?e.liveMaxLatencyDuration:t?e.liveMaxLatencyDurationCount*t.targetduration:0}get targetLatency(){const{levelDetails:e}=this;if(e===null)return null;const{holdBack:t,partHoldBack:n,targetduration:i}=e,{liveSyncDuration:s,liveSyncDurationCount:o,lowLatencyMode:a}=this.config,l=this.hls.userConfig;let A=a&&n||t;(l.liveSyncDuration||l.liveSyncDurationCount||A===0)&&(A=s!==void 0?s:o*i);const c=i;return A+Math.min(this.stallCount*1,c)}get liveSyncPosition(){const e=this.estimateLiveEdge(),t=this.targetLatency,n=this.levelDetails;if(e===null||t===null||n===null)return null;const i=n.edge,s=e-t-this.edgeStalled,o=i-n.totalduration,a=i-(this.config.lowLatencyMode&&n.partTarget||n.targetduration);return Math.min(Math.max(o,s),a)}get drift(){const{levelDetails:e}=this;return e===null?1:e.drift}get edgeStalled(){const{levelDetails:e}=this;if(e===null)return 0;const t=(this.config.lowLatencyMode&&e.partTarget||e.targetduration)*3;return Math.max(e.age-t,0)}get forwardBufferLength(){const{media:e,levelDetails:t}=this;if(!e||!t)return 0;const n=e.buffered.length;return(n?e.buffered.end(n-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null}registerListeners(){this.hls.on(I.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(I.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(I.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(I.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(I.ERROR,this.onError,this)}unregisterListeners(){this.hls.off(I.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(I.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.off(I.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(I.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.off(I.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.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:t}){this.levelDetails=t,t.advanced&&this.timeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)}onError(e,t){var n;t.details===K.BUFFER_STALLED_ERROR&&(this.stallCount++,(n=this.levelDetails)!=null&&n.live&&U.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))}timeupdate(){const{media:e,levelDetails:t}=this;if(!e||!t)return;this.currentTime=e.currentTime;const n=this.computeLatency();if(n===null)return;this._latency=n;const{lowLatencyMode:i,maxLiveSyncPlaybackRate:s}=this.config;if(!i||s===1||!t.live)return;const o=this.targetLatency;if(o===null)return;const a=n-o,l=Math.min(this.maxLatency,o+t.targetduration);if(a<l&&a>.05&&this.forwardBufferLength>1){const c=Math.min(2,Math.max(1,s)),u=Math.round(2/(1+Math.exp(-.75*a-this.edgeStalled))*20)/20;e.playbackRate=Math.min(c,Math.max(1,u))}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 Aa=["NONE","TYPE-0","TYPE-1",null];function Um(r){return Aa.indexOf(r)>-1}const ds=["SDR","PQ","HLG"];function Gm(r){return!!r&&ds.indexOf(r)>-1}var fs={No:"",Yes:"YES",v2:"v2"};function zc(r){const{canSkipUntil:e,canSkipDateRanges:t,age:n}=r,i=n<e/2;return e&&i?t?fs.v2:fs.Yes:fs.No}class Zc{constructor(e,t,n){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=e,this.part=t,this.skip=n}addDirectives(e){const t=new self.URL(e);return this.msn!==void 0&&t.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&t.searchParams.set("_HLS_part",this.part.toString()),this.skip&&t.searchParams.set("_HLS_skip",this.skip),t.href}}class En{constructor(e){this._attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.url=void 0,this.frameRate=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.supportedPromise=void 0,this.supportedResult=void 0,this._avgBitrate=0,this._audioGroups=void 0,this._subtitleGroups=void 0,this._urlId=0,this.url=[e.url],this._attrs=[e.attrs],this.bitrate=e.bitrate,e.details&&(this.details=e.details),this.id=e.id||0,this.name=e.name,this.width=e.width||0,this.height=e.height||0,this.frameRate=e.attrs.optionalFloat("FRAME-RATE",0),this._avgBitrate=e.attrs.decimalInteger("AVERAGE-BANDWIDTH"),this.audioCodec=e.audioCodec,this.videoCodec=e.videoCodec,this.codecSet=[e.videoCodec,e.audioCodec].filter(t=>!!t).map(t=>t.substring(0,4)).join(","),this.addGroupId("audio",e.attrs.AUDIO),this.addGroupId("text",e.attrs.SUBTITLES)}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get averageBitrate(){return this._avgBitrate||this.realBitrate||this.bitrate}get attrs(){return this._attrs[0]}get codecs(){return this.attrs.CODECS||""}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get videoRange(){return this.attrs["VIDEO-RANGE"]||"SDR"}get score(){return this.attrs.optionalFloat("SCORE",0)}get uri(){return this.url[0]||""}hasAudioGroup(e){return eu(this._audioGroups,e)}hasSubtitleGroup(e){return eu(this._subtitleGroups,e)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(e,t){if(t){if(e==="audio"){let n=this._audioGroups;n||(n=this._audioGroups=[]),n.indexOf(t)===-1&&n.push(t)}else if(e==="text"){let n=this._subtitleGroups;n||(n=this._subtitleGroups=[]),n.indexOf(t)===-1&&n.push(t)}}}get urlId(){return 0}set urlId(e){}get audioGroupIds(){return this.audioGroups?[this.audioGroupId]:void 0}get textGroupIds(){return this.subtitleGroups?[this.textGroupId]:void 0}get audioGroupId(){var e;return(e=this.audioGroups)==null?void 0:e[0]}get textGroupId(){var e;return(e=this.subtitleGroups)==null?void 0:e[0]}addFallback(){}}function eu(r,e){return!e||!r?!1:r.indexOf(e)!==-1}function ca(r,e){const t=e.startPTS;if(he(t)){let n=0,i;e.sn>r.sn?(n=t-r.start,i=r):(n=r.start-t,i=e),i.duration!==n&&(i.duration=n)}else e.sn>r.sn?r.cc===e.cc&&r.minEndPTS?e.start=r.start+(r.minEndPTS-r.start):e.start=r.start+r.duration:e.start=Math.max(r.start-e.duration,0)}function tu(r,e,t,n,i,s){n-t<=0&&(U.warn("Fragment should have a positive duration",e),n=t+e.duration,s=i+e.duration);let a=t,l=n;const A=e.startPTS,c=e.endPTS;if(he(A)){const p=Math.abs(A-t);he(e.deltaPTS)?e.deltaPTS=Math.max(p,e.deltaPTS):e.deltaPTS=p,a=Math.max(t,A),t=Math.min(t,A),i=Math.min(i,e.startDTS),l=Math.min(n,c),n=Math.max(n,c),s=Math.max(s,e.endDTS)}const u=t-e.start;e.start!==0&&(e.start=t),e.duration=n-e.start,e.startPTS=t,e.maxStartPTS=a,e.startDTS=i,e.endPTS=n,e.minEndPTS=l,e.endDTS=s;const h=e.sn;if(!r||h<r.startSN||h>r.endSN)return 0;let d;const f=h-r.startSN,g=r.fragments;for(g[f]=e,d=f;d>0;d--)ca(g[d],g[d-1]);for(d=f;d<g.length-1;d++)ca(g[d],g[d+1]);return r.fragmentHint&&ca(g[g.length-1],r.fragmentHint),r.PTSKnown=r.alignedSliding=!0,u}function Hm(r,e){let t=null;const n=r.fragments;for(let l=n.length-1;l>=0;l--){const A=n[l].initSegment;if(A){t=A;break}}r.fragmentHint&&delete r.fragmentHint.endPTS;let i=0,s;if(Vm(r,e,(l,A)=>{l.relurl&&(i=l.cc-A.cc),he(l.startPTS)&&he(l.endPTS)&&(A.start=A.startPTS=l.startPTS,A.startDTS=l.startDTS,A.maxStartPTS=l.maxStartPTS,A.endPTS=l.endPTS,A.endDTS=l.endDTS,A.minEndPTS=l.minEndPTS,A.duration=l.endPTS-l.startPTS,A.duration&&(s=A),e.PTSKnown=e.alignedSliding=!0),A.elementaryStreams=l.elementaryStreams,A.loader=l.loader,A.stats=l.stats,l.initSegment&&(A.initSegment=l.initSegment,t=l.initSegment)}),t&&(e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments).forEach(A=>{var c;A&&(!A.initSegment||A.initSegment.relurl===((c=t)==null?void 0:c.relurl))&&(A.initSegment=t)}),e.skippedSegments)if(e.deltaUpdateFailed=e.fragments.some(l=>!l),e.deltaUpdateFailed){U.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let l=e.skippedSegments;l--;)e.fragments.shift();e.startSN=e.fragments[0].sn,e.startCC=e.fragments[0].cc}else e.canSkipDateRanges&&(e.dateRanges=$m(r.dateRanges,e.dateRanges,e.recentlyRemovedDateranges));const o=e.fragments;if(i){U.warn("discontinuity sliding from playlist, take drift into account");for(let l=0;l<o.length;l++)o[l].cc+=i}e.skippedSegments&&(e.startCC=e.fragments[0].cc),Ym(r.partList,e.partList,(l,A)=>{A.elementaryStreams=l.elementaryStreams,A.stats=l.stats}),s?tu(e,s,s.startPTS,s.endPTS,s.startDTS,s.endDTS):ru(r,e),o.length&&(e.totalduration=e.edge-o[0].start),e.driftStartTime=r.driftStartTime,e.driftStart=r.driftStart;const a=e.advancedDateTime;if(e.advanced&&a){const l=e.edge;e.driftStart||(e.driftStartTime=a,e.driftStart=l),e.driftEndTime=a,e.driftEnd=l}else e.driftEndTime=r.driftEndTime,e.driftEnd=r.driftEnd,e.advancedDateTime=r.advancedDateTime}function $m(r,e,t){const n=st({},r);return t&&t.forEach(i=>{delete n[i]}),Object.keys(e).forEach(i=>{const s=new gc(e[i].attr,n[i]);s.isValid?n[i]=s:U.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${JSON.stringify(e[i].attr)}"`)}),n}function Ym(r,e,t){if(r&&e){let n=0;for(let i=0,s=r.length;i<=s;i++){const o=r[i],a=e[i+n];o&&a&&o.index===a.index&&o.fragment.sn===a.fragment.sn?t(o,a):n--}}}function Vm(r,e,t){const n=e.skippedSegments,i=Math.max(r.startSN,e.startSN)-e.startSN,s=(r.fragmentHint?1:0)+(n?e.endSN:Math.min(r.endSN,e.endSN))-e.startSN,o=e.startSN-r.startSN,a=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,l=r.fragmentHint?r.fragments.concat(r.fragmentHint):r.fragments;for(let A=i;A<=s;A++){const c=l[o+A];let u=a[A];n&&!u&&A<n&&(u=e.fragments[A]=c),c&&u&&t(c,u)}}function ru(r,e){const t=e.startSN+e.skippedSegments-r.startSN,n=r.fragments;t<0||t>=n.length||ua(e,n[t].start)}function ua(r,e){if(e){const t=r.fragments;for(let n=r.skippedSegments;n<t.length;n++)t[n].start+=e;r.fragmentHint&&(r.fragmentHint.start+=e)}}function Km(r,e=1/0){let t=1e3*r.targetduration;if(r.updated){const n=r.fragments;if(n.length&&t*4>e){const s=n[n.length-1].duration*1e3;s<t&&(t=s)}}else t/=2;return Math.round(t)}function Jm(r,e,t){if(!(r!=null&&r.details))return null;const n=r.details;let i=n.fragments[e-n.startSN];return i||(i=n.fragmentHint,i&&i.sn===e)?i:e<n.startSN&&t&&t.sn===e?t:null}function nu(r,e,t){var n;return r!=null&&r.details?iu((n=r.details)==null?void 0:n.partList,e,t):null}function iu(r,e,t){if(r)for(let n=r.length;n--;){const i=r[n];if(i.index===t&&i.fragment.sn===e)return i}return null}function su(r){r.forEach((e,t)=>{const{details:n}=e;n!=null&&n.fragments&&n.fragments.forEach(i=>{i.level=t})})}function gs(r){switch(r.details){case K.FRAG_LOAD_TIMEOUT:case K.KEY_LOAD_TIMEOUT:case K.LEVEL_LOAD_TIMEOUT:case K.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function ou(r,e){const t=gs(e);return r.default[`${t?"timeout":"error"}Retry`]}function ha(r,e){const t=r.backoff==="linear"?1:Math.pow(2,e);return Math.min(t*r.retryDelayMs,r.maxRetryDelayMs)}function au(r){return ut(ut({},r),{errorRetry:null,timeoutRetry:null})}function ps(r,e,t,n){if(!r)return!1;const i=n==null?void 0:n.code,s=e<r.maxNumRetry&&(Wm(i)||!!t);return r.shouldRetry?r.shouldRetry(r,e,t,n,s):s}function Wm(r){return r===0&&navigator.onLine===!1||!!r&&(r<400||r>499)}const lu={search:function(r,e){let t=0,n=r.length-1,i=null,s=null;for(;t<=n;){i=(t+n)/2|0,s=r[i];const o=e(s);if(o>0)t=i+1;else if(o<0)n=i-1;else return s}return null}};function qm(r,e,t){if(e===null||!Array.isArray(r)||!r.length||!he(e))return null;const n=r[0].programDateTime;if(e<(n||0))return null;const i=r[r.length-1].endProgramDateTime;if(e>=(i||0))return null;t=t||0;for(let s=0;s<r.length;++s){const o=r[s];if(jm(e,t,o))return o}return null}function ms(r,e,t=0,n=0,i=.005){let s=null;if(r){s=e[r.sn-e[0].sn+1]||null;const a=r.endDTS-t;a>0&&a<15e-7&&(t+=15e-7)}else t===0&&e[0].start===0&&(s=e[0]);if(s&&((!r||r.level===s.level)&&da(t,n,s)===0||Xm(s,r,Math.min(i,n))))return s;const o=lu.search(e,da.bind(null,t,n));return o&&(o!==r||!s)?o:s}function Xm(r,e,t){if(e&&e.start===0&&e.level<r.level&&(e.endPTS||0)>0){const n=e.tagList.reduce((i,s)=>(s[0]==="INF"&&(i+=parseFloat(s[1])),i),t);return r.start<=n}return!1}function da(r=0,e=0,t){if(t.start<=r&&t.start+t.duration>r)return 0;const n=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0));return t.start+t.duration-n<=r?1:t.start-n>r&&t.start?-1:0}function jm(r,e,t){const n=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0))*1e3;return(t.endProgramDateTime||0)-n>r}function zm(r,e){return lu.search(r,t=>t.cc<e?1:t.cc>e?-1:0)}var It={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},Wt={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,SwitchToSDR:4};class Zm{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=U.log.bind(U,"[info]:"),this.warn=U.warn.bind(U,"[warning]:"),this.error=U.error.bind(U,"[error]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(I.ERROR,this.onError,this),e.on(I.MANIFEST_LOADING,this.onManifestLoading,this),e.on(I.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(I.ERROR,this.onError,this),e.off(I.ERROR,this.onErrorOut,this),e.off(I.MANIFEST_LOADING,this.onManifestLoading,this),e.off(I.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null,this.penalizedRenditions={}}startLoad(e){}stopLoad(){this.playlistError=0}getVariantLevelIndex(e){return(e==null?void 0:e.type)===Ee.MAIN?e.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onLevelUpdated(){this.playlistError=0}onError(e,t){var n,i;if(t.fatal)return;const s=this.hls,o=t.context;switch(t.details){case K.FRAG_LOAD_ERROR:case K.FRAG_LOAD_TIMEOUT:case K.KEY_LOAD_ERROR:case K.KEY_LOAD_TIMEOUT:t.errorAction=this.getFragRetryOrSwitchAction(t);return;case K.FRAG_PARSING_ERROR:if((n=t.frag)!=null&&n.gap){t.errorAction={action:It.DoNothing,flags:Wt.None};return}case K.FRAG_GAP:case K.FRAG_DECRYPT_ERROR:{t.errorAction=this.getFragRetryOrSwitchAction(t),t.errorAction.action=It.SendAlternateToPenaltyBox;return}case K.LEVEL_EMPTY_ERROR:case K.LEVEL_PARSING_ERROR:{var a,l;const A=t.parent===Ee.MAIN?t.level:s.loadLevel;t.details===K.LEVEL_EMPTY_ERROR&&((a=t.context)!=null&&(l=a.levelDetails)!=null&&l.live)?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,A):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,A))}return;case K.LEVEL_LOAD_ERROR:case K.LEVEL_LOAD_TIMEOUT:typeof(o==null?void 0:o.level)=="number"&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,o.level));return;case K.AUDIO_TRACK_LOAD_ERROR:case K.AUDIO_TRACK_LOAD_TIMEOUT:case K.SUBTITLE_LOAD_ERROR:case K.SUBTITLE_TRACK_LOAD_TIMEOUT:if(o){const A=s.levels[s.loadLevel];if(A&&(o.type===Oe.AUDIO_TRACK&&A.hasAudioGroup(o.groupId)||o.type===Oe.SUBTITLE_TRACK&&A.hasSubtitleGroup(o.groupId))){t.errorAction=this.getPlaylistRetryOrSwitchAction(t,s.loadLevel),t.errorAction.action=It.SendAlternateToPenaltyBox,t.errorAction.flags=Wt.MoveAllAlternatesMatchingHost;return}}return;case K.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const A=s.levels[s.loadLevel],c=A==null?void 0:A.attrs["HDCP-LEVEL"];c?t.errorAction={action:It.SendAlternateToPenaltyBox,flags:Wt.MoveAllAlternatesMatchingHDCP,hdcpLevel:c}:this.keySystemError(t)}return;case K.BUFFER_ADD_CODEC_ERROR:case K.REMUX_ALLOC_ERROR:case K.BUFFER_APPEND_ERROR:t.errorAction=this.getLevelSwitchAction(t,(i=t.level)!=null?i:s.loadLevel);return;case K.INTERNAL_EXCEPTION:case K.BUFFER_APPENDING_ERROR:case K.BUFFER_FULL_ERROR:case K.LEVEL_SWITCH_ERROR:case K.BUFFER_STALLED_ERROR:case K.BUFFER_SEEK_OVER_HOLE:case K.BUFFER_NUDGE_ON_STALL:t.errorAction={action:It.DoNothing,flags:Wt.None};return}t.type===ye.KEY_SYSTEM_ERROR&&this.keySystemError(t)}keySystemError(e){const t=this.getVariantLevelIndex(e.frag);e.levelRetry=!1,e.errorAction=this.getLevelSwitchAction(e,t)}getPlaylistRetryOrSwitchAction(e,t){const n=this.hls,i=ou(n.config.playlistLoadPolicy,e),s=this.playlistError++;if(ps(i,s,gs(e),e.response))return{action:It.RetryRequest,flags:Wt.None,retryConfig:i,retryCount:s};const a=this.getLevelSwitchAction(e,t);return i&&(a.retryConfig=i,a.retryCount=s),a}getFragRetryOrSwitchAction(e){const t=this.hls,n=this.getVariantLevelIndex(e.frag),i=t.levels[n],{fragLoadPolicy:s,keyLoadPolicy:o}=t.config,a=ou(e.details.startsWith("key")?o:s,e),l=t.levels.reduce((c,u)=>c+u.fragmentError,0);if(i&&(e.details!==K.FRAG_GAP&&i.fragmentError++,ps(a,l,gs(e),e.response)))return{action:It.RetryRequest,flags:Wt.None,retryConfig:a,retryCount:l};const A=this.getLevelSwitchAction(e,n);return a&&(A.retryConfig=a,A.retryCount=l),A}getLevelSwitchAction(e,t){const n=this.hls;t==null&&(t=n.loadLevel);const i=this.hls.levels[t];if(i){var s,o;const A=e.details;i.loadError++,A===K.BUFFER_APPEND_ERROR&&i.fragmentError++;let c=-1;const{levels:u,loadLevel:h,minAutoLevel:d,maxAutoLevel:f}=n;n.autoLevelEnabled||(n.loadLevel=-1);const g=(s=e.frag)==null?void 0:s.type,C=(g===Ee.AUDIO&&A===K.FRAG_PARSING_ERROR||e.sourceBufferName==="audio"&&(A===K.BUFFER_ADD_CODEC_ERROR||A===K.BUFFER_APPEND_ERROR))&&u.some(({audioCodec:R})=>i.audioCodec!==R),b=e.sourceBufferName==="video"&&(A===K.BUFFER_ADD_CODEC_ERROR||A===K.BUFFER_APPEND_ERROR)&&u.some(({codecSet:R,audioCodec:k})=>i.codecSet!==R&&i.audioCodec===k),{type:y,groupId:x}=(o=e.context)!=null?o:{};for(let R=u.length;R--;){const k=(R+h)%u.length;if(k!==h&&k>=d&&k<=f&&u[k].loadError===0){var a,l;const $=u[k];if(A===K.FRAG_GAP&&g===Ee.MAIN&&e.frag){const V=u[k].details;if(V){const O=ms(e.frag,V.fragments,e.frag.start);if(O!=null&&O.gap)continue}}else{if(y===Oe.AUDIO_TRACK&&$.hasAudioGroup(x)||y===Oe.SUBTITLE_TRACK&&$.hasSubtitleGroup(x))continue;if(g===Ee.AUDIO&&(a=i.audioGroups)!=null&&a.some(V=>$.hasAudioGroup(V))||g===Ee.SUBTITLE&&(l=i.subtitleGroups)!=null&&l.some(V=>$.hasSubtitleGroup(V))||C&&i.audioCodec===$.audioCodec||!C&&i.audioCodec!==$.audioCodec||b&&i.codecSet===$.codecSet)continue}c=k;break}}if(c>-1&&n.loadLevel!==c)return e.levelRetry=!0,this.playlistError=0,{action:It.SendAlternateToPenaltyBox,flags:Wt.None,nextAutoLevel:c}}return{action:It.SendAlternateToPenaltyBox,flags:Wt.MoveAllAlternatesMatchingHost}}onErrorOut(e,t){var n;switch((n=t.errorAction)==null?void 0:n.action){case It.DoNothing:break;case It.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(t),!t.errorAction.resolved&&t.details!==K.FRAG_GAP?t.fatal=!0:/MediaSource readyState: ended/.test(t.error.message)&&(this.warn(`MediaSource ended after "${t.sourceBufferName}" sourceBuffer append error. Attempting to recover from media error.`),this.hls.recoverMediaError());break}if(t.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(e){const t=this.hls,n=e.errorAction;if(!n)return;const{flags:i,hdcpLevel:s,nextAutoLevel:o}=n;switch(i){case Wt.None:this.switchLevel(e,o);break;case Wt.MoveAllAlternatesMatchingHDCP:s&&(t.maxHdcpLevel=Aa[Aa.indexOf(s)-1],n.resolved=!0),this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}n.resolved||this.switchLevel(e,o)}switchLevel(e,t){t!==void 0&&e.errorAction&&(this.warn(`switching to level ${t} after ${e.details}`),this.hls.nextAutoLevel=t,e.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel)}}class fa{constructor(e,t){this.hls=void 0,this.timer=-1,this.requestScheduled=-1,this.canLoad=!1,this.log=void 0,this.warn=void 0,this.log=U.log.bind(U,`${t}:`),this.warn=U.warn.bind(U,`${t}:`),this.hls=e}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){this.timer!==-1&&(self.clearTimeout(this.timer),this.timer=-1)}startLoad(){this.canLoad=!0,this.requestScheduled=-1,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(e,t,n){const i=t==null?void 0:t.renditionReports;if(i){let s=-1;for(let o=0;o<i.length;o++){const a=i[o];let l;try{l=new self.URL(a.URI,t.url).href}catch(A){U.warn(`Could not construct new URL for Rendition Report: ${A}`),l=a.URI||""}if(l===e){s=o;break}else l===e.substring(0,l.length)&&(s=o)}if(s!==-1){const o=i[s],a=parseInt(o["LAST-MSN"])||(t==null?void 0:t.lastPartSn);let l=parseInt(o["LAST-PART"])||(t==null?void 0:t.lastPartIndex);if(this.hls.config.lowLatencyMode){const c=Math.min(t.age-t.partTarget,t.targetduration);l>=0&&c>t.partTarget&&(l+=1)}const A=n&&zc(n);return new Zc(a,l>=0?l:void 0,A)}}}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,t,n){const{details:i,stats:s}=t,o=self.performance.now(),a=s.loading.first?Math.max(0,o-s.loading.first):0;if(i.advancedDateTime=Date.now()-a,i.live||n!=null&&n.live){if(i.reloaded(n),n&&this.log(`live playlist ${e} ${i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:i.updated?"UPDATED":"MISSED"}`),n&&i.fragments.length>0&&Hm(n,i),!this.canLoad||!i.live)return;let l,A,c;if(i.canBlockReload&&i.endSN&&i.advanced){const p=this.hls.config.lowLatencyMode,C=i.lastPartSn,T=i.endSN,b=i.lastPartIndex,y=b!==-1,x=C===T,R=p?0:b;y?(A=x?T+1:C,c=x?R:b+1):A=T+1;const k=i.age,$=k+i.ageHeader;let V=Math.min($-i.partTarget,i.targetduration*1.5);if(V>0){if(n&&V>n.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${n.tuneInGoal} to: ${V} with playlist age: ${i.age}`),V=0;else{const O=Math.floor(V/i.targetduration);if(A+=O,c!==void 0){const J=Math.round(V%i.targetduration/i.partTarget);c+=J}this.log(`CDN Tune-in age: ${i.ageHeader}s last advanced ${k.toFixed(2)}s goal: ${V} skip sn ${O} to part ${c}`)}i.tuneInGoal=V}if(l=this.getDeliveryDirectives(i,t.deliveryDirectives,A,c),p||!x){this.loadPlaylist(l);return}}else(i.canBlockReload||i.canSkipUntil)&&(l=this.getDeliveryDirectives(i,t.deliveryDirectives,A,c));const u=this.hls.mainForwardBufferInfo,h=u?u.end-u.len:0,d=(i.edge-h)*1e3,f=Km(i,d);i.updated&&o>this.requestScheduled+f&&(this.requestScheduled=s.loading.start),A!==void 0&&i.canBlockReload?this.requestScheduled=s.loading.first+f-(i.partTarget*1e3||1e3):this.requestScheduled===-1||this.requestScheduled+f<o?this.requestScheduled=o:this.requestScheduled-o<=0&&(this.requestScheduled+=f);let g=this.requestScheduled-o;g=Math.max(0,g),this.log(`reload live playlist ${e} in ${Math.round(g)} ms`),this.timer=self.setTimeout(()=>this.loadPlaylist(l),g)}else this.clearTimer()}getDeliveryDirectives(e,t,n,i){let s=zc(e);return t!=null&&t.skip&&e.deltaUpdateFailed&&(n=t.msn,i=t.part,s=fs.No),new Zc(n,i,s)}checkRetry(e){const t=e.details,n=gs(e),i=e.errorAction,{action:s,retryCount:o=0,retryConfig:a}=i||{},l=!!i&&!!a&&(s===It.RetryRequest||!i.resolved&&s===It.SendAlternateToPenaltyBox);if(l){var A;if(this.requestScheduled=-1,o>=a.maxNumRetry)return!1;if(n&&(A=e.context)!=null&&A.deliveryDirectives)this.warn(`Retrying playlist loading ${o+1}/${a.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const c=ha(a,o);this.timer=self.setTimeout(()=>this.loadPlaylist(),c),this.warn(`Retrying playlist loading ${o+1}/${a.maxNumRetry} after "${t}" in ${c}ms`)}e.levelRetry=!0,i.resolved=!0}return l}}class In{constructor(e,t=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_=t,this.totalWeight_=n}sample(e,t){const n=Math.pow(this.alpha_,e);this.estimate_=t*(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 eE{constructor(e,t,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 In(e),this.fast_=new In(t),this.defaultTTFB_=i,this.ttfb_=new In(e)}update(e,t){const{slow_:n,fast_:i,ttfb_:s}=this;n.halfLife!==e&&(this.slow_=new In(e,n.getEstimate(),n.getTotalWeight())),i.halfLife!==t&&(this.fast_=new In(t,i.getEstimate(),i.getTotalWeight())),s.halfLife!==e&&(this.ttfb_=new In(e,s.getEstimate(),s.getTotalWeight()))}sample(e,t){e=Math.max(e,this.minDelayMs_);const n=8*t,i=e/1e3,s=n/i;this.fast_.sample(i,s),this.slow_.sample(i,s)}sampleTTFB(e){const t=e/1e3,n=Math.sqrt(2)*Math.exp(-Math.pow(t,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(){}}const Au={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]},cu={};function tE(r,e,t,n,i,s){const o=r.audioCodec?r.audioGroups:null,a=s==null?void 0:s.audioCodec,l=s==null?void 0:s.channels,A=l?parseInt(l):a?1/0:2;let c=null;if(o!=null&&o.length)try{o.length===1&&o[0]?c=e.groups[o[0]].channels:c=o.reduce((u,h)=>{if(h){const d=e.groups[h];if(!d)throw new Error(`Audio track group ${h} not found`);Object.keys(d.channels).forEach(f=>{u[f]=(u[f]||0)+d.channels[f]})}return u},{2:0})}catch{return!0}return r.videoCodec!==void 0&&(r.width>1920&&r.height>1088||r.height>1920&&r.width>1088||r.frameRate>Math.max(n,30)||r.videoRange!=="SDR"&&r.videoRange!==t||r.bitrate>Math.max(i,8e6))||!!c&&he(A)&&Object.keys(c).some(u=>parseInt(u)>A)}function rE(r,e,t){const n=r.videoCodec,i=r.audioCodec;if(!n||!i||!t)return Promise.resolve(Au);const s={width:r.width,height:r.height,bitrate:Math.ceil(Math.max(r.bitrate*.9,r.averageBitrate)),framerate:r.frameRate||30},o=r.videoRange;o!=="SDR"&&(s.transferFunction=o.toLowerCase());const a=n.split(",").map(l=>({type:"media-source",video:ut(ut({},s),{},{contentType:li(l,"video")})}));return i&&r.audioGroups&&r.audioGroups.forEach(l=>{var A;l&&((A=e.groups[l])==null||A.tracks.forEach(c=>{if(c.groupId===l){const u=c.channels||"",h=parseFloat(u);he(h)&&h>2&&a.push.apply(a,i.split(",").map(d=>({type:"media-source",audio:{contentType:li(d,"audio"),channels:""+h}})))}}))}),Promise.all(a.map(l=>{const A=nE(l);return cu[A]||(cu[A]=t.decodingInfo(l))})).then(l=>({supported:!l.some(A=>!A.supported),configurations:a,decodingInfoResults:l})).catch(l=>({supported:!1,configurations:a,decodingInfoResults:[],error:l}))}function nE(r){const{audio:e,video:t}=r,n=t||e;if(n){const i=n.contentType.split('"')[1];if(t)return`r${t.height}x${t.width}f${Math.ceil(t.framerate)}${t.transferFunction||"sd"}_${i}_${Math.ceil(t.bitrate/1e5)}`;if(e)return`c${e.channels}${e.spatialRendering?"s":"n"}_${i}`}return""}function iE(){if(typeof matchMedia=="function"){const r=matchMedia("(dynamic-range: high)"),e=matchMedia("bad query");if(r.media!==e.media)return r.matches===!0}return!1}function sE(r,e){let t=!1,n=[];return r&&(t=r!=="SDR",n=[r]),e&&(n=e.allowedVideoRanges||ds.slice(0),t=e.preferHDR!==void 0?e.preferHDR:iE(),t?n=n.filter(i=>i!=="SDR"):n=["SDR"]),{preferHDR:t,allowedVideoRanges:n}}function oE(r,e,t,n,i){const s=Object.keys(r),o=n==null?void 0:n.channels,a=n==null?void 0:n.audioCodec,l=o&&parseInt(o)===2;let A=!0,c=!1,u=1/0,h=1/0,d=1/0,f=0,g=[];const{preferHDR:p,allowedVideoRanges:C}=sE(e,i);for(let x=s.length;x--;){const R=r[s[x]];A=R.channels[2]>0,u=Math.min(u,R.minHeight),h=Math.min(h,R.minFramerate),d=Math.min(d,R.minBitrate);const k=C.filter($=>R.videoRanges[$]>0);k.length>0&&(c=!0,g=k)}u=he(u)?u:0,h=he(h)?h:0;const T=Math.max(1080,u),b=Math.max(30,h);return d=he(d)?d:t,t=Math.max(d,t),c||(e=void 0,g=[]),{codecSet:s.reduce((x,R)=>{const k=r[R];if(R===x)return x;if(k.minBitrate>t)return Er(R,`min bitrate of ${k.minBitrate} > current estimate of ${t}`),x;if(!k.hasDefaultAudio)return Er(R,"no renditions with default or auto-select sound found"),x;if(a&&R.indexOf(a.substring(0,4))%5!==0)return Er(R,`audio codec preference "${a}" not found`),x;if(o&&!l){if(!k.channels[o])return Er(R,`no renditions with ${o} channel sound found (channels options: ${Object.keys(k.channels)})`),x}else if((!a||l)&&A&&k.channels[2]===0)return Er(R,"no renditions with stereo sound found"),x;return k.minHeight>T?(Er(R,`min resolution of ${k.minHeight} > maximum of ${T}`),x):k.minFramerate>b?(Er(R,`min framerate of ${k.minFramerate} > maximum of ${b}`),x):g.some($=>k.videoRanges[$]>0)?k.maxScore<f?(Er(R,`max score of ${k.maxScore} < selected max of ${f}`),x):x&&(As(R)>=As(x)||k.fragmentError>r[x].fragmentError)?x:(f=k.maxScore,R):(Er(R,`no variants with VIDEO-RANGE of ${JSON.stringify(g)} found`),x)},void 0),videoRanges:g,preferHDR:p,minFramerate:h,minBitrate:d}}function Er(r,e){U.log(`[abr] start candidates with "${r}" ignored because ${e}`)}function aE(r){return r.reduce((e,t)=>{let n=e.groups[t.groupId];n||(n=e.groups[t.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),n.tracks.push(t);const i=t.channels||"2";return n.channels[i]=(n.channels[i]||0)+1,n.hasDefault=n.hasDefault||t.default,n.hasAutoSelect=n.hasAutoSelect||t.autoselect,n.hasDefault&&(e.hasDefaultAudio=!0),n.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function lE(r,e,t,n){return r.slice(t,n+1).reduce((i,s)=>{if(!s.codecSet)return i;const o=s.audioGroups;let a=i[s.codecSet];a||(i[s.codecSet]=a={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!o,fragmentError:0}),a.minBitrate=Math.min(a.minBitrate,s.bitrate);const l=Math.min(s.height,s.width);return a.minHeight=Math.min(a.minHeight,l),a.minFramerate=Math.min(a.minFramerate,s.frameRate),a.maxScore=Math.max(a.maxScore,s.score),a.fragmentError+=s.fragmentError,a.videoRanges[s.videoRange]=(a.videoRanges[s.videoRange]||0)+1,o&&o.forEach(A=>{if(!A)return;const c=e.groups[A];c&&(a.hasDefaultAudio=a.hasDefaultAudio||e.hasDefaultAudio?c.hasDefault:c.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(c.channels).forEach(u=>{a.channels[u]=(a.channels[u]||0)+c.channels[u]}))}),i},{})}function sr(r,e,t){if("attrs"in r){const n=e.indexOf(r);if(n!==-1)return n}for(let n=0;n<e.length;n++){const i=e[n];if(Cn(r,i,t))return n}return-1}function Cn(r,e,t){const{groupId:n,name:i,lang:s,assocLang:o,characteristics:a,default:l}=r,A=r.forced;return(n===void 0||e.groupId===n)&&(i===void 0||e.name===i)&&(s===void 0||e.lang===s)&&(s===void 0||e.assocLang===o)&&(l===void 0||e.default===l)&&(A===void 0||e.forced===A)&&(a===void 0||AE(a,e.characteristics))&&(t===void 0||t(r,e))}function AE(r,e=""){const t=r.split(","),n=e.split(",");return t.length===n.length&&!t.some(i=>n.indexOf(i)===-1)}function vn(r,e){const{audioCodec:t,channels:n}=r;return(t===void 0||(e.audioCodec||"").substring(0,4)===t.substring(0,4))&&(n===void 0||n===(e.channels||"2"))}function cE(r,e,t,n,i){const s=e[n],a=e.reduce((h,d,f)=>{const g=d.uri;return(h[g]||(h[g]=[])).push(f),h},{})[s.uri];a.length>1&&(n=Math.max.apply(Math,a));const l=s.videoRange,A=s.frameRate,c=s.codecSet.substring(0,4),u=uu(e,n,h=>{if(h.videoRange!==l||h.frameRate!==A||h.codecSet.substring(0,4)!==c)return!1;const d=h.audioGroups,f=t.filter(g=>!d||d.indexOf(g.groupId)!==-1);return sr(r,f,i)>-1});return u>-1?u:uu(e,n,h=>{const d=h.audioGroups,f=t.filter(g=>!d||d.indexOf(g.groupId)!==-1);return sr(r,f,i)>-1})}function uu(r,e,t){for(let n=e;n;n--)if(t(r[n]))return n;for(let n=e+1;n<r.length;n++)if(t(r[n]))return n;return-1}class uE{constructor(e){this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey="",this.audioTracksByGroup=null,this.codecTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this._abandonRulesCheck=()=>{const{fragCurrent:t,partCurrent:n,hls:i}=this,{autoLevelEnabled:s,media:o}=i;if(!t||!o)return;const a=performance.now(),l=n?n.stats:t.stats,A=n?n.duration:t.duration,c=a-l.loading.start,u=i.minAutoLevel;if(l.aborted||l.loaded&&l.loaded===l.total||t.level<=u){this.clearTimer(),this._nextAutoLevel=-1;return}if(!s||o.paused||!o.playbackRate||!o.readyState)return;const h=i.mainForwardBufferInfo;if(h===null)return;const d=this.bwEstimator.getEstimateTTFB(),f=Math.abs(o.playbackRate);if(c<=Math.max(d,1e3*(A/(f*2))))return;const g=h.len/f,p=l.loading.first?l.loading.first-l.loading.start:-1,C=l.loaded&&p>-1,T=this.getBwEstimate(),b=i.levels,y=b[t.level],x=l.total||Math.max(l.loaded,Math.round(A*y.averageBitrate/8));let R=C?c-p:c;R<1&&C&&(R=Math.min(c,l.loaded*8/T));const k=C?l.loaded*1e3/R:0,$=k?(x-l.loaded)/k:x*8/T+d/1e3;if($<=g)return;const V=k?k*8:T;let O=Number.POSITIVE_INFINITY,J;for(J=t.level-1;J>u;J--){const ee=b[J].maxBitrate;if(O=this.getTimeToLoadFrag(d/1e3,V,A*ee,!b[J].details),O<g)break}if(O>=$||O>A*10)return;i.nextLoadLevel=i.nextAutoLevel=J,C?this.bwEstimator.sample(c-Math.min(d,p),l.loaded):this.bwEstimator.sampleTTFB(c);const ne=b[J].maxBitrate;this.getBwEstimate()*this.hls.config.abrBandWidthUpFactor>ne&&this.resetEstimator(ne),this.clearTimer(),U.warn(`[abr] Fragment ${t.sn}${n?" part "+n.index:""} of level ${t.level} is loading too slowly;
|
2464
2464
|
Time to underbuffer: ${g.toFixed(3)} s
|
2465
2465
|
Estimated load time for current fragment: ${$.toFixed(3)} s
|
2466
2466
|
Estimated load time for down switch fragment: ${O.toFixed(3)} s
|
2467
2467
|
TTFB estimate: ${p|0} ms
|
2468
2468
|
Current BW estimate: ${he(T)?T|0:"Unknown"} bps
|
2469
2469
|
New BW estimate: ${this.getBwEstimate()|0} bps
|
2470
|
-
Switching to level ${K} @ ${ne|0} bps`),i.trigger(I.FRAG_LOAD_EMERGENCY_ABORTED,{frag:t,part:n,stats:A})},this.hls=e,this.bwEstimator=this.initEstimator(),this.registerListeners()}resetEstimator(e){e&&(U.log(`setting initial bwe to ${e}`),this.hls.config.abrEwmaDefaultEstimate=e),this.firstSelection=-1,this.bwEstimator=this.initEstimator()}initEstimator(){const e=this.hls.config;return new eE(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}registerListeners(){const{hls:e}=this;e.on(I.MANIFEST_LOADING,this.onManifestLoading,this),e.on(I.FRAG_LOADING,this.onFragLoading,this),e.on(I.FRAG_LOADED,this.onFragLoaded,this),e.on(I.FRAG_BUFFERED,this.onFragBuffered,this),e.on(I.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(I.LEVEL_LOADED,this.onLevelLoaded,this),e.on(I.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(I.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(I.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e&&(e.off(I.MANIFEST_LOADING,this.onManifestLoading,this),e.off(I.FRAG_LOADING,this.onFragLoading,this),e.off(I.FRAG_LOADED,this.onFragLoaded,this),e.off(I.FRAG_BUFFERED,this.onFragBuffered,this),e.off(I.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(I.LEVEL_LOADED,this.onLevelLoaded,this),e.off(I.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(I.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(I.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(e,t){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}onLevelsUpdated(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}onMaxAutoLevelUpdated(){this.firstSelection=-1,this.nextAutoLevelKey=""}onFragLoading(e,t){const n=t.frag;if(!this.ignoreFragment(n)){if(!n.bitrateTest){var i;this.fragCurrent=n,this.partCurrent=(i=t.part)!=null?i:null}this.clearTimer(),this.timer=self.setInterval(this._abandonRulesCheck,100)}}onLevelSwitching(e,t){this.clearTimer()}onError(e,t){if(!t.fatal)switch(t.details){case V.BUFFER_ADD_CODEC_ERROR:case V.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case V.FRAG_LOAD_TIMEOUT:{const n=t.frag,{fragCurrent:i,partCurrent:s}=this;if(n&&i&&n.sn===i.sn&&n.level===i.level){const o=performance.now(),a=s?s.stats:n.stats,A=o-a.loading.start,l=a.loading.first?a.loading.first-a.loading.start:-1;if(a.loaded&&l>-1){const u=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(A-Math.min(u,l),a.loaded)}else this.bwEstimator.sampleTTFB(A)}break}}}getTimeToLoadFrag(e,t,n,i){const s=e+n/t,o=i?this.lastLevelLoadSec:0;return s+o}onLevelLoaded(e,t){const n=this.hls.config,{loading:i}=t.stats,s=i.end-i.start;he(s)&&(this.lastLevelLoadSec=s/1e3),t.details.live?this.bwEstimator.update(n.abrEwmaSlowLive,n.abrEwmaFastLive):this.bwEstimator.update(n.abrEwmaSlowVoD,n.abrEwmaFastVoD)}onFragLoaded(e,{frag:t,part:n}){const i=n?n.stats:t.stats;if(t.type===Ee.MAIN&&this.bwEstimator.sampleTTFB(i.loading.first-i.loading.start),!this.ignoreFragment(t)){if(this.clearTimer(),t.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const s=n?n.duration:t.duration,o=this.hls.levels[t.level],a=(o.loaded?o.loaded.bytes:0)+i.loaded,A=(o.loaded?o.loaded.duration:0)+s;o.loaded={bytes:a,duration:A},o.realBitrate=Math.round(8*a/A)}if(t.bitrateTest){const s={stats:i,frag:t,part:n,id:t.type};this.onFragBuffered(I.FRAG_BUFFERED,s),t.bitrateTest=!1}else this.lastLoadedFragLevel=t.level}}onFragBuffered(e,t){const{frag:n,part:i}=t,s=i!=null&&i.stats.loaded?i.stats:n.stats;if(s.aborted||this.ignoreFragment(n))return;const o=s.parsing.end-s.loading.start-Math.min(s.loading.first-s.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(o,s.loaded),s.bwEstimate=this.getBwEstimate(),n.bitrateTest?this.bitrateTestDelay=o/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==Ee.MAIN||e.sn==="initSegment"}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:e,minAutoLevel:t}=this.hls,n=this.getBwEstimate(),i=this.hls.config.maxStarvationDelay,s=this.findBestLevel(n,t,e,0,i,1,1);if(s>-1)return s;const o=this.hls.firstLevel,a=Math.min(Math.max(o,t),e);return U.warn(`[abr] Could not find best starting auto level. Defaulting to first in playlist ${o} clamped to ${a}`),a}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const e=this.forcedAutoLevel,n=this.bwEstimator.canEstimate(),i=this.lastLoadedFragLevel>-1;if(e!==-1&&(!n||!i||this.nextAutoLevelKey===this.getAutoLevelKey()))return e;const s=n&&i?this.getNextABRAutoLevel():this.firstAutoLevel;if(e!==-1){const o=this.hls.levels;if(o.length>Math.max(e,s)&&o[e].loadError<=o[s].loadError)return e}return this._nextAutoLevel=s,this.nextAutoLevelKey=this.getAutoLevelKey(),s}getAutoLevelKey(){return`${this.getBwEstimate()}_${this.getStarvationDelay().toFixed(2)}`}getNextABRAutoLevel(){const{fragCurrent:e,partCurrent:t,hls:n}=this,{maxAutoLevel:i,config:s,minAutoLevel:o}=n,a=t?t.duration:e?e.duration:0,A=this.getBwEstimate(),l=this.getStarvationDelay();let c=s.abrBandWidthFactor,u=s.abrBandWidthUpFactor;if(l){const p=this.findBestLevel(A,o,i,l,0,c,u);if(p>=0)return p}let h=a?Math.min(a,s.maxStarvationDelay):s.maxStarvationDelay;if(!l){const p=this.bitrateTestDelay;p&&(h=(a?Math.min(a,s.maxLoadingDelay):s.maxLoadingDelay)-p,U.info(`[abr] bitrate test took ${Math.round(1e3*p)}ms, set first fragment max fetchDuration to ${Math.round(1e3*h)} ms`),c=u=1)}const d=this.findBestLevel(A,o,i,l,h,c,u);if(U.info(`[abr] ${l?"rebuffering expected":"buffer is empty"}, optimal quality level ${d}`),d>-1)return d;const f=n.levels[o],g=n.levels[n.loadLevel];return(f==null?void 0:f.bitrate)<(g==null?void 0:g.bitrate)?o:n.loadLevel}getStarvationDelay(){const e=this.hls,t=e.media;if(!t)return 1/0;const n=t&&t.playbackRate!==0?Math.abs(t.playbackRate):1,i=e.mainForwardBufferInfo;return(i?i.len:0)/n}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(e,t,n,i,s,o,a){var A;const l=i+s,c=this.lastLoadedFragLevel,u=c===-1?this.hls.firstLevel:c,{fragCurrent:h,partCurrent:d}=this,{levels:f,allAudioTracks:g,loadLevel:p,config:v}=this.hls;if(f.length===1)return 0;const T=f[u],b=!!(T!=null&&(A=T.details)!=null&&A.live),y=p===-1||c===-1;let w,R="SDR",k=(T==null?void 0:T.frameRate)||0;const{audioPreference:$,videoPreference:W}=v,O=this.audioTracksByGroup||(this.audioTracksByGroup=aE(g));if(y){if(this.firstSelection!==-1)return this.firstSelection;const _=this.codecTiers||(this.codecTiers=AE(f,O,t,n)),P=oE(_,R,e,$,W),{codecSet:X,videoRanges:D,minFramerate:S,minBitrate:F,preferHDR:J}=P;w=X,R=J?D[D.length-1]:D[0],k=S,e=Math.max(e,F),U.log(`[abr] picked start tier ${JSON.stringify(P)}`)}else w=T==null?void 0:T.codecSet,R=T==null?void 0:T.videoRange;const K=d?d.duration:h?h.duration:0,ne=this.bwEstimator.getEstimateTTFB()/1e3,ee=[];for(let _=n;_>=t;_--){var Ae;const P=f[_],X=_>u;if(!P)continue;if(v.useMediaCapabilities&&!P.supportedResult&&!P.supportedPromise){const ce=navigator.mediaCapabilities;typeof(ce==null?void 0:ce.decodingInfo)=="function"&&tE(P,O,R,k,e,$)?(P.supportedPromise=rE(P,O,ce),P.supportedPromise.then(pe=>{if(!this.hls)return;P.supportedResult=pe;const ge=this.hls.levels,Se=ge.indexOf(P);pe.error?U.warn(`[abr] MediaCapabilities decodingInfo error: "${pe.error}" for level ${Se} ${JSON.stringify(pe)}`):pe.supported||(U.warn(`[abr] Unsupported MediaCapabilities decodingInfo result for level ${Se} ${JSON.stringify(pe)}`),Se>-1&&ge.length>1&&(U.log(`[abr] Removing unsupported level ${Se}`),this.hls.removeLevel(Se)))})):P.supportedResult=lu}if(w&&P.codecSet!==w||R&&P.videoRange!==R||X&&k>P.frameRate||!X&&k>0&&k<P.frameRate||P.supportedResult&&!((Ae=P.supportedResult.decodingInfoResults)!=null&&Ae[0].smooth)){ee.push(_);continue}const D=P.details,S=(d?D==null?void 0:D.partTarget:D==null?void 0:D.averagetargetduration)||K;let F;X?F=a*e:F=o*e;const J=K&&i>=K*2&&s===0?f[_].averageBitrate:f[_].maxBitrate,Y=this.getTimeToLoadFrag(ne,F,J*S,D===void 0);if(F>=J&&(_===c||P.loadError===0&&P.fragmentError===0)&&(Y<=ne||!he(Y)||b&&!this.bitrateTestDelay||Y<l)){const ce=this.forcedAutoLevel;return _!==p&&(ce===-1||ce!==p)&&(ee.length&&U.trace(`[abr] Skipped level(s) ${ee.join(",")} of ${n} max with CODECS and VIDEO-RANGE:"${f[ee[0]].codecs}" ${f[ee[0]].videoRange}; not compatible with "${T.codecs}" ${R}`),U.info(`[abr] switch candidate:${u}->${_} adjustedbw(${Math.round(F)})-bitrate=${Math.round(F-J)} ttfb:${ne.toFixed(1)} avgDuration:${S.toFixed(1)} maxFetchDuration:${l.toFixed(1)} fetchDuration:${Y.toFixed(1)} firstSelection:${y} codecSet:${w} videoRange:${R} hls.loadLevel:${p}`)),y&&(this.firstSelection=_),_}}return-1}set nextAutoLevel(e){const{maxAutoLevel:t,minAutoLevel:n}=this.hls,i=Math.min(Math.max(e,n),t);this._nextAutoLevel!==i&&(this.nextAutoLevelKey="",this._nextAutoLevel=i)}}class hE{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(){}}var ht={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class dE{constructor(e){this.activePartLists=Object.create(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(I.BUFFER_APPENDED,this.onBufferAppended,this),e.on(I.FRAG_BUFFERED,this.onFragBuffered,this),e.on(I.FRAG_LOADED,this.onFragLoaded,this)}_unregisterListeners(){const{hls:e}=this;e.off(I.BUFFER_APPENDED,this.onBufferAppended,this),e.off(I.FRAG_BUFFERED,this.onFragBuffered,this),e.off(I.FRAG_LOADED,this.onFragLoaded,this)}destroy(){this._unregisterListeners(),this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(e,t){const n=this.activePartLists[t];if(n)for(let i=n.length;i--;){const s=n[i];if(!s)break;const o=s.end;if(s.start<=e&&o!==null&&e<=o)return s}return this.getBufferedFrag(e,t)}getBufferedFrag(e,t){const{fragments:n}=this,i=Object.keys(n);for(let s=i.length;s--;){const o=n[i[s]];if((o==null?void 0:o.body.type)===t&&o.buffered){const a=o.body;if(a.start<=e&&e<=a.end)return a}}return null}detectEvictedFragments(e,t,n,i){this.timeRanges&&(this.timeRanges[e]=t);const s=(i==null?void 0:i.fragment.sn)||-1;Object.keys(this.fragments).forEach(o=>{const a=this.fragments[o];if(!a||s>=a.body.sn)return;if(!a.buffered&&!a.loaded){a.body.type===n&&this.removeFragment(a.body);return}const A=a.range[e];A&&A.time.some(l=>{const c=!this.isTimeBuffered(l.startPTS,l.endPTS,t);return c&&this.removeFragment(a.body),c})})}detectPartialFragments(e){const t=this.timeRanges,{frag:n,part:i}=e;if(!t||n.sn==="initSegment")return;const s=yn(n),o=this.fragments[s];if(!o||o.buffered&&n.gap)return;const a=!n.relurl;Object.keys(t).forEach(A=>{const l=n.elementaryStreams[A];if(!l)return;const c=t[A],u=a||l.partial===!0;o.range[A]=this.getBufferedTimes(n,i,u,c)}),o.loaded=null,Object.keys(o.range).length?(o.buffered=!0,(o.body.endList=n.endList||o.body.endList)&&(this.endListFragments[o.body.type]=o),Es(o)||this.removeParts(n.sn-1,n.type)):this.removeFragment(o.body)}removeParts(e,t){const n=this.activePartLists[t];n&&(this.activePartLists[t]=n.filter(i=>i.fragment.sn>=e))}fragBuffered(e,t){const n=yn(e);let i=this.fragments[n];!i&&t&&(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,t,n,i){const s={time:[],partial:n},o=e.start,a=e.end,A=e.minEndPTS||a,l=e.maxStartPTS||o;for(let c=0;c<i.length;c++){const u=i.start(c)-this.bufferPadding,h=i.end(c)+this.bufferPadding;if(l>=u&&A<=h){s.time.push({startPTS:Math.max(o,i.start(c)),endPTS:Math.min(a,i.end(c))});break}else if(o<h&&a>u){const d=Math.max(o,i.start(c)),f=Math.min(a,i.end(c));f>d&&(s.partial=!0,s.time.push({startPTS:d,endPTS:f}))}else if(a<=u)break}return s}getPartialFragment(e){let t=null,n,i,s,o=0;const{bufferPadding:a,fragments:A}=this;return Object.keys(A).forEach(l=>{const c=A[l];c&&Es(c)&&(i=c.body.start-a,s=c.body.end+a,e>=i&&e<=s&&(n=Math.min(e-i,s-e),o<=n&&(t=c.body,o=n)))}),t}isEndListAppended(e){const t=this.endListFragments[e];return t!==void 0&&(t.buffered||Es(t))}getState(e){const t=yn(e),n=this.fragments[t];return n?n.buffered?Es(n)?ht.PARTIAL:ht.OK:ht.APPENDING:ht.NOT_LOADED}isTimeBuffered(e,t,n){let i,s;for(let o=0;o<n.length;o++){if(i=n.start(o)-this.bufferPadding,s=n.end(o)+this.bufferPadding,e>=i&&t<=s)return!0;if(t<=i)return!1}return!1}onFragLoaded(e,t){const{frag:n,part:i}=t;if(n.sn==="initSegment"||n.bitrateTest)return;const s=i?null:t,o=yn(n);this.fragments[o]={body:n,appendedPTS:null,loaded:s,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:n,part:i,timeRanges:s}=t;if(n.sn==="initSegment")return;const o=n.type;if(i){let a=this.activePartLists[o];a||(this.activePartLists[o]=a=[]),a.push(i)}this.timeRanges=s,Object.keys(s).forEach(a=>{const A=s[a];this.detectEvictedFragments(a,A,o,i)})}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=yn(e);return!!this.fragments[t]}hasParts(e){var t;return!!((t=this.activePartLists[e])!=null&&t.length)}removeFragmentsInRange(e,t,n,i,s){i&&!this.hasGaps||Object.keys(this.fragments).forEach(o=>{const a=this.fragments[o];if(!a)return;const A=a.body;A.type!==n||i&&!A.gap||A.start<t&&A.end>e&&(a.buffered||s)&&this.removeFragment(A)})}removeFragment(e){const t=yn(e);e.stats.loaded=0,e.clearElementaryStreamInfo();const n=this.activePartLists[e.type];if(n){const i=e.sn;this.activePartLists[e.type]=n.filter(s=>s.fragment.sn!==i)}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1}}function Es(r){var e,t,n;return r.buffered&&(r.body.gap||((e=r.range.video)==null?void 0:e.partial)||((t=r.range.audio)==null?void 0:t.partial)||((n=r.range.audiovideo)==null?void 0:n.partial))}function yn(r){return`${r.type}_${r.level}_${r.sn}`}const fE={length:0,start:()=>0,end:()=>0};class Ve{static isBuffered(e,t){try{if(e){const n=Ve.getBuffered(e);for(let i=0;i<n.length;i++)if(t>=n.start(i)&&t<=n.end(i))return!0}}catch{}return!1}static bufferInfo(e,t,n){try{if(e){const i=Ve.getBuffered(e),s=[];let o;for(o=0;o<i.length;o++)s.push({start:i.start(o),end:i.end(o)});return this.bufferedInfo(s,t,n)}}catch{}return{len:0,start:t,end:t,nextStart:void 0}}static bufferedInfo(e,t,n){t=Math.max(0,t),e.sort(function(l,c){const u=l.start-c.start;return u||c.end-l.end});let i=[];if(n)for(let l=0;l<e.length;l++){const c=i.length;if(c){const u=i[c-1].end;e[l].start-u<n?e[l].end>u&&(i[c-1].end=e[l].end):i.push(e[l])}else i.push(e[l])}else i=e;let s=0,o,a=t,A=t;for(let l=0;l<i.length;l++){const c=i[l].start,u=i[l].end;if(t+n>=c&&t<u)a=c,A=u,s=A-t;else if(t+n<c){o=c;break}}return{len:s,start:a||0,end:A||0,nextStart:o}}static getBuffered(e){try{return e.buffered}catch(t){return U.log("failed to get media.buffered",t),fE}}}class fa{constructor(e,t,n,i=0,s=-1,o=!1){this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=Is(),this.buffering={audio:Is(),video:Is(),audiovideo:Is()},this.level=e,this.sn=t,this.id=n,this.size=i,this.part=s,this.partial=o}}function Is(){return{start:0,executeStart:0,executeEnd:0,end:0}}function Cs(r,e){for(let n=0,i=r.length;n<i;n++){var t;if(((t=r[n])==null?void 0:t.cc)===e)return r[n]}return null}function gE(r,e,t){return!!(e&&(t.endCC>t.startCC||r&&r.cc<t.startCC))}function pE(r,e){const t=r.fragments,n=e.fragments;if(!n.length||!t.length){U.log("No fragments to align");return}const i=Cs(t,n[0].cc);if(!i||i&&!i.startPTS){U.log("No frag in previous level to align on");return}return i}function hu(r,e){if(r){const t=r.start+e;r.start=r.startPTS=t,r.endPTS=t+r.duration}}function du(r,e){const t=e.fragments;for(let n=0,i=t.length;n<i;n++)hu(t[n],r);e.fragmentHint&&hu(e.fragmentHint,r),e.alignedSliding=!0}function mE(r,e,t){e&&(EE(r,t,e),!t.alignedSliding&&e&&vs(t,e),!t.alignedSliding&&e&&!t.skippedSegments&&ru(e,t))}function EE(r,e,t){if(gE(r,t,e)){const n=pE(t,e);n&&he(n.start)&&(U.log(`Adjusting PTS using last level due to CC increase within current level ${e.url}`),du(n.start,e))}}function vs(r,e){if(!r.hasProgramDateTime||!e.hasProgramDateTime)return;const t=r.fragments,n=e.fragments;if(!t.length||!n.length)return;let i,s;const o=Math.min(e.endCC,r.endCC);e.startCC<o&&r.startCC<o&&(i=Cs(n,o),s=Cs(t,o)),(!i||!s)&&(i=n[Math.floor(n.length/2)],s=Cs(t,i.cc)||t[Math.floor(t.length/2)]);const a=i.programDateTime,A=s.programDateTime;if(!a||!A)return;const l=(A-a)/1e3-(s.start-i.start);du(l,r)}const fu=Math.pow(2,17);class IE{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,t){const n=e.url;if(!n)return Promise.reject(new Ir({type:ye.NETWORK_ERROR,details:V.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,s=i.fLoader,o=i.loader;return new Promise((a,A)=>{if(this.loader&&this.loader.destroy(),e.gap)if(e.tagList.some(d=>d[0]==="GAP")){A(pu(e));return}else e.gap=!1;const l=this.loader=e.loader=s?new s(i):new o(i),c=gu(e),u=au(i.fragLoadPolicy.default),h={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:e.sn==="initSegment"?1/0:fu};e.stats=l.stats,l.load(c,h,{onSuccess:(d,f,g,p)=>{this.resetLoader(e,l);let v=d.data;g.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(v.slice(0,16)),v=v.slice(16)),a({frag:e,part:null,payload:v,networkDetails:p})},onError:(d,f,g,p)=>{this.resetLoader(e,l),A(new Ir({type:ye.NETWORK_ERROR,details:V.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:ut({url:n,data:void 0},d),error:new Error(`HTTP Error ${d.code} ${d.text}`),networkDetails:g,stats:p}))},onAbort:(d,f,g)=>{this.resetLoader(e,l),A(new Ir({type:ye.NETWORK_ERROR,details:V.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:g,stats:d}))},onTimeout:(d,f,g)=>{this.resetLoader(e,l),A(new Ir({type:ye.NETWORK_ERROR,details:V.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${h.timeout}ms`),networkDetails:g,stats:d}))},onProgress:(d,f,g,p)=>{t&&t({frag:e,part:null,payload:g,networkDetails:p})}})})}loadPart(e,t,n){this.abort();const i=this.config,s=i.fLoader,o=i.loader;return new Promise((a,A)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap){A(pu(e,t));return}const l=this.loader=e.loader=s?new s(i):new o(i),c=gu(e,t),u=au(i.fragLoadPolicy.default),h={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:fu};t.stats=l.stats,l.load(c,h,{onSuccess:(d,f,g,p)=>{this.resetLoader(e,l),this.updateStatsFromPart(e,t);const v={frag:e,part:t,payload:d.data,networkDetails:p};n(v),a(v)},onError:(d,f,g,p)=>{this.resetLoader(e,l),A(new Ir({type:ye.NETWORK_ERROR,details:V.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:ut({url:c.url,data:void 0},d),error:new Error(`HTTP Error ${d.code} ${d.text}`),networkDetails:g,stats:p}))},onAbort:(d,f,g)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,l),A(new Ir({type:ye.NETWORK_ERROR,details:V.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:g,stats:d}))},onTimeout:(d,f,g)=>{this.resetLoader(e,l),A(new Ir({type:ye.NETWORK_ERROR,details:V.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${h.timeout}ms`),networkDetails:g,stats:d}))}})})}updateStatsFromPart(e,t){const n=e.stats,i=t.stats,s=i.total;if(n.loaded+=i.loaded,s){const A=Math.round(e.duration/t.duration),l=Math.min(Math.round(n.loaded/s),A),u=(A-l)*Math.round(n.loaded/l);n.total=n.loaded+u}else n.total=Math.max(n.loaded,n.total);const o=n.loading,a=i.loading;o.start?o.first+=a.first-a.start:(o.start=a.start,o.first=a.first),o.end=a.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function gu(r,e=null){const t=e||r,n={frag:r,part:e,responseType:"arraybuffer",url:t.url,headers:{},rangeStart:0,rangeEnd:0},i=t.byteRangeStartOffset,s=t.byteRangeEndOffset;if(he(i)&&he(s)){var o;let a=i,A=s;if(r.sn==="initSegment"&&((o=r.decryptdata)==null?void 0:o.method)==="AES-128"){const l=s-i;l%16&&(A=s+(16-l%16)),i!==0&&(n.resetIV=!0,a=i-16)}n.rangeStart=a,n.rangeEnd=A}return n}function pu(r,e){const t=new Error(`GAP ${r.gap?"tag":"attribute"} found`),n={type:ye.MEDIA_ERROR,details:V.FRAG_GAP,fatal:!1,frag:r,error:t,networkDetails:null};return e&&(n.part=e),(e||r).stats.aborted=!0,new Ir(n)}class Ir extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class CE{constructor(e,t){this.subtle=void 0,this.aesIV=void 0,this.subtle=e,this.aesIV=t}decrypt(e,t){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e)}}class vE{constructor(e,t){this.subtle=void 0,this.key=void 0,this.subtle=e,this.key=t}expandKey(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])}}function yE(r){const e=r.byteLength,t=e&&new DataView(r.buffer).getUint8(e-1);return t?Jr(r,0,e-t):r}class BE{constructor(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}uint8ArrayToUint32Array_(e){const t=new DataView(e),n=new Uint32Array(4);for(let i=0;i<4;i++)n[i]=t.getUint32(i*4);return n}initTable(){const e=this.sBox,t=this.invSBox,n=this.subMix,i=n[0],s=n[1],o=n[2],a=n[3],A=this.invSubMix,l=A[0],c=A[1],u=A[2],h=A[3],d=new Uint32Array(256);let f=0,g=0,p=0;for(p=0;p<256;p++)p<128?d[p]=p<<1:d[p]=p<<1^283;for(p=0;p<256;p++){let v=g^g<<1^g<<2^g<<3^g<<4;v=v>>>8^v&255^99,e[f]=v,t[v]=f;const T=d[f],b=d[T],y=d[b];let w=d[v]*257^v*16843008;i[f]=w<<24|w>>>8,s[f]=w<<16|w>>>16,o[f]=w<<8|w>>>24,a[f]=w,w=y*16843009^b*65537^T*257^f*16843008,l[v]=w<<24|w>>>8,c[v]=w<<16|w>>>16,u[v]=w<<8|w>>>24,h[v]=w,f?(f=T^d[d[d[y^T]]],g^=d[d[g]]):f=g=1}}expandKey(e){const t=this.uint8ArrayToUint32Array_(e);let n=!0,i=0;for(;i<t.length&&n;)n=t[i]===this.key[i],i++;if(n)return;this.key=t;const s=this.keySize=t.length;if(s!==4&&s!==6&&s!==8)throw new Error("Invalid aes key size="+s);const o=this.ksRows=(s+6+1)*4;let a,A;const l=this.keySchedule=new Uint32Array(o),c=this.invKeySchedule=new Uint32Array(o),u=this.sBox,h=this.rcon,d=this.invSubMix,f=d[0],g=d[1],p=d[2],v=d[3];let T,b;for(a=0;a<o;a++){if(a<s){T=l[a]=t[a];continue}b=T,a%s===0?(b=b<<8|b>>>24,b=u[b>>>24]<<24|u[b>>>16&255]<<16|u[b>>>8&255]<<8|u[b&255],b^=h[a/s|0]<<24):s>6&&a%s===4&&(b=u[b>>>24]<<24|u[b>>>16&255]<<16|u[b>>>8&255]<<8|u[b&255]),l[a]=T=(l[a-s]^b)>>>0}for(A=0;A<o;A++)a=o-A,A&3?b=l[a]:b=l[a-4],A<4||a<=4?c[A]=b:c[A]=f[u[b>>>24]]^g[u[b>>>16&255]]^p[u[b>>>8&255]]^v[u[b&255]],c[A]=c[A]>>>0}networkToHostOrderSwap(e){return e<<24|(e&65280)<<8|(e&16711680)>>8|e>>>24}decrypt(e,t,n){const i=this.keySize+6,s=this.invKeySchedule,o=this.invSBox,a=this.invSubMix,A=a[0],l=a[1],c=a[2],u=a[3],h=this.uint8ArrayToUint32Array_(n);let d=h[0],f=h[1],g=h[2],p=h[3];const v=new Int32Array(e),T=new Int32Array(v.length);let b,y,w,R,k,$,W,O,K,ne,ee,Ae,_,P;const X=this.networkToHostOrderSwap;for(;t<v.length;){for(K=X(v[t]),ne=X(v[t+1]),ee=X(v[t+2]),Ae=X(v[t+3]),k=K^s[0],$=Ae^s[1],W=ee^s[2],O=ne^s[3],_=4,P=1;P<i;P++)b=A[k>>>24]^l[$>>16&255]^c[W>>8&255]^u[O&255]^s[_],y=A[$>>>24]^l[W>>16&255]^c[O>>8&255]^u[k&255]^s[_+1],w=A[W>>>24]^l[O>>16&255]^c[k>>8&255]^u[$&255]^s[_+2],R=A[O>>>24]^l[k>>16&255]^c[$>>8&255]^u[W&255]^s[_+3],k=b,$=y,W=w,O=R,_=_+4;b=o[k>>>24]<<24^o[$>>16&255]<<16^o[W>>8&255]<<8^o[O&255]^s[_],y=o[$>>>24]<<24^o[W>>16&255]<<16^o[O>>8&255]<<8^o[k&255]^s[_+1],w=o[W>>>24]<<24^o[O>>16&255]<<16^o[k>>8&255]<<8^o[$&255]^s[_+2],R=o[O>>>24]<<24^o[k>>16&255]<<16^o[$>>8&255]<<8^o[W&255]^s[_+3],T[t]=X(b^d),T[t+1]=X(R^f),T[t+2]=X(w^g),T[t+3]=X(y^p),d=K,f=ne,g=ee,p=Ae,t=t+4}return T.buffer}}const QE=16;class ga{constructor(e,{removePKCS7Padding:t=!0}={}){if(this.logEnabled=!0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.useSoftware=void 0,this.useSoftware=e.enableSoftwareAES,this.removePKCS7Padding=t,t)try{const n=self.crypto;n&&(this.subtle=n.subtle||n.webkitSubtle)}catch{}this.useSoftware=!this.subtle}destroy(){this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null}isSync(){return this.useSoftware}flush(){const{currentResult:e,remainderData:t}=this;if(!e||t)return this.reset(),null;const n=new Uint8Array(e);return this.reset(),this.removePKCS7Padding?yE(n):n}reset(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}decrypt(e,t,n){return this.useSoftware?new Promise((i,s)=>{this.softwareDecrypt(new Uint8Array(e),t,n);const o=this.flush();o?i(o.buffer):s(new Error("[softwareDecrypt] Failed to decrypt data"))}):this.webCryptoDecrypt(new Uint8Array(e),t,n)}softwareDecrypt(e,t,n){const{currentIV:i,currentResult:s,remainderData:o}=this;this.logOnce("JS AES decrypt"),o&&(e=Ot(o,e),this.remainderData=null);const a=this.getValidChunk(e);if(!a.length)return null;i&&(n=i);let A=this.softwareDecrypter;A||(A=this.softwareDecrypter=new BE),A.expandKey(t);const l=s;return this.currentResult=A.decrypt(a.buffer,0,n),this.currentIV=Jr(a,-16).buffer,l||null}webCryptoDecrypt(e,t,n){if(this.key!==t||!this.fastAesKey){if(!this.subtle)return Promise.resolve(this.onWebCryptoError(e,t,n));this.key=t,this.fastAesKey=new vE(this.subtle,t)}return this.fastAesKey.expandKey().then(i=>this.subtle?(this.logOnce("WebCrypto AES decrypt"),new CE(this.subtle,new Uint8Array(n)).decrypt(e.buffer,i)):Promise.reject(new Error("web crypto not initialized"))).catch(i=>(U.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${i.name}: ${i.message}`),this.onWebCryptoError(e,t,n)))}onWebCryptoError(e,t,n){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,n);const i=this.flush();if(i)return i.buffer;throw new Error("WebCrypto and softwareDecrypt: failed to decrypt data")}getValidChunk(e){let t=e;const n=e.length-e.length%QE;return n!==e.length&&(t=Jr(e,0,n),this.remainderData=Jr(e,n)),t}logOnce(e){this.logEnabled&&(U.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const TE={toString:function(r){let e="";const t=r.length;for(let n=0;n<t;n++)e+=`[${r.start(n).toFixed(3)}-${r.end(n).toFixed(3)}]`;return e}},te={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"};class pa extends hE{constructor(e,t,n,i,s){super(),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=te.STOPPED,this.playlistType=void 0,this.media=null,this.mediaBuffer=null,this.config=void 0,this.bitrateTest=!1,this.lastCurrentTime=0,this.nextLoadPosition=0,this.startPosition=0,this.startTimeOffset=null,this.loadedmetadata=!1,this.retryDate=0,this.levels=null,this.fragmentLoader=void 0,this.keyLoader=void 0,this.levelLastLoaded=null,this.startFragRequested=!1,this.decrypter=void 0,this.initPTS=[],this.onvseeking=null,this.onvended=null,this.logPrefix="",this.log=void 0,this.warn=void 0,this.playlistType=s,this.logPrefix=i,this.log=U.log.bind(U,`${i}:`),this.warn=U.warn.bind(U,`${i}:`),this.hls=e,this.fragmentLoader=new IE(e.config),this.keyLoader=n,this.fragmentTracker=t,this.config=e.config,this.decrypter=new ga(e.config),e.on(I.MANIFEST_LOADED,this.onManifestLoaded,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(e){}stopLoad(){this.fragmentLoader.abort(),this.keyLoader.abort(this.playlistType);const e=this.fragCurrent;e!=null&&e.loader&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=te.STOPPED}_streamEnded(e,t){if(t.live||e.nextStart||!e.end||!this.media)return!1;const n=t.partList;if(n!=null&&n.length){const s=n[n.length-1];return Ve.isBuffered(this.media,s.start+s.duration/2)}const i=t.fragments[t.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(i)}getLevelDetails(){if(this.levels&&this.levelLastLoaded!==null){var e;return(e=this.levelLastLoaded)==null?void 0:e.details}}onMediaAttached(e,t){const n=this.media=this.mediaBuffer=t.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),n.addEventListener("seeking",this.onvseeking),n.addEventListener("ended",this.onvended);const i=this.config;this.levels&&i.autoStartLoad&&this.state===te.STOPPED&&this.startLoad(i.startPosition)}onMediaDetaching(){const e=this.media;e!=null&&e.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),e&&this.onvseeking&&this.onvended&&(e.removeEventListener("seeking",this.onvseeking),e.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.keyLoader&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()}onMediaSeeking(){const{config:e,fragCurrent:t,media:n,mediaBuffer:i,state:s}=this,o=n?n.currentTime:0,a=Ve.bufferInfo(i||n,o,e.maxBufferHole);if(this.log(`media seeking to ${he(o)?o.toFixed(3):o}, state: ${s}`),this.state===te.ENDED)this.resetLoadingState();else if(t){const A=e.maxFragLookUpTolerance,l=t.start-A,c=t.start+t.duration+A;if(!a.len||c<a.start||l>a.end){const u=o>c;(o<l||u)&&(u&&t.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),t.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}n&&(this.fragmentTracker.removeFragmentsInRange(o,1/0,this.playlistType,!0),this.lastCurrentTime=o),!this.loadedmetadata&&!a.len&&(this.nextLoadPosition=this.startPosition=o),this.tickImmediate()}onMediaEnded(){this.startPosition=this.lastCurrentTime=0}onManifestLoaded(e,t){this.startTimeOffset=t.startTimeOffset,this.initPTS=[]}onHandlerDestroying(){this.hls.off(I.MANIFEST_LOADED,this.onManifestLoaded,this),this.stopLoad(),super.onHandlerDestroying(),this.hls=null}onHandlerDestroyed(){this.state=te.STOPPED,this.fragmentLoader&&this.fragmentLoader.destroy(),this.keyLoader&&this.keyLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.keyLoader=this.fragmentLoader=this.fragmentTracker=null,super.onHandlerDestroyed()}loadFragment(e,t,n){this._loadFragForPlayback(e,t,n)}_loadFragForPlayback(e,t,n){const i=s=>{if(this.fragContextChanged(e)){this.warn(`Fragment ${e.sn}${s.part?" p: "+s.part.index:""} of level ${e.level} was dropped during download.`),this.fragmentTracker.removeFragment(e);return}e.stats.chunkCount++,this._handleFragmentLoadProgress(s)};this._doFragLoad(e,t,n,i).then(s=>{if(!s)return;const o=this.state;if(this.fragContextChanged(e)){(o===te.FRAG_LOADING||!this.fragCurrent&&o===te.PARSING)&&(this.fragmentTracker.removeFragment(e),this.state=te.IDLE);return}"payload"in s&&(this.log(`Loaded fragment ${e.sn} of level ${e.level}`),this.hls.trigger(I.FRAG_LOADED,s)),this._handleFragmentLoadComplete(s)}).catch(s=>{this.state===te.STOPPED||this.state===te.ERROR||(this.warn(`Frag error: ${(s==null?void 0:s.message)||s}`),this.resetFragmentLoading(e))})}clearTrackerIfNeeded(e){var t;const{fragmentTracker:n}=this;if(n.getState(e)===ht.APPENDING){const s=e.type,o=this.getFwdBufferInfo(this.mediaBuffer,s),a=Math.max(e.duration,o?o.len:this.config.maxBufferLength),A=this.backtrackFragment;((A?e.sn-A.sn:0)===1||this.reduceMaxBufferLength(a))&&n.removeFragment(e)}else((t=this.mediaBuffer)==null?void 0:t.buffered.length)===0?n.removeAllFragments():n.hasParts(e.type)&&(n.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),n.getState(e)===ht.PARTIAL&&n.removeFragment(e))}checkLiveUpdate(e){if(e.updated&&!e.live){const t=e.fragments[e.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:t,part:null,stats:t.stats,id:t.type})}e.fragments[0]||(e.deltaUpdateFailed=!0)}flushMainBuffer(e,t,n=null){if(!(e-t))return;const i={startOffset:e,endOffset:t,type:n};this.hls.trigger(I.BUFFER_FLUSHING,i)}_loadInitSegment(e,t){this._doFragLoad(e,t).then(n=>{if(!n||this.fragContextChanged(e)||!this.levels)throw new Error("init load aborted");return n}).then(n=>{const{hls:i}=this,{payload:s}=n,o=e.decryptdata;if(s&&s.byteLength>0&&o!=null&&o.key&&o.iv&&o.method==="AES-128"){const a=self.performance.now();return this.decrypter.decrypt(new Uint8Array(s),o.key.buffer,o.iv.buffer).catch(A=>{throw i.trigger(I.ERROR,{type:ye.MEDIA_ERROR,details:V.FRAG_DECRYPT_ERROR,fatal:!1,error:A,reason:A.message,frag:e}),A}).then(A=>{const l=self.performance.now();return i.trigger(I.FRAG_DECRYPTED,{frag:e,payload:A,stats:{tstart:a,tdecrypt:l}}),n.payload=A,this.completeInitSegmentLoad(n)})}return this.completeInitSegmentLoad(n)}).catch(n=>{this.state===te.STOPPED||this.state===te.ERROR||(this.warn(n),this.resetFragmentLoading(e))})}completeInitSegmentLoad(e){const{levels:t}=this;if(!t)throw new Error("init load aborted, missing levels");const n=e.frag.stats;this.state=te.IDLE,e.frag.data=new Uint8Array(e.payload),n.parsing.start=n.buffering.start=self.performance.now(),n.parsing.end=n.buffering.end=self.performance.now(),this.tick()}fragContextChanged(e){const{fragCurrent:t}=this;return!e||!t||e.sn!==t.sn||e.level!==t.level}fragBufferedComplete(e,t){var n,i,s,o;const a=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log(`Buffered ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.playlistType===Ee.MAIN?"level":"track"} ${e.level} (frag:[${((n=e.startPTS)!=null?n:NaN).toFixed(3)}-${((i=e.endPTS)!=null?i:NaN).toFixed(3)}] > buffer:${a?TE.toString(Ve.getBuffered(a)):"(detached)"})`),e.sn!=="initSegment"){var A;if(e.type!==Ee.SUBTITLE){const c=e.elementaryStreams;if(!Object.keys(c).some(u=>!!c[u])){this.state=te.IDLE;return}}const l=(A=this.levels)==null?void 0:A[e.level];l!=null&&l.fragmentError&&(this.log(`Resetting level fragment error count of ${l.fragmentError} on frag buffered`),l.fragmentError=0)}this.state=te.IDLE,a&&(!this.loadedmetadata&&e.type==Ee.MAIN&&a.buffered.length&&((s=this.fragCurrent)==null?void 0:s.sn)===((o=this.fragPrevious)==null?void 0:o.sn)&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick())}seekToStartPos(){}_handleFragmentLoadComplete(e){const{transmuxer:t}=this;if(!t)return;const{frag:n,part:i,partsLoaded:s}=e,o=!s||s.length===0||s.some(A=>!A),a=new fa(n.level,n.sn,n.stats.chunkCount+1,0,i?i.index:-1,!o);t.flush(a)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,n=null,i){var s;const o=t==null?void 0:t.details;if(!this.levels||!o)throw new Error(`frag load aborted, missing level${o?"":" detail"}s`);let a=null;if(e.encrypted&&!((s=e.decryptdata)!=null&&s.key)?(this.log(`Loading key for ${e.sn} of [${o.startSN}-${o.endSN}], ${this.logPrefix==="[stream-controller]"?"level":"track"} ${e.level}`),this.state=te.KEY_LOADING,this.fragCurrent=e,a=this.keyLoader.load(e).then(c=>{if(!this.fragContextChanged(c.frag))return this.hls.trigger(I.KEY_LOADED,c),this.state===te.KEY_LOADING&&(this.state=te.IDLE),c}),this.hls.trigger(I.KEY_LOADING,{frag:e}),this.fragCurrent===null&&(a=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))):!e.encrypted&&o.encryptedFragments.length&&this.keyLoader.loadClear(e,o.encryptedFragments),n=Math.max(e.start,n||0),this.config.lowLatencyMode&&e.sn!=="initSegment"){const c=o.partList;if(c&&i){n>e.end&&o.fragmentHint&&(e=o.fragmentHint);const u=this.getNextPart(c,e,n);if(u>-1){const h=c[u];this.log(`Loading part sn: ${e.sn} p: ${h.index} cc: ${e.cc} of playlist [${o.startSN}-${o.endSN}] parts [0-${u}-${c.length-1}] ${this.logPrefix==="[stream-controller]"?"level":"track"}: ${e.level}, target: ${parseFloat(n.toFixed(3))}`),this.nextLoadPosition=h.start+h.duration,this.state=te.FRAG_LOADING;let d;return a?d=a.then(f=>!f||this.fragContextChanged(f.frag)?null:this.doFragPartsLoad(e,h,t,i)).catch(f=>this.handleFragLoadError(f)):d=this.doFragPartsLoad(e,h,t,i).catch(f=>this.handleFragLoadError(f)),this.hls.trigger(I.FRAG_LOADING,{frag:e,part:h,targetBufferTime:n}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):d}else if(!e.url||this.loadedEndOfParts(c,n))return Promise.resolve(null)}}this.log(`Loading fragment ${e.sn} cc: ${e.cc} ${o?"of ["+o.startSN+"-"+o.endSN+"] ":""}${this.logPrefix==="[stream-controller]"?"level":"track"}: ${e.level}, target: ${parseFloat(n.toFixed(3))}`),he(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=te.FRAG_LOADING;const A=this.config.progressive;let l;return A&&a?l=a.then(c=>!c||this.fragContextChanged(c==null?void 0:c.frag)?null:this.fragmentLoader.load(e,i)).catch(c=>this.handleFragLoadError(c)):l=Promise.all([this.fragmentLoader.load(e,A?i:void 0),a]).then(([c])=>(!A&&c&&i&&i(c),c)).catch(c=>this.handleFragLoadError(c)),this.hls.trigger(I.FRAG_LOADING,{frag:e,targetBufferTime:n}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):l}doFragPartsLoad(e,t,n,i){return new Promise((s,o)=>{var a;const A=[],l=(a=n.details)==null?void 0:a.partList,c=u=>{this.fragmentLoader.loadPart(e,u,i).then(h=>{A[u.index]=h;const d=h.part;this.hls.trigger(I.FRAG_LOADED,h);const f=nu(n,e.sn,u.index+1)||iu(l,e.sn,u.index+1);if(f)c(f);else return s({frag:e,part:d,partsLoaded:A})}).catch(o)};c(t)})}handleFragLoadError(e){if("data"in e){const t=e.data;e.data&&t.details===V.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(I.ERROR,t)}else this.hls.trigger(I.ERROR,{type:ye.OTHER_ERROR,details:V.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==te.PARSING){!this.fragCurrent&&this.state!==te.STOPPED&&this.state!==te.ERROR&&(this.state=te.IDLE);return}const{frag:n,part:i,level:s}=t,o=self.performance.now();n.stats.parsing.end=o,i&&(i.stats.parsing.end=o),this.updateLevelTiming(n,i,s,e.partial)}getCurrentContext(e){const{levels:t,fragCurrent:n}=this,{level:i,sn:s,part:o}=e;if(!(t!=null&&t[i]))return this.warn(`Levels object was unset while buffering fragment ${s} of level ${i}. The current chunk will not be buffered.`),null;const a=t[i],A=o>-1?nu(a,s,o):null,l=A?A.fragment:Jm(a,s,n);return l?(n&&n!==l&&(l.stats=n.stats),{frag:l,part:A,level:a}):null}bufferFragmentData(e,t,n,i,s){var o;if(!e||this.state!==te.PARSING)return;const{data1:a,data2:A}=e;let l=a;if(a&&A&&(l=Ot(a,A)),!((o=l)!=null&&o.length))return;const c={type:e.type,frag:t,part:n,chunkMeta:i,parent:t.type,data:l};if(this.hls.trigger(I.BUFFER_APPENDING,c),e.dropped&&e.independent&&!n){if(s)return;this.flushBufferGap(t)}}flushBufferGap(e){const t=this.media;if(!t)return;if(!Ve.isBuffered(t,t.currentTime)){this.flushMainBuffer(0,e.start);return}const n=t.currentTime,i=Ve.bufferInfo(t,n,0),s=e.duration,o=Math.min(this.config.maxFragLookUpTolerance*2,s*.25),a=Math.max(Math.min(e.start-o,i.end-o),n+o);e.start-a>o&&this.flushMainBuffer(a,e.start)}getFwdBufferInfo(e,t){const n=this.getLoadPosition();return he(n)?this.getFwdBufferInfoAtPos(e,n,t):null}getFwdBufferInfoAtPos(e,t,n){const{config:{maxBufferHole:i}}=this,s=Ve.bufferInfo(e,t,i);if(s.len===0&&s.nextStart!==void 0){const o=this.fragmentTracker.getBufferedFrag(t,n);if(o&&s.nextStart<o.end)return Ve.bufferInfo(e,t,Math.max(s.nextStart,i))}return s}getMaxBufferLength(e){const{config:t}=this;let n;return e?n=Math.max(8*t.maxBufferSize/e,t.maxBufferLength):n=t.maxBufferLength,Math.min(n,t.maxMaxBufferLength)}reduceMaxBufferLength(e){const t=this.config,n=e||t.maxBufferLength,i=t.maxMaxBufferLength/2;return i>=n?(t.maxMaxBufferLength=i,this.warn(`Reduce max buffer length to ${i}s`),!0):!1}getAppendedFrag(e,t=Ee.MAIN){const n=this.fragmentTracker.getAppendedFrag(e,Ee.MAIN);return n&&"fragment"in n?n.fragment:n}getNextFragment(e,t){const n=t.fragments,i=n.length;if(!i)return null;const{config:s}=this,o=n[0].start;let a;if(t.live){const A=s.initialLiveManifestSize;if(i<A)return this.warn(`Not enough fragments to start playback (have: ${i}, need: ${A})`),null;(!t.PTSKnown&&!this.startFragRequested&&this.startPosition===-1||e<o)&&(a=this.getInitialLiveFragment(t,n),this.startPosition=this.nextLoadPosition=a?this.hls.liveSyncPosition||a.start:e)}else e<=o&&(a=n[0]);if(!a){const A=s.lowLatencyMode?t.partEnd:t.fragmentEnd;a=this.getFragmentAtPosition(e,A,t)}return this.mapToInitFragWhenRequired(a)}isLoopLoading(e,t){const n=this.fragmentTracker.getState(e);return(n===ht.OK||n===ht.PARTIAL&&!!e.gap)&&this.nextLoadPosition>t}getNextFragmentLoopLoading(e,t,n,i,s){const o=e.gap,a=this.getNextFragment(this.nextLoadPosition,t);if(a===null)return a;if(e=a,o&&e&&!e.gap&&n.nextStart){const A=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,n.nextStart,i);if(A!==null&&n.len+A.len>=s)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,t,n){let i=-1,s=!1,o=!0;for(let a=0,A=e.length;a<A;a++){const l=e[a];if(o=o&&!l.independent,i>-1&&n<l.start)break;const c=l.loaded;c?i=-1:(s||l.independent||o)&&l.fragment===t&&(i=a),s=c}return i}loadedEndOfParts(e,t){const n=e[e.length-1];return n&&t>n.start&&n.loaded}getInitialLiveFragment(e,t){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=qm(t,n.endProgramDateTime,this.config.maxFragLookUpTolerance)),!i){const s=n.sn+1;if(s>=e.startSN&&s<=e.endSN){const o=t[s-e.startSN];n.cc===o.cc&&(i=o,this.log(`Live playlist, switching playlist, load frag with next SN: ${i.sn}`))}i||(i=zm(t,n.cc),i&&this.log(`Live playlist, switching playlist, load frag with same CC: ${i.sn}`))}}else{const s=this.hls.liveSyncPosition;s!==null&&(i=this.getFragmentAtPosition(s,this.bitrateTest?e.fragmentEnd:e.edge,e))}return i}getFragmentAtPosition(e,t,n){const{config:i}=this;let{fragPrevious:s}=this,{fragments:o,endSN:a}=n;const{fragmentHint:A}=n,{maxFragLookUpTolerance:l}=i,c=n.partList,u=!!(i.lowLatencyMode&&c!=null&&c.length&&A);u&&A&&!this.bitrateTest&&(o=o.concat(A),a=A.sn);let h;if(e<t){const d=e>t-l?0:l;h=ms(s,o,e,d)}else h=o[o.length-1];if(h){const d=h.sn-n.startSN,f=this.fragmentTracker.getState(h);if((f===ht.OK||f===ht.PARTIAL&&h.gap)&&(s=h),s&&h.sn===s.sn&&(!u||c[0].fragment.sn>h.sn)&&s&&h.level===s.level){const p=o[d+1];h.sn<a&&this.fragmentTracker.getState(p)!==ht.OK?h=p:h=null}}return h}synchronizeToLiveEdge(e){const{config:t,media:n}=this;if(!n)return;const i=this.hls.liveSyncPosition,s=n.currentTime,o=e.fragments[0].start,a=e.edge,A=s>=o-t.maxFragLookUpTolerance&&s<=a;if(i!==null&&n.duration>i&&(s<i||!A)){const l=t.liveMaxLatencyDuration!==void 0?t.liveMaxLatencyDuration:t.liveMaxLatencyDurationCount*e.targetduration;(!A&&n.readyState<4||s<a-l)&&(this.loadedmetadata||(this.nextLoadPosition=i),n.readyState&&(this.warn(`Playback: ${s.toFixed(3)} is located too far from the end of live sliding playlist: ${a}, reset currentTime to : ${i.toFixed(3)}`),n.currentTime=i))}}alignPlaylists(e,t,n){const i=e.fragments.length;if(!i)return this.warn("No fragments in live playlist"),0;const s=e.fragments[0].start,o=!t,a=e.alignedSliding&&he(s);if(o||!a&&!s){const{fragPrevious:A}=this;mE(A,n,e);const l=e.fragments[0].start;return this.log(`Live playlist sliding: ${l.toFixed(2)} start-sn: ${t?t.startSN:"na"}->${e.startSN} prev-sn: ${A?A.sn:"na"} fragments: ${i}`),l}return s}waitForCdnTuneIn(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,e.partTarget*3)}setStartPosition(e,t){let n=this.startPosition;if(n<t&&(n=-1),n===-1||this.lastCurrentTime===-1){const i=this.startTimeOffset!==null,s=i?this.startTimeOffset:e.startTimeOffset;s!==null&&he(s)?(n=t+s,s<0&&(n+=e.totalduration),n=Math.min(Math.max(t,n),t+e.totalduration),this.log(`Start time offset ${s} found in ${i?"multivariant":"media"} playlist, adjust startPosition to ${n}`),this.startPosition=n):e.live?n=this.hls.liveSyncPosition||t:this.startPosition=n=0,this.lastCurrentTime=n}this.nextLoadPosition=n}getLoadPosition(){const{media:e}=this;let t=0;return this.loadedmetadata&&e?t=e.currentTime:this.nextLoadPosition&&(t=this.nextLoadPosition),t}handleFragLoadAborted(e,t){this.transmuxer&&e.sn!=="initSegment"&&e.stats.aborted&&(this.warn(`Fragment ${e.sn}${t?" part "+t.index:""} of level ${e.level} was aborted`),this.resetFragmentLoading(e))}resetFragmentLoading(e){(!this.fragCurrent||!this.fragContextChanged(e)&&this.state!==te.FRAG_LOADING_WAITING_RETRY)&&(this.state=te.IDLE)}onFragmentOrKeyLoadError(e,t){if(t.chunkMeta&&!t.frag){const c=this.getCurrentContext(t.chunkMeta);c&&(t.frag=c.frag)}const n=t.frag;if(!n||n.type!==e||!this.levels)return;if(this.fragContextChanged(n)){var i;this.warn(`Frag load error must match current frag to retry ${n.url} > ${(i=this.fragCurrent)==null?void 0:i.url}`);return}const s=t.details===V.FRAG_GAP;s&&this.fragmentTracker.fragBuffered(n,!0);const o=t.errorAction,{action:a,retryCount:A=0,retryConfig:l}=o||{};if(o&&a===It.RetryRequest&&l){this.resetStartWhenNotLoaded(this.levelLastLoaded);const c=ua(l,A);this.warn(`Fragment ${n.sn} of ${e} ${n.level} errored with ${t.details}, retrying loading ${A+1}/${l.maxNumRetry} in ${c}ms`),o.resolved=!0,this.retryDate=self.performance.now()+c,this.state=te.FRAG_LOADING_WAITING_RETRY}else if(l&&o)if(this.resetFragmentErrors(e),A<l.maxNumRetry)!s&&a!==It.RemoveAlternatePermanently&&(o.resolved=!0);else{U.warn(`${t.details} reached or exceeded max retry (${A})`);return}else(o==null?void 0:o.action)===It.SendAlternateToPenaltyBox?this.state=te.WAITING_LEVEL:this.state=te.ERROR;this.tickImmediate()}reduceLengthAndFlushBuffer(e){if(this.state===te.PARSING||this.state===te.PARSED){const t=e.parent,n=this.getFwdBufferInfo(this.mediaBuffer,t),i=n&&n.len>.5;i&&this.reduceMaxBufferLength(n.len);const s=!i;return s&&this.warn(`Buffer full error while media.currentTime is not buffered, flush ${t} buffer`),e.frag&&(this.fragmentTracker.removeFragment(e.frag),this.nextLoadPosition=e.frag.start),this.resetLoadingState(),s}return!1}resetFragmentErrors(e){e===Ee.AUDIO&&(this.fragCurrent=null),this.loadedmetadata||(this.startFragRequested=!1),this.state!==te.STOPPED&&(this.state=te.IDLE)}afterBufferFlushed(e,t,n){if(!e)return;const i=Ve.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,i,n),this.state===te.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state=te.IDLE}resetStartWhenNotLoaded(e){if(!this.loadedmetadata){this.startFragRequested=!1;const t=e?e.details:null;t!=null&&t.live?(this.startPosition=-1,this.setStartPosition(t,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(this.levelLastLoaded),this.resetLoadingState()}removeUnbufferedFrags(e=0){this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}updateLevelTiming(e,t,n,i){var s;const o=n.details;if(!o){this.warn("level.details undefined");return}if(!Object.keys(e.elementaryStreams).reduce((A,l)=>{const c=e.elementaryStreams[l];if(c){const u=c.endPTS-c.startPTS;if(u<=0)return this.warn(`Could not parse fragment ${e.sn} ${l} duration reliably (${u})`),A||!1;const h=i?0:tu(o,e,c.startPTS,c.endPTS,c.startDTS,c.endDTS);return this.hls.trigger(I.LEVEL_PTS_UPDATED,{details:o,level:n,drift:h,type:l,frag:e,start:c.startPTS,end:c.endPTS}),!0}return A},!1)&&((s=this.transmuxer)==null?void 0:s.error)===null){const A=new Error(`Found no media in fragment ${e.sn} of level ${e.level} resetting transmuxer to fallback to playlist timing`);if(n.fragmentError===0&&(n.fragmentError++,e.gap=!0,this.fragmentTracker.removeFragment(e),this.fragmentTracker.fragBuffered(e,!0)),this.warn(A.message),this.hls.trigger(I.ERROR,{type:ye.MEDIA_ERROR,details:V.FRAG_PARSING_ERROR,fatal:!1,error:A,frag:e,reason:`Found no media in msn ${e.sn} of level "${n.url}"`}),!this.hls)return;this.resetTransmuxer()}this.state=te.PARSED,this.hls.trigger(I.FRAG_PARSED,{frag:e,part:t})}resetTransmuxer(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)}recoverWorkerError(e){e.event==="demuxerWorker"&&(this.fragmentTracker.removeAllFragments(),this.resetTransmuxer(),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState())}set state(e){const t=this._state;t!==e&&(this._state=e,this.log(`${t}->${e}`))}get state(){return this._state}}class mu{constructor(){this.chunks=[],this.dataLength=0}push(e){this.chunks.push(e),this.dataLength+=e.length}flush(){const{chunks:e,dataLength:t}=this;let n;if(e.length)e.length===1?n=e[0]:n=bE(e,t);else return new Uint8Array(0);return this.reset(),n}reset(){this.chunks.length=0,this.dataLength=0}}function bE(r,e){const t=new Uint8Array(e);let n=0;for(let i=0;i<r.length;i++){const s=r[i];t.set(s,n),n+=s.length}return t}function xE(){return typeof __HLS_WORKER_BUNDLE__=="function"}function wE(){const r=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(r);return{worker:new self.Worker(e),objectURL:e}}function SE(r){const e=new self.URL(r,self.location.href).href;return{worker:new self.Worker(e),scriptURL:e}}function or(r="",e=9e4){return{type:r,id:-1,pid:-1,inputTimeScale:e,sequenceNumber:-1,samples:[],dropped:0}}class ma{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,t,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,t){return!1}appendFrame(e,t,n){}demux(e,t){this.cachedData&&(e=Ot(this.cachedData,e),this.cachedData=null);let n=oi(e,0),i=n?n.length:0,s;const o=this._audioTrack,a=this._id3Track,A=n?jo(n):void 0,l=e.length;for((this.basePTS===null||this.frameIndex===0&&he(A))&&(this.basePTS=RE(A,t,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),n&&n.length>0&&a.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:Jt.audioId3,duration:Number.POSITIVE_INFINITY});i<l;){if(this.canParse(e,i)){const c=this.appendFrame(o,e,i);c?(this.frameIndex++,this.lastPTS=c.sample.pts,i+=c.length,s=i):i=l}else zp(e,i)?(n=oi(e,i),a.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:Jt.audioId3,duration:Number.POSITIVE_INFINITY}),i+=n.length,s=i):i++;if(i===l&&s!==l){const c=Jr(e,s);this.cachedData?this.cachedData=Ot(this.cachedData,c):this.cachedData=c}}return{audioTrack:o,videoTrack:or(),id3Track:a,textTrack:or()}}demuxSampleAes(e,t,n){return Promise.reject(new Error(`[${this}] This demuxer does not support Sample-AES decryption`))}flush(e){const t=this.cachedData;return t&&(this.cachedData=null,this.demux(t,0)),{audioTrack:this._audioTrack,videoTrack:or(),id3Track:this._id3Track,textTrack:or()}}destroy(){}}const RE=(r,e,t)=>{if(he(r))return r*90;const n=t?t.baseTime*9e4/t.timescale:0;return e*9e4+n};function DE(r,e,t,n){let i,s,o,a;const A=navigator.userAgent.toLowerCase(),l=n,c=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];i=((e[t+2]&192)>>>6)+1;const u=(e[t+2]&60)>>>2;if(u>c.length-1){const h=new Error(`invalid ADTS sampling index:${u}`);r.emit(I.ERROR,I.ERROR,{type:ye.MEDIA_ERROR,details:V.FRAG_PARSING_ERROR,fatal:!0,error:h,reason:h.message});return}return o=(e[t+2]&1)<<2,o|=(e[t+3]&192)>>>6,U.log(`manifest codec:${n}, ADTS type:${i}, samplingIndex:${u}`),/firefox/i.test(A)?u>=6?(i=5,a=new Array(4),s=u-3):(i=2,a=new Array(2),s=u):A.indexOf("android")!==-1?(i=2,a=new Array(2),s=u):(i=5,a=new Array(4),n&&(n.indexOf("mp4a.40.29")!==-1||n.indexOf("mp4a.40.5")!==-1)||!n&&u>=6?s=u-3:((n&&n.indexOf("mp4a.40.2")!==-1&&(u>=6&&o===1||/vivaldi/i.test(A))||!n&&o===1)&&(i=2,a=new Array(2)),s=u)),a[0]=i<<3,a[0]|=(u&14)>>1,a[1]|=(u&1)<<7,a[1]|=o<<3,i===5&&(a[1]|=(s&14)>>1,a[2]=(s&1)<<7,a[2]|=8,a[3]=0),{config:a,samplerate:c[u],channelCount:o,codec:"mp4a.40."+i,manifestCodec:l}}function Eu(r,e){return r[e]===255&&(r[e+1]&246)===240}function Iu(r,e){return r[e+1]&1?7:9}function Ea(r,e){return(r[e+3]&3)<<11|r[e+4]<<3|(r[e+5]&224)>>>5}function _E(r,e){return e+5<r.length}function ys(r,e){return e+1<r.length&&Eu(r,e)}function LE(r,e){return _E(r,e)&&Eu(r,e)&&Ea(r,e)<=r.length-e}function FE(r,e){if(ys(r,e)){const t=Iu(r,e);if(e+t>=r.length)return!1;const n=Ea(r,e);if(n<=t)return!1;const i=e+n;return i===r.length||ys(r,i)}return!1}function Cu(r,e,t,n,i){if(!r.samplerate){const s=DE(e,t,n,i);if(!s)return;r.config=s.config,r.samplerate=s.samplerate,r.channelCount=s.channelCount,r.codec=s.codec,r.manifestCodec=s.manifestCodec,U.log(`parsed codec:${r.codec}, rate:${s.samplerate}, channels:${s.channelCount}`)}}function vu(r){return 9216e4/r}function kE(r,e){const t=Iu(r,e);if(e+t<=r.length){const n=Ea(r,e)-t;if(n>0)return{headerLength:t,frameLength:n}}}function yu(r,e,t,n,i){const s=vu(r.samplerate),o=n+i*s,a=kE(e,t);let A;if(a){const{frameLength:u,headerLength:h}=a,d=h+u,f=Math.max(0,t+d-e.length);f?(A=new Uint8Array(d-h),A.set(e.subarray(t+h,e.length),0)):A=e.subarray(t+h,t+d);const g={unit:A,pts:o};return f||r.samples.push(g),{sample:g,length:d,missing:f}}const l=e.length-t;return A=new Uint8Array(l),A.set(e.subarray(t,e.length),0),{sample:{unit:A,pts:o},length:l,missing:-1}}let Bs=null;const NE=[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],ME=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],PE=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],OE=[0,1,1,4];function Bu(r,e,t,n,i){if(t+24>e.length)return;const s=Qu(e,t);if(s&&t+s.frameLength<=e.length){const o=s.samplesPerFrame*9e4/s.sampleRate,a=n+i*o,A={unit:e.subarray(t,t+s.frameLength),pts:a,dts:a};return r.config=[],r.channelCount=s.channelCount,r.samplerate=s.sampleRate,r.samples.push(A),{sample:A,length:s.frameLength,missing:0}}}function Qu(r,e){const t=r[e+1]>>3&3,n=r[e+1]>>1&3,i=r[e+2]>>4&15,s=r[e+2]>>2&3;if(t!==1&&i!==0&&i!==15&&s!==3){const o=r[e+2]>>1&1,a=r[e+3]>>6,A=t===3?3-n:n===3?3:4,l=NE[A*14+i-1]*1e3,u=ME[(t===3?0:t===2?1:2)*3+s],h=a===3?1:2,d=PE[t][n],f=OE[n],g=d*8*f,p=Math.floor(d*l/u+o)*f;if(Bs===null){const b=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Bs=b?parseInt(b[1]):0}return!!Bs&&Bs<=87&&n===2&&l>=224e3&&a===0&&(r[e+3]=r[e+3]|128),{sampleRate:u,channelCount:h,frameLength:p,samplesPerFrame:g}}}function Ia(r,e){return r[e]===255&&(r[e+1]&224)===224&&(r[e+1]&6)!==0}function Tu(r,e){return e+1<r.length&&Ia(r,e)}function UE(r,e){return Ia(r,e)&&4<=r.length-e}function bu(r,e){if(e+1<r.length&&Ia(r,e)){const n=Qu(r,e);let i=4;n!=null&&n.frameLength&&(i=n.frameLength);const s=e+i;return s===r.length||Tu(r,s)}return!1}class GE extends ma{constructor(e,t){super(),this.observer=void 0,this.config=void 0,this.observer=e,this.config=t}resetInitSegment(e,t,n,i){super.resetInitSegment(e,t,n,i),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const t=oi(e,0);let n=(t==null?void 0:t.length)||0;if(bu(e,n))return!1;for(let i=e.length;n<i;n++)if(FE(e,n))return U.log("ADTS sync word found !"),!0;return!1}canParse(e,t){return LE(e,t)}appendFrame(e,t,n){Cu(e,this.observer,t,n,e.manifestCodec);const i=yu(e,t,n,this.basePTS,this.frameIndex);if(i&&i.missing===0)return i}}const HE=/\/emsg[-/]ID3/i;class $E{constructor(e,t){this.remainderData=null,this.timeOffset=0,this.config=void 0,this.videoTrack=void 0,this.audioTrack=void 0,this.id3Track=void 0,this.txtTrack=void 0,this.config=t}resetTimeStamp(){}resetInitSegment(e,t,n,i){const s=this.videoTrack=or("video",1),o=this.audioTrack=or("audio",1),a=this.txtTrack=or("text",1);if(this.id3Track=or("id3",1),this.timeOffset=0,!(e!=null&&e.byteLength))return;const A=wc(e);if(A.video){const{id:l,timescale:c,codec:u}=A.video;s.id=l,s.timescale=a.timescale=c,s.codec=u}if(A.audio){const{id:l,timescale:c,codec:u}=A.audio;o.id=l,o.timescale=c,o.codec=u}a.id=Qc.text,s.sampleDuration=0,s.duration=o.duration=i}resetContiguity(){this.remainderData=null}static probe(e){return am(e)}demux(e,t){this.timeOffset=t;let n=e;const i=this.videoTrack,s=this.txtTrack;if(this.config.progressive){this.remainderData&&(n=Ot(this.remainderData,e));const a=gm(n);this.remainderData=a.remainder,i.samples=a.valid||new Uint8Array}else i.samples=n;const o=this.extractID3Track(i,t);return s.samples=Rc(t,i),{videoTrack:i,audioTrack:this.audioTrack,id3Track:o,textTrack:this.txtTrack}}flush(){const e=this.timeOffset,t=this.videoTrack,n=this.txtTrack;t.samples=this.remainderData||new Uint8Array,this.remainderData=null;const i=this.extractID3Track(t,this.timeOffset);return n.samples=Rc(e,t),{videoTrack:t,audioTrack:or(),id3Track:i,textTrack:or()}}extractID3Track(e,t){const n=this.id3Track;if(e.samples.length){const i=xe(e.samples,["emsg"]);i&&i.forEach(s=>{const o=Em(s);if(HE.test(o.schemeIdUri)){const a=he(o.presentationTime)?o.presentationTime/o.timeScale:t+o.presentationTimeDelta/o.timeScale;let A=o.eventDuration===4294967295?Number.POSITIVE_INFINITY:o.eventDuration/o.timeScale;A<=.001&&(A=Number.POSITIVE_INFINITY);const l=o.payload;n.samples.push({data:l,len:l.byteLength,dts:a,pts:a,type:Jt.emsg,duration:A})}})}return n}demuxSampleAes(e,t,n){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){}}const xu=(r,e)=>{let t=0,n=5;e+=n;const i=new Uint32Array(1),s=new Uint32Array(1),o=new Uint8Array(1);for(;n>0;){o[0]=r[e];const a=Math.min(n,8),A=8-a;s[0]=4278190080>>>24+A<<A,i[0]=(o[0]&s[0])>>A,t=t?t<<a|i[0]:i[0],e+=1,n-=a}return t};class YE extends ma{constructor(e){super(),this.observer=void 0,this.observer=e}resetInitSegment(e,t,n,i){super.resetInitSegment(e,t,n,i),this._audioTrack={container:"audio/ac-3",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"ac3",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}canParse(e,t){return t+64<e.length}appendFrame(e,t,n){const i=wu(e,t,n,this.basePTS,this.frameIndex);if(i!==-1)return{sample:e.samples[e.samples.length-1],length:i,missing:0}}static probe(e){if(!e)return!1;const t=oi(e,0);if(!t)return!1;const n=t.length;return e[n]===11&&e[n+1]===119&&jo(t)!==void 0&&xu(e,n)<16}}function wu(r,e,t,n,i){if(t+8>e.length||e[t]!==11||e[t+1]!==119)return-1;const s=e[t+4]>>6;if(s>=3)return-1;const a=[48e3,44100,32e3][s],A=e[t+4]&63,c=[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][A*3+s]*2;if(t+c>e.length)return-1;const u=e[t+6]>>5;let h=0;u===2?h+=2:(u&1&&u!==1&&(h+=2),u&4&&(h+=2));const d=(e[t+6]<<8|e[t+7])>>12-h&1,g=[2,1,2,3,3,4,4,5][u]+d,p=e[t+5]>>3,v=e[t+5]&7,T=new Uint8Array([s<<6|p<<1|v>>2,(v&3)<<6|u<<3|d<<2|A>>4,A<<4&224]),b=1536/a*9e4,y=n+i*b,w=e.subarray(t,t+c);return r.config=T,r.channelCount=g,r.samplerate=a,r.samples.push({unit:w,pts:y}),c}class VE{constructor(){this.VideoSample=null}createVideoSample(e,t,n,i){return{key:e,frame:!1,pts:t,dts:n,units:[],debug:i,length:0}}getLastNalUnit(e){var t;let n=this.VideoSample,i;if((!n||n.units.length===0)&&(n=e[e.length-1]),(t=n)!=null&&t.units){const s=n.units;i=s[s.length-1]}return i}pushAccessUnit(e,t){if(e.units.length&&e.frame){if(e.pts===void 0){const n=t.samples,i=n.length;if(i){const s=n[i-1];e.pts=s.pts,e.dts=s.dts}else{t.dropped++;return}}t.samples.push(e)}e.debug.length&&U.log(e.pts+"/"+e.dts+":"+e.debug)}}class Su{constructor(e){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}loadWord(){const e=this.data,t=this.bytesAvailable,n=e.byteLength-t,i=new Uint8Array(4),s=Math.min(4,t);if(s===0)throw new Error("no bytes available");i.set(e.subarray(n,n+s)),this.word=new DataView(i.buffer).getUint32(0),this.bitsAvailable=s*8,this.bytesAvailable-=s}skipBits(e){let t;e=Math.min(e,this.bytesAvailable*8+this.bitsAvailable),this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,t=e>>3,e-=t<<3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}readBits(e){let t=Math.min(this.bitsAvailable,e);const n=this.word>>>32-t;if(e>32&&U.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0)this.word<<=t;else if(this.bytesAvailable>0)this.loadWord();else throw new Error("no bits available");return t=e-t,t>0&&this.bitsAvailable?n<<t|this.readBits(t):n}skipLZ(){let e;for(e=0;e<this.bitsAvailable;++e)if(this.word&2147483648>>>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 t=8,n=8,i;for(let s=0;s<e;s++)n!==0&&(i=this.readEG(),n=(t+i+256)%256),t=n===0?t:n}readSPS(){let e=0,t=0,n=0,i=0,s,o,a;const A=this.readUByte.bind(this),l=this.readBits.bind(this),c=this.readUEG.bind(this),u=this.readBoolean.bind(this),h=this.skipBits.bind(this),d=this.skipEG.bind(this),f=this.skipUEG.bind(this),g=this.skipScalingList.bind(this);A();const p=A();if(l(5),h(3),A(),f(),p===100||p===110||p===122||p===244||p===44||p===83||p===86||p===118||p===128){const R=c();if(R===3&&h(1),f(),f(),h(1),u())for(o=R!==3?8:12,a=0;a<o;a++)u()&&(a<6?g(16):g(64))}f();const v=c();if(v===0)c();else if(v===1)for(h(1),d(),d(),s=c(),a=0;a<s;a++)d();f(),h(1);const T=c(),b=c(),y=l(1);y===0&&h(1),h(1),u()&&(e=c(),t=c(),n=c(),i=c());let w=[1,1];if(u()&&u())switch(A()){case 1:w=[1,1];break;case 2:w=[12,11];break;case 3:w=[10,11];break;case 4:w=[16,11];break;case 5:w=[40,33];break;case 6:w=[24,11];break;case 7:w=[20,11];break;case 8:w=[32,11];break;case 9:w=[80,33];break;case 10:w=[18,11];break;case 11:w=[15,11];break;case 12:w=[64,33];break;case 13:w=[160,99];break;case 14:w=[4,3];break;case 15:w=[3,2];break;case 16:w=[2,1];break;case 255:{w=[A()<<8|A(),A()<<8|A()];break}}return{width:Math.ceil((T+1)*16-e*2-t*2),height:(2-y)*(b+1)*16-(y?2:4)*(n+i),pixelRatio:w}}readSliceType(){return this.readUByte(),this.readUEG(),this.readUEG()}}class KE extends VE{parseAVCPES(e,t,n,i,s){const o=this.parseAVCNALu(e,n.data);let a=this.VideoSample,A,l=!1;n.data=null,a&&o.length&&!e.audFound&&(this.pushAccessUnit(a,e),a=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts,"")),o.forEach(c=>{var u;switch(c.type){case 1:{let g=!1;A=!0;const p=c.data;if(l&&p.length>4){const v=new Su(p).readSliceType();(v===2||v===4||v===7||v===9)&&(g=!0)}if(g){var h;(h=a)!=null&&h.frame&&!a.key&&(this.pushAccessUnit(a,e),a=this.VideoSample=null)}a||(a=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts,"")),a.frame=!0,a.key=g;break}case 5:A=!0,(u=a)!=null&&u.frame&&!a.key&&(this.pushAccessUnit(a,e),a=this.VideoSample=null),a||(a=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts,"")),a.key=!0,a.frame=!0;break;case 6:{A=!0,Dc(c.data,1,n.pts,t.samples);break}case 7:{var d,f;A=!0,l=!0;const g=c.data,v=new Su(g).readSPS();if(!e.sps||e.width!==v.width||e.height!==v.height||((d=e.pixelRatio)==null?void 0:d[0])!==v.pixelRatio[0]||((f=e.pixelRatio)==null?void 0:f[1])!==v.pixelRatio[1]){e.width=v.width,e.height=v.height,e.pixelRatio=v.pixelRatio,e.sps=[g],e.duration=s;const T=g.subarray(1,4);let b="avc1.";for(let y=0;y<3;y++){let w=T[y].toString(16);w.length<2&&(w="0"+w),b+=w}e.codec=b}break}case 8:A=!0,e.pps=[c.data];break;case 9:A=!0,e.audFound=!0,a&&this.pushAccessUnit(a,e),a=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts,"");break;case 12:A=!0;break;default:A=!1,a&&(a.debug+="unknown NAL "+c.type+" ");break}a&&A&&a.units.push(c)}),i&&a&&(this.pushAccessUnit(a,e),this.VideoSample=null)}parseAVCNALu(e,t){const n=t.byteLength;let i=e.naluState||0;const s=i,o=[];let a=0,A,l,c,u=-1,h=0;for(i===-1&&(u=0,h=t[0]&31,i=0,a=1);a<n;){if(A=t[a++],!i){i=A?0:1;continue}if(i===1){i=A?0:2;continue}if(!A)i=3;else if(A===1){if(l=a-i-1,u>=0){const d={data:t.subarray(u,l),type:h};o.push(d)}else{const d=this.getLastNalUnit(e.samples);d&&(s&&a<=4-s&&d.state&&(d.data=d.data.subarray(0,d.data.byteLength-s)),l>0&&(d.data=Ot(d.data,t.subarray(0,l)),d.state=0))}a<n?(c=t[a]&31,u=a,h=c,i=0):i=-1}else i=0}if(u>=0&&i>=0){const d={data:t.subarray(u,n),type:h,state:i};o.push(d)}if(o.length===0){const d=this.getLastNalUnit(e.samples);d&&(d.data=Ot(d.data,t))}return e.naluState=i,o}}class JE{constructor(e,t,n){this.keyData=void 0,this.decrypter=void 0,this.keyData=n,this.decrypter=new ga(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer)}decryptAacSample(e,t,n){const i=e[t].unit;if(i.length<=16)return;const s=i.subarray(16,i.length-i.length%16),o=s.buffer.slice(s.byteOffset,s.byteOffset+s.length);this.decryptBuffer(o).then(a=>{const A=new Uint8Array(a);i.set(A,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,n)})}decryptAacSamples(e,t,n){for(;;t++){if(t>=e.length){n();return}if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,n),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const t=Math.floor((e.length-48)/160)*16+16,n=new Int8Array(t);let i=0;for(let s=32;s<e.length-16;s+=160,i+=16)n.set(e.subarray(s,s+16),i);return n}getAvcDecryptedUnit(e,t){const n=new Uint8Array(t);let i=0;for(let s=32;s<e.length-16;s+=160,i+=16)e.set(n.subarray(i,i+16),s);return e}decryptAvcSample(e,t,n,i,s){const o=_c(s.data),a=this.getAvcEncryptedData(o);this.decryptBuffer(a.buffer).then(A=>{s.data=this.getAvcDecryptedUnit(o,A),this.decrypter.isSync()||this.decryptAvcSamples(e,t,n+1,i)})}decryptAvcSamples(e,t,n,i){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,n=0){if(t>=e.length){i();return}const s=e[t].units;for(;!(n>=s.length);n++){const o=s[n];if(!(o.data.length<=48||o.type!==1&&o.type!==5)&&(this.decryptAvcSample(e,t,n,i,o),!this.decrypter.isSync()))return}}}}const dt=188;class Rr{constructor(e,t,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._videoTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.remainderData=null,this.videoParser=void 0,this.observer=e,this.config=t,this.typeSupported=n,this.videoParser=new KE}static probe(e){const t=Rr.syncOffset(e);return t>0&&U.warn(`MPEG2-TS detected but first sync word found @ offset ${t}`),t!==-1}static syncOffset(e){const t=e.length;let n=Math.min(dt*5,t-dt)+1,i=0;for(;i<n;){let s=!1,o=-1,a=0;for(let A=i;A<t;A+=dt)if(e[A]===71&&(t-A===dt||e[A+dt]===71)){if(a++,o===-1&&(o=A,o!==0&&(n=Math.min(o+dt*99,e.length-dt)+1)),s||(s=Ca(e,A)===0),s&&a>1&&(o===0&&a>2||A+dt>n))return o}else{if(a)return-1;break}i++}return-1}static createTrack(e,t){return{container:e==="video"||e==="audio"?"video/mp2t":void 0,type:e,id:Qc[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:e==="audio"?t:void 0}}resetInitSegment(e,t,n,i){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=Rr.createTrack("video"),this._audioTrack=Rr.createTrack("audio",i),this._id3Track=Rr.createTrack("id3"),this._txtTrack=Rr.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=n,this._duration=i}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_videoTrack:t,_id3Track:n}=this;e&&(e.pesData=null),t&&(t.pesData=null),n&&(n.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(e,t,n=!1,i=!1){n||(this.sampleAes=null);let s;const o=this._videoTrack,a=this._audioTrack,A=this._id3Track,l=this._txtTrack;let c=o.pid,u=o.pesData,h=a.pid,d=A.pid,f=a.pesData,g=A.pesData,p=null,v=this.pmtParsed,T=this._pmtId,b=e.length;if(this.remainderData&&(e=Ot(this.remainderData,e),b=e.length,this.remainderData=null),b<dt&&!i)return this.remainderData=e,{audioTrack:a,videoTrack:o,id3Track:A,textTrack:l};const y=Math.max(0,Rr.syncOffset(e));b-=(b-y)%dt,b<e.byteLength&&!i&&(this.remainderData=new Uint8Array(e.buffer,b,e.buffer.byteLength-b));let w=0;for(let k=y;k<b;k+=dt)if(e[k]===71){const $=!!(e[k+1]&64),W=Ca(e,k),O=(e[k+3]&48)>>4;let K;if(O>1){if(K=k+5+e[k+4],K===k+dt)continue}else K=k+4;switch(W){case c:$&&(u&&(s=Bn(u))&&this.videoParser.parseAVCPES(o,l,s,!1,this._duration),u={data:[],size:0}),u&&(u.data.push(e.subarray(K,k+dt)),u.size+=k+dt-K);break;case h:if($){if(f&&(s=Bn(f)))switch(a.segmentCodec){case"aac":this.parseAACPES(a,s);break;case"mp3":this.parseMPEGPES(a,s);break;case"ac3":this.parseAC3PES(a,s);break}f={data:[],size:0}}f&&(f.data.push(e.subarray(K,k+dt)),f.size+=k+dt-K);break;case d:$&&(g&&(s=Bn(g))&&this.parseID3PES(A,s),g={data:[],size:0}),g&&(g.data.push(e.subarray(K,k+dt)),g.size+=k+dt-K);break;case 0:$&&(K+=e[K]+1),T=this._pmtId=WE(e,K);break;case T:{$&&(K+=e[K]+1);const ne=qE(e,K,this.typeSupported,n,this.observer);c=ne.videoPid,c>0&&(o.pid=c,o.segmentCodec=ne.segmentVideoCodec),h=ne.audioPid,h>0&&(a.pid=h,a.segmentCodec=ne.segmentAudioCodec),d=ne.id3Pid,d>0&&(A.pid=d),p!==null&&!v&&(U.warn(`MPEG-TS PMT found at ${k} after unknown PID '${p}'. Backtracking to sync byte @${y} to parse all TS packets.`),p=null,k=y-188),v=this.pmtParsed=!0;break}case 17:case 8191:break;default:p=W;break}}else w++;w>0&&Qs(this.observer,new Error(`Found ${w} TS packet/s that do not start with 0x47`)),o.pesData=u,a.pesData=f,A.pesData=g;const R={audioTrack:a,videoTrack:o,id3Track:A,textTrack:l};return i&&this.extractRemainingSamples(R),R}flush(){const{remainderData:e}=this;this.remainderData=null;let t;return e?t=this.demux(e,-1,!1,!0):t={videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t}extractRemainingSamples(e){const{audioTrack:t,videoTrack:n,id3Track:i,textTrack:s}=e,o=n.pesData,a=t.pesData,A=i.pesData;let l;if(o&&(l=Bn(o))?(this.videoParser.parseAVCPES(n,s,l,!0,this._duration),n.pesData=null):n.pesData=o,a&&(l=Bn(a))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,l);break;case"mp3":this.parseMPEGPES(t,l);break;case"ac3":this.parseAC3PES(t,l);break}t.pesData=null}else a!=null&&a.size&&U.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=a;A&&(l=Bn(A))?(this.parseID3PES(i,l),i.pesData=null):i.pesData=A}demuxSampleAes(e,t,n){const i=this.demux(e,n,!0,!this.config.progressive),s=this.sampleAes=new JE(this.observer,this.config,t);return this.decrypt(i,s)}decrypt(e,t){return new Promise(n=>{const{audioTrack:i,videoTrack:s}=e;i.samples&&i.segmentCodec==="aac"?t.decryptAacSamples(i.samples,0,()=>{s.samples?t.decryptAvcSamples(s.samples,0,0,()=>{n(e)}):n(e)}):s.samples&&t.decryptAvcSamples(s.samples,0,0,()=>{n(e)})})}destroy(){this._duration=0}parseAACPES(e,t){let n=0;const i=this.aacOverFlow;let s=t.data;if(i){this.aacOverFlow=null;const u=i.missing,h=i.sample.unit.byteLength;if(u===-1)s=Ot(i.sample.unit,s);else{const d=h-u;i.sample.unit.set(s.subarray(0,u),d),e.samples.push(i.sample),n=i.missing}}let o,a;for(o=n,a=s.length;o<a-1&&!ys(s,o);o++);if(o!==n){let u;const h=o<a-1;if(h?u=`AAC PES did not start with ADTS header,offset:${o}`:u="No ADTS header found in AAC PES",Qs(this.observer,new Error(u),h),!h)return}Cu(e,this.observer,s,o,this.audioCodec);let A;if(t.pts!==void 0)A=t.pts;else if(i){const u=vu(e.samplerate);A=i.sample.pts+u}else{U.warn("[tsdemuxer]: AAC PES unknown PTS");return}let l=0,c;for(;o<a;)if(c=yu(e,s,o,A,l),o+=c.length,c.missing){this.aacOverFlow=c;break}else for(l++;o<a-1&&!ys(s,o);o++);}parseMPEGPES(e,t){const n=t.data,i=n.length;let s=0,o=0;const a=t.pts;if(a===void 0){U.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;o<i;)if(Tu(n,o)){const A=Bu(e,n,o,a,s);if(A)o+=A.length,s++;else break}else o++}parseAC3PES(e,t){{const n=t.data,i=t.pts;if(i===void 0){U.warn("[tsdemuxer]: AC3 PES unknown PTS");return}const s=n.length;let o=0,a=0,A;for(;a<s&&(A=wu(e,n,a,i,o++))>0;)a+=A}}parseID3PES(e,t){if(t.pts===void 0){U.warn("[tsdemuxer]: ID3 PES unknown PTS");return}const n=st({},t,{type:this._videoTrack?Jt.emsg:Jt.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(n)}}function Ca(r,e){return((r[e+1]&31)<<8)+r[e+2]}function WE(r,e){return(r[e+10]&31)<<8|r[e+11]}function qE(r,e,t,n,i){const s={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},o=(r[e+1]&15)<<8|r[e+2],a=e+3+o-4,A=(r[e+10]&15)<<8|r[e+11];for(e+=12+A;e<a;){const l=Ca(r,e),c=(r[e+3]&15)<<8|r[e+4];switch(r[e]){case 207:if(!n){va("ADTS AAC");break}case 15:s.audioPid===-1&&(s.audioPid=l);break;case 21:s.id3Pid===-1&&(s.id3Pid=l);break;case 219:if(!n){va("H.264");break}case 27:s.videoPid===-1&&(s.videoPid=l,s.segmentVideoCodec="avc");break;case 3:case 4:!t.mpeg&&!t.mp3?U.log("MPEG audio found, not supported in this browser"):s.audioPid===-1&&(s.audioPid=l,s.segmentAudioCodec="mp3");break;case 193:if(!n){va("AC-3");break}case 129:t.ac3?s.audioPid===-1&&(s.audioPid=l,s.segmentAudioCodec="ac3"):U.log("AC-3 audio found, not supported in this browser");break;case 6:if(s.audioPid===-1&&c>0){let u=e+5,h=c;for(;h>2;){switch(r[u]){case 106:t.ac3!==!0?U.log("AC-3 audio found, not supported in this browser for now"):(s.audioPid=l,s.segmentAudioCodec="ac3");break}const f=r[u+1]+2;u+=f,h-=f}}break;case 194:case 135:return Qs(i,new Error("Unsupported EC-3 in M2TS found")),s;case 36:return Qs(i,new Error("Unsupported HEVC in M2TS found")),s}e+=c+5}return s}function Qs(r,e,t){U.warn(`parsing error: ${e.message}`),r.emit(I.ERROR,I.ERROR,{type:ye.MEDIA_ERROR,details:V.FRAG_PARSING_ERROR,fatal:!1,levelRetry:t,error:e,reason:e.message})}function va(r){U.log(`${r} with AES-128-CBC encryption found in unencrypted stream`)}function Bn(r){let e=0,t,n,i,s,o;const a=r.data;if(!r||r.size===0)return null;for(;a[0].length<19&&a.length>1;)a[0]=Ot(a[0],a[1]),a.splice(1,1);if(t=a[0],(t[0]<<16)+(t[1]<<8)+t[2]===1){if(n=(t[4]<<8)+t[5],n&&n>r.size-6)return null;const l=t[7];l&192&&(s=(t[9]&14)*536870912+(t[10]&255)*4194304+(t[11]&254)*16384+(t[12]&255)*128+(t[13]&254)/2,l&64?(o=(t[14]&14)*536870912+(t[15]&255)*4194304+(t[16]&254)*16384+(t[17]&255)*128+(t[18]&254)/2,s-o>54e5&&(U.warn(`${Math.round((s-o)/9e4)}s delta between PTS and DTS, align them`),s=o)):o=s),i=t[8];let c=i+9;if(r.size<=c)return null;r.size-=c;const u=new Uint8Array(r.size);for(let h=0,d=a.length;h<d;h++){t=a[h];let f=t.byteLength;if(c)if(c>f){c-=f;continue}else t=t.subarray(c),f-=c,c=0;u.set(t,e),e+=f}return n&&(n-=i+3),{data:u,pts:s,dts:o,len:n}}return null}class XE extends ma{resetInitSegment(e,t,n,i){super.resetInitSegment(e,t,n,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const t=oi(e,0);let n=(t==null?void 0:t.length)||0;if(t&&e[n]===11&&e[n+1]===119&&jo(t)!==void 0&&xu(e,n)<=16)return!1;for(let i=e.length;n<i;n++)if(bu(e,n))return U.log("MPEG Audio sync word found !"),!0;return!1}canParse(e,t){return UE(e,t)}appendFrame(e,t,n){if(this.basePTS!==null)return Bu(e,t,n,this.basePTS,this.frameIndex)}}class Ru{static getSilentFrame(e,t){switch(e){case"mp4a.40.2":if(t===1)return new Uint8Array([0,200,0,128,35,128]);if(t===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(t===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(t===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(t===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(t===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(t===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(t===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(t===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}}}const Dr=Math.pow(2,32)-1;class G{static init(){G.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],dac3:[],"ac-3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};let e;for(e in G.types)G.types.hasOwnProperty(e)&&(G.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);const t=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),n=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);G.HDLR_TYPES={video:t,audio:n};const i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),s=new Uint8Array([0,0,0,0,0,0,0,0]);G.STTS=G.STSC=G.STCO=s,G.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),G.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),G.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),G.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);const o=new Uint8Array([105,115,111,109]),a=new Uint8Array([97,118,99,49]),A=new Uint8Array([0,0,0,1]);G.FTYP=G.box(G.types.ftyp,o,A,o,a),G.DINF=G.box(G.types.dinf,G.box(G.types.dref,i))}static box(e,...t){let n=8,i=t.length;const s=i;for(;i--;)n+=t[i].byteLength;const o=new Uint8Array(n);for(o[0]=n>>24&255,o[1]=n>>16&255,o[2]=n>>8&255,o[3]=n&255,o.set(e,4),i=0,n=8;i<s;i++)o.set(t[i],n),n+=t[i].byteLength;return o}static hdlr(e){return G.box(G.types.hdlr,G.HDLR_TYPES[e])}static mdat(e){return G.box(G.types.mdat,e)}static mdhd(e,t){t*=e;const n=Math.floor(t/(Dr+1)),i=Math.floor(t%(Dr+1));return G.box(G.types.mdhd,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,85,196,0,0]))}static mdia(e){return G.box(G.types.mdia,G.mdhd(e.timescale,e.duration),G.hdlr(e.type),G.minf(e))}static mfhd(e){return G.box(G.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"?G.box(G.types.minf,G.box(G.types.smhd,G.SMHD),G.DINF,G.stbl(e)):G.box(G.types.minf,G.box(G.types.vmhd,G.VMHD),G.DINF,G.stbl(e))}static moof(e,t,n){return G.box(G.types.moof,G.mfhd(e),G.traf(n,t))}static moov(e){let t=e.length;const n=[];for(;t--;)n[t]=G.trak(e[t]);return G.box.apply(null,[G.types.moov,G.mvhd(e[0].timescale,e[0].duration)].concat(n).concat(G.mvex(e)))}static mvex(e){let t=e.length;const n=[];for(;t--;)n[t]=G.trex(e[t]);return G.box.apply(null,[G.types.mvex,...n])}static mvhd(e,t){t*=e;const n=Math.floor(t/(Dr+1)),i=Math.floor(t%(Dr+1)),s=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 G.box(G.types.mvhd,s)}static sdtp(e){const t=e.samples||[],n=new Uint8Array(4+t.length);let i,s;for(i=0;i<t.length;i++)s=t[i].flags,n[i+4]=s.dependsOn<<4|s.isDependedOn<<2|s.hasRedundancy;return G.box(G.types.sdtp,n)}static stbl(e){return G.box(G.types.stbl,G.stsd(e),G.box(G.types.stts,G.STTS),G.box(G.types.stsc,G.STSC),G.box(G.types.stsz,G.STSZ),G.box(G.types.stco,G.STCO))}static avc1(e){let t=[],n=[],i,s,o;for(i=0;i<e.sps.length;i++)s=e.sps[i],o=s.byteLength,t.push(o>>>8&255),t.push(o&255),t=t.concat(Array.prototype.slice.call(s));for(i=0;i<e.pps.length;i++)s=e.pps[i],o=s.byteLength,n.push(o>>>8&255),n.push(o&255),n=n.concat(Array.prototype.slice.call(s));const a=G.box(G.types.avcC,new Uint8Array([1,t[3],t[4],t[5],255,224|e.sps.length].concat(t).concat([e.pps.length]).concat(n))),A=e.width,l=e.height,c=e.pixelRatio[0],u=e.pixelRatio[1];return G.box(G.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,A>>8&255,A&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]),a,G.box(G.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),G.box(G.types.pasp,new Uint8Array([c>>24,c>>16&255,c>>8&255,c&255,u>>24,u>>16&255,u>>8&255,u&255])))}static esds(e){const t=e.config.length;return new Uint8Array([0,0,0,0,3,23+t,0,1,0,4,15+t,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([t]).concat(e.config).concat([6,1,2]))}static audioStsd(e){const t=e.samplerate;return 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,t>>8&255,t&255,0,0])}static mp4a(e){return G.box(G.types.mp4a,G.audioStsd(e),G.box(G.types.esds,G.esds(e)))}static mp3(e){return G.box(G.types[".mp3"],G.audioStsd(e))}static ac3(e){return G.box(G.types["ac-3"],G.audioStsd(e),G.box(G.types.dac3,e.config))}static stsd(e){return e.type==="audio"?e.segmentCodec==="mp3"&&e.codec==="mp3"?G.box(G.types.stsd,G.STSD,G.mp3(e)):e.segmentCodec==="ac3"?G.box(G.types.stsd,G.STSD,G.ac3(e)):G.box(G.types.stsd,G.STSD,G.mp4a(e)):G.box(G.types.stsd,G.STSD,G.avc1(e))}static tkhd(e){const t=e.id,n=e.duration*e.timescale,i=e.width,s=e.height,o=Math.floor(n/(Dr+1)),a=Math.floor(n%(Dr+1));return G.box(G.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,t&255,0,0,0,0,o>>24,o>>16&255,o>>8&255,o&255,a>>24,a>>16&255,a>>8&255,a&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,s>>8&255,s&255,0,0]))}static traf(e,t){const n=G.sdtp(e),i=e.id,s=Math.floor(t/(Dr+1)),o=Math.floor(t%(Dr+1));return G.box(G.types.traf,G.box(G.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,i&255])),G.box(G.types.tfdt,new Uint8Array([1,0,0,0,s>>24,s>>16&255,s>>8&255,s&255,o>>24,o>>16&255,o>>8&255,o&255])),G.trun(e,n.length+16+20+8+16+8+8),n)}static trak(e){return e.duration=e.duration||4294967295,G.box(G.types.trak,G.tkhd(e),G.mdia(e))}static trex(e){const t=e.id;return G.box(G.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,t&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(e,t){const n=e.samples||[],i=n.length,s=12+16*i,o=new Uint8Array(s);let a,A,l,c,u,h;for(t+=8+s,o.set([e.type==="video"?1:0,0,15,1,i>>>24&255,i>>>16&255,i>>>8&255,i&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255],0),a=0;a<i;a++)A=n[a],l=A.duration,c=A.size,u=A.flags,h=A.cts,o.set([l>>>24&255,l>>>16&255,l>>>8&255,l&255,c>>>24&255,c>>>16&255,c>>>8&255,c&255,u.isLeading<<2|u.dependsOn,u.isDependedOn<<6|u.hasRedundancy<<4|u.paddingValue<<1|u.isNonSync,u.degradPrio&61440,u.degradPrio&15,h>>>24&255,h>>>16&255,h>>>8&255,h&255],12+16*a);return G.box(G.types.trun,o)}static initSegment(e){G.types||G.init();const t=G.moov(e);return Ot(G.FTYP,t)}}G.types=void 0,G.HDLR_TYPES=void 0,G.STTS=void 0,G.STSC=void 0,G.STCO=void 0,G.STSZ=void 0,G.VMHD=void 0,G.SMHD=void 0,G.STSD=void 0,G.FTYP=void 0,G.DINF=void 0;const Du=9e4;function ya(r,e,t=1,n=!1){const i=r*e*t;return n?Math.round(i):i}function jE(r,e,t=1,n=!1){return ya(r,e,1/t,n)}function li(r,e=!1){return ya(r,1e3,1/Du,e)}function zE(r,e=1){return ya(r,Du,1/e)}const ZE=10*1e3,_u=1024,eI=1152,tI=1536;let Qn=null,Ba=null;class Ts{constructor(e,t,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.videoTrackConfig=void 0,this.observer=e,this.config=t,this.typeSupported=n,this.ISGenerated=!1,Qn===null){const o=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Qn=o?parseInt(o[1]):0}if(Ba===null){const s=navigator.userAgent.match(/Safari\/(\d+)/i);Ba=s?parseInt(s[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(e){U.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=e}resetNextTimestamp(){U.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){U.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(e){let t=!1;const n=e.reduce((i,s)=>{const o=s.pts-i;return o<-4294967296?(t=!0,Ut(i,s.pts)):o>0?i:s.pts},e[0].pts);return t&&U.debug("PTS rollover detected"),n}remux(e,t,n,i,s,o,a,A){let l,c,u,h,d,f,g=s,p=s;const v=e.pid>-1,T=t.pid>-1,b=t.samples.length,y=e.samples.length>0,w=a&&b>0||b>1;if((!v||y)&&(!T||w)||this.ISGenerated||a){if(this.ISGenerated){var k,$,W,O;const Ae=this.videoTrackConfig;Ae&&(t.width!==Ae.width||t.height!==Ae.height||((k=t.pixelRatio)==null?void 0:k[0])!==(($=Ae.pixelRatio)==null?void 0:$[0])||((W=t.pixelRatio)==null?void 0:W[1])!==((O=Ae.pixelRatio)==null?void 0:O[1]))&&this.resetInitSegment()}else u=this.generateIS(e,t,s,o);const K=this.isVideoContiguous;let ne=-1,ee;if(w&&(ne=rI(t.samples),!K&&this.config.forceKeyFrameOnDiscontinuity))if(f=!0,ne>0){U.warn(`[mp4-remuxer]: Dropped ${ne} out of ${b} video samples due to a missing keyframe`);const Ae=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(ne),t.dropped+=ne,p+=(t.samples[0].pts-Ae)/t.inputTimeScale,ee=p}else ne===-1&&(U.warn(`[mp4-remuxer]: No keyframe found out of ${b} video samples`),f=!1);if(this.ISGenerated){if(y&&w){const Ae=this.getVideoStartPts(t.samples),P=(Ut(e.samples[0].pts,Ae)-Ae)/t.inputTimeScale;g+=Math.max(0,P),p+=Math.max(0,-P)}if(y){if(e.samplerate||(U.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),u=this.generateIS(e,t,s,o)),c=this.remuxAudio(e,g,this.isAudioContiguous,o,T||w||A===Ee.AUDIO?p:void 0),w){const Ae=c?c.endPTS-c.startPTS:0;t.inputTimeScale||(U.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),u=this.generateIS(e,t,s,o)),l=this.remuxVideo(t,p,K,Ae)}}else w&&(l=this.remuxVideo(t,p,K,0));l&&(l.firstKeyFrame=ne,l.independent=ne!==-1,l.firstKeyFramePTS=ee)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(n.samples.length&&(d=Lu(n,s,this._initPTS,this._initDTS)),i.samples.length&&(h=Fu(i,s,this._initPTS))),{audio:c,video:l,initSegment:u,independent:f,text:h,id3:d}}generateIS(e,t,n,i){const s=e.samples,o=t.samples,a=this.typeSupported,A={},l=this._initPTS;let c=!l||i,u="audio/mp4",h,d,f;if(c&&(h=d=1/0),e.config&&s.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":a.mpeg?(u="audio/mpeg",e.codec=""):a.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3";break}A.audio={id:"audio",container:u,codec:e.codec,initSegment:e.segmentCodec==="mp3"&&a.mpeg?new Uint8Array(0):G.initSegment([e]),metadata:{channelCount:e.channelCount}},c&&(f=e.inputTimeScale,!l||f!==l.timescale?h=d=s[0].pts-Math.round(f*n):c=!1)}if(t.sps&&t.pps&&o.length){if(t.timescale=t.inputTimeScale,A.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:G.initSegment([t]),metadata:{width:t.width,height:t.height}},c)if(f=t.inputTimeScale,!l||f!==l.timescale){const g=this.getVideoStartPts(o),p=Math.round(f*n);d=Math.min(d,Ut(o[0].dts,g)-p),h=Math.min(h,g-p)}else c=!1;this.videoTrackConfig={width:t.width,height:t.height,pixelRatio:t.pixelRatio}}if(Object.keys(A).length)return this.ISGenerated=!0,c?(this._initPTS={baseTime:h,timescale:f},this._initDTS={baseTime:d,timescale:f}):h=f=void 0,{tracks:A,initPTS:h,timescale:f}}remuxVideo(e,t,n,i){const s=e.inputTimeScale,o=e.samples,a=[],A=o.length,l=this._initPTS;let c=this.nextAvcDts,u=8,h=this.videoSampleDuration,d,f,g=Number.POSITIVE_INFINITY,p=Number.NEGATIVE_INFINITY,v=!1;if(!n||c===null){const S=t*s,F=o[0].pts-Ut(o[0].dts,o[0].pts);Qn&&c!==null&&Math.abs(S-F-c)<15e3?n=!0:c=S-F}const T=l.baseTime*s/l.timescale;for(let S=0;S<A;S++){const F=o[S];F.pts=Ut(F.pts-T,c),F.dts=Ut(F.dts-T,c),F.dts<o[S>0?S-1:S].dts&&(v=!0)}v&&o.sort(function(S,F){const J=S.dts-F.dts,Y=S.pts-F.pts;return J||Y}),d=o[0].dts,f=o[o.length-1].dts;const b=f-d,y=b?Math.round(b/(A-1)):h||e.inputTimeScale/30;if(n){const S=d-c,F=S>y,J=S<-1;if((F||J)&&(F?U.warn(`AVC: ${li(S,!0)} ms (${S}dts) hole between fragments detected at ${t.toFixed(3)}`):U.warn(`AVC: ${li(-S,!0)} ms (${S}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!J||c>=o[0].pts||Qn)){d=c;const Y=o[0].pts-S;if(F)o[0].dts=d,o[0].pts=Y;else for(let re=0;re<o.length&&!(o[re].dts>Y);re++)o[re].dts-=S,o[re].pts-=S;U.log(`Video: Initial PTS/DTS adjusted: ${li(Y,!0)}/${li(d,!0)}, delta: ${li(S,!0)} ms`)}}d=Math.max(0,d);let w=0,R=0,k=d;for(let S=0;S<A;S++){const F=o[S],J=F.units,Y=J.length;let re=0;for(let ce=0;ce<Y;ce++)re+=J[ce].data.length;R+=re,w+=Y,F.length=re,F.dts<k?(F.dts=k,k+=y/4|0||1):k=F.dts,g=Math.min(F.pts,g),p=Math.max(F.pts,p)}f=o[A-1].dts;const $=R+4*w+8;let W;try{W=new Uint8Array($)}catch(S){this.observer.emit(I.ERROR,I.ERROR,{type:ye.MUX_ERROR,details:V.REMUX_ALLOC_ERROR,fatal:!1,error:S,bytes:$,reason:`fail allocating video mdat ${$}`});return}const O=new DataView(W.buffer);O.setUint32(0,$),W.set(G.types.mdat,4);let K=!1,ne=Number.POSITIVE_INFINITY,ee=Number.POSITIVE_INFINITY,Ae=Number.NEGATIVE_INFINITY,_=Number.NEGATIVE_INFINITY;for(let S=0;S<A;S++){const F=o[S],J=F.units;let Y=0;for(let pe=0,ge=J.length;pe<ge;pe++){const Se=J[pe],Le=Se.data,Ge=Se.data.byteLength;O.setUint32(u,Ge),u+=4,W.set(Le,u),u+=Ge,Y+=4+Ge}let re;if(S<A-1)h=o[S+1].dts-F.dts,re=o[S+1].pts-F.pts;else{const pe=this.config,ge=S>0?F.dts-o[S-1].dts:y;if(re=S>0?F.pts-o[S-1].pts:y,pe.stretchShortVideoTrack&&this.nextAudioPts!==null){const Se=Math.floor(pe.maxBufferHole*s),Le=(i?g+i*s:this.nextAudioPts)-F.pts;Le>Se?(h=Le-ge,h<0?h=ge:K=!0,U.log(`[mp4-remuxer]: It is approximately ${Le/90} ms to the next segment; using duration ${h/90} ms for the last video frame.`)):h=ge}else h=ge}const ce=Math.round(F.pts-F.dts);ne=Math.min(ne,h),Ae=Math.max(Ae,h),ee=Math.min(ee,re),_=Math.max(_,re),a.push(new ku(F.key,h,Y,ce))}if(a.length){if(Qn){if(Qn<70){const S=a[0].flags;S.dependsOn=2,S.isNonSync=0}}else if(Ba&&_-ee<Ae-ne&&y/Ae<.025&&a[0].cts===0){U.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let S=d;for(let F=0,J=a.length;F<J;F++){const Y=S+a[F].duration,re=S+a[F].cts;if(F<J-1){const ce=Y+a[F+1].cts;a[F].duration=ce-re}else a[F].duration=F?a[F-1].duration:y;a[F].cts=0,S=Y}}}h=K||!h?y:h,this.nextAvcDts=c=f+h,this.videoSampleDuration=h,this.isVideoContiguous=!0;const D={data1:G.moof(e.sequenceNumber++,d,st({},e,{samples:a})),data2:W,startPTS:g/s,endPTS:(p+h)/s,startDTS:d/s,endDTS:c/s,type:"video",hasAudio:!1,hasVideo:!0,nb:a.length,dropped:e.dropped};return e.samples=[],e.dropped=0,D}getSamplesPerFrame(e){switch(e.segmentCodec){case"mp3":return eI;case"ac3":return tI;default:return _u}}remuxAudio(e,t,n,i,s){const o=e.inputTimeScale,a=e.samplerate?e.samplerate:o,A=o/a,l=this.getSamplesPerFrame(e),c=l*A,u=this._initPTS,h=e.segmentCodec==="mp3"&&this.typeSupported.mpeg,d=[],f=s!==void 0;let g=e.samples,p=h?0:8,v=this.nextAudioPts||-1;const T=t*o,b=u.baseTime*o/u.timescale;if(this.isAudioContiguous=n=n||g.length&&v>0&&(i&&Math.abs(T-v)<9e3||Math.abs(Ut(g[0].pts-b,T)-v)<20*c),g.forEach(function(P){P.pts=Ut(P.pts-b,T)}),!n||v<0){if(g=g.filter(P=>P.pts>=0),!g.length)return;s===0?v=0:i&&!f?v=Math.max(0,T):v=g[0].pts}if(e.segmentCodec==="aac"){const P=this.config.maxAudioFramesDrift;for(let X=0,D=v;X<g.length;X++){const S=g[X],F=S.pts,J=F-D,Y=Math.abs(1e3*J/o);if(J<=-P*c&&f)X===0&&(U.warn(`Audio frame @ ${(F/o).toFixed(3)}s overlaps nextAudioPts by ${Math.round(1e3*J/o)} ms.`),this.nextAudioPts=v=D=F);else if(J>=P*c&&Y<ZE&&f){let re=Math.round(J/c);D=F-re*c,D<0&&(re--,D+=c),X===0&&(this.nextAudioPts=v=D),U.warn(`[mp4-remuxer]: Injecting ${re} audio frame @ ${(D/o).toFixed(3)}s due to ${Math.round(1e3*J/o)} ms gap.`);for(let ce=0;ce<re;ce++){const pe=Math.max(D,0);let ge=Ru.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);ge||(U.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),ge=S.unit.subarray()),g.splice(X,0,{unit:ge,pts:pe}),D+=c,X++}}S.pts=D,D+=c}}let y=null,w=null,R,k=0,$=g.length;for(;$--;)k+=g[$].unit.byteLength;for(let P=0,X=g.length;P<X;P++){const D=g[P],S=D.unit;let F=D.pts;if(w!==null){const Y=d[P-1];Y.duration=Math.round((F-w)/A)}else if(n&&e.segmentCodec==="aac"&&(F=v),y=F,k>0){k+=p;try{R=new Uint8Array(k)}catch(Y){this.observer.emit(I.ERROR,I.ERROR,{type:ye.MUX_ERROR,details:V.REMUX_ALLOC_ERROR,fatal:!1,error:Y,bytes:k,reason:`fail allocating audio mdat ${k}`});return}h||(new DataView(R.buffer).setUint32(0,k),R.set(G.types.mdat,4))}else return;R.set(S,p);const J=S.byteLength;p+=J,d.push(new ku(!0,l,J,0)),w=F}const W=d.length;if(!W)return;const O=d[d.length-1];this.nextAudioPts=v=w+A*O.duration;const K=h?new Uint8Array(0):G.moof(e.sequenceNumber++,y/A,st({},e,{samples:d}));e.samples=[];const ne=y/o,ee=v/o,_={data1:K,data2:R,startPTS:ne,endPTS:ee,startDTS:ne,endDTS:ee,type:"audio",hasAudio:!0,hasVideo:!1,nb:W};return this.isAudioContiguous=!0,_}remuxEmptyAudio(e,t,n,i){const s=e.inputTimeScale,o=e.samplerate?e.samplerate:s,a=s/o,A=this.nextAudioPts,l=this._initDTS,c=l.baseTime*9e4/l.timescale,u=(A!==null?A:i.startDTS*s)+c,h=i.endDTS*s+c,d=a*_u,f=Math.ceil((h-u)/d),g=Ru.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(U.warn("[mp4-remuxer]: remux empty Audio"),!g){U.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}const p=[];for(let v=0;v<f;v++){const T=u+v*d;p.push({unit:g,pts:T,dts:T})}return e.samples=p,this.remuxAudio(e,t,n,!1)}}function Ut(r,e){let t;if(e===null)return r;for(e<r?t=-8589934592:t=8589934592;Math.abs(r-e)>4294967296;)r+=t;return r}function rI(r){for(let e=0;e<r.length;e++)if(r[e].key)return e;return-1}function Lu(r,e,t,n){const i=r.samples.length;if(!i)return;const s=r.inputTimeScale;for(let a=0;a<i;a++){const A=r.samples[a];A.pts=Ut(A.pts-t.baseTime*s/t.timescale,e*s)/s,A.dts=Ut(A.dts-n.baseTime*s/n.timescale,e*s)/s}const o=r.samples;return r.samples=[],{samples:o}}function Fu(r,e,t){const n=r.samples.length;if(!n)return;const i=r.inputTimeScale;for(let o=0;o<n;o++){const a=r.samples[o];a.pts=Ut(a.pts-t.baseTime*i/t.timescale,e*i)/i}r.samples.sort((o,a)=>o.pts-a.pts);const s=r.samples;return r.samples=[],{samples:s}}class ku{constructor(e,t,n,i){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=t,this.size=n,this.cts=i,this.flags={isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:e?2:1,isNonSync:e?0:1}}}class nI{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,t,n,i){this.audioCodec=t,this.videoCodec=n,this.generateInitSegment(cm(e,i)),this.emitInitSegment=!0}generateInitSegment(e){let{audioCodec:t,videoCodec:n}=this;if(!(e!=null&&e.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const i=this.initData=wc(e);i.audio&&(t=Nu(i.audio,He.AUDIO)),i.video&&(n=Nu(i.video,He.VIDEO));const s={};i.audio&&i.video?s.audiovideo={container:"video/mp4",codec:t+","+n,initSegment:e,id:"main"}:i.audio?s.audio={container:"audio/mp4",codec:t,initSegment:e,id:"audio"}:i.video?s.video={container:"video/mp4",codec:n,initSegment:e,id:"main"}:U.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=s}remux(e,t,n,i,s,o){var a,A;let{initPTS:l,lastEndTime:c}=this;const u={audio:void 0,video:void 0,text:i,id3:n,initSegment:void 0};he(c)||(c=this.lastEndTime=s||0);const h=t.samples;if(!(h!=null&&h.length))return u;const d={initPTS:void 0,timescale:1};let f=this.initData;if((a=f)!=null&&a.length||(this.generateInitSegment(h),f=this.initData),!((A=f)!=null&&A.length))return U.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),u;this.emitInitSegment&&(d.tracks=this.initTracks,this.emitInitSegment=!1);const g=hm(h,f),p=um(f,h),v=p===null?s:p;(iI(l,v,s,g)||d.timescale!==l.timescale&&o)&&(d.initPTS=v-s,l&&l.timescale===1&&U.warn(`Adjusting initPTS by ${d.initPTS-l.baseTime}`),this.initPTS=l={baseTime:d.initPTS,timescale:1});const T=e?v-l.baseTime/l.timescale:c,b=T+g;fm(f,h,l.baseTime/l.timescale),g>0?this.lastEndTime=b:(U.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const y=!!f.audio,w=!!f.video;let R="";y&&(R+="audio"),w&&(R+="video");const k={data1:h,startPTS:T,startDTS:T,endPTS:b,endDTS:b,type:R,hasAudio:y,hasVideo:w,nb:1,dropped:0};return u.audio=k.type==="audio"?k:void 0,u.video=k.type!=="audio"?k:void 0,u.initSegment=d,u.id3=Lu(n,s,l,l),i.samples.length&&(u.text=Fu(i,s,l)),u}}function iI(r,e,t,n){if(r===null)return!0;const i=Math.max(n,1),s=e-r.baseTime/r.timescale;return Math.abs(s-t)>i}function Nu(r,e){const t=r==null?void 0:r.codec;if(t&&t.length>4)return t;if(e===He.AUDIO){if(t==="ec-3"||t==="ac-3"||t==="alac")return t;if(t==="fLaC"||t==="Opus")return cs(t,!1);const n="mp4a.40.5";return U.info(`Parsed audio codec "${t}" or audio object type not handled. Using "${n}"`),n}return U.warn(`Unhandled video codec "${t}"`),t==="hvc1"||t==="hev1"?"hvc1.1.6.L120.90":t==="av01"?"av01.0.04M.08":"avc1.42e01e"}let Cr;try{Cr=self.performance.now.bind(self.performance)}catch{U.debug("Unable to use Performance API on this environment"),Cr=pn==null?void 0:pn.Date.now}const bs=[{demux:$E,remux:nI},{demux:Rr,remux:Ts},{demux:GE,remux:Ts},{demux:XE,remux:Ts}];bs.splice(2,0,{demux:YE,remux:Ts});class Mu{constructor(e,t,n,i,s){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=t,this.config=n,this.vendor=i,this.id=s}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,t,n,i){const s=n.transmuxing;s.executeStart=Cr();let o=new Uint8Array(e);const{currentTransmuxState:a,transmuxConfig:A}=this;i&&(this.currentTransmuxState=i);const{contiguous:l,discontinuity:c,trackSwitch:u,accurateTimeOffset:h,timeOffset:d,initSegmentChange:f}=i||a,{audioCodec:g,videoCodec:p,defaultInitPts:v,duration:T,initSegmentData:b}=A,y=sI(o,t);if(y&&y.method==="AES-128"){const $=this.getDecrypter();if($.isSync()){let W=$.softwareDecrypt(o,y.key.buffer,y.iv.buffer);if(n.part>-1&&(W=$.flush()),!W)return s.executeEnd=Cr(),Qa(n);o=new Uint8Array(W)}else return this.decryptionPromise=$.webCryptoDecrypt(o,y.key.buffer,y.iv.buffer).then(W=>{const O=this.push(W,null,n);return this.decryptionPromise=null,O}),this.decryptionPromise}const w=this.needsProbing(c,u);if(w){const $=this.configureTransmuxer(o);if($)return U.warn(`[transmuxer] ${$.message}`),this.observer.emit(I.ERROR,I.ERROR,{type:ye.MEDIA_ERROR,details:V.FRAG_PARSING_ERROR,fatal:!1,error:$,reason:$.message}),s.executeEnd=Cr(),Qa(n)}(c||u||f||w)&&this.resetInitSegment(b,g,p,T,t),(c||f||w)&&this.resetInitialTimestamp(v),l||this.resetContiguity();const R=this.transmux(o,y,d,h,n),k=this.currentTransmuxState;return k.contiguous=!0,k.discontinuity=!1,k.trackSwitch=!1,s.executeEnd=Cr(),R}flush(e){const t=e.transmuxing;t.executeStart=Cr();const{decrypter:n,currentTransmuxState:i,decryptionPromise:s}=this;if(s)return s.then(()=>this.flush(e));const o=[],{timeOffset:a}=i;if(n){const u=n.flush();u&&o.push(this.push(u,null,e))}const{demuxer:A,remuxer:l}=this;if(!A||!l)return t.executeEnd=Cr(),[Qa(e)];const c=A.flush(a);return xs(c)?c.then(u=>(this.flushRemux(o,u,e),o)):(this.flushRemux(o,c,e),o)}flushRemux(e,t,n){const{audioTrack:i,videoTrack:s,id3Track:o,textTrack:a}=t,{accurateTimeOffset:A,timeOffset:l}=this.currentTransmuxState;U.log(`[transmuxer.ts]: Flushed fragment ${n.sn}${n.part>-1?" p: "+n.part:""} of level ${n.level}`);const c=this.remuxer.remux(i,s,o,a,l,A,!0,this.id);e.push({remuxResult:c,chunkMeta:n}),n.transmuxing.executeEnd=Cr()}resetInitialTimestamp(e){const{demuxer:t,remuxer:n}=this;!t||!n||(t.resetTimeStamp(e),n.resetTimeStamp(e))}resetContiguity(){const{demuxer:e,remuxer:t}=this;!e||!t||(e.resetContiguity(),t.resetNextTimestamp())}resetInitSegment(e,t,n,i,s){const{demuxer:o,remuxer:a}=this;!o||!a||(o.resetInitSegment(e,t,n,i),a.resetInitSegment(e,t,n,s))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,t,n,i,s){let o;return t&&t.method==="SAMPLE-AES"?o=this.transmuxSampleAes(e,t,n,i,s):o=this.transmuxUnencrypted(e,n,i,s),o}transmuxUnencrypted(e,t,n,i){const{audioTrack:s,videoTrack:o,id3Track:a,textTrack:A}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(s,o,a,A,t,n,!1,this.id),chunkMeta:i}}transmuxSampleAes(e,t,n,i,s){return this.demuxer.demuxSampleAes(e,t,n).then(o=>({remuxResult:this.remuxer.remux(o.audioTrack,o.videoTrack,o.id3Track,o.textTrack,n,i,!1,this.id),chunkMeta:s}))}configureTransmuxer(e){const{config:t,observer:n,typeSupported:i,vendor:s}=this;let o;for(let h=0,d=bs.length;h<d;h++){var a;if((a=bs[h].demux)!=null&&a.probe(e)){o=bs[h];break}}if(!o)return new Error("Failed to find demuxer by probing fragment data");const A=this.demuxer,l=this.remuxer,c=o.remux,u=o.demux;(!l||!(l instanceof c))&&(this.remuxer=new c(n,t,i,s)),(!A||!(A instanceof u))&&(this.demuxer=new u(n,t,i),this.probe=u.probe)}needsProbing(e,t){return!this.demuxer||!this.remuxer||e||t}getDecrypter(){let e=this.decrypter;return e||(e=this.decrypter=new ga(this.config)),e}}function sI(r,e){let t=null;return r.byteLength>0&&(e==null?void 0:e.key)!=null&&e.iv!==null&&e.method!=null&&(t=e),t}const Qa=r=>({remuxResult:{},chunkMeta:r});function xs(r){return"then"in r&&r.then instanceof Function}class oI{constructor(e,t,n,i,s){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=t,this.initSegmentData=n,this.duration=i,this.defaultInitPts=s||null}}class aI{constructor(e,t,n,i,s,o){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=t,this.accurateTimeOffset=n,this.trackSwitch=i,this.timeOffset=s,this.initSegmentChange=o}}var Pu={exports:{}};(function(r){var e=Object.prototype.hasOwnProperty,t="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(t=!1));function i(A,l,c){this.fn=A,this.context=l,this.once=c||!1}function s(A,l,c,u,h){if(typeof c!="function")throw new TypeError("The listener must be a function");var d=new i(c,u||A,h),f=t?t+l:l;return A._events[f]?A._events[f].fn?A._events[f]=[A._events[f],d]:A._events[f].push(d):(A._events[f]=d,A._eventsCount++),A}function o(A,l){--A._eventsCount===0?A._events=new n:delete A._events[l]}function a(){this._events=new n,this._eventsCount=0}a.prototype.eventNames=function(){var l=[],c,u;if(this._eventsCount===0)return l;for(u in c=this._events)e.call(c,u)&&l.push(t?u.slice(1):u);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(c)):l},a.prototype.listeners=function(l){var c=t?t+l:l,u=this._events[c];if(!u)return[];if(u.fn)return[u.fn];for(var h=0,d=u.length,f=new Array(d);h<d;h++)f[h]=u[h].fn;return f},a.prototype.listenerCount=function(l){var c=t?t+l:l,u=this._events[c];return u?u.fn?1:u.length:0},a.prototype.emit=function(l,c,u,h,d,f){var g=t?t+l:l;if(!this._events[g])return!1;var p=this._events[g],v=arguments.length,T,b;if(p.fn){switch(p.once&&this.removeListener(l,p.fn,void 0,!0),v){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,c),!0;case 3:return p.fn.call(p.context,c,u),!0;case 4:return p.fn.call(p.context,c,u,h),!0;case 5:return p.fn.call(p.context,c,u,h,d),!0;case 6:return p.fn.call(p.context,c,u,h,d,f),!0}for(b=1,T=new Array(v-1);b<v;b++)T[b-1]=arguments[b];p.fn.apply(p.context,T)}else{var y=p.length,w;for(b=0;b<y;b++)switch(p[b].once&&this.removeListener(l,p[b].fn,void 0,!0),v){case 1:p[b].fn.call(p[b].context);break;case 2:p[b].fn.call(p[b].context,c);break;case 3:p[b].fn.call(p[b].context,c,u);break;case 4:p[b].fn.call(p[b].context,c,u,h);break;default:if(!T)for(w=1,T=new Array(v-1);w<v;w++)T[w-1]=arguments[w];p[b].fn.apply(p[b].context,T)}}return!0},a.prototype.on=function(l,c,u){return s(this,l,c,u,!1)},a.prototype.once=function(l,c,u){return s(this,l,c,u,!0)},a.prototype.removeListener=function(l,c,u,h){var d=t?t+l:l;if(!this._events[d])return this;if(!c)return o(this,d),this;var f=this._events[d];if(f.fn)f.fn===c&&(!h||f.once)&&(!u||f.context===u)&&o(this,d);else{for(var g=0,p=[],v=f.length;g<v;g++)(f[g].fn!==c||h&&!f[g].once||u&&f[g].context!==u)&&p.push(f[g]);p.length?this._events[d]=p.length===1?p[0]:p:o(this,d)}return this},a.prototype.removeAllListeners=function(l){var c;return l?(c=t?t+l:l,this._events[c]&&o(this,c)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=t,a.EventEmitter=a,r.exports=a})(Pu);var AI=Pu.exports,Ta=Dp(AI);class Ou{constructor(e,t,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 s=e.config;this.hls=e,this.id=t,this.useWorker=!!s.enableWorker,this.onTransmuxComplete=n,this.onFlush=i;const o=(l,c)=>{c=c||{},c.frag=this.frag,c.id=this.id,l===I.ERROR&&(this.error=c.error),this.hls.trigger(l,c)};this.observer=new Ta,this.observer.on(I.FRAG_DECRYPTED,o),this.observer.on(I.ERROR,o);const a=Wr(s.preferManagedMediaSource)||{isTypeSupported:()=>!1},A={mpeg:a.isTypeSupported("audio/mpeg"),mp3:a.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:a.isTypeSupported('audio/mp4; codecs="ac-3"')};if(this.useWorker&&typeof Worker<"u"&&(s.workerPath||xE())){try{s.workerPath?(U.log(`loading Web Worker ${s.workerPath} for "${t}"`),this.workerContext=SE(s.workerPath)):(U.log(`injecting Web Worker for "${t}"`),this.workerContext=wE()),this.onwmsg=u=>this.onWorkerMessage(u);const{worker:c}=this.workerContext;c.addEventListener("message",this.onwmsg),c.onerror=u=>{const h=new Error(`${u.message} (${u.filename}:${u.lineno})`);s.enableWorker=!1,U.warn(`Error in "${t}" Web Worker, fallback to inline`),this.hls.trigger(I.ERROR,{type:ye.OTHER_ERROR,details:V.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:h})},c.postMessage({cmd:"init",typeSupported:A,vendor:"",id:t,config:JSON.stringify(s)})}catch(c){U.warn(`Error setting up "${t}" Web Worker, fallback to inline`,c),this.resetWorker(),this.error=null,this.transmuxer=new Mu(this.observer,A,s,"",t)}return}this.transmuxer=new Mu(this.observer,A,s,"",t)}resetWorker(){if(this.workerContext){const{worker:e,objectURL:t}=this.workerContext;t&&self.URL.revokeObjectURL(t),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 t=this.transmuxer;t&&(t.destroy(),this.transmuxer=null)}const e=this.observer;e&&e.removeAllListeners(),this.frag=null,this.observer=null,this.hls=null}push(e,t,n,i,s,o,a,A,l,c){var u,h;l.transmuxing.start=self.performance.now();const{transmuxer:d}=this,f=o?o.start:s.start,g=s.decryptdata,p=this.frag,v=!(p&&s.cc===p.cc),T=!(p&&l.level===p.level),b=p?l.sn-p.sn:-1,y=this.part?l.part-this.part.index:-1,w=b===0&&l.id>1&&l.id===(p==null?void 0:p.stats.chunkCount),R=!T&&(b===1||b===0&&(y===1||w&&y<=0)),k=self.performance.now();(T||b||s.stats.parsing.start===0)&&(s.stats.parsing.start=k),o&&(y||!R)&&(o.stats.parsing.start=k);const $=!(p&&((u=s.initSegment)==null?void 0:u.url)===((h=p.initSegment)==null?void 0:h.url)),W=new aI(v,R,A,T,f,$);if(!R||v||$){U.log(`[transmuxer-interface, ${s.type}]: Starting new transmux session for sn: ${l.sn} p: ${l.part} level: ${l.level} id: ${l.id}
|
2471
|
-
discontinuity: ${
|
2470
|
+
Switching to level ${J} @ ${ne|0} bps`),i.trigger(I.FRAG_LOAD_EMERGENCY_ABORTED,{frag:t,part:n,stats:l})},this.hls=e,this.bwEstimator=this.initEstimator(),this.registerListeners()}resetEstimator(e){e&&(U.log(`setting initial bwe to ${e}`),this.hls.config.abrEwmaDefaultEstimate=e),this.firstSelection=-1,this.bwEstimator=this.initEstimator()}initEstimator(){const e=this.hls.config;return new eE(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}registerListeners(){const{hls:e}=this;e.on(I.MANIFEST_LOADING,this.onManifestLoading,this),e.on(I.FRAG_LOADING,this.onFragLoading,this),e.on(I.FRAG_LOADED,this.onFragLoaded,this),e.on(I.FRAG_BUFFERED,this.onFragBuffered,this),e.on(I.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(I.LEVEL_LOADED,this.onLevelLoaded,this),e.on(I.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(I.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(I.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e&&(e.off(I.MANIFEST_LOADING,this.onManifestLoading,this),e.off(I.FRAG_LOADING,this.onFragLoading,this),e.off(I.FRAG_LOADED,this.onFragLoaded,this),e.off(I.FRAG_BUFFERED,this.onFragBuffered,this),e.off(I.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(I.LEVEL_LOADED,this.onLevelLoaded,this),e.off(I.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(I.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(I.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(e,t){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}onLevelsUpdated(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}onMaxAutoLevelUpdated(){this.firstSelection=-1,this.nextAutoLevelKey=""}onFragLoading(e,t){const n=t.frag;if(!this.ignoreFragment(n)){if(!n.bitrateTest){var i;this.fragCurrent=n,this.partCurrent=(i=t.part)!=null?i:null}this.clearTimer(),this.timer=self.setInterval(this._abandonRulesCheck,100)}}onLevelSwitching(e,t){this.clearTimer()}onError(e,t){if(!t.fatal)switch(t.details){case K.BUFFER_ADD_CODEC_ERROR:case K.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case K.FRAG_LOAD_TIMEOUT:{const n=t.frag,{fragCurrent:i,partCurrent:s}=this;if(n&&i&&n.sn===i.sn&&n.level===i.level){const o=performance.now(),a=s?s.stats:n.stats,l=o-a.loading.start,A=a.loading.first?a.loading.first-a.loading.start:-1;if(a.loaded&&A>-1){const u=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(l-Math.min(u,A),a.loaded)}else this.bwEstimator.sampleTTFB(l)}break}}}getTimeToLoadFrag(e,t,n,i){const s=e+n/t,o=i?this.lastLevelLoadSec:0;return s+o}onLevelLoaded(e,t){const n=this.hls.config,{loading:i}=t.stats,s=i.end-i.start;he(s)&&(this.lastLevelLoadSec=s/1e3),t.details.live?this.bwEstimator.update(n.abrEwmaSlowLive,n.abrEwmaFastLive):this.bwEstimator.update(n.abrEwmaSlowVoD,n.abrEwmaFastVoD)}onFragLoaded(e,{frag:t,part:n}){const i=n?n.stats:t.stats;if(t.type===Ee.MAIN&&this.bwEstimator.sampleTTFB(i.loading.first-i.loading.start),!this.ignoreFragment(t)){if(this.clearTimer(),t.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const s=n?n.duration:t.duration,o=this.hls.levels[t.level],a=(o.loaded?o.loaded.bytes:0)+i.loaded,l=(o.loaded?o.loaded.duration:0)+s;o.loaded={bytes:a,duration:l},o.realBitrate=Math.round(8*a/l)}if(t.bitrateTest){const s={stats:i,frag:t,part:n,id:t.type};this.onFragBuffered(I.FRAG_BUFFERED,s),t.bitrateTest=!1}else this.lastLoadedFragLevel=t.level}}onFragBuffered(e,t){const{frag:n,part:i}=t,s=i!=null&&i.stats.loaded?i.stats:n.stats;if(s.aborted||this.ignoreFragment(n))return;const o=s.parsing.end-s.loading.start-Math.min(s.loading.first-s.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(o,s.loaded),s.bwEstimate=this.getBwEstimate(),n.bitrateTest?this.bitrateTestDelay=o/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==Ee.MAIN||e.sn==="initSegment"}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:e,minAutoLevel:t}=this.hls,n=this.getBwEstimate(),i=this.hls.config.maxStarvationDelay,s=this.findBestLevel(n,t,e,0,i,1,1);if(s>-1)return s;const o=this.hls.firstLevel,a=Math.min(Math.max(o,t),e);return U.warn(`[abr] Could not find best starting auto level. Defaulting to first in playlist ${o} clamped to ${a}`),a}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const e=this.forcedAutoLevel,n=this.bwEstimator.canEstimate(),i=this.lastLoadedFragLevel>-1;if(e!==-1&&(!n||!i||this.nextAutoLevelKey===this.getAutoLevelKey()))return e;const s=n&&i?this.getNextABRAutoLevel():this.firstAutoLevel;if(e!==-1){const o=this.hls.levels;if(o.length>Math.max(e,s)&&o[e].loadError<=o[s].loadError)return e}return this._nextAutoLevel=s,this.nextAutoLevelKey=this.getAutoLevelKey(),s}getAutoLevelKey(){return`${this.getBwEstimate()}_${this.getStarvationDelay().toFixed(2)}`}getNextABRAutoLevel(){const{fragCurrent:e,partCurrent:t,hls:n}=this,{maxAutoLevel:i,config:s,minAutoLevel:o}=n,a=t?t.duration:e?e.duration:0,l=this.getBwEstimate(),A=this.getStarvationDelay();let c=s.abrBandWidthFactor,u=s.abrBandWidthUpFactor;if(A){const p=this.findBestLevel(l,o,i,A,0,c,u);if(p>=0)return p}let h=a?Math.min(a,s.maxStarvationDelay):s.maxStarvationDelay;if(!A){const p=this.bitrateTestDelay;p&&(h=(a?Math.min(a,s.maxLoadingDelay):s.maxLoadingDelay)-p,U.info(`[abr] bitrate test took ${Math.round(1e3*p)}ms, set first fragment max fetchDuration to ${Math.round(1e3*h)} ms`),c=u=1)}const d=this.findBestLevel(l,o,i,A,h,c,u);if(U.info(`[abr] ${A?"rebuffering expected":"buffer is empty"}, optimal quality level ${d}`),d>-1)return d;const f=n.levels[o],g=n.levels[n.loadLevel];return(f==null?void 0:f.bitrate)<(g==null?void 0:g.bitrate)?o:n.loadLevel}getStarvationDelay(){const e=this.hls,t=e.media;if(!t)return 1/0;const n=t&&t.playbackRate!==0?Math.abs(t.playbackRate):1,i=e.mainForwardBufferInfo;return(i?i.len:0)/n}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(e,t,n,i,s,o,a){var l;const A=i+s,c=this.lastLoadedFragLevel,u=c===-1?this.hls.firstLevel:c,{fragCurrent:h,partCurrent:d}=this,{levels:f,allAudioTracks:g,loadLevel:p,config:C}=this.hls;if(f.length===1)return 0;const T=f[u],b=!!(T!=null&&(l=T.details)!=null&&l.live),y=p===-1||c===-1;let x,R="SDR",k=(T==null?void 0:T.frameRate)||0;const{audioPreference:$,videoPreference:V}=C,O=this.audioTracksByGroup||(this.audioTracksByGroup=aE(g));if(y){if(this.firstSelection!==-1)return this.firstSelection;const D=this.codecTiers||(this.codecTiers=lE(f,O,t,n)),P=oE(D,R,e,$,V),{codecSet:X,videoRanges:_,minFramerate:S,minBitrate:F,preferHDR:W}=P;x=X,R=W?_[_.length-1]:_[0],k=S,e=Math.max(e,F),U.log(`[abr] picked start tier ${JSON.stringify(P)}`)}else x=T==null?void 0:T.codecSet,R=T==null?void 0:T.videoRange;const J=d?d.duration:h?h.duration:0,ne=this.bwEstimator.getEstimateTTFB()/1e3,ee=[];for(let D=n;D>=t;D--){var le;const P=f[D],X=D>u;if(!P)continue;if(C.useMediaCapabilities&&!P.supportedResult&&!P.supportedPromise){const ce=navigator.mediaCapabilities;typeof(ce==null?void 0:ce.decodingInfo)=="function"&&tE(P,O,R,k,e,$)?(P.supportedPromise=rE(P,O,ce),P.supportedPromise.then(pe=>{if(!this.hls)return;P.supportedResult=pe;const ge=this.hls.levels,Se=ge.indexOf(P);pe.error?U.warn(`[abr] MediaCapabilities decodingInfo error: "${pe.error}" for level ${Se} ${JSON.stringify(pe)}`):pe.supported||(U.warn(`[abr] Unsupported MediaCapabilities decodingInfo result for level ${Se} ${JSON.stringify(pe)}`),Se>-1&&ge.length>1&&(U.log(`[abr] Removing unsupported level ${Se}`),this.hls.removeLevel(Se)))})):P.supportedResult=Au}if(x&&P.codecSet!==x||R&&P.videoRange!==R||X&&k>P.frameRate||!X&&k>0&&k<P.frameRate||P.supportedResult&&!((le=P.supportedResult.decodingInfoResults)!=null&&le[0].smooth)){ee.push(D);continue}const _=P.details,S=(d?_==null?void 0:_.partTarget:_==null?void 0:_.averagetargetduration)||J;let F;X?F=a*e:F=o*e;const W=J&&i>=J*2&&s===0?f[D].averageBitrate:f[D].maxBitrate,Y=this.getTimeToLoadFrag(ne,F,W*S,_===void 0);if(F>=W&&(D===c||P.loadError===0&&P.fragmentError===0)&&(Y<=ne||!he(Y)||b&&!this.bitrateTestDelay||Y<A)){const ce=this.forcedAutoLevel;return D!==p&&(ce===-1||ce!==p)&&(ee.length&&U.trace(`[abr] Skipped level(s) ${ee.join(",")} of ${n} max with CODECS and VIDEO-RANGE:"${f[ee[0]].codecs}" ${f[ee[0]].videoRange}; not compatible with "${T.codecs}" ${R}`),U.info(`[abr] switch candidate:${u}->${D} adjustedbw(${Math.round(F)})-bitrate=${Math.round(F-W)} ttfb:${ne.toFixed(1)} avgDuration:${S.toFixed(1)} maxFetchDuration:${A.toFixed(1)} fetchDuration:${Y.toFixed(1)} firstSelection:${y} codecSet:${x} videoRange:${R} hls.loadLevel:${p}`)),y&&(this.firstSelection=D),D}}return-1}set nextAutoLevel(e){const{maxAutoLevel:t,minAutoLevel:n}=this.hls,i=Math.min(Math.max(e,n),t);this._nextAutoLevel!==i&&(this.nextAutoLevelKey="",this._nextAutoLevel=i)}}class hE{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(){}}var ht={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class dE{constructor(e){this.activePartLists=Object.create(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(I.BUFFER_APPENDED,this.onBufferAppended,this),e.on(I.FRAG_BUFFERED,this.onFragBuffered,this),e.on(I.FRAG_LOADED,this.onFragLoaded,this)}_unregisterListeners(){const{hls:e}=this;e.off(I.BUFFER_APPENDED,this.onBufferAppended,this),e.off(I.FRAG_BUFFERED,this.onFragBuffered,this),e.off(I.FRAG_LOADED,this.onFragLoaded,this)}destroy(){this._unregisterListeners(),this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(e,t){const n=this.activePartLists[t];if(n)for(let i=n.length;i--;){const s=n[i];if(!s)break;const o=s.end;if(s.start<=e&&o!==null&&e<=o)return s}return this.getBufferedFrag(e,t)}getBufferedFrag(e,t){const{fragments:n}=this,i=Object.keys(n);for(let s=i.length;s--;){const o=n[i[s]];if((o==null?void 0:o.body.type)===t&&o.buffered){const a=o.body;if(a.start<=e&&e<=a.end)return a}}return null}detectEvictedFragments(e,t,n,i){this.timeRanges&&(this.timeRanges[e]=t);const s=(i==null?void 0:i.fragment.sn)||-1;Object.keys(this.fragments).forEach(o=>{const a=this.fragments[o];if(!a||s>=a.body.sn)return;if(!a.buffered&&!a.loaded){a.body.type===n&&this.removeFragment(a.body);return}const l=a.range[e];l&&l.time.some(A=>{const c=!this.isTimeBuffered(A.startPTS,A.endPTS,t);return c&&this.removeFragment(a.body),c})})}detectPartialFragments(e){const t=this.timeRanges,{frag:n,part:i}=e;if(!t||n.sn==="initSegment")return;const s=yn(n),o=this.fragments[s];if(!o||o.buffered&&n.gap)return;const a=!n.relurl;Object.keys(t).forEach(l=>{const A=n.elementaryStreams[l];if(!A)return;const c=t[l],u=a||A.partial===!0;o.range[l]=this.getBufferedTimes(n,i,u,c)}),o.loaded=null,Object.keys(o.range).length?(o.buffered=!0,(o.body.endList=n.endList||o.body.endList)&&(this.endListFragments[o.body.type]=o),Es(o)||this.removeParts(n.sn-1,n.type)):this.removeFragment(o.body)}removeParts(e,t){const n=this.activePartLists[t];n&&(this.activePartLists[t]=n.filter(i=>i.fragment.sn>=e))}fragBuffered(e,t){const n=yn(e);let i=this.fragments[n];!i&&t&&(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,t,n,i){const s={time:[],partial:n},o=e.start,a=e.end,l=e.minEndPTS||a,A=e.maxStartPTS||o;for(let c=0;c<i.length;c++){const u=i.start(c)-this.bufferPadding,h=i.end(c)+this.bufferPadding;if(A>=u&&l<=h){s.time.push({startPTS:Math.max(o,i.start(c)),endPTS:Math.min(a,i.end(c))});break}else if(o<h&&a>u){const d=Math.max(o,i.start(c)),f=Math.min(a,i.end(c));f>d&&(s.partial=!0,s.time.push({startPTS:d,endPTS:f}))}else if(a<=u)break}return s}getPartialFragment(e){let t=null,n,i,s,o=0;const{bufferPadding:a,fragments:l}=this;return Object.keys(l).forEach(A=>{const c=l[A];c&&Es(c)&&(i=c.body.start-a,s=c.body.end+a,e>=i&&e<=s&&(n=Math.min(e-i,s-e),o<=n&&(t=c.body,o=n)))}),t}isEndListAppended(e){const t=this.endListFragments[e];return t!==void 0&&(t.buffered||Es(t))}getState(e){const t=yn(e),n=this.fragments[t];return n?n.buffered?Es(n)?ht.PARTIAL:ht.OK:ht.APPENDING:ht.NOT_LOADED}isTimeBuffered(e,t,n){let i,s;for(let o=0;o<n.length;o++){if(i=n.start(o)-this.bufferPadding,s=n.end(o)+this.bufferPadding,e>=i&&t<=s)return!0;if(t<=i)return!1}return!1}onFragLoaded(e,t){const{frag:n,part:i}=t;if(n.sn==="initSegment"||n.bitrateTest)return;const s=i?null:t,o=yn(n);this.fragments[o]={body:n,appendedPTS:null,loaded:s,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:n,part:i,timeRanges:s}=t;if(n.sn==="initSegment")return;const o=n.type;if(i){let a=this.activePartLists[o];a||(this.activePartLists[o]=a=[]),a.push(i)}this.timeRanges=s,Object.keys(s).forEach(a=>{const l=s[a];this.detectEvictedFragments(a,l,o,i)})}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=yn(e);return!!this.fragments[t]}hasParts(e){var t;return!!((t=this.activePartLists[e])!=null&&t.length)}removeFragmentsInRange(e,t,n,i,s){i&&!this.hasGaps||Object.keys(this.fragments).forEach(o=>{const a=this.fragments[o];if(!a)return;const l=a.body;l.type!==n||i&&!l.gap||l.start<t&&l.end>e&&(a.buffered||s)&&this.removeFragment(l)})}removeFragment(e){const t=yn(e);e.stats.loaded=0,e.clearElementaryStreamInfo();const n=this.activePartLists[e.type];if(n){const i=e.sn;this.activePartLists[e.type]=n.filter(s=>s.fragment.sn!==i)}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1}}function Es(r){var e,t,n;return r.buffered&&(r.body.gap||((e=r.range.video)==null?void 0:e.partial)||((t=r.range.audio)==null?void 0:t.partial)||((n=r.range.audiovideo)==null?void 0:n.partial))}function yn(r){return`${r.type}_${r.level}_${r.sn}`}const fE={length:0,start:()=>0,end:()=>0};class Ve{static isBuffered(e,t){try{if(e){const n=Ve.getBuffered(e);for(let i=0;i<n.length;i++)if(t>=n.start(i)&&t<=n.end(i))return!0}}catch{}return!1}static bufferInfo(e,t,n){try{if(e){const i=Ve.getBuffered(e),s=[];let o;for(o=0;o<i.length;o++)s.push({start:i.start(o),end:i.end(o)});return this.bufferedInfo(s,t,n)}}catch{}return{len:0,start:t,end:t,nextStart:void 0}}static bufferedInfo(e,t,n){t=Math.max(0,t),e.sort(function(A,c){const u=A.start-c.start;return u||c.end-A.end});let i=[];if(n)for(let A=0;A<e.length;A++){const c=i.length;if(c){const u=i[c-1].end;e[A].start-u<n?e[A].end>u&&(i[c-1].end=e[A].end):i.push(e[A])}else i.push(e[A])}else i=e;let s=0,o,a=t,l=t;for(let A=0;A<i.length;A++){const c=i[A].start,u=i[A].end;if(t+n>=c&&t<u)a=c,l=u,s=l-t;else if(t+n<c){o=c;break}}return{len:s,start:a||0,end:l||0,nextStart:o}}static getBuffered(e){try{return e.buffered}catch(t){return U.log("failed to get media.buffered",t),fE}}}class ga{constructor(e,t,n,i=0,s=-1,o=!1){this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=Is(),this.buffering={audio:Is(),video:Is(),audiovideo:Is()},this.level=e,this.sn=t,this.id=n,this.size=i,this.part=s,this.partial=o}}function Is(){return{start:0,executeStart:0,executeEnd:0,end:0}}function Cs(r,e){for(let n=0,i=r.length;n<i;n++){var t;if(((t=r[n])==null?void 0:t.cc)===e)return r[n]}return null}function gE(r,e,t){return!!(e&&(t.endCC>t.startCC||r&&r.cc<t.startCC))}function pE(r,e){const t=r.fragments,n=e.fragments;if(!n.length||!t.length){U.log("No fragments to align");return}const i=Cs(t,n[0].cc);if(!i||i&&!i.startPTS){U.log("No frag in previous level to align on");return}return i}function hu(r,e){if(r){const t=r.start+e;r.start=r.startPTS=t,r.endPTS=t+r.duration}}function du(r,e){const t=e.fragments;for(let n=0,i=t.length;n<i;n++)hu(t[n],r);e.fragmentHint&&hu(e.fragmentHint,r),e.alignedSliding=!0}function mE(r,e,t){e&&(EE(r,t,e),!t.alignedSliding&&e&&vs(t,e),!t.alignedSliding&&e&&!t.skippedSegments&&ru(e,t))}function EE(r,e,t){if(gE(r,t,e)){const n=pE(t,e);n&&he(n.start)&&(U.log(`Adjusting PTS using last level due to CC increase within current level ${e.url}`),du(n.start,e))}}function vs(r,e){if(!r.hasProgramDateTime||!e.hasProgramDateTime)return;const t=r.fragments,n=e.fragments;if(!t.length||!n.length)return;let i,s;const o=Math.min(e.endCC,r.endCC);e.startCC<o&&r.startCC<o&&(i=Cs(n,o),s=Cs(t,o)),(!i||!s)&&(i=n[Math.floor(n.length/2)],s=Cs(t,i.cc)||t[Math.floor(t.length/2)]);const a=i.programDateTime,l=s.programDateTime;if(!a||!l)return;const A=(l-a)/1e3-(s.start-i.start);du(A,r)}const fu=Math.pow(2,17);class IE{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,t){const n=e.url;if(!n)return Promise.reject(new Ir({type:ye.NETWORK_ERROR,details:K.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,s=i.fLoader,o=i.loader;return new Promise((a,l)=>{if(this.loader&&this.loader.destroy(),e.gap)if(e.tagList.some(d=>d[0]==="GAP")){l(pu(e));return}else e.gap=!1;const A=this.loader=e.loader=s?new s(i):new o(i),c=gu(e),u=au(i.fragLoadPolicy.default),h={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:e.sn==="initSegment"?1/0:fu};e.stats=A.stats,A.load(c,h,{onSuccess:(d,f,g,p)=>{this.resetLoader(e,A);let C=d.data;g.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(C.slice(0,16)),C=C.slice(16)),a({frag:e,part:null,payload:C,networkDetails:p})},onError:(d,f,g,p)=>{this.resetLoader(e,A),l(new Ir({type:ye.NETWORK_ERROR,details:K.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:ut({url:n,data:void 0},d),error:new Error(`HTTP Error ${d.code} ${d.text}`),networkDetails:g,stats:p}))},onAbort:(d,f,g)=>{this.resetLoader(e,A),l(new Ir({type:ye.NETWORK_ERROR,details:K.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:g,stats:d}))},onTimeout:(d,f,g)=>{this.resetLoader(e,A),l(new Ir({type:ye.NETWORK_ERROR,details:K.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${h.timeout}ms`),networkDetails:g,stats:d}))},onProgress:(d,f,g,p)=>{t&&t({frag:e,part:null,payload:g,networkDetails:p})}})})}loadPart(e,t,n){this.abort();const i=this.config,s=i.fLoader,o=i.loader;return new Promise((a,l)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap){l(pu(e,t));return}const A=this.loader=e.loader=s?new s(i):new o(i),c=gu(e,t),u=au(i.fragLoadPolicy.default),h={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:fu};t.stats=A.stats,A.load(c,h,{onSuccess:(d,f,g,p)=>{this.resetLoader(e,A),this.updateStatsFromPart(e,t);const C={frag:e,part:t,payload:d.data,networkDetails:p};n(C),a(C)},onError:(d,f,g,p)=>{this.resetLoader(e,A),l(new Ir({type:ye.NETWORK_ERROR,details:K.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:ut({url:c.url,data:void 0},d),error:new Error(`HTTP Error ${d.code} ${d.text}`),networkDetails:g,stats:p}))},onAbort:(d,f,g)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,A),l(new Ir({type:ye.NETWORK_ERROR,details:K.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:g,stats:d}))},onTimeout:(d,f,g)=>{this.resetLoader(e,A),l(new Ir({type:ye.NETWORK_ERROR,details:K.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${h.timeout}ms`),networkDetails:g,stats:d}))}})})}updateStatsFromPart(e,t){const n=e.stats,i=t.stats,s=i.total;if(n.loaded+=i.loaded,s){const l=Math.round(e.duration/t.duration),A=Math.min(Math.round(n.loaded/s),l),u=(l-A)*Math.round(n.loaded/A);n.total=n.loaded+u}else n.total=Math.max(n.loaded,n.total);const o=n.loading,a=i.loading;o.start?o.first+=a.first-a.start:(o.start=a.start,o.first=a.first),o.end=a.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function gu(r,e=null){const t=e||r,n={frag:r,part:e,responseType:"arraybuffer",url:t.url,headers:{},rangeStart:0,rangeEnd:0},i=t.byteRangeStartOffset,s=t.byteRangeEndOffset;if(he(i)&&he(s)){var o;let a=i,l=s;if(r.sn==="initSegment"&&((o=r.decryptdata)==null?void 0:o.method)==="AES-128"){const A=s-i;A%16&&(l=s+(16-A%16)),i!==0&&(n.resetIV=!0,a=i-16)}n.rangeStart=a,n.rangeEnd=l}return n}function pu(r,e){const t=new Error(`GAP ${r.gap?"tag":"attribute"} found`),n={type:ye.MEDIA_ERROR,details:K.FRAG_GAP,fatal:!1,frag:r,error:t,networkDetails:null};return e&&(n.part=e),(e||r).stats.aborted=!0,new Ir(n)}class Ir extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class CE{constructor(e,t){this.subtle=void 0,this.aesIV=void 0,this.subtle=e,this.aesIV=t}decrypt(e,t){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e)}}class vE{constructor(e,t){this.subtle=void 0,this.key=void 0,this.subtle=e,this.key=t}expandKey(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])}}function yE(r){const e=r.byteLength,t=e&&new DataView(r.buffer).getUint8(e-1);return t?Wr(r,0,e-t):r}class BE{constructor(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}uint8ArrayToUint32Array_(e){const t=new DataView(e),n=new Uint32Array(4);for(let i=0;i<4;i++)n[i]=t.getUint32(i*4);return n}initTable(){const e=this.sBox,t=this.invSBox,n=this.subMix,i=n[0],s=n[1],o=n[2],a=n[3],l=this.invSubMix,A=l[0],c=l[1],u=l[2],h=l[3],d=new Uint32Array(256);let f=0,g=0,p=0;for(p=0;p<256;p++)p<128?d[p]=p<<1:d[p]=p<<1^283;for(p=0;p<256;p++){let C=g^g<<1^g<<2^g<<3^g<<4;C=C>>>8^C&255^99,e[f]=C,t[C]=f;const T=d[f],b=d[T],y=d[b];let x=d[C]*257^C*16843008;i[f]=x<<24|x>>>8,s[f]=x<<16|x>>>16,o[f]=x<<8|x>>>24,a[f]=x,x=y*16843009^b*65537^T*257^f*16843008,A[C]=x<<24|x>>>8,c[C]=x<<16|x>>>16,u[C]=x<<8|x>>>24,h[C]=x,f?(f=T^d[d[d[y^T]]],g^=d[d[g]]):f=g=1}}expandKey(e){const t=this.uint8ArrayToUint32Array_(e);let n=!0,i=0;for(;i<t.length&&n;)n=t[i]===this.key[i],i++;if(n)return;this.key=t;const s=this.keySize=t.length;if(s!==4&&s!==6&&s!==8)throw new Error("Invalid aes key size="+s);const o=this.ksRows=(s+6+1)*4;let a,l;const A=this.keySchedule=new Uint32Array(o),c=this.invKeySchedule=new Uint32Array(o),u=this.sBox,h=this.rcon,d=this.invSubMix,f=d[0],g=d[1],p=d[2],C=d[3];let T,b;for(a=0;a<o;a++){if(a<s){T=A[a]=t[a];continue}b=T,a%s===0?(b=b<<8|b>>>24,b=u[b>>>24]<<24|u[b>>>16&255]<<16|u[b>>>8&255]<<8|u[b&255],b^=h[a/s|0]<<24):s>6&&a%s===4&&(b=u[b>>>24]<<24|u[b>>>16&255]<<16|u[b>>>8&255]<<8|u[b&255]),A[a]=T=(A[a-s]^b)>>>0}for(l=0;l<o;l++)a=o-l,l&3?b=A[a]:b=A[a-4],l<4||a<=4?c[l]=b:c[l]=f[u[b>>>24]]^g[u[b>>>16&255]]^p[u[b>>>8&255]]^C[u[b&255]],c[l]=c[l]>>>0}networkToHostOrderSwap(e){return e<<24|(e&65280)<<8|(e&16711680)>>8|e>>>24}decrypt(e,t,n){const i=this.keySize+6,s=this.invKeySchedule,o=this.invSBox,a=this.invSubMix,l=a[0],A=a[1],c=a[2],u=a[3],h=this.uint8ArrayToUint32Array_(n);let d=h[0],f=h[1],g=h[2],p=h[3];const C=new Int32Array(e),T=new Int32Array(C.length);let b,y,x,R,k,$,V,O,J,ne,ee,le,D,P;const X=this.networkToHostOrderSwap;for(;t<C.length;){for(J=X(C[t]),ne=X(C[t+1]),ee=X(C[t+2]),le=X(C[t+3]),k=J^s[0],$=le^s[1],V=ee^s[2],O=ne^s[3],D=4,P=1;P<i;P++)b=l[k>>>24]^A[$>>16&255]^c[V>>8&255]^u[O&255]^s[D],y=l[$>>>24]^A[V>>16&255]^c[O>>8&255]^u[k&255]^s[D+1],x=l[V>>>24]^A[O>>16&255]^c[k>>8&255]^u[$&255]^s[D+2],R=l[O>>>24]^A[k>>16&255]^c[$>>8&255]^u[V&255]^s[D+3],k=b,$=y,V=x,O=R,D=D+4;b=o[k>>>24]<<24^o[$>>16&255]<<16^o[V>>8&255]<<8^o[O&255]^s[D],y=o[$>>>24]<<24^o[V>>16&255]<<16^o[O>>8&255]<<8^o[k&255]^s[D+1],x=o[V>>>24]<<24^o[O>>16&255]<<16^o[k>>8&255]<<8^o[$&255]^s[D+2],R=o[O>>>24]<<24^o[k>>16&255]<<16^o[$>>8&255]<<8^o[V&255]^s[D+3],T[t]=X(b^d),T[t+1]=X(R^f),T[t+2]=X(x^g),T[t+3]=X(y^p),d=J,f=ne,g=ee,p=le,t=t+4}return T.buffer}}const QE=16;class pa{constructor(e,{removePKCS7Padding:t=!0}={}){if(this.logEnabled=!0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.useSoftware=void 0,this.useSoftware=e.enableSoftwareAES,this.removePKCS7Padding=t,t)try{const n=self.crypto;n&&(this.subtle=n.subtle||n.webkitSubtle)}catch{}this.useSoftware=!this.subtle}destroy(){this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null}isSync(){return this.useSoftware}flush(){const{currentResult:e,remainderData:t}=this;if(!e||t)return this.reset(),null;const n=new Uint8Array(e);return this.reset(),this.removePKCS7Padding?yE(n):n}reset(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}decrypt(e,t,n){return this.useSoftware?new Promise((i,s)=>{this.softwareDecrypt(new Uint8Array(e),t,n);const o=this.flush();o?i(o.buffer):s(new Error("[softwareDecrypt] Failed to decrypt data"))}):this.webCryptoDecrypt(new Uint8Array(e),t,n)}softwareDecrypt(e,t,n){const{currentIV:i,currentResult:s,remainderData:o}=this;this.logOnce("JS AES decrypt"),o&&(e=Ot(o,e),this.remainderData=null);const a=this.getValidChunk(e);if(!a.length)return null;i&&(n=i);let l=this.softwareDecrypter;l||(l=this.softwareDecrypter=new BE),l.expandKey(t);const A=s;return this.currentResult=l.decrypt(a.buffer,0,n),this.currentIV=Wr(a,-16).buffer,A||null}webCryptoDecrypt(e,t,n){if(this.key!==t||!this.fastAesKey){if(!this.subtle)return Promise.resolve(this.onWebCryptoError(e,t,n));this.key=t,this.fastAesKey=new vE(this.subtle,t)}return this.fastAesKey.expandKey().then(i=>this.subtle?(this.logOnce("WebCrypto AES decrypt"),new CE(this.subtle,new Uint8Array(n)).decrypt(e.buffer,i)):Promise.reject(new Error("web crypto not initialized"))).catch(i=>(U.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${i.name}: ${i.message}`),this.onWebCryptoError(e,t,n)))}onWebCryptoError(e,t,n){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,n);const i=this.flush();if(i)return i.buffer;throw new Error("WebCrypto and softwareDecrypt: failed to decrypt data")}getValidChunk(e){let t=e;const n=e.length-e.length%QE;return n!==e.length&&(t=Wr(e,0,n),this.remainderData=Wr(e,n)),t}logOnce(e){this.logEnabled&&(U.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const TE={toString:function(r){let e="";const t=r.length;for(let n=0;n<t;n++)e+=`[${r.start(n).toFixed(3)}-${r.end(n).toFixed(3)}]`;return e}},te={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"};class ma extends hE{constructor(e,t,n,i,s){super(),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=te.STOPPED,this.playlistType=void 0,this.media=null,this.mediaBuffer=null,this.config=void 0,this.bitrateTest=!1,this.lastCurrentTime=0,this.nextLoadPosition=0,this.startPosition=0,this.startTimeOffset=null,this.loadedmetadata=!1,this.retryDate=0,this.levels=null,this.fragmentLoader=void 0,this.keyLoader=void 0,this.levelLastLoaded=null,this.startFragRequested=!1,this.decrypter=void 0,this.initPTS=[],this.onvseeking=null,this.onvended=null,this.logPrefix="",this.log=void 0,this.warn=void 0,this.playlistType=s,this.logPrefix=i,this.log=U.log.bind(U,`${i}:`),this.warn=U.warn.bind(U,`${i}:`),this.hls=e,this.fragmentLoader=new IE(e.config),this.keyLoader=n,this.fragmentTracker=t,this.config=e.config,this.decrypter=new pa(e.config),e.on(I.MANIFEST_LOADED,this.onManifestLoaded,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(e){}stopLoad(){this.fragmentLoader.abort(),this.keyLoader.abort(this.playlistType);const e=this.fragCurrent;e!=null&&e.loader&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=te.STOPPED}_streamEnded(e,t){if(t.live||e.nextStart||!e.end||!this.media)return!1;const n=t.partList;if(n!=null&&n.length){const s=n[n.length-1];return Ve.isBuffered(this.media,s.start+s.duration/2)}const i=t.fragments[t.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(i)}getLevelDetails(){if(this.levels&&this.levelLastLoaded!==null){var e;return(e=this.levelLastLoaded)==null?void 0:e.details}}onMediaAttached(e,t){const n=this.media=this.mediaBuffer=t.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),n.addEventListener("seeking",this.onvseeking),n.addEventListener("ended",this.onvended);const i=this.config;this.levels&&i.autoStartLoad&&this.state===te.STOPPED&&this.startLoad(i.startPosition)}onMediaDetaching(){const e=this.media;e!=null&&e.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),e&&this.onvseeking&&this.onvended&&(e.removeEventListener("seeking",this.onvseeking),e.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.keyLoader&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()}onMediaSeeking(){const{config:e,fragCurrent:t,media:n,mediaBuffer:i,state:s}=this,o=n?n.currentTime:0,a=Ve.bufferInfo(i||n,o,e.maxBufferHole);if(this.log(`media seeking to ${he(o)?o.toFixed(3):o}, state: ${s}`),this.state===te.ENDED)this.resetLoadingState();else if(t){const l=e.maxFragLookUpTolerance,A=t.start-l,c=t.start+t.duration+l;if(!a.len||c<a.start||A>a.end){const u=o>c;(o<A||u)&&(u&&t.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),t.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}n&&(this.fragmentTracker.removeFragmentsInRange(o,1/0,this.playlistType,!0),this.lastCurrentTime=o),!this.loadedmetadata&&!a.len&&(this.nextLoadPosition=this.startPosition=o),this.tickImmediate()}onMediaEnded(){this.startPosition=this.lastCurrentTime=0}onManifestLoaded(e,t){this.startTimeOffset=t.startTimeOffset,this.initPTS=[]}onHandlerDestroying(){this.hls.off(I.MANIFEST_LOADED,this.onManifestLoaded,this),this.stopLoad(),super.onHandlerDestroying(),this.hls=null}onHandlerDestroyed(){this.state=te.STOPPED,this.fragmentLoader&&this.fragmentLoader.destroy(),this.keyLoader&&this.keyLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.keyLoader=this.fragmentLoader=this.fragmentTracker=null,super.onHandlerDestroyed()}loadFragment(e,t,n){this._loadFragForPlayback(e,t,n)}_loadFragForPlayback(e,t,n){const i=s=>{if(this.fragContextChanged(e)){this.warn(`Fragment ${e.sn}${s.part?" p: "+s.part.index:""} of level ${e.level} was dropped during download.`),this.fragmentTracker.removeFragment(e);return}e.stats.chunkCount++,this._handleFragmentLoadProgress(s)};this._doFragLoad(e,t,n,i).then(s=>{if(!s)return;const o=this.state;if(this.fragContextChanged(e)){(o===te.FRAG_LOADING||!this.fragCurrent&&o===te.PARSING)&&(this.fragmentTracker.removeFragment(e),this.state=te.IDLE);return}"payload"in s&&(this.log(`Loaded fragment ${e.sn} of level ${e.level}`),this.hls.trigger(I.FRAG_LOADED,s)),this._handleFragmentLoadComplete(s)}).catch(s=>{this.state===te.STOPPED||this.state===te.ERROR||(this.warn(`Frag error: ${(s==null?void 0:s.message)||s}`),this.resetFragmentLoading(e))})}clearTrackerIfNeeded(e){var t;const{fragmentTracker:n}=this;if(n.getState(e)===ht.APPENDING){const s=e.type,o=this.getFwdBufferInfo(this.mediaBuffer,s),a=Math.max(e.duration,o?o.len:this.config.maxBufferLength),l=this.backtrackFragment;((l?e.sn-l.sn:0)===1||this.reduceMaxBufferLength(a))&&n.removeFragment(e)}else((t=this.mediaBuffer)==null?void 0:t.buffered.length)===0?n.removeAllFragments():n.hasParts(e.type)&&(n.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),n.getState(e)===ht.PARTIAL&&n.removeFragment(e))}checkLiveUpdate(e){if(e.updated&&!e.live){const t=e.fragments[e.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:t,part:null,stats:t.stats,id:t.type})}e.fragments[0]||(e.deltaUpdateFailed=!0)}flushMainBuffer(e,t,n=null){if(!(e-t))return;const i={startOffset:e,endOffset:t,type:n};this.hls.trigger(I.BUFFER_FLUSHING,i)}_loadInitSegment(e,t){this._doFragLoad(e,t).then(n=>{if(!n||this.fragContextChanged(e)||!this.levels)throw new Error("init load aborted");return n}).then(n=>{const{hls:i}=this,{payload:s}=n,o=e.decryptdata;if(s&&s.byteLength>0&&o!=null&&o.key&&o.iv&&o.method==="AES-128"){const a=self.performance.now();return this.decrypter.decrypt(new Uint8Array(s),o.key.buffer,o.iv.buffer).catch(l=>{throw i.trigger(I.ERROR,{type:ye.MEDIA_ERROR,details:K.FRAG_DECRYPT_ERROR,fatal:!1,error:l,reason:l.message,frag:e}),l}).then(l=>{const A=self.performance.now();return i.trigger(I.FRAG_DECRYPTED,{frag:e,payload:l,stats:{tstart:a,tdecrypt:A}}),n.payload=l,this.completeInitSegmentLoad(n)})}return this.completeInitSegmentLoad(n)}).catch(n=>{this.state===te.STOPPED||this.state===te.ERROR||(this.warn(n),this.resetFragmentLoading(e))})}completeInitSegmentLoad(e){const{levels:t}=this;if(!t)throw new Error("init load aborted, missing levels");const n=e.frag.stats;this.state=te.IDLE,e.frag.data=new Uint8Array(e.payload),n.parsing.start=n.buffering.start=self.performance.now(),n.parsing.end=n.buffering.end=self.performance.now(),this.tick()}fragContextChanged(e){const{fragCurrent:t}=this;return!e||!t||e.sn!==t.sn||e.level!==t.level}fragBufferedComplete(e,t){var n,i,s,o;const a=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log(`Buffered ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.playlistType===Ee.MAIN?"level":"track"} ${e.level} (frag:[${((n=e.startPTS)!=null?n:NaN).toFixed(3)}-${((i=e.endPTS)!=null?i:NaN).toFixed(3)}] > buffer:${a?TE.toString(Ve.getBuffered(a)):"(detached)"})`),e.sn!=="initSegment"){var l;if(e.type!==Ee.SUBTITLE){const c=e.elementaryStreams;if(!Object.keys(c).some(u=>!!c[u])){this.state=te.IDLE;return}}const A=(l=this.levels)==null?void 0:l[e.level];A!=null&&A.fragmentError&&(this.log(`Resetting level fragment error count of ${A.fragmentError} on frag buffered`),A.fragmentError=0)}this.state=te.IDLE,a&&(!this.loadedmetadata&&e.type==Ee.MAIN&&a.buffered.length&&((s=this.fragCurrent)==null?void 0:s.sn)===((o=this.fragPrevious)==null?void 0:o.sn)&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick())}seekToStartPos(){}_handleFragmentLoadComplete(e){const{transmuxer:t}=this;if(!t)return;const{frag:n,part:i,partsLoaded:s}=e,o=!s||s.length===0||s.some(l=>!l),a=new ga(n.level,n.sn,n.stats.chunkCount+1,0,i?i.index:-1,!o);t.flush(a)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,n=null,i){var s;const o=t==null?void 0:t.details;if(!this.levels||!o)throw new Error(`frag load aborted, missing level${o?"":" detail"}s`);let a=null;if(e.encrypted&&!((s=e.decryptdata)!=null&&s.key)?(this.log(`Loading key for ${e.sn} of [${o.startSN}-${o.endSN}], ${this.logPrefix==="[stream-controller]"?"level":"track"} ${e.level}`),this.state=te.KEY_LOADING,this.fragCurrent=e,a=this.keyLoader.load(e).then(c=>{if(!this.fragContextChanged(c.frag))return this.hls.trigger(I.KEY_LOADED,c),this.state===te.KEY_LOADING&&(this.state=te.IDLE),c}),this.hls.trigger(I.KEY_LOADING,{frag:e}),this.fragCurrent===null&&(a=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))):!e.encrypted&&o.encryptedFragments.length&&this.keyLoader.loadClear(e,o.encryptedFragments),n=Math.max(e.start,n||0),this.config.lowLatencyMode&&e.sn!=="initSegment"){const c=o.partList;if(c&&i){n>e.end&&o.fragmentHint&&(e=o.fragmentHint);const u=this.getNextPart(c,e,n);if(u>-1){const h=c[u];this.log(`Loading part sn: ${e.sn} p: ${h.index} cc: ${e.cc} of playlist [${o.startSN}-${o.endSN}] parts [0-${u}-${c.length-1}] ${this.logPrefix==="[stream-controller]"?"level":"track"}: ${e.level}, target: ${parseFloat(n.toFixed(3))}`),this.nextLoadPosition=h.start+h.duration,this.state=te.FRAG_LOADING;let d;return a?d=a.then(f=>!f||this.fragContextChanged(f.frag)?null:this.doFragPartsLoad(e,h,t,i)).catch(f=>this.handleFragLoadError(f)):d=this.doFragPartsLoad(e,h,t,i).catch(f=>this.handleFragLoadError(f)),this.hls.trigger(I.FRAG_LOADING,{frag:e,part:h,targetBufferTime:n}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):d}else if(!e.url||this.loadedEndOfParts(c,n))return Promise.resolve(null)}}this.log(`Loading fragment ${e.sn} cc: ${e.cc} ${o?"of ["+o.startSN+"-"+o.endSN+"] ":""}${this.logPrefix==="[stream-controller]"?"level":"track"}: ${e.level}, target: ${parseFloat(n.toFixed(3))}`),he(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=te.FRAG_LOADING;const l=this.config.progressive;let A;return l&&a?A=a.then(c=>!c||this.fragContextChanged(c==null?void 0:c.frag)?null:this.fragmentLoader.load(e,i)).catch(c=>this.handleFragLoadError(c)):A=Promise.all([this.fragmentLoader.load(e,l?i:void 0),a]).then(([c])=>(!l&&c&&i&&i(c),c)).catch(c=>this.handleFragLoadError(c)),this.hls.trigger(I.FRAG_LOADING,{frag:e,targetBufferTime:n}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):A}doFragPartsLoad(e,t,n,i){return new Promise((s,o)=>{var a;const l=[],A=(a=n.details)==null?void 0:a.partList,c=u=>{this.fragmentLoader.loadPart(e,u,i).then(h=>{l[u.index]=h;const d=h.part;this.hls.trigger(I.FRAG_LOADED,h);const f=nu(n,e.sn,u.index+1)||iu(A,e.sn,u.index+1);if(f)c(f);else return s({frag:e,part:d,partsLoaded:l})}).catch(o)};c(t)})}handleFragLoadError(e){if("data"in e){const t=e.data;e.data&&t.details===K.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(I.ERROR,t)}else this.hls.trigger(I.ERROR,{type:ye.OTHER_ERROR,details:K.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==te.PARSING){!this.fragCurrent&&this.state!==te.STOPPED&&this.state!==te.ERROR&&(this.state=te.IDLE);return}const{frag:n,part:i,level:s}=t,o=self.performance.now();n.stats.parsing.end=o,i&&(i.stats.parsing.end=o),this.updateLevelTiming(n,i,s,e.partial)}getCurrentContext(e){const{levels:t,fragCurrent:n}=this,{level:i,sn:s,part:o}=e;if(!(t!=null&&t[i]))return this.warn(`Levels object was unset while buffering fragment ${s} of level ${i}. The current chunk will not be buffered.`),null;const a=t[i],l=o>-1?nu(a,s,o):null,A=l?l.fragment:Jm(a,s,n);return A?(n&&n!==A&&(A.stats=n.stats),{frag:A,part:l,level:a}):null}bufferFragmentData(e,t,n,i,s){var o;if(!e||this.state!==te.PARSING)return;const{data1:a,data2:l}=e;let A=a;if(a&&l&&(A=Ot(a,l)),!((o=A)!=null&&o.length))return;const c={type:e.type,frag:t,part:n,chunkMeta:i,parent:t.type,data:A};if(this.hls.trigger(I.BUFFER_APPENDING,c),e.dropped&&e.independent&&!n){if(s)return;this.flushBufferGap(t)}}flushBufferGap(e){const t=this.media;if(!t)return;if(!Ve.isBuffered(t,t.currentTime)){this.flushMainBuffer(0,e.start);return}const n=t.currentTime,i=Ve.bufferInfo(t,n,0),s=e.duration,o=Math.min(this.config.maxFragLookUpTolerance*2,s*.25),a=Math.max(Math.min(e.start-o,i.end-o),n+o);e.start-a>o&&this.flushMainBuffer(a,e.start)}getFwdBufferInfo(e,t){const n=this.getLoadPosition();return he(n)?this.getFwdBufferInfoAtPos(e,n,t):null}getFwdBufferInfoAtPos(e,t,n){const{config:{maxBufferHole:i}}=this,s=Ve.bufferInfo(e,t,i);if(s.len===0&&s.nextStart!==void 0){const o=this.fragmentTracker.getBufferedFrag(t,n);if(o&&s.nextStart<o.end)return Ve.bufferInfo(e,t,Math.max(s.nextStart,i))}return s}getMaxBufferLength(e){const{config:t}=this;let n;return e?n=Math.max(8*t.maxBufferSize/e,t.maxBufferLength):n=t.maxBufferLength,Math.min(n,t.maxMaxBufferLength)}reduceMaxBufferLength(e){const t=this.config,n=e||t.maxBufferLength,i=t.maxMaxBufferLength/2;return i>=n?(t.maxMaxBufferLength=i,this.warn(`Reduce max buffer length to ${i}s`),!0):!1}getAppendedFrag(e,t=Ee.MAIN){const n=this.fragmentTracker.getAppendedFrag(e,Ee.MAIN);return n&&"fragment"in n?n.fragment:n}getNextFragment(e,t){const n=t.fragments,i=n.length;if(!i)return null;const{config:s}=this,o=n[0].start;let a;if(t.live){const l=s.initialLiveManifestSize;if(i<l)return this.warn(`Not enough fragments to start playback (have: ${i}, need: ${l})`),null;(!t.PTSKnown&&!this.startFragRequested&&this.startPosition===-1||e<o)&&(a=this.getInitialLiveFragment(t,n),this.startPosition=this.nextLoadPosition=a?this.hls.liveSyncPosition||a.start:e)}else e<=o&&(a=n[0]);if(!a){const l=s.lowLatencyMode?t.partEnd:t.fragmentEnd;a=this.getFragmentAtPosition(e,l,t)}return this.mapToInitFragWhenRequired(a)}isLoopLoading(e,t){const n=this.fragmentTracker.getState(e);return(n===ht.OK||n===ht.PARTIAL&&!!e.gap)&&this.nextLoadPosition>t}getNextFragmentLoopLoading(e,t,n,i,s){const o=e.gap,a=this.getNextFragment(this.nextLoadPosition,t);if(a===null)return a;if(e=a,o&&e&&!e.gap&&n.nextStart){const l=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,n.nextStart,i);if(l!==null&&n.len+l.len>=s)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,t,n){let i=-1,s=!1,o=!0;for(let a=0,l=e.length;a<l;a++){const A=e[a];if(o=o&&!A.independent,i>-1&&n<A.start)break;const c=A.loaded;c?i=-1:(s||A.independent||o)&&A.fragment===t&&(i=a),s=c}return i}loadedEndOfParts(e,t){const n=e[e.length-1];return n&&t>n.start&&n.loaded}getInitialLiveFragment(e,t){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=qm(t,n.endProgramDateTime,this.config.maxFragLookUpTolerance)),!i){const s=n.sn+1;if(s>=e.startSN&&s<=e.endSN){const o=t[s-e.startSN];n.cc===o.cc&&(i=o,this.log(`Live playlist, switching playlist, load frag with next SN: ${i.sn}`))}i||(i=zm(t,n.cc),i&&this.log(`Live playlist, switching playlist, load frag with same CC: ${i.sn}`))}}else{const s=this.hls.liveSyncPosition;s!==null&&(i=this.getFragmentAtPosition(s,this.bitrateTest?e.fragmentEnd:e.edge,e))}return i}getFragmentAtPosition(e,t,n){const{config:i}=this;let{fragPrevious:s}=this,{fragments:o,endSN:a}=n;const{fragmentHint:l}=n,{maxFragLookUpTolerance:A}=i,c=n.partList,u=!!(i.lowLatencyMode&&c!=null&&c.length&&l);u&&l&&!this.bitrateTest&&(o=o.concat(l),a=l.sn);let h;if(e<t){const d=e>t-A?0:A;h=ms(s,o,e,d)}else h=o[o.length-1];if(h){const d=h.sn-n.startSN,f=this.fragmentTracker.getState(h);if((f===ht.OK||f===ht.PARTIAL&&h.gap)&&(s=h),s&&h.sn===s.sn&&(!u||c[0].fragment.sn>h.sn)&&s&&h.level===s.level){const p=o[d+1];h.sn<a&&this.fragmentTracker.getState(p)!==ht.OK?h=p:h=null}}return h}synchronizeToLiveEdge(e){const{config:t,media:n}=this;if(!n)return;const i=this.hls.liveSyncPosition,s=n.currentTime,o=e.fragments[0].start,a=e.edge,l=s>=o-t.maxFragLookUpTolerance&&s<=a;if(i!==null&&n.duration>i&&(s<i||!l)){const A=t.liveMaxLatencyDuration!==void 0?t.liveMaxLatencyDuration:t.liveMaxLatencyDurationCount*e.targetduration;(!l&&n.readyState<4||s<a-A)&&(this.loadedmetadata||(this.nextLoadPosition=i),n.readyState&&(this.warn(`Playback: ${s.toFixed(3)} is located too far from the end of live sliding playlist: ${a}, reset currentTime to : ${i.toFixed(3)}`),n.currentTime=i))}}alignPlaylists(e,t,n){const i=e.fragments.length;if(!i)return this.warn("No fragments in live playlist"),0;const s=e.fragments[0].start,o=!t,a=e.alignedSliding&&he(s);if(o||!a&&!s){const{fragPrevious:l}=this;mE(l,n,e);const A=e.fragments[0].start;return this.log(`Live playlist sliding: ${A.toFixed(2)} start-sn: ${t?t.startSN:"na"}->${e.startSN} prev-sn: ${l?l.sn:"na"} fragments: ${i}`),A}return s}waitForCdnTuneIn(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,e.partTarget*3)}setStartPosition(e,t){let n=this.startPosition;if(n<t&&(n=-1),n===-1||this.lastCurrentTime===-1){const i=this.startTimeOffset!==null,s=i?this.startTimeOffset:e.startTimeOffset;s!==null&&he(s)?(n=t+s,s<0&&(n+=e.totalduration),n=Math.min(Math.max(t,n),t+e.totalduration),this.log(`Start time offset ${s} found in ${i?"multivariant":"media"} playlist, adjust startPosition to ${n}`),this.startPosition=n):e.live?n=this.hls.liveSyncPosition||t:this.startPosition=n=0,this.lastCurrentTime=n}this.nextLoadPosition=n}getLoadPosition(){const{media:e}=this;let t=0;return this.loadedmetadata&&e?t=e.currentTime:this.nextLoadPosition&&(t=this.nextLoadPosition),t}handleFragLoadAborted(e,t){this.transmuxer&&e.sn!=="initSegment"&&e.stats.aborted&&(this.warn(`Fragment ${e.sn}${t?" part "+t.index:""} of level ${e.level} was aborted`),this.resetFragmentLoading(e))}resetFragmentLoading(e){(!this.fragCurrent||!this.fragContextChanged(e)&&this.state!==te.FRAG_LOADING_WAITING_RETRY)&&(this.state=te.IDLE)}onFragmentOrKeyLoadError(e,t){if(t.chunkMeta&&!t.frag){const c=this.getCurrentContext(t.chunkMeta);c&&(t.frag=c.frag)}const n=t.frag;if(!n||n.type!==e||!this.levels)return;if(this.fragContextChanged(n)){var i;this.warn(`Frag load error must match current frag to retry ${n.url} > ${(i=this.fragCurrent)==null?void 0:i.url}`);return}const s=t.details===K.FRAG_GAP;s&&this.fragmentTracker.fragBuffered(n,!0);const o=t.errorAction,{action:a,retryCount:l=0,retryConfig:A}=o||{};if(o&&a===It.RetryRequest&&A){this.resetStartWhenNotLoaded(this.levelLastLoaded);const c=ha(A,l);this.warn(`Fragment ${n.sn} of ${e} ${n.level} errored with ${t.details}, retrying loading ${l+1}/${A.maxNumRetry} in ${c}ms`),o.resolved=!0,this.retryDate=self.performance.now()+c,this.state=te.FRAG_LOADING_WAITING_RETRY}else if(A&&o)if(this.resetFragmentErrors(e),l<A.maxNumRetry)!s&&a!==It.RemoveAlternatePermanently&&(o.resolved=!0);else{U.warn(`${t.details} reached or exceeded max retry (${l})`);return}else(o==null?void 0:o.action)===It.SendAlternateToPenaltyBox?this.state=te.WAITING_LEVEL:this.state=te.ERROR;this.tickImmediate()}reduceLengthAndFlushBuffer(e){if(this.state===te.PARSING||this.state===te.PARSED){const t=e.parent,n=this.getFwdBufferInfo(this.mediaBuffer,t),i=n&&n.len>.5;i&&this.reduceMaxBufferLength(n.len);const s=!i;return s&&this.warn(`Buffer full error while media.currentTime is not buffered, flush ${t} buffer`),e.frag&&(this.fragmentTracker.removeFragment(e.frag),this.nextLoadPosition=e.frag.start),this.resetLoadingState(),s}return!1}resetFragmentErrors(e){e===Ee.AUDIO&&(this.fragCurrent=null),this.loadedmetadata||(this.startFragRequested=!1),this.state!==te.STOPPED&&(this.state=te.IDLE)}afterBufferFlushed(e,t,n){if(!e)return;const i=Ve.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,i,n),this.state===te.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state=te.IDLE}resetStartWhenNotLoaded(e){if(!this.loadedmetadata){this.startFragRequested=!1;const t=e?e.details:null;t!=null&&t.live?(this.startPosition=-1,this.setStartPosition(t,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(this.levelLastLoaded),this.resetLoadingState()}removeUnbufferedFrags(e=0){this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}updateLevelTiming(e,t,n,i){var s;const o=n.details;if(!o){this.warn("level.details undefined");return}if(!Object.keys(e.elementaryStreams).reduce((l,A)=>{const c=e.elementaryStreams[A];if(c){const u=c.endPTS-c.startPTS;if(u<=0)return this.warn(`Could not parse fragment ${e.sn} ${A} duration reliably (${u})`),l||!1;const h=i?0:tu(o,e,c.startPTS,c.endPTS,c.startDTS,c.endDTS);return this.hls.trigger(I.LEVEL_PTS_UPDATED,{details:o,level:n,drift:h,type:A,frag:e,start:c.startPTS,end:c.endPTS}),!0}return l},!1)&&((s=this.transmuxer)==null?void 0:s.error)===null){const l=new Error(`Found no media in fragment ${e.sn} of level ${e.level} resetting transmuxer to fallback to playlist timing`);if(n.fragmentError===0&&(n.fragmentError++,e.gap=!0,this.fragmentTracker.removeFragment(e),this.fragmentTracker.fragBuffered(e,!0)),this.warn(l.message),this.hls.trigger(I.ERROR,{type:ye.MEDIA_ERROR,details:K.FRAG_PARSING_ERROR,fatal:!1,error:l,frag:e,reason:`Found no media in msn ${e.sn} of level "${n.url}"`}),!this.hls)return;this.resetTransmuxer()}this.state=te.PARSED,this.hls.trigger(I.FRAG_PARSED,{frag:e,part:t})}resetTransmuxer(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)}recoverWorkerError(e){e.event==="demuxerWorker"&&(this.fragmentTracker.removeAllFragments(),this.resetTransmuxer(),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState())}set state(e){const t=this._state;t!==e&&(this._state=e,this.log(`${t}->${e}`))}get state(){return this._state}}class mu{constructor(){this.chunks=[],this.dataLength=0}push(e){this.chunks.push(e),this.dataLength+=e.length}flush(){const{chunks:e,dataLength:t}=this;let n;if(e.length)e.length===1?n=e[0]:n=bE(e,t);else return new Uint8Array(0);return this.reset(),n}reset(){this.chunks.length=0,this.dataLength=0}}function bE(r,e){const t=new Uint8Array(e);let n=0;for(let i=0;i<r.length;i++){const s=r[i];t.set(s,n),n+=s.length}return t}function xE(){return typeof __HLS_WORKER_BUNDLE__=="function"}function wE(){const r=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(r);return{worker:new self.Worker(e),objectURL:e}}function SE(r){const e=new self.URL(r,self.location.href).href;return{worker:new self.Worker(e),scriptURL:e}}function or(r="",e=9e4){return{type:r,id:-1,pid:-1,inputTimeScale:e,sequenceNumber:-1,samples:[],dropped:0}}class Ea{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,t,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,t){return!1}appendFrame(e,t,n){}demux(e,t){this.cachedData&&(e=Ot(this.cachedData,e),this.cachedData=null);let n=oi(e,0),i=n?n.length:0,s;const o=this._audioTrack,a=this._id3Track,l=n?zo(n):void 0,A=e.length;for((this.basePTS===null||this.frameIndex===0&&he(l))&&(this.basePTS=RE(l,t,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),n&&n.length>0&&a.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:Jt.audioId3,duration:Number.POSITIVE_INFINITY});i<A;){if(this.canParse(e,i)){const c=this.appendFrame(o,e,i);c?(this.frameIndex++,this.lastPTS=c.sample.pts,i+=c.length,s=i):i=A}else zp(e,i)?(n=oi(e,i),a.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:Jt.audioId3,duration:Number.POSITIVE_INFINITY}),i+=n.length,s=i):i++;if(i===A&&s!==A){const c=Wr(e,s);this.cachedData?this.cachedData=Ot(this.cachedData,c):this.cachedData=c}}return{audioTrack:o,videoTrack:or(),id3Track:a,textTrack:or()}}demuxSampleAes(e,t,n){return Promise.reject(new Error(`[${this}] This demuxer does not support Sample-AES decryption`))}flush(e){const t=this.cachedData;return t&&(this.cachedData=null,this.demux(t,0)),{audioTrack:this._audioTrack,videoTrack:or(),id3Track:this._id3Track,textTrack:or()}}destroy(){}}const RE=(r,e,t)=>{if(he(r))return r*90;const n=t?t.baseTime*9e4/t.timescale:0;return e*9e4+n};function DE(r,e,t,n){let i,s,o,a;const l=navigator.userAgent.toLowerCase(),A=n,c=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];i=((e[t+2]&192)>>>6)+1;const u=(e[t+2]&60)>>>2;if(u>c.length-1){const h=new Error(`invalid ADTS sampling index:${u}`);r.emit(I.ERROR,I.ERROR,{type:ye.MEDIA_ERROR,details:K.FRAG_PARSING_ERROR,fatal:!0,error:h,reason:h.message});return}return o=(e[t+2]&1)<<2,o|=(e[t+3]&192)>>>6,U.log(`manifest codec:${n}, ADTS type:${i}, samplingIndex:${u}`),/firefox/i.test(l)?u>=6?(i=5,a=new Array(4),s=u-3):(i=2,a=new Array(2),s=u):l.indexOf("android")!==-1?(i=2,a=new Array(2),s=u):(i=5,a=new Array(4),n&&(n.indexOf("mp4a.40.29")!==-1||n.indexOf("mp4a.40.5")!==-1)||!n&&u>=6?s=u-3:((n&&n.indexOf("mp4a.40.2")!==-1&&(u>=6&&o===1||/vivaldi/i.test(l))||!n&&o===1)&&(i=2,a=new Array(2)),s=u)),a[0]=i<<3,a[0]|=(u&14)>>1,a[1]|=(u&1)<<7,a[1]|=o<<3,i===5&&(a[1]|=(s&14)>>1,a[2]=(s&1)<<7,a[2]|=8,a[3]=0),{config:a,samplerate:c[u],channelCount:o,codec:"mp4a.40."+i,manifestCodec:A}}function Eu(r,e){return r[e]===255&&(r[e+1]&246)===240}function Iu(r,e){return r[e+1]&1?7:9}function Ia(r,e){return(r[e+3]&3)<<11|r[e+4]<<3|(r[e+5]&224)>>>5}function _E(r,e){return e+5<r.length}function ys(r,e){return e+1<r.length&&Eu(r,e)}function LE(r,e){return _E(r,e)&&Eu(r,e)&&Ia(r,e)<=r.length-e}function FE(r,e){if(ys(r,e)){const t=Iu(r,e);if(e+t>=r.length)return!1;const n=Ia(r,e);if(n<=t)return!1;const i=e+n;return i===r.length||ys(r,i)}return!1}function Cu(r,e,t,n,i){if(!r.samplerate){const s=DE(e,t,n,i);if(!s)return;r.config=s.config,r.samplerate=s.samplerate,r.channelCount=s.channelCount,r.codec=s.codec,r.manifestCodec=s.manifestCodec,U.log(`parsed codec:${r.codec}, rate:${s.samplerate}, channels:${s.channelCount}`)}}function vu(r){return 9216e4/r}function kE(r,e){const t=Iu(r,e);if(e+t<=r.length){const n=Ia(r,e)-t;if(n>0)return{headerLength:t,frameLength:n}}}function yu(r,e,t,n,i){const s=vu(r.samplerate),o=n+i*s,a=kE(e,t);let l;if(a){const{frameLength:u,headerLength:h}=a,d=h+u,f=Math.max(0,t+d-e.length);f?(l=new Uint8Array(d-h),l.set(e.subarray(t+h,e.length),0)):l=e.subarray(t+h,t+d);const g={unit:l,pts:o};return f||r.samples.push(g),{sample:g,length:d,missing:f}}const A=e.length-t;return l=new Uint8Array(A),l.set(e.subarray(t,e.length),0),{sample:{unit:l,pts:o},length:A,missing:-1}}let Bs=null;const NE=[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],ME=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],PE=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],OE=[0,1,1,4];function Bu(r,e,t,n,i){if(t+24>e.length)return;const s=Qu(e,t);if(s&&t+s.frameLength<=e.length){const o=s.samplesPerFrame*9e4/s.sampleRate,a=n+i*o,l={unit:e.subarray(t,t+s.frameLength),pts:a,dts:a};return r.config=[],r.channelCount=s.channelCount,r.samplerate=s.sampleRate,r.samples.push(l),{sample:l,length:s.frameLength,missing:0}}}function Qu(r,e){const t=r[e+1]>>3&3,n=r[e+1]>>1&3,i=r[e+2]>>4&15,s=r[e+2]>>2&3;if(t!==1&&i!==0&&i!==15&&s!==3){const o=r[e+2]>>1&1,a=r[e+3]>>6,l=t===3?3-n:n===3?3:4,A=NE[l*14+i-1]*1e3,u=ME[(t===3?0:t===2?1:2)*3+s],h=a===3?1:2,d=PE[t][n],f=OE[n],g=d*8*f,p=Math.floor(d*A/u+o)*f;if(Bs===null){const b=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Bs=b?parseInt(b[1]):0}return!!Bs&&Bs<=87&&n===2&&A>=224e3&&a===0&&(r[e+3]=r[e+3]|128),{sampleRate:u,channelCount:h,frameLength:p,samplesPerFrame:g}}}function Ca(r,e){return r[e]===255&&(r[e+1]&224)===224&&(r[e+1]&6)!==0}function Tu(r,e){return e+1<r.length&&Ca(r,e)}function UE(r,e){return Ca(r,e)&&4<=r.length-e}function bu(r,e){if(e+1<r.length&&Ca(r,e)){const n=Qu(r,e);let i=4;n!=null&&n.frameLength&&(i=n.frameLength);const s=e+i;return s===r.length||Tu(r,s)}return!1}class GE extends Ea{constructor(e,t){super(),this.observer=void 0,this.config=void 0,this.observer=e,this.config=t}resetInitSegment(e,t,n,i){super.resetInitSegment(e,t,n,i),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const t=oi(e,0);let n=(t==null?void 0:t.length)||0;if(bu(e,n))return!1;for(let i=e.length;n<i;n++)if(FE(e,n))return U.log("ADTS sync word found !"),!0;return!1}canParse(e,t){return LE(e,t)}appendFrame(e,t,n){Cu(e,this.observer,t,n,e.manifestCodec);const i=yu(e,t,n,this.basePTS,this.frameIndex);if(i&&i.missing===0)return i}}const HE=/\/emsg[-/]ID3/i;class $E{constructor(e,t){this.remainderData=null,this.timeOffset=0,this.config=void 0,this.videoTrack=void 0,this.audioTrack=void 0,this.id3Track=void 0,this.txtTrack=void 0,this.config=t}resetTimeStamp(){}resetInitSegment(e,t,n,i){const s=this.videoTrack=or("video",1),o=this.audioTrack=or("audio",1),a=this.txtTrack=or("text",1);if(this.id3Track=or("id3",1),this.timeOffset=0,!(e!=null&&e.byteLength))return;const l=wc(e);if(l.video){const{id:A,timescale:c,codec:u}=l.video;s.id=A,s.timescale=a.timescale=c,s.codec=u}if(l.audio){const{id:A,timescale:c,codec:u}=l.audio;o.id=A,o.timescale=c,o.codec=u}a.id=Qc.text,s.sampleDuration=0,s.duration=o.duration=i}resetContiguity(){this.remainderData=null}static probe(e){return am(e)}demux(e,t){this.timeOffset=t;let n=e;const i=this.videoTrack,s=this.txtTrack;if(this.config.progressive){this.remainderData&&(n=Ot(this.remainderData,e));const a=gm(n);this.remainderData=a.remainder,i.samples=a.valid||new Uint8Array}else i.samples=n;const o=this.extractID3Track(i,t);return s.samples=Rc(t,i),{videoTrack:i,audioTrack:this.audioTrack,id3Track:o,textTrack:this.txtTrack}}flush(){const e=this.timeOffset,t=this.videoTrack,n=this.txtTrack;t.samples=this.remainderData||new Uint8Array,this.remainderData=null;const i=this.extractID3Track(t,this.timeOffset);return n.samples=Rc(e,t),{videoTrack:t,audioTrack:or(),id3Track:i,textTrack:or()}}extractID3Track(e,t){const n=this.id3Track;if(e.samples.length){const i=xe(e.samples,["emsg"]);i&&i.forEach(s=>{const o=Em(s);if(HE.test(o.schemeIdUri)){const a=he(o.presentationTime)?o.presentationTime/o.timeScale:t+o.presentationTimeDelta/o.timeScale;let l=o.eventDuration===4294967295?Number.POSITIVE_INFINITY:o.eventDuration/o.timeScale;l<=.001&&(l=Number.POSITIVE_INFINITY);const A=o.payload;n.samples.push({data:A,len:A.byteLength,dts:a,pts:a,type:Jt.emsg,duration:l})}})}return n}demuxSampleAes(e,t,n){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){}}const xu=(r,e)=>{let t=0,n=5;e+=n;const i=new Uint32Array(1),s=new Uint32Array(1),o=new Uint8Array(1);for(;n>0;){o[0]=r[e];const a=Math.min(n,8),l=8-a;s[0]=4278190080>>>24+l<<l,i[0]=(o[0]&s[0])>>l,t=t?t<<a|i[0]:i[0],e+=1,n-=a}return t};class YE extends Ea{constructor(e){super(),this.observer=void 0,this.observer=e}resetInitSegment(e,t,n,i){super.resetInitSegment(e,t,n,i),this._audioTrack={container:"audio/ac-3",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"ac3",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}canParse(e,t){return t+64<e.length}appendFrame(e,t,n){const i=wu(e,t,n,this.basePTS,this.frameIndex);if(i!==-1)return{sample:e.samples[e.samples.length-1],length:i,missing:0}}static probe(e){if(!e)return!1;const t=oi(e,0);if(!t)return!1;const n=t.length;return e[n]===11&&e[n+1]===119&&zo(t)!==void 0&&xu(e,n)<16}}function wu(r,e,t,n,i){if(t+8>e.length||e[t]!==11||e[t+1]!==119)return-1;const s=e[t+4]>>6;if(s>=3)return-1;const a=[48e3,44100,32e3][s],l=e[t+4]&63,c=[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][l*3+s]*2;if(t+c>e.length)return-1;const u=e[t+6]>>5;let h=0;u===2?h+=2:(u&1&&u!==1&&(h+=2),u&4&&(h+=2));const d=(e[t+6]<<8|e[t+7])>>12-h&1,g=[2,1,2,3,3,4,4,5][u]+d,p=e[t+5]>>3,C=e[t+5]&7,T=new Uint8Array([s<<6|p<<1|C>>2,(C&3)<<6|u<<3|d<<2|l>>4,l<<4&224]),b=1536/a*9e4,y=n+i*b,x=e.subarray(t,t+c);return r.config=T,r.channelCount=g,r.samplerate=a,r.samples.push({unit:x,pts:y}),c}class VE{constructor(){this.VideoSample=null}createVideoSample(e,t,n,i){return{key:e,frame:!1,pts:t,dts:n,units:[],debug:i,length:0}}getLastNalUnit(e){var t;let n=this.VideoSample,i;if((!n||n.units.length===0)&&(n=e[e.length-1]),(t=n)!=null&&t.units){const s=n.units;i=s[s.length-1]}return i}pushAccessUnit(e,t){if(e.units.length&&e.frame){if(e.pts===void 0){const n=t.samples,i=n.length;if(i){const s=n[i-1];e.pts=s.pts,e.dts=s.dts}else{t.dropped++;return}}t.samples.push(e)}e.debug.length&&U.log(e.pts+"/"+e.dts+":"+e.debug)}}class Su{constructor(e){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}loadWord(){const e=this.data,t=this.bytesAvailable,n=e.byteLength-t,i=new Uint8Array(4),s=Math.min(4,t);if(s===0)throw new Error("no bytes available");i.set(e.subarray(n,n+s)),this.word=new DataView(i.buffer).getUint32(0),this.bitsAvailable=s*8,this.bytesAvailable-=s}skipBits(e){let t;e=Math.min(e,this.bytesAvailable*8+this.bitsAvailable),this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,t=e>>3,e-=t<<3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}readBits(e){let t=Math.min(this.bitsAvailable,e);const n=this.word>>>32-t;if(e>32&&U.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0)this.word<<=t;else if(this.bytesAvailable>0)this.loadWord();else throw new Error("no bits available");return t=e-t,t>0&&this.bitsAvailable?n<<t|this.readBits(t):n}skipLZ(){let e;for(e=0;e<this.bitsAvailable;++e)if(this.word&2147483648>>>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 t=8,n=8,i;for(let s=0;s<e;s++)n!==0&&(i=this.readEG(),n=(t+i+256)%256),t=n===0?t:n}readSPS(){let e=0,t=0,n=0,i=0,s,o,a;const l=this.readUByte.bind(this),A=this.readBits.bind(this),c=this.readUEG.bind(this),u=this.readBoolean.bind(this),h=this.skipBits.bind(this),d=this.skipEG.bind(this),f=this.skipUEG.bind(this),g=this.skipScalingList.bind(this);l();const p=l();if(A(5),h(3),l(),f(),p===100||p===110||p===122||p===244||p===44||p===83||p===86||p===118||p===128){const R=c();if(R===3&&h(1),f(),f(),h(1),u())for(o=R!==3?8:12,a=0;a<o;a++)u()&&(a<6?g(16):g(64))}f();const C=c();if(C===0)c();else if(C===1)for(h(1),d(),d(),s=c(),a=0;a<s;a++)d();f(),h(1);const T=c(),b=c(),y=A(1);y===0&&h(1),h(1),u()&&(e=c(),t=c(),n=c(),i=c());let x=[1,1];if(u()&&u())switch(l()){case 1:x=[1,1];break;case 2:x=[12,11];break;case 3:x=[10,11];break;case 4:x=[16,11];break;case 5:x=[40,33];break;case 6:x=[24,11];break;case 7:x=[20,11];break;case 8:x=[32,11];break;case 9:x=[80,33];break;case 10:x=[18,11];break;case 11:x=[15,11];break;case 12:x=[64,33];break;case 13:x=[160,99];break;case 14:x=[4,3];break;case 15:x=[3,2];break;case 16:x=[2,1];break;case 255:{x=[l()<<8|l(),l()<<8|l()];break}}return{width:Math.ceil((T+1)*16-e*2-t*2),height:(2-y)*(b+1)*16-(y?2:4)*(n+i),pixelRatio:x}}readSliceType(){return this.readUByte(),this.readUEG(),this.readUEG()}}class KE extends VE{parseAVCPES(e,t,n,i,s){const o=this.parseAVCNALu(e,n.data);let a=this.VideoSample,l,A=!1;n.data=null,a&&o.length&&!e.audFound&&(this.pushAccessUnit(a,e),a=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts,"")),o.forEach(c=>{var u;switch(c.type){case 1:{let g=!1;l=!0;const p=c.data;if(A&&p.length>4){const C=new Su(p).readSliceType();(C===2||C===4||C===7||C===9)&&(g=!0)}if(g){var h;(h=a)!=null&&h.frame&&!a.key&&(this.pushAccessUnit(a,e),a=this.VideoSample=null)}a||(a=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts,"")),a.frame=!0,a.key=g;break}case 5:l=!0,(u=a)!=null&&u.frame&&!a.key&&(this.pushAccessUnit(a,e),a=this.VideoSample=null),a||(a=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts,"")),a.key=!0,a.frame=!0;break;case 6:{l=!0,Dc(c.data,1,n.pts,t.samples);break}case 7:{var d,f;l=!0,A=!0;const g=c.data,C=new Su(g).readSPS();if(!e.sps||e.width!==C.width||e.height!==C.height||((d=e.pixelRatio)==null?void 0:d[0])!==C.pixelRatio[0]||((f=e.pixelRatio)==null?void 0:f[1])!==C.pixelRatio[1]){e.width=C.width,e.height=C.height,e.pixelRatio=C.pixelRatio,e.sps=[g],e.duration=s;const T=g.subarray(1,4);let b="avc1.";for(let y=0;y<3;y++){let x=T[y].toString(16);x.length<2&&(x="0"+x),b+=x}e.codec=b}break}case 8:l=!0,e.pps=[c.data];break;case 9:l=!0,e.audFound=!0,a&&this.pushAccessUnit(a,e),a=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts,"");break;case 12:l=!0;break;default:l=!1,a&&(a.debug+="unknown NAL "+c.type+" ");break}a&&l&&a.units.push(c)}),i&&a&&(this.pushAccessUnit(a,e),this.VideoSample=null)}parseAVCNALu(e,t){const n=t.byteLength;let i=e.naluState||0;const s=i,o=[];let a=0,l,A,c,u=-1,h=0;for(i===-1&&(u=0,h=t[0]&31,i=0,a=1);a<n;){if(l=t[a++],!i){i=l?0:1;continue}if(i===1){i=l?0:2;continue}if(!l)i=3;else if(l===1){if(A=a-i-1,u>=0){const d={data:t.subarray(u,A),type:h};o.push(d)}else{const d=this.getLastNalUnit(e.samples);d&&(s&&a<=4-s&&d.state&&(d.data=d.data.subarray(0,d.data.byteLength-s)),A>0&&(d.data=Ot(d.data,t.subarray(0,A)),d.state=0))}a<n?(c=t[a]&31,u=a,h=c,i=0):i=-1}else i=0}if(u>=0&&i>=0){const d={data:t.subarray(u,n),type:h,state:i};o.push(d)}if(o.length===0){const d=this.getLastNalUnit(e.samples);d&&(d.data=Ot(d.data,t))}return e.naluState=i,o}}class JE{constructor(e,t,n){this.keyData=void 0,this.decrypter=void 0,this.keyData=n,this.decrypter=new pa(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer)}decryptAacSample(e,t,n){const i=e[t].unit;if(i.length<=16)return;const s=i.subarray(16,i.length-i.length%16),o=s.buffer.slice(s.byteOffset,s.byteOffset+s.length);this.decryptBuffer(o).then(a=>{const l=new Uint8Array(a);i.set(l,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,n)})}decryptAacSamples(e,t,n){for(;;t++){if(t>=e.length){n();return}if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,n),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const t=Math.floor((e.length-48)/160)*16+16,n=new Int8Array(t);let i=0;for(let s=32;s<e.length-16;s+=160,i+=16)n.set(e.subarray(s,s+16),i);return n}getAvcDecryptedUnit(e,t){const n=new Uint8Array(t);let i=0;for(let s=32;s<e.length-16;s+=160,i+=16)e.set(n.subarray(i,i+16),s);return e}decryptAvcSample(e,t,n,i,s){const o=_c(s.data),a=this.getAvcEncryptedData(o);this.decryptBuffer(a.buffer).then(l=>{s.data=this.getAvcDecryptedUnit(o,l),this.decrypter.isSync()||this.decryptAvcSamples(e,t,n+1,i)})}decryptAvcSamples(e,t,n,i){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,n=0){if(t>=e.length){i();return}const s=e[t].units;for(;!(n>=s.length);n++){const o=s[n];if(!(o.data.length<=48||o.type!==1&&o.type!==5)&&(this.decryptAvcSample(e,t,n,i,o),!this.decrypter.isSync()))return}}}}const dt=188;class Rr{constructor(e,t,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._videoTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.remainderData=null,this.videoParser=void 0,this.observer=e,this.config=t,this.typeSupported=n,this.videoParser=new KE}static probe(e){const t=Rr.syncOffset(e);return t>0&&U.warn(`MPEG2-TS detected but first sync word found @ offset ${t}`),t!==-1}static syncOffset(e){const t=e.length;let n=Math.min(dt*5,t-dt)+1,i=0;for(;i<n;){let s=!1,o=-1,a=0;for(let l=i;l<t;l+=dt)if(e[l]===71&&(t-l===dt||e[l+dt]===71)){if(a++,o===-1&&(o=l,o!==0&&(n=Math.min(o+dt*99,e.length-dt)+1)),s||(s=va(e,l)===0),s&&a>1&&(o===0&&a>2||l+dt>n))return o}else{if(a)return-1;break}i++}return-1}static createTrack(e,t){return{container:e==="video"||e==="audio"?"video/mp2t":void 0,type:e,id:Qc[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:e==="audio"?t:void 0}}resetInitSegment(e,t,n,i){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=Rr.createTrack("video"),this._audioTrack=Rr.createTrack("audio",i),this._id3Track=Rr.createTrack("id3"),this._txtTrack=Rr.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=n,this._duration=i}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_videoTrack:t,_id3Track:n}=this;e&&(e.pesData=null),t&&(t.pesData=null),n&&(n.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(e,t,n=!1,i=!1){n||(this.sampleAes=null);let s;const o=this._videoTrack,a=this._audioTrack,l=this._id3Track,A=this._txtTrack;let c=o.pid,u=o.pesData,h=a.pid,d=l.pid,f=a.pesData,g=l.pesData,p=null,C=this.pmtParsed,T=this._pmtId,b=e.length;if(this.remainderData&&(e=Ot(this.remainderData,e),b=e.length,this.remainderData=null),b<dt&&!i)return this.remainderData=e,{audioTrack:a,videoTrack:o,id3Track:l,textTrack:A};const y=Math.max(0,Rr.syncOffset(e));b-=(b-y)%dt,b<e.byteLength&&!i&&(this.remainderData=new Uint8Array(e.buffer,b,e.buffer.byteLength-b));let x=0;for(let k=y;k<b;k+=dt)if(e[k]===71){const $=!!(e[k+1]&64),V=va(e,k),O=(e[k+3]&48)>>4;let J;if(O>1){if(J=k+5+e[k+4],J===k+dt)continue}else J=k+4;switch(V){case c:$&&(u&&(s=Bn(u))&&this.videoParser.parseAVCPES(o,A,s,!1,this._duration),u={data:[],size:0}),u&&(u.data.push(e.subarray(J,k+dt)),u.size+=k+dt-J);break;case h:if($){if(f&&(s=Bn(f)))switch(a.segmentCodec){case"aac":this.parseAACPES(a,s);break;case"mp3":this.parseMPEGPES(a,s);break;case"ac3":this.parseAC3PES(a,s);break}f={data:[],size:0}}f&&(f.data.push(e.subarray(J,k+dt)),f.size+=k+dt-J);break;case d:$&&(g&&(s=Bn(g))&&this.parseID3PES(l,s),g={data:[],size:0}),g&&(g.data.push(e.subarray(J,k+dt)),g.size+=k+dt-J);break;case 0:$&&(J+=e[J]+1),T=this._pmtId=WE(e,J);break;case T:{$&&(J+=e[J]+1);const ne=qE(e,J,this.typeSupported,n,this.observer);c=ne.videoPid,c>0&&(o.pid=c,o.segmentCodec=ne.segmentVideoCodec),h=ne.audioPid,h>0&&(a.pid=h,a.segmentCodec=ne.segmentAudioCodec),d=ne.id3Pid,d>0&&(l.pid=d),p!==null&&!C&&(U.warn(`MPEG-TS PMT found at ${k} after unknown PID '${p}'. Backtracking to sync byte @${y} to parse all TS packets.`),p=null,k=y-188),C=this.pmtParsed=!0;break}case 17:case 8191:break;default:p=V;break}}else x++;x>0&&Qs(this.observer,new Error(`Found ${x} TS packet/s that do not start with 0x47`)),o.pesData=u,a.pesData=f,l.pesData=g;const R={audioTrack:a,videoTrack:o,id3Track:l,textTrack:A};return i&&this.extractRemainingSamples(R),R}flush(){const{remainderData:e}=this;this.remainderData=null;let t;return e?t=this.demux(e,-1,!1,!0):t={videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t}extractRemainingSamples(e){const{audioTrack:t,videoTrack:n,id3Track:i,textTrack:s}=e,o=n.pesData,a=t.pesData,l=i.pesData;let A;if(o&&(A=Bn(o))?(this.videoParser.parseAVCPES(n,s,A,!0,this._duration),n.pesData=null):n.pesData=o,a&&(A=Bn(a))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,A);break;case"mp3":this.parseMPEGPES(t,A);break;case"ac3":this.parseAC3PES(t,A);break}t.pesData=null}else a!=null&&a.size&&U.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=a;l&&(A=Bn(l))?(this.parseID3PES(i,A),i.pesData=null):i.pesData=l}demuxSampleAes(e,t,n){const i=this.demux(e,n,!0,!this.config.progressive),s=this.sampleAes=new JE(this.observer,this.config,t);return this.decrypt(i,s)}decrypt(e,t){return new Promise(n=>{const{audioTrack:i,videoTrack:s}=e;i.samples&&i.segmentCodec==="aac"?t.decryptAacSamples(i.samples,0,()=>{s.samples?t.decryptAvcSamples(s.samples,0,0,()=>{n(e)}):n(e)}):s.samples&&t.decryptAvcSamples(s.samples,0,0,()=>{n(e)})})}destroy(){this._duration=0}parseAACPES(e,t){let n=0;const i=this.aacOverFlow;let s=t.data;if(i){this.aacOverFlow=null;const u=i.missing,h=i.sample.unit.byteLength;if(u===-1)s=Ot(i.sample.unit,s);else{const d=h-u;i.sample.unit.set(s.subarray(0,u),d),e.samples.push(i.sample),n=i.missing}}let o,a;for(o=n,a=s.length;o<a-1&&!ys(s,o);o++);if(o!==n){let u;const h=o<a-1;if(h?u=`AAC PES did not start with ADTS header,offset:${o}`:u="No ADTS header found in AAC PES",Qs(this.observer,new Error(u),h),!h)return}Cu(e,this.observer,s,o,this.audioCodec);let l;if(t.pts!==void 0)l=t.pts;else if(i){const u=vu(e.samplerate);l=i.sample.pts+u}else{U.warn("[tsdemuxer]: AAC PES unknown PTS");return}let A=0,c;for(;o<a;)if(c=yu(e,s,o,l,A),o+=c.length,c.missing){this.aacOverFlow=c;break}else for(A++;o<a-1&&!ys(s,o);o++);}parseMPEGPES(e,t){const n=t.data,i=n.length;let s=0,o=0;const a=t.pts;if(a===void 0){U.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;o<i;)if(Tu(n,o)){const l=Bu(e,n,o,a,s);if(l)o+=l.length,s++;else break}else o++}parseAC3PES(e,t){{const n=t.data,i=t.pts;if(i===void 0){U.warn("[tsdemuxer]: AC3 PES unknown PTS");return}const s=n.length;let o=0,a=0,l;for(;a<s&&(l=wu(e,n,a,i,o++))>0;)a+=l}}parseID3PES(e,t){if(t.pts===void 0){U.warn("[tsdemuxer]: ID3 PES unknown PTS");return}const n=st({},t,{type:this._videoTrack?Jt.emsg:Jt.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(n)}}function va(r,e){return((r[e+1]&31)<<8)+r[e+2]}function WE(r,e){return(r[e+10]&31)<<8|r[e+11]}function qE(r,e,t,n,i){const s={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},o=(r[e+1]&15)<<8|r[e+2],a=e+3+o-4,l=(r[e+10]&15)<<8|r[e+11];for(e+=12+l;e<a;){const A=va(r,e),c=(r[e+3]&15)<<8|r[e+4];switch(r[e]){case 207:if(!n){ya("ADTS AAC");break}case 15:s.audioPid===-1&&(s.audioPid=A);break;case 21:s.id3Pid===-1&&(s.id3Pid=A);break;case 219:if(!n){ya("H.264");break}case 27:s.videoPid===-1&&(s.videoPid=A,s.segmentVideoCodec="avc");break;case 3:case 4:!t.mpeg&&!t.mp3?U.log("MPEG audio found, not supported in this browser"):s.audioPid===-1&&(s.audioPid=A,s.segmentAudioCodec="mp3");break;case 193:if(!n){ya("AC-3");break}case 129:t.ac3?s.audioPid===-1&&(s.audioPid=A,s.segmentAudioCodec="ac3"):U.log("AC-3 audio found, not supported in this browser");break;case 6:if(s.audioPid===-1&&c>0){let u=e+5,h=c;for(;h>2;){switch(r[u]){case 106:t.ac3!==!0?U.log("AC-3 audio found, not supported in this browser for now"):(s.audioPid=A,s.segmentAudioCodec="ac3");break}const f=r[u+1]+2;u+=f,h-=f}}break;case 194:case 135:return Qs(i,new Error("Unsupported EC-3 in M2TS found")),s;case 36:return Qs(i,new Error("Unsupported HEVC in M2TS found")),s}e+=c+5}return s}function Qs(r,e,t){U.warn(`parsing error: ${e.message}`),r.emit(I.ERROR,I.ERROR,{type:ye.MEDIA_ERROR,details:K.FRAG_PARSING_ERROR,fatal:!1,levelRetry:t,error:e,reason:e.message})}function ya(r){U.log(`${r} with AES-128-CBC encryption found in unencrypted stream`)}function Bn(r){let e=0,t,n,i,s,o;const a=r.data;if(!r||r.size===0)return null;for(;a[0].length<19&&a.length>1;)a[0]=Ot(a[0],a[1]),a.splice(1,1);if(t=a[0],(t[0]<<16)+(t[1]<<8)+t[2]===1){if(n=(t[4]<<8)+t[5],n&&n>r.size-6)return null;const A=t[7];A&192&&(s=(t[9]&14)*536870912+(t[10]&255)*4194304+(t[11]&254)*16384+(t[12]&255)*128+(t[13]&254)/2,A&64?(o=(t[14]&14)*536870912+(t[15]&255)*4194304+(t[16]&254)*16384+(t[17]&255)*128+(t[18]&254)/2,s-o>54e5&&(U.warn(`${Math.round((s-o)/9e4)}s delta between PTS and DTS, align them`),s=o)):o=s),i=t[8];let c=i+9;if(r.size<=c)return null;r.size-=c;const u=new Uint8Array(r.size);for(let h=0,d=a.length;h<d;h++){t=a[h];let f=t.byteLength;if(c)if(c>f){c-=f;continue}else t=t.subarray(c),f-=c,c=0;u.set(t,e),e+=f}return n&&(n-=i+3),{data:u,pts:s,dts:o,len:n}}return null}class XE extends Ea{resetInitSegment(e,t,n,i){super.resetInitSegment(e,t,n,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const t=oi(e,0);let n=(t==null?void 0:t.length)||0;if(t&&e[n]===11&&e[n+1]===119&&zo(t)!==void 0&&xu(e,n)<=16)return!1;for(let i=e.length;n<i;n++)if(bu(e,n))return U.log("MPEG Audio sync word found !"),!0;return!1}canParse(e,t){return UE(e,t)}appendFrame(e,t,n){if(this.basePTS!==null)return Bu(e,t,n,this.basePTS,this.frameIndex)}}class Ru{static getSilentFrame(e,t){switch(e){case"mp4a.40.2":if(t===1)return new Uint8Array([0,200,0,128,35,128]);if(t===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(t===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(t===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(t===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(t===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(t===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(t===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(t===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}}}const Dr=Math.pow(2,32)-1;class G{static init(){G.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],dac3:[],"ac-3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};let e;for(e in G.types)G.types.hasOwnProperty(e)&&(G.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);const t=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),n=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);G.HDLR_TYPES={video:t,audio:n};const i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),s=new Uint8Array([0,0,0,0,0,0,0,0]);G.STTS=G.STSC=G.STCO=s,G.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),G.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),G.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),G.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);const o=new Uint8Array([105,115,111,109]),a=new Uint8Array([97,118,99,49]),l=new Uint8Array([0,0,0,1]);G.FTYP=G.box(G.types.ftyp,o,l,o,a),G.DINF=G.box(G.types.dinf,G.box(G.types.dref,i))}static box(e,...t){let n=8,i=t.length;const s=i;for(;i--;)n+=t[i].byteLength;const o=new Uint8Array(n);for(o[0]=n>>24&255,o[1]=n>>16&255,o[2]=n>>8&255,o[3]=n&255,o.set(e,4),i=0,n=8;i<s;i++)o.set(t[i],n),n+=t[i].byteLength;return o}static hdlr(e){return G.box(G.types.hdlr,G.HDLR_TYPES[e])}static mdat(e){return G.box(G.types.mdat,e)}static mdhd(e,t){t*=e;const n=Math.floor(t/(Dr+1)),i=Math.floor(t%(Dr+1));return G.box(G.types.mdhd,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,85,196,0,0]))}static mdia(e){return G.box(G.types.mdia,G.mdhd(e.timescale,e.duration),G.hdlr(e.type),G.minf(e))}static mfhd(e){return G.box(G.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"?G.box(G.types.minf,G.box(G.types.smhd,G.SMHD),G.DINF,G.stbl(e)):G.box(G.types.minf,G.box(G.types.vmhd,G.VMHD),G.DINF,G.stbl(e))}static moof(e,t,n){return G.box(G.types.moof,G.mfhd(e),G.traf(n,t))}static moov(e){let t=e.length;const n=[];for(;t--;)n[t]=G.trak(e[t]);return G.box.apply(null,[G.types.moov,G.mvhd(e[0].timescale,e[0].duration)].concat(n).concat(G.mvex(e)))}static mvex(e){let t=e.length;const n=[];for(;t--;)n[t]=G.trex(e[t]);return G.box.apply(null,[G.types.mvex,...n])}static mvhd(e,t){t*=e;const n=Math.floor(t/(Dr+1)),i=Math.floor(t%(Dr+1)),s=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 G.box(G.types.mvhd,s)}static sdtp(e){const t=e.samples||[],n=new Uint8Array(4+t.length);let i,s;for(i=0;i<t.length;i++)s=t[i].flags,n[i+4]=s.dependsOn<<4|s.isDependedOn<<2|s.hasRedundancy;return G.box(G.types.sdtp,n)}static stbl(e){return G.box(G.types.stbl,G.stsd(e),G.box(G.types.stts,G.STTS),G.box(G.types.stsc,G.STSC),G.box(G.types.stsz,G.STSZ),G.box(G.types.stco,G.STCO))}static avc1(e){let t=[],n=[],i,s,o;for(i=0;i<e.sps.length;i++)s=e.sps[i],o=s.byteLength,t.push(o>>>8&255),t.push(o&255),t=t.concat(Array.prototype.slice.call(s));for(i=0;i<e.pps.length;i++)s=e.pps[i],o=s.byteLength,n.push(o>>>8&255),n.push(o&255),n=n.concat(Array.prototype.slice.call(s));const a=G.box(G.types.avcC,new Uint8Array([1,t[3],t[4],t[5],255,224|e.sps.length].concat(t).concat([e.pps.length]).concat(n))),l=e.width,A=e.height,c=e.pixelRatio[0],u=e.pixelRatio[1];return G.box(G.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,l>>8&255,l&255,A>>8&255,A&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]),a,G.box(G.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),G.box(G.types.pasp,new Uint8Array([c>>24,c>>16&255,c>>8&255,c&255,u>>24,u>>16&255,u>>8&255,u&255])))}static esds(e){const t=e.config.length;return new Uint8Array([0,0,0,0,3,23+t,0,1,0,4,15+t,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([t]).concat(e.config).concat([6,1,2]))}static audioStsd(e){const t=e.samplerate;return 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,t>>8&255,t&255,0,0])}static mp4a(e){return G.box(G.types.mp4a,G.audioStsd(e),G.box(G.types.esds,G.esds(e)))}static mp3(e){return G.box(G.types[".mp3"],G.audioStsd(e))}static ac3(e){return G.box(G.types["ac-3"],G.audioStsd(e),G.box(G.types.dac3,e.config))}static stsd(e){return e.type==="audio"?e.segmentCodec==="mp3"&&e.codec==="mp3"?G.box(G.types.stsd,G.STSD,G.mp3(e)):e.segmentCodec==="ac3"?G.box(G.types.stsd,G.STSD,G.ac3(e)):G.box(G.types.stsd,G.STSD,G.mp4a(e)):G.box(G.types.stsd,G.STSD,G.avc1(e))}static tkhd(e){const t=e.id,n=e.duration*e.timescale,i=e.width,s=e.height,o=Math.floor(n/(Dr+1)),a=Math.floor(n%(Dr+1));return G.box(G.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,t&255,0,0,0,0,o>>24,o>>16&255,o>>8&255,o&255,a>>24,a>>16&255,a>>8&255,a&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,s>>8&255,s&255,0,0]))}static traf(e,t){const n=G.sdtp(e),i=e.id,s=Math.floor(t/(Dr+1)),o=Math.floor(t%(Dr+1));return G.box(G.types.traf,G.box(G.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,i&255])),G.box(G.types.tfdt,new Uint8Array([1,0,0,0,s>>24,s>>16&255,s>>8&255,s&255,o>>24,o>>16&255,o>>8&255,o&255])),G.trun(e,n.length+16+20+8+16+8+8),n)}static trak(e){return e.duration=e.duration||4294967295,G.box(G.types.trak,G.tkhd(e),G.mdia(e))}static trex(e){const t=e.id;return G.box(G.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,t&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(e,t){const n=e.samples||[],i=n.length,s=12+16*i,o=new Uint8Array(s);let a,l,A,c,u,h;for(t+=8+s,o.set([e.type==="video"?1:0,0,15,1,i>>>24&255,i>>>16&255,i>>>8&255,i&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255],0),a=0;a<i;a++)l=n[a],A=l.duration,c=l.size,u=l.flags,h=l.cts,o.set([A>>>24&255,A>>>16&255,A>>>8&255,A&255,c>>>24&255,c>>>16&255,c>>>8&255,c&255,u.isLeading<<2|u.dependsOn,u.isDependedOn<<6|u.hasRedundancy<<4|u.paddingValue<<1|u.isNonSync,u.degradPrio&61440,u.degradPrio&15,h>>>24&255,h>>>16&255,h>>>8&255,h&255],12+16*a);return G.box(G.types.trun,o)}static initSegment(e){G.types||G.init();const t=G.moov(e);return Ot(G.FTYP,t)}}G.types=void 0,G.HDLR_TYPES=void 0,G.STTS=void 0,G.STSC=void 0,G.STCO=void 0,G.STSZ=void 0,G.VMHD=void 0,G.SMHD=void 0,G.STSD=void 0,G.FTYP=void 0,G.DINF=void 0;const Du=9e4;function Ba(r,e,t=1,n=!1){const i=r*e*t;return n?Math.round(i):i}function jE(r,e,t=1,n=!1){return Ba(r,e,1/t,n)}function Ai(r,e=!1){return Ba(r,1e3,1/Du,e)}function zE(r,e=1){return Ba(r,Du,1/e)}const ZE=10*1e3,_u=1024,eI=1152,tI=1536;let Qn=null,Qa=null;class Ts{constructor(e,t,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.videoTrackConfig=void 0,this.observer=e,this.config=t,this.typeSupported=n,this.ISGenerated=!1,Qn===null){const o=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Qn=o?parseInt(o[1]):0}if(Qa===null){const s=navigator.userAgent.match(/Safari\/(\d+)/i);Qa=s?parseInt(s[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(e){U.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=e}resetNextTimestamp(){U.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){U.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(e){let t=!1;const n=e.reduce((i,s)=>{const o=s.pts-i;return o<-4294967296?(t=!0,Ut(i,s.pts)):o>0?i:s.pts},e[0].pts);return t&&U.debug("PTS rollover detected"),n}remux(e,t,n,i,s,o,a,l){let A,c,u,h,d,f,g=s,p=s;const C=e.pid>-1,T=t.pid>-1,b=t.samples.length,y=e.samples.length>0,x=a&&b>0||b>1;if((!C||y)&&(!T||x)||this.ISGenerated||a){if(this.ISGenerated){var k,$,V,O;const le=this.videoTrackConfig;le&&(t.width!==le.width||t.height!==le.height||((k=t.pixelRatio)==null?void 0:k[0])!==(($=le.pixelRatio)==null?void 0:$[0])||((V=t.pixelRatio)==null?void 0:V[1])!==((O=le.pixelRatio)==null?void 0:O[1]))&&this.resetInitSegment()}else u=this.generateIS(e,t,s,o);const J=this.isVideoContiguous;let ne=-1,ee;if(x&&(ne=rI(t.samples),!J&&this.config.forceKeyFrameOnDiscontinuity))if(f=!0,ne>0){U.warn(`[mp4-remuxer]: Dropped ${ne} out of ${b} video samples due to a missing keyframe`);const le=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(ne),t.dropped+=ne,p+=(t.samples[0].pts-le)/t.inputTimeScale,ee=p}else ne===-1&&(U.warn(`[mp4-remuxer]: No keyframe found out of ${b} video samples`),f=!1);if(this.ISGenerated){if(y&&x){const le=this.getVideoStartPts(t.samples),P=(Ut(e.samples[0].pts,le)-le)/t.inputTimeScale;g+=Math.max(0,P),p+=Math.max(0,-P)}if(y){if(e.samplerate||(U.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),u=this.generateIS(e,t,s,o)),c=this.remuxAudio(e,g,this.isAudioContiguous,o,T||x||l===Ee.AUDIO?p:void 0),x){const le=c?c.endPTS-c.startPTS:0;t.inputTimeScale||(U.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),u=this.generateIS(e,t,s,o)),A=this.remuxVideo(t,p,J,le)}}else x&&(A=this.remuxVideo(t,p,J,0));A&&(A.firstKeyFrame=ne,A.independent=ne!==-1,A.firstKeyFramePTS=ee)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(n.samples.length&&(d=Lu(n,s,this._initPTS,this._initDTS)),i.samples.length&&(h=Fu(i,s,this._initPTS))),{audio:c,video:A,initSegment:u,independent:f,text:h,id3:d}}generateIS(e,t,n,i){const s=e.samples,o=t.samples,a=this.typeSupported,l={},A=this._initPTS;let c=!A||i,u="audio/mp4",h,d,f;if(c&&(h=d=1/0),e.config&&s.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":a.mpeg?(u="audio/mpeg",e.codec=""):a.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3";break}l.audio={id:"audio",container:u,codec:e.codec,initSegment:e.segmentCodec==="mp3"&&a.mpeg?new Uint8Array(0):G.initSegment([e]),metadata:{channelCount:e.channelCount}},c&&(f=e.inputTimeScale,!A||f!==A.timescale?h=d=s[0].pts-Math.round(f*n):c=!1)}if(t.sps&&t.pps&&o.length){if(t.timescale=t.inputTimeScale,l.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:G.initSegment([t]),metadata:{width:t.width,height:t.height}},c)if(f=t.inputTimeScale,!A||f!==A.timescale){const g=this.getVideoStartPts(o),p=Math.round(f*n);d=Math.min(d,Ut(o[0].dts,g)-p),h=Math.min(h,g-p)}else c=!1;this.videoTrackConfig={width:t.width,height:t.height,pixelRatio:t.pixelRatio}}if(Object.keys(l).length)return this.ISGenerated=!0,c?(this._initPTS={baseTime:h,timescale:f},this._initDTS={baseTime:d,timescale:f}):h=f=void 0,{tracks:l,initPTS:h,timescale:f}}remuxVideo(e,t,n,i){const s=e.inputTimeScale,o=e.samples,a=[],l=o.length,A=this._initPTS;let c=this.nextAvcDts,u=8,h=this.videoSampleDuration,d,f,g=Number.POSITIVE_INFINITY,p=Number.NEGATIVE_INFINITY,C=!1;if(!n||c===null){const S=t*s,F=o[0].pts-Ut(o[0].dts,o[0].pts);Qn&&c!==null&&Math.abs(S-F-c)<15e3?n=!0:c=S-F}const T=A.baseTime*s/A.timescale;for(let S=0;S<l;S++){const F=o[S];F.pts=Ut(F.pts-T,c),F.dts=Ut(F.dts-T,c),F.dts<o[S>0?S-1:S].dts&&(C=!0)}C&&o.sort(function(S,F){const W=S.dts-F.dts,Y=S.pts-F.pts;return W||Y}),d=o[0].dts,f=o[o.length-1].dts;const b=f-d,y=b?Math.round(b/(l-1)):h||e.inputTimeScale/30;if(n){const S=d-c,F=S>y,W=S<-1;if((F||W)&&(F?U.warn(`AVC: ${Ai(S,!0)} ms (${S}dts) hole between fragments detected at ${t.toFixed(3)}`):U.warn(`AVC: ${Ai(-S,!0)} ms (${S}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!W||c>=o[0].pts||Qn)){d=c;const Y=o[0].pts-S;if(F)o[0].dts=d,o[0].pts=Y;else for(let re=0;re<o.length&&!(o[re].dts>Y);re++)o[re].dts-=S,o[re].pts-=S;U.log(`Video: Initial PTS/DTS adjusted: ${Ai(Y,!0)}/${Ai(d,!0)}, delta: ${Ai(S,!0)} ms`)}}d=Math.max(0,d);let x=0,R=0,k=d;for(let S=0;S<l;S++){const F=o[S],W=F.units,Y=W.length;let re=0;for(let ce=0;ce<Y;ce++)re+=W[ce].data.length;R+=re,x+=Y,F.length=re,F.dts<k?(F.dts=k,k+=y/4|0||1):k=F.dts,g=Math.min(F.pts,g),p=Math.max(F.pts,p)}f=o[l-1].dts;const $=R+4*x+8;let V;try{V=new Uint8Array($)}catch(S){this.observer.emit(I.ERROR,I.ERROR,{type:ye.MUX_ERROR,details:K.REMUX_ALLOC_ERROR,fatal:!1,error:S,bytes:$,reason:`fail allocating video mdat ${$}`});return}const O=new DataView(V.buffer);O.setUint32(0,$),V.set(G.types.mdat,4);let J=!1,ne=Number.POSITIVE_INFINITY,ee=Number.POSITIVE_INFINITY,le=Number.NEGATIVE_INFINITY,D=Number.NEGATIVE_INFINITY;for(let S=0;S<l;S++){const F=o[S],W=F.units;let Y=0;for(let pe=0,ge=W.length;pe<ge;pe++){const Se=W[pe],Le=Se.data,Ge=Se.data.byteLength;O.setUint32(u,Ge),u+=4,V.set(Le,u),u+=Ge,Y+=4+Ge}let re;if(S<l-1)h=o[S+1].dts-F.dts,re=o[S+1].pts-F.pts;else{const pe=this.config,ge=S>0?F.dts-o[S-1].dts:y;if(re=S>0?F.pts-o[S-1].pts:y,pe.stretchShortVideoTrack&&this.nextAudioPts!==null){const Se=Math.floor(pe.maxBufferHole*s),Le=(i?g+i*s:this.nextAudioPts)-F.pts;Le>Se?(h=Le-ge,h<0?h=ge:J=!0,U.log(`[mp4-remuxer]: It is approximately ${Le/90} ms to the next segment; using duration ${h/90} ms for the last video frame.`)):h=ge}else h=ge}const ce=Math.round(F.pts-F.dts);ne=Math.min(ne,h),le=Math.max(le,h),ee=Math.min(ee,re),D=Math.max(D,re),a.push(new ku(F.key,h,Y,ce))}if(a.length){if(Qn){if(Qn<70){const S=a[0].flags;S.dependsOn=2,S.isNonSync=0}}else if(Qa&&D-ee<le-ne&&y/le<.025&&a[0].cts===0){U.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let S=d;for(let F=0,W=a.length;F<W;F++){const Y=S+a[F].duration,re=S+a[F].cts;if(F<W-1){const ce=Y+a[F+1].cts;a[F].duration=ce-re}else a[F].duration=F?a[F-1].duration:y;a[F].cts=0,S=Y}}}h=J||!h?y:h,this.nextAvcDts=c=f+h,this.videoSampleDuration=h,this.isVideoContiguous=!0;const _={data1:G.moof(e.sequenceNumber++,d,st({},e,{samples:a})),data2:V,startPTS:g/s,endPTS:(p+h)/s,startDTS:d/s,endDTS:c/s,type:"video",hasAudio:!1,hasVideo:!0,nb:a.length,dropped:e.dropped};return e.samples=[],e.dropped=0,_}getSamplesPerFrame(e){switch(e.segmentCodec){case"mp3":return eI;case"ac3":return tI;default:return _u}}remuxAudio(e,t,n,i,s){const o=e.inputTimeScale,a=e.samplerate?e.samplerate:o,l=o/a,A=this.getSamplesPerFrame(e),c=A*l,u=this._initPTS,h=e.segmentCodec==="mp3"&&this.typeSupported.mpeg,d=[],f=s!==void 0;let g=e.samples,p=h?0:8,C=this.nextAudioPts||-1;const T=t*o,b=u.baseTime*o/u.timescale;if(this.isAudioContiguous=n=n||g.length&&C>0&&(i&&Math.abs(T-C)<9e3||Math.abs(Ut(g[0].pts-b,T)-C)<20*c),g.forEach(function(P){P.pts=Ut(P.pts-b,T)}),!n||C<0){if(g=g.filter(P=>P.pts>=0),!g.length)return;s===0?C=0:i&&!f?C=Math.max(0,T):C=g[0].pts}if(e.segmentCodec==="aac"){const P=this.config.maxAudioFramesDrift;for(let X=0,_=C;X<g.length;X++){const S=g[X],F=S.pts,W=F-_,Y=Math.abs(1e3*W/o);if(W<=-P*c&&f)X===0&&(U.warn(`Audio frame @ ${(F/o).toFixed(3)}s overlaps nextAudioPts by ${Math.round(1e3*W/o)} ms.`),this.nextAudioPts=C=_=F);else if(W>=P*c&&Y<ZE&&f){let re=Math.round(W/c);_=F-re*c,_<0&&(re--,_+=c),X===0&&(this.nextAudioPts=C=_),U.warn(`[mp4-remuxer]: Injecting ${re} audio frame @ ${(_/o).toFixed(3)}s due to ${Math.round(1e3*W/o)} ms gap.`);for(let ce=0;ce<re;ce++){const pe=Math.max(_,0);let ge=Ru.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);ge||(U.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),ge=S.unit.subarray()),g.splice(X,0,{unit:ge,pts:pe}),_+=c,X++}}S.pts=_,_+=c}}let y=null,x=null,R,k=0,$=g.length;for(;$--;)k+=g[$].unit.byteLength;for(let P=0,X=g.length;P<X;P++){const _=g[P],S=_.unit;let F=_.pts;if(x!==null){const Y=d[P-1];Y.duration=Math.round((F-x)/l)}else if(n&&e.segmentCodec==="aac"&&(F=C),y=F,k>0){k+=p;try{R=new Uint8Array(k)}catch(Y){this.observer.emit(I.ERROR,I.ERROR,{type:ye.MUX_ERROR,details:K.REMUX_ALLOC_ERROR,fatal:!1,error:Y,bytes:k,reason:`fail allocating audio mdat ${k}`});return}h||(new DataView(R.buffer).setUint32(0,k),R.set(G.types.mdat,4))}else return;R.set(S,p);const W=S.byteLength;p+=W,d.push(new ku(!0,A,W,0)),x=F}const V=d.length;if(!V)return;const O=d[d.length-1];this.nextAudioPts=C=x+l*O.duration;const J=h?new Uint8Array(0):G.moof(e.sequenceNumber++,y/l,st({},e,{samples:d}));e.samples=[];const ne=y/o,ee=C/o,D={data1:J,data2:R,startPTS:ne,endPTS:ee,startDTS:ne,endDTS:ee,type:"audio",hasAudio:!0,hasVideo:!1,nb:V};return this.isAudioContiguous=!0,D}remuxEmptyAudio(e,t,n,i){const s=e.inputTimeScale,o=e.samplerate?e.samplerate:s,a=s/o,l=this.nextAudioPts,A=this._initDTS,c=A.baseTime*9e4/A.timescale,u=(l!==null?l:i.startDTS*s)+c,h=i.endDTS*s+c,d=a*_u,f=Math.ceil((h-u)/d),g=Ru.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(U.warn("[mp4-remuxer]: remux empty Audio"),!g){U.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}const p=[];for(let C=0;C<f;C++){const T=u+C*d;p.push({unit:g,pts:T,dts:T})}return e.samples=p,this.remuxAudio(e,t,n,!1)}}function Ut(r,e){let t;if(e===null)return r;for(e<r?t=-8589934592:t=8589934592;Math.abs(r-e)>4294967296;)r+=t;return r}function rI(r){for(let e=0;e<r.length;e++)if(r[e].key)return e;return-1}function Lu(r,e,t,n){const i=r.samples.length;if(!i)return;const s=r.inputTimeScale;for(let a=0;a<i;a++){const l=r.samples[a];l.pts=Ut(l.pts-t.baseTime*s/t.timescale,e*s)/s,l.dts=Ut(l.dts-n.baseTime*s/n.timescale,e*s)/s}const o=r.samples;return r.samples=[],{samples:o}}function Fu(r,e,t){const n=r.samples.length;if(!n)return;const i=r.inputTimeScale;for(let o=0;o<n;o++){const a=r.samples[o];a.pts=Ut(a.pts-t.baseTime*i/t.timescale,e*i)/i}r.samples.sort((o,a)=>o.pts-a.pts);const s=r.samples;return r.samples=[],{samples:s}}class ku{constructor(e,t,n,i){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=t,this.size=n,this.cts=i,this.flags={isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:e?2:1,isNonSync:e?0:1}}}class nI{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,t,n,i){this.audioCodec=t,this.videoCodec=n,this.generateInitSegment(cm(e,i)),this.emitInitSegment=!0}generateInitSegment(e){let{audioCodec:t,videoCodec:n}=this;if(!(e!=null&&e.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const i=this.initData=wc(e);i.audio&&(t=Nu(i.audio,He.AUDIO)),i.video&&(n=Nu(i.video,He.VIDEO));const s={};i.audio&&i.video?s.audiovideo={container:"video/mp4",codec:t+","+n,initSegment:e,id:"main"}:i.audio?s.audio={container:"audio/mp4",codec:t,initSegment:e,id:"audio"}:i.video?s.video={container:"video/mp4",codec:n,initSegment:e,id:"main"}:U.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=s}remux(e,t,n,i,s,o){var a,l;let{initPTS:A,lastEndTime:c}=this;const u={audio:void 0,video:void 0,text:i,id3:n,initSegment:void 0};he(c)||(c=this.lastEndTime=s||0);const h=t.samples;if(!(h!=null&&h.length))return u;const d={initPTS:void 0,timescale:1};let f=this.initData;if((a=f)!=null&&a.length||(this.generateInitSegment(h),f=this.initData),!((l=f)!=null&&l.length))return U.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),u;this.emitInitSegment&&(d.tracks=this.initTracks,this.emitInitSegment=!1);const g=hm(h,f),p=um(f,h),C=p===null?s:p;(iI(A,C,s,g)||d.timescale!==A.timescale&&o)&&(d.initPTS=C-s,A&&A.timescale===1&&U.warn(`Adjusting initPTS by ${d.initPTS-A.baseTime}`),this.initPTS=A={baseTime:d.initPTS,timescale:1});const T=e?C-A.baseTime/A.timescale:c,b=T+g;fm(f,h,A.baseTime/A.timescale),g>0?this.lastEndTime=b:(U.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const y=!!f.audio,x=!!f.video;let R="";y&&(R+="audio"),x&&(R+="video");const k={data1:h,startPTS:T,startDTS:T,endPTS:b,endDTS:b,type:R,hasAudio:y,hasVideo:x,nb:1,dropped:0};return u.audio=k.type==="audio"?k:void 0,u.video=k.type!=="audio"?k:void 0,u.initSegment=d,u.id3=Lu(n,s,A,A),i.samples.length&&(u.text=Fu(i,s,A)),u}}function iI(r,e,t,n){if(r===null)return!0;const i=Math.max(n,1),s=e-r.baseTime/r.timescale;return Math.abs(s-t)>i}function Nu(r,e){const t=r==null?void 0:r.codec;if(t&&t.length>4)return t;if(e===He.AUDIO){if(t==="ec-3"||t==="ac-3"||t==="alac")return t;if(t==="fLaC"||t==="Opus")return cs(t,!1);const n="mp4a.40.5";return U.info(`Parsed audio codec "${t}" or audio object type not handled. Using "${n}"`),n}return U.warn(`Unhandled video codec "${t}"`),t==="hvc1"||t==="hev1"?"hvc1.1.6.L120.90":t==="av01"?"av01.0.04M.08":"avc1.42e01e"}let Cr;try{Cr=self.performance.now.bind(self.performance)}catch{U.debug("Unable to use Performance API on this environment"),Cr=pn==null?void 0:pn.Date.now}const bs=[{demux:$E,remux:nI},{demux:Rr,remux:Ts},{demux:GE,remux:Ts},{demux:XE,remux:Ts}];bs.splice(2,0,{demux:YE,remux:Ts});class Mu{constructor(e,t,n,i,s){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=t,this.config=n,this.vendor=i,this.id=s}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,t,n,i){const s=n.transmuxing;s.executeStart=Cr();let o=new Uint8Array(e);const{currentTransmuxState:a,transmuxConfig:l}=this;i&&(this.currentTransmuxState=i);const{contiguous:A,discontinuity:c,trackSwitch:u,accurateTimeOffset:h,timeOffset:d,initSegmentChange:f}=i||a,{audioCodec:g,videoCodec:p,defaultInitPts:C,duration:T,initSegmentData:b}=l,y=sI(o,t);if(y&&y.method==="AES-128"){const $=this.getDecrypter();if($.isSync()){let V=$.softwareDecrypt(o,y.key.buffer,y.iv.buffer);if(n.part>-1&&(V=$.flush()),!V)return s.executeEnd=Cr(),Ta(n);o=new Uint8Array(V)}else return this.decryptionPromise=$.webCryptoDecrypt(o,y.key.buffer,y.iv.buffer).then(V=>{const O=this.push(V,null,n);return this.decryptionPromise=null,O}),this.decryptionPromise}const x=this.needsProbing(c,u);if(x){const $=this.configureTransmuxer(o);if($)return U.warn(`[transmuxer] ${$.message}`),this.observer.emit(I.ERROR,I.ERROR,{type:ye.MEDIA_ERROR,details:K.FRAG_PARSING_ERROR,fatal:!1,error:$,reason:$.message}),s.executeEnd=Cr(),Ta(n)}(c||u||f||x)&&this.resetInitSegment(b,g,p,T,t),(c||f||x)&&this.resetInitialTimestamp(C),A||this.resetContiguity();const R=this.transmux(o,y,d,h,n),k=this.currentTransmuxState;return k.contiguous=!0,k.discontinuity=!1,k.trackSwitch=!1,s.executeEnd=Cr(),R}flush(e){const t=e.transmuxing;t.executeStart=Cr();const{decrypter:n,currentTransmuxState:i,decryptionPromise:s}=this;if(s)return s.then(()=>this.flush(e));const o=[],{timeOffset:a}=i;if(n){const u=n.flush();u&&o.push(this.push(u,null,e))}const{demuxer:l,remuxer:A}=this;if(!l||!A)return t.executeEnd=Cr(),[Ta(e)];const c=l.flush(a);return xs(c)?c.then(u=>(this.flushRemux(o,u,e),o)):(this.flushRemux(o,c,e),o)}flushRemux(e,t,n){const{audioTrack:i,videoTrack:s,id3Track:o,textTrack:a}=t,{accurateTimeOffset:l,timeOffset:A}=this.currentTransmuxState;U.log(`[transmuxer.ts]: Flushed fragment ${n.sn}${n.part>-1?" p: "+n.part:""} of level ${n.level}`);const c=this.remuxer.remux(i,s,o,a,A,l,!0,this.id);e.push({remuxResult:c,chunkMeta:n}),n.transmuxing.executeEnd=Cr()}resetInitialTimestamp(e){const{demuxer:t,remuxer:n}=this;!t||!n||(t.resetTimeStamp(e),n.resetTimeStamp(e))}resetContiguity(){const{demuxer:e,remuxer:t}=this;!e||!t||(e.resetContiguity(),t.resetNextTimestamp())}resetInitSegment(e,t,n,i,s){const{demuxer:o,remuxer:a}=this;!o||!a||(o.resetInitSegment(e,t,n,i),a.resetInitSegment(e,t,n,s))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,t,n,i,s){let o;return t&&t.method==="SAMPLE-AES"?o=this.transmuxSampleAes(e,t,n,i,s):o=this.transmuxUnencrypted(e,n,i,s),o}transmuxUnencrypted(e,t,n,i){const{audioTrack:s,videoTrack:o,id3Track:a,textTrack:l}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(s,o,a,l,t,n,!1,this.id),chunkMeta:i}}transmuxSampleAes(e,t,n,i,s){return this.demuxer.demuxSampleAes(e,t,n).then(o=>({remuxResult:this.remuxer.remux(o.audioTrack,o.videoTrack,o.id3Track,o.textTrack,n,i,!1,this.id),chunkMeta:s}))}configureTransmuxer(e){const{config:t,observer:n,typeSupported:i,vendor:s}=this;let o;for(let h=0,d=bs.length;h<d;h++){var a;if((a=bs[h].demux)!=null&&a.probe(e)){o=bs[h];break}}if(!o)return new Error("Failed to find demuxer by probing fragment data");const l=this.demuxer,A=this.remuxer,c=o.remux,u=o.demux;(!A||!(A instanceof c))&&(this.remuxer=new c(n,t,i,s)),(!l||!(l instanceof u))&&(this.demuxer=new u(n,t,i),this.probe=u.probe)}needsProbing(e,t){return!this.demuxer||!this.remuxer||e||t}getDecrypter(){let e=this.decrypter;return e||(e=this.decrypter=new pa(this.config)),e}}function sI(r,e){let t=null;return r.byteLength>0&&(e==null?void 0:e.key)!=null&&e.iv!==null&&e.method!=null&&(t=e),t}const Ta=r=>({remuxResult:{},chunkMeta:r});function xs(r){return"then"in r&&r.then instanceof Function}class oI{constructor(e,t,n,i,s){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=t,this.initSegmentData=n,this.duration=i,this.defaultInitPts=s||null}}class aI{constructor(e,t,n,i,s,o){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=t,this.accurateTimeOffset=n,this.trackSwitch=i,this.timeOffset=s,this.initSegmentChange=o}}var Pu={exports:{}};(function(r){var e=Object.prototype.hasOwnProperty,t="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(t=!1));function i(l,A,c){this.fn=l,this.context=A,this.once=c||!1}function s(l,A,c,u,h){if(typeof c!="function")throw new TypeError("The listener must be a function");var d=new i(c,u||l,h),f=t?t+A:A;return l._events[f]?l._events[f].fn?l._events[f]=[l._events[f],d]:l._events[f].push(d):(l._events[f]=d,l._eventsCount++),l}function o(l,A){--l._eventsCount===0?l._events=new n:delete l._events[A]}function a(){this._events=new n,this._eventsCount=0}a.prototype.eventNames=function(){var A=[],c,u;if(this._eventsCount===0)return A;for(u in c=this._events)e.call(c,u)&&A.push(t?u.slice(1):u);return Object.getOwnPropertySymbols?A.concat(Object.getOwnPropertySymbols(c)):A},a.prototype.listeners=function(A){var c=t?t+A:A,u=this._events[c];if(!u)return[];if(u.fn)return[u.fn];for(var h=0,d=u.length,f=new Array(d);h<d;h++)f[h]=u[h].fn;return f},a.prototype.listenerCount=function(A){var c=t?t+A:A,u=this._events[c];return u?u.fn?1:u.length:0},a.prototype.emit=function(A,c,u,h,d,f){var g=t?t+A:A;if(!this._events[g])return!1;var p=this._events[g],C=arguments.length,T,b;if(p.fn){switch(p.once&&this.removeListener(A,p.fn,void 0,!0),C){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,c),!0;case 3:return p.fn.call(p.context,c,u),!0;case 4:return p.fn.call(p.context,c,u,h),!0;case 5:return p.fn.call(p.context,c,u,h,d),!0;case 6:return p.fn.call(p.context,c,u,h,d,f),!0}for(b=1,T=new Array(C-1);b<C;b++)T[b-1]=arguments[b];p.fn.apply(p.context,T)}else{var y=p.length,x;for(b=0;b<y;b++)switch(p[b].once&&this.removeListener(A,p[b].fn,void 0,!0),C){case 1:p[b].fn.call(p[b].context);break;case 2:p[b].fn.call(p[b].context,c);break;case 3:p[b].fn.call(p[b].context,c,u);break;case 4:p[b].fn.call(p[b].context,c,u,h);break;default:if(!T)for(x=1,T=new Array(C-1);x<C;x++)T[x-1]=arguments[x];p[b].fn.apply(p[b].context,T)}}return!0},a.prototype.on=function(A,c,u){return s(this,A,c,u,!1)},a.prototype.once=function(A,c,u){return s(this,A,c,u,!0)},a.prototype.removeListener=function(A,c,u,h){var d=t?t+A:A;if(!this._events[d])return this;if(!c)return o(this,d),this;var f=this._events[d];if(f.fn)f.fn===c&&(!h||f.once)&&(!u||f.context===u)&&o(this,d);else{for(var g=0,p=[],C=f.length;g<C;g++)(f[g].fn!==c||h&&!f[g].once||u&&f[g].context!==u)&&p.push(f[g]);p.length?this._events[d]=p.length===1?p[0]:p:o(this,d)}return this},a.prototype.removeAllListeners=function(A){var c;return A?(c=t?t+A:A,this._events[c]&&o(this,c)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=t,a.EventEmitter=a,r.exports=a})(Pu);var lI=Pu.exports,ba=Dp(lI);class Ou{constructor(e,t,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 s=e.config;this.hls=e,this.id=t,this.useWorker=!!s.enableWorker,this.onTransmuxComplete=n,this.onFlush=i;const o=(A,c)=>{c=c||{},c.frag=this.frag,c.id=this.id,A===I.ERROR&&(this.error=c.error),this.hls.trigger(A,c)};this.observer=new ba,this.observer.on(I.FRAG_DECRYPTED,o),this.observer.on(I.ERROR,o);const a=qr(s.preferManagedMediaSource)||{isTypeSupported:()=>!1},l={mpeg:a.isTypeSupported("audio/mpeg"),mp3:a.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:a.isTypeSupported('audio/mp4; codecs="ac-3"')};if(this.useWorker&&typeof Worker<"u"&&(s.workerPath||xE())){try{s.workerPath?(U.log(`loading Web Worker ${s.workerPath} for "${t}"`),this.workerContext=SE(s.workerPath)):(U.log(`injecting Web Worker for "${t}"`),this.workerContext=wE()),this.onwmsg=u=>this.onWorkerMessage(u);const{worker:c}=this.workerContext;c.addEventListener("message",this.onwmsg),c.onerror=u=>{const h=new Error(`${u.message} (${u.filename}:${u.lineno})`);s.enableWorker=!1,U.warn(`Error in "${t}" Web Worker, fallback to inline`),this.hls.trigger(I.ERROR,{type:ye.OTHER_ERROR,details:K.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:h})},c.postMessage({cmd:"init",typeSupported:l,vendor:"",id:t,config:JSON.stringify(s)})}catch(c){U.warn(`Error setting up "${t}" Web Worker, fallback to inline`,c),this.resetWorker(),this.error=null,this.transmuxer=new Mu(this.observer,l,s,"",t)}return}this.transmuxer=new Mu(this.observer,l,s,"",t)}resetWorker(){if(this.workerContext){const{worker:e,objectURL:t}=this.workerContext;t&&self.URL.revokeObjectURL(t),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 t=this.transmuxer;t&&(t.destroy(),this.transmuxer=null)}const e=this.observer;e&&e.removeAllListeners(),this.frag=null,this.observer=null,this.hls=null}push(e,t,n,i,s,o,a,l,A,c){var u,h;A.transmuxing.start=self.performance.now();const{transmuxer:d}=this,f=o?o.start:s.start,g=s.decryptdata,p=this.frag,C=!(p&&s.cc===p.cc),T=!(p&&A.level===p.level),b=p?A.sn-p.sn:-1,y=this.part?A.part-this.part.index:-1,x=b===0&&A.id>1&&A.id===(p==null?void 0:p.stats.chunkCount),R=!T&&(b===1||b===0&&(y===1||x&&y<=0)),k=self.performance.now();(T||b||s.stats.parsing.start===0)&&(s.stats.parsing.start=k),o&&(y||!R)&&(o.stats.parsing.start=k);const $=!(p&&((u=s.initSegment)==null?void 0:u.url)===((h=p.initSegment)==null?void 0:h.url)),V=new aI(C,R,l,T,f,$);if(!R||C||$){U.log(`[transmuxer-interface, ${s.type}]: Starting new transmux session for sn: ${A.sn} p: ${A.part} level: ${A.level} id: ${A.id}
|
2471
|
+
discontinuity: ${C}
|
2472
2472
|
trackSwitch: ${T}
|
2473
2473
|
contiguous: ${R}
|
2474
|
-
accurateTimeOffset: ${
|
2474
|
+
accurateTimeOffset: ${l}
|
2475
2475
|
timeOffset: ${f}
|
2476
|
-
initSegmentChange: ${$}`);const O=new oI(n,i,t,a,c);this.configureTransmuxer(O)}if(this.frag=s,this.part=o,this.workerContext)this.workerContext.worker.postMessage({cmd:"demux",data:e,decryptdata:g,chunkMeta:l,state:W},e instanceof ArrayBuffer?[e]:[]);else if(d){const O=d.push(e,g,l,W);xs(O)?(d.async=!0,O.then(K=>{this.handleTransmuxComplete(K)}).catch(K=>{this.transmuxerError(K,l,"transmuxer-interface push error")})):(d.async=!1,this.handleTransmuxComplete(O))}}flush(e){e.transmuxing.start=self.performance.now();const{transmuxer:t}=this;if(this.workerContext)this.workerContext.worker.postMessage({cmd:"flush",chunkMeta:e});else if(t){let n=t.flush(e);xs(n)||t.async?(xs(n)||(n=Promise.resolve(n)),n.then(s=>{this.handleFlushResult(s,e)}).catch(s=>{this.transmuxerError(s,e,"transmuxer-interface flush error")})):this.handleFlushResult(n,e)}}transmuxerError(e,t,n){this.hls&&(this.error=e,this.hls.trigger(I.ERROR,{type:ye.MEDIA_ERROR,details:V.FRAG_PARSING_ERROR,chunkMeta:t,frag:this.frag||void 0,fatal:!1,error:e,err:e,reason:n}))}handleFlushResult(e,t){e.forEach(n=>{this.handleTransmuxComplete(n)}),this.onFlush(t)}onWorkerMessage(e){const t=e.data;if(!(t!=null&&t.event)){U.warn(`worker message received with no ${t?"event name":"data"}`);return}const n=this.hls;if(this.hls)switch(t.event){case"init":{var i;const s=(i=this.workerContext)==null?void 0:i.objectURL;s&&self.URL.revokeObjectURL(s);break}case"transmuxComplete":{this.handleTransmuxComplete(t.data);break}case"flush":{this.onFlush(t.data);break}case"workerLog":U[t.data.logType]&&U[t.data.logType](t.data.message);break;default:{t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,n.trigger(t.event,t.data);break}}}configureTransmuxer(e){const{transmuxer:t}=this;this.workerContext?this.workerContext.worker.postMessage({cmd:"configure",config:e}):t&&t.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}function Uu(r,e){if(r.length!==e.length)return!1;for(let t=0;t<r.length;t++)if(!Tn(r[t].attrs,e[t].attrs))return!1;return!0}function Tn(r,e,t){const n=r["STABLE-RENDITION-ID"];return n&&!t?n===e["STABLE-RENDITION-ID"]:!(t||["LANGUAGE","NAME","CHARACTERISTICS","AUTOSELECT","DEFAULT","FORCED","ASSOC-LANGUAGE"]).some(i=>r[i]!==e[i])}function ba(r,e){return e.label.toLowerCase()===r.name.toLowerCase()&&(!e.language||e.language.toLowerCase()===(r.lang||"").toLowerCase())}const Gu=100;class lI extends pa{constructor(e,t,n){super(e,t,n,"[audio-stream-controller]",Ee.AUDIO),this.videoBuffer=null,this.videoTrackCC=-1,this.waitingVideoCC=-1,this.bufferedTrack=null,this.switchingTrack=null,this.trackId=-1,this.waitingData=null,this.mainDetails=null,this.flushing=!1,this.bufferFlushed=!1,this.cachedTrackLoadedData=null,this._registerListeners()}onHandlerDestroying(){this._unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=null,this.bufferedTrack=null,this.switchingTrack=null}_registerListeners(){const{hls:e}=this;e.on(I.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(I.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(I.MANIFEST_LOADING,this.onManifestLoading,this),e.on(I.LEVEL_LOADED,this.onLevelLoaded,this),e.on(I.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(I.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(I.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(I.ERROR,this.onError,this),e.on(I.BUFFER_RESET,this.onBufferReset,this),e.on(I.BUFFER_CREATED,this.onBufferCreated,this),e.on(I.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(I.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(I.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(I.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(I.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(I.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(I.MANIFEST_LOADING,this.onManifestLoading,this),e.off(I.LEVEL_LOADED,this.onLevelLoaded,this),e.off(I.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(I.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(I.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(I.ERROR,this.onError,this),e.off(I.BUFFER_RESET,this.onBufferReset,this),e.off(I.BUFFER_CREATED,this.onBufferCreated,this),e.off(I.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(I.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(I.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(I.FRAG_BUFFERED,this.onFragBuffered,this)}onInitPtsFound(e,{frag:t,id:n,initPTS:i,timescale:s}){if(n==="main"){const o=t.cc;this.initPTS[t.cc]={baseTime:i,timescale:s},this.log(`InitPTS for cc: ${o} found from main: ${i}`),this.videoTrackCC=o,this.state===te.WAITING_INIT_PTS&&this.tick()}}startLoad(e){if(!this.levels){this.startPosition=e,this.state=te.STOPPED;return}const t=this.lastCurrentTime;this.stopLoad(),this.setInterval(Gu),t>0&&e===-1?(this.log(`Override startPosition with lastCurrentTime @${t.toFixed(3)}`),e=t,this.state=te.IDLE):(this.loadedmetadata=!1,this.state=te.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}doTick(){switch(this.state){case te.IDLE:this.doTickIdle();break;case te.WAITING_TRACK:{var e;const{levels:n,trackId:i}=this,s=n==null||(e=n[i])==null?void 0:e.details;if(s){if(this.waitForCdnTuneIn(s))break;this.state=te.WAITING_INIT_PTS}break}case te.FRAG_LOADING_WAITING_RETRY:{var t;const n=performance.now(),i=this.retryDate;if(!i||n>=i||(t=this.media)!=null&&t.seeking){const{levels:s,trackId:o}=this;this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded((s==null?void 0:s[o])||null),this.state=te.IDLE}break}case te.WAITING_INIT_PTS:{const n=this.waitingData;if(n){const{frag:i,part:s,cache:o,complete:a}=n;if(this.initPTS[i.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=te.FRAG_LOADING;const A=o.flush(),l={frag:i,part:s,payload:A,networkDetails:null};this._handleFragmentLoadProgress(l),a&&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 A=this.getLoadPosition(),l=Ve.bufferInfo(this.mediaBuffer,A,this.config.maxBufferHole);ha(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=te.IDLE}}this.onTickEnd()}clearWaitingFragment(){const e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=te.IDLE)}resetLoadingState(){this.clearWaitingFragment(),super.resetLoadingState()}onTickEnd(){const{media:e}=this;e!=null&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){const{hls:e,levels:t,media:n,trackId:i}=this,s=e.config;if(!n&&(this.startFragRequested||!s.startFragPrefetch)||!(t!=null&&t[i]))return;const o=t[i],a=o.details;if(!a||a.live&&this.levelLastLoaded!==o||this.waitForCdnTuneIn(a)){this.state=te.WAITING_TRACK;return}const A=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&A&&(this.bufferFlushed=!1,this.afterBufferFlushed(A,He.AUDIO,Ee.AUDIO));const l=this.getFwdBufferInfo(A,Ee.AUDIO);if(l===null)return;const{bufferedTrack:c,switchingTrack:u}=this;if(!u&&this._streamEnded(l,a)){e.trigger(I.BUFFER_EOS,{type:"audio"}),this.state=te.ENDED;return}const h=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,Ee.MAIN),d=l.len,f=this.getMaxBufferLength(h==null?void 0:h.len),g=a.fragments,p=g[0].start;let v=this.flushing?this.getLoadPosition():l.end;if(u&&n){const w=this.getLoadPosition();c&&!Tn(u.attrs,c.attrs)&&(v=w),a.PTSKnown&&w<p&&(l.end>p||l.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),n.currentTime=p+.05)}if(d>=f&&!u&&v<g[g.length-1].start)return;let T=this.getNextFragment(v,a),b=!1;if(T&&this.isLoopLoading(T,v)&&(b=!!T.gap,T=this.getNextFragmentLoopLoading(T,a,l,Ee.MAIN,f)),!T){this.bufferFlushed=!0;return}const y=h&&T.start>h.end+a.targetduration;if(y||!(h!=null&&h.len)&&l.len){const w=this.getAppendedFrag(T.start,Ee.MAIN);if(w===null||(b||(b=!!w.gap||!!y&&h.len===0),y&&!b||b&&l.nextStart&&l.nextStart<w.end))return}this.loadFragment(T,o,v)}getMaxBufferLength(e){const t=super.getMaxBufferLength();return e?Math.min(Math.max(t,e),this.config.maxMaxBufferLength):t}onMediaDetaching(){this.videoBuffer=null,this.bufferFlushed=this.flushing=!1,super.onMediaDetaching()}onAudioTracksUpdated(e,{audioTracks:t}){this.resetTransmuxer(),this.levels=t.map(n=>new En(n))}onAudioTrackSwitching(e,t){const n=!!t.url;this.trackId=t.id;const{fragCurrent:i}=this;i&&(i.abortRequests(),this.removeUnbufferedFrags(i.start)),this.resetLoadingState(),n?this.setInterval(Gu):this.resetTransmuxer(),n?(this.switchingTrack=t,this.state=te.IDLE,this.flushAudioIfNeeded(t)):(this.switchingTrack=null,this.bufferedTrack=t,this.state=te.STOPPED),this.tick()}onManifestLoading(){this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=this.flushing=!1,this.levels=this.mainDetails=this.waitingData=this.bufferedTrack=this.cachedTrackLoadedData=this.switchingTrack=null,this.startFragRequested=!1,this.trackId=this.videoTrackCC=this.waitingVideoCC=-1}onLevelLoaded(e,t){this.mainDetails=t.details,this.cachedTrackLoadedData!==null&&(this.hls.trigger(I.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData),this.cachedTrackLoadedData=null)}onAudioTrackLoaded(e,t){var n;if(this.mainDetails==null){this.cachedTrackLoadedData=t;return}const{levels:i}=this,{details:s,id:o}=t;if(!i){this.warn(`Audio tracks were reset while loading level ${o}`);return}this.log(`Audio track ${o} loaded [${s.startSN},${s.endSN}]${s.lastPartSn?`[part-${s.lastPartSn}-${s.lastPartIndex}]`:""},duration:${s.totalduration}`);const a=i[o];let A=0;if(s.live||(n=a.details)!=null&&n.live){this.checkLiveUpdate(s);const c=this.mainDetails;if(s.deltaUpdateFailed||!c)return;if(!a.details&&s.hasProgramDateTime&&c.hasProgramDateTime)vs(s,c),A=s.fragments[0].start;else{var l;A=this.alignPlaylists(s,a.details,(l=this.levelLastLoaded)==null?void 0:l.details)}}a.details=s,this.levelLastLoaded=a,!this.startFragRequested&&(this.mainDetails||!s.live)&&this.setStartPosition(this.mainDetails||s,A),this.state===te.WAITING_TRACK&&!this.waitForCdnTuneIn(s)&&(this.state=te.IDLE),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:n,part:i,payload:s}=e,{config:o,trackId:a,levels:A}=this;if(!A){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=A[a];if(!l){this.warn("Audio track is undefined on fragment load progress");return}const c=l.details;if(!c){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(n.start);return}const u=o.defaultAudioCodec||l.audioCodec||"mp4a.40.2";let h=this.transmuxer;h||(h=this.transmuxer=new Ou(this.hls,Ee.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const d=this.initPTS[n.cc],f=(t=n.initSegment)==null?void 0:t.data;if(d!==void 0){const p=i?i.index:-1,v=p!==-1,T=new fa(n.level,n.sn,n.stats.chunkCount,s.byteLength,p,v);h.push(s,f,u,"",n,i,c.totalduration,!1,T,d)}else{this.log(`Unknown video PTS for cc ${n.cc}, waiting for video PTS before demuxing audio frag ${n.sn} of [${c.startSN} ,${c.endSN}],track ${a}`);const{cache:g}=this.waitingData=this.waitingData||{frag:n,part:i,cache:new mu,complete:!1};g.push(new Uint8Array(s)),this.waitingVideoCC=this.videoTrackCC,this.state=te.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,t){const n=t.tracks.audio;n&&(this.mediaBuffer=n.buffer||null),t.tracks.video&&(this.videoBuffer=t.tracks.video.buffer||null)}onFragBuffered(e,t){const{frag:n,part:i}=t;if(n.type!==Ee.AUDIO){if(!this.loadedmetadata&&n.type===Ee.MAIN){const s=this.videoBuffer||this.media;s&&Ve.getBuffered(s).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(I.AUDIO_TRACK_SWITCHED,ut({},s)))}this.fragBufferedComplete(n,i)}onError(e,t){var n;if(t.fatal){this.state=te.ERROR;return}switch(t.details){case V.FRAG_GAP:case V.FRAG_PARSING_ERROR:case V.FRAG_DECRYPT_ERROR:case V.FRAG_LOAD_ERROR:case V.FRAG_LOAD_TIMEOUT:case V.KEY_LOAD_ERROR:case V.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(Ee.AUDIO,t);break;case V.AUDIO_TRACK_LOAD_ERROR:case V.AUDIO_TRACK_LOAD_TIMEOUT:case V.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===te.WAITING_TRACK&&((n=t.context)==null?void 0:n.type)===Oe.AUDIO_TRACK&&(this.state=te.IDLE);break;case V.BUFFER_APPEND_ERROR:case V.BUFFER_FULL_ERROR:if(!t.parent||t.parent!=="audio")return;if(t.details===V.BUFFER_APPEND_ERROR){this.resetLoadingState();return}this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case V.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onBufferFlushing(e,{type:t}){t!==He.VIDEO&&(this.flushing=!0)}onBufferFlushed(e,{type:t}){if(t!==He.VIDEO){this.flushing=!1,this.bufferFlushed=!0,this.state===te.ENDED&&(this.state=te.IDLE);const n=this.mediaBuffer||this.media;n&&(this.afterBufferFlushed(n,t,Ee.AUDIO),this.tick())}}_handleTransmuxComplete(e){var t;const n="audio",{hls:i}=this,{remuxResult:s,chunkMeta:o}=e,a=this.getCurrentContext(o);if(!a){this.resetWhenMissingContext(o);return}const{frag:A,part:l,level:c}=a,{details:u}=c,{audio:h,text:d,id3:f,initSegment:g}=s;if(this.fragContextChanged(A)||!u){this.fragmentTracker.removeFragment(A);return}if(this.state=te.PARSING,this.switchingTrack&&h&&this.completeAudioSwitch(this.switchingTrack),g!=null&&g.tracks){const p=A.initSegment||A;this._bufferInitSegment(c,g.tracks,p,o),i.trigger(I.FRAG_PARSING_INIT_SEGMENT,{frag:p,id:n,tracks:g.tracks})}if(h){const{startPTS:p,endPTS:v,startDTS:T,endDTS:b}=h;l&&(l.elementaryStreams[He.AUDIO]={startPTS:p,endPTS:v,startDTS:T,endDTS:b}),A.setElementaryStreamInfo(He.AUDIO,p,v,T,b),this.bufferFragmentData(h,A,l,o)}if(f!=null&&(t=f.samples)!=null&&t.length){const p=st({id:n,frag:A,details:u},f);i.trigger(I.FRAG_PARSING_METADATA,p)}if(d){const p=st({id:n,frag:A,details:u},d);i.trigger(I.FRAG_PARSING_USERDATA,p)}}_bufferInitSegment(e,t,n,i){if(this.state!==te.PARSING)return;t.video&&delete t.video;const s=t.audio;if(!s)return;s.id="audio";const o=e.audioCodec;this.log(`Init audio buffer, container:${s.container}, codecs[level/parsed]=[${o}/${s.codec}]`),o&&o.split(",").length===1&&(s.levelCodec=o),this.hls.trigger(I.BUFFER_CODECS,t);const a=s.initSegment;if(a!=null&&a.byteLength){const A={type:"audio",frag:n,part:null,chunkMeta:i,parent:n.type,data:a};this.hls.trigger(I.BUFFER_APPENDING,A)}this.tickImmediate()}loadFragment(e,t,n){const i=this.fragmentTracker.getState(e);if(this.fragCurrent=e,this.switchingTrack||i===ht.NOT_LOADED||i===ht.PARTIAL){var s;if(e.sn==="initSegment")this._loadInitSegment(e,t);else if((s=t.details)!=null&&s.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=te.WAITING_INIT_PTS;const o=this.mainDetails;o&&o.fragments[0].start!==t.details.fragments[0].start&&vs(t.details,o)}else this.startFragRequested=!0,super.loadFragment(e,t,n)}else this.clearTrackerIfNeeded(e)}flushAudioIfNeeded(e){const{media:t,bufferedTrack:n}=this,i=n==null?void 0:n.attrs,s=e.attrs;t&&i&&(i.CHANNELS!==s.CHANNELS||n.name!==e.name||n.lang!==e.lang)&&(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"),this.bufferedTrack=null)}completeAudioSwitch(e){const{hls:t}=this;this.flushAudioIfNeeded(e),this.bufferedTrack=e,this.switchingTrack=null,t.trigger(I.AUDIO_TRACK_SWITCHED,ut({},e))}}class cI extends da{constructor(e){super(e,"[audio-track-controller]"),this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:e}=this;e.on(I.MANIFEST_LOADING,this.onManifestLoading,this),e.on(I.MANIFEST_PARSED,this.onManifestParsed,this),e.on(I.LEVEL_LOADING,this.onLevelLoading,this),e.on(I.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(I.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(I.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(I.MANIFEST_LOADING,this.onManifestLoading,this),e.off(I.MANIFEST_PARSED,this.onManifestParsed,this),e.off(I.LEVEL_LOADING,this.onLevelLoading,this),e.off(I.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(I.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(I.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.tracksInGroup=[],this.groupIds=null,this.currentTrack=null,this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.audioTracks||[]}onAudioTrackLoaded(e,t){const{id:n,groupId:i,details:s}=t,o=this.tracksInGroup[n];if(!o||o.groupId!==i){this.warn(`Audio track with id:${n} and group:${i} not found in active group ${o==null?void 0:o.groupId}`);return}const a=o.details;o.details=t.details,this.log(`Audio track ${n} "${o.name}" lang:${o.lang} group:${i} loaded [${s.startSN}-${s.endSN}]`),n===this.trackId&&this.playlistLoaded(n,t,a)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const n=t.audioGroups||null,i=this.groupIds;let s=this.currentTrack;if(!n||(i==null?void 0:i.length)!==(n==null?void 0:n.length)||n!=null&&n.some(a=>(i==null?void 0:i.indexOf(a))===-1)){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const a=this.tracks.filter(h=>!n||n.indexOf(h.groupId)!==-1);if(a.length)this.selectDefaultTrack&&!a.some(h=>h.default)&&(this.selectDefaultTrack=!1),a.forEach((h,d)=>{h.id=d});else if(!s&&!this.tracksInGroup.length)return;this.tracksInGroup=a;const A=this.hls.config.audioPreference;if(!s&&A){const h=sr(A,a,vn);if(h>-1)s=a[h];else{const d=sr(A,this.tracks);s=this.tracks[d]}}let l=this.findTrackId(s);l===-1&&s&&(l=this.findTrackId(null));const c={audioTracks:a};this.log(`Updating audio tracks, ${a.length} track(s) found in group(s): ${n==null?void 0:n.join(",")}`),this.hls.trigger(I.AUDIO_TRACKS_UPDATED,c);const u=this.trackId;if(l!==-1&&u===-1)this.setAudioTrack(l);else if(a.length&&u===-1){var o;const h=new Error(`No audio track selected for current audio group-ID(s): ${(o=this.groupIds)==null?void 0:o.join(",")} track count: ${a.length}`);this.warn(h.message),this.hls.trigger(I.ERROR,{type:ye.MEDIA_ERROR,details:V.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:h})}}else this.shouldReloadPlaylist(s)&&this.setAudioTrack(this.trackId)}onError(e,t){t.fatal||!t.context||t.context.type===Oe.AUDIO_TRACK&&t.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(t.context.groupId)!==-1)&&(this.requestScheduled=-1,this.checkRetry(t))}get allAudioTracks(){return this.tracks}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}setAudioOption(e){const t=this.hls;if(t.config.audioPreference=e,e){const n=this.allAudioTracks;if(this.selectDefaultTrack=!1,n.length){const i=this.currentTrack;if(i&&Cn(e,i,vn))return i;const s=sr(e,this.tracksInGroup,vn);if(s>-1){const o=this.tracksInGroup[s];return this.setAudioTrack(s),o}else if(i){let o=t.loadLevel;o===-1&&(o=t.firstAutoLevel);const a=cE(e,t.levels,n,o,vn);if(a===-1)return null;t.nextLoadLevel=a}if(e.channels||e.audioCodec){const o=sr(e,n);if(o>-1)return n[o]}}}return null}setAudioTrack(e){const t=this.tracksInGroup;if(e<0||e>=t.length){this.warn(`Invalid audio track id: ${e}`);return}this.clearTimer(),this.selectDefaultTrack=!1;const n=this.currentTrack,i=t[e],s=i.details&&!i.details.live;if(e===this.trackId&&i===n&&s||(this.log(`Switching to audio-track ${e} "${i.name}" lang:${i.lang} group:${i.groupId} channels:${i.channels}`),this.trackId=e,this.currentTrack=i,this.hls.trigger(I.AUDIO_TRACK_SWITCHING,ut({},i)),s))return;const o=this.switchParams(i.url,n==null?void 0:n.details,i.details);this.loadPlaylist(o)}findTrackId(e){const t=this.tracksInGroup;for(let n=0;n<t.length;n++){const i=t[n];if(!(this.selectDefaultTrack&&!i.default)&&(!e||Cn(e,i,vn)))return n}if(e){const{name:n,lang:i,assocLang:s,characteristics:o,audioCodec:a,channels:A}=e;for(let l=0;l<t.length;l++){const c=t[l];if(Cn({name:n,lang:i,assocLang:s,characteristics:o,audioCodec:a,channels:A},c,vn))return l}for(let l=0;l<t.length;l++){const c=t[l];if(Tn(e.attrs,c.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return l}for(let l=0;l<t.length;l++){const c=t[l];if(Tn(e.attrs,c.attrs,["LANGUAGE"]))return l}}return-1}loadPlaylist(e){const t=this.currentTrack;if(this.shouldLoadPlaylist(t)&&t){super.loadPlaylist();const n=t.id,i=t.groupId;let s=t.url;if(e)try{s=e.addDirectives(s)}catch(o){this.warn(`Could not construct new URL with HLS Delivery Directives: ${o}`)}this.log(`loading audio-track playlist ${n} "${t.name}" lang:${t.lang} group:${i}`),this.clearTimer(),this.hls.trigger(I.AUDIO_TRACK_LOADING,{url:s,id:n,groupId:i,deliveryDirectives:e||null})}}}const Hu=500;class uI extends pa{constructor(e,t,n){super(e,t,n,"[subtitle-stream-controller]",Ee.SUBTITLE),this.currentTrackId=-1,this.tracksBuffered=[],this.mainDetails=null,this._registerListeners()}onHandlerDestroying(){this._unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=null}_registerListeners(){const{hls:e}=this;e.on(I.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(I.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(I.MANIFEST_LOADING,this.onManifestLoading,this),e.on(I.LEVEL_LOADED,this.onLevelLoaded,this),e.on(I.ERROR,this.onError,this),e.on(I.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(I.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(I.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(I.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(I.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(I.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(I.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(I.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(I.MANIFEST_LOADING,this.onManifestLoading,this),e.off(I.LEVEL_LOADED,this.onLevelLoaded,this),e.off(I.ERROR,this.onError,this),e.off(I.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(I.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(I.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(I.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(I.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(I.FRAG_BUFFERED,this.onFragBuffered,this)}startLoad(e){this.stopLoad(),this.state=te.IDLE,this.setInterval(Hu),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}onManifestLoading(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()}onMediaDetaching(){this.tracksBuffered=[],super.onMediaDetaching()}onLevelLoaded(e,t){this.mainDetails=t.details}onSubtitleFragProcessed(e,t){const{frag:n,success:i}=t;if(this.fragPrevious=n,this.state=te.IDLE,!i)return;const s=this.tracksBuffered[this.currentTrackId];if(!s)return;let o;const a=n.start;for(let l=0;l<s.length;l++)if(a>=s[l].start&&a<=s[l].end){o=s[l];break}const A=n.start+n.duration;o?o.end=A:(o={start:a,end:A},s.push(o)),this.fragmentTracker.fragBuffered(n),this.fragBufferedComplete(n,null)}onBufferFlushing(e,t){const{startOffset:n,endOffset:i}=t;if(n===0&&i!==Number.POSITIVE_INFINITY){const s=i-1;if(s<=0)return;t.endOffsetSubtitles=Math.max(0,s),this.tracksBuffered.forEach(o=>{for(let a=0;a<o.length;){if(o[a].end<=s){o.shift();continue}else if(o[a].start<s)o[a].start=s;else break;a++}}),this.fragmentTracker.removeFragmentsInRange(n,s,Ee.SUBTITLE)}}onFragBuffered(e,t){if(!this.loadedmetadata&&t.frag.type===Ee.MAIN){var n;(n=this.media)!=null&&n.buffered.length&&(this.loadedmetadata=!0)}}onError(e,t){const n=t.frag;(n==null?void 0:n.type)===Ee.SUBTITLE&&(t.details===V.FRAG_GAP&&this.fragmentTracker.fragBuffered(n,!0),this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==te.STOPPED&&(this.state=te.IDLE))}onSubtitleTracksUpdated(e,{subtitleTracks:t}){if(this.levels&&Uu(this.levels,t)){this.levels=t.map(n=>new En(n));return}this.tracksBuffered=[],this.levels=t.map(n=>{const i=new En(n);return this.tracksBuffered[i.id]=[],i}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,Ee.SUBTITLE),this.fragPrevious=null,this.mediaBuffer=null}onSubtitleTrackSwitch(e,t){var n;if(this.currentTrackId=t.id,!((n=this.levels)!=null&&n.length)||this.currentTrackId===-1){this.clearInterval();return}const i=this.levels[this.currentTrackId];i!=null&&i.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,i&&this.setInterval(Hu)}onSubtitleTrackLoaded(e,t){var n;const{currentTrackId:i,levels:s}=this,{details:o,id:a}=t;if(!s){this.warn(`Subtitle tracks were reset while loading level ${a}`);return}const A=s[a];if(a>=s.length||!A)return;this.log(`Subtitle track ${a} loaded [${o.startSN},${o.endSN}]${o.lastPartSn?`[part-${o.lastPartSn}-${o.lastPartIndex}]`:""},duration:${o.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let l=0;if(o.live||(n=A.details)!=null&&n.live){const u=this.mainDetails;if(o.deltaUpdateFailed||!u)return;const h=u.fragments[0];if(!A.details)o.hasProgramDateTime&&u.hasProgramDateTime?(vs(o,u),l=o.fragments[0].start):h&&(l=h.start,ca(o,l));else{var c;l=this.alignPlaylists(o,A.details,(c=this.levelLastLoaded)==null?void 0:c.details),l===0&&h&&(l=h.start,ca(o,l))}}A.details=o,this.levelLastLoaded=A,a===i&&(!this.startFragRequested&&(this.mainDetails||!o.live)&&this.setStartPosition(this.mainDetails||o,l),this.tick(),o.live&&!this.fragCurrent&&this.media&&this.state===te.IDLE&&(ms(null,o.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),A.details=void 0)))}_handleFragmentLoadComplete(e){const{frag:t,payload:n}=e,i=t.decryptdata,s=this.hls;if(!this.fragContextChanged(t)&&n&&n.byteLength>0&&i!=null&&i.key&&i.iv&&i.method==="AES-128"){const o=performance.now();this.decrypter.decrypt(new Uint8Array(n),i.key.buffer,i.iv.buffer).catch(a=>{throw s.trigger(I.ERROR,{type:ye.MEDIA_ERROR,details:V.FRAG_DECRYPT_ERROR,fatal:!1,error:a,reason:a.message,frag:t}),a}).then(a=>{const A=performance.now();s.trigger(I.FRAG_DECRYPTED,{frag:t,payload:a,stats:{tstart:o,tdecrypt:A}})}).catch(a=>{this.warn(`${a.name}: ${a.message}`),this.state=te.IDLE})}}doTick(){if(!this.media){this.state=te.IDLE;return}if(this.state===te.IDLE){const{currentTrackId:e,levels:t}=this,n=t==null?void 0:t[e];if(!n||!t.length||!n.details)return;const{config:i}=this,s=this.getLoadPosition(),o=Ve.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],s,i.maxBufferHole),{end:a,len:A}=o,l=this.getFwdBufferInfo(this.media,Ee.MAIN),c=n.details,u=this.getMaxBufferLength(l==null?void 0:l.len)+c.levelTargetDuration;if(A>u)return;const h=c.fragments,d=h.length,f=c.edge;let g=null;const p=this.fragPrevious;if(a<f){const v=i.maxFragLookUpTolerance,T=a>f-v?0:v;g=ms(p,h,Math.max(h[0].start,a),T),!g&&p&&p.start<h[0].start&&(g=h[0])}else g=h[d-1];if(!g)return;if(g=this.mapToInitFragWhenRequired(g),g.sn!=="initSegment"){const v=g.sn-c.startSN,T=h[v-1];T&&T.cc===g.cc&&this.fragmentTracker.getState(T)===ht.NOT_LOADED&&(g=T)}this.fragmentTracker.getState(g)===ht.NOT_LOADED&&this.loadFragment(g,n,a)}}getMaxBufferLength(e){const t=super.getMaxBufferLength();return e?Math.max(t,e):t}loadFragment(e,t,n){this.fragCurrent=e,e.sn==="initSegment"?this._loadInitSegment(e,t):(this.startFragRequested=!0,super.loadFragment(e,t,n))}get mediaBufferTimeRanges(){return new hI(this.tracksBuffered[this.currentTrackId]||[])}}class hI{constructor(e){this.buffered=void 0;const t=(n,i,s)=>{if(i=i>>>0,i>s-1)throw new DOMException(`Failed to execute '${n}' on 'TimeRanges': The index provided (${i}) is greater than the maximum bound (${s})`);return e[i][n]};this.buffered={get length(){return e.length},end(n){return t("end",n,e.length)},start(n){return t("start",n,e.length)}}}}class dI extends da{constructor(e){super(e,"[subtitle-track-controller]"),this.media=null,this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.queuedDefaultTrack=-1,this.asyncPollTrackChange=()=>this.pollTrackChange(0),this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.onTextTracksChanged=()=>{if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let t=null;const n=us(this.media.textTracks);for(let s=0;s<n.length;s++)if(n[s].mode==="hidden")t=n[s];else if(n[s].mode==="showing"){t=n[s];break}const i=this.findTrackForTextTrack(t);this.subtitleTrack!==i&&this.setSubtitleTrack(i)},this.registerListeners()}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,this.onTextTracksChanged=this.asyncPollTrackChange=null,super.destroy()}get subtitleDisplay(){return this._subtitleDisplay}set subtitleDisplay(e){this._subtitleDisplay=e,this.trackId>-1&&this.toggleTrackModes()}registerListeners(){const{hls:e}=this;e.on(I.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(I.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(I.MANIFEST_LOADING,this.onManifestLoading,this),e.on(I.MANIFEST_PARSED,this.onManifestParsed,this),e.on(I.LEVEL_LOADING,this.onLevelLoading,this),e.on(I.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(I.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(I.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(I.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(I.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(I.MANIFEST_LOADING,this.onManifestLoading,this),e.off(I.MANIFEST_PARSED,this.onManifestParsed,this),e.off(I.LEVEL_LOADING,this.onLevelLoading,this),e.off(I.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(I.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(I.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.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.onTextTracksChanged,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),us(this.media.textTracks).forEach(t=>{mn(t)}),this.subtitleTrack=-1,this.media=null}onManifestLoading(){this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.subtitleTracks}onSubtitleTrackLoaded(e,t){const{id:n,groupId:i,details:s}=t,o=this.tracksInGroup[n];if(!o||o.groupId!==i){this.warn(`Subtitle track with id:${n} and group:${i} not found in active group ${o==null?void 0:o.groupId}`);return}const a=o.details;o.details=t.details,this.log(`Subtitle track ${n} "${o.name}" lang:${o.lang} group:${i} loaded [${s.startSN}-${s.endSN}]`),n===this.trackId&&this.playlistLoaded(n,t,a)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const n=t.subtitleGroups||null,i=this.groupIds;let s=this.currentTrack;if(!n||(i==null?void 0:i.length)!==(n==null?void 0:n.length)||n!=null&&n.some(o=>(i==null?void 0:i.indexOf(o))===-1)){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const o=this.tracks.filter(c=>!n||n.indexOf(c.groupId)!==-1);if(o.length)this.selectDefaultTrack&&!o.some(c=>c.default)&&(this.selectDefaultTrack=!1),o.forEach((c,u)=>{c.id=u});else if(!s&&!this.tracksInGroup.length)return;this.tracksInGroup=o;const a=this.hls.config.subtitlePreference;if(!s&&a){this.selectDefaultTrack=!1;const c=sr(a,o);if(c>-1)s=o[c];else{const u=sr(a,this.tracks);s=this.tracks[u]}}let A=this.findTrackId(s);A===-1&&s&&(A=this.findTrackId(null));const l={subtitleTracks:o};this.log(`Updating subtitle tracks, ${o.length} track(s) found in "${n==null?void 0:n.join(",")}" group-id`),this.hls.trigger(I.SUBTITLE_TRACKS_UPDATED,l),A!==-1&&this.trackId===-1&&this.setSubtitleTrack(A)}else this.shouldReloadPlaylist(s)&&this.setSubtitleTrack(this.trackId)}findTrackId(e){const t=this.tracksInGroup,n=this.selectDefaultTrack;for(let i=0;i<t.length;i++){const s=t[i];if(!(n&&!s.default||!n&&!e)&&(!e||Cn(s,e)))return i}if(e){for(let i=0;i<t.length;i++){const s=t[i];if(Tn(e.attrs,s.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return i}for(let i=0;i<t.length;i++){const s=t[i];if(Tn(e.attrs,s.attrs,["LANGUAGE"]))return i}}return-1}findTrackForTextTrack(e){if(e){const t=this.tracksInGroup;for(let n=0;n<t.length;n++){const i=t[n];if(ba(i,e))return n}}return-1}onError(e,t){t.fatal||!t.context||t.context.type===Oe.SUBTITLE_TRACK&&t.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(t.context.groupId)!==-1)&&this.checkRetry(t)}get allSubtitleTracks(){return this.tracks}get subtitleTracks(){return this.tracksInGroup}get subtitleTrack(){return this.trackId}set subtitleTrack(e){this.selectDefaultTrack=!1,this.setSubtitleTrack(e)}setSubtitleOption(e){if(this.hls.config.subtitlePreference=e,e){const t=this.allSubtitleTracks;if(this.selectDefaultTrack=!1,t.length){const n=this.currentTrack;if(n&&Cn(e,n))return n;const i=sr(e,this.tracksInGroup);if(i>-1){const s=this.tracksInGroup[i];return this.setSubtitleTrack(i),s}else{if(n)return null;{const s=sr(e,t);if(s>-1)return t[s]}}}}return null}loadPlaylist(e){super.loadPlaylist();const t=this.currentTrack;if(this.shouldLoadPlaylist(t)&&t){const n=t.id,i=t.groupId;let s=t.url;if(e)try{s=e.addDirectives(s)}catch(o){this.warn(`Could not construct new URL with HLS Delivery Directives: ${o}`)}this.log(`Loading subtitle playlist for id ${n}`),this.hls.trigger(I.SUBTITLE_TRACK_LOADING,{url:s,id:n,groupId:i,deliveryDirectives:e||null})}}toggleTrackModes(){const{media:e}=this;if(!e)return;const t=us(e.textTracks),n=this.currentTrack;let i;if(n&&(i=t.filter(s=>ba(n,s))[0],i||this.warn(`Unable to find subtitle TextTrack with name "${n.name}" and language "${n.lang}"`)),[].slice.call(t).forEach(s=>{s.mode!=="disabled"&&s!==i&&(s.mode="disabled")}),i){const s=this.subtitleDisplay?"showing":"hidden";i.mode!==s&&(i.mode=s)}}setSubtitleTrack(e){const t=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=e;return}if(e<-1||e>=t.length||!he(e)){this.warn(`Invalid subtitle track id: ${e}`);return}this.clearTimer(),this.selectDefaultTrack=!1;const n=this.currentTrack,i=t[e]||null;if(this.trackId=e,this.currentTrack=i,this.toggleTrackModes(),!i){this.hls.trigger(I.SUBTITLE_TRACK_SWITCH,{id:e});return}const s=!!i.details&&!i.details.live;if(e===this.trackId&&i===n&&s)return;this.log(`Switching to subtitle-track ${e}`+(i?` "${i.name}" lang:${i.lang} group:${i.groupId}`:""));const{id:o,groupId:a="",name:A,type:l,url:c}=i;this.hls.trigger(I.SUBTITLE_TRACK_SWITCH,{id:o,groupId:a,name:A,type:l,url:c});const u=this.switchParams(i.url,n==null?void 0:n.details,i.details);this.loadPlaylist(u)}}class fI{constructor(e){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=e}append(e,t,n){const i=this.queues[t];i.push(e),i.length===1&&!n&&this.executeNext(t)}insertAbort(e,t){this.queues[t].unshift(e),this.executeNext(t)}appendBlocker(e){let t;const n=new Promise(s=>{t=s}),i={execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};return this.append(i,e),n}executeNext(e){const t=this.queues[e];if(t.length){const n=t[0];try{n.execute()}catch(i){U.warn(`[buffer-operation-queue]: Exception executing "${e}" SourceBuffer operation: ${i}`),n.onError(i);const s=this.buffers[e];s!=null&&s.updating||this.shiftAndExecuteNext(e)}}}shiftAndExecuteNext(e){this.queues[e].shift(),this.executeNext(e)}current(e){return this.queues[e][0]}}const $u=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/;class gI{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.appendSource=void 0,this.appendErrors={audio:0,video:0,audiovideo:0},this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this.log=void 0,this.warn=void 0,this.error=void 0,this._onEndStreaming=n=>{this.hls&&this.hls.pauseBuffering()},this._onStartStreaming=n=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=()=>{const{media:n,mediaSource:i}=this;this.log("Media source opened"),n&&(n.removeEventListener("emptied",this._onMediaEmptied),this.updateMediaElementDuration(),this.hls.trigger(I.MEDIA_ATTACHED,{media:n,mediaSource:i})),i&&i.removeEventListener("sourceopen",this._onMediaSourceOpen),this.checkPendingTracks()},this._onMediaSourceClose=()=>{this.log("Media source closed")},this._onMediaSourceEnded=()=>{this.log("Media source ended")},this._onMediaEmptied=()=>{const{mediaSrc:n,_objectUrl:i}=this;n!==i&&U.error(`Media element src was set while attaching MediaSource (${i} > ${n})`)},this.hls=e;const t="[buffer-controller]";this.appendSource=Qm(Wr(e.config.preferManagedMediaSource)),this.log=U.log.bind(U,t),this.warn=U.warn.bind(U,t),this.error=U.error.bind(U,t),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,this.hls=null}registerListeners(){const{hls:e}=this;e.on(I.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(I.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(I.MANIFEST_LOADING,this.onManifestLoading,this),e.on(I.MANIFEST_PARSED,this.onManifestParsed,this),e.on(I.BUFFER_RESET,this.onBufferReset,this),e.on(I.BUFFER_APPENDING,this.onBufferAppending,this),e.on(I.BUFFER_CODECS,this.onBufferCodecs,this),e.on(I.BUFFER_EOS,this.onBufferEos,this),e.on(I.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(I.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(I.FRAG_PARSED,this.onFragParsed,this),e.on(I.FRAG_CHANGED,this.onFragChanged,this)}unregisterListeners(){const{hls:e}=this;e.off(I.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(I.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(I.MANIFEST_LOADING,this.onManifestLoading,this),e.off(I.MANIFEST_PARSED,this.onManifestParsed,this),e.off(I.BUFFER_RESET,this.onBufferReset,this),e.off(I.BUFFER_APPENDING,this.onBufferAppending,this),e.off(I.BUFFER_CODECS,this.onBufferCodecs,this),e.off(I.BUFFER_EOS,this.onBufferEos,this),e.off(I.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(I.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(I.FRAG_PARSED,this.onFragParsed,this),e.off(I.FRAG_CHANGED,this.onFragChanged,this)}_initSourceBuffer(){this.sourceBuffer={},this.operationQueue=new fI(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]},this.appendErrors={audio:0,video:0,audiovideo:0},this.lastMpegAudioChunk=null}onManifestLoading(){this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=0,this.details=null}onManifestParsed(e,t){let n=2;(t.audio&&!t.video||!t.altAudio)&&(n=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=n,this.log(`${this.bufferCodecEventsExpected} bufferCodec event(s) expected`)}onMediaAttaching(e,t){const n=this.media=t.media,i=Wr(this.appendSource);if(n&&i){var s;const o=this.mediaSource=new i;this.log(`created media source: ${(s=o.constructor)==null?void 0:s.name}`),o.addEventListener("sourceopen",this._onMediaSourceOpen),o.addEventListener("sourceended",this._onMediaSourceEnded),o.addEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(o.addEventListener("startstreaming",this._onStartStreaming),o.addEventListener("endstreaming",this._onEndStreaming));const a=this._objectUrl=self.URL.createObjectURL(o);if(this.appendSource)try{n.removeAttribute("src");const A=self.ManagedMediaSource;n.disableRemotePlayback=n.disableRemotePlayback||A&&o instanceof A,Yu(n),pI(n,a),n.load()}catch{n.src=a}else n.src=a;n.addEventListener("emptied",this._onMediaEmptied)}}onMediaDetaching(){const{media:e,mediaSource:t,_objectUrl:n}=this;if(t){if(this.log("media source detaching"),t.readyState==="open")try{t.endOfStream()}catch(i){this.warn(`onMediaDetaching: ${i.message} while calling endOfStream`)}this.onBufferReset(),t.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("sourceended",this._onMediaSourceEnded),t.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(t.removeEventListener("startstreaming",this._onStartStreaming),t.removeEventListener("endstreaming",this._onEndStreaming)),e&&(e.removeEventListener("emptied",this._onMediaEmptied),n&&self.URL.revokeObjectURL(n),this.mediaSrc===n?(e.removeAttribute("src"),this.appendSource&&Yu(e),e.load()):this.warn("media|source.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(I.MEDIA_DETACHED,void 0)}onBufferReset(){this.getSourceBufferTypes().forEach(e=>{this.resetBuffer(e)}),this._initSourceBuffer()}resetBuffer(e){const t=this.sourceBuffer[e];try{if(t){var n;this.removeBufferListeners(e),this.sourceBuffer[e]=void 0,(n=this.mediaSource)!=null&&n.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(t)}}catch(i){this.warn(`onBufferReset ${e}`,i)}}onBufferCodecs(e,t){const n=this.getSourceBufferTypes().length,i=Object.keys(t);if(i.forEach(o=>{if(n){const A=this.tracks[o];if(A&&typeof A.buffer.changeType=="function"){var a;const{id:l,codec:c,levelCodec:u,container:h,metadata:d}=t[o],f=Pc(A.codec,A.levelCodec),g=f==null?void 0:f.replace($u,"$1");let p=Pc(c,u);const v=(a=p)==null?void 0:a.replace($u,"$1");if(p&&g!==v){o.slice(0,5)==="audio"&&(p=cs(p,this.appendSource));const T=`${h};codecs=${p}`;this.appendChangeType(o,T),this.log(`switching codec ${f} to ${p}`),this.tracks[o]={buffer:A.buffer,codec:c,container:h,levelCodec:u,metadata:d,id:l}}}}else this.pendingTracks[o]=t[o]}),n)return;const s=Math.max(this.bufferCodecEventsExpected-1,0);this.bufferCodecEventsExpected!==s&&(this.log(`${s} bufferCodec event(s) expected ${i.join(",")}`),this.bufferCodecEventsExpected=s),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()}appendChangeType(e,t){const{operationQueue:n}=this,i={execute:()=>{const s=this.sourceBuffer[e];s&&(this.log(`changing ${e} sourceBuffer type to ${t}`),s.changeType(t)),n.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:s=>{this.warn(`Failed to change ${e} SourceBuffer type`,s)}};n.append(i,e,!!this.pendingTracks[e])}onBufferAppending(e,t){const{hls:n,operationQueue:i,tracks:s}=this,{data:o,type:a,frag:A,part:l,chunkMeta:c}=t,u=c.buffering[a],h=self.performance.now();u.start=h;const d=A.stats.buffering,f=l?l.stats.buffering:null;d.start===0&&(d.start=h),f&&f.start===0&&(f.start=h);const g=s.audio;let p=!1;a==="audio"&&(g==null?void 0:g.container)==="audio/mpeg"&&(p=!this.lastMpegAudioChunk||c.id===1||this.lastMpegAudioChunk.sn!==c.sn,this.lastMpegAudioChunk=c);const v=A.start,T={execute:()=>{if(u.executeStart=self.performance.now(),p){const b=this.sourceBuffer[a];if(b){const y=v-b.timestampOffset;Math.abs(y)>=.1&&(this.log(`Updating audio SourceBuffer timestampOffset to ${v} (delta: ${y}) sn: ${A.sn})`),b.timestampOffset=v)}}this.appendExecutor(o,a)},onStart:()=>{},onComplete:()=>{const b=self.performance.now();u.executeEnd=u.end=b,d.first===0&&(d.first=b),f&&f.first===0&&(f.first=b);const{sourceBuffer:y}=this,w={};for(const R in y)w[R]=Ve.getBuffered(y[R]);this.appendErrors[a]=0,a==="audio"||a==="video"?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(I.BUFFER_APPENDED,{type:a,frag:A,part:l,chunkMeta:c,parent:A.type,timeRanges:w})},onError:b=>{const y={type:ye.MEDIA_ERROR,parent:A.type,details:V.BUFFER_APPEND_ERROR,sourceBufferName:a,frag:A,part:l,chunkMeta:c,error:b,err:b,fatal:!1};if(b.code===DOMException.QUOTA_EXCEEDED_ERR)y.details=V.BUFFER_FULL_ERROR;else{const w=++this.appendErrors[a];y.details=V.BUFFER_APPEND_ERROR,this.warn(`Failed ${w}/${n.config.appendErrorMaxRetry} times to append segment in "${a}" sourceBuffer`),w>=n.config.appendErrorMaxRetry&&(y.fatal=!0)}n.trigger(I.ERROR,y)}};i.append(T,a,!!this.pendingTracks[a])}onBufferFlushing(e,t){const{operationQueue:n}=this,i=s=>({execute:this.removeExecutor.bind(this,s,t.startOffset,t.endOffset),onStart:()=>{},onComplete:()=>{this.hls.trigger(I.BUFFER_FLUSHED,{type:s})},onError:o=>{this.warn(`Failed to remove from ${s} SourceBuffer`,o)}});t.type?n.append(i(t.type),t.type):this.getSourceBufferTypes().forEach(s=>{n.append(i(s),s)})}onFragParsed(e,t){const{frag:n,part:i}=t,s=[],o=i?i.elementaryStreams:n.elementaryStreams;o[He.AUDIOVIDEO]?s.push("audiovideo"):(o[He.AUDIO]&&s.push("audio"),o[He.VIDEO]&&s.push("video"));const a=()=>{const A=self.performance.now();n.stats.buffering.end=A,i&&(i.stats.buffering.end=A);const l=i?i.stats:n.stats;this.hls.trigger(I.FRAG_BUFFERED,{frag:n,part:i,stats:l,id:n.type})};s.length===0&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${n.type} level: ${n.level} sn: ${n.sn}`),this.blockBuffers(a,s)}onFragChanged(e,t){this.trimBuffers()}onBufferEos(e,t){this.getSourceBufferTypes().reduce((i,s)=>{const o=this.sourceBuffer[s];return o&&(!t.type||t.type===s)&&(o.ending=!0,o.ended||(o.ended=!0,this.log(`${s} sourceBuffer now EOS`))),i&&!!(!o||o.ended)},!0)&&(this.log("Queueing mediaSource.endOfStream()"),this.blockBuffers(()=>{this.getSourceBufferTypes().forEach(s=>{const o=this.sourceBuffer[s];o&&(o.ending=!1)});const{mediaSource:i}=this;if(!i||i.readyState!=="open"){i&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${i.readyState}`);return}this.log("Calling mediaSource.endOfStream()"),i.endOfStream()}))}onLevelUpdated(e,{details:t}){t.fragments.length&&(this.details=t,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())}trimBuffers(){const{hls:e,details:t,media:n}=this;if(!n||t===null||!this.getSourceBufferTypes().length)return;const s=e.config,o=n.currentTime,a=t.levelTargetDuration,A=t.live&&s.liveBackBufferLength!==null?s.liveBackBufferLength:s.backBufferLength;if(he(A)&&A>0){const l=Math.max(A,a),c=Math.floor(o/a)*a-l;this.flushBackBuffer(o,a,c)}if(he(s.frontBufferFlushThreshold)&&s.frontBufferFlushThreshold>0){const l=Math.max(s.maxBufferLength,s.frontBufferFlushThreshold),c=Math.max(l,a),u=Math.floor(o/a)*a+c;this.flushFrontBuffer(o,a,u)}}flushBackBuffer(e,t,n){const{details:i,sourceBuffer:s}=this;this.getSourceBufferTypes().forEach(a=>{const A=s[a];if(A){const l=Ve.getBuffered(A);if(l.length>0&&n>l.start(0)){if(this.hls.trigger(I.BACK_BUFFER_REACHED,{bufferEnd:n}),i!=null&&i.live)this.hls.trigger(I.LIVE_BACK_BUFFER_REACHED,{bufferEnd:n});else if(A.ended&&l.end(l.length-1)-e<t*2){this.log(`Cannot flush ${a} back buffer while SourceBuffer is in ended state`);return}this.hls.trigger(I.BUFFER_FLUSHING,{startOffset:0,endOffset:n,type:a})}}})}flushFrontBuffer(e,t,n){const{sourceBuffer:i}=this;this.getSourceBufferTypes().forEach(o=>{const a=i[o];if(a){const A=Ve.getBuffered(a),l=A.length;if(l<2)return;const c=A.start(l-1),u=A.end(l-1);if(n>c||e>=c&&e<=u)return;if(a.ended&&e-u<2*t){this.log(`Cannot flush ${o} front buffer while SourceBuffer is in ended state`);return}this.hls.trigger(I.BUFFER_FLUSHING,{startOffset:c,endOffset:1/0,type:o})}})}updateMediaElementDuration(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;const{details:e,hls:t,media:n,mediaSource:i}=this,s=e.fragments[0].start+e.totalduration,o=n.duration,a=he(i.duration)?i.duration:0;e.live&&t.config.liveDurationInfinity?(i.duration=1/0,this.updateSeekableRange(e)):(s>a&&s>o||!he(o))&&(this.log(`Updating Media Source duration to ${s.toFixed(3)}`),i.duration=s)}updateSeekableRange(e){const t=this.mediaSource,n=e.fragments;if(n.length&&e.live&&t!=null&&t.setLiveSeekableRange){const s=Math.max(0,n[0].start),o=Math.max(s,s+e.totalduration);this.log(`Media Source duration is set to ${t.duration}. Setting seekable range to ${s}-${o}.`),t.setLiveSeekableRange(s,o)}}checkPendingTracks(){const{bufferCodecEventsExpected:e,operationQueue:t,pendingTracks:n}=this,i=Object.keys(n).length;if(i&&(!e||i===2||"audiovideo"in n)){this.createSourceBuffers(n),this.pendingTracks={};const s=this.getSourceBufferTypes();if(s.length)this.hls.trigger(I.BUFFER_CREATED,{tracks:this.tracks}),s.forEach(o=>{t.executeNext(o)});else{const o=new Error("could not create source buffer for media codec(s)");this.hls.trigger(I.ERROR,{type:ye.MEDIA_ERROR,details:V.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:o,reason:o.message})}}}createSourceBuffers(e){const{sourceBuffer:t,mediaSource:n}=this;if(!n)throw Error("createSourceBuffers called when mediaSource was null");for(const s in e)if(!t[s]){var i;const o=e[s];if(!o)throw Error(`source buffer exists for track ${s}, however track does not`);let a=((i=o.levelCodec)==null?void 0:i.indexOf(","))===-1?o.levelCodec:o.codec;a&&s.slice(0,5)==="audio"&&(a=cs(a,this.appendSource));const A=`${o.container};codecs=${a}`;this.log(`creating sourceBuffer(${A})`);try{const l=t[s]=n.addSourceBuffer(A),c=s;this.addBufferListener(c,"updatestart",this._onSBUpdateStart),this.addBufferListener(c,"updateend",this._onSBUpdateEnd),this.addBufferListener(c,"error",this._onSBUpdateError),this.appendSource&&this.addBufferListener(c,"bufferedchange",(u,h)=>{const d=h.removedRanges;d!=null&&d.length&&this.hls.trigger(I.BUFFER_FLUSHED,{type:s})}),this.tracks[s]={buffer:l,codec:a,container:o.container,levelCodec:o.levelCodec,metadata:o.metadata,id:o.id}}catch(l){this.error(`error while trying to add sourceBuffer: ${l.message}`),this.hls.trigger(I.ERROR,{type:ye.MEDIA_ERROR,details:V.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:l,sourceBufferName:s,mimeType:A})}}}get mediaSrc(){var e;const t=((e=this.media)==null?void 0:e.firstChild)||this.media;return t==null?void 0:t.src}_onSBUpdateStart(e){const{operationQueue:t}=this;t.current(e).onStart()}_onSBUpdateEnd(e){var t;if(((t=this.mediaSource)==null?void 0:t.readyState)==="closed"){this.resetBuffer(e);return}const{operationQueue:n}=this;n.current(e).onComplete(),n.shiftAndExecuteNext(e)}_onSBUpdateError(e,t){var n;const i=new Error(`${e} SourceBuffer error. MediaSource readyState: ${(n=this.mediaSource)==null?void 0:n.readyState}`);this.error(`${i}`,t),this.hls.trigger(I.ERROR,{type:ye.MEDIA_ERROR,details:V.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:i,fatal:!1});const s=this.operationQueue.current(e);s&&s.onError(i)}removeExecutor(e,t,n){const{media:i,mediaSource:s,operationQueue:o,sourceBuffer:a}=this,A=a[e];if(!i||!s||!A){this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`),o.shiftAndExecuteNext(e);return}const l=he(i.duration)?i.duration:1/0,c=he(s.duration)?s.duration:1/0,u=Math.max(0,t),h=Math.min(n,l,c);h>u&&(!A.ending||A.ended)?(A.ended=!1,this.log(`Removing [${u},${h}] from the ${e} SourceBuffer`),A.remove(u,h)):o.shiftAndExecuteNext(e)}appendExecutor(e,t){const n=this.sourceBuffer[t];if(!n){if(!this.pendingTracks[t])throw new Error(`Attempting to append to the ${t} SourceBuffer, but it does not exist`);return}n.ended=!1,n.appendBuffer(e)}blockBuffers(e,t=this.getSourceBufferTypes()){if(!t.length){this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(e);return}const{operationQueue:n}=this,i=t.map(s=>n.appendBlocker(s));Promise.all(i).then(()=>{e(),t.forEach(s=>{const o=this.sourceBuffer[s];o!=null&&o.updating||n.shiftAndExecuteNext(s)})})}getSourceBufferTypes(){return Object.keys(this.sourceBuffer)}addBufferListener(e,t,n){const i=this.sourceBuffer[e];if(!i)return;const s=n.bind(this,e);this.listeners[e].push({event:t,listener:s}),i.addEventListener(t,s)}removeBufferListeners(e){const t=this.sourceBuffer[e];t&&this.listeners[e].forEach(n=>{t.removeEventListener(n.event,n.listener)})}}function Yu(r){const e=r.querySelectorAll("source");[].slice.call(e).forEach(t=>{r.removeChild(t)})}function pI(r,e){const t=self.document.createElement("source");t.type="video/mp4",t.src=e,r.appendChild(t)}const mI={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},Vu=r=>String.fromCharCode(mI[r]||r),qt=15,vr=100,EI={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},II={17:2,18:4,21:6,22:8,23:10,19:13,20:15},CI={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},vI={25:2,26:4,29:6,30:8,31:10,27:13,28:15},yI=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class BI{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const n=typeof t=="function"?t():t;U.log(`${this.time} [${e}] ${n}`)}}}const qr=function(e){const t=[];for(let n=0;n<e.length;n++)t.push(e[n].toString(16));return t};class Ku{constructor(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}reset(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}setStyles(e){const t=["foreground","underline","italics","background","flash"];for(let n=0;n<t.length;n++){const i=t[n];e.hasOwnProperty(i)&&(this[i]=e[i])}}isDefault(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash}equals(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash}copy(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash}toString(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}}class QI{constructor(){this.uchar=" ",this.penState=new Ku}reset(){this.uchar=" ",this.penState.reset()}setChar(e,t){this.uchar=e,this.penState.copy(t)}setPenState(e){this.penState.copy(e)}equals(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)}copy(e){this.uchar=e.uchar,this.penState.copy(e.penState)}isEmpty(){return this.uchar===" "&&this.penState.isDefault()}}class TI{constructor(e){this.chars=[],this.pos=0,this.currPenState=new Ku,this.cueStartTime=null,this.logger=void 0;for(let t=0;t<vr;t++)this.chars.push(new QI);this.logger=e}equals(e){for(let t=0;t<vr;t++)if(!this.chars[t].equals(e.chars[t]))return!1;return!0}copy(e){for(let t=0;t<vr;t++)this.chars[t].copy(e.chars[t])}isEmpty(){let e=!0;for(let t=0;t<vr;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e}setCursor(e){this.pos!==e&&(this.pos=e),this.pos<0?(this.logger.log(3,"Negative cursor position "+this.pos),this.pos=0):this.pos>vr&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=vr)}moveCursor(e){const t=this.pos+e;if(e>1)for(let n=this.pos+1;n<t+1;n++)this.chars[n].setPenState(this.currPenState);this.setCursor(t)}backSpace(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)}insertChar(e){e>=144&&this.backSpace();const t=Vu(e);if(this.pos>=vr){this.logger.log(0,()=>"Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1)}clearFromPos(e){let t;for(t=e;t<vr;t++)this.chars[t].reset()}clear(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()}clearToEndOfRow(){this.clearFromPos(this.pos)}getTextString(){const e=[];let t=!0;for(let n=0;n<vr;n++){const i=this.chars[n].uchar;i!==" "&&(t=!1),e.push(i)}return t?"":e.join("")}setPenStyles(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}}class xa{constructor(e){this.rows=[],this.currRow=qt-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let t=0;t<qt;t++)this.rows.push(new TI(e));this.logger=e}reset(){for(let e=0;e<qt;e++)this.rows[e].clear();this.currRow=qt-1}equals(e){let t=!0;for(let n=0;n<qt;n++)if(!this.rows[n].equals(e.rows[n])){t=!1;break}return t}copy(e){for(let t=0;t<qt;t++)this.rows[t].copy(e.rows[t])}isEmpty(){let e=!0;for(let t=0;t<qt;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e}backSpace(){this.rows[this.currRow].backSpace()}clearToEndOfRow(){this.rows[this.currRow].clearToEndOfRow()}insertChar(e){this.rows[this.currRow].insertChar(e)}setPen(e){this.rows[this.currRow].setPenStyles(e)}moveCursor(e){this.rows[this.currRow].moveCursor(e)}setCursor(e){this.logger.log(2,"setCursor: "+e),this.rows[this.currRow].setCursor(e)}setPAC(e){this.logger.log(2,()=>"pacData = "+JSON.stringify(e));let t=e.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(let a=0;a<qt;a++)this.rows[a].clear();const s=this.currRow+1-this.nrRollUpRows,o=this.lastOutputScreen;if(o){const a=o.rows[s].cueStartTime,A=this.logger.time;if(a!==null&&A!==null&&a<A)for(let l=0;l<this.nrRollUpRows;l++)this.rows[t-this.nrRollUpRows+l+1].copy(o.rows[s+l])}}this.currRow=t;const n=this.rows[this.currRow];if(e.indent!==null){const s=e.indent,o=Math.max(s-1,0);n.setCursor(e.indent),e.color=n.chars[o].penState.foreground}const i={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(i)}setBkgData(e){this.logger.log(2,()=>"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,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),this.logger.log(2,"Rolling up")}getDisplayText(e){e=e||!1;const t=[];let n="",i=-1;for(let s=0;s<qt;s++){const o=this.rows[s].getTextString();o&&(i=s+1,e?t.push("Row "+i+": '"+o+"'"):t.push(o.trim()))}return t.length>0&&(e?n="["+t.join(" | ")+"]":n=t.join(`
|
2477
|
-
`)),n}getTextAndFormat(){return this.rows}}class Ju{constructor(e,t,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=t,this.mode=null,this.verbose=0,this.displayedMemory=new xa(n),this.nonDisplayedMemory=new xa(n),this.lastOutputScreen=new xa(n),this.currRollUpRow=this.displayedMemory.rows[qt-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[qt-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;n<e.length;n++)this.writeScreen.insertChar(e[n]);const t=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(2,()=>t+": "+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 t={flash:!1};if(t.underline=e%2===1,t.italics=e>=46,t.italics)t.foreground="white";else{const n=Math.floor(e/2)-16,i=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=i[n]}this.logger.log(2,"MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)}outputDataUpdate(e=!1){const t=this.logger.time;t!==null&&this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=t:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t),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 Wu{constructor(e,t,n){this.channels=void 0,this.currentChannel=0,this.cmdHistory=xI(),this.logger=void 0;const i=this.logger=new BI;this.channels=[null,new Ju(e,t,i),new Ju(e+1,n,i)]}getHandler(e){return this.channels[e].getHandler()}setHandler(e,t){this.channels[e].setHandler(t)}addData(e,t){this.logger.time=e;for(let n=0;n<t.length;n+=2){const i=t[n]&127,s=t[n+1]&127;let o=!1,a=null;if(i===0&&s===0)continue;this.logger.log(3,()=>"["+qr([t[n],t[n+1]])+"] -> ("+qr([i,s])+")");const A=this.cmdHistory;if(i>=16&&i<=31){if(bI(i,s,A)){ws(null,null,A),this.logger.log(3,()=>"Repeated command ("+qr([i,s])+") is dropped");continue}ws(i,s,this.cmdHistory),o=this.parseCmd(i,s),o||(o=this.parseMidrow(i,s)),o||(o=this.parsePAC(i,s)),o||(o=this.parseBackgroundAttributes(i,s))}else ws(null,null,A);if(!o&&(a=this.parseChars(i,s),a)){const c=this.currentChannel;c&&c>0?this.channels[c].insertChars(a):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!o&&!a&&this.logger.log(2,()=>"Couldn't parse cleaned data "+qr([i,s])+" orig: "+qr([t[n],t[n+1]]))}}parseCmd(e,t){const n=(e===20||e===28||e===21||e===29)&&t>=32&&t<=47,i=(e===23||e===31)&&t>=33&&t<=35;if(!(n||i))return!1;const s=e===20||e===21||e===23?1:2,o=this.channels[s];return e===20||e===21||e===28||e===29?t===32?o.ccRCL():t===33?o.ccBS():t===34?o.ccAOF():t===35?o.ccAON():t===36?o.ccDER():t===37?o.ccRU(2):t===38?o.ccRU(3):t===39?o.ccRU(4):t===40?o.ccFON():t===41?o.ccRDC():t===42?o.ccTR():t===43?o.ccRTD():t===44?o.ccEDM():t===45?o.ccCR():t===46?o.ccENM():t===47&&o.ccEOC():o.ccTO(t-32),this.currentChannel=s,!0}parseMidrow(e,t){let n=0;if((e===17||e===25)&&t>=32&&t<=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(t),this.logger.log(3,()=>"MIDROW ("+qr([e,t])+")"),!0):!1}return!1}parsePAC(e,t){let n;const i=(e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127,s=(e===16||e===24)&&t>=64&&t<=95;if(!(i||s))return!1;const o=e<=23?1:2;t>=64&&t<=95?n=o===1?EI[e]:CI[e]:n=o===1?II[e]:vI[e];const a=this.channels[o];return a?(a.setPAC(this.interpretPAC(n,t)),this.currentChannel=o,!0):!1}interpretPAC(e,t){let n;const i={color:null,italics:!1,indent:null,underline:!1,row:e};return t>95?n=t-96:n=t-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,t){let n,i=null,s=null;if(e>=25?(n=2,s=e-8):(n=1,s=e),s>=17&&s<=19){let o;s===17?o=t+80:s===18?o=t+112:o=t+144,this.logger.log(2,()=>"Special char '"+Vu(o)+"' in channel "+n),i=[o]}else e>=32&&e<=127&&(i=t===0?[e]:[e,t]);return i&&this.logger.log(3,()=>"Char codes = "+qr(i).join(",")),i}parseBackgroundAttributes(e,t){const n=(e===16||e===24)&&t>=32&&t<=47,i=(e===23||e===31)&&t>=45&&t<=47;if(!(n||i))return!1;let s;const o={};e===16||e===24?(s=Math.floor((t-32)/2),o.background=yI[s],t%2===1&&(o.background=o.background+"_semi")):t===45?o.background="transparent":(o.foreground="black",t===47&&(o.underline=!0));const a=e<=23?1:2;return this.channels[a].setBkgData(o),!0}reset(){for(let e=0;e<Object.keys(this.channels).length;e++){const t=this.channels[e];t&&t.reset()}ws(null,null,this.cmdHistory)}cueSplitAtTime(e){for(let t=0;t<this.channels.length;t++){const n=this.channels[t];n&&n.cueSplitAtTime(e)}}}function ws(r,e,t){t.a=r,t.b=e}function bI(r,e,t){return t.a===r&&t.b===e}function xI(){return{a:null,b:null}}class Ss{constructor(e,t){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=e,this.trackName=t}dispatchCue(){this.startTime!==null&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)}newCue(e,t,n){(this.startTime===null||this.startTime>e)&&(this.startTime=e),this.endTime=t,this.screen=n,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}var wa=function(){if(pn!=null&&pn.VTTCue)return self.VTTCue;const r=["","lr","rl"],e=["start","middle","end","left","right"];function t(a,A){if(typeof A!="string"||!Array.isArray(a))return!1;const l=A.toLowerCase();return~a.indexOf(l)?l:!1}function n(a){return t(r,a)}function i(a){return t(e,a)}function s(a,...A){let l=1;for(;l<arguments.length;l++){const c=arguments[l];for(const u in c)a[u]=c[u]}return a}function o(a,A,l){const c=this,u={enumerable:!0};c.hasBeenReset=!1;let h="",d=!1,f=a,g=A,p=l,v=null,T="",b=!0,y="auto",w="start",R=50,k="middle",$=50,W="middle";Object.defineProperty(c,"id",s({},u,{get:function(){return h},set:function(O){h=""+O}})),Object.defineProperty(c,"pauseOnExit",s({},u,{get:function(){return d},set:function(O){d=!!O}})),Object.defineProperty(c,"startTime",s({},u,{get:function(){return f},set:function(O){if(typeof O!="number")throw new TypeError("Start time must be set to a number.");f=O,this.hasBeenReset=!0}})),Object.defineProperty(c,"endTime",s({},u,{get:function(){return g},set:function(O){if(typeof O!="number")throw new TypeError("End time must be set to a number.");g=O,this.hasBeenReset=!0}})),Object.defineProperty(c,"text",s({},u,{get:function(){return p},set:function(O){p=""+O,this.hasBeenReset=!0}})),Object.defineProperty(c,"region",s({},u,{get:function(){return v},set:function(O){v=O,this.hasBeenReset=!0}})),Object.defineProperty(c,"vertical",s({},u,{get:function(){return T},set:function(O){const K=n(O);if(K===!1)throw new SyntaxError("An invalid or illegal string was specified.");T=K,this.hasBeenReset=!0}})),Object.defineProperty(c,"snapToLines",s({},u,{get:function(){return b},set:function(O){b=!!O,this.hasBeenReset=!0}})),Object.defineProperty(c,"line",s({},u,{get:function(){return y},set:function(O){if(typeof O!="number"&&O!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");y=O,this.hasBeenReset=!0}})),Object.defineProperty(c,"lineAlign",s({},u,{get:function(){return w},set:function(O){const K=i(O);if(!K)throw new SyntaxError("An invalid or illegal string was specified.");w=K,this.hasBeenReset=!0}})),Object.defineProperty(c,"position",s({},u,{get:function(){return R},set:function(O){if(O<0||O>100)throw new Error("Position must be between 0 and 100.");R=O,this.hasBeenReset=!0}})),Object.defineProperty(c,"positionAlign",s({},u,{get:function(){return k},set:function(O){const K=i(O);if(!K)throw new SyntaxError("An invalid or illegal string was specified.");k=K,this.hasBeenReset=!0}})),Object.defineProperty(c,"size",s({},u,{get:function(){return $},set:function(O){if(O<0||O>100)throw new Error("Size must be between 0 and 100.");$=O,this.hasBeenReset=!0}})),Object.defineProperty(c,"align",s({},u,{get:function(){return W},set:function(O){const K=i(O);if(!K)throw new SyntaxError("An invalid or illegal string was specified.");W=K,this.hasBeenReset=!0}})),c.displayState=void 0}return o.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},o}();class wI{decode(e,t){if(!e)return"";if(typeof e!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function qu(r){function e(n,i,s,o){return(n|0)*3600+(i|0)*60+(s|0)+parseFloat(o||0)}const t=r.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return t?parseFloat(t[2])>59?e(t[2],t[3],0,t[4]):e(t[1],t[2],t[3],t[4]):null}class SI{constructor(){this.values=Object.create(null)}set(e,t){!this.get(e)&&t!==""&&(this.values[e]=t)}get(e,t,n){return n?this.has(e)?this.values[e]:t[n]:this.has(e)?this.values[e]:t}has(e){return e in this.values}alt(e,t,n){for(let i=0;i<n.length;++i)if(t===n[i]){this.set(e,t);break}}integer(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))}percent(e,t){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(t)){const n=parseFloat(t);if(n>=0&&n<=100)return this.set(e,n),!0}return!1}}function Xu(r,e,t,n){const i=n?r.split(n):[r];for(const s in i){if(typeof i[s]!="string")continue;const o=i[s].split(t);if(o.length!==2)continue;const a=o[0],A=o[1];e(a,A)}}const Sa=new wa(0,0,""),Rs=Sa.align==="middle"?"middle":"center";function RI(r,e,t){const n=r;function i(){const a=qu(r);if(a===null)throw new Error("Malformed timestamp: "+n);return r=r.replace(/^[^\sa-zA-Z-]+/,""),a}function s(a,A){const l=new SI;Xu(a,function(h,d){let f;switch(h){case"region":for(let g=t.length-1;g>=0;g--)if(t[g].id===d){l.set(h,t[g].region);break}break;case"vertical":l.alt(h,d,["rl","lr"]);break;case"line":f=d.split(","),l.integer(h,f[0]),l.percent(h,f[0])&&l.set("snapToLines",!1),l.alt(h,f[0],["auto"]),f.length===2&&l.alt("lineAlign",f[1],["start",Rs,"end"]);break;case"position":f=d.split(","),l.percent(h,f[0]),f.length===2&&l.alt("positionAlign",f[1],["start",Rs,"end","line-left","line-right","auto"]);break;case"size":l.percent(h,d);break;case"align":l.alt(h,d,["start",Rs,"end","left","right"]);break}},/:/,/\s/),A.region=l.get("region",null),A.vertical=l.get("vertical","");let c=l.get("line","auto");c==="auto"&&Sa.line===-1&&(c=-1),A.line=c,A.lineAlign=l.get("lineAlign","start"),A.snapToLines=l.get("snapToLines",!0),A.size=l.get("size",100),A.align=l.get("align",Rs);let u=l.get("position","auto");u==="auto"&&Sa.position===50&&(u=A.align==="start"||A.align==="left"?0:A.align==="end"||A.align==="right"?100:50),A.position=u}function o(){r=r.replace(/^\s+/,"")}if(o(),e.startTime=i(),o(),r.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+n);r=r.slice(3),o(),e.endTime=i(),o(),s(r,e)}function ju(r){return r.replace(/<br(?: \/)?>/gi,`
|
2476
|
+
initSegmentChange: ${$}`);const O=new oI(n,i,t,a,c);this.configureTransmuxer(O)}if(this.frag=s,this.part=o,this.workerContext)this.workerContext.worker.postMessage({cmd:"demux",data:e,decryptdata:g,chunkMeta:A,state:V},e instanceof ArrayBuffer?[e]:[]);else if(d){const O=d.push(e,g,A,V);xs(O)?(d.async=!0,O.then(J=>{this.handleTransmuxComplete(J)}).catch(J=>{this.transmuxerError(J,A,"transmuxer-interface push error")})):(d.async=!1,this.handleTransmuxComplete(O))}}flush(e){e.transmuxing.start=self.performance.now();const{transmuxer:t}=this;if(this.workerContext)this.workerContext.worker.postMessage({cmd:"flush",chunkMeta:e});else if(t){let n=t.flush(e);xs(n)||t.async?(xs(n)||(n=Promise.resolve(n)),n.then(s=>{this.handleFlushResult(s,e)}).catch(s=>{this.transmuxerError(s,e,"transmuxer-interface flush error")})):this.handleFlushResult(n,e)}}transmuxerError(e,t,n){this.hls&&(this.error=e,this.hls.trigger(I.ERROR,{type:ye.MEDIA_ERROR,details:K.FRAG_PARSING_ERROR,chunkMeta:t,frag:this.frag||void 0,fatal:!1,error:e,err:e,reason:n}))}handleFlushResult(e,t){e.forEach(n=>{this.handleTransmuxComplete(n)}),this.onFlush(t)}onWorkerMessage(e){const t=e.data;if(!(t!=null&&t.event)){U.warn(`worker message received with no ${t?"event name":"data"}`);return}const n=this.hls;if(this.hls)switch(t.event){case"init":{var i;const s=(i=this.workerContext)==null?void 0:i.objectURL;s&&self.URL.revokeObjectURL(s);break}case"transmuxComplete":{this.handleTransmuxComplete(t.data);break}case"flush":{this.onFlush(t.data);break}case"workerLog":U[t.data.logType]&&U[t.data.logType](t.data.message);break;default:{t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,n.trigger(t.event,t.data);break}}}configureTransmuxer(e){const{transmuxer:t}=this;this.workerContext?this.workerContext.worker.postMessage({cmd:"configure",config:e}):t&&t.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}function Uu(r,e){if(r.length!==e.length)return!1;for(let t=0;t<r.length;t++)if(!Tn(r[t].attrs,e[t].attrs))return!1;return!0}function Tn(r,e,t){const n=r["STABLE-RENDITION-ID"];return n&&!t?n===e["STABLE-RENDITION-ID"]:!(t||["LANGUAGE","NAME","CHARACTERISTICS","AUTOSELECT","DEFAULT","FORCED","ASSOC-LANGUAGE"]).some(i=>r[i]!==e[i])}function xa(r,e){return e.label.toLowerCase()===r.name.toLowerCase()&&(!e.language||e.language.toLowerCase()===(r.lang||"").toLowerCase())}const Gu=100;class AI extends ma{constructor(e,t,n){super(e,t,n,"[audio-stream-controller]",Ee.AUDIO),this.videoBuffer=null,this.videoTrackCC=-1,this.waitingVideoCC=-1,this.bufferedTrack=null,this.switchingTrack=null,this.trackId=-1,this.waitingData=null,this.mainDetails=null,this.flushing=!1,this.bufferFlushed=!1,this.cachedTrackLoadedData=null,this._registerListeners()}onHandlerDestroying(){this._unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=null,this.bufferedTrack=null,this.switchingTrack=null}_registerListeners(){const{hls:e}=this;e.on(I.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(I.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(I.MANIFEST_LOADING,this.onManifestLoading,this),e.on(I.LEVEL_LOADED,this.onLevelLoaded,this),e.on(I.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(I.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(I.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(I.ERROR,this.onError,this),e.on(I.BUFFER_RESET,this.onBufferReset,this),e.on(I.BUFFER_CREATED,this.onBufferCreated,this),e.on(I.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(I.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(I.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(I.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(I.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(I.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(I.MANIFEST_LOADING,this.onManifestLoading,this),e.off(I.LEVEL_LOADED,this.onLevelLoaded,this),e.off(I.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(I.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(I.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(I.ERROR,this.onError,this),e.off(I.BUFFER_RESET,this.onBufferReset,this),e.off(I.BUFFER_CREATED,this.onBufferCreated,this),e.off(I.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(I.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(I.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(I.FRAG_BUFFERED,this.onFragBuffered,this)}onInitPtsFound(e,{frag:t,id:n,initPTS:i,timescale:s}){if(n==="main"){const o=t.cc;this.initPTS[t.cc]={baseTime:i,timescale:s},this.log(`InitPTS for cc: ${o} found from main: ${i}`),this.videoTrackCC=o,this.state===te.WAITING_INIT_PTS&&this.tick()}}startLoad(e){if(!this.levels){this.startPosition=e,this.state=te.STOPPED;return}const t=this.lastCurrentTime;this.stopLoad(),this.setInterval(Gu),t>0&&e===-1?(this.log(`Override startPosition with lastCurrentTime @${t.toFixed(3)}`),e=t,this.state=te.IDLE):(this.loadedmetadata=!1,this.state=te.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}doTick(){switch(this.state){case te.IDLE:this.doTickIdle();break;case te.WAITING_TRACK:{var e;const{levels:n,trackId:i}=this,s=n==null||(e=n[i])==null?void 0:e.details;if(s){if(this.waitForCdnTuneIn(s))break;this.state=te.WAITING_INIT_PTS}break}case te.FRAG_LOADING_WAITING_RETRY:{var t;const n=performance.now(),i=this.retryDate;if(!i||n>=i||(t=this.media)!=null&&t.seeking){const{levels:s,trackId:o}=this;this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded((s==null?void 0:s[o])||null),this.state=te.IDLE}break}case te.WAITING_INIT_PTS:{const n=this.waitingData;if(n){const{frag:i,part:s,cache:o,complete:a}=n;if(this.initPTS[i.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=te.FRAG_LOADING;const l=o.flush(),A={frag:i,part:s,payload:l,networkDetails:null};this._handleFragmentLoadProgress(A),a&&super._handleFragmentLoadComplete(A)}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 l=this.getLoadPosition(),A=Ve.bufferInfo(this.mediaBuffer,l,this.config.maxBufferHole);da(A.end,this.config.maxFragLookUpTolerance,i)<0&&(this.log(`Waiting fragment cc (${i.cc}) @ ${i.start} cancelled because another fragment at ${A.end} is needed`),this.clearWaitingFragment())}}else this.state=te.IDLE}}this.onTickEnd()}clearWaitingFragment(){const e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=te.IDLE)}resetLoadingState(){this.clearWaitingFragment(),super.resetLoadingState()}onTickEnd(){const{media:e}=this;e!=null&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){const{hls:e,levels:t,media:n,trackId:i}=this,s=e.config;if(!n&&(this.startFragRequested||!s.startFragPrefetch)||!(t!=null&&t[i]))return;const o=t[i],a=o.details;if(!a||a.live&&this.levelLastLoaded!==o||this.waitForCdnTuneIn(a)){this.state=te.WAITING_TRACK;return}const l=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&l&&(this.bufferFlushed=!1,this.afterBufferFlushed(l,He.AUDIO,Ee.AUDIO));const A=this.getFwdBufferInfo(l,Ee.AUDIO);if(A===null)return;const{bufferedTrack:c,switchingTrack:u}=this;if(!u&&this._streamEnded(A,a)){e.trigger(I.BUFFER_EOS,{type:"audio"}),this.state=te.ENDED;return}const h=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,Ee.MAIN),d=A.len,f=this.getMaxBufferLength(h==null?void 0:h.len),g=a.fragments,p=g[0].start;let C=this.flushing?this.getLoadPosition():A.end;if(u&&n){const x=this.getLoadPosition();c&&!Tn(u.attrs,c.attrs)&&(C=x),a.PTSKnown&&x<p&&(A.end>p||A.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),n.currentTime=p+.05)}if(d>=f&&!u&&C<g[g.length-1].start)return;let T=this.getNextFragment(C,a),b=!1;if(T&&this.isLoopLoading(T,C)&&(b=!!T.gap,T=this.getNextFragmentLoopLoading(T,a,A,Ee.MAIN,f)),!T){this.bufferFlushed=!0;return}const y=h&&T.start>h.end+a.targetduration;if(y||!(h!=null&&h.len)&&A.len){const x=this.getAppendedFrag(T.start,Ee.MAIN);if(x===null||(b||(b=!!x.gap||!!y&&h.len===0),y&&!b||b&&A.nextStart&&A.nextStart<x.end))return}this.loadFragment(T,o,C)}getMaxBufferLength(e){const t=super.getMaxBufferLength();return e?Math.min(Math.max(t,e),this.config.maxMaxBufferLength):t}onMediaDetaching(){this.videoBuffer=null,this.bufferFlushed=this.flushing=!1,super.onMediaDetaching()}onAudioTracksUpdated(e,{audioTracks:t}){this.resetTransmuxer(),this.levels=t.map(n=>new En(n))}onAudioTrackSwitching(e,t){const n=!!t.url;this.trackId=t.id;const{fragCurrent:i}=this;i&&(i.abortRequests(),this.removeUnbufferedFrags(i.start)),this.resetLoadingState(),n?this.setInterval(Gu):this.resetTransmuxer(),n?(this.switchingTrack=t,this.state=te.IDLE,this.flushAudioIfNeeded(t)):(this.switchingTrack=null,this.bufferedTrack=t,this.state=te.STOPPED),this.tick()}onManifestLoading(){this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=this.flushing=!1,this.levels=this.mainDetails=this.waitingData=this.bufferedTrack=this.cachedTrackLoadedData=this.switchingTrack=null,this.startFragRequested=!1,this.trackId=this.videoTrackCC=this.waitingVideoCC=-1}onLevelLoaded(e,t){this.mainDetails=t.details,this.cachedTrackLoadedData!==null&&(this.hls.trigger(I.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData),this.cachedTrackLoadedData=null)}onAudioTrackLoaded(e,t){var n;if(this.mainDetails==null){this.cachedTrackLoadedData=t;return}const{levels:i}=this,{details:s,id:o}=t;if(!i){this.warn(`Audio tracks were reset while loading level ${o}`);return}this.log(`Audio track ${o} loaded [${s.startSN},${s.endSN}]${s.lastPartSn?`[part-${s.lastPartSn}-${s.lastPartIndex}]`:""},duration:${s.totalduration}`);const a=i[o];let l=0;if(s.live||(n=a.details)!=null&&n.live){this.checkLiveUpdate(s);const c=this.mainDetails;if(s.deltaUpdateFailed||!c)return;if(!a.details&&s.hasProgramDateTime&&c.hasProgramDateTime)vs(s,c),l=s.fragments[0].start;else{var A;l=this.alignPlaylists(s,a.details,(A=this.levelLastLoaded)==null?void 0:A.details)}}a.details=s,this.levelLastLoaded=a,!this.startFragRequested&&(this.mainDetails||!s.live)&&this.setStartPosition(this.mainDetails||s,l),this.state===te.WAITING_TRACK&&!this.waitForCdnTuneIn(s)&&(this.state=te.IDLE),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:n,part:i,payload:s}=e,{config:o,trackId:a,levels:l}=this;if(!l){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 A=l[a];if(!A){this.warn("Audio track is undefined on fragment load progress");return}const c=A.details;if(!c){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(n.start);return}const u=o.defaultAudioCodec||A.audioCodec||"mp4a.40.2";let h=this.transmuxer;h||(h=this.transmuxer=new Ou(this.hls,Ee.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const d=this.initPTS[n.cc],f=(t=n.initSegment)==null?void 0:t.data;if(d!==void 0){const p=i?i.index:-1,C=p!==-1,T=new ga(n.level,n.sn,n.stats.chunkCount,s.byteLength,p,C);h.push(s,f,u,"",n,i,c.totalduration,!1,T,d)}else{this.log(`Unknown video PTS for cc ${n.cc}, waiting for video PTS before demuxing audio frag ${n.sn} of [${c.startSN} ,${c.endSN}],track ${a}`);const{cache:g}=this.waitingData=this.waitingData||{frag:n,part:i,cache:new mu,complete:!1};g.push(new Uint8Array(s)),this.waitingVideoCC=this.videoTrackCC,this.state=te.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,t){const n=t.tracks.audio;n&&(this.mediaBuffer=n.buffer||null),t.tracks.video&&(this.videoBuffer=t.tracks.video.buffer||null)}onFragBuffered(e,t){const{frag:n,part:i}=t;if(n.type!==Ee.AUDIO){if(!this.loadedmetadata&&n.type===Ee.MAIN){const s=this.videoBuffer||this.media;s&&Ve.getBuffered(s).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(I.AUDIO_TRACK_SWITCHED,ut({},s)))}this.fragBufferedComplete(n,i)}onError(e,t){var n;if(t.fatal){this.state=te.ERROR;return}switch(t.details){case K.FRAG_GAP:case K.FRAG_PARSING_ERROR:case K.FRAG_DECRYPT_ERROR:case K.FRAG_LOAD_ERROR:case K.FRAG_LOAD_TIMEOUT:case K.KEY_LOAD_ERROR:case K.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(Ee.AUDIO,t);break;case K.AUDIO_TRACK_LOAD_ERROR:case K.AUDIO_TRACK_LOAD_TIMEOUT:case K.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===te.WAITING_TRACK&&((n=t.context)==null?void 0:n.type)===Oe.AUDIO_TRACK&&(this.state=te.IDLE);break;case K.BUFFER_APPEND_ERROR:case K.BUFFER_FULL_ERROR:if(!t.parent||t.parent!=="audio")return;if(t.details===K.BUFFER_APPEND_ERROR){this.resetLoadingState();return}this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case K.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onBufferFlushing(e,{type:t}){t!==He.VIDEO&&(this.flushing=!0)}onBufferFlushed(e,{type:t}){if(t!==He.VIDEO){this.flushing=!1,this.bufferFlushed=!0,this.state===te.ENDED&&(this.state=te.IDLE);const n=this.mediaBuffer||this.media;n&&(this.afterBufferFlushed(n,t,Ee.AUDIO),this.tick())}}_handleTransmuxComplete(e){var t;const n="audio",{hls:i}=this,{remuxResult:s,chunkMeta:o}=e,a=this.getCurrentContext(o);if(!a){this.resetWhenMissingContext(o);return}const{frag:l,part:A,level:c}=a,{details:u}=c,{audio:h,text:d,id3:f,initSegment:g}=s;if(this.fragContextChanged(l)||!u){this.fragmentTracker.removeFragment(l);return}if(this.state=te.PARSING,this.switchingTrack&&h&&this.completeAudioSwitch(this.switchingTrack),g!=null&&g.tracks){const p=l.initSegment||l;this._bufferInitSegment(c,g.tracks,p,o),i.trigger(I.FRAG_PARSING_INIT_SEGMENT,{frag:p,id:n,tracks:g.tracks})}if(h){const{startPTS:p,endPTS:C,startDTS:T,endDTS:b}=h;A&&(A.elementaryStreams[He.AUDIO]={startPTS:p,endPTS:C,startDTS:T,endDTS:b}),l.setElementaryStreamInfo(He.AUDIO,p,C,T,b),this.bufferFragmentData(h,l,A,o)}if(f!=null&&(t=f.samples)!=null&&t.length){const p=st({id:n,frag:l,details:u},f);i.trigger(I.FRAG_PARSING_METADATA,p)}if(d){const p=st({id:n,frag:l,details:u},d);i.trigger(I.FRAG_PARSING_USERDATA,p)}}_bufferInitSegment(e,t,n,i){if(this.state!==te.PARSING)return;t.video&&delete t.video;const s=t.audio;if(!s)return;s.id="audio";const o=e.audioCodec;this.log(`Init audio buffer, container:${s.container}, codecs[level/parsed]=[${o}/${s.codec}]`),o&&o.split(",").length===1&&(s.levelCodec=o),this.hls.trigger(I.BUFFER_CODECS,t);const a=s.initSegment;if(a!=null&&a.byteLength){const l={type:"audio",frag:n,part:null,chunkMeta:i,parent:n.type,data:a};this.hls.trigger(I.BUFFER_APPENDING,l)}this.tickImmediate()}loadFragment(e,t,n){const i=this.fragmentTracker.getState(e);if(this.fragCurrent=e,this.switchingTrack||i===ht.NOT_LOADED||i===ht.PARTIAL){var s;if(e.sn==="initSegment")this._loadInitSegment(e,t);else if((s=t.details)!=null&&s.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=te.WAITING_INIT_PTS;const o=this.mainDetails;o&&o.fragments[0].start!==t.details.fragments[0].start&&vs(t.details,o)}else this.startFragRequested=!0,super.loadFragment(e,t,n)}else this.clearTrackerIfNeeded(e)}flushAudioIfNeeded(e){const{media:t,bufferedTrack:n}=this,i=n==null?void 0:n.attrs,s=e.attrs;t&&i&&(i.CHANNELS!==s.CHANNELS||n.name!==e.name||n.lang!==e.lang)&&(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"),this.bufferedTrack=null)}completeAudioSwitch(e){const{hls:t}=this;this.flushAudioIfNeeded(e),this.bufferedTrack=e,this.switchingTrack=null,t.trigger(I.AUDIO_TRACK_SWITCHED,ut({},e))}}class cI extends fa{constructor(e){super(e,"[audio-track-controller]"),this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:e}=this;e.on(I.MANIFEST_LOADING,this.onManifestLoading,this),e.on(I.MANIFEST_PARSED,this.onManifestParsed,this),e.on(I.LEVEL_LOADING,this.onLevelLoading,this),e.on(I.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(I.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(I.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(I.MANIFEST_LOADING,this.onManifestLoading,this),e.off(I.MANIFEST_PARSED,this.onManifestParsed,this),e.off(I.LEVEL_LOADING,this.onLevelLoading,this),e.off(I.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(I.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(I.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.tracksInGroup=[],this.groupIds=null,this.currentTrack=null,this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.audioTracks||[]}onAudioTrackLoaded(e,t){const{id:n,groupId:i,details:s}=t,o=this.tracksInGroup[n];if(!o||o.groupId!==i){this.warn(`Audio track with id:${n} and group:${i} not found in active group ${o==null?void 0:o.groupId}`);return}const a=o.details;o.details=t.details,this.log(`Audio track ${n} "${o.name}" lang:${o.lang} group:${i} loaded [${s.startSN}-${s.endSN}]`),n===this.trackId&&this.playlistLoaded(n,t,a)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const n=t.audioGroups||null,i=this.groupIds;let s=this.currentTrack;if(!n||(i==null?void 0:i.length)!==(n==null?void 0:n.length)||n!=null&&n.some(a=>(i==null?void 0:i.indexOf(a))===-1)){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const a=this.tracks.filter(h=>!n||n.indexOf(h.groupId)!==-1);if(a.length)this.selectDefaultTrack&&!a.some(h=>h.default)&&(this.selectDefaultTrack=!1),a.forEach((h,d)=>{h.id=d});else if(!s&&!this.tracksInGroup.length)return;this.tracksInGroup=a;const l=this.hls.config.audioPreference;if(!s&&l){const h=sr(l,a,vn);if(h>-1)s=a[h];else{const d=sr(l,this.tracks);s=this.tracks[d]}}let A=this.findTrackId(s);A===-1&&s&&(A=this.findTrackId(null));const c={audioTracks:a};this.log(`Updating audio tracks, ${a.length} track(s) found in group(s): ${n==null?void 0:n.join(",")}`),this.hls.trigger(I.AUDIO_TRACKS_UPDATED,c);const u=this.trackId;if(A!==-1&&u===-1)this.setAudioTrack(A);else if(a.length&&u===-1){var o;const h=new Error(`No audio track selected for current audio group-ID(s): ${(o=this.groupIds)==null?void 0:o.join(",")} track count: ${a.length}`);this.warn(h.message),this.hls.trigger(I.ERROR,{type:ye.MEDIA_ERROR,details:K.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:h})}}else this.shouldReloadPlaylist(s)&&this.setAudioTrack(this.trackId)}onError(e,t){t.fatal||!t.context||t.context.type===Oe.AUDIO_TRACK&&t.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(t.context.groupId)!==-1)&&(this.requestScheduled=-1,this.checkRetry(t))}get allAudioTracks(){return this.tracks}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}setAudioOption(e){const t=this.hls;if(t.config.audioPreference=e,e){const n=this.allAudioTracks;if(this.selectDefaultTrack=!1,n.length){const i=this.currentTrack;if(i&&Cn(e,i,vn))return i;const s=sr(e,this.tracksInGroup,vn);if(s>-1){const o=this.tracksInGroup[s];return this.setAudioTrack(s),o}else if(i){let o=t.loadLevel;o===-1&&(o=t.firstAutoLevel);const a=cE(e,t.levels,n,o,vn);if(a===-1)return null;t.nextLoadLevel=a}if(e.channels||e.audioCodec){const o=sr(e,n);if(o>-1)return n[o]}}}return null}setAudioTrack(e){const t=this.tracksInGroup;if(e<0||e>=t.length){this.warn(`Invalid audio track id: ${e}`);return}this.clearTimer(),this.selectDefaultTrack=!1;const n=this.currentTrack,i=t[e],s=i.details&&!i.details.live;if(e===this.trackId&&i===n&&s||(this.log(`Switching to audio-track ${e} "${i.name}" lang:${i.lang} group:${i.groupId} channels:${i.channels}`),this.trackId=e,this.currentTrack=i,this.hls.trigger(I.AUDIO_TRACK_SWITCHING,ut({},i)),s))return;const o=this.switchParams(i.url,n==null?void 0:n.details,i.details);this.loadPlaylist(o)}findTrackId(e){const t=this.tracksInGroup;for(let n=0;n<t.length;n++){const i=t[n];if(!(this.selectDefaultTrack&&!i.default)&&(!e||Cn(e,i,vn)))return n}if(e){const{name:n,lang:i,assocLang:s,characteristics:o,audioCodec:a,channels:l}=e;for(let A=0;A<t.length;A++){const c=t[A];if(Cn({name:n,lang:i,assocLang:s,characteristics:o,audioCodec:a,channels:l},c,vn))return A}for(let A=0;A<t.length;A++){const c=t[A];if(Tn(e.attrs,c.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return A}for(let A=0;A<t.length;A++){const c=t[A];if(Tn(e.attrs,c.attrs,["LANGUAGE"]))return A}}return-1}loadPlaylist(e){const t=this.currentTrack;if(this.shouldLoadPlaylist(t)&&t){super.loadPlaylist();const n=t.id,i=t.groupId;let s=t.url;if(e)try{s=e.addDirectives(s)}catch(o){this.warn(`Could not construct new URL with HLS Delivery Directives: ${o}`)}this.log(`loading audio-track playlist ${n} "${t.name}" lang:${t.lang} group:${i}`),this.clearTimer(),this.hls.trigger(I.AUDIO_TRACK_LOADING,{url:s,id:n,groupId:i,deliveryDirectives:e||null})}}}const Hu=500;class uI extends ma{constructor(e,t,n){super(e,t,n,"[subtitle-stream-controller]",Ee.SUBTITLE),this.currentTrackId=-1,this.tracksBuffered=[],this.mainDetails=null,this._registerListeners()}onHandlerDestroying(){this._unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=null}_registerListeners(){const{hls:e}=this;e.on(I.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(I.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(I.MANIFEST_LOADING,this.onManifestLoading,this),e.on(I.LEVEL_LOADED,this.onLevelLoaded,this),e.on(I.ERROR,this.onError,this),e.on(I.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(I.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(I.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(I.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(I.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(I.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(I.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(I.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(I.MANIFEST_LOADING,this.onManifestLoading,this),e.off(I.LEVEL_LOADED,this.onLevelLoaded,this),e.off(I.ERROR,this.onError,this),e.off(I.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(I.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(I.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(I.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(I.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(I.FRAG_BUFFERED,this.onFragBuffered,this)}startLoad(e){this.stopLoad(),this.state=te.IDLE,this.setInterval(Hu),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}onManifestLoading(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()}onMediaDetaching(){this.tracksBuffered=[],super.onMediaDetaching()}onLevelLoaded(e,t){this.mainDetails=t.details}onSubtitleFragProcessed(e,t){const{frag:n,success:i}=t;if(this.fragPrevious=n,this.state=te.IDLE,!i)return;const s=this.tracksBuffered[this.currentTrackId];if(!s)return;let o;const a=n.start;for(let A=0;A<s.length;A++)if(a>=s[A].start&&a<=s[A].end){o=s[A];break}const l=n.start+n.duration;o?o.end=l:(o={start:a,end:l},s.push(o)),this.fragmentTracker.fragBuffered(n),this.fragBufferedComplete(n,null)}onBufferFlushing(e,t){const{startOffset:n,endOffset:i}=t;if(n===0&&i!==Number.POSITIVE_INFINITY){const s=i-1;if(s<=0)return;t.endOffsetSubtitles=Math.max(0,s),this.tracksBuffered.forEach(o=>{for(let a=0;a<o.length;){if(o[a].end<=s){o.shift();continue}else if(o[a].start<s)o[a].start=s;else break;a++}}),this.fragmentTracker.removeFragmentsInRange(n,s,Ee.SUBTITLE)}}onFragBuffered(e,t){if(!this.loadedmetadata&&t.frag.type===Ee.MAIN){var n;(n=this.media)!=null&&n.buffered.length&&(this.loadedmetadata=!0)}}onError(e,t){const n=t.frag;(n==null?void 0:n.type)===Ee.SUBTITLE&&(t.details===K.FRAG_GAP&&this.fragmentTracker.fragBuffered(n,!0),this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==te.STOPPED&&(this.state=te.IDLE))}onSubtitleTracksUpdated(e,{subtitleTracks:t}){if(this.levels&&Uu(this.levels,t)){this.levels=t.map(n=>new En(n));return}this.tracksBuffered=[],this.levels=t.map(n=>{const i=new En(n);return this.tracksBuffered[i.id]=[],i}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,Ee.SUBTITLE),this.fragPrevious=null,this.mediaBuffer=null}onSubtitleTrackSwitch(e,t){var n;if(this.currentTrackId=t.id,!((n=this.levels)!=null&&n.length)||this.currentTrackId===-1){this.clearInterval();return}const i=this.levels[this.currentTrackId];i!=null&&i.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,i&&this.setInterval(Hu)}onSubtitleTrackLoaded(e,t){var n;const{currentTrackId:i,levels:s}=this,{details:o,id:a}=t;if(!s){this.warn(`Subtitle tracks were reset while loading level ${a}`);return}const l=s[a];if(a>=s.length||!l)return;this.log(`Subtitle track ${a} loaded [${o.startSN},${o.endSN}]${o.lastPartSn?`[part-${o.lastPartSn}-${o.lastPartIndex}]`:""},duration:${o.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let A=0;if(o.live||(n=l.details)!=null&&n.live){const u=this.mainDetails;if(o.deltaUpdateFailed||!u)return;const h=u.fragments[0];if(!l.details)o.hasProgramDateTime&&u.hasProgramDateTime?(vs(o,u),A=o.fragments[0].start):h&&(A=h.start,ua(o,A));else{var c;A=this.alignPlaylists(o,l.details,(c=this.levelLastLoaded)==null?void 0:c.details),A===0&&h&&(A=h.start,ua(o,A))}}l.details=o,this.levelLastLoaded=l,a===i&&(!this.startFragRequested&&(this.mainDetails||!o.live)&&this.setStartPosition(this.mainDetails||o,A),this.tick(),o.live&&!this.fragCurrent&&this.media&&this.state===te.IDLE&&(ms(null,o.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),l.details=void 0)))}_handleFragmentLoadComplete(e){const{frag:t,payload:n}=e,i=t.decryptdata,s=this.hls;if(!this.fragContextChanged(t)&&n&&n.byteLength>0&&i!=null&&i.key&&i.iv&&i.method==="AES-128"){const o=performance.now();this.decrypter.decrypt(new Uint8Array(n),i.key.buffer,i.iv.buffer).catch(a=>{throw s.trigger(I.ERROR,{type:ye.MEDIA_ERROR,details:K.FRAG_DECRYPT_ERROR,fatal:!1,error:a,reason:a.message,frag:t}),a}).then(a=>{const l=performance.now();s.trigger(I.FRAG_DECRYPTED,{frag:t,payload:a,stats:{tstart:o,tdecrypt:l}})}).catch(a=>{this.warn(`${a.name}: ${a.message}`),this.state=te.IDLE})}}doTick(){if(!this.media){this.state=te.IDLE;return}if(this.state===te.IDLE){const{currentTrackId:e,levels:t}=this,n=t==null?void 0:t[e];if(!n||!t.length||!n.details)return;const{config:i}=this,s=this.getLoadPosition(),o=Ve.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],s,i.maxBufferHole),{end:a,len:l}=o,A=this.getFwdBufferInfo(this.media,Ee.MAIN),c=n.details,u=this.getMaxBufferLength(A==null?void 0:A.len)+c.levelTargetDuration;if(l>u)return;const h=c.fragments,d=h.length,f=c.edge;let g=null;const p=this.fragPrevious;if(a<f){const C=i.maxFragLookUpTolerance,T=a>f-C?0:C;g=ms(p,h,Math.max(h[0].start,a),T),!g&&p&&p.start<h[0].start&&(g=h[0])}else g=h[d-1];if(!g)return;if(g=this.mapToInitFragWhenRequired(g),g.sn!=="initSegment"){const C=g.sn-c.startSN,T=h[C-1];T&&T.cc===g.cc&&this.fragmentTracker.getState(T)===ht.NOT_LOADED&&(g=T)}this.fragmentTracker.getState(g)===ht.NOT_LOADED&&this.loadFragment(g,n,a)}}getMaxBufferLength(e){const t=super.getMaxBufferLength();return e?Math.max(t,e):t}loadFragment(e,t,n){this.fragCurrent=e,e.sn==="initSegment"?this._loadInitSegment(e,t):(this.startFragRequested=!0,super.loadFragment(e,t,n))}get mediaBufferTimeRanges(){return new hI(this.tracksBuffered[this.currentTrackId]||[])}}class hI{constructor(e){this.buffered=void 0;const t=(n,i,s)=>{if(i=i>>>0,i>s-1)throw new DOMException(`Failed to execute '${n}' on 'TimeRanges': The index provided (${i}) is greater than the maximum bound (${s})`);return e[i][n]};this.buffered={get length(){return e.length},end(n){return t("end",n,e.length)},start(n){return t("start",n,e.length)}}}}class dI extends fa{constructor(e){super(e,"[subtitle-track-controller]"),this.media=null,this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.queuedDefaultTrack=-1,this.asyncPollTrackChange=()=>this.pollTrackChange(0),this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.onTextTracksChanged=()=>{if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let t=null;const n=us(this.media.textTracks);for(let s=0;s<n.length;s++)if(n[s].mode==="hidden")t=n[s];else if(n[s].mode==="showing"){t=n[s];break}const i=this.findTrackForTextTrack(t);this.subtitleTrack!==i&&this.setSubtitleTrack(i)},this.registerListeners()}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,this.onTextTracksChanged=this.asyncPollTrackChange=null,super.destroy()}get subtitleDisplay(){return this._subtitleDisplay}set subtitleDisplay(e){this._subtitleDisplay=e,this.trackId>-1&&this.toggleTrackModes()}registerListeners(){const{hls:e}=this;e.on(I.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(I.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(I.MANIFEST_LOADING,this.onManifestLoading,this),e.on(I.MANIFEST_PARSED,this.onManifestParsed,this),e.on(I.LEVEL_LOADING,this.onLevelLoading,this),e.on(I.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(I.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(I.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(I.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(I.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(I.MANIFEST_LOADING,this.onManifestLoading,this),e.off(I.MANIFEST_PARSED,this.onManifestParsed,this),e.off(I.LEVEL_LOADING,this.onLevelLoading,this),e.off(I.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(I.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(I.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.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.onTextTracksChanged,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),us(this.media.textTracks).forEach(t=>{mn(t)}),this.subtitleTrack=-1,this.media=null}onManifestLoading(){this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.subtitleTracks}onSubtitleTrackLoaded(e,t){const{id:n,groupId:i,details:s}=t,o=this.tracksInGroup[n];if(!o||o.groupId!==i){this.warn(`Subtitle track with id:${n} and group:${i} not found in active group ${o==null?void 0:o.groupId}`);return}const a=o.details;o.details=t.details,this.log(`Subtitle track ${n} "${o.name}" lang:${o.lang} group:${i} loaded [${s.startSN}-${s.endSN}]`),n===this.trackId&&this.playlistLoaded(n,t,a)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const n=t.subtitleGroups||null,i=this.groupIds;let s=this.currentTrack;if(!n||(i==null?void 0:i.length)!==(n==null?void 0:n.length)||n!=null&&n.some(o=>(i==null?void 0:i.indexOf(o))===-1)){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const o=this.tracks.filter(c=>!n||n.indexOf(c.groupId)!==-1);if(o.length)this.selectDefaultTrack&&!o.some(c=>c.default)&&(this.selectDefaultTrack=!1),o.forEach((c,u)=>{c.id=u});else if(!s&&!this.tracksInGroup.length)return;this.tracksInGroup=o;const a=this.hls.config.subtitlePreference;if(!s&&a){this.selectDefaultTrack=!1;const c=sr(a,o);if(c>-1)s=o[c];else{const u=sr(a,this.tracks);s=this.tracks[u]}}let l=this.findTrackId(s);l===-1&&s&&(l=this.findTrackId(null));const A={subtitleTracks:o};this.log(`Updating subtitle tracks, ${o.length} track(s) found in "${n==null?void 0:n.join(",")}" group-id`),this.hls.trigger(I.SUBTITLE_TRACKS_UPDATED,A),l!==-1&&this.trackId===-1&&this.setSubtitleTrack(l)}else this.shouldReloadPlaylist(s)&&this.setSubtitleTrack(this.trackId)}findTrackId(e){const t=this.tracksInGroup,n=this.selectDefaultTrack;for(let i=0;i<t.length;i++){const s=t[i];if(!(n&&!s.default||!n&&!e)&&(!e||Cn(s,e)))return i}if(e){for(let i=0;i<t.length;i++){const s=t[i];if(Tn(e.attrs,s.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return i}for(let i=0;i<t.length;i++){const s=t[i];if(Tn(e.attrs,s.attrs,["LANGUAGE"]))return i}}return-1}findTrackForTextTrack(e){if(e){const t=this.tracksInGroup;for(let n=0;n<t.length;n++){const i=t[n];if(xa(i,e))return n}}return-1}onError(e,t){t.fatal||!t.context||t.context.type===Oe.SUBTITLE_TRACK&&t.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(t.context.groupId)!==-1)&&this.checkRetry(t)}get allSubtitleTracks(){return this.tracks}get subtitleTracks(){return this.tracksInGroup}get subtitleTrack(){return this.trackId}set subtitleTrack(e){this.selectDefaultTrack=!1,this.setSubtitleTrack(e)}setSubtitleOption(e){if(this.hls.config.subtitlePreference=e,e){const t=this.allSubtitleTracks;if(this.selectDefaultTrack=!1,t.length){const n=this.currentTrack;if(n&&Cn(e,n))return n;const i=sr(e,this.tracksInGroup);if(i>-1){const s=this.tracksInGroup[i];return this.setSubtitleTrack(i),s}else{if(n)return null;{const s=sr(e,t);if(s>-1)return t[s]}}}}return null}loadPlaylist(e){super.loadPlaylist();const t=this.currentTrack;if(this.shouldLoadPlaylist(t)&&t){const n=t.id,i=t.groupId;let s=t.url;if(e)try{s=e.addDirectives(s)}catch(o){this.warn(`Could not construct new URL with HLS Delivery Directives: ${o}`)}this.log(`Loading subtitle playlist for id ${n}`),this.hls.trigger(I.SUBTITLE_TRACK_LOADING,{url:s,id:n,groupId:i,deliveryDirectives:e||null})}}toggleTrackModes(){const{media:e}=this;if(!e)return;const t=us(e.textTracks),n=this.currentTrack;let i;if(n&&(i=t.filter(s=>xa(n,s))[0],i||this.warn(`Unable to find subtitle TextTrack with name "${n.name}" and language "${n.lang}"`)),[].slice.call(t).forEach(s=>{s.mode!=="disabled"&&s!==i&&(s.mode="disabled")}),i){const s=this.subtitleDisplay?"showing":"hidden";i.mode!==s&&(i.mode=s)}}setSubtitleTrack(e){const t=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=e;return}if(e<-1||e>=t.length||!he(e)){this.warn(`Invalid subtitle track id: ${e}`);return}this.clearTimer(),this.selectDefaultTrack=!1;const n=this.currentTrack,i=t[e]||null;if(this.trackId=e,this.currentTrack=i,this.toggleTrackModes(),!i){this.hls.trigger(I.SUBTITLE_TRACK_SWITCH,{id:e});return}const s=!!i.details&&!i.details.live;if(e===this.trackId&&i===n&&s)return;this.log(`Switching to subtitle-track ${e}`+(i?` "${i.name}" lang:${i.lang} group:${i.groupId}`:""));const{id:o,groupId:a="",name:l,type:A,url:c}=i;this.hls.trigger(I.SUBTITLE_TRACK_SWITCH,{id:o,groupId:a,name:l,type:A,url:c});const u=this.switchParams(i.url,n==null?void 0:n.details,i.details);this.loadPlaylist(u)}}class fI{constructor(e){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=e}append(e,t,n){const i=this.queues[t];i.push(e),i.length===1&&!n&&this.executeNext(t)}insertAbort(e,t){this.queues[t].unshift(e),this.executeNext(t)}appendBlocker(e){let t;const n=new Promise(s=>{t=s}),i={execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};return this.append(i,e),n}executeNext(e){const t=this.queues[e];if(t.length){const n=t[0];try{n.execute()}catch(i){U.warn(`[buffer-operation-queue]: Exception executing "${e}" SourceBuffer operation: ${i}`),n.onError(i);const s=this.buffers[e];s!=null&&s.updating||this.shiftAndExecuteNext(e)}}}shiftAndExecuteNext(e){this.queues[e].shift(),this.executeNext(e)}current(e){return this.queues[e][0]}}const $u=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/;class gI{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.appendSource=void 0,this.appendErrors={audio:0,video:0,audiovideo:0},this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this.log=void 0,this.warn=void 0,this.error=void 0,this._onEndStreaming=n=>{this.hls&&this.hls.pauseBuffering()},this._onStartStreaming=n=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=()=>{const{media:n,mediaSource:i}=this;this.log("Media source opened"),n&&(n.removeEventListener("emptied",this._onMediaEmptied),this.updateMediaElementDuration(),this.hls.trigger(I.MEDIA_ATTACHED,{media:n,mediaSource:i})),i&&i.removeEventListener("sourceopen",this._onMediaSourceOpen),this.checkPendingTracks()},this._onMediaSourceClose=()=>{this.log("Media source closed")},this._onMediaSourceEnded=()=>{this.log("Media source ended")},this._onMediaEmptied=()=>{const{mediaSrc:n,_objectUrl:i}=this;n!==i&&U.error(`Media element src was set while attaching MediaSource (${i} > ${n})`)},this.hls=e;const t="[buffer-controller]";this.appendSource=Qm(qr(e.config.preferManagedMediaSource)),this.log=U.log.bind(U,t),this.warn=U.warn.bind(U,t),this.error=U.error.bind(U,t),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,this.hls=null}registerListeners(){const{hls:e}=this;e.on(I.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(I.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(I.MANIFEST_LOADING,this.onManifestLoading,this),e.on(I.MANIFEST_PARSED,this.onManifestParsed,this),e.on(I.BUFFER_RESET,this.onBufferReset,this),e.on(I.BUFFER_APPENDING,this.onBufferAppending,this),e.on(I.BUFFER_CODECS,this.onBufferCodecs,this),e.on(I.BUFFER_EOS,this.onBufferEos,this),e.on(I.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(I.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(I.FRAG_PARSED,this.onFragParsed,this),e.on(I.FRAG_CHANGED,this.onFragChanged,this)}unregisterListeners(){const{hls:e}=this;e.off(I.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(I.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(I.MANIFEST_LOADING,this.onManifestLoading,this),e.off(I.MANIFEST_PARSED,this.onManifestParsed,this),e.off(I.BUFFER_RESET,this.onBufferReset,this),e.off(I.BUFFER_APPENDING,this.onBufferAppending,this),e.off(I.BUFFER_CODECS,this.onBufferCodecs,this),e.off(I.BUFFER_EOS,this.onBufferEos,this),e.off(I.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(I.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(I.FRAG_PARSED,this.onFragParsed,this),e.off(I.FRAG_CHANGED,this.onFragChanged,this)}_initSourceBuffer(){this.sourceBuffer={},this.operationQueue=new fI(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]},this.appendErrors={audio:0,video:0,audiovideo:0},this.lastMpegAudioChunk=null}onManifestLoading(){this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=0,this.details=null}onManifestParsed(e,t){let n=2;(t.audio&&!t.video||!t.altAudio)&&(n=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=n,this.log(`${this.bufferCodecEventsExpected} bufferCodec event(s) expected`)}onMediaAttaching(e,t){const n=this.media=t.media,i=qr(this.appendSource);if(n&&i){var s;const o=this.mediaSource=new i;this.log(`created media source: ${(s=o.constructor)==null?void 0:s.name}`),o.addEventListener("sourceopen",this._onMediaSourceOpen),o.addEventListener("sourceended",this._onMediaSourceEnded),o.addEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(o.addEventListener("startstreaming",this._onStartStreaming),o.addEventListener("endstreaming",this._onEndStreaming));const a=this._objectUrl=self.URL.createObjectURL(o);if(this.appendSource)try{n.removeAttribute("src");const l=self.ManagedMediaSource;n.disableRemotePlayback=n.disableRemotePlayback||l&&o instanceof l,Yu(n),pI(n,a),n.load()}catch{n.src=a}else n.src=a;n.addEventListener("emptied",this._onMediaEmptied)}}onMediaDetaching(){const{media:e,mediaSource:t,_objectUrl:n}=this;if(t){if(this.log("media source detaching"),t.readyState==="open")try{t.endOfStream()}catch(i){this.warn(`onMediaDetaching: ${i.message} while calling endOfStream`)}this.onBufferReset(),t.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("sourceended",this._onMediaSourceEnded),t.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(t.removeEventListener("startstreaming",this._onStartStreaming),t.removeEventListener("endstreaming",this._onEndStreaming)),e&&(e.removeEventListener("emptied",this._onMediaEmptied),n&&self.URL.revokeObjectURL(n),this.mediaSrc===n?(e.removeAttribute("src"),this.appendSource&&Yu(e),e.load()):this.warn("media|source.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(I.MEDIA_DETACHED,void 0)}onBufferReset(){this.getSourceBufferTypes().forEach(e=>{this.resetBuffer(e)}),this._initSourceBuffer()}resetBuffer(e){const t=this.sourceBuffer[e];try{if(t){var n;this.removeBufferListeners(e),this.sourceBuffer[e]=void 0,(n=this.mediaSource)!=null&&n.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(t)}}catch(i){this.warn(`onBufferReset ${e}`,i)}}onBufferCodecs(e,t){const n=this.getSourceBufferTypes().length,i=Object.keys(t);if(i.forEach(o=>{if(n){const l=this.tracks[o];if(l&&typeof l.buffer.changeType=="function"){var a;const{id:A,codec:c,levelCodec:u,container:h,metadata:d}=t[o],f=Pc(l.codec,l.levelCodec),g=f==null?void 0:f.replace($u,"$1");let p=Pc(c,u);const C=(a=p)==null?void 0:a.replace($u,"$1");if(p&&g!==C){o.slice(0,5)==="audio"&&(p=cs(p,this.appendSource));const T=`${h};codecs=${p}`;this.appendChangeType(o,T),this.log(`switching codec ${f} to ${p}`),this.tracks[o]={buffer:l.buffer,codec:c,container:h,levelCodec:u,metadata:d,id:A}}}}else this.pendingTracks[o]=t[o]}),n)return;const s=Math.max(this.bufferCodecEventsExpected-1,0);this.bufferCodecEventsExpected!==s&&(this.log(`${s} bufferCodec event(s) expected ${i.join(",")}`),this.bufferCodecEventsExpected=s),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()}appendChangeType(e,t){const{operationQueue:n}=this,i={execute:()=>{const s=this.sourceBuffer[e];s&&(this.log(`changing ${e} sourceBuffer type to ${t}`),s.changeType(t)),n.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:s=>{this.warn(`Failed to change ${e} SourceBuffer type`,s)}};n.append(i,e,!!this.pendingTracks[e])}onBufferAppending(e,t){const{hls:n,operationQueue:i,tracks:s}=this,{data:o,type:a,frag:l,part:A,chunkMeta:c}=t,u=c.buffering[a],h=self.performance.now();u.start=h;const d=l.stats.buffering,f=A?A.stats.buffering:null;d.start===0&&(d.start=h),f&&f.start===0&&(f.start=h);const g=s.audio;let p=!1;a==="audio"&&(g==null?void 0:g.container)==="audio/mpeg"&&(p=!this.lastMpegAudioChunk||c.id===1||this.lastMpegAudioChunk.sn!==c.sn,this.lastMpegAudioChunk=c);const C=l.start,T={execute:()=>{if(u.executeStart=self.performance.now(),p){const b=this.sourceBuffer[a];if(b){const y=C-b.timestampOffset;Math.abs(y)>=.1&&(this.log(`Updating audio SourceBuffer timestampOffset to ${C} (delta: ${y}) sn: ${l.sn})`),b.timestampOffset=C)}}this.appendExecutor(o,a)},onStart:()=>{},onComplete:()=>{const b=self.performance.now();u.executeEnd=u.end=b,d.first===0&&(d.first=b),f&&f.first===0&&(f.first=b);const{sourceBuffer:y}=this,x={};for(const R in y)x[R]=Ve.getBuffered(y[R]);this.appendErrors[a]=0,a==="audio"||a==="video"?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(I.BUFFER_APPENDED,{type:a,frag:l,part:A,chunkMeta:c,parent:l.type,timeRanges:x})},onError:b=>{const y={type:ye.MEDIA_ERROR,parent:l.type,details:K.BUFFER_APPEND_ERROR,sourceBufferName:a,frag:l,part:A,chunkMeta:c,error:b,err:b,fatal:!1};if(b.code===DOMException.QUOTA_EXCEEDED_ERR)y.details=K.BUFFER_FULL_ERROR;else{const x=++this.appendErrors[a];y.details=K.BUFFER_APPEND_ERROR,this.warn(`Failed ${x}/${n.config.appendErrorMaxRetry} times to append segment in "${a}" sourceBuffer`),x>=n.config.appendErrorMaxRetry&&(y.fatal=!0)}n.trigger(I.ERROR,y)}};i.append(T,a,!!this.pendingTracks[a])}onBufferFlushing(e,t){const{operationQueue:n}=this,i=s=>({execute:this.removeExecutor.bind(this,s,t.startOffset,t.endOffset),onStart:()=>{},onComplete:()=>{this.hls.trigger(I.BUFFER_FLUSHED,{type:s})},onError:o=>{this.warn(`Failed to remove from ${s} SourceBuffer`,o)}});t.type?n.append(i(t.type),t.type):this.getSourceBufferTypes().forEach(s=>{n.append(i(s),s)})}onFragParsed(e,t){const{frag:n,part:i}=t,s=[],o=i?i.elementaryStreams:n.elementaryStreams;o[He.AUDIOVIDEO]?s.push("audiovideo"):(o[He.AUDIO]&&s.push("audio"),o[He.VIDEO]&&s.push("video"));const a=()=>{const l=self.performance.now();n.stats.buffering.end=l,i&&(i.stats.buffering.end=l);const A=i?i.stats:n.stats;this.hls.trigger(I.FRAG_BUFFERED,{frag:n,part:i,stats:A,id:n.type})};s.length===0&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${n.type} level: ${n.level} sn: ${n.sn}`),this.blockBuffers(a,s)}onFragChanged(e,t){this.trimBuffers()}onBufferEos(e,t){this.getSourceBufferTypes().reduce((i,s)=>{const o=this.sourceBuffer[s];return o&&(!t.type||t.type===s)&&(o.ending=!0,o.ended||(o.ended=!0,this.log(`${s} sourceBuffer now EOS`))),i&&!!(!o||o.ended)},!0)&&(this.log("Queueing mediaSource.endOfStream()"),this.blockBuffers(()=>{this.getSourceBufferTypes().forEach(s=>{const o=this.sourceBuffer[s];o&&(o.ending=!1)});const{mediaSource:i}=this;if(!i||i.readyState!=="open"){i&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${i.readyState}`);return}this.log("Calling mediaSource.endOfStream()"),i.endOfStream()}))}onLevelUpdated(e,{details:t}){t.fragments.length&&(this.details=t,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())}trimBuffers(){const{hls:e,details:t,media:n}=this;if(!n||t===null||!this.getSourceBufferTypes().length)return;const s=e.config,o=n.currentTime,a=t.levelTargetDuration,l=t.live&&s.liveBackBufferLength!==null?s.liveBackBufferLength:s.backBufferLength;if(he(l)&&l>0){const A=Math.max(l,a),c=Math.floor(o/a)*a-A;this.flushBackBuffer(o,a,c)}if(he(s.frontBufferFlushThreshold)&&s.frontBufferFlushThreshold>0){const A=Math.max(s.maxBufferLength,s.frontBufferFlushThreshold),c=Math.max(A,a),u=Math.floor(o/a)*a+c;this.flushFrontBuffer(o,a,u)}}flushBackBuffer(e,t,n){const{details:i,sourceBuffer:s}=this;this.getSourceBufferTypes().forEach(a=>{const l=s[a];if(l){const A=Ve.getBuffered(l);if(A.length>0&&n>A.start(0)){if(this.hls.trigger(I.BACK_BUFFER_REACHED,{bufferEnd:n}),i!=null&&i.live)this.hls.trigger(I.LIVE_BACK_BUFFER_REACHED,{bufferEnd:n});else if(l.ended&&A.end(A.length-1)-e<t*2){this.log(`Cannot flush ${a} back buffer while SourceBuffer is in ended state`);return}this.hls.trigger(I.BUFFER_FLUSHING,{startOffset:0,endOffset:n,type:a})}}})}flushFrontBuffer(e,t,n){const{sourceBuffer:i}=this;this.getSourceBufferTypes().forEach(o=>{const a=i[o];if(a){const l=Ve.getBuffered(a),A=l.length;if(A<2)return;const c=l.start(A-1),u=l.end(A-1);if(n>c||e>=c&&e<=u)return;if(a.ended&&e-u<2*t){this.log(`Cannot flush ${o} front buffer while SourceBuffer is in ended state`);return}this.hls.trigger(I.BUFFER_FLUSHING,{startOffset:c,endOffset:1/0,type:o})}})}updateMediaElementDuration(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;const{details:e,hls:t,media:n,mediaSource:i}=this,s=e.fragments[0].start+e.totalduration,o=n.duration,a=he(i.duration)?i.duration:0;e.live&&t.config.liveDurationInfinity?(i.duration=1/0,this.updateSeekableRange(e)):(s>a&&s>o||!he(o))&&(this.log(`Updating Media Source duration to ${s.toFixed(3)}`),i.duration=s)}updateSeekableRange(e){const t=this.mediaSource,n=e.fragments;if(n.length&&e.live&&t!=null&&t.setLiveSeekableRange){const s=Math.max(0,n[0].start),o=Math.max(s,s+e.totalduration);this.log(`Media Source duration is set to ${t.duration}. Setting seekable range to ${s}-${o}.`),t.setLiveSeekableRange(s,o)}}checkPendingTracks(){const{bufferCodecEventsExpected:e,operationQueue:t,pendingTracks:n}=this,i=Object.keys(n).length;if(i&&(!e||i===2||"audiovideo"in n)){this.createSourceBuffers(n),this.pendingTracks={};const s=this.getSourceBufferTypes();if(s.length)this.hls.trigger(I.BUFFER_CREATED,{tracks:this.tracks}),s.forEach(o=>{t.executeNext(o)});else{const o=new Error("could not create source buffer for media codec(s)");this.hls.trigger(I.ERROR,{type:ye.MEDIA_ERROR,details:K.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:o,reason:o.message})}}}createSourceBuffers(e){const{sourceBuffer:t,mediaSource:n}=this;if(!n)throw Error("createSourceBuffers called when mediaSource was null");for(const s in e)if(!t[s]){var i;const o=e[s];if(!o)throw Error(`source buffer exists for track ${s}, however track does not`);let a=((i=o.levelCodec)==null?void 0:i.indexOf(","))===-1?o.levelCodec:o.codec;a&&s.slice(0,5)==="audio"&&(a=cs(a,this.appendSource));const l=`${o.container};codecs=${a}`;this.log(`creating sourceBuffer(${l})`);try{const A=t[s]=n.addSourceBuffer(l),c=s;this.addBufferListener(c,"updatestart",this._onSBUpdateStart),this.addBufferListener(c,"updateend",this._onSBUpdateEnd),this.addBufferListener(c,"error",this._onSBUpdateError),this.appendSource&&this.addBufferListener(c,"bufferedchange",(u,h)=>{const d=h.removedRanges;d!=null&&d.length&&this.hls.trigger(I.BUFFER_FLUSHED,{type:s})}),this.tracks[s]={buffer:A,codec:a,container:o.container,levelCodec:o.levelCodec,metadata:o.metadata,id:o.id}}catch(A){this.error(`error while trying to add sourceBuffer: ${A.message}`),this.hls.trigger(I.ERROR,{type:ye.MEDIA_ERROR,details:K.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:A,sourceBufferName:s,mimeType:l})}}}get mediaSrc(){var e;const t=((e=this.media)==null?void 0:e.firstChild)||this.media;return t==null?void 0:t.src}_onSBUpdateStart(e){const{operationQueue:t}=this;t.current(e).onStart()}_onSBUpdateEnd(e){var t;if(((t=this.mediaSource)==null?void 0:t.readyState)==="closed"){this.resetBuffer(e);return}const{operationQueue:n}=this;n.current(e).onComplete(),n.shiftAndExecuteNext(e)}_onSBUpdateError(e,t){var n;const i=new Error(`${e} SourceBuffer error. MediaSource readyState: ${(n=this.mediaSource)==null?void 0:n.readyState}`);this.error(`${i}`,t),this.hls.trigger(I.ERROR,{type:ye.MEDIA_ERROR,details:K.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:i,fatal:!1});const s=this.operationQueue.current(e);s&&s.onError(i)}removeExecutor(e,t,n){const{media:i,mediaSource:s,operationQueue:o,sourceBuffer:a}=this,l=a[e];if(!i||!s||!l){this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`),o.shiftAndExecuteNext(e);return}const A=he(i.duration)?i.duration:1/0,c=he(s.duration)?s.duration:1/0,u=Math.max(0,t),h=Math.min(n,A,c);h>u&&(!l.ending||l.ended)?(l.ended=!1,this.log(`Removing [${u},${h}] from the ${e} SourceBuffer`),l.remove(u,h)):o.shiftAndExecuteNext(e)}appendExecutor(e,t){const n=this.sourceBuffer[t];if(!n){if(!this.pendingTracks[t])throw new Error(`Attempting to append to the ${t} SourceBuffer, but it does not exist`);return}n.ended=!1,n.appendBuffer(e)}blockBuffers(e,t=this.getSourceBufferTypes()){if(!t.length){this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(e);return}const{operationQueue:n}=this,i=t.map(s=>n.appendBlocker(s));Promise.all(i).then(()=>{e(),t.forEach(s=>{const o=this.sourceBuffer[s];o!=null&&o.updating||n.shiftAndExecuteNext(s)})})}getSourceBufferTypes(){return Object.keys(this.sourceBuffer)}addBufferListener(e,t,n){const i=this.sourceBuffer[e];if(!i)return;const s=n.bind(this,e);this.listeners[e].push({event:t,listener:s}),i.addEventListener(t,s)}removeBufferListeners(e){const t=this.sourceBuffer[e];t&&this.listeners[e].forEach(n=>{t.removeEventListener(n.event,n.listener)})}}function Yu(r){const e=r.querySelectorAll("source");[].slice.call(e).forEach(t=>{r.removeChild(t)})}function pI(r,e){const t=self.document.createElement("source");t.type="video/mp4",t.src=e,r.appendChild(t)}const mI={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},Vu=r=>String.fromCharCode(mI[r]||r),qt=15,vr=100,EI={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},II={17:2,18:4,21:6,22:8,23:10,19:13,20:15},CI={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},vI={25:2,26:4,29:6,30:8,31:10,27:13,28:15},yI=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class BI{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const n=typeof t=="function"?t():t;U.log(`${this.time} [${e}] ${n}`)}}}const Xr=function(e){const t=[];for(let n=0;n<e.length;n++)t.push(e[n].toString(16));return t};class Ku{constructor(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}reset(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}setStyles(e){const t=["foreground","underline","italics","background","flash"];for(let n=0;n<t.length;n++){const i=t[n];e.hasOwnProperty(i)&&(this[i]=e[i])}}isDefault(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash}equals(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash}copy(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash}toString(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}}class QI{constructor(){this.uchar=" ",this.penState=new Ku}reset(){this.uchar=" ",this.penState.reset()}setChar(e,t){this.uchar=e,this.penState.copy(t)}setPenState(e){this.penState.copy(e)}equals(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)}copy(e){this.uchar=e.uchar,this.penState.copy(e.penState)}isEmpty(){return this.uchar===" "&&this.penState.isDefault()}}class TI{constructor(e){this.chars=[],this.pos=0,this.currPenState=new Ku,this.cueStartTime=null,this.logger=void 0;for(let t=0;t<vr;t++)this.chars.push(new QI);this.logger=e}equals(e){for(let t=0;t<vr;t++)if(!this.chars[t].equals(e.chars[t]))return!1;return!0}copy(e){for(let t=0;t<vr;t++)this.chars[t].copy(e.chars[t])}isEmpty(){let e=!0;for(let t=0;t<vr;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e}setCursor(e){this.pos!==e&&(this.pos=e),this.pos<0?(this.logger.log(3,"Negative cursor position "+this.pos),this.pos=0):this.pos>vr&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=vr)}moveCursor(e){const t=this.pos+e;if(e>1)for(let n=this.pos+1;n<t+1;n++)this.chars[n].setPenState(this.currPenState);this.setCursor(t)}backSpace(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)}insertChar(e){e>=144&&this.backSpace();const t=Vu(e);if(this.pos>=vr){this.logger.log(0,()=>"Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1)}clearFromPos(e){let t;for(t=e;t<vr;t++)this.chars[t].reset()}clear(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()}clearToEndOfRow(){this.clearFromPos(this.pos)}getTextString(){const e=[];let t=!0;for(let n=0;n<vr;n++){const i=this.chars[n].uchar;i!==" "&&(t=!1),e.push(i)}return t?"":e.join("")}setPenStyles(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}}class wa{constructor(e){this.rows=[],this.currRow=qt-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let t=0;t<qt;t++)this.rows.push(new TI(e));this.logger=e}reset(){for(let e=0;e<qt;e++)this.rows[e].clear();this.currRow=qt-1}equals(e){let t=!0;for(let n=0;n<qt;n++)if(!this.rows[n].equals(e.rows[n])){t=!1;break}return t}copy(e){for(let t=0;t<qt;t++)this.rows[t].copy(e.rows[t])}isEmpty(){let e=!0;for(let t=0;t<qt;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e}backSpace(){this.rows[this.currRow].backSpace()}clearToEndOfRow(){this.rows[this.currRow].clearToEndOfRow()}insertChar(e){this.rows[this.currRow].insertChar(e)}setPen(e){this.rows[this.currRow].setPenStyles(e)}moveCursor(e){this.rows[this.currRow].moveCursor(e)}setCursor(e){this.logger.log(2,"setCursor: "+e),this.rows[this.currRow].setCursor(e)}setPAC(e){this.logger.log(2,()=>"pacData = "+JSON.stringify(e));let t=e.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(let a=0;a<qt;a++)this.rows[a].clear();const s=this.currRow+1-this.nrRollUpRows,o=this.lastOutputScreen;if(o){const a=o.rows[s].cueStartTime,l=this.logger.time;if(a!==null&&l!==null&&a<l)for(let A=0;A<this.nrRollUpRows;A++)this.rows[t-this.nrRollUpRows+A+1].copy(o.rows[s+A])}}this.currRow=t;const n=this.rows[this.currRow];if(e.indent!==null){const s=e.indent,o=Math.max(s-1,0);n.setCursor(e.indent),e.color=n.chars[o].penState.foreground}const i={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(i)}setBkgData(e){this.logger.log(2,()=>"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,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),this.logger.log(2,"Rolling up")}getDisplayText(e){e=e||!1;const t=[];let n="",i=-1;for(let s=0;s<qt;s++){const o=this.rows[s].getTextString();o&&(i=s+1,e?t.push("Row "+i+": '"+o+"'"):t.push(o.trim()))}return t.length>0&&(e?n="["+t.join(" | ")+"]":n=t.join(`
|
2477
|
+
`)),n}getTextAndFormat(){return this.rows}}class Ju{constructor(e,t,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=t,this.mode=null,this.verbose=0,this.displayedMemory=new wa(n),this.nonDisplayedMemory=new wa(n),this.lastOutputScreen=new wa(n),this.currRollUpRow=this.displayedMemory.rows[qt-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[qt-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;n<e.length;n++)this.writeScreen.insertChar(e[n]);const t=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(2,()=>t+": "+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 t={flash:!1};if(t.underline=e%2===1,t.italics=e>=46,t.italics)t.foreground="white";else{const n=Math.floor(e/2)-16,i=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=i[n]}this.logger.log(2,"MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)}outputDataUpdate(e=!1){const t=this.logger.time;t!==null&&this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=t:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t),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 Wu{constructor(e,t,n){this.channels=void 0,this.currentChannel=0,this.cmdHistory=xI(),this.logger=void 0;const i=this.logger=new BI;this.channels=[null,new Ju(e,t,i),new Ju(e+1,n,i)]}getHandler(e){return this.channels[e].getHandler()}setHandler(e,t){this.channels[e].setHandler(t)}addData(e,t){this.logger.time=e;for(let n=0;n<t.length;n+=2){const i=t[n]&127,s=t[n+1]&127;let o=!1,a=null;if(i===0&&s===0)continue;this.logger.log(3,()=>"["+Xr([t[n],t[n+1]])+"] -> ("+Xr([i,s])+")");const l=this.cmdHistory;if(i>=16&&i<=31){if(bI(i,s,l)){ws(null,null,l),this.logger.log(3,()=>"Repeated command ("+Xr([i,s])+") is dropped");continue}ws(i,s,this.cmdHistory),o=this.parseCmd(i,s),o||(o=this.parseMidrow(i,s)),o||(o=this.parsePAC(i,s)),o||(o=this.parseBackgroundAttributes(i,s))}else ws(null,null,l);if(!o&&(a=this.parseChars(i,s),a)){const c=this.currentChannel;c&&c>0?this.channels[c].insertChars(a):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!o&&!a&&this.logger.log(2,()=>"Couldn't parse cleaned data "+Xr([i,s])+" orig: "+Xr([t[n],t[n+1]]))}}parseCmd(e,t){const n=(e===20||e===28||e===21||e===29)&&t>=32&&t<=47,i=(e===23||e===31)&&t>=33&&t<=35;if(!(n||i))return!1;const s=e===20||e===21||e===23?1:2,o=this.channels[s];return e===20||e===21||e===28||e===29?t===32?o.ccRCL():t===33?o.ccBS():t===34?o.ccAOF():t===35?o.ccAON():t===36?o.ccDER():t===37?o.ccRU(2):t===38?o.ccRU(3):t===39?o.ccRU(4):t===40?o.ccFON():t===41?o.ccRDC():t===42?o.ccTR():t===43?o.ccRTD():t===44?o.ccEDM():t===45?o.ccCR():t===46?o.ccENM():t===47&&o.ccEOC():o.ccTO(t-32),this.currentChannel=s,!0}parseMidrow(e,t){let n=0;if((e===17||e===25)&&t>=32&&t<=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(t),this.logger.log(3,()=>"MIDROW ("+Xr([e,t])+")"),!0):!1}return!1}parsePAC(e,t){let n;const i=(e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127,s=(e===16||e===24)&&t>=64&&t<=95;if(!(i||s))return!1;const o=e<=23?1:2;t>=64&&t<=95?n=o===1?EI[e]:CI[e]:n=o===1?II[e]:vI[e];const a=this.channels[o];return a?(a.setPAC(this.interpretPAC(n,t)),this.currentChannel=o,!0):!1}interpretPAC(e,t){let n;const i={color:null,italics:!1,indent:null,underline:!1,row:e};return t>95?n=t-96:n=t-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,t){let n,i=null,s=null;if(e>=25?(n=2,s=e-8):(n=1,s=e),s>=17&&s<=19){let o;s===17?o=t+80:s===18?o=t+112:o=t+144,this.logger.log(2,()=>"Special char '"+Vu(o)+"' in channel "+n),i=[o]}else e>=32&&e<=127&&(i=t===0?[e]:[e,t]);return i&&this.logger.log(3,()=>"Char codes = "+Xr(i).join(",")),i}parseBackgroundAttributes(e,t){const n=(e===16||e===24)&&t>=32&&t<=47,i=(e===23||e===31)&&t>=45&&t<=47;if(!(n||i))return!1;let s;const o={};e===16||e===24?(s=Math.floor((t-32)/2),o.background=yI[s],t%2===1&&(o.background=o.background+"_semi")):t===45?o.background="transparent":(o.foreground="black",t===47&&(o.underline=!0));const a=e<=23?1:2;return this.channels[a].setBkgData(o),!0}reset(){for(let e=0;e<Object.keys(this.channels).length;e++){const t=this.channels[e];t&&t.reset()}ws(null,null,this.cmdHistory)}cueSplitAtTime(e){for(let t=0;t<this.channels.length;t++){const n=this.channels[t];n&&n.cueSplitAtTime(e)}}}function ws(r,e,t){t.a=r,t.b=e}function bI(r,e,t){return t.a===r&&t.b===e}function xI(){return{a:null,b:null}}class Ss{constructor(e,t){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=e,this.trackName=t}dispatchCue(){this.startTime!==null&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)}newCue(e,t,n){(this.startTime===null||this.startTime>e)&&(this.startTime=e),this.endTime=t,this.screen=n,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}var Sa=function(){if(pn!=null&&pn.VTTCue)return self.VTTCue;const r=["","lr","rl"],e=["start","middle","end","left","right"];function t(a,l){if(typeof l!="string"||!Array.isArray(a))return!1;const A=l.toLowerCase();return~a.indexOf(A)?A:!1}function n(a){return t(r,a)}function i(a){return t(e,a)}function s(a,...l){let A=1;for(;A<arguments.length;A++){const c=arguments[A];for(const u in c)a[u]=c[u]}return a}function o(a,l,A){const c=this,u={enumerable:!0};c.hasBeenReset=!1;let h="",d=!1,f=a,g=l,p=A,C=null,T="",b=!0,y="auto",x="start",R=50,k="middle",$=50,V="middle";Object.defineProperty(c,"id",s({},u,{get:function(){return h},set:function(O){h=""+O}})),Object.defineProperty(c,"pauseOnExit",s({},u,{get:function(){return d},set:function(O){d=!!O}})),Object.defineProperty(c,"startTime",s({},u,{get:function(){return f},set:function(O){if(typeof O!="number")throw new TypeError("Start time must be set to a number.");f=O,this.hasBeenReset=!0}})),Object.defineProperty(c,"endTime",s({},u,{get:function(){return g},set:function(O){if(typeof O!="number")throw new TypeError("End time must be set to a number.");g=O,this.hasBeenReset=!0}})),Object.defineProperty(c,"text",s({},u,{get:function(){return p},set:function(O){p=""+O,this.hasBeenReset=!0}})),Object.defineProperty(c,"region",s({},u,{get:function(){return C},set:function(O){C=O,this.hasBeenReset=!0}})),Object.defineProperty(c,"vertical",s({},u,{get:function(){return T},set:function(O){const J=n(O);if(J===!1)throw new SyntaxError("An invalid or illegal string was specified.");T=J,this.hasBeenReset=!0}})),Object.defineProperty(c,"snapToLines",s({},u,{get:function(){return b},set:function(O){b=!!O,this.hasBeenReset=!0}})),Object.defineProperty(c,"line",s({},u,{get:function(){return y},set:function(O){if(typeof O!="number"&&O!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");y=O,this.hasBeenReset=!0}})),Object.defineProperty(c,"lineAlign",s({},u,{get:function(){return x},set:function(O){const J=i(O);if(!J)throw new SyntaxError("An invalid or illegal string was specified.");x=J,this.hasBeenReset=!0}})),Object.defineProperty(c,"position",s({},u,{get:function(){return R},set:function(O){if(O<0||O>100)throw new Error("Position must be between 0 and 100.");R=O,this.hasBeenReset=!0}})),Object.defineProperty(c,"positionAlign",s({},u,{get:function(){return k},set:function(O){const J=i(O);if(!J)throw new SyntaxError("An invalid or illegal string was specified.");k=J,this.hasBeenReset=!0}})),Object.defineProperty(c,"size",s({},u,{get:function(){return $},set:function(O){if(O<0||O>100)throw new Error("Size must be between 0 and 100.");$=O,this.hasBeenReset=!0}})),Object.defineProperty(c,"align",s({},u,{get:function(){return V},set:function(O){const J=i(O);if(!J)throw new SyntaxError("An invalid or illegal string was specified.");V=J,this.hasBeenReset=!0}})),c.displayState=void 0}return o.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},o}();class wI{decode(e,t){if(!e)return"";if(typeof e!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function qu(r){function e(n,i,s,o){return(n|0)*3600+(i|0)*60+(s|0)+parseFloat(o||0)}const t=r.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return t?parseFloat(t[2])>59?e(t[2],t[3],0,t[4]):e(t[1],t[2],t[3],t[4]):null}class SI{constructor(){this.values=Object.create(null)}set(e,t){!this.get(e)&&t!==""&&(this.values[e]=t)}get(e,t,n){return n?this.has(e)?this.values[e]:t[n]:this.has(e)?this.values[e]:t}has(e){return e in this.values}alt(e,t,n){for(let i=0;i<n.length;++i)if(t===n[i]){this.set(e,t);break}}integer(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))}percent(e,t){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(t)){const n=parseFloat(t);if(n>=0&&n<=100)return this.set(e,n),!0}return!1}}function Xu(r,e,t,n){const i=n?r.split(n):[r];for(const s in i){if(typeof i[s]!="string")continue;const o=i[s].split(t);if(o.length!==2)continue;const a=o[0],l=o[1];e(a,l)}}const Ra=new Sa(0,0,""),Rs=Ra.align==="middle"?"middle":"center";function RI(r,e,t){const n=r;function i(){const a=qu(r);if(a===null)throw new Error("Malformed timestamp: "+n);return r=r.replace(/^[^\sa-zA-Z-]+/,""),a}function s(a,l){const A=new SI;Xu(a,function(h,d){let f;switch(h){case"region":for(let g=t.length-1;g>=0;g--)if(t[g].id===d){A.set(h,t[g].region);break}break;case"vertical":A.alt(h,d,["rl","lr"]);break;case"line":f=d.split(","),A.integer(h,f[0]),A.percent(h,f[0])&&A.set("snapToLines",!1),A.alt(h,f[0],["auto"]),f.length===2&&A.alt("lineAlign",f[1],["start",Rs,"end"]);break;case"position":f=d.split(","),A.percent(h,f[0]),f.length===2&&A.alt("positionAlign",f[1],["start",Rs,"end","line-left","line-right","auto"]);break;case"size":A.percent(h,d);break;case"align":A.alt(h,d,["start",Rs,"end","left","right"]);break}},/:/,/\s/),l.region=A.get("region",null),l.vertical=A.get("vertical","");let c=A.get("line","auto");c==="auto"&&Ra.line===-1&&(c=-1),l.line=c,l.lineAlign=A.get("lineAlign","start"),l.snapToLines=A.get("snapToLines",!0),l.size=A.get("size",100),l.align=A.get("align",Rs);let u=A.get("position","auto");u==="auto"&&Ra.position===50&&(u=l.align==="start"||l.align==="left"?0:l.align==="end"||l.align==="right"?100:50),l.position=u}function o(){r=r.replace(/^\s+/,"")}if(o(),e.startTime=i(),o(),r.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+n);r=r.slice(3),o(),e.endTime=i(),o(),s(r,e)}function ju(r){return r.replace(/<br(?: \/)?>/gi,`
|
2478
2478
|
`)}class DI{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new wI,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(e){const t=this;e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));function n(){let s=t.buffer,o=0;for(s=ju(s);o<s.length&&s[o]!=="\r"&&s[o]!==`
|
2479
2479
|
`;)++o;const a=s.slice(0,o);return s[o]==="\r"&&++o,s[o]===`
|
2480
|
-
`&&++o,t.buffer=s.slice(o),a}function i(s){Xu(s,function(o,a){},/:/)}try{let s="";if(t.state==="INITIAL"){if(!/\r\n|\n/.test(t.buffer))return this;s=n();const a=s.match(/^()?WEBVTT([ \t].*)?$/);if(!(a!=null&&a[0]))throw new Error("Malformed WebVTT signature.");t.state="HEADER"}let o=!1;for(;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(o?o=!1:s=n(),t.state){case"HEADER":/:/.test(s)?i(s):s||(t.state="ID");continue;case"NOTE":s||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(s)){t.state="NOTE";break}if(!s)continue;if(t.cue=new
|
2480
|
+
`&&++o,t.buffer=s.slice(o),a}function i(s){Xu(s,function(o,a){},/:/)}try{let s="";if(t.state==="INITIAL"){if(!/\r\n|\n/.test(t.buffer))return this;s=n();const a=s.match(/^()?WEBVTT([ \t].*)?$/);if(!(a!=null&&a[0]))throw new Error("Malformed WebVTT signature.");t.state="HEADER"}let o=!1;for(;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(o?o=!1:s=n(),t.state){case"HEADER":/:/.test(s)?i(s):s||(t.state="ID");continue;case"NOTE":s||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(s)){t.state="NOTE";break}if(!s)continue;if(t.cue=new Sa(0,0,""),t.state="CUE",s.indexOf("-->")===-1){t.cue.id=s;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{RI(s,t.cue,t.regionList)}catch{t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{const a=s.indexOf("-->")!==-1;if(!s||a&&(o=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(t.cue===null)continue;t.cue.text&&(t.cue.text+=`
|
2481
2481
|
`),t.cue.text+=s}continue;case"BADCUE":s||(t.state="ID")}}}catch{t.state==="CUETEXT"&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state=t.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this}flush(){const e=this;try{if((e.cue||e.state==="HEADER")&&(e.buffer+=`
|
2482
2482
|
|
2483
|
-
`,e.parse()),e.state==="INITIAL"||e.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(t){e.onparsingerror&&e.onparsingerror(t)}return e.onflush&&e.onflush(),this}}const _I=/\r\n|\n\r|\n|\r/g,
|
2483
|
+
`,e.parse()),e.state==="INITIAL"||e.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(t){e.onparsingerror&&e.onparsingerror(t)}return e.onflush&&e.onflush(),this}}const _I=/\r\n|\n\r|\n|\r/g,Da=function(e,t,n=0){return e.slice(n,n+t.length)===t},LI=function(e){let t=parseInt(e.slice(-3));const n=parseInt(e.slice(-6,-4)),i=parseInt(e.slice(-9,-7)),s=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!he(t)||!he(n)||!he(i)||!he(s))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*n,t+=60*1e3*i,t+=60*60*1e3*s,t},_a=function(e){let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return(t>>>0).toString()};function La(r,e,t){return _a(r.toString())+_a(e.toString())+_a(t)}const FI=function(e,t,n){let i=e[t],s=e[i.prevCC];if(!s||!s.new&&i.new){e.ccOffset=e.presentationOffset=i.start,i.new=!1;return}for(;(o=s)!=null&&o.new;){var o;e.ccOffset+=i.start-s.start,i.new=!1,i=s,s=e[i.prevCC]}e.presentationOffset=n};function kI(r,e,t,n,i,s,o){const a=new DI,l=tr(new Uint8Array(r)).trim().replace(_I,`
|
2484
2484
|
`).split(`
|
2485
|
-
`),
|
2486
|
-
`)}),a.flush()}const
|
2487
|
-
`:(s=n.childNodes)!=null&&s.length?rh(n,e):e?t+n.textContent.trim().replace(/\s+/g," "):t+n.textContent},"")}function PI(r,e,t){const n="http://www.w3.org/ns/ttml#styling";let i=null;const s=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],o=r!=null&&r.hasAttribute("style")?r.getAttribute("style"):null;return o&&t.hasOwnProperty(o)&&(i=t[o]),s.reduce((a,A)=>{const l=ka(e,n,A)||ka(r,n,A)||ka(i,n,A);return l&&(a[A]=l),a},{})}function ka(r,e,t){return r&&r.hasAttributeNS(e,t)?r.getAttributeNS(e,t):null}function nh(r){return new Error(`Could not parse ttml timestamp ${r}`)}function Na(r,e){if(!r)return null;let t=qu(r);return t===null&&(zu.test(r)?t=OI(r,e):Zu.test(r)&&(t=UI(r,e))),t}function OI(r,e){const t=zu.exec(r),n=(t[4]|0)+(t[5]|0)/e.subFrameRate;return(t[1]|0)*3600+(t[2]|0)*60+(t[3]|0)+n/e.frameRate}function UI(r,e){const t=Zu.exec(r),n=Number(t[1]);switch(t[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 GI{constructor(e){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.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=oh(),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}},e.on(I.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(I.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(I.MANIFEST_LOADING,this.onManifestLoading,this),e.on(I.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(I.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(I.FRAG_LOADING,this.onFragLoading,this),e.on(I.FRAG_LOADED,this.onFragLoaded,this),e.on(I.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(I.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(I.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(I.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(I.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(I.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(I.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(I.MANIFEST_LOADING,this.onManifestLoading,this),e.off(I.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(I.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(I.FRAG_LOADING,this.onFragLoading,this),e.off(I.FRAG_LOADED,this.onFragLoaded,this),e.off(I.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(I.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(I.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(I.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(I.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){if(this.config.enableCEA708Captions&&(!this.cea608Parser1||!this.cea608Parser2)){const e=new Ss(this,"textTrack1"),t=new Ss(this,"textTrack2"),n=new Ss(this,"textTrack3"),i=new Ss(this,"textTrack4");this.cea608Parser1=new Wu(1,e,t),this.cea608Parser2=new Wu(3,n,i)}}addCues(e,t,n,i,s){let o=!1;for(let a=s.length;a--;){const A=s[a],l=HI(A[0],A[1],t,n);if(l>=0&&(A[0]=Math.min(A[0],t),A[1]=Math.max(A[1],n),o=!0,l/(n-t)>.5))return}if(o||s.push([t,n]),this.config.renderTextTracksNatively){const a=this.captionsTracks[e];this.Cues.newCue(a,t,n,i)}else{const a=this.Cues.newCue(null,t,n,i);this.hls.trigger(I.CUES_PARSED,{type:"captions",cues:a,track:e})}}onInitPtsFound(e,{frag:t,id:n,initPTS:i,timescale:s}){const{unparsedVttFrags:o}=this;n==="main"&&(this.initPTS[t.cc]={baseTime:i,timescale:s}),o.length&&(this.unparsedVttFrags=[],o.forEach(a=>{this.onFragLoaded(I.FRAG_LOADED,a)}))}getExistingTrack(e,t){const{media:n}=this;if(n)for(let i=0;i<n.textTracks.length;i++){const s=n.textTracks[i];if(sh(s,{name:e,lang:t,attrs:{}}))return s}return null}createCaptionsTrack(e){this.config.renderTextTracksNatively?this.createNativeTrack(e):this.createNonNativeTrack(e)}createNativeTrack(e){if(this.captionsTracks[e])return;const{captionsProperties:t,captionsTracks:n,media:i}=this,{label:s,languageCode:o}=t[e],a=this.getExistingTrack(s,o);if(a)n[e]=a,mn(n[e]),qc(n[e],i);else{const A=this.createTextTrack("captions",s,o);A&&(A[e]=!0,n[e]=A)}}createNonNativeTrack(e){if(this.nonNativeCaptionsTracks[e])return;const t=this.captionsProperties[e];if(!t)return;const n=t.label,i={_id:e,label:n,kind:"captions",default:t.media?!!t.media.default:!1,closedCaptions:t.media};this.nonNativeCaptionsTracks[e]=i,this.hls.trigger(I.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[i]})}createTextTrack(e,t,n){const i=this.media;if(i)return i.addTextTrack(e,t,n)}onMediaAttaching(e,t){this.media=t.media,this._cleanTracks()}onMediaDetaching(){const{captionsTracks:e}=this;Object.keys(e).forEach(t=>{mn(e[t]),delete e[t]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=oh(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){const{media:e}=this;if(!e)return;const t=e.textTracks;if(t)for(let n=0;n<t.length;n++)mn(t[n])}onSubtitleTracksUpdated(e,t){const n=t.subtitleTracks||[],i=n.some(s=>s.textCodec===La);if(this.config.enableWebVTT||i&&this.config.enableIMSC1){if(Uu(this.tracks,n)){this.tracks=n;return}if(this.textTracks=[],this.tracks=n,this.config.renderTextTracksNatively){const o=this.media,a=o?us(o.textTracks):null;if(this.tracks.forEach((A,l)=>{let c;if(a){let u=null;for(let h=0;h<a.length;h++)if(a[h]&&sh(a[h],A)){u=a[h],a[h]=null;break}u&&(c=u)}if(c)mn(c);else{const u=ih(A);c=this.createTextTrack(u,A.name,A.lang),c&&(c.mode="disabled")}c&&this.textTracks.push(c)}),a!=null&&a.length){const A=a.filter(l=>l!==null).map(l=>l.label);A.length&&U.warn(`Media element contains unused subtitle tracks: ${A.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const o=this.tracks.map(a=>({label:a.name,kind:a.type.toLowerCase(),default:a.default,subtitleTrack:a}));this.hls.trigger(I.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:o})}}}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach(n=>{const i=/(?:CC|SERVICE)([1-4])/.exec(n.instreamId);if(!i)return;const s=`textTrack${i[1]}`,o=this.captionsProperties[s];o&&(o.label=n.name,n.lang&&(o.languageCode=n.lang),o.media=n)})}closedCaptionsForLevel(e){const t=this.hls.levels[e.level];return t==null?void 0:t.attrs["CLOSED-CAPTIONS"]}onFragLoading(e,t){if(this.enabled&&t.frag.type===Ee.MAIN){var n,i;const{cea608Parser1:s,cea608Parser2:o,lastSn:a}=this,{cc:A,sn:l}=t.frag,c=(n=(i=t.part)==null?void 0:i.index)!=null?n:-1;s&&o&&(l!==a+1||l===a&&c!==this.lastPartIndex+1||A!==this.lastCc)&&(s.reset(),o.reset()),this.lastCc=A,this.lastSn=l,this.lastPartIndex=c}}onFragLoaded(e,t){const{frag:n,payload:i}=t;if(n.type===Ee.SUBTITLE)if(i.byteLength){const s=n.decryptdata,o="stats"in t;if(s==null||!s.encrypted||o){const a=this.tracks[n.level],A=this.vttCCs;A[n.cc]||(A[n.cc]={start:n.start,prevCC:this.prevCC,new:!0},this.prevCC=n.cc),a&&a.textCodec===La?this._parseIMSC1(n,i):this._parseVTTs(t)}}else this.hls.trigger(I.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const n=this.hls;eh(t,this.initPTS[e.cc],i=>{this._appendCues(i,e.level),n.trigger(I.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},i=>{U.log(`Failed to parse IMSC1: ${i}`),n.trigger(I.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:i})})}_parseVTTs(e){var t;const{frag:n,payload:i}=e,{initPTS:s,unparsedVttFrags:o}=this,a=s.length-1;if(!s[n.cc]&&a===-1){o.push(e);return}const A=this.hls,l=(t=n.initSegment)!=null&&t.data?Ot(n.initSegment.data,new Uint8Array(i)):i;kI(l,this.initPTS[n.cc],this.vttCCs,n.cc,n.start,c=>{this._appendCues(c,n.level),A.trigger(I.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})},c=>{const u=c.message==="Missing initPTS for VTT MPEGTS";u?o.push(e):this._fallbackToIMSC1(n,i),U.log(`Failed to parse VTT cue: ${c}`),!(u&&a>n.cc)&&A.trigger(I.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:c})})}_fallbackToIMSC1(e,t){const n=this.tracks[e.level];n.textCodec||eh(t,this.initPTS[e.cc],()=>{n.textCodec=La,this._parseIMSC1(e,t)},()=>{n.textCodec="wvtt"})}_appendCues(e,t){const n=this.hls;if(this.config.renderTextTracksNatively){const i=this.textTracks[t];if(!i||i.mode==="disabled")return;e.forEach(s=>Xc(i,s))}else{const i=this.tracks[t];if(!i)return;const s=i.default?"default":"subtitles"+t;n.trigger(I.CUES_PARSED,{type:"subtitles",cues:e,track:s})}}onFragDecrypted(e,t){const{frag:n}=t;n.type===Ee.SUBTITLE&&this.onFragLoaded(I.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){this.initCea608Parsers();const{cea608Parser1:n,cea608Parser2:i}=this;if(!this.enabled||!n||!i)return;const{frag:s,samples:o}=t;if(!(s.type===Ee.MAIN&&this.closedCaptionsForLevel(s)==="NONE"))for(let a=0;a<o.length;a++){const A=o[a].bytes;if(A){const l=this.extractCea608Data(A);n.addData(o[a].pts,l[0]),i.addData(o[a].pts,l[1])}}}onBufferFlushing(e,{startOffset:t,endOffset:n,endOffsetSubtitles:i,type:s}){const{media:o}=this;if(!(!o||o.currentTime<n)){if(!s||s==="video"){const{captionsTracks:a}=this;Object.keys(a).forEach(A=>sa(a[A],t,n))}if(this.config.renderTextTracksNatively&&t===0&&i!==void 0){const{textTracks:a}=this;Object.keys(a).forEach(A=>sa(a[A],t,i))}}}extractCea608Data(e){const t=[[],[]],n=e[0]&31;let i=2;for(let s=0;s<n;s++){const o=e[i++],a=127&e[i++],A=127&e[i++];if(a===0&&A===0)continue;if((4&o)!==0){const c=3&o;(c===0||c===1)&&(t[c].push(a),t[c].push(A))}}return t}}function ih(r){return r.characteristics&&/transcribes-spoken-dialog/gi.test(r.characteristics)&&/describes-music-and-sound/gi.test(r.characteristics)?"captions":"subtitles"}function sh(r,e){return!!r&&r.kind===ih(e)&&ba(e,r)}function HI(r,e,t,n){return Math.min(e,n)-Math.max(r,t)}function oh(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}class Ma{constructor(e){this.hls=void 0,this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.clientRect=void 0,this.streamController=void 0,this.hls=e,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}setStreamController(e){this.streamController=e}destroy(){this.hls&&this.unregisterListener(),this.timer&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null}registerListeners(){const{hls:e}=this;e.on(I.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(I.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(I.MANIFEST_PARSED,this.onManifestParsed,this),e.on(I.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(I.BUFFER_CODECS,this.onBufferCodecs,this),e.on(I.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:e}=this;e.off(I.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(I.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(I.MANIFEST_PARSED,this.onManifestParsed,this),e.off(I.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(I.BUFFER_CODECS,this.onBufferCodecs,this),e.off(I.MEDIA_DETACHING,this.onMediaDetaching,this)}onFpsDropLevelCapping(e,t){const n=this.hls.levels[t.droppedLevel];this.isLevelAllowed(n)&&this.restrictedLevels.push({bitrate:n.bitrate,height:n.height,width:n.width})}onMediaAttaching(e,t){this.media=t.media instanceof HTMLVideoElement?t.media:null,this.clientRect=null,this.timer&&this.hls.levels.length&&this.detectPlayerSize()}onManifestParsed(e,t){const n=this.hls;this.restrictedLevels=[],this.firstLevel=t.firstLevel,n.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onLevelsUpdated(e,t){this.timer&&he(this.autoLevelCapping)&&this.detectPlayerSize()}onBufferCodecs(e,t){this.hls.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onMediaDetaching(){this.stopCapping()}detectPlayerSize(){if(this.media){if(this.mediaHeight<=0||this.mediaWidth<=0){this.clientRect=null;return}const e=this.hls.levels;if(e.length){const t=this.hls,n=this.getMaxLevel(e.length-1);n!==this.autoLevelCapping&&U.log(`Setting autoLevelCapping to ${n}: ${e[n].height}p@${e[n].bitrate} for media ${this.mediaWidth}x${this.mediaHeight}`),t.autoLevelCapping=n,t.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}getMaxLevel(e){const t=this.hls.levels;if(!t.length)return-1;const n=t.filter((i,s)=>this.isLevelAllowed(i)&&s<=e);return this.clientRect=null,Ma.getMaxLevelByMediaSize(n,this.mediaWidth,this.mediaHeight)}startCapping(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,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,t={width:0,height:0};if(e){const n=e.getBoundingClientRect();t.width=n.width,t.height=n.height,!t.width&&!t.height&&(t.width=n.right-n.left||e.width||0,t.height=n.bottom-n.top||e.height||0)}return this.clientRect=t,t}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,t,n){if(!(e!=null&&e.length))return-1;const i=(a,A)=>A?a.width!==A.width||a.height!==A.height:!0;let s=e.length-1;const o=Math.max(t,n);for(let a=0;a<e.length;a+=1){const A=e[a];if((A.width>=o||A.height>=o)&&i(A,e[a+1])){s=a;break}}return s}}class $I{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(I.MEDIA_ATTACHING,this.onMediaAttaching,this)}unregisterListeners(){this.hls.off(I.MEDIA_ATTACHING,this.onMediaAttaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,t){const n=this.hls.config;if(n.capLevelOnFPSDrop){const i=t.media instanceof self.HTMLVideoElement?t.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,t,n){const i=performance.now();if(t){if(this.lastTime){const s=i-this.lastTime,o=n-this.lastDroppedFrames,a=t-this.lastDecodedFrames,A=1e3*o/s,l=this.hls;if(l.trigger(I.FPS_DROP,{currentDropped:o,currentDecoded:a,totalDroppedFrames:n}),A>0&&o>l.config.fpsDroppedMonitoringThreshold*a){let c=l.currentLevel;U.warn("drop FPS ratio greater than max allowed value for currentLevel: "+c),c>0&&(l.autoLevelCapping===-1||l.autoLevelCapping>=c)&&(c=c-1,l.trigger(I.FPS_DROP_LEVEL_CAPPING,{level:c,droppedLevel:l.currentLevel}),l.autoLevelCapping=c,this.streamController.nextLevelSwitch())}}this.lastTime=i,this.lastDroppedFrames=n,this.lastDecodedFrames=t}}checkFPSInterval(){const e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){const t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}}const Ds="[eme]";class bn{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=bn.CDMCleanupPromise?[bn.CDMCleanupPromise]:[],this.onMediaEncrypted=this._onMediaEncrypted.bind(this),this.onWaitingForKey=this._onWaitingForKey.bind(this),this.debug=U.debug.bind(U,Ds),this.log=U.log.bind(U,Ds),this.warn=U.warn.bind(U,Ds),this.error=U.error.bind(U,Ds),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(I.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(I.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(I.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(I.MANIFEST_LOADED,this.onManifestLoaded,this)}unregisterListeners(){this.hls.off(I.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(I.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(I.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(I.MANIFEST_LOADED,this.onManifestLoaded,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:n}=this.config,i=t[e];if(i)return i.licenseUrl;if(e===Je.WIDEVINE&&n)return n;throw new Error(`no license server URL configured for key-system "${e}"`)}getServerCertificateUrl(e){const{drmSystems:t}=this.config,n=t[e];if(n)return n.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const t=this.hls.levels,n=(o,a,A)=>!!o&&A.indexOf(o)===a,i=t.map(o=>o.audioCodec).filter(n),s=t.map(o=>o.videoCodec).filter(n);return i.length+s.length===0&&s.push("avc1.42e01e"),new Promise((o,a)=>{const A=l=>{const c=l.shift();this.getMediaKeysPromise(c,i,s).then(u=>o({keySystem:c,mediaKeys:u})).catch(u=>{l.length?A(l):u instanceof Gt?a(u):a(new Gt({type:ye.KEY_SYSTEM_ERROR,details:V.KEY_SYSTEM_NO_ACCESS,error:u,fatal:!0},u.message))})};A(e)})}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:n}=this.config;if(typeof n!="function"){let i=`Configured requestMediaKeySystemAccess is not a function ${n}`;return Cc===null&&self.location.protocol==="http:"&&(i=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(i))}return n(e,t)}getMediaKeysPromise(e,t,n){const i=Xp(e,t,n,this.config.drmSystemOptions),s=this.keySystemAccessPromises[e];let o=s==null?void 0:s.keySystemAccess;if(!o){this.log(`Requesting encrypted media "${e}" key-system access with config: ${JSON.stringify(i)}`),o=this.requestMediaKeySystemAccess(e,i);const a=this.keySystemAccessPromises[e]={keySystemAccess:o};return o.catch(A=>{this.log(`Failed to obtain access to key-system "${e}": ${A}`)}),o.then(A=>{this.log(`Access for key-system "${A.keySystem}" obtained`);const l=this.fetchServerCertificate(e);return this.log(`Create media-keys for "${e}"`),a.mediaKeys=A.createMediaKeys().then(c=>(this.log(`Media-keys created for "${e}"`),l.then(u=>u?this.setMediaKeysServerCertificate(c,e,u):c))),a.mediaKeys.catch(c=>{this.error(`Failed to create media-keys for "${e}"}: ${c}`)}),a.mediaKeys})}return o.then(()=>s.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:n}){this.log(`Creating key-system session "${t}" keyId: ${rr.hexDump(e.keyId||[])}`);const i=n.createSession(),s={decryptdata:e,keySystem:t,mediaKeys:n,mediaKeysSession:i,keyStatus:"status-pending"};return this.mediaKeySessions.push(s),s}renewKeySession(e){const t=e.decryptdata;if(t.pssh){const n=this.createMediaKeySessionContext(e),i=this.getKeyIdString(t),s="cenc";this.keyIdToKeySessionPromise[i]=this.generateRequestWithPreferredKeySession(n,s,t.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 rr.hexDump(e.keyId)}updateKeySession(e,t){var n;const i=e.mediaKeysSession;return this.log(`Updating key-session "${i.sessionId}" for keyID ${rr.hexDump(((n=e.decryptdata)==null?void 0:n.keyId)||[])}
|
2488
|
-
} (data length: ${t&&t.byteLength})`),i.update(t)}selectKeySystemFormat(e){const t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise}getKeyFormatPromise(e){return new Promise((t,n)=>{const i=qo(this.config),s=e.map(mc).filter(o=>!!o&&i.indexOf(o)!==-1);return this.getKeySystemSelectionPromise(s).then(({keySystem:o})=>{const a=Ic(o);a?t(a):n(new Error(`Unable to find format for key-system "${o}"`))}).catch(n)})}loadKey(e){const t=e.keyInfo.decryptdata,n=this.getKeyIdString(t),i=`(keyId: ${n} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${i}`);let s=this.keyIdToKeySessionPromise[n];return s||(s=this.keyIdToKeySessionPromise[n]=this.getKeySystemForKeyPromise(t).then(({keySystem:o,mediaKeys:a})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${i}`),this.attemptSetMediaKeys(o,a).then(()=>{this.throwIfDestroyed();const A=this.createMediaKeySessionContext({keySystem:o,mediaKeys:a,decryptdata:t});return this.generateRequestWithPreferredKeySession(A,"cenc",t.pssh,"playlist-key")}))),s.catch(o=>this.handleError(o))),s}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e){this.hls&&(this.error(e.message),e instanceof Gt?this.hls.trigger(I.ERROR,e.data):this.hls.trigger(I.ERROR,{type:ye.KEY_SYSTEM_ERROR,details:V.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}getKeySystemForKeyPromise(e){const t=this.getKeyIdString(e),n=this.keyIdToKeySessionPromise[t];if(!n){const i=mc(e.keyFormat),s=i?[i]:qo(this.config);return this.attemptKeySystemAccess(s)}return n}getKeySystemSelectionPromise(e){if(e.length||(e=qo(this.config)),e.length===0)throw new Gt({type:ye.KEY_SYSTEM_ERROR,details:V.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:t,initData:n}=e;if(this.debug(`"${e.type}" event: init data type: "${t}"`),n===null)return;let i,s;if(t==="sinf"&&this.config.drmSystems[Je.FAIRPLAY]){const c=lt(new Uint8Array(n));try{const u=Jo(JSON.parse(c).sinf),h=Sc(new Uint8Array(u));if(!h)return;i=h.subarray(8,24),s=Je.FAIRPLAY}catch{this.warn('Failed to parse sinf "encrypted" event message initData');return}}else{const c=vm(n);if(c===null)return;c.version===0&&c.systemId===Ec.WIDEVINE&&c.data&&(i=c.data.subarray(8,24)),s=qp(c.systemId)}if(!s||!i)return;const o=rr.hexDump(i),{keyIdToKeySessionPromise:a,mediaKeySessions:A}=this;let l=a[o];for(let c=0;c<A.length;c++){const u=A[c],h=u.decryptdata;if(h.pssh||!h.keyId)continue;const d=rr.hexDump(h.keyId);if(o===d||h.uri.replace(/-/g,"").indexOf(o)!==-1){l=a[d],delete a[d],h.pssh=new Uint8Array(n),h.keyId=i,l=a[o]=l.then(()=>this.generateRequestWithPreferredKeySession(u,t,n,"encrypted-event-key-match"));break}}l||(l=a[o]=this.getKeySystemSelectionPromise([s]).then(({keySystem:c,mediaKeys:u})=>{var h;this.throwIfDestroyed();const d=new ai("ISO-23001-7",o,(h=Ic(c))!=null?h:"");return d.pssh=new Uint8Array(n),d.keyId=i,this.attemptSetMediaKeys(c,u).then(()=>{this.throwIfDestroyed();const f=this.createMediaKeySessionContext({decryptdata:d,keySystem:c,mediaKeys:u});return this.generateRequestWithPreferredKeySession(f,t,n,"encrypted-event-no-match")})})),l.catch(c=>this.handleError(c))}_onWaitingForKey(e){this.log(`"${e.type}" event`)}attemptSetMediaKeys(e,t){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(t)});return this.setMediaKeysQueue.push(i),i.then(()=>{this.log(`Media-keys set for "${e}"`),n.push(i),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(s=>n.indexOf(s)===-1)})}generateRequestWithPreferredKeySession(e,t,n,i){var s,o;const a=(s=this.config.drmSystems)==null||(o=s[e.keySystem])==null?void 0:o.generateRequest;if(a)try{const f=a.call(this.hls,t,n,e);if(!f)throw new Error("Invalid response from configured generateRequest filter");t=f.initDataType,n=e.decryptdata.pssh=f.initData?new Uint8Array(f.initData):null}catch(f){var A;if(this.warn(f.message),(A=this.hls)!=null&&A.config.debug)throw f}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: ${t} length: ${n?n.byteLength:null})`);const c=new Ta,u=e._onmessage=f=>{const g=e.mediaKeysSession;if(!g){c.emit("error",new Error("invalid state"));return}const{messageType:p,message:v}=f;this.log(`"${p}" message event for session "${g.sessionId}" message size: ${v.byteLength}`),p==="license-request"||p==="license-renewal"?this.renewLicense(e,v).catch(T=>{this.handleError(T),c.emit("error",T)}):p==="license-release"?e.keySystem===Je.FAIRPLAY&&(this.updateKeySession(e,Wo("acknowledged")),this.removeSession(e)):this.warn(`unhandled media key message type "${p}"`)},h=e._onkeystatuseschange=f=>{if(!e.mediaKeysSession){c.emit("error",new Error("invalid state"));return}this.onKeyStatusChange(e);const p=e.keyStatus;c.emit("keyStatus",p),p==="expired"&&(this.warn(`${e.keySystem} expired for key ${l}`),this.renewKeySession(e))};e.mediaKeysSession.addEventListener("message",u),e.mediaKeysSession.addEventListener("keystatuseschange",h);const d=new Promise((f,g)=>{c.on("error",g),c.on("keyStatus",p=>{p.startsWith("usable")?f():p==="output-restricted"?g(new Gt({type:ye.KEY_SYSTEM_ERROR,details:V.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):p==="internal-error"?g(new Gt({type:ye.KEY_SYSTEM_ERROR,details:V.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${p}"`)):p==="expired"?g(new Error("key expired while generating request")):this.warn(`unhandled key status change "${p}"`)})});return e.mediaKeysSession.generateRequest(t,n).then(()=>{var f;this.log(`Request generated for key-session "${(f=e.mediaKeysSession)==null?void 0:f.sessionId}" keyId: ${l}`)}).catch(f=>{throw new Gt({type:ye.KEY_SYSTEM_ERROR,details:V.KEY_SYSTEM_NO_SESSION,error:f,fatal:!1},`Error generating key-session request: ${f}`)}).then(()=>d).catch(f=>{throw c.removeAllListeners(),this.removeSession(e),f}).then(()=>(c.removeAllListeners(),e))}onKeyStatusChange(e){e.mediaKeysSession.keyStatuses.forEach((t,n)=>{this.log(`key status change "${t}" for keyStatuses keyId: ${rr.hexDump("buffer"in n?new Uint8Array(n.buffer,n.byteOffset,n.byteLength):new Uint8Array(n))} session keyId: ${rr.hexDump(new Uint8Array(e.decryptdata.keyId||[]))} uri: ${e.decryptdata.uri}`),e.keyStatus=t})}fetchServerCertificate(e){const t=this.config,n=t.loader,i=new n(t),s=this.getServerCertificateUrl(e);return s?(this.log(`Fetching server certificate for "${e}"`),new Promise((o,a)=>{const A={responseType:"arraybuffer",url:s},l=t.certLoadPolicy.default,c={loadPolicy:l,timeout:l.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},u={onSuccess:(h,d,f,g)=>{o(h.data)},onError:(h,d,f,g)=>{a(new Gt({type:ye.KEY_SYSTEM_ERROR,details:V.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:f,response:ut({url:A.url,data:void 0},h)},`"${e}" certificate request failed (${s}). Status: ${h.code} (${h.text})`))},onTimeout:(h,d,f)=>{a(new Gt({type:ye.KEY_SYSTEM_ERROR,details:V.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:f,response:{url:A.url,data:void 0}},`"${e}" certificate request timed out (${s})`))},onAbort:(h,d,f)=>{a(new Error("aborted"))}};i.load(A,c,u)})):Promise.resolve()}setMediaKeysServerCertificate(e,t,n){return new Promise((i,s)=>{e.setServerCertificate(n).then(o=>{this.log(`setServerCertificate ${o?"success":"not supported by CDM"} (${n==null?void 0:n.byteLength}) on "${t}"`),i(e)}).catch(o=>{s(new Gt({type:ye.KEY_SYSTEM_ERROR,details:V.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:o,fatal:!0},o.message))})})}renewLicense(e,t){return this.requestLicense(e,new Uint8Array(t)).then(n=>this.updateKeySession(e,new Uint8Array(n)).catch(i=>{throw new Gt({type:ye.KEY_SYSTEM_ERROR,details:V.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:i,fatal:!0},i.message)}))}unpackPlayReadyKeyMessage(e,t){const n=String.fromCharCode.apply(null,new Uint16Array(t.buffer));if(!n.includes("PlayReadyKeyMessage"))return e.setRequestHeader("Content-Type","text/xml; charset=utf-8"),t;const i=new DOMParser().parseFromString(n,"application/xml"),s=i.querySelectorAll("HttpHeader");if(s.length>0){let c;for(let u=0,h=s.length;u<h;u++){var o,a;c=s[u];const d=(o=c.querySelector("name"))==null?void 0:o.textContent,f=(a=c.querySelector("value"))==null?void 0:a.textContent;d&&f&&e.setRequestHeader(d,f)}}const A=i.querySelector("Challenge"),l=A==null?void 0:A.textContent;if(!l)throw new Error("Cannot find <Challenge> in key message");return Wo(atob(l))}setupLicenseXHR(e,t,n,i){const s=this.config.licenseXhrSetup;return s?Promise.resolve().then(()=>{if(!n.decryptdata)throw new Error("Key removed");return s.call(this.hls,e,t,n,i)}).catch(o=>{if(!n.decryptdata)throw o;return e.open("POST",t,!0),s.call(this.hls,e,t,n,i)}).then(o=>(e.readyState||e.open("POST",t,!0),{xhr:e,licenseChallenge:o||i})):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:i}))}requestLicense(e,t){const n=this.config.keyLoadPolicy.default;return new Promise((i,s)=>{const o=this.getLicenseServerUrl(e.keySystem);this.log(`Sending license request to URL: ${o}`);const a=new XMLHttpRequest;a.responseType="arraybuffer",a.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return s(new Error("invalid state"));if(a.readyState===4)if(a.status===200){this._requestLicenseFailureCount=0;let A=a.response;this.log(`License received ${A instanceof ArrayBuffer?A.byteLength:A}`);const l=this.config.licenseResponseCallback;if(l)try{A=l.call(this.hls,a,o,e)}catch(c){this.error(c)}i(A)}else{const A=n.errorRetry,l=A?A.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>l||a.status>=400&&a.status<500)s(new Gt({type:ye.KEY_SYSTEM_ERROR,details:V.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:a,response:{url:o,data:void 0,code:a.status,text:a.statusText}},`License Request XHR failed (${o}). Status: ${a.status} (${a.statusText})`));else{const c=l-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${c} attempts left`),this.requestLicense(e,t).then(i,s)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=a,this.setupLicenseXHR(a,o,e,t).then(({xhr:A,licenseChallenge:l})=>{e.keySystem==Je.PLAYREADY&&(l=this.unpackPlayReadyKeyMessage(A,l)),A.send(l)})})}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const n=t.media;this.media=n,n.addEventListener("encrypted",this.onMediaEncrypted),n.addEventListener("waitingforkey",this.onWaitingForKey)}onMediaDetached(){const e=this.media,t=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={},ai.clearKeyUriToKeyIdMap();const n=t.length;bn.CDMCleanupPromise=Promise.all(t.map(i=>this.removeSession(i)).concat(e==null?void 0:e.setMediaKeys(null).catch(i=>{this.log(`Could not clear media keys: ${i}`)}))).then(()=>{n&&(this.log("finished closing key sessions and clearing media keys"),t.length=0)}).catch(i=>{this.log(`Could not close sessions and clear media keys: ${i}`)})}onManifestLoading(){this.keyFormatPromise=null}onManifestLoaded(e,{sessionKeys:t}){if(!(!t||!this.config.emeEnabled)&&!this.keyFormatPromise){const n=t.reduce((i,s)=>(i.indexOf(s.keyFormat)===-1&&i.push(s.keyFormat),i),[]);this.log(`Selecting key-system from session-keys ${n.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(n)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:n}=e;if(t){this.log(`Remove licenses and keys and close session ${t.sessionId}`),e._onmessage&&(t.removeEventListener("message",e._onmessage),e._onmessage=void 0),e._onkeystatuseschange&&(t.removeEventListener("keystatuseschange",e._onkeystatuseschange),e._onkeystatuseschange=void 0),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),t.remove().catch(s=>{this.log(`Could not remove session: ${s}`)}).then(()=>t.close()).catch(s=>{this.log(`Could not close session: ${s}`)})}}}bn.CDMCleanupPromise=void 0;class Gt extends Error{constructor(e,t){super(t),this.data=void 0,e.error||(e.error=new Error(t)),this.data=e,e.err=e.error}}var Bt;(function(r){r.MANIFEST="m",r.AUDIO="a",r.VIDEO="v",r.MUXED="av",r.INIT="i",r.CAPTION="c",r.TIMED_TEXT="tt",r.KEY="k",r.OTHER="o"})(Bt||(Bt={}));var Pa;(function(r){r.DASH="d",r.HLS="h",r.SMOOTH="s",r.OTHER="o"})(Pa||(Pa={}));var Xr;(function(r){r.OBJECT="CMCD-Object",r.REQUEST="CMCD-Request",r.SESSION="CMCD-Session",r.STATUS="CMCD-Status"})(Xr||(Xr={}));const YI={[Xr.OBJECT]:["br","d","ot","tb"],[Xr.REQUEST]:["bl","dl","mtp","nor","nrr","su"],[Xr.SESSION]:["cid","pr","sf","sid","st","v"],[Xr.STATUS]:["bs","rtp"]};class xn{constructor(e,t){this.value=void 0,this.params=void 0,Array.isArray(e)&&(e=e.map(n=>n instanceof xn?n:new xn(n))),this.value=e,this.params=t}}class ah{constructor(e){this.description=void 0,this.description=e}}const VI="Dict";function KI(r){return Array.isArray(r)?JSON.stringify(r):r instanceof Map?"Map{}":r instanceof Set?"Set{}":typeof r=="object"?JSON.stringify(r):String(r)}function JI(r,e,t,n){return new Error(`failed to ${r} "${KI(e)}" as ${t}`,{cause:n})}const Ah="Bare Item",WI="Boolean",qI="Byte Sequence",XI="Decimal",jI="Integer";function zI(r){return r<-999999999999999||999999999999999<r}const ZI=/[\x00-\x1f\x7f]+/,eC="Token",tC="Key";function ar(r,e,t){return JI("serialize",r,e,t)}function rC(r){if(typeof r!="boolean")throw ar(r,WI);return r?"?1":"?0"}function nC(r){return btoa(String.fromCharCode(...r))}function iC(r){if(ArrayBuffer.isView(r)===!1)throw ar(r,qI);return`:${nC(r)}:`}function lh(r){if(zI(r))throw ar(r,jI);return r.toString()}function sC(r){return`@${lh(r.getTime()/1e3)}`}function ch(r,e){if(r<0)return-ch(-r,e);const t=Math.pow(10,e);if(Math.abs(r*t%1-.5)<Number.EPSILON){const i=Math.floor(r*t);return(i%2===0?i:i+1)/t}else return Math.round(r*t)/t}function oC(r){const e=ch(r,3);if(Math.floor(Math.abs(e)).toString().length>12)throw ar(r,XI);const t=e.toString();return t.includes(".")?t:`${t}.0`}const aC="String";function AC(r){if(ZI.test(r))throw ar(r,aC);return`"${r.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function lC(r){return r.description||r.toString().slice(7,-1)}function uh(r){const e=lC(r);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e)===!1)throw ar(e,eC);return e}function Oa(r){switch(typeof r){case"number":if(!he(r))throw ar(r,Ah);return Number.isInteger(r)?lh(r):oC(r);case"string":return AC(r);case"symbol":return uh(r);case"boolean":return rC(r);case"object":if(r instanceof Date)return sC(r);if(r instanceof Uint8Array)return iC(r);if(r instanceof ah)return uh(r);default:throw ar(r,Ah)}}function Ua(r){if(/^[a-z*][a-z0-9\-_.*]*$/.test(r)===!1)throw ar(r,tC);return r}function Ga(r){return r==null?"":Object.entries(r).map(([e,t])=>t===!0?`;${Ua(e)}`:`;${Ua(e)}=${Oa(t)}`).join("")}function hh(r){return r instanceof xn?`${Oa(r.value)}${Ga(r.params)}`:Oa(r)}function cC(r){return`(${r.value.map(hh).join(" ")})${Ga(r.params)}`}function uC(r,e={whitespace:!0}){if(typeof r!="object")throw ar(r,VI);const t=r instanceof Map?r.entries():Object.entries(r),n=e!=null&&e.whitespace?" ":"";return Array.from(t).map(([i,s])=>{s instanceof xn||(s=new xn(s));let o=Ua(i);return s.value===!0?o+=Ga(s.params):(o+="=",Array.isArray(s.value)?o+=cC(s):o+=hh(s)),o}).join(`,${n}`)}function hC(r,e){return uC(r,e)}const dC=r=>r==="ot"||r==="sf"||r==="st",fC=r=>typeof r=="number"?he(r):r!=null&&r!==""&&r!==!1;function gC(r,e){const t=new URL(r),n=new URL(e);if(t.origin!==n.origin)return r;const i=t.pathname.split("/").slice(1),s=n.pathname.split("/").slice(1,-1);for(;i[0]===s[0];)i.shift(),s.shift();for(;s.length;)s.shift(),i.unshift("..");return i.join("/")}function pC(){try{return crypto.randomUUID()}catch{try{const e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.slice(t.lastIndexOf("/")+1)}catch{let t=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,i=>{const s=(t+Math.random()*16)%16|0;return t=Math.floor(t/16),(i=="x"?s:s&3|8).toString(16)})}}}const _s=r=>Math.round(r),mC=(r,e)=>(e!=null&&e.baseUrl&&(r=gC(r,e.baseUrl)),encodeURIComponent(r)),Ls=r=>_s(r/100)*100,EC={br:_s,d:_s,bl:Ls,dl:Ls,mtp:Ls,nor:mC,rtp:Ls,tb:_s};function IC(r,e){const t={};if(r==null||typeof r!="object")return t;const n=Object.keys(r).sort(),i=st({},EC,e==null?void 0:e.formatters),s=e==null?void 0:e.filter;return n.forEach(o=>{if(s!=null&&s(o))return;let a=r[o];const A=i[o];A&&(a=A(a,e)),!(o==="v"&&a===1)&&(o=="pr"&&a===1||fC(a)&&(dC(o)&&typeof a=="string"&&(a=new ah(a)),t[o]=a))}),t}function dh(r,e={}){return r?hC(IC(r,e),st({whitespace:!1},e)):""}function CC(r,e={}){if(!r)return{};const t=Object.entries(r),n=Object.entries(YI).concat(Object.entries((e==null?void 0:e.customHeaderMap)||{})),i=t.reduce((s,o)=>{var a,A;const[l,c]=o,u=((a=n.find(h=>h[1].includes(l)))==null?void 0:a[0])||Xr.REQUEST;return(A=s[u])!=null||(s[u]={}),s[u][l]=c,s},{});return Object.entries(i).reduce((s,[o,a])=>(s[o]=dh(a,e),s),{})}function vC(r,e,t){return st(r,CC(e,t))}const yC="CMCD";function BC(r,e={}){if(!r)return"";const t=dh(r,e);return`${yC}=${encodeURIComponent(t)}`}const fh=/CMCD=[^&#]+/;function QC(r,e,t){const n=BC(e,t);if(!n)return r;if(fh.test(r))return r.replace(fh,n);const i=r.includes("?")?"&":"?";return`${r}${i}${n}`}class TC{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.includeKeys=void 0,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:Bt.MANIFEST,su:!this.initialized})}catch(s){U.warn("Could not generate manifest CMCD data.",s)}},this.applyFragmentData=i=>{try{const s=i.frag,o=this.hls.levels[s.level],a=this.getObjectType(s),A={d:s.duration*1e3,ot:a};(a===Bt.VIDEO||a===Bt.AUDIO||a==Bt.MUXED)&&(A.br=o.bitrate/1e3,A.tb=this.getTopBandwidth(a)/1e3,A.bl=this.getBufferLength(a)),this.apply(i,A)}catch(s){U.warn("Could not generate segment CMCD data.",s)}},this.hls=e;const t=this.config=e.config,{cmcd:n}=t;n!=null&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=n.sessionId||pC(),this.cid=n.contentId,this.useHeaders=n.useHeaders===!0,this.includeKeys=n.includeKeys,this.registerListeners())}registerListeners(){const e=this.hls;e.on(I.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(I.MEDIA_DETACHED,this.onMediaDetached,this),e.on(I.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(I.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(I.MEDIA_DETACHED,this.onMediaDetached,this),e.off(I.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null,this.onWaiting=this.onPlaying=null}onMediaAttached(e,t){this.media=t.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,t){var n,i;this.audioBuffer=(n=t.tracks.audio)==null?void 0:n.buffer,this.videoBuffer=(i=t.tracks.video)==null?void 0:i.buffer}createData(){var e;return{v:1,sf:Pa.HLS,sid:this.sid,cid:this.cid,pr:(e=this.media)==null?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,t={}){st(t,this.createData());const n=t.ot===Bt.INIT||t.ot===Bt.VIDEO||t.ot===Bt.MUXED;this.starved&&n&&(t.bs=!0,t.su=!0,this.starved=!1),t.su==null&&(t.su=this.buffering);const{includeKeys:i}=this;i&&(t=Object.keys(t).reduce((s,o)=>(i.includes(o)&&(s[o]=t[o]),s),{})),this.useHeaders?(e.headers||(e.headers={}),vC(e.headers,t)):e.url=QC(e.url,t)}getObjectType(e){const{type:t}=e;if(t==="subtitle")return Bt.TIMED_TEXT;if(e.sn==="initSegment")return Bt.INIT;if(t==="audio")return Bt.AUDIO;if(t==="main")return this.hls.audioTracks.length?Bt.VIDEO:Bt.MUXED}getTopBandwidth(e){let t=0,n;const i=this.hls;if(e===Bt.AUDIO)n=i.audioTracks;else{const s=i.maxAutoLevel,o=s>-1?s+1:i.levels.length;n=i.levels.slice(0,o)}for(const s of n)s.bitrate>t&&(t=s.bitrate);return t>0?t:NaN}getBufferLength(e){const t=this.hls.media,n=e===Bt.AUDIO?this.audioBuffer:this.videoBuffer;return!n||!t?NaN:Ve.bufferInfo(n,t.currentTime,this.config.maxBufferHole).len*1e3}createPlaylistLoader(){const{pLoader:e}=this.config,t=this.applyPlaylistData,n=e||this.config.loader;return class{constructor(s){this.loader=void 0,this.loader=new n(s)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(s,o,a){t(s),this.loader.load(s,o,a)}}}createFragmentLoader(){const{fLoader:e}=this.config,t=this.applyFragmentData,n=e||this.config.loader;return class{constructor(s){this.loader=void 0,this.loader=new n(s)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(s,o,a){t(s),this.loader.load(s,o,a)}}}}const bC=3e5;class xC{constructor(e){this.hls=void 0,this.log=void 0,this.loader=null,this.uri=null,this.pathwayId=".",this.pathwayPriority=null,this.timeToLoad=300,this.reloadTimer=-1,this.updated=0,this.started=!1,this.enabled=!0,this.levels=null,this.audioTracks=null,this.subtitleTracks=null,this.penalizedPathways={},this.hls=e,this.log=U.log.bind(U,"[content-steering]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(I.MANIFEST_LOADING,this.onManifestLoading,this),e.on(I.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(I.MANIFEST_PARSED,this.onManifestParsed,this),e.on(I.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(I.MANIFEST_LOADING,this.onManifestLoading,this),e.off(I.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(I.MANIFEST_PARSED,this.onManifestParsed,this),e.off(I.ERROR,this.onError,this))}startLoad(){if(this.started=!0,this.clearTimeout(),this.enabled&&this.uri){if(this.updated){const e=this.timeToLoad*1e3-(performance.now()-this.updated);if(e>0){this.scheduleRefresh(this.uri,e);return}}this.loadSteeringManifest(this.uri)}}stopLoad(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),this.clearTimeout()}clearTimeout(){this.reloadTimer!==-1&&(self.clearTimeout(this.reloadTimer),this.reloadTimer=-1)}destroy(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null}removeLevel(e){const t=this.levels;t&&(this.levels=t.filter(n=>n!==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,t){const{contentSteering:n}=t;n!==null&&(this.pathwayId=n.pathwayId,this.uri=n.uri,this.started&&this.startLoad())}onManifestParsed(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks}onError(e,t){const{errorAction:n}=t;if((n==null?void 0:n.action)===It.SendAlternateToPenaltyBox&&n.flags===Wt.MoveAllAlternatesMatchingHost){const i=this.levels;let s=this.pathwayPriority,o=this.pathwayId;if(t.context){const{groupId:a,pathwayId:A,type:l}=t.context;a&&i?o=this.getPathwayForGroupId(a,l,o):A&&(o=A)}o in this.penalizedPathways||(this.penalizedPathways[o]=performance.now()),!s&&i&&(s=i.reduce((a,A)=>(a.indexOf(A.pathwayId)===-1&&a.push(A.pathwayId),a),[])),s&&s.length>1&&(this.updatePathwayPriority(s),n.resolved=this.pathwayId!==o),n.resolved||U.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${o} levels: ${i&&i.length} priorities: ${JSON.stringify(s)} penalized: ${JSON.stringify(this.penalizedPathways)}`)}}filterParsedLevels(e){this.levels=e;let t=this.getLevelsForPathway(this.pathwayId);if(t.length===0){const n=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${n}"`),t=this.getLevelsForPathway(n),this.pathwayId=n}return t.length!==e.length?(this.log(`Found ${t.length}/${e.length} levels in Pathway "${this.pathwayId}"`),t):e}getLevelsForPathway(e){return this.levels===null?[]:this.levels.filter(t=>e===t.pathwayId)}updatePathwayPriority(e){this.pathwayPriority=e;let t;const n=this.penalizedPathways,i=performance.now();Object.keys(n).forEach(s=>{i-n[s]>bC&&delete n[s]});for(let s=0;s<e.length;s++){const o=e[s];if(o in n)continue;if(o===this.pathwayId)return;const a=this.hls.nextLoadLevel,A=this.hls.levels[a];if(t=this.getLevelsForPathway(o),t.length>0){this.log(`Setting Pathway to "${o}"`),this.pathwayId=o,su(t),this.hls.trigger(I.LEVELS_UPDATED,{levels:t});const l=this.hls.levels[a];A&&l&&this.levels&&(l.attrs["STABLE-VARIANT-ID"]!==A.attrs["STABLE-VARIANT-ID"]&&l.bitrate!==A.bitrate&&this.log(`Unstable Pathways change from bitrate ${A.bitrate} to ${l.bitrate}`),this.hls.nextLoadLevel=a);break}}}getPathwayForGroupId(e,t,n){const i=this.getLevelsForPathway(n).concat(this.levels||[]);for(let s=0;s<i.length;s++)if(t===Oe.AUDIO_TRACK&&i[s].hasAudioGroup(e)||t===Oe.SUBTITLE_TRACK&&i[s].hasSubtitleGroup(e))return i[s].pathwayId;return n}clonePathways(e){const t=this.levels;if(!t)return;const n={},i={};e.forEach(s=>{const{ID:o,"BASE-ID":a,"URI-REPLACEMENT":A}=s;if(t.some(c=>c.pathwayId===o))return;const l=this.getLevelsForPathway(a).map(c=>{const u=new Xe(c.attrs);u["PATHWAY-ID"]=o;const h=u.AUDIO&&`${u.AUDIO}_clone_${o}`,d=u.SUBTITLES&&`${u.SUBTITLES}_clone_${o}`;h&&(n[u.AUDIO]=h,u.AUDIO=h),d&&(i[u.SUBTITLES]=d,u.SUBTITLES=d);const f=ph(c.uri,u["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",A),g=new En({attrs:u,audioCodec:c.audioCodec,bitrate:c.bitrate,height:c.height,name:c.name,url:f,videoCodec:c.videoCodec,width:c.width});if(c.audioGroups)for(let p=1;p<c.audioGroups.length;p++)g.addGroupId("audio",`${c.audioGroups[p]}_clone_${o}`);if(c.subtitleGroups)for(let p=1;p<c.subtitleGroups.length;p++)g.addGroupId("text",`${c.subtitleGroups[p]}_clone_${o}`);return g});t.push(...l),gh(this.audioTracks,n,A,o),gh(this.subtitleTracks,i,A,o)})}loadSteeringManifest(e){const t=this.hls.config,n=t.loader;this.loader&&this.loader.destroy(),this.loader=new n(t);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 c=(this.hls.bandwidthEstimate||t.abrEwmaDefaultEstimate)|0;i.searchParams.set("_HLS_pathway",this.pathwayId),i.searchParams.set("_HLS_throughput",""+c)}const s={responseType:"json",url:i.href},o=t.steeringManifestLoadPolicy.default,a=o.errorRetry||o.timeoutRetry||{},A={loadPolicy:o,timeout:o.maxLoadTimeMs,maxRetry:a.maxNumRetry||0,retryDelay:a.retryDelayMs||0,maxRetryDelay:a.maxRetryDelayMs||0},l={onSuccess:(c,u,h,d)=>{this.log(`Loaded steering manifest: "${i}"`);const f=c.data;if(f.VERSION!==1){this.log(`Steering VERSION ${f.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=f.TTL;const{"RELOAD-URI":g,"PATHWAY-CLONES":p,"PATHWAY-PRIORITY":v}=f;if(g)try{this.uri=new self.URL(g,i).href}catch{this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${g}`);return}this.scheduleRefresh(this.uri||h.url),p&&this.clonePathways(p);const T={steeringManifest:f,url:i.toString()};this.hls.trigger(I.STEERING_MANIFEST_LOADED,T),v&&this.updatePathwayPriority(v)},onError:(c,u,h,d)=>{if(this.log(`Error loading steering manifest: ${c.code} ${c.text} (${u.url})`),this.stopLoad(),c.code===410){this.enabled=!1,this.log(`Steering manifest ${u.url} no longer available`);return}let f=this.timeToLoad*1e3;if(c.code===429){const g=this.loader;if(typeof(g==null?void 0:g.getResponseHeader)=="function"){const p=g.getResponseHeader("Retry-After");p&&(f=parseFloat(p)*1e3)}this.log(`Steering manifest ${u.url} rate limited`);return}this.scheduleRefresh(this.uri||u.url,f)},onTimeout:(c,u,h)=>{this.log(`Timeout loading steering manifest (${u.url})`),this.scheduleRefresh(this.uri||u.url)}};this.log(`Requesting steering manifest: ${i}`),this.loader.load(s,A,l)}scheduleRefresh(e,t=this.timeToLoad*1e3){this.clearTimeout(),this.reloadTimer=self.setTimeout(()=>{var n;const i=(n=this.hls)==null?void 0:n.media;if(i&&!i.ended){this.loadSteeringManifest(e);return}this.scheduleRefresh(e,this.timeToLoad*1e3)},t)}}function gh(r,e,t,n){r&&Object.keys(e).forEach(i=>{const s=r.filter(o=>o.groupId===i).map(o=>{const a=st({},o);return a.details=void 0,a.attrs=new Xe(a.attrs),a.url=a.attrs.URI=ph(o.url,o.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",t),a.groupId=a.attrs["GROUP-ID"]=e[i],a.attrs["PATHWAY-ID"]=n,a});r.push(...s)})}function ph(r,e,t,n){const{HOST:i,PARAMS:s,[t]:o}=n;let a;e&&(a=o==null?void 0:o[e],a&&(r=a));const A=new self.URL(r);return i&&!a&&(A.host=i),s&&Object.keys(s).sort().forEach(l=>{l&&A.searchParams.set(l,s[l])}),A.href}const wC=/^age:\s*[\d.]+\s*$/im;class mh{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=null,this.loader=null,this.stats=void 0,this.xhrSetup=e&&e.xhrSetup||null,this.stats=new ns,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=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,t,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=t,this.callbacks=n,this.loadInternal()}loadInternal(){const{config:e,context:t}=this;if(!e||!t)return;const n=this.loader=new self.XMLHttpRequest,i=this.stats;i.loading.first=0,i.loaded=0,i.aborted=!1;const s=this.xhrSetup;s?Promise.resolve().then(()=>{if(!(this.loader!==n||this.stats.aborted))return s(n,t.url)}).catch(o=>{if(!(this.loader!==n||this.stats.aborted))return n.open("GET",t.url,!0),s(n,t.url)}).then(()=>{this.loader!==n||this.stats.aborted||this.openAndSendXhr(n,t,e)}).catch(o=>{this.callbacks.onError({code:n.status,text:o.message},t,n,i)}):this.openAndSendXhr(n,t,e)}openAndSendXhr(e,t,n){e.readyState||e.open("GET",t.url,!0);const i=t.headers,{maxTimeToFirstByteMs:s,maxLoadTimeMs:o}=n.loadPolicy;if(i)for(const a in i)e.setRequestHeader(a,i[a]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),n.timeout=s&&he(s)?s:o,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),n.timeout),e.send()}readystatechange(){const{context:e,loader:t,stats:n}=this;if(!e||!t)return;const i=t.readyState,s=this.config;if(!n.aborted&&i>=2&&(n.loading.first===0&&(n.loading.first=Math.max(self.performance.now(),n.loading.start),s.timeout!==s.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),s.timeout=s.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),s.loadPolicy.maxLoadTimeMs-(n.loading.first-n.loading.start)))),i===4)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const o=t.status,a=t.responseType!=="text";if(o>=200&&o<300&&(a&&t.response||t.responseText!==null)){n.loading.end=Math.max(self.performance.now(),n.loading.first);const A=a?t.response:t.responseText,l=t.responseType==="arraybuffer"?A.byteLength:A.length;if(n.loaded=n.total=l,n.bwEstimate=n.total*8e3/(n.loading.end-n.loading.first),!this.callbacks)return;const c=this.callbacks.onProgress;if(c&&c(n,e,A,t),!this.callbacks)return;const u={url:t.responseURL,data:A,code:o};this.callbacks.onSuccess(u,n,e,t)}else{const A=s.loadPolicy.errorRetry,l=n.retry,c={url:e.url,data:void 0,code:o};ps(A,l,!1,c)?this.retry(A):(U.error(`${o} while loading ${e.url}`),this.callbacks.onError({code:o,text:t.statusText},e,t,n))}}}loadtimeout(){if(!this.config)return;const e=this.config.loadPolicy.timeoutRetry,t=this.stats.retry;if(ps(e,t,!0))this.retry(e);else{var n;U.warn(`timeout while loading ${(n=this.context)==null?void 0:n.url}`);const i=this.callbacks;i&&(this.abortInternal(),i.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:n}=this;this.retryDelay=ua(e,n.retry),n.retry++,U.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${t==null?void 0:t.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 t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)}getCacheAge(){let e=null;if(this.loader&&wC.test(this.loader.getAllResponseHeaders())){const t=this.loader.getResponseHeader("age");e=t?parseFloat(t):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 SC(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch{}return!1}const RC=/(\d+)-(\d+)\/(\d+)/;class Eh{constructor(e){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=null,this.response=null,this.controller=void 0,this.context=null,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=e.fetchSetup||FC,this.controller=new self.AbortController,this.stats=new ns}destroy(){this.loader=this.callbacks=this.context=this.config=this.request=null,this.abortInternal(),this.response=null,this.fetchSetup=this.controller=this.stats=null}abortInternal(){this.controller&&!this.stats.loading.end&&(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,t,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 s=DC(e,this.controller.signal),o=n.onProgress,a=e.responseType==="arraybuffer",A=a?"byteLength":"length",{maxTimeToFirstByteMs:l,maxLoadTimeMs:c}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=n,this.request=this.fetchSetup(e,s),self.clearTimeout(this.requestTimeout),t.timeout=l&&he(l)?l:c,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),n.onTimeout(i,e,this.response)},t.timeout),self.fetch(this.request).then(u=>{this.response=this.loader=u;const h=Math.max(self.performance.now(),i.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=c,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),n.onTimeout(i,e,this.response)},c-(h-i.loading.start)),!u.ok){const{status:d,statusText:f}=u;throw new kC(f||"fetch, bad network response",d,u)}return i.loading.first=h,i.total=LC(u.headers)||i.total,o&&he(t.highWaterMark)?this.loadProgressively(u,i,e,t.highWaterMark,o):a?u.arrayBuffer():e.responseType==="json"?u.json():u.text()}).then(u=>{const h=this.response;if(!h)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),i.loading.end=Math.max(self.performance.now(),i.loading.first);const d=u[A];d&&(i.loaded=i.total=d);const f={url:h.url,data:u,code:h.status};o&&!he(t.highWaterMark)&&o(i,e,u,h),n.onSuccess(f,i,e,h)}).catch(u=>{if(self.clearTimeout(this.requestTimeout),i.aborted)return;const h=u&&u.code||0,d=u?u.message:null;n.onError({code:h,text:d},e,u?u.details:null,i)})}getCacheAge(){let e=null;if(this.response){const t=this.response.headers.get("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,t,n,i=0,s){const o=new mu,a=e.body.getReader(),A=()=>a.read().then(l=>{if(l.done)return o.dataLength&&s(t,n,o.flush(),e),Promise.resolve(new ArrayBuffer(0));const c=l.value,u=c.length;return t.loaded+=u,u<i||o.dataLength?(o.push(c),o.dataLength>=i&&s(t,n,o.flush(),e)):s(t,n,c,e),A()}).catch(()=>Promise.reject());return A()}}function DC(r,e){const t={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(st({},r.headers))};return r.rangeEnd&&t.headers.set("Range","bytes="+r.rangeStart+"-"+String(r.rangeEnd-1)),t}function _C(r){const e=RC.exec(r);if(e)return parseInt(e[2])-parseInt(e[1])+1}function LC(r){const e=r.get("Content-Range");if(e){const n=_C(e);if(he(n))return n}const t=r.get("Content-Length");if(t)return parseInt(t)}function FC(r,e){return new self.Request(r.url,e)}class kC extends Error{constructor(e,t,n){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=n}}const NC=/\s/,MC={newCue(r,e,t,n){const i=[];let s,o,a,A,l;const c=self.VTTCue||self.TextTrackCue;for(let h=0;h<n.rows.length;h++)if(s=n.rows[h],a=!0,A=0,l="",!s.isEmpty()){var u;for(let g=0;g<s.chars.length;g++)NC.test(s.chars[g].uchar)&&a?A++:(l+=s.chars[g].uchar,a=!1);s.cueStartTime=e,e===t&&(t+=1e-4),A>=16?A--:A++;const d=ju(l.trim()),f=_a(e,t,d);r!=null&&(u=r.cues)!=null&&u.getCueById(f)||(o=new c(e,t,d),o.id=f,o.line=h+1,o.align="left",o.position=10+Math.min(80,Math.floor(A*8/32)*10),i.push(o))}return r&&i.length&&(i.sort((h,d)=>h.line==="auto"||d.line==="auto"?0:h.line>8&&d.line>8?d.line-h.line:h.line-d.line),i.forEach(h=>Xc(r,h))),i}},PC={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},Ih=ut(ut({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold: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:mh,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:uE,bufferController:gI,capLevelController:Ma,errorController:Zm,fpsController:$I,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrEwmaDefaultEstimateMax:5e6,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:Cc,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0,useMediaCapabilities:!0,certLoadPolicy:{default:PC},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},OC()),{},{subtitleStreamController:uI,subtitleTrackController:dI,timelineController:GI,audioStreamController:lI,audioTrackController:cI,emeController:bn,cmcdController:TC,contentSteeringController:xC});function OC(){return{cueHandler:MC,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 UC(r,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 t=Ha(r),n=["manifest","level","frag"],i=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return n.forEach(s=>{const o=`${s==="level"?"playlist":s}LoadPolicy`,a=e[o]===void 0,A=[];i.forEach(l=>{const c=`${s}Loading${l}`,u=e[c];if(u!==void 0&&a){A.push(c);const h=t[o].default;switch(e[o]={default:h},l){case"TimeOut":h.maxLoadTimeMs=u,h.maxTimeToFirstByteMs=u;break;case"MaxRetry":h.errorRetry.maxNumRetry=u,h.timeoutRetry.maxNumRetry=u;break;case"RetryDelay":h.errorRetry.retryDelayMs=u,h.timeoutRetry.retryDelayMs=u;break;case"MaxRetryTimeout":h.errorRetry.maxRetryDelayMs=u,h.timeoutRetry.maxRetryDelayMs=u;break}}}),A.length&&U.warn(`hls.js config: "${A.join('", "')}" setting(s) are deprecated, use "${o}": ${JSON.stringify(e[o])}`)}),ut(ut({},t),e)}function Ha(r){return r&&typeof r=="object"?Array.isArray(r)?r.map(Ha):Object.keys(r).reduce((e,t)=>(e[t]=Ha(r[t]),e),{}):r}function GC(r){const e=r.loader;e!==Eh&&e!==mh?(U.log("[config]: Custom loader detected, cannot enable progressive streaming"),r.progressive=!1):SC()&&(r.loader=Eh,r.progressive=!0,r.enableSoftwareAES=!0,U.log("[config]: Progressive streaming enabled, using FetchLoader"))}let $a;class HC extends da{constructor(e,t){super(e,"[level-controller]"),this._levels=[],this._firstLevel=-1,this._maxAutoLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=t,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(I.MANIFEST_LOADING,this.onManifestLoading,this),e.on(I.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(I.LEVEL_LOADED,this.onLevelLoaded,this),e.on(I.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(I.FRAG_BUFFERED,this.onFragBuffered,this),e.on(I.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(I.MANIFEST_LOADING,this.onManifestLoading,this),e.off(I.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(I.LEVEL_LOADED,this.onLevelLoaded,this),e.off(I.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(I.FRAG_BUFFERED,this.onFragBuffered,this),e.off(I.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}stopLoad(){this._levels.forEach(t=>{t.loadError=0,t.fragmentError=0}),super.stopLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[],this._maxAutoLevel=-1}onManifestLoading(e,t){this.resetLevels()}onManifestLoaded(e,t){const n=this.hls.config.preferManagedMediaSource,i=[],s={},o={};let a=!1,A=!1,l=!1;t.levels.forEach(c=>{var u,h;const d=c.attrs;let{audioCodec:f,videoCodec:g}=c;((u=f)==null?void 0:u.indexOf("mp4a.40.34"))!==-1&&($a||($a=/chrome|firefox/i.test(navigator.userAgent)),$a&&(c.audioCodec=f=void 0)),f&&(c.audioCodec=f=cs(f,n)),((h=g)==null?void 0:h.indexOf("avc1"))===0&&(g=c.videoCodec=wm(g));const{width:p,height:v,unknownCodecs:T}=c;if(a||(a=!!(p&&v)),A||(A=!!g),l||(l=!!f),T!=null&&T.length||f&&!ra(f,"audio",n)||g&&!ra(g,"video",n))return;const{CODECS:b,"FRAME-RATE":y,"HDCP-LEVEL":w,"PATHWAY-ID":R,RESOLUTION:k,"VIDEO-RANGE":$}=d,O=`${`${R||"."}-`}${c.bitrate}-${k}-${y}-${b}-${$}-${w}`;if(s[O])if(s[O].uri!==c.url&&!c.attrs["PATHWAY-ID"]){const K=o[O]+=1;c.attrs["PATHWAY-ID"]=new Array(K+1).join(".");const ne=new En(c);s[O]=ne,i.push(ne)}else s[O].addGroupId("audio",d.AUDIO),s[O].addGroupId("text",d.SUBTITLES);else{const K=new En(c);s[O]=K,o[O]=1,i.push(K)}}),this.filterAndSortMediaOptions(i,t,a,A,l)}filterAndSortMediaOptions(e,t,n,i,s){let o=[],a=[],A=e;if((n||i)&&s&&(A=A.filter(({videoCodec:f,videoRange:g,width:p,height:v})=>(!!f||!!(p&&v))&&Gm(g))),A.length===0){Promise.resolve().then(()=>{if(this.hls){t.levels.length&&this.warn(`One or more CODECS in variant not supported: ${JSON.stringify(t.levels[0].attrs)}`);const f=new Error("no level with compatible codecs found in manifest");this.hls.trigger(I.ERROR,{type:ye.MEDIA_ERROR,details:V.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:f,reason:f.message})}});return}if(t.audioTracks){const{preferManagedMediaSource:f}=this.hls.config;o=t.audioTracks.filter(g=>!g.audioCodec||ra(g.audioCodec,"audio",f)),Ch(o)}t.subtitles&&(a=t.subtitles,Ch(a));const l=A.slice(0);A.sort((f,g)=>{if(f.attrs["HDCP-LEVEL"]!==g.attrs["HDCP-LEVEL"])return(f.attrs["HDCP-LEVEL"]||"")>(g.attrs["HDCP-LEVEL"]||"")?1:-1;if(n&&f.height!==g.height)return f.height-g.height;if(f.frameRate!==g.frameRate)return f.frameRate-g.frameRate;if(f.videoRange!==g.videoRange)return ds.indexOf(f.videoRange)-ds.indexOf(g.videoRange);if(f.videoCodec!==g.videoCodec){const p=Mc(f.videoCodec),v=Mc(g.videoCodec);if(p!==v)return v-p}if(f.uri===g.uri&&f.codecSet!==g.codecSet){const p=ls(f.codecSet),v=ls(g.codecSet);if(p!==v)return v-p}return f.averageBitrate!==g.averageBitrate?f.averageBitrate-g.averageBitrate:0});let c=l[0];if(this.steering&&(A=this.steering.filterParsedLevels(A),A.length!==l.length)){for(let f=0;f<l.length;f++)if(l[f].pathwayId===A[0].pathwayId){c=l[f];break}}this._levels=A;for(let f=0;f<A.length;f++)if(A[f]===c){var u;this._firstLevel=f;const g=c.bitrate,p=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${A.length} level(s) found, first bitrate: ${g}`),((u=this.hls.userConfig)==null?void 0:u.abrEwmaDefaultEstimate)===void 0){const v=Math.min(g,this.hls.config.abrEwmaDefaultEstimateMax);v>p&&p===Ih.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=v)}break}const h=s&&!i,d={levels:A,audioTracks:o,subtitleTracks:a,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:s,video:i,altAudio:!h&&o.some(f=>!!f.url)};this.hls.trigger(I.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 t=this._levels;if(t.length===0)return;if(e<0||e>=t.length){const c=new Error("invalid level idx"),u=e<0;if(this.hls.trigger(I.ERROR,{type:ye.OTHER_ERROR,details:V.LEVEL_SWITCH_ERROR,level:e,fatal:u,error:c,reason:c.message}),u)return;e=Math.min(e,t.length-1)}const n=this.currentLevelIndex,i=this.currentLevel,s=i?i.attrs["PATHWAY-ID"]:void 0,o=t[e],a=o.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=o,n===e&&o.details&&i&&s===a)return;this.log(`Switching to level ${e} (${o.height?o.height+"p ":""}${o.videoRange?o.videoRange+" ":""}${o.codecSet?o.codecSet+" ":""}@${o.bitrate})${a?" with Pathway "+a:""} from level ${n}${s?" with Pathway "+s:""}`);const A={level:e,attrs:o.attrs,details:o.details,bitrate:o.bitrate,averageBitrate:o.averageBitrate,maxBitrate:o.maxBitrate,realBitrate:o.realBitrate,width:o.width,height:o.height,codecSet:o.codecSet,audioCodec:o.audioCodec,videoCodec:o.videoCodec,audioGroups:o.audioGroups,subtitleGroups:o.subtitleGroups,loaded:o.loaded,loadError:o.loadError,fragmentError:o.fragmentError,name:o.name,id:o.id,uri:o.uri,url:o.url,urlId:0,audioGroupIds:o.audioGroupIds,textGroupIds:o.textGroupIds};this.hls.trigger(I.LEVEL_SWITCHING,A);const l=o.details;if(!l||l.live){const c=this.switchParams(o.uri,i==null?void 0:i.details,l);this.loadPlaylist(c)}}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.hls.firstAutoLevel}return this._startLevel}set startLevel(e){this._startLevel=e}onError(e,t){t.fatal||!t.context||t.context.type===Oe.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(t!==void 0&&t.type===Ee.MAIN){const n=t.elementaryStreams;if(!Object.keys(n).some(s=>!!n[s]))return;const i=this._levels[t.level];i!=null&&i.loadError&&(this.log(`Resetting level error count of ${i.loadError} on frag buffered`),i.loadError=0)}}onLevelLoaded(e,t){var n;const{level:i,details:s}=t,o=this._levels[i];if(!o){var a;this.warn(`Invalid level index ${i}`),(a=t.deliveryDirectives)!=null&&a.skip&&(s.deltaUpdateFailed=!0);return}i===this.currentLevelIndex?(o.fragmentError===0&&(o.loadError=0),this.playlistLoaded(i,t,o.details)):(n=t.deliveryDirectives)!=null&&n.skip&&(s.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist();const t=this.currentLevelIndex,n=this.currentLevel;if(n&&this.shouldLoadPlaylist(n)){let i=n.uri;if(e)try{i=e.addDirectives(i)}catch(o){this.warn(`Could not construct new URL with HLS Delivery Directives: ${o}`)}const s=n.attrs["PATHWAY-ID"];this.log(`Loading level index ${t}${(e==null?void 0:e.msn)!==void 0?" at sn "+e.msn+" part "+e.part:""} with${s?" Pathway "+s:""} ${i}`),this.clearTimer(),this.hls.trigger(I.LEVEL_LOADING,{url:i,level:t,pathwayId:n.attrs["PATHWAY-ID"],id:0,deliveryDirectives:e||null})}}get nextLoadLevel(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(e){this.level=e,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=e)}removeLevel(e){var t;const n=this._levels.filter((i,s)=>s!==e?!0:(this.steering&&this.steering.removeLevel(i),i===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,i.details&&i.details.fragments.forEach(o=>o.level=-1)),!1));su(n),this._levels=n,this.currentLevelIndex>-1&&(t=this.currentLevel)!=null&&t.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.hls.trigger(I.LEVELS_UPDATED,{levels:n})}onLevelsUpdated(e,{levels:t}){this._levels=t}checkMaxAutoUpdated(){const{autoLevelCapping:e,maxAutoLevel:t,maxHdcpLevel:n}=this.hls;this._maxAutoLevel!==t&&(this._maxAutoLevel=t,this.hls.trigger(I.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:n}))}}function Ch(r){const e={};r.forEach(t=>{const n=t.groupId||"";t.id=e[n]=e[n]||0,e[n]++})}class $C{constructor(e){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const n in this.keyUriToKeyInfo){const i=this.keyUriToKeyInfo[n].loader;if(i){var t;if(e&&e!==((t=i.context)==null?void 0:t.frag.type))return;i.abort()}}}detach(){for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e].loader;t&&t.destroy()}this.keyUriToKeyInfo={}}createKeyLoadError(e,t=V.KEY_LOAD_ERROR,n,i,s){return new Ir({type:ye.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:s,error:n,networkDetails:i})}loadClear(e,t){if(this.emeController&&this.config.emeEnabled){const{sn:n,cc:i}=e;for(let s=0;s<t.length;s++){const o=t[s];if(i<=o.cc&&(n==="initSegment"||o.sn==="initSegment"||n<o.sn)){this.emeController.selectKeySystemFormat(o).then(a=>{o.setKeyFormat(a)});break}}}}load(e){return!e.decryptdata&&e.encrypted&&this.emeController?this.emeController.selectKeySystemFormat(e).then(t=>this.loadInternal(e,t)):this.loadInternal(e)}loadInternal(e,t){var n,i;t&&e.setKeyFormat(t);const s=e.decryptdata;if(!s){const l=new Error(t?`Expected frag.decryptdata to be defined after setting format ${t}`:"Missing decryption data on fragment in onKeyLoading");return Promise.reject(this.createKeyLoadError(e,V.KEY_LOAD_ERROR,l))}const o=s.uri;if(!o)return Promise.reject(this.createKeyLoadError(e,V.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${o}"`)));let a=this.keyUriToKeyInfo[o];if((n=a)!=null&&n.decryptdata.key)return s.key=a.decryptdata.key,Promise.resolve({frag:e,keyInfo:a});if((i=a)!=null&&i.keyLoadPromise){var A;switch((A=a.mediaKeySessionContext)==null?void 0:A.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return a.keyLoadPromise.then(l=>(s.key=l.keyInfo.decryptdata.key,{frag:e,keyInfo:a}))}}switch(a=this.keyUriToKeyInfo[o]={decryptdata:s,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},s.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return s.keyFormat==="identity"?this.loadKeyHTTP(a,e):this.loadKeyEME(a,e);case"AES-128":return this.loadKeyHTTP(a,e);default:return Promise.reject(this.createKeyLoadError(e,V.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${s.method}"`)))}}loadKeyEME(e,t){const n={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){const i=this.emeController.loadKey(n);if(i)return(e.keyLoadPromise=i.then(s=>(e.mediaKeySessionContext=s,n))).catch(s=>{throw e.keyLoadPromise=null,s})}return Promise.resolve(n)}loadKeyHTTP(e,t){const n=this.config,i=n.loader,s=new i(n);return t.keyLoader=e.loader=s,e.keyLoadPromise=new Promise((o,a)=>{const A={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},l=n.keyLoadPolicy.default,c={loadPolicy:l,timeout:l.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},u={onSuccess:(h,d,f,g)=>{const{frag:p,keyInfo:v,url:T}=f;if(!p.decryptdata||v!==this.keyUriToKeyInfo[T])return a(this.createKeyLoadError(p,V.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),g));v.decryptdata.key=p.decryptdata.key=new Uint8Array(h.data),p.keyLoader=null,v.loader=null,o({frag:p,keyInfo:v})},onError:(h,d,f,g)=>{this.resetLoader(d),a(this.createKeyLoadError(t,V.KEY_LOAD_ERROR,new Error(`HTTP Error ${h.code} loading key ${h.text}`),f,ut({url:A.url,data:void 0},h)))},onTimeout:(h,d,f)=>{this.resetLoader(d),a(this.createKeyLoadError(t,V.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),f))},onAbort:(h,d,f)=>{this.resetLoader(d),a(this.createKeyLoadError(t,V.INTERNAL_ABORTED,new Error("key loading aborted"),f))}};s.load(A,c,u)})}resetLoader(e){const{frag:t,keyInfo:n,url:i}=e,s=n.loader;t.keyLoader===s&&(t.keyLoader=null,n.loader=null),delete this.keyUriToKeyInfo[i],s&&s.destroy()}}function vh(){return self.SourceBuffer||self.WebKitSourceBuffer}function yh(){if(!Wr())return!1;const e=vh();return!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function"}function YC(){if(!yh())return!1;const r=Wr();return typeof(r==null?void 0:r.isTypeSupported)=="function"&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some(e=>r.isTypeSupported(Ai(e,"video")))||["mp4a.40.2","fLaC"].some(e=>r.isTypeSupported(Ai(e,"audio"))))}function VC(){var r;const e=vh();return typeof(e==null||(r=e.prototype)==null?void 0:r.changeType)=="function"}const KC=250,Fs=2,JC=.1,WC=.05;class qC{constructor(e,t,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=t,this.fragmentTracker=n,this.hls=i}destroy(){this.media=null,this.hls=this.fragmentTracker=null}poll(e,t){const{config:n,media:i,stalled:s}=this;if(i===null)return;const{currentTime:o,seeking:a}=i,A=this.seeking&&!a,l=!this.seeking&&a;if(this.seeking=a,o!==e){if(this.moved=!0,a||(this.nudgeRetry=0),s!==null){if(this.stallReported){const p=self.performance.now()-s;U.warn(`playback not stuck anymore @${o}, after ${Math.round(p)}ms`),this.stallReported=!1}this.stalled=null}return}if(l||A){this.stalled=null;return}if(i.paused&&!a||i.ended||i.playbackRate===0||!Ve.getBuffered(i).length){this.nudgeRetry=0;return}const c=Ve.bufferInfo(i,o,0),u=c.nextStart||0;if(a){const p=c.len>Fs,v=!u||t&&t.start<=o||u-o>Fs&&!this.fragmentTracker.getPartialFragment(o);if(p||v)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var h;if(!(c.len>0)&&!u)return;const v=Math.max(u,c.start||0)-o,T=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,y=(T==null||(h=T.details)==null?void 0:h.live)?T.details.targetduration*2:Fs,w=this.fragmentTracker.getPartialFragment(o);if(v>0&&(v<=y||w)){i.paused||this._trySkipBufferHole(w);return}}const d=self.performance.now();if(s===null){this.stalled=d;return}const f=d-s;if(!a&&f>=KC&&(this._reportStall(c),!this.media))return;const g=Ve.bufferInfo(i,o,n.maxBufferHole);this._tryFixBufferStall(g,f)}_tryFixBufferStall(e,t){const{config:n,fragmentTracker:i,media:s}=this;if(s===null)return;const o=s.currentTime,a=i.getPartialFragment(o);a&&(this._trySkipBufferHole(a)||!this.media)||(e.len>n.maxBufferHole||e.nextStart&&e.nextStart-o<n.maxBufferHole)&&t>n.highBufferWatchdogPeriod*1e3&&(U.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}_reportStall(e){const{hls:t,media:n,stallReported:i}=this;if(!i&&n){this.stallReported=!0;const s=new Error(`Playback stalling at @${n.currentTime} due to low buffer (${JSON.stringify(e)})`);U.warn(s.message),t.trigger(I.ERROR,{type:ye.MEDIA_ERROR,details:V.BUFFER_STALLED_ERROR,fatal:!1,error:s,buffer:e.len})}}_trySkipBufferHole(e){const{config:t,hls:n,media:i}=this;if(i===null)return 0;const s=i.currentTime,o=Ve.bufferInfo(i,s,0),a=s<o.start?o.start:o.nextStart;if(a){const A=o.len<=t.maxBufferHole,l=o.len>0&&o.len<1&&i.readyState<3,c=a-s;if(c>0&&(A||l)){if(c>t.maxBufferHole){const{fragmentTracker:h}=this;let d=!1;if(s===0){const f=h.getAppendedFrag(0,Ee.MAIN);f&&a<f.end&&(d=!0)}if(!d){const f=e||h.getAppendedFrag(s,Ee.MAIN);if(f){let g=!1,p=f.end;for(;p<a;){const v=h.getPartialFragment(p);if(v)p+=v.duration;else{g=!0;break}}if(g)return 0}}}const u=Math.max(a+WC,s+JC);if(U.warn(`skipping hole, adjusting currentTime from ${s} to ${u}`),this.moved=!0,this.stalled=null,i.currentTime=u,e&&!e.gap){const h=new Error(`fragment loaded with buffer holes, seeking from ${s} to ${u}`);n.trigger(I.ERROR,{type:ye.MEDIA_ERROR,details:V.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:h,reason:h.message,frag:e})}return u}}return 0}_tryNudgeBuffer(){const{config:e,hls:t,media:n,nudgeRetry:i}=this;if(n===null)return;const s=n.currentTime;if(this.nudgeRetry++,i<e.nudgeMaxRetry){const o=s+(i+1)*e.nudgeOffset,a=new Error(`Nudging 'currentTime' from ${s} to ${o}`);U.warn(a.message),n.currentTime=o,t.trigger(I.ERROR,{type:ye.MEDIA_ERROR,details:V.BUFFER_NUDGE_ON_STALL,error:a,fatal:!1})}else{const o=new Error(`Playhead still not moving while enough data buffered @${s} after ${e.nudgeMaxRetry} nudges`);U.error(o.message),t.trigger(I.ERROR,{type:ye.MEDIA_ERROR,details:V.BUFFER_STALLED_ERROR,error:o,fatal:!0})}}}const XC=100;class jC extends pa{constructor(e,t,n){super(e,t,n,"[stream-controller]",Ee.MAIN),this.audioCodecSwap=!1,this.gapController=null,this.level=-1,this._forceStartLoad=!1,this.altAudio=!1,this.audioOnly=!1,this.fragPlaying=null,this.onvplaying=null,this.onvseeked=null,this.fragLastKbps=0,this.couldBacktrack=!1,this.backtrackFragment=null,this.audioCodecSwitch=!1,this.videoBuffer=null,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(I.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(I.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(I.MANIFEST_LOADING,this.onManifestLoading,this),e.on(I.MANIFEST_PARSED,this.onManifestParsed,this),e.on(I.LEVEL_LOADING,this.onLevelLoading,this),e.on(I.LEVEL_LOADED,this.onLevelLoaded,this),e.on(I.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(I.ERROR,this.onError,this),e.on(I.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(I.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(I.BUFFER_CREATED,this.onBufferCreated,this),e.on(I.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(I.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(I.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(I.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(I.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(I.MANIFEST_LOADING,this.onManifestLoading,this),e.off(I.MANIFEST_PARSED,this.onManifestParsed,this),e.off(I.LEVEL_LOADED,this.onLevelLoaded,this),e.off(I.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(I.ERROR,this.onError,this),e.off(I.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(I.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(I.BUFFER_CREATED,this.onBufferCreated,this),e.off(I.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(I.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(I.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this._unregisterListeners(),super.onHandlerDestroying()}startLoad(e){if(this.levels){const{lastCurrentTime:t,hls:n}=this;if(this.stopLoad(),this.setInterval(XC),this.level=-1,!this.startFragRequested){let i=n.startLevel;i===-1&&(n.config.testBandwidth&&this.levels.length>1?(i=0,this.bitrateTest=!0):i=n.firstAutoLevel),n.nextLoadLevel=i,this.level=n.loadLevel,this.loadedmetadata=!1}t>0&&e===-1&&(this.log(`Override startPosition with lastCurrentTime @${t.toFixed(3)}`),e=t),this.state=te.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this._forceStartLoad=!0,this.state=te.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case te.WAITING_LEVEL:{const{levels:t,level:n}=this,i=t==null?void 0:t[n],s=i==null?void 0:i.details;if(s&&(!s.live||this.levelLastLoaded===i)){if(this.waitForCdnTuneIn(s))break;this.state=te.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=te.IDLE;break}break}case te.FRAG_LOADING_WAITING_RETRY:{var e;const t=self.performance.now(),n=this.retryDate;if(!n||t>=n||(e=this.media)!=null&&e.seeking){const{levels:i,level:s}=this,o=i==null?void 0:i[s];this.resetStartWhenNotLoaded(o||null),this.state=te.IDLE}}break}this.state===te.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){super.onTickEnd(),this.checkBuffer(),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:t,levels:n,media:i}=this;if(t===null||!i&&(this.startFragRequested||!e.config.startFragPrefetch)||this.altAudio&&this.audioOnly)return;const s=e.nextLoadLevel;if(!(n!=null&&n[s]))return;const o=n[s],a=this.getMainFwdBufferInfo();if(a===null)return;const A=this.getLevelDetails();if(A&&this._streamEnded(a,A)){const g={};this.altAudio&&(g.type="video"),this.hls.trigger(I.BUFFER_EOS,g),this.state=te.ENDED;return}e.loadLevel!==s&&e.manualLevel===-1&&this.log(`Adapting to level ${s} from level ${this.level}`),this.level=e.nextLoadLevel=s;const l=o.details;if(!l||this.state===te.WAITING_LEVEL||l.live&&this.levelLastLoaded!==o){this.level=s,this.state=te.WAITING_LEVEL;return}const c=a.len,u=this.getMaxBufferLength(o.maxBitrate);if(c>=u)return;this.backtrackFragment&&this.backtrackFragment.start>a.end&&(this.backtrackFragment=null);const h=this.backtrackFragment?this.backtrackFragment.start:a.end;let d=this.getNextFragment(h,l);if(this.couldBacktrack&&!this.fragPrevious&&d&&d.sn!=="initSegment"&&this.fragmentTracker.getState(d)!==ht.OK){var f;const p=((f=this.backtrackFragment)!=null?f:d).sn-l.startSN,v=l.fragments[p-1];v&&d.cc===v.cc&&(d=v,this.fragmentTracker.removeFragment(v))}else this.backtrackFragment&&a.len&&(this.backtrackFragment=null);if(d&&this.isLoopLoading(d,h)){if(!d.gap){const p=this.audioOnly&&!this.altAudio?He.AUDIO:He.VIDEO,v=(p===He.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;v&&this.afterBufferFlushed(v,p,Ee.MAIN)}d=this.getNextFragmentLoopLoading(d,l,a,Ee.MAIN,u)}d&&(d.initSegment&&!d.initSegment.data&&!this.bitrateTest&&(d=d.initSegment),this.loadFragment(d,o,h))}loadFragment(e,t,n){const i=this.fragmentTracker.getState(e);this.fragCurrent=e,i===ht.NOT_LOADED||i===ht.PARTIAL?e.sn==="initSegment"?this._loadInitSegment(e,t):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,t)):(this.startFragRequested=!0,super.loadFragment(e,t,n)):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,Ee.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:t}=this;if(t!=null&&t.readyState){let n;const i=this.getAppendedFrag(t.currentTime);i&&i.start>1&&this.flushMainBuffer(0,i.start-1);const s=this.getLevelDetails();if(s!=null&&s.live){const a=this.getMainFwdBufferInfo();if(!a||a.len<s.targetduration*2)return}if(!t.paused&&e){const a=this.hls.nextLoadLevel,A=e[a],l=this.fragLastKbps;l&&this.fragCurrent?n=this.fragCurrent.duration*A.maxBitrate/(1e3*l)+1:n=0}else n=0;const o=this.getBufferedFrag(t.currentTime+n);if(o){const a=this.followingBufferedFrag(o);if(a){this.abortCurrentFrag();const A=a.maxStartPTS?a.maxStartPTS:a.start,l=a.duration,c=Math.max(o.end,A+Math.min(Math.max(l-this.config.maxFragLookUpTolerance,l*(this.couldBacktrack?.5:.125)),l*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(c,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 te.KEY_LOADING:case te.FRAG_LOADING:case te.FRAG_LOADING_WAITING_RETRY:case te.PARSING:case te.PARSED:this.state=te.IDLE;break}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(e,t){super.flushMainBuffer(e,t,this.altAudio?"video":null)}onMediaAttached(e,t){super.onMediaAttached(e,t);const n=t.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 qC(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,t=e?e.currentTime:null;he(t)&&this.log(`Media seeked to ${t.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(I.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=!1,this.startPosition=this.lastCurrentTime=this.fragLastKbps=0,this.levels=this.fragPlaying=this.backtrackFragment=this.levelLastLoaded=null,this.altAudio=this.audioOnly=this.startFragRequested=!1}onManifestParsed(e,t){let n=!1,i=!1;t.levels.forEach(s=>{const o=s.audioCodec;o&&(n=n||o.indexOf("mp4a.40.2")!==-1,i=i||o.indexOf("mp4a.40.5")!==-1)}),this.audioCodecSwitch=n&&i&&!VC(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1}onLevelLoading(e,t){const{levels:n}=this;if(!n||this.state!==te.IDLE)return;const i=n[t.level];(!i.details||i.details.live&&this.levelLastLoaded!==i||this.waitForCdnTuneIn(i.details))&&(this.state=te.WAITING_LEVEL)}onLevelLoaded(e,t){var n;const{levels:i}=this,s=t.level,o=t.details,a=o.totalduration;if(!i){this.warn(`Levels were reset while loading level ${s}`);return}this.log(`Level ${s} loaded [${o.startSN},${o.endSN}]${o.lastPartSn?`[part-${o.lastPartSn}-${o.lastPartIndex}]`:""}, cc [${o.startCC}, ${o.endCC}] duration:${a}`);const A=i[s],l=this.fragCurrent;l&&(this.state===te.FRAG_LOADING||this.state===te.FRAG_LOADING_WAITING_RETRY)&&l.level!==t.level&&l.loader&&this.abortCurrentFrag();let c=0;if(o.live||(n=A.details)!=null&&n.live){var u;if(this.checkLiveUpdate(o),o.deltaUpdateFailed)return;c=this.alignPlaylists(o,A.details,(u=this.levelLastLoaded)==null?void 0:u.details)}if(A.details=o,this.levelLastLoaded=A,this.hls.trigger(I.LEVEL_UPDATED,{details:o,level:s}),this.state===te.WAITING_LEVEL){if(this.waitForCdnTuneIn(o))return;this.state=te.IDLE}this.startFragRequested?o.live&&this.synchronizeToLiveEdge(o):this.setStartPosition(o,c),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:n,part:i,payload:s}=e,{levels:o}=this;if(!o){this.warn(`Levels were reset while fragment load was in progress. Fragment ${n.sn} of level ${n.level} will not be buffered`);return}const a=o[n.level],A=a.details;if(!A){this.warn(`Dropping fragment ${n.sn} of level ${n.level} after level details were reset`),this.fragmentTracker.removeFragment(n);return}const l=a.videoCodec,c=A.PTSKnown||!A.live,u=(t=n.initSegment)==null?void 0:t.data,h=this._getAudioCodec(a),d=this.transmuxer=this.transmuxer||new Ou(this.hls,Ee.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),f=i?i.index:-1,g=f!==-1,p=new fa(n.level,n.sn,n.stats.chunkCount,s.byteLength,f,g),v=this.initPTS[n.cc];d.push(s,u,h,l,n,i,A.totalduration,c,p,v)}onAudioTrackSwitching(e,t){const n=this.altAudio;if(!!!t.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 o=this.fragCurrent;o&&(this.log("Switching to main audio track, cancel main fragment load"),o.abortRequests(),this.fragmentTracker.removeFragment(o)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();const s=this.hls;n&&(s.trigger(I.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null}),this.fragmentTracker.removeAllFragments()),s.trigger(I.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const n=t.id,i=!!this.hls.audioTracks[n].url;if(i){const s=this.videoBuffer;s&&this.mediaBuffer!==s&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=s)}this.altAudio=i,this.tick()}onBufferCreated(e,t){const n=t.tracks;let i,s,o=!1;for(const a in n){const A=n[a];if(A.id==="main"){if(s=a,i=A,a==="video"){const l=n[a];l&&(this.videoBuffer=l.buffer)}}else o=!0}o&&i?(this.log(`Alternate track found, use ${s}.buffered to schedule main fragment loading`),this.mediaBuffer=i.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:n,part:i}=t;if(n&&n.type!==Ee.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===te.PARSED&&(this.state=te.IDLE);return}const s=i?i.stats:n.stats;this.fragLastKbps=Math.round(8*s.total/(s.buffering.end-s.loading.first)),n.sn!=="initSegment"&&(this.fragPrevious=n),this.fragBufferedComplete(n,i)}onError(e,t){var n;if(t.fatal){this.state=te.ERROR;return}switch(t.details){case V.FRAG_GAP:case V.FRAG_PARSING_ERROR:case V.FRAG_DECRYPT_ERROR:case V.FRAG_LOAD_ERROR:case V.FRAG_LOAD_TIMEOUT:case V.KEY_LOAD_ERROR:case V.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(Ee.MAIN,t);break;case V.LEVEL_LOAD_ERROR:case V.LEVEL_LOAD_TIMEOUT:case V.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===te.WAITING_LEVEL&&((n=t.context)==null?void 0:n.type)===Oe.LEVEL&&(this.state=te.IDLE);break;case V.BUFFER_APPEND_ERROR:case V.BUFFER_FULL_ERROR:if(!t.parent||t.parent!=="main")return;if(t.details===V.BUFFER_APPEND_ERROR){this.resetLoadingState();return}this.reduceLengthAndFlushBuffer(t)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case V.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}checkBuffer(){const{media:e,gapController:t}=this;if(!(!e||!t||!e.readyState)){if(this.loadedmetadata||!Ve.getBuffered(e).length){const n=this.state!==te.IDLE?this.fragCurrent:null;t.poll(this.lastCurrentTime,n)}this.lastCurrentTime=e.currentTime}}onFragLoadEmergencyAborted(){this.state=te.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==He.AUDIO||this.audioOnly&&!this.altAudio){const n=(t===He.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(n,t,Ee.MAIN),this.tick()}}onLevelsUpdated(e,t){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level),this.levels=t.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:e}=this;if(!e)return;const t=e.currentTime;let n=this.startPosition;if(n>=0&&t<n){if(e.seeking){this.log(`could not seek to ${n}, already seeking at ${t}`);return}const i=Ve.getBuffered(e),o=(i.length?i.start(0):0)-n;o>0&&(o<this.config.maxBufferHole||o<this.config.maxFragLookUpTolerance)&&(this.log(`adjusting start position by ${o} to match buffer start`),n+=o,this.startPosition=n),this.log(`seek to target start position ${n} from current time ${t}`),e.currentTime=n}}_getAudioCodec(e){let t=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&t&&(this.log("Swapping audio codec"),t.indexOf("mp4a.40.5")!==-1?t="mp4a.40.2":t="mp4a.40.5"),t}_loadBitrateTestFrag(e,t){e.bitrateTest=!0,this._doFragLoad(e,t).then(n=>{const{hls:i}=this;if(!n||this.fragContextChanged(e))return;t.fragmentError=0,this.state=te.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const s=e.stats;s.parsing.start=s.parsing.end=s.buffering.start=s.buffering.end=self.performance.now(),i.trigger(I.FRAG_LOADED,n),e.bitrateTest=!1})}_handleTransmuxComplete(e){var t;const n="main",{hls:i}=this,{remuxResult:s,chunkMeta:o}=e,a=this.getCurrentContext(o);if(!a){this.resetWhenMissingContext(o);return}const{frag:A,part:l,level:c}=a,{video:u,text:h,id3:d,initSegment:f}=s,{details:g}=c,p=this.altAudio?void 0:s.audio;if(this.fragContextChanged(A)){this.fragmentTracker.removeFragment(A);return}if(this.state=te.PARSING,f){if(f!=null&&f.tracks){const b=A.initSegment||A;this._bufferInitSegment(c,f.tracks,b,o),i.trigger(I.FRAG_PARSING_INIT_SEGMENT,{frag:b,id:n,tracks:f.tracks})}const v=f.initPTS,T=f.timescale;he(v)&&(this.initPTS[A.cc]={baseTime:v,timescale:T},i.trigger(I.INIT_PTS_FOUND,{frag:A,id:n,initPTS:v,timescale:T}))}if(u&&g&&A.sn!=="initSegment"){const v=g.fragments[A.sn-1-g.startSN],T=A.sn===g.startSN,b=!v||A.cc>v.cc;if(s.independent!==!1){const{startPTS:y,endPTS:w,startDTS:R,endDTS:k}=u;if(l)l.elementaryStreams[u.type]={startPTS:y,endPTS:w,startDTS:R,endDTS:k};else if(u.firstKeyFrame&&u.independent&&o.id===1&&!b&&(this.couldBacktrack=!0),u.dropped&&u.independent){const $=this.getMainFwdBufferInfo(),W=($?$.end:this.getLoadPosition())+this.config.maxBufferHole,O=u.firstKeyFramePTS?u.firstKeyFramePTS:y;if(!T&&W<O-this.config.maxBufferHole&&!b){this.backtrack(A);return}else b&&(A.gap=!0);A.setElementaryStreamInfo(u.type,A.start,w,A.start,k,!0)}else T&&y>Fs&&(A.gap=!0);A.setElementaryStreamInfo(u.type,y,w,R,k),this.backtrackFragment&&(this.backtrackFragment=A),this.bufferFragmentData(u,A,l,o,T||b)}else if(T||b)A.gap=!0;else{this.backtrack(A);return}}if(p){const{startPTS:v,endPTS:T,startDTS:b,endDTS:y}=p;l&&(l.elementaryStreams[He.AUDIO]={startPTS:v,endPTS:T,startDTS:b,endDTS:y}),A.setElementaryStreamInfo(He.AUDIO,v,T,b,y),this.bufferFragmentData(p,A,l,o)}if(g&&d!=null&&(t=d.samples)!=null&&t.length){const v={id:n,frag:A,details:g,samples:d.samples};i.trigger(I.FRAG_PARSING_METADATA,v)}if(g&&h){const v={id:n,frag:A,details:g,samples:h.samples};i.trigger(I.FRAG_PARSING_USERDATA,v)}}_bufferInitSegment(e,t,n,i){if(this.state!==te.PARSING)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&delete t.audio;const{audio:s,video:o,audiovideo:a}=t;if(s){let A=e.audioCodec;const l=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){A&&(A.indexOf("mp4a.40.5")!==-1?A="mp4a.40.2":A="mp4a.40.5");const c=s.metadata;c&&"channelCount"in c&&(c.channelCount||1)!==1&&l.indexOf("firefox")===-1&&(A="mp4a.40.5")}A&&A.indexOf("mp4a.40.5")!==-1&&l.indexOf("android")!==-1&&s.container!=="audio/mpeg"&&(A="mp4a.40.2",this.log(`Android: force audio codec to ${A}`)),e.audioCodec&&e.audioCodec!==A&&this.log(`Swapping manifest audio codec "${e.audioCodec}" for "${A}"`),s.levelCodec=A,s.id="main",this.log(`Init audio buffer, container:${s.container}, codecs[selected/level/parsed]=[${A||""}/${e.audioCodec||""}/${s.codec}]`)}o&&(o.levelCodec=e.videoCodec,o.id="main",this.log(`Init video buffer, container:${o.container}, codecs[level/parsed]=[${e.videoCodec||""}/${o.codec}]`)),a&&this.log(`Init audiovideo buffer, container:${a.container}, codecs[level/parsed]=[${e.codecs}/${a.codec}]`),this.hls.trigger(I.BUFFER_CODECS,t),Object.keys(t).forEach(A=>{const c=t[A].initSegment;c!=null&&c.byteLength&&this.hls.trigger(I.BUFFER_APPENDING,{type:A,data:c,frag:n,part:null,chunkMeta:i,parent:n.type})}),this.tickImmediate()}getMainFwdBufferInfo(){return this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,Ee.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=te.IDLE}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&e.seeking===!1){const n=e.currentTime;if(Ve.isBuffered(e,n)?t=this.getAppendedFrag(n):Ve.isBuffered(e,n+.1)&&(t=this.getAppendedFrag(n+.1)),t){this.backtrackFragment=null;const i=this.fragPlaying,s=t.level;(!i||t.sn!==i.sn||i.level!==s)&&(this.fragPlaying=t,this.hls.trigger(I.FRAG_CHANGED,{frag:t}),(!i||i.level!==s)&&this.hls.trigger(I.LEVEL_SWITCHED,{level:s}))}}}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 t=e.currentTime,n=this.currentFrag;if(n&&he(t)&&he(n.programDateTime)){const i=n.programDateTime+(t-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 yr{static get version(){return"1.5.11"}static isMSESupported(){return yh()}static isSupported(){return YC()}static getMediaSource(){return Wr()}static get Events(){return I}static get ErrorTypes(){return ye}static get ErrorDetails(){return V}static get DefaultConfig(){return yr.defaultConfig?yr.defaultConfig:Ih}static set DefaultConfig(e){yr.defaultConfig=e}constructor(e={}){this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this.started=!1,this._emitter=new Ta,this._autoLevelCapping=-1,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,this.triggeringException=void 0,Op(e.debug||!1,"Hls instance");const t=this.config=UC(yr.DefaultConfig,e);this.userConfig=e,t.progressive&&GC(t);const{abrController:n,bufferController:i,capLevelController:s,errorController:o,fpsController:a}=t,A=new o(this),l=this.abrController=new n(this),c=this.bufferController=new i(this),u=this.capLevelController=new s(this),h=new a(this),d=new Lm(this),f=new Pm(this),g=t.contentSteeringController,p=g?new g(this):null,v=this.levelController=new HC(this,p),T=new dE(this),b=new $C(this.config),y=this.streamController=new jC(this,T,b);u.setStreamController(y),h.setStreamController(y);const w=[d,v,y];p&&w.splice(1,0,p),this.networkControllers=w;const R=[l,c,u,h,f,T];this.audioTrackController=this.createController(t.audioTrackController,w);const k=t.audioStreamController;k&&w.push(new k(this,T,b)),this.subtitleTrackController=this.createController(t.subtitleTrackController,w);const $=t.subtitleStreamController;$&&w.push(new $(this,T,b)),this.createController(t.timelineController,R),b.emeController=this.emeController=this.createController(t.emeController,R),this.cmcdController=this.createController(t.cmcdController,R),this.latencyController=this.createController(Om,R),this.coreComponents=R,w.push(A);const W=A.onErrorOut;typeof W=="function"&&this.on(I.ERROR,W,A)}createController(e,t){if(e){const n=new e(this);return t&&t.push(n),n}return null}on(e,t,n=this){this._emitter.on(e,t,n)}once(e,t,n=this){this._emitter.once(e,t,n)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,n=this,i){this._emitter.off(e,t,n,i)}listeners(e){return this._emitter.listeners(e)}emit(e,t,n){return this._emitter.emit(e,t,n)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(n){if(U.error("An internal error happened while handling event "+e+'. Error message: "'+n.message+'". Here is a stacktrace:',n),!this.triggeringException){this.triggeringException=!0;const i=e===I.ERROR;this.trigger(I.ERROR,{type:ye.OTHER_ERROR,details:V.INTERNAL_EXCEPTION,fatal:i,event:e,error:n}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){U.log("destroy"),this.trigger(I.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(t=>t.destroy()),this.networkControllers.length=0,this.coreComponents.forEach(t=>t.destroy()),this.coreComponents.length=0;const e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}attachMedia(e){U.log("attachMedia"),this._media=e,this.trigger(I.MEDIA_ATTACHING,{media:e})}detachMedia(){U.log("detachMedia"),this.trigger(I.MEDIA_DETACHING,void 0),this._media=null}loadSource(e){this.stopLoad();const t=this.media,n=this.url,i=this.url=Yo.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,U.log(`loadSource:${i}`),t&&n&&(n!==i||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(I.MANIFEST_LOADING,{url:e})}startLoad(e=-1){U.log(`startLoad(${e})`),this.started=!0,this.networkControllers.forEach(t=>{t.startLoad(e)})}stopLoad(){U.log("stopLoad"),this.started=!1,this.networkControllers.forEach(e=>{e.stopLoad()})}resumeBuffering(){this.started&&this.networkControllers.forEach(e=>{"fragmentLoader"in e&&e.startLoad(-1)})}pauseBuffering(){this.networkControllers.forEach(e=>{"fragmentLoader"in e&&e.stopLoad()})}swapAudioCodec(){U.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){U.log("recoverMediaError");const e=this._media;this.detachMedia(),e&&this.attachMedia(e)}removeLevel(e){this.levelController.removeLevel(e)}get levels(){const e=this.levelController.levels;return e||[]}get currentLevel(){return this.streamController.currentLevel}set currentLevel(e){U.log(`set currentLevel:${e}`),this.levelController.manualLevel=e,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){U.log(`set nextLevel:${e}`),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){U.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){U.log(`set firstLevel:${e}`),this.levelController.firstLevel=e}get startLevel(){const e=this.levelController.startLevel;return e===-1&&this.abrController.forcedAutoLevel>-1?this.abrController.forcedAutoLevel:e}set startLevel(e){U.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 t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimate():NaN}set bandwidthEstimate(e){this.abrController.resetEstimator(e)}get ttfbEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimateTTFB():NaN}set autoLevelCapping(e){this._autoLevelCapping!==e&&(U.log(`set autoLevelCapping:${e}`),this._autoLevelCapping=e,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){Um(e)&&this._maxHdcpLevel!==e&&(this._maxHdcpLevel=e,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return this.levelController.manualLevel===-1}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:e,config:{minAutoBitrate:t}}=this;if(!e)return 0;const n=e.length;for(let i=0;i<n;i++)if(e[i].maxBitrate>=t)return i;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:n}=this;let i;if(t===-1&&e!=null&&e.length?i=e.length-1:i=t,n)for(let s=i;s--;){const o=e[s].attrs["HDCP-LEVEL"];if(o&&o<=n)return s}return i}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(e){this.abrController.nextAutoLevel=e}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}setAudioOption(e){var t;return(t=this.audioTrackController)==null?void 0:t.setAudioOption(e)}setSubtitleOption(e){var t;return(t=this.subtitleTrackController)==null||t.setSubtitleOption(e),null}get allAudioTracks(){const e=this.audioTrackController;return e?e.allAudioTracks:[]}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 t=this.audioTrackController;t&&(t.audioTrack=e)}get allSubtitleTracks(){const e=this.subtitleTrackController;return e?e.allSubtitleTracks:[]}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 t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}get subtitleDisplay(){const e=this.subtitleTrackController;return e?e.subtitleDisplay:!1}set subtitleDisplay(e){const t=this.subtitleTrackController;t&&(t.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}}yr.defaultConfig=void 0;function zC(r){return r&&r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function ZC(r){return r}function ev(r,e){e=e||{};const t=e.delimiter||".",n=e.maxDepth,i=e.transformKey||ZC,s={};function o(a,A,l){l=l||1,Object.keys(a).forEach(function(c){const u=a[c],h=e.safe&&Array.isArray(u),d=Object.prototype.toString.call(u),f=zC(u),g=d==="[object Object]"||d==="[object Array]",p=A?A+t+i(c):i(c);if(!h&&!f&&g&&Object.keys(u).length&&(!e.maxDepth||l<n))return o(u,p,l+1);s[p]=u})}return o(r),s}var Bh=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function tv(r,e){return!!(r===e||Bh(r)&&Bh(e))}function rv(r,e){if(r.length!==e.length)return!1;for(var t=0;t<r.length;t++)if(!tv(r[t],e[t]))return!1;return!0}function nv(r,e){e===void 0&&(e=rv);var t=null;function n(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];if(t&&t.lastThis===this&&e(i,t.lastArgs))return t.lastResult;var o=r.apply(this,i);return t={lastResult:o,lastArgs:i,lastThis:this},o}return n.clear=function(){t=null},n}/**
|
2485
|
+
`),A=[],c=e?zE(e.baseTime,e.timescale):0;let u="00:00.000",h=0,d=0,f,g=!0;a.oncue=function(p){const C=t[n];let T=t.ccOffset;const b=(h-c)/9e4;if(C!=null&&C.new&&(d!==void 0?T=t.ccOffset=C.start:FI(t,n,b)),b){if(!e){f=new Error("Missing initPTS for VTT MPEGTS");return}T=b-t.presentationOffset}const y=p.endTime-p.startTime,x=Ut((p.startTime+T-d)*9e4,i*9e4)/9e4;p.startTime=Math.max(x,0),p.endTime=Math.max(x+y,0);const R=p.text.trim();p.text=decodeURIComponent(encodeURIComponent(R)),p.id||(p.id=La(p.startTime,p.endTime,R)),p.endTime>0&&A.push(p)},a.onparsingerror=function(p){f=p},a.onflush=function(){if(f){o(f);return}s(A)},l.forEach(p=>{if(g)if(Da(p,"X-TIMESTAMP-MAP=")){g=!1,p.slice(16).split(",").forEach(C=>{Da(C,"LOCAL:")?u=C.slice(6):Da(C,"MPEGTS:")&&(h=parseInt(C.slice(7)))});try{d=LI(u)/1e3}catch(C){f=C}return}else p===""&&(g=!1);a.parse(p+`
|
2486
|
+
`)}),a.flush()}const Fa="stpp.ttml.im1t",zu=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Zu=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,NI={left:"start",center:"center",right:"end",start:"start",end:"end"};function eh(r,e,t,n){const i=xe(new Uint8Array(r),["mdat"]);if(i.length===0){n(new Error("Could not parse IMSC1 mdat"));return}const s=i.map(a=>tr(a)),o=jE(e.baseTime,1,e.timescale);try{s.forEach(a=>t(MI(a,o)))}catch(a){n(a)}}function MI(r,e){const i=new DOMParser().parseFromString(r,"text/xml").getElementsByTagName("tt")[0];if(!i)throw new Error("Invalid ttml");const s={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},o=Object.keys(s).reduce((u,h)=>(u[h]=i.getAttribute(`ttp:${h}`)||s[h],u),{}),a=i.getAttribute("xml:space")!=="preserve",l=th(ka(i,"styling","style")),A=th(ka(i,"layout","region")),c=ka(i,"body","[begin]");return[].map.call(c,u=>{const h=rh(u,a);if(!h||!u.hasAttribute("begin"))return null;const d=Ma(u.getAttribute("begin"),o),f=Ma(u.getAttribute("dur"),o);let g=Ma(u.getAttribute("end"),o);if(d===null)throw nh(u);if(g===null){if(f===null)throw nh(u);g=d+f}const p=new Sa(d-e,g-e,h);p.id=La(p.startTime,p.endTime,p.text);const C=A[u.getAttribute("region")],T=l[u.getAttribute("style")],b=PI(C,T,l),{textAlign:y}=b;if(y){const x=NI[y];x&&(p.lineAlign=x),p.align=y}return st(p,b),p}).filter(u=>u!==null)}function ka(r,e,t){const n=r.getElementsByTagName(e)[0];return n?[].slice.call(n.querySelectorAll(t)):[]}function th(r){return r.reduce((e,t)=>{const n=t.getAttribute("xml:id");return n&&(e[n]=t),e},{})}function rh(r,e){return[].slice.call(r.childNodes).reduce((t,n,i)=>{var s;return n.nodeName==="br"&&i?t+`
|
2487
|
+
`:(s=n.childNodes)!=null&&s.length?rh(n,e):e?t+n.textContent.trim().replace(/\s+/g," "):t+n.textContent},"")}function PI(r,e,t){const n="http://www.w3.org/ns/ttml#styling";let i=null;const s=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],o=r!=null&&r.hasAttribute("style")?r.getAttribute("style"):null;return o&&t.hasOwnProperty(o)&&(i=t[o]),s.reduce((a,l)=>{const A=Na(e,n,l)||Na(r,n,l)||Na(i,n,l);return A&&(a[l]=A),a},{})}function Na(r,e,t){return r&&r.hasAttributeNS(e,t)?r.getAttributeNS(e,t):null}function nh(r){return new Error(`Could not parse ttml timestamp ${r}`)}function Ma(r,e){if(!r)return null;let t=qu(r);return t===null&&(zu.test(r)?t=OI(r,e):Zu.test(r)&&(t=UI(r,e))),t}function OI(r,e){const t=zu.exec(r),n=(t[4]|0)+(t[5]|0)/e.subFrameRate;return(t[1]|0)*3600+(t[2]|0)*60+(t[3]|0)+n/e.frameRate}function UI(r,e){const t=Zu.exec(r),n=Number(t[1]);switch(t[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 GI{constructor(e){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.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=oh(),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}},e.on(I.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(I.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(I.MANIFEST_LOADING,this.onManifestLoading,this),e.on(I.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(I.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(I.FRAG_LOADING,this.onFragLoading,this),e.on(I.FRAG_LOADED,this.onFragLoaded,this),e.on(I.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(I.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(I.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(I.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(I.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(I.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(I.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(I.MANIFEST_LOADING,this.onManifestLoading,this),e.off(I.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(I.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(I.FRAG_LOADING,this.onFragLoading,this),e.off(I.FRAG_LOADED,this.onFragLoaded,this),e.off(I.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(I.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(I.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(I.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(I.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){if(this.config.enableCEA708Captions&&(!this.cea608Parser1||!this.cea608Parser2)){const e=new Ss(this,"textTrack1"),t=new Ss(this,"textTrack2"),n=new Ss(this,"textTrack3"),i=new Ss(this,"textTrack4");this.cea608Parser1=new Wu(1,e,t),this.cea608Parser2=new Wu(3,n,i)}}addCues(e,t,n,i,s){let o=!1;for(let a=s.length;a--;){const l=s[a],A=HI(l[0],l[1],t,n);if(A>=0&&(l[0]=Math.min(l[0],t),l[1]=Math.max(l[1],n),o=!0,A/(n-t)>.5))return}if(o||s.push([t,n]),this.config.renderTextTracksNatively){const a=this.captionsTracks[e];this.Cues.newCue(a,t,n,i)}else{const a=this.Cues.newCue(null,t,n,i);this.hls.trigger(I.CUES_PARSED,{type:"captions",cues:a,track:e})}}onInitPtsFound(e,{frag:t,id:n,initPTS:i,timescale:s}){const{unparsedVttFrags:o}=this;n==="main"&&(this.initPTS[t.cc]={baseTime:i,timescale:s}),o.length&&(this.unparsedVttFrags=[],o.forEach(a=>{this.onFragLoaded(I.FRAG_LOADED,a)}))}getExistingTrack(e,t){const{media:n}=this;if(n)for(let i=0;i<n.textTracks.length;i++){const s=n.textTracks[i];if(sh(s,{name:e,lang:t,attrs:{}}))return s}return null}createCaptionsTrack(e){this.config.renderTextTracksNatively?this.createNativeTrack(e):this.createNonNativeTrack(e)}createNativeTrack(e){if(this.captionsTracks[e])return;const{captionsProperties:t,captionsTracks:n,media:i}=this,{label:s,languageCode:o}=t[e],a=this.getExistingTrack(s,o);if(a)n[e]=a,mn(n[e]),qc(n[e],i);else{const l=this.createTextTrack("captions",s,o);l&&(l[e]=!0,n[e]=l)}}createNonNativeTrack(e){if(this.nonNativeCaptionsTracks[e])return;const t=this.captionsProperties[e];if(!t)return;const n=t.label,i={_id:e,label:n,kind:"captions",default:t.media?!!t.media.default:!1,closedCaptions:t.media};this.nonNativeCaptionsTracks[e]=i,this.hls.trigger(I.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[i]})}createTextTrack(e,t,n){const i=this.media;if(i)return i.addTextTrack(e,t,n)}onMediaAttaching(e,t){this.media=t.media,this._cleanTracks()}onMediaDetaching(){const{captionsTracks:e}=this;Object.keys(e).forEach(t=>{mn(e[t]),delete e[t]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=oh(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){const{media:e}=this;if(!e)return;const t=e.textTracks;if(t)for(let n=0;n<t.length;n++)mn(t[n])}onSubtitleTracksUpdated(e,t){const n=t.subtitleTracks||[],i=n.some(s=>s.textCodec===Fa);if(this.config.enableWebVTT||i&&this.config.enableIMSC1){if(Uu(this.tracks,n)){this.tracks=n;return}if(this.textTracks=[],this.tracks=n,this.config.renderTextTracksNatively){const o=this.media,a=o?us(o.textTracks):null;if(this.tracks.forEach((l,A)=>{let c;if(a){let u=null;for(let h=0;h<a.length;h++)if(a[h]&&sh(a[h],l)){u=a[h],a[h]=null;break}u&&(c=u)}if(c)mn(c);else{const u=ih(l);c=this.createTextTrack(u,l.name,l.lang),c&&(c.mode="disabled")}c&&this.textTracks.push(c)}),a!=null&&a.length){const l=a.filter(A=>A!==null).map(A=>A.label);l.length&&U.warn(`Media element contains unused subtitle tracks: ${l.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const o=this.tracks.map(a=>({label:a.name,kind:a.type.toLowerCase(),default:a.default,subtitleTrack:a}));this.hls.trigger(I.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:o})}}}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach(n=>{const i=/(?:CC|SERVICE)([1-4])/.exec(n.instreamId);if(!i)return;const s=`textTrack${i[1]}`,o=this.captionsProperties[s];o&&(o.label=n.name,n.lang&&(o.languageCode=n.lang),o.media=n)})}closedCaptionsForLevel(e){const t=this.hls.levels[e.level];return t==null?void 0:t.attrs["CLOSED-CAPTIONS"]}onFragLoading(e,t){if(this.enabled&&t.frag.type===Ee.MAIN){var n,i;const{cea608Parser1:s,cea608Parser2:o,lastSn:a}=this,{cc:l,sn:A}=t.frag,c=(n=(i=t.part)==null?void 0:i.index)!=null?n:-1;s&&o&&(A!==a+1||A===a&&c!==this.lastPartIndex+1||l!==this.lastCc)&&(s.reset(),o.reset()),this.lastCc=l,this.lastSn=A,this.lastPartIndex=c}}onFragLoaded(e,t){const{frag:n,payload:i}=t;if(n.type===Ee.SUBTITLE)if(i.byteLength){const s=n.decryptdata,o="stats"in t;if(s==null||!s.encrypted||o){const a=this.tracks[n.level],l=this.vttCCs;l[n.cc]||(l[n.cc]={start:n.start,prevCC:this.prevCC,new:!0},this.prevCC=n.cc),a&&a.textCodec===Fa?this._parseIMSC1(n,i):this._parseVTTs(t)}}else this.hls.trigger(I.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const n=this.hls;eh(t,this.initPTS[e.cc],i=>{this._appendCues(i,e.level),n.trigger(I.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},i=>{U.log(`Failed to parse IMSC1: ${i}`),n.trigger(I.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:i})})}_parseVTTs(e){var t;const{frag:n,payload:i}=e,{initPTS:s,unparsedVttFrags:o}=this,a=s.length-1;if(!s[n.cc]&&a===-1){o.push(e);return}const l=this.hls,A=(t=n.initSegment)!=null&&t.data?Ot(n.initSegment.data,new Uint8Array(i)):i;kI(A,this.initPTS[n.cc],this.vttCCs,n.cc,n.start,c=>{this._appendCues(c,n.level),l.trigger(I.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})},c=>{const u=c.message==="Missing initPTS for VTT MPEGTS";u?o.push(e):this._fallbackToIMSC1(n,i),U.log(`Failed to parse VTT cue: ${c}`),!(u&&a>n.cc)&&l.trigger(I.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:c})})}_fallbackToIMSC1(e,t){const n=this.tracks[e.level];n.textCodec||eh(t,this.initPTS[e.cc],()=>{n.textCodec=Fa,this._parseIMSC1(e,t)},()=>{n.textCodec="wvtt"})}_appendCues(e,t){const n=this.hls;if(this.config.renderTextTracksNatively){const i=this.textTracks[t];if(!i||i.mode==="disabled")return;e.forEach(s=>Xc(i,s))}else{const i=this.tracks[t];if(!i)return;const s=i.default?"default":"subtitles"+t;n.trigger(I.CUES_PARSED,{type:"subtitles",cues:e,track:s})}}onFragDecrypted(e,t){const{frag:n}=t;n.type===Ee.SUBTITLE&&this.onFragLoaded(I.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){this.initCea608Parsers();const{cea608Parser1:n,cea608Parser2:i}=this;if(!this.enabled||!n||!i)return;const{frag:s,samples:o}=t;if(!(s.type===Ee.MAIN&&this.closedCaptionsForLevel(s)==="NONE"))for(let a=0;a<o.length;a++){const l=o[a].bytes;if(l){const A=this.extractCea608Data(l);n.addData(o[a].pts,A[0]),i.addData(o[a].pts,A[1])}}}onBufferFlushing(e,{startOffset:t,endOffset:n,endOffsetSubtitles:i,type:s}){const{media:o}=this;if(!(!o||o.currentTime<n)){if(!s||s==="video"){const{captionsTracks:a}=this;Object.keys(a).forEach(l=>oa(a[l],t,n))}if(this.config.renderTextTracksNatively&&t===0&&i!==void 0){const{textTracks:a}=this;Object.keys(a).forEach(l=>oa(a[l],t,i))}}}extractCea608Data(e){const t=[[],[]],n=e[0]&31;let i=2;for(let s=0;s<n;s++){const o=e[i++],a=127&e[i++],l=127&e[i++];if(a===0&&l===0)continue;if((4&o)!==0){const c=3&o;(c===0||c===1)&&(t[c].push(a),t[c].push(l))}}return t}}function ih(r){return r.characteristics&&/transcribes-spoken-dialog/gi.test(r.characteristics)&&/describes-music-and-sound/gi.test(r.characteristics)?"captions":"subtitles"}function sh(r,e){return!!r&&r.kind===ih(e)&&xa(e,r)}function HI(r,e,t,n){return Math.min(e,n)-Math.max(r,t)}function oh(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}class Pa{constructor(e){this.hls=void 0,this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.clientRect=void 0,this.streamController=void 0,this.hls=e,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}setStreamController(e){this.streamController=e}destroy(){this.hls&&this.unregisterListener(),this.timer&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null}registerListeners(){const{hls:e}=this;e.on(I.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(I.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(I.MANIFEST_PARSED,this.onManifestParsed,this),e.on(I.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(I.BUFFER_CODECS,this.onBufferCodecs,this),e.on(I.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:e}=this;e.off(I.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(I.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(I.MANIFEST_PARSED,this.onManifestParsed,this),e.off(I.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(I.BUFFER_CODECS,this.onBufferCodecs,this),e.off(I.MEDIA_DETACHING,this.onMediaDetaching,this)}onFpsDropLevelCapping(e,t){const n=this.hls.levels[t.droppedLevel];this.isLevelAllowed(n)&&this.restrictedLevels.push({bitrate:n.bitrate,height:n.height,width:n.width})}onMediaAttaching(e,t){this.media=t.media instanceof HTMLVideoElement?t.media:null,this.clientRect=null,this.timer&&this.hls.levels.length&&this.detectPlayerSize()}onManifestParsed(e,t){const n=this.hls;this.restrictedLevels=[],this.firstLevel=t.firstLevel,n.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onLevelsUpdated(e,t){this.timer&&he(this.autoLevelCapping)&&this.detectPlayerSize()}onBufferCodecs(e,t){this.hls.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onMediaDetaching(){this.stopCapping()}detectPlayerSize(){if(this.media){if(this.mediaHeight<=0||this.mediaWidth<=0){this.clientRect=null;return}const e=this.hls.levels;if(e.length){const t=this.hls,n=this.getMaxLevel(e.length-1);n!==this.autoLevelCapping&&U.log(`Setting autoLevelCapping to ${n}: ${e[n].height}p@${e[n].bitrate} for media ${this.mediaWidth}x${this.mediaHeight}`),t.autoLevelCapping=n,t.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}getMaxLevel(e){const t=this.hls.levels;if(!t.length)return-1;const n=t.filter((i,s)=>this.isLevelAllowed(i)&&s<=e);return this.clientRect=null,Pa.getMaxLevelByMediaSize(n,this.mediaWidth,this.mediaHeight)}startCapping(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,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,t={width:0,height:0};if(e){const n=e.getBoundingClientRect();t.width=n.width,t.height=n.height,!t.width&&!t.height&&(t.width=n.right-n.left||e.width||0,t.height=n.bottom-n.top||e.height||0)}return this.clientRect=t,t}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,t,n){if(!(e!=null&&e.length))return-1;const i=(a,l)=>l?a.width!==l.width||a.height!==l.height:!0;let s=e.length-1;const o=Math.max(t,n);for(let a=0;a<e.length;a+=1){const l=e[a];if((l.width>=o||l.height>=o)&&i(l,e[a+1])){s=a;break}}return s}}class $I{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(I.MEDIA_ATTACHING,this.onMediaAttaching,this)}unregisterListeners(){this.hls.off(I.MEDIA_ATTACHING,this.onMediaAttaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,t){const n=this.hls.config;if(n.capLevelOnFPSDrop){const i=t.media instanceof self.HTMLVideoElement?t.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,t,n){const i=performance.now();if(t){if(this.lastTime){const s=i-this.lastTime,o=n-this.lastDroppedFrames,a=t-this.lastDecodedFrames,l=1e3*o/s,A=this.hls;if(A.trigger(I.FPS_DROP,{currentDropped:o,currentDecoded:a,totalDroppedFrames:n}),l>0&&o>A.config.fpsDroppedMonitoringThreshold*a){let c=A.currentLevel;U.warn("drop FPS ratio greater than max allowed value for currentLevel: "+c),c>0&&(A.autoLevelCapping===-1||A.autoLevelCapping>=c)&&(c=c-1,A.trigger(I.FPS_DROP_LEVEL_CAPPING,{level:c,droppedLevel:A.currentLevel}),A.autoLevelCapping=c,this.streamController.nextLevelSwitch())}}this.lastTime=i,this.lastDroppedFrames=n,this.lastDecodedFrames=t}}checkFPSInterval(){const e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){const t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}}const Ds="[eme]";class bn{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=bn.CDMCleanupPromise?[bn.CDMCleanupPromise]:[],this.onMediaEncrypted=this._onMediaEncrypted.bind(this),this.onWaitingForKey=this._onWaitingForKey.bind(this),this.debug=U.debug.bind(U,Ds),this.log=U.log.bind(U,Ds),this.warn=U.warn.bind(U,Ds),this.error=U.error.bind(U,Ds),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(I.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(I.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(I.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(I.MANIFEST_LOADED,this.onManifestLoaded,this)}unregisterListeners(){this.hls.off(I.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(I.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(I.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(I.MANIFEST_LOADED,this.onManifestLoaded,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:n}=this.config,i=t[e];if(i)return i.licenseUrl;if(e===Je.WIDEVINE&&n)return n;throw new Error(`no license server URL configured for key-system "${e}"`)}getServerCertificateUrl(e){const{drmSystems:t}=this.config,n=t[e];if(n)return n.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const t=this.hls.levels,n=(o,a,l)=>!!o&&l.indexOf(o)===a,i=t.map(o=>o.audioCodec).filter(n),s=t.map(o=>o.videoCodec).filter(n);return i.length+s.length===0&&s.push("avc1.42e01e"),new Promise((o,a)=>{const l=A=>{const c=A.shift();this.getMediaKeysPromise(c,i,s).then(u=>o({keySystem:c,mediaKeys:u})).catch(u=>{A.length?l(A):u instanceof Gt?a(u):a(new Gt({type:ye.KEY_SYSTEM_ERROR,details:K.KEY_SYSTEM_NO_ACCESS,error:u,fatal:!0},u.message))})};l(e)})}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:n}=this.config;if(typeof n!="function"){let i=`Configured requestMediaKeySystemAccess is not a function ${n}`;return Cc===null&&self.location.protocol==="http:"&&(i=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(i))}return n(e,t)}getMediaKeysPromise(e,t,n){const i=Xp(e,t,n,this.config.drmSystemOptions),s=this.keySystemAccessPromises[e];let o=s==null?void 0:s.keySystemAccess;if(!o){this.log(`Requesting encrypted media "${e}" key-system access with config: ${JSON.stringify(i)}`),o=this.requestMediaKeySystemAccess(e,i);const a=this.keySystemAccessPromises[e]={keySystemAccess:o};return o.catch(l=>{this.log(`Failed to obtain access to key-system "${e}": ${l}`)}),o.then(l=>{this.log(`Access for key-system "${l.keySystem}" obtained`);const A=this.fetchServerCertificate(e);return this.log(`Create media-keys for "${e}"`),a.mediaKeys=l.createMediaKeys().then(c=>(this.log(`Media-keys created for "${e}"`),A.then(u=>u?this.setMediaKeysServerCertificate(c,e,u):c))),a.mediaKeys.catch(c=>{this.error(`Failed to create media-keys for "${e}"}: ${c}`)}),a.mediaKeys})}return o.then(()=>s.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:n}){this.log(`Creating key-system session "${t}" keyId: ${rr.hexDump(e.keyId||[])}`);const i=n.createSession(),s={decryptdata:e,keySystem:t,mediaKeys:n,mediaKeysSession:i,keyStatus:"status-pending"};return this.mediaKeySessions.push(s),s}renewKeySession(e){const t=e.decryptdata;if(t.pssh){const n=this.createMediaKeySessionContext(e),i=this.getKeyIdString(t),s="cenc";this.keyIdToKeySessionPromise[i]=this.generateRequestWithPreferredKeySession(n,s,t.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 rr.hexDump(e.keyId)}updateKeySession(e,t){var n;const i=e.mediaKeysSession;return this.log(`Updating key-session "${i.sessionId}" for keyID ${rr.hexDump(((n=e.decryptdata)==null?void 0:n.keyId)||[])}
|
2488
|
+
} (data length: ${t&&t.byteLength})`),i.update(t)}selectKeySystemFormat(e){const t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise}getKeyFormatPromise(e){return new Promise((t,n)=>{const i=Xo(this.config),s=e.map(mc).filter(o=>!!o&&i.indexOf(o)!==-1);return this.getKeySystemSelectionPromise(s).then(({keySystem:o})=>{const a=Ic(o);a?t(a):n(new Error(`Unable to find format for key-system "${o}"`))}).catch(n)})}loadKey(e){const t=e.keyInfo.decryptdata,n=this.getKeyIdString(t),i=`(keyId: ${n} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${i}`);let s=this.keyIdToKeySessionPromise[n];return s||(s=this.keyIdToKeySessionPromise[n]=this.getKeySystemForKeyPromise(t).then(({keySystem:o,mediaKeys:a})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${i}`),this.attemptSetMediaKeys(o,a).then(()=>{this.throwIfDestroyed();const l=this.createMediaKeySessionContext({keySystem:o,mediaKeys:a,decryptdata:t});return this.generateRequestWithPreferredKeySession(l,"cenc",t.pssh,"playlist-key")}))),s.catch(o=>this.handleError(o))),s}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e){this.hls&&(this.error(e.message),e instanceof Gt?this.hls.trigger(I.ERROR,e.data):this.hls.trigger(I.ERROR,{type:ye.KEY_SYSTEM_ERROR,details:K.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}getKeySystemForKeyPromise(e){const t=this.getKeyIdString(e),n=this.keyIdToKeySessionPromise[t];if(!n){const i=mc(e.keyFormat),s=i?[i]:Xo(this.config);return this.attemptKeySystemAccess(s)}return n}getKeySystemSelectionPromise(e){if(e.length||(e=Xo(this.config)),e.length===0)throw new Gt({type:ye.KEY_SYSTEM_ERROR,details:K.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:t,initData:n}=e;if(this.debug(`"${e.type}" event: init data type: "${t}"`),n===null)return;let i,s;if(t==="sinf"&&this.config.drmSystems[Je.FAIRPLAY]){const c=At(new Uint8Array(n));try{const u=Wo(JSON.parse(c).sinf),h=Sc(new Uint8Array(u));if(!h)return;i=h.subarray(8,24),s=Je.FAIRPLAY}catch{this.warn('Failed to parse sinf "encrypted" event message initData');return}}else{const c=vm(n);if(c===null)return;c.version===0&&c.systemId===Ec.WIDEVINE&&c.data&&(i=c.data.subarray(8,24)),s=qp(c.systemId)}if(!s||!i)return;const o=rr.hexDump(i),{keyIdToKeySessionPromise:a,mediaKeySessions:l}=this;let A=a[o];for(let c=0;c<l.length;c++){const u=l[c],h=u.decryptdata;if(h.pssh||!h.keyId)continue;const d=rr.hexDump(h.keyId);if(o===d||h.uri.replace(/-/g,"").indexOf(o)!==-1){A=a[d],delete a[d],h.pssh=new Uint8Array(n),h.keyId=i,A=a[o]=A.then(()=>this.generateRequestWithPreferredKeySession(u,t,n,"encrypted-event-key-match"));break}}A||(A=a[o]=this.getKeySystemSelectionPromise([s]).then(({keySystem:c,mediaKeys:u})=>{var h;this.throwIfDestroyed();const d=new ai("ISO-23001-7",o,(h=Ic(c))!=null?h:"");return d.pssh=new Uint8Array(n),d.keyId=i,this.attemptSetMediaKeys(c,u).then(()=>{this.throwIfDestroyed();const f=this.createMediaKeySessionContext({decryptdata:d,keySystem:c,mediaKeys:u});return this.generateRequestWithPreferredKeySession(f,t,n,"encrypted-event-no-match")})})),A.catch(c=>this.handleError(c))}_onWaitingForKey(e){this.log(`"${e.type}" event`)}attemptSetMediaKeys(e,t){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(t)});return this.setMediaKeysQueue.push(i),i.then(()=>{this.log(`Media-keys set for "${e}"`),n.push(i),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(s=>n.indexOf(s)===-1)})}generateRequestWithPreferredKeySession(e,t,n,i){var s,o;const a=(s=this.config.drmSystems)==null||(o=s[e.keySystem])==null?void 0:o.generateRequest;if(a)try{const f=a.call(this.hls,t,n,e);if(!f)throw new Error("Invalid response from configured generateRequest filter");t=f.initDataType,n=e.decryptdata.pssh=f.initData?new Uint8Array(f.initData):null}catch(f){var l;if(this.warn(f.message),(l=this.hls)!=null&&l.config.debug)throw f}if(n===null)return this.log(`Skipping key-session request for "${i}" (no initData)`),Promise.resolve(e);const A=this.getKeyIdString(e.decryptdata);this.log(`Generating key-session request for "${i}": ${A} (init data type: ${t} length: ${n?n.byteLength:null})`);const c=new ba,u=e._onmessage=f=>{const g=e.mediaKeysSession;if(!g){c.emit("error",new Error("invalid state"));return}const{messageType:p,message:C}=f;this.log(`"${p}" message event for session "${g.sessionId}" message size: ${C.byteLength}`),p==="license-request"||p==="license-renewal"?this.renewLicense(e,C).catch(T=>{this.handleError(T),c.emit("error",T)}):p==="license-release"?e.keySystem===Je.FAIRPLAY&&(this.updateKeySession(e,qo("acknowledged")),this.removeSession(e)):this.warn(`unhandled media key message type "${p}"`)},h=e._onkeystatuseschange=f=>{if(!e.mediaKeysSession){c.emit("error",new Error("invalid state"));return}this.onKeyStatusChange(e);const p=e.keyStatus;c.emit("keyStatus",p),p==="expired"&&(this.warn(`${e.keySystem} expired for key ${A}`),this.renewKeySession(e))};e.mediaKeysSession.addEventListener("message",u),e.mediaKeysSession.addEventListener("keystatuseschange",h);const d=new Promise((f,g)=>{c.on("error",g),c.on("keyStatus",p=>{p.startsWith("usable")?f():p==="output-restricted"?g(new Gt({type:ye.KEY_SYSTEM_ERROR,details:K.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):p==="internal-error"?g(new Gt({type:ye.KEY_SYSTEM_ERROR,details:K.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${p}"`)):p==="expired"?g(new Error("key expired while generating request")):this.warn(`unhandled key status change "${p}"`)})});return e.mediaKeysSession.generateRequest(t,n).then(()=>{var f;this.log(`Request generated for key-session "${(f=e.mediaKeysSession)==null?void 0:f.sessionId}" keyId: ${A}`)}).catch(f=>{throw new Gt({type:ye.KEY_SYSTEM_ERROR,details:K.KEY_SYSTEM_NO_SESSION,error:f,fatal:!1},`Error generating key-session request: ${f}`)}).then(()=>d).catch(f=>{throw c.removeAllListeners(),this.removeSession(e),f}).then(()=>(c.removeAllListeners(),e))}onKeyStatusChange(e){e.mediaKeysSession.keyStatuses.forEach((t,n)=>{this.log(`key status change "${t}" for keyStatuses keyId: ${rr.hexDump("buffer"in n?new Uint8Array(n.buffer,n.byteOffset,n.byteLength):new Uint8Array(n))} session keyId: ${rr.hexDump(new Uint8Array(e.decryptdata.keyId||[]))} uri: ${e.decryptdata.uri}`),e.keyStatus=t})}fetchServerCertificate(e){const t=this.config,n=t.loader,i=new n(t),s=this.getServerCertificateUrl(e);return s?(this.log(`Fetching server certificate for "${e}"`),new Promise((o,a)=>{const l={responseType:"arraybuffer",url:s},A=t.certLoadPolicy.default,c={loadPolicy:A,timeout:A.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},u={onSuccess:(h,d,f,g)=>{o(h.data)},onError:(h,d,f,g)=>{a(new Gt({type:ye.KEY_SYSTEM_ERROR,details:K.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:f,response:ut({url:l.url,data:void 0},h)},`"${e}" certificate request failed (${s}). Status: ${h.code} (${h.text})`))},onTimeout:(h,d,f)=>{a(new Gt({type:ye.KEY_SYSTEM_ERROR,details:K.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:f,response:{url:l.url,data:void 0}},`"${e}" certificate request timed out (${s})`))},onAbort:(h,d,f)=>{a(new Error("aborted"))}};i.load(l,c,u)})):Promise.resolve()}setMediaKeysServerCertificate(e,t,n){return new Promise((i,s)=>{e.setServerCertificate(n).then(o=>{this.log(`setServerCertificate ${o?"success":"not supported by CDM"} (${n==null?void 0:n.byteLength}) on "${t}"`),i(e)}).catch(o=>{s(new Gt({type:ye.KEY_SYSTEM_ERROR,details:K.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:o,fatal:!0},o.message))})})}renewLicense(e,t){return this.requestLicense(e,new Uint8Array(t)).then(n=>this.updateKeySession(e,new Uint8Array(n)).catch(i=>{throw new Gt({type:ye.KEY_SYSTEM_ERROR,details:K.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:i,fatal:!0},i.message)}))}unpackPlayReadyKeyMessage(e,t){const n=String.fromCharCode.apply(null,new Uint16Array(t.buffer));if(!n.includes("PlayReadyKeyMessage"))return e.setRequestHeader("Content-Type","text/xml; charset=utf-8"),t;const i=new DOMParser().parseFromString(n,"application/xml"),s=i.querySelectorAll("HttpHeader");if(s.length>0){let c;for(let u=0,h=s.length;u<h;u++){var o,a;c=s[u];const d=(o=c.querySelector("name"))==null?void 0:o.textContent,f=(a=c.querySelector("value"))==null?void 0:a.textContent;d&&f&&e.setRequestHeader(d,f)}}const l=i.querySelector("Challenge"),A=l==null?void 0:l.textContent;if(!A)throw new Error("Cannot find <Challenge> in key message");return qo(atob(A))}setupLicenseXHR(e,t,n,i){const s=this.config.licenseXhrSetup;return s?Promise.resolve().then(()=>{if(!n.decryptdata)throw new Error("Key removed");return s.call(this.hls,e,t,n,i)}).catch(o=>{if(!n.decryptdata)throw o;return e.open("POST",t,!0),s.call(this.hls,e,t,n,i)}).then(o=>(e.readyState||e.open("POST",t,!0),{xhr:e,licenseChallenge:o||i})):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:i}))}requestLicense(e,t){const n=this.config.keyLoadPolicy.default;return new Promise((i,s)=>{const o=this.getLicenseServerUrl(e.keySystem);this.log(`Sending license request to URL: ${o}`);const a=new XMLHttpRequest;a.responseType="arraybuffer",a.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return s(new Error("invalid state"));if(a.readyState===4)if(a.status===200){this._requestLicenseFailureCount=0;let l=a.response;this.log(`License received ${l instanceof ArrayBuffer?l.byteLength:l}`);const A=this.config.licenseResponseCallback;if(A)try{l=A.call(this.hls,a,o,e)}catch(c){this.error(c)}i(l)}else{const l=n.errorRetry,A=l?l.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>A||a.status>=400&&a.status<500)s(new Gt({type:ye.KEY_SYSTEM_ERROR,details:K.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:a,response:{url:o,data:void 0,code:a.status,text:a.statusText}},`License Request XHR failed (${o}). Status: ${a.status} (${a.statusText})`));else{const c=A-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${c} attempts left`),this.requestLicense(e,t).then(i,s)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=a,this.setupLicenseXHR(a,o,e,t).then(({xhr:l,licenseChallenge:A})=>{e.keySystem==Je.PLAYREADY&&(A=this.unpackPlayReadyKeyMessage(l,A)),l.send(A)})})}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const n=t.media;this.media=n,n.addEventListener("encrypted",this.onMediaEncrypted),n.addEventListener("waitingforkey",this.onWaitingForKey)}onMediaDetached(){const e=this.media,t=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={},ai.clearKeyUriToKeyIdMap();const n=t.length;bn.CDMCleanupPromise=Promise.all(t.map(i=>this.removeSession(i)).concat(e==null?void 0:e.setMediaKeys(null).catch(i=>{this.log(`Could not clear media keys: ${i}`)}))).then(()=>{n&&(this.log("finished closing key sessions and clearing media keys"),t.length=0)}).catch(i=>{this.log(`Could not close sessions and clear media keys: ${i}`)})}onManifestLoading(){this.keyFormatPromise=null}onManifestLoaded(e,{sessionKeys:t}){if(!(!t||!this.config.emeEnabled)&&!this.keyFormatPromise){const n=t.reduce((i,s)=>(i.indexOf(s.keyFormat)===-1&&i.push(s.keyFormat),i),[]);this.log(`Selecting key-system from session-keys ${n.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(n)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:n}=e;if(t){this.log(`Remove licenses and keys and close session ${t.sessionId}`),e._onmessage&&(t.removeEventListener("message",e._onmessage),e._onmessage=void 0),e._onkeystatuseschange&&(t.removeEventListener("keystatuseschange",e._onkeystatuseschange),e._onkeystatuseschange=void 0),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),t.remove().catch(s=>{this.log(`Could not remove session: ${s}`)}).then(()=>t.close()).catch(s=>{this.log(`Could not close session: ${s}`)})}}}bn.CDMCleanupPromise=void 0;class Gt extends Error{constructor(e,t){super(t),this.data=void 0,e.error||(e.error=new Error(t)),this.data=e,e.err=e.error}}var Bt;(function(r){r.MANIFEST="m",r.AUDIO="a",r.VIDEO="v",r.MUXED="av",r.INIT="i",r.CAPTION="c",r.TIMED_TEXT="tt",r.KEY="k",r.OTHER="o"})(Bt||(Bt={}));var Oa;(function(r){r.DASH="d",r.HLS="h",r.SMOOTH="s",r.OTHER="o"})(Oa||(Oa={}));var jr;(function(r){r.OBJECT="CMCD-Object",r.REQUEST="CMCD-Request",r.SESSION="CMCD-Session",r.STATUS="CMCD-Status"})(jr||(jr={}));const YI={[jr.OBJECT]:["br","d","ot","tb"],[jr.REQUEST]:["bl","dl","mtp","nor","nrr","su"],[jr.SESSION]:["cid","pr","sf","sid","st","v"],[jr.STATUS]:["bs","rtp"]};class xn{constructor(e,t){this.value=void 0,this.params=void 0,Array.isArray(e)&&(e=e.map(n=>n instanceof xn?n:new xn(n))),this.value=e,this.params=t}}class ah{constructor(e){this.description=void 0,this.description=e}}const VI="Dict";function KI(r){return Array.isArray(r)?JSON.stringify(r):r instanceof Map?"Map{}":r instanceof Set?"Set{}":typeof r=="object"?JSON.stringify(r):String(r)}function JI(r,e,t,n){return new Error(`failed to ${r} "${KI(e)}" as ${t}`,{cause:n})}const lh="Bare Item",WI="Boolean",qI="Byte Sequence",XI="Decimal",jI="Integer";function zI(r){return r<-999999999999999||999999999999999<r}const ZI=/[\x00-\x1f\x7f]+/,eC="Token",tC="Key";function ar(r,e,t){return JI("serialize",r,e,t)}function rC(r){if(typeof r!="boolean")throw ar(r,WI);return r?"?1":"?0"}function nC(r){return btoa(String.fromCharCode(...r))}function iC(r){if(ArrayBuffer.isView(r)===!1)throw ar(r,qI);return`:${nC(r)}:`}function Ah(r){if(zI(r))throw ar(r,jI);return r.toString()}function sC(r){return`@${Ah(r.getTime()/1e3)}`}function ch(r,e){if(r<0)return-ch(-r,e);const t=Math.pow(10,e);if(Math.abs(r*t%1-.5)<Number.EPSILON){const i=Math.floor(r*t);return(i%2===0?i:i+1)/t}else return Math.round(r*t)/t}function oC(r){const e=ch(r,3);if(Math.floor(Math.abs(e)).toString().length>12)throw ar(r,XI);const t=e.toString();return t.includes(".")?t:`${t}.0`}const aC="String";function lC(r){if(ZI.test(r))throw ar(r,aC);return`"${r.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function AC(r){return r.description||r.toString().slice(7,-1)}function uh(r){const e=AC(r);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e)===!1)throw ar(e,eC);return e}function Ua(r){switch(typeof r){case"number":if(!he(r))throw ar(r,lh);return Number.isInteger(r)?Ah(r):oC(r);case"string":return lC(r);case"symbol":return uh(r);case"boolean":return rC(r);case"object":if(r instanceof Date)return sC(r);if(r instanceof Uint8Array)return iC(r);if(r instanceof ah)return uh(r);default:throw ar(r,lh)}}function Ga(r){if(/^[a-z*][a-z0-9\-_.*]*$/.test(r)===!1)throw ar(r,tC);return r}function Ha(r){return r==null?"":Object.entries(r).map(([e,t])=>t===!0?`;${Ga(e)}`:`;${Ga(e)}=${Ua(t)}`).join("")}function hh(r){return r instanceof xn?`${Ua(r.value)}${Ha(r.params)}`:Ua(r)}function cC(r){return`(${r.value.map(hh).join(" ")})${Ha(r.params)}`}function uC(r,e={whitespace:!0}){if(typeof r!="object")throw ar(r,VI);const t=r instanceof Map?r.entries():Object.entries(r),n=e!=null&&e.whitespace?" ":"";return Array.from(t).map(([i,s])=>{s instanceof xn||(s=new xn(s));let o=Ga(i);return s.value===!0?o+=Ha(s.params):(o+="=",Array.isArray(s.value)?o+=cC(s):o+=hh(s)),o}).join(`,${n}`)}function hC(r,e){return uC(r,e)}const dC=r=>r==="ot"||r==="sf"||r==="st",fC=r=>typeof r=="number"?he(r):r!=null&&r!==""&&r!==!1;function gC(r,e){const t=new URL(r),n=new URL(e);if(t.origin!==n.origin)return r;const i=t.pathname.split("/").slice(1),s=n.pathname.split("/").slice(1,-1);for(;i[0]===s[0];)i.shift(),s.shift();for(;s.length;)s.shift(),i.unshift("..");return i.join("/")}function pC(){try{return crypto.randomUUID()}catch{try{const e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.slice(t.lastIndexOf("/")+1)}catch{let t=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,i=>{const s=(t+Math.random()*16)%16|0;return t=Math.floor(t/16),(i=="x"?s:s&3|8).toString(16)})}}}const _s=r=>Math.round(r),mC=(r,e)=>(e!=null&&e.baseUrl&&(r=gC(r,e.baseUrl)),encodeURIComponent(r)),Ls=r=>_s(r/100)*100,EC={br:_s,d:_s,bl:Ls,dl:Ls,mtp:Ls,nor:mC,rtp:Ls,tb:_s};function IC(r,e){const t={};if(r==null||typeof r!="object")return t;const n=Object.keys(r).sort(),i=st({},EC,e==null?void 0:e.formatters),s=e==null?void 0:e.filter;return n.forEach(o=>{if(s!=null&&s(o))return;let a=r[o];const l=i[o];l&&(a=l(a,e)),!(o==="v"&&a===1)&&(o=="pr"&&a===1||fC(a)&&(dC(o)&&typeof a=="string"&&(a=new ah(a)),t[o]=a))}),t}function dh(r,e={}){return r?hC(IC(r,e),st({whitespace:!1},e)):""}function CC(r,e={}){if(!r)return{};const t=Object.entries(r),n=Object.entries(YI).concat(Object.entries((e==null?void 0:e.customHeaderMap)||{})),i=t.reduce((s,o)=>{var a,l;const[A,c]=o,u=((a=n.find(h=>h[1].includes(A)))==null?void 0:a[0])||jr.REQUEST;return(l=s[u])!=null||(s[u]={}),s[u][A]=c,s},{});return Object.entries(i).reduce((s,[o,a])=>(s[o]=dh(a,e),s),{})}function vC(r,e,t){return st(r,CC(e,t))}const yC="CMCD";function BC(r,e={}){if(!r)return"";const t=dh(r,e);return`${yC}=${encodeURIComponent(t)}`}const fh=/CMCD=[^&#]+/;function QC(r,e,t){const n=BC(e,t);if(!n)return r;if(fh.test(r))return r.replace(fh,n);const i=r.includes("?")?"&":"?";return`${r}${i}${n}`}class TC{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.includeKeys=void 0,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:Bt.MANIFEST,su:!this.initialized})}catch(s){U.warn("Could not generate manifest CMCD data.",s)}},this.applyFragmentData=i=>{try{const s=i.frag,o=this.hls.levels[s.level],a=this.getObjectType(s),l={d:s.duration*1e3,ot:a};(a===Bt.VIDEO||a===Bt.AUDIO||a==Bt.MUXED)&&(l.br=o.bitrate/1e3,l.tb=this.getTopBandwidth(a)/1e3,l.bl=this.getBufferLength(a)),this.apply(i,l)}catch(s){U.warn("Could not generate segment CMCD data.",s)}},this.hls=e;const t=this.config=e.config,{cmcd:n}=t;n!=null&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=n.sessionId||pC(),this.cid=n.contentId,this.useHeaders=n.useHeaders===!0,this.includeKeys=n.includeKeys,this.registerListeners())}registerListeners(){const e=this.hls;e.on(I.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(I.MEDIA_DETACHED,this.onMediaDetached,this),e.on(I.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(I.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(I.MEDIA_DETACHED,this.onMediaDetached,this),e.off(I.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null,this.onWaiting=this.onPlaying=null}onMediaAttached(e,t){this.media=t.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,t){var n,i;this.audioBuffer=(n=t.tracks.audio)==null?void 0:n.buffer,this.videoBuffer=(i=t.tracks.video)==null?void 0:i.buffer}createData(){var e;return{v:1,sf:Oa.HLS,sid:this.sid,cid:this.cid,pr:(e=this.media)==null?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,t={}){st(t,this.createData());const n=t.ot===Bt.INIT||t.ot===Bt.VIDEO||t.ot===Bt.MUXED;this.starved&&n&&(t.bs=!0,t.su=!0,this.starved=!1),t.su==null&&(t.su=this.buffering);const{includeKeys:i}=this;i&&(t=Object.keys(t).reduce((s,o)=>(i.includes(o)&&(s[o]=t[o]),s),{})),this.useHeaders?(e.headers||(e.headers={}),vC(e.headers,t)):e.url=QC(e.url,t)}getObjectType(e){const{type:t}=e;if(t==="subtitle")return Bt.TIMED_TEXT;if(e.sn==="initSegment")return Bt.INIT;if(t==="audio")return Bt.AUDIO;if(t==="main")return this.hls.audioTracks.length?Bt.VIDEO:Bt.MUXED}getTopBandwidth(e){let t=0,n;const i=this.hls;if(e===Bt.AUDIO)n=i.audioTracks;else{const s=i.maxAutoLevel,o=s>-1?s+1:i.levels.length;n=i.levels.slice(0,o)}for(const s of n)s.bitrate>t&&(t=s.bitrate);return t>0?t:NaN}getBufferLength(e){const t=this.hls.media,n=e===Bt.AUDIO?this.audioBuffer:this.videoBuffer;return!n||!t?NaN:Ve.bufferInfo(n,t.currentTime,this.config.maxBufferHole).len*1e3}createPlaylistLoader(){const{pLoader:e}=this.config,t=this.applyPlaylistData,n=e||this.config.loader;return class{constructor(s){this.loader=void 0,this.loader=new n(s)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(s,o,a){t(s),this.loader.load(s,o,a)}}}createFragmentLoader(){const{fLoader:e}=this.config,t=this.applyFragmentData,n=e||this.config.loader;return class{constructor(s){this.loader=void 0,this.loader=new n(s)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(s,o,a){t(s),this.loader.load(s,o,a)}}}}const bC=3e5;class xC{constructor(e){this.hls=void 0,this.log=void 0,this.loader=null,this.uri=null,this.pathwayId=".",this.pathwayPriority=null,this.timeToLoad=300,this.reloadTimer=-1,this.updated=0,this.started=!1,this.enabled=!0,this.levels=null,this.audioTracks=null,this.subtitleTracks=null,this.penalizedPathways={},this.hls=e,this.log=U.log.bind(U,"[content-steering]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(I.MANIFEST_LOADING,this.onManifestLoading,this),e.on(I.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(I.MANIFEST_PARSED,this.onManifestParsed,this),e.on(I.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(I.MANIFEST_LOADING,this.onManifestLoading,this),e.off(I.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(I.MANIFEST_PARSED,this.onManifestParsed,this),e.off(I.ERROR,this.onError,this))}startLoad(){if(this.started=!0,this.clearTimeout(),this.enabled&&this.uri){if(this.updated){const e=this.timeToLoad*1e3-(performance.now()-this.updated);if(e>0){this.scheduleRefresh(this.uri,e);return}}this.loadSteeringManifest(this.uri)}}stopLoad(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),this.clearTimeout()}clearTimeout(){this.reloadTimer!==-1&&(self.clearTimeout(this.reloadTimer),this.reloadTimer=-1)}destroy(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null}removeLevel(e){const t=this.levels;t&&(this.levels=t.filter(n=>n!==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,t){const{contentSteering:n}=t;n!==null&&(this.pathwayId=n.pathwayId,this.uri=n.uri,this.started&&this.startLoad())}onManifestParsed(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks}onError(e,t){const{errorAction:n}=t;if((n==null?void 0:n.action)===It.SendAlternateToPenaltyBox&&n.flags===Wt.MoveAllAlternatesMatchingHost){const i=this.levels;let s=this.pathwayPriority,o=this.pathwayId;if(t.context){const{groupId:a,pathwayId:l,type:A}=t.context;a&&i?o=this.getPathwayForGroupId(a,A,o):l&&(o=l)}o in this.penalizedPathways||(this.penalizedPathways[o]=performance.now()),!s&&i&&(s=i.reduce((a,l)=>(a.indexOf(l.pathwayId)===-1&&a.push(l.pathwayId),a),[])),s&&s.length>1&&(this.updatePathwayPriority(s),n.resolved=this.pathwayId!==o),n.resolved||U.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${o} levels: ${i&&i.length} priorities: ${JSON.stringify(s)} penalized: ${JSON.stringify(this.penalizedPathways)}`)}}filterParsedLevels(e){this.levels=e;let t=this.getLevelsForPathway(this.pathwayId);if(t.length===0){const n=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${n}"`),t=this.getLevelsForPathway(n),this.pathwayId=n}return t.length!==e.length?(this.log(`Found ${t.length}/${e.length} levels in Pathway "${this.pathwayId}"`),t):e}getLevelsForPathway(e){return this.levels===null?[]:this.levels.filter(t=>e===t.pathwayId)}updatePathwayPriority(e){this.pathwayPriority=e;let t;const n=this.penalizedPathways,i=performance.now();Object.keys(n).forEach(s=>{i-n[s]>bC&&delete n[s]});for(let s=0;s<e.length;s++){const o=e[s];if(o in n)continue;if(o===this.pathwayId)return;const a=this.hls.nextLoadLevel,l=this.hls.levels[a];if(t=this.getLevelsForPathway(o),t.length>0){this.log(`Setting Pathway to "${o}"`),this.pathwayId=o,su(t),this.hls.trigger(I.LEVELS_UPDATED,{levels:t});const A=this.hls.levels[a];l&&A&&this.levels&&(A.attrs["STABLE-VARIANT-ID"]!==l.attrs["STABLE-VARIANT-ID"]&&A.bitrate!==l.bitrate&&this.log(`Unstable Pathways change from bitrate ${l.bitrate} to ${A.bitrate}`),this.hls.nextLoadLevel=a);break}}}getPathwayForGroupId(e,t,n){const i=this.getLevelsForPathway(n).concat(this.levels||[]);for(let s=0;s<i.length;s++)if(t===Oe.AUDIO_TRACK&&i[s].hasAudioGroup(e)||t===Oe.SUBTITLE_TRACK&&i[s].hasSubtitleGroup(e))return i[s].pathwayId;return n}clonePathways(e){const t=this.levels;if(!t)return;const n={},i={};e.forEach(s=>{const{ID:o,"BASE-ID":a,"URI-REPLACEMENT":l}=s;if(t.some(c=>c.pathwayId===o))return;const A=this.getLevelsForPathway(a).map(c=>{const u=new je(c.attrs);u["PATHWAY-ID"]=o;const h=u.AUDIO&&`${u.AUDIO}_clone_${o}`,d=u.SUBTITLES&&`${u.SUBTITLES}_clone_${o}`;h&&(n[u.AUDIO]=h,u.AUDIO=h),d&&(i[u.SUBTITLES]=d,u.SUBTITLES=d);const f=ph(c.uri,u["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",l),g=new En({attrs:u,audioCodec:c.audioCodec,bitrate:c.bitrate,height:c.height,name:c.name,url:f,videoCodec:c.videoCodec,width:c.width});if(c.audioGroups)for(let p=1;p<c.audioGroups.length;p++)g.addGroupId("audio",`${c.audioGroups[p]}_clone_${o}`);if(c.subtitleGroups)for(let p=1;p<c.subtitleGroups.length;p++)g.addGroupId("text",`${c.subtitleGroups[p]}_clone_${o}`);return g});t.push(...A),gh(this.audioTracks,n,l,o),gh(this.subtitleTracks,i,l,o)})}loadSteeringManifest(e){const t=this.hls.config,n=t.loader;this.loader&&this.loader.destroy(),this.loader=new n(t);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 c=(this.hls.bandwidthEstimate||t.abrEwmaDefaultEstimate)|0;i.searchParams.set("_HLS_pathway",this.pathwayId),i.searchParams.set("_HLS_throughput",""+c)}const s={responseType:"json",url:i.href},o=t.steeringManifestLoadPolicy.default,a=o.errorRetry||o.timeoutRetry||{},l={loadPolicy:o,timeout:o.maxLoadTimeMs,maxRetry:a.maxNumRetry||0,retryDelay:a.retryDelayMs||0,maxRetryDelay:a.maxRetryDelayMs||0},A={onSuccess:(c,u,h,d)=>{this.log(`Loaded steering manifest: "${i}"`);const f=c.data;if(f.VERSION!==1){this.log(`Steering VERSION ${f.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=f.TTL;const{"RELOAD-URI":g,"PATHWAY-CLONES":p,"PATHWAY-PRIORITY":C}=f;if(g)try{this.uri=new self.URL(g,i).href}catch{this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${g}`);return}this.scheduleRefresh(this.uri||h.url),p&&this.clonePathways(p);const T={steeringManifest:f,url:i.toString()};this.hls.trigger(I.STEERING_MANIFEST_LOADED,T),C&&this.updatePathwayPriority(C)},onError:(c,u,h,d)=>{if(this.log(`Error loading steering manifest: ${c.code} ${c.text} (${u.url})`),this.stopLoad(),c.code===410){this.enabled=!1,this.log(`Steering manifest ${u.url} no longer available`);return}let f=this.timeToLoad*1e3;if(c.code===429){const g=this.loader;if(typeof(g==null?void 0:g.getResponseHeader)=="function"){const p=g.getResponseHeader("Retry-After");p&&(f=parseFloat(p)*1e3)}this.log(`Steering manifest ${u.url} rate limited`);return}this.scheduleRefresh(this.uri||u.url,f)},onTimeout:(c,u,h)=>{this.log(`Timeout loading steering manifest (${u.url})`),this.scheduleRefresh(this.uri||u.url)}};this.log(`Requesting steering manifest: ${i}`),this.loader.load(s,l,A)}scheduleRefresh(e,t=this.timeToLoad*1e3){this.clearTimeout(),this.reloadTimer=self.setTimeout(()=>{var n;const i=(n=this.hls)==null?void 0:n.media;if(i&&!i.ended){this.loadSteeringManifest(e);return}this.scheduleRefresh(e,this.timeToLoad*1e3)},t)}}function gh(r,e,t,n){r&&Object.keys(e).forEach(i=>{const s=r.filter(o=>o.groupId===i).map(o=>{const a=st({},o);return a.details=void 0,a.attrs=new je(a.attrs),a.url=a.attrs.URI=ph(o.url,o.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",t),a.groupId=a.attrs["GROUP-ID"]=e[i],a.attrs["PATHWAY-ID"]=n,a});r.push(...s)})}function ph(r,e,t,n){const{HOST:i,PARAMS:s,[t]:o}=n;let a;e&&(a=o==null?void 0:o[e],a&&(r=a));const l=new self.URL(r);return i&&!a&&(l.host=i),s&&Object.keys(s).sort().forEach(A=>{A&&l.searchParams.set(A,s[A])}),l.href}const wC=/^age:\s*[\d.]+\s*$/im;class mh{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=null,this.loader=null,this.stats=void 0,this.xhrSetup=e&&e.xhrSetup||null,this.stats=new ns,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=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,t,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=t,this.callbacks=n,this.loadInternal()}loadInternal(){const{config:e,context:t}=this;if(!e||!t)return;const n=this.loader=new self.XMLHttpRequest,i=this.stats;i.loading.first=0,i.loaded=0,i.aborted=!1;const s=this.xhrSetup;s?Promise.resolve().then(()=>{if(!(this.loader!==n||this.stats.aborted))return s(n,t.url)}).catch(o=>{if(!(this.loader!==n||this.stats.aborted))return n.open("GET",t.url,!0),s(n,t.url)}).then(()=>{this.loader!==n||this.stats.aborted||this.openAndSendXhr(n,t,e)}).catch(o=>{this.callbacks.onError({code:n.status,text:o.message},t,n,i)}):this.openAndSendXhr(n,t,e)}openAndSendXhr(e,t,n){e.readyState||e.open("GET",t.url,!0);const i=t.headers,{maxTimeToFirstByteMs:s,maxLoadTimeMs:o}=n.loadPolicy;if(i)for(const a in i)e.setRequestHeader(a,i[a]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),n.timeout=s&&he(s)?s:o,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),n.timeout),e.send()}readystatechange(){const{context:e,loader:t,stats:n}=this;if(!e||!t)return;const i=t.readyState,s=this.config;if(!n.aborted&&i>=2&&(n.loading.first===0&&(n.loading.first=Math.max(self.performance.now(),n.loading.start),s.timeout!==s.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),s.timeout=s.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),s.loadPolicy.maxLoadTimeMs-(n.loading.first-n.loading.start)))),i===4)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const o=t.status,a=t.responseType!=="text";if(o>=200&&o<300&&(a&&t.response||t.responseText!==null)){n.loading.end=Math.max(self.performance.now(),n.loading.first);const l=a?t.response:t.responseText,A=t.responseType==="arraybuffer"?l.byteLength:l.length;if(n.loaded=n.total=A,n.bwEstimate=n.total*8e3/(n.loading.end-n.loading.first),!this.callbacks)return;const c=this.callbacks.onProgress;if(c&&c(n,e,l,t),!this.callbacks)return;const u={url:t.responseURL,data:l,code:o};this.callbacks.onSuccess(u,n,e,t)}else{const l=s.loadPolicy.errorRetry,A=n.retry,c={url:e.url,data:void 0,code:o};ps(l,A,!1,c)?this.retry(l):(U.error(`${o} while loading ${e.url}`),this.callbacks.onError({code:o,text:t.statusText},e,t,n))}}}loadtimeout(){if(!this.config)return;const e=this.config.loadPolicy.timeoutRetry,t=this.stats.retry;if(ps(e,t,!0))this.retry(e);else{var n;U.warn(`timeout while loading ${(n=this.context)==null?void 0:n.url}`);const i=this.callbacks;i&&(this.abortInternal(),i.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:n}=this;this.retryDelay=ha(e,n.retry),n.retry++,U.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${t==null?void 0:t.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 t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)}getCacheAge(){let e=null;if(this.loader&&wC.test(this.loader.getAllResponseHeaders())){const t=this.loader.getResponseHeader("age");e=t?parseFloat(t):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 SC(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch{}return!1}const RC=/(\d+)-(\d+)\/(\d+)/;class Eh{constructor(e){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=null,this.response=null,this.controller=void 0,this.context=null,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=e.fetchSetup||FC,this.controller=new self.AbortController,this.stats=new ns}destroy(){this.loader=this.callbacks=this.context=this.config=this.request=null,this.abortInternal(),this.response=null,this.fetchSetup=this.controller=this.stats=null}abortInternal(){this.controller&&!this.stats.loading.end&&(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,t,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 s=DC(e,this.controller.signal),o=n.onProgress,a=e.responseType==="arraybuffer",l=a?"byteLength":"length",{maxTimeToFirstByteMs:A,maxLoadTimeMs:c}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=n,this.request=this.fetchSetup(e,s),self.clearTimeout(this.requestTimeout),t.timeout=A&&he(A)?A:c,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),n.onTimeout(i,e,this.response)},t.timeout),self.fetch(this.request).then(u=>{this.response=this.loader=u;const h=Math.max(self.performance.now(),i.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=c,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),n.onTimeout(i,e,this.response)},c-(h-i.loading.start)),!u.ok){const{status:d,statusText:f}=u;throw new kC(f||"fetch, bad network response",d,u)}return i.loading.first=h,i.total=LC(u.headers)||i.total,o&&he(t.highWaterMark)?this.loadProgressively(u,i,e,t.highWaterMark,o):a?u.arrayBuffer():e.responseType==="json"?u.json():u.text()}).then(u=>{const h=this.response;if(!h)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),i.loading.end=Math.max(self.performance.now(),i.loading.first);const d=u[l];d&&(i.loaded=i.total=d);const f={url:h.url,data:u,code:h.status};o&&!he(t.highWaterMark)&&o(i,e,u,h),n.onSuccess(f,i,e,h)}).catch(u=>{if(self.clearTimeout(this.requestTimeout),i.aborted)return;const h=u&&u.code||0,d=u?u.message:null;n.onError({code:h,text:d},e,u?u.details:null,i)})}getCacheAge(){let e=null;if(this.response){const t=this.response.headers.get("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,t,n,i=0,s){const o=new mu,a=e.body.getReader(),l=()=>a.read().then(A=>{if(A.done)return o.dataLength&&s(t,n,o.flush(),e),Promise.resolve(new ArrayBuffer(0));const c=A.value,u=c.length;return t.loaded+=u,u<i||o.dataLength?(o.push(c),o.dataLength>=i&&s(t,n,o.flush(),e)):s(t,n,c,e),l()}).catch(()=>Promise.reject());return l()}}function DC(r,e){const t={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(st({},r.headers))};return r.rangeEnd&&t.headers.set("Range","bytes="+r.rangeStart+"-"+String(r.rangeEnd-1)),t}function _C(r){const e=RC.exec(r);if(e)return parseInt(e[2])-parseInt(e[1])+1}function LC(r){const e=r.get("Content-Range");if(e){const n=_C(e);if(he(n))return n}const t=r.get("Content-Length");if(t)return parseInt(t)}function FC(r,e){return new self.Request(r.url,e)}class kC extends Error{constructor(e,t,n){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=n}}const NC=/\s/,MC={newCue(r,e,t,n){const i=[];let s,o,a,l,A;const c=self.VTTCue||self.TextTrackCue;for(let h=0;h<n.rows.length;h++)if(s=n.rows[h],a=!0,l=0,A="",!s.isEmpty()){var u;for(let g=0;g<s.chars.length;g++)NC.test(s.chars[g].uchar)&&a?l++:(A+=s.chars[g].uchar,a=!1);s.cueStartTime=e,e===t&&(t+=1e-4),l>=16?l--:l++;const d=ju(A.trim()),f=La(e,t,d);r!=null&&(u=r.cues)!=null&&u.getCueById(f)||(o=new c(e,t,d),o.id=f,o.line=h+1,o.align="left",o.position=10+Math.min(80,Math.floor(l*8/32)*10),i.push(o))}return r&&i.length&&(i.sort((h,d)=>h.line==="auto"||d.line==="auto"?0:h.line>8&&d.line>8?d.line-h.line:h.line-d.line),i.forEach(h=>Xc(r,h))),i}},PC={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},Ih=ut(ut({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold: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:mh,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:uE,bufferController:gI,capLevelController:Pa,errorController:Zm,fpsController:$I,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrEwmaDefaultEstimateMax:5e6,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:Cc,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0,useMediaCapabilities:!0,certLoadPolicy:{default:PC},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},OC()),{},{subtitleStreamController:uI,subtitleTrackController:dI,timelineController:GI,audioStreamController:AI,audioTrackController:cI,emeController:bn,cmcdController:TC,contentSteeringController:xC});function OC(){return{cueHandler:MC,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 UC(r,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 t=$a(r),n=["manifest","level","frag"],i=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return n.forEach(s=>{const o=`${s==="level"?"playlist":s}LoadPolicy`,a=e[o]===void 0,l=[];i.forEach(A=>{const c=`${s}Loading${A}`,u=e[c];if(u!==void 0&&a){l.push(c);const h=t[o].default;switch(e[o]={default:h},A){case"TimeOut":h.maxLoadTimeMs=u,h.maxTimeToFirstByteMs=u;break;case"MaxRetry":h.errorRetry.maxNumRetry=u,h.timeoutRetry.maxNumRetry=u;break;case"RetryDelay":h.errorRetry.retryDelayMs=u,h.timeoutRetry.retryDelayMs=u;break;case"MaxRetryTimeout":h.errorRetry.maxRetryDelayMs=u,h.timeoutRetry.maxRetryDelayMs=u;break}}}),l.length&&U.warn(`hls.js config: "${l.join('", "')}" setting(s) are deprecated, use "${o}": ${JSON.stringify(e[o])}`)}),ut(ut({},t),e)}function $a(r){return r&&typeof r=="object"?Array.isArray(r)?r.map($a):Object.keys(r).reduce((e,t)=>(e[t]=$a(r[t]),e),{}):r}function GC(r){const e=r.loader;e!==Eh&&e!==mh?(U.log("[config]: Custom loader detected, cannot enable progressive streaming"),r.progressive=!1):SC()&&(r.loader=Eh,r.progressive=!0,r.enableSoftwareAES=!0,U.log("[config]: Progressive streaming enabled, using FetchLoader"))}let Ya;class HC extends fa{constructor(e,t){super(e,"[level-controller]"),this._levels=[],this._firstLevel=-1,this._maxAutoLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=t,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(I.MANIFEST_LOADING,this.onManifestLoading,this),e.on(I.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(I.LEVEL_LOADED,this.onLevelLoaded,this),e.on(I.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(I.FRAG_BUFFERED,this.onFragBuffered,this),e.on(I.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(I.MANIFEST_LOADING,this.onManifestLoading,this),e.off(I.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(I.LEVEL_LOADED,this.onLevelLoaded,this),e.off(I.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(I.FRAG_BUFFERED,this.onFragBuffered,this),e.off(I.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}stopLoad(){this._levels.forEach(t=>{t.loadError=0,t.fragmentError=0}),super.stopLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[],this._maxAutoLevel=-1}onManifestLoading(e,t){this.resetLevels()}onManifestLoaded(e,t){const n=this.hls.config.preferManagedMediaSource,i=[],s={},o={};let a=!1,l=!1,A=!1;t.levels.forEach(c=>{var u,h;const d=c.attrs;let{audioCodec:f,videoCodec:g}=c;((u=f)==null?void 0:u.indexOf("mp4a.40.34"))!==-1&&(Ya||(Ya=/chrome|firefox/i.test(navigator.userAgent)),Ya&&(c.audioCodec=f=void 0)),f&&(c.audioCodec=f=cs(f,n)),((h=g)==null?void 0:h.indexOf("avc1"))===0&&(g=c.videoCodec=wm(g));const{width:p,height:C,unknownCodecs:T}=c;if(a||(a=!!(p&&C)),l||(l=!!g),A||(A=!!f),T!=null&&T.length||f&&!na(f,"audio",n)||g&&!na(g,"video",n))return;const{CODECS:b,"FRAME-RATE":y,"HDCP-LEVEL":x,"PATHWAY-ID":R,RESOLUTION:k,"VIDEO-RANGE":$}=d,O=`${`${R||"."}-`}${c.bitrate}-${k}-${y}-${b}-${$}-${x}`;if(s[O])if(s[O].uri!==c.url&&!c.attrs["PATHWAY-ID"]){const J=o[O]+=1;c.attrs["PATHWAY-ID"]=new Array(J+1).join(".");const ne=new En(c);s[O]=ne,i.push(ne)}else s[O].addGroupId("audio",d.AUDIO),s[O].addGroupId("text",d.SUBTITLES);else{const J=new En(c);s[O]=J,o[O]=1,i.push(J)}}),this.filterAndSortMediaOptions(i,t,a,l,A)}filterAndSortMediaOptions(e,t,n,i,s){let o=[],a=[],l=e;if((n||i)&&s&&(l=l.filter(({videoCodec:f,videoRange:g,width:p,height:C})=>(!!f||!!(p&&C))&&Gm(g))),l.length===0){Promise.resolve().then(()=>{if(this.hls){t.levels.length&&this.warn(`One or more CODECS in variant not supported: ${JSON.stringify(t.levels[0].attrs)}`);const f=new Error("no level with compatible codecs found in manifest");this.hls.trigger(I.ERROR,{type:ye.MEDIA_ERROR,details:K.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:f,reason:f.message})}});return}if(t.audioTracks){const{preferManagedMediaSource:f}=this.hls.config;o=t.audioTracks.filter(g=>!g.audioCodec||na(g.audioCodec,"audio",f)),Ch(o)}t.subtitles&&(a=t.subtitles,Ch(a));const A=l.slice(0);l.sort((f,g)=>{if(f.attrs["HDCP-LEVEL"]!==g.attrs["HDCP-LEVEL"])return(f.attrs["HDCP-LEVEL"]||"")>(g.attrs["HDCP-LEVEL"]||"")?1:-1;if(n&&f.height!==g.height)return f.height-g.height;if(f.frameRate!==g.frameRate)return f.frameRate-g.frameRate;if(f.videoRange!==g.videoRange)return ds.indexOf(f.videoRange)-ds.indexOf(g.videoRange);if(f.videoCodec!==g.videoCodec){const p=Mc(f.videoCodec),C=Mc(g.videoCodec);if(p!==C)return C-p}if(f.uri===g.uri&&f.codecSet!==g.codecSet){const p=As(f.codecSet),C=As(g.codecSet);if(p!==C)return C-p}return f.averageBitrate!==g.averageBitrate?f.averageBitrate-g.averageBitrate:0});let c=A[0];if(this.steering&&(l=this.steering.filterParsedLevels(l),l.length!==A.length)){for(let f=0;f<A.length;f++)if(A[f].pathwayId===l[0].pathwayId){c=A[f];break}}this._levels=l;for(let f=0;f<l.length;f++)if(l[f]===c){var u;this._firstLevel=f;const g=c.bitrate,p=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${l.length} level(s) found, first bitrate: ${g}`),((u=this.hls.userConfig)==null?void 0:u.abrEwmaDefaultEstimate)===void 0){const C=Math.min(g,this.hls.config.abrEwmaDefaultEstimateMax);C>p&&p===Ih.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=C)}break}const h=s&&!i,d={levels:l,audioTracks:o,subtitleTracks:a,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:s,video:i,altAudio:!h&&o.some(f=>!!f.url)};this.hls.trigger(I.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 t=this._levels;if(t.length===0)return;if(e<0||e>=t.length){const c=new Error("invalid level idx"),u=e<0;if(this.hls.trigger(I.ERROR,{type:ye.OTHER_ERROR,details:K.LEVEL_SWITCH_ERROR,level:e,fatal:u,error:c,reason:c.message}),u)return;e=Math.min(e,t.length-1)}const n=this.currentLevelIndex,i=this.currentLevel,s=i?i.attrs["PATHWAY-ID"]:void 0,o=t[e],a=o.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=o,n===e&&o.details&&i&&s===a)return;this.log(`Switching to level ${e} (${o.height?o.height+"p ":""}${o.videoRange?o.videoRange+" ":""}${o.codecSet?o.codecSet+" ":""}@${o.bitrate})${a?" with Pathway "+a:""} from level ${n}${s?" with Pathway "+s:""}`);const l={level:e,attrs:o.attrs,details:o.details,bitrate:o.bitrate,averageBitrate:o.averageBitrate,maxBitrate:o.maxBitrate,realBitrate:o.realBitrate,width:o.width,height:o.height,codecSet:o.codecSet,audioCodec:o.audioCodec,videoCodec:o.videoCodec,audioGroups:o.audioGroups,subtitleGroups:o.subtitleGroups,loaded:o.loaded,loadError:o.loadError,fragmentError:o.fragmentError,name:o.name,id:o.id,uri:o.uri,url:o.url,urlId:0,audioGroupIds:o.audioGroupIds,textGroupIds:o.textGroupIds};this.hls.trigger(I.LEVEL_SWITCHING,l);const A=o.details;if(!A||A.live){const c=this.switchParams(o.uri,i==null?void 0:i.details,A);this.loadPlaylist(c)}}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.hls.firstAutoLevel}return this._startLevel}set startLevel(e){this._startLevel=e}onError(e,t){t.fatal||!t.context||t.context.type===Oe.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(t!==void 0&&t.type===Ee.MAIN){const n=t.elementaryStreams;if(!Object.keys(n).some(s=>!!n[s]))return;const i=this._levels[t.level];i!=null&&i.loadError&&(this.log(`Resetting level error count of ${i.loadError} on frag buffered`),i.loadError=0)}}onLevelLoaded(e,t){var n;const{level:i,details:s}=t,o=this._levels[i];if(!o){var a;this.warn(`Invalid level index ${i}`),(a=t.deliveryDirectives)!=null&&a.skip&&(s.deltaUpdateFailed=!0);return}i===this.currentLevelIndex?(o.fragmentError===0&&(o.loadError=0),this.playlistLoaded(i,t,o.details)):(n=t.deliveryDirectives)!=null&&n.skip&&(s.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist();const t=this.currentLevelIndex,n=this.currentLevel;if(n&&this.shouldLoadPlaylist(n)){let i=n.uri;if(e)try{i=e.addDirectives(i)}catch(o){this.warn(`Could not construct new URL with HLS Delivery Directives: ${o}`)}const s=n.attrs["PATHWAY-ID"];this.log(`Loading level index ${t}${(e==null?void 0:e.msn)!==void 0?" at sn "+e.msn+" part "+e.part:""} with${s?" Pathway "+s:""} ${i}`),this.clearTimer(),this.hls.trigger(I.LEVEL_LOADING,{url:i,level:t,pathwayId:n.attrs["PATHWAY-ID"],id:0,deliveryDirectives:e||null})}}get nextLoadLevel(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(e){this.level=e,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=e)}removeLevel(e){var t;const n=this._levels.filter((i,s)=>s!==e?!0:(this.steering&&this.steering.removeLevel(i),i===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,i.details&&i.details.fragments.forEach(o=>o.level=-1)),!1));su(n),this._levels=n,this.currentLevelIndex>-1&&(t=this.currentLevel)!=null&&t.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.hls.trigger(I.LEVELS_UPDATED,{levels:n})}onLevelsUpdated(e,{levels:t}){this._levels=t}checkMaxAutoUpdated(){const{autoLevelCapping:e,maxAutoLevel:t,maxHdcpLevel:n}=this.hls;this._maxAutoLevel!==t&&(this._maxAutoLevel=t,this.hls.trigger(I.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:n}))}}function Ch(r){const e={};r.forEach(t=>{const n=t.groupId||"";t.id=e[n]=e[n]||0,e[n]++})}class $C{constructor(e){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const n in this.keyUriToKeyInfo){const i=this.keyUriToKeyInfo[n].loader;if(i){var t;if(e&&e!==((t=i.context)==null?void 0:t.frag.type))return;i.abort()}}}detach(){for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e].loader;t&&t.destroy()}this.keyUriToKeyInfo={}}createKeyLoadError(e,t=K.KEY_LOAD_ERROR,n,i,s){return new Ir({type:ye.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:s,error:n,networkDetails:i})}loadClear(e,t){if(this.emeController&&this.config.emeEnabled){const{sn:n,cc:i}=e;for(let s=0;s<t.length;s++){const o=t[s];if(i<=o.cc&&(n==="initSegment"||o.sn==="initSegment"||n<o.sn)){this.emeController.selectKeySystemFormat(o).then(a=>{o.setKeyFormat(a)});break}}}}load(e){return!e.decryptdata&&e.encrypted&&this.emeController?this.emeController.selectKeySystemFormat(e).then(t=>this.loadInternal(e,t)):this.loadInternal(e)}loadInternal(e,t){var n,i;t&&e.setKeyFormat(t);const s=e.decryptdata;if(!s){const A=new Error(t?`Expected frag.decryptdata to be defined after setting format ${t}`:"Missing decryption data on fragment in onKeyLoading");return Promise.reject(this.createKeyLoadError(e,K.KEY_LOAD_ERROR,A))}const o=s.uri;if(!o)return Promise.reject(this.createKeyLoadError(e,K.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${o}"`)));let a=this.keyUriToKeyInfo[o];if((n=a)!=null&&n.decryptdata.key)return s.key=a.decryptdata.key,Promise.resolve({frag:e,keyInfo:a});if((i=a)!=null&&i.keyLoadPromise){var l;switch((l=a.mediaKeySessionContext)==null?void 0:l.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return a.keyLoadPromise.then(A=>(s.key=A.keyInfo.decryptdata.key,{frag:e,keyInfo:a}))}}switch(a=this.keyUriToKeyInfo[o]={decryptdata:s,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},s.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return s.keyFormat==="identity"?this.loadKeyHTTP(a,e):this.loadKeyEME(a,e);case"AES-128":return this.loadKeyHTTP(a,e);default:return Promise.reject(this.createKeyLoadError(e,K.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${s.method}"`)))}}loadKeyEME(e,t){const n={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){const i=this.emeController.loadKey(n);if(i)return(e.keyLoadPromise=i.then(s=>(e.mediaKeySessionContext=s,n))).catch(s=>{throw e.keyLoadPromise=null,s})}return Promise.resolve(n)}loadKeyHTTP(e,t){const n=this.config,i=n.loader,s=new i(n);return t.keyLoader=e.loader=s,e.keyLoadPromise=new Promise((o,a)=>{const l={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},A=n.keyLoadPolicy.default,c={loadPolicy:A,timeout:A.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},u={onSuccess:(h,d,f,g)=>{const{frag:p,keyInfo:C,url:T}=f;if(!p.decryptdata||C!==this.keyUriToKeyInfo[T])return a(this.createKeyLoadError(p,K.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),g));C.decryptdata.key=p.decryptdata.key=new Uint8Array(h.data),p.keyLoader=null,C.loader=null,o({frag:p,keyInfo:C})},onError:(h,d,f,g)=>{this.resetLoader(d),a(this.createKeyLoadError(t,K.KEY_LOAD_ERROR,new Error(`HTTP Error ${h.code} loading key ${h.text}`),f,ut({url:l.url,data:void 0},h)))},onTimeout:(h,d,f)=>{this.resetLoader(d),a(this.createKeyLoadError(t,K.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),f))},onAbort:(h,d,f)=>{this.resetLoader(d),a(this.createKeyLoadError(t,K.INTERNAL_ABORTED,new Error("key loading aborted"),f))}};s.load(l,c,u)})}resetLoader(e){const{frag:t,keyInfo:n,url:i}=e,s=n.loader;t.keyLoader===s&&(t.keyLoader=null,n.loader=null),delete this.keyUriToKeyInfo[i],s&&s.destroy()}}function vh(){return self.SourceBuffer||self.WebKitSourceBuffer}function yh(){if(!qr())return!1;const e=vh();return!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function"}function YC(){if(!yh())return!1;const r=qr();return typeof(r==null?void 0:r.isTypeSupported)=="function"&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some(e=>r.isTypeSupported(li(e,"video")))||["mp4a.40.2","fLaC"].some(e=>r.isTypeSupported(li(e,"audio"))))}function VC(){var r;const e=vh();return typeof(e==null||(r=e.prototype)==null?void 0:r.changeType)=="function"}const KC=250,Fs=2,JC=.1,WC=.05;class qC{constructor(e,t,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=t,this.fragmentTracker=n,this.hls=i}destroy(){this.media=null,this.hls=this.fragmentTracker=null}poll(e,t){const{config:n,media:i,stalled:s}=this;if(i===null)return;const{currentTime:o,seeking:a}=i,l=this.seeking&&!a,A=!this.seeking&&a;if(this.seeking=a,o!==e){if(this.moved=!0,a||(this.nudgeRetry=0),s!==null){if(this.stallReported){const p=self.performance.now()-s;U.warn(`playback not stuck anymore @${o}, after ${Math.round(p)}ms`),this.stallReported=!1}this.stalled=null}return}if(A||l){this.stalled=null;return}if(i.paused&&!a||i.ended||i.playbackRate===0||!Ve.getBuffered(i).length){this.nudgeRetry=0;return}const c=Ve.bufferInfo(i,o,0),u=c.nextStart||0;if(a){const p=c.len>Fs,C=!u||t&&t.start<=o||u-o>Fs&&!this.fragmentTracker.getPartialFragment(o);if(p||C)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var h;if(!(c.len>0)&&!u)return;const C=Math.max(u,c.start||0)-o,T=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,y=(T==null||(h=T.details)==null?void 0:h.live)?T.details.targetduration*2:Fs,x=this.fragmentTracker.getPartialFragment(o);if(C>0&&(C<=y||x)){i.paused||this._trySkipBufferHole(x);return}}const d=self.performance.now();if(s===null){this.stalled=d;return}const f=d-s;if(!a&&f>=KC&&(this._reportStall(c),!this.media))return;const g=Ve.bufferInfo(i,o,n.maxBufferHole);this._tryFixBufferStall(g,f)}_tryFixBufferStall(e,t){const{config:n,fragmentTracker:i,media:s}=this;if(s===null)return;const o=s.currentTime,a=i.getPartialFragment(o);a&&(this._trySkipBufferHole(a)||!this.media)||(e.len>n.maxBufferHole||e.nextStart&&e.nextStart-o<n.maxBufferHole)&&t>n.highBufferWatchdogPeriod*1e3&&(U.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}_reportStall(e){const{hls:t,media:n,stallReported:i}=this;if(!i&&n){this.stallReported=!0;const s=new Error(`Playback stalling at @${n.currentTime} due to low buffer (${JSON.stringify(e)})`);U.warn(s.message),t.trigger(I.ERROR,{type:ye.MEDIA_ERROR,details:K.BUFFER_STALLED_ERROR,fatal:!1,error:s,buffer:e.len})}}_trySkipBufferHole(e){const{config:t,hls:n,media:i}=this;if(i===null)return 0;const s=i.currentTime,o=Ve.bufferInfo(i,s,0),a=s<o.start?o.start:o.nextStart;if(a){const l=o.len<=t.maxBufferHole,A=o.len>0&&o.len<1&&i.readyState<3,c=a-s;if(c>0&&(l||A)){if(c>t.maxBufferHole){const{fragmentTracker:h}=this;let d=!1;if(s===0){const f=h.getAppendedFrag(0,Ee.MAIN);f&&a<f.end&&(d=!0)}if(!d){const f=e||h.getAppendedFrag(s,Ee.MAIN);if(f){let g=!1,p=f.end;for(;p<a;){const C=h.getPartialFragment(p);if(C)p+=C.duration;else{g=!0;break}}if(g)return 0}}}const u=Math.max(a+WC,s+JC);if(U.warn(`skipping hole, adjusting currentTime from ${s} to ${u}`),this.moved=!0,this.stalled=null,i.currentTime=u,e&&!e.gap){const h=new Error(`fragment loaded with buffer holes, seeking from ${s} to ${u}`);n.trigger(I.ERROR,{type:ye.MEDIA_ERROR,details:K.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:h,reason:h.message,frag:e})}return u}}return 0}_tryNudgeBuffer(){const{config:e,hls:t,media:n,nudgeRetry:i}=this;if(n===null)return;const s=n.currentTime;if(this.nudgeRetry++,i<e.nudgeMaxRetry){const o=s+(i+1)*e.nudgeOffset,a=new Error(`Nudging 'currentTime' from ${s} to ${o}`);U.warn(a.message),n.currentTime=o,t.trigger(I.ERROR,{type:ye.MEDIA_ERROR,details:K.BUFFER_NUDGE_ON_STALL,error:a,fatal:!1})}else{const o=new Error(`Playhead still not moving while enough data buffered @${s} after ${e.nudgeMaxRetry} nudges`);U.error(o.message),t.trigger(I.ERROR,{type:ye.MEDIA_ERROR,details:K.BUFFER_STALLED_ERROR,error:o,fatal:!0})}}}const XC=100;class jC extends ma{constructor(e,t,n){super(e,t,n,"[stream-controller]",Ee.MAIN),this.audioCodecSwap=!1,this.gapController=null,this.level=-1,this._forceStartLoad=!1,this.altAudio=!1,this.audioOnly=!1,this.fragPlaying=null,this.onvplaying=null,this.onvseeked=null,this.fragLastKbps=0,this.couldBacktrack=!1,this.backtrackFragment=null,this.audioCodecSwitch=!1,this.videoBuffer=null,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(I.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(I.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(I.MANIFEST_LOADING,this.onManifestLoading,this),e.on(I.MANIFEST_PARSED,this.onManifestParsed,this),e.on(I.LEVEL_LOADING,this.onLevelLoading,this),e.on(I.LEVEL_LOADED,this.onLevelLoaded,this),e.on(I.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(I.ERROR,this.onError,this),e.on(I.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(I.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(I.BUFFER_CREATED,this.onBufferCreated,this),e.on(I.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(I.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(I.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(I.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(I.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(I.MANIFEST_LOADING,this.onManifestLoading,this),e.off(I.MANIFEST_PARSED,this.onManifestParsed,this),e.off(I.LEVEL_LOADED,this.onLevelLoaded,this),e.off(I.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(I.ERROR,this.onError,this),e.off(I.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(I.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(I.BUFFER_CREATED,this.onBufferCreated,this),e.off(I.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(I.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(I.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this._unregisterListeners(),super.onHandlerDestroying()}startLoad(e){if(this.levels){const{lastCurrentTime:t,hls:n}=this;if(this.stopLoad(),this.setInterval(XC),this.level=-1,!this.startFragRequested){let i=n.startLevel;i===-1&&(n.config.testBandwidth&&this.levels.length>1?(i=0,this.bitrateTest=!0):i=n.firstAutoLevel),n.nextLoadLevel=i,this.level=n.loadLevel,this.loadedmetadata=!1}t>0&&e===-1&&(this.log(`Override startPosition with lastCurrentTime @${t.toFixed(3)}`),e=t),this.state=te.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this._forceStartLoad=!0,this.state=te.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case te.WAITING_LEVEL:{const{levels:t,level:n}=this,i=t==null?void 0:t[n],s=i==null?void 0:i.details;if(s&&(!s.live||this.levelLastLoaded===i)){if(this.waitForCdnTuneIn(s))break;this.state=te.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=te.IDLE;break}break}case te.FRAG_LOADING_WAITING_RETRY:{var e;const t=self.performance.now(),n=this.retryDate;if(!n||t>=n||(e=this.media)!=null&&e.seeking){const{levels:i,level:s}=this,o=i==null?void 0:i[s];this.resetStartWhenNotLoaded(o||null),this.state=te.IDLE}}break}this.state===te.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){super.onTickEnd(),this.checkBuffer(),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:t,levels:n,media:i}=this;if(t===null||!i&&(this.startFragRequested||!e.config.startFragPrefetch)||this.altAudio&&this.audioOnly)return;const s=e.nextLoadLevel;if(!(n!=null&&n[s]))return;const o=n[s],a=this.getMainFwdBufferInfo();if(a===null)return;const l=this.getLevelDetails();if(l&&this._streamEnded(a,l)){const g={};this.altAudio&&(g.type="video"),this.hls.trigger(I.BUFFER_EOS,g),this.state=te.ENDED;return}e.loadLevel!==s&&e.manualLevel===-1&&this.log(`Adapting to level ${s} from level ${this.level}`),this.level=e.nextLoadLevel=s;const A=o.details;if(!A||this.state===te.WAITING_LEVEL||A.live&&this.levelLastLoaded!==o){this.level=s,this.state=te.WAITING_LEVEL;return}const c=a.len,u=this.getMaxBufferLength(o.maxBitrate);if(c>=u)return;this.backtrackFragment&&this.backtrackFragment.start>a.end&&(this.backtrackFragment=null);const h=this.backtrackFragment?this.backtrackFragment.start:a.end;let d=this.getNextFragment(h,A);if(this.couldBacktrack&&!this.fragPrevious&&d&&d.sn!=="initSegment"&&this.fragmentTracker.getState(d)!==ht.OK){var f;const p=((f=this.backtrackFragment)!=null?f:d).sn-A.startSN,C=A.fragments[p-1];C&&d.cc===C.cc&&(d=C,this.fragmentTracker.removeFragment(C))}else this.backtrackFragment&&a.len&&(this.backtrackFragment=null);if(d&&this.isLoopLoading(d,h)){if(!d.gap){const p=this.audioOnly&&!this.altAudio?He.AUDIO:He.VIDEO,C=(p===He.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;C&&this.afterBufferFlushed(C,p,Ee.MAIN)}d=this.getNextFragmentLoopLoading(d,A,a,Ee.MAIN,u)}d&&(d.initSegment&&!d.initSegment.data&&!this.bitrateTest&&(d=d.initSegment),this.loadFragment(d,o,h))}loadFragment(e,t,n){const i=this.fragmentTracker.getState(e);this.fragCurrent=e,i===ht.NOT_LOADED||i===ht.PARTIAL?e.sn==="initSegment"?this._loadInitSegment(e,t):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,t)):(this.startFragRequested=!0,super.loadFragment(e,t,n)):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,Ee.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:t}=this;if(t!=null&&t.readyState){let n;const i=this.getAppendedFrag(t.currentTime);i&&i.start>1&&this.flushMainBuffer(0,i.start-1);const s=this.getLevelDetails();if(s!=null&&s.live){const a=this.getMainFwdBufferInfo();if(!a||a.len<s.targetduration*2)return}if(!t.paused&&e){const a=this.hls.nextLoadLevel,l=e[a],A=this.fragLastKbps;A&&this.fragCurrent?n=this.fragCurrent.duration*l.maxBitrate/(1e3*A)+1:n=0}else n=0;const o=this.getBufferedFrag(t.currentTime+n);if(o){const a=this.followingBufferedFrag(o);if(a){this.abortCurrentFrag();const l=a.maxStartPTS?a.maxStartPTS:a.start,A=a.duration,c=Math.max(o.end,l+Math.min(Math.max(A-this.config.maxFragLookUpTolerance,A*(this.couldBacktrack?.5:.125)),A*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(c,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 te.KEY_LOADING:case te.FRAG_LOADING:case te.FRAG_LOADING_WAITING_RETRY:case te.PARSING:case te.PARSED:this.state=te.IDLE;break}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(e,t){super.flushMainBuffer(e,t,this.altAudio?"video":null)}onMediaAttached(e,t){super.onMediaAttached(e,t);const n=t.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 qC(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,t=e?e.currentTime:null;he(t)&&this.log(`Media seeked to ${t.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(I.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=!1,this.startPosition=this.lastCurrentTime=this.fragLastKbps=0,this.levels=this.fragPlaying=this.backtrackFragment=this.levelLastLoaded=null,this.altAudio=this.audioOnly=this.startFragRequested=!1}onManifestParsed(e,t){let n=!1,i=!1;t.levels.forEach(s=>{const o=s.audioCodec;o&&(n=n||o.indexOf("mp4a.40.2")!==-1,i=i||o.indexOf("mp4a.40.5")!==-1)}),this.audioCodecSwitch=n&&i&&!VC(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1}onLevelLoading(e,t){const{levels:n}=this;if(!n||this.state!==te.IDLE)return;const i=n[t.level];(!i.details||i.details.live&&this.levelLastLoaded!==i||this.waitForCdnTuneIn(i.details))&&(this.state=te.WAITING_LEVEL)}onLevelLoaded(e,t){var n;const{levels:i}=this,s=t.level,o=t.details,a=o.totalduration;if(!i){this.warn(`Levels were reset while loading level ${s}`);return}this.log(`Level ${s} loaded [${o.startSN},${o.endSN}]${o.lastPartSn?`[part-${o.lastPartSn}-${o.lastPartIndex}]`:""}, cc [${o.startCC}, ${o.endCC}] duration:${a}`);const l=i[s],A=this.fragCurrent;A&&(this.state===te.FRAG_LOADING||this.state===te.FRAG_LOADING_WAITING_RETRY)&&A.level!==t.level&&A.loader&&this.abortCurrentFrag();let c=0;if(o.live||(n=l.details)!=null&&n.live){var u;if(this.checkLiveUpdate(o),o.deltaUpdateFailed)return;c=this.alignPlaylists(o,l.details,(u=this.levelLastLoaded)==null?void 0:u.details)}if(l.details=o,this.levelLastLoaded=l,this.hls.trigger(I.LEVEL_UPDATED,{details:o,level:s}),this.state===te.WAITING_LEVEL){if(this.waitForCdnTuneIn(o))return;this.state=te.IDLE}this.startFragRequested?o.live&&this.synchronizeToLiveEdge(o):this.setStartPosition(o,c),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:n,part:i,payload:s}=e,{levels:o}=this;if(!o){this.warn(`Levels were reset while fragment load was in progress. Fragment ${n.sn} of level ${n.level} will not be buffered`);return}const a=o[n.level],l=a.details;if(!l){this.warn(`Dropping fragment ${n.sn} of level ${n.level} after level details were reset`),this.fragmentTracker.removeFragment(n);return}const A=a.videoCodec,c=l.PTSKnown||!l.live,u=(t=n.initSegment)==null?void 0:t.data,h=this._getAudioCodec(a),d=this.transmuxer=this.transmuxer||new Ou(this.hls,Ee.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),f=i?i.index:-1,g=f!==-1,p=new ga(n.level,n.sn,n.stats.chunkCount,s.byteLength,f,g),C=this.initPTS[n.cc];d.push(s,u,h,A,n,i,l.totalduration,c,p,C)}onAudioTrackSwitching(e,t){const n=this.altAudio;if(!!!t.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 o=this.fragCurrent;o&&(this.log("Switching to main audio track, cancel main fragment load"),o.abortRequests(),this.fragmentTracker.removeFragment(o)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();const s=this.hls;n&&(s.trigger(I.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null}),this.fragmentTracker.removeAllFragments()),s.trigger(I.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const n=t.id,i=!!this.hls.audioTracks[n].url;if(i){const s=this.videoBuffer;s&&this.mediaBuffer!==s&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=s)}this.altAudio=i,this.tick()}onBufferCreated(e,t){const n=t.tracks;let i,s,o=!1;for(const a in n){const l=n[a];if(l.id==="main"){if(s=a,i=l,a==="video"){const A=n[a];A&&(this.videoBuffer=A.buffer)}}else o=!0}o&&i?(this.log(`Alternate track found, use ${s}.buffered to schedule main fragment loading`),this.mediaBuffer=i.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:n,part:i}=t;if(n&&n.type!==Ee.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===te.PARSED&&(this.state=te.IDLE);return}const s=i?i.stats:n.stats;this.fragLastKbps=Math.round(8*s.total/(s.buffering.end-s.loading.first)),n.sn!=="initSegment"&&(this.fragPrevious=n),this.fragBufferedComplete(n,i)}onError(e,t){var n;if(t.fatal){this.state=te.ERROR;return}switch(t.details){case K.FRAG_GAP:case K.FRAG_PARSING_ERROR:case K.FRAG_DECRYPT_ERROR:case K.FRAG_LOAD_ERROR:case K.FRAG_LOAD_TIMEOUT:case K.KEY_LOAD_ERROR:case K.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(Ee.MAIN,t);break;case K.LEVEL_LOAD_ERROR:case K.LEVEL_LOAD_TIMEOUT:case K.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===te.WAITING_LEVEL&&((n=t.context)==null?void 0:n.type)===Oe.LEVEL&&(this.state=te.IDLE);break;case K.BUFFER_APPEND_ERROR:case K.BUFFER_FULL_ERROR:if(!t.parent||t.parent!=="main")return;if(t.details===K.BUFFER_APPEND_ERROR){this.resetLoadingState();return}this.reduceLengthAndFlushBuffer(t)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case K.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}checkBuffer(){const{media:e,gapController:t}=this;if(!(!e||!t||!e.readyState)){if(this.loadedmetadata||!Ve.getBuffered(e).length){const n=this.state!==te.IDLE?this.fragCurrent:null;t.poll(this.lastCurrentTime,n)}this.lastCurrentTime=e.currentTime}}onFragLoadEmergencyAborted(){this.state=te.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==He.AUDIO||this.audioOnly&&!this.altAudio){const n=(t===He.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(n,t,Ee.MAIN),this.tick()}}onLevelsUpdated(e,t){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level),this.levels=t.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:e}=this;if(!e)return;const t=e.currentTime;let n=this.startPosition;if(n>=0&&t<n){if(e.seeking){this.log(`could not seek to ${n}, already seeking at ${t}`);return}const i=Ve.getBuffered(e),o=(i.length?i.start(0):0)-n;o>0&&(o<this.config.maxBufferHole||o<this.config.maxFragLookUpTolerance)&&(this.log(`adjusting start position by ${o} to match buffer start`),n+=o,this.startPosition=n),this.log(`seek to target start position ${n} from current time ${t}`),e.currentTime=n}}_getAudioCodec(e){let t=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&t&&(this.log("Swapping audio codec"),t.indexOf("mp4a.40.5")!==-1?t="mp4a.40.2":t="mp4a.40.5"),t}_loadBitrateTestFrag(e,t){e.bitrateTest=!0,this._doFragLoad(e,t).then(n=>{const{hls:i}=this;if(!n||this.fragContextChanged(e))return;t.fragmentError=0,this.state=te.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const s=e.stats;s.parsing.start=s.parsing.end=s.buffering.start=s.buffering.end=self.performance.now(),i.trigger(I.FRAG_LOADED,n),e.bitrateTest=!1})}_handleTransmuxComplete(e){var t;const n="main",{hls:i}=this,{remuxResult:s,chunkMeta:o}=e,a=this.getCurrentContext(o);if(!a){this.resetWhenMissingContext(o);return}const{frag:l,part:A,level:c}=a,{video:u,text:h,id3:d,initSegment:f}=s,{details:g}=c,p=this.altAudio?void 0:s.audio;if(this.fragContextChanged(l)){this.fragmentTracker.removeFragment(l);return}if(this.state=te.PARSING,f){if(f!=null&&f.tracks){const b=l.initSegment||l;this._bufferInitSegment(c,f.tracks,b,o),i.trigger(I.FRAG_PARSING_INIT_SEGMENT,{frag:b,id:n,tracks:f.tracks})}const C=f.initPTS,T=f.timescale;he(C)&&(this.initPTS[l.cc]={baseTime:C,timescale:T},i.trigger(I.INIT_PTS_FOUND,{frag:l,id:n,initPTS:C,timescale:T}))}if(u&&g&&l.sn!=="initSegment"){const C=g.fragments[l.sn-1-g.startSN],T=l.sn===g.startSN,b=!C||l.cc>C.cc;if(s.independent!==!1){const{startPTS:y,endPTS:x,startDTS:R,endDTS:k}=u;if(A)A.elementaryStreams[u.type]={startPTS:y,endPTS:x,startDTS:R,endDTS:k};else if(u.firstKeyFrame&&u.independent&&o.id===1&&!b&&(this.couldBacktrack=!0),u.dropped&&u.independent){const $=this.getMainFwdBufferInfo(),V=($?$.end:this.getLoadPosition())+this.config.maxBufferHole,O=u.firstKeyFramePTS?u.firstKeyFramePTS:y;if(!T&&V<O-this.config.maxBufferHole&&!b){this.backtrack(l);return}else b&&(l.gap=!0);l.setElementaryStreamInfo(u.type,l.start,x,l.start,k,!0)}else T&&y>Fs&&(l.gap=!0);l.setElementaryStreamInfo(u.type,y,x,R,k),this.backtrackFragment&&(this.backtrackFragment=l),this.bufferFragmentData(u,l,A,o,T||b)}else if(T||b)l.gap=!0;else{this.backtrack(l);return}}if(p){const{startPTS:C,endPTS:T,startDTS:b,endDTS:y}=p;A&&(A.elementaryStreams[He.AUDIO]={startPTS:C,endPTS:T,startDTS:b,endDTS:y}),l.setElementaryStreamInfo(He.AUDIO,C,T,b,y),this.bufferFragmentData(p,l,A,o)}if(g&&d!=null&&(t=d.samples)!=null&&t.length){const C={id:n,frag:l,details:g,samples:d.samples};i.trigger(I.FRAG_PARSING_METADATA,C)}if(g&&h){const C={id:n,frag:l,details:g,samples:h.samples};i.trigger(I.FRAG_PARSING_USERDATA,C)}}_bufferInitSegment(e,t,n,i){if(this.state!==te.PARSING)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&delete t.audio;const{audio:s,video:o,audiovideo:a}=t;if(s){let l=e.audioCodec;const A=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){l&&(l.indexOf("mp4a.40.5")!==-1?l="mp4a.40.2":l="mp4a.40.5");const c=s.metadata;c&&"channelCount"in c&&(c.channelCount||1)!==1&&A.indexOf("firefox")===-1&&(l="mp4a.40.5")}l&&l.indexOf("mp4a.40.5")!==-1&&A.indexOf("android")!==-1&&s.container!=="audio/mpeg"&&(l="mp4a.40.2",this.log(`Android: force audio codec to ${l}`)),e.audioCodec&&e.audioCodec!==l&&this.log(`Swapping manifest audio codec "${e.audioCodec}" for "${l}"`),s.levelCodec=l,s.id="main",this.log(`Init audio buffer, container:${s.container}, codecs[selected/level/parsed]=[${l||""}/${e.audioCodec||""}/${s.codec}]`)}o&&(o.levelCodec=e.videoCodec,o.id="main",this.log(`Init video buffer, container:${o.container}, codecs[level/parsed]=[${e.videoCodec||""}/${o.codec}]`)),a&&this.log(`Init audiovideo buffer, container:${a.container}, codecs[level/parsed]=[${e.codecs}/${a.codec}]`),this.hls.trigger(I.BUFFER_CODECS,t),Object.keys(t).forEach(l=>{const c=t[l].initSegment;c!=null&&c.byteLength&&this.hls.trigger(I.BUFFER_APPENDING,{type:l,data:c,frag:n,part:null,chunkMeta:i,parent:n.type})}),this.tickImmediate()}getMainFwdBufferInfo(){return this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,Ee.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=te.IDLE}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&e.seeking===!1){const n=e.currentTime;if(Ve.isBuffered(e,n)?t=this.getAppendedFrag(n):Ve.isBuffered(e,n+.1)&&(t=this.getAppendedFrag(n+.1)),t){this.backtrackFragment=null;const i=this.fragPlaying,s=t.level;(!i||t.sn!==i.sn||i.level!==s)&&(this.fragPlaying=t,this.hls.trigger(I.FRAG_CHANGED,{frag:t}),(!i||i.level!==s)&&this.hls.trigger(I.LEVEL_SWITCHED,{level:s}))}}}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 t=e.currentTime,n=this.currentFrag;if(n&&he(t)&&he(n.programDateTime)){const i=n.programDateTime+(t-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 yr{static get version(){return"1.5.11"}static isMSESupported(){return yh()}static isSupported(){return YC()}static getMediaSource(){return qr()}static get Events(){return I}static get ErrorTypes(){return ye}static get ErrorDetails(){return K}static get DefaultConfig(){return yr.defaultConfig?yr.defaultConfig:Ih}static set DefaultConfig(e){yr.defaultConfig=e}constructor(e={}){this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this.started=!1,this._emitter=new ba,this._autoLevelCapping=-1,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,this.triggeringException=void 0,Op(e.debug||!1,"Hls instance");const t=this.config=UC(yr.DefaultConfig,e);this.userConfig=e,t.progressive&&GC(t);const{abrController:n,bufferController:i,capLevelController:s,errorController:o,fpsController:a}=t,l=new o(this),A=this.abrController=new n(this),c=this.bufferController=new i(this),u=this.capLevelController=new s(this),h=new a(this),d=new Lm(this),f=new Pm(this),g=t.contentSteeringController,p=g?new g(this):null,C=this.levelController=new HC(this,p),T=new dE(this),b=new $C(this.config),y=this.streamController=new jC(this,T,b);u.setStreamController(y),h.setStreamController(y);const x=[d,C,y];p&&x.splice(1,0,p),this.networkControllers=x;const R=[A,c,u,h,f,T];this.audioTrackController=this.createController(t.audioTrackController,x);const k=t.audioStreamController;k&&x.push(new k(this,T,b)),this.subtitleTrackController=this.createController(t.subtitleTrackController,x);const $=t.subtitleStreamController;$&&x.push(new $(this,T,b)),this.createController(t.timelineController,R),b.emeController=this.emeController=this.createController(t.emeController,R),this.cmcdController=this.createController(t.cmcdController,R),this.latencyController=this.createController(Om,R),this.coreComponents=R,x.push(l);const V=l.onErrorOut;typeof V=="function"&&this.on(I.ERROR,V,l)}createController(e,t){if(e){const n=new e(this);return t&&t.push(n),n}return null}on(e,t,n=this){this._emitter.on(e,t,n)}once(e,t,n=this){this._emitter.once(e,t,n)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,n=this,i){this._emitter.off(e,t,n,i)}listeners(e){return this._emitter.listeners(e)}emit(e,t,n){return this._emitter.emit(e,t,n)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(n){if(U.error("An internal error happened while handling event "+e+'. Error message: "'+n.message+'". Here is a stacktrace:',n),!this.triggeringException){this.triggeringException=!0;const i=e===I.ERROR;this.trigger(I.ERROR,{type:ye.OTHER_ERROR,details:K.INTERNAL_EXCEPTION,fatal:i,event:e,error:n}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){U.log("destroy"),this.trigger(I.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(t=>t.destroy()),this.networkControllers.length=0,this.coreComponents.forEach(t=>t.destroy()),this.coreComponents.length=0;const e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}attachMedia(e){U.log("attachMedia"),this._media=e,this.trigger(I.MEDIA_ATTACHING,{media:e})}detachMedia(){U.log("detachMedia"),this.trigger(I.MEDIA_DETACHING,void 0),this._media=null}loadSource(e){this.stopLoad();const t=this.media,n=this.url,i=this.url=Vo.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,U.log(`loadSource:${i}`),t&&n&&(n!==i||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(I.MANIFEST_LOADING,{url:e})}startLoad(e=-1){U.log(`startLoad(${e})`),this.started=!0,this.networkControllers.forEach(t=>{t.startLoad(e)})}stopLoad(){U.log("stopLoad"),this.started=!1,this.networkControllers.forEach(e=>{e.stopLoad()})}resumeBuffering(){this.started&&this.networkControllers.forEach(e=>{"fragmentLoader"in e&&e.startLoad(-1)})}pauseBuffering(){this.networkControllers.forEach(e=>{"fragmentLoader"in e&&e.stopLoad()})}swapAudioCodec(){U.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){U.log("recoverMediaError");const e=this._media;this.detachMedia(),e&&this.attachMedia(e)}removeLevel(e){this.levelController.removeLevel(e)}get levels(){const e=this.levelController.levels;return e||[]}get currentLevel(){return this.streamController.currentLevel}set currentLevel(e){U.log(`set currentLevel:${e}`),this.levelController.manualLevel=e,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){U.log(`set nextLevel:${e}`),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){U.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){U.log(`set firstLevel:${e}`),this.levelController.firstLevel=e}get startLevel(){const e=this.levelController.startLevel;return e===-1&&this.abrController.forcedAutoLevel>-1?this.abrController.forcedAutoLevel:e}set startLevel(e){U.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 t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimate():NaN}set bandwidthEstimate(e){this.abrController.resetEstimator(e)}get ttfbEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimateTTFB():NaN}set autoLevelCapping(e){this._autoLevelCapping!==e&&(U.log(`set autoLevelCapping:${e}`),this._autoLevelCapping=e,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){Um(e)&&this._maxHdcpLevel!==e&&(this._maxHdcpLevel=e,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return this.levelController.manualLevel===-1}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:e,config:{minAutoBitrate:t}}=this;if(!e)return 0;const n=e.length;for(let i=0;i<n;i++)if(e[i].maxBitrate>=t)return i;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:n}=this;let i;if(t===-1&&e!=null&&e.length?i=e.length-1:i=t,n)for(let s=i;s--;){const o=e[s].attrs["HDCP-LEVEL"];if(o&&o<=n)return s}return i}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(e){this.abrController.nextAutoLevel=e}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}setAudioOption(e){var t;return(t=this.audioTrackController)==null?void 0:t.setAudioOption(e)}setSubtitleOption(e){var t;return(t=this.subtitleTrackController)==null||t.setSubtitleOption(e),null}get allAudioTracks(){const e=this.audioTrackController;return e?e.allAudioTracks:[]}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 t=this.audioTrackController;t&&(t.audioTrack=e)}get allSubtitleTracks(){const e=this.subtitleTrackController;return e?e.allSubtitleTracks:[]}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 t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}get subtitleDisplay(){const e=this.subtitleTrackController;return e?e.subtitleDisplay:!1}set subtitleDisplay(e){const t=this.subtitleTrackController;t&&(t.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}}yr.defaultConfig=void 0;function zC(r){return r&&r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function ZC(r){return r}function ev(r,e){e=e||{};const t=e.delimiter||".",n=e.maxDepth,i=e.transformKey||ZC,s={};function o(a,l,A){A=A||1,Object.keys(a).forEach(function(c){const u=a[c],h=e.safe&&Array.isArray(u),d=Object.prototype.toString.call(u),f=zC(u),g=d==="[object Object]"||d==="[object Array]",p=l?l+t+i(c):i(c);if(!h&&!f&&g&&Object.keys(u).length&&(!e.maxDepth||A<n))return o(u,p,A+1);s[p]=u})}return o(r),s}var Bh=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function tv(r,e){return!!(r===e||Bh(r)&&Bh(e))}function rv(r,e){if(r.length!==e.length)return!1;for(var t=0;t<r.length;t++)if(!tv(r[t],e[t]))return!1;return!0}function nv(r,e){e===void 0&&(e=rv);var t=null;function n(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];if(t&&t.lastThis===this&&e(i,t.lastArgs))return t.lastResult;var o=r.apply(this,i);return t={lastResult:o,lastArgs:i,lastThis:this},o}return n.clear=function(){t=null},n}/**
|
2489
2489
|
* @license
|
2490
2490
|
* Copyright 2017 Google LLC
|
2491
2491
|
* SPDX-License-Identifier: BSD-3-Clause
|
2492
|
-
*/const Qh=(r,e,t)=>{const n=new Map;for(let i=e;i<=t;i++)n.set(r[i],i);return n},Th=un(class extends qn{constructor(r){if(super(r),r.type!==cn.CHILD)throw Error("repeat() can only be used in text expressions")}dt(r,e,t){let n;t===void 0?t=e:e!==void 0&&(n=e);const i=[],s=[];let o=0;for(const a of r)i[o]=n?n(a,o):o,s[o]=t(a,o),o++;return{values:s,keys:i}}render(r,e,t){return this.dt(r,e,t).values}update(r,[e,t,n]){const i=Yd(r),{values:s,keys:o}=this.dt(e,t,n);if(!Array.isArray(i))return this.ut=o,s;const a=this.ut??(this.ut=[]),A=[];let l,c,u=0,h=i.length-1,d=0,f=s.length-1;for(;u<=h&&d<=f;)if(i[u]===null)u++;else if(i[h]===null)h--;else if(a[u]===o[d])A[d]=Gr(i[u],s[d]),u++,d++;else if(a[h]===o[f])A[f]=Gr(i[h],s[f]),h--,f--;else if(a[u]===o[f])A[f]=Gr(i[u],s[f]),Wn(r,A[f+1],i[u]),u++,f--;else if(a[h]===o[d])A[d]=Gr(i[h],s[d]),Wn(r,i[u],i[h]),h--,d++;else if(l===void 0&&(l=Qh(o,d,f),c=Qh(a,u,h)),l.has(a[u]))if(l.has(a[h])){const g=c.get(o[d]),p=g!==void 0?i[g]:null;if(p===null){const v=Wn(r,i[u]);Gr(v,s[d]),A[d]=v}else A[d]=Gr(p,s[d]),Wn(r,i[u],p),i[g]=null;d++}else io(i[h]),h--;else io(i[u]),u++;for(;d<=f;){const g=Wn(r,A[f+1]);Gr(g,s[d]),A[d++]=g}for(;u<=h;){const g=i[u++];g!==null&&io(g)}return this.ut=o,$d(r,A),Vt}});var _t="top",Ht="bottom",$t="right",Lt="left",Ya="auto",ci=[_t,Ht,$t,Lt],wn="start",ui="end",iv="clippingParents",bh="viewport",hi="popper",sv="reference",xh=ci.reduce(function(r,e){return r.concat([e+"-"+wn,e+"-"+ui])},[]),wh=[].concat(ci,[Ya]).reduce(function(r,e){return r.concat([e,e+"-"+wn,e+"-"+ui])},[]),ov="beforeRead",av="read",Av="afterRead",lv="beforeMain",cv="main",uv="afterMain",hv="beforeWrite",dv="write",fv="afterWrite",gv=[ov,av,Av,lv,cv,uv,hv,dv,fv];function Ar(r){return r?(r.nodeName||"").toLowerCase():null}function kt(r){if(r==null)return window;if(r.toString()!=="[object Window]"){var e=r.ownerDocument;return e&&e.defaultView||window}return r}function jr(r){var e=kt(r).Element;return r instanceof e||r instanceof Element}function Yt(r){var e=kt(r).HTMLElement;return r instanceof e||r instanceof HTMLElement}function Va(r){if(typeof ShadowRoot>"u")return!1;var e=kt(r).ShadowRoot;return r instanceof e||r instanceof ShadowRoot}function pv(r){var e=r.state;Object.keys(e.elements).forEach(function(t){var n=e.styles[t]||{},i=e.attributes[t]||{},s=e.elements[t];!Yt(s)||!Ar(s)||(Object.assign(s.style,n),Object.keys(i).forEach(function(o){var a=i[o];a===!1?s.removeAttribute(o):s.setAttribute(o,a===!0?"":a)}))})}function mv(r){var e=r.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(n){var i=e.elements[n],s=e.attributes[n]||{},o=Object.keys(e.styles.hasOwnProperty(n)?e.styles[n]:t[n]),a=o.reduce(function(A,l){return A[l]="",A},{});!Yt(i)||!Ar(i)||(Object.assign(i.style,a),Object.keys(s).forEach(function(A){i.removeAttribute(A)}))})}}const Sh={name:"applyStyles",enabled:!0,phase:"write",fn:pv,effect:mv,requires:["computeStyles"]};function lr(r){return r.split("-")[0]}var zr=Math.max,ks=Math.min,Sn=Math.round;function Ka(){var r=navigator.userAgentData;return r!=null&&r.brands&&Array.isArray(r.brands)?r.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Rh(){return!/^((?!chrome|android).)*safari/i.test(Ka())}function Rn(r,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var n=r.getBoundingClientRect(),i=1,s=1;e&&Yt(r)&&(i=r.offsetWidth>0&&Sn(n.width)/r.offsetWidth||1,s=r.offsetHeight>0&&Sn(n.height)/r.offsetHeight||1);var o=jr(r)?kt(r):window,a=o.visualViewport,A=!Rh()&&t,l=(n.left+(A&&a?a.offsetLeft:0))/i,c=(n.top+(A&&a?a.offsetTop:0))/s,u=n.width/i,h=n.height/s;return{width:u,height:h,top:c,right:l+u,bottom:c+h,left:l,x:l,y:c}}function Ja(r){var e=Rn(r),t=r.offsetWidth,n=r.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:r.offsetLeft,y:r.offsetTop,width:t,height:n}}function Dh(r,e){var t=e.getRootNode&&e.getRootNode();if(r.contains(e))return!0;if(t&&Va(t)){var n=e;do{if(n&&r.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Br(r){return kt(r).getComputedStyle(r)}function Ev(r){return["table","td","th"].indexOf(Ar(r))>=0}function _r(r){return((jr(r)?r.ownerDocument:r.document)||window.document).documentElement}function Ns(r){return Ar(r)==="html"?r:r.assignedSlot||r.parentNode||(Va(r)?r.host:null)||_r(r)}function _h(r){return!Yt(r)||Br(r).position==="fixed"?null:r.offsetParent}function Iv(r){var e=/firefox/i.test(Ka()),t=/Trident/i.test(Ka());if(t&&Yt(r)){var n=Br(r);if(n.position==="fixed")return null}var i=Ns(r);for(Va(i)&&(i=i.host);Yt(i)&&["html","body"].indexOf(Ar(i))<0;){var s=Br(i);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return i;i=i.parentNode}return null}function di(r){for(var e=kt(r),t=_h(r);t&&Ev(t)&&Br(t).position==="static";)t=_h(t);return t&&(Ar(t)==="html"||Ar(t)==="body"&&Br(t).position==="static")?e:t||Iv(r)||e}function Wa(r){return["top","bottom"].indexOf(r)>=0?"x":"y"}function fi(r,e,t){return zr(r,ks(e,t))}function Cv(r,e,t){var n=fi(r,e,t);return n>t?t:n}function Lh(){return{top:0,right:0,bottom:0,left:0}}function Fh(r){return Object.assign({},Lh(),r)}function kh(r,e){return e.reduce(function(t,n){return t[n]=r,t},{})}var vv=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,Fh(typeof e!="number"?e:kh(e,ci))};function yv(r){var e,t=r.state,n=r.name,i=r.options,s=t.elements.arrow,o=t.modifiersData.popperOffsets,a=lr(t.placement),A=Wa(a),l=[Lt,$t].indexOf(a)>=0,c=l?"height":"width";if(!(!s||!o)){var u=vv(i.padding,t),h=Ja(s),d=A==="y"?_t:Lt,f=A==="y"?Ht:$t,g=t.rects.reference[c]+t.rects.reference[A]-o[A]-t.rects.popper[c],p=o[A]-t.rects.reference[A],v=di(s),T=v?A==="y"?v.clientHeight||0:v.clientWidth||0:0,b=g/2-p/2,y=u[d],w=T-h[c]-u[f],R=T/2-h[c]/2+b,k=fi(y,R,w),$=A;t.modifiersData[n]=(e={},e[$]=k,e.centerOffset=k-R,e)}}function Bv(r){var e=r.state,t=r.options,n=t.element,i=n===void 0?"[data-popper-arrow]":n;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||Dh(e.elements.popper,i)&&(e.elements.arrow=i))}const Qv={name:"arrow",enabled:!0,phase:"main",fn:yv,effect:Bv,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Dn(r){return r.split("-")[1]}var Tv={top:"auto",right:"auto",bottom:"auto",left:"auto"};function bv(r,e){var t=r.x,n=r.y,i=e.devicePixelRatio||1;return{x:Sn(t*i)/i||0,y:Sn(n*i)/i||0}}function Nh(r){var e,t=r.popper,n=r.popperRect,i=r.placement,s=r.variation,o=r.offsets,a=r.position,A=r.gpuAcceleration,l=r.adaptive,c=r.roundOffsets,u=r.isFixed,h=o.x,d=h===void 0?0:h,f=o.y,g=f===void 0?0:f,p=typeof c=="function"?c({x:d,y:g}):{x:d,y:g};d=p.x,g=p.y;var v=o.hasOwnProperty("x"),T=o.hasOwnProperty("y"),b=Lt,y=_t,w=window;if(l){var R=di(t),k="clientHeight",$="clientWidth";if(R===kt(t)&&(R=_r(t),Br(R).position!=="static"&&a==="absolute"&&(k="scrollHeight",$="scrollWidth")),R=R,i===_t||(i===Lt||i===$t)&&s===ui){y=Ht;var W=u&&R===w&&w.visualViewport?w.visualViewport.height:R[k];g-=W-n.height,g*=A?1:-1}if(i===Lt||(i===_t||i===Ht)&&s===ui){b=$t;var O=u&&R===w&&w.visualViewport?w.visualViewport.width:R[$];d-=O-n.width,d*=A?1:-1}}var K=Object.assign({position:a},l&&Tv),ne=c===!0?bv({x:d,y:g},kt(t)):{x:d,y:g};if(d=ne.x,g=ne.y,A){var ee;return Object.assign({},K,(ee={},ee[y]=T?"0":"",ee[b]=v?"0":"",ee.transform=(w.devicePixelRatio||1)<=1?"translate("+d+"px, "+g+"px)":"translate3d("+d+"px, "+g+"px, 0)",ee))}return Object.assign({},K,(e={},e[y]=T?g+"px":"",e[b]=v?d+"px":"",e.transform="",e))}function xv(r){var e=r.state,t=r.options,n=t.gpuAcceleration,i=n===void 0?!0:n,s=t.adaptive,o=s===void 0?!0:s,a=t.roundOffsets,A=a===void 0?!0:a,l={placement:lr(e.placement),variation:Dn(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Nh(Object.assign({},l,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:A})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Nh(Object.assign({},l,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:A})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const wv={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:xv,data:{}};var Ms={passive:!0};function Sv(r){var e=r.state,t=r.instance,n=r.options,i=n.scroll,s=i===void 0?!0:i,o=n.resize,a=o===void 0?!0:o,A=kt(e.elements.popper),l=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&l.forEach(function(c){c.addEventListener("scroll",t.update,Ms)}),a&&A.addEventListener("resize",t.update,Ms),function(){s&&l.forEach(function(c){c.removeEventListener("scroll",t.update,Ms)}),a&&A.removeEventListener("resize",t.update,Ms)}}const Rv={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Sv,data:{}};var Dv={left:"right",right:"left",bottom:"top",top:"bottom"};function Ps(r){return r.replace(/left|right|bottom|top/g,function(e){return Dv[e]})}var _v={start:"end",end:"start"};function Mh(r){return r.replace(/start|end/g,function(e){return _v[e]})}function qa(r){var e=kt(r),t=e.pageXOffset,n=e.pageYOffset;return{scrollLeft:t,scrollTop:n}}function Xa(r){return Rn(_r(r)).left+qa(r).scrollLeft}function Lv(r,e){var t=kt(r),n=_r(r),i=t.visualViewport,s=n.clientWidth,o=n.clientHeight,a=0,A=0;if(i){s=i.width,o=i.height;var l=Rh();(l||!l&&e==="fixed")&&(a=i.offsetLeft,A=i.offsetTop)}return{width:s,height:o,x:a+Xa(r),y:A}}function Fv(r){var e,t=_r(r),n=qa(r),i=(e=r.ownerDocument)==null?void 0:e.body,s=zr(t.scrollWidth,t.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=zr(t.scrollHeight,t.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-n.scrollLeft+Xa(r),A=-n.scrollTop;return Br(i||t).direction==="rtl"&&(a+=zr(t.clientWidth,i?i.clientWidth:0)-s),{width:s,height:o,x:a,y:A}}function ja(r){var e=Br(r),t=e.overflow,n=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+i+n)}function Ph(r){return["html","body","#document"].indexOf(Ar(r))>=0?r.ownerDocument.body:Yt(r)&&ja(r)?r:Ph(Ns(r))}function gi(r,e){var t;e===void 0&&(e=[]);var n=Ph(r),i=n===((t=r.ownerDocument)==null?void 0:t.body),s=kt(n),o=i?[s].concat(s.visualViewport||[],ja(n)?n:[]):n,a=e.concat(o);return i?a:a.concat(gi(Ns(o)))}function za(r){return Object.assign({},r,{left:r.x,top:r.y,right:r.x+r.width,bottom:r.y+r.height})}function kv(r,e){var t=Rn(r,!1,e==="fixed");return t.top=t.top+r.clientTop,t.left=t.left+r.clientLeft,t.bottom=t.top+r.clientHeight,t.right=t.left+r.clientWidth,t.width=r.clientWidth,t.height=r.clientHeight,t.x=t.left,t.y=t.top,t}function Oh(r,e,t){return e===bh?za(Lv(r,t)):jr(e)?kv(e,t):za(Fv(_r(r)))}function Nv(r){var e=gi(Ns(r)),t=["absolute","fixed"].indexOf(Br(r).position)>=0,n=t&&Yt(r)?di(r):r;return jr(n)?e.filter(function(i){return jr(i)&&Dh(i,n)&&Ar(i)!=="body"}):[]}function Mv(r,e,t,n){var i=e==="clippingParents"?Nv(r):[].concat(e),s=[].concat(i,[t]),o=s[0],a=s.reduce(function(A,l){var c=Oh(r,l,n);return A.top=zr(c.top,A.top),A.right=ks(c.right,A.right),A.bottom=ks(c.bottom,A.bottom),A.left=zr(c.left,A.left),A},Oh(r,o,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Uh(r){var e=r.reference,t=r.element,n=r.placement,i=n?lr(n):null,s=n?Dn(n):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,A;switch(i){case _t:A={x:o,y:e.y-t.height};break;case Ht:A={x:o,y:e.y+e.height};break;case $t:A={x:e.x+e.width,y:a};break;case Lt:A={x:e.x-t.width,y:a};break;default:A={x:e.x,y:e.y}}var l=i?Wa(i):null;if(l!=null){var c=l==="y"?"height":"width";switch(s){case wn:A[l]=A[l]-(e[c]/2-t[c]/2);break;case ui:A[l]=A[l]+(e[c]/2-t[c]/2);break}}return A}function pi(r,e){e===void 0&&(e={});var t=e,n=t.placement,i=n===void 0?r.placement:n,s=t.strategy,o=s===void 0?r.strategy:s,a=t.boundary,A=a===void 0?iv:a,l=t.rootBoundary,c=l===void 0?bh:l,u=t.elementContext,h=u===void 0?hi:u,d=t.altBoundary,f=d===void 0?!1:d,g=t.padding,p=g===void 0?0:g,v=Fh(typeof p!="number"?p:kh(p,ci)),T=h===hi?sv:hi,b=r.rects.popper,y=r.elements[f?T:h],w=Mv(jr(y)?y:y.contextElement||_r(r.elements.popper),A,c,o),R=Rn(r.elements.reference),k=Uh({reference:R,element:b,strategy:"absolute",placement:i}),$=za(Object.assign({},b,k)),W=h===hi?$:R,O={top:w.top-W.top+v.top,bottom:W.bottom-w.bottom+v.bottom,left:w.left-W.left+v.left,right:W.right-w.right+v.right},K=r.modifiersData.offset;if(h===hi&&K){var ne=K[i];Object.keys(O).forEach(function(ee){var Ae=[$t,Ht].indexOf(ee)>=0?1:-1,_=[_t,Ht].indexOf(ee)>=0?"y":"x";O[ee]+=ne[_]*Ae})}return O}function Pv(r,e){e===void 0&&(e={});var t=e,n=t.placement,i=t.boundary,s=t.rootBoundary,o=t.padding,a=t.flipVariations,A=t.allowedAutoPlacements,l=A===void 0?wh:A,c=Dn(n),u=c?a?xh:xh.filter(function(f){return Dn(f)===c}):ci,h=u.filter(function(f){return l.indexOf(f)>=0});h.length===0&&(h=u);var d=h.reduce(function(f,g){return f[g]=pi(r,{placement:g,boundary:i,rootBoundary:s,padding:o})[lr(g)],f},{});return Object.keys(d).sort(function(f,g){return d[f]-d[g]})}function Ov(r){if(lr(r)===Ya)return[];var e=Ps(r);return[Mh(r),e,Mh(e)]}function Uv(r){var e=r.state,t=r.options,n=r.name;if(!e.modifiersData[n]._skip){for(var i=t.mainAxis,s=i===void 0?!0:i,o=t.altAxis,a=o===void 0?!0:o,A=t.fallbackPlacements,l=t.padding,c=t.boundary,u=t.rootBoundary,h=t.altBoundary,d=t.flipVariations,f=d===void 0?!0:d,g=t.allowedAutoPlacements,p=e.options.placement,v=lr(p),T=v===p,b=A||(T||!f?[Ps(p)]:Ov(p)),y=[p].concat(b).reduce(function(ce,pe){return ce.concat(lr(pe)===Ya?Pv(e,{placement:pe,boundary:c,rootBoundary:u,padding:l,flipVariations:f,allowedAutoPlacements:g}):pe)},[]),w=e.rects.reference,R=e.rects.popper,k=new Map,$=!0,W=y[0],O=0;O<y.length;O++){var K=y[O],ne=lr(K),ee=Dn(K)===wn,Ae=[_t,Ht].indexOf(ne)>=0,_=Ae?"width":"height",P=pi(e,{placement:K,boundary:c,rootBoundary:u,altBoundary:h,padding:l}),X=Ae?ee?$t:Lt:ee?Ht:_t;w[_]>R[_]&&(X=Ps(X));var D=Ps(X),S=[];if(s&&S.push(P[ne]<=0),a&&S.push(P[X]<=0,P[D]<=0),S.every(function(ce){return ce})){W=K,$=!1;break}k.set(K,S)}if($)for(var F=f?3:1,J=function(pe){var ge=y.find(function(Se){var Le=k.get(Se);if(Le)return Le.slice(0,pe).every(function(Ge){return Ge})});if(ge)return W=ge,"break"},Y=F;Y>0;Y--){var re=J(Y);if(re==="break")break}e.placement!==W&&(e.modifiersData[n]._skip=!0,e.placement=W,e.reset=!0)}}const Gv={name:"flip",enabled:!0,phase:"main",fn:Uv,requiresIfExists:["offset"],data:{_skip:!1}};function Gh(r,e,t){return t===void 0&&(t={x:0,y:0}),{top:r.top-e.height-t.y,right:r.right-e.width+t.x,bottom:r.bottom-e.height+t.y,left:r.left-e.width-t.x}}function Hh(r){return[_t,$t,Ht,Lt].some(function(e){return r[e]>=0})}function Hv(r){var e=r.state,t=r.name,n=e.rects.reference,i=e.rects.popper,s=e.modifiersData.preventOverflow,o=pi(e,{elementContext:"reference"}),a=pi(e,{altBoundary:!0}),A=Gh(o,n),l=Gh(a,i,s),c=Hh(A),u=Hh(l);e.modifiersData[t]={referenceClippingOffsets:A,popperEscapeOffsets:l,isReferenceHidden:c,hasPopperEscaped:u},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":u})}const $v={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Hv};function Yv(r,e,t){var n=lr(r),i=[Lt,_t].indexOf(n)>=0?-1:1,s=typeof t=="function"?t(Object.assign({},e,{placement:r})):t,o=s[0],a=s[1];return o=o||0,a=(a||0)*i,[Lt,$t].indexOf(n)>=0?{x:a,y:o}:{x:o,y:a}}function Vv(r){var e=r.state,t=r.options,n=r.name,i=t.offset,s=i===void 0?[0,0]:i,o=wh.reduce(function(c,u){return c[u]=Yv(u,e.rects,s),c},{}),a=o[e.placement],A=a.x,l=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=A,e.modifiersData.popperOffsets.y+=l),e.modifiersData[n]=o}const Kv={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Vv};function Jv(r){var e=r.state,t=r.name;e.modifiersData[t]=Uh({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const Wv={name:"popperOffsets",enabled:!0,phase:"read",fn:Jv,data:{}};function qv(r){return r==="x"?"y":"x"}function Xv(r){var e=r.state,t=r.options,n=r.name,i=t.mainAxis,s=i===void 0?!0:i,o=t.altAxis,a=o===void 0?!1:o,A=t.boundary,l=t.rootBoundary,c=t.altBoundary,u=t.padding,h=t.tether,d=h===void 0?!0:h,f=t.tetherOffset,g=f===void 0?0:f,p=pi(e,{boundary:A,rootBoundary:l,padding:u,altBoundary:c}),v=lr(e.placement),T=Dn(e.placement),b=!T,y=Wa(v),w=qv(y),R=e.modifiersData.popperOffsets,k=e.rects.reference,$=e.rects.popper,W=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,O=typeof W=="number"?{mainAxis:W,altAxis:W}:Object.assign({mainAxis:0,altAxis:0},W),K=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,ne={x:0,y:0};if(R){if(s){var ee,Ae=y==="y"?_t:Lt,_=y==="y"?Ht:$t,P=y==="y"?"height":"width",X=R[y],D=X+p[Ae],S=X-p[_],F=d?-$[P]/2:0,J=T===wn?k[P]:$[P],Y=T===wn?-$[P]:-k[P],re=e.elements.arrow,ce=d&&re?Ja(re):{width:0,height:0},pe=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Lh(),ge=pe[Ae],Se=pe[_],Le=fi(0,k[P],ce[P]),Ge=b?k[P]/2-F-Le-ge-O.mainAxis:J-Le-ge-O.mainAxis,fe=b?-k[P]/2+F+Le+Se+O.mainAxis:Y+Le+Se+O.mainAxis,Te=e.elements.arrow&&di(e.elements.arrow),Me=Te?y==="y"?Te.clientTop||0:Te.clientLeft||0:0,we=(ee=K==null?void 0:K[y])!=null?ee:0,We=X+Ge-we-Me,Be=X+fe-we,Q=fi(d?ks(D,We):D,X,d?zr(S,Be):S);R[y]=Q,ne[y]=Q-X}if(a){var m,E=y==="x"?_t:Lt,x=y==="x"?Ht:$t,M=R[w],z=w==="y"?"height":"width",j=M+p[E],Ie=M-p[x],be=[_t,Lt].indexOf(v)!==-1,De=(m=K==null?void 0:K[w])!=null?m:0,ke=be?j:M-k[z]-$[z]-De+O.altAxis,_e=be?M+k[z]+$[z]-De-O.altAxis:Ie,Ft=d&&be?Cv(ke,M,_e):fi(d?ke:j,M,d?_e:Ie);R[w]=Ft,ne[w]=Ft-M}e.modifiersData[n]=ne}}const jv={name:"preventOverflow",enabled:!0,phase:"main",fn:Xv,requiresIfExists:["offset"]};function zv(r){return{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}}function Zv(r){return r===kt(r)||!Yt(r)?qa(r):zv(r)}function ey(r){var e=r.getBoundingClientRect(),t=Sn(e.width)/r.offsetWidth||1,n=Sn(e.height)/r.offsetHeight||1;return t!==1||n!==1}function ty(r,e,t){t===void 0&&(t=!1);var n=Yt(e),i=Yt(e)&&ey(e),s=_r(e),o=Rn(r,i,t),a={scrollLeft:0,scrollTop:0},A={x:0,y:0};return(n||!n&&!t)&&((Ar(e)!=="body"||ja(s))&&(a=Zv(e)),Yt(e)?(A=Rn(e,!0),A.x+=e.clientLeft,A.y+=e.clientTop):s&&(A.x=Xa(s))),{x:o.left+a.scrollLeft-A.x,y:o.top+a.scrollTop-A.y,width:o.width,height:o.height}}function ry(r){var e=new Map,t=new Set,n=[];r.forEach(function(s){e.set(s.name,s)});function i(s){t.add(s.name);var o=[].concat(s.requires||[],s.requiresIfExists||[]);o.forEach(function(a){if(!t.has(a)){var A=e.get(a);A&&i(A)}}),n.push(s)}return r.forEach(function(s){t.has(s.name)||i(s)}),n}function ny(r){var e=ry(r);return gv.reduce(function(t,n){return t.concat(e.filter(function(i){return i.phase===n}))},[])}function iy(r){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(r())})})),e}}function sy(r){var e=r.reduce(function(t,n){var i=t[n.name];return t[n.name]=i?Object.assign({},i,n,{options:Object.assign({},i.options,n.options),data:Object.assign({},i.data,n.data)}):n,t},{});return Object.keys(e).map(function(t){return e[t]})}var $h={placement:"bottom",modifiers:[],strategy:"absolute"};function Yh(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return!e.some(function(n){return!(n&&typeof n.getBoundingClientRect=="function")})}function oy(r){r===void 0&&(r={});var e=r,t=e.defaultModifiers,n=t===void 0?[]:t,i=e.defaultOptions,s=i===void 0?$h:i;return function(a,A,l){l===void 0&&(l=s);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},$h,s),modifiersData:{},elements:{reference:a,popper:A},attributes:{},styles:{}},u=[],h=!1,d={state:c,setOptions:function(v){var T=typeof v=="function"?v(c.options):v;g(),c.options=Object.assign({},s,c.options,T),c.scrollParents={reference:jr(a)?gi(a):a.contextElement?gi(a.contextElement):[],popper:gi(A)};var b=ny(sy([].concat(n,c.options.modifiers)));return c.orderedModifiers=b.filter(function(y){return y.enabled}),f(),d.update()},forceUpdate:function(){if(!h){var v=c.elements,T=v.reference,b=v.popper;if(Yh(T,b)){c.rects={reference:ty(T,di(b),c.options.strategy==="fixed"),popper:Ja(b)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(O){return c.modifiersData[O.name]=Object.assign({},O.data)});for(var y=0;y<c.orderedModifiers.length;y++){if(c.reset===!0){c.reset=!1,y=-1;continue}var w=c.orderedModifiers[y],R=w.fn,k=w.options,$=k===void 0?{}:k,W=w.name;typeof R=="function"&&(c=R({state:c,options:$,name:W,instance:d})||c)}}}},update:iy(function(){return new Promise(function(p){d.forceUpdate(),p(c)})}),destroy:function(){g(),h=!0}};if(!Yh(a,A))return d;d.setOptions(l).then(function(p){!h&&l.onFirstUpdate&&l.onFirstUpdate(p)});function f(){c.orderedModifiers.forEach(function(p){var v=p.name,T=p.options,b=T===void 0?{}:T,y=p.effect;if(typeof y=="function"){var w=y({state:c,name:v,instance:d,options:b}),R=function(){};u.push(w||R)}})}function g(){u.forEach(function(p){return p()}),u=[]}return d}}var ay=[Rv,Wv,wv,Sh,Kv,Gv,jv,Qv,$v],Ay=oy({defaultModifiers:ay}),ly="tippy-box",Vh="tippy-content",cy="tippy-backdrop",Kh="tippy-arrow",Jh="tippy-svg-arrow",Zr={passive:!0,capture:!0},Wh=function(){return document.body};function Za(r,e,t){if(Array.isArray(r)){var n=r[e];return n??(Array.isArray(t)?t[e]:t)}return r}function eA(r,e){var t={}.toString.call(r);return t.indexOf("[object")===0&&t.indexOf(e+"]")>-1}function qh(r,e){return typeof r=="function"?r.apply(void 0,e):r}function Xh(r,e){if(e===0)return r;var t;return function(n){clearTimeout(t),t=setTimeout(function(){r(n)},e)}}function uy(r){return r.split(/\s+/).filter(Boolean)}function _n(r){return[].concat(r)}function jh(r,e){r.indexOf(e)===-1&&r.push(e)}function hy(r){return r.filter(function(e,t){return r.indexOf(e)===t})}function dy(r){return r.split("-")[0]}function Os(r){return[].slice.call(r)}function zh(r){return Object.keys(r).reduce(function(e,t){return r[t]!==void 0&&(e[t]=r[t]),e},{})}function mi(){return document.createElement("div")}function Us(r){return["Element","Fragment"].some(function(e){return eA(r,e)})}function fy(r){return eA(r,"NodeList")}function gy(r){return eA(r,"MouseEvent")}function py(r){return!!(r&&r._tippy&&r._tippy.reference===r)}function my(r){return Us(r)?[r]:fy(r)?Os(r):Array.isArray(r)?r:Os(document.querySelectorAll(r))}function tA(r,e){r.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function Zh(r,e){r.forEach(function(t){t&&t.setAttribute("data-state",e)})}function Ey(r){var e,t=_n(r),n=t[0];return n!=null&&(e=n.ownerDocument)!=null&&e.body?n.ownerDocument:document}function Iy(r,e){var t=e.clientX,n=e.clientY;return r.every(function(i){var s=i.popperRect,o=i.popperState,a=i.props,A=a.interactiveBorder,l=dy(o.placement),c=o.modifiersData.offset;if(!c)return!0;var u=l==="bottom"?c.top.y:0,h=l==="top"?c.bottom.y:0,d=l==="right"?c.left.x:0,f=l==="left"?c.right.x:0,g=s.top-n+u>A,p=n-s.bottom-h>A,v=s.left-t+d>A,T=t-s.right-f>A;return g||p||v||T})}function rA(r,e,t){var n=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){r[n](i,t)})}function ed(r,e){for(var t=e;t;){var n;if(r.contains(t))return!0;t=t.getRootNode==null||(n=t.getRootNode())==null?void 0:n.host}return!1}var cr={isTouch:!1},td=0;function Cy(){cr.isTouch||(cr.isTouch=!0,window.performance&&document.addEventListener("mousemove",rd))}function rd(){var r=performance.now();r-td<20&&(cr.isTouch=!1,document.removeEventListener("mousemove",rd)),td=r}function vy(){var r=document.activeElement;if(py(r)){var e=r._tippy;r.blur&&!e.state.isVisible&&r.blur()}}function yy(){document.addEventListener("touchstart",Cy,Zr),window.addEventListener("blur",vy)}var By=typeof window<"u"&&typeof document<"u",Qy=By?!!window.msCrypto:!1,Ty={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},by={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Xt=Object.assign({appendTo:Wh,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Ty,by),xy=Object.keys(Xt),wy=function(e){var t=Object.keys(e);t.forEach(function(n){Xt[n]=e[n]})};function nd(r){var e=r.plugins||[],t=e.reduce(function(n,i){var s=i.name,o=i.defaultValue;if(s){var a;n[s]=r[s]!==void 0?r[s]:(a=Xt[s])!=null?a:o}return n},{});return Object.assign({},r,t)}function Sy(r,e){var t=e?Object.keys(nd(Object.assign({},Xt,{plugins:e}))):xy,n=t.reduce(function(i,s){var o=(r.getAttribute("data-tippy-"+s)||"").trim();if(!o)return i;if(s==="content")i[s]=o;else try{i[s]=JSON.parse(o)}catch{i[s]=o}return i},{});return n}function id(r,e){var t=Object.assign({},e,{content:qh(e.content,[r])},e.ignoreAttributes?{}:Sy(r,e.plugins));return t.aria=Object.assign({},Xt.aria,t.aria),t.aria={expanded:t.aria.expanded==="auto"?e.interactive:t.aria.expanded,content:t.aria.content==="auto"?e.interactive?null:"describedby":t.aria.content},t}var Ry=function(){return"innerHTML"};function nA(r,e){r[Ry()]=e}function sd(r){var e=mi();return r===!0?e.className=Kh:(e.className=Jh,Us(r)?e.appendChild(r):nA(e,r)),e}function od(r,e){Us(e.content)?(nA(r,""),r.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?nA(r,e.content):r.textContent=e.content)}function iA(r){var e=r.firstElementChild,t=Os(e.children);return{box:e,content:t.find(function(n){return n.classList.contains(Vh)}),arrow:t.find(function(n){return n.classList.contains(Kh)||n.classList.contains(Jh)}),backdrop:t.find(function(n){return n.classList.contains(cy)})}}function ad(r){var e=mi(),t=mi();t.className=ly,t.setAttribute("data-state","hidden"),t.setAttribute("tabindex","-1");var n=mi();n.className=Vh,n.setAttribute("data-state","hidden"),od(n,r.props),e.appendChild(t),t.appendChild(n),i(r.props,r.props);function i(s,o){var a=iA(e),A=a.box,l=a.content,c=a.arrow;o.theme?A.setAttribute("data-theme",o.theme):A.removeAttribute("data-theme"),typeof o.animation=="string"?A.setAttribute("data-animation",o.animation):A.removeAttribute("data-animation"),o.inertia?A.setAttribute("data-inertia",""):A.removeAttribute("data-inertia"),A.style.maxWidth=typeof o.maxWidth=="number"?o.maxWidth+"px":o.maxWidth,o.role?A.setAttribute("role",o.role):A.removeAttribute("role"),(s.content!==o.content||s.allowHTML!==o.allowHTML)&&od(l,r.props),o.arrow?c?s.arrow!==o.arrow&&(A.removeChild(c),A.appendChild(sd(o.arrow))):A.appendChild(sd(o.arrow)):c&&A.removeChild(c)}return{popper:e,onUpdate:i}}ad.$$tippy=!0;var Dy=1,Gs=[],sA=[];function _y(r,e){var t=id(r,Object.assign({},Xt,nd(zh(e)))),n,i,s,o=!1,a=!1,A=!1,l=!1,c,u,h,d=[],f=Xh(We,t.interactiveDebounce),g,p=Dy++,v=null,T=hy(t.plugins),b={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},y={id:p,reference:r,popper:mi(),popperInstance:v,props:t,state:b,plugins:T,clearDelayTimeouts:ke,setProps:_e,setContent:Ft,show:ct,hide:Nt,hideWithInteractivity:dr,enable:be,disable:De,unmount:fr,destroy:Ct};if(!t.render)return y;var w=t.render(y),R=w.popper,k=w.onUpdate;R.setAttribute("data-tippy-root",""),R.id="tippy-"+y.id,y.popper=R,r._tippy=y,R._tippy=y;var $=T.map(function(q){return q.fn(y)}),W=r.hasAttribute("aria-expanded");return Te(),F(),X(),D("onCreate",[y]),t.showOnCreate&&j(),R.addEventListener("mouseenter",function(){y.props.interactive&&y.state.isVisible&&y.clearDelayTimeouts()}),R.addEventListener("mouseleave",function(){y.props.interactive&&y.props.trigger.indexOf("mouseenter")>=0&&Ae().addEventListener("mousemove",f)}),y;function O(){var q=y.props.touch;return Array.isArray(q)?q:[q,0]}function K(){return O()[0]==="hold"}function ne(){var q;return!!((q=y.props.render)!=null&&q.$$tippy)}function ee(){return g||r}function Ae(){var q=ee().parentNode;return q?Ey(q):document}function _(){return iA(R)}function P(q){return y.state.isMounted&&!y.state.isVisible||cr.isTouch||c&&c.type==="focus"?0:Za(y.props.delay,q?0:1,Xt.delay)}function X(q){q===void 0&&(q=!1),R.style.pointerEvents=y.props.interactive&&!q?"":"none",R.style.zIndex=""+y.props.zIndex}function D(q,de,Ce){if(Ce===void 0&&(Ce=!0),$.forEach(function(Fe){Fe[q]&&Fe[q].apply(Fe,de)}),Ce){var Pe;(Pe=y.props)[q].apply(Pe,de)}}function S(){var q=y.props.aria;if(q.content){var de="aria-"+q.content,Ce=R.id,Pe=_n(y.props.triggerTarget||r);Pe.forEach(function(Fe){var qe=Fe.getAttribute(de);if(y.state.isVisible)Fe.setAttribute(de,qe?qe+" "+Ce:Ce);else{var Tt=qe&&qe.replace(Ce,"").trim();Tt?Fe.setAttribute(de,Tt):Fe.removeAttribute(de)}})}}function F(){if(!(W||!y.props.aria.expanded)){var q=_n(y.props.triggerTarget||r);q.forEach(function(de){y.props.interactive?de.setAttribute("aria-expanded",y.state.isVisible&&de===ee()?"true":"false"):de.removeAttribute("aria-expanded")})}}function J(){Ae().removeEventListener("mousemove",f),Gs=Gs.filter(function(q){return q!==f})}function Y(q){if(!(cr.isTouch&&(A||q.type==="mousedown"))){var de=q.composedPath&&q.composedPath()[0]||q.target;if(!(y.props.interactive&&ed(R,de))){if(_n(y.props.triggerTarget||r).some(function(Ce){return ed(Ce,de)})){if(cr.isTouch||y.state.isVisible&&y.props.trigger.indexOf("click")>=0)return}else D("onClickOutside",[y,q]);y.props.hideOnClick===!0&&(y.clearDelayTimeouts(),y.hide(),a=!0,setTimeout(function(){a=!1}),y.state.isMounted||ge())}}}function re(){A=!0}function ce(){A=!1}function pe(){var q=Ae();q.addEventListener("mousedown",Y,!0),q.addEventListener("touchend",Y,Zr),q.addEventListener("touchstart",ce,Zr),q.addEventListener("touchmove",re,Zr)}function ge(){var q=Ae();q.removeEventListener("mousedown",Y,!0),q.removeEventListener("touchend",Y,Zr),q.removeEventListener("touchstart",ce,Zr),q.removeEventListener("touchmove",re,Zr)}function Se(q,de){Ge(q,function(){!y.state.isVisible&&R.parentNode&&R.parentNode.contains(R)&&de()})}function Le(q,de){Ge(q,de)}function Ge(q,de){var Ce=_().box;function Pe(Fe){Fe.target===Ce&&(rA(Ce,"remove",Pe),de())}if(q===0)return de();rA(Ce,"remove",u),rA(Ce,"add",Pe),u=Pe}function fe(q,de,Ce){Ce===void 0&&(Ce=!1);var Pe=_n(y.props.triggerTarget||r);Pe.forEach(function(Fe){Fe.addEventListener(q,de,Ce),d.push({node:Fe,eventType:q,handler:de,options:Ce})})}function Te(){K()&&(fe("touchstart",we,{passive:!0}),fe("touchend",Be,{passive:!0})),uy(y.props.trigger).forEach(function(q){if(q!=="manual")switch(fe(q,we),q){case"mouseenter":fe("mouseleave",Be);break;case"focus":fe(Qy?"focusout":"blur",Q);break;case"focusin":fe("focusout",Q);break}})}function Me(){d.forEach(function(q){var de=q.node,Ce=q.eventType,Pe=q.handler,Fe=q.options;de.removeEventListener(Ce,Pe,Fe)}),d=[]}function we(q){var de,Ce=!1;if(!(!y.state.isEnabled||m(q)||a)){var Pe=((de=c)==null?void 0:de.type)==="focus";c=q,g=q.currentTarget,F(),!y.state.isVisible&&gy(q)&&Gs.forEach(function(Fe){return Fe(q)}),q.type==="click"&&(y.props.trigger.indexOf("mouseenter")<0||o)&&y.props.hideOnClick!==!1&&y.state.isVisible?Ce=!0:j(q),q.type==="click"&&(o=!Ce),Ce&&!Pe&&Ie(q)}}function We(q){var de=q.target,Ce=ee().contains(de)||R.contains(de);if(!(q.type==="mousemove"&&Ce)){var Pe=z().concat(R).map(function(Fe){var qe,Tt=Fe._tippy,bt=(qe=Tt.popperInstance)==null?void 0:qe.state;return bt?{popperRect:Fe.getBoundingClientRect(),popperState:bt,props:t}:null}).filter(Boolean);Iy(Pe,q)&&(J(),Ie(q))}}function Be(q){var de=m(q)||y.props.trigger.indexOf("click")>=0&&o;if(!de){if(y.props.interactive){y.hideWithInteractivity(q);return}Ie(q)}}function Q(q){y.props.trigger.indexOf("focusin")<0&&q.target!==ee()||y.props.interactive&&q.relatedTarget&&R.contains(q.relatedTarget)||Ie(q)}function m(q){return cr.isTouch?K()!==q.type.indexOf("touch")>=0:!1}function E(){x();var q=y.props,de=q.popperOptions,Ce=q.placement,Pe=q.offset,Fe=q.getReferenceClientRect,qe=q.moveTransition,Tt=ne()?iA(R).arrow:null,bt=Fe?{getBoundingClientRect:Fe,contextElement:Fe.contextElement||ee()}:r,Mn={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Pn){var kr=Pn.state;if(ne()){var Bi=_(),Qi=Bi.box;["placement","reference-hidden","escaped"].forEach(function(On){On==="placement"?Qi.setAttribute("data-placement",kr.placement):kr.attributes.popper["data-popper-"+On]?Qi.setAttribute("data-"+On,""):Qi.removeAttribute("data-"+On)}),kr.attributes.popper={}}}},xt=[{name:"offset",options:{offset:Pe}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!qe}},Mn];ne()&&Tt&&xt.push({name:"arrow",options:{element:Tt,padding:3}}),xt.push.apply(xt,(de==null?void 0:de.modifiers)||[]),y.popperInstance=Ay(bt,R,Object.assign({},de,{placement:Ce,onFirstUpdate:h,modifiers:xt}))}function x(){y.popperInstance&&(y.popperInstance.destroy(),y.popperInstance=null)}function M(){var q=y.props.appendTo,de,Ce=ee();y.props.interactive&&q===Wh||q==="parent"?de=Ce.parentNode:de=qh(q,[Ce]),de.contains(R)||de.appendChild(R),y.state.isMounted=!0,E()}function z(){return Os(R.querySelectorAll("[data-tippy-root]"))}function j(q){y.clearDelayTimeouts(),q&&D("onTrigger",[y,q]),pe();var de=P(!0),Ce=O(),Pe=Ce[0],Fe=Ce[1];cr.isTouch&&Pe==="hold"&&Fe&&(de=Fe),de?n=setTimeout(function(){y.show()},de):y.show()}function Ie(q){if(y.clearDelayTimeouts(),D("onUntrigger",[y,q]),!y.state.isVisible){ge();return}if(!(y.props.trigger.indexOf("mouseenter")>=0&&y.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(q.type)>=0&&o)){var de=P(!1);de?i=setTimeout(function(){y.state.isVisible&&y.hide()},de):s=requestAnimationFrame(function(){y.hide()})}}function be(){y.state.isEnabled=!0}function De(){y.hide(),y.state.isEnabled=!1}function ke(){clearTimeout(n),clearTimeout(i),cancelAnimationFrame(s)}function _e(q){if(!y.state.isDestroyed){D("onBeforeUpdate",[y,q]),Me();var de=y.props,Ce=id(r,Object.assign({},de,zh(q),{ignoreAttributes:!0}));y.props=Ce,Te(),de.interactiveDebounce!==Ce.interactiveDebounce&&(J(),f=Xh(We,Ce.interactiveDebounce)),de.triggerTarget&&!Ce.triggerTarget?_n(de.triggerTarget).forEach(function(Pe){Pe.removeAttribute("aria-expanded")}):Ce.triggerTarget&&r.removeAttribute("aria-expanded"),F(),X(),k&&k(de,Ce),y.popperInstance&&(E(),z().forEach(function(Pe){requestAnimationFrame(Pe._tippy.popperInstance.forceUpdate)})),D("onAfterUpdate",[y,q])}}function Ft(q){y.setProps({content:q})}function ct(){var q=y.state.isVisible,de=y.state.isDestroyed,Ce=!y.state.isEnabled,Pe=cr.isTouch&&!y.props.touch,Fe=Za(y.props.duration,0,Xt.duration);if(!(q||de||Ce||Pe)&&!ee().hasAttribute("disabled")&&(D("onShow",[y],!1),y.props.onShow(y)!==!1)){if(y.state.isVisible=!0,ne()&&(R.style.visibility="visible"),X(),pe(),y.state.isMounted||(R.style.transition="none"),ne()){var qe=_(),Tt=qe.box,bt=qe.content;tA([Tt,bt],0)}h=function(){var xt;if(!(!y.state.isVisible||l)){if(l=!0,R.offsetHeight,R.style.transition=y.props.moveTransition,ne()&&y.props.animation){var on=_(),Pn=on.box,kr=on.content;tA([Pn,kr],Fe),Zh([Pn,kr],"visible")}S(),F(),jh(sA,y),(xt=y.popperInstance)==null||xt.forceUpdate(),D("onMount",[y]),y.props.animation&&ne()&&Le(Fe,function(){y.state.isShown=!0,D("onShown",[y])})}},M()}}function Nt(){var q=!y.state.isVisible,de=y.state.isDestroyed,Ce=!y.state.isEnabled,Pe=Za(y.props.duration,1,Xt.duration);if(!(q||de||Ce)&&(D("onHide",[y],!1),y.props.onHide(y)!==!1)){if(y.state.isVisible=!1,y.state.isShown=!1,l=!1,o=!1,ne()&&(R.style.visibility="hidden"),J(),ge(),X(!0),ne()){var Fe=_(),qe=Fe.box,Tt=Fe.content;y.props.animation&&(tA([qe,Tt],Pe),Zh([qe,Tt],"hidden"))}S(),F(),y.props.animation?ne()&&Se(Pe,y.unmount):y.unmount()}}function dr(q){Ae().addEventListener("mousemove",f),jh(Gs,f),f(q)}function fr(){y.state.isVisible&&y.hide(),y.state.isMounted&&(x(),z().forEach(function(q){q._tippy.unmount()}),R.parentNode&&R.parentNode.removeChild(R),sA=sA.filter(function(q){return q!==y}),y.state.isMounted=!1,D("onHidden",[y]))}function Ct(){y.state.isDestroyed||(y.clearDelayTimeouts(),y.unmount(),Me(),delete r._tippy,y.state.isDestroyed=!0,D("onDestroy",[y]))}}function en(r,e){e===void 0&&(e={});var t=Xt.plugins.concat(e.plugins||[]);yy();var n=Object.assign({},e,{plugins:t}),i=my(r),s=i.reduce(function(o,a){var A=a&&_y(a,n);return A&&o.push(A),o},[]);return Us(r)?s[0]:s}en.defaultProps=Xt,en.setDefaultProps=wy,en.currentInput=cr,Object.assign({},Sh,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}}),en.setDefaultProps({render:ad});function tn(r){const e=[];return r.renderer.type==="video"&&e.push(r.options),e.push(...r.childNodes.flatMap(tn).filter(Boolean)),e}class Hs extends Error{constructor(e,t=new Error,n=!1){super(),this.fatal=!1,this.fatal=n,this.stack=t.stack,this.message=[e,t.message].filter(Boolean).join(" - ")}}const Ly=5;function Fy(r,e){const t=r.map(({id:i})=>i).join("|"),n=e.map(({id:i})=>i).join("|");return t===n}class ky{constructor(e){this._caption="",this._currentTime=0,this._activeScenes=[],this._upcomingScenes=[],this._canvas=vt(),this._controls=vt(),this.host=e}set activeScenes(e){Fy(e,this._activeScenes)||(this._activeScenes=e,this.host.dispatchEvent(new CustomEvent("scenechange",{detail:e})),this.host.requestUpdate())}get activeScenes(){return this._activeScenes}set currentTime(e){var t,n,i;const s=Math.min(this.host.duration,Math.max(0,e));this.activeScenes=((t=this.host.composition)==null?void 0:t.tracks.reduce((a,A)=>a.concat(A.drawScenes.filter(({start:l,duration:c})=>s>=l&&s<l+c)),[]))??[];const o=s!==this.currentTime;this._currentTime=s,this._upcomingScenes=((n=this.host.composition)==null?void 0:n.tracks.reduce((a,A)=>a.concat(A.drawScenes.filter(({start:l})=>s>=l-Ly&&s<l)),[]))??[],this.loadScenes(),this.syncVideoState(),(i=this._controls.value)==null||i.setAttribute("currentTime",s.toString()),o&&this.host.dispatchEvent(new CustomEvent("timeupdate",{detail:s})),this.draw(s)}get currentTime(){return this._currentTime}set caption(e){e!==this._caption&&(this._caption=e,this.host.requestUpdate())}get caption(){return this._caption}canvas(){return yt(this._canvas)}controls(){return yt(this._controls)}loadScenes(){[...this.activeScenes,...this._upcomingScenes].forEach(e=>{const{start:t,duration:n}=e,i=this.host.currentTime>0||this.host.preload==="auto"||!this.host.paused;tn(e.layout.node).forEach(o=>{var a,A,l;if(o!=null&&o.key&&this.host.videos[o==null?void 0:o.key]){const c=this.host.videos[o==null?void 0:o.key],{key:u,hls:h,node:d,start:f,duration:g}=c,p=this.host.videoState[u];d&&p&&(d.currentTime>=f+g||d.ended||i&&(h?(a=h.startLoadOnce)==null||a.call(h,f):p.initialised||(A=d.startLoadOnce)==null||A.call(d)))}else if(i){const c=`${t}-${n}`,u=this.host._sceneController.videoState[c];this.host.duration&&!((l=u==null?void 0:u.buffered)!=null&&l.length)&&(this.host._sceneController.videoState={...this.host._sceneController.videoState,[c]:{...u,buffered:[{start:Math.max(0,t/this.host.duration*100),end:Math.min((t+n)/this.host.duration*100,100)}]}})}})})}syncVideoState(){var e;(e=this.host.composition)==null||e.tracks.forEach(t=>{var n;(n=t.drawScenes)==null||n.forEach(i=>{tn(i.layout.node).forEach(o=>{if(o!=null&&o.key&&this.host.videos[o==null?void 0:o.key]){const a=this.host.videos[o==null?void 0:o.key],{key:A,node:l}=a,c=this.host.videoState[A],u=this.activeScenes.includes(i);if(l&&c)if(u&&!this.host.waiting&&!this.host.loading&&!this.host.paused){if(l.paused&&c.initialised)try{return l.play()}catch(h){throw new Hs("Video play error",h,!0)}}else l.paused||l.pause()}})})})}draw(e=this.currentTime){this.host.composition&&this._canvas.value&&this.host.composition.draw({currentTime:e,canvas:this._canvas.value})}clear(){var e;const t=this._canvas.value;(e=t==null?void 0:t.getContext("2d"))==null||e.clearRect(0,0,t.width,t.height)}}async function Ad(r){return r.duration===1/0?new Promise(e=>{r.currentTime=Number.MAX_SAFE_INTEGER,r.ontimeupdate=()=>{r.ontimeupdate=null,e(r.duration),r.currentTime=0}}):r.duration}function Ny(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function My(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function Py(r,e){return new Promise(async t=>{const{id:n,key:i,duration:s,startOffset:o,endOffset:a}=e,A=document.createElement("video");A.playsInline=!0,A.muted=!0,A.loop=!1,A.src=r;let l=!1;if(A.startLoadOnce=()=>{l||(A.preload="auto",A.load(),l=!0)},s){A.preload="none";const c=(o??0)*s,u=(1-(a??0))*s;t({id:n,key:i,hls:null,config:e,node:A,start:c,duration:u-c})}else{A.preload="metadata";const c=async()=>{const u=await Ad(A),h=(o??0)*u,d=(1-(a??0))*u;t({id:n,key:i,hls:null,config:e,node:A,start:h,duration:d-h}),A.removeEventListener("loadedmetadata",c)};A.addEventListener("loadedmetadata",c)}})}function Oy(r,e){return new Promise(t=>{const{id:n,key:i,startOffset:s,endOffset:o}=e,a=document.createElement("video");a.playsInline=!0,a.muted=!0,a.loop=!1;let A=!1;const l=new yr({autoStartLoad:!0,xhrSetup:c=>{const{open:u}=c,h=r.split("?")[1];c.open=function(d,f,g){h&&!f.toString().includes("?")&&(f+="?"+h),!(!A&&f.toString().includes(".ts"))&&u.apply(this,[d,f,g])}}});l.on(yr.Events.LEVEL_LOADED,async()=>{A||l==null||l.stopLoad();const c=await Ad(a),u=(s??0)*c,h=(1-(o??0))*c;t({id:n,key:i,hls:l,config:e,node:a,start:u,duration:h-u})}),l.loadSource(r),l.attachMedia(a),l.startLoadOnce=(c=-1,u)=>{if(l&&!A){const h=l.levels.findIndex(d=>Math.min(d.height,d.width)===u);A=!0,l.startLevel=l.firstLevel,l.startLoad(c),l.currentLevel=h!==-1?h:l.firstLevel}}})}function Uy(r){const{src:e,playlist:t}=r;return t&&!Ny()&&yr.isSupported()?Oy(t,r):Py(e,r)}let Gy=class{constructor(e){this._hasPlayed=!1,this._memoKey=null,this._lastDeps=null,this._duration=0,this._composition=null,this._videos={},this._videoState={},this._delayProcessing=(t=100)=>{const n=new AbortController,i=setTimeout(()=>{n.signal.aborted||(this.host._processing=!0)},t);return n.signal.addEventListener("abort",()=>{clearTimeout(i)}),n},this._createImageResolver=dn(async({src:t})=>t?new Promise((n,i)=>{const s=new Image;s.onload=()=>{n({image:s})},s.onerror=o=>{i(o)},s.src=t}):{image:null}),this._videoFactory=dn(async t=>{const{id:n,key:i}=t,s=await Uy(t);s.node.volume=this.host.volume,s.node.playbackRate=this.host.playbackRate;const o={loadeddata:this._handleLoadedData,waiting:this._handleWaiting,canplay:this._handleCanPlay,progress:this._handleProgress,seeking:this._handleSeeking,seeked:this._handleSeeked,play:this._handlePlay,playing:this._handlePlaying,pause:this._handlePause,stalled:this._handleStalled,timeupdate:this._handleTimeUpdate,ended:this._handleEnded,error:this._handleError},a=Object.keys(o).reduce((A,l)=>{const c=l,u=o[c]({id:n,key:i,node:s.node});return A[c]=u,s.node.addEventListener(l,u),A},{});return{video:s,listeners:a,source:()=>s.node}},{cacheKey:([{id:t,key:n,src:i,playlist:s}])=>JSON.stringify({id:t,key:n,src:i==null?void 0:i.split("?")[0],playlist:s==null?void 0:s.split("?")[0]})}),this._createVideoResolver=async t=>{const{video:n,listeners:i,source:s}=await this._videoFactory(t);return this.videos={...this.videos,[t.key]:{...n,listeners:i}},this.videoState={...this.videoState,[t.key]:{initialised:!n,waiting:!!n,...this.videoState[t.key]}},{video:s}},this._handleLoadedData=({id:t,key:n,node:i})=>()=>{const s=this.videoState[n];s!=null&&s.initialised||(this.videoState={...this.videoState,[n]:{...s,initialised:!0,waiting:!1,buffered:(s==null?void 0:s.buffered)??[]}},this.setVideosCurrentTime(this.host.currentTime),this.host.dispatchEvent(new CustomEvent("video:loadeddata",{detail:{id:t,key:n,node:i}})))},this._handleWaiting=({key:t})=>()=>{const n=this.videoState[t];n!=null&&n.initialised&&!(n!=null&&n.waiting)&&(this.videoState={...this.videoState,[t]:{...n,waiting:!0}})},this._handleCanPlay=({key:t})=>()=>{const n=this.videoState[t];n!=null&&n.initialised&&(n!=null&&n.waiting)&&(this.videoState={...this.videoState,[t]:{...n,waiting:!1}}),this.host.paused&&this.host.draw()},this._handleProgress=()=>()=>{},this._handleSeeking=({id:t,key:n,node:i})=>()=>{this.host.dispatchEvent(new CustomEvent("video:seeking",{detail:{id:t,key:n,node:i}}))},this._handleSeeked=({id:t,key:n,node:i})=>()=>{const s=this.videoState[n];s!=null&&s.initialised&&(this.host.draw(),this.host.activeScenes.flatMap(o=>tn(o.layout.node).map(({id:A})=>A)).includes(t)&&this.host.dispatchEvent(new CustomEvent("seeked",{detail:this.host.currentTime})),this.host.dispatchEvent(new CustomEvent("video:seeked",{detail:{id:t,key:n,node:i}})))},this._handlePlay=({id:t,key:n,node:i})=>()=>{this.hasPlayed=!0,this.host.dispatchEvent(new CustomEvent("video:play",{detail:{id:t,key:n,node:i}}))},this._handlePlaying=({id:t,key:n,node:i})=>()=>{this.host.dispatchEvent(new CustomEvent("video:playing",{detail:{id:t,key:n,node:i}}))},this._handlePause=({id:t,key:n,node:i})=>()=>{this.host.dispatchEvent(new CustomEvent("video:pause",{detail:{id:t,key:n,node:i}}))},this._handleStalled=({id:t,key:n,node:i})=>()=>{this.host.dispatchEvent(new CustomEvent("video:stalled",{detail:{id:t,key:n,node:i}}))},this._handleTimeUpdate=({id:t,key:n,node:i})=>()=>{this.host.dispatchEvent(new CustomEvent("video:timeupdate",{detail:{id:t,key:n,node:i}}))},this._handleEnded=({id:t,key:n,node:i})=>()=>{this.host.dispatchEvent(new CustomEvent("video:ended",{detail:{id:t,key:n,node:i}}))},this._handleError=({id:t,key:n,node:i})=>()=>{const s=new Hs(`Video error - answer ${t} failed to load`);this.host.dispatchEvent(new ErrorEvent("error",{bubbles:!0,composed:!0,error:s,message:s.message})),this.host.dispatchEvent(new CustomEvent("video:error",{detail:{id:t,key:n,node:i}}))},this._cleanupVideo=t=>{var n;const i=this.videos[t];i&&(i.node.pause(),i.node.src="",(n=i.hls)==null||n.destroy(),Object.keys(i.listeners??{}).forEach(s=>{var o,a;if((o=this.videos)!=null&&o[t]){const A=(a=i.listeners)==null?void 0:a[s];A&&i.node.removeEventListener(s,A)}}),delete this.videos[t])},this.host=e,this.host.addController(this)}set hasPlayed(e){e!==this._hasPlayed&&(this._hasPlayed=e,this.host.requestUpdate())}get hasPlayed(){return this._hasPlayed}set duration(e){!isNaN(e)&&e!==this._duration&&(this._duration=e,this.host.requestUpdate(),this.host.dispatchEvent(new CustomEvent("durationchange",{detail:this._duration})))}get duration(){return this._duration}set composition(e){e!==this._composition&&(this._composition=e,this.host.requestUpdate())}get composition(){return this._composition}set videos(e){e!==this._videos&&(this._videos=e,this.host.requestUpdate())}get videos(){return this._videos}set videoState(e){e!==this._videoState&&(this._videoState=e,this.host.requestUpdate())}get videoState(){return this._videoState}_setupTask(){new Di(this.host,async([e,t])=>{var n;const i=this._delayProcessing();try{if(this.host._errors=[],(!t||!this.host._languages.find(({value:s})=>t===s))&&(this.host._language=(n=this.host._languages[0])==null?void 0:n.value),e){try{console.log(e),this.composition=await ac({config:e,resolvers:{image:this._createImageResolver,video:this._createVideoResolver}})}catch(s){throw new Hs("Fatal composition error",s,!0)}this.duration=this.composition.duration,this.host.currentTime>this.duration?this.host.reset(this.duration,!1):this.host.paused&&this.host.reset(this.host.currentTime,!this.host.paused)}this.host.dispatchEvent(new CustomEvent("compositionupdate",{detail:this.composition,bubbles:!0,composed:!0}))}catch(s){this.composition=null,this.duration=0,this.host.dispatchEvent(new ErrorEvent("error",{composed:!0,bubbles:!0,error:s,message:s.message}))}finally{i.abort(),this.host._processing=!1}},()=>{const e=JSON.stringify({config:this.host.config,language:this.host.language});if(this._lastDeps&&this._memoKey===e)return this._lastDeps;const t=[this.host.config,this.host.language];return this._memoKey=e,this._lastDeps=t,t})}_setVideoCurrentTime({time:e,scene:t}){const{start:n}=t;tn(t.layout.node).forEach(s=>{if(s!=null&&s.key&&this.videos[s==null?void 0:s.key]){const o=this.videos[s==null?void 0:s.key],a=e-n;o.node.currentTime=Math.max(o.start,Math.min(o.start+o.duration,a+o.start))}})}setVideosCurrentTime(e){var t;(t=this.composition)==null||t.tracks.forEach(n=>{n.drawScenes.forEach(i=>{this._setVideoCurrentTime({time:e,scene:i})})})}hostConnected(){this._setupTask()}hostDisconnected(){Object.keys(this.videos).forEach(e=>{this._cleanupVideo(e)}),this.videos={}}};function Hy(r){r.requestFullscreen?r.requestFullscreen():r.mozRequestFullScreen?r.mozRequestFullScreen():r.webkitRequestFullscreen?r.webkitRequestFullscreen():r.msRequestFullscreen&&r.msRequestFullscreen()}function $y(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()}const oA=["progress","play-large","navigation","play","volume","current-time","duration","speed","captions","fullscreen","preview"],Yy={id:"captions",event:"captions:click",label:"Closed Captions"},Vy={id:"fullscreen",event:"fullscreen:click",label:"Full Screen"},ld={title:"Playback Speed",items:[{id:"playback-rate-0.5",event:"playbackRate:click",label:"0.5x",value:.5},{id:"playback-rate-1",event:"playbackRate:click",label:"1.0x",value:1},{id:"playback-rate-1.5",event:"playbackRate:click",label:"1.5x",value:1.5},{id:"playback-rate-2",event:"playbackRate:click",label:"2.0x",value:2}]},Ky={id:"playbackRate",label:"Playback playbackRate",subItems:ld};class Jy extends GA{constructor(e){if(super(e),this.element=null,this.observer=void 0,e.type!==cn.ELEMENT)throw new Error("Resize directive must be used in an Element expression")}disconnected(){var e;(e=this.observer)==null||e.disconnect(),this.observer=void 0}reconnected(){var e;this.element&&((e=this.observer)==null||e.observe(this.element))}update(e,[t]){return this.isConnected&&!this.observer&&(this.observer=new ResizeObserver(t),this.element=e.element,this.observer.observe(this.element)),Vt}}const aA=un(Jy),Wy=nv(()=>{const r=new FontFace("Roobert","url(https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/Roobert-Regular.woff2)",{style:"normal",weight:"400"}),e=new FontFace("Roobert","url(https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/Roobert-SemiBold.woff2)",{style:"normal",weight:"600"}),t=new FontFace("Roobert","url(https://vouch-clients.s3.ap-southeast-2.amazonaws.com/vouch/fonts/Roobert-Bold.woff2",{style:"normal",weight:"700"}),n=new FontFace("Roobert Captions","url(https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/Roobert-Regular.woff2)",{style:"normal",weight:"400"}),i=zl.map(s=>({load:!1,font:new FontFace(s.family,`url(${s.url})`,{style:s.style})}));return[{load:!0,font:r},{load:!0,font:e},{load:!0,font:t},{load:!0,font:n},...i]}),ur={"red-120":"#feeded","red-130":"#fcd5d0","red-400":"#e84a4a","red-500":"#c51c3a","red-700":"#a21c39","red-800":"#850231","red-900":"#580A2D","teal-80":"#f3fafa","teal-100":"#d6f1f1","teal-200":"#ace3e3","teal-300":"#7acace","teal-400":"#4faab2","teal-500":"#358f97","teal-600":"#287179","teal-700":"#22555c","teal-800":"#21484e","teal-900":"#1f3d42","teal-950":"#0d2126","purple-100":"#d7cfff","purple-700":"#5f2fe9","green-200":"#a4d7aa","green-500":"#38b319","green-800":"#2b3c2f","grey-100":"#f0f0f0","light-50":"rgba(255, 255, 255, .05)","light-100":"rgba(255, 255, 255, .1)","light-200":"rgba(255, 255, 255, .2)","light-400":"rgba(255, 255, 255, .4)","light-500":"rgba(255, 255, 255, .5)","light-640":"rgba(255, 255, 255, .64)","light-800":"rgba(255, 255, 255, .8)","light-1000":"#fff","dark-50":"rgba(0, 0, 0, .05)","dark-80":"rgba(0, 0, 0, .08)","dark-100":"rgba(0, 0, 0, .1)","dark-200":"rgba(0, 0, 0, .2)","dark-250":"rgba(0, 0, 0, .25)","dark-400":"rgba(0, 0, 0, .4)","dark-500":"rgba(0, 0, 0, .5)","dark-640":"rgba(0, 0, 0, .64)","dark-800":"rgba(0, 0, 0, .8)","dark-900":"rgba(0, 0, 0, .9)","dark-1000":"#000"},qy={colors:ur,space:{xxs:".25rem",xs:".5rem",small:".75rem",medium:"1rem",large:"1.5rem",xl:"2.5rem"},sizes:{xxs:"1rem",xs:"1.5rem",small:"2rem",medium:"2.5rem",large:"3rem"},fontWeights:{regular:400,semibold:600},lineHeights:{small:1.1,medium:1.25,large:1.4},letterSpacings:{xxs:"-.04rem",xs:"-.03rem",small:"-.02rem",medium:"-.01rem",large:0},fontSizes:{micro:".625rem",small:".75rem",medium:".875rem",large:"1rem",xl:"1.25rem",xxl:"1.5rem",xxxl:"2rem",huge:"2.75rem"},fontFamilies:{sans:'Roobert, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,"Noto Sans", "Noto Color Emoji", sans-serif, "Segoe UI Emoji", "Segoe UI Symbol", "Apple Color Emoji"',mono:'"Maison Neue Mono", Menlo, Monaco, Consolas, Liberation Mono, "Courier New", monospace'},borderWidths:{thin:".0625rem"},radii:{small:".25rem",medium:".5rem",large:".75rem",xl:"1rem"},shadows:{small:`.25rem .25rem .25rem ${ur["dark-100"]}`,medium:`0 .125rem .625rem ${ur["dark-100"]}`,large:`0 .25rem 1rem ${ur["dark-50"]}`,xl:`.25rem .25rem 1rem ${ur["dark-250"]}`,xxl:`0 .25rem 2rem ${ur["dark-100"]}`,xxxl:`.25rem .25rem 3rem ${ur["dark-250"]}`,toolbar:`0 -.625rem .625rem ${ur["dark-50"]}`,text:`0 0 .25rem ${ur["dark-250"]}`},timings:{fast:".1s",normal:".2s",slow:".3s"},easings:{linear:"linear"},focusOutline:{width:".2rem",color:ur["dark-400"]},iconSizes:{small:"0.75rem",medium:"1rem",large:"1.5rem"}},cd=ev(qy,{delimiter:"-"}),Xy=Object.keys(cd).map(r=>Un(`:host { --${r}: ${cd[r]}; }`)),$e=(r=>{const e=class extends r{firstUpdated(){Wy().forEach(({load:s,font:o})=>{document.fonts.add(o),s&&o.load()})}};return e.styles=[(r==null?void 0:r.styles)??[],Xy,gt`
|
2492
|
+
*/const Qh=(r,e,t)=>{const n=new Map;for(let i=e;i<=t;i++)n.set(r[i],i);return n},Th=hn(class extends qn{constructor(r){if(super(r),r.type!==un.CHILD)throw Error("repeat() can only be used in text expressions")}dt(r,e,t){let n;t===void 0?t=e:e!==void 0&&(n=e);const i=[],s=[];let o=0;for(const a of r)i[o]=n?n(a,o):o,s[o]=t(a,o),o++;return{values:s,keys:i}}render(r,e,t){return this.dt(r,e,t).values}update(r,[e,t,n]){const i=Yd(r),{values:s,keys:o}=this.dt(e,t,n);if(!Array.isArray(i))return this.ut=o,s;const a=this.ut??(this.ut=[]),l=[];let A,c,u=0,h=i.length-1,d=0,f=s.length-1;for(;u<=h&&d<=f;)if(i[u]===null)u++;else if(i[h]===null)h--;else if(a[u]===o[d])l[d]=Gr(i[u],s[d]),u++,d++;else if(a[h]===o[f])l[f]=Gr(i[h],s[f]),h--,f--;else if(a[u]===o[f])l[f]=Gr(i[u],s[f]),Wn(r,l[f+1],i[u]),u++,f--;else if(a[h]===o[d])l[d]=Gr(i[h],s[d]),Wn(r,i[u],i[h]),h--,d++;else if(A===void 0&&(A=Qh(o,d,f),c=Qh(a,u,h)),A.has(a[u]))if(A.has(a[h])){const g=c.get(o[d]),p=g!==void 0?i[g]:null;if(p===null){const C=Wn(r,i[u]);Gr(C,s[d]),l[d]=C}else l[d]=Gr(p,s[d]),Wn(r,i[u],p),i[g]=null;d++}else io(i[h]),h--;else io(i[u]),u++;for(;d<=f;){const g=Wn(r,l[f+1]);Gr(g,s[d]),l[d++]=g}for(;u<=h;){const g=i[u++];g!==null&&io(g)}return this.ut=o,$d(r,l),Vt}});var _t="top",Ht="bottom",$t="right",Lt="left",Va="auto",ci=[_t,Ht,$t,Lt],wn="start",ui="end",iv="clippingParents",bh="viewport",hi="popper",sv="reference",xh=ci.reduce(function(r,e){return r.concat([e+"-"+wn,e+"-"+ui])},[]),wh=[].concat(ci,[Va]).reduce(function(r,e){return r.concat([e,e+"-"+wn,e+"-"+ui])},[]),ov="beforeRead",av="read",lv="afterRead",Av="beforeMain",cv="main",uv="afterMain",hv="beforeWrite",dv="write",fv="afterWrite",gv=[ov,av,lv,Av,cv,uv,hv,dv,fv];function lr(r){return r?(r.nodeName||"").toLowerCase():null}function kt(r){if(r==null)return window;if(r.toString()!=="[object Window]"){var e=r.ownerDocument;return e&&e.defaultView||window}return r}function zr(r){var e=kt(r).Element;return r instanceof e||r instanceof Element}function Yt(r){var e=kt(r).HTMLElement;return r instanceof e||r instanceof HTMLElement}function Ka(r){if(typeof ShadowRoot>"u")return!1;var e=kt(r).ShadowRoot;return r instanceof e||r instanceof ShadowRoot}function pv(r){var e=r.state;Object.keys(e.elements).forEach(function(t){var n=e.styles[t]||{},i=e.attributes[t]||{},s=e.elements[t];!Yt(s)||!lr(s)||(Object.assign(s.style,n),Object.keys(i).forEach(function(o){var a=i[o];a===!1?s.removeAttribute(o):s.setAttribute(o,a===!0?"":a)}))})}function mv(r){var e=r.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(n){var i=e.elements[n],s=e.attributes[n]||{},o=Object.keys(e.styles.hasOwnProperty(n)?e.styles[n]:t[n]),a=o.reduce(function(l,A){return l[A]="",l},{});!Yt(i)||!lr(i)||(Object.assign(i.style,a),Object.keys(s).forEach(function(l){i.removeAttribute(l)}))})}}const Sh={name:"applyStyles",enabled:!0,phase:"write",fn:pv,effect:mv,requires:["computeStyles"]};function Ar(r){return r.split("-")[0]}var Zr=Math.max,ks=Math.min,Sn=Math.round;function Ja(){var r=navigator.userAgentData;return r!=null&&r.brands&&Array.isArray(r.brands)?r.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Rh(){return!/^((?!chrome|android).)*safari/i.test(Ja())}function Rn(r,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var n=r.getBoundingClientRect(),i=1,s=1;e&&Yt(r)&&(i=r.offsetWidth>0&&Sn(n.width)/r.offsetWidth||1,s=r.offsetHeight>0&&Sn(n.height)/r.offsetHeight||1);var o=zr(r)?kt(r):window,a=o.visualViewport,l=!Rh()&&t,A=(n.left+(l&&a?a.offsetLeft:0))/i,c=(n.top+(l&&a?a.offsetTop:0))/s,u=n.width/i,h=n.height/s;return{width:u,height:h,top:c,right:A+u,bottom:c+h,left:A,x:A,y:c}}function Wa(r){var e=Rn(r),t=r.offsetWidth,n=r.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:r.offsetLeft,y:r.offsetTop,width:t,height:n}}function Dh(r,e){var t=e.getRootNode&&e.getRootNode();if(r.contains(e))return!0;if(t&&Ka(t)){var n=e;do{if(n&&r.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Br(r){return kt(r).getComputedStyle(r)}function Ev(r){return["table","td","th"].indexOf(lr(r))>=0}function _r(r){return((zr(r)?r.ownerDocument:r.document)||window.document).documentElement}function Ns(r){return lr(r)==="html"?r:r.assignedSlot||r.parentNode||(Ka(r)?r.host:null)||_r(r)}function _h(r){return!Yt(r)||Br(r).position==="fixed"?null:r.offsetParent}function Iv(r){var e=/firefox/i.test(Ja()),t=/Trident/i.test(Ja());if(t&&Yt(r)){var n=Br(r);if(n.position==="fixed")return null}var i=Ns(r);for(Ka(i)&&(i=i.host);Yt(i)&&["html","body"].indexOf(lr(i))<0;){var s=Br(i);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return i;i=i.parentNode}return null}function di(r){for(var e=kt(r),t=_h(r);t&&Ev(t)&&Br(t).position==="static";)t=_h(t);return t&&(lr(t)==="html"||lr(t)==="body"&&Br(t).position==="static")?e:t||Iv(r)||e}function qa(r){return["top","bottom"].indexOf(r)>=0?"x":"y"}function fi(r,e,t){return Zr(r,ks(e,t))}function Cv(r,e,t){var n=fi(r,e,t);return n>t?t:n}function Lh(){return{top:0,right:0,bottom:0,left:0}}function Fh(r){return Object.assign({},Lh(),r)}function kh(r,e){return e.reduce(function(t,n){return t[n]=r,t},{})}var vv=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,Fh(typeof e!="number"?e:kh(e,ci))};function yv(r){var e,t=r.state,n=r.name,i=r.options,s=t.elements.arrow,o=t.modifiersData.popperOffsets,a=Ar(t.placement),l=qa(a),A=[Lt,$t].indexOf(a)>=0,c=A?"height":"width";if(!(!s||!o)){var u=vv(i.padding,t),h=Wa(s),d=l==="y"?_t:Lt,f=l==="y"?Ht:$t,g=t.rects.reference[c]+t.rects.reference[l]-o[l]-t.rects.popper[c],p=o[l]-t.rects.reference[l],C=di(s),T=C?l==="y"?C.clientHeight||0:C.clientWidth||0:0,b=g/2-p/2,y=u[d],x=T-h[c]-u[f],R=T/2-h[c]/2+b,k=fi(y,R,x),$=l;t.modifiersData[n]=(e={},e[$]=k,e.centerOffset=k-R,e)}}function Bv(r){var e=r.state,t=r.options,n=t.element,i=n===void 0?"[data-popper-arrow]":n;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||Dh(e.elements.popper,i)&&(e.elements.arrow=i))}const Qv={name:"arrow",enabled:!0,phase:"main",fn:yv,effect:Bv,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Dn(r){return r.split("-")[1]}var Tv={top:"auto",right:"auto",bottom:"auto",left:"auto"};function bv(r,e){var t=r.x,n=r.y,i=e.devicePixelRatio||1;return{x:Sn(t*i)/i||0,y:Sn(n*i)/i||0}}function Nh(r){var e,t=r.popper,n=r.popperRect,i=r.placement,s=r.variation,o=r.offsets,a=r.position,l=r.gpuAcceleration,A=r.adaptive,c=r.roundOffsets,u=r.isFixed,h=o.x,d=h===void 0?0:h,f=o.y,g=f===void 0?0:f,p=typeof c=="function"?c({x:d,y:g}):{x:d,y:g};d=p.x,g=p.y;var C=o.hasOwnProperty("x"),T=o.hasOwnProperty("y"),b=Lt,y=_t,x=window;if(A){var R=di(t),k="clientHeight",$="clientWidth";if(R===kt(t)&&(R=_r(t),Br(R).position!=="static"&&a==="absolute"&&(k="scrollHeight",$="scrollWidth")),R=R,i===_t||(i===Lt||i===$t)&&s===ui){y=Ht;var V=u&&R===x&&x.visualViewport?x.visualViewport.height:R[k];g-=V-n.height,g*=l?1:-1}if(i===Lt||(i===_t||i===Ht)&&s===ui){b=$t;var O=u&&R===x&&x.visualViewport?x.visualViewport.width:R[$];d-=O-n.width,d*=l?1:-1}}var J=Object.assign({position:a},A&&Tv),ne=c===!0?bv({x:d,y:g},kt(t)):{x:d,y:g};if(d=ne.x,g=ne.y,l){var ee;return Object.assign({},J,(ee={},ee[y]=T?"0":"",ee[b]=C?"0":"",ee.transform=(x.devicePixelRatio||1)<=1?"translate("+d+"px, "+g+"px)":"translate3d("+d+"px, "+g+"px, 0)",ee))}return Object.assign({},J,(e={},e[y]=T?g+"px":"",e[b]=C?d+"px":"",e.transform="",e))}function xv(r){var e=r.state,t=r.options,n=t.gpuAcceleration,i=n===void 0?!0:n,s=t.adaptive,o=s===void 0?!0:s,a=t.roundOffsets,l=a===void 0?!0:a,A={placement:Ar(e.placement),variation:Dn(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Nh(Object.assign({},A,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Nh(Object.assign({},A,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const wv={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:xv,data:{}};var Ms={passive:!0};function Sv(r){var e=r.state,t=r.instance,n=r.options,i=n.scroll,s=i===void 0?!0:i,o=n.resize,a=o===void 0?!0:o,l=kt(e.elements.popper),A=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&A.forEach(function(c){c.addEventListener("scroll",t.update,Ms)}),a&&l.addEventListener("resize",t.update,Ms),function(){s&&A.forEach(function(c){c.removeEventListener("scroll",t.update,Ms)}),a&&l.removeEventListener("resize",t.update,Ms)}}const Rv={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Sv,data:{}};var Dv={left:"right",right:"left",bottom:"top",top:"bottom"};function Ps(r){return r.replace(/left|right|bottom|top/g,function(e){return Dv[e]})}var _v={start:"end",end:"start"};function Mh(r){return r.replace(/start|end/g,function(e){return _v[e]})}function Xa(r){var e=kt(r),t=e.pageXOffset,n=e.pageYOffset;return{scrollLeft:t,scrollTop:n}}function ja(r){return Rn(_r(r)).left+Xa(r).scrollLeft}function Lv(r,e){var t=kt(r),n=_r(r),i=t.visualViewport,s=n.clientWidth,o=n.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;var A=Rh();(A||!A&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:a+ja(r),y:l}}function Fv(r){var e,t=_r(r),n=Xa(r),i=(e=r.ownerDocument)==null?void 0:e.body,s=Zr(t.scrollWidth,t.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=Zr(t.scrollHeight,t.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-n.scrollLeft+ja(r),l=-n.scrollTop;return Br(i||t).direction==="rtl"&&(a+=Zr(t.clientWidth,i?i.clientWidth:0)-s),{width:s,height:o,x:a,y:l}}function za(r){var e=Br(r),t=e.overflow,n=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+i+n)}function Ph(r){return["html","body","#document"].indexOf(lr(r))>=0?r.ownerDocument.body:Yt(r)&&za(r)?r:Ph(Ns(r))}function gi(r,e){var t;e===void 0&&(e=[]);var n=Ph(r),i=n===((t=r.ownerDocument)==null?void 0:t.body),s=kt(n),o=i?[s].concat(s.visualViewport||[],za(n)?n:[]):n,a=e.concat(o);return i?a:a.concat(gi(Ns(o)))}function Za(r){return Object.assign({},r,{left:r.x,top:r.y,right:r.x+r.width,bottom:r.y+r.height})}function kv(r,e){var t=Rn(r,!1,e==="fixed");return t.top=t.top+r.clientTop,t.left=t.left+r.clientLeft,t.bottom=t.top+r.clientHeight,t.right=t.left+r.clientWidth,t.width=r.clientWidth,t.height=r.clientHeight,t.x=t.left,t.y=t.top,t}function Oh(r,e,t){return e===bh?Za(Lv(r,t)):zr(e)?kv(e,t):Za(Fv(_r(r)))}function Nv(r){var e=gi(Ns(r)),t=["absolute","fixed"].indexOf(Br(r).position)>=0,n=t&&Yt(r)?di(r):r;return zr(n)?e.filter(function(i){return zr(i)&&Dh(i,n)&&lr(i)!=="body"}):[]}function Mv(r,e,t,n){var i=e==="clippingParents"?Nv(r):[].concat(e),s=[].concat(i,[t]),o=s[0],a=s.reduce(function(l,A){var c=Oh(r,A,n);return l.top=Zr(c.top,l.top),l.right=ks(c.right,l.right),l.bottom=ks(c.bottom,l.bottom),l.left=Zr(c.left,l.left),l},Oh(r,o,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Uh(r){var e=r.reference,t=r.element,n=r.placement,i=n?Ar(n):null,s=n?Dn(n):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,l;switch(i){case _t:l={x:o,y:e.y-t.height};break;case Ht:l={x:o,y:e.y+e.height};break;case $t:l={x:e.x+e.width,y:a};break;case Lt:l={x:e.x-t.width,y:a};break;default:l={x:e.x,y:e.y}}var A=i?qa(i):null;if(A!=null){var c=A==="y"?"height":"width";switch(s){case wn:l[A]=l[A]-(e[c]/2-t[c]/2);break;case ui:l[A]=l[A]+(e[c]/2-t[c]/2);break}}return l}function pi(r,e){e===void 0&&(e={});var t=e,n=t.placement,i=n===void 0?r.placement:n,s=t.strategy,o=s===void 0?r.strategy:s,a=t.boundary,l=a===void 0?iv:a,A=t.rootBoundary,c=A===void 0?bh:A,u=t.elementContext,h=u===void 0?hi:u,d=t.altBoundary,f=d===void 0?!1:d,g=t.padding,p=g===void 0?0:g,C=Fh(typeof p!="number"?p:kh(p,ci)),T=h===hi?sv:hi,b=r.rects.popper,y=r.elements[f?T:h],x=Mv(zr(y)?y:y.contextElement||_r(r.elements.popper),l,c,o),R=Rn(r.elements.reference),k=Uh({reference:R,element:b,strategy:"absolute",placement:i}),$=Za(Object.assign({},b,k)),V=h===hi?$:R,O={top:x.top-V.top+C.top,bottom:V.bottom-x.bottom+C.bottom,left:x.left-V.left+C.left,right:V.right-x.right+C.right},J=r.modifiersData.offset;if(h===hi&&J){var ne=J[i];Object.keys(O).forEach(function(ee){var le=[$t,Ht].indexOf(ee)>=0?1:-1,D=[_t,Ht].indexOf(ee)>=0?"y":"x";O[ee]+=ne[D]*le})}return O}function Pv(r,e){e===void 0&&(e={});var t=e,n=t.placement,i=t.boundary,s=t.rootBoundary,o=t.padding,a=t.flipVariations,l=t.allowedAutoPlacements,A=l===void 0?wh:l,c=Dn(n),u=c?a?xh:xh.filter(function(f){return Dn(f)===c}):ci,h=u.filter(function(f){return A.indexOf(f)>=0});h.length===0&&(h=u);var d=h.reduce(function(f,g){return f[g]=pi(r,{placement:g,boundary:i,rootBoundary:s,padding:o})[Ar(g)],f},{});return Object.keys(d).sort(function(f,g){return d[f]-d[g]})}function Ov(r){if(Ar(r)===Va)return[];var e=Ps(r);return[Mh(r),e,Mh(e)]}function Uv(r){var e=r.state,t=r.options,n=r.name;if(!e.modifiersData[n]._skip){for(var i=t.mainAxis,s=i===void 0?!0:i,o=t.altAxis,a=o===void 0?!0:o,l=t.fallbackPlacements,A=t.padding,c=t.boundary,u=t.rootBoundary,h=t.altBoundary,d=t.flipVariations,f=d===void 0?!0:d,g=t.allowedAutoPlacements,p=e.options.placement,C=Ar(p),T=C===p,b=l||(T||!f?[Ps(p)]:Ov(p)),y=[p].concat(b).reduce(function(ce,pe){return ce.concat(Ar(pe)===Va?Pv(e,{placement:pe,boundary:c,rootBoundary:u,padding:A,flipVariations:f,allowedAutoPlacements:g}):pe)},[]),x=e.rects.reference,R=e.rects.popper,k=new Map,$=!0,V=y[0],O=0;O<y.length;O++){var J=y[O],ne=Ar(J),ee=Dn(J)===wn,le=[_t,Ht].indexOf(ne)>=0,D=le?"width":"height",P=pi(e,{placement:J,boundary:c,rootBoundary:u,altBoundary:h,padding:A}),X=le?ee?$t:Lt:ee?Ht:_t;x[D]>R[D]&&(X=Ps(X));var _=Ps(X),S=[];if(s&&S.push(P[ne]<=0),a&&S.push(P[X]<=0,P[_]<=0),S.every(function(ce){return ce})){V=J,$=!1;break}k.set(J,S)}if($)for(var F=f?3:1,W=function(pe){var ge=y.find(function(Se){var Le=k.get(Se);if(Le)return Le.slice(0,pe).every(function(Ge){return Ge})});if(ge)return V=ge,"break"},Y=F;Y>0;Y--){var re=W(Y);if(re==="break")break}e.placement!==V&&(e.modifiersData[n]._skip=!0,e.placement=V,e.reset=!0)}}const Gv={name:"flip",enabled:!0,phase:"main",fn:Uv,requiresIfExists:["offset"],data:{_skip:!1}};function Gh(r,e,t){return t===void 0&&(t={x:0,y:0}),{top:r.top-e.height-t.y,right:r.right-e.width+t.x,bottom:r.bottom-e.height+t.y,left:r.left-e.width-t.x}}function Hh(r){return[_t,$t,Ht,Lt].some(function(e){return r[e]>=0})}function Hv(r){var e=r.state,t=r.name,n=e.rects.reference,i=e.rects.popper,s=e.modifiersData.preventOverflow,o=pi(e,{elementContext:"reference"}),a=pi(e,{altBoundary:!0}),l=Gh(o,n),A=Gh(a,i,s),c=Hh(l),u=Hh(A);e.modifiersData[t]={referenceClippingOffsets:l,popperEscapeOffsets:A,isReferenceHidden:c,hasPopperEscaped:u},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":u})}const $v={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Hv};function Yv(r,e,t){var n=Ar(r),i=[Lt,_t].indexOf(n)>=0?-1:1,s=typeof t=="function"?t(Object.assign({},e,{placement:r})):t,o=s[0],a=s[1];return o=o||0,a=(a||0)*i,[Lt,$t].indexOf(n)>=0?{x:a,y:o}:{x:o,y:a}}function Vv(r){var e=r.state,t=r.options,n=r.name,i=t.offset,s=i===void 0?[0,0]:i,o=wh.reduce(function(c,u){return c[u]=Yv(u,e.rects,s),c},{}),a=o[e.placement],l=a.x,A=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=A),e.modifiersData[n]=o}const Kv={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Vv};function Jv(r){var e=r.state,t=r.name;e.modifiersData[t]=Uh({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const Wv={name:"popperOffsets",enabled:!0,phase:"read",fn:Jv,data:{}};function qv(r){return r==="x"?"y":"x"}function Xv(r){var e=r.state,t=r.options,n=r.name,i=t.mainAxis,s=i===void 0?!0:i,o=t.altAxis,a=o===void 0?!1:o,l=t.boundary,A=t.rootBoundary,c=t.altBoundary,u=t.padding,h=t.tether,d=h===void 0?!0:h,f=t.tetherOffset,g=f===void 0?0:f,p=pi(e,{boundary:l,rootBoundary:A,padding:u,altBoundary:c}),C=Ar(e.placement),T=Dn(e.placement),b=!T,y=qa(C),x=qv(y),R=e.modifiersData.popperOffsets,k=e.rects.reference,$=e.rects.popper,V=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,O=typeof V=="number"?{mainAxis:V,altAxis:V}:Object.assign({mainAxis:0,altAxis:0},V),J=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,ne={x:0,y:0};if(R){if(s){var ee,le=y==="y"?_t:Lt,D=y==="y"?Ht:$t,P=y==="y"?"height":"width",X=R[y],_=X+p[le],S=X-p[D],F=d?-$[P]/2:0,W=T===wn?k[P]:$[P],Y=T===wn?-$[P]:-k[P],re=e.elements.arrow,ce=d&&re?Wa(re):{width:0,height:0},pe=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Lh(),ge=pe[le],Se=pe[D],Le=fi(0,k[P],ce[P]),Ge=b?k[P]/2-F-Le-ge-O.mainAxis:W-Le-ge-O.mainAxis,fe=b?-k[P]/2+F+Le+Se+O.mainAxis:Y+Le+Se+O.mainAxis,Te=e.elements.arrow&&di(e.elements.arrow),Me=Te?y==="y"?Te.clientTop||0:Te.clientLeft||0:0,we=(ee=J==null?void 0:J[y])!=null?ee:0,qe=X+Ge-we-Me,Be=X+fe-we,Q=fi(d?ks(_,qe):_,X,d?Zr(S,Be):S);R[y]=Q,ne[y]=Q-X}if(a){var m,E=y==="x"?_t:Lt,w=y==="x"?Ht:$t,M=R[x],z=x==="y"?"height":"width",j=M+p[E],Ie=M-p[w],be=[_t,Lt].indexOf(C)!==-1,De=(m=J==null?void 0:J[x])!=null?m:0,ke=be?j:M-k[z]-$[z]-De+O.altAxis,_e=be?M+k[z]+$[z]-De-O.altAxis:Ie,Ft=d&&be?Cv(ke,M,_e):fi(d?ke:j,M,d?_e:Ie);R[x]=Ft,ne[x]=Ft-M}e.modifiersData[n]=ne}}const jv={name:"preventOverflow",enabled:!0,phase:"main",fn:Xv,requiresIfExists:["offset"]};function zv(r){return{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}}function Zv(r){return r===kt(r)||!Yt(r)?Xa(r):zv(r)}function ey(r){var e=r.getBoundingClientRect(),t=Sn(e.width)/r.offsetWidth||1,n=Sn(e.height)/r.offsetHeight||1;return t!==1||n!==1}function ty(r,e,t){t===void 0&&(t=!1);var n=Yt(e),i=Yt(e)&&ey(e),s=_r(e),o=Rn(r,i,t),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!t)&&((lr(e)!=="body"||za(s))&&(a=Zv(e)),Yt(e)?(l=Rn(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):s&&(l.x=ja(s))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function ry(r){var e=new Map,t=new Set,n=[];r.forEach(function(s){e.set(s.name,s)});function i(s){t.add(s.name);var o=[].concat(s.requires||[],s.requiresIfExists||[]);o.forEach(function(a){if(!t.has(a)){var l=e.get(a);l&&i(l)}}),n.push(s)}return r.forEach(function(s){t.has(s.name)||i(s)}),n}function ny(r){var e=ry(r);return gv.reduce(function(t,n){return t.concat(e.filter(function(i){return i.phase===n}))},[])}function iy(r){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(r())})})),e}}function sy(r){var e=r.reduce(function(t,n){var i=t[n.name];return t[n.name]=i?Object.assign({},i,n,{options:Object.assign({},i.options,n.options),data:Object.assign({},i.data,n.data)}):n,t},{});return Object.keys(e).map(function(t){return e[t]})}var $h={placement:"bottom",modifiers:[],strategy:"absolute"};function Yh(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return!e.some(function(n){return!(n&&typeof n.getBoundingClientRect=="function")})}function oy(r){r===void 0&&(r={});var e=r,t=e.defaultModifiers,n=t===void 0?[]:t,i=e.defaultOptions,s=i===void 0?$h:i;return function(a,l,A){A===void 0&&(A=s);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},$h,s),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},u=[],h=!1,d={state:c,setOptions:function(C){var T=typeof C=="function"?C(c.options):C;g(),c.options=Object.assign({},s,c.options,T),c.scrollParents={reference:zr(a)?gi(a):a.contextElement?gi(a.contextElement):[],popper:gi(l)};var b=ny(sy([].concat(n,c.options.modifiers)));return c.orderedModifiers=b.filter(function(y){return y.enabled}),f(),d.update()},forceUpdate:function(){if(!h){var C=c.elements,T=C.reference,b=C.popper;if(Yh(T,b)){c.rects={reference:ty(T,di(b),c.options.strategy==="fixed"),popper:Wa(b)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(O){return c.modifiersData[O.name]=Object.assign({},O.data)});for(var y=0;y<c.orderedModifiers.length;y++){if(c.reset===!0){c.reset=!1,y=-1;continue}var x=c.orderedModifiers[y],R=x.fn,k=x.options,$=k===void 0?{}:k,V=x.name;typeof R=="function"&&(c=R({state:c,options:$,name:V,instance:d})||c)}}}},update:iy(function(){return new Promise(function(p){d.forceUpdate(),p(c)})}),destroy:function(){g(),h=!0}};if(!Yh(a,l))return d;d.setOptions(A).then(function(p){!h&&A.onFirstUpdate&&A.onFirstUpdate(p)});function f(){c.orderedModifiers.forEach(function(p){var C=p.name,T=p.options,b=T===void 0?{}:T,y=p.effect;if(typeof y=="function"){var x=y({state:c,name:C,instance:d,options:b}),R=function(){};u.push(x||R)}})}function g(){u.forEach(function(p){return p()}),u=[]}return d}}var ay=[Rv,Wv,wv,Sh,Kv,Gv,jv,Qv,$v],ly=oy({defaultModifiers:ay}),Ay="tippy-box",Vh="tippy-content",cy="tippy-backdrop",Kh="tippy-arrow",Jh="tippy-svg-arrow",en={passive:!0,capture:!0},Wh=function(){return document.body};function el(r,e,t){if(Array.isArray(r)){var n=r[e];return n??(Array.isArray(t)?t[e]:t)}return r}function tl(r,e){var t={}.toString.call(r);return t.indexOf("[object")===0&&t.indexOf(e+"]")>-1}function qh(r,e){return typeof r=="function"?r.apply(void 0,e):r}function Xh(r,e){if(e===0)return r;var t;return function(n){clearTimeout(t),t=setTimeout(function(){r(n)},e)}}function uy(r){return r.split(/\s+/).filter(Boolean)}function _n(r){return[].concat(r)}function jh(r,e){r.indexOf(e)===-1&&r.push(e)}function hy(r){return r.filter(function(e,t){return r.indexOf(e)===t})}function dy(r){return r.split("-")[0]}function Os(r){return[].slice.call(r)}function zh(r){return Object.keys(r).reduce(function(e,t){return r[t]!==void 0&&(e[t]=r[t]),e},{})}function mi(){return document.createElement("div")}function Us(r){return["Element","Fragment"].some(function(e){return tl(r,e)})}function fy(r){return tl(r,"NodeList")}function gy(r){return tl(r,"MouseEvent")}function py(r){return!!(r&&r._tippy&&r._tippy.reference===r)}function my(r){return Us(r)?[r]:fy(r)?Os(r):Array.isArray(r)?r:Os(document.querySelectorAll(r))}function rl(r,e){r.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function Zh(r,e){r.forEach(function(t){t&&t.setAttribute("data-state",e)})}function Ey(r){var e,t=_n(r),n=t[0];return n!=null&&(e=n.ownerDocument)!=null&&e.body?n.ownerDocument:document}function Iy(r,e){var t=e.clientX,n=e.clientY;return r.every(function(i){var s=i.popperRect,o=i.popperState,a=i.props,l=a.interactiveBorder,A=dy(o.placement),c=o.modifiersData.offset;if(!c)return!0;var u=A==="bottom"?c.top.y:0,h=A==="top"?c.bottom.y:0,d=A==="right"?c.left.x:0,f=A==="left"?c.right.x:0,g=s.top-n+u>l,p=n-s.bottom-h>l,C=s.left-t+d>l,T=t-s.right-f>l;return g||p||C||T})}function nl(r,e,t){var n=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){r[n](i,t)})}function ed(r,e){for(var t=e;t;){var n;if(r.contains(t))return!0;t=t.getRootNode==null||(n=t.getRootNode())==null?void 0:n.host}return!1}var cr={isTouch:!1},td=0;function Cy(){cr.isTouch||(cr.isTouch=!0,window.performance&&document.addEventListener("mousemove",rd))}function rd(){var r=performance.now();r-td<20&&(cr.isTouch=!1,document.removeEventListener("mousemove",rd)),td=r}function vy(){var r=document.activeElement;if(py(r)){var e=r._tippy;r.blur&&!e.state.isVisible&&r.blur()}}function yy(){document.addEventListener("touchstart",Cy,en),window.addEventListener("blur",vy)}var By=typeof window<"u"&&typeof document<"u",Qy=By?!!window.msCrypto:!1,Ty={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},by={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Xt=Object.assign({appendTo:Wh,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Ty,by),xy=Object.keys(Xt),wy=function(e){var t=Object.keys(e);t.forEach(function(n){Xt[n]=e[n]})};function nd(r){var e=r.plugins||[],t=e.reduce(function(n,i){var s=i.name,o=i.defaultValue;if(s){var a;n[s]=r[s]!==void 0?r[s]:(a=Xt[s])!=null?a:o}return n},{});return Object.assign({},r,t)}function Sy(r,e){var t=e?Object.keys(nd(Object.assign({},Xt,{plugins:e}))):xy,n=t.reduce(function(i,s){var o=(r.getAttribute("data-tippy-"+s)||"").trim();if(!o)return i;if(s==="content")i[s]=o;else try{i[s]=JSON.parse(o)}catch{i[s]=o}return i},{});return n}function id(r,e){var t=Object.assign({},e,{content:qh(e.content,[r])},e.ignoreAttributes?{}:Sy(r,e.plugins));return t.aria=Object.assign({},Xt.aria,t.aria),t.aria={expanded:t.aria.expanded==="auto"?e.interactive:t.aria.expanded,content:t.aria.content==="auto"?e.interactive?null:"describedby":t.aria.content},t}var Ry=function(){return"innerHTML"};function il(r,e){r[Ry()]=e}function sd(r){var e=mi();return r===!0?e.className=Kh:(e.className=Jh,Us(r)?e.appendChild(r):il(e,r)),e}function od(r,e){Us(e.content)?(il(r,""),r.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?il(r,e.content):r.textContent=e.content)}function sl(r){var e=r.firstElementChild,t=Os(e.children);return{box:e,content:t.find(function(n){return n.classList.contains(Vh)}),arrow:t.find(function(n){return n.classList.contains(Kh)||n.classList.contains(Jh)}),backdrop:t.find(function(n){return n.classList.contains(cy)})}}function ad(r){var e=mi(),t=mi();t.className=Ay,t.setAttribute("data-state","hidden"),t.setAttribute("tabindex","-1");var n=mi();n.className=Vh,n.setAttribute("data-state","hidden"),od(n,r.props),e.appendChild(t),t.appendChild(n),i(r.props,r.props);function i(s,o){var a=sl(e),l=a.box,A=a.content,c=a.arrow;o.theme?l.setAttribute("data-theme",o.theme):l.removeAttribute("data-theme"),typeof o.animation=="string"?l.setAttribute("data-animation",o.animation):l.removeAttribute("data-animation"),o.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof o.maxWidth=="number"?o.maxWidth+"px":o.maxWidth,o.role?l.setAttribute("role",o.role):l.removeAttribute("role"),(s.content!==o.content||s.allowHTML!==o.allowHTML)&&od(A,r.props),o.arrow?c?s.arrow!==o.arrow&&(l.removeChild(c),l.appendChild(sd(o.arrow))):l.appendChild(sd(o.arrow)):c&&l.removeChild(c)}return{popper:e,onUpdate:i}}ad.$$tippy=!0;var Dy=1,Gs=[],ol=[];function _y(r,e){var t=id(r,Object.assign({},Xt,nd(zh(e)))),n,i,s,o=!1,a=!1,l=!1,A=!1,c,u,h,d=[],f=Xh(qe,t.interactiveDebounce),g,p=Dy++,C=null,T=hy(t.plugins),b={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},y={id:p,reference:r,popper:mi(),popperInstance:C,props:t,state:b,plugins:T,clearDelayTimeouts:ke,setProps:_e,setContent:Ft,show:ct,hide:Nt,hideWithInteractivity:dr,enable:be,disable:De,unmount:fr,destroy:Ct};if(!t.render)return y;var x=t.render(y),R=x.popper,k=x.onUpdate;R.setAttribute("data-tippy-root",""),R.id="tippy-"+y.id,y.popper=R,r._tippy=y,R._tippy=y;var $=T.map(function(q){return q.fn(y)}),V=r.hasAttribute("aria-expanded");return Te(),F(),X(),_("onCreate",[y]),t.showOnCreate&&j(),R.addEventListener("mouseenter",function(){y.props.interactive&&y.state.isVisible&&y.clearDelayTimeouts()}),R.addEventListener("mouseleave",function(){y.props.interactive&&y.props.trigger.indexOf("mouseenter")>=0&&le().addEventListener("mousemove",f)}),y;function O(){var q=y.props.touch;return Array.isArray(q)?q:[q,0]}function J(){return O()[0]==="hold"}function ne(){var q;return!!((q=y.props.render)!=null&&q.$$tippy)}function ee(){return g||r}function le(){var q=ee().parentNode;return q?Ey(q):document}function D(){return sl(R)}function P(q){return y.state.isMounted&&!y.state.isVisible||cr.isTouch||c&&c.type==="focus"?0:el(y.props.delay,q?0:1,Xt.delay)}function X(q){q===void 0&&(q=!1),R.style.pointerEvents=y.props.interactive&&!q?"":"none",R.style.zIndex=""+y.props.zIndex}function _(q,de,Ce){if(Ce===void 0&&(Ce=!0),$.forEach(function(Fe){Fe[q]&&Fe[q].apply(Fe,de)}),Ce){var Pe;(Pe=y.props)[q].apply(Pe,de)}}function S(){var q=y.props.aria;if(q.content){var de="aria-"+q.content,Ce=R.id,Pe=_n(y.props.triggerTarget||r);Pe.forEach(function(Fe){var Xe=Fe.getAttribute(de);if(y.state.isVisible)Fe.setAttribute(de,Xe?Xe+" "+Ce:Ce);else{var Tt=Xe&&Xe.replace(Ce,"").trim();Tt?Fe.setAttribute(de,Tt):Fe.removeAttribute(de)}})}}function F(){if(!(V||!y.props.aria.expanded)){var q=_n(y.props.triggerTarget||r);q.forEach(function(de){y.props.interactive?de.setAttribute("aria-expanded",y.state.isVisible&&de===ee()?"true":"false"):de.removeAttribute("aria-expanded")})}}function W(){le().removeEventListener("mousemove",f),Gs=Gs.filter(function(q){return q!==f})}function Y(q){if(!(cr.isTouch&&(l||q.type==="mousedown"))){var de=q.composedPath&&q.composedPath()[0]||q.target;if(!(y.props.interactive&&ed(R,de))){if(_n(y.props.triggerTarget||r).some(function(Ce){return ed(Ce,de)})){if(cr.isTouch||y.state.isVisible&&y.props.trigger.indexOf("click")>=0)return}else _("onClickOutside",[y,q]);y.props.hideOnClick===!0&&(y.clearDelayTimeouts(),y.hide(),a=!0,setTimeout(function(){a=!1}),y.state.isMounted||ge())}}}function re(){l=!0}function ce(){l=!1}function pe(){var q=le();q.addEventListener("mousedown",Y,!0),q.addEventListener("touchend",Y,en),q.addEventListener("touchstart",ce,en),q.addEventListener("touchmove",re,en)}function ge(){var q=le();q.removeEventListener("mousedown",Y,!0),q.removeEventListener("touchend",Y,en),q.removeEventListener("touchstart",ce,en),q.removeEventListener("touchmove",re,en)}function Se(q,de){Ge(q,function(){!y.state.isVisible&&R.parentNode&&R.parentNode.contains(R)&&de()})}function Le(q,de){Ge(q,de)}function Ge(q,de){var Ce=D().box;function Pe(Fe){Fe.target===Ce&&(nl(Ce,"remove",Pe),de())}if(q===0)return de();nl(Ce,"remove",u),nl(Ce,"add",Pe),u=Pe}function fe(q,de,Ce){Ce===void 0&&(Ce=!1);var Pe=_n(y.props.triggerTarget||r);Pe.forEach(function(Fe){Fe.addEventListener(q,de,Ce),d.push({node:Fe,eventType:q,handler:de,options:Ce})})}function Te(){J()&&(fe("touchstart",we,{passive:!0}),fe("touchend",Be,{passive:!0})),uy(y.props.trigger).forEach(function(q){if(q!=="manual")switch(fe(q,we),q){case"mouseenter":fe("mouseleave",Be);break;case"focus":fe(Qy?"focusout":"blur",Q);break;case"focusin":fe("focusout",Q);break}})}function Me(){d.forEach(function(q){var de=q.node,Ce=q.eventType,Pe=q.handler,Fe=q.options;de.removeEventListener(Ce,Pe,Fe)}),d=[]}function we(q){var de,Ce=!1;if(!(!y.state.isEnabled||m(q)||a)){var Pe=((de=c)==null?void 0:de.type)==="focus";c=q,g=q.currentTarget,F(),!y.state.isVisible&&gy(q)&&Gs.forEach(function(Fe){return Fe(q)}),q.type==="click"&&(y.props.trigger.indexOf("mouseenter")<0||o)&&y.props.hideOnClick!==!1&&y.state.isVisible?Ce=!0:j(q),q.type==="click"&&(o=!Ce),Ce&&!Pe&&Ie(q)}}function qe(q){var de=q.target,Ce=ee().contains(de)||R.contains(de);if(!(q.type==="mousemove"&&Ce)){var Pe=z().concat(R).map(function(Fe){var Xe,Tt=Fe._tippy,bt=(Xe=Tt.popperInstance)==null?void 0:Xe.state;return bt?{popperRect:Fe.getBoundingClientRect(),popperState:bt,props:t}:null}).filter(Boolean);Iy(Pe,q)&&(W(),Ie(q))}}function Be(q){var de=m(q)||y.props.trigger.indexOf("click")>=0&&o;if(!de){if(y.props.interactive){y.hideWithInteractivity(q);return}Ie(q)}}function Q(q){y.props.trigger.indexOf("focusin")<0&&q.target!==ee()||y.props.interactive&&q.relatedTarget&&R.contains(q.relatedTarget)||Ie(q)}function m(q){return cr.isTouch?J()!==q.type.indexOf("touch")>=0:!1}function E(){w();var q=y.props,de=q.popperOptions,Ce=q.placement,Pe=q.offset,Fe=q.getReferenceClientRect,Xe=q.moveTransition,Tt=ne()?sl(R).arrow:null,bt=Fe?{getBoundingClientRect:Fe,contextElement:Fe.contextElement||ee()}:r,Mn={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Pn){var kr=Pn.state;if(ne()){var Bi=D(),Qi=Bi.box;["placement","reference-hidden","escaped"].forEach(function(On){On==="placement"?Qi.setAttribute("data-placement",kr.placement):kr.attributes.popper["data-popper-"+On]?Qi.setAttribute("data-"+On,""):Qi.removeAttribute("data-"+On)}),kr.attributes.popper={}}}},xt=[{name:"offset",options:{offset:Pe}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!Xe}},Mn];ne()&&Tt&&xt.push({name:"arrow",options:{element:Tt,padding:3}}),xt.push.apply(xt,(de==null?void 0:de.modifiers)||[]),y.popperInstance=ly(bt,R,Object.assign({},de,{placement:Ce,onFirstUpdate:h,modifiers:xt}))}function w(){y.popperInstance&&(y.popperInstance.destroy(),y.popperInstance=null)}function M(){var q=y.props.appendTo,de,Ce=ee();y.props.interactive&&q===Wh||q==="parent"?de=Ce.parentNode:de=qh(q,[Ce]),de.contains(R)||de.appendChild(R),y.state.isMounted=!0,E()}function z(){return Os(R.querySelectorAll("[data-tippy-root]"))}function j(q){y.clearDelayTimeouts(),q&&_("onTrigger",[y,q]),pe();var de=P(!0),Ce=O(),Pe=Ce[0],Fe=Ce[1];cr.isTouch&&Pe==="hold"&&Fe&&(de=Fe),de?n=setTimeout(function(){y.show()},de):y.show()}function Ie(q){if(y.clearDelayTimeouts(),_("onUntrigger",[y,q]),!y.state.isVisible){ge();return}if(!(y.props.trigger.indexOf("mouseenter")>=0&&y.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(q.type)>=0&&o)){var de=P(!1);de?i=setTimeout(function(){y.state.isVisible&&y.hide()},de):s=requestAnimationFrame(function(){y.hide()})}}function be(){y.state.isEnabled=!0}function De(){y.hide(),y.state.isEnabled=!1}function ke(){clearTimeout(n),clearTimeout(i),cancelAnimationFrame(s)}function _e(q){if(!y.state.isDestroyed){_("onBeforeUpdate",[y,q]),Me();var de=y.props,Ce=id(r,Object.assign({},de,zh(q),{ignoreAttributes:!0}));y.props=Ce,Te(),de.interactiveDebounce!==Ce.interactiveDebounce&&(W(),f=Xh(qe,Ce.interactiveDebounce)),de.triggerTarget&&!Ce.triggerTarget?_n(de.triggerTarget).forEach(function(Pe){Pe.removeAttribute("aria-expanded")}):Ce.triggerTarget&&r.removeAttribute("aria-expanded"),F(),X(),k&&k(de,Ce),y.popperInstance&&(E(),z().forEach(function(Pe){requestAnimationFrame(Pe._tippy.popperInstance.forceUpdate)})),_("onAfterUpdate",[y,q])}}function Ft(q){y.setProps({content:q})}function ct(){var q=y.state.isVisible,de=y.state.isDestroyed,Ce=!y.state.isEnabled,Pe=cr.isTouch&&!y.props.touch,Fe=el(y.props.duration,0,Xt.duration);if(!(q||de||Ce||Pe)&&!ee().hasAttribute("disabled")&&(_("onShow",[y],!1),y.props.onShow(y)!==!1)){if(y.state.isVisible=!0,ne()&&(R.style.visibility="visible"),X(),pe(),y.state.isMounted||(R.style.transition="none"),ne()){var Xe=D(),Tt=Xe.box,bt=Xe.content;rl([Tt,bt],0)}h=function(){var xt;if(!(!y.state.isVisible||A)){if(A=!0,R.offsetHeight,R.style.transition=y.props.moveTransition,ne()&&y.props.animation){var an=D(),Pn=an.box,kr=an.content;rl([Pn,kr],Fe),Zh([Pn,kr],"visible")}S(),F(),jh(ol,y),(xt=y.popperInstance)==null||xt.forceUpdate(),_("onMount",[y]),y.props.animation&&ne()&&Le(Fe,function(){y.state.isShown=!0,_("onShown",[y])})}},M()}}function Nt(){var q=!y.state.isVisible,de=y.state.isDestroyed,Ce=!y.state.isEnabled,Pe=el(y.props.duration,1,Xt.duration);if(!(q||de||Ce)&&(_("onHide",[y],!1),y.props.onHide(y)!==!1)){if(y.state.isVisible=!1,y.state.isShown=!1,A=!1,o=!1,ne()&&(R.style.visibility="hidden"),W(),ge(),X(!0),ne()){var Fe=D(),Xe=Fe.box,Tt=Fe.content;y.props.animation&&(rl([Xe,Tt],Pe),Zh([Xe,Tt],"hidden"))}S(),F(),y.props.animation?ne()&&Se(Pe,y.unmount):y.unmount()}}function dr(q){le().addEventListener("mousemove",f),jh(Gs,f),f(q)}function fr(){y.state.isVisible&&y.hide(),y.state.isMounted&&(w(),z().forEach(function(q){q._tippy.unmount()}),R.parentNode&&R.parentNode.removeChild(R),ol=ol.filter(function(q){return q!==y}),y.state.isMounted=!1,_("onHidden",[y]))}function Ct(){y.state.isDestroyed||(y.clearDelayTimeouts(),y.unmount(),Me(),delete r._tippy,y.state.isDestroyed=!0,_("onDestroy",[y]))}}function tn(r,e){e===void 0&&(e={});var t=Xt.plugins.concat(e.plugins||[]);yy();var n=Object.assign({},e,{plugins:t}),i=my(r),s=i.reduce(function(o,a){var l=a&&_y(a,n);return l&&o.push(l),o},[]);return Us(r)?s[0]:s}tn.defaultProps=Xt,tn.setDefaultProps=wy,tn.currentInput=cr,Object.assign({},Sh,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}}),tn.setDefaultProps({render:ad});function rn(r){var e;const t=[];return((e=r.renderer)==null?void 0:e.type)==="video"&&t.push(r.options),t.push(...r.childNodes.flatMap(rn).filter(Boolean)),t}class Hs extends Error{constructor(e,t=new Error,n=!1){super(),this.fatal=!1,this.fatal=n,this.stack=t.stack,this.message=[e,t.message].filter(Boolean).join(" - ")}}const Ly=5;function Fy(r,e){const t=r.map(({id:i})=>i).join("|"),n=e.map(({id:i})=>i).join("|");return t===n}class ky{constructor(e){this._caption="",this._currentTime=0,this._activeScenes=[],this._upcomingScenes=[],this._canvas=vt(),this._controls=vt(),this.host=e}set activeScenes(e){Fy(e,this._activeScenes)||(this._activeScenes=e,this.host.dispatchEvent(new CustomEvent("scenechange",{detail:e})),this.host.requestUpdate())}get activeScenes(){return this._activeScenes}set currentTime(e){var t,n,i;const s=Math.min(this.host.duration,Math.max(0,e));this.activeScenes=((t=this.host.composition)==null?void 0:t.tracks.reduce((a,l)=>a.concat(l.drawScenes.filter(({start:A,duration:c})=>s>=A&&s<A+c)),[]))??[];const o=s!==this.currentTime;this._currentTime=s,this._upcomingScenes=((n=this.host.composition)==null?void 0:n.tracks.reduce((a,l)=>a.concat(l.drawScenes.filter(({start:A})=>s>=A-Ly&&s<A)),[]))??[],this.loadScenes(),this.syncVideoState(),(i=this._controls.value)==null||i.setAttribute("currentTime",s.toString()),o&&this.host.dispatchEvent(new CustomEvent("timeupdate",{detail:s})),this.draw(s)}get currentTime(){return this._currentTime}set caption(e){e!==this._caption&&(this._caption=e,this.host.requestUpdate())}get caption(){return this._caption}canvas(){return yt(this._canvas)}controls(){return yt(this._controls)}loadScenes(){[...this.activeScenes,...this._upcomingScenes].forEach(e=>{const{start:t,duration:n}=e,i=this.host.currentTime>0||this.host.preload==="auto"||!this.host.paused;rn(e.layout.node).forEach(o=>{var a,l,A;if(o!=null&&o.key&&this.host.videos[o==null?void 0:o.key]){const c=this.host.videos[o==null?void 0:o.key],{key:u,hls:h,node:d,start:f,duration:g}=c,p=this.host.videoState[u];d&&p&&(d.currentTime>=f+g||d.ended||i&&(h?(a=h.startLoadOnce)==null||a.call(h,f):p.initialised||(l=d.startLoadOnce)==null||l.call(d)))}else if(i){const c=`${t}-${n}`,u=this.host._sceneController.videoState[c];this.host.duration&&!((A=u==null?void 0:u.buffered)!=null&&A.length)&&(this.host._sceneController.videoState={...this.host._sceneController.videoState,[c]:{...u,buffered:[{start:Math.max(0,t/this.host.duration*100),end:Math.min((t+n)/this.host.duration*100,100)}]}})}})})}syncVideoState(){var e;(e=this.host.composition)==null||e.tracks.forEach(t=>{var n;(n=t.drawScenes)==null||n.forEach(i=>{rn(i.layout.node).forEach(o=>{if(o!=null&&o.key&&this.host.videos[o==null?void 0:o.key]){const a=this.host.videos[o==null?void 0:o.key],{key:l,node:A}=a,c=this.host.videoState[l],u=this.activeScenes.includes(i);if(A&&c)if(u&&!this.host.waiting&&!this.host.loading&&!this.host.paused){if(A.paused&&c.initialised)try{return A.play()}catch(h){throw new Hs("Video play error",h,!0)}}else A.paused||A.pause()}})})})}draw(e=this.currentTime){this.host.composition&&this._canvas.value&&this.host.composition.draw({currentTime:e,canvas:this._canvas.value})}clear(){var e;const t=this._canvas.value;(e=t==null?void 0:t.getContext("2d"))==null||e.clearRect(0,0,t.width,t.height)}}async function ld(r){return r.duration===1/0?new Promise(e=>{r.currentTime=Number.MAX_SAFE_INTEGER,r.ontimeupdate=()=>{r.ontimeupdate=null,e(r.duration),r.currentTime=0}}):r.duration}function Ny(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function My(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function Py(r,e){return new Promise(async t=>{const{id:n,key:i,duration:s,startOffset:o,endOffset:a,aspectRatio:l}=e,A=document.createElement("video");A.playsInline=!0,A.muted=!0,A.loop=!1,A.src=r;let c=!1;if(A.startLoadOnce=()=>{c||(A.preload="auto",A.load(),c=!0)},s&&l){A.preload="none";const u=(o??0)*s,h=(1-(a??0))*s;t({id:n,key:i,hls:null,config:e,aspectRatio:l,node:A,start:u,duration:h-u})}else{A.preload="metadata";const u=async()=>{const h=await ld(A),d=(o??0)*h,f=(1-(a??0))*h;t({id:n,key:i,hls:null,config:e,node:A,start:d,duration:f-d,aspectRatio:A.videoWidth/A.videoHeight}),A.removeEventListener("loadedmetadata",u)};A.addEventListener("loadedmetadata",u)}})}function Oy(r,e){return new Promise(t=>{const{id:n,key:i,startOffset:s,endOffset:o}=e,a=document.createElement("video");a.playsInline=!0,a.muted=!0,a.loop=!1;let l=!1;const A=new yr({autoStartLoad:!0,xhrSetup:c=>{const{open:u}=c,h=r.split("?")[1];c.open=function(d,f,g){h&&!f.toString().includes("?")&&(f+="?"+h),!(!l&&f.toString().includes(".ts"))&&u.apply(this,[d,f,g])}}});A.on(yr.Events.LEVEL_LOADED,async()=>{l||A==null||A.stopLoad();const c=await ld(a),u=(s??0)*c,h=(1-(o??0))*c;t({id:n,key:i,hls:A,config:e,node:a,start:u,duration:h-u,aspectRatio:A.levels[0].width/A.levels[0].height})}),A.loadSource(r),A.attachMedia(a),A.startLoadOnce=(c=-1,u)=>{if(A&&!l){const h=A.levels.findIndex(d=>Math.min(d.height,d.width)===u);l=!0,A.startLevel=A.firstLevel,A.startLoad(c),A.currentLevel=h!==-1?h:A.firstLevel}}})}function Uy(r){const{src:e,playlist:t}=r;return t&&!Ny()&&yr.isSupported()?Oy(t,r):Py(e,r)}const Gy=$r(async function(e){const{weight:t,family:n}=e,{client:i,server:s}=n.weights.find(a=>a.weight===t)??{};return!i&&!s?null:new FontFace(e.family.name,`url(${i??s})`,{weight:t,style:"normal"}).load()},{cacheKey:([r])=>JSON.stringify(r)});let Hy=class{constructor(e){this._hasPlayed=!1,this._memoKey=null,this._lastDeps=null,this._duration=0,this._composition=null,this._videos={},this._videoState={},this._delayProcessing=(t=100)=>{const n=new AbortController,i=setTimeout(()=>{n.signal.aborted||(this.host._processing=!0)},t);return n.signal.addEventListener("abort",()=>{clearTimeout(i)}),n},this._createImageResolver=$r(async({config:t})=>t.src?new Promise((n,i)=>{const s=new Image;s.onload=()=>{n({image:s})},s.onerror=o=>{i(o)},s.src=t.src}):{image:null}),this._videoFactory=$r(async t=>{const{id:n,key:i}=t,s=await Uy(t);s.node.volume=this.host.volume,s.node.playbackRate=this.host.playbackRate;const o={loadeddata:this._handleLoadedData,waiting:this._handleWaiting,canplay:this._handleCanPlay,progress:this._handleProgress,seeking:this._handleSeeking,seeked:this._handleSeeked,play:this._handlePlay,playing:this._handlePlaying,pause:this._handlePause,stalled:this._handleStalled,timeupdate:this._handleTimeUpdate,ended:this._handleEnded,error:this._handleError},a=Object.keys(o).reduce((l,A)=>{const c=A,u=o[c]({id:n,key:i,node:s.node});return l[c]=u,s.node.addEventListener(A,u),l},{});return{video:s,listeners:a,source:()=>s.node}},{cacheKey:([{id:t,key:n,src:i,playlist:s}])=>JSON.stringify({id:t,key:n,src:i==null?void 0:i.split("?")[0],playlist:s==null?void 0:s.split("?")[0]})}),this._createVideoResolver=async({config:t})=>{const{video:n,listeners:i,source:s}=await this._videoFactory(t);return this.videos={...this.videos,[t.key]:{...n,listeners:i}},this.videoState={...this.videoState,[t.key]:{initialised:!n,waiting:!!n,...this.videoState[t.key]}},{video:s,aspectRatio:n.aspectRatio}},this._handleLoadedData=({id:t,key:n,node:i})=>()=>{const s=this.videoState[n];s!=null&&s.initialised||(this.videoState={...this.videoState,[n]:{...s,initialised:!0,waiting:!1,buffered:(s==null?void 0:s.buffered)??[]}},this.setVideosCurrentTime(this.host.currentTime),this.host.dispatchEvent(new CustomEvent("video:loadeddata",{detail:{id:t,key:n,node:i}})))},this._handleWaiting=({key:t})=>()=>{const n=this.videoState[t];n!=null&&n.initialised&&!(n!=null&&n.waiting)&&(this.videoState={...this.videoState,[t]:{...n,waiting:!0}})},this._handleCanPlay=({key:t})=>()=>{const n=this.videoState[t];n!=null&&n.initialised&&(n!=null&&n.waiting)&&(this.videoState={...this.videoState,[t]:{...n,waiting:!1}}),this.host.paused&&this.host.draw()},this._handleProgress=()=>()=>{},this._handleSeeking=({id:t,key:n,node:i})=>()=>{this.host.dispatchEvent(new CustomEvent("video:seeking",{detail:{id:t,key:n,node:i}}))},this._handleSeeked=({id:t,key:n,node:i})=>()=>{const s=this.videoState[n];s!=null&&s.initialised&&(this.host.draw(),this.host.activeScenes.flatMap(o=>rn(o.layout.node).map(({id:l})=>l)).includes(t)&&this.host.dispatchEvent(new CustomEvent("seeked",{detail:this.host.currentTime})),this.host.dispatchEvent(new CustomEvent("video:seeked",{detail:{id:t,key:n,node:i}})))},this._handlePlay=({id:t,key:n,node:i})=>()=>{this.hasPlayed=!0,this.host.dispatchEvent(new CustomEvent("video:play",{detail:{id:t,key:n,node:i}}))},this._handlePlaying=({id:t,key:n,node:i})=>()=>{this.host.dispatchEvent(new CustomEvent("video:playing",{detail:{id:t,key:n,node:i}}))},this._handlePause=({id:t,key:n,node:i})=>()=>{this.host.dispatchEvent(new CustomEvent("video:pause",{detail:{id:t,key:n,node:i}}))},this._handleStalled=({id:t,key:n,node:i})=>()=>{this.host.dispatchEvent(new CustomEvent("video:stalled",{detail:{id:t,key:n,node:i}}))},this._handleTimeUpdate=({id:t,key:n,node:i})=>()=>{this.host.dispatchEvent(new CustomEvent("video:timeupdate",{detail:{id:t,key:n,node:i}}))},this._handleEnded=({id:t,key:n,node:i})=>()=>{this.host.dispatchEvent(new CustomEvent("video:ended",{detail:{id:t,key:n,node:i}}))},this._handleError=({id:t,key:n,node:i})=>()=>{const s=new Hs(`Video error - answer ${t} failed to load`);this.host.dispatchEvent(new ErrorEvent("error",{bubbles:!0,composed:!0,error:s,message:s.message})),this.host.dispatchEvent(new CustomEvent("video:error",{detail:{id:t,key:n,node:i}}))},this._cleanupVideo=t=>{var n;const i=this.videos[t];i&&(i.node.pause(),i.node.src="",(n=i.hls)==null||n.destroy(),Object.keys(i.listeners??{}).forEach(s=>{var o,a;if((o=this.videos)!=null&&o[t]){const l=(a=i.listeners)==null?void 0:a[s];l&&i.node.removeEventListener(s,l)}}),delete this.videos[t])},this.host=e,this.host.addController(this)}set hasPlayed(e){e!==this._hasPlayed&&(this._hasPlayed=e,this.host.requestUpdate())}get hasPlayed(){return this._hasPlayed}set duration(e){!isNaN(e)&&e!==this._duration&&(this._duration=e,this.host.requestUpdate(),this.host.dispatchEvent(new CustomEvent("durationchange",{detail:this._duration})))}get duration(){return this._duration}set composition(e){e!==this._composition&&(this._composition=e,this.host.requestUpdate())}get composition(){return this._composition}set videos(e){e!==this._videos&&(this._videos=e,this.host.requestUpdate())}get videos(){return this._videos}set videoState(e){e!==this._videoState&&(this._videoState=e,this.host.requestUpdate())}get videoState(){return this._videoState}_setupTask(){new Di(this.host,async([e,t,n])=>{var i;const s=this._delayProcessing();try{if(this.host._errors=[],(!t||!this.host._languages.find(({value:o})=>t===o))&&(this.host._language=(i=this.host._languages[0])==null?void 0:i.value),e){const{width:o,height:a}=Oo({aspectRatio:n,resolution:1080});try{this.composition=await ac({config:e,resolvers:{text:async({options:l})=>{const A=await Gy(l.font);return A&&document.fonts.add(A),{font:l.font}},image:this._createImageResolver,video:this._createVideoResolver},rootWidth:o,rootHeight:a})}catch(l){throw new Hs("Fatal composition error",l,!0)}this.duration=this.composition.duration,this.host.currentTime>this.duration?this.host.reset(this.duration,!1):this.host.paused&&this.host.reset(this.host.currentTime,!this.host.paused)}this.host.dispatchEvent(new CustomEvent("compositionupdate",{detail:this.composition,bubbles:!0,composed:!0}))}catch(o){this.composition=null,this.duration=0,this.host.dispatchEvent(new ErrorEvent("error",{composed:!0,bubbles:!0,error:o,message:o.message}))}finally{s.abort(),this.host._processing=!1}},()=>{const e=JSON.stringify({config:this.host.config,language:this.host.language,aspectRatio:this.host.aspectRatio});if(this._lastDeps&&this._memoKey===e)return this._lastDeps;const t=[this.host.config,this.host.language,this.host.aspectRatio];return this._memoKey=e,this._lastDeps=t,t})}_setVideoCurrentTime({time:e,scene:t}){const{start:n}=t;rn(t.layout.node).forEach(s=>{if(s!=null&&s.key&&this.videos[s==null?void 0:s.key]){const o=this.videos[s==null?void 0:s.key],a=e-n;o.node.currentTime=Math.max(o.start,Math.min(o.start+o.duration,a+o.start))}})}setVideosCurrentTime(e){var t;(t=this.composition)==null||t.tracks.forEach(n=>{n.drawScenes.forEach(i=>{this._setVideoCurrentTime({time:e,scene:i})})})}hostConnected(){this._setupTask()}hostDisconnected(){Object.keys(this.videos).forEach(e=>{this._cleanupVideo(e)}),this.videos={}}};function $y(r){r.requestFullscreen?r.requestFullscreen():r.mozRequestFullScreen?r.mozRequestFullScreen():r.webkitRequestFullscreen?r.webkitRequestFullscreen():r.msRequestFullscreen&&r.msRequestFullscreen()}function Yy(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()}const al=["progress","play-large","navigation","play","volume","current-time","duration","speed","captions","fullscreen","preview"],Vy={id:"captions",event:"captions:click",label:"Closed Captions"},Ky={id:"fullscreen",event:"fullscreen:click",label:"Full Screen"},Ad={title:"Playback Speed",items:[{id:"playback-rate-0.5",event:"playbackRate:click",label:"0.5x",value:.5},{id:"playback-rate-1",event:"playbackRate:click",label:"1.0x",value:1},{id:"playback-rate-1.5",event:"playbackRate:click",label:"1.5x",value:1.5},{id:"playback-rate-2",event:"playbackRate:click",label:"2.0x",value:2}]},Jy={id:"playbackRate",label:"Playback playbackRate",subItems:Ad};class Wy extends Hl{constructor(e){if(super(e),this.element=null,this.observer=void 0,e.type!==un.ELEMENT)throw new Error("Resize directive must be used in an Element expression")}disconnected(){var e;(e=this.observer)==null||e.disconnect(),this.observer=void 0}reconnected(){var e;this.element&&((e=this.observer)==null||e.observe(this.element))}update(e,[t]){return this.isConnected&&!this.observer&&(this.observer=new ResizeObserver(t),this.element=e.element,this.observer.observe(this.element)),Vt}}const ll=hn(Wy),qy=nv(()=>{const r=new FontFace("Roobert","url(https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/Roobert-Regular.woff2)",{style:"normal",weight:"400"}),e=new FontFace("Roobert","url(https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/Roobert-SemiBold.woff2)",{style:"normal",weight:"600"}),t=new FontFace("Roobert","url(https://vouch-clients.s3.ap-southeast-2.amazonaws.com/vouch/fonts/Roobert-Bold.woff2",{style:"normal",weight:"700"}),n=new FontFace("Roobert Captions","url(https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/Roobert-Regular.woff2)",{style:"normal",weight:"400"}),i=zA.map(s=>({load:!1,font:new FontFace(s.family,`url(${s.url})`,{style:s.style})}));return[{load:!0,font:r},{load:!0,font:e},{load:!0,font:t},{load:!0,font:n},...i]}),ur={"red-120":"#feeded","red-130":"#fcd5d0","red-400":"#e84a4a","red-500":"#c51c3a","red-700":"#a21c39","red-800":"#850231","red-900":"#580A2D","teal-80":"#f3fafa","teal-100":"#d6f1f1","teal-200":"#ace3e3","teal-300":"#7acace","teal-400":"#4faab2","teal-500":"#358f97","teal-600":"#287179","teal-700":"#22555c","teal-800":"#21484e","teal-900":"#1f3d42","teal-950":"#0d2126","purple-100":"#d7cfff","purple-700":"#5f2fe9","green-200":"#a4d7aa","green-500":"#38b319","green-800":"#2b3c2f","grey-100":"#f0f0f0","light-50":"rgba(255, 255, 255, .05)","light-100":"rgba(255, 255, 255, .1)","light-200":"rgba(255, 255, 255, .2)","light-400":"rgba(255, 255, 255, .4)","light-500":"rgba(255, 255, 255, .5)","light-640":"rgba(255, 255, 255, .64)","light-800":"rgba(255, 255, 255, .8)","light-1000":"#fff","dark-50":"rgba(0, 0, 0, .05)","dark-80":"rgba(0, 0, 0, .08)","dark-100":"rgba(0, 0, 0, .1)","dark-200":"rgba(0, 0, 0, .2)","dark-250":"rgba(0, 0, 0, .25)","dark-400":"rgba(0, 0, 0, .4)","dark-500":"rgba(0, 0, 0, .5)","dark-640":"rgba(0, 0, 0, .64)","dark-800":"rgba(0, 0, 0, .8)","dark-900":"rgba(0, 0, 0, .9)","dark-1000":"#000"},Xy={colors:ur,space:{xxs:".25rem",xs:".5rem",small:".75rem",medium:"1rem",large:"1.5rem",xl:"2.5rem"},sizes:{xxs:"1rem",xs:"1.5rem",small:"2rem",medium:"2.5rem",large:"3rem"},fontWeights:{regular:400,semibold:600},lineHeights:{small:1.1,medium:1.25,large:1.4},letterSpacings:{xxs:"-.04rem",xs:"-.03rem",small:"-.02rem",medium:"-.01rem",large:0},fontSizes:{micro:".625rem",small:".75rem",medium:".875rem",large:"1rem",xl:"1.25rem",xxl:"1.5rem",xxxl:"2rem",huge:"2.75rem"},fontFamilies:{sans:'Roobert, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,"Noto Sans", "Noto Color Emoji", sans-serif, "Segoe UI Emoji", "Segoe UI Symbol", "Apple Color Emoji"',mono:'"Maison Neue Mono", Menlo, Monaco, Consolas, Liberation Mono, "Courier New", monospace'},borderWidths:{thin:".0625rem"},radii:{small:".25rem",medium:".5rem",large:".75rem",xl:"1rem"},shadows:{small:`.25rem .25rem .25rem ${ur["dark-100"]}`,medium:`0 .125rem .625rem ${ur["dark-100"]}`,large:`0 .25rem 1rem ${ur["dark-50"]}`,xl:`.25rem .25rem 1rem ${ur["dark-250"]}`,xxl:`0 .25rem 2rem ${ur["dark-100"]}`,xxxl:`.25rem .25rem 3rem ${ur["dark-250"]}`,toolbar:`0 -.625rem .625rem ${ur["dark-50"]}`,text:`0 0 .25rem ${ur["dark-250"]}`},timings:{fast:".1s",normal:".2s",slow:".3s"},easings:{linear:"linear"},focusOutline:{width:".2rem",color:ur["dark-400"]},iconSizes:{small:"0.75rem",medium:"1rem",large:"1.5rem"}},cd=ev(Xy,{delimiter:"-"}),jy=Object.keys(cd).map(r=>Un(`:host { --${r}: ${cd[r]}; }`)),$e=(r=>{const e=class extends r{firstUpdated(){qy().forEach(({load:s,font:o})=>{document.fonts.add(o),s&&o.load()})}};return e.styles=[(r==null?void 0:r.styles)??[],jy,gt`
|
2493
2493
|
:host {
|
2494
2494
|
font-family: var(--fontFamilies-sans);
|
2495
2495
|
font-size: var(--fontSizes-medium);
|
@@ -2570,7 +2570,7 @@ vec4 transition(vec2 uv) {
|
|
2570
2570
|
scroll-behavior: auto !important;
|
2571
2571
|
}
|
2572
2572
|
}
|
2573
|
-
`],e})(
|
2573
|
+
`],e})(cn),zy=(r,e)=>(typeof window<"u"&&(window.customElements.get(r)??window.customElements.define(r,e)),e),Zy=(r,e)=>{const{kind:t,elements:n}=e;return{kind:t,elements:n,finisher(i){typeof window<"u"&&(window.customElements.get(r)??window.customElements.define(r,i))}}},wt=r=>e=>typeof e=="function"?zy(r,e):Zy(r,e);class eB{constructor(e){this._memoKey=null,this._lastDeps=null,this._composition=null,this._videos={},this._cleanupVideo=t=>{var n;const i=this.videos[t];i&&(i.node.pause(),i.node.src="",(n=i.hls)==null||n.destroy(),delete this.videos[t])},this.host=e,this.host.addController(this)}set composition(e){e!==this._composition&&(this._composition=e,this.host.requestUpdate())}get composition(){return this._composition}set videos(e){e!==this._videos&&(this._videos=e,this.host.requestUpdate())}get videos(){return this._videos}_setupTask(){new Di(this.host,async([e,t])=>{try{if(!t||e)return;try{this.composition=await ac({config:t,rootWidth:0,rootHeight:0})}catch(n){throw new Hs("Video preview data template error",n)}}catch(n){this.composition=null,this.host.dispatchEvent(new ErrorEvent("error",{composed:!0,bubbles:!0,error:n,message:n.message}))}},()=>{const e=JSON.stringify({disabled:this.host.disabled,config:this.host.config});if(this._lastDeps&&this._memoKey===e)return this._lastDeps;const t=[this.host.disabled,this.host.config];return this._memoKey=e,this._lastDeps=t,t})}hostConnected(){this._setupTask()}hostDisconnected(){Object.keys(this.videos).forEach(e=>{this._cleanupVideo(e)}),this.videos={}}}function ud(r,e,t){return Math.min(Math.max(e,r),t)}function Ei(r,e){return e?e instanceof ShadowRoot?Ei(r,e.host):e instanceof HTMLElement&&e.matches(r)?e:Ei(r,e.parentNode):null}function Al(r,e={}){const t=Math.max(0,r||0),n=Math.floor(t/3600),i=Math.floor(t%3600/60),s=Math.floor(t%3600%60),o=Math.floor(t%1*1e3);let a=n?`${n}:${`${i}`.padStart(2,"0")}:${`${s}`.padStart(2,"0")}`:`${i}:${`${s}`.padStart(2,"0")}`;return e.includeMs&&(a+=`:${`${o}`.padStart(3,"0")}`),a}var tB=Object.defineProperty,rB=Object.getOwnPropertyDescriptor,Ln=(r,e,t,n)=>{for(var i=n>1?void 0:n?rB(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&tB(e,t,i),i};let Lr=class extends $e{constructor(){super(...arguments),this.active=!1,this.size="small",this.rounded="medium",this.weight="light"}render(){return Qe`<button
|
2574
2574
|
class=${Ke({active:this.active,"size-tiny":this.size==="tiny","size-small":this.size==="small","size-large":this.size==="large","radius-medium":this.rounded==="medium","radius-full":this.rounded==="full","weight-light":this.weight==="light","weight-heavy":this.weight==="heavy"})}
|
2575
2575
|
>
|
2576
2576
|
<slot></slot>
|
@@ -2812,14 +2812,14 @@ vec4 transition(vec2 uv) {
|
|
2812
2812
|
<path
|
2813
2813
|
d="M9.853 23.246L4.86 7.688H0L7 27.42h5.52l7.265-19.733h-4.65L9.854 23.246zM95.12 7.08a8.905 8.905 0 00-4.648 1.294V0H86.14v27.419h4.332V16.087a4.656 4.656 0 014.649-4.65 4.656 4.656 0 014.649 4.65v11.332h4.332V16.087c.026-4.966-4.015-9.008-8.981-9.008zM57.188 19.02a4.656 4.656 0 01-4.649 4.649 4.656 4.656 0 01-4.649-4.65V7.689h-4.332V19.02c0 4.966 4.041 8.98 8.981 8.98 4.94 0 8.981-4.04 8.981-8.98V7.688h-4.332V19.02zM30.483 7.133c-5.732 0-10.408 4.675-10.408 10.407s4.676 10.408 10.408 10.408c5.732 0 10.408-4.676 10.408-10.408 0-5.732-4.676-10.407-10.408-10.407zm0 16.483a6.076 6.076 0 116.075-6.076c0 3.355-2.747 6.076-6.075 6.076zM74.517 23.616a6.076 6.076 0 010-12.151 6.132 6.132 0 015.045 2.668l3.592-2.43a10.473 10.473 0 00-8.637-4.57c-5.732 0-10.408 4.675-10.408 10.407s4.676 10.408 10.408 10.408a10.35 10.35 0 008.611-4.596l-3.593-2.43a5.975 5.975 0 01-5.018 2.694z"
|
2814
2814
|
/>
|
2815
|
-
</svg>`};var
|
2815
|
+
</svg>`};var nB=Object.defineProperty,iB=Object.getOwnPropertyDescriptor,dd=(r,e,t,n)=>{for(var i=n>1?void 0:n?iB(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&nB(e,t,i),i};let $s=class extends $e{render(){return!this.icon||!Object.keys(hd).includes(this.icon)?null:hd[this.icon]()}};$s.styles=[$e.styles??[],gt`
|
2816
2816
|
:host {
|
2817
2817
|
display: flex;
|
2818
2818
|
align-items: center;
|
2819
2819
|
justify-content: center;
|
2820
2820
|
flex-shrink: 0;
|
2821
2821
|
}
|
2822
|
-
`],dd([oe({type:String})],$s.prototype,"icon",2),$s=dd([wt("vmp-icon")],$s);var
|
2822
|
+
`],dd([oe({type:String})],$s.prototype,"icon",2),$s=dd([wt("vmp-icon")],$s);var sB=Object.defineProperty,oB=Object.getOwnPropertyDescriptor,Fn=(r,e,t,n)=>{for(var i=n>1?void 0:n?oB(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&sB(e,t,i),i};let Fr=class extends $e{constructor(){super(...arguments),this.active=!1,this.size="small",this.rounded="medium",this.weight="light"}render(){return Qe`
|
2823
2823
|
<vmp-button
|
2824
2824
|
?active=${this.active}
|
2825
2825
|
size=${Ur(this.size)}
|
@@ -2846,16 +2846,16 @@ vec4 transition(vec2 uv) {
|
|
2846
2846
|
height: 32px;
|
2847
2847
|
width: 32px;
|
2848
2848
|
}
|
2849
|
-
`],Fn([oe({type:Boolean})],Fr.prototype,"active",2),Fn([oe({type:String})],Fr.prototype,"size",2),Fn([oe({type:String})],Fr.prototype,"rounded",2),Fn([oe({type:String})],Fr.prototype,"weight",2),Fn([oe({type:String})],Fr.prototype,"icon",2),Fr=Fn([wt("vmp-icon-button")],Fr);var
|
2849
|
+
`],Fn([oe({type:Boolean})],Fr.prototype,"active",2),Fn([oe({type:String})],Fr.prototype,"size",2),Fn([oe({type:String})],Fr.prototype,"rounded",2),Fn([oe({type:String})],Fr.prototype,"weight",2),Fn([oe({type:String})],Fr.prototype,"icon",2),Fr=Fn([wt("vmp-icon-button")],Fr);var aB=Object.defineProperty,lB=Object.getOwnPropertyDescriptor,hr=(r,e,t,n)=>{for(var i=n>1?void 0:n?lB(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&aB(e,t,i),i};let nn=class extends $e{constructor(){super(...arguments),this.disabled=!1,this.aspectRatio=1,this.dataResolver=$o,this._currentTime=0,this._sceneController=new eB(this),this._canvasRef=vt(),this._previewRef=vt(),this._previewTimeRef=vt(),this._handleScrubberMouseEnter=({detail:{x:r,y:e,elementLeft:t,elementRight:n}})=>{var i,s;if((i=this._previewRef)!=null&&i.value){const o=this._previewRef.value.getBoundingClientRect(),a=(s=this._previewRef.value.getRootNode().host)==null?void 0:s.getBoundingClientRect();o&&a&&(this._previewRef.value.style.opacity="1",this._previewRef.value.style.transform=`translate3d(${ud(t-a.left,r-a.left-o.width/2,n-a.left-o.width)}px, ${e-a.top-o.height-28}px, 0)`)}},this._handleScrubberMouseMove=({detail:{time:r,x:e,elementLeft:t,elementRight:n}})=>{var i,s,o,a,l,A,c,u,h,d;if(this._currentTime=r,(o=(s=(i=this._sceneController.composition)==null?void 0:i.tracks)==null?void 0:s[0])!=null&&o.scenes){const f=(c=(A=(l=(a=this._sceneController.composition)==null?void 0:a.tracks)==null?void 0:l[0])==null?void 0:A.drawScenes)==null?void 0:c.find(({start:g,duration:p})=>r>=g&&r<=g+p);if(f&&rn(f.layout.node).forEach(p=>{var C,T;if(p!=null&&p.key&&this._sceneController.videos[p.key]){const b=this._sceneController.videos[p.key];(T=(C=b.node).startLoadOnce)==null||T.call(C),b.node.currentTime=r-f.start}}),this._draw(),(u=this._previewRef)!=null&&u.value){const g=this._previewRef.value.getBoundingClientRect(),p=(h=this._previewRef.value.getRootNode().host)==null?void 0:h.getBoundingClientRect();if(g&&p){const C=this._previewRef.value.style.transform||"translate3d(0px, 0px, 0px)",[,T]=Array.from(C.matchAll(/([+-]?([0-9]*[.])?[0-9]+)(?=px)\w+/g));this._previewRef.value.style.transform=`translate3d(${ud(t-p.left,e-p.left-g.width/2,n-p.left-g.width)}px, ${T[1]}px, 0)`}}this._previewTimeRef.value&&this._previewTimeRef.value.setAttribute("content",Al(Math.max(0,Math.min(this._currentTime,(d=this._sceneController.composition)==null?void 0:d.duration))))}},this._handleScrubberMouseLeave=()=>{var r;(r=this._previewRef)!=null&&r.value&&(this._previewRef.value.style.opacity="0")},this._handleScrubberResize=({detail:{y:r}})=>{var e,t;if((e=this._previewRef)!=null&&e.value){const n=this._previewRef.value.getBoundingClientRect(),i=(t=this._previewRef.value.getRootNode().host)==null?void 0:t.getBoundingClientRect();if(n&&i){const s=this._previewRef.value.style.transform||"translate3d(0px, 0px, 0px)",[o]=Array.from(s.matchAll(/([+-]?([0-9]*[.])?[0-9]+)(?=px)\w+/g));this._previewRef.value.style.transform=`translate3d(${o[1]}px, ${r-i.top-n.height-28}px, 0)`}}}}_draw(r=this._currentTime){this._sceneController.composition&&this._canvasRef.value&&this._sceneController.composition.draw({canvas:this._canvasRef.value,currentTime:Math.max(0,Math.min(r,this._sceneController.composition.duration))})}connectedCallback(){super.connectedCallback();const r=Ei("vmp-media-player",this);r==null||r.addEventListener("scrubber:resize",this._handleScrubberResize),r==null||r.addEventListener("scrubber:mouseenter",this._handleScrubberMouseEnter),r==null||r.addEventListener("scrubber:mousemove",this._handleScrubberMouseMove),r==null||r.addEventListener("scrubber:mouseleave",this._handleScrubberMouseLeave)}disconnectedCallback(){super.disconnectedCallback();const r=Ei("vmp-media-player",this);r==null||r.removeEventListener("scrubber:resize",this._handleScrubberResize),r==null||r.removeEventListener("scrubber:mouseenter",this._handleScrubberMouseEnter),r==null||r.removeEventListener("scrubber:mousemove",this._handleScrubberMouseMove),r==null||r.removeEventListener("scrubber:mouseleave",this._handleScrubberMouseLeave)}render(){var r,e,t;const{height:n,width:i}=Oo({resolution:180,aspectRatio:this.aspectRatio}),s=((t=(e=(r=this._sceneController.composition)==null?void 0:r.tracks)==null?void 0:e[0])==null?void 0:t.scenes.length)??0;return!this.disabled&&s>1?Qe`
|
2850
2850
|
<div
|
2851
2851
|
${yt(this._previewRef)}
|
2852
2852
|
class="preview"
|
2853
|
-
style=${
|
2853
|
+
style=${Yo({width:this.aspectRatio>1?"140px":void 0,height:this.aspectRatio<=1?"140px":void 0,aspectRatio:this.aspectRatio})}
|
2854
2854
|
>
|
2855
2855
|
<canvas ${yt(this._canvasRef)} class="preview-canvas" width=${i} height=${n}></canvas>
|
2856
2856
|
<vmp-text ${yt(this._previewTimeRef)} class="preview-text" size="small"></vmp-text>
|
2857
2857
|
</div>
|
2858
|
-
`:null}};
|
2858
|
+
`:null}};nn.styles=[$e.styles??[],gt`
|
2859
2859
|
.preview {
|
2860
2860
|
position: absolute;
|
2861
2861
|
display: flex;
|
@@ -2886,22 +2886,22 @@ vec4 transition(vec2 uv) {
|
|
2886
2886
|
color: var(--colors-light-1000);
|
2887
2887
|
font-variant-numeric: tabular-nums;
|
2888
2888
|
}
|
2889
|
-
`],hr([oe({type:Object})],
|
2889
|
+
`],hr([oe({type:Object})],nn.prototype,"config",2),hr([oe({type:Boolean})],nn.prototype,"disabled",2),hr([oe({type:Number})],nn.prototype,"aspectRatio",2),hr([oe({attribute:!1})],nn.prototype,"dataResolver",2),nn=hr([wt("vmp-video-preview-content")],nn);let kn=class extends $e{constructor(){super(...arguments),this.disabled=!1,this.aspectRatio=1,this.dataResolver=$o}render(){return Qe`
|
2890
2890
|
<vmp-video-preview-content
|
2891
2891
|
?disabled=${this.disabled}
|
2892
2892
|
.config=${this.config}
|
2893
2893
|
.aspectRatio=${this.aspectRatio}
|
2894
2894
|
.dataResolver=${this.dataResolver}
|
2895
2895
|
></vmp-video-preview-content>
|
2896
|
-
`}};hr([oe({type:Object})],kn.prototype,"config",2),hr([oe({type:Boolean})],kn.prototype,"disabled",2),hr([oe({type:Number})],kn.prototype,"aspectRatio",2),hr([oe({attribute:!1})],kn.prototype,"dataResolver",2),kn=hr([wt("vmp-video-preview")],kn);class AB extends qn{constructor(e){if(super(e),e.type!==
|
2896
|
+
`}};hr([oe({type:Object})],kn.prototype,"config",2),hr([oe({type:Boolean})],kn.prototype,"disabled",2),hr([oe({type:Number})],kn.prototype,"aspectRatio",2),hr([oe({attribute:!1})],kn.prototype,"dataResolver",2),kn=hr([wt("vmp-video-preview")],kn);class AB extends qn{constructor(e){if(super(e),e.type!==un.ELEMENT)throw new Error("Resize directive must be used in an Element expression")}update(e,[t]){return t==null||t(e.element),Vt}}const fd=hn(AB);class cB{constructor(e){this.hiddenControls=[],this._measureRef=vt(),this._prevControlsWidth=0,this._hideables={},this._showables={},this._onResize=t=>{var n,i,s;const o=this._measureRef.value,a=(s=(i=(n=t==null?void 0:t[0])==null?void 0:n.borderBoxSize)==null?void 0:i[0])==null?void 0:s.inlineSize;if(o&&a&&a!==this._prevControlsWidth){Object.keys(this._hideables).forEach(A=>{this._hideables[A].element.style.display=""}),Object.keys(this._showables).forEach(A=>{this._showables[A].element.style.display="none"});const l=[];for(;o.scrollWidth>o.offsetWidth;){const A=Object.keys(this._hideables).find(u=>this._hideables[u].hideIndex===l.length);if(!A)break;const c=this._hideables[A].element;c&&(c.style.display="none"),l.push(A),Object.keys(this._showables).forEach(u=>{this._showables[u].showOn.some(h=>l.includes(h))&&(this._showables[u].element.style.display="flex")})}this.hiddenControls=l,this._prevControlsWidth=a,this.host.requestUpdate()}},this.host=e}measure(){return yt(this._measureRef)}contain(){return ll(this._onResize)}hide(e,t){return fd(n=>{this._hideables[e]={element:n,hideIndex:t}})}show(e,t){return fd(n=>{this._showables[e]={element:n,showOn:t}})}}const cl=".tippy-box[data-animation=shift-away-subtle][data-state=hidden]{opacity:0}.tippy-box[data-animation=shift-away-subtle][data-state=hidden][data-placement^=top]{transform:translateY(5px)}.tippy-box[data-animation=shift-away-subtle][data-state=hidden][data-placement^=bottom]{transform:translateY(-5px)}.tippy-box[data-animation=shift-away-subtle][data-state=hidden][data-placement^=left]{transform:translateX(5px)}.tippy-box[data-animation=shift-away-subtle][data-state=hidden][data-placement^=right]{transform:translateX(-5px)}";var uB=Object.defineProperty,hB=Object.getOwnPropertyDescriptor,Ii=(r,e,t,n)=>{for(var i=n>1?void 0:n?hB(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&uB(e,t,i),i};let sn=class extends $e{constructor(){super(...arguments),this.semibold=!1,this.truncate=!1,this.size="medium",this.content=""}render(){return Qe`
|
2897
2897
|
<div
|
2898
2898
|
part="content"
|
2899
2899
|
class=${Ke({semibold:this.semibold,truncate:this.truncate,[this.size]:!0})}
|
2900
|
-
style=${
|
2900
|
+
style=${Yo({fontFamily:Z0({text:this.content,font:"var(--fontFamilies-sans)"})})}
|
2901
2901
|
>
|
2902
2902
|
${this.content}
|
2903
2903
|
</div>
|
2904
|
-
`}};
|
2904
|
+
`}};sn.styles=[$e.styles??[],gt`
|
2905
2905
|
:host {
|
2906
2906
|
--text-size: var(--fontSizes-medium);
|
2907
2907
|
--text-line-height: var(--lineHeights-medium);
|
@@ -2938,7 +2938,7 @@ vec4 transition(vec2 uv) {
|
|
2938
2938
|
text-overflow: ellipsis;
|
2939
2939
|
overflow: hidden;
|
2940
2940
|
}
|
2941
|
-
`],Ii([oe({type:Boolean})],
|
2941
|
+
`],Ii([oe({type:Boolean})],sn.prototype,"semibold",2),Ii([oe({type:Boolean})],sn.prototype,"truncate",2),Ii([oe({type:String})],sn.prototype,"size",2),Ii([oe({type:String})],sn.prototype,"content",2),sn=Ii([wt("vmp-text")],sn);var dB=Object.defineProperty,fB=Object.getOwnPropertyDescriptor,Ci=(r,e,t,n)=>{for(var i=n>1?void 0:n?fB(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&dB(e,t,i),i};let on=class extends $e{constructor(){super(...arguments),this.activeItems=[],this.visibleItems=null,this.subItemsActive=null,this.tippy=null,this._contentRef=vt()}_handleBackClick(){this.subItemsActive=null,this.visibleItems=this.items??null}willUpdate(){this.visibleItems=this.visibleItems??this.items??null}updated(){var r,e;const t=(e=(r=this.items)==null?void 0:r.items.find(({id:n})=>this.subItemsActive===n))==null?void 0:e.subItems;this.visibleItems=t??this.items??null,t||(this.subItemsActive=null)}connectedCallback(){super.connectedCallback(),requestAnimationFrame(()=>{var r;const e=(r=this.shadowRoot)==null?void 0:r.querySelector("slot"),t=e==null?void 0:e.assignedElements()[0];t&&this._contentRef.value&&(this.tippy=tn(t,{content:this._contentRef.value,allowHTML:!0,arrow:!1,animation:"shift-away-subtle",interactive:!0,placement:"top",trigger:"click",onShow:()=>{this.dispatchEvent(new CustomEvent("menu:toggle",{detail:!0}))},onHide:()=>{this.dispatchEvent(new CustomEvent("menu:toggle",{detail:!1}))},appendTo:()=>this.shadowRoot}))})}disconnectedCallback(){var r;super.disconnectedCallback(),(r=this.tippy)==null||r.destroy()}render(){var r,e;return Qe`
|
2942
2942
|
<slot></slot>
|
2943
2943
|
<div ${yt(this._contentRef)} class="content">
|
2944
2944
|
<div class="title">
|
@@ -2964,7 +2964,7 @@ vec4 transition(vec2 uv) {
|
|
2964
2964
|
</button>
|
2965
2965
|
`)}
|
2966
2966
|
</div>
|
2967
|
-
`}};
|
2967
|
+
`}};on.styles=[$e.styles??[],Un(cl),gt`
|
2968
2968
|
:host {
|
2969
2969
|
display: flex;
|
2970
2970
|
}
|
@@ -3026,12 +3026,12 @@ vec4 transition(vec2 uv) {
|
|
3026
3026
|
height: 20px;
|
3027
3027
|
width: 20px;
|
3028
3028
|
}
|
3029
|
-
`],Ci([oe({type:Object})],
|
3029
|
+
`],Ci([oe({type:Object})],on.prototype,"items",2),Ci([oe({type:Array})],on.prototype,"activeItems",2),Ci([it()],on.prototype,"visibleItems",2),Ci([it()],on.prototype,"subItemsActive",2),on=Ci([wt("vmp-menu")],on);var gB=Object.defineProperty,pB=Object.getOwnPropertyDescriptor,ul=(r,e,t,n)=>{for(var i=n>1?void 0:n?pB(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&gB(e,t,i),i};let vi=class extends $e{constructor(){super(...arguments),this.content="",this.disabled=!1,this.tippy=null,this._contentRef=vt()}connectedCallback(){super.connectedCallback(),requestAnimationFrame(()=>{var r;const e=(r=this.shadowRoot)==null?void 0:r.querySelector("slot"),t=e==null?void 0:e.assignedElements()[0];t&&this._contentRef.value&&(this.tippy=tn(t,{content:this._contentRef.value,allowHTML:!0,arrow:!1,animation:"shift-away-subtle",interactive:!1,placement:"top",zIndex:1e4,appendTo:()=>this.shadowRoot}))})}disconnectedCallback(){var r;super.disconnectedCallback(),(r=this.tippy)==null||r.destroy()}updated(){var r,e;this.disabled?(r=this.tippy)==null||r.disable():(e=this.tippy)==null||e.enable()}render(){return Qe`
|
3030
3030
|
<slot></slot>
|
3031
3031
|
<div ${yt(this._contentRef)} class="content">
|
3032
3032
|
<vmp-text content=${this.content}></vmp-text>
|
3033
3033
|
</div>
|
3034
|
-
`}};vi.styles=[$e.styles??[],Un(
|
3034
|
+
`}};vi.styles=[$e.styles??[],Un(cl),gt`
|
3035
3035
|
:host {
|
3036
3036
|
display: flex;
|
3037
3037
|
}
|
@@ -3045,7 +3045,7 @@ vec4 transition(vec2 uv) {
|
|
3045
3045
|
background: var(--colors-dark-800);
|
3046
3046
|
border-radius: var(--radii-medium);
|
3047
3047
|
}
|
3048
|
-
`],
|
3048
|
+
`],ul([oe({type:String})],vi.prototype,"content",2),ul([oe({type:Boolean})],vi.prototype,"disabled",2),vi=ul([wt("vmp-tooltip")],vi);var mB=Object.defineProperty,EB=Object.getOwnPropertyDescriptor,hl=(r,e,t,n)=>{for(var i=n>1?void 0:n?EB(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&mB(e,t,i),i};let yi=class extends $e{constructor(){super(...arguments),this.volume=1,this.muted=!1,this.tippy=null,this._contentRef=vt(),this._anchorRef=vt(),this._menuOpen=!1}connectedCallback(){super.connectedCallback(),requestAnimationFrame(()=>{this._anchorRef.value&&this._contentRef.value&&(this.tippy=tn(this._anchorRef.value,{content:this._contentRef.value,allowHTML:!0,arrow:!1,animation:"shift-away-subtle",interactive:!0,placement:"top",interactiveBorder:20,onShow:()=>{this._menuOpen=!0,this.dispatchEvent(new CustomEvent("menu:toggle",{detail:!0}))},onHide:()=>{this._menuOpen=!1,this.dispatchEvent(new CustomEvent("menu:toggle",{detail:!1}))},appendTo:()=>this.shadowRoot}))})}disconnectedCallback(){var r;super.disconnectedCallback(),(r=this.tippy)==null||r.destroy()}render(){return Qe`
|
3049
3049
|
<vmp-icon-button
|
3050
3050
|
${yt(this._anchorRef)}
|
3051
3051
|
icon=${this.muted||this.volume===0?"muted":this.volume<1/3?"volume-low":this.volume<2/3?"volume-medium":"volume-high"}
|
@@ -3065,7 +3065,7 @@ vec4 transition(vec2 uv) {
|
|
3065
3065
|
@blur=${()=>{var r;return(r=this.tippy)==null?void 0:r.hide()}}
|
3066
3066
|
/>
|
3067
3067
|
</div>
|
3068
|
-
`}};yi.styles=[$e.styles??[],Un(
|
3068
|
+
`}};yi.styles=[$e.styles??[],Un(cl),gt`
|
3069
3069
|
.content {
|
3070
3070
|
--volume-slider-height: 4px;
|
3071
3071
|
--volume-slider-width: 78px;
|
@@ -3207,11 +3207,11 @@ vec4 transition(vec2 uv) {
|
|
3207
3207
|
--volume-slider-height: 8px;
|
3208
3208
|
color: var(--colors-light-800);
|
3209
3209
|
}
|
3210
|
-
`],
|
3210
|
+
`],hl([oe({type:Number})],yi.prototype,"volume",2),hl([oe({type:Boolean})],yi.prototype,"muted",2),yi=hl([wt("vmp-volume-button")],yi);var IB=Object.defineProperty,CB=Object.getOwnPropertyDescriptor,Ys=(r,e,t,n)=>{for(var i=n>1?void 0:n?CB(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&IB(e,t,i),i};let Nn=class extends $e{constructor(){super(...arguments),this.duration=0,this.currentTime=0,this.buffer=[],this._containerRef=vt(),this._handleContainerResize=()=>{var r;const e=(r=this._containerRef.value)==null?void 0:r.getBoundingClientRect();this.dispatchEvent(new CustomEvent("scrubber:resize",{detail:e,bubbles:!0,composed:!0}))},this._handleMouseEnter=r=>{var e;const t=(e=this._containerRef.value)==null?void 0:e.getBoundingClientRect();this.dispatchEvent(new CustomEvent("scrubber:mouseenter",{detail:{x:r.clientX,y:r.clientY,elementLeft:(t==null?void 0:t.left)??0,elementRight:(t==null?void 0:t.right)??document.body.offsetWidth},bubbles:!0,composed:!0}))},this._handleMouseMove=r=>{var e;const t=(e=this._containerRef.value)==null?void 0:e.getBoundingClientRect(),i=(r.clientX-((t==null?void 0:t.left)??0))/((t==null?void 0:t.width)??1);this.dispatchEvent(new CustomEvent("scrubber:mousemove",{detail:{x:r.clientX,y:r.clientY,time:i*this.duration,elementLeft:(t==null?void 0:t.left)??0,elementRight:(t==null?void 0:t.right)??document.body.offsetWidth},bubbles:!0,composed:!0}))},this._handleMouseLeave=r=>{this.dispatchEvent(new CustomEvent("scrubber:mouseleave",{detail:{x:r.clientX,y:r.clientY},bubbles:!0,composed:!0}))}}render(){var r;const e=((r=this.buffer)==null?void 0:r.sort((t,n)=>t.start<n.start?-1:n.start<t.start?1:0).reduce((t,{start:n,end:i},s)=>{const o=t[s-1],a=Math.floor(n),l=Math.ceil(i);return t.push({id:n,start:Math.max(0,a),end:Math.min(l,100)}),o&&o.end>=n-1&&(t[s].start=o.end),t},[]))??[];return Qe`
|
3211
3211
|
<div
|
3212
3212
|
class="container"
|
3213
3213
|
${yt(this._containerRef)}
|
3214
|
-
${
|
3214
|
+
${ll(this._handleContainerResize)}
|
3215
3215
|
@mouseenter=${this._handleMouseEnter}
|
3216
3216
|
@mousemove=${this._handleMouseMove}
|
3217
3217
|
@mouseleave=${this._handleMouseLeave}
|
@@ -3380,14 +3380,14 @@ vec4 transition(vec2 uv) {
|
|
3380
3380
|
--player-scrubber-height: 16px;
|
3381
3381
|
color: var(--colors-light-800);
|
3382
3382
|
}
|
3383
|
-
`],Ys([oe({type:Number})],Nn.prototype,"duration",2),Ys([oe({type:Number})],Nn.prototype,"currentTime",2),Ys([oe({type:Array})],Nn.prototype,"buffer",2),Nn=Ys([wt("vmp-progress-scrubber")],Nn);var
|
3383
|
+
`],Ys([oe({type:Number})],Nn.prototype,"duration",2),Ys([oe({type:Number})],Nn.prototype,"currentTime",2),Ys([oe({type:Array})],Nn.prototype,"buffer",2),Nn=Ys([wt("vmp-progress-scrubber")],Nn);var vB=Object.defineProperty,yB=Object.getOwnPropertyDescriptor,ot=(r,e,t,n)=>{for(var i=n>1?void 0:n?yB(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&vB(e,t,i),i};let Ze=class extends $e{constructor(){super(...arguments),this.resizeHider=new cB(this),this.playing=!1,this.volume=1,this.muted=!1,this.currentTime=0,this.duration=0,this.languages=[],this.language="en",this.levels=[],this.level=-1,this.playbackRate=1,this.buffer=[],this.captions=!1,this.fullscreen=!1,this.controls=al,this.volumeMenuOpen=!1,this.languageMenuOpen=!1,this.levelsMenuOpen=!1,this.playbackRateMenuOpen=!1,this.settingsMenuOpen=!1}_handleNavigateBackClick(){this.dispatchEvent(new CustomEvent("navigate:back",{bubbles:!0,composed:!0}))}_handleNavigateForwardClick(){this.dispatchEvent(new CustomEvent("navigate:forward",{bubbles:!0,composed:!0}))}_handlePlayClick(){this.dispatchEvent(new CustomEvent("play:click",{bubbles:!0,composed:!0,detail:this.playing}))}_handleCaptionsClick(){this.dispatchEvent(new CustomEvent("captions:click",{bubbles:!0,composed:!0,detail:this.captions}))}_handleFullscreenClick(){this.dispatchEvent(new CustomEvent("fullscreen:click",{bubbles:!0,composed:!0,detail:this.fullscreen}))}_handleVolumeMenuToggle({detail:r}){this.volumeMenuOpen=r}_handleLanguageMenuOpen({detail:r}){this.languageMenuOpen=r}_handleLevelsMenuOpen({detail:r}){this.levelsMenuOpen=r}_handlePlaybackMenuToggle({detail:r}){this.playbackRateMenuOpen=r}_handleSettingsMenuToggle({detail:r}){this.settingsMenuOpen=r}hideMenus(){var r,e;(e=Array.from((r=this.shadowRoot)==null?void 0:r.querySelectorAll("vmp-menu, vmp-tooltip, vmp-volume-button")))==null||e.forEach(t=>{var n;(n=t.tippy)==null||n.hide()})}render(){var r,e,t,n,i,s,o,a,l,A,c,u,h,d,f;const g=((r=this.languages)==null?void 0:r.map(Y=>({id:`language-${Y.value}`,event:"language:click",label:Y.label,value:Y.value})))??[],p={title:"Languages",items:g},C={id:"languages",label:"Languages",subItems:p},T=p.items.find(({value:Y})=>Y===this.language),b=((e=this.levels)==null?void 0:e.map((Y,re)=>{const ce=Math.min(Y.width,Y.height);return{id:`level-${re.toString()}`,event:"level:click",label:`${ce}p`,value:{resolution:ce,level:re}}}))??[],y={title:"Quality",items:[...b.reverse(),{id:"level--1",event:"level:click",label:"Auto",value:{level:-1,resolution:"auto"}}]},x={id:"levels",label:"Quality",subItems:y},R=(t=y.items)==null?void 0:t.find(({value:Y})=>Y.level===this.level),k=[(g==null?void 0:g.length)&&"languages","levels","playback-rate","captions","fullscreen"].filter(Boolean).filter(Y=>{var re;return(re=this.controls)==null?void 0:re.includes(Y)}),$={title:"Settings",items:[(g==null?void 0:g.length)&&C,Vy,Ky,x,Jy].filter(Boolean).filter(({id:Y})=>k.includes(Y)&&this.resizeHider.hiddenControls.includes(Y))},V=(n=this.controls)==null?void 0:n.includes("progress"),O=(i=this.controls)==null?void 0:i.includes("navigation"),J=(s=this.controls)==null?void 0:s.includes("play"),ne=(o=this.controls)==null?void 0:o.includes("volume"),ee=(a=this.controls)==null?void 0:a.includes("current-time"),le=(l=this.controls)==null?void 0:l.includes("duration"),D=(A=this.controls)==null?void 0:A.includes("languages"),P=(c=this.controls)==null?void 0:c.includes("levels"),X=(u=this.controls)==null?void 0:u.includes("speed"),_=(h=this.controls)==null?void 0:h.includes("captions"),S=(d=this.controls)==null?void 0:d.includes("fullscreen"),F=J||ne||ee||le||D||P||X||_||S,W=[this.captions&&"captions",this.fullscreen&&"fullscreen",`language-${this.language}`,`level-${(f=this.level)==null?void 0:f.toString()}`,`playback-rate-${this.playbackRate.toString()}`].filter(Boolean);return Qe`
|
3384
3384
|
<div
|
3385
3385
|
${this.resizeHider.measure()}
|
3386
3386
|
${this.resizeHider.contain()}
|
3387
|
-
class=${Ke({container:!0,hidden:!
|
3387
|
+
class=${Ke({container:!0,hidden:!V&&!F})}
|
3388
3388
|
>
|
3389
3389
|
<div
|
3390
|
-
class=${Ke({"scrubber-container":!0,hidden:!
|
3390
|
+
class=${Ke({"scrubber-container":!0,hidden:!V})}
|
3391
3391
|
>
|
3392
3392
|
<vmp-progress-scrubber
|
3393
3393
|
class=${Ke({scrubber:!0,invisible:this.volumeMenuOpen||this.levelsMenuOpen||this.playbackRateMenuOpen||this.settingsMenuOpen})}
|
@@ -3419,7 +3419,7 @@ vec4 transition(vec2 uv) {
|
|
3419
3419
|
></vmp-icon-button>
|
3420
3420
|
</div>
|
3421
3421
|
<vmp-icon-button
|
3422
|
-
class=${Ke({hidden:!
|
3422
|
+
class=${Ke({hidden:!J})}
|
3423
3423
|
icon=${this.playing?"pause":"play"}
|
3424
3424
|
weight="heavy"
|
3425
3425
|
rounded="full"
|
@@ -3437,22 +3437,22 @@ vec4 transition(vec2 uv) {
|
|
3437
3437
|
${this.resizeHider.hide("current-time",2)}
|
3438
3438
|
class=${Ke({hidden:!ee})}
|
3439
3439
|
?semibold=${!0}
|
3440
|
-
content="${
|
3440
|
+
content="${Al(this.currentTime)}${le?"/":null}"
|
3441
3441
|
></vmp-text>
|
3442
3442
|
<vmp-text
|
3443
3443
|
${this.resizeHider.hide("duration",6)}
|
3444
|
-
class=${Ke({hidden:!
|
3444
|
+
class=${Ke({hidden:!le})}
|
3445
3445
|
?semibold=${!0}
|
3446
|
-
content=${
|
3446
|
+
content=${Al(this.duration)}
|
3447
3447
|
></vmp-text>
|
3448
3448
|
</div>
|
3449
3449
|
</div>
|
3450
3450
|
<div class="section">
|
3451
3451
|
<vmp-menu
|
3452
3452
|
${this.resizeHider.hide("languages",0)}
|
3453
|
-
class=${Ke({hidden:!
|
3453
|
+
class=${Ke({hidden:!D||!g||g.length<=1})}
|
3454
3454
|
.items=${p}
|
3455
|
-
.activeItems=${
|
3455
|
+
.activeItems=${W}
|
3456
3456
|
@menu:toggle=${this._handleLanguageMenuOpen}
|
3457
3457
|
>
|
3458
3458
|
<vmp-tooltip content="Languages" ?disabled=${this.languageMenuOpen}>
|
@@ -3463,7 +3463,7 @@ vec4 transition(vec2 uv) {
|
|
3463
3463
|
${this.resizeHider.hide("levels",1)}
|
3464
3464
|
class=${Ke({hidden:!P||b.length<=0})}
|
3465
3465
|
.items=${y}
|
3466
|
-
.activeItems=${
|
3466
|
+
.activeItems=${W}
|
3467
3467
|
@menu:toggle=${this._handleLevelsMenuOpen}
|
3468
3468
|
>
|
3469
3469
|
<vmp-tooltip content="Quality" ?disabled=${this.levelsMenuOpen}>
|
@@ -3473,8 +3473,8 @@ vec4 transition(vec2 uv) {
|
|
3473
3473
|
<vmp-menu
|
3474
3474
|
${this.resizeHider.hide("playback-rate",5)}
|
3475
3475
|
class=${Ke({hidden:!X})}
|
3476
|
-
.items=${
|
3477
|
-
.activeItems=${
|
3476
|
+
.items=${Ad}
|
3477
|
+
.activeItems=${W}
|
3478
3478
|
@menu:toggle=${this._handlePlaybackMenuToggle}
|
3479
3479
|
>
|
3480
3480
|
<vmp-tooltip content="Playback speed" ?disabled=${this.playbackRateMenuOpen}>
|
@@ -3485,7 +3485,7 @@ vec4 transition(vec2 uv) {
|
|
3485
3485
|
</vmp-menu>
|
3486
3486
|
<vmp-tooltip
|
3487
3487
|
${this.resizeHider.hide("captions",4)}
|
3488
|
-
class=${Ke({hidden:!
|
3488
|
+
class=${Ke({hidden:!_})}
|
3489
3489
|
content="Captions"
|
3490
3490
|
>
|
3491
3491
|
<vmp-icon-button
|
@@ -3511,7 +3511,7 @@ vec4 transition(vec2 uv) {
|
|
3511
3511
|
<vmp-menu
|
3512
3512
|
${this.resizeHider.show("settings",["levels","playback-rate","captions","fullscreen"])}
|
3513
3513
|
.items=${$}
|
3514
|
-
.activeItems=${
|
3514
|
+
.activeItems=${W}
|
3515
3515
|
@menu:toggle=${this._handleSettingsMenuToggle}
|
3516
3516
|
>
|
3517
3517
|
<vmp-tooltip content="Settings" ?disabled=${this.settingsMenuOpen}>
|
@@ -3592,13 +3592,13 @@ vec4 transition(vec2 uv) {
|
|
3592
3592
|
.hidden {
|
3593
3593
|
display: none;
|
3594
3594
|
}
|
3595
|
-
`],ot([oe({type:Boolean})],Ze.prototype,"playing",2),ot([oe({type:Number})],Ze.prototype,"volume",2),ot([oe({type:Boolean})],Ze.prototype,"muted",2),ot([oe({type:Number})],Ze.prototype,"currentTime",2),ot([oe({type:Number})],Ze.prototype,"duration",2),ot([oe({type:Array})],Ze.prototype,"languages",2),ot([oe({type:String})],Ze.prototype,"language",2),ot([oe({type:Array,attribute:!1})],Ze.prototype,"levels",2),ot([oe({type:Number})],Ze.prototype,"level",2),ot([oe({type:Number})],Ze.prototype,"playbackRate",2),ot([oe({type:Array})],Ze.prototype,"buffer",2),ot([oe({type:Boolean})],Ze.prototype,"captions",2),ot([oe({type:Boolean})],Ze.prototype,"fullscreen",2),ot([oe({type:Array})],Ze.prototype,"controls",2),ot([it()],Ze.prototype,"volumeMenuOpen",2),ot([it()],Ze.prototype,"languageMenuOpen",2),ot([it()],Ze.prototype,"levelsMenuOpen",2),ot([it()],Ze.prototype,"playbackRateMenuOpen",2),ot([it()],Ze.prototype,"settingsMenuOpen",2),Ze=ot([wt("vmp-player-controls")],Ze);var
|
3595
|
+
`],ot([oe({type:Boolean})],Ze.prototype,"playing",2),ot([oe({type:Number})],Ze.prototype,"volume",2),ot([oe({type:Boolean})],Ze.prototype,"muted",2),ot([oe({type:Number})],Ze.prototype,"currentTime",2),ot([oe({type:Number})],Ze.prototype,"duration",2),ot([oe({type:Array})],Ze.prototype,"languages",2),ot([oe({type:String})],Ze.prototype,"language",2),ot([oe({type:Array,attribute:!1})],Ze.prototype,"levels",2),ot([oe({type:Number})],Ze.prototype,"level",2),ot([oe({type:Number})],Ze.prototype,"playbackRate",2),ot([oe({type:Array})],Ze.prototype,"buffer",2),ot([oe({type:Boolean})],Ze.prototype,"captions",2),ot([oe({type:Boolean})],Ze.prototype,"fullscreen",2),ot([oe({type:Array})],Ze.prototype,"controls",2),ot([it()],Ze.prototype,"volumeMenuOpen",2),ot([it()],Ze.prototype,"languageMenuOpen",2),ot([it()],Ze.prototype,"levelsMenuOpen",2),ot([it()],Ze.prototype,"playbackRateMenuOpen",2),ot([it()],Ze.prototype,"settingsMenuOpen",2),Ze=ot([wt("vmp-player-controls")],Ze);var BB=Object.defineProperty,QB=Object.getOwnPropertyDescriptor,TB=(r,e,t,n)=>{for(var i=n>1?void 0:n?QB(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&BB(e,t,i),i};let dl=class extends $e{render(){return Qe`<vmp-icon icon="loading"></vmp-icon>`}};dl.styles=[$e.styles??[],gt`
|
3596
3596
|
:host {
|
3597
3597
|
display: flex;
|
3598
3598
|
align-items: center;
|
3599
3599
|
justify-content: center;
|
3600
3600
|
}
|
3601
|
-
`],
|
3601
|
+
`],dl=TB([wt("vmp-loading-spinner")],dl);var bB=Object.defineProperty,xB=Object.getOwnPropertyDescriptor,gd=(r,e,t,n)=>{for(var i=n>1?void 0:n?xB(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&bB(e,t,i),i};let Vs=class extends $e{constructor(){super(...arguments),this.caption=""}render(){return Qe`
|
3602
3602
|
<div class="container">
|
3603
3603
|
<vmp-text content=${this.caption} size="large"></vmp-text>
|
3604
3604
|
</div>
|
@@ -3621,7 +3621,7 @@ vec4 transition(vec2 uv) {
|
|
3621
3621
|
/* Line height controls the spacing between the cloned boxes so has to override the default */
|
3622
3622
|
line-height: 2.2;
|
3623
3623
|
}
|
3624
|
-
`],gd([oe({type:String})],Vs.prototype,"caption",2),Vs=gd([wt("vmp-captions")],Vs);var
|
3624
|
+
`],gd([oe({type:String})],Vs.prototype,"caption",2),Vs=gd([wt("vmp-captions")],Vs);var wB=Object.defineProperty,SB=Object.getOwnPropertyDescriptor,ft=(r,e,t,n)=>{for(var i=n>1?void 0:n?SB(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&wB(e,t,i),i};const RB=3e3;let at=class extends $e{constructor(){super(...arguments),this.loading=!1,this.playing=!1,this.volume=1,this.muted=!1,this.currentTime=0,this.duration=0,this.languages=[],this.language="en",this.levels=[],this.level=-1,this.playbackRate=1,this.caption="",this.buffer=[],this.captions=!1,this.fullscreen=!1,this.controls=al,this.showControls=!0,this._hasTouched=!1,this._playerControlsRef=vt()}_startHideControls(){clearTimeout(this._controlHideTimeout),this._controlHideTimeout=setTimeout(()=>{this.showControls=!1,this._hasTouched=!1},RB)}_immediateShowControls(){this.showControls=!0,clearTimeout(this._controlHideTimeout)}_immediateHideControls(){this.showControls=!1,this._hasTouched=!1,clearTimeout(this._controlHideTimeout)}willUpdate(r){var e;r.has("playing")&&this.playing&&this._startHideControls(),r.has("showControls")&&this.playing&&!this.showControls&&((e=this._playerControlsRef.value)==null||e.hideMenus())}render(){var r;const e=(r=this.controls)==null?void 0:r.includes("play-large"),t=this.playing&&!this.showControls,n=!!(e&&!this.playing);return Qe`
|
3625
3625
|
<div
|
3626
3626
|
class=${Ke({container:!0,hide:t})}
|
3627
3627
|
@mousemove=${()=>{this._immediateShowControls(),this._startHideControls()}}
|
@@ -3741,7 +3741,7 @@ vec4 transition(vec2 uv) {
|
|
3741
3741
|
vmp-captions.hiddenControls {
|
3742
3742
|
transform: translateY(calc(var(--space-small) * -1));
|
3743
3743
|
}
|
3744
|
-
`],ft([oe({type:Boolean})],at.prototype,"loading",2),ft([oe({type:Boolean})],at.prototype,"playing",2),ft([oe({type:Number})],at.prototype,"volume",2),ft([oe({type:Boolean})],at.prototype,"muted",2),ft([oe({type:Number})],at.prototype,"currentTime",2),ft([oe({type:Number})],at.prototype,"duration",2),ft([oe({type:Array})],at.prototype,"languages",2),ft([oe({type:String})],at.prototype,"language",2),ft([oe({type:Array,attribute:!1})],at.prototype,"levels",2),ft([oe({type:Number})],at.prototype,"level",2),ft([oe({type:Number})],at.prototype,"playbackRate",2),ft([oe({type:String})],at.prototype,"caption",2),ft([oe({type:Array})],at.prototype,"buffer",2),ft([oe({type:Boolean})],at.prototype,"captions",2),ft([oe({type:Boolean})],at.prototype,"fullscreen",2),ft([oe({type:Array})],at.prototype,"controls",2),ft([it()],at.prototype,"showControls",2),at=ft([wt("vmp-player-overlay")],at);var
|
3744
|
+
`],ft([oe({type:Boolean})],at.prototype,"loading",2),ft([oe({type:Boolean})],at.prototype,"playing",2),ft([oe({type:Number})],at.prototype,"volume",2),ft([oe({type:Boolean})],at.prototype,"muted",2),ft([oe({type:Number})],at.prototype,"currentTime",2),ft([oe({type:Number})],at.prototype,"duration",2),ft([oe({type:Array})],at.prototype,"languages",2),ft([oe({type:String})],at.prototype,"language",2),ft([oe({type:Array,attribute:!1})],at.prototype,"levels",2),ft([oe({type:Number})],at.prototype,"level",2),ft([oe({type:Number})],at.prototype,"playbackRate",2),ft([oe({type:String})],at.prototype,"caption",2),ft([oe({type:Array})],at.prototype,"buffer",2),ft([oe({type:Boolean})],at.prototype,"captions",2),ft([oe({type:Boolean})],at.prototype,"fullscreen",2),ft([oe({type:Array})],at.prototype,"controls",2),ft([it()],at.prototype,"showControls",2),at=ft([wt("vmp-player-overlay")],at);var DB=Object.defineProperty,_B=Object.getOwnPropertyDescriptor,et=(r,e,t,n)=>{for(var i=n>1?void 0:n?_B(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&DB(e,t,i),i};const LB=1e3/60,FB=30;let We=class extends $e{constructor(){super(...arguments),this.debug=!1,this.propAspectRatio=0,this.preload="auto",this.autoplay=!1,this.loading=!1,this.disabled=!1,this.dataResolver=$o,this.languageResolver=Sp,this._sceneController=new Hy(this),this._drawController=new ky(this),this._observer=null,this._wasPlaying=!1,this._manualMute=this.muted,this._seekerRAF=null,this._seekerTimeout=null,this._lastWaiting=!1,this._lastTimestamp=null,this._playerRef=vt(),this._canvasRef=vt(),this._pageHidden=document.visibilityState==="hidden",this._aspectRatio=this.propAspectRatio,this._processing=!1,this._waiting=!1,this._errors=[],this._seeking=!1,this._language=this.propLanguage,this._languages=[],this._captions=!1,this._fullscreen=!1,this._initialised=null,this._paused=!0,this._playbackRate=1,this._volume=null,this._muted=null,this._videoResolution=-1,this._handleContainerResize=()=>{var r;(r=this.shadowRoot)!=null&&r.host&&!this.propAspectRatio&&(this._aspectRatio=this.shadowRoot.host.clientWidth/this.shadowRoot.host.clientHeight)},this._handleCanvasResize=()=>{this.draw()},this._loop=()=>{this._endLoop(),this._pageHidden?this._seekerTimeout=setTimeout(this._seeker,LB):this._seekerRAF=requestAnimationFrame(this._seeker)},this._endLoop=()=>{this._seekerRAF&&cancelAnimationFrame(this._seekerRAF),this._seekerTimeout&&clearTimeout(this._seekerTimeout),this._seekerRAF=null,this._seekerTimeout=null},this._seeker=(r=performance.now())=>{if(this.composition){if(this._waiting=this._drawController.activeScenes.some(e=>rn(e.layout.node).some(n=>{if(n!=null&&n.key&&this.videos[n==null?void 0:n.key]&&this.videoState[n==null?void 0:n.key]){const i=this.videos[n==null?void 0:n.key],s=this.videoState[n==null?void 0:n.key];return!s||!s.initialised||s.waiting||i.node.readyState<3}})),this.waiting?(this._lastTimestamp=null,this._lastWaiting||this.dispatchEvent(new CustomEvent("waiting"))):this._lastWaiting&&this.dispatchEvent(new CustomEvent("playing")),r-(this._lastTimestamp??0)>1e3/FB){let e=this._drawController.currentTime;const t=(r-(this._lastTimestamp??r))/1e3*this.playbackRate;e+=t,this._drawController.currentTime=e,this._lastTimestamp=r}this._lastWaiting=this._waiting,this._drawController.currentTime>=this.duration&&(this.pause(),this.dispatchEvent(new CustomEvent("ended")))}this.paused||this._loop()},this._handleError=r=>{this._errors=[...this.errors,r.error],r.error.fatal&&this.pause()},this._handleFullscreenChange=()=>{this===document.fullscreenElement?this._fullscreen=!0:this._fullscreen=!1},this._handleVisibilityChange=()=>{this._pageHidden=document.visibilityState==="hidden",this.paused||this._loop()}}get aspectRatio(){return this._aspectRatio}get processing(){return this._processing}get waiting(){return!this.paused&&this._waiting}get errors(){return this._errors}get seeking(){return this._seeking}get language(){return this._language}get languages(){return this._languages}get captions(){return this._captions}get fullscreen(){return this._fullscreen}get initialised(){return this._initialised=this._initialised??new Promise(r=>{const e=setInterval(()=>{!!this.errors.find(n=>n.fatal)&&r(!1),!this.loading&&!this.processing&&this.composition&&this.duration>0&&r(!0)},500);setTimeout(()=>{clearInterval(e),r(!1)},60*1e3)}),this._initialised}get duration(){return this._sceneController.duration}get videos(){return this._sceneController.videos??{}}get videoState(){return this._sceneController.videoState}get composition(){return this._sceneController.composition}get activeScenes(){return this._drawController.activeScenes}set paused(r){r!==this._paused&&(this._paused=r,this.requestUpdate(),this.dispatchEvent(new CustomEvent(r?"pause":"play")))}get paused(){return this._paused}set playbackRate(r){r!==this._playbackRate&&(this._playbackRate=r,Object.values(this.videos).forEach(({node:e})=>{e.playbackRate=r}),this.requestUpdate(),this.dispatchEvent(new CustomEvent("ratechange",{detail:r})))}get playbackRate(){return this._playbackRate}set volume(r){const e=Math.min(1,Math.max(0,r));e!==this._volume&&(Object.values(this.videos).forEach(({node:t})=>{t.volume=e}),localStorage.setItem("vmp-player-volume",e.toString()),this._volume=e,e>0&&(this.muted=!1),this.requestUpdate(),this.dispatchEvent(new CustomEvent("volumechange",{detail:r})))}get volume(){return this._volume??(this._volume=parseFloat(localStorage.getItem("vmp-player-volume")??"1"))}set muted(r){Object.values(this.videos).forEach(({node:e})=>{e.muted=r}),r!==this._muted&&(this._muted=r,localStorage.setItem("vmp-player-muted",r.toString()),this.requestUpdate(),this.dispatchEvent(new CustomEvent("volumechange",{detail:r?0:this.volume})))}get muted(){return this._muted??(this._muted=this.autoplay||localStorage.getItem("vmp-player-muted")==="true")}set videoResolution(r){r!==this._videoResolution&&(this._videoResolution=r,Object.values(this.videos).forEach(({hls:e})=>{if(e){const t=e.levels.findIndex(n=>Math.min(n.height,n.width)===r);e.currentLevel=t??-1}}),this.requestUpdate())}get videoResolution(){return this._videoResolution}set currentTime(r){r!==this._drawController.currentTime&&(this._drawController.currentTime=r,this._sceneController.setVideosCurrentTime(r))}get currentTime(){return this._drawController.currentTime}reset(r=0,e=!1){this._lastTimestamp=null,this._drawController.currentTime=r,this._sceneController.setVideosCurrentTime(r),e?this.play():this.pause()}clear(){this._drawController.clear()}play(){this.paused=!1,this._lastTimestamp=null,this.duration>0&&this._drawController.currentTime>=this.duration&&this.reset(0,!0),this._loop()}pause(){this._endLoop(),this.paused=!0,Object.values(this.videos).forEach(({node:r})=>{r.pause()})}draw(r){return this._drawController.draw(r)}toggleFullscreen(r){r??this.fullscreen?Yy():this._playerRef.value&&$y(this._playerRef.value)}connectedCallback(){var r;super.connectedCallback(),this.addEventListener("error",this._handleError),document.addEventListener("fullscreenchange",this._handleFullscreenChange),document.addEventListener("visibilitychange",this._handleVisibilityChange),(r=this.shadowRoot)!=null&&r.host&&(this._observer=new ResizeObserver(this._handleContainerResize),this._observer.observe(this.shadowRoot.host))}willUpdate(r){r.has("propAspectRatio")&&(this._aspectRatio=this.propAspectRatio),r.has("propLanguage")&&(this._language=this.propLanguage)}updated(r){r.has("propAspectRatio")&&!this.propAspectRatio&&this._handleContainerResize(),this.autoplay&&!this._sceneController.hasPlayed&&!this.processing&&r.get("_processing")&&this.play(),r.has("_processing")&&this.processing&&this.dispatchEvent(new CustomEvent("processing"))}disconnectedCallback(){var r;super.disconnectedCallback(),(r=this._observer)==null||r.disconnect(),document.removeEventListener("fullscreenchange",this._handleFullscreenChange),document.removeEventListener("visibilitychange",this._handleVisibilityChange)}_renderStyles(){return this.propAspectRatio?typeof this.propAspectRatio=="number"?Qe`
|
3745
3745
|
<style>
|
3746
3746
|
:host {
|
3747
3747
|
aspect-ratio: ${this.propAspectRatio};
|
@@ -3762,17 +3762,17 @@ vec4 transition(vec2 uv) {
|
|
3762
3762
|
<vmp-text semibold content="An error has occurred when attempting to play this video."></vmp-text>
|
3763
3763
|
<vmp-text semibold content="Please try again later."></vmp-text>
|
3764
3764
|
</div>
|
3765
|
-
</div>`}render(){var r;const e=this.loading||this.processing||!this.composition||this.duration<=0,{height:t,width:n}=
|
3765
|
+
</div>`}render(){var r;const e=this.disabled||this.loading||this.processing||!this.composition||this.duration<=0,{height:t,width:n}=Oo({resolution:1080,aspectRatio:this.aspectRatio}),i=e?[]:(r=this.controls??al)==null?void 0:r.filter(A=>!(A==="fullscreen"&&My())),s=!(i!=null&&i.includes("preview")),o=this.loading||this.waiting||this.processing,a=!this.config,l=!!this.errors.find(A=>A.fatal);return Qe`
|
3766
3766
|
${this._renderStyles()}
|
3767
3767
|
<div
|
3768
3768
|
${yt(this._playerRef)}
|
3769
3769
|
class=${Ke({player:!0,responsive:!this.propAspectRatio})}
|
3770
|
-
style=${
|
3770
|
+
style=${Yo({aspectRatio:this.aspectRatio})}
|
3771
3771
|
>
|
3772
|
-
${!o&&(a||
|
3772
|
+
${!o&&(a||l)?this._renderError():Qe`<canvas
|
3773
3773
|
${yt(this._canvasRef)}
|
3774
3774
|
${this._drawController.canvas()}
|
3775
|
-
${
|
3775
|
+
${ll(this._handleCanvasResize)}
|
3776
3776
|
height=${t}
|
3777
3777
|
width=${n}
|
3778
3778
|
></canvas>
|
@@ -3791,16 +3791,16 @@ vec4 transition(vec2 uv) {
|
|
3791
3791
|
.controls=${i}
|
3792
3792
|
?captions=${this.captions}
|
3793
3793
|
?fullscreen=${this.fullscreen}
|
3794
|
-
@play:click=${({detail:
|
3795
|
-
@volume:click=${({detail:
|
3796
|
-
@language:click=${({detail:
|
3797
|
-
@level:click=${({detail:
|
3798
|
-
@playbackRate:click=${({detail:
|
3794
|
+
@play:click=${({detail:A})=>{e||(A?this.pause():(this.muted=this._manualMute,this.play()))}}
|
3795
|
+
@volume:click=${({detail:A})=>{this.muted=!A,this._manualMute=!A}}
|
3796
|
+
@language:click=${({detail:A})=>{this._language=A.value}}
|
3797
|
+
@level:click=${({detail:A})=>{this.videoResolution=A.value.resolution}}
|
3798
|
+
@playbackRate:click=${({detail:A})=>{this.playbackRate=A.value??1}}
|
3799
3799
|
@captions:click=${()=>{this._captions=!this._captions}}
|
3800
3800
|
@fullscreen:click=${()=>{this.toggleFullscreen()}}
|
3801
|
-
@input=${
|
3802
|
-
@pointerdown=${
|
3803
|
-
@pointerup=${
|
3801
|
+
@input=${A=>{const c=A.composedPath()[0],u=c.getAttribute("key");if(u==="scrubber"){const h=parseFloat(c.value);this._drawController.currentTime=h,this._sceneController.setVideosCurrentTime(h),this.dispatchEvent(new CustomEvent("seeking",{detail:h}))}u==="volume"&&(this.volume=parseFloat(c.value))}}
|
3802
|
+
@pointerdown=${A=>{A.composedPath()[0].getAttribute("key")==="scrubber"&&(this._seeking=!0,this._wasPlaying=!this.paused,this.paused||this.pause())}}
|
3803
|
+
@pointerup=${A=>{A.composedPath()[0].getAttribute("key")==="scrubber"&&(this._seeking=!1,this._wasPlaying&&(this.play(),this._wasPlaying=!1))}}
|
3804
3804
|
></vmp-player-overlay>
|
3805
3805
|
<vmp-video-preview
|
3806
3806
|
?disabled=${s}
|
@@ -3810,7 +3810,7 @@ vec4 transition(vec2 uv) {
|
|
3810
3810
|
.dataResolver=${this.dataResolver}
|
3811
3811
|
></vmp-video-preview>`}
|
3812
3812
|
</div>
|
3813
|
-
`}};
|
3813
|
+
`}};We.styles=[$e.styles??[],gt`
|
3814
3814
|
:host {
|
3815
3815
|
--player-border-radius: var(--vouch-media-player-border-radius, 0px);
|
3816
3816
|
|
@@ -3871,7 +3871,7 @@ vec4 transition(vec2 uv) {
|
|
3871
3871
|
top: 0;
|
3872
3872
|
left: 0;
|
3873
3873
|
}
|
3874
|
-
`],
|
3874
|
+
`],et([oe({type:Boolean})],We.prototype,"debug",2),et([oe({type:Object})],We.prototype,"config",2),et([oe({type:String,attribute:"language"})],We.prototype,"propLanguage",2),et([oe({type:Number,attribute:"aspectratio"})],We.prototype,"propAspectRatio",2),et([oe({type:String})],We.prototype,"preload",2),et([oe({type:Boolean})],We.prototype,"autoplay",2),et([oe({type:Boolean})],We.prototype,"loading",2),et([oe({type:Boolean})],We.prototype,"disabled",2),et([oe({type:Array})],We.prototype,"controls",2),et([oe({attribute:!1})],We.prototype,"dataResolver",2),et([oe({attribute:!1})],We.prototype,"languageResolver",2),et([it()],We.prototype,"_pageHidden",2),et([it()],We.prototype,"_aspectRatio",2),et([it()],We.prototype,"_processing",2),et([it()],We.prototype,"_waiting",2),et([it()],We.prototype,"_errors",2),et([it()],We.prototype,"_seeking",2),et([it()],We.prototype,"_language",2),et([it()],We.prototype,"_languages",2),et([it()],We.prototype,"_captions",2),et([it()],We.prototype,"_fullscreen",2),We=et([wt("vmp-media-player")],We);var kB=Object.defineProperty,NB=Object.getOwnPropertyDescriptor,Qt=(r,e,t,n)=>{for(var i=n>1?void 0:n?NB(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&kB(e,t,i),i};return tt.PlayerEmbed=class extends cn{constructor(){super(...arguments),this.env="prod",this.apiKey="",this.disableTracking=!1,this.trackingSource="embedded_player",this.preload="auto",this.autoplay=!1,this.aspectRatio=0,this.eventController=new Xd(this,["durationchange","ended","error","loadeddata","pause","stalled","play","playing","ratechange","scenechange","scenesupdate","seeking","seeked","timeupdate","volumechange","processing","waiting","video:loadeddata","video:seeking","video:seeked","video:play","video:playing","video:pause","video:stalled","video:timeupdate","video:ended","video:error"]),this._fetcherController=new uf(this),this._trackingController=new Cp(this),this._mediaPlayerRef=vt()}get fetching(){return this._fetcherController.fetching}get waiting(){var e;return(e=this._mediaPlayerRef.value)==null?void 0:e.waiting}get initialised(){var e;return(e=this._mediaPlayerRef.value)==null?void 0:e.initialised}get seeking(){var e;return(e=this._mediaPlayerRef.value)==null?void 0:e.seeking}get paused(){var e;return(e=this._mediaPlayerRef.value)==null?void 0:e.paused}get captions(){var e;return(e=this._mediaPlayerRef.value)==null?void 0:e.captions}get fullscreen(){var e;return(e=this._mediaPlayerRef.value)==null?void 0:e.fullscreen}get duration(){var e;return(e=this._mediaPlayerRef.value)==null?void 0:e.duration}set currentTime(e){this._mediaPlayerRef.value&&(this._mediaPlayerRef.value.currentTime=e)}get currentTime(){var e;return((e=this._mediaPlayerRef.value)==null?void 0:e.currentTime)??0}set playbackRate(e){this._mediaPlayerRef.value&&(this._mediaPlayerRef.value.playbackRate=e)}get playbackRate(){var e;return((e=this._mediaPlayerRef.value)==null?void 0:e.playbackRate)??1}set volume(e){this._mediaPlayerRef.value&&(this._mediaPlayerRef.value.volume=e)}get volume(){var e;return((e=this._mediaPlayerRef.value)==null?void 0:e.volume)??1}set muted(e){this._mediaPlayerRef.value&&(this._mediaPlayerRef.value.muted=e)}get muted(){var e;return((e=this._mediaPlayerRef.value)==null?void 0:e.muted)??!1}get videoState(){var e;return(e=this._mediaPlayerRef.value)==null?void 0:e.videoState}get mediaPlayer(){return this._mediaPlayerRef.value}play(){var e;(e=this._mediaPlayerRef.value)==null||e.play()}pause(){var e;(e=this._mediaPlayerRef.value)==null||e.pause()}reset(e=0,t=!1){var n;(n=this._mediaPlayerRef.value)==null||n.reset(e,t)}_renderStyles(){return this.aspectRatio?typeof this.aspectRatio=="number"?Qe`
|
3875
3875
|
<style>
|
3876
3876
|
:host {
|
3877
3877
|
aspect-ratio: ${this.aspectRatio};
|
@@ -3896,9 +3896,9 @@ vec4 transition(vec2 uv) {
|
|
3896
3896
|
language=${Ur(this.language)}
|
3897
3897
|
.controls=${this.controls}
|
3898
3898
|
></vmp-media-player>
|
3899
|
-
`}},
|
3899
|
+
`}},tt.PlayerEmbed.styles=[gt`
|
3900
3900
|
:host {
|
3901
3901
|
display: flex;
|
3902
3902
|
}
|
3903
|
-
`],Qt([oe({type:Object})],
|
3903
|
+
`],Qt([oe({type:Object})],tt.PlayerEmbed.prototype,"data",2),Qt([oe({type:String})],tt.PlayerEmbed.prototype,"vouchId",2),Qt([oe({type:String})],tt.PlayerEmbed.prototype,"templateId",2),Qt([oe({type:Array})],tt.PlayerEmbed.prototype,"questions",2),Qt([oe({type:String})],tt.PlayerEmbed.prototype,"env",2),Qt([oe({type:String})],tt.PlayerEmbed.prototype,"apiKey",2),Qt([oe({type:Boolean})],tt.PlayerEmbed.prototype,"disableTracking",2),Qt([oe({type:String})],tt.PlayerEmbed.prototype,"trackingSource",2),Qt([oe({type:Array})],tt.PlayerEmbed.prototype,"controls",2),Qt([oe({type:String})],tt.PlayerEmbed.prototype,"preload",2),Qt([oe({type:Boolean})],tt.PlayerEmbed.prototype,"autoplay",2),Qt([oe({type:Number})],tt.PlayerEmbed.prototype,"aspectRatio",2),Qt([oe({type:String})],tt.PlayerEmbed.prototype,"language",2),Qt([it()],tt.PlayerEmbed.prototype,"vouch",2),Qt([it()],tt.PlayerEmbed.prototype,"template",2),tt.PlayerEmbed=Qt([Md("vouch-embed-player")],tt.PlayerEmbed),Object.defineProperty(tt,Symbol.toStringTag,{value:"Module"}),tt}({});
|
3904
3904
|
//# sourceMappingURL=embed.iife.js.map
|