const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MainLayout-CoehIdCA.js","assets/TouchPan--MHHFvUL.js","assets/ThemeSwitch-Dkc62fT1.js","assets/index-NBHkZjGq.js","assets/use-quasar-oVIHlz4p.js","assets/ThemeSwitch-BOEXY8Tw.css","assets/QSkeleton-DGfP788Y.js","assets/MyCard-CfLjqOzq.js","assets/MyCard-XY9gNazb.css","assets/MainLayout-DBqlXUfy.css","assets/IndexPage-DuIKlpVx.js","assets/MyPage-C8u4U9EA.js","assets/MyPage-CT73SucJ.css","assets/copy-to-clipboard-XOrOUCG4.js","assets/IndexPage-zcwtGzOd.css","assets/Level-0vOa2YqY.js","assets/Level-D45urXyB.css","assets/More-BZQ-Z8BP.js","assets/More-Ds3wfKN8.css","assets/Login-CujoDjOq.js","assets/QForm-CIO43rWx.js","assets/Login-CZNh1vxg.css","assets/Reg-B6ynSNzS.js","assets/Reg-CY4s-Dji.css","assets/Forbidden-DzEG47dH.js"])))=>i.map(i=>d[i]); const Z1=function(){const e=typeof document<"u"&&document.createElement("link").relList;return e&&e.supports&&e.supports("modulepreload")?"modulepreload":"preload"}(),ex=function(t){return"/"+t},kp={},xn=function(e,i,n){let s=Promise.resolve();if(i&&i.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),o=a?.nonce||a?.getAttribute("nonce");s=Promise.allSettled(i.map(u=>{if(u=ex(u),u in kp)return;kp[u]=!0;const c=u.endsWith(".css"),f=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${f}`))return;const g=document.createElement("link");if(g.rel=c?"stylesheet":Z1,c||(g.as="script"),g.crossOrigin="",g.href=u,o&&g.setAttribute("nonce",o),document.head.appendChild(g),c)return new Promise((y,_)=>{g.addEventListener("load",y),g.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${u}`)))})}))}function r(a){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a}return s.then(a=>{for(const o of a||[])o.status==="rejected"&&r(o.reason);return e().catch(r)})};/** * @vue/shared v3.5.13 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **//*! #__NO_SIDE_EFFECTS__ */function Ih(t){const e=Object.create(null);for(const i of t.split(","))e[i]=1;return i=>i in e}const st={},ur=[],hn=()=>{},tx=()=>!1,fu=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),Ph=t=>t.startsWith("onUpdate:"),St=Object.assign,Oh=(t,e)=>{const i=t.indexOf(e);i>-1&&t.splice(i,1)},ix=Object.prototype.hasOwnProperty,Je=(t,e)=>ix.call(t,e),Fe=Array.isArray,cr=t=>pu(t)==="[object Map]",V0=t=>pu(t)==="[object Set]",$e=t=>typeof t=="function",vt=t=>typeof t=="string",Ln=t=>typeof t=="symbol",ct=t=>t!==null&&typeof t=="object",H0=t=>(ct(t)||$e(t))&&$e(t.then)&&$e(t.catch),z0=Object.prototype.toString,pu=t=>z0.call(t),nx=t=>pu(t).slice(8,-1),W0=t=>pu(t)==="[object Object]",Lh=t=>vt(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Ia=Ih(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),gu=t=>{const e=Object.create(null);return i=>e[i]||(e[i]=t(i))},sx=/-(\w)/g,Oi=gu(t=>t.replace(sx,(e,i)=>i?i.toUpperCase():"")),rx=/\B([A-Z])/g,js=gu(t=>t.replace(rx,"-$1").toLowerCase()),mu=gu(t=>t.charAt(0).toUpperCase()+t.slice(1)),_c=gu(t=>t?`on${mu(t)}`:""),is=(t,e)=>!Object.is(t,e),vc=(t,...e)=>{for(let i=0;i{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:n,value:i})},ax=t=>{const e=parseFloat(t);return isNaN(e)?t:e},ox=t=>{const e=vt(t)?Number(t):NaN;return isNaN(e)?t:e};let Ip;const yu=()=>Ip||(Ip=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Rh(t){if(Fe(t)){const e={};for(let i=0;i{if(i){const n=i.split(ux);n.length>1&&(e[n[0].trim()]=n[1].trim())}}),e}function dr(t){let e="";if(vt(t))e=t;else if(Fe(t))for(let i=0;i!!(t&&t.__v_isRef===!0),px=t=>vt(t)?t:t==null?"":Fe(t)||ct(t)&&(t.toString===z0||!$e(t.toString))?K0(t)?px(t.value):JSON.stringify(t,X0,2):String(t),X0=(t,e)=>K0(e)?X0(t,e.value):cr(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((i,[n,s],r)=>(i[bc(n,r)+" =>"]=s,i),{})}:V0(e)?{[`Set(${e.size})`]:[...e.values()].map(i=>bc(i))}:Ln(e)?bc(e):ct(e)&&!Fe(e)&&!W0(e)?String(e):e,bc=(t,e="")=>{var i;return Ln(t)?`Symbol(${(i=t.description)!=null?i:e})`:t};/** * @vue/reactivity v3.5.13 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/let pi;class Y0{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=pi,!e&&pi&&(this.index=(pi.scopes||(pi.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,i;if(this.scopes)for(e=0,i=this.scopes.length;e0)return;if(Oa){let e=Oa;for(Oa=void 0;e;){const i=e.next;e.next=void 0,e.flags&=-9,e=i}}let t;for(;Pa;){let e=Pa;for(Pa=void 0;e;){const i=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(n){t||(t=n)}e=i}}if(t)throw t}function ey(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function ty(t){let e,i=t.depsTail,n=i;for(;n;){const s=n.prevDep;n.version===-1?(n===i&&(i=s),Bh(n),mx(n)):e=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=s}t.deps=e,t.depsTail=i}function Dd(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(iy(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function iy(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===Wa))return;t.globalVersion=Wa;const e=t.dep;if(t.flags|=2,e.version>0&&!t.isSSR&&t.deps&&!Dd(t)){t.flags&=-3;return}const i=rt,n=zi;rt=t,zi=!0;try{ey(t);const s=t.fn(t._value);(e.version===0||is(s,t._value))&&(t._value=s,e.version++)}catch(s){throw e.version++,s}finally{rt=i,zi=n,ty(t),t.flags&=-3}}function Bh(t,e=!1){const{dep:i,prevSub:n,nextSub:s}=t;if(n&&(n.nextSub=s,t.prevSub=void 0),s&&(s.prevSub=n,t.nextSub=void 0),i.subs===t&&(i.subs=n,!n&&i.computed)){i.computed.flags&=-5;for(let r=i.computed.deps;r;r=r.nextDep)Bh(r,!0)}!e&&!--i.sc&&i.map&&i.map.delete(i.key)}function mx(t){const{prevDep:e,nextDep:i}=t;e&&(e.nextDep=i,t.prevDep=void 0),i&&(i.prevDep=e,t.nextDep=void 0)}let zi=!0;const ny=[];function ls(){ny.push(zi),zi=!1}function us(){const t=ny.pop();zi=t===void 0?!0:t}function Pp(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const i=rt;rt=void 0;try{e()}finally{rt=i}}}let Wa=0;class yx{constructor(e,i){this.sub=e,this.dep=i,this.version=i.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Fh{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(e){if(!rt||!zi||rt===this.computed)return;let i=this.activeLink;if(i===void 0||i.sub!==rt)i=this.activeLink=new yx(rt,this),rt.deps?(i.prevDep=rt.depsTail,rt.depsTail.nextDep=i,rt.depsTail=i):rt.deps=rt.depsTail=i,sy(i);else if(i.version===-1&&(i.version=this.version,i.nextDep)){const n=i.nextDep;n.prevDep=i.prevDep,i.prevDep&&(i.prevDep.nextDep=n),i.prevDep=rt.depsTail,i.nextDep=void 0,rt.depsTail.nextDep=i,rt.depsTail=i,rt.deps===i&&(rt.deps=n)}return i}trigger(e){this.version++,Wa++,this.notify(e)}notify(e){Mh();try{for(let i=this.subs;i;i=i.prevSub)i.sub.notify()&&i.sub.dep.notify()}finally{Nh()}}}function sy(t){if(t.dep.sc++,t.sub.flags&4){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let n=e.deps;n;n=n.nextDep)sy(n)}const i=t.dep.subs;i!==t&&(t.prevSub=i,i&&(i.nextSub=t)),t.dep.subs=t}}const kd=new WeakMap,Ps=Symbol(""),Id=Symbol(""),Ga=Symbol("");function Vt(t,e,i){if(zi&&rt){let n=kd.get(t);n||kd.set(t,n=new Map);let s=n.get(i);s||(n.set(i,s=new Fh),s.map=n,s.key=i),s.track()}}function Cn(t,e,i,n,s,r){const a=kd.get(t);if(!a){Wa++;return}const o=u=>{u&&u.trigger()};if(Mh(),e==="clear")a.forEach(o);else{const u=Fe(t),c=u&&Lh(i);if(u&&i==="length"){const f=Number(n);a.forEach((g,y)=>{(y==="length"||y===Ga||!Ln(y)&&y>=f)&&o(g)})}else switch((i!==void 0||a.has(void 0))&&o(a.get(i)),c&&o(a.get(Ga)),e){case"add":u?c&&o(a.get("length")):(o(a.get(Ps)),cr(t)&&o(a.get(Id)));break;case"delete":u||(o(a.get(Ps)),cr(t)&&o(a.get(Id)));break;case"set":cr(t)&&o(a.get(Ps));break}}Nh()}function Ys(t){const e=Ve(t);return e===t?e:(Vt(e,"iterate",Ga),ki(t)?e:e.map(Ht))}function _u(t){return Vt(t=Ve(t),"iterate",Ga),t}const _x={__proto__:null,[Symbol.iterator](){return xc(this,Symbol.iterator,Ht)},concat(...t){return Ys(this).concat(...t.map(e=>Fe(e)?Ys(e):e))},entries(){return xc(this,"entries",t=>(t[1]=Ht(t[1]),t))},every(t,e){return vn(this,"every",t,e,void 0,arguments)},filter(t,e){return vn(this,"filter",t,e,i=>i.map(Ht),arguments)},find(t,e){return vn(this,"find",t,e,Ht,arguments)},findIndex(t,e){return vn(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return vn(this,"findLast",t,e,Ht,arguments)},findLastIndex(t,e){return vn(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return vn(this,"forEach",t,e,void 0,arguments)},includes(...t){return Sc(this,"includes",t)},indexOf(...t){return Sc(this,"indexOf",t)},join(t){return Ys(this).join(t)},lastIndexOf(...t){return Sc(this,"lastIndexOf",t)},map(t,e){return vn(this,"map",t,e,void 0,arguments)},pop(){return da(this,"pop")},push(...t){return da(this,"push",t)},reduce(t,...e){return Op(this,"reduce",t,e)},reduceRight(t,...e){return Op(this,"reduceRight",t,e)},shift(){return da(this,"shift")},some(t,e){return vn(this,"some",t,e,void 0,arguments)},splice(...t){return da(this,"splice",t)},toReversed(){return Ys(this).toReversed()},toSorted(t){return Ys(this).toSorted(t)},toSpliced(...t){return Ys(this).toSpliced(...t)},unshift(...t){return da(this,"unshift",t)},values(){return xc(this,"values",Ht)}};function xc(t,e,i){const n=_u(t),s=n[e]();return n!==t&&!ki(t)&&(s._next=s.next,s.next=()=>{const r=s._next();return r.value&&(r.value=i(r.value)),r}),s}const vx=Array.prototype;function vn(t,e,i,n,s,r){const a=_u(t),o=a!==t&&!ki(t),u=a[e];if(u!==vx[e]){const g=u.apply(t,r);return o?Ht(g):g}let c=i;a!==t&&(o?c=function(g,y){return i.call(this,Ht(g),y,t)}:i.length>2&&(c=function(g,y){return i.call(this,g,y,t)}));const f=u.call(a,c,n);return o&&s?s(f):f}function Op(t,e,i,n){const s=_u(t);let r=i;return s!==t&&(ki(t)?i.length>3&&(r=function(a,o,u){return i.call(this,a,o,u,t)}):r=function(a,o,u){return i.call(this,a,Ht(o),u,t)}),s[e](r,...n)}function Sc(t,e,i){const n=Ve(t);Vt(n,"iterate",Ga);const s=n[e](...i);return(s===-1||s===!1)&&jh(i[0])?(i[0]=Ve(i[0]),n[e](...i)):s}function da(t,e,i=[]){ls(),Mh();const n=Ve(t)[e].apply(t,i);return Nh(),us(),n}const bx=Ih("__proto__,__v_isRef,__isVue"),ry=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Ln));function Tx(t){Ln(t)||(t=String(t));const e=Ve(this);return Vt(e,"has",t),e.hasOwnProperty(t)}class ay{constructor(e=!1,i=!1){this._isReadonly=e,this._isShallow=i}get(e,i,n){if(i==="__v_skip")return e.__v_skip;const s=this._isReadonly,r=this._isShallow;if(i==="__v_isReactive")return!s;if(i==="__v_isReadonly")return s;if(i==="__v_isShallow")return r;if(i==="__v_raw")return n===(s?r?Px:cy:r?uy:ly).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const a=Fe(e);if(!s){let u;if(a&&(u=_x[i]))return u;if(i==="hasOwnProperty")return Tx}const o=Reflect.get(e,i,Gt(e)?e:n);return(Ln(i)?ry.has(i):bx(i))||(s||Vt(e,"get",i),r)?o:Gt(o)?a&&Lh(i)?o:o.value:ct(o)?s?qh(o):Fr(o):o}}class oy extends ay{constructor(e=!1){super(!1,e)}set(e,i,n,s){let r=e[i];if(!this._isShallow){const u=Us(r);if(!ki(n)&&!Us(n)&&(r=Ve(r),n=Ve(n)),!Fe(e)&&Gt(r)&&!Gt(n))return u?!1:(r.value=n,!0)}const a=Fe(e)&&Lh(i)?Number(i)t,Wo=t=>Reflect.getPrototypeOf(t);function wx(t,e,i){return function(...n){const s=this.__v_raw,r=Ve(s),a=cr(r),o=t==="entries"||t===Symbol.iterator&&a,u=t==="keys"&&a,c=s[t](...n),f=i?Pd:e?Od:Ht;return!e&&Vt(r,"iterate",u?Id:Ps),{next(){const{value:g,done:y}=c.next();return y?{value:g,done:y}:{value:o?[f(g[0]),f(g[1])]:f(g),done:y}},[Symbol.iterator](){return this}}}}function Go(t){return function(...e){return t==="delete"?!1:t==="clear"?void 0:this}}function Ax(t,e){const i={get(s){const r=this.__v_raw,a=Ve(r),o=Ve(s);t||(is(s,o)&&Vt(a,"get",s),Vt(a,"get",o));const{has:u}=Wo(a),c=e?Pd:t?Od:Ht;if(u.call(a,s))return c(r.get(s));if(u.call(a,o))return c(r.get(o));r!==a&&r.get(s)},get size(){const s=this.__v_raw;return!t&&Vt(Ve(s),"iterate",Ps),Reflect.get(s,"size",s)},has(s){const r=this.__v_raw,a=Ve(r),o=Ve(s);return t||(is(s,o)&&Vt(a,"has",s),Vt(a,"has",o)),s===o?r.has(s):r.has(s)||r.has(o)},forEach(s,r){const a=this,o=a.__v_raw,u=Ve(o),c=e?Pd:t?Od:Ht;return!t&&Vt(u,"iterate",Ps),o.forEach((f,g)=>s.call(r,c(f),c(g),a))}};return St(i,t?{add:Go("add"),set:Go("set"),delete:Go("delete"),clear:Go("clear")}:{add(s){!e&&!ki(s)&&!Us(s)&&(s=Ve(s));const r=Ve(this);return Wo(r).has.call(r,s)||(r.add(s),Cn(r,"add",s,s)),this},set(s,r){!e&&!ki(r)&&!Us(r)&&(r=Ve(r));const a=Ve(this),{has:o,get:u}=Wo(a);let c=o.call(a,s);c||(s=Ve(s),c=o.call(a,s));const f=u.call(a,s);return a.set(s,r),c?is(r,f)&&Cn(a,"set",s,r):Cn(a,"add",s,r),this},delete(s){const r=Ve(this),{has:a,get:o}=Wo(r);let u=a.call(r,s);u||(s=Ve(s),u=a.call(r,s)),o&&o.call(r,s);const c=r.delete(s);return u&&Cn(r,"delete",s,void 0),c},clear(){const s=Ve(this),r=s.size!==0,a=s.clear();return r&&Cn(s,"clear",void 0,void 0),a}}),["keys","values","entries",Symbol.iterator].forEach(s=>{i[s]=wx(s,t,e)}),i}function Uh(t,e){const i=Ax(t,e);return(n,s,r)=>s==="__v_isReactive"?!t:s==="__v_isReadonly"?t:s==="__v_raw"?n:Reflect.get(Je(i,s)&&s in n?i:n,s,r)}const Dx={get:Uh(!1,!1)},kx={get:Uh(!1,!0)},Ix={get:Uh(!0,!1)};const ly=new WeakMap,uy=new WeakMap,cy=new WeakMap,Px=new WeakMap;function Ox(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Lx(t){return t.__v_skip||!Object.isExtensible(t)?0:Ox(nx(t))}function Fr(t){return Us(t)?t:$h(t,!1,Sx,Dx,ly)}function dy(t){return $h(t,!1,Cx,kx,uy)}function qh(t){return $h(t,!0,Ex,Ix,cy)}function $h(t,e,i,n,s){if(!ct(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const r=s.get(t);if(r)return r;const a=Lx(t);if(a===0)return t;const o=new Proxy(t,a===2?n:i);return s.set(t,o),o}function hr(t){return Us(t)?hr(t.__v_raw):!!(t&&t.__v_isReactive)}function Us(t){return!!(t&&t.__v_isReadonly)}function ki(t){return!!(t&&t.__v_isShallow)}function jh(t){return t?!!t.__v_raw:!1}function Ve(t){const e=t&&t.__v_raw;return e?Ve(e):t}function lo(t){return!Je(t,"__v_skip")&&Object.isExtensible(t)&&Al(t,"__v_skip",!0),t}const Ht=t=>ct(t)?Fr(t):t,Od=t=>ct(t)?qh(t):t;function Gt(t){return t?t.__v_isRef===!0:!1}function Ge(t){return hy(t,!1)}function fl(t){return hy(t,!0)}function hy(t,e){return Gt(t)?t:new Rx(t,e)}class Rx{constructor(e,i){this.dep=new Fh,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=i?e:Ve(e),this._value=i?e:Ht(e),this.__v_isShallow=i}get value(){return this.dep.track(),this._value}set value(e){const i=this._rawValue,n=this.__v_isShallow||ki(e)||Us(e);e=n?e:Ve(e),is(e,i)&&(this._rawValue=e,this._value=n?e:Ht(e),this.dep.trigger())}}function ts(t){return Gt(t)?t.value:t}const Mx={get:(t,e,i)=>e==="__v_raw"?t:ts(Reflect.get(t,e,i)),set:(t,e,i,n)=>{const s=t[e];return Gt(s)&&!Gt(i)?(s.value=i,!0):Reflect.set(t,e,i,n)}};function fy(t){return hr(t)?t:new Proxy(t,Mx)}class Nx{constructor(e,i,n){this.fn=e,this.setter=i,this._value=void 0,this.dep=new Fh(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Wa-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!i,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&rt!==this)return Z0(this,!0),!0}get value(){const e=this.dep.track();return iy(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function Bx(t,e,i=!1){let n,s;return $e(t)?n=t:(n=t.get,s=t.set),new Nx(n,s,i)}const Ko={},Dl=new WeakMap;let Ss;function Fx(t,e=!1,i=Ss){if(i){let n=Dl.get(i);n||Dl.set(i,n=[]),n.push(t)}}function Ux(t,e,i=st){const{immediate:n,deep:s,once:r,scheduler:a,augmentJob:o,call:u}=i,c=R=>s?R:ki(R)||s===!1||s===0?wn(R,1):wn(R);let f,g,y,_,x=!1,b=!1;if(Gt(t)?(g=()=>t.value,x=ki(t)):hr(t)?(g=()=>c(t),x=!0):Fe(t)?(b=!0,x=t.some(R=>hr(R)||ki(R)),g=()=>t.map(R=>{if(Gt(R))return R.value;if(hr(R))return c(R);if($e(R))return u?u(R,2):R()})):$e(t)?e?g=u?()=>u(t,2):t:g=()=>{if(y){ls();try{y()}finally{us()}}const R=Ss;Ss=f;try{return u?u(t,3,[_]):t(_)}finally{Ss=R}}:g=hn,e&&s){const R=g,O=s===!0?1/0:s;g=()=>wn(R(),O)}const A=gx(),L=()=>{f.stop(),A&&A.active&&Oh(A.effects,f)};if(r&&e){const R=e;e=(...O)=>{R(...O),L()}}let C=b?new Array(t.length).fill(Ko):Ko;const w=R=>{if(!(!(f.flags&1)||!f.dirty&&!R))if(e){const O=f.run();if(s||x||(b?O.some((U,H)=>is(U,C[H])):is(O,C))){y&&y();const U=Ss;Ss=f;try{const H=[O,C===Ko?void 0:b&&C[0]===Ko?[]:C,_];u?u(e,3,H):e(...H),C=O}finally{Ss=U}}}else f.run()};return o&&o(w),f=new Q0(g),f.scheduler=a?()=>a(w,!1):w,_=R=>Fx(R,!1,f),y=f.onStop=()=>{const R=Dl.get(f);if(R){if(u)u(R,4);else for(const O of R)O();Dl.delete(f)}},e?n?w(!0):C=f.run():a?a(w.bind(null,!0),!0):f.run(),L.pause=f.pause.bind(f),L.resume=f.resume.bind(f),L.stop=L,L}function wn(t,e=1/0,i){if(e<=0||!ct(t)||t.__v_skip||(i=i||new Set,i.has(t)))return t;if(i.add(t),e--,Gt(t))wn(t.value,e,i);else if(Fe(t))for(let n=0;n{wn(n,e,i)});else if(W0(t)){for(const n in t)wn(t[n],e,i);for(const n of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,n)&&wn(t[n],e,i)}return t}/** * @vue/runtime-core v3.5.13 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/function uo(t,e,i,n){try{return n?t(...n):t()}catch(s){vu(s,e,i)}}function Gi(t,e,i,n){if($e(t)){const s=uo(t,e,i,n);return s&&H0(s)&&s.catch(r=>{vu(r,e,i)}),s}if(Fe(t)){const s=[];for(let r=0;r>>1,s=ii[n],r=Ka(s);r=Ka(i)?ii.push(t):ii.splice($x(e),0,t),t.flags|=1,gy()}}function gy(){kl||(kl=py.then(yy))}function jx(t){Fe(t)?fr.push(...t):Gn&&t.id===-1?Gn.splice(sr+1,0,t):t.flags&1||(fr.push(t),t.flags|=1),gy()}function Lp(t,e,i=nn+1){for(;iKa(i)-Ka(n));if(fr.length=0,Gn){Gn.push(...e);return}for(Gn=e,sr=0;srt.id==null?t.flags&2?-1:1/0:t.id;function yy(t){try{for(nn=0;nnon.emit(s,...r)),Ea=[]):typeof window<"u"&&window.HTMLElement&&!((n=(i=window.navigator)==null?void 0:i.userAgent)!=null&&n.includes("jsdom"))?((e.__VUE_DEVTOOLS_HOOK_REPLAY__=e.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(r=>{_y(r,e)}),setTimeout(()=>{on||(e.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Ld=!0,Ea=[])},3e3)):(Ld=!0,Ea=[])}function Vx(t,e){bu("app:init",t,e,{Fragment:ni,Text:co,Comment:zt,Static:ml})}function Hx(t){bu("app:unmount",t)}const zx=Hh("component:added"),vy=Hh("component:updated"),Wx=Hh("component:removed"),Gx=t=>{on&&typeof on.cleanupBuffer=="function"&&!on.cleanupBuffer(t)&&Wx(t)};/*! #__NO_SIDE_EFFECTS__ */function Hh(t){return e=>{bu(t,e.appContext.app,e.uid,e.parent?e.parent.uid:void 0,e)}}function Kx(t,e,i){bu("component:emit",t.appContext.app,t,e,i)}let Rt=null,by=null;function Il(t){const e=Rt;return Rt=t,by=t&&t.type.__scopeId||null,e}function Xx(t,e=Rt,i){if(!e||t._n)return t;const n=(...s)=>{n._d&&Wp(-1);const r=Il(e);let a;try{a=t(...s)}finally{Il(r),n._d&&Wp(1)}return vy(e),a};return n._n=!0,n._c=!0,n._d=!0,n}function Ty(t,e){if(Rt===null)return t;const i=wu(Rt),n=t.dirs||(t.dirs=[]);for(let s=0;st.__isTeleport,La=t=>t&&(t.disabled||t.disabled===""),Rp=t=>t&&(t.defer||t.defer===""),Mp=t=>typeof SVGElement<"u"&&t instanceof SVGElement,Np=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,Rd=(t,e)=>{const i=t&&t.to;return vt(i)?e?e(i):null:i},Ey={name:"Teleport",__isTeleport:!0,process(t,e,i,n,s,r,a,o,u,c){const{mc:f,pc:g,pbc:y,o:{insert:_,querySelector:x,createText:b,createComment:A}}=c,L=La(e.props);let{shapeFlag:C,children:w,dynamicChildren:R}=e;if(t==null){const O=e.el=b(""),U=e.anchor=b("");_(O,i,n),_(U,i,n);const H=(T,S)=>{C&16&&(s&&s.isCE&&(s.ce._teleportTarget=T),f(w,T,S,s,r,a,o,u))},X=()=>{const T=e.target=Rd(e.props,x),S=Cy(T,e,b,_);T&&(a!=="svg"&&Mp(T)?a="svg":a!=="mathml"&&Np(T)&&(a="mathml"),L||(H(T,S),pl(e,!1)))};L&&(H(i,U),pl(e,!0)),Rp(e.props)?ti(()=>{X(),e.el.__isMounted=!0},r):X()}else{if(Rp(e.props)&&!t.el.__isMounted){ti(()=>{Ey.process(t,e,i,n,s,r,a,o,u,c),delete t.el.__isMounted},r);return}e.el=t.el,e.targetStart=t.targetStart;const O=e.anchor=t.anchor,U=e.target=t.target,H=e.targetAnchor=t.targetAnchor,X=La(t.props),T=X?i:U,S=X?O:H;if(a==="svg"||Mp(U)?a="svg":(a==="mathml"||Np(U))&&(a="mathml"),R?(y(t.dynamicChildren,R,T,s,r,a,o),Xh(t,e,!0)):u||g(t,e,T,S,s,r,a,o,!1),L)X?e.props&&t.props&&e.props.to!==t.props.to&&(e.props.to=t.props.to):Xo(e,i,O,c,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const B=e.target=Rd(e.props,x);B&&Xo(e,B,null,c,0)}else X&&Xo(e,U,H,c,1);pl(e,L)}},remove(t,e,i,{um:n,o:{remove:s}},r){const{shapeFlag:a,children:o,anchor:u,targetStart:c,targetAnchor:f,target:g,props:y}=t;if(g&&(s(c),s(f)),r&&s(u),a&16){const _=r||!La(y);for(let x=0;x{t.isMounted=!0}),bi(()=>{t.isUnmounting=!0}),t}const Ei=[Function,Array],Ay={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Ei,onEnter:Ei,onAfterEnter:Ei,onEnterCancelled:Ei,onBeforeLeave:Ei,onLeave:Ei,onAfterLeave:Ei,onLeaveCancelled:Ei,onBeforeAppear:Ei,onAppear:Ei,onAfterAppear:Ei,onAppearCancelled:Ei},Dy=t=>{const e=t.subTree;return e.component?Dy(e.component):e},Jx={name:"BaseTransition",props:Ay,setup(t,{slots:e}){const i=yt(),n=wy();return()=>{const s=e.default&&zh(e.default(),!0);if(!s||!s.length)return;const r=ky(s),a=Ve(t),{mode:o}=a;if(n.isLeaving)return Ec(r);const u=Bp(r);if(!u)return Ec(r);let c=Xa(u,a,n,i,g=>c=g);u.type!==zt&&qs(u,c);let f=i.subTree&&Bp(i.subTree);if(f&&f.type!==zt&&!Cs(u,f)&&Dy(i).type!==zt){let g=Xa(f,a,n,i);if(qs(f,g),o==="out-in"&&u.type!==zt)return n.isLeaving=!0,g.afterLeave=()=>{n.isLeaving=!1,i.job.flags&8||i.update(),delete g.afterLeave,f=void 0},Ec(r);o==="in-out"&&u.type!==zt?g.delayLeave=(y,_,x)=>{const b=Iy(n,f);b[String(f.key)]=f,y[Kn]=()=>{_(),y[Kn]=void 0,delete c.delayedLeave,f=void 0},c.delayedLeave=()=>{x(),delete c.delayedLeave,f=void 0}}:f=void 0}else f&&(f=void 0);return r}}};function ky(t){let e=t[0];if(t.length>1){for(const i of t)if(i.type!==zt){e=i;break}}return e}const Zx=Jx;function Iy(t,e){const{leavingVNodes:i}=t;let n=i.get(e.type);return n||(n=Object.create(null),i.set(e.type,n)),n}function Xa(t,e,i,n,s){const{appear:r,mode:a,persisted:o=!1,onBeforeEnter:u,onEnter:c,onAfterEnter:f,onEnterCancelled:g,onBeforeLeave:y,onLeave:_,onAfterLeave:x,onLeaveCancelled:b,onBeforeAppear:A,onAppear:L,onAfterAppear:C,onAppearCancelled:w}=e,R=String(t.key),O=Iy(i,t),U=(T,S)=>{T&&Gi(T,n,9,S)},H=(T,S)=>{const B=S[1];U(T,S),Fe(T)?T.every(k=>k.length<=1)&&B():T.length<=1&&B()},X={mode:a,persisted:o,beforeEnter(T){let S=u;if(!i.isMounted)if(r)S=A||u;else return;T[Kn]&&T[Kn](!0);const B=O[R];B&&Cs(t,B)&&B.el[Kn]&&B.el[Kn](),U(S,[T])},enter(T){let S=c,B=f,k=g;if(!i.isMounted)if(r)S=L||c,B=C||f,k=w||g;else return;let V=!1;const F=T[Yo]=Y=>{V||(V=!0,Y?U(k,[T]):U(B,[T]),X.delayedLeave&&X.delayedLeave(),T[Yo]=void 0)};S?H(S,[T,F]):F()},leave(T,S){const B=String(t.key);if(T[Yo]&&T[Yo](!0),i.isUnmounting)return S();U(y,[T]);let k=!1;const V=T[Kn]=F=>{k||(k=!0,S(),F?U(b,[T]):U(x,[T]),T[Kn]=void 0,O[B]===t&&delete O[B])};O[B]=t,_?H(_,[T,V]):V()},clone(T){const S=Xa(T,e,i,n,s);return s&&s(S),S}};return X}function Ec(t){if(xu(t))return t=ns(t),t.children=null,t}function Bp(t){if(!xu(t))return Sy(t.type)&&t.children?ky(t.children):t;const{shapeFlag:e,children:i}=t;if(i){if(e&16)return i[0];if(e&32&&$e(i.default))return i.default()}}function qs(t,e){t.shapeFlag&6&&t.component?(t.transition=e,qs(t.component.subTree,e)):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function zh(t,e=!1,i){let n=[],s=0;for(let r=0;r1)for(let r=0;rPl(x,e&&(Fe(e)?e[b]:e),i,n,s));return}if(pr(n)&&!s){n.shapeFlag&512&&n.type.__asyncResolved&&n.component.subTree.component&&Pl(t,e,i,n.component.subTree);return}const r=n.shapeFlag&4?wu(n.component):n.el,a=s?null:r,{i:o,r:u}=t,c=e&&e.r,f=o.refs===st?o.refs={}:o.refs,g=o.setupState,y=Ve(g),_=g===st?()=>!1:x=>Je(y,x);if(c!=null&&c!==u&&(vt(c)?(f[c]=null,_(c)&&(g[c]=null)):Gt(c)&&(c.value=null)),$e(u))uo(u,o,12,[a,f]);else{const x=vt(u),b=Gt(u);if(x||b){const A=()=>{if(t.f){const L=x?_(u)?g[u]:f[u]:u.value;s?Fe(L)&&Oh(L,r):Fe(L)?L.includes(r)||L.push(r):x?(f[u]=[r],_(u)&&(g[u]=f[u])):(u.value=[r],t.k&&(f[t.k]=u.value))}else x?(f[u]=a,_(u)&&(g[u]=a)):b&&(u.value=a,t.k&&(f[t.k]=a))};a?(A.id=-1,ti(A,i)):A()}}}yu().requestIdleCallback;yu().cancelIdleCallback;const pr=t=>!!t.type.__asyncLoader,xu=t=>t.type.__isKeepAlive;function Oy(t,e){Ly(t,"a",e)}function Su(t,e){Ly(t,"da",e)}function Ly(t,e,i=Ut){const n=t.__wdc||(t.__wdc=()=>{let s=i;for(;s;){if(s.isDeactivated)return;s=s.parent}return t()});if(Eu(e,n,i),i){let s=i.parent;for(;s&&s.parent;)xu(s.parent.vnode)&&eS(n,e,i,s),s=s.parent}}function eS(t,e,i,n){const s=Eu(e,t,n,!0);Wh(()=>{Oh(n[e],s)},i)}function Eu(t,e,i=Ut,n=!1){if(i){const s=i[t]||(i[t]=[]),r=e.__weh||(e.__weh=(...a)=>{ls();const o=ho(i),u=Gi(e,i,t,a);return o(),us(),u});return n?s.unshift(r):s.push(r),r}}const Rn=t=>(e,i=Ut)=>{(!Ja||t==="sp")&&Eu(t,(...n)=>e(...n),i)},tS=Rn("bm"),Mn=Rn("m"),Ry=Rn("bu"),My=Rn("u"),bi=Rn("bum"),Wh=Rn("um"),iS=Rn("sp"),nS=Rn("rtg"),sS=Rn("rtc");function rS(t,e=Ut){Eu("ec",t,e)}const aS="components";function oS(t,e){return uS(aS,t,!0,e)||t}const lS=Symbol.for("v-ndc");function uS(t,e,i=!0,n=!1){const s=Rt||Ut;if(s){const r=s.type;{const o=JS(r,!1);if(o&&(o===e||o===Oi(e)||o===mu(Oi(e))))return r}const a=Fp(s[t]||r[t],e)||Fp(s.appContext[t],e);return!a&&n?r:a}}function Fp(t,e){return t&&(t[e]||t[Oi(e)]||t[mu(Oi(e))])}function uR(t,e,i,n){let s;const r=i,a=Fe(t);if(a||vt(t)){const o=a&&hr(t);let u=!1;o&&(u=!ki(t),t=_u(t)),s=new Array(t.length);for(let c=0,f=t.length;ce(o,u,void 0,r));else{const o=Object.keys(t);s=new Array(o.length);for(let u=0,c=o.length;uQa(e)?!(e.type===zt||e.type===ni&&!Ny(e.children)):!0)?t:null}const Md=t=>t?t_(t)?wu(t):Md(t.parent):null,Ra=St(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>Md(t.parent),$root:t=>Md(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>Gh(t),$forceUpdate:t=>t.f||(t.f=()=>{Vh(t.update)}),$nextTick:t=>t.n||(t.n=gi.bind(t.proxy)),$watch:t=>PS.bind(t)}),Cc=(t,e)=>t!==st&&!t.__isScriptSetup&&Je(t,e),cS={get({_:t},e){if(e==="__v_skip")return!0;const{ctx:i,setupState:n,data:s,props:r,accessCache:a,type:o,appContext:u}=t;let c;if(e[0]!=="$"){const _=a[e];if(_!==void 0)switch(_){case 1:return n[e];case 2:return s[e];case 4:return i[e];case 3:return r[e]}else{if(Cc(n,e))return a[e]=1,n[e];if(s!==st&&Je(s,e))return a[e]=2,s[e];if((c=t.propsOptions[0])&&Je(c,e))return a[e]=3,r[e];if(i!==st&&Je(i,e))return a[e]=4,i[e];Nd&&(a[e]=0)}}const f=Ra[e];let g,y;if(f)return e==="$attrs"&&Vt(t.attrs,"get",""),f(t);if((g=o.__cssModules)&&(g=g[e]))return g;if(i!==st&&Je(i,e))return a[e]=4,i[e];if(y=u.config.globalProperties,Je(y,e))return y[e]},set({_:t},e,i){const{data:n,setupState:s,ctx:r}=t;return Cc(s,e)?(s[e]=i,!0):n!==st&&Je(n,e)?(n[e]=i,!0):Je(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(r[e]=i,!0)},has({_:{data:t,setupState:e,accessCache:i,ctx:n,appContext:s,propsOptions:r}},a){let o;return!!i[a]||t!==st&&Je(t,a)||Cc(e,a)||(o=r[0])&&Je(o,a)||Je(n,a)||Je(Ra,a)||Je(s.config.globalProperties,a)},defineProperty(t,e,i){return i.get!=null?t._.accessCache[e]=0:Je(i,"value")&&this.set(t,e,i.value,null),Reflect.defineProperty(t,e,i)}};function Up(t){return Fe(t)?t.reduce((e,i)=>(e[i]=null,e),{}):t}let Nd=!0;function dS(t){const e=Gh(t),i=t.proxy,n=t.ctx;Nd=!1,e.beforeCreate&&qp(e.beforeCreate,t,"bc");const{data:s,computed:r,methods:a,watch:o,provide:u,inject:c,created:f,beforeMount:g,mounted:y,beforeUpdate:_,updated:x,activated:b,deactivated:A,beforeDestroy:L,beforeUnmount:C,destroyed:w,unmounted:R,render:O,renderTracked:U,renderTriggered:H,errorCaptured:X,serverPrefetch:T,expose:S,inheritAttrs:B,components:k,directives:V,filters:F}=e;if(c&&hS(c,n,null),a)for(const G in a){const W=a[G];$e(W)&&(n[G]=W.bind(i))}if(s){const G=s.call(i,i);ct(G)&&(t.data=Fr(G))}if(Nd=!0,r)for(const G in r){const W=r[G],Q=$e(W)?W.bind(i,i):$e(W.get)?W.get.bind(i,i):hn,se=!$e(W)&&$e(W.set)?W.set.bind(i):hn,re=oe({get:Q,set:se});Object.defineProperty(n,G,{enumerable:!0,configurable:!0,get:()=>re.value,set:ne=>re.value=ne})}if(o)for(const G in o)By(o[G],n,i,G);if(u){const G=$e(u)?u.call(i):u;Reflect.ownKeys(G).forEach(W=>{gl(W,G[W])})}f&&qp(f,t,"c");function Z(G,W){Fe(W)?W.forEach(Q=>G(Q.bind(i))):W&&G(W.bind(i))}if(Z(tS,g),Z(Mn,y),Z(Ry,_),Z(My,x),Z(Oy,b),Z(Su,A),Z(rS,X),Z(sS,U),Z(nS,H),Z(bi,C),Z(Wh,R),Z(iS,T),Fe(S))if(S.length){const G=t.exposed||(t.exposed={});S.forEach(W=>{Object.defineProperty(G,W,{get:()=>i[W],set:Q=>i[W]=Q})})}else t.exposed||(t.exposed={});O&&t.render===hn&&(t.render=O),B!=null&&(t.inheritAttrs=B),k&&(t.components=k),V&&(t.directives=V),T&&Py(t)}function hS(t,e,i=hn){Fe(t)&&(t=Bd(t));for(const n in t){const s=t[n];let r;ct(s)?"default"in s?r=Ii(s.from||n,s.default,!0):r=Ii(s.from||n):r=Ii(s),Gt(r)?Object.defineProperty(e,n,{enumerable:!0,configurable:!0,get:()=>r.value,set:a=>r.value=a}):e[n]=r}}function qp(t,e,i){Gi(Fe(t)?t.map(n=>n.bind(e.proxy)):t.bind(e.proxy),e,i)}function By(t,e,i,n){let s=n.includes(".")?Xy(i,n):()=>i[n];if(vt(t)){const r=e[t];$e(r)&&tt(s,r)}else if($e(t))tt(s,t.bind(i));else if(ct(t))if(Fe(t))t.forEach(r=>By(r,e,i,n));else{const r=$e(t.handler)?t.handler.bind(i):e[t.handler];$e(r)&&tt(s,r,t)}}function Gh(t){const e=t.type,{mixins:i,extends:n}=e,{mixins:s,optionsCache:r,config:{optionMergeStrategies:a}}=t.appContext,o=r.get(e);let u;return o?u=o:!s.length&&!i&&!n?u=e:(u={},s.length&&s.forEach(c=>Ol(u,c,a,!0)),Ol(u,e,a)),ct(e)&&r.set(e,u),u}function Ol(t,e,i,n=!1){const{mixins:s,extends:r}=e;r&&Ol(t,r,i,!0),s&&s.forEach(a=>Ol(t,a,i,!0));for(const a in e)if(!(n&&a==="expose")){const o=fS[a]||i&&i[a];t[a]=o?o(t[a],e[a]):e[a]}return t}const fS={data:$p,props:jp,emits:jp,methods:Ca,computed:Ca,beforeCreate:ei,created:ei,beforeMount:ei,mounted:ei,beforeUpdate:ei,updated:ei,beforeDestroy:ei,beforeUnmount:ei,destroyed:ei,unmounted:ei,activated:ei,deactivated:ei,errorCaptured:ei,serverPrefetch:ei,components:Ca,directives:Ca,watch:gS,provide:$p,inject:pS};function $p(t,e){return e?t?function(){return St($e(t)?t.call(this,this):t,$e(e)?e.call(this,this):e)}:e:t}function pS(t,e){return Ca(Bd(t),Bd(e))}function Bd(t){if(Fe(t)){const e={};for(let i=0;i1)return i&&$e(e)?e.call(n&&n.proxy):e}}const Uy={},qy=()=>Object.create(Uy),$y=t=>Object.getPrototypeOf(t)===Uy;function _S(t,e,i,n=!1){const s={},r=qy();t.propsDefaults=Object.create(null),jy(t,e,s,r);for(const a in t.propsOptions[0])a in s||(s[a]=void 0);i?t.props=n?s:dy(s):t.type.props?t.props=s:t.props=r,t.attrs=r}function vS(t,e,i,n){const{props:s,attrs:r,vnode:{patchFlag:a}}=t,o=Ve(s),[u]=t.propsOptions;let c=!1;if((n||a>0)&&!(a&16)){if(a&8){const f=t.vnode.dynamicProps;for(let g=0;g{u=!0;const[y,_]=Vy(g,e,!0);St(a,y),_&&o.push(..._)};!i&&e.mixins.length&&e.mixins.forEach(f),t.extends&&f(t.extends),t.mixins&&t.mixins.forEach(f)}if(!r&&!u)return ct(t)&&n.set(t,ur),ur;if(Fe(r))for(let f=0;ft[0]==="_"||t==="$stable",Kh=t=>Fe(t)?t.map(rn):[rn(t)],TS=(t,e,i)=>{if(e._n)return e;const n=Xx((...s)=>Kh(e(...s)),i);return n._c=!1,n},zy=(t,e,i)=>{const n=t._ctx;for(const s in t){if(Hy(s))continue;const r=t[s];if($e(r))e[s]=TS(s,r,n);else if(r!=null){const a=Kh(r);e[s]=()=>a}}},Wy=(t,e)=>{const i=Kh(e);t.slots.default=()=>i},Gy=(t,e,i)=>{for(const n in e)(i||n!=="_")&&(t[n]=e[n])},xS=(t,e,i)=>{const n=t.slots=qy();if(t.vnode.shapeFlag&32){const s=e._;s?(Gy(n,e,i),i&&Al(n,"_",s,!0)):zy(e,n)}else e&&Wy(t,e)},SS=(t,e,i)=>{const{vnode:n,slots:s}=t;let r=!0,a=st;if(n.shapeFlag&32){const o=e._;o?i&&o===1?r=!1:Gy(s,e,i):(r=!e.$stable,zy(e,s)),a=e}else e&&(Wy(t,e),a={default:1});if(r)for(const o in s)!Hy(o)&&a[o]==null&&delete s[o]},ti=FS;function ES(t){return CS(t)}function CS(t,e){const i=yu();i.__VUE__=!0,_y(i.__VUE_DEVTOOLS_GLOBAL_HOOK__,i);const{insert:n,remove:s,patchProp:r,createElement:a,createText:o,createComment:u,setText:c,setElementText:f,parentNode:g,nextSibling:y,setScopeId:_=hn,insertStaticContent:x}=t,b=(M,j,ee,he=null,ce=null,me=null,be=void 0,fe=null,pe=!!j.dynamicChildren)=>{if(M===j)return;M&&!Cs(M,j)&&(he=te(M),ne(M,ce,me,!0),M=null),j.patchFlag===-2&&(pe=!1,j.dynamicChildren=null);const{type:ge,ref:Pe,shapeFlag:Ee}=j;switch(ge){case co:A(M,j,ee,he);break;case zt:L(M,j,ee,he);break;case ml:M==null&&C(j,ee,he,be);break;case ni:k(M,j,ee,he,ce,me,be,fe,pe);break;default:Ee&1?O(M,j,ee,he,ce,me,be,fe,pe):Ee&6?V(M,j,ee,he,ce,me,be,fe,pe):(Ee&64||Ee&128)&&ge.process(M,j,ee,he,ce,me,be,fe,pe,we)}Pe!=null&&ce&&Pl(Pe,M&&M.ref,me,j||M,!j)},A=(M,j,ee,he)=>{if(M==null)n(j.el=o(j.children),ee,he);else{const ce=j.el=M.el;j.children!==M.children&&c(ce,j.children)}},L=(M,j,ee,he)=>{M==null?n(j.el=u(j.children||""),ee,he):j.el=M.el},C=(M,j,ee,he)=>{[M.el,M.anchor]=x(M.children,j,ee,he,M.el,M.anchor)},w=({el:M,anchor:j},ee,he)=>{let ce;for(;M&&M!==j;)ce=y(M),n(M,ee,he),M=ce;n(j,ee,he)},R=({el:M,anchor:j})=>{let ee;for(;M&&M!==j;)ee=y(M),s(M),M=ee;s(j)},O=(M,j,ee,he,ce,me,be,fe,pe)=>{j.type==="svg"?be="svg":j.type==="math"&&(be="mathml"),M==null?U(j,ee,he,ce,me,be,fe,pe):T(M,j,ce,me,be,fe,pe)},U=(M,j,ee,he,ce,me,be,fe)=>{let pe,ge;const{props:Pe,shapeFlag:Ee,transition:ke,dirs:Le}=M;if(pe=M.el=a(M.type,me,Pe&&Pe.is,Pe),Ee&8?f(pe,M.children):Ee&16&&X(M.children,pe,null,he,ce,wc(M,me),be,fe),Le&&ys(M,null,he,"created"),H(pe,M,M.scopeId,be,he),Pe){for(const Xe in Pe)Xe!=="value"&&!Ia(Xe)&&r(pe,Xe,null,Pe[Xe],me,he);"value"in Pe&&r(pe,"value",null,Pe.value,me),(ge=Pe.onVnodeBeforeMount)&&Zi(ge,he,M)}Al(pe,"__vnode",M,!0),Al(pe,"__vueParentComponent",he,!0),Le&&ys(M,null,he,"beforeMount");const qe=wS(ce,ke);qe&&ke.beforeEnter(pe),n(pe,j,ee),((ge=Pe&&Pe.onVnodeMounted)||qe||Le)&&ti(()=>{ge&&Zi(ge,he,M),qe&&ke.enter(pe),Le&&ys(M,null,he,"mounted")},ce)},H=(M,j,ee,he,ce)=>{if(ee&&_(M,ee),he)for(let me=0;me{for(let ge=pe;ge{const fe=j.el=M.el;fe.__vnode=j;let{patchFlag:pe,dynamicChildren:ge,dirs:Pe}=j;pe|=M.patchFlag&16;const Ee=M.props||st,ke=j.props||st;let Le;if(ee&&_s(ee,!1),(Le=ke.onVnodeBeforeUpdate)&&Zi(Le,ee,j,M),Pe&&ys(j,M,ee,"beforeUpdate"),ee&&_s(ee,!0),(Ee.innerHTML&&ke.innerHTML==null||Ee.textContent&&ke.textContent==null)&&f(fe,""),ge?S(M.dynamicChildren,ge,fe,ee,he,wc(j,ce),me):be||W(M,j,fe,null,ee,he,wc(j,ce),me,!1),pe>0){if(pe&16)B(fe,Ee,ke,ee,ce);else if(pe&2&&Ee.class!==ke.class&&r(fe,"class",null,ke.class,ce),pe&4&&r(fe,"style",Ee.style,ke.style,ce),pe&8){const qe=j.dynamicProps;for(let Xe=0;Xe{Le&&Zi(Le,ee,j,M),Pe&&ys(j,M,ee,"updated")},he)},S=(M,j,ee,he,ce,me,be)=>{for(let fe=0;fe{if(j!==ee){if(j!==st)for(const me in j)!Ia(me)&&!(me in ee)&&r(M,me,j[me],null,ce,he);for(const me in ee){if(Ia(me))continue;const be=ee[me],fe=j[me];be!==fe&&me!=="value"&&r(M,me,fe,be,ce,he)}"value"in ee&&r(M,"value",j.value,ee.value,ce)}},k=(M,j,ee,he,ce,me,be,fe,pe)=>{const ge=j.el=M?M.el:o(""),Pe=j.anchor=M?M.anchor:o("");let{patchFlag:Ee,dynamicChildren:ke,slotScopeIds:Le}=j;Le&&(fe=fe?fe.concat(Le):Le),M==null?(n(ge,ee,he),n(Pe,ee,he),X(j.children||[],ee,Pe,ce,me,be,fe,pe)):Ee>0&&Ee&64&&ke&&M.dynamicChildren?(S(M.dynamicChildren,ke,ee,ce,me,be,fe),(j.key!=null||ce&&j===ce.subTree)&&Xh(M,j,!0)):W(M,j,ee,Pe,ce,me,be,fe,pe)},V=(M,j,ee,he,ce,me,be,fe,pe)=>{j.slotScopeIds=fe,M==null?j.shapeFlag&512?ce.ctx.activate(j,ee,he,be,pe):F(j,ee,he,ce,me,be,pe):Y(M,j,pe)},F=(M,j,ee,he,ce,me,be)=>{const fe=M.component=GS(M,he,ce);if(xu(M)&&(fe.ctx.renderer=we),KS(fe,!1,be),fe.asyncDep){if(ce&&ce.registerDep(fe,Z,be),!M.el){const pe=fe.subTree=Wt(zt);L(null,pe,j,ee)}}else Z(fe,M,j,ee,ce,me,be)},Y=(M,j,ee)=>{const he=j.component=M.component;if(NS(M,j,ee))if(he.asyncDep&&!he.asyncResolved){G(he,j,ee);return}else he.next=j,he.update();else j.el=M.el,he.vnode=j},Z=(M,j,ee,he,ce,me,be)=>{const fe=()=>{if(M.isMounted){let{next:Ee,bu:ke,u:Le,parent:qe,vnode:Xe}=M;{const It=Ky(M);if(It){Ee&&(Ee.el=Xe.el,G(M,Ee,be)),It.asyncDep.then(()=>{M.isUnmounted||fe()});return}}let Ke=Ee,Et;_s(M,!1),Ee?(Ee.el=Xe.el,G(M,Ee,be)):Ee=Xe,ke&&vc(ke),(Et=Ee.props&&Ee.props.onVnodeBeforeUpdate)&&Zi(Et,qe,Ee,Xe),_s(M,!0);const dt=Ac(M),He=M.subTree;M.subTree=dt,b(He,dt,g(He.el),te(He),M,ce,me),Ee.el=dt.el,Ke===null&&BS(M,dt.el),Le&&ti(Le,ce),(Et=Ee.props&&Ee.props.onVnodeUpdated)&&ti(()=>Zi(Et,qe,Ee,Xe),ce),vy(M)}else{let Ee;const{el:ke,props:Le}=j,{bm:qe,m:Xe,parent:Ke,root:Et,type:dt}=M,He=pr(j);if(_s(M,!1),qe&&vc(qe),!He&&(Ee=Le&&Le.onVnodeBeforeMount)&&Zi(Ee,Ke,j),_s(M,!0),ke&&ze){const It=()=>{M.subTree=Ac(M),ze(ke,M.subTree,M,ce,null)};He&&dt.__asyncHydrate?dt.__asyncHydrate(ke,M,It):It()}else{Et.ce&&Et.ce._injectChildStyle(dt);const It=M.subTree=Ac(M);b(null,It,ee,he,M,ce,me),j.el=It.el}if(Xe&&ti(Xe,ce),!He&&(Ee=Le&&Le.onVnodeMounted)){const It=j;ti(()=>Zi(Ee,Ke,It),ce)}(j.shapeFlag&256||Ke&&pr(Ke.vnode)&&Ke.vnode.shapeFlag&256)&&M.a&&ti(M.a,ce),M.isMounted=!0,zx(M),j=ee=he=null}};M.scope.on();const pe=M.effect=new Q0(fe);M.scope.off();const ge=M.update=pe.run.bind(pe),Pe=M.job=pe.runIfDirty.bind(pe);Pe.i=M,Pe.id=M.uid,pe.scheduler=()=>Vh(Pe),_s(M,!0),ge()},G=(M,j,ee)=>{j.component=M;const he=M.vnode.props;M.vnode=j,M.next=null,vS(M,j.props,he,ee),SS(M,j.children,ee),ls(),Lp(M),us()},W=(M,j,ee,he,ce,me,be,fe,pe=!1)=>{const ge=M&&M.children,Pe=M?M.shapeFlag:0,Ee=j.children,{patchFlag:ke,shapeFlag:Le}=j;if(ke>0){if(ke&128){se(ge,Ee,ee,he,ce,me,be,fe,pe);return}else if(ke&256){Q(ge,Ee,ee,he,ce,me,be,fe,pe);return}}Le&8?(Pe&16&&Se(ge,ce,me),Ee!==ge&&f(ee,Ee)):Pe&16?Le&16?se(ge,Ee,ee,he,ce,me,be,fe,pe):Se(ge,ce,me,!0):(Pe&8&&f(ee,""),Le&16&&X(Ee,ee,he,ce,me,be,fe,pe))},Q=(M,j,ee,he,ce,me,be,fe,pe)=>{M=M||ur,j=j||ur;const ge=M.length,Pe=j.length,Ee=Math.min(ge,Pe);let ke;for(ke=0;kePe?Se(M,ce,me,!0,!1,Ee):X(j,ee,he,ce,me,be,fe,pe,Ee)},se=(M,j,ee,he,ce,me,be,fe,pe)=>{let ge=0;const Pe=j.length;let Ee=M.length-1,ke=Pe-1;for(;ge<=Ee&&ge<=ke;){const Le=M[ge],qe=j[ge]=pe?Xn(j[ge]):rn(j[ge]);if(Cs(Le,qe))b(Le,qe,ee,null,ce,me,be,fe,pe);else break;ge++}for(;ge<=Ee&&ge<=ke;){const Le=M[Ee],qe=j[ke]=pe?Xn(j[ke]):rn(j[ke]);if(Cs(Le,qe))b(Le,qe,ee,null,ce,me,be,fe,pe);else break;Ee--,ke--}if(ge>Ee){if(ge<=ke){const Le=ke+1,qe=Leke)for(;ge<=Ee;)ne(M[ge],ce,me,!0),ge++;else{const Le=ge,qe=ge,Xe=new Map;for(ge=qe;ge<=ke;ge++){const At=j[ge]=pe?Xn(j[ge]):rn(j[ge]);At.key!=null&&Xe.set(At.key,ge)}let Ke,Et=0;const dt=ke-qe+1;let He=!1,It=0;const ci=new Array(dt);for(ge=0;ge=dt){ne(At,ce,me,!0);continue}let Dt;if(At.key!=null)Dt=Xe.get(At.key);else for(Ke=qe;Ke<=ke;Ke++)if(ci[Ke-qe]===0&&Cs(At,j[Ke])){Dt=Ke;break}Dt===void 0?ne(At,ce,me,!0):(ci[Dt-qe]=ge+1,Dt>=It?It=Dt:He=!0,b(At,j[Dt],ee,null,ce,me,be,fe,pe),Et++)}const ds=He?AS(ci):ur;for(Ke=ds.length-1,ge=dt-1;ge>=0;ge--){const At=qe+ge,Dt=j[At],hs=At+1{const{el:me,type:be,transition:fe,children:pe,shapeFlag:ge}=M;if(ge&6){re(M.component.subTree,j,ee,he);return}if(ge&128){M.suspense.move(j,ee,he);return}if(ge&64){be.move(M,j,ee,we);return}if(be===ni){n(me,j,ee);for(let Ee=0;Eefe.enter(me),ce);else{const{leave:Ee,delayLeave:ke,afterLeave:Le}=fe,qe=()=>n(me,j,ee),Xe=()=>{Ee(me,()=>{qe(),Le&&Le()})};ke?ke(me,qe,Xe):Xe()}else n(me,j,ee)},ne=(M,j,ee,he=!1,ce=!1)=>{const{type:me,props:be,ref:fe,children:pe,dynamicChildren:ge,shapeFlag:Pe,patchFlag:Ee,dirs:ke,cacheIndex:Le}=M;if(Ee===-2&&(ce=!1),fe!=null&&Pl(fe,null,ee,M,!0),Le!=null&&(j.renderCache[Le]=void 0),Pe&256){j.ctx.deactivate(M);return}const qe=Pe&1&&ke,Xe=!pr(M);let Ke;if(Xe&&(Ke=be&&be.onVnodeBeforeUnmount)&&Zi(Ke,j,M),Pe&6)De(M.component,ee,he);else{if(Pe&128){M.suspense.unmount(ee,he);return}qe&&ys(M,null,j,"beforeUnmount"),Pe&64?M.type.remove(M,j,ee,we,he):ge&&!ge.hasOnce&&(me!==ni||Ee>0&&Ee&64)?Se(ge,j,ee,!1,!0):(me===ni&&Ee&384||!ce&&Pe&16)&&Se(pe,j,ee),he&&Ce(M)}(Xe&&(Ke=be&&be.onVnodeUnmounted)||qe)&&ti(()=>{Ke&&Zi(Ke,j,M),qe&&ys(M,null,j,"unmounted")},ee)},Ce=M=>{const{type:j,el:ee,anchor:he,transition:ce}=M;if(j===ni){Ie(ee,he);return}if(j===ml){R(M);return}const me=()=>{s(ee),ce&&!ce.persisted&&ce.afterLeave&&ce.afterLeave()};if(M.shapeFlag&1&&ce&&!ce.persisted){const{leave:be,delayLeave:fe}=ce,pe=()=>be(ee,me);fe?fe(M.el,me,pe):pe()}else me()},Ie=(M,j)=>{let ee;for(;M!==j;)ee=y(M),s(M),M=ee;s(j)},De=(M,j,ee)=>{const{bum:he,scope:ce,job:me,subTree:be,um:fe,m:pe,a:ge}=M;Hp(pe),Hp(ge),he&&vc(he),ce.stop(),me&&(me.flags|=8,ne(be,M,j,ee)),fe&&ti(fe,j),ti(()=>{M.isUnmounted=!0},j),j&&j.pendingBranch&&!j.isUnmounted&&M.asyncDep&&!M.asyncResolved&&M.suspenseId===j.pendingId&&(j.deps--,j.deps===0&&j.resolve()),Gx(M)},Se=(M,j,ee,he=!1,ce=!1,me=0)=>{for(let be=me;be{if(M.shapeFlag&6)return te(M.component.subTree);if(M.shapeFlag&128)return M.suspense.next();const j=y(M.anchor||M.el),ee=j&&j[xy];return ee?y(ee):j};let ye=!1;const ve=(M,j,ee)=>{M==null?j._vnode&&ne(j._vnode,null,null,!0):b(j._vnode||null,M,j,null,null,null,ee),j._vnode=M,ye||(ye=!0,Lp(),my(),ye=!1)},we={p:b,um:ne,m:re,r:Ce,mt:F,mc:X,pc:W,pbc:S,n:te,o:t};let Be,ze;return{render:ve,hydrate:Be,createApp:yS(ve,Be)}}function wc({type:t,props:e},i){return i==="svg"&&t==="foreignObject"||i==="mathml"&&t==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:i}function _s({effect:t,job:e},i){i?(t.flags|=32,e.flags|=4):(t.flags&=-33,e.flags&=-5)}function wS(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}function Xh(t,e,i=!1){const n=t.children,s=e.children;if(Fe(n)&&Fe(s))for(let r=0;r>1,t[i[o]]0&&(e[n]=i[r-1]),i[r]=n)}}for(r=i.length,a=i[r-1];r-- >0;)i[r]=a,a=e[a];return i}function Ky(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:Ky(e)}function Hp(t){if(t)for(let e=0;eIi(DS);function IS(t,e){return Yh(t,null,e)}function tt(t,e,i){return Yh(t,e,i)}function Yh(t,e,i=st){const{immediate:n,deep:s,flush:r,once:a}=i,o=St({},i),u=e&&n||!e&&r!=="post";let c;if(Ja){if(r==="sync"){const _=kS();c=_.__watcherHandles||(_.__watcherHandles=[])}else if(!u){const _=()=>{};return _.stop=hn,_.resume=hn,_.pause=hn,_}}const f=Ut;o.call=(_,x,b)=>Gi(_,f,x,b);let g=!1;r==="post"?o.scheduler=_=>{ti(_,f&&f.suspense)}:r!=="sync"&&(g=!0,o.scheduler=(_,x)=>{x?_():Vh(_)}),o.augmentJob=_=>{e&&(_.flags|=4),g&&(_.flags|=2,f&&(_.id=f.uid,_.i=f))};const y=Ux(t,e,o);return Ja&&(c?c.push(y):u&&y()),y}function PS(t,e,i){const n=this.proxy,s=vt(t)?t.includes(".")?Xy(n,t):()=>n[t]:t.bind(n,n);let r;$e(e)?r=e:(r=e.handler,i=e);const a=ho(this),o=Yh(s,r.bind(n),i);return a(),o}function Xy(t,e){const i=e.split(".");return()=>{let n=t;for(let s=0;se==="modelValue"||e==="model-value"?t.modelModifiers:t[`${e}Modifiers`]||t[`${Oi(e)}Modifiers`]||t[`${js(e)}Modifiers`];function LS(t,e,...i){if(t.isUnmounted)return;const n=t.vnode.props||st;let s=i;const r=e.startsWith("update:"),a=r&&OS(n,e.slice(7));a&&(a.trim&&(s=i.map(f=>vt(f)?f.trim():f)),a.number&&(s=i.map(ax))),Kx(t,e,s);let o,u=n[o=_c(e)]||n[o=_c(Oi(e))];!u&&r&&(u=n[o=_c(js(e))]),u&&Gi(u,t,6,s);const c=n[o+"Once"];if(c){if(!t.emitted)t.emitted={};else if(t.emitted[o])return;t.emitted[o]=!0,Gi(c,t,6,s)}}function Yy(t,e,i=!1){const n=e.emitsCache,s=n.get(t);if(s!==void 0)return s;const r=t.emits;let a={},o=!1;if(!$e(t)){const u=c=>{const f=Yy(c,e,!0);f&&(o=!0,St(a,f))};!i&&e.mixins.length&&e.mixins.forEach(u),t.extends&&u(t.extends),t.mixins&&t.mixins.forEach(u)}return!r&&!o?(ct(t)&&n.set(t,null),null):(Fe(r)?r.forEach(u=>a[u]=null):St(a,r),ct(t)&&n.set(t,a),a)}function Cu(t,e){return!t||!fu(e)?!1:(e=e.slice(2).replace(/Once$/,""),Je(t,e[0].toLowerCase()+e.slice(1))||Je(t,js(e))||Je(t,e))}function Ac(t){const{type:e,vnode:i,proxy:n,withProxy:s,propsOptions:[r],slots:a,attrs:o,emit:u,render:c,renderCache:f,props:g,data:y,setupState:_,ctx:x,inheritAttrs:b}=t,A=Il(t);let L,C;try{if(i.shapeFlag&4){const R=s||n,O=R;L=rn(c.call(O,R,f,g,_,y,x)),C=o}else{const R=e;L=rn(R.length>1?R(g,{attrs:o,slots:a,emit:u}):R(g,null)),C=e.props?o:RS(o)}}catch(R){Ma.length=0,vu(R,t,1),L=Wt(zt)}let w=L;if(C&&b!==!1){const R=Object.keys(C),{shapeFlag:O}=w;R.length&&O&7&&(r&&R.some(Ph)&&(C=MS(C,r)),w=ns(w,C,!1,!0))}return i.dirs&&(w=ns(w,null,!1,!0),w.dirs=w.dirs?w.dirs.concat(i.dirs):i.dirs),i.transition&&qs(w,i.transition),L=w,Il(A),L}const RS=t=>{let e;for(const i in t)(i==="class"||i==="style"||fu(i))&&((e||(e={}))[i]=t[i]);return e},MS=(t,e)=>{const i={};for(const n in t)(!Ph(n)||!(n.slice(9)in e))&&(i[n]=t[n]);return i};function NS(t,e,i){const{props:n,children:s,component:r}=t,{props:a,children:o,patchFlag:u}=e,c=r.emitsOptions;if(e.dirs||e.transition)return!0;if(i&&u>=0){if(u&1024)return!0;if(u&16)return n?zp(n,a,c):!!a;if(u&8){const f=e.dynamicProps;for(let g=0;gt.__isSuspense;function FS(t,e){e&&e.pendingBranch?Fe(t)?e.effects.push(...t):e.effects.push(t):jx(t)}const ni=Symbol.for("v-fgt"),co=Symbol.for("v-txt"),zt=Symbol.for("v-cmt"),ml=Symbol.for("v-stc"),Ma=[];let mi=null;function Ll(t=!1){Ma.push(mi=t?null:[])}function US(){Ma.pop(),mi=Ma[Ma.length-1]||null}let Ya=1;function Wp(t,e=!1){Ya+=t,t<0&&mi&&e&&(mi.hasOnce=!0)}function Jy(t){return t.dynamicChildren=Ya>0?mi||ur:null,US(),Ya>0&&mi&&mi.push(t),t}function qS(t,e,i,n,s,r){return Jy(e_(t,e,i,n,s,r,!0))}function Ud(t,e,i,n,s){return Jy(Wt(t,e,i,n,s,!0))}function Qa(t){return t?t.__v_isVNode===!0:!1}function Cs(t,e){return t.type===e.type&&t.key===e.key}const Zy=({key:t})=>t??null,yl=({ref:t,ref_key:e,ref_for:i})=>(typeof t=="number"&&(t=""+t),t!=null?vt(t)||Gt(t)||$e(t)?{i:Rt,r:t,k:e,f:!!i}:t:null);function e_(t,e=null,i=null,n=0,s=null,r=t===ni?0:1,a=!1,o=!1){const u={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&Zy(e),ref:e&&yl(e),scopeId:by,slotScopeIds:null,children:i,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:n,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:Rt};return o?(Qh(u,i),r&128&&t.normalize(u)):i&&(u.shapeFlag|=vt(i)?8:16),Ya>0&&!a&&mi&&(u.patchFlag>0||r&6)&&u.patchFlag!==32&&mi.push(u),u}const Wt=$S;function $S(t,e=null,i=null,n=0,s=null,r=!1){if((!t||t===lS)&&(t=zt),Qa(t)){const o=ns(t,e,!0);return i&&Qh(o,i),Ya>0&&!r&&mi&&(o.shapeFlag&6?mi[mi.indexOf(t)]=o:mi.push(o)),o.patchFlag=-2,o}if(ZS(t)&&(t=t.__vccOpts),e){e=jS(e);let{class:o,style:u}=e;o&&!vt(o)&&(e.class=dr(o)),ct(u)&&(jh(u)&&!Fe(u)&&(u=St({},u)),e.style=Rh(u))}const a=vt(t)?1:Qy(t)?128:Sy(t)?64:ct(t)?4:$e(t)?2:0;return e_(t,e,i,n,s,a,r,!0)}function jS(t){return t?jh(t)||$y(t)?St({},t):t:null}function ns(t,e,i=!1,n=!1){const{props:s,ref:r,patchFlag:a,children:o,transition:u}=t,c=e?HS(s||{},e):s,f={__v_isVNode:!0,__v_skip:!0,type:t.type,props:c,key:c&&Zy(c),ref:e&&e.ref?i&&r?Fe(r)?r.concat(yl(e)):[r,yl(e)]:yl(e):r,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:o,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==ni?a===-1?16:a|16:a,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:u,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&ns(t.ssContent),ssFallback:t.ssFallback&&ns(t.ssFallback),el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return u&&n&&qs(f,u.clone(f)),f}function VS(t=" ",e=0){return Wt(co,null,t,e)}function dR(t="",e=!1){return e?(Ll(),Ud(zt,null,t)):Wt(zt,null,t)}function rn(t){return t==null||typeof t=="boolean"?Wt(zt):Fe(t)?Wt(ni,null,t.slice()):Qa(t)?Xn(t):Wt(co,null,String(t))}function Xn(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:ns(t)}function Qh(t,e){let i=0;const{shapeFlag:n}=t;if(e==null)e=null;else if(Fe(e))i=16;else if(typeof e=="object")if(n&65){const s=e.default;s&&(s._c&&(s._d=!1),Qh(t,s()),s._c&&(s._d=!0));return}else{i=32;const s=e._;!s&&!$y(e)?e._ctx=Rt:s===3&&Rt&&(Rt.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else $e(e)?(e={default:e,_ctx:Rt},i=32):(e=String(e),n&64?(i=16,e=[VS(e)]):i=8);t.children=e,t.shapeFlag|=i}function HS(...t){const e={};for(let i=0;iUt||Rt;let Rl,qd;{const t=yu(),e=(i,n)=>{let s;return(s=t[i])||(s=t[i]=[]),s.push(n),r=>{s.length>1?s.forEach(a=>a(r)):s[0](r)}};Rl=e("__VUE_INSTANCE_SETTERS__",i=>Ut=i),qd=e("__VUE_SSR_SETTERS__",i=>Ja=i)}const ho=t=>{const e=Ut;return Rl(t),t.scope.on(),()=>{t.scope.off(),Rl(e)}},Gp=()=>{Ut&&Ut.scope.off(),Rl(null)};function t_(t){return t.vnode.shapeFlag&4}let Ja=!1;function KS(t,e=!1,i=!1){e&&qd(e);const{props:n,children:s}=t.vnode,r=t_(t);_S(t,n,r,e),xS(t,s,i);const a=r?XS(t,e):void 0;return e&&qd(!1),a}function XS(t,e){const i=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,cS);const{setup:n}=i;if(n){ls();const s=t.setupContext=n.length>1?QS(t):null,r=ho(t),a=uo(n,t,0,[t.props,s]),o=H0(a);if(us(),r(),(o||t.sp)&&!pr(t)&&Py(t),o){if(a.then(Gp,Gp),e)return a.then(u=>{Kp(t,u,e)}).catch(u=>{vu(u,t,0)});t.asyncDep=a}else Kp(t,a,e)}else i_(t,e)}function Kp(t,e,i){$e(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:ct(e)&&(t.devtoolsRawSetupState=e,t.setupState=fy(e)),i_(t,i)}let Xp;function i_(t,e,i){const n=t.type;if(!t.render){if(!e&&Xp&&!n.render){const s=n.template||Gh(t).template;if(s){const{isCustomElement:r,compilerOptions:a}=t.appContext.config,{delimiters:o,compilerOptions:u}=n,c=St(St({isCustomElement:r,delimiters:o},a),u);n.render=Xp(s,c)}}t.render=n.render||hn}{const s=ho(t);ls();try{dS(t)}finally{us(),s()}}}const YS={get(t,e){return Vt(t,"get",""),t[e]}};function QS(t){const e=i=>{t.exposed=i||{}};return{attrs:new Proxy(t.attrs,YS),slots:t.slots,emit:t.emit,expose:e}}function wu(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(fy(lo(t.exposed)),{get(e,i){if(i in e)return e[i];if(i in Ra)return Ra[i](t)},has(e,i){return i in e||i in Ra}})):t.proxy}function JS(t,e=!0){return $e(t)?t.displayName||t.name:t.name||e&&t.__name}function ZS(t){return $e(t)&&"__vccOpts"in t}const oe=(t,e)=>Bx(t,e,Ja);function ue(t,e,i){const n=arguments.length;return n===2?ct(e)&&!Fe(e)?Qa(e)?Wt(t,null,[e]):Wt(t,e):Wt(t,null,e):(n>3?i=Array.prototype.slice.call(arguments,2):n===3&&Qa(i)&&(i=[i]),Wt(t,e,i))}const Yp="3.5.13";/** * @vue/runtime-dom v3.5.13 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/let $d;const Qp=typeof window<"u"&&window.trustedTypes;if(Qp)try{$d=Qp.createPolicy("vue",{createHTML:t=>t})}catch{}const n_=$d?t=>$d.createHTML(t):t=>t,eE="http://www.w3.org/2000/svg",tE="http://www.w3.org/1998/Math/MathML",Sn=typeof document<"u"?document:null,Jp=Sn&&Sn.createElement("template"),iE={insert:(t,e,i)=>{e.insertBefore(t,i||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,i,n)=>{const s=e==="svg"?Sn.createElementNS(eE,t):e==="mathml"?Sn.createElementNS(tE,t):i?Sn.createElement(t,{is:i}):Sn.createElement(t);return t==="select"&&n&&n.multiple!=null&&s.setAttribute("multiple",n.multiple),s},createText:t=>Sn.createTextNode(t),createComment:t=>Sn.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>Sn.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,i,n,s,r){const a=i?i.previousSibling:e.lastChild;if(s&&(s===r||s.nextSibling))for(;e.insertBefore(s.cloneNode(!0),i),!(s===r||!(s=s.nextSibling)););else{Jp.innerHTML=n_(n==="svg"?`${t}`:n==="mathml"?`${t}`:t);const o=Jp.content;if(n==="svg"||n==="mathml"){const u=o.firstChild;for(;u.firstChild;)o.appendChild(u.firstChild);o.removeChild(u)}e.insertBefore(o,i)}return[a?a.nextSibling:e.firstChild,i?i.previousSibling:e.lastChild]}},qn="transition",ha="animation",Er=Symbol("_vtc"),s_={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},r_=St({},Ay,s_),nE=t=>(t.displayName="Transition",t.props=r_,t),Ml=nE((t,{slots:e})=>ue(Zx,a_(t),e)),vs=(t,e=[])=>{Fe(t)?t.forEach(i=>i(...e)):t&&t(...e)},Zp=t=>t?Fe(t)?t.some(e=>e.length>1):t.length>1:!1;function a_(t){const e={};for(const k in t)k in s_||(e[k]=t[k]);if(t.css===!1)return e;const{name:i="v",type:n,duration:s,enterFromClass:r=`${i}-enter-from`,enterActiveClass:a=`${i}-enter-active`,enterToClass:o=`${i}-enter-to`,appearFromClass:u=r,appearActiveClass:c=a,appearToClass:f=o,leaveFromClass:g=`${i}-leave-from`,leaveActiveClass:y=`${i}-leave-active`,leaveToClass:_=`${i}-leave-to`}=t,x=sE(s),b=x&&x[0],A=x&&x[1],{onBeforeEnter:L,onEnter:C,onEnterCancelled:w,onLeave:R,onLeaveCancelled:O,onBeforeAppear:U=L,onAppear:H=C,onAppearCancelled:X=w}=e,T=(k,V,F,Y)=>{k._enterCancelled=Y,Wn(k,V?f:o),Wn(k,V?c:a),F&&F()},S=(k,V)=>{k._isLeaving=!1,Wn(k,g),Wn(k,_),Wn(k,y),V&&V()},B=k=>(V,F)=>{const Y=k?H:C,Z=()=>T(V,k,F);vs(Y,[V,Z]),eg(()=>{Wn(V,k?u:r),tn(V,k?f:o),Zp(Y)||tg(V,n,b,Z)})};return St(e,{onBeforeEnter(k){vs(L,[k]),tn(k,r),tn(k,a)},onBeforeAppear(k){vs(U,[k]),tn(k,u),tn(k,c)},onEnter:B(!1),onAppear:B(!0),onLeave(k,V){k._isLeaving=!0;const F=()=>S(k,V);tn(k,g),k._enterCancelled?(tn(k,y),jd()):(jd(),tn(k,y)),eg(()=>{k._isLeaving&&(Wn(k,g),tn(k,_),Zp(R)||tg(k,n,A,F))}),vs(R,[k,F])},onEnterCancelled(k){T(k,!1,void 0,!0),vs(w,[k])},onAppearCancelled(k){T(k,!0,void 0,!0),vs(X,[k])},onLeaveCancelled(k){S(k),vs(O,[k])}})}function sE(t){if(t==null)return null;if(ct(t))return[Dc(t.enter),Dc(t.leave)];{const e=Dc(t);return[e,e]}}function Dc(t){return ox(t)}function tn(t,e){e.split(/\s+/).forEach(i=>i&&t.classList.add(i)),(t[Er]||(t[Er]=new Set)).add(e)}function Wn(t,e){e.split(/\s+/).forEach(n=>n&&t.classList.remove(n));const i=t[Er];i&&(i.delete(e),i.size||(t[Er]=void 0))}function eg(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let rE=0;function tg(t,e,i,n){const s=t._endId=++rE,r=()=>{s===t._endId&&n()};if(i!=null)return setTimeout(r,i);const{type:a,timeout:o,propCount:u}=o_(t,e);if(!a)return n();const c=a+"end";let f=0;const g=()=>{t.removeEventListener(c,y),r()},y=_=>{_.target===t&&++f>=u&&g()};setTimeout(()=>{f(i[x]||"").split(", "),s=n(`${qn}Delay`),r=n(`${qn}Duration`),a=ig(s,r),o=n(`${ha}Delay`),u=n(`${ha}Duration`),c=ig(o,u);let f=null,g=0,y=0;e===qn?a>0&&(f=qn,g=a,y=r.length):e===ha?c>0&&(f=ha,g=c,y=u.length):(g=Math.max(a,c),f=g>0?a>c?qn:ha:null,y=f?f===qn?r.length:u.length:0);const _=f===qn&&/\b(transform|all)(,|$)/.test(n(`${qn}Property`).toString());return{type:f,timeout:g,propCount:y,hasTransform:_}}function ig(t,e){for(;t.lengthng(i)+ng(t[n])))}function ng(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function jd(){return document.body.offsetHeight}function aE(t,e,i){const n=t[Er];n&&(e=(e?[e,...n]:[...n]).join(" ")),e==null?t.removeAttribute("class"):i?t.setAttribute("class",e):t.className=e}const Nl=Symbol("_vod"),l_=Symbol("_vsh"),hR={beforeMount(t,{value:e},{transition:i}){t[Nl]=t.style.display==="none"?"":t.style.display,i&&e?i.beforeEnter(t):fa(t,e)},mounted(t,{value:e},{transition:i}){i&&e&&i.enter(t)},updated(t,{value:e,oldValue:i},{transition:n}){!e!=!i&&(n?e?(n.beforeEnter(t),fa(t,!0),n.enter(t)):n.leave(t,()=>{fa(t,!1)}):fa(t,e))},beforeUnmount(t,{value:e}){fa(t,e)}};function fa(t,e){t.style.display=e?t[Nl]:"none",t[l_]=!e}const oE=Symbol(""),lE=/(^|;)\s*display\s*:/;function uE(t,e,i){const n=t.style,s=vt(i);let r=!1;if(i&&!s){if(e)if(vt(e))for(const a of e.split(";")){const o=a.slice(0,a.indexOf(":")).trim();i[o]==null&&_l(n,o,"")}else for(const a in e)i[a]==null&&_l(n,a,"");for(const a in i)a==="display"&&(r=!0),_l(n,a,i[a])}else if(s){if(e!==i){const a=n[oE];a&&(i+=";"+a),n.cssText=i,r=lE.test(i)}}else e&&t.removeAttribute("style");Nl in t&&(t[Nl]=r?n.display:"",t[l_]&&(n.display="none"))}const sg=/\s*!important$/;function _l(t,e,i){if(Fe(i))i.forEach(n=>_l(t,e,n));else if(i==null&&(i=""),e.startsWith("--"))t.setProperty(e,i);else{const n=cE(t,e);sg.test(i)?t.setProperty(js(n),i.replace(sg,""),"important"):t[n]=i}}const rg=["Webkit","Moz","ms"],kc={};function cE(t,e){const i=kc[e];if(i)return i;let n=Oi(e);if(n!=="filter"&&n in t)return kc[e]=n;n=mu(n);for(let s=0;sIc||(gE.then(()=>Ic=0),Ic=Date.now());function yE(t,e){const i=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=i.attached)return;Gi(_E(n,i.value),e,5,[n])};return i.value=t,i.attached=mE(),i}function _E(t,e){if(Fe(e)){const i=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{i.call(t),t._stopped=!0},e.map(n=>s=>!s._stopped&&n&&n(s))}else return e}const dg=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,vE=(t,e,i,n,s,r)=>{const a=s==="svg";e==="class"?aE(t,n,a):e==="style"?uE(t,i,n):fu(e)?Ph(e)||fE(t,e,i,n,r):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):bE(t,e,n,a))?(lg(t,e,n),!t.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&og(t,e,n,a,r,e!=="value")):t._isVueCE&&(/[A-Z]/.test(e)||!vt(n))?lg(t,Oi(e),n,r,e):(e==="true-value"?t._trueValue=n:e==="false-value"&&(t._falseValue=n),og(t,e,n,a))};function bE(t,e,i,n){if(n)return!!(e==="innerHTML"||e==="textContent"||e in t&&dg(e)&&$e(i));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const s=t.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return dg(e)&&vt(i)?!1:e in t}const u_=new WeakMap,c_=new WeakMap,Bl=Symbol("_moveCb"),hg=Symbol("_enterCb"),TE=t=>(delete t.props.mode,t),xE=TE({name:"TransitionGroup",props:St({},r_,{tag:String,moveClass:String}),setup(t,{slots:e}){const i=yt(),n=wy();let s,r;return My(()=>{if(!s.length)return;const a=t.moveClass||`${t.name||"v"}-move`;if(!AE(s[0].el,i.vnode.el,a))return;s.forEach(EE),s.forEach(CE);const o=s.filter(wE);jd(),o.forEach(u=>{const c=u.el,f=c.style;tn(c,a),f.transform=f.webkitTransform=f.transitionDuration="";const g=c[Bl]=y=>{y&&y.target!==c||(!y||/transform$/.test(y.propertyName))&&(c.removeEventListener("transitionend",g),c[Bl]=null,Wn(c,a))};c.addEventListener("transitionend",g)})}),()=>{const a=Ve(t),o=a_(a);let u=a.tag||ni;if(s=[],r)for(let c=0;c{o.split(/\s+/).forEach(u=>u&&n.classList.remove(u))}),i.split(/\s+/).forEach(o=>o&&n.classList.add(o)),n.style.display="none";const r=e.nodeType===1?e:e.parentNode;r.appendChild(n);const{hasTransform:a}=o_(n);return r.removeChild(n),a}const DE=St({patchProp:vE},iE);let fg;function kE(){return fg||(fg=ES(DE))}const Fl=(...t)=>{const e=kE().createApp(...t),{mount:i}=e;return e.mount=n=>{const s=PE(n);if(!s)return;const r=e._component;!$e(r)&&!r.render&&!r.template&&(r.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const a=i(s,!1,IE(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),a},e};function IE(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function PE(t){return vt(t)?document.querySelector(t):t}function Vs(t,e,i,n){return Object.defineProperty(t,e,{get:i,set:n,enumerable:!0}),t}function fR(t,e){for(const i in e)Vs(t,i,e[i]);return t}const ss=Ge(!1);let Vd;function OE(t,e){const i=/(edg|edge|edga|edgios)\/([\w.]+)/.exec(t)||/(opr)[\/]([\w.]+)/.exec(t)||/(vivaldi)[\/]([\w.]+)/.exec(t)||/(chrome|crios)[\/]([\w.]+)/.exec(t)||/(version)(applewebkit)[\/]([\w.]+).*(safari)[\/]([\w.]+)/.exec(t)||/(webkit)[\/]([\w.]+).*(version)[\/]([\w.]+).*(safari)[\/]([\w.]+)/.exec(t)||/(firefox|fxios)[\/]([\w.]+)/.exec(t)||/(webkit)[\/]([\w.]+)/.exec(t)||/(opera)(?:.*version|)[\/]([\w.]+)/.exec(t)||[];return{browser:i[5]||i[3]||i[1]||"",version:i[4]||i[2]||"0",platform:e[0]||""}}function LE(t){return/(ipad)/.exec(t)||/(ipod)/.exec(t)||/(windows phone)/.exec(t)||/(iphone)/.exec(t)||/(kindle)/.exec(t)||/(silk)/.exec(t)||/(android)/.exec(t)||/(win)/.exec(t)||/(mac)/.exec(t)||/(linux)/.exec(t)||/(cros)/.exec(t)||/(playbook)/.exec(t)||/(bb)/.exec(t)||/(blackberry)/.exec(t)||[]}const d_="ontouchstart"in window||window.navigator.maxTouchPoints>0;function RE(t){const e=t.toLowerCase(),i=LE(e),n=OE(e,i),s={mobile:!1,desktop:!1,cordova:!1,capacitor:!1,nativeMobile:!1,electron:!1,bex:!1,linux:!1,mac:!1,win:!1,cros:!1,chrome:!1,firefox:!1,opera:!1,safari:!1,vivaldi:!1,edge:!1,edgeChromium:!1,ie:!1,webkit:!1,android:!1,ios:!1,ipad:!1,iphone:!1,ipod:!1,kindle:!1,winphone:!1,blackberry:!1,playbook:!1,silk:!1};n.browser&&(s[n.browser]=!0,s.version=n.version,s.versionNumber=parseInt(n.version,10)),n.platform&&(s[n.platform]=!0);const r=s.android||s.ios||s.bb||s.blackberry||s.ipad||s.iphone||s.ipod||s.kindle||s.playbook||s.silk||s["windows phone"];if(r===!0||e.indexOf("mobile")!==-1?s.mobile=!0:s.desktop=!0,s["windows phone"]&&(s.winphone=!0,delete s["windows phone"]),s.edga||s.edgios||s.edg?(s.edge=!0,n.browser="edge"):s.crios?(s.chrome=!0,n.browser="chrome"):s.fxios&&(s.firefox=!0,n.browser="firefox"),(s.ipod||s.ipad||s.iphone)&&(s.ios=!0),s.vivaldi&&(n.browser="vivaldi",s.vivaldi=!0),(s.chrome||s.opr||s.safari||s.vivaldi||s.mobile===!0&&s.ios!==!0&&r!==!0)&&(s.webkit=!0),s.opr&&(n.browser="opera",s.opera=!0),s.safari&&(s.blackberry||s.bb?(n.browser="blackberry",s.blackberry=!0):s.playbook?(n.browser="playbook",s.playbook=!0):s.android?(n.browser="android",s.android=!0):s.kindle?(n.browser="kindle",s.kindle=!0):s.silk&&(n.browser="silk",s.silk=!0)),s.name=n.browser,s.platform=n.platform,e.indexOf("electron")!==-1)s.electron=!0;else if(document.location.href.indexOf("-extension://")!==-1)s.bex=!0;else{if(window.Capacitor!==void 0?(s.capacitor=!0,s.nativeMobile=!0,s.nativeMobileWrapper="capacitor"):(window._cordovaNative!==void 0||window.cordova!==void 0)&&(s.cordova=!0,s.nativeMobile=!0,s.nativeMobileWrapper="cordova"),ss.value===!0&&(Vd={is:{...s}}),d_===!0&&s.mac===!0&&(s.desktop===!0&&s.safari===!0||s.nativeMobile===!0&&s.android!==!0&&s.ios!==!0&&s.ipad!==!0)){delete s.mac,delete s.desktop;const a=Math.min(window.innerHeight,window.innerWidth)>414?"ipad":"iphone";Object.assign(s,{mobile:!0,ios:!0,platform:a,[a]:!0})}s.mobile!==!0&&window.navigator.userAgentData&&window.navigator.userAgentData.mobile&&(delete s.desktop,s.mobile=!0)}return s}const pg=navigator.userAgent||navigator.vendor||window.opera,ME={has:{touch:!1,webStorage:!1},within:{iframe:!1}},kt={userAgent:pg,is:RE(pg),has:{touch:d_},within:{iframe:window.self!==window.top}},Hd={install(t){const{$q:e}=t;ss.value===!0?(t.onSSRHydrated.push(()=>{Object.assign(e.platform,kt),ss.value=!1}),e.platform=Fr(this)):e.platform=this}};{let t;Vs(kt.has,"webStorage",()=>{if(t!==void 0)return t;try{if(window.localStorage)return t=!0,!0}catch{}return t=!1,!1}),Object.assign(Hd,kt),ss.value===!0&&(Object.assign(Hd,Vd,ME),Vd=null)}function Nt(t){return lo(Tu(t))}function NE(t){return lo(t)}const fo=(t,e)=>{const i=Fr(t);for(const n in t)Vs(e,n,()=>i[n],s=>{i[n]=s});return e},oi={hasPassive:!1,passiveCapture:!0,notPassiveCapture:!0};try{const t=Object.defineProperty({},"passive",{get(){Object.assign(oi,{hasPassive:!0,passive:{passive:!0},notPassive:{passive:!1},passiveCapture:{passive:!0,capture:!0},notPassiveCapture:{passive:!1,capture:!0}})}});window.addEventListener("qtest",null,t),window.removeEventListener("qtest",null,t)}catch{}function kn(){}function pR(t){return t.button===0}function BE(t){return t.touches&&t.touches[0]?t=t.touches[0]:t.changedTouches&&t.changedTouches[0]?t=t.changedTouches[0]:t.targetTouches&&t.targetTouches[0]&&(t=t.targetTouches[0]),{top:t.clientY,left:t.clientX}}function FE(t){if(t.path)return t.path;if(t.composedPath)return t.composedPath();const e=[];let i=t.target;for(;i;){if(e.push(i),i.tagName==="HTML")return e.push(document),e.push(window),e;i=i.parentElement}}function Ul(t){t.stopPropagation()}function es(t){t.cancelable!==!1&&t.preventDefault()}function Ai(t){t.cancelable!==!1&&t.preventDefault(),t.stopPropagation()}function gR(t,e){if(t===void 0||e===!0&&t.__dragPrevented===!0)return;const i=e===!0?n=>{n.__dragPrevented=!0,n.addEventListener("dragstart",es,oi.notPassiveCapture)}:n=>{delete n.__dragPrevented,n.removeEventListener("dragstart",es,oi.notPassiveCapture)};t.querySelectorAll("a, img").forEach(i)}function UE(t,e,i){const n=`__q_${e}_evt`;t[n]=t[n]!==void 0?t[n].concat(i):i,i.forEach(s=>{s[0].addEventListener(s[1],t[s[2]],oi[s[3]])})}function qE(t,e){const i=`__q_${e}_evt`;t[i]!==void 0&&(t[i].forEach(n=>{n[0].removeEventListener(n[1],t[n[2]],oi[n[3]])}),t[i]=void 0)}function h_(t,e=250,i){let n=null;function s(){const r=arguments,a=()=>{n=null,t.apply(this,r)};n!==null&&clearTimeout(n),n=setTimeout(a,e)}return s.cancel=()=>{n!==null&&clearTimeout(n)},s}const Pc=["sm","md","lg","xl"],{passive:gg}=oi,$E=fo({width:0,height:0,name:"xs",sizes:{sm:600,md:1024,lg:1440,xl:1920},lt:{sm:!0,md:!0,lg:!0,xl:!0},gt:{xs:!1,sm:!1,md:!1,lg:!1},xs:!0,sm:!1,md:!1,lg:!1,xl:!1},{setSizes:kn,setDebounce:kn,install({$q:t,onSSRHydrated:e}){if(t.screen=this,this.__installed===!0){t.config.screen!==void 0&&(t.config.screen.bodyClasses===!1?document.body.classList.remove(`screen--${this.name}`):this.__update(!0));return}const{visualViewport:i}=window,n=i||window,s=document.scrollingElement||document.documentElement,r=i===void 0||kt.is.mobile===!0?()=>[Math.max(window.innerWidth,s.clientWidth),Math.max(window.innerHeight,s.clientHeight)]:()=>[i.width*i.scale+window.innerWidth-s.clientWidth,i.height*i.scale+window.innerHeight-s.clientHeight],a=t.config.screen!==void 0&&t.config.screen.bodyClasses===!0;this.__update=g=>{const[y,_]=r();if(_!==this.height&&(this.height=_),y!==this.width)this.width=y;else if(g!==!0)return;let x=this.sizes;this.gt.xs=y>=x.sm,this.gt.sm=y>=x.md,this.gt.md=y>=x.lg,this.gt.lg=y>=x.xl,this.lt.sm=y{Pc.forEach(y=>{g[y]!==void 0&&(u[y]=g[y])})},this.setDebounce=g=>{c=g};const f=()=>{const g=getComputedStyle(document.body);g.getPropertyValue("--q-size-sm")&&Pc.forEach(y=>{this.sizes[y]=parseInt(g.getPropertyValue(`--q-size-${y}`),10)}),this.setSizes=y=>{Pc.forEach(_=>{y[_]&&(this.sizes[_]=y[_])}),this.__update(!0)},this.setDebounce=y=>{o!==void 0&&n.removeEventListener("resize",o,gg),o=y>0?h_(this.__update,y):this.__update,n.addEventListener("resize",o,gg)},this.setDebounce(c),Object.keys(u).length!==0?(this.setSizes(u),u=void 0):this.__update(),a===!0&&this.name==="xs"&&document.body.classList.add("screen--xs")};ss.value===!0?e.push(f):f()}}),jt=fo({isActive:!1,mode:!1},{__media:void 0,set(t){jt.mode=t,t==="auto"?(jt.__media===void 0&&(jt.__media=window.matchMedia("(prefers-color-scheme: dark)"),jt.__updateMedia=()=>{jt.set("auto")},jt.__media.addListener(jt.__updateMedia)),t=jt.__media.matches):jt.__media!==void 0&&(jt.__media.removeListener(jt.__updateMedia),jt.__media=void 0),jt.isActive=t===!0,document.body.classList.remove(`body--${t===!0?"light":"dark"}`),document.body.classList.add(`body--${t===!0?"dark":"light"}`)},toggle(){jt.set(jt.isActive===!1)},install({$q:t,ssrContext:e}){const{dark:i}=t.config;t.dark=this,this.__installed!==!0&&this.set(i!==void 0?i:!1)}});function jE(t,e,i=document.body){if(typeof t!="string")throw new TypeError("Expected a string as propName");if(typeof e!="string")throw new TypeError("Expected a string as value");if(!(i instanceof Element))throw new TypeError("Expected a DOM element");i.style.setProperty(`--q-${t}`,e)}let f_=!1;function VE(t){f_=t.isComposing===!0}function p_(t){return f_===!0||t!==Object(t)||t.isComposing===!0||t.qKeyEvent===!0}function Za(t,e){return p_(t)===!0?!1:[].concat(e).includes(t.keyCode)}function g_(t){if(t.ios===!0)return"ios";if(t.android===!0)return"android"}function HE({is:t,has:e,within:i},n){const s=[t.desktop===!0?"desktop":"mobile",`${e.touch===!1?"no-":""}touch`];if(t.mobile===!0){const r=g_(t);r!==void 0&&s.push("platform-"+r)}if(t.nativeMobile===!0){const r=t.nativeMobileWrapper;s.push(r),s.push("native-mobile"),t.ios===!0&&(n[r]===void 0||n[r].iosStatusBarPadding!==!1)&&s.push("q-ios-padding")}else t.electron===!0?s.push("electron"):t.bex===!0&&s.push("bex");return i.iframe===!0&&s.push("within-iframe"),s}function zE(){const{is:t}=kt,e=document.body.className,i=new Set(e.replace(/ {2}/g," ").split(" "));if(t.nativeMobile!==!0&&t.electron!==!0&&t.bex!==!0){if(t.desktop===!0)i.delete("mobile"),i.delete("platform-ios"),i.delete("platform-android"),i.add("desktop");else if(t.mobile===!0){i.delete("desktop"),i.add("mobile"),i.delete("platform-ios"),i.delete("platform-android");const s=g_(t);s!==void 0&&i.add(`platform-${s}`)}}kt.has.touch===!0&&(i.delete("no-touch"),i.add("touch")),kt.within.iframe===!0&&i.add("within-iframe");const n=Array.from(i).join(" ");e!==n&&(document.body.className=n)}function WE(t){for(const e in t)jE(e,t[e])}const GE={install(t){if(this.__installed!==!0){if(ss.value===!0)zE();else{const{$q:e}=t;e.config.brand!==void 0&&WE(e.config.brand);const i=HE(kt,e.config);document.body.classList.add.apply(document.body.classList,i)}kt.is.ios===!0&&document.body.addEventListener("touchstart",kn),window.addEventListener("keydown",VE,!0)}}},m_=()=>!0;function KE(t){return typeof t=="string"&&t!==""&&t!=="/"&&t!=="#/"}function XE(t){return t.startsWith("#")===!0&&(t=t.substring(1)),t.startsWith("/")===!1&&(t="/"+t),t.endsWith("/")===!0&&(t=t.substring(0,t.length-1)),"#"+t}function YE(t){if(t.backButtonExit===!1)return()=>!1;if(t.backButtonExit==="*")return m_;const e=["#/"];return Array.isArray(t.backButtonExit)===!0&&e.push(...t.backButtonExit.filter(KE).map(XE)),()=>e.includes(window.location.hash)}const zd={__history:[],add:kn,remove:kn,install({$q:t}){if(this.__installed===!0)return;const{cordova:e,capacitor:i}=kt.is;if(e!==!0&&i!==!0)return;const n=t.config[e===!0?"cordova":"capacitor"];if(n!==void 0&&n.backButton===!1||i===!0&&(window.Capacitor===void 0||window.Capacitor.Plugins.App===void 0))return;this.add=a=>{a.condition===void 0&&(a.condition=m_),this.__history.push(a)},this.remove=a=>{const o=this.__history.indexOf(a);o>=0&&this.__history.splice(o,1)};const s=YE(Object.assign({backButtonExit:!0},n)),r=()=>{if(this.__history.length){const a=this.__history[this.__history.length-1];a.condition()===!0&&(this.__history.pop(),a.handler())}else s()===!0?navigator.app.exitApp():window.history.back()};e===!0?document.addEventListener("deviceready",()=>{document.addEventListener("backbutton",r,!1)}):window.Capacitor.Plugins.App.addListener("backButton",r)}},mg={isoName:"en-US",nativeName:"English (US)",label:{clear:"Clear",ok:"OK",cancel:"Cancel",close:"Close",set:"Set",select:"Select",reset:"Reset",remove:"Remove",update:"Update",create:"Create",search:"Search",filter:"Filter",refresh:"Refresh",expand:t=>t?`Expand "${t}"`:"Expand",collapse:t=>t?`Collapse "${t}"`:"Collapse"},date:{days:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),daysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),firstDayOfWeek:0,format24h:!1,pluralDay:"days"},table:{noData:"No data available",noResults:"No matching records found",loading:"Loading...",selectedRecords:t=>t===1?"1 record selected.":(t===0?"No":t)+" records selected.",recordsPerPage:"Records per page:",allRows:"All",pagination:(t,e,i)=>t+"-"+e+" of "+i,columns:"Columns"},editor:{url:"URL",bold:"Bold",italic:"Italic",strikethrough:"Strikethrough",underline:"Underline",unorderedList:"Unordered List",orderedList:"Ordered List",subscript:"Subscript",superscript:"Superscript",hyperlink:"Hyperlink",toggleFullscreen:"Toggle Fullscreen",quote:"Quote",left:"Left align",center:"Center align",right:"Right align",justify:"Justify align",print:"Print",outdent:"Decrease indentation",indent:"Increase indentation",removeFormat:"Remove formatting",formatting:"Formatting",fontSize:"Font Size",align:"Align",hr:"Insert Horizontal Rule",undo:"Undo",redo:"Redo",heading1:"Heading 1",heading2:"Heading 2",heading3:"Heading 3",heading4:"Heading 4",heading5:"Heading 5",heading6:"Heading 6",paragraph:"Paragraph",code:"Code",size1:"Very small",size2:"A bit small",size3:"Normal",size4:"Medium-large",size5:"Big",size6:"Very big",size7:"Maximum",defaultFont:"Default Font",viewSource:"View Source"},tree:{noNodes:"No nodes available",noResults:"No matching nodes found"}};function yg(){const t=Array.isArray(navigator.languages)===!0&&navigator.languages.length!==0?navigator.languages[0]:navigator.language;if(typeof t=="string")return t.split(/[-_]/).map((e,i)=>i===0?e.toLowerCase():i>1||e.length<4?e.toUpperCase():e[0].toUpperCase()+e.slice(1).toLowerCase()).join("-")}const Yn=fo({__qLang:{}},{getLocale:yg,set(t=mg,e){const i={...t,rtl:t.rtl===!0,getLocale:yg};{if(i.set=Yn.set,Yn.__langConfig===void 0||Yn.__langConfig.noHtmlAttrs!==!0){const n=document.documentElement;n.setAttribute("dir",i.rtl===!0?"rtl":"ltr"),n.setAttribute("lang",i.isoName)}Object.assign(Yn.__qLang,i)}},install({$q:t,lang:e,ssrContext:i}){t.lang=Yn.__qLang,Yn.__langConfig=t.config.lang,this.__installed===!0?e!==void 0&&this.set(e):(this.props=new Proxy(this.__qLang,{get(){return Reflect.get(...arguments)},ownKeys(n){return Reflect.ownKeys(n).filter(s=>s!=="set"&&s!=="getLocale")}}),this.set(e||mg))}}),QE={name:"material-icons",type:{positive:"check_circle",negative:"warning",info:"info",warning:"priority_high"},arrow:{up:"arrow_upward",right:"arrow_forward",down:"arrow_downward",left:"arrow_back",dropdown:"arrow_drop_down"},chevron:{left:"chevron_left",right:"chevron_right"},colorPicker:{spectrum:"gradient",tune:"tune",palette:"style"},pullToRefresh:{icon:"refresh"},carousel:{left:"chevron_left",right:"chevron_right",up:"keyboard_arrow_up",down:"keyboard_arrow_down",navigationIcon:"lens"},chip:{remove:"cancel",selected:"check"},datetime:{arrowLeft:"chevron_left",arrowRight:"chevron_right",now:"access_time",today:"today"},editor:{bold:"format_bold",italic:"format_italic",strikethrough:"strikethrough_s",underline:"format_underlined",unorderedList:"format_list_bulleted",orderedList:"format_list_numbered",subscript:"vertical_align_bottom",superscript:"vertical_align_top",hyperlink:"link",toggleFullscreen:"fullscreen",quote:"format_quote",left:"format_align_left",center:"format_align_center",right:"format_align_right",justify:"format_align_justify",print:"print",outdent:"format_indent_decrease",indent:"format_indent_increase",removeFormat:"format_clear",formatting:"text_format",fontSize:"format_size",align:"format_align_left",hr:"remove",undo:"undo",redo:"redo",heading:"format_size",code:"code",size:"format_size",font:"font_download",viewSource:"code"},expansionItem:{icon:"keyboard_arrow_down",denseIcon:"arrow_drop_down"},fab:{icon:"add",activeIcon:"close"},field:{clear:"cancel",error:"error"},pagination:{first:"first_page",prev:"keyboard_arrow_left",next:"keyboard_arrow_right",last:"last_page"},rating:{icon:"grade"},stepper:{done:"check",active:"edit",error:"warning"},tabs:{left:"chevron_left",right:"chevron_right",up:"keyboard_arrow_up",down:"keyboard_arrow_down"},table:{arrowUp:"arrow_upward",warning:"warning",firstPage:"first_page",prevPage:"chevron_left",nextPage:"chevron_right",lastPage:"last_page"},tree:{icon:"play_arrow"},uploader:{done:"done",clear:"clear",add:"add_box",upload:"cloud_upload",removeQueue:"clear_all",removeUploaded:"done_all"}},ql=fo({iconMapFn:null,__qIconSet:{}},{set(t,e){const i={...t};i.set=ql.set,Object.assign(ql.__qIconSet,i)},install({$q:t,iconSet:e,ssrContext:i}){t.config.iconMapFn!==void 0&&(this.iconMapFn=t.config.iconMapFn),t.iconSet=this.__qIconSet,Vs(t,"iconMapFn",()=>this.iconMapFn,n=>{this.iconMapFn=n}),this.__installed===!0?e!==void 0&&this.set(e):(this.props=new Proxy(this.__qIconSet,{get(){return Reflect.get(...arguments)},ownKeys(n){return Reflect.ownKeys(n).filter(s=>s!=="set")}}),this.set(e||QE))}}),JE="_q_",mR="_q_l_",yR="_q_pc_",ZE="_q_fo_";function _R(){}const $l={};let y_=!1;function eC(){y_=!0}function Oc(t,e){if(t===e)return!0;if(t!==null&&e!==null&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;let i,n;if(t.constructor===Array){if(i=t.length,i!==e.length)return!1;for(n=i;n--!==0;)if(Oc(t[n],e[n])!==!0)return!1;return!0}if(t.constructor===Map){if(t.size!==e.size)return!1;let r=t.entries();for(n=r.next();n.done!==!0;){if(e.has(n.value[0])!==!0)return!1;n=r.next()}for(r=t.entries(),n=r.next();n.done!==!0;){if(Oc(n.value[1],e.get(n.value[0]))!==!0)return!1;n=r.next()}return!0}if(t.constructor===Set){if(t.size!==e.size)return!1;const r=t.entries();for(n=r.next();n.done!==!0;){if(e.has(n.value[0])!==!0)return!1;n=r.next()}return!0}if(t.buffer!=null&&t.buffer.constructor===ArrayBuffer){if(i=t.length,i!==e.length)return!1;for(n=i;n--!==0;)if(t[n]!==e[n])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();const s=Object.keys(t).filter(r=>t[r]!==void 0);if(i=s.length,i!==Object.keys(e).filter(r=>e[r]!==void 0).length)return!1;for(n=i;n--!==0;){const r=s[n];if(Oc(t[r],e[r])!==!0)return!1}return!0}return t!==t&&e!==e}function Di(t){return t!==null&&typeof t=="object"&&Array.isArray(t)!==!0}function vR(t){return Object.prototype.toString.call(t)==="[object Date]"}function bR(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function TR(t){return typeof t=="number"&&isFinite(t)}const _g=[Hd,GE,jt,$E,zd,Yn,ql];function Jh(t,e){const i=Fl(t);i.config.globalProperties=e.config.globalProperties;const{reload:n,...s}=e._context;return Object.assign(i._context,s),i}function vg(t,e){e.forEach(i=>{i.install(t),i.__installed=!0})}function tC(t,e,i){t.config.globalProperties.$q=i.$q,t.provide(JE,i.$q),vg(i,_g),e.components!==void 0&&Object.values(e.components).forEach(n=>{Di(n)===!0&&n.name!==void 0&&t.component(n.name,n)}),e.directives!==void 0&&Object.values(e.directives).forEach(n=>{Di(n)===!0&&n.name!==void 0&&t.directive(n.name,n)}),e.plugins!==void 0&&vg(i,Object.values(e.plugins).filter(n=>typeof n.install=="function"&&_g.includes(n)===!1)),ss.value===!0&&(i.$q.onSSRHydrated=()=>{i.onSSRHydrated.forEach(n=>{n()}),i.$q.onSSRHydrated=()=>{}})}const iC=function(t,e={}){const i={version:"2.17.4"};y_===!1?(e.config!==void 0&&Object.assign($l,e.config),i.config={...$l},eC()):i.config=e.config||{},tC(t,e,{parentApp:t,$q:i,lang:e.lang,iconSet:e.iconSet,onSSRHydrated:[]})},nC={name:"Quasar",version:"2.17.4",install:iC,lang:Yn,iconSet:ql};var jl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function po(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function sC(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var i=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};i.prototype=e.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var s=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(i,n,s.get?s:{enumerable:!0,get:function(){return t[n]}})}),i}var Lc,bg;function Au(){if(bg)return Lc;bg=1;var t;return typeof window<"u"?t=window:typeof jl<"u"?t=jl:typeof self<"u"?t=self:t={},Lc=t,Lc}var rC=Au();const $=po(rC),aC={},oC=Object.freeze(Object.defineProperty({__proto__:null,default:aC},Symbol.toStringTag,{value:"Module"})),lC=sC(oC);var Rc,Tg;function __(){if(Tg)return Rc;Tg=1;var t=typeof jl<"u"?jl:typeof window<"u"?window:{},e=lC,i;return typeof document<"u"?i=document:(i=t["__GLOBAL_DOCUMENT_CACHE@4"],i||(i=t["__GLOBAL_DOCUMENT_CACHE@4"]=e)),Rc=i,Rc}var uC=__();const _e=po(uC);var Qo={exports:{}},Mc={exports:{}},xg;function cC(){return xg||(xg=1,function(t){function e(){return t.exports=e=Object.assign?Object.assign.bind():function(i){for(var n=1;n=s.length?{done:!0}:{done:!1,value:s[o++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function e(s,r){if(s){if(typeof s=="string")return i(s,r);var a=Object.prototype.toString.call(s).slice(8,-1);if(a==="Object"&&s.constructor&&(a=s.constructor.name),a==="Map"||a==="Set")return Array.from(s);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return i(s,r)}}function i(s,r){(r==null||r>s.length)&&(r=s.length);for(var a=0,o=new Array(r);a=400&&o.statusCode<=599){var c=u;if(r)if(t.TextDecoder){var f=i(o.headers&&o.headers["content-type"]);try{c=new TextDecoder(f).decode(u)}catch{}}else c=String.fromCharCode.apply(null,new Uint8Array(u));s({cause:c});return}s(null,u)}};function i(n){return n===void 0&&(n=""),n.toLowerCase().split(";").reduce(function(s,r){var a=r.split("="),o=a[0],u=a[1];return o.trim()==="charset"?u.trim():s},"utf-8")}return Uc=e,Uc}var Ag;function gC(){if(Ag)return Qo.exports;Ag=1;var t=Au(),e=cC(),i=dC(),n=hC(),s=fC();c.httpHandler=pC(),c.requestInterceptorsStorage=new n,c.responseInterceptorsStorage=new n,c.retryManager=new s;/** * @license * slighly modified parse-headers 2.0.2 * Copyright (c) 2014 David Björklund * Available under the MIT license * */var r=function(x){var b={};return x&&x.trim().split(` `).forEach(function(A){var L=A.indexOf(":"),C=A.slice(0,L).trim().toLowerCase(),w=A.slice(L+1).trim();typeof b[C]>"u"?b[C]=w:Array.isArray(b[C])?b[C].push(w):b[C]=[b[C],w]}),b};Qo.exports=c,Qo.exports.default=c,c.XMLHttpRequest=t.XMLHttpRequest||y,c.XDomainRequest="withCredentials"in new c.XMLHttpRequest?c.XMLHttpRequest:t.XDomainRequest,a(["get","put","post","patch","head","delete"],function(_){c[_==="delete"?"del":_]=function(x,b,A){return b=u(x,b,A),b.method=_.toUpperCase(),f(b)}});function a(_,x){for(var b=0;b<_.length;b++)x(_[b])}function o(_){for(var x in _)if(_.hasOwnProperty(x))return!1;return!0}function u(_,x,b){var A=_;return i(x)?(b=x,typeof _=="string"&&(A={uri:_})):A=e({},x,{uri:_}),A.callback=b,A}function c(_,x,b){return x=u(_,x,b),f(x)}function f(_){if(typeof _.callback>"u")throw new Error("callback argument missing");if(_.requestType&&c.requestInterceptorsStorage.getIsEnabled()){var x={uri:_.uri||_.url,headers:_.headers||{},body:_.body,metadata:_.metadata||{},retry:_.retry,timeout:_.timeout},b=c.requestInterceptorsStorage.execute(_.requestType,x);_.uri=b.uri,_.headers=b.headers,_.body=b.body,_.metadata=b.metadata,_.retry=b.retry,_.timeout=b.timeout}var A=!1,L=function(W,Q,se){A||(A=!0,_.callback(W,Q,se))};function C(){U.readyState===4&&!c.responseInterceptorsStorage.getIsEnabled()&&setTimeout(O,0)}function w(){var G=void 0;if(U.response?G=U.response:G=U.responseText||g(U),F)try{G=JSON.parse(G)}catch{}return G}function R(G){if(clearTimeout(Y),clearTimeout(_.retryTimeout),G instanceof Error||(G=new Error(""+(G||"Unknown XMLHttpRequest Error"))),G.statusCode=0,!X&&c.retryManager.getIsEnabled()&&_.retry&&_.retry.shouldRetry()){_.retryTimeout=setTimeout(function(){_.retry.moveToNextAttempt(),_.xhr=U,f(_)},_.retry.getCurrentFuzzedDelay());return}if(_.requestType&&c.responseInterceptorsStorage.getIsEnabled()){var W={headers:Z.headers||{},body:Z.body,responseUrl:U.responseURL,responseType:U.responseType},Q=c.responseInterceptorsStorage.execute(_.requestType,W);Z.body=Q.body,Z.headers=Q.headers}return L(G,Z)}function O(){if(!X){var G;clearTimeout(Y),clearTimeout(_.retryTimeout),_.useXDR&&U.status===void 0?G=200:G=U.status===1223?204:U.status;var W=Z,Q=null;if(G!==0?(W={body:w(),statusCode:G,method:S,headers:{},url:T,rawRequest:U},U.getAllResponseHeaders&&(W.headers=r(U.getAllResponseHeaders()))):Q=new Error("Internal XMLHttpRequest Error"),_.requestType&&c.responseInterceptorsStorage.getIsEnabled()){var se={headers:W.headers||{},body:W.body,responseUrl:U.responseURL,responseType:U.responseType},re=c.responseInterceptorsStorage.execute(_.requestType,se);W.body=re.body,W.headers=re.headers}return L(Q,W,W.body)}}var U=_.xhr||null;U||(_.cors||_.useXDR?U=new c.XDomainRequest:U=new c.XMLHttpRequest);var H,X,T=U.url=_.uri||_.url,S=U.method=_.method||"GET",B=_.body||_.data,k=U.headers=_.headers||{},V=!!_.sync,F=!1,Y,Z={body:void 0,headers:{},statusCode:0,method:S,url:T,rawRequest:U};if("json"in _&&_.json!==!1&&(F=!0,k.accept||k.Accept||(k.Accept="application/json"),S!=="GET"&&S!=="HEAD"&&(k["content-type"]||k["Content-Type"]||(k["Content-Type"]="application/json"),B=JSON.stringify(_.json===!0?B:_.json))),U.onreadystatechange=C,U.onload=O,U.onerror=R,U.onprogress=function(){},U.onabort=function(){X=!0,clearTimeout(_.retryTimeout)},U.ontimeout=R,U.open(S,T,!V,_.username,_.password),V||(U.withCredentials=!!_.withCredentials),!V&&_.timeout>0&&(Y=setTimeout(function(){if(!X){X=!0,U.abort("timeout");var G=new Error("XMLHttpRequest timeout");G.code="ETIMEDOUT",R(G)}},_.timeout)),U.setRequestHeader)for(H in k)k.hasOwnProperty(H)&&U.setRequestHeader(H,k[H]);else if(_.headers&&!o(_.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in _&&(U.responseType=_.responseType),"beforeSend"in _&&typeof _.beforeSend=="function"&&_.beforeSend(U),U.send(B||null),U}function g(_){try{if(_.responseType==="document")return _.responseXML;var x=_.responseXML&&_.responseXML.documentElement.nodeName==="parsererror";if(_.responseType===""&&!x)return _.responseXML}catch{}return null}function y(){}return Qo.exports}var mC=gC();const v_=po(mC);var qc={exports:{}},$c,Dg;function yC(){if(Dg)return $c;Dg=1;var t=__(),e=Object.create||function(){function T(){}return function(S){if(arguments.length!==1)throw new Error("Object.create shim only accepts one parameter.");return T.prototype=S,new T}}();function i(T,S){this.name="ParsingError",this.code=T.code,this.message=S||T.message}i.prototype=e(Error.prototype),i.prototype.constructor=i,i.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}};function n(T){function S(k,V,F,Y){return(k|0)*3600+(V|0)*60+(F|0)+(Y|0)/1e3}var B=T.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return B?B[3]?S(B[1],B[2],B[3].replace(":",""),B[4]):B[1]>59?S(B[1],B[2],0,B[4]):S(0,B[1],B[2],B[4]):null}function s(){this.values=e(null)}s.prototype={set:function(T,S){!this.get(T)&&S!==""&&(this.values[T]=S)},get:function(T,S,B){return B?this.has(T)?this.values[T]:S[B]:this.has(T)?this.values[T]:S},has:function(T){return T in this.values},alt:function(T,S,B){for(var k=0;k=0&&S<=100)?(this.set(T,S),!0):!1}};function r(T,S,B,k){var V=k?T.split(k):[T];for(var F in V)if(typeof V[F]=="string"){var Y=V[F].split(B);if(Y.length===2){var Z=Y[0].trim(),G=Y[1].trim();S(Z,G)}}}function a(T,S,B){var k=T;function V(){var Z=n(T);if(Z===null)throw new i(i.Errors.BadTimeStamp,"Malformed timestamp: "+k);return T=T.replace(/^[^\sa-zA-Z-]+/,""),Z}function F(Z,G){var W=new s;r(Z,function(Q,se){switch(Q){case"region":for(var re=B.length-1;re>=0;re--)if(B[re].id===se){W.set(Q,B[re].region);break}break;case"vertical":W.alt(Q,se,["rl","lr"]);break;case"line":var ne=se.split(","),Ce=ne[0];W.integer(Q,Ce),W.percent(Q,Ce)&&W.set("snapToLines",!1),W.alt(Q,Ce,["auto"]),ne.length===2&&W.alt("lineAlign",ne[1],["start","center","end"]);break;case"position":ne=se.split(","),W.percent(Q,ne[0]),ne.length===2&&W.alt("positionAlign",ne[1],["start","center","end"]);break;case"size":W.percent(Q,se);break;case"align":W.alt(Q,se,["start","center","end","left","right"]);break}},/:/,/\s/),G.region=W.get("region",null),G.vertical=W.get("vertical","");try{G.line=W.get("line","auto")}catch{}G.lineAlign=W.get("lineAlign","start"),G.snapToLines=W.get("snapToLines",!0),G.size=W.get("size",100);try{G.align=W.get("align","center")}catch{G.align=W.get("align","middle")}try{G.position=W.get("position","auto")}catch{G.position=W.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},G.align)}G.positionAlign=W.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},G.align)}function Y(){T=T.replace(/^\s+/,"")}if(Y(),S.startTime=V(),Y(),T.substr(0,3)!=="-->")throw new i(i.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+k);T=T.substr(3),Y(),S.endTime=V(),Y(),F(T,S)}var o=t.createElement&&t.createElement("textarea"),u={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},c={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},f={v:"title",lang:"lang"},g={rt:"ruby"};function y(T,S){function B(){if(!S)return null;function Ce(De){return S=S.substr(De.length),De}var Ie=S.match(/^([^<]*)(<[^>]*>?)?/);return Ce(Ie[1]?Ie[1]:Ie[2])}function k(Ce){return o.innerHTML=Ce,Ce=o.textContent,o.textContent="",Ce}function V(Ce,Ie){return!g[Ie.localName]||g[Ie.localName]===Ce.localName}function F(Ce,Ie){var De=u[Ce];if(!De)return null;var Se=T.document.createElement(De),te=f[Ce];return te&&Ie&&(Se[te]=Ie.trim()),Se}for(var Y=T.document.createElement("div"),Z=Y,G,W=[];(G=B())!==null;){if(G[0]==="<"){if(G[1]==="/"){W.length&&W[W.length-1]===G.substr(2).replace(">","")&&(W.pop(),Z=Z.parentNode);continue}var Q=n(G.substr(1,G.length-2)),se;if(Q){se=T.document.createProcessingInstruction("timestamp",Q),Z.appendChild(se);continue}var re=G.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!re||(se=F(re[1],re[3]),!se)||!V(Z,se))continue;if(re[2]){var ne=re[2].split(".");ne.forEach(function(Ce){var Ie=/^bg_/.test(Ce),De=Ie?Ce.slice(3):Ce;if(c.hasOwnProperty(De)){var Se=Ie?"background-color":"color",te=c[De];se.style[Se]=te}}),se.className=ne.join(" ")}W.push(re[1]),Z.appendChild(se),Z=se;continue}Z.appendChild(T.document.createTextNode(k(G)))}return Y}var _=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function x(T){for(var S=0;S<_.length;S++){var B=_[S];if(T>=B[0]&&T<=B[1])return!0}return!1}function b(T){var S=[],B="",k;if(!T||!T.childNodes)return"ltr";function V(Z,G){for(var W=G.childNodes.length-1;W>=0;W--)Z.push(G.childNodes[W])}function F(Z){if(!Z||!Z.length)return null;var G=Z.pop(),W=G.textContent||G.innerText;if(W){var Q=W.match(/^.*(\n|\r)/);return Q?(Z.length=0,Q[0]):W}if(G.tagName==="ruby")return F(Z);if(G.childNodes)return V(Z,G),F(Z)}for(V(S,T);B=F(S);)for(var Y=0;Y=0&&T.line<=100))return T.line;if(!T.track||!T.track.textTrackList||!T.track.textTrackList.mediaElement)return-1;for(var S=T.track,B=S.textTrackList,k=0,V=0;VT.left&&this.topT.top},w.prototype.overlapsAny=function(T){for(var S=0;S=T.top&&this.bottom<=T.bottom&&this.left>=T.left&&this.right<=T.right},w.prototype.overlapsOppositeAxis=function(T,S){switch(S){case"+x":return this.leftT.right;case"+y":return this.topT.bottom}},w.prototype.intersectPercentage=function(T){var S=Math.max(0,Math.min(this.right,T.right)-Math.max(this.left,T.left)),B=Math.max(0,Math.min(this.bottom,T.bottom)-Math.max(this.top,T.top)),k=S*B;return k/(this.height*this.width)},w.prototype.toCSSCompatValues=function(T){return{top:this.top-T.top,bottom:T.bottom-this.bottom,left:this.left-T.left,right:T.right-this.right,height:this.height,width:this.width}},w.getSimpleBoxPosition=function(T){var S=T.div?T.div.offsetHeight:T.tagName?T.offsetHeight:0,B=T.div?T.div.offsetWidth:T.tagName?T.offsetWidth:0,k=T.div?T.div.offsetTop:T.tagName?T.offsetTop:0;T=T.div?T.div.getBoundingClientRect():T.tagName?T.getBoundingClientRect():T;var V={left:T.left,right:T.right,top:T.top||k,height:T.height||S,bottom:T.bottom||k+(T.height||S),width:T.width||B};return V};function R(T,S,B,k){function V(De,Se){for(var te,ye=new w(De),ve=1,we=0;weBe&&(te=new w(De),ve=Be),De=new w(ye)}return te||ye}var F=new w(S),Y=S.cue,Z=A(Y),G=[];if(Y.snapToLines){var W;switch(Y.vertical){case"":G=["+y","-y"],W="height";break;case"rl":G=["+x","-x"],W="width";break;case"lr":G=["-x","+x"],W="width";break}var Q=F.lineHeight,se=Q*Math.round(Z),re=B[W]+Q,ne=G[0];Math.abs(se)>re&&(se=se<0?-1:1,se*=Math.ceil(re/Q)*Q),Z<0&&(se+=Y.vertical===""?B.height:B.width,G=G.reverse()),F.move(ne,se)}else{var Ce=F.lineHeight/B.height*100;switch(Y.lineAlign){case"center":Z-=Ce/2;break;case"end":Z-=Ce;break}switch(Y.vertical){case"":S.applyStyles({top:S.formatStyle(Z,"%")});break;case"rl":S.applyStyles({left:S.formatStyle(Z,"%")});break;case"lr":S.applyStyles({right:S.formatStyle(Z,"%")});break}G=["+y","-x","+x","-y"],F=new w(S)}var Ie=V(F,G);S.move(Ie.toCSSCompatValues(B))}function O(){}O.StringDecoder=function(){return{decode:function(T){if(!T)return"";if(typeof T!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(T))}}},O.convertCueToDOMTree=function(T,S){return!T||!S?null:y(T,S)};var U=.05,H="sans-serif",X="1.5%";return O.processCues=function(T,S,B){if(!T||!S||!B)return null;for(;B.firstChild;)B.removeChild(B.firstChild);var k=T.document.createElement("div");k.style.position="absolute",k.style.left="0",k.style.right="0",k.style.top="0",k.style.bottom="0",k.style.margin=X,B.appendChild(k);function V(Q){for(var se=0;se")===-1){S.cue.id=Y;continue}case"CUE":try{a(Y,S.cue,S.regionList)}catch(Q){S.reportOrThrowError(Q),S.cue=null,S.state="BADCUE";continue}S.state="CUETEXT";continue;case"CUETEXT":var W=Y.indexOf("-->")!==-1;if(!Y||W&&(G=!0)){S.oncue&&S.oncue(S.cue),S.cue=null,S.state="ID";continue}S.cue.text&&(S.cue.text+=` `),S.cue.text+=Y.replace(/\u2028/g,` `).replace(/u2029/g,` `);continue;case"BADCUE":Y||(S.state="ID");continue}}}catch(Q){S.reportOrThrowError(Q),S.state==="CUETEXT"&&S.cue&&S.oncue&&S.oncue(S.cue),S.cue=null,S.state=S.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var T=this;try{if(T.buffer+=T.decoder.decode(),(T.cue||T.state==="HEADER")&&(T.buffer+=` `,T.parse()),T.state==="INITIAL")throw new i(i.Errors.BadSignature)}catch(S){T.reportOrThrowError(S)}return T.onflush&&T.onflush(),this}},$c=O,$c}var jc,kg;function _C(){if(kg)return jc;kg=1;var t="auto",e={"":1,lr:1,rl:1},i={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function n(a){if(typeof a!="string")return!1;var o=e[a.toLowerCase()];return o?a.toLowerCase():!1}function s(a){if(typeof a!="string")return!1;var o=i[a.toLowerCase()];return o?a.toLowerCase():!1}function r(a,o,u){this.hasBeenReset=!1;var c="",f=!1,g=a,y=o,_=u,x=null,b="",A=!0,L="auto",C="start",w="auto",R="auto",O=100,U="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return c},set:function(H){c=""+H}},pauseOnExit:{enumerable:!0,get:function(){return f},set:function(H){f=!!H}},startTime:{enumerable:!0,get:function(){return g},set:function(H){if(typeof H!="number")throw new TypeError("Start time must be set to a number.");g=H,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return y},set:function(H){if(typeof H!="number")throw new TypeError("End time must be set to a number.");y=H,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return _},set:function(H){_=""+H,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return x},set:function(H){x=H,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return b},set:function(H){var X=n(H);if(X===!1)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");b=X,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return A},set:function(H){A=!!H,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return L},set:function(H){if(typeof H!="number"&&H!==t)throw new SyntaxError("Line: an invalid number or illegal string was specified.");L=H,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return C},set:function(H){var X=s(H);X?(C=X,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return w},set:function(H){if(H<0||H>100)throw new Error("Position must be between 0 and 100.");w=H,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return R},set:function(H){var X=s(H);X?(R=X,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return O},set:function(H){if(H<0||H>100)throw new Error("Size must be between 0 and 100.");O=H,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return U},set:function(H){var X=s(H);if(!X)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");U=X,this.hasBeenReset=!0}}}),this.displayState=void 0}return r.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},jc=r,jc}var Vc,Ig;function vC(){if(Ig)return Vc;Ig=1;var t={"":!0,up:!0};function e(s){if(typeof s!="string")return!1;var r=t[s.toLowerCase()];return r?s.toLowerCase():!1}function i(s){return typeof s=="number"&&s>=0&&s<=100}function n(){var s=100,r=3,a=0,o=100,u=0,c=100,f="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return s},set:function(g){if(!i(g))throw new Error("Width must be between 0 and 100.");s=g}},lines:{enumerable:!0,get:function(){return r},set:function(g){if(typeof g!="number")throw new TypeError("Lines must be set to a number.");r=g}},regionAnchorY:{enumerable:!0,get:function(){return o},set:function(g){if(!i(g))throw new Error("RegionAnchorX must be between 0 and 100.");o=g}},regionAnchorX:{enumerable:!0,get:function(){return a},set:function(g){if(!i(g))throw new Error("RegionAnchorY must be between 0 and 100.");a=g}},viewportAnchorY:{enumerable:!0,get:function(){return c},set:function(g){if(!i(g))throw new Error("ViewportAnchorY must be between 0 and 100.");c=g}},viewportAnchorX:{enumerable:!0,get:function(){return u},set:function(g){if(!i(g))throw new Error("ViewportAnchorX must be between 0 and 100.");u=g}},scroll:{enumerable:!0,get:function(){return f},set:function(g){var y=e(g);y===!1?console.warn("Scroll: an invalid or illegal string was specified."):f=y}}})}return Vc=n,Vc}var Pg;function bC(){if(Pg)return qc.exports;Pg=1;var t=Au(),e=qc.exports={WebVTT:yC(),VTTCue:_C(),VTTRegion:vC()};t.vttjs=e,t.WebVTT=e.WebVTT;var i=e.VTTCue,n=e.VTTRegion,s=t.VTTCue,r=t.VTTRegion;return e.shim=function(){t.VTTCue=i,t.VTTRegion=n},e.restore=function(){t.VTTCue=s,t.VTTRegion=r},t.VTTCue||e.shim(),qc.exports}var TC=bC();const Og=po(TC);function xt(){return xt=Object.assign?Object.assign.bind():function(t){for(var e=1;e-1},e.trigger=function(n){var s=this.listeners[n];if(s)if(arguments.length===2)for(var r=s.length,a=0;a-1;i=this.buffer.indexOf(` `))this.trigger("data",this.buffer.substring(0,i)),this.buffer=this.buffer.substring(i+1)}}const EC=" ",Hc=function(t){const e=/([0-9.]*)?@?([0-9.]*)?/.exec(t||""),i={};return e[1]&&(i.length=parseInt(e[1],10)),e[2]&&(i.offset=parseInt(e[2],10)),i},CC=function(){const i="(?:"+"[^=]*"+")=(?:"+'"[^"]*"|[^,]*'+")";return new RegExp("(?:^|,)("+i+")")},Jt=function(t){const e={};if(!t)return e;const i=t.split(CC());let n=i.length,s;for(;n--;)i[n]!==""&&(s=/([^=]*)=(.*)/.exec(i[n]).slice(1),s[0]=s[0].replace(/^\s+|\s+$/g,""),s[1]=s[1].replace(/^\s+|\s+$/g,""),s[1]=s[1].replace(/^['"](.*)['"]$/g,"$1"),e[s[0]]=s[1]);return e},Rg=t=>{const e=t.split("x"),i={};return e[0]&&(i.width=parseInt(e[0],10)),e[1]&&(i.height=parseInt(e[1],10)),i};class wC extends Zh{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let i,n;if(e=e.trim(),e.length===0)return;if(e[0]!=="#"){this.trigger("data",{type:"uri",uri:e});return}this.tagMappers.reduce((r,a)=>{const o=a(e);return o===e?r:r.concat([o])},[e]).forEach(r=>{for(let a=0;ar),this.customParsers.push(r=>{if(e.exec(r))return this.trigger("data",{type:"custom",data:n(r),customType:i,segment:s}),!0})}addTagMapper({expression:e,map:i}){const n=s=>e.test(s)?i(s):s;this.tagMappers.push(n)}}const AC=t=>t.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase()),$n=function(t){const e={};return Object.keys(t).forEach(function(i){e[AC(i)]=t[i]}),e},zc=function(t){const{serverControl:e,targetDuration:i,partTargetDuration:n}=t;if(!e)return;const s="#EXT-X-SERVER-CONTROL",r="holdBack",a="partHoldBack",o=i&&i*3,u=n&&n*2;i&&!e.hasOwnProperty(r)&&(e[r]=o,this.trigger("info",{message:`${s} defaulting HOLD-BACK to targetDuration * 3 (${o}).`})),o&&e[r]{s.uri||!s.parts&&!s.preloadHints||(!s.map&&r&&(s.map=r),!s.key&&a&&(s.key=a),!s.timeline&&typeof g=="number"&&(s.timeline=g),this.manifest.preloadSegment=s)}),this.parseStream.on("data",function(b){let A,L;if(i.manifest.definitions){for(const C in i.manifest.definitions)if(b.uri&&(b.uri=b.uri.replace(`{$${C}}`,i.manifest.definitions[C])),b.attributes)for(const w in b.attributes)typeof b.attributes[w]=="string"&&(b.attributes[w]=b.attributes[w].replace(`{$${C}}`,i.manifest.definitions[C]))}({tag(){({version(){b.version&&(this.manifest.version=b.version)},"allow-cache"(){this.manifest.allowCache=b.allowed,"allowed"in b||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){const C={};"length"in b&&(s.byterange=C,C.length=b.length,"offset"in b||(b.offset=y)),"offset"in b&&(s.byterange=C,C.offset=b.offset),y=C.offset+C.length},endlist(){this.manifest.endList=!0},inf(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),b.title&&(s.title=b.title),b.duration>0&&(s.duration=b.duration),b.duration===0&&(s.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=n},key(){if(!b.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(b.attributes.METHOD==="NONE"){a=null;return}if(!b.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(b.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:b.attributes};return}if(b.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.microsoft.playready"]={uri:b.attributes.URI};return}if(b.attributes.KEYFORMAT===f){if(["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(b.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(b.attributes.METHOD==="SAMPLE-AES-CENC"&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),b.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(b.attributes.KEYID&&b.attributes.KEYID.substring(0,2)==="0x")){this.trigger("warn",{message:"invalid key ID provided for Widevine"});return}this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:b.attributes.KEYFORMAT,keyId:b.attributes.KEYID.substring(2)},pssh:b_(b.attributes.URI.split(",")[1])};return}b.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),a={method:b.attributes.METHOD||"AES-128",uri:b.attributes.URI},typeof b.attributes.IV<"u"&&(a.iv=b.attributes.IV)},"media-sequence"(){if(!isFinite(b.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+b.number});return}this.manifest.mediaSequence=b.number},"discontinuity-sequence"(){if(!isFinite(b.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+b.number});return}this.manifest.discontinuitySequence=b.number,g=b.number},"playlist-type"(){if(!/VOD|EVENT/.test(b.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+b.playlist});return}this.manifest.playlistType=b.playlistType},map(){r={},b.uri&&(r.uri=b.uri),b.byterange&&(r.byterange=b.byterange),a&&(r.key=a)},"stream-inf"(){if(this.manifest.playlists=n,this.manifest.mediaGroups=this.manifest.mediaGroups||c,!b.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}s.attributes||(s.attributes={}),xt(s.attributes,b.attributes)},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||c,!(b.attributes&&b.attributes.TYPE&&b.attributes["GROUP-ID"]&&b.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}const C=this.manifest.mediaGroups[b.attributes.TYPE];C[b.attributes["GROUP-ID"]]=C[b.attributes["GROUP-ID"]]||{},A=C[b.attributes["GROUP-ID"]],L={default:/yes/i.test(b.attributes.DEFAULT)},L.default?L.autoselect=!0:L.autoselect=/yes/i.test(b.attributes.AUTOSELECT),b.attributes.LANGUAGE&&(L.language=b.attributes.LANGUAGE),b.attributes.URI&&(L.uri=b.attributes.URI),b.attributes["INSTREAM-ID"]&&(L.instreamId=b.attributes["INSTREAM-ID"]),b.attributes.CHARACTERISTICS&&(L.characteristics=b.attributes.CHARACTERISTICS),b.attributes.FORCED&&(L.forced=/yes/i.test(b.attributes.FORCED)),A[b.attributes.NAME]=L},discontinuity(){g+=1,s.discontinuity=!0,this.manifest.discontinuityStarts.push(n.length)},"program-date-time"(){typeof this.manifest.dateTimeString>"u"&&(this.manifest.dateTimeString=b.dateTimeString,this.manifest.dateTimeObject=b.dateTimeObject),s.dateTimeString=b.dateTimeString,s.dateTimeObject=b.dateTimeObject;const{lastProgramDateTime:C}=this;this.lastProgramDateTime=new Date(b.dateTimeString).getTime(),C===null&&this.manifest.segments.reduceRight((w,R)=>(R.programDateTime=w-R.duration*1e3,R.programDateTime),this.lastProgramDateTime)},targetduration(){if(!isFinite(b.duration)||b.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+b.duration});return}this.manifest.targetDuration=b.duration,zc.call(this,this.manifest)},start(){if(!b.attributes||isNaN(b.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:b.attributes["TIME-OFFSET"],precise:b.attributes.PRECISE}},"cue-out"(){s.cueOut=b.data},"cue-out-cont"(){s.cueOutCont=b.data},"cue-in"(){s.cueIn=b.data},skip(){this.manifest.skip=$n(b.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",b.attributes,["SKIPPED-SEGMENTS"])},part(){o=!0;const C=this.manifest.segments.length,w=$n(b.attributes);s.parts=s.parts||[],s.parts.push(w),w.byterange&&(w.byterange.hasOwnProperty("offset")||(w.byterange.offset=_),_=w.byterange.offset+w.byterange.length);const R=s.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${R} for segment #${C}`,b.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((O,U)=>{O.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${U} lacks required attribute(s): LAST-PART`})})},"server-control"(){const C=this.manifest.serverControl=$n(b.attributes);C.hasOwnProperty("canBlockReload")||(C.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),zc.call(this,this.manifest),C.canSkipDateranges&&!C.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint"(){const C=this.manifest.segments.length,w=$n(b.attributes),R=w.type&&w.type==="PART";s.preloadHints=s.preloadHints||[],s.preloadHints.push(w),w.byterange&&(w.byterange.hasOwnProperty("offset")||(w.byterange.offset=R?_:0,R&&(_=w.byterange.offset+w.byterange.length)));const O=s.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${O} for segment #${C}`,b.attributes,["TYPE","URI"]),!!w.type)for(let U=0;UU.id===w.id);this.manifest.dateRanges[O]=xt(this.manifest.dateRanges[O],w),x[w.id]=xt(x[w.id],w),this.manifest.dateRanges.pop()}},"independent-segments"(){this.manifest.independentSegments=!0},"i-frames-only"(){this.manifest.iFramesOnly=!0,this.requiredCompatibilityversion(this.manifest.version,4)},"content-steering"(){this.manifest.contentSteering=$n(b.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",b.attributes,["SERVER-URI"])},define(){this.manifest.definitions=this.manifest.definitions||{};const C=(w,R)=>{if(w in this.manifest.definitions){this.trigger("error",{message:`EXT-X-DEFINE: Duplicate name ${w}`});return}this.manifest.definitions[w]=R};if("QUERYPARAM"in b.attributes){if("NAME"in b.attributes||"IMPORT"in b.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}const w=this.params.get(b.attributes.QUERYPARAM);if(!w){this.trigger("error",{message:`EXT-X-DEFINE: No query param ${b.attributes.QUERYPARAM}`});return}C(b.attributes.QUERYPARAM,decodeURIComponent(w));return}if("NAME"in b.attributes){if("IMPORT"in b.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}if(!("VALUE"in b.attributes)||typeof b.attributes.VALUE!="string"){this.trigger("error",{message:`EXT-X-DEFINE: No value for ${b.attributes.NAME}`});return}C(b.attributes.NAME,b.attributes.VALUE);return}if("IMPORT"in b.attributes){if(!this.mainDefinitions[b.attributes.IMPORT]){this.trigger("error",{message:`EXT-X-DEFINE: No value ${b.attributes.IMPORT} to import, or IMPORT used on main playlist`});return}C(b.attributes.IMPORT,this.mainDefinitions[b.attributes.IMPORT]);return}this.trigger("error",{message:"EXT-X-DEFINE: No attribute"})},"i-frame-playlist"(){this.manifest.iFramePlaylists.push({attributes:b.attributes,uri:b.uri,timeline:g}),this.warnOnMissingAttributes_("#EXT-X-I-FRAME-STREAM-INF",b.attributes,["BANDWIDTH","URI"])}}[b.tagType]||u).call(i)},uri(){s.uri=b.uri,n.push(s),this.manifest.targetDuration&&!("duration"in s)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),s.duration=this.manifest.targetDuration),a&&(s.key=a),s.timeline=g,r&&(s.map=r),_=0,this.lastProgramDateTime!==null&&(s.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=s.duration*1e3),s={}},comment(){},custom(){b.segment?(s.custom=s.custom||{},s.custom[b.customType]=b.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[b.customType]=b.data)}})[b.type].call(i)})}requiredCompatibilityversion(e,i){(eg&&(f-=g,f-=g,f-=Ft(2))}return Number(f)},UC=function(e,i){var n={},s=n.le,r=s===void 0?!1:s;(typeof e!="bigint"&&typeof e!="number"||typeof e=="number"&&e!==e)&&(e=0),e=Ft(e);for(var a=NC(e),o=new Uint8Array(new ArrayBuffer(a)),u=0;u=i.length&&c.call(i,function(f,g){var y=u[g]?u[g]&e[a+g]:e[a+g];return f===y})},$C=function(e,i,n){i.forEach(function(s){for(var r in e.mediaGroups[s])for(var a in e.mediaGroups[s][r]){var o=e.mediaGroups[s][r][a];n(o,s,r,a)}})},pa={},bn={},bs={},Bg;function ku(){if(Bg)return bs;Bg=1;function t(r,a,o){if(o===void 0&&(o=Array.prototype),r&&typeof o.find=="function")return o.find.call(r,a);for(var u=0;u=0&&E=0){for(var Te=I.length-1;ie0},lookupPrefix:function(E){for(var I=this;I;){var z=I._nsMap;if(z){for(var ie in z)if(Object.prototype.hasOwnProperty.call(z,ie)&&z[ie]===E)return ie}I=I.nodeType==y?I.ownerDocument:I.parentNode}return null},lookupNamespaceURI:function(E){for(var I=this;I;){var z=I._nsMap;if(z&&Object.prototype.hasOwnProperty.call(z,E))return z[E];I=I.nodeType==y?I.ownerDocument:I.parentNode}return null},isDefaultNamespace:function(E){var I=this.lookupPrefix(E);return I==null}};function ne(E){return E=="<"&&"<"||E==">"&&">"||E=="&"&&"&"||E=='"'&&"""||"&#"+E.charCodeAt()+";"}u(f,re),u(f,re.prototype);function Ce(E,I){if(I(E))return!0;if(E=E.firstChild)do if(Ce(E,I))return!0;while(E=E.nextSibling)}function Ie(){this.ownerDocument=this}function De(E,I,z){E&&E._inc++;var ie=z.namespaceURI;ie===i.XMLNS&&(I._nsMap[z.prefix?z.localName:""]=z.value)}function Se(E,I,z,ie){E&&E._inc++;var Te=z.namespaceURI;Te===i.XMLNS&&delete I._nsMap[z.prefix?z.localName:""]}function te(E,I,z){if(E&&E._inc){E._inc++;var ie=I.childNodes;if(z)ie[ie.length++]=z;else{for(var Te=I.firstChild,Ne=0;Te;)ie[Ne++]=Te,Te=Te.nextSibling;ie.length=Ne,delete ie[ie.length]}}}function ye(E,I){var z=I.previousSibling,ie=I.nextSibling;return z?z.nextSibling=ie:E.firstChild=ie,ie?ie.previousSibling=z:E.lastChild=z,I.parentNode=null,I.previousSibling=null,I.nextSibling=null,te(E.ownerDocument,E),I}function ve(E){return E&&(E.nodeType===re.DOCUMENT_NODE||E.nodeType===re.DOCUMENT_FRAGMENT_NODE||E.nodeType===re.ELEMENT_NODE)}function we(E){return E&&(ze(E)||M(E)||Be(E)||E.nodeType===re.DOCUMENT_FRAGMENT_NODE||E.nodeType===re.COMMENT_NODE||E.nodeType===re.PROCESSING_INSTRUCTION_NODE)}function Be(E){return E&&E.nodeType===re.DOCUMENT_TYPE_NODE}function ze(E){return E&&E.nodeType===re.ELEMENT_NODE}function M(E){return E&&E.nodeType===re.TEXT_NODE}function j(E,I){var z=E.childNodes||[];if(e(z,ze)||Be(I))return!1;var ie=e(z,Be);return!(I&&ie&&z.indexOf(ie)>z.indexOf(I))}function ee(E,I){var z=E.childNodes||[];function ie(Ne){return ze(Ne)&&Ne!==I}if(e(z,ie))return!1;var Te=e(z,Be);return!(I&&Te&&z.indexOf(Te)>z.indexOf(I))}function he(E,I,z){if(!ve(E))throw new k(T,"Unexpected parent node type "+E.nodeType);if(z&&z.parentNode!==E)throw new k(S,"child not in parent");if(!we(I)||Be(I)&&E.nodeType!==re.DOCUMENT_NODE)throw new k(T,"Unexpected node type "+I.nodeType+" for parent node type "+E.nodeType)}function ce(E,I,z){var ie=E.childNodes||[],Te=I.childNodes||[];if(I.nodeType===re.DOCUMENT_FRAGMENT_NODE){var Ne=Te.filter(ze);if(Ne.length>1||e(Te,M))throw new k(T,"More than one element or text in fragment");if(Ne.length===1&&!j(E,z))throw new k(T,"Element in fragment can not be inserted before doctype")}if(ze(I)&&!j(E,z))throw new k(T,"Only one element can be added and only after doctype");if(Be(I)){if(e(ie,Be))throw new k(T,"Only one doctype is allowed");var nt=e(ie,ze);if(z&&ie.indexOf(nt)1||e(Te,M))throw new k(T,"More than one element or text in fragment");if(Ne.length===1&&!ee(E,z))throw new k(T,"Element in fragment can not be inserted before doctype")}if(ze(I)&&!ee(E,z))throw new k(T,"Only one element can be added and only after doctype");if(Be(I)){if(e(ie,function(Ni){return Be(Ni)&&Ni!==z}))throw new k(T,"Only one doctype is allowed");var nt=e(ie,ze);if(z&&ie.indexOf(nt)0&&Ce(z.documentElement,function(Te){if(Te!==z&&Te.nodeType===g){var Ne=Te.getAttribute("class");if(Ne){var nt=E===Ne;if(!nt){var qt=a(Ne);nt=I.every(o(qt))}nt&&ie.push(Te)}}}),ie})},createElement:function(E){var I=new pe;I.ownerDocument=this,I.nodeName=E,I.tagName=E,I.localName=E,I.childNodes=new V;var z=I.attributes=new Z;return z._ownerElement=I,I},createDocumentFragment:function(){var E=new dt;return E.ownerDocument=this,E.childNodes=new V,E},createTextNode:function(E){var I=new Ee;return I.ownerDocument=this,I.appendData(E),I},createComment:function(E){var I=new ke;return I.ownerDocument=this,I.appendData(E),I},createCDATASection:function(E){var I=new Le;return I.ownerDocument=this,I.appendData(E),I},createProcessingInstruction:function(E,I){var z=new He;return z.ownerDocument=this,z.tagName=z.nodeName=z.target=E,z.nodeValue=z.data=I,z},createAttribute:function(E){var I=new ge;return I.ownerDocument=this,I.name=E,I.nodeName=E,I.localName=E,I.specified=!0,I},createEntityReference:function(E){var I=new Et;return I.ownerDocument=this,I.nodeName=E,I},createElementNS:function(E,I){var z=new pe,ie=I.split(":"),Te=z.attributes=new Z;return z.childNodes=new V,z.ownerDocument=this,z.nodeName=I,z.tagName=I,z.namespaceURI=E,ie.length==2?(z.prefix=ie[0],z.localName=ie[1]):z.localName=I,Te._ownerElement=z,z},createAttributeNS:function(E,I){var z=new ge,ie=I.split(":");return z.ownerDocument=this,z.nodeName=I,z.name=I,z.namespaceURI=E,z.specified=!0,ie.length==2?(z.prefix=ie[0],z.localName=ie[1]):z.localName=I,z}},c(Ie,re);function pe(){this._nsMap={}}pe.prototype={nodeType:g,hasAttribute:function(E){return this.getAttributeNode(E)!=null},getAttribute:function(E){var I=this.getAttributeNode(E);return I&&I.value||""},getAttributeNode:function(E){return this.attributes.getNamedItem(E)},setAttribute:function(E,I){var z=this.ownerDocument.createAttribute(E);z.value=z.nodeValue=""+I,this.setAttributeNode(z)},removeAttribute:function(E){var I=this.getAttributeNode(E);I&&this.removeAttributeNode(I)},appendChild:function(E){return E.nodeType===O?this.insertBefore(E,null):fe(this,E)},setAttributeNode:function(E){return this.attributes.setNamedItem(E)},setAttributeNodeNS:function(E){return this.attributes.setNamedItemNS(E)},removeAttributeNode:function(E){return this.attributes.removeNamedItem(E.nodeName)},removeAttributeNS:function(E,I){var z=this.getAttributeNodeNS(E,I);z&&this.removeAttributeNode(z)},hasAttributeNS:function(E,I){return this.getAttributeNodeNS(E,I)!=null},getAttributeNS:function(E,I){var z=this.getAttributeNodeNS(E,I);return z&&z.value||""},setAttributeNS:function(E,I,z){var ie=this.ownerDocument.createAttributeNS(E,I);ie.value=ie.nodeValue=""+z,this.setAttributeNode(ie)},getAttributeNodeNS:function(E,I){return this.attributes.getNamedItemNS(E,I)},getElementsByTagName:function(E){return new F(this,function(I){var z=[];return Ce(I,function(ie){ie!==I&&ie.nodeType==g&&(E==="*"||ie.tagName==E)&&z.push(ie)}),z})},getElementsByTagNameNS:function(E,I){return new F(this,function(z){var ie=[];return Ce(z,function(Te){Te!==z&&Te.nodeType===g&&(E==="*"||Te.namespaceURI===E)&&(I==="*"||Te.localName==I)&&ie.push(Te)}),ie})}},Ie.prototype.getElementsByTagName=pe.prototype.getElementsByTagName,Ie.prototype.getElementsByTagNameNS=pe.prototype.getElementsByTagNameNS,c(pe,re);function ge(){}ge.prototype.nodeType=y,c(ge,re);function Pe(){}Pe.prototype={data:"",substringData:function(E,I){return this.data.substring(E,E+I)},appendData:function(E){E=this.data+E,this.nodeValue=this.data=E,this.length=E.length},insertData:function(E,I){this.replaceData(E,0,I)},appendChild:function(E){throw new Error(X[T])},deleteData:function(E,I){this.replaceData(E,I,"")},replaceData:function(E,I,z){var ie=this.data.substring(0,E),Te=this.data.substring(E+I);z=ie+z+Te,this.nodeValue=this.data=z,this.length=z.length}},c(Pe,re);function Ee(){}Ee.prototype={nodeName:"#text",nodeType:_,splitText:function(E){var I=this.data,z=I.substring(E);I=I.substring(0,E),this.data=this.nodeValue=I,this.length=I.length;var ie=this.ownerDocument.createTextNode(z);return this.parentNode&&this.parentNode.insertBefore(ie,this.nextSibling),ie}},c(Ee,Pe);function ke(){}ke.prototype={nodeName:"#comment",nodeType:C},c(ke,Pe);function Le(){}Le.prototype={nodeName:"#cdata-section",nodeType:x},c(Le,Pe);function qe(){}qe.prototype.nodeType=R,c(qe,re);function Xe(){}Xe.prototype.nodeType=U,c(Xe,re);function Ke(){}Ke.prototype.nodeType=A,c(Ke,re);function Et(){}Et.prototype.nodeType=b,c(Et,re);function dt(){}dt.prototype.nodeName="#document-fragment",dt.prototype.nodeType=O,c(dt,re);function He(){}He.prototype.nodeType=L,c(He,re);function It(){}It.prototype.serializeToString=function(E,I,z){return ci.call(E,I,z)},re.prototype.toString=ci;function ci(E,I){var z=[],ie=this.nodeType==9&&this.documentElement||this,Te=ie.prefix,Ne=ie.namespaceURI;if(Ne&&Te==null){var Te=ie.lookupPrefix(Ne);if(Te==null)var nt=[{namespace:Ne,prefix:null}]}return Dt(this,z,E,I,nt),z.join("")}function ds(E,I,z){var ie=E.prefix||"",Te=E.namespaceURI;if(!Te||ie==="xml"&&Te===i.XML||Te===i.XMLNS)return!1;for(var Ne=z.length;Ne--;){var nt=z[Ne];if(nt.prefix===ie)return nt.namespace!==Te}return!0}function At(E,I,z){E.push(" ",I,'="',z.replace(/[<>&"\t\n\r]/g,ne),'"')}function Dt(E,I,z,ie,Te){if(Te||(Te=[]),ie)if(E=ie(E),E){if(typeof E=="string"){I.push(E);return}}else return;switch(E.nodeType){case g:var Ne=E.attributes,nt=Ne.length,bt=E.firstChild,qt=E.tagName;z=i.isHTML(E.namespaceURI)||z;var Ni=qt;if(!z&&!E.prefix&&E.namespaceURI){for(var Yi,Bi=0;Bi=0;Qi--){var Fi=Te[Qi];if(Fi.prefix===""&&Fi.namespace===E.namespaceURI){Yi=Fi.namespace;break}}if(Yi!==E.namespaceURI)for(var Qi=Te.length-1;Qi>=0;Qi--){var Fi=Te[Qi];if(Fi.namespace===E.namespaceURI){Fi.prefix&&(Ni=Fi.prefix+":"+qt);break}}}I.push("<",Ni);for(var Ti=0;Ti"),z&&/^script$/i.test(qt))for(;bt;)bt.data?I.push(bt.data):Dt(bt,I,z,ie,Te.slice()),bt=bt.nextSibling;else for(;bt;)Dt(bt,I,z,ie,Te.slice()),bt=bt.nextSibling;I.push("")}else I.push("/>");return;case w:case O:for(var bt=E.firstChild;bt;)Dt(bt,I,z,ie,Te.slice()),bt=bt.nextSibling;return;case y:return At(I,E.name,E.value);case _:return I.push(E.data.replace(/[<&>]/g,ne));case x:return I.push("");case C:return I.push("");case R:var xi=E.publicId,Ui=E.systemId;if(I.push("");else if(Ui&&Ui!=".")I.push(" SYSTEM ",Ui,">");else{var Qe=E.internalSubset;Qe&&I.push(" [",Qe,"]"),I.push(">")}return;case L:return I.push("");case b:return I.push("&",E.nodeName,";");default:I.push("??",E.nodeName)}}function hs(E,I,z){var ie;switch(I.nodeType){case g:ie=I.cloneNode(!1),ie.ownerDocument=E;case O:break;case y:z=!0;break}if(ie||(ie=I.cloneNode(!1)),ie.ownerDocument=E,ie.parentNode=null,z)for(var Te=I.firstChild;Te;)ie.appendChild(hs(E,Te,z)),Te=Te.nextSibling;return ie}function Wr(E,I,z){var ie=new I.constructor;for(var Te in I)if(Object.prototype.hasOwnProperty.call(I,Te)){var Ne=I[Te];typeof Ne!="object"&&Ne!=ie[Te]&&(ie[Te]=Ne)}switch(I.childNodes&&(ie.childNodes=new V),ie.ownerDocument=E,ie.nodeType){case g:var nt=I.attributes,qt=ie.attributes=new Z,Ni=nt.length;qt._ownerElement=ie;for(var Yi=0;Yi",lt:"<",quot:'"'}),t.HTML_ENTITIES=e({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:` `,nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}),t.entityMap=t.HTML_ENTITIES}(Gc)),Gc}var Jo={},qg;function VC(){if(qg)return Jo;qg=1;var t=ku().NAMESPACE,e=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,i=new RegExp("[\\-\\.0-9"+e.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),n=new RegExp("^"+e.source+i.source+"*(?::"+e.source+i.source+"*)?$"),s=0,r=1,a=2,o=3,u=4,c=5,f=6,g=7;function y(T,S){this.message=T,this.locator=S,Error.captureStackTrace&&Error.captureStackTrace(this,y)}y.prototype=new Error,y.prototype.name=y.name;function _(){}_.prototype={parse:function(T,S,B){var k=this.domBuilder;k.startDocument(),R(S,S={}),x(T,S,B,k,this.errorHandler),k.endDocument()}};function x(T,S,B,k,V){function F(pe){if(pe>65535){pe-=65536;var ge=55296+(pe>>10),Pe=56320+(pe&1023);return String.fromCharCode(ge,Pe)}else return String.fromCharCode(pe)}function Y(pe){var ge=pe.slice(1,-1);return Object.hasOwnProperty.call(B,ge)?B[ge]:ge.charAt(0)==="#"?F(parseInt(ge.substr(1).replace("x","0x"))):(V.error("entity not found:"+pe),pe)}function Z(pe){if(pe>Ie){var ge=T.substring(Ie,pe).replace(/&#?\w+;/g,Y);re&&G(Ie),k.characters(ge,0,pe-Ie),Ie=pe}}function G(pe,ge){for(;pe>=Q&&(ge=se.exec(T));)W=ge.index,Q=W+ge[0].length,re.lineNumber++;re.columnNumber=pe-W+1}for(var W=0,Q=0,se=/.*(?:\r\n?|\n)|.*$/g,re=k.locator,ne=[{currentNSMap:S}],Ce={},Ie=0;;){try{var De=T.indexOf("<",Ie);if(De<0){if(!T.substr(Ie).match(/^\s*$/)){var Se=k.doc,te=Se.createTextNode(T.substr(Ie));Se.appendChild(te),k.currentElement=te}return}switch(De>Ie&&Z(De),T.charAt(De+1)){case"/":var he=T.indexOf(">",De+3),ye=T.substring(De+2,he).replace(/[ \t\n\r]+$/g,""),ve=ne.pop();he<0?(ye=T.substring(De+2).replace(/[\s<].*/,""),V.error("end tag name: "+ye+" is not complete:"+ve.tagName),he=De+1+ye.length):ye.match(/\sIe?Ie=he:Z(Math.max(De,Ie)+1)}}function b(T,S){return S.lineNumber=T.lineNumber,S.columnNumber=T.columnNumber,S}function A(T,S,B,k,V,F){function Y(re,ne,Ce){B.attributeNames.hasOwnProperty(re)&&F.fatalError("Attribute "+re+" redefined"),B.addValue(re,ne.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,V),Ce)}for(var Z,G,W=++S,Q=s;;){var se=T.charAt(W);switch(se){case"=":if(Q===r)Z=T.slice(S,W),Q=o;else if(Q===a)Q=o;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(Q===o||Q===r)if(Q===r&&(F.warning('attribute value must after "="'),Z=T.slice(S,W)),S=W+1,W=T.indexOf(se,S),W>0)G=T.slice(S,W),Y(Z,G,S-1),Q=c;else throw new Error("attribute value no end '"+se+"' match");else if(Q==u)G=T.slice(S,W),Y(Z,G,S),F.warning('attribute "'+Z+'" missed start quot('+se+")!!"),S=W+1,Q=c;else throw new Error('attribute value must after "="');break;case"/":switch(Q){case s:B.setTagName(T.slice(S,W));case c:case f:case g:Q=g,B.closed=!0;case u:case r:break;case a:B.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return F.error("unexpected end of input"),Q==s&&B.setTagName(T.slice(S,W)),W;case">":switch(Q){case s:B.setTagName(T.slice(S,W));case c:case f:case g:break;case u:case r:G=T.slice(S,W),G.slice(-1)==="/"&&(B.closed=!0,G=G.slice(0,-1));case a:Q===a&&(G=Z),Q==u?(F.warning('attribute "'+G+'" missed quot(")!'),Y(Z,G,S)):((!t.isHTML(k[""])||!G.match(/^(?:disabled|checked|selected)$/i))&&F.warning('attribute "'+G+'" missed value!! "'+G+'" instead!!'),Y(G,G,S));break;case o:throw new Error("attribute value missed!!")}return W;case"€":se=" ";default:if(se<=" ")switch(Q){case s:B.setTagName(T.slice(S,W)),Q=f;break;case r:Z=T.slice(S,W),Q=a;break;case u:var G=T.slice(S,W);F.warning('attribute "'+G+'" missed quot(")!!'),Y(Z,G,S);case c:Q=f;break}else switch(Q){case a:B.tagName,(!t.isHTML(k[""])||!Z.match(/^(?:disabled|checked|selected)$/i))&&F.warning('attribute "'+Z+'" missed value!! "'+Z+'" instead2!!'),Y(Z,Z,S),S=W,Q=r;break;case c:F.warning('attribute space is required"'+Z+'"!!');case f:Q=r,S=W;break;case o:Q=u,S=W;break;case g:throw new Error("elements closed character '/' and '>' must be connected to")}}W++}}function L(T,S,B){for(var k=T.tagName,V=null,se=T.length;se--;){var F=T[se],Y=F.qName,Z=F.value,re=Y.indexOf(":");if(re>0)var G=F.prefix=Y.slice(0,re),W=Y.slice(re+1),Q=G==="xmlns"&&W;else W=Y,G=null,Q=Y==="xmlns"&&"";F.localName=W,Q!==!1&&(V==null&&(V={},R(B,B={})),B[Q]=V[Q]=Z,F.uri=t.XMLNS,S.startPrefixMapping(Q,Z))}for(var se=T.length;se--;){F=T[se];var G=F.prefix;G&&(G==="xml"&&(F.uri=t.XML),G!=="xmlns"&&(F.uri=B[G||""]))}var re=k.indexOf(":");re>0?(G=T.prefix=k.slice(0,re),W=T.localName=k.slice(re+1)):(G=null,W=T.localName=k);var ne=T.uri=B[G||""];if(S.startElement(ne,W,k,T),T.closed){if(S.endElement(ne,W,k),V)for(G in V)Object.prototype.hasOwnProperty.call(V,G)&&S.endPrefixMapping(G)}else return T.currentNSMap=B,T.localNSMap=V,!0}function C(T,S,B,k,V){if(/^(?:script|textarea)$/i.test(B)){var F=T.indexOf("",S),Y=T.substring(S+1,F);if(/[&<]/.test(Y))return/^script$/i.test(B)?(V.characters(Y,0,Y.length),F):(Y=Y.replace(/&#?\w+;/g,k),V.characters(Y,0,Y.length),F)}return S+1}function w(T,S,B,k){var V=k[B];return V==null&&(V=T.lastIndexOf(""),V",S+4);return F>S?(B.comment(T,S+4,F-S-4),F+3):(k.error("Unclosed comment"),-1)}else return-1;default:if(T.substr(S+3,6)=="CDATA["){var F=T.indexOf("]]>",S+9);return B.startCDATA(),B.characters(T,S+9,F-S-9),B.endCDATA(),F+3}var Y=X(T,S),Z=Y.length;if(Z>1&&/!doctype/i.test(Y[0][0])){var G=Y[1][0],W=!1,Q=!1;Z>3&&(/^public$/i.test(Y[2][0])?(W=Y[3][0],Q=Z>4&&Y[4][0]):/^system$/i.test(Y[2][0])&&(Q=Y[3][0]));var se=Y[Z-1];return B.startDTD(G,W,Q),B.endDTD(),se.index+se[0].length}}return-1}function U(T,S,B){var k=T.indexOf("?>",S);if(k){var V=T.substring(S,k).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return V?(V[0].length,B.processingInstruction(V[1],V[2]),k+2):-1}return-1}function H(){this.attributeNames={}}H.prototype={setTagName:function(T){if(!n.test(T))throw new Error("invalid tagName:"+T);this.tagName=T},addValue:function(T,S,B){if(!n.test(T))throw new Error("invalid attribute:"+T);this.attributeNames[T]=this.length,this[this.length++]={qName:T,value:S,offset:B}},length:0,getLocalName:function(T){return this[T].localName},getLocator:function(T){return this[T].locator},getQName:function(T){return this[T].qName},getURI:function(T){return this[T].uri},getValue:function(T){return this[T].value}};function X(T,S){var B,k=[],V=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(V.lastIndex=S,V.exec(T);B=V.exec(T);)if(k.push(B),B[1])return k}return Jo.XMLReader=_,Jo.ParseError=y,Jo}var $g;function HC(){if($g)return ga;$g=1;var t=ku(),e=w_(),i=jC(),n=VC(),s=e.DOMImplementation,r=t.NAMESPACE,a=n.ParseError,o=n.XMLReader;function u(A){return A.replace(/\r[\n\u0085]/g,` `).replace(/[\r\u0085\u2028]/g,` `)}function c(A){this.options=A||{locator:{}}}c.prototype.parseFromString=function(A,L){var C=this.options,w=new o,R=C.domBuilder||new g,O=C.errorHandler,U=C.locator,H=C.xmlns||{},X=/\/x?html?$/.test(L),T=X?i.HTML_ENTITIES:i.XML_ENTITIES;U&&R.setDocumentLocator(U),w.errorHandler=f(O,R,U),w.domBuilder=C.domBuilder||R,X&&(H[""]=r.HTML),H.xml=H.xml||r.XML;var S=C.normalizeLineEndings||u;return A&&typeof A=="string"?w.parse(S(A),H,T):w.errorHandler.error("invalid doc source"),R.doc};function f(A,L,C){if(!A){if(L instanceof g)return L;A=L}var w={},R=A instanceof Function;C=C||{};function O(U){var H=A[U];!H&&R&&(H=A.length==2?function(X){A(U,X)}:A),w[U]=H&&function(X){H("[xmldom "+U+"] "+X+_(C))}||function(){}}return O("warning"),O("error"),O("fatalError"),w}function g(){this.cdata=!1}function y(A,L){L.lineNumber=A.lineNumber,L.columnNumber=A.columnNumber}g.prototype={startDocument:function(){this.doc=new s().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(A,L,C,w){var R=this.doc,O=R.createElementNS(A,C||L),U=w.length;b(this,O),this.currentElement=O,this.locator&&y(this.locator,O);for(var H=0;H=L+C||L?new java.lang.String(A,L,C)+"":A}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(A){g.prototype[A]=function(){return null}});function b(A,L){A.currentElement?A.currentElement.appendChild(L):A.doc.appendChild(L)}return ga.__DOMHandler=g,ga.normalizeLineEndings=u,ga.DOMParser=c,ga}var jg;function zC(){if(jg)return pa;jg=1;var t=w_();return pa.DOMImplementation=t.DOMImplementation,pa.XMLSerializer=t.XMLSerializer,pa.DOMParser=HC().DOMParser,pa}var WC=zC();/*! @name mpd-parser @version 1.3.1 @license Apache-2.0 */const Vg=t=>!!t&&typeof t=="object",Lt=(...t)=>t.reduce((e,i)=>(typeof i!="object"||Object.keys(i).forEach(n=>{Array.isArray(e[n])&&Array.isArray(i[n])?e[n]=e[n].concat(i[n]):Vg(e[n])&&Vg(i[n])?e[n]=Lt(e[n],i[n]):e[n]=i[n]}),e),{}),A_=t=>Object.keys(t).map(e=>t[e]),GC=(t,e)=>{const i=[];for(let n=t;nt.reduce((e,i)=>e.concat(i),[]),D_=t=>{if(!t.length)return[];const e=[];for(let i=0;it.reduce((i,n,s)=>(n[e]&&i.push(s),i),[]),XC=(t,e)=>A_(t.reduce((i,n)=>(n.forEach(s=>{i[e(s)]=s}),i),{}));var Ar={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",INVALID_NUMBER_OF_CONTENT_STEERING:"INVALID_NUMBER_OF_CONTENT_STEERING",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",MISSING_SEGMENT_INFORMATION:"MISSING_SEGMENT_INFORMATION",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"};const eo=({baseUrl:t="",source:e="",range:i="",indexRange:n=""})=>{const s={uri:e,resolvedUri:Du(t||"",e)};if(i||n){const a=(i||n).split("-");let o=$.BigInt?$.BigInt(a[0]):parseInt(a[0],10),u=$.BigInt?$.BigInt(a[1]):parseInt(a[1],10);o{let e;return typeof t.offset=="bigint"||typeof t.length=="bigint"?e=$.BigInt(t.offset)+$.BigInt(t.length)-$.BigInt(1):e=t.offset+t.length-1,`${t.offset}-${e}`},Hg=t=>(t&&typeof t!="number"&&(t=parseInt(t,10)),isNaN(t)?null:t),QC={static(t){const{duration:e,timescale:i=1,sourceDuration:n,periodDuration:s}=t,r=Hg(t.endNumber),a=e/i;return typeof r=="number"?{start:0,end:r}:typeof s=="number"?{start:0,end:s/a}:{start:0,end:n/a}},dynamic(t){const{NOW:e,clientOffset:i,availabilityStartTime:n,timescale:s=1,duration:r,periodStart:a=0,minimumUpdatePeriod:o=0,timeShiftBufferDepth:u=1/0}=t,c=Hg(t.endNumber),f=(e+i)/1e3,g=n+a,_=f+o-g,x=Math.ceil(_*s/r),b=Math.floor((f-g-u)*s/r),A=Math.floor((f-g)*s/r);return{start:Math.max(0,b),end:typeof c=="number"?c:Math.min(x,A)}}},JC=t=>e=>{const{duration:i,timescale:n=1,periodStart:s,startNumber:r=1}=t;return{number:r+e,duration:i/n,timeline:s,time:e*i}},ef=t=>{const{type:e,duration:i,timescale:n=1,periodDuration:s,sourceDuration:r}=t,{start:a,end:o}=QC[e](t),u=GC(a,o).map(JC(t));if(e==="static"){const c=u.length-1,f=typeof s=="number"?s:r;u[c].duration=f-i/n*c}return u},k_=t=>{const{baseUrl:e,initialization:i={},sourceDuration:n,indexRange:s="",periodStart:r,presentationTime:a,number:o=0,duration:u}=t;if(!e)throw new Error(Ar.NO_BASE_URL);const c=eo({baseUrl:e,source:i.sourceURL,range:i.range}),f=eo({baseUrl:e,source:e,indexRange:s});if(f.map=c,u){const g=ef(t);g.length&&(f.duration=g[0].duration,f.timeline=g[0].timeline)}else n&&(f.duration=n,f.timeline=r);return f.presentationTime=a||r,f.number=o,[f]},tf=(t,e,i)=>{const n=t.sidx.map?t.sidx.map:null,s=t.sidx.duration,r=t.timeline||0,a=t.sidx.byterange,o=a.offset+a.length,u=e.timescale,c=e.references.filter(A=>A.referenceType!==1),f=[],g=t.endList?"static":"dynamic",y=t.sidx.timeline;let _=y,x=t.mediaSequence||0,b;typeof e.firstOffset=="bigint"?b=$.BigInt(o)+e.firstOffset:b=o+e.firstOffset;for(let A=0;AXC(t,({timeline:e})=>e).sort((e,i)=>e.timeline>i.timeline?1:-1),tw=(t,e)=>{for(let i=0;i{let e=[];return $C(t,ZC,(i,n,s,r)=>{e=e.concat(i.playlists||[])}),e},Wg=({playlist:t,mediaSequence:e})=>{t.mediaSequence=e,t.segments.forEach((i,n)=>{i.number=t.mediaSequence+n})},iw=({oldPlaylists:t,newPlaylists:e,timelineStarts:i})=>{e.forEach(n=>{n.discontinuitySequence=i.findIndex(function({timeline:u}){return u===n.timeline});const s=tw(t,n.attributes.NAME);if(!s||n.sidx)return;const r=n.segments[0],a=s.segments.findIndex(function(u){return Math.abs(u.presentationTime-r.presentationTime)s.timeline||s.segments.length&&n.timeline>s.segments[s.segments.length-1].timeline)&&n.discontinuitySequence--;return}s.segments[a].discontinuity&&!r.discontinuity&&(r.discontinuity=!0,n.discontinuityStarts.unshift(0),n.discontinuitySequence--),Wg({playlist:n,mediaSequence:s.segments[a].number})})},nw=({oldManifest:t,newManifest:e})=>{const i=t.playlists.concat(zg(t)),n=e.playlists.concat(zg(e));return e.timelineStarts=I_([t.timelineStarts,e.timelineStarts]),iw({oldPlaylists:i,newPlaylists:n,timelineStarts:e.timelineStarts}),e},Iu=t=>t&&t.uri+"-"+YC(t.byterange),Kc=t=>{const e=t.reduce(function(n,s){return n[s.attributes.baseUrl]||(n[s.attributes.baseUrl]=[]),n[s.attributes.baseUrl].push(s),n},{});let i=[];return Object.values(e).forEach(n=>{const s=A_(n.reduce((r,a)=>{const o=a.attributes.id+(a.attributes.lang||"");return r[o]?(a.segments&&(a.segments[0]&&(a.segments[0].discontinuity=!0),r[o].segments.push(...a.segments)),a.attributes.contentProtection&&(r[o].attributes.contentProtection=a.attributes.contentProtection)):(r[o]=a,r[o].attributes.timelineStarts=[]),r[o].attributes.timelineStarts.push({start:a.attributes.periodStart,timeline:a.attributes.periodStart}),r},{}));i=i.concat(s)}),i.map(n=>(n.discontinuityStarts=KC(n.segments||[],"discontinuity"),n))},nf=(t,e)=>{const i=Iu(t.sidx),n=i&&e[i]&&e[i].sidx;return n&&tf(t,n,t.sidx.resolvedUri),t},sw=(t,e={})=>{if(!Object.keys(e).length)return t;for(const i in t)t[i]=nf(t[i],e);return t},rw=({attributes:t,segments:e,sidx:i,mediaSequence:n,discontinuitySequence:s,discontinuityStarts:r},a)=>{const o={attributes:{NAME:t.id,BANDWIDTH:t.bandwidth,CODECS:t.codecs,"PROGRAM-ID":1},uri:"",endList:t.type==="static",timeline:t.periodStart,resolvedUri:t.baseUrl||"",targetDuration:t.duration,discontinuitySequence:s,discontinuityStarts:r,timelineStarts:t.timelineStarts,mediaSequence:n,segments:e};return t.contentProtection&&(o.contentProtection=t.contentProtection),t.serviceLocation&&(o.attributes.serviceLocation=t.serviceLocation),i&&(o.sidx=i),a&&(o.attributes.AUDIO="audio",o.attributes.SUBTITLES="subs"),o},aw=({attributes:t,segments:e,mediaSequence:i,discontinuityStarts:n,discontinuitySequence:s})=>{typeof e>"u"&&(e=[{uri:t.baseUrl,timeline:t.periodStart,resolvedUri:t.baseUrl||"",duration:t.sourceDuration,number:0}],t.duration=t.sourceDuration);const r={NAME:t.id,BANDWIDTH:t.bandwidth,"PROGRAM-ID":1};t.codecs&&(r.CODECS=t.codecs);const a={attributes:r,uri:"",endList:t.type==="static",timeline:t.periodStart,resolvedUri:t.baseUrl||"",targetDuration:t.duration,timelineStarts:t.timelineStarts,discontinuityStarts:n,discontinuitySequence:s,mediaSequence:i,segments:e};return t.serviceLocation&&(a.attributes.serviceLocation=t.serviceLocation),a},ow=(t,e={},i=!1)=>{let n;const s=t.reduce((r,a)=>{const o=a.attributes.role&&a.attributes.role.value||"",u=a.attributes.lang||"";let c=a.attributes.label||"main";if(u&&!a.attributes.label){const g=o?` (${o})`:"";c=`${a.attributes.lang}${g}`}r[c]||(r[c]={language:u,autoselect:!0,default:o==="main",playlists:[],uri:""});const f=nf(rw(a,i),e);return r[c].playlists.push(f),typeof n>"u"&&o==="main"&&(n=a,n.default=!0),r},{});if(!n){const r=Object.keys(s)[0];s[r].default=!0}return s},lw=(t,e={})=>t.reduce((i,n)=>{const s=n.attributes.label||n.attributes.lang||"text",r=n.attributes.lang||"und";return i[s]||(i[s]={language:r,default:!1,autoselect:!1,playlists:[],uri:""}),i[s].playlists.push(nf(aw(n),e)),i},{}),uw=t=>t.reduce((e,i)=>(i&&i.forEach(n=>{const{channel:s,language:r}=n;e[r]={autoselect:!1,default:!1,instreamId:s,language:r},n.hasOwnProperty("aspectRatio")&&(e[r].aspectRatio=n.aspectRatio),n.hasOwnProperty("easyReader")&&(e[r].easyReader=n.easyReader),n.hasOwnProperty("3D")&&(e[r]["3D"]=n["3D"])}),e),{}),cw=({attributes:t,segments:e,sidx:i,discontinuityStarts:n})=>{const s={attributes:{NAME:t.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:t.width,height:t.height},CODECS:t.codecs,BANDWIDTH:t.bandwidth,"PROGRAM-ID":1},uri:"",endList:t.type==="static",timeline:t.periodStart,resolvedUri:t.baseUrl||"",targetDuration:t.duration,discontinuityStarts:n,timelineStarts:t.timelineStarts,segments:e};return t.frameRate&&(s.attributes["FRAME-RATE"]=t.frameRate),t.contentProtection&&(s.contentProtection=t.contentProtection),t.serviceLocation&&(s.attributes.serviceLocation=t.serviceLocation),i&&(s.sidx=i),s},dw=({attributes:t})=>t.mimeType==="video/mp4"||t.mimeType==="video/webm"||t.contentType==="video",hw=({attributes:t})=>t.mimeType==="audio/mp4"||t.mimeType==="audio/webm"||t.contentType==="audio",fw=({attributes:t})=>t.mimeType==="text/vtt"||t.contentType==="text",pw=(t,e)=>{t.forEach(i=>{i.mediaSequence=0,i.discontinuitySequence=e.findIndex(function({timeline:n}){return n===i.timeline}),i.segments&&i.segments.forEach((n,s)=>{n.number=s})})},Gg=t=>t?Object.keys(t).reduce((e,i)=>{const n=t[i];return e.concat(n.playlists)},[]):[],gw=({dashPlaylists:t,locations:e,contentSteering:i,sidxMapping:n={},previousManifest:s,eventStream:r})=>{if(!t.length)return{};const{sourceDuration:a,type:o,suggestedPresentationDelay:u,minimumUpdatePeriod:c}=t[0].attributes,f=Kc(t.filter(dw)).map(cw),g=Kc(t.filter(hw)),y=Kc(t.filter(fw)),_=t.map(R=>R.attributes.captionServices).filter(Boolean),x={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:a,playlists:sw(f,n)};c>=0&&(x.minimumUpdatePeriod=c*1e3),e&&(x.locations=e),i&&(x.contentSteering=i),o==="dynamic"&&(x.suggestedPresentationDelay=u),r&&r.length>0&&(x.eventStream=r);const b=x.playlists.length===0,A=g.length?ow(g,n,b):null,L=y.length?lw(y,n):null,C=f.concat(Gg(A),Gg(L)),w=C.map(({timelineStarts:R})=>R);return x.timelineStarts=I_(w),pw(C,x.timelineStarts),A&&(x.mediaGroups.AUDIO.audio=A),L&&(x.mediaGroups.SUBTITLES.subs=L),_.length&&(x.mediaGroups["CLOSED-CAPTIONS"].cc=uw(_)),s?nw({oldManifest:s,newManifest:x}):x},mw=(t,e,i)=>{const{NOW:n,clientOffset:s,availabilityStartTime:r,timescale:a=1,periodStart:o=0,minimumUpdatePeriod:u=0}=t,c=(n+s)/1e3,f=r+o,y=c+u-f;return Math.ceil((y*a-e)/i)},P_=(t,e)=>{const{type:i,minimumUpdatePeriod:n=0,media:s="",sourceDuration:r,timescale:a=1,startNumber:o=1,periodStart:u}=t,c=[];let f=-1;for(let g=0;gf&&(f=b);let A;if(x<0){const w=g+1;w===e.length?i==="dynamic"&&n>0&&s.indexOf("$Number$")>0?A=mw(t,f,_):A=(r*a-f)/_:A=(e[w].t-f)/_}else A=x+1;const L=o+c.length+A;let C=o+c.length;for(;C(e,i,n,s)=>{if(e==="$$")return"$";if(typeof t[i]>"u")return e;const r=""+t[i];return i==="RepresentationID"||(n?s=parseInt(s,10):s=1,r.length>=s)?r:`${new Array(s-r.length+1).join("0")}${r}`},Kg=(t,e)=>t.replace(yw,_w(e)),vw=(t,e)=>!t.duration&&!e?[{number:t.startNumber||1,duration:t.sourceDuration,time:0,timeline:t.periodStart}]:t.duration?ef(t):P_(t,e),bw=(t,e)=>{const i={RepresentationID:t.id,Bandwidth:t.bandwidth||0},{initialization:n={sourceURL:"",range:""}}=t,s=eo({baseUrl:t.baseUrl,source:Kg(n.sourceURL,i),range:n.range});return vw(t,e).map(a=>{i.Number=a.number,i.Time=a.time;const o=Kg(t.media||"",i),u=t.timescale||1,c=t.presentationTimeOffset||0,f=t.periodStart+(a.time-c)/u;return{uri:o,timeline:a.timeline,duration:a.duration,resolvedUri:Du(t.baseUrl||"",o),map:s,number:a.number,presentationTime:f}})},Tw=(t,e)=>{const{baseUrl:i,initialization:n={}}=t,s=eo({baseUrl:i,source:n.sourceURL,range:n.range}),r=eo({baseUrl:i,source:e.media,range:e.mediaRange});return r.map=s,r},xw=(t,e)=>{const{duration:i,segmentUrls:n=[],periodStart:s}=t;if(!i&&!e||i&&e)throw new Error(Ar.SEGMENT_TIME_UNSPECIFIED);const r=n.map(u=>Tw(t,u));let a;return i&&(a=ef(t)),e&&(a=P_(t,e)),a.map((u,c)=>{if(r[c]){const f=r[c],g=t.timescale||1,y=t.presentationTimeOffset||0;return f.timeline=u.timeline,f.duration=u.duration,f.number=u.number,f.presentationTime=s+(u.time-y)/g,f}}).filter(u=>u)},Sw=({attributes:t,segmentInfo:e})=>{let i,n;e.template?(n=bw,i=Lt(t,e.template)):e.base?(n=k_,i=Lt(t,e.base)):e.list&&(n=xw,i=Lt(t,e.list));const s={attributes:t};if(!n)return s;const r=n(i,e.segmentTimeline);if(i.duration){const{duration:a,timescale:o=1}=i;i.duration=a/o}else r.length?i.duration=r.reduce((a,o)=>Math.max(a,Math.ceil(o.duration)),0):i.duration=0;return s.attributes=i,s.segments=r,e.base&&i.indexRange&&(s.sidx=r[0],s.segments=[]),s},Ew=t=>t.map(Sw),pt=(t,e)=>D_(t.childNodes).filter(({tagName:i})=>i===e),go=t=>t.textContent.trim(),Cw=t=>parseFloat(t.split("/").reduce((e,i)=>e/i)),Qs=t=>{const o=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(t);if(!o)return 0;const[u,c,f,g,y,_]=o.slice(1);return parseFloat(u||0)*31536e3+parseFloat(c||0)*2592e3+parseFloat(f||0)*86400+parseFloat(g||0)*3600+parseFloat(y||0)*60+parseFloat(_||0)},ww=t=>(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(t)&&(t+="Z"),Date.parse(t)),Xg={mediaPresentationDuration(t){return Qs(t)},availabilityStartTime(t){return ww(t)/1e3},minimumUpdatePeriod(t){return Qs(t)},suggestedPresentationDelay(t){return Qs(t)},type(t){return t},timeShiftBufferDepth(t){return Qs(t)},start(t){return Qs(t)},width(t){return parseInt(t,10)},height(t){return parseInt(t,10)},bandwidth(t){return parseInt(t,10)},frameRate(t){return Cw(t)},startNumber(t){return parseInt(t,10)},timescale(t){return parseInt(t,10)},presentationTimeOffset(t){return parseInt(t,10)},duration(t){const e=parseInt(t,10);return isNaN(e)?Qs(t):e},d(t){return parseInt(t,10)},t(t){return parseInt(t,10)},r(t){return parseInt(t,10)},presentationTime(t){return parseInt(t,10)},DEFAULT(t){return t}},wt=t=>t&&t.attributes?D_(t.attributes).reduce((e,i)=>{const n=Xg[i.name]||Xg.DEFAULT;return e[i.name]=n(i.value),e},{}):{},Aw={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime","urn:mpeg:dash:mp4protection:2011":"mp4protection"},Pu=(t,e)=>e.length?wr(t.map(function(i){return e.map(function(n){const s=go(n),r=Du(i.baseUrl,s),a=Lt(wt(n),{baseUrl:r});return r!==s&&!a.serviceLocation&&i.serviceLocation&&(a.serviceLocation=i.serviceLocation),a})})):t,sf=t=>{const e=pt(t,"SegmentTemplate")[0],i=pt(t,"SegmentList")[0],n=i&&pt(i,"SegmentURL").map(g=>Lt({tag:"SegmentURL"},wt(g))),s=pt(t,"SegmentBase")[0],r=i||e,a=r&&pt(r,"SegmentTimeline")[0],o=i||s||e,u=o&&pt(o,"Initialization")[0],c=e&&wt(e);c&&u?c.initialization=u&&wt(u):c&&c.initialization&&(c.initialization={sourceURL:c.initialization});const f={template:c,segmentTimeline:a&&pt(a,"S").map(g=>wt(g)),list:i&&Lt(wt(i),{segmentUrls:n,initialization:wt(u)}),base:s&&Lt(wt(s),{initialization:wt(u)})};return Object.keys(f).forEach(g=>{f[g]||delete f[g]}),f},Dw=(t,e,i)=>n=>{const s=pt(n,"BaseURL"),r=Pu(e,s),a=Lt(t,wt(n)),o=sf(n);return r.map(u=>({segmentInfo:Lt(i,o),attributes:Lt(a,u)}))},kw=t=>t.reduce((e,i)=>{const n=wt(i);n.schemeIdUri&&(n.schemeIdUri=n.schemeIdUri.toLowerCase());const s=Aw[n.schemeIdUri];if(s){e[s]={attributes:n};const r=pt(i,"cenc:pssh")[0];if(r){const a=go(r);e[s].pssh=a&&b_(a)}}return e},{}),Iw=t=>{if(t.schemeIdUri==="urn:scte:dash:cc:cea-608:2015")return(typeof t.value!="string"?[]:t.value.split(";")).map(i=>{let n,s;return s=i,/^CC\d=/.test(i)?[n,s]=i.split("="):/^CC\d$/.test(i)&&(n=i),{channel:n,language:s}});if(t.schemeIdUri==="urn:scte:dash:cc:cea-708:2015")return(typeof t.value!="string"?[]:t.value.split(";")).map(i=>{const n={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(i)){const[s,r=""]=i.split("=");n.channel=s,n.language=i,r.split(",").forEach(a=>{const[o,u]=a.split(":");o==="lang"?n.language=u:o==="er"?n.easyReader=Number(u):o==="war"?n.aspectRatio=Number(u):o==="3D"&&(n["3D"]=Number(u))})}else n.language=i;return n.channel&&(n.channel="SERVICE"+n.channel),n})},Pw=t=>wr(pt(t.node,"EventStream").map(e=>{const i=wt(e),n=i.schemeIdUri;return pt(e,"Event").map(s=>{const r=wt(s),a=r.presentationTime||0,o=i.timescale||1,u=r.duration||0,c=a/o+t.attributes.start;return{schemeIdUri:n,value:i.value,id:r.id,start:c,end:c+u/o,messageData:go(s)||r.messageData,contentEncoding:i.contentEncoding,presentationTimeOffset:i.presentationTimeOffset||0}})})),Ow=(t,e,i)=>n=>{const s=wt(n),r=Pu(e,pt(n,"BaseURL")),a=pt(n,"Role")[0],o={role:wt(a)};let u=Lt(t,s,o);const c=pt(n,"Accessibility")[0],f=Iw(wt(c));f&&(u=Lt(u,{captionServices:f}));const g=pt(n,"Label")[0];if(g&&g.childNodes.length){const A=g.childNodes[0].nodeValue.trim();u=Lt(u,{label:A})}const y=kw(pt(n,"ContentProtection"));Object.keys(y).length&&(u=Lt(u,{contentProtection:y}));const _=sf(n),x=pt(n,"Representation"),b=Lt(i,_);return wr(x.map(Dw(u,r,b)))},Lw=(t,e)=>(i,n)=>{const s=Pu(e,pt(i.node,"BaseURL")),r=Lt(t,{periodStart:i.attributes.start});typeof i.attributes.duration=="number"&&(r.periodDuration=i.attributes.duration);const a=pt(i.node,"AdaptationSet"),o=sf(i.node);return wr(a.map(Ow(r,s,o)))},Rw=(t,e)=>{if(t.length>1&&e({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),!t.length)return null;const i=Lt({serverURL:go(t[0])},wt(t[0]));return i.queryBeforeStart=i.queryBeforeStart==="true",i},Mw=({attributes:t,priorPeriodAttributes:e,mpdType:i})=>typeof t.start=="number"?t.start:e&&typeof e.start=="number"&&typeof e.duration=="number"?e.start+e.duration:!e&&i==="static"?0:null,Nw=(t,e={})=>{const{manifestUri:i="",NOW:n=Date.now(),clientOffset:s=0,eventHandler:r=function(){}}=e,a=pt(t,"Period");if(!a.length)throw new Error(Ar.INVALID_NUMBER_OF_PERIOD);const o=pt(t,"Location"),u=wt(t),c=Pu([{baseUrl:i}],pt(t,"BaseURL")),f=pt(t,"ContentSteering");u.type=u.type||"static",u.sourceDuration=u.mediaPresentationDuration||0,u.NOW=n,u.clientOffset=s,o.length&&(u.locations=o.map(go));const g=[];return a.forEach((y,_)=>{const x=wt(y),b=g[_-1];x.start=Mw({attributes:x,priorPeriodAttributes:b?b.attributes:null,mpdType:u.type}),g.push({node:y,attributes:x})}),{locations:u.locations,contentSteeringInfo:Rw(f,r),representationInfo:wr(g.map(Lw(u,c))),eventStream:wr(g.map(Pw))}},O_=t=>{if(t==="")throw new Error(Ar.DASH_EMPTY_MANIFEST);const e=new WC.DOMParser;let i,n;try{i=e.parseFromString(t,"application/xml"),n=i&&i.documentElement.tagName==="MPD"?i.documentElement:null}catch{}if(!n||n&&n.getElementsByTagName("parsererror").length>0)throw new Error(Ar.DASH_INVALID_XML);return n},Bw=t=>{const e=pt(t,"UTCTiming")[0];if(!e)return null;const i=wt(e);switch(i.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":i.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":i.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":i.method="DIRECT",i.value=Date.parse(i.value);break;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error(Ar.UNSUPPORTED_UTC_TIMING_SCHEME)}return i},Fw=(t,e={})=>{const i=Nw(O_(t),e),n=Ew(i.representationInfo);return gw({dashPlaylists:n,locations:i.locations,contentSteering:i.contentSteeringInfo,sidxMapping:e.sidxMapping,previousManifest:e.previousManifest,eventStream:i.eventStream})},Uw=t=>Bw(O_(t));var Xc,Yg;function qw(){if(Yg)return Xc;Yg=1;var t=Math.pow(2,32),e=function(i){var n=new DataView(i.buffer,i.byteOffset,i.byteLength),s;return n.getBigUint64?(s=n.getBigUint64(0),s0;r+=12,a--)s.references.push({referenceType:(i[r]&128)>>>7,referencedSize:n.getUint32(r)&2147483647,subsegmentDuration:n.getUint32(r+4),startsWithSap:!!(i[r+8]&128),sapType:(i[r+8]&112)>>>4,sapDeltaTime:n.getUint32(r+8)&268435455});return s};return Yc=e,Yc}var jw=$w();const Vw=po(jw);var Hw=Re([73,68,51]),zw=function(e,i){i===void 0&&(i=0),e=Re(e);var n=e[i+5],s=e[i+6]<<21|e[i+7]<<14|e[i+8]<<7|e[i+9],r=(n&16)>>4;return r?s+20:s+10},wa=function t(e,i){return i===void 0&&(i=0),e=Re(e),e.length-i<10||!ft(e,Hw,{offset:i})?i:(i+=zw(e,i),t(e,i))},Jg=function(e){return typeof e=="string"?C_(e):e},Ww=function(e){return Array.isArray(e)?e.map(function(i){return Jg(i)}):[Jg(e)]},Gw=function t(e,i,n){n===void 0&&(n=!1),i=Ww(i),e=Re(e);var s=[];if(!i.length)return s;for(var r=0;r>>0,o=e.subarray(r+4,r+8);if(a===0)break;var u=r+a;if(u>e.length){if(n)break;u=e.length}var c=e.subarray(r+8,u);ft(o,i[0])&&(i.length===1?s.push(c):s.push.apply(s,t(c,i.slice(1),n))),r=u}return s},Zo={EBML:Re([26,69,223,163]),DocType:Re([66,130]),Segment:Re([24,83,128,103]),SegmentInfo:Re([21,73,169,102]),Tracks:Re([22,84,174,107]),Track:Re([174]),TrackNumber:Re([215]),DefaultDuration:Re([35,227,131]),TrackEntry:Re([174]),TrackType:Re([131]),FlagDefault:Re([136]),CodecID:Re([134]),CodecPrivate:Re([99,162]),VideoTrack:Re([224]),AudioTrack:Re([225]),Cluster:Re([31,67,182,117]),Timestamp:Re([231]),TimestampScale:Re([42,215,177]),BlockGroup:Re([160]),BlockDuration:Re([155]),Block:Re([161]),SimpleBlock:Re([163])},Gd=[128,64,32,16,8,4,2,1],Kw=function(e){for(var i=1,n=0;n=i.length)return i.length;var s=Vl(i,n,!1);if(ft(e.bytes,s.bytes))return n;var r=Vl(i,n+s.length);return t(e,i,n+r.length+r.value+s.length)},em=function t(e,i){i=Xw(i),e=Re(e);var n=[];if(!i.length)return n;for(var s=0;se.length?e.length:o+a.value,c=e.subarray(o,u);ft(i[0],r.bytes)&&(i.length===1?n.push(c):n=n.concat(t(c,i.slice(1))));var f=r.length+a.length+c.length;s+=f}return n},Qw=Re([0,0,0,1]),Jw=Re([0,0,1]),Zw=Re([0,0,3]),eA=function(e){for(var i=[],n=1;n>1&63),n.indexOf(c)!==-1&&(a=r+u),r+=u+(i==="h264"?1:2)}return e.subarray(0,0)},tA=function(e,i,n){return L_(e,"h264",i,n)},iA=function(e,i,n){return L_(e,"h265",i,n)},Zt={webm:Re([119,101,98,109]),matroska:Re([109,97,116,114,111,115,107,97]),flac:Re([102,76,97,67]),ogg:Re([79,103,103,83]),ac3:Re([11,119]),riff:Re([82,73,70,70]),avi:Re([65,86,73]),wav:Re([87,65,86,69]),"3gp":Re([102,116,121,112,51,103]),mp4:Re([102,116,121,112]),fmp4:Re([115,116,121,112]),mov:Re([102,116,121,112,113,116]),moov:Re([109,111,111,118]),moof:Re([109,111,111,102])},Dr={aac:function(e){var i=wa(e);return ft(e,[255,16],{offset:i,mask:[255,22]})},mp3:function(e){var i=wa(e);return ft(e,[255,2],{offset:i,mask:[255,6]})},webm:function(e){var i=em(e,[Zo.EBML,Zo.DocType])[0];return ft(i,Zt.webm)},mkv:function(e){var i=em(e,[Zo.EBML,Zo.DocType])[0];return ft(i,Zt.matroska)},mp4:function(e){if(Dr["3gp"](e)||Dr.mov(e))return!1;if(ft(e,Zt.mp4,{offset:4})||ft(e,Zt.fmp4,{offset:4})||ft(e,Zt.moof,{offset:4})||ft(e,Zt.moov,{offset:4}))return!0},mov:function(e){return ft(e,Zt.mov,{offset:4})},"3gp":function(e){return ft(e,Zt["3gp"],{offset:4})},ac3:function(e){var i=wa(e);return ft(e,Zt.ac3,{offset:i})},ts:function(e){if(e.length<189&&e.length>=1)return e[0]===71;for(var i=0;i+1880},Qc,tm;function rA(){if(tm)return Qc;tm=1;var t=9e4,e,i,n,s,r,a,o;return e=function(u){return u*t},i=function(u,c){return u*c},n=function(u){return u/t},s=function(u,c){return u/c},r=function(u,c){return e(s(u,c))},a=function(u,c){return i(n(u),c)},o=function(u,c,f){return n(f?u:u-c)},Qc={ONE_SECOND_IN_TS:t,secondsToVideoTs:e,secondsToAudioTs:i,videoTsToSeconds:n,audioTsToSeconds:s,audioTsToVideoTs:r,videoTsToAudioTs:a,metadataTsToSeconds:o},Qc}var As=rA();/** * @license * Video.js 8.21.0 * Copyright Brightcove, Inc. * Available under Apache License Version 2.0 * * * Includes vtt.js * Available under Apache License Version 2.0 * */var Xd="8.21.0";const An={},rs=function(t,e){return An[t]=An[t]||[],e&&(An[t]=An[t].concat(e)),An[t]},aA=function(t,e){rs(t,e)},R_=function(t,e){const i=rs(t).indexOf(e);return i<=-1?!1:(An[t]=An[t].slice(),An[t].splice(i,1),!0)},oA=function(t,e){rs(t,[].concat(e).map(i=>{const n=(...s)=>(R_(t,n),i(...s));return n}))},Hl={prefixed:!0},vl=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],im=vl[0];let Aa;for(let t=0;t(n,s,r)=>{const a=e.levels[s],o=new RegExp(`^(${a})$`);let u=t;if(n!=="log"&&r.unshift(n.toUpperCase()+":"),i&&(u=`%c${t}`,r.unshift(i)),r.unshift(u+":"),ai){ai.push([].concat(r));const f=ai.length-1e3;ai.splice(0,f>0?f:0)}if(!$.console)return;let c=$.console[n];!c&&n==="debug"&&(c=$.console.info||$.console.log),!(!c||!a||!o.test(n))&&c[Array.isArray(r)?"apply":"call"]($.console,r)};function Yd(t,e=":",i=""){let n="info",s;function r(...a){s("log",n,a)}return s=lA(t,r,i),r.createLogger=(a,o,u)=>{const c=o!==void 0?o:e,f=u!==void 0?u:i,g=`${t} ${c} ${a}`;return Yd(g,c,f)},r.createNewLogger=(a,o,u)=>Yd(a,o,u),r.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:n},r.level=a=>{if(typeof a=="string"){if(!r.levels.hasOwnProperty(a))throw new Error(`"${a}" in not a valid log level`);n=a}return n},r.history=()=>ai?[].concat(ai):[],r.history.filter=a=>(ai||[]).filter(o=>new RegExp(`.*${a}.*`).test(o[0])),r.history.clear=()=>{ai&&(ai.length=0)},r.history.disable=()=>{ai!==null&&(ai.length=0,ai=null)},r.history.enable=()=>{ai===null&&(ai=[])},r.error=(...a)=>s("error",n,a),r.warn=(...a)=>s("warn",n,a),r.debug=(...a)=>s("debug",n,a),r}const We=Yd("VIDEOJS"),M_=We.createLogger,uA=Object.prototype.toString,N_=function(t){return fn(t)?Object.keys(t):[]};function mr(t,e){N_(t).forEach(i=>e(t[i],i))}function B_(t,e,i=0){return N_(t).reduce((n,s)=>e(n,t[s],s),i)}function fn(t){return!!t&&typeof t=="object"}function kr(t){return fn(t)&&uA.call(t)==="[object Object]"&&t.constructor===Object}function it(...t){const e={};return t.forEach(i=>{i&&mr(i,(n,s)=>{if(!kr(n)){e[s]=n;return}kr(e[s])||(e[s]={}),e[s]=it(e[s],n)})}),e}function F_(t={}){const e=[];for(const i in t)if(t.hasOwnProperty(i)){const n=t[i];e.push(n)}return e}function Ou(t,e,i,n=!0){const s=a=>Object.defineProperty(t,e,{value:a,enumerable:!0,writable:!0}),r={configurable:!0,enumerable:!0,get(){const a=i();return s(a),a}};return n&&(r.set=s),Object.defineProperty(t,e,r)}var cA=Object.freeze({__proto__:null,each:mr,reduce:B_,isObject:fn,isPlain:kr,merge:it,values:F_,defineLazyProperty:Ou});let af=!1,U_=null,Ki=!1,q_,$_=!1,yr=!1,_r=!1,pn=!1,of=null,Lu=null;const dA=!!($.cast&&$.cast.framework&&$.cast.framework.CastReceiverContext);let j_=null,zl=!1,Ru=!1,Wl=!1,Mu=!1,Gl=!1,Kl=!1,Xl=!1;const to=!!(Ur()&&("ontouchstart"in $||$.navigator.maxTouchPoints||$.DocumentTouch&&$.document instanceof $.DocumentTouch)),jn=$.navigator&&$.navigator.userAgentData;jn&&jn.platform&&jn.brands&&(Ki=jn.platform==="Android",yr=!!jn.brands.find(t=>t.brand==="Microsoft Edge"),_r=!!jn.brands.find(t=>t.brand==="Chromium"),pn=!yr&&_r,of=Lu=(jn.brands.find(t=>t.brand==="Chromium")||{}).version||null,Ru=jn.platform==="Windows");if(!_r){const t=$.navigator&&$.navigator.userAgent||"";af=/iPod/i.test(t),U_=function(){const e=t.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),Ki=/Android/i.test(t),q_=function(){const e=t.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;const i=e[1]&&parseFloat(e[1]),n=e[2]&&parseFloat(e[2]);return i&&n?parseFloat(e[1]+"."+e[2]):i||null}(),$_=/Firefox/i.test(t),yr=/Edg/i.test(t),_r=/Chrome/i.test(t)||/CriOS/i.test(t),pn=!yr&&_r,of=Lu=function(){const e=t.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),j_=function(){const e=/MSIE\s(\d+)\.\d/.exec(t);let i=e&&parseFloat(e[1]);return!i&&/Trident\/7.0/i.test(t)&&/rv:11.0/.test(t)&&(i=11),i}(),Gl=/Tizen/i.test(t),Kl=/Web0S/i.test(t),Xl=Gl||Kl,zl=/Safari/i.test(t)&&!pn&&!Ki&&!yr&&!Xl,Ru=/Windows/i.test(t),Wl=/iPad/i.test(t)||zl&&to&&!/iPhone/i.test(t),Mu=/iPhone/i.test(t)&&!Wl}const Kt=Mu||Wl||af,Nu=(zl||Kt)&&!pn;var V_=Object.freeze({__proto__:null,get IS_IPOD(){return af},get IOS_VERSION(){return U_},get IS_ANDROID(){return Ki},get ANDROID_VERSION(){return q_},get IS_FIREFOX(){return $_},get IS_EDGE(){return yr},get IS_CHROMIUM(){return _r},get IS_CHROME(){return pn},get CHROMIUM_VERSION(){return of},get CHROME_VERSION(){return Lu},IS_CHROMECAST_RECEIVER:dA,get IE_VERSION(){return j_},get IS_SAFARI(){return zl},get IS_WINDOWS(){return Ru},get IS_IPAD(){return Wl},get IS_IPHONE(){return Mu},get IS_TIZEN(){return Gl},get IS_WEBOS(){return Kl},get IS_SMART_TV(){return Xl},TOUCH_ENABLED:to,IS_IOS:Kt,IS_ANY_SAFARI:Nu});function nm(t){return typeof t=="string"&&!!t.trim()}function hA(t){if(t.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function Ur(){return _e===$.document}function qr(t){return fn(t)&&t.nodeType===1}function H_(){try{return $.parent!==$.self}catch{return!0}}function z_(t){return function(e,i){if(!nm(e))return _e[t](null);nm(i)&&(i=_e.querySelector(i));const n=qr(i)?i:_e;return n[t]&&n[t](e)}}function Me(t="div",e={},i={},n){const s=_e.createElement(t);return Object.getOwnPropertyNames(e).forEach(function(r){const a=e[r];r==="textContent"?cs(s,a):(s[r]!==a||r==="tabIndex")&&(s[r]=a)}),Object.getOwnPropertyNames(i).forEach(function(r){s.setAttribute(r,i[r])}),n&&lf(s,n),s}function cs(t,e){return typeof t.textContent>"u"?t.innerText=e:t.textContent=e,t}function Qd(t,e){e.firstChild?e.insertBefore(t,e.firstChild):e.appendChild(t)}function Ba(t,e){return hA(e),t.classList.contains(e)}function Ls(t,...e){return t.classList.add(...e.reduce((i,n)=>i.concat(n.split(/\s+/)),[])),t}function Bu(t,...e){return t?(t.classList.remove(...e.reduce((i,n)=>i.concat(n.split(/\s+/)),[])),t):(We.warn("removeClass was called with an element that doesn't exist"),null)}function W_(t,e,i){return typeof i=="function"&&(i=i(t,e)),typeof i!="boolean"&&(i=void 0),e.split(/\s+/).forEach(n=>t.classList.toggle(n,i)),t}function G_(t,e){Object.getOwnPropertyNames(e).forEach(function(i){const n=e[i];n===null||typeof n>"u"||n===!1?t.removeAttribute(i):t.setAttribute(i,n===!0?"":n)})}function Qn(t){const e={},i=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(t&&t.attributes&&t.attributes.length>0){const n=t.attributes;for(let s=n.length-1;s>=0;s--){const r=n[s].name;let a=n[s].value;i.includes(r)&&(a=a!==null),e[r]=a}}return e}function K_(t,e){return t.getAttribute(e)}function Ir(t,e,i){t.setAttribute(e,i)}function Fu(t,e){t.removeAttribute(e)}function X_(){_e.body.focus(),_e.onselectstart=function(){return!1}}function Y_(){_e.onselectstart=function(){return!0}}function Pr(t){if(t&&t.getBoundingClientRect&&t.parentNode){const e=t.getBoundingClientRect(),i={};return["bottom","height","left","right","top","width"].forEach(n=>{e[n]!==void 0&&(i[n]=e[n])}),i.height||(i.height=parseFloat(Or(t,"height"))),i.width||(i.width=parseFloat(Or(t,"width"))),i}}function io(t){if(!t||t&&!t.offsetParent)return{left:0,top:0,width:0,height:0};const e=t.offsetWidth,i=t.offsetHeight;let n=0,s=0;for(;t.offsetParent&&t!==_e[Hl.fullscreenElement];)n+=t.offsetLeft,s+=t.offsetTop,t=t.offsetParent;return{left:n,top:s,width:e,height:i}}function Uu(t,e){const i={x:0,y:0};if(Kt){let f=t;for(;f&&f.nodeName.toLowerCase()!=="html";){const g=Or(f,"transform");if(/^matrix/.test(g)){const y=g.slice(7,-1).split(/,\s/).map(Number);i.x+=y[4],i.y+=y[5]}else if(/^matrix3d/.test(g)){const y=g.slice(9,-1).split(/,\s/).map(Number);i.x+=y[12],i.y+=y[13]}if(f.assignedSlot&&f.assignedSlot.parentElement&&$.WebKitCSSMatrix){const y=$.getComputedStyle(f.assignedSlot.parentElement).transform,_=new $.WebKitCSSMatrix(y);i.x+=_.m41,i.y+=_.m42}f=f.parentNode||f.host}}const n={},s=io(e.target),r=io(t),a=r.width,o=r.height;let u=e.offsetY-(r.top-s.top),c=e.offsetX-(r.left-s.left);return e.changedTouches&&(c=e.changedTouches[0].pageX-r.left,u=e.changedTouches[0].pageY+r.top,Kt&&(c-=i.x,u-=i.y)),n.y=1-Math.max(0,Math.min(1,u/o)),n.x=Math.max(0,Math.min(1,c/a)),n}function Q_(t){return fn(t)&&t.nodeType===3}function qu(t){for(;t.firstChild;)t.removeChild(t.firstChild);return t}function J_(t){return typeof t=="function"&&(t=t()),(Array.isArray(t)?t:[t]).map(e=>{if(typeof e=="function"&&(e=e()),qr(e)||Q_(e))return e;if(typeof e=="string"&&/\S/.test(e))return _e.createTextNode(e)}).filter(e=>e)}function lf(t,e){return J_(e).forEach(i=>t.appendChild(i)),t}function Z_(t,e){return lf(qu(t),e)}function no(t){return t.button===void 0&&t.buttons===void 0||t.button===0&&t.buttons===void 0||t.type==="mouseup"&&t.button===0&&t.buttons===0||t.type==="mousedown"&&t.button===0&&t.buttons===0?!0:!(t.button!==0||t.buttons!==1)}const as=z_("querySelector"),ev=z_("querySelectorAll");function Or(t,e){if(!t||!e)return"";if(typeof $.getComputedStyle=="function"){let i;try{i=$.getComputedStyle(t)}catch{return""}return i?i.getPropertyValue(e)||i[e]:""}return""}function tv(t){[..._e.styleSheets].forEach(e=>{try{const i=[...e.cssRules].map(s=>s.cssText).join(""),n=_e.createElement("style");n.textContent=i,t.document.head.appendChild(n)}catch{const n=_e.createElement("link");n.rel="stylesheet",n.type=e.type,n.media=e.media.mediaText,n.href=e.href,t.document.head.appendChild(n)}})}var iv=Object.freeze({__proto__:null,isReal:Ur,isEl:qr,isInFrame:H_,createEl:Me,textContent:cs,prependTo:Qd,hasClass:Ba,addClass:Ls,removeClass:Bu,toggleClass:W_,setAttributes:G_,getAttributes:Qn,getAttribute:K_,setAttribute:Ir,removeAttribute:Fu,blockTextSelection:X_,unblockTextSelection:Y_,getBoundingClientRect:Pr,findPosition:io,getPointerPosition:Uu,isTextNode:Q_,emptyEl:qu,normalizeContent:J_,appendContent:lf,insertContent:Z_,isSingleLeftClick:no,$:as,$$:ev,computedStyle:Or,copyStyleSheetsToWindow:tv});let nv=!1,Jd;const fA=function(){if(Jd.options.autoSetup===!1)return;const t=Array.prototype.slice.call(_e.getElementsByTagName("video")),e=Array.prototype.slice.call(_e.getElementsByTagName("audio")),i=Array.prototype.slice.call(_e.getElementsByTagName("video-js")),n=t.concat(e,i);if(n&&n.length>0)for(let s=0,r=n.length;s-1&&(s={passive:!0}),t.addEventListener(e,n.dispatcher,s)}else t.attachEvent&&t.attachEvent("on"+e,n.dispatcher)}function Xt(t,e,i){if(!ri.has(t))return;const n=ri.get(t);if(!n.handlers)return;if(Array.isArray(e))return uf(Xt,t,e,i);const s=function(a,o){n.handlers[o]=[],sm(a,o)};if(e===void 0){for(const a in n.handlers)Object.prototype.hasOwnProperty.call(n.handlers||{},a)&&s(t,a);return}const r=n.handlers[e];if(r){if(!i){s(t,e);return}if(i.guid)for(let a=0;a=e&&(t(...s),i=r)}},av=function(t,e,i,n=$){let s;const r=()=>{n.clearTimeout(s),s=null},a=function(){const o=this,u=arguments;let c=function(){s=null,c=null,i||t.apply(o,u)};!s&&i&&t.apply(o,u),n.clearTimeout(s),s=n.setTimeout(c,e)};return a.cancel=r,a};var vA=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:Ri,bind_:at,throttle:gn,debounce:av});let ma;class _i{on(e,i){const n=this.addEventListener;this.addEventListener=()=>{},yi(this,e,i),this.addEventListener=n}off(e,i){Xt(this,e,i)}one(e,i){const n=this.addEventListener;this.addEventListener=()=>{},ju(this,e,i),this.addEventListener=n}any(e,i){const n=this.addEventListener;this.addEventListener=()=>{},cf(this,e,i),this.addEventListener=n}trigger(e){const i=e.type||e;typeof e=="string"&&(e={type:i}),e=$u(e),this.allowedEvents_[i]&&this["on"+i]&&this["on"+i](e),$r(this,e)}queueTrigger(e){ma||(ma=new Map);const i=e.type||e;let n=ma.get(this);n||(n=new Map,ma.set(this,n));const s=n.get(i);n.delete(i),$.clearTimeout(s);const r=$.setTimeout(()=>{n.delete(i),n.size===0&&(n=null,ma.delete(this)),this.trigger(e)},0);n.set(i,r)}}_i.prototype.allowedEvents_={};_i.prototype.addEventListener=_i.prototype.on;_i.prototype.removeEventListener=_i.prototype.off;_i.prototype.dispatchEvent=_i.prototype.trigger;const Vu=t=>typeof t.name=="function"?t.name():typeof t.name=="string"?t.name:t.name_?t.name_:t.constructor&&t.constructor.name?t.constructor.name:typeof t,In=t=>t instanceof _i||!!t.eventBusEl_&&["on","one","off","trigger"].every(e=>typeof t[e]=="function"),bA=(t,e)=>{In(t)?e():(t.eventedCallbacks||(t.eventedCallbacks=[]),t.eventedCallbacks.push(e))},th=t=>typeof t=="string"&&/\S/.test(t)||Array.isArray(t)&&!!t.length,Yl=(t,e,i)=>{if(!t||!t.nodeName&&!In(t))throw new Error(`Invalid target for ${Vu(e)}#${i}; must be a DOM node or evented object.`)},ov=(t,e,i)=>{if(!th(t))throw new Error(`Invalid event type for ${Vu(e)}#${i}; must be a non-empty string or array.`)},lv=(t,e,i)=>{if(typeof t!="function")throw new Error(`Invalid listener for ${Vu(e)}#${i}; must be a function.`)},Jc=(t,e,i)=>{const n=e.length<3||e[0]===t||e[0]===t.eventBusEl_;let s,r,a;return n?(s=t.eventBusEl_,e.length>=3&&e.shift(),[r,a]=e):(s=e[0],r=e[1],a=e[2]),Yl(s,t,i),ov(r,t,i),lv(a,t,i),a=at(t,a),{isTargetingSelf:n,target:s,type:r,listener:a}},Ts=(t,e,i,n)=>{Yl(t,t,e),t.nodeName?_A[e](t,i,n):t[e](i,n)},TA={on(...t){const{isTargetingSelf:e,target:i,type:n,listener:s}=Jc(this,t,"on");if(Ts(i,"on",n,s),!e){const r=()=>this.off(i,n,s);r.guid=s.guid;const a=()=>this.off("dispose",r);a.guid=s.guid,Ts(this,"on","dispose",r),Ts(i,"on","dispose",a)}},one(...t){const{isTargetingSelf:e,target:i,type:n,listener:s}=Jc(this,t,"one");if(e)Ts(i,"one",n,s);else{const r=(...a)=>{this.off(i,n,r),s.apply(null,a)};r.guid=s.guid,Ts(i,"one",n,r)}},any(...t){const{isTargetingSelf:e,target:i,type:n,listener:s}=Jc(this,t,"any");if(e)Ts(i,"any",n,s);else{const r=(...a)=>{this.off(i,n,r),s.apply(null,a)};r.guid=s.guid,Ts(i,"any",n,r)}},off(t,e,i){if(!t||th(t))Xt(this.eventBusEl_,t,e);else{const n=t,s=e;Yl(n,this,"off"),ov(s,this,"off"),lv(i,this,"off"),i=at(this,i),this.off("dispose",i),n.nodeName?(Xt(n,s,i),Xt(n,"dispose",i)):In(n)&&(n.off(s,i),n.off("dispose",i))}},trigger(t,e){Yl(this.eventBusEl_,this,"trigger");const i=t&&typeof t!="string"?t.type:t;if(!th(i))throw new Error(`Invalid event type for ${Vu(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return $r(this.eventBusEl_,t,e)}};function df(t,e={}){const{eventBusKey:i}=e;if(i){if(!t[i].nodeName)throw new Error(`The eventBusKey "${i}" does not refer to an element.`);t.eventBusEl_=t[i]}else t.eventBusEl_=Me("span",{className:"vjs-event-bus"});return Object.assign(t,TA),t.eventedCallbacks&&t.eventedCallbacks.forEach(n=>{n()}),t.on("dispose",()=>{t.off(),[t,t.el_,t.eventBusEl_].forEach(function(n){n&&ri.has(n)&&ri.delete(n)}),$.setTimeout(()=>{t.eventBusEl_=null},0)}),t}const xA={state:{},setState(t){typeof t=="function"&&(t=t());let e;return mr(t,(i,n)=>{this.state[n]!==i&&(e=e||{},e[n]={from:this.state[n],to:i}),this.state[n]=i}),e&&In(this)&&this.trigger({changes:e,type:"statechanged"}),e}};function uv(t,e){return Object.assign(t,xA),t.state=Object.assign({},t.state,e),typeof t.handleStateChanged=="function"&&In(t)&&t.on("statechanged",t.handleStateChanged),t}const Fa=function(t){return typeof t!="string"?t:t.replace(/./,e=>e.toLowerCase())},_t=function(t){return typeof t!="string"?t:t.replace(/./,e=>e.toUpperCase())},cv=function(t,e){return _t(t)===_t(e)};var SA=Object.freeze({__proto__:null,toLowerCase:Fa,toTitleCase:_t,titleCaseEquals:cv});class le{constructor(e,i,n){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=it({},this.options_),i=this.options_=it(this.options_,i),this.id_=i.id||i.el&&i.el.id,!this.id_){const s=e&&e.id&&e.id()||"no_player";this.id_=`${s}_component_${Li()}`}this.name_=i.name||null,i.el?this.el_=i.el:i.createEl!==!1&&(this.el_=this.createEl()),i.className&&this.el_&&i.className.split(" ").forEach(s=>this.addClass(s)),["on","off","one","any","trigger"].forEach(s=>{this[s]=void 0}),i.evented!==!1&&(df(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),uv(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map,this.clearingTimersOnDispose_=!1,i.initChildren!==!1&&this.initChildren(),this.ready(n),i.reportTouchActivity!==!1&&this.enableTouchActivity()}dispose(e={}){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(let i=this.children_.length-1;i>=0;i--)this.children_[i].dispose&&this.children_[i].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}}isDisposed(){return!!this.isDisposed_}player(){return this.player_}options(e){return e?(this.options_=it(this.options_,e),this.options_):this.options_}el(){return this.el_}createEl(e,i,n){return Me(e,i,n)}localize(e,i,n=e){const s=this.player_.language&&this.player_.language(),r=this.player_.languages&&this.player_.languages(),a=r&&r[s],o=s&&s.split("-")[0],u=r&&r[o];let c=n;return a&&a[e]?c=a[e]:u&&u[e]&&(c=u[e]),i&&(c=c.replace(/\{(\d+)\}/g,function(f,g){const y=i[g-1];let _=y;return typeof y>"u"&&(_=f),_})),c}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(e)return this.childNameIndex_[e]}getDescendant(...e){e=e.reduce((n,s)=>n.concat(s),[]);let i=this;for(let n=0;n=0;s--)if(this.children_[s]===e){i=!0,this.children_.splice(s,1);break}if(!i)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[_t(e.name())]=null,this.childNameIndex_[Fa(e.name())]=null;const n=e.el();n&&n.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){const e=this.options_.children;if(e){const i=this.options_,n=a=>{const o=a.name;let u=a.opts;if(i[o]!==void 0&&(u=i[o]),u===!1)return;u===!0&&(u={}),u.playerOptions=this.options_.playerOptions;const c=this.addChild(o,u);c&&(this[o]=c)};let s;const r=le.getComponent("Tech");Array.isArray(e)?s=e:s=Object.keys(e),s.concat(Object.keys(this.options_).filter(function(a){return!s.some(function(o){return typeof o=="string"?a===o:a===o.name})})).map(a=>{let o,u;return typeof a=="string"?(o=a,u=e[o]||this.options_[o]||{}):(o=a.name,u=a),{name:o,opts:u}}).filter(a=>{const o=le.getComponent(a.opts.componentClass||_t(a.name));return o&&!r.isTech(o)}).forEach(n)}}buildCSSClass(){return""}ready(e,i=!1){if(e){if(!this.isReady_){this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(e);return}i?e.call(this):this.setTimeout(e,1)}}triggerReady(){this.isReady_=!0,this.setTimeout(function(){const e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(i){i.call(this)},this),this.trigger("ready")},1)}$(e,i){return as(e,i||this.contentEl())}$$(e,i){return ev(e,i||this.contentEl())}hasClass(e){return Ba(this.el_,e)}addClass(...e){Ls(this.el_,...e)}removeClass(...e){Bu(this.el_,...e)}toggleClass(e,i){W_(this.el_,e,i)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(e){return K_(this.el_,e)}setAttribute(e,i){Ir(this.el_,e,i)}removeAttribute(e){Fu(this.el_,e)}width(e,i){return this.dimension("width",e,i)}height(e,i){return this.dimension("height",e,i)}dimensions(e,i){this.width(e,!0),this.height(i)}dimension(e,i,n){if(i!==void 0){(i===null||i!==i)&&(i=0),(""+i).indexOf("%")!==-1||(""+i).indexOf("px")!==-1?this.el_.style[e]=i:i==="auto"?this.el_.style[e]="":this.el_.style[e]=i+"px",n||this.trigger("componentresize");return}if(!this.el_)return 0;const s=this.el_.style[e],r=s.indexOf("px");return parseInt(r!==-1?s.slice(0,r):this.el_["offset"+_t(e)],10)}currentDimension(e){let i=0;if(e!=="width"&&e!=="height")throw new Error("currentDimension only accepts width or height value");if(i=Or(this.el_,e),i=parseFloat(i),i===0||isNaN(i)){const n=`offset${_t(e)}`;i=this.el_[n]}return i}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}getPositions(){const e=this.el_.getBoundingClientRect(),i={x:e.x,y:e.y,width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left},n={x:e.left+e.width/2,y:e.top+e.height/2,width:0,height:0,top:e.top+e.height/2,right:e.left+e.width/2,bottom:e.top+e.height/2,left:e.left+e.width/2};return{boundingClientRect:i,center:n}}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){this.player_&&(e.key!=="Tab"&&!(this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled)&&e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e=0,i=null;const n=10,s=200;let r;this.on("touchstart",function(o){o.touches.length===1&&(i={pageX:o.touches[0].pageX,pageY:o.touches[0].pageY},e=$.performance.now(),r=!0)}),this.on("touchmove",function(o){if(o.touches.length>1)r=!1;else if(i){const u=o.touches[0].pageX-i.pageX,c=o.touches[0].pageY-i.pageY;Math.sqrt(u*u+c*c)>n&&(r=!1)}});const a=function(){r=!1};this.on("touchleave",a),this.on("touchcancel",a),this.on("touchend",function(o){i=null,r===!0&&$.performance.now()-e{this.setTimeoutIds_.has(n)&&this.setTimeoutIds_.delete(n),e()},i),this.setTimeoutIds_.add(n),n}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),$.clearTimeout(e)),e}setInterval(e,i){e=at(this,e),this.clearTimersOnDispose_();const n=$.setInterval(e,i);return this.setIntervalIds_.add(n),n}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),$.clearInterval(e)),e}requestAnimationFrame(e){this.clearTimersOnDispose_();var i;return e=at(this,e),i=$.requestAnimationFrame(()=>{this.rafIds_.has(i)&&this.rafIds_.delete(i),e()}),this.rafIds_.add(i),i}requestNamedAnimationFrame(e,i){this.namedRafs_.has(e)&&this.cancelNamedAnimationFrame(e),this.clearTimersOnDispose_(),i=at(this,i);const n=this.requestAnimationFrame(()=>{i(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)});return this.namedRafs_.set(e,n),e}cancelNamedAnimationFrame(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))}cancelAnimationFrame(e){return this.rafIds_.has(e)&&(this.rafIds_.delete(e),$.cancelAnimationFrame(e)),e}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(([e,i])=>{this[e].forEach((n,s)=>this[i](s))}),this.clearingTimersOnDispose_=!1}))}getIsDisabled(){return!!this.el_.disabled}getIsExpresslyInert(){return this.el_.inert&&!this.el_.ownerDocument.documentElement.inert}getIsFocusable(e){return(e||this.el_).tabIndex>=0&&!(this.getIsDisabled()||this.getIsExpresslyInert())}getIsAvailableToBeFocused(e){function i(r){const a=$.getComputedStyle(r,null),o=a.getPropertyValue("visibility");return a.getPropertyValue("display")!=="none"&&!["hidden","collapse"].includes(o)}function n(r){return!(!i(r.parentElement)||!i(r)||r.style.opacity==="0"||$.getComputedStyle(r).height==="0px"||$.getComputedStyle(r).width==="0px")}function s(r){if(r.offsetWidth+r.offsetHeight+r.getBoundingClientRect().height+r.getBoundingClientRect().width===0)return!1;const a={x:r.getBoundingClientRect().left+r.offsetWidth/2,y:r.getBoundingClientRect().top+r.offsetHeight/2};if(a.x<0||a.x>(_e.documentElement.clientWidth||$.innerWidth)||a.y<0||a.y>(_e.documentElement.clientHeight||$.innerHeight))return!1;let o=_e.elementFromPoint(a.x,a.y);for(;o;){if(o===r)return!0;if(o.parentNode)o=o.parentNode;else return!1}}return e||(e=this.el()),!!(s(e)&&n(e)&&(!e.parentElement||e.tabIndex>=0))}static registerComponent(e,i){if(typeof e!="string"||!e)throw new Error(`Illegal component name, "${e}"; must be a non-empty string.`);const n=le.getComponent("Tech"),s=n&&n.isTech(i),r=le===i||le.prototype.isPrototypeOf(i.prototype);if(s||!r){let o;throw s?o="techs must be registered using Tech.registerTech()":o="must be a Component subclass",new Error(`Illegal component, "${e}"; ${o}.`)}e=_t(e),le.components_||(le.components_={});const a=le.getComponent("Player");if(e==="Player"&&a&&a.players){const o=a.players,u=Object.keys(o);if(o&&u.length>0&&u.map(c=>o[c]).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return le.components_[e]=i,le.components_[Fa(e)]=i,i}static getComponent(e){if(!(!e||!le.components_))return le.components_[e]}}le.registerComponent("Component",le);function EA(t,e,i){if(typeof e!="number"||e<0||e>i)throw new Error(`Failed to execute '${t}' on 'TimeRanges': The index provided (${e}) is non-numeric or out of bounds (0-${i}).`)}function rm(t,e,i,n){return EA(t,n,i.length-1),i[n][e]}function Zc(t){let e;return t===void 0||t.length===0?e={length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}:e={length:t.length,start:rm.bind(null,"start",0,t),end:rm.bind(null,"end",1,t)},$.Symbol&&$.Symbol.iterator&&(e[$.Symbol.iterator]=()=>(t||[]).values()),e}function Wi(t,e){return Array.isArray(t)?Zc(t):t===void 0||e===void 0?Zc():Zc([[t,e]])}const dv=function(t,e){t=t<0?0:t;let i=Math.floor(t%60),n=Math.floor(t/60%60),s=Math.floor(t/3600);const r=Math.floor(e/60%60),a=Math.floor(e/3600);return(isNaN(t)||t===1/0)&&(s=n=i="-"),s=s>0||a>0?s+":":"",n=((s||r>=10)&&n<10?"0"+n:n)+":",i=i<10?"0"+i:i,s+n+i};let hf=dv;function hv(t){hf=t}function fv(){hf=dv}function $s(t,e=t){return hf(t,e)}var CA=Object.freeze({__proto__:null,createTimeRanges:Wi,createTimeRange:Wi,setFormatTime:hv,resetFormatTime:fv,formatTime:$s});function pv(t,e){let i=0,n,s;if(!e)return 0;(!t||!t.length)&&(t=Wi(0,0));for(let r=0;re&&(s=e),i+=s-n;return i/e}function mt(t){if(t instanceof mt)return t;typeof t=="number"?this.code=t:typeof t=="string"?this.message=t:fn(t)&&(typeof t.code=="number"&&(this.code=t.code),Object.assign(this,t)),this.message||(this.message=mt.defaultMessages[this.code]||"")}mt.prototype.code=0;mt.prototype.message="";mt.prototype.status=null;mt.prototype.metadata=null;mt.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"];mt.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};mt.MEDIA_ERR_CUSTOM=0;mt.prototype.MEDIA_ERR_CUSTOM=0;mt.MEDIA_ERR_ABORTED=1;mt.prototype.MEDIA_ERR_ABORTED=1;mt.MEDIA_ERR_NETWORK=2;mt.prototype.MEDIA_ERR_NETWORK=2;mt.MEDIA_ERR_DECODE=3;mt.prototype.MEDIA_ERR_DECODE=3;mt.MEDIA_ERR_SRC_NOT_SUPPORTED=4;mt.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4;mt.MEDIA_ERR_ENCRYPTED=5;mt.prototype.MEDIA_ERR_ENCRYPTED=5;function Ua(t){return t!=null&&typeof t.then=="function"}function ln(t){Ua(t)&&t.then(null,e=>{})}const ih=function(t){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((i,n,s)=>(t[n]&&(i[n]=t[n]),i),{cues:t.cues&&Array.prototype.map.call(t.cues,function(i){return{startTime:i.startTime,endTime:i.endTime,text:i.text,id:i.id}})})},wA=function(t){const e=t.$$("track"),i=Array.prototype.map.call(e,s=>s.track);return Array.prototype.map.call(e,function(s){const r=ih(s.track);return s.src&&(r.src=s.src),r}).concat(Array.prototype.filter.call(t.textTracks(),function(s){return i.indexOf(s)===-1}).map(ih))},AA=function(t,e){return t.forEach(function(i){const n=e.addRemoteTextTrack(i).track;!i.src&&i.cues&&i.cues.forEach(s=>n.addCue(s))}),e.textTracks()};var am={textTracksToJson:wA,jsonToTextTracks:AA,trackToJson_:ih};const ed="vjs-modal-dialog";class jr extends le{constructor(e,i){super(e,i),this.handleKeyDown_=n=>this.handleKeyDown(n),this.close_=n=>this.close(n),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=Me("div",{className:`${ed}-content`},{role:"document"}),this.descEl_=Me("p",{className:`${ed}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),cs(this.descEl_,this.description()),this.el_.appendChild(this.descEl_),this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl("div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":`${this.id()}_description`,"aria-hidden":"true","aria-label":this.label(),role:"dialog","aria-live":"polite"})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return`${ed} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e}open(){if(this.opened_){this.options_.fillAlways&&this.fill();return}const e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}opened(e){return typeof e=="boolean"&&this[e?"open":"close"](),this.opened_}close(){if(!this.opened_)return;const e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger({type:"modalclose",bubbles:!0}),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(e){if(typeof e=="boolean"){const i=this.closeable_=!!e;let n=this.getChild("closeButton");if(i&&!n){const s=this.contentEl_;this.contentEl_=this.el_,n=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=s,this.on(n,"close",this.close_)}!i&&n&&(this.off(n,"close",this.close_),this.removeChild(n),n.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){const i=this.contentEl(),n=i.parentNode,s=i.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,n.removeChild(i),this.empty(),Z_(i,e),this.trigger("modalfill"),s?n.insertBefore(i,s):n.appendChild(i);const r=this.getChild("closeButton");r&&n.appendChild(r.el_),this.trigger("aftermodalfill")}empty(){this.trigger("beforemodalempty"),qu(this.contentEl()),this.trigger("modalempty")}content(e){return typeof e<"u"&&(this.content_=e),this.content_}conditionalFocus_(){const e=_e.activeElement,i=this.player_.el_;this.previouslyActiveEl_=null,(i.contains(e)||i===e)&&(this.previouslyActiveEl_=e,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)}handleKeyDown(e){if(this.trigger({type:"modalKeydown",originalEvent:e,target:this,bubbles:!0}),e.stopPropagation(),e.key==="Escape"&&this.closeable()){e.preventDefault(),this.close();return}if(e.key!=="Tab")return;const i=this.focusableEls_(),n=this.el_.querySelector(":focus");let s;for(let r=0;r(i instanceof $.HTMLAnchorElement||i instanceof $.HTMLAreaElement)&&i.hasAttribute("href")||(i instanceof $.HTMLInputElement||i instanceof $.HTMLSelectElement||i instanceof $.HTMLTextAreaElement||i instanceof $.HTMLButtonElement)&&!i.hasAttribute("disabled")||i instanceof $.HTMLIFrameElement||i instanceof $.HTMLObjectElement||i instanceof $.HTMLEmbedElement||i.hasAttribute("tabindex")&&i.getAttribute("tabindex")!==-1||i.hasAttribute("contenteditable"))}}jr.prototype.options_={pauseOnOpen:!0,temporary:!0};le.registerComponent("ModalDialog",jr);class Lr extends _i{constructor(e=[]){super(),this.tracks_=[],Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let i=0;i{this.trigger({track:e,type:"labelchange",target:this})},In(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let i;for(let n=0,s=this.length;n=0;i--)if(e[i].enabled){td(e,e[i]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&td(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,td(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)}}const id=function(t,e){for(let i=0;i=0;i--)if(e[i].selected){id(e,e[i]);break}super(e),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let i=0;i{this.changing_||(this.changing_=!0,id(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)}}class gv extends Lr{addTrack(e){super.addTrack(e),this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),e.addEventListener("modechange",this.queueChange_),["metadata","chapters"].indexOf(e.kind)===-1&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}}class IA{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let i=0,n=e.length;i0&&($.console&&$.console.groupCollapsed&&$.console.groupCollapsed(`Text Track parsing errors for ${e.src}`),n.forEach(s=>We.error(s)),$.console&&$.console.groupEnd&&$.console.groupEnd()),i.flush()},um=function(t,e){const i={uri:t},n=Hu(t);n&&(i.cors=n);const s=e.tech_.crossOrigin()==="use-credentials";s&&(i.withCredentials=s),v_(i,at(this,function(r,a,o){if(r)return We.error(r,a);e.loaded_=!0,typeof $.WebVTT!="function"?e.tech_&&e.tech_.any(["vttjsloaded","vttjserror"],u=>{if(u.type==="vttjserror"){We.error(`vttjs failed to load, stopping trying to process ${e.src}`);return}return lm(o,e)}):lm(o,e)}))};class mo extends ff{constructor(e={}){if(!e.tech)throw new Error("A tech was not provided.");const i=it(e,{kind:LA[e.kind]||"subtitles",language:e.language||e.srclang||""});let n=om[i.mode]||"disabled";const s=i.default;(i.kind==="metadata"||i.kind==="chapters")&&(n="hidden"),super(i),this.tech_=i.tech,this.cues_=[],this.activeCues_=[],this.preload_=this.tech_.preloadTextTracks!==!1;const r=new Ql(this.cues_),a=new Ql(this.activeCues_);let o=!1;this.timeupdateHandler=at(this,function(c={}){if(!this.tech_.isDisposed()){if(!this.tech_.isReady_){c.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler));return}this.activeCues=this.activeCues,o&&(this.trigger("cuechange"),o=!1),c.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))}});const u=()=>{this.stopTracking()};this.tech_.one("dispose",u),n!=="disabled"&&this.startTracking(),Object.defineProperties(this,{default:{get(){return s},set(){}},mode:{get(){return n},set(c){om[c]&&n!==c&&(n=c,!this.preload_&&n!=="disabled"&&this.cues.length===0&&um(this.src,this),this.stopTracking(),n!=="disabled"&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?r:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(this.cues.length===0)return a;const c=this.tech_.currentTime(),f=[];for(let g=0,y=this.cues.length;g=c&&f.push(_)}if(o=!1,f.length!==this.activeCues_.length)o=!0;else for(let g=0;g{i=Pn.LOADED,this.trigger({type:"load",target:this})})}}Pn.prototype.allowedEvents_={load:"load"};Pn.NONE=0;Pn.LOADING=1;Pn.LOADED=2;Pn.ERROR=3;const Pi={audio:{ListClass:DA,TrackClass:yv,capitalName:"Audio"},video:{ListClass:kA,TrackClass:_v,capitalName:"Video"},text:{ListClass:gv,TrackClass:mo,capitalName:"Text"}};Object.keys(Pi).forEach(function(t){Pi[t].getterName=`${t}Tracks`,Pi[t].privateName=`${t}Tracks_`});const Rr={remoteText:{ListClass:gv,TrackClass:mo,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:IA,TrackClass:Pn,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},si=Object.assign({},Pi,Rr);Rr.names=Object.keys(Rr);Pi.names=Object.keys(Pi);si.names=[].concat(Rr.names).concat(Pi.names);function MA(t,e,i,n,s={}){const r=t.textTracks();s.kind=e,i&&(s.label=i),n&&(s.language=n),s.tech=t;const a=new si.text.TrackClass(s);return r.addTrack(a),a}class je extends le{constructor(e={},i=function(){}){e.reportTouchActivity=!1,super(null,e,i),this.onDurationChange_=n=>this.onDurationChange(n),this.trackProgress_=n=>this.trackProgress(n),this.trackCurrentTime_=n=>this.trackCurrentTime(n),this.stopTrackingCurrentTime_=n=>this.stopTrackingCurrentTime(n),this.disposeSourceHandler_=n=>this.disposeSourceHandler(n),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",function(){this.hasStarted_=!0}),this.on("loadstart",function(){this.hasStarted_=!1}),si.names.forEach(n=>{const s=si[n];e&&e[s.getterName]&&(this[s.privateName]=e[s.getterName])}),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(n=>{e[`native${n}Tracks`]===!1&&(this[`featuresNative${n}Tracks`]=!1)}),e.nativeCaptions===!1||e.nativeTextTracks===!1?this.featuresNativeTextTracks=!1:(e.nativeCaptions===!0||e.nativeTextTracks===!0)&&(this.featuresNativeTextTracks=!0),this.featuresNativeTextTracks||this.emulateTextTracks(),this.preloadTextTracks=e.preloadTextTracks!==!1,this.autoRemoteTextTracks_=new si.text.ListClass,this.initTrackListeners(),e.nativeControlsForTouch||this.emitTapEvents(),this.constructor&&(this.name_=this.constructor.name||"Unknown Tech")}triggerSourceset(e){this.isReady_||this.one("ready",()=>this.setTimeout(()=>this.triggerSourceset(e),1)),this.trigger({src:e,type:"sourceset"})}manualProgressOn(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)}manualProgressOff(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)}trackProgress(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(at(this,function(){const i=this.bufferedPercent();this.bufferedPercent_!==i&&this.trigger("progress"),this.bufferedPercent_=i,i===1&&this.stopTrackingProgress()}),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return Wi(0,0)}bufferedPercent(){return pv(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)}trackCurrentTime(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}dispose(){this.clearTracks(Pi.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){e=[].concat(e),e.forEach(i=>{const n=this[`${i}Tracks`]()||[];let s=n.length;for(;s--;){const r=n[s];i==="text"&&this.removeRemoteTextTrack(r),n.removeTrack(r)}})}cleanupAutoTextTracks(){const e=this.autoRemoteTextTracks_||[];let i=e.length;for(;i--;){const n=e[i];this.removeRemoteTextTrack(n)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return e!==void 0&&(this.error_=new mt(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?Wi(0,0):Wi()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){Pi.names.forEach(e=>{const i=Pi[e],n=()=>{this.trigger(`${e}trackchange`)},s=this[i.getterName]();s.addEventListener("removetrack",n),s.addEventListener("addtrack",n),this.on("dispose",()=>{s.removeEventListener("removetrack",n),s.removeEventListener("addtrack",n)})})}addWebVttScript_(){if(!$.WebVTT)if(_e.body.contains(this.el())){if(!this.options_["vtt.js"]&&kr(Og)&&Object.keys(Og).length>0){this.trigger("vttjsloaded");return}const e=_e.createElement("script");e.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",e.onload=()=>{this.trigger("vttjsloaded")},e.onerror=()=>{this.trigger("vttjserror")},this.on("dispose",()=>{e.onload=null,e.onerror=null}),$.WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){const e=this.textTracks(),i=this.remoteTextTracks(),n=o=>e.addTrack(o.track),s=o=>e.removeTrack(o.track);i.on("addtrack",n),i.on("removetrack",s),this.addWebVttScript_();const r=()=>this.trigger("texttrackchange"),a=()=>{r();for(let o=0;othis.autoRemoteTextTracks_.addTrack(n.track)),n}removeRemoteTextTrack(e){const i=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(i),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return!0}setDisablePictureInPicture(){}requestVideoFrameCallback(e){const i=Li();return!this.isReady_||this.paused()?(this.queuedHanders_.add(i),this.one("playing",()=>{this.queuedHanders_.has(i)&&(this.queuedHanders_.delete(i),e())})):this.requestNamedAnimationFrame(i,e),i}cancelVideoFrameCallback(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(e){}overrideNativeVideoTracks(e){}canPlayType(e){return""}static canPlayType(e){return""}static canPlaySource(e,i){return je.canPlayType(e.type)}static isTech(e){return e.prototype instanceof je||e instanceof je||e===je}static registerTech(e,i){if(je.techs_||(je.techs_={}),!je.isTech(i))throw new Error(`Tech ${e} must be a Tech`);if(!je.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!je.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=_t(e),je.techs_[e]=i,je.techs_[Fa(e)]=i,e!=="Tech"&&je.defaultTechOrder_.push(e),i}static getTech(e){if(e){if(je.techs_&&je.techs_[e])return je.techs_[e];if(e=_t(e),$&&$.videojs&&$.videojs[e])return We.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),$.videojs[e]}}}si.names.forEach(function(t){const e=si[t];je.prototype[e.getterName]=function(){return this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName]}});je.prototype.featuresVolumeControl=!0;je.prototype.featuresMuteControl=!0;je.prototype.featuresFullscreenResize=!1;je.prototype.featuresPlaybackRate=!1;je.prototype.featuresProgressEvents=!1;je.prototype.featuresSourceset=!1;je.prototype.featuresTimeupdateEvents=!1;je.prototype.featuresNativeTextTracks=!1;je.prototype.featuresVideoFrameCallback=!1;je.withSourceHandlers=function(t){t.registerSourceHandler=function(i,n){let s=t.sourceHandlers;s||(s=t.sourceHandlers=[]),n===void 0&&(n=s.length),s.splice(n,0,i)},t.canPlayType=function(i){const n=t.sourceHandlers||[];let s;for(let r=0;rEs(e,Rs[e.type],i,t),1)}function FA(t,e){t.forEach(i=>i.setTech&&i.setTech(e))}function UA(t,e,i){return t.reduceRight(mf(i),e[i]())}function qA(t,e,i,n){return e[i](t.reduce(mf(i),n))}function cm(t,e,i,n=null){const s="call"+_t(i),r=t.reduce(mf(s),n),a=r===Zl,o=a?null:e[i](r);return VA(t,i,o,a),o}const $A={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},jA={setCurrentTime:1,setMuted:1,setVolume:1},dm={play:1,pause:1};function mf(t){return(e,i)=>e===Zl?Zl:i[t]?i[t](e):e}function VA(t,e,i,n){for(let s=t.length-1;s>=0;s--){const r=t[s];r[e]&&r[e](n,i)}}function HA(t){Jl.hasOwnProperty(t.id())&&delete Jl[t.id()]}function zA(t,e){const i=Jl[t.id()];let n=null;if(i==null)return n=e(t),Jl[t.id()]=[[e,n]],n;for(let s=0;s{if(!e)return"";if(t.cache_.source.src===e&&t.cache_.source.type)return t.cache_.source.type;const i=t.cache_.sources.filter(s=>s.src===e);if(i.length)return i[0].type;const n=t.$$("source");for(let s=0;s `;const fm=Gl?10009:Kl?461:8,Js={codes:{play:415,pause:19,ff:417,rw:412,back:fm},names:{415:"play",19:"pause",417:"ff",412:"rw",[fm]:"back"},isEventKey(t,e){return e=e.toLowerCase(),!!(this.names[t.keyCode]&&this.names[t.keyCode]===e)},getEventName(t){if(this.names[t.keyCode])return this.names[t.keyCode];if(this.codes[t.code]){const e=this.codes[t.code];return this.names[e]}return null}},pm=5;class XA extends _i{constructor(e){super(),this.player_=e,this.focusableComponents=[],this.isListening_=!1,this.isPaused_=!1,this.onKeyDown_=this.onKeyDown_.bind(this),this.lastFocusedComponent_=null}start(){this.isListening_||(this.player_.on("keydown",this.onKeyDown_),this.player_.on("modalKeydown",this.onKeyDown_),this.player_.on("loadedmetadata",()=>{this.focus(this.updateFocusableComponents()[0])}),this.player_.on("modalclose",()=>{this.refocusComponent()}),this.player_.on("focusin",this.handlePlayerFocus_.bind(this)),this.player_.on("focusout",this.handlePlayerBlur_.bind(this)),this.isListening_=!0,this.player_.errorDisplay&&this.player_.errorDisplay.on("aftermodalfill",()=>{this.updateFocusableComponents(),this.focusableComponents.length&&(this.focusableComponents.length>1?this.focusableComponents[1].focus():this.focusableComponents[0].focus())}))}stop(){this.player_.off("keydown",this.onKeyDown_),this.isListening_=!1}onKeyDown_(e){const i=e.originalEvent?e.originalEvent:e;if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(i.key)){if(this.isPaused_)return;i.preventDefault();const n=i.key.substring(5).toLowerCase();this.move(n)}else if(Js.isEventKey(i,"play")||Js.isEventKey(i,"pause")||Js.isEventKey(i,"ff")||Js.isEventKey(i,"rw")){i.preventDefault();const n=Js.getEventName(i);this.performMediaAction_(n)}else Js.isEventKey(i,"Back")&&e.target&&typeof e.target.closeable=="function"&&e.target.closeable()&&(i.preventDefault(),e.target.close())}performMediaAction_(e){if(this.player_)switch(e){case"play":this.player_.paused()&&this.player_.play();break;case"pause":this.player_.paused()||this.player_.pause();break;case"ff":this.userSeek_(this.player_.currentTime()+pm);break;case"rw":this.userSeek_(this.player_.currentTime()-pm);break}}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}pause(){this.isPaused_=!0}resume(){this.isPaused_=!1}handlePlayerBlur_(e){const i=e.relatedTarget;let n=null;const s=this.getCurrentComponent(e.target);i&&(n=!!i.closest(".video-js"),i.classList.contains("vjs-text-track-settings")&&!this.isPaused_&&this.searchForTrackSelect_()),(!e.currentTarget.contains(e.relatedTarget)&&!n||!i)&&(s&&s.name()==="CloseButton"?this.refocusComponent():(this.pause(),s&&s.el()&&(this.lastFocusedComponent_=s)))}handlePlayerFocus_(){this.getCurrentComponent()&&this.getCurrentComponent().getIsFocusable()&&this.resume()}updateFocusableComponents(){const e=this.player_,i=[];function n(s){for(const r of s)r.hasOwnProperty("el_")&&r.getIsFocusable()&&r.getIsAvailableToBeFocused(r.el())&&i.push(r),r.hasOwnProperty("children_")&&r.children_.length>0&&n(r.children_)}return e.children_.forEach(s=>{if(s.hasOwnProperty("el_"))if(s.getIsFocusable&&s.getIsAvailableToBeFocused&&s.getIsFocusable()&&s.getIsAvailableToBeFocused(s.el())){i.push(s);return}else s.hasOwnProperty("children_")&&s.children_.length>0?n(s.children_):s.hasOwnProperty("items")&&s.items.length>0?n(s.items):this.findSuitableDOMChild(s)&&i.push(s);if(s.name_==="ErrorDisplay"&&s.opened_){const r=s.el_.querySelector(".vjs-errors-ok-button-container");r&&r.querySelectorAll("button").forEach((o,u)=>{i.push({name:()=>"ModalButton"+(u+1),el:()=>o,getPositions:()=>{const c=o.getBoundingClientRect(),f={x:c.x,y:c.y,width:c.width,height:c.height,top:c.top,right:c.right,bottom:c.bottom,left:c.left},g={x:c.left+c.width/2,y:c.top+c.height/2,width:0,height:0,top:c.top+c.height/2,right:c.left+c.width/2,bottom:c.top+c.height/2,left:c.left+c.width/2};return{boundingClientRect:f,center:g}},getIsAvailableToBeFocused:()=>!0,getIsFocusable:c=>!0,focus:()=>o.focus()})})}}),this.focusableComponents=i,this.focusableComponents}findSuitableDOMChild(e){function i(n){if(e.getIsFocusable(n)&&e.getIsAvailableToBeFocused(n))return n;for(let s=0;s0&&(this.focusableComponents=[],this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents}))}move(e){const i=this.getCurrentComponent();if(!i)return;const n=i.getPositions(),s=this.focusableComponents.filter(a=>a!==i&&this.isInDirection_(n.boundingClientRect,a.getPositions().boundingClientRect,e)),r=this.findBestCandidate_(n.center,s,e);r?this.focus(r):this.trigger({type:"endOfFocusableComponents",direction:e,focusedComponent:i})}findBestCandidate_(e,i,n){let s=1/0,r=null;for(const a of i){const o=a.getPositions().center,u=this.calculateDistance_(e,o,n);u=e.right;case"left":return i.right<=e.left;case"down":return i.top>=e.bottom;case"up":return i.bottom<=e.top;default:return!1}}refocusComponent(){if(this.lastFocusedComponent_){this.player_.userActive()||this.player_.userActive(!0),this.updateFocusableComponents();for(let e=0;ethis.handleMouseOver(n),this.handleMouseOut_=n=>this.handleMouseOut(n),this.handleClick_=n=>this.handleClick(n),this.handleKeyDown_=n=>this.handleKeyDown(n),this.emitTapEvents(),this.enable()}createEl(e="div",i={},n={}){i=Object.assign({className:this.buildCSSClass(),tabIndex:0},i),e==="button"&&We.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),n=Object.assign({role:"button"},n),this.tabIndex_=i.tabIndex;const s=Me(e,i,n);return this.player_.options_.experimentalSvgIcons||s.appendChild(Me("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(s),s}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=Me("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_}controlText(e,i=this.el()){if(e===void 0)return this.controlText_||"Need Text";const n=this.localize(e);this.controlText_=e,cs(this.controlTextEl_,n),!this.nonIconControl&&!this.player_.options_.noUITitleAttributes&&i.setAttribute("title",n)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),typeof this.tabIndex_<"u"&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))}disable(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),typeof this.tabIndex_<"u"&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}handleKeyDown(e){e.key===" "||e.key==="Enter"?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}le.registerComponent("ClickableComponent",zu);class nh extends zu{constructor(e,i){super(e,i),this.update(),this.update_=n=>this.update(n),e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return Me("div",{className:"vjs-poster"})}crossOrigin(e){if(typeof e>"u")return this.$("img")?this.$("img").crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null;if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}this.$("img")&&(this.$("img").crossOrigin=e)}update(e){const i=this.player().poster();this.setSrc(i),i?this.show():this.hide()}setSrc(e){if(!e){this.el_.textContent="";return}this.$("img")||this.el_.appendChild(Me("picture",{className:"vjs-poster",tabIndex:-1},{},Me("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=e}handleClick(e){this.player_.controls()&&(this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?ln(this.player_.play()):this.player_.pause())}}nh.prototype.crossorigin=nh.prototype.crossOrigin;le.registerComponent("PosterImage",nh);const Ci="#222",gm="#ccc",QA={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function nd(t,e){let i;if(t.length===4)i=t[1]+t[1]+t[2]+t[2]+t[3]+t[3];else if(t.length===7)i=t.slice(1);else throw new Error("Invalid color code provided, "+t+"; must be formatted as e.g. #f0e or #f604e2.");return"rgba("+parseInt(i.slice(0,2),16)+","+parseInt(i.slice(2,4),16)+","+parseInt(i.slice(4,6),16)+","+e+")"}function en(t,e,i){try{t.style[e]=i}catch{return}}function mm(t){return t?`${t}px`:""}class JA extends le{constructor(e,i,n){super(e,i,n);const s=a=>this.updateDisplay(a),r=a=>{this.updateDisplayOverlay(),this.updateDisplay(a)};e.on("loadstart",a=>this.toggleDisplay(a)),e.on("texttrackchange",s),e.on("loadedmetadata",a=>{this.updateDisplayOverlay(),this.preselectTrack(a)}),e.ready(at(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks){this.hide();return}e.on("fullscreenchange",r),e.on("playerresize",r);const a=$.screen.orientation||$,o=$.screen.orientation?"change":"orientationchange";a.addEventListener(o,r),e.on("dispose",()=>a.removeEventListener(o,r));const u=this.options_.playerOptions.tracks||[];for(let c=0;c0&&o.forEach(f=>{if(f.style.inset){const g=f.style.inset.split(" ");g.length===3&&Object.assign(f.style,{top:g[0],right:g[1],bottom:g[2],left:"unset"})}})}}updateDisplayOverlay(){if(!this.player_.videoHeight()||!$.CSS.supports("inset-inline: 10px"))return;const e=this.player_.currentWidth(),i=this.player_.currentHeight(),n=e/i,s=this.player_.videoWidth()/this.player_.videoHeight();let r=0,a=0;Math.abs(n-s)>.1&&(n>s?r=Math.round((e-i*s)/2):a=Math.round((i-e/s)/2)),en(this.el_,"insetInline",mm(r)),en(this.el_,"insetBlock",mm(a))}updateDisplayState(e){const i=this.player_.textTrackSettings.getValues(),n=e.activeCues;let s=n.length;for(;s--;){const r=n[s];if(!r)continue;const a=r.displayState;if(i.color&&(a.firstChild.style.color=i.color),i.textOpacity&&en(a.firstChild,"color",nd(i.color||"#fff",i.textOpacity)),i.backgroundColor&&(a.firstChild.style.backgroundColor=i.backgroundColor),i.backgroundOpacity&&en(a.firstChild,"backgroundColor",nd(i.backgroundColor||"#000",i.backgroundOpacity)),i.windowColor&&(i.windowOpacity?en(a,"backgroundColor",nd(i.windowColor,i.windowOpacity)):a.style.backgroundColor=i.windowColor),i.edgeStyle&&(i.edgeStyle==="dropshadow"?a.firstChild.style.textShadow=`2px 2px 3px ${Ci}, 2px 2px 4px ${Ci}, 2px 2px 5px ${Ci}`:i.edgeStyle==="raised"?a.firstChild.style.textShadow=`1px 1px ${Ci}, 2px 2px ${Ci}, 3px 3px ${Ci}`:i.edgeStyle==="depressed"?a.firstChild.style.textShadow=`1px 1px ${gm}, 0 1px ${gm}, -1px -1px ${Ci}, 0 -1px ${Ci}`:i.edgeStyle==="uniform"&&(a.firstChild.style.textShadow=`0 0 4px ${Ci}, 0 0 4px ${Ci}, 0 0 4px ${Ci}, 0 0 4px ${Ci}`)),i.fontPercent&&i.fontPercent!==1){const o=$.parseFloat(a.style.fontSize);a.style.fontSize=o*i.fontPercent+"px",a.style.height="auto",a.style.top="auto"}i.fontFamily&&i.fontFamily!=="default"&&(i.fontFamily==="small-caps"?a.firstChild.style.fontVariant="small-caps":a.firstChild.style.fontFamily=QA[i.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),typeof $.WebVTT!="function"||e.every(n=>!n.activeCues))return;const i=[];for(let n=0;nthis.handleMouseDown(n))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){const i=this.player_.play();if(this.mouseused_&&"clientX"in e&&"clientY"in e){ln(i),this.player_.tech(!0)&&this.player_.tech(!0).focus();return}const n=this.player_.getChild("controlBar"),s=n&&n.getChild("playToggle");if(!s){this.player_.tech(!0).focus();return}const r=()=>s.focus();Ua(i)?i.then(r,()=>{}):this.setTimeout(r,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}bv.prototype.controlText_="Play Video";le.registerComponent("BigPlayButton",bv);class eD extends Yt{constructor(e,i){super(e,i),this.setIcon("cancel"),this.controlText(i&&i.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:"close",bubbles:!1})}handleKeyDown(e){e.key==="Escape"?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}le.registerComponent("CloseButton",eD);class Tv extends Yt{constructor(e,i={}){super(e,i),i.replay=i.replay===void 0||i.replay,this.setIcon("play"),this.on(e,"play",n=>this.handlePlay(n)),this.on(e,"pause",n=>this.handlePause(n)),i.replay&&this.on(e,"ended",n=>this.handleEnded(n))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?ln(this.player_.play()):this.player_.pause()}handleSeeked(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)}handlePlay(e){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.setIcon("pause"),this.controlText("Pause")}handlePause(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.setIcon("play"),this.controlText("Play")}handleEnded(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.setIcon("replay"),this.controlText("Replay"),this.one(this.player_,"seeked",i=>this.handleSeeked(i))}}Tv.prototype.controlText_="Play";le.registerComponent("PlayToggle",Tv);class Vr extends le{constructor(e,i){super(e,i),this.on(e,["timeupdate","ended","seeking"],n=>this.update(n)),this.updateTextNode_()}createEl(){const e=this.buildCSSClass(),i=super.createEl("div",{className:`${e} vjs-time-control vjs-control`}),n=Me("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)} `},{role:"presentation"});return i.appendChild(n),this.contentEl_=Me("span",{className:`${e}-display`},{role:"presentation"}),i.appendChild(this.contentEl_),i}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}update(e){!this.player_.options_.enableSmoothSeeking&&e.type==="seeking"||this.updateContent(e)}updateTextNode_(e=0){e=$s(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",()=>{if(!this.contentEl_)return;let i=this.textNode_;i&&this.contentEl_.firstChild!==i&&(i=null,We.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),this.textNode_=_e.createTextNode(this.formattedTime_),this.textNode_&&(i?this.contentEl_.replaceChild(this.textNode_,i):this.contentEl_.appendChild(this.textNode_))}))}updateContent(e){}}Vr.prototype.labelText_="Time";Vr.prototype.controlText_="Time";le.registerComponent("TimeDisplay",Vr);class yf extends Vr{buildCSSClass(){return"vjs-current-time"}updateContent(e){let i;this.player_.ended()?i=this.player_.duration():i=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(i)}}yf.prototype.labelText_="Current Time";yf.prototype.controlText_="Current Time";le.registerComponent("CurrentTimeDisplay",yf);class _f extends Vr{constructor(e,i){super(e,i);const n=s=>this.updateContent(s);this.on(e,"durationchange",n),this.on(e,"loadstart",n),this.on(e,"loadedmetadata",n)}buildCSSClass(){return"vjs-duration"}updateContent(e){const i=this.player_.duration();this.updateTextNode_(i)}}_f.prototype.labelText_="Duration";_f.prototype.controlText_="Duration";le.registerComponent("DurationDisplay",_f);class tD extends le{createEl(){const e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),i=super.createEl("div"),n=super.createEl("span",{textContent:"/"});return i.appendChild(n),e.appendChild(i),e}}le.registerComponent("TimeDivider",tD);class vf extends Vr{constructor(e,i){super(e,i),this.on(e,"durationchange",n=>this.updateContent(n))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const e=super.createEl();return this.options_.displayNegative!==!1&&e.insertBefore(Me("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e}updateContent(e){if(typeof this.player_.duration()!="number")return;let i;this.player_.ended()?i=0:this.player_.remainingTimeDisplay?i=this.player_.remainingTimeDisplay():i=this.player_.remainingTime(),this.updateTextNode_(i)}}vf.prototype.labelText_="Remaining Time";vf.prototype.controlText_="Remaining Time";le.registerComponent("RemainingTimeDisplay",vf);class iD extends le{constructor(e,i){super(e,i),this.updateShowing(),this.on(this.player(),"durationchange",n=>this.updateShowing(n))}createEl(){const e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=Me("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(Me("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")} `})),this.contentEl_.appendChild(_e.createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e}dispose(){this.contentEl_=null,super.dispose()}updateShowing(e){this.player().duration()===1/0?this.show():this.hide()}}le.registerComponent("LiveDisplay",iD);class xv extends Yt{constructor(e,i){super(e,i),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=n=>this.updateLiveEdgeStatus(n),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_))}createEl(){const e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.setIcon("circle",e),this.textEl_=Me("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e}updateLiveEdgeStatus(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,super.dispose()}}xv.prototype.controlText_="Seek to live, currently playing live";le.registerComponent("SeekToLive",xv);function yo(t,e,i){return t=Number(t),Math.min(i,Math.max(e,isNaN(t)?e:t))}var nD=Object.freeze({__proto__:null,clamp:yo});class bf extends le{constructor(e,i){super(e,i),this.handleMouseDown_=n=>this.handleMouseDown(n),this.handleMouseUp_=n=>this.handleMouseUp(n),this.handleKeyDown_=n=>this.handleKeyDown(n),this.handleClick_=n=>this.handleClick(n),this.handleMouseMove_=n=>this.handleMouseMove(n),this.update_=n=>this.update(n),this.bar=this.getChild(this.options_.barName),this.vertical(!!this.options_.vertical),this.enable()}enabled(){return this.enabled_}enable(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)}disable(){if(!this.enabled())return;const e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}createEl(e,i={},n={}){return i.className=i.className+" vjs-slider",i=Object.assign({tabIndex:0},i),n=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},n),super.createEl(e,i,n)}handleMouseDown(e){const i=this.bar.el_.ownerDocument;e.type==="mousedown"&&e.preventDefault(),e.type==="touchstart"&&!pn&&e.preventDefault(),X_(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(i,"mousemove",this.handleMouseMove_),this.on(i,"mouseup",this.handleMouseUp_),this.on(i,"touchmove",this.handleMouseMove_),this.on(i,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)}handleMouseMove(e){}handleMouseUp(e){const i=this.bar.el_.ownerDocument;Y_(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(i,"mousemove",this.handleMouseMove_),this.off(i,"mouseup",this.handleMouseUp_),this.off(i,"touchmove",this.handleMouseMove_),this.off(i,"touchend",this.handleMouseUp_),this.update()}update(){if(!this.el_||!this.bar)return;const e=this.getProgress();return e===this.progress_||(this.progress_=e,this.requestNamedAnimationFrame("Slider#update",()=>{const i=this.vertical()?"height":"width";this.bar.el().style[i]=(e*100).toFixed(2)+"%"})),e}getProgress(){return Number(yo(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const i=Uu(this.el_,e);return this.vertical()?i.y:i.x}handleKeyDown(e){const i=this.options_.playerOptions.spatialNavigation,n=i&&i.enabled,s=i&&i.horizontalSeek;n?s&&e.key==="ArrowLeft"||!s&&e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):s&&e.key==="ArrowRight"||!s&&e.key==="ArrowUp"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e):e.key==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):e.key==="ArrowUp"||e.key==="ArrowRight"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e)}handleClick(e){e.stopPropagation(),e.preventDefault()}vertical(e){if(e===void 0)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")}}le.registerComponent("Slider",bf);const sd=(t,e)=>yo(t/e*100,0,100).toFixed(2)+"%";class sD extends le{constructor(e,i){super(e,i),this.partEls_=[],this.on(e,"progress",n=>this.update(n))}createEl(){const e=super.createEl("div",{className:"vjs-load-progress"}),i=Me("span",{className:"vjs-control-text"}),n=Me("span",{textContent:this.localize("Loaded")}),s=_e.createTextNode(": ");return this.percentageEl_=Me("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(i),i.appendChild(n),i.appendChild(s),i.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",()=>{const i=this.player_.liveTracker,n=this.player_.buffered(),s=i&&i.isLive()?i.seekableEnd():this.player_.duration(),r=this.player_.bufferedEnd(),a=this.partEls_,o=sd(r,s);this.percent_!==o&&(this.el_.style.width=o,cs(this.percentageEl_,o),this.percent_=o);for(let u=0;un.length;u--)this.el_.removeChild(a[u-1]);a.length=n.length})}}le.registerComponent("LoadProgressBar",sD);class rD extends le{constructor(e,i){super(e,i),this.update=gn(at(this,this.update),Ri)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,i,n){const s=io(this.el_),r=Pr(this.player_.el()),a=e.width*i;if(!r||!s)return;let o=e.left-r.left+a,u=e.width-a+(r.right-e.right);u||(u=e.width-a,o=a);let c=s.width/2;os.width&&(c=s.width),c=Math.round(c),this.el_.style.right=`-${c}px`,this.write(n)}write(e){cs(this.el_,e)}updateTime(e,i,n,s){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{let r;const a=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const o=this.player_.liveTracker.liveWindow(),u=o-i*o;r=(u<1?"":"-")+$s(u,o)}else r=$s(n,a);this.update(e,i,r),s&&s()})}}le.registerComponent("TimeTooltip",rD);class Tf extends le{constructor(e,i){super(e,i),this.setIcon("circle"),this.update=gn(at(this,this.update),Ri)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,i){const n=this.getChild("timeTooltip");if(!n)return;const s=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();n.updateTime(e,i,s)}}Tf.prototype.options_={children:[]};!Kt&&!Ki&&Tf.prototype.options_.children.push("timeTooltip");le.registerComponent("PlayProgressBar",Tf);class Sv extends le{constructor(e,i){super(e,i),this.update=gn(at(this,this.update),Ri)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,i){const n=i*this.player_.duration();this.getChild("timeTooltip").updateTime(e,i,n,()=>{this.el_.style.left=`${e.width*i}px`})}}Sv.prototype.options_={children:["timeTooltip"]};le.registerComponent("MouseTimeDisplay",Sv);const tl=5,ym=12;class Wu extends bf{constructor(e,i){i=it(Wu.prototype.options_,i),i.children=[...i.children];const n=e.options_.disableSeekWhileScrubbingOnMobile&&(Kt||Ki);(!Kt&&!Ki||n)&&i.children.splice(1,0,"mouseTimeDisplay"),super(e,i),this.shouldDisableSeekWhileScrubbingOnMobile_=n,this.pendingSeekTime_=null,this.setEventHandlers_()}setEventHandlers_(){this.update_=at(this,this.update),this.update=gn(this.update_,Ri),this.on(this.player_,["durationchange","timeupdate"],this.update),this.on(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=e=>this.enableInterval_(e),this.disableIntervalHandler_=e=>this.disableInterval_(e),this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in _e&&"visibilityState"in _e&&this.on(_e,"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){_e.visibilityState==="hidden"?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(!this.player_.ended()&&!this.player_.paused()&&this.enableInterval_(),this.update())}enableInterval_(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,Ri))}disableInterval_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&e.type!=="ended"||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(e){if(_e.visibilityState==="hidden")return;const i=super.update();return this.requestNamedAnimationFrame("SeekBar#update",()=>{const n=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),s=this.player_.liveTracker;let r=this.player_.duration();s&&s.isLive()&&(r=this.player_.liveTracker.liveCurrentTime()),this.percent_!==i&&(this.el_.setAttribute("aria-valuenow",(i*100).toFixed(2)),this.percent_=i),(this.currentTime_!==n||this.duration_!==r)&&(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[$s(n,r),$s(r,r)],"{1} of {2}")),this.currentTime_=n,this.duration_=r),this.bar&&this.bar.update(Pr(this.el()),this.getProgress())}),i}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}getPercent(){if(this.pendingSeekTime_)return this.pendingSeekTime_/this.player_.duration();const e=this.getCurrentTime_();let i;const n=this.player_.liveTracker;return n&&n.isLive()?(i=(e-n.seekableStart())/n.liveWindow(),n.atLiveEdge()&&(i=1)):i=e/this.player_.duration(),i}handleMouseDown(e){no(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.shouldDisableSeekWhileScrubbingOnMobile_||this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,i=!1){if(!no(e)||isNaN(this.player_.duration()))return;!i&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);let n;const s=this.calculateDistance(e),r=this.player_.liveTracker;if(!r||!r.isLive())n=s*this.player_.duration(),n===this.player_.duration()&&(n=n-.1);else{if(s>=.99){r.seekToLiveEdge();return}const a=r.seekableStart(),o=r.liveCurrentTime();if(n=a+s*r.liveWindow(),n>=o&&(n=o),n<=a&&(n=a+.1),n===1/0)return}this.shouldDisableSeekWhileScrubbingOnMobile_?this.pendingSeekTime_=n:this.userSeek_(n),this.player_.options_.enableSmoothSeeking&&this.update()}enable(){super.enable();const e=this.getChild("mouseTimeDisplay");e&&e.show()}disable(){super.disable();const e=this.getChild("mouseTimeDisplay");e&&e.hide()}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.pendingSeekTime_&&(this.userSeek_(this.pendingSeekTime_),this.pendingSeekTime_=null),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?ln(this.player_.play()):this.update_()}stepForward(){this.userSeek_(this.player_.currentTime()+tl)}stepBack(){this.userSeek_(this.player_.currentTime()-tl)}handleAction(e){this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){const i=this.player_.liveTracker;if(e.key===" "||e.key==="Enter")e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(e.key==="Home")e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(e.key==="End")e.preventDefault(),e.stopPropagation(),i&&i.isLive()?this.userSeek_(i.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(e.key)){e.preventDefault(),e.stopPropagation();const n=parseInt(e.key,10)*.1;i&&i.isLive()?this.userSeek_(i.seekableStart()+i.liveWindow()*n):this.userSeek_(this.player_.duration()*n)}else e.key==="PageDown"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-tl*ym)):e.key==="PageUp"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+tl*ym)):super.handleKeyDown(e)}dispose(){this.disableInterval_(),this.off(this.player_,["durationchange","timeupdate"],this.update),this.off(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in _e&&"visibilityState"in _e&&this.off(_e,"visibilitychange",this.toggleVisibility_),super.dispose()}}Wu.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"};le.registerComponent("SeekBar",Wu);class Ev extends le{constructor(e,i){super(e,i),this.handleMouseMove=gn(at(this,this.handleMouseMove),Ri),this.throttledHandleMouseSeek=gn(at(this,this.handleMouseSeek),Ri),this.handleMouseUpHandler_=n=>this.handleMouseUp(n),this.handleMouseDownHandler_=n=>this.handleMouseDown(n),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){const i=this.getChild("seekBar");if(!i)return;const n=i.getChild("playProgressBar"),s=i.getChild("mouseTimeDisplay");if(!n&&!s)return;const r=i.el(),a=io(r);let o=Uu(r,e).x;o=yo(o,0,1),s&&s.update(a,o),n&&n.update(a,i.getProgress())}handleMouseSeek(e){const i=this.getChild("seekBar");i&&i.handleMouseMove(e)}enabled(){return this.enabled_}disable(){if(this.children().forEach(e=>e.disable&&e.disable()),!!this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,["mousemove","touchmove"],this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){const e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&ln(this.player_.play())}}enable(){this.children().forEach(e=>e.enable&&e.enable()),!this.enabled()&&(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,["mousemove","touchmove"],this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)}removeListenersAddedOnMousedownAndTouchstart(){const e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)}handleMouseDown(e){const i=this.el_.ownerDocument,n=this.getChild("seekBar");n&&n.handleMouseDown(e),this.on(i,"mousemove",this.throttledHandleMouseSeek),this.on(i,"touchmove",this.throttledHandleMouseSeek),this.on(i,"mouseup",this.handleMouseUpHandler_),this.on(i,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const i=this.getChild("seekBar");i&&i.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}}Ev.prototype.options_={children:["seekBar"]};le.registerComponent("ProgressControl",Ev);class Cv extends Yt{constructor(e,i){super(e,i),this.setIcon("picture-in-picture-enter"),this.on(e,["enterpictureinpicture","leavepictureinpicture"],n=>this.handlePictureInPictureChange(n)),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],n=>this.handlePictureInPictureEnabledChange(n)),this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],()=>this.handlePictureInPictureAudioModeChange()),this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){if(!(this.player_.currentType().substring(0,5)==="audio"||this.player_.audioPosterMode()||this.player_.audioOnlyMode())){this.show();return}this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()}handlePictureInPictureEnabledChange(){_e.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in $?this.enable():this.disable()}handlePictureInPictureChange(e){this.player_.isInPictureInPicture()?(this.setIcon("picture-in-picture-exit"),this.controlText("Exit Picture-in-Picture")):(this.setIcon("picture-in-picture-enter"),this.controlText("Picture-in-Picture")),this.handlePictureInPictureEnabledChange()}handleClick(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}show(){typeof _e.exitPictureInPicture=="function"&&super.show()}}Cv.prototype.controlText_="Picture-in-Picture";le.registerComponent("PictureInPictureToggle",Cv);class wv extends Yt{constructor(e,i){super(e,i),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",n=>this.handleFullscreenChange(n)),_e[e.fsApi_.fullscreenEnabled]===!1&&this.disable()}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){this.player_.isFullscreen()?(this.controlText("Exit Fullscreen"),this.setIcon("fullscreen-exit")):(this.controlText("Fullscreen"),this.setIcon("fullscreen-enter"))}handleClick(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}}wv.prototype.controlText_="Fullscreen";le.registerComponent("FullscreenToggle",wv);const aD=function(t,e){e.tech_&&!e.tech_.featuresVolumeControl&&t.addClass("vjs-hidden"),t.on(e,"loadstart",function(){e.tech_.featuresVolumeControl?t.removeClass("vjs-hidden"):t.addClass("vjs-hidden")})};class oD extends le{createEl(){const e=super.createEl("div",{className:"vjs-volume-level"});return this.setIcon("circle",e),e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}}le.registerComponent("VolumeLevel",oD);class lD extends le{constructor(e,i){super(e,i),this.update=gn(at(this,this.update),Ri)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,i,n,s){if(!n){const r=Pr(this.el_),a=Pr(this.player_.el()),o=e.width*i;if(!a||!r)return;const u=e.left-a.left+o,c=e.width-o+(a.right-e.right);let f=r.width/2;ur.width&&(f=r.width),this.el_.style.right=`-${f}px`}this.write(`${s}%`)}write(e){cs(this.el_,e)}updateVolume(e,i,n,s,r){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{this.update(e,i,n,s.toFixed(0)),r&&r()})}}le.registerComponent("VolumeLevelTooltip",lD);class Av extends le{constructor(e,i){super(e,i),this.update=gn(at(this,this.update),Ri)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,i,n){const s=100*i;this.getChild("volumeLevelTooltip").updateVolume(e,i,n,s,()=>{n?this.el_.style.bottom=`${e.height*i}px`:this.el_.style.left=`${e.width*i}px`})}}Av.prototype.options_={children:["volumeLevelTooltip"]};le.registerComponent("MouseVolumeLevelDisplay",Av);class Gu extends bf{constructor(e,i){super(e,i),this.on("slideractive",n=>this.updateLastVolume_(n)),this.on(e,"volumechange",n=>this.updateARIAAttributes(n)),e.ready(()=>this.updateARIAAttributes())}createEl(){return super.createEl("div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})}handleMouseDown(e){no(e)&&super.handleMouseDown(e)}handleMouseMove(e){const i=this.getChild("mouseVolumeLevelDisplay");if(i){const n=this.el(),s=Pr(n),r=this.vertical();let a=Uu(n,e);a=r?a.y:a.x,a=yo(a,0,1),i.update(s,a,r)}no(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))}checkMuted(){this.player_.muted()&&this.player_.muted(!1)}getPercent(){return this.player_.muted()?0:this.player_.volume()}stepForward(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(e){const i=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",i),this.el_.setAttribute("aria-valuetext",i+"%")}volumeAsPercentage_(){return Math.round(this.player_.volume()*100)}updateLastVolume_(){const e=this.player_.volume();this.one("sliderinactive",()=>{this.player_.volume()===0&&this.player_.lastVolume_(e)})}}Gu.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};!Kt&&!Ki&&Gu.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay");Gu.prototype.playerEvent="volumechange";le.registerComponent("VolumeBar",Gu);class Dv extends le{constructor(e,i={}){i.vertical=i.vertical||!1,(typeof i.volumeBar>"u"||kr(i.volumeBar))&&(i.volumeBar=i.volumeBar||{},i.volumeBar.vertical=i.vertical),super(e,i),aD(this,e),this.throttledHandleMouseMove=gn(at(this,this.handleMouseMove),Ri),this.handleMouseUpHandler_=n=>this.handleMouseUp(n),this.on("mousedown",n=>this.handleMouseDown(n)),this.on("touchstart",n=>this.handleMouseDown(n)),this.on("mousemove",n=>this.handleMouseMove(n)),this.on(this.volumeBar,["focus","slideractive"],()=>{this.volumeBar.addClass("vjs-slider-active"),this.addClass("vjs-slider-active"),this.trigger("slideractive")}),this.on(this.volumeBar,["blur","sliderinactive"],()=>{this.volumeBar.removeClass("vjs-slider-active"),this.removeClass("vjs-slider-active"),this.trigger("sliderinactive")})}createEl(){let e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),super.createEl("div",{className:`vjs-volume-control vjs-control ${e}`})}handleMouseDown(e){const i=this.el_.ownerDocument;this.on(i,"mousemove",this.throttledHandleMouseMove),this.on(i,"touchmove",this.throttledHandleMouseMove),this.on(i,"mouseup",this.handleMouseUpHandler_),this.on(i,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const i=this.el_.ownerDocument;this.off(i,"mousemove",this.throttledHandleMouseMove),this.off(i,"touchmove",this.throttledHandleMouseMove),this.off(i,"mouseup",this.handleMouseUpHandler_),this.off(i,"touchend",this.handleMouseUpHandler_)}handleMouseMove(e){this.volumeBar.handleMouseMove(e)}}Dv.prototype.options_={children:["volumeBar"]};le.registerComponent("VolumeControl",Dv);const uD=function(t,e){e.tech_&&!e.tech_.featuresMuteControl&&t.addClass("vjs-hidden"),t.on(e,"loadstart",function(){e.tech_.featuresMuteControl?t.removeClass("vjs-hidden"):t.addClass("vjs-hidden")})};class kv extends Yt{constructor(e,i){super(e,i),uD(this,e),this.on(e,["loadstart","volumechange"],n=>this.update(n))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){const i=this.player_.volume(),n=this.player_.lastVolume_();if(i===0){const s=n<.1?.1:n;this.player_.volume(s),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())}update(e){this.updateIcon_(),this.updateControlText_()}updateIcon_(){const e=this.player_.volume();let i=3;this.setIcon("volume-high"),Kt&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),e===0||this.player_.muted()?(this.setIcon("volume-mute"),i=0):e<.33?(this.setIcon("volume-low"),i=1):e<.67&&(this.setIcon("volume-medium"),i=2),Bu(this.el_,[0,1,2,3].reduce((n,s)=>n+`${s?" ":""}vjs-vol-${s}`,"")),Ls(this.el_,`vjs-vol-${i}`)}updateControlText_(){const i=this.player_.muted()||this.player_.volume()===0?"Unmute":"Mute";this.controlText()!==i&&this.controlText(i)}}kv.prototype.controlText_="Mute";le.registerComponent("MuteToggle",kv);class Iv extends le{constructor(e,i={}){typeof i.inline<"u"?i.inline=i.inline:i.inline=!0,(typeof i.volumeControl>"u"||kr(i.volumeControl))&&(i.volumeControl=i.volumeControl||{},i.volumeControl.vertical=!i.inline),super(e,i),this.handleKeyPressHandler_=n=>this.handleKeyPress(n),this.on(e,["loadstart"],n=>this.volumePanelState_(n)),this.on(this.muteToggle,"keyup",n=>this.handleKeyPress(n)),this.on(this.volumeControl,"keyup",n=>this.handleVolumeControlKeyUp(n)),this.on("keydown",n=>this.handleKeyPress(n)),this.on("mouseover",n=>this.handleMouseOver(n)),this.on("mouseout",n=>this.handleMouseOut(n)),this.on(this.volumeControl,["slideractive"],this.sliderActive_),this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_)}sliderActive_(){this.addClass("vjs-slider-active")}sliderInactive_(){this.removeClass("vjs-slider-active")}volumePanelState_(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")}createEl(){let e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),super.createEl("div",{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut(),super.dispose()}handleVolumeControlKeyUp(e){e.key==="Escape"&&this.muteToggle.focus()}handleMouseOver(e){this.addClass("vjs-hover"),yi(_e,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),Xt(_e,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){e.key==="Escape"&&this.handleMouseOut()}}Iv.prototype.options_={children:["muteToggle","volumeControl"]};le.registerComponent("VolumePanel",Iv);class Pv extends Yt{constructor(e,i){super(e,i),this.validOptions=[5,10,30],this.skipTime=this.getSkipForwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`forward-${this.skipTime}`),this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipForwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(e){if(isNaN(this.player_.duration()))return;const i=this.player_.currentTime(),n=this.player_.liveTracker,s=n&&n.isLive()?n.seekableEnd():this.player_.duration();let r;i+this.skipTime<=s?r=i+this.skipTime:r=s,this.player_.currentTime(r)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}Pv.prototype.controlText_="Skip Forward";le.registerComponent("SkipForward",Pv);class Ov extends Yt{constructor(e,i){super(e,i),this.validOptions=[5,10,30],this.skipTime=this.getSkipBackwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`replay-${this.skipTime}`),this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipBackwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(e){const i=this.player_.currentTime(),n=this.player_.liveTracker,s=n&&n.isLive()&&n.seekableStart();let r;s&&i-this.skipTime<=s?r=s:i>=this.skipTime?r=i-this.skipTime:r=0,this.player_.currentTime(r)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}Ov.prototype.controlText_="Skip Backward";le.registerComponent("SkipBackward",Ov);class Lv extends le{constructor(e,i){super(e,i),i&&(this.menuButton_=i.menuButton),this.focusedChild_=-1,this.on("keydown",n=>this.handleKeyDown(n)),this.boundHandleBlur_=n=>this.handleBlur(n),this.boundHandleTapClick_=n=>this.handleTapClick(n)}addEventListenerForItem(e){e instanceof le&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof le&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))}removeChild(e){typeof e=="string"&&(e=this.getChild(e)),this.removeEventListenerForItem(e),super.removeChild(e)}addItem(e){const i=this.addChild(e);i&&this.addEventListenerForItem(i)}createEl(){const e=this.options_.contentElType||"ul";this.contentEl_=Me(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");const i=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});return i.appendChild(this.contentEl_),yi(i,"click",function(n){n.preventDefault(),n.stopImmediatePropagation()}),i}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){const i=e.relatedTarget||_e.activeElement;if(!this.children().some(n=>n.el()===i)){const n=this.menuButton_;n&&n.buttonPressed_&&i!==n.el().firstChild&&n.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();const i=this.children();if(!Array.isArray(i))return;const n=i.filter(s=>s.el()===e.target)[0];if(!n)return;n.name()!=="CaptionSettingsMenuItem"&&this.menuButton_.focus()}}handleKeyDown(e){e.key==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(e.key==="ArrowRight"||e.key==="ArrowUp")&&(e.preventDefault(),e.stopPropagation(),this.stepBack())}stepForward(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_+1),this.focus(e)}stepBack(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_-1),this.focus(e)}focus(e=0){const i=this.children().slice();i.length&&i[0].hasClass("vjs-menu-title")&&i.shift(),i.length>0&&(e<0?e=0:e>=i.length&&(e=i.length-1),this.focusedChild_=e,i[e].el_.focus())}}le.registerComponent("Menu",Lv);class xf extends le{constructor(e,i={}){super(e,i),this.menuButton_=new Yt(e,i),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");const n=Yt.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+n,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;const s=r=>this.handleClick(r);this.handleMenuKeyUp_=r=>this.handleMenuKeyUp(r),this.on(this.menuButton_,"tap",s),this.on(this.menuButton_,"click",s),this.on(this.menuButton_,"keydown",r=>this.handleKeyDown(r)),this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover"),this.menu.show(),yi(_e,"keyup",this.handleMenuKeyUp_)}),this.on("mouseleave",r=>this.handleMouseLeave(r)),this.on("keydown",r=>this.handleSubmenuKeyDown(r))}update(){const e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))}createMenu(){const e=new Lv(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const i=Me("li",{className:"vjs-menu-title",textContent:_t(this.options_.title),tabIndex:-1}),n=new le(this.player_,{el:i});e.addItem(n)}if(this.items=this.createItems(),this.items)for(let i=0;i{this.handleTracksChange.apply(this,o)},a=(...o)=>{this.handleSelectedLanguageChange.apply(this,o)};if(e.on(["loadstart","texttrackchange"],r),s.addEventListener("change",r),s.addEventListener("selectedlanguagechange",a),this.on("dispose",function(){e.off(["loadstart","texttrackchange"],r),s.removeEventListener("change",r),s.removeEventListener("selectedlanguagechange",a)}),s.onchange===void 0){let o;this.on(["tap","click"],function(){if(typeof $.Event!="object")try{o=new $.Event("change")}catch{}o||(o=_e.createEvent("Event"),o.initEvent("change",!0,!0)),s.dispatchEvent(o)})}this.handleTracksChange()}handleClick(e){const i=this.track,n=this.player_.textTracks();if(super.handleClick(e),!!n)for(let s=0;s-1&&a.mode==="showing"){n=!1;break}}n!==this.isSelected_&&this.selected(n)}handleSelectedLanguageChange(e){const i=this.player().textTracks();let n=!0;for(let s=0,r=i.length;s-1&&a.mode==="showing"){n=!1;break}}n&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}}le.registerComponent("OffTextTrackMenuItem",Rv);class Hr extends Sf{constructor(e,i={}){i.tracks=e.textTracks(),super(e,i)}createItems(e=[],i=vo){let n;this.label_&&(n=`${this.label_} off`),e.push(new Rv(this.player_,{kinds:this.kinds_,kind:this.kind_,label:n})),this.hideThreshold_+=1;const s=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let r=0;r-1){const o=new i(this.player_,{track:a,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});o.addClass(`vjs-${a.kind}-menu-item`),e.push(o)}}return e}}le.registerComponent("TextTrackButton",Hr);class Mv extends _o{constructor(e,i){const n=i.track,s=i.cue,r=e.currentTime();i.selectable=!0,i.multiSelectable=!1,i.label=s.text,i.selected=s.startTime<=r&&r{this.items.forEach(s=>{s.selected(this.track_.activeCues[0]===s.cue)})}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(e){if(e&&e.track&&e.track.kind!=="chapters")return;const i=this.findChaptersTrack();i!==this.track_?(this.setTrack(i),super.update()):(!this.items||i&&i.cues&&i.cues.length!==this.items.length)&&super.update()}setTrack(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){const i=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);i&&i.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";const i=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);i&&i.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}}findChaptersTrack(){const e=this.player_.textTracks()||[];for(let i=e.length-1;i>=0;i--){const n=e[i];if(n.kind===this.kind_)return n}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(_t(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){const e=[];if(!this.track_)return e;const i=this.track_.cues;if(!i)return e;for(let n=0,s=i.length;n-1&&(this.label_="captions",this.setIcon("captions")),this.menuButton_.controlText(_t(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new Af(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,Nv),e}}kf.prototype.kinds_=["captions","subtitles"];kf.prototype.controlText_="Subtitles";le.registerComponent("SubsCapsButton",kf);class Bv extends _o{constructor(e,i){const n=i.track,s=e.audioTracks();i.label=n.label||n.language||"Unknown",i.selected=n.enabled,super(e,i),this.track=n,this.addClass(`vjs-${n.kind}-menu-item`);const r=(...a)=>{this.handleTracksChange.apply(this,a)};s.addEventListener("change",r),this.on("dispose",()=>{s.removeEventListener("change",r)})}createEl(e,i,n){const s=super.createEl(e,i,n),r=s.querySelector(".vjs-menu-item-text");return["main-desc","descriptions"].indexOf(this.options_.track.kind)>=0&&(r.appendChild(Me("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),r.appendChild(Me("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),s}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){const i=this.player_.audioTracks();for(let n=0;nthis.update(r))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}}If.prototype.contentElType="button";le.registerComponent("PlaybackRateMenuItem",If);class Uv extends xf{constructor(e,i){super(e,i),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",n=>this.updateVisibility(n)),this.on(e,"ratechange",n=>this.updateLabel(n)),this.on(e,"playbackrateschange",n=>this.handlePlaybackRateschange(n))}createEl(){const e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=Me("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e}dispose(){this.labelEl_=null,super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){const e=this.playbackRates(),i=[];for(let n=e.length-1;n>=0;n--)i.push(new If(this.player(),{rate:e[n]+"x"}));return i}handlePlaybackRateschange(e){this.update()}playbackRates(){const e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}updateLabel(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")}}Uv.prototype.controlText_="Playback Rate";le.registerComponent("PlaybackRateMenuButton",Uv);class qv extends le{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",i={},n={}){return i.className||(i.className=this.buildCSSClass()),super.createEl(e,i,n)}}le.registerComponent("Spacer",qv);class cD extends qv{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:" "})}}le.registerComponent("CustomControlSpacer",cD);class $v extends le{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}$v.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]};le.registerComponent("ControlBar",$v);class jv extends jr{constructor(e,i){super(e,i),this.on(e,"error",n=>{this.open(n)})}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const e=this.player().error();return e?this.localize(e.message):""}}jv.prototype.options_=Object.assign({},jr.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0});le.registerComponent("ErrorDisplay",jv);class Vv extends le{constructor(e,i={}){super(e,i),this.el_.setAttribute("aria-labelledby",this.selectLabelledbyIds)}createEl(){return this.selectLabelledbyIds=[this.options_.legendId,this.options_.labelId].join(" ").trim(),Me("select",{id:this.options_.id},{},this.options_.SelectOptions.map(i=>{const n=(this.options_.labelId?this.options_.labelId:`vjs-track-option-${Li()}`)+"-"+i[1].replace(/\W+/g,""),s=Me("option",{id:n,value:this.localize(i[0]),textContent:this.localize(i[1])});return s.setAttribute("aria-labelledby",`${this.selectLabelledbyIds} ${n}`),s}))}}le.registerComponent("TextTrackSelect",Vv);class Ms extends le{constructor(e,i={}){super(e,i);const n=Me("legend",{textContent:this.localize(this.options_.legendText),id:this.options_.legendId});this.el().appendChild(n);const s=this.options_.selects;for(const r of s){const a=this.options_.selectConfigs[r],o=a.className,u=a.id.replace("%s",this.options_.id_);let c=null;const f=`vjs_select_${Li()}`;if(this.options_.type==="colors"){c=Me("span",{className:o});const y=Me("label",{id:u,className:"vjs-label",textContent:this.localize(a.label)});y.setAttribute("for",f),c.appendChild(y)}const g=new Vv(e,{SelectOptions:a.options,legendId:this.options_.legendId,id:f,labelId:u});this.addChild(g),this.options_.type==="colors"&&(c.appendChild(g.el()),this.el().appendChild(c))}}createEl(){return Me("fieldset",{className:this.options_.className})}}le.registerComponent("TextTrackFieldset",Ms);class Hv extends le{constructor(e,i={}){super(e,i);const n=this.options_.textTrackComponentid,s=new Ms(e,{id_:n,legendId:`captions-text-legend-${n}`,legendText:this.localize("Text"),className:"vjs-fg vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(s);const r=new Ms(e,{id_:n,legendId:`captions-background-${n}`,legendText:this.localize("Text Background"),className:"vjs-bg vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(r);const a=new Ms(e,{id_:n,legendId:`captions-window-${n}`,legendText:this.localize("Caption Area Background"),className:"vjs-window vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(a)}createEl(){return Me("div",{className:"vjs-track-settings-colors"})}}le.registerComponent("TextTrackSettingsColors",Hv);class zv extends le{constructor(e,i={}){super(e,i);const n=this.options_.textTrackComponentid,s=new Ms(e,{id_:n,legendId:`captions-font-size-${n}`,legendText:"Font Size",className:"vjs-font-percent vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(s);const r=new Ms(e,{id_:n,legendId:`captions-edge-style-${n}`,legendText:this.localize("Text Edge Style"),className:"vjs-edge-style vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(r);const a=new Ms(e,{id_:n,legendId:`captions-font-family-${n}`,legendText:this.localize("Font Family"),className:"vjs-font-family vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(a)}createEl(){return Me("div",{className:"vjs-track-settings-font"})}}le.registerComponent("TextTrackSettingsFont",zv);class Wv extends le{constructor(e,i={}){super(e,i);const n=this.localize("restore all settings to the default values"),s=new Yt(e,{controlText:n,className:"vjs-default-button"});s.el().classList.remove("vjs-control","vjs-button"),s.el().textContent=this.localize("Reset"),this.addChild(s);const r=new Yt(e,{controlText:n,className:"vjs-done-button"});r.el().classList.remove("vjs-control","vjs-button"),r.el().textContent=this.localize("Done"),this.addChild(r)}createEl(){return Me("div",{className:"vjs-track-settings-controls"})}}le.registerComponent("TrackSettingsControls",Wv);const rd="vjs-text-track-settings",_m=["#000","Black"],vm=["#00F","Blue"],bm=["#0FF","Cyan"],Tm=["#0F0","Green"],xm=["#F0F","Magenta"],Sm=["#F00","Red"],Em=["#FFF","White"],Cm=["#FF0","Yellow"],ad=["1","Opaque"],od=["0.5","Semi-Transparent"],wm=["0","Transparent"],Jn={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[_m,Em,Sm,Tm,vm,Cm,xm,bm],className:"vjs-bg-color"},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[ad,od,wm],className:"vjs-bg-opacity vjs-opacity"},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Em,_m,Sm,Tm,vm,Cm,xm,bm],className:"vjs-text-color"},edgeStyle:{selector:".vjs-edge-style > select",id:"",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:t=>t==="1.00"?null:Number(t)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[ad,od],className:"vjs-text-opacity vjs-opacity"},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color",className:"vjs-window-color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[wm,od,ad],className:"vjs-window-opacity vjs-opacity"}};Jn.windowColor.options=Jn.backgroundColor.options;function Gv(t,e){if(e&&(t=e(t)),t&&t!=="none")return t}function dD(t,e){const i=t.options[t.options.selectedIndex].value;return Gv(i,e)}function hD(t,e,i){if(e){for(let n=0;n{this.saveSettings(),this.close()}),this.on(this.$(".vjs-default-button"),["click","tap"],()=>{this.setDefaults(),this.updateDisplay()}),mr(Jn,e=>{this.on(this.$(e.selector),"change",this.updateDisplay)})}dispose(){this.endDialog=null,super.dispose()}label(){return this.localize("Caption Settings Dialog")}description(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")}buildCSSClass(){return super.buildCSSClass()+" vjs-text-track-settings"}getValues(){return B_(Jn,(e,i,n)=>{const s=dD(this.$(i.selector),i.parser);return s!==void 0&&(e[n]=s),e},{})}setValues(e){mr(Jn,(i,n)=>{hD(this.$(i.selector),e[n],i.parser)})}setDefaults(){mr(Jn,e=>{const i=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=i})}restoreSettings(){let e;try{e=JSON.parse($.localStorage.getItem(rd))}catch(i){We.warn(i)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;const e=this.getValues();try{Object.keys(e).length?$.localStorage.setItem(rd,JSON.stringify(e)):$.localStorage.removeItem(rd)}catch(i){We.warn(i)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}handleLanguagechange(){this.fill(),this.renderModalComponents(this.player_),this.bindFunctionsToSelectsAndButtons()}}le.registerComponent("TextTrackSettings",fD);class pD extends le{constructor(e,i){let n=i.ResizeObserver||$.ResizeObserver;i.ResizeObserver===null&&(n=!1);const s=it({createEl:!n,reportTouchActivity:!1},i);super(e,s),this.ResizeObserver=i.ResizeObserver||$.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=av(()=>{this.resizeHandler()},100,!1,this),n?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;const r=this.debouncedHandler_;let a=this.unloadListener_=function(){Xt(this,"resize",r),Xt(this,"unload",a),a=null};yi(this.el_.contentWindow,"unload",a),yi(this.el_.contentWindow,"resize",r)},this.one("load",this.loadListener_))}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){!this.player_||!this.player_.trigger||this.player_.trigger("playerresize")}dispose(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,super.dispose()}}le.registerComponent("ResizeManager",pD);const gD={trackingThreshold:20,liveTolerance:15};class mD extends le{constructor(e,i){const n=it(gD,i,{createEl:!1});super(e,n),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=s=>this.handlePlay(s),this.handleFirstTimeupdate_=s=>this.handleFirstTimeupdate(s),this.handleSeeked_=s=>this.handleSeeked(s),this.seekToLiveEdge_=s=>this.seekToLiveEdge(s),this.reset_(),this.on(this.player_,"durationchange",s=>this.handleDurationchange(s)),this.on(this.player_,"canplay",()=>this.toggleTracking())}trackLive_(){const e=this.player_.seekable();if(!e||!e.length)return;const i=Number($.performance.now().toFixed(4)),n=this.lastTime_===-1?0:(i-this.lastTime_)/1e3;this.lastTime_=i,this.pastSeekEnd_=this.pastSeekEnd()+n;const s=this.liveCurrentTime(),r=this.player_.currentTime();let a=this.player_.paused()||this.seekedBehindLive_||Math.abs(s-r)>this.options_.liveTolerance;(!this.timeupdateSeen_||s===1/0)&&(a=!1),a!==this.behindLiveEdge_&&(this.behindLiveEdge_=a,this.trigger("liveedgechange"))}handleDurationchange(){this.toggleTracking()}toggleTracking(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())}startTracking(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,Ri),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))}handleFirstTimeupdate(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){const e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_=!0}stopTracking(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))}seekableEnd(){const e=this.player_.seekable(),i=[];let n=e?e.length:0;for(;n--;)i.push(e.end(n));return i.length?i.sort()[i.length-1]:1/0}seekableStart(){const e=this.player_.seekable(),i=[];let n=e?e.length:0;for(;n--;)i.push(e.start(n));return i.length?i.sort()[0]:0}liveWindow(){const e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){const e=this.seekableEnd();return this.lastSeekEnd_!==-1&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return typeof this.trackingInterval_=="number"}seekToLiveEdge(){this.seekedBehindLive_=!1,!this.atLiveEdge()&&(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}dispose(){this.stopTracking(),super.dispose()}}le.registerComponent("LiveTracker",mD);class yD extends le{constructor(e,i){super(e,i),this.on("statechanged",n=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:Me("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${Li()}`}),description:Me("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${Li()}`})},Me("div",{className:"vjs-title-bar"},{},F_(this.els))}updateDom_(){const e=this.player_.tech_,i=e&&e.el_,n={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach(s=>{const r=this.state[s],a=this.els[s],o=n[s];qu(a),r&&cs(a,r),i&&(i.removeAttribute(o),r&&i.setAttribute(o,a.id))}),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){const e=this.player_.tech_,i=e&&e.el_;i&&(i.removeAttribute("aria-labelledby"),i.removeAttribute("aria-describedby")),super.dispose(),this.els=null}}le.registerComponent("TitleBar",yD);const _D={initialDisplay:4e3,position:[],takeFocus:!1};class vD extends Yt{constructor(e,i){i=it(_D,i),super(e,i),this.controlText(i.controlText),this.hide(),this.on(this.player_,["useractive","userinactive"],n=>{this.removeClass("force-display")})}buildCSSClass(){return`vjs-transient-button focus-visible ${this.options_.position.map(e=>`vjs-${e}`).join(" ")}`}createEl(){const e=Me("button",{},{type:"button",class:this.buildCSSClass()},Me("span"));return this.controlTextEl_=e.querySelector("span"),e}show(){super.show(),this.addClass("force-display"),this.options_.takeFocus&&this.el().focus({preventScroll:!0}),this.forceDisplayTimeout=this.player_.setTimeout(()=>{this.removeClass("force-display")},this.options_.initialDisplay)}hide(){this.removeClass("force-display"),super.hide()}dispose(){this.player_.clearTimeout(this.forceDisplayTimeout),super.dispose()}}le.registerComponent("TransientButton",vD);const sh=t=>{const e=t.el();if(e.hasAttribute("src"))return t.triggerSourceset(e.src),!0;const i=t.$$("source"),n=[];let s="";if(!i.length)return!1;for(let r=0;r{let i={};for(let n=0;nKv([t.el(),$.HTMLMediaElement.prototype,$.Element.prototype,bD],"innerHTML"),Am=function(t){const e=t.el();if(e.resetSourceWatch_)return;const i={},n=TD(t),s=r=>(...a)=>{const o=r.apply(e,a);return sh(t),o};["append","appendChild","insertAdjacentHTML"].forEach(r=>{e[r]&&(i[r]=e[r],e[r]=s(i[r]))}),Object.defineProperty(e,"innerHTML",it(n,{set:s(n.set)})),e.resetSourceWatch_=()=>{e.resetSourceWatch_=null,Object.keys(i).forEach(r=>{e[r]=i[r]}),Object.defineProperty(e,"innerHTML",n)},t.one("sourceset",e.resetSourceWatch_)},xD=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?mv($.Element.prototype.getAttribute.call(this,"src")):""},set(t){return $.Element.prototype.setAttribute.call(this,"src",t),t}}),SD=t=>Kv([t.el(),$.HTMLMediaElement.prototype,xD],"src"),ED=function(t){if(!t.featuresSourceset)return;const e=t.el();if(e.resetSourceset_)return;const i=SD(t),n=e.setAttribute,s=e.load;Object.defineProperty(e,"src",it(i,{set:r=>{const a=i.set.call(e,r);return t.triggerSourceset(e.src),a}})),e.setAttribute=(r,a)=>{const o=n.call(e,r,a);return/src/i.test(r)&&t.triggerSourceset(e.src),o},e.load=()=>{const r=s.call(e);return sh(t)||(t.triggerSourceset(""),Am(t)),r},e.currentSrc?t.triggerSourceset(e.currentSrc):sh(t)||Am(t),e.resetSourceset_=()=>{e.resetSourceset_=null,e.load=s,e.setAttribute=n,Object.defineProperty(e,"src",i),e.resetSourceWatch_&&e.resetSourceWatch_()}};class Ae extends je{constructor(e,i){super(e,i);const n=e.source;let s=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&this.el_.tagName==="VIDEO",n&&(this.el_.currentSrc!==n.src||e.tag&&e.tag.initNetworkState_===3)?this.setSource(n):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){const r=this.el_.childNodes;let a=r.length;const o=[];for(;a--;){const u=r[a];u.nodeName.toLowerCase()==="track"&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(u),this.remoteTextTracks().addTrack(u.track),this.textTracks().addTrack(u.track),!s&&!this.el_.hasAttribute("crossorigin")&&Hu(u.src)&&(s=!0)):o.push(u))}for(let u=0;u{i=[];for(let r=0;re.removeEventListener("change",n));const s=()=>{for(let r=0;r{e.removeEventListener("change",n),e.removeEventListener("change",s),e.addEventListener("change",s)}),this.on("webkitendfullscreen",()=>{e.removeEventListener("change",n),e.addEventListener("change",n),e.removeEventListener("change",s)})}overrideNative_(e,i){if(i!==this[`featuresNative${e}Tracks`])return;const n=e.toLowerCase();this[`${n}TracksListeners_`]&&Object.keys(this[`${n}TracksListeners_`]).forEach(s=>{this.el()[`${n}Tracks`].removeEventListener(s,this[`${n}TracksListeners_`][s])}),this[`featuresNative${e}Tracks`]=!i,this[`${n}TracksListeners_`]=null,this.proxyNativeTracksForType_(n)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){const i=Pi[e],n=this.el()[i.getterName],s=this[i.getterName]();if(!this[`featuresNative${i.capitalName}Tracks`]||!n||!n.addEventListener)return;const r={change:o=>{const u={type:"change",target:s,currentTarget:s,srcElement:s};s.trigger(u),e==="text"&&this[Rr.remoteText.getterName]().trigger(u)},addtrack(o){s.addTrack(o.track)},removetrack(o){s.removeTrack(o.track)}},a=function(){const o=[];for(let u=0;u{const u=r[o];n.addEventListener(o,u),this.on("dispose",c=>n.removeEventListener(o,u))}),this.on("loadstart",a),this.on("dispose",o=>this.off("loadstart",a))}proxyNativeTracks_(){Pi.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let e=this.options_.tag;if(!e||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(e){const n=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(n,e),Ae.disposeMediaElement(e),e=n}else{e=_e.createElement("video");const n=this.options_.tag&&Qn(this.options_.tag),s=it({},n);(!to||this.options_.nativeControlsForTouch!==!0)&&delete s.controls,G_(e,Object.assign(s,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}typeof this.options_.preload<"u"&&Ir(e,"preload",this.options_.preload),this.options_.disablePictureInPicture!==void 0&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);const i=["loop","muted","playsinline","autoplay"];for(let n=0;n=2&&i.push("loadeddata"),e.readyState>=3&&i.push("canplay"),e.readyState>=4&&i.push("canplaythrough"),this.ready(function(){i.forEach(function(n){this.trigger(n)},this)})}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&Nu?this.el_.fastSeek(e):this.el_.currentTime=e}catch(i){We(i,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&Ki&&pn&&this.el_.currentTime===0){const e=()=>{this.el_.currentTime>0&&(this.el_.duration===1/0&&this.trigger("durationchange"),this.off("timeupdate",e))};return this.on("timeupdate",e),NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!("webkitDisplayingFullscreen"in this.el_))return;const e=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},i=function(){"webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",i),this.on("dispose",()=>{this.off("webkitbeginfullscreen",i),this.off("webkitendfullscreen",e)})}supportsFullScreen(){return typeof this.el_.webkitEnterFullScreen=="function"}enterFullScreen(){const e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)ln(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(i){this.trigger("fullscreenerror",i)}},0);else try{e.webkitEnterFullScreen()}catch(i){this.trigger("fullscreenerror",i)}}exitFullScreen(){if(!this.el_.webkitDisplayingFullscreen){this.trigger("fullscreenerror",new Error("The video is not fullscreen"));return}this.el_.webkitExitFullScreen()}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):super.cancelVideoFrameCallback(e)}src(e){if(e===void 0)return this.el_.src;this.setSrc(e)}addSourceElement(e,i){if(!e)return We.error("Invalid source URL."),!1;const n={src:e};i&&(n.type=i);const s=Me("source",{},n);return this.el_.appendChild(s),!0}removeSourceElement(e){if(!e)return We.error("Source URL is required to remove the source element."),!1;const i=this.el_.querySelectorAll("source");for(const n of i)if(n.src===e)return this.el_.removeChild(n),!0;return We.warn(`No matching source element found with src: ${e}`),!1}reset(){Ae.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,i,n){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,i,n):super.addTextTrack(e,i,n)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);const i=_e.createElement("track");return e.kind&&(i.kind=e.kind),e.label&&(i.label=e.label),(e.language||e.srclang)&&(i.srclang=e.language||e.srclang),e.default&&(i.default=e.default),e.id&&(i.id=e.id),e.src&&(i.src=e.src),i}addRemoteTextTrack(e,i){const n=super.addRemoteTextTrack(e,i);return this.featuresNativeTextTracks&&this.el().appendChild(n),n}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){const i=this.$$("track");let n=i.length;for(;n--;)(e===i[n]||e===i[n].track)&&this.el().removeChild(i[n])}}getVideoPlaybackQuality(){if(typeof this.el().getVideoPlaybackQuality=="function")return this.el().getVideoPlaybackQuality();const e={};return typeof this.el().webkitDroppedFrameCount<"u"&&typeof this.el().webkitDecodedFrameCount<"u"&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),$.performance&&(e.creationTime=$.performance.now()),e}}Ou(Ae,"TEST_VID",function(){if(!Ur())return;const t=_e.createElement("video"),e=_e.createElement("track");return e.kind="captions",e.srclang="en",e.label="English",t.appendChild(e),t});Ae.isSupported=function(){try{Ae.TEST_VID.volume=.5}catch{return!1}return!!(Ae.TEST_VID&&Ae.TEST_VID.canPlayType)};Ae.canPlayType=function(t){return Ae.TEST_VID.canPlayType(t)};Ae.canPlaySource=function(t,e){return Ae.canPlayType(t.type)};Ae.canControlVolume=function(){try{const t=Ae.TEST_VID.volume;Ae.TEST_VID.volume=t/2+.1;const e=t!==Ae.TEST_VID.volume;return e&&Kt?($.setTimeout(()=>{Ae&&Ae.prototype&&(Ae.prototype.featuresVolumeControl=t!==Ae.TEST_VID.volume)}),!1):e}catch{return!1}};Ae.canMuteVolume=function(){try{const t=Ae.TEST_VID.muted;return Ae.TEST_VID.muted=!t,Ae.TEST_VID.muted?Ir(Ae.TEST_VID,"muted","muted"):Fu(Ae.TEST_VID,"muted","muted"),t!==Ae.TEST_VID.muted}catch{return!1}};Ae.canControlPlaybackRate=function(){if(Ki&&pn&&Lu<58)return!1;try{const t=Ae.TEST_VID.playbackRate;return Ae.TEST_VID.playbackRate=t/2+.1,t!==Ae.TEST_VID.playbackRate}catch{return!1}};Ae.canOverrideAttributes=function(){try{const t=()=>{};Object.defineProperty(_e.createElement("video"),"src",{get:t,set:t}),Object.defineProperty(_e.createElement("audio"),"src",{get:t,set:t}),Object.defineProperty(_e.createElement("video"),"innerHTML",{get:t,set:t}),Object.defineProperty(_e.createElement("audio"),"innerHTML",{get:t,set:t})}catch{return!1}return!0};Ae.supportsNativeTextTracks=function(){return Nu||Kt&&pn};Ae.supportsNativeVideoTracks=function(){return!!(Ae.TEST_VID&&Ae.TEST_VID.videoTracks)};Ae.supportsNativeAudioTracks=function(){return!!(Ae.TEST_VID&&Ae.TEST_VID.audioTracks)};Ae.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"];[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function([t,e]){Ou(Ae.prototype,t,()=>Ae[e](),!0)});Ae.prototype.featuresVolumeControl=Ae.canControlVolume();Ae.prototype.movingMediaElementInDOM=!Kt;Ae.prototype.featuresFullscreenResize=!0;Ae.prototype.featuresProgressEvents=!0;Ae.prototype.featuresTimeupdateEvents=!0;Ae.prototype.featuresVideoFrameCallback=!!(Ae.TEST_VID&&Ae.TEST_VID.requestVideoFrameCallback);Ae.disposeMediaElement=function(t){if(t){for(t.parentNode&&t.parentNode.removeChild(t);t.hasChildNodes();)t.removeChild(t.firstChild);t.removeAttribute("src"),typeof t.load=="function"&&function(){try{t.load()}catch{}}()}};Ae.resetMediaElement=function(t){if(!t)return;const e=t.querySelectorAll("source");let i=e.length;for(;i--;)t.removeChild(e[i]);t.removeAttribute("src"),typeof t.load=="function"&&function(){try{t.load()}catch{}}()};["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(t){Ae.prototype[t]=function(){return this.el_[t]||this.el_.hasAttribute(t)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(t){Ae.prototype["set"+_t(t)]=function(e){this.el_[t]=e,e?this.el_.setAttribute(t,t):this.el_.removeAttribute(t)}});["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(t){Ae.prototype[t]=function(){return this.el_[t]}});["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(t){Ae.prototype["set"+_t(t)]=function(e){this.el_[t]=e}});["pause","load","play"].forEach(function(t){Ae.prototype[t]=function(){return this.el_[t]()}});je.withSourceHandlers(Ae);Ae.nativeSourceHandler={};Ae.nativeSourceHandler.canPlayType=function(t){try{return Ae.TEST_VID.canPlayType(t)}catch{return""}};Ae.nativeSourceHandler.canHandleSource=function(t,e){if(t.type)return Ae.nativeSourceHandler.canPlayType(t.type);if(t.src){const i=gf(t.src);return Ae.nativeSourceHandler.canPlayType(`video/${i}`)}return""};Ae.nativeSourceHandler.handleSource=function(t,e,i){e.setSrc(t.src)};Ae.nativeSourceHandler.dispose=function(){};Ae.registerSourceHandler(Ae.nativeSourceHandler);je.registerTech("Html5",Ae);const Xv=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],ld={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},rh=["tiny","xsmall","small","medium","large","xlarge","huge"],bl={};rh.forEach(t=>{const e=t.charAt(0)==="x"?`x-${t.substring(1)}`:t;bl[t]=`vjs-layout-${e}`});const CD={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};class ut extends le{constructor(e,i,n){if(e.id=e.id||i.id||`vjs_video_${Li()}`,i=Object.assign(ut.getTagSettings(e),i),i.initChildren=!1,i.createEl=!1,i.evented=!1,i.reportTouchActivity=!1,!i.language){const a=e.closest("[lang]");a&&(i.language=a.getAttribute("lang"))}if(super(null,i,n),this.boundDocumentFullscreenChange_=a=>this.documentFullscreenChange_(a),this.boundFullWindowOnEscKey_=a=>this.fullWindowOnEscKey(a),this.boundUpdateStyleEl_=a=>this.updateStyleEl_(a),this.boundApplyInitTime_=a=>this.applyInitTime_(a),this.boundUpdateCurrentBreakpoint_=a=>this.updateCurrentBreakpoint_(a),this.boundHandleTechClick_=a=>this.handleTechClick_(a),this.boundHandleTechDoubleClick_=a=>this.handleTechDoubleClick_(a),this.boundHandleTechTouchStart_=a=>this.handleTechTouchStart_(a),this.boundHandleTechTouchMove_=a=>this.handleTechTouchMove_(a),this.boundHandleTechTouchEnd_=a=>this.handleTechTouchEnd_(a),this.boundHandleTechTap_=a=>this.handleTechTap_(a),this.boundUpdatePlayerHeightOnAudioOnlyMode_=a=>this.updatePlayerHeightOnAudioOnlyMode_(a),this.isFullscreen_=!1,this.log=M_(this.id_),this.fsApi_=Hl,this.isPosterFromTech_=!1,this.queuedCallbacks_=[],this.isReady_=!1,this.hasStarted_=!1,this.userActive_=!1,this.debugEnabled_=!1,this.audioOnlyMode_=!1,this.audioPosterMode_=!1,this.audioOnlyCache_={controlBarHeight:null,playerHeight:null,hiddenChildren:[]},!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(this.tag=e,this.tagAttributes=e&&Qn(e),this.language(this.options_.language),i.languages){const a={};Object.getOwnPropertyNames(i.languages).forEach(function(o){a[o.toLowerCase()]=i.languages[o]}),this.languages_=a}else this.languages_=ut.prototype.options_.languages;this.resetCache_(),this.poster_=i.poster||"",this.controls_=!!i.controls,e.controls=!1,e.removeAttribute("controls"),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],e.hasAttribute("autoplay")?this.autoplay(!0):this.autoplay(this.options_.autoplay),i.plugins&&Object.keys(i.plugins).forEach(a=>{if(typeof this[a]!="function")throw new Error(`plugin "${a}" does not exist`)}),this.scrubbing_=!1,this.el_=this.createEl(),df(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(yi(_e,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);const s=it(this.options_);if(i.plugins&&Object.keys(i.plugins).forEach(a=>{this[a](i.plugins[a])}),i.debug&&this.debug(!0),this.options_.playerOptions=s,this.middleware_=[],this.playbackRates(i.playbackRates),i.experimentalSvgIcons){const o=new $.DOMParser().parseFromString(KA,"image/svg+xml");if(o.querySelector("parsererror"))We.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{const c=o.documentElement;c.style.display="none",this.el_.appendChild(c),this.addClass("vjs-svg-icons-enabled")}}this.initChildren(),this.isAudio(e.nodeName.toLowerCase()==="audio"),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.el_.setAttribute("role","region"),this.isAudio()?this.el_.setAttribute("aria-label",this.localize("Audio Player")):this.el_.setAttribute("aria-label",this.localize("Video Player")),this.isAudio()&&this.addClass("vjs-audio"),i.spatialNavigation&&i.spatialNavigation.enabled&&(this.spatialNavigation=new XA(this),this.addClass("vjs-spatial-navigation-enabled")),to&&this.addClass("vjs-touch-enabled"),Kt||this.addClass("vjs-workinghover"),ut.players[this.id_]=this;const r=Xd.split(".")[0];this.addClass(`vjs-v${r}`),this.userActive(!0),this.reportUserActivity(),this.one("play",a=>this.listenForUserActivity_(a)),this.on("keydown",a=>this.handleKeyDown(a)),this.on("languagechange",a=>this.handleLanguagechange(a)),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on("ready",()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode)})}dispose(){this.trigger("dispose"),this.off("dispose"),Xt(_e,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Xt(_e,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),ut.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),HA(this),si.names.forEach(e=>{const i=si[e],n=this[i.getterName]();n&&n.off&&n.off()}),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e=this.tag,i,n=this.playerElIngest_=e.parentNode&&e.parentNode.hasAttribute&&e.parentNode.hasAttribute("data-vjs-player");const s=this.tag.tagName.toLowerCase()==="video-js";n?i=this.el_=e.parentNode:s||(i=this.el_=super.createEl("div"));const r=Qn(e);if(s){for(i=this.el_=e,e=this.tag=_e.createElement("video");i.children.length;)e.appendChild(i.firstChild);Ba(i,"video-js")||Ls(i,"video-js"),i.appendChild(e),n=this.playerElIngest_=i,Object.keys(i).forEach(u=>{try{e[u]=i[u]}catch{}})}e.setAttribute("tabindex","-1"),r.tabindex="-1",pn&&Ru&&(e.setAttribute("role","application"),r.role="application"),e.removeAttribute("width"),e.removeAttribute("height"),"width"in r&&delete r.width,"height"in r&&delete r.height,Object.getOwnPropertyNames(r).forEach(function(u){s&&u==="class"||i.setAttribute(u,r[u]),s&&e.setAttribute(u,r[u])}),e.playerId=e.id,e.id+="_html5_api",e.className="vjs-tech",e.player=i.player=this,this.addClass("vjs-paused");const a=["IS_SMART_TV","IS_TIZEN","IS_WEBOS","IS_ANDROID","IS_IPAD","IS_IPHONE","IS_CHROMECAST_RECEIVER"].filter(u=>V_[u]).map(u=>"vjs-device-"+u.substring(3).toLowerCase().replace(/\_/g,"-"));if(this.addClass(...a),$.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=sv("vjs-styles-dimensions");const u=as(".vjs-styles-defaults"),c=as("head");c.insertBefore(this.styleEl_,u?u.nextSibling:c.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);const o=e.getElementsByTagName("a");for(let u=0;u"u")return this.techGet_("crossOrigin");if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){We.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}this.techCall_("setCrossOrigin",e),this.posterImage&&this.posterImage.crossOrigin(e)}width(e){return this.dimension("width",e)}height(e){return this.dimension("height",e)}dimension(e,i){const n=e+"_";if(i===void 0)return this[n]||0;if(i===""||i==="auto"){this[n]=void 0,this.updateStyleEl_();return}const s=parseFloat(i);if(isNaN(s)){We.error(`Improper value "${i}" supplied for for ${e}`);return}this[n]=s,this.updateStyleEl_()}fluid(e){if(e===void 0)return!!this.fluid_;this.fluid_=!!e,In(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),bA(this,()=>{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)})):this.removeClass("vjs-fluid"),this.updateStyleEl_()}fill(e){if(e===void 0)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")}aspectRatio(e){if(e===void 0)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()}updateStyleEl_(){if($.VIDEOJS_NO_DYNAMIC_STYLE===!0){const o=typeof this.width_=="number"?this.width_:this.options_.width,u=typeof this.height_=="number"?this.height_:this.options_.height,c=this.tech_&&this.tech_.el();c&&(o>=0&&(c.width=o),u>=0&&(c.height=u));return}let e,i,n,s;this.aspectRatio_!==void 0&&this.aspectRatio_!=="auto"?n=this.aspectRatio_:this.videoWidth()>0?n=this.videoWidth()+":"+this.videoHeight():n="16:9";const r=n.split(":"),a=r[1]/r[0];this.width_!==void 0?e=this.width_:this.height_!==void 0?e=this.height_/a:e=this.videoWidth()||300,this.height_!==void 0?i=this.height_:i=e*a,/^[^a-zA-Z]/.test(this.id())?s="dimensions-"+this.id():s=this.id()+"-dimensions",this.addClass(s),rv(this.styleEl_,` .${s} { width: ${e}px; height: ${i}px; } .${s}.vjs-fluid:not(.vjs-audio-only-mode) { padding-top: ${a*100}%; } `)}loadTech_(e,i){this.tech_&&this.unloadTech_();const n=_t(e),s=e.charAt(0).toLowerCase()+e.slice(1);n!=="Html5"&&this.tag&&(je.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=n,this.isReady_=!1;let r=this.autoplay();(typeof this.autoplay()=="string"||this.autoplay()===!0&&this.options_.normalizeAutoplay)&&(r=!1);const a={source:i,autoplay:r,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${s}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};si.names.forEach(u=>{const c=si[u];a[c.getterName]=this[c.privateName]}),Object.assign(a,this.options_[n]),Object.assign(a,this.options_[s]),Object.assign(a,this.options_[e.toLowerCase()]),this.tag&&(a.tag=this.tag),i&&i.src===this.cache_.src&&this.cache_.currentTime>0&&(a.startTime=this.cache_.currentTime);const o=je.getTech(e);if(!o)throw new Error(`No Tech named '${n}' exists! '${n}' should be registered using videojs.registerTech()'`);this.tech_=new o(a),this.tech_.ready(at(this,this.handleTechReady_),!0),am.jsonToTextTracks(this.textTracksJson_||[],this.tech_),Xv.forEach(u=>{this.on(this.tech_,u,c=>this[`handleTech${_t(u)}_`](c))}),Object.keys(ld).forEach(u=>{this.on(this.tech_,u,c=>{if(this.tech_.playbackRate()===0&&this.tech_.seeking()){this.queuedCallbacks_.push({callback:this[`handleTech${ld[u]}_`].bind(this),event:c});return}this[`handleTech${ld[u]}_`](c)})}),this.on(this.tech_,"loadstart",u=>this.handleTechLoadStart_(u)),this.on(this.tech_,"sourceset",u=>this.handleTechSourceset_(u)),this.on(this.tech_,"waiting",u=>this.handleTechWaiting_(u)),this.on(this.tech_,"ended",u=>this.handleTechEnded_(u)),this.on(this.tech_,"seeking",u=>this.handleTechSeeking_(u)),this.on(this.tech_,"play",u=>this.handleTechPlay_(u)),this.on(this.tech_,"pause",u=>this.handleTechPause_(u)),this.on(this.tech_,"durationchange",u=>this.handleTechDurationChange_(u)),this.on(this.tech_,"fullscreenchange",(u,c)=>this.handleTechFullscreenChange_(u,c)),this.on(this.tech_,"fullscreenerror",(u,c)=>this.handleTechFullscreenError_(u,c)),this.on(this.tech_,"enterpictureinpicture",u=>this.handleTechEnterPictureInPicture_(u)),this.on(this.tech_,"leavepictureinpicture",u=>this.handleTechLeavePictureInPicture_(u)),this.on(this.tech_,"error",u=>this.handleTechError_(u)),this.on(this.tech_,"posterchange",u=>this.handleTechPosterChange_(u)),this.on(this.tech_,"textdata",u=>this.handleTechTextData_(u)),this.on(this.tech_,"ratechange",u=>this.handleTechRateChange_(u)),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode!==this.el()&&(n!=="Html5"||!this.tag)&&Qd(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){si.names.forEach(e=>{const i=si[e];this[i.privateName]=this[i.getterName]()}),this.textTracksJson_=am.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1}tech(e){return e===void 0&&We.warn(`Using the tech directly can be dangerous. I hope you know what you're doing. See https://github.com/videojs/video.js/issues/2617 for more info. `),this.tech_}version(){return{"video.js":Xd}}addTechControlsListeners_(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass("vjs-ended","vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):this.trigger("loadstart"),this.manualAutoplay_(this.autoplay()===!0&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){if(!this.tech_||typeof e!="string")return;const i=()=>{const s=this.muted();this.muted(!0);const r=()=>{this.muted(s)};this.playTerminatedQueue_.push(r);const a=this.play();if(Ua(a))return a.catch(o=>{throw r(),new Error(`Rejection at manualAutoplay. Restoring muted value. ${o||""}`)})};let n;if(e==="any"&&!this.muted()?(n=this.play(),Ua(n)&&(n=n.catch(i))):e==="muted"&&!this.muted()?n=i():n=this.play(),!!Ua(n))return n.then(()=>{this.trigger({type:"autoplay-success",autoplay:e})}).catch(()=>{this.trigger({type:"autoplay-failure",autoplay:e})})}updateSourceCaches_(e=""){let i=e,n="";typeof i!="string"&&(i=e.src,n=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],i&&!n&&(n=GA(this,i)),this.cache_.source=it({},e,{src:i,type:n});const s=this.cache_.sources.filter(u=>u.src&&u.src===i),r=[],a=this.$$("source"),o=[];for(let u=0;uthis.updateSourceCaches_(r);const n=this.currentSource().src,s=e.src;n&&!/^blob:/.test(n)&&/^blob:/.test(s)&&(!this.lastSource_||this.lastSource_.tech!==s&&this.lastSource_.player!==n)&&(i=()=>{}),i(s),e.src||this.tech_.any(["sourceset","loadstart"],r=>{if(r.type==="sourceset")return;const a=this.techGet_("currentSrc");this.lastSource_.tech=a,this.updateSourceCaches_(a)})}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})}hasStarted(e){if(e===void 0)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?this.addClass("vjs-has-started"):this.removeClass("vjs-has-started"))}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")}handleTechRateChange_(){this.tech_.playbackRate()>0&&this.cache_.lastPlaybackRate===0&&(this.queuedCallbacks_.forEach(e=>e.callback(e.event)),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting"),this.trigger("waiting");const e=this.currentTime(),i=()=>{e!==this.currentTime()&&(this.removeClass("vjs-waiting"),this.off("timeupdate",i))};this.on("timeupdate",i)}handleTechCanPlay_(){this.removeClass("vjs-waiting"),this.trigger("canplay")}handleTechCanPlayThrough_(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")}handleTechPlaying_(){this.removeClass("vjs-waiting"),this.trigger("playing")}handleTechSeeking_(){this.addClass("vjs-seeking"),this.trigger("seeking")}handleTechSeeked_(){this.removeClass("vjs-seeking","vjs-ended"),this.trigger("seeked")}handleTechPause_(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")}handleTechEnded_(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(e){this.controls_&&(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.click===void 0||this.options_.userActions.click!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.click=="function"?this.options_.userActions.click.call(this,e):this.paused()?ln(this.play()):this.pause())}handleTechDoubleClick_(e){if(!this.controls_)return;Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),n=>n.contains(e.target))||(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.doubleClick===void 0||this.options_.userActions.doubleClick!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.doubleClick=="function"?this.options_.userActions.doubleClick.call(this,e):this.isInPictureInPicture()&&!_e.pictureInPictureElement?this.exitPictureInPicture():this.isFullscreen()?this.exitFullscreen():this.requestFullscreen())}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){this.userWasActive&&this.reportUserActivity()}handleTechTouchEnd_(e){e.cancelable&&e.preventDefault()}toggleFullscreenClass_(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")}documentFullscreenChange_(e){const i=e.target.player;if(i&&i!==this)return;const n=this.el();let s=_e[this.fsApi_.fullscreenElement]===n;!s&&n.matches&&(s=n.matches(":"+this.fsApi_.fullscreen)),this.isFullscreen(s)}handleTechFullscreenChange_(e,i){i&&(i.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",()=>{this.removeClass("vjs-ios-native-fs")})),this.isFullscreen(i.isFullscreen))}handleTechFullscreenError_(e,i){this.trigger("fullscreenerror",i)}togglePictureInPictureClass_(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(!0)}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(!1)}handleTechError_(){const e=this.tech_.error();e&&this.error(e)}handleTechTextData_(){let e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}}techCall_(e,i){this.ready(function(){if(e in jA)return qA(this.middleware_,this.tech_,e,i);if(e in dm)return cm(this.middleware_,this.tech_,e,i);try{this.tech_&&this.tech_[e](i)}catch(n){throw We(n),n}},!0)}techGet_(e){if(!(!this.tech_||!this.tech_.isReady_)){if(e in $A)return UA(this.middleware_,this.tech_,e);if(e in dm)return cm(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(i){throw this.tech_[e]===void 0?(We(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,i),i):i.name==="TypeError"?(We(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,i),this.tech_.isReady_=!1,i):(We(i),i)}}}play(){return new Promise(e=>{this.play_(e)})}play_(e=ln){this.playCallbacks_.push(e);const i=!!(!this.changingSrc_&&(this.src()||this.currentSrc())),n=!!(Nu||Kt);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!i){this.waitToPlay_=a=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),!i&&n&&this.load();return}const s=this.techGet_("play");n&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),s===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(s)}runPlayTerminatedQueue_(){const e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(i){i()})}runPlayCallbacks_(e){const i=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],i.forEach(function(n){n(e)})}pause(){this.techCall_("pause")}paused(){return this.techGet_("paused")!==!1}played(){return this.techGet_("played")||Wi(0,0)}scrubbing(e){if(typeof e>"u")return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")}currentTime(e){if(e===void 0)return this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime;if(e<0&&(e=0),!this.isReady_||this.changingSrc_||!this.tech_||!this.tech_.isReady_){this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),this.one("canplay",this.boundApplyInitTime_);return}this.techCall_("setCurrentTime",e),this.cache_.initTime=0,isFinite(e)&&(this.cache_.currentTime=Number(e))}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(e===void 0)return this.cache_.duration!==void 0?this.cache_.duration:NaN;e=parseFloat(e),e<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let e=this.techGet_("buffered");return(!e||!e.length)&&(e=Wi(0,0)),e}seekable(){let e=this.techGet_("seekable");return(!e||!e.length)&&(e=Wi(0,0)),e}seeking(){return this.techGet_("seeking")}ended(){return this.techGet_("ended")}networkState(){return this.techGet_("networkState")}readyState(){return this.techGet_("readyState")}bufferedPercent(){return pv(this.buffered(),this.duration())}bufferedEnd(){const e=this.buffered(),i=this.duration();let n=e.end(e.length-1);return n>i&&(n=i),n}volume(e){let i;if(e!==void 0){i=Math.max(0,Math.min(1,e)),this.cache_.volume=i,this.techCall_("setVolume",i),i>0&&this.lastVolume_(i);return}return i=parseFloat(this.techGet_("volume")),isNaN(i)?1:i}muted(e){if(e!==void 0){this.techCall_("setMuted",e);return}return this.techGet_("muted")||!1}defaultMuted(e){return e!==void 0&&this.techCall_("setDefaultMuted",e),this.techGet_("defaultMuted")||!1}lastVolume_(e){if(e!==void 0&&e!==0){this.cache_.lastVolume=e;return}return this.cache_.lastVolume}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(e){if(e!==void 0){const i=this.isFullscreen_;this.isFullscreen_=!!e,this.isFullscreen_!==i&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),this.toggleFullscreenClass_();return}return this.isFullscreen_}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();const i=this;return new Promise((n,s)=>{function r(){i.off("fullscreenerror",o),i.off("fullscreenchange",a)}function a(){r(),n()}function o(c,f){r(),s(f)}i.one("fullscreenchange",a),i.one("fullscreenerror",o);const u=i.requestFullscreenHelper_(e);u&&(u.then(r,r),u.then(n,s))})}requestFullscreenHelper_(e){let i;if(this.fsApi_.prefixed||(i=this.options_.fullscreen&&this.options_.fullscreen.options||{},e!==void 0&&(i=e)),this.fsApi_.requestFullscreen){const n=this.el_[this.fsApi_.requestFullscreen](i);return n&&n.then(()=>this.isFullscreen(!0),()=>this.isFullscreen(!1)),n}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){const e=this;return new Promise((i,n)=>{function s(){e.off("fullscreenerror",a),e.off("fullscreenchange",r)}function r(){s(),i()}function a(u,c){s(),n(c)}e.one("fullscreenchange",r),e.one("fullscreenerror",a);const o=e.exitFullscreenHelper_();o&&(o.then(s,s),o.then(i,n))})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=_e[this.fsApi_.exitFullscreen]();return e&&ln(e.then(()=>this.isFullscreen(!1))),e}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=_e.documentElement.style.overflow,yi(_e,"keydown",this.boundFullWindowOnEscKey_),_e.documentElement.style.overflow="hidden",Ls(_e.body,"vjs-full-window"),this.trigger("enterFullWindow")}fullWindowOnEscKey(e){e.key==="Escape"&&this.isFullscreen()===!0&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,Xt(_e,"keydown",this.boundFullWindowOnEscKey_),_e.documentElement.style.overflow=this.docOrigOverflow,Bu(_e.body,"vjs-full-window"),this.trigger("exitFullWindow")}disablePictureInPicture(e){if(e===void 0)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(e){if(e!==void 0){this.isInPictureInPicture_=!!e,this.togglePictureInPictureClass_();return}return!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&$.documentPictureInPicture){const e=_e.createElement(this.el().tagName);return e.classList=this.el().classList,e.classList.add("vjs-pip-container"),this.posterImage&&e.appendChild(this.posterImage.el().cloneNode(!0)),this.titleBar&&e.appendChild(this.titleBar.el().cloneNode(!0)),e.appendChild(Me("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),$.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(i=>(tv(i),this.el_.parentNode.insertBefore(e,this.el_),i.document.body.appendChild(this.el_),i.document.body.classList.add("vjs-pip-window"),this.player_.isInPictureInPicture(!0),this.player_.trigger({type:"enterpictureinpicture",pipWindow:i}),i.addEventListener("pagehide",n=>{const s=n.target.querySelector(".video-js");e.parentNode.replaceChild(s,e),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")}),i))}return"pictureInPictureEnabled"in _e&&this.disablePictureInPicture()===!1?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){if($.documentPictureInPicture&&$.documentPictureInPicture.window)return $.documentPictureInPicture.window.close(),Promise.resolve();if("pictureInPictureEnabled"in _e)return _e.exitPictureInPicture()}handleKeyDown(e){const{userActions:i}=this.options_;!i||!i.hotkeys||(s=>{const r=s.tagName.toLowerCase();if(s.isContentEditable)return!0;const a=["button","checkbox","hidden","radio","reset","submit"];return r==="input"?a.indexOf(s.type)===-1:["textarea"].indexOf(r)!==-1})(this.el_.ownerDocument.activeElement)||(typeof i.hotkeys=="function"?i.hotkeys.call(this,e):this.handleHotkeys(e))}handleHotkeys(e){const i=this.options_.userActions?this.options_.userActions.hotkeys:{},{fullscreenKey:n=a=>e.key.toLowerCase()==="f",muteKey:s=a=>e.key.toLowerCase()==="m",playPauseKey:r=a=>e.key.toLowerCase()==="k"||e.key.toLowerCase()===" "}=i;if(n.call(this,e)){e.preventDefault(),e.stopPropagation();const a=le.getComponent("FullscreenToggle");_e[this.fsApi_.fullscreenEnabled]!==!1&&a.prototype.handleClick.call(this,e)}else s.call(this,e)?(e.preventDefault(),e.stopPropagation(),le.getComponent("MuteToggle").prototype.handleClick.call(this,e)):r.call(this,e)&&(e.preventDefault(),e.stopPropagation(),le.getComponent("PlayToggle").prototype.handleClick.call(this,e))}canPlayType(e){let i;for(let n=0,s=this.options_.techOrder;n[o,je.getTech(o)]).filter(([o,u])=>u?u.isSupported():(We.error(`The "${o}" tech is undefined. Skipped browser support check for that tech.`),!1)),n=function(o,u,c){let f;return o.some(g=>u.some(y=>{if(f=c(g,y),f)return!0})),f};let s;const r=o=>(u,c)=>o(c,u),a=([o,u],c)=>{if(u.canPlaySource(c,this.options_[o.toLowerCase()]))return{source:c,tech:o}};return this.options_.sourceOrder?s=n(e,i,r(a)):s=n(i,e,a),s||!1}handleSrc_(e,i){if(typeof e>"u")return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();const n=vv(e);if(!n.length){this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);return}if(this.changingSrc_=!0,i||(this.cache_.sources=n),this.updateSourceCaches_(n[0]),BA(this,n[0],(s,r)=>{if(this.middleware_=r,i||(this.cache_.sources=n),this.updateSourceCaches_(s),this.src_(s)){if(n.length>1)return this.handleSrc_(n.slice(1));this.changingSrc_=!1,this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),this.triggerReady();return}FA(r,this.tech_)}),n.length>1){const s=()=>{this.error(null),this.handleSrc_(n.slice(1),!0)},r=()=>{this.off("error",s)};this.one("error",s),this.one("playing",r),this.resetRetryOnError_=()=>{this.off("error",s),this.off("playing",r)}}}src(e){return this.handleSrc_(e,!1)}src_(e){const i=this.selectSource([e]);return i?cv(i.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(i.tech,i.source),this.tech_.ready(()=>{this.changingSrc_=!1}),!1):!0}addSourceElement(e,i){return this.tech_?this.tech_.addSourceElement(e,i):!1}removeSourceElement(e){return this.tech_?this.tech_.removeSourceElement(e):!1}load(){if(this.tech_&&this.tech_.vhs){this.src(this.currentSource());return}this.techCall_("load")}reset(){if(this.paused())this.doReset_();else{const e=this.play();ln(e.then(()=>this.doReset_()))}}doReset_(){this.tech_&&this.tech_.clearTracks("text"),this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),this.error(null),this.titleBar&&this.titleBar.update({title:void 0,description:void 0}),In(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:e,durationDisplay:i,progressControl:n,remainingTimeDisplay:s}=this.controlBar||{},{seekBar:r}=n||{};e&&e.updateContent(),i&&i.updateContent(),s&&s.updateContent(),r&&(r.update(),r.loadProgressBar&&r.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger("volumechange")}currentSources(){const e=this.currentSource(),i=[];return Object.keys(e).length!==0&&i.push(e),this.cache_.sources||i}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(e){if(e!==void 0){this.techCall_("setPreload",e),this.options_.preload=e;return}return this.techGet_("preload")}autoplay(e){if(e===void 0)return this.options_.autoplay||!1;let i;typeof e=="string"&&/(any|play|muted)/.test(e)||e===!0&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_(typeof e=="string"?e:"play"),i=!1):e?this.options_.autoplay=!0:this.options_.autoplay=!1,i=typeof i>"u"?this.options_.autoplay:i,this.tech_&&this.techCall_("setAutoplay",i)}playsinline(e){return e!==void 0&&(this.techCall_("setPlaysinline",e),this.options_.playsinline=e),this.techGet_("playsinline")}loop(e){if(e!==void 0){this.techCall_("setLoop",e),this.options_.loop=e;return}return this.techGet_("loop")}poster(e){if(e===void 0)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){const e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}}controls(e){if(e===void 0)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))}usingNativeControls(e){if(e===void 0)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))}error(e){if(e===void 0)return this.error_||null;if(rs("beforeerror").forEach(i=>{const n=i(this,e);if(!(fn(n)&&!Array.isArray(n)||typeof n=="string"||typeof n=="number"||n===null)){this.log.error("please return a value that MediaError expects in beforeerror hooks");return}e=n}),this.options_.suppressNotSupportedError&&e&&e.code===4){const i=function(){this.error(e)};this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],i),this.one("loadstart",function(){this.off(["click","touchstart"],i)});return}if(e===null){this.error_=null,this.removeClass("vjs-error"),this.errorDisplay&&this.errorDisplay.close();return}this.error_=new mt(e),this.addClass("vjs-error"),We.error(`(CODE:${this.error_.code} ${mt.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),rs("error").forEach(i=>i(this,this.error_))}reportUserActivity(e){this.userActivity_=!0}userActive(e){if(e===void 0)return this.userActive_;if(e=!!e,e!==this.userActive_){if(this.userActive_=e,this.userActive_){this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),this.trigger("useractive");return}this.tech_&&this.tech_.one("mousemove",function(i){i.stopPropagation(),i.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}}listenForUserActivity_(){let e,i,n;const s=at(this,this.reportUserActivity),r=function(g){(g.screenX!==i||g.screenY!==n)&&(i=g.screenX,n=g.screenY,s())},a=function(){s(),this.clearInterval(e),e=this.setInterval(s,250)},o=function(g){s(),this.clearInterval(e)};this.on("mousedown",a),this.on("mousemove",r),this.on("mouseup",o),this.on("mouseleave",o);const u=this.getChild("controlBar");u&&!Kt&&!Ki&&(u.on("mouseenter",function(g){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),u.on("mouseleave",function(g){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",s),this.on("keyup",s);let c;const f=function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(c);const g=this.options_.inactivityTimeout;g<=0||(c=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},g))};this.setInterval(f,250)}playbackRate(e){if(e!==void 0){this.techCall_("setPlaybackRate",e);return}return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1}defaultPlaybackRate(e){return e!==void 0?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1}isAudio(e){if(e!==void 0){this.isAudio_=!!e;return}return!!this.isAudio_}updatePlayerHeightOnAudioOnlyMode_(){const e=this.getChild("ControlBar");!e||this.audioOnlyCache_.controlBarHeight===e.currentHeight()||(this.audioOnlyCache_.controlBarHeight=e.currentHeight(),this.height(this.audioOnlyCache_.controlBarHeight))}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const e=this.children(),i=this.getChild("ControlBar"),n=i&&i.currentHeight();e.forEach(s=>{s!==i&&s.el_&&!s.hasClass("vjs-hidden")&&(s.hide(),this.audioOnlyCache_.hiddenChildren.push(s))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.audioOnlyCache_.controlBarHeight=n,this.on("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.height(n),this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode"),this.off("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.audioOnlyCache_.hiddenChildren.forEach(e=>e.show()),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")}audioOnlyMode(e){if(typeof e!="boolean"||e===this.audioOnlyMode_)return this.audioOnlyMode_;if(this.audioOnlyMode_=e,e){const i=[];return this.isInPictureInPicture()&&i.push(this.exitPictureInPicture()),this.isFullscreen()&&i.push(this.exitFullscreen()),this.audioPosterMode()&&i.push(this.audioPosterMode(!1)),Promise.all(i).then(()=>this.enableAudioOnlyUI_())}return Promise.resolve().then(()=>this.disableAudioOnlyUI_())}enablePosterModeUI_(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}disablePosterModeUI_(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}audioPosterMode(e){return typeof e!="boolean"||e===this.audioPosterMode_?this.audioPosterMode_:(this.audioPosterMode_=e,e?this.audioOnlyMode()?this.audioOnlyMode(!1).then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.disablePosterModeUI_()}))}addTextTrack(e,i,n){if(this.tech_)return this.tech_.addTextTrack(e,i,n)}addRemoteTextTrack(e,i){if(this.tech_)return this.tech_.addRemoteTextTrack(e,i)}removeRemoteTextTrack(e={}){let{track:i}=e;if(i||(i=e),this.tech_)return this.tech_.removeRemoteTextTrack(i)}getVideoPlaybackQuality(){return this.techGet_("getVideoPlaybackQuality")}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(e){if(e===void 0)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),In(this)&&this.trigger("languagechange"))}languages(){return it(ut.prototype.options_.languages,this.languages_)}toJSON(){const e=it(this.options_),i=e.tracks;e.tracks=[];for(let n=0;n{this.removeChild(n)}),n.open(),n}updateCurrentBreakpoint_(){if(!this.responsive())return;const e=this.currentBreakpoint(),i=this.currentWidth();for(let n=0;nthis.addRemoteTextTrack(g,!1)),this.titleBar&&this.titleBar.update({title:f,description:a||s||""}),this.ready(i)}getMedia(){if(!this.cache_.media){const e=this.poster(),i=this.currentSources(),n=Array.prototype.map.call(this.remoteTextTracks(),r=>({kind:r.kind,label:r.label,language:r.language,src:r.src})),s={src:i,textTracks:n};return e&&(s.poster=e,s.artwork=[{src:s.poster,type:eu(s.poster)}]),s}return it(this.cache_.media)}static getTagSettings(e){const i={sources:[],tracks:[]},n=Qn(e),s=n["data-setup"];if(Ba(e,"vjs-fill")&&(n.fill=!0),Ba(e,"vjs-fluid")&&(n.fluid=!0),s!==null)try{Object.assign(n,JSON.parse(s||"{}"))}catch(r){We.error("data-setup",r)}if(Object.assign(i,n),e.hasChildNodes()){const r=e.childNodes;for(let a=0,o=r.length;atypeof i=="number")&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))}}si.names.forEach(function(t){const e=si[t];ut.prototype[e.getterName]=function(){return this.tech_?this.tech_[e.getterName]():(this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName])}});ut.prototype.crossorigin=ut.prototype.crossOrigin;ut.players={};const ya=$.navigator;ut.prototype.options_={techOrder:je.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:ya&&(ya.languages&&ya.languages[0]||ya.userLanguage||ya.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1,spatialNavigation:{enabled:!1,horizontalSeek:!1},enableSmoothSeeking:!1,disableSeekWhileScrubbingOnMobile:!1};Xv.forEach(function(t){ut.prototype[`handleTech${_t(t)}_`]=function(){return this.trigger(t)}});le.registerComponent("Player",ut);const tu="plugin",vr="activePlugins_",ar={},iu=t=>ar.hasOwnProperty(t),Tl=t=>iu(t)?ar[t]:void 0,Yv=(t,e)=>{t[vr]=t[vr]||{},t[vr][e]=!0},nu=(t,e,i)=>{const n=(i?"before":"")+"pluginsetup";t.trigger(n,e),t.trigger(n+":"+e.name,e)},wD=function(t,e){const i=function(){nu(this,{name:t,plugin:e,instance:null},!0);const n=e.apply(this,arguments);return Yv(this,t),nu(this,{name:t,plugin:e,instance:n}),n};return Object.keys(e).forEach(function(n){i[n]=e[n]}),i},Dm=(t,e)=>(e.prototype.name=t,function(...i){nu(this,{name:t,plugin:e,instance:null},!0);const n=new e(this,...i);return this[t]=()=>n,nu(this,n.getEventHash()),n});let mn=class xl{constructor(e){if(this.constructor===xl)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),df(this),delete this.trigger,uv(this,this.constructor.defaultState),Yv(e,this.name),this.dispose=this.dispose.bind(this),e.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(e={}){return e.name=this.name,e.plugin=this.constructor,e.instance=this,e}trigger(e,i={}){return $r(this.eventBusEl_,e,this.getEventHash(i))}handleStateChanged(e){}dispose(){const{name:e,player:i}=this;this.trigger("dispose"),this.off(),i.off("dispose",this.dispose),i[vr][e]=!1,this.player=this.state=null,i[e]=Dm(e,ar[e])}static isBasic(e){const i=typeof e=="string"?Tl(e):e;return typeof i=="function"&&!xl.prototype.isPrototypeOf(i.prototype)}static registerPlugin(e,i){if(typeof e!="string")throw new Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`);if(iu(e))We.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(ut.prototype.hasOwnProperty(e))throw new Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`);if(typeof i!="function")throw new Error(`Illegal plugin for "${e}", must be a function, was ${typeof i}.`);return ar[e]=i,e!==tu&&(xl.isBasic(i)?ut.prototype[e]=wD(e,i):ut.prototype[e]=Dm(e,i)),i}static deregisterPlugin(e){if(e===tu)throw new Error("Cannot de-register base plugin.");iu(e)&&(delete ar[e],delete ut.prototype[e])}static getPlugins(e=Object.keys(ar)){let i;return e.forEach(n=>{const s=Tl(n);s&&(i=i||{},i[n]=s)}),i}static getPluginVersion(e){const i=Tl(e);return i&&i.VERSION||""}};mn.getPlugin=Tl;mn.BASE_PLUGIN_NAME=tu;mn.registerPlugin(tu,mn);ut.prototype.usingPlugin=function(t){return!!this[vr]&&this[vr][t]===!0};ut.prototype.hasPlugin=function(t){return!!iu(t)};function AD(t,e){let i=!1;return function(...n){return i||We.warn(t),i=!0,e.apply(this,n)}}function Xi(t,e,i,n){return AD(`${e} is deprecated and will be removed in ${t}.0; please use ${i} instead.`,n)}var DD={NetworkBadStatus:"networkbadstatus",NetworkRequestFailed:"networkrequestfailed",NetworkRequestAborted:"networkrequestaborted",NetworkRequestTimeout:"networkrequesttimeout",NetworkBodyParserFailed:"networkbodyparserfailed",StreamingHlsPlaylistParserError:"streaminghlsplaylistparsererror",StreamingDashManifestParserError:"streamingdashmanifestparsererror",StreamingContentSteeringParserError:"streamingcontentsteeringparsererror",StreamingVttParserError:"streamingvttparsererror",StreamingFailedToSelectNextSegment:"streamingfailedtoselectnextsegment",StreamingFailedToDecryptSegment:"streamingfailedtodecryptsegment",StreamingFailedToTransmuxSegment:"streamingfailedtotransmuxsegment",StreamingFailedToAppendSegment:"streamingfailedtoappendsegment",StreamingCodecsChangeError:"streamingcodecschangeerror"};const Qv=t=>t.indexOf("#")===0?t.slice(1):t;function J(t,e,i){let n=J.getPlayer(t);if(n)return e&&We.warn(`Player "${t}" is already initialised. Options will not be applied.`),i&&n.ready(i),n;const s=typeof t=="string"?as("#"+Qv(t)):t;if(!qr(s))throw new TypeError("The element or ID supplied is not valid. (videojs)");const a=("getRootNode"in s?s.getRootNode()instanceof $.ShadowRoot:!1)?s.getRootNode():s.ownerDocument.body;(!s.ownerDocument.defaultView||!a.contains(s))&&We.warn("The element supplied is not included in the DOM"),e=e||{},e.restoreEl===!0&&(e.restoreEl=(s.parentNode&&s.parentNode.hasAttribute&&s.parentNode.hasAttribute("data-vjs-player")?s.parentNode:s).cloneNode(!0)),rs("beforesetup").forEach(u=>{const c=u(s,it(e));if(!fn(c)||Array.isArray(c)){We.error("please return an object in beforesetup hooks");return}e=it(e,c)});const o=le.getComponent("Player");return n=new o(s,e,i),rs("setup").forEach(u=>u(n)),n}J.hooks_=An;J.hooks=rs;J.hook=aA;J.hookOnce=oA;J.removeHook=R_;if($.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&Ur()){let t=as(".vjs-styles-defaults");if(!t){t=sv("vjs-styles-defaults");const e=as("head");e&&e.insertBefore(t,e.firstChild),rv(t,` .video-js { width: 300px; height: 150px; } .vjs-fluid:not(.vjs-audio-only-mode) { padding-top: 56.25% } `)}}Zd(1,J);J.VERSION=Xd;J.options=ut.prototype.options_;J.getPlayers=()=>ut.players;J.getPlayer=t=>{const e=ut.players;let i;if(typeof t=="string"){const n=Qv(t),s=e[n];if(s)return s;i=as("#"+n)}else i=t;if(qr(i)){const{player:n,playerId:s}=i;if(n||e[s])return n||e[s]}};J.getAllPlayers=()=>Object.keys(ut.players).map(t=>ut.players[t]).filter(Boolean);J.players=ut.players;J.getComponent=le.getComponent;J.registerComponent=(t,e)=>(je.isTech(e)&&We.warn(`The ${t} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),le.registerComponent.call(le,t,e));J.getTech=je.getTech;J.registerTech=je.registerTech;J.use=NA;Object.defineProperty(J,"middleware",{value:{},writeable:!1,enumerable:!0});Object.defineProperty(J.middleware,"TERMINATOR",{value:Zl,writeable:!1,enumerable:!0});J.browser=V_;J.obj=cA;J.mergeOptions=Xi(9,"videojs.mergeOptions","videojs.obj.merge",it);J.defineLazyProperty=Xi(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",Ou);J.bind=Xi(9,"videojs.bind","native Function.prototype.bind",at);J.registerPlugin=mn.registerPlugin;J.deregisterPlugin=mn.deregisterPlugin;J.plugin=(t,e)=>(We.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),mn.registerPlugin(t,e));J.getPlugins=mn.getPlugins;J.getPlugin=mn.getPlugin;J.getPluginVersion=mn.getPluginVersion;J.addLanguage=function(t,e){return t=(""+t).toLowerCase(),J.options.languages=it(J.options.languages,{[t]:e}),J.options.languages[t]};J.log=We;J.createLogger=M_;J.time=CA;J.createTimeRange=Xi(9,"videojs.createTimeRange","videojs.time.createTimeRanges",Wi);J.createTimeRanges=Xi(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",Wi);J.formatTime=Xi(9,"videojs.formatTime","videojs.time.formatTime",$s);J.setFormatTime=Xi(9,"videojs.setFormatTime","videojs.time.setFormatTime",hv);J.resetFormatTime=Xi(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",fv);J.parseUrl=Xi(9,"videojs.parseUrl","videojs.url.parseUrl",pf);J.isCrossOrigin=Xi(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",Hu);J.EventTarget=_i;J.any=cf;J.on=yi;J.one=ju;J.off=Xt;J.trigger=$r;J.xhr=v_;J.TextTrack=mo;J.AudioTrack=yv;J.VideoTrack=_v;["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(t=>{J[t]=function(){return We.warn(`videojs.${t}() is deprecated; use videojs.dom.${t}() instead`),iv[t].apply(null,arguments)}});J.computedStyle=Xi(9,"videojs.computedStyle","videojs.dom.computedStyle",Or);J.dom=iv;J.fn=vA;J.num=nD;J.str=SA;J.url=RA;J.Error=DD;/*! @name videojs-contrib-quality-levels @version 4.1.0 @license Apache-2.0 */class kD{constructor(e){let i=this;return i.id=e.id,i.label=i.id,i.width=e.width,i.height=e.height,i.bitrate=e.bandwidth,i.frameRate=e.frameRate,i.enabled_=e.enabled,Object.defineProperty(i,"enabled",{get(){return i.enabled_()},set(n){i.enabled_(n)}}),i}}class su extends J.EventTarget{constructor(){super();let e=this;return e.levels_=[],e.selectedIndex_=-1,Object.defineProperty(e,"selectedIndex",{get(){return e.selectedIndex_}}),Object.defineProperty(e,"length",{get(){return e.levels_.length}}),e[Symbol.iterator]=()=>e.levels_.values(),e}addQualityLevel(e){let i=this.getQualityLevelById(e.id);if(i)return i;const n=this.levels_.length;return i=new kD(e),""+n in this||Object.defineProperty(this,n,{get(){return this.levels_[n]}}),this.levels_.push(i),this.trigger({qualityLevel:i,type:"addqualitylevel"}),i}removeQualityLevel(e){let i=null;for(let n=0,s=this.length;nn&&this.selectedIndex_--;break}return i&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),i}getQualityLevelById(e){for(let i=0,n=this.length;in,t.qualityLevels.VERSION=Jv,n},Zv=function(t){return ID(this,J.obj.merge({},t))};J.registerPlugin("qualityLevels",Zv);Zv.VERSION=Jv;/*! @name @videojs/http-streaming @version 3.16.2 @license Apache-2.0 */const li=Du,ru=(t,e)=>e&&e.responseURL&&t!==e.responseURL?e.responseURL:t,Mi=t=>J.log.debug?J.log.debug.bind(J,"VHS:",`${t} >`):function(){};function Ze(...t){const e=J.obj||J;return(e.merge||e.mergeOptions).apply(e,t)}function Mt(...t){const e=J.time||J;return(e.createTimeRanges||e.createTimeRanges).apply(e,t)}function PD(t){if(t.length===0)return"Buffered Ranges are empty";let e=`Buffered Ranges: `;for(let i=0;i ${s}. Duration (${s-n}) `}return e}const un=1/30,cn=un*3,eb=function(t,e){const i=[];let n;if(t&&t.length)for(n=0;n=e})},il=function(t,e){return eb(t,function(i){return i-un>=e})},OD=function(t){if(t.length<2)return Mt();const e=[];for(let i=1;i{const e=[];if(!t||!t.length)return"";for(let i=0;i "+t.end(i));return e.join(", ")},RD=function(t,e,i=1){return((t.length?t.end(t.length-1):0)-e)/i},Ds=t=>{const e=[];for(let i=0;ir)){if(e>s&&e<=r){i+=r-e;continue}i+=r-s}}return i},Of=(t,e)=>{if(!e.preload)return e.duration;let i=0;return(e.parts||[]).forEach(function(n){i+=n.duration}),(e.preloadHints||[]).forEach(function(n){n.type==="PART"&&(i+=t.partTargetDuration)}),i},ah=t=>(t.segments||[]).reduce((e,i,n)=>(i.parts?i.parts.forEach(function(s,r){e.push({duration:s.duration,segmentIndex:n,partIndex:r,part:s,segment:i})}):e.push({duration:i.duration,segmentIndex:n,partIndex:null,segment:i,part:null}),e),[]),ib=t=>{const e=t.segments&&t.segments.length&&t.segments[t.segments.length-1];return e&&e.parts||[]},nb=({preloadSegment:t})=>{if(!t)return;const{parts:e,preloadHints:i}=t;let n=(i||[]).reduce((s,r)=>s+(r.type==="PART"?1:0),0);return n+=e&&e.length?e.length:0,n},sb=(t,e)=>{if(e.endList)return 0;if(t&&t.suggestedPresentationDelay)return t.suggestedPresentationDelay;const i=ib(e).length>0;return i&&e.serverControl&&e.serverControl.partHoldBack?e.serverControl.partHoldBack:i&&e.partTargetDuration?e.partTargetDuration*3:e.serverControl&&e.serverControl.holdBack?e.serverControl.holdBack:e.targetDuration?e.targetDuration*3:0},ND=function(t,e){let i=0,n=e-t.mediaSequence,s=t.segments[n];if(s){if(typeof s.start<"u")return{result:s.start,precise:!0};if(typeof s.end<"u")return{result:s.end-s.duration,precise:!0}}for(;n--;){if(s=t.segments[n],typeof s.end<"u")return{result:i+s.end,precise:!0};if(i+=Of(t,s),typeof s.start<"u")return{result:i+s.start,precise:!0}}return{result:i,precise:!1}},BD=function(t,e){let i=0,n,s=e-t.mediaSequence;for(;s"u"&&(e=t.mediaSequence+t.segments.length),e"u"){if(t.totalDuration)return t.totalDuration;if(!t.endList)return $.Infinity}return rb(t,e,i)},qa=function({defaultDuration:t,durationList:e,startIndex:i,endIndex:n}){let s=0;if(i>n&&([i,n]=[n,i]),i<0){for(let r=i;r0)for(let c=u-1;c>=0;c--){const f=o[c];if(a+=f.duration,r){if(a<0)continue}else if(a+un<=0)continue;return{partIndex:f.partIndex,segmentIndex:f.segmentIndex,startTime:s-qa({defaultDuration:t.targetDuration,durationList:o,startIndex:u,endIndex:c})}}return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:e}}if(u<0){for(let c=u;c<0;c++)if(a-=t.targetDuration,a<0)return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:e};u=0}for(let c=u;cun,y=a===0,_=g&&a+un>=0;if(!((y||_)&&c!==o.length-1)){if(r){if(a>0)continue}else if(a-un>=0)continue;return{partIndex:f.partIndex,segmentIndex:f.segmentIndex,startTime:s+qa({defaultDuration:t.targetDuration,durationList:o,startIndex:u,endIndex:c})}}}return{segmentIndex:o[o.length-1].segmentIndex,partIndex:o[o.length-1].partIndex,startTime:e}},lb=function(t){return t.excludeUntil&&t.excludeUntil>Date.now()},Lf=function(t){return t.excludeUntil&&t.excludeUntil===1/0},Ku=function(t){const e=lb(t);return!t.disabled&&!e},qD=function(t){return t.disabled},$D=function(t){for(let e=0;e{if(t.playlists.length===1)return!0;const i=e.attributes.BANDWIDTH||Number.MAX_VALUE;return t.playlists.filter(n=>Ku(n)?(n.attributes.BANDWIDTH||0)!t&&!e||!t&&e||t&&!e?!1:!!(t===e||t.id&&e.id&&t.id===e.id||t.resolvedUri&&e.resolvedUri&&t.resolvedUri===e.resolvedUri||t.uri&&e.uri&&t.uri===e.uri),km=function(t,e){const i=t&&t.mediaGroups&&t.mediaGroups.AUDIO||{};let n=!1;for(const s in i){for(const r in i[s])if(n=e(i[s][r]),n)break;if(n)break}return!!n},bo=t=>{if(!t||!t.playlists||!t.playlists.length)return km(t,i=>i.playlists&&i.playlists.length||i.uri);for(let e=0;ex_(r))||km(t,r=>Rf(i,r))))return!1}return!0};var ui={liveEdgeDelay:sb,duration:ab,seekable:FD,getMediaInfoForTime:UD,isEnabled:Ku,isDisabled:qD,isExcluded:lb,isIncompatible:Lf,playlistEnd:ob,isAes:$D,hasAttribute:ub,estimateSegmentRequestTime:jD,isLowestEnabledRendition:oh,isAudioOnly:bo,playlistMatch:Rf,segmentDurationWithParts:Of};const{log:cb}=J,br=(t,e)=>`${t}-${e}`,db=(t,e,i)=>`placeholder-uri-${t}-${e}-${i}`,VD=({onwarn:t,oninfo:e,manifestString:i,customTagParsers:n=[],customTagMappers:s=[],llhls:r})=>{const a=new DC;t&&a.on("warn",t),e&&a.on("info",e),n.forEach(c=>a.addParser(c)),s.forEach(c=>a.addTagMapper(c)),a.push(i),a.end();const o=a.manifest;if(r||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(c){o.hasOwnProperty(c)&&delete o[c]}),o.segments&&o.segments.forEach(function(c){["parts","preloadHints"].forEach(function(f){c.hasOwnProperty(f)&&delete c[f]})})),!o.targetDuration){let c=10;o.segments&&o.segments.length&&(c=o.segments.reduce((f,g)=>Math.max(f,g.duration),0)),t&&t({message:`manifest has no targetDuration defaulting to ${c}`}),o.targetDuration=c}const u=ib(o);if(u.length&&!o.partTargetDuration){const c=u.reduce((f,g)=>Math.max(f,g.duration),0);t&&(t({message:`manifest has no partTargetDuration defaulting to ${c}`}),cb.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),o.partTargetDuration=c}return o},zr=(t,e)=>{t.mediaGroups&&["AUDIO","SUBTITLES"].forEach(i=>{if(t.mediaGroups[i])for(const n in t.mediaGroups[i])for(const s in t.mediaGroups[i][n]){const r=t.mediaGroups[i][n][s];e(r,i,n,s)}})},hb=({playlist:t,uri:e,id:i})=>{t.id=i,t.playlistErrors_=0,e&&(t.uri=e),t.attributes=t.attributes||{}},HD=t=>{let e=t.playlists.length;for(;e--;){const i=t.playlists[e];hb({playlist:i,id:br(e,i.uri)}),i.resolvedUri=li(t.uri,i.uri),t.playlists[i.id]=i,t.playlists[i.uri]=i,i.attributes.BANDWIDTH||cb.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},zD=t=>{zr(t,e=>{e.uri&&(e.resolvedUri=li(t.uri,e.uri))})},WD=(t,e)=>{const i=br(0,e),n={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:$.location.href,resolvedUri:$.location.href,playlists:[{uri:e,id:i,resolvedUri:e,attributes:{}}]};return n.playlists[i]=n.playlists[0],n.playlists[e]=n.playlists[0],n},fb=(t,e,i=db)=>{t.uri=e;for(let s=0;s{if(!s.playlists||!s.playlists.length){if(n&&r==="AUDIO"&&!s.uri)for(let u=0;u(s.set(r.id,r),s),new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id),this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(this.offset_===null)return[];const e={},i=[];this.pendingDateRanges_.forEach((n,s)=>{if(!this.processedDateRanges_.has(s)&&(n.startTime=n.startDate.getTime()/1e3-this.offset_,n.processDateRange=()=>this.processDateRange(n),i.push(n),!!n.class))if(e[n.class]){const r=e[n.class].push(n);n.classListIndex=r-1}else e[n.class]=[n],n.classListIndex=0});for(const n of i){const s=e[n.class]||[];n.endDate?n.endTime=n.endDate.getTime()/1e3-this.offset_:n.endOnNext&&s[n.classListIndex+1]?n.endTime=s[n.classListIndex+1].startTime:n.duration?n.endTime=n.startTime+n.duration:n.plannedDuration?n.endTime=n.startTime+n.plannedDuration:n.endTime=n.startTime}return i}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach((n,s)=>{n.startDate.getTime(){const s=e.status<200||e.status>299,r=e.status>=400&&e.status<=499,a={uri:e.uri,requestType:t},o=s&&!r||n;if(i&&r)a.error=xt({},i),a.errorType=J.Error.NetworkRequestFailed;else if(e.aborted)a.errorType=J.Error.NetworkRequestAborted;else if(e.timedout)a.erroType=J.Error.NetworkRequestTimeout;else if(o){const u=n?J.Error.NetworkBodyParserFailed:J.Error.NetworkBadStatus;a.errorType=u,a.status=e.status,a.headers=e.headers}return a},{EventTarget:GD}=J,KD=(t,e)=>{if(e.endList||!e.serverControl)return t;const i={};if(e.serverControl.canBlockReload){const{preloadSegment:n}=e;let s=e.mediaSequence+e.segments.length;if(n){const r=n.parts||[],a=nb(e)-1;a>-1&&a!==r.length-1&&(i._HLS_part=a),(a>-1||r.length)&&s--}i._HLS_msn=s}if(e.serverControl&&e.serverControl.canSkipUntil&&(i._HLS_skip=e.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(i).length){const n=new $.URL(t);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(s){i.hasOwnProperty(s)&&n.searchParams.set(s,i[s])}),t=n.toString()}return t},XD=(t,e)=>{if(!t)return e;const i=Ze(t,e);if(t.preloadHints&&!e.preloadHints&&delete i.preloadHints,t.parts&&!e.parts)delete i.parts;else if(t.parts&&e.parts)for(let n=0;n{const n=t.slice(),s=e.slice();i=i||0;const r=[];let a;for(let o=0;o{!t.resolvedUri&&t.uri&&(t.resolvedUri=li(e,t.uri)),t.key&&!t.key.resolvedUri&&(t.key.resolvedUri=li(e,t.key.uri)),t.map&&!t.map.resolvedUri&&(t.map.resolvedUri=li(e,t.map.uri)),t.map&&t.map.key&&!t.map.key.resolvedUri&&(t.map.key.resolvedUri=li(e,t.map.key.uri)),t.parts&&t.parts.length&&t.parts.forEach(i=>{i.resolvedUri||(i.resolvedUri=li(e,i.uri))}),t.preloadHints&&t.preloadHints.length&&t.preloadHints.forEach(i=>{i.resolvedUri||(i.resolvedUri=li(e,i.uri))})},mb=function(t){const e=t.segments||[],i=t.preloadSegment;if(i&&i.parts&&i.parts.length){if(i.preloadHints){for(let n=0;nt===e||t.segments&&e.segments&&t.segments.length===e.segments.length&&t.endList===e.endList&&t.mediaSequence===e.mediaSequence&&t.preloadSegment===e.preloadSegment,lh=(t,e,i=yb)=>{const n=Ze(t,{}),s=n.playlists[e.id];if(!s||i(s,e))return null;e.segments=mb(e);const r=Ze(s,e);if(r.preloadSegment&&!e.preloadSegment&&delete r.preloadSegment,s.segments){if(e.skip){e.segments=e.segments||[];for(let a=0;a{gb(a,r.resolvedUri)});for(let a=0;a{if(a.playlists)for(let f=0;f{const i=t.segments||[],n=i[i.length-1],s=n&&n.parts&&n.parts[n.parts.length-1],r=s&&s.duration||n&&n.duration;return e&&r?r*1e3:(t.partTargetDuration||t.targetDuration||10)*500},Pm=(t,e,i)=>{if(!t)return;const n=[];return t.forEach(s=>{if(!s.attributes)return;const{BANDWIDTH:r,RESOLUTION:a,CODECS:o}=s.attributes;n.push({id:s.id,bandwidth:r,resolution:a,codecs:o})}),{type:e,isLive:i,renditions:n}};class lr extends GD{constructor(e,i,n={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=Mi("PlaylistLoader");const{withCredentials:s=!1}=n;this.src=e,this.vhs_=i,this.withCredentials=s,this.addDateRangesToTextTrack_=n.addDateRangesToTextTrack;const r=i.options_;this.customTagParsers=r&&r.customTagParsers||[],this.customTagMappers=r&&r.customTagMappers||[],this.llhls=r&&r.llhls,this.dateRangesStorage_=new Im,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_),this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){const e=this.media();if(!e)return;this.dateRangesStorage_.setOffset(e.segments),this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);const i=this.dateRangesStorage_.getDateRangesToProcess();!i.length||!this.addDateRangesToTextTrack_||this.addDateRangesToTextTrack_(i)}handleMediaupdatetimeout_(){if(this.state!=="HAVE_METADATA")return;const e=this.media();let i=li(this.main.uri,e.uri);this.llhls&&(i=KD(i,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:i,withCredentials:this.withCredentials,requestType:"hls-playlist"},(n,s)=>{if(this.request){if(n)return this.playlistRequestError(this.request,this.media(),"HAVE_METADATA");this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})}})}playlistRequestError(e,i,n){const{uri:s,id:r}=i;this.request=null,n&&(this.state=n),this.error={playlist:this.main.playlists[r],status:e.status,message:`HLS playlist request error at URL: ${s}.`,responseText:e.responseText,code:e.status>=500?4:2,metadata:Ns({requestType:e.requestType,request:e,error:e.error})},this.trigger("error")}parseManifest_({url:e,manifestString:i}){try{return VD({onwarn:({message:n})=>this.logger_(`m3u8-parser warn for ${e}: ${n}`),oninfo:({message:n})=>this.logger_(`m3u8-parser info for ${e}: ${n}`),manifestString:i,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls})}catch(n){this.error=n,this.error.metadata={errorType:J.Error.StreamingHlsPlaylistParserError,error:n}}}haveMetadata({playlistString:e,playlistObject:i,url:n,id:s}){this.request=null,this.state="HAVE_METADATA";const r={playlistInfo:{type:"media",uri:n}};this.trigger({type:"playlistparsestart",metadata:r});const a=i||this.parseManifest_({url:n,manifestString:e});a.lastRequest=Date.now(),hb({playlist:a,uri:n,id:s});const o=lh(this.main,a);this.targetDuration=a.partTargetDuration||a.targetDuration,this.pendingMedia_=null,o?(this.main=o,this.media_=this.main.playlists[s]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(uh(this.media(),!!o)),r.parsedPlaylist=Pm(this.main.playlists,r.playlistInfo.type,!this.media_.endList),this.trigger({type:"playlistparsecomplete",metadata:r}),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),$.clearTimeout(this.mediaUpdateTimeout),$.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new Im,this.off()}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e,i){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);if(typeof e=="string"){if(!this.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.main.playlists[e]}if($.clearTimeout(this.finalRenditionTimeout),i){const o=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=$.setTimeout(this.media.bind(this,e,!1),o);return}const n=this.state,s=!this.media_||e.id!==this.media_.id,r=this.main.playlists[e.id];if(r&&r.endList||e.endList&&e.segments.length){this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,s&&(this.trigger("mediachanging"),n==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange"));return}if(this.updateMediaUpdateTimeout_(uh(e,!0)),!s)return;if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e;const a={playlistInfo:{type:"media",uri:e.uri}};this.trigger({type:"playlistrequeststart",metadata:a}),this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials,requestType:"hls-playlist"},(o,u)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=ru(e.resolvedUri,u),o)return this.playlistRequestError(this.request,e,n);this.trigger({type:"playlistrequestcomplete",metadata:a}),this.haveMetadata({playlistString:u.responseText,url:e.uri,id:e.id}),n==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}})}pause(){this.mediaUpdateTimeout&&($.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),this.state==="HAVE_NOTHING"&&(this.started=!1),this.state==="SWITCHING_MEDIA"?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MAIN_MANIFEST":this.state==="HAVE_CURRENT_METADATA"&&(this.state="HAVE_METADATA")}load(e){this.mediaUpdateTimeout&&($.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const i=this.media();if(e){const n=i?(i.partTargetDuration||i.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=$.setTimeout(()=>{this.mediaUpdateTimeout=null,this.load()},n);return}if(!this.started){this.start();return}i&&!i.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist")}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&($.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),!(!this.media()||this.media().endList)&&(this.mediaUpdateTimeout=$.setTimeout(()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(e)},e))}start(){if(this.started=!0,typeof this.src=="object"){this.src.uri||(this.src.uri=$.location.href),this.src.resolvedUri=this.src.uri,setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);return}const e={playlistInfo:{type:"multivariant",uri:this.src}};this.trigger({type:"playlistrequeststart",metadata:e}),this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials,requestType:"hls-playlist"},(i,n)=>{if(!this.request)return;if(this.request=null,i)return this.error={status:n.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:n.responseText,code:2,metadata:Ns({requestType:n.requestType,request:n,error:i})},this.state==="HAVE_NOTHING"&&(this.started=!1),this.trigger("error");this.trigger({type:"playlistrequestcomplete",metadata:e}),this.src=ru(this.src,n),this.trigger({type:"playlistparsestart",metadata:e});const s=this.parseManifest_({manifestString:n.responseText,url:this.src});e.parsedPlaylist=Pm(s.playlists,e.playlistInfo.type,!1),this.trigger({type:"playlistparsecomplete",metadata:e}),this.setupInitialPlaylist(s)})}srcUri(){return typeof this.src=="string"?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists){this.main=e,fb(this.main,this.srcUri()),e.playlists.forEach(n=>{n.segments=mb(n),n.segments.forEach(s=>{gb(s,n.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.main.playlists[0]);return}const i=this.srcUri()||$.location.href;this.main=WD(e,i),this.haveMetadata({playlistObject:e,url:i,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(e,i){const n=this.main,s=e.ID;let r=n.playlists.length;for(;r--;){const a=n.playlists[r];if(a.attributes["PATHWAY-ID"]===s){const o=a.resolvedUri,u=a.id;if(i){const c=this.createCloneURI_(a.resolvedUri,e),f=br(s,c),g=this.createCloneAttributes_(s,a.attributes),y=this.createClonePlaylist_(a,f,e,g);n.playlists[r]=y,n.playlists[f]=y,n.playlists[c]=y}else n.playlists.splice(r,1);delete n.playlists[u],delete n.playlists[o]}}this.updateOrDeleteCloneMedia(e,i)}updateOrDeleteCloneMedia(e,i){const n=this.main,s=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(r=>{if(!(!n.mediaGroups[r]||!n.mediaGroups[r][s])){for(const a in n.mediaGroups[r])if(a===s){for(const o in n.mediaGroups[r][a])n.mediaGroups[r][a][o].playlists.forEach((c,f)=>{const g=n.playlists[c.id],y=g.id,_=g.resolvedUri;delete n.playlists[y],delete n.playlists[_]});delete n.mediaGroups[r][a]}}}),i&&this.createClonedMediaGroups_(e)}addClonePathway(e,i={}){const n=this.main,s=n.playlists.length,r=this.createCloneURI_(i.resolvedUri,e),a=br(e.ID,r),o=this.createCloneAttributes_(e.ID,i.attributes),u=this.createClonePlaylist_(i,a,e,o);n.playlists[s]=u,n.playlists[a]=u,n.playlists[r]=u,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){const i=e.ID,n=e["BASE-ID"],s=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(r=>{if(!(!s.mediaGroups[r]||s.mediaGroups[r][i]))for(const a in s.mediaGroups[r]){if(a===n)s.mediaGroups[r][i]={};else continue;for(const o in s.mediaGroups[r][a]){const u=s.mediaGroups[r][a][o];s.mediaGroups[r][i][o]=xt({},u);const c=s.mediaGroups[r][i][o],f=this.createCloneURI_(u.resolvedUri,e);c.resolvedUri=f,c.uri=f,c.playlists=[],u.playlists.forEach((g,y)=>{const _=s.playlists[g.id],x=db(r,i,o),b=br(i,x);if(_&&!s.playlists[b]){const A=this.createClonePlaylist_(_,b,e),L=A.resolvedUri;s.playlists[b]=A,s.playlists[L]=A}c.playlists[y]=this.createClonePlaylist_(g,b,e)})}}})}createClonePlaylist_(e,i,n,s){const r=this.createCloneURI_(e.resolvedUri,n),a={resolvedUri:r,uri:r,id:i};return e.segments&&(a.segments=[]),s&&(a.attributes=s),Ze(e,a)}createCloneURI_(e,i){const n=new URL(e);n.hostname=i["URI-REPLACEMENT"].HOST;const s=i["URI-REPLACEMENT"].PARAMS;for(const r of Object.keys(s))n.searchParams.set(r,s[r]);return n.href}createCloneAttributes_(e,i){const n={"PATHWAY-ID":e};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(s=>{i[s]&&(n[s]=e)}),n}getKeyIdSet(e){if(e.contentProtection){const i=new Set;for(const n in e.contentProtection){const s=e.contentProtection[n].attributes.keyId;s&&i.add(s.toLowerCase())}return i}}}const ch=function(t,e,i,n){const s=t.responseType==="arraybuffer"?t.response:t.responseText;!e&&s&&(t.responseTime=Date.now(),t.roundTripTime=t.responseTime-t.requestTime,t.bytesReceived=s.byteLength||s.length,t.bandwidth||(t.bandwidth=Math.floor(t.bytesReceived/t.roundTripTime*8*1e3))),i.headers&&(t.responseHeaders=i.headers),e&&e.code==="ETIMEDOUT"&&(t.timedout=!0),!e&&!t.aborted&&i.statusCode!==200&&i.statusCode!==206&&i.statusCode!==0&&(e=new Error("XHR Failed with a response of: "+(t&&(s||t.responseText)))),n(e,t)},QD=(t,e)=>{if(!t||!t.size)return;let i=e;return t.forEach(n=>{i=n(i)}),i},JD=(t,e,i,n)=>{!t||!t.size||t.forEach(s=>{s(e,i,n)})},_b=function(){const t=function e(i,n){i=Ze({timeout:45e3},i);const s=e.beforeRequest||J.Vhs.xhr.beforeRequest,r=e._requestCallbackSet||J.Vhs.xhr._requestCallbackSet||new Set,a=e._responseCallbackSet||J.Vhs.xhr._responseCallbackSet;s&&typeof s=="function"&&(J.log.warn("beforeRequest is deprecated, use onRequest instead."),r.add(s));const o=J.Vhs.xhr.original===!0?J.xhr:J.Vhs.xhr,u=QD(r,i);r.delete(s);const c=o(u||i,function(g,y){return JD(a,c,g,y),ch(c,g,y,n)}),f=c.abort;return c.abort=function(){return c.aborted=!0,f.apply(c,arguments)},c.uri=i.uri,c.requestType=i.requestType,c.requestTime=Date.now(),c};return t.original=!0,t},ZD=function(t){let e;const i=t.offset;return typeof t.offset=="bigint"||typeof t.length=="bigint"?e=$.BigInt(t.offset)+$.BigInt(t.length)-$.BigInt(1):e=t.offset+t.length-1,"bytes="+i+"-"+e},dh=function(t){const e={};return t.byterange&&(e.Range=ZD(t.byterange)),e},ek=function(t,e){return t.start(e)+"-"+t.end(e)},tk=function(t,e){const i=t.toString(16);return"00".substring(0,2-i.length)+i+(e%2?" ":"")},ik=function(t){return t>=32&&t<126?String.fromCharCode(t):"."},vb=function(t){const e={};return Object.keys(t).forEach(i=>{const n=t[i];E_(n)?e[i]={bytes:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength}:e[i]=n}),e},au=function(t){const e=t.byterange||{length:1/0,offset:0};return[e.length,e.offset,t.resolvedUri].join(",")},bb=function(t){return t.resolvedUri},Tb=t=>{const e=Array.prototype.slice.call(t),i=16;let n="",s,r;for(let a=0;aTb(t),sk=t=>{let e="",i;for(i=0;i{if(!e.dateTimeObject)return null;const i=e.videoTimingInfo.transmuxerPrependedSeconds,s=e.videoTimingInfo.transmuxedPresentationStart+i,r=t-s;return new Date(e.dateTimeObject.getTime()+r*1e3)},ok=t=>t.transmuxedPresentationEnd-t.transmuxedPresentationStart-t.transmuxerPrependedSeconds,lk=(t,e)=>{let i;try{i=new Date(t)}catch{return null}if(!e||!e.segments||e.segments.length===0)return null;let n=e.segments[0];if(io?null:(i>new Date(r)&&(n=s),{segment:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:ui.duration(e,e.mediaSequence+e.segments.indexOf(n)),type:n.videoTimingInfo?"accurate":"estimate"})},uk=(t,e)=>{if(!e||!e.segments||e.segments.length===0)return null;let i=0,n;for(let r=0;ri){if(t>i+s.duration*xb)return null;n=s}return{segment:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:i-n.duration,type:n.videoTimingInfo?"accurate":"estimate"}},ck=(t,e)=>{let i,n;try{i=new Date(t),n=new Date(e)}catch{}const s=i.getTime();return(n.getTime()-s)/1e3},dk=t=>{if(!t.segments||t.segments.length===0)return!1;for(let e=0;e{if(!i)throw new Error("getProgramTime: callback must be provided");if(!t||e===void 0)return i({message:"getProgramTime: playlist and time must be provided"});const n=uk(e,t);if(!n)return i({message:"valid programTime was not found"});if(n.type==="estimate")return i({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:n.estimatedStart});const s={mediaSeconds:e},r=ak(e,n.segment);return r&&(s.programDateTime=r.toISOString()),i(null,s)},Sb=({programTime:t,playlist:e,retryCount:i=2,seekTo:n,pauseAfterSeek:s=!0,tech:r,callback:a})=>{if(!a)throw new Error("seekToProgramTime: callback must be provided");if(typeof t>"u"||!e||!n)return a({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!e.endList&&!r.hasStarted_)return a({message:"player must be playing a live stream to start buffering"});if(!dk(e))return a({message:"programDateTime tags must be provided in the manifest "+e.resolvedUri});const o=lk(t,e);if(!o)return a({message:`${t} was not found in the stream`});const u=o.segment,c=ck(u.dateTimeObject,t);if(o.type==="estimate"){if(i===0)return a({message:`${t} is not buffered yet. Try again`});n(o.estimatedStart+c),r.one("seeked",()=>{Sb({programTime:t,playlist:e,retryCount:i-1,seekTo:n,pauseAfterSeek:s,tech:r,callback:a})});return}const f=u.start+c,g=()=>a(null,r.currentTime());r.one("seeked",g),s&&r.pause(),n(f)},cd=(t,e)=>{if(t.readyState===4)return e()},fk=(t,e,i,n)=>{let s=[],r,a=!1;const o=function(g,y,_,x){return y.abort(),a=!0,i(g,y,_,x)},u=function(g,y){if(a)return;if(g)return g.metadata=Ns({requestType:n,request:y,error:g}),o(g,y,"",s);const _=y.responseText.substring(s&&s.byteLength||0,y.responseText.length);if(s=qC(s,C_(_,!0)),r=r||wa(s),s.length<10||r&&s.lengtho(g,y,"",s));const x=rf(s);return x==="ts"&&s.length<188?cd(y,()=>o(g,y,"",s)):!x&&s.length<376?cd(y,()=>o(g,y,"",s)):o(null,y,x,s)},f=e({uri:t,beforeSend(g){g.overrideMimeType("text/plain; charset=x-user-defined"),g.addEventListener("progress",function({total:y,loaded:_}){return ch(g,null,{statusCode:g.status},u)})}},function(g,y){return ch(f,g,y,u)});return f},{EventTarget:pk}=J,Om=function(t,e){if(!yb(t,e)||t.sidx&&e.sidx&&(t.sidx.offset!==e.sidx.offset||t.sidx.length!==e.sidx.length))return!1;if(!t.sidx&&e.sidx||t.sidx&&!e.sidx||t.segments&&!e.segments||!t.segments&&e.segments)return!1;if(!t.segments&&!e.segments)return!0;for(let i=0;i{const s=n.attributes.NAME||i;return`placeholder-uri-${t}-${e}-${s}`},mk=({mainXml:t,srcUrl:e,clientOffset:i,sidxMapping:n,previousManifest:s})=>{const r=Fw(t,{manifestUri:e,clientOffset:i,sidxMapping:n,previousManifest:s});return fb(r,e,gk),r},yk=(t,e)=>{zr(t,(i,n,s,r)=>{(!e.mediaGroups[n][s]||!(r in e.mediaGroups[n][s]))&&delete t.mediaGroups[n][s][r]})},_k=(t,e,i)=>{let n=!0,s=Ze(t,{duration:e.duration,minimumUpdatePeriod:e.minimumUpdatePeriod,timelineStarts:e.timelineStarts});for(let r=0;r{if(r.playlists&&r.playlists.length){const c=r.playlists[0].id,f=lh(s,r.playlists[0],Om);f&&(s=f,u in s.mediaGroups[a][o]||(s.mediaGroups[a][o][u]=r),s.mediaGroups[a][o][u].playlists[0]=s.playlists[c],n=!1)}}),yk(s,e),e.minimumUpdatePeriod!==t.minimumUpdatePeriod&&(n=!1),n?null:s},vk=(t,e)=>(!t.map&&!e.map||!!(t.map&&e.map&&t.map.byterange.offset===e.map.byterange.offset&&t.map.byterange.length===e.map.byterange.length))&&t.uri===e.uri&&t.byterange.offset===e.byterange.offset&&t.byterange.length===e.byterange.length,Lm=(t,e)=>{const i={};for(const n in t){const r=t[n].sidx;if(r){const a=Iu(r);if(!e[a])break;const o=e[a].sidxInfo;vk(o,r)&&(i[a]=e[a])}}return i},bk=(t,e)=>{let n=Lm(t.playlists,e);return zr(t,(s,r,a,o)=>{if(s.playlists&&s.playlists.length){const u=s.playlists;n=Ze(n,Lm(u,e))}}),n};class hh extends pk{constructor(e,i,n={},s){super(),this.isPaused_=!0,this.mainPlaylistLoader_=s||this,s||(this.isMain_=!0);const{withCredentials:r=!1}=n;if(this.vhs_=i,this.withCredentials=r,this.addMetadataToTextTrack=n.addMetadataToTextTrack,!e)throw new Error("A non-empty playlist URL or object is required");this.on("minimumUpdatePeriod",()=>{this.refreshXml_()}),this.on("mediaupdatetimeout",()=>{this.refreshMedia_(this.media().id)}),this.state="HAVE_NOTHING",this.loadedPlaylists_={},this.logger_=Mi("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}get isPaused(){return this.isPaused_}requestErrored_(e,i,n){if(!this.request)return!0;if(this.request=null,e)return this.error=typeof e=="object"&&!(e instanceof Error)?e:{status:i.status,message:"DASH request error at URL: "+i.uri,response:i.response,code:2,metadata:e.metadata},n&&(this.state=n),this.trigger("error"),!0}addSidxSegments_(e,i,n){const s=e.sidx&&Iu(e.sidx);if(!e.sidx||!s||this.mainPlaylistLoader_.sidxMapping_[s]){$.clearTimeout(this.mediaRequest_),this.mediaRequest_=$.setTimeout(()=>n(!1),0);return}const r=ru(e.sidx.resolvedUri),a=(u,c)=>{if(this.requestErrored_(u,c,i))return;const f=this.mainPlaylistLoader_.sidxMapping_,{requestType:g}=c;let y;try{y=Vw(Re(c.response).subarray(8))}catch(_){_.metadata=Ns({requestType:g,request:c,parseFailure:!0}),this.requestErrored_(_,c,i);return}return f[s]={sidxInfo:e.sidx,sidx:y},tf(e,y,e.sidx.resolvedUri),n(!0)},o="dash-sidx";this.request=fk(r,this.vhs_.xhr,(u,c,f,g)=>{if(u)return a(u,c);if(!f||f!=="mp4"){const x=f||"unknown";return a({status:c.status,message:`Unsupported ${x} container type for sidx segment at URL: ${r}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},c)}const{offset:y,length:_}=e.sidx.byterange;if(g.length>=_+y)return a(u,{response:g.subarray(y,y+_),status:c.status,uri:c.uri});this.request=this.vhs_.xhr({uri:r,responseType:"arraybuffer",requestType:"dash-sidx",headers:dh({byterange:e.sidx.byterange})},a)},o)}dispose(){this.isPaused_=!0,this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},$.clearTimeout(this.minimumUpdatePeriodTimeout_),$.clearTimeout(this.mediaRequest_),$.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);const i=this.state;if(typeof e=="string"){if(!this.mainPlaylistLoader_.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}const n=!this.media_||e.id!==this.media_.id;if(n&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList){this.state="HAVE_METADATA",this.media_=e,n&&(this.trigger("mediachanging"),this.trigger("mediachange"));return}n&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,i,s=>{this.haveMetadata({startingState:i,playlist:e})}))}haveMetadata({startingState:e,playlist:i}){this.state="HAVE_METADATA",this.loadedPlaylists_[i.id]=i,$.clearTimeout(this.mediaRequest_),this.mediaRequest_=null,this.refreshMedia_(i.id),e==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.isPaused_=!0,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),$.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&($.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)}load(e){this.isPaused_=!1,$.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const i=this.media();if(e){const n=i?i.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=$.setTimeout(()=>this.load(),n);return}if(!this.started){this.start();return}i&&!i.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist")}start(){if(this.started=!0,!this.isMain_){$.clearTimeout(this.mediaRequest_),this.mediaRequest_=$.setTimeout(()=>this.haveMain_(),0);return}this.requestMain_((e,i)=>{this.haveMain_(),!this.hasPendingRequest()&&!this.media_&&this.media(this.mainPlaylistLoader_.main.playlists[0])})}requestMain_(e){const i={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestrequeststart",metadata:i}),this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials,requestType:"dash-manifest"},(n,s)=>{if(n){const{requestType:a}=s;n.metadata=Ns({requestType:a,request:s,error:n})}if(this.requestErrored_(n,s)){this.state==="HAVE_NOTHING"&&(this.started=!1);return}this.trigger({type:"manifestrequestcomplete",metadata:i});const r=s.responseText!==this.mainPlaylistLoader_.mainXml_;if(this.mainPlaylistLoader_.mainXml_=s.responseText,s.responseHeaders&&s.responseHeaders.date?this.mainLoaded_=Date.parse(s.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=ru(this.mainPlaylistLoader_.srcUrl,s),r){this.handleMain_(),this.syncClientServerClock_(()=>e(s,r));return}return e(s,r)})}syncClientServerClock_(e){const i=Uw(this.mainPlaylistLoader_.mainXml_);if(i===null)return this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e();if(i.method==="DIRECT")return this.mainPlaylistLoader_.clientOffset_=i.value-Date.now(),e();this.request=this.vhs_.xhr({uri:li(this.mainPlaylistLoader_.srcUrl,i.value),method:i.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},(n,s)=>{if(!this.request)return;if(n){const{requestType:a}=s;return this.error.metadata=Ns({requestType:a,request:s,error:n}),this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()}let r;i.method==="HEAD"?!s.responseHeaders||!s.responseHeaders.date?r=this.mainLoaded_:r=Date.parse(s.responseHeaders.date):r=Date.parse(s.responseText),this.mainPlaylistLoader_.clientOffset_=r-Date.now(),e()})}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){$.clearTimeout(this.mediaRequest_),this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main,i={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestparsestart",metadata:i});let n;try{n=mk({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e})}catch(r){this.error=r,this.error.metadata={errorType:J.Error.StreamingDashManifestParserError,error:r},this.trigger("error")}e&&(n=_k(e,n,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=n||e;const s=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(s&&s!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=s),(!e||n&&n.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(n),n){const{duration:r,endList:a}=n,o=[];n.playlists.forEach(c=>{o.push({id:c.id,bandwidth:c.attributes.BANDWIDTH,resolution:c.attributes.RESOLUTION,codecs:c.attributes.CODECS})});const u={duration:r,isLive:!a,renditions:o};i.parsedManifest=u,this.trigger({type:"manifestparsecomplete",metadata:i})}return!!n}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&($.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);let i=e.main&&e.main.minimumUpdatePeriod;if(i===0&&(e.media()?i=e.media().targetDuration*1e3:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),typeof i!="number"||i<=0){i<0&&this.logger_(`found invalid minimumUpdatePeriod of ${i}, not setting a timeout`);return}this.createMUPTimeout_(i)}createMUPTimeout_(e){const i=this.mainPlaylistLoader_;i.minimumUpdatePeriodTimeout_=$.setTimeout(()=>{i.minimumUpdatePeriodTimeout_=null,i.trigger("minimumUpdatePeriod"),i.createMUPTimeout_(e)},e)}refreshXml_(){this.requestMain_((e,i)=>{i&&(this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=bk(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,n=>{this.refreshMedia_(this.media().id)}))})}refreshMedia_(e){if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();const i=this.mainPlaylistLoader_.main.playlists,n=!this.media_||this.media_!==i[e];if(n?this.media_=i[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){const s=()=>{this.media().endList||(this.mediaUpdateTimeout=$.setTimeout(()=>{this.trigger("mediaupdatetimeout"),s()},uh(this.media(),!!n)))};s()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){const i=this.mainPlaylistLoader_.main.eventStream.map(n=>({cueTime:n.start,frames:[{data:n.messageData}]}));this.addMetadataToTextTrack("EventStream",i,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){const i=new Set;for(const n in e.contentProtection){const s=e.contentProtection[n].attributes["cenc:default_KID"];s&&i.add(s.replace(/-/g,"").toLowerCase())}return i}}}var Ot={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30};const Tk=t=>{const e=new Uint8Array(new ArrayBuffer(t.length));for(let i=0;i-1):!1},this.trigger=function(d){var h,p,m,v;if(h=l[d],!!h)if(arguments.length===2)for(m=h.length,p=0;p"u")){for(l in V)V.hasOwnProperty(l)&&(V[l]=[l.charCodeAt(0),l.charCodeAt(1),l.charCodeAt(2),l.charCodeAt(3)]);F=new Uint8Array([105,115,111,109]),Z=new Uint8Array([97,118,99,49]),Y=new Uint8Array([0,0,0,1]),G=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]),W=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]),Q={video:G,audio:W},ne=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),re=new Uint8Array([0,0,0,0,0,0,0,0]),Ce=new Uint8Array([0,0,0,0,0,0,0,0]),Ie=Ce,De=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Se=Ce,se=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),o=function(l){var d=[],h=0,p,m,v;for(p=1;p>>1,l.samplingfrequencyindex<<7|l.channelcount<<3,6,1,2]))},f=function(){return o(V.ftyp,F,Y,F,Z)},U=function(l){return o(V.hdlr,Q[l])},g=function(l){return o(V.mdat,l)},O=function(l){var d=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,l.duration>>>24&255,l.duration>>>16&255,l.duration>>>8&255,l.duration&255,85,196,0,0]);return l.samplerate&&(d[12]=l.samplerate>>>24&255,d[13]=l.samplerate>>>16&255,d[14]=l.samplerate>>>8&255,d[15]=l.samplerate&255),o(V.mdhd,d)},R=function(l){return o(V.mdia,O(l),U(l.type),_(l))},y=function(l){return o(V.mfhd,new Uint8Array([0,0,0,0,(l&4278190080)>>24,(l&16711680)>>16,(l&65280)>>8,l&255]))},_=function(l){return o(V.minf,l.type==="video"?o(V.vmhd,se):o(V.smhd,re),u(),X(l))},x=function(l,d){for(var h=[],p=d.length;p--;)h[p]=S(d[p]);return o.apply(null,[V.moof,y(l)].concat(h))},b=function(l){for(var d=l.length,h=[];d--;)h[d]=C(l[d]);return o.apply(null,[V.moov,L(4294967295)].concat(h).concat(A(l)))},A=function(l){for(var d=l.length,h=[];d--;)h[d]=B(l[d]);return o.apply(null,[V.mvex].concat(h))},L=function(l){var d=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(l&4278190080)>>24,(l&16711680)>>16,(l&65280)>>8,l&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 o(V.mvhd,d)},H=function(l){var d=l.samples||[],h=new Uint8Array(4+d.length),p,m;for(m=0;m>>8),v.push(p[P].byteLength&255),v=v.concat(Array.prototype.slice.call(p[P]));for(P=0;P>>8),D.push(m[P].byteLength&255),D=D.concat(Array.prototype.slice.call(m[P]));if(N=[V.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,(h.width&65280)>>8,h.width&255,(h.height&65280)>>8,h.height&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o(V.avcC,new Uint8Array([1,h.profileIdc,h.profileCompatibility,h.levelIdc,255].concat([p.length],v,[m.length],D))),o(V.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],h.sarRatio){var q=h.sarRatio[0],K=h.sarRatio[1];N.push(o(V.pasp,new Uint8Array([(q&4278190080)>>24,(q&16711680)>>16,(q&65280)>>8,q&255,(K&4278190080)>>24,(K&16711680)>>16,(K&65280)>>8,K&255])))}return o.apply(null,N)},d=function(h){return o(V.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(h.channelcount&65280)>>8,h.channelcount&255,(h.samplesize&65280)>>8,h.samplesize&255,0,0,0,0,(h.samplerate&65280)>>8,h.samplerate&255,0,0]),c(h))}}(),w=function(l){var d=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(l.id&4278190080)>>24,(l.id&16711680)>>16,(l.id&65280)>>8,l.id&255,0,0,0,0,(l.duration&4278190080)>>24,(l.duration&16711680)>>16,(l.duration&65280)>>8,l.duration&255,0,0,0,0,0,0,0,0,0,0,0,0,1,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,(l.width&65280)>>8,l.width&255,0,0,(l.height&65280)>>8,l.height&255,0,0]);return o(V.tkhd,d)},S=function(l){var d,h,p,m,v,D,P;return d=o(V.tfhd,new Uint8Array([0,0,0,58,(l.id&4278190080)>>24,(l.id&16711680)>>16,(l.id&65280)>>8,l.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),D=Math.floor(l.baseMediaDecodeTime/a),P=Math.floor(l.baseMediaDecodeTime%a),h=o(V.tfdt,new Uint8Array([1,0,0,0,D>>>24&255,D>>>16&255,D>>>8&255,D&255,P>>>24&255,P>>>16&255,P>>>8&255,P&255])),v=92,l.type==="audio"?(p=k(l,v),o(V.traf,d,h,p)):(m=H(l),p=k(l,m.length+v),o(V.traf,d,h,p,m))},C=function(l){return l.duration=l.duration||4294967295,o(V.trak,w(l),R(l))},B=function(l){var d=new Uint8Array([0,0,0,0,(l.id&4278190080)>>24,(l.id&16711680)>>16,(l.id&65280)>>8,l.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return l.type!=="video"&&(d[d.length-1]=0),o(V.trex,d)},function(){var l,d,h;h=function(p,m){var v=0,D=0,P=0,N=0;return p.length&&(p[0].duration!==void 0&&(v=1),p[0].size!==void 0&&(D=2),p[0].flags!==void 0&&(P=4),p[0].compositionTimeOffset!==void 0&&(N=8)),[0,0,v|D|P|N,1,(p.length&4278190080)>>>24,(p.length&16711680)>>>16,(p.length&65280)>>>8,p.length&255,(m&4278190080)>>>24,(m&16711680)>>>16,(m&65280)>>>8,m&255]},d=function(p,m){var v,D,P,N,q,K;for(N=p.samples||[],m+=20+16*N.length,P=h(N,m),D=new Uint8Array(P.length+N.length*16),D.set(P),v=P.length,K=0;K>>24,D[v++]=(q.duration&16711680)>>>16,D[v++]=(q.duration&65280)>>>8,D[v++]=q.duration&255,D[v++]=(q.size&4278190080)>>>24,D[v++]=(q.size&16711680)>>>16,D[v++]=(q.size&65280)>>>8,D[v++]=q.size&255,D[v++]=q.flags.isLeading<<2|q.flags.dependsOn,D[v++]=q.flags.isDependedOn<<6|q.flags.hasRedundancy<<4|q.flags.paddingValue<<1|q.flags.isNonSyncSample,D[v++]=q.flags.degradationPriority&61440,D[v++]=q.flags.degradationPriority&15,D[v++]=(q.compositionTimeOffset&4278190080)>>>24,D[v++]=(q.compositionTimeOffset&16711680)>>>16,D[v++]=(q.compositionTimeOffset&65280)>>>8,D[v++]=q.compositionTimeOffset&255;return o(V.trun,D)},l=function(p,m){var v,D,P,N,q,K;for(N=p.samples||[],m+=20+8*N.length,P=h(N,m),v=new Uint8Array(P.length+N.length*8),v.set(P),D=P.length,K=0;K>>24,v[D++]=(q.duration&16711680)>>>16,v[D++]=(q.duration&65280)>>>8,v[D++]=q.duration&255,v[D++]=(q.size&4278190080)>>>24,v[D++]=(q.size&16711680)>>>16,v[D++]=(q.size&65280)>>>8,v[D++]=q.size&255;return o(V.trun,v)},k=function(p,m){return p.type==="audio"?l(p,m):d(p,m)}}();var te={ftyp:f,mdat:g,moof:x,moov:b,initSegment:function(l){var d=f(),h=b(l),p;return p=new Uint8Array(d.byteLength+h.byteLength),p.set(d),p.set(h,d.byteLength),p}},ye=function(l){var d,h,p=[],m=[];for(m.byteLength=0,m.nalCount=0,m.duration=0,p.byteLength=0,d=0;d1&&(d=l.shift(),l.byteLength-=d.byteLength,l.nalCount-=d.nalCount,l[0][0].dts=d.dts,l[0][0].pts=d.pts,l[0][0].duration+=d.duration),l},Be=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},ze=function(l,d){var h=Be();return h.dataOffset=d,h.compositionTimeOffset=l.pts-l.dts,h.duration=l.duration,h.size=4*l.length,h.size+=l.byteLength,l.keyFrame&&(h.flags.dependsOn=2,h.flags.isNonSyncSample=0),h},M=function(l,d){var h,p,m,v,D,P=d||0,N=[];for(h=0;hci.ONE_SECOND_IN_TS/2))){for(q=It()[l.samplerate],q||(q=d[0].data),K=0;K=h?l:(d.minSegmentDts=1/0,l.filter(function(p){return p.dts>=h?(d.minSegmentDts=Math.min(d.minSegmentDts,p.dts),d.minSegmentPts=d.minSegmentDts,!0):!1}))},hs=function(l){var d,h,p=[];for(d=0;d=this.virtualRowCount&&typeof this.beforeRowOverflow=="function"&&this.beforeRowOverflow(l),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},xi.prototype.isEmpty=function(){return this.rows.length===0?!0:this.rows.length===1?this.rows[0]==="":!1},xi.prototype.addText=function(l){this.rows[this.rowIdx]+=l},xi.prototype.backspace=function(){if(!this.isEmpty()){var l=this.rows[this.rowIdx];this.rows[this.rowIdx]=l.substr(0,l.length-1)}};var Ui=function(l,d,h){this.serviceNum=l,this.text="",this.currentWindow=new xi(-1),this.windows=[],this.stream=h,typeof d=="string"&&this.createTextDecoder(d)};Ui.prototype.init=function(l,d){this.startPts=l;for(var h=0;h<8;h++)this.windows[h]=new xi(h),typeof d=="function"&&(this.windows[h].beforeRowOverflow=d)},Ui.prototype.setCurrentWindow=function(l){this.currentWindow=this.windows[l]},Ui.prototype.createTextDecoder=function(l){if(typeof TextDecoder>"u")this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(l)}catch(d){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+l+" encoding. "+d})}};var Qe=function(l){l=l||{},Qe.prototype.init.call(this);var d=this,h=l.captionServices||{},p={},m;Object.keys(h).forEach(v=>{m=h[v],/^SERVICE/.test(v)&&(p[v]=m.encoding)}),this.serviceEncodings=p,this.current708Packet=null,this.services={},this.push=function(v){v.type===3?(d.new708Packet(),d.add708Bytes(v)):(d.current708Packet===null&&d.new708Packet(),d.add708Bytes(v))}};Qe.prototype=new Fi,Qe.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},Qe.prototype.add708Bytes=function(l){var d=l.ccData,h=d>>>8,p=d&255;this.current708Packet.ptsVals.push(l.pts),this.current708Packet.data.push(h),this.current708Packet.data.push(p)},Qe.prototype.push708Packet=function(){var l=this.current708Packet,d=l.data,h=null,p=null,m=0,v=d[m++];for(l.seq=v>>6,l.sizeCode=v&63;m>5,p=v&31,h===7&&p>0&&(v=d[m++],h=v),this.pushServiceBlock(h,m,p),p>0&&(m+=p-1)},Qe.prototype.pushServiceBlock=function(l,d,h){var p,m=d,v=this.current708Packet.data,D=this.services[l];for(D||(D=this.initService(l,m));m("0"+(Oe&255).toString(16)).slice(-2)).join("")}if(m?(ae=[P,N],l++):ae=[P],d.textDecoder_&&!p)K=d.textDecoder_.decode(new Uint8Array(ae));else if(m){const de=xe(ae);K=String.fromCharCode(parseInt(de,16))}else K=fs(D|P);return q.pendingNewLine&&!q.isEmpty()&&q.newLine(this.getPts(l)),q.pendingNewLine=!1,q.addText(K),l},Qe.prototype.multiByteCharacter=function(l,d){var h=this.current708Packet.data,p=h[l+1],m=h[l+2];return bt(p)&&bt(m)&&(l=this.handleText(++l,d,{isMultiByte:!0})),l},Qe.prototype.setCurrentWindow=function(l,d){var h=this.current708Packet.data,p=h[l],m=p&7;return d.setCurrentWindow(m),l},Qe.prototype.defineWindow=function(l,d){var h=this.current708Packet.data,p=h[l],m=p&7;d.setCurrentWindow(m);var v=d.currentWindow;return p=h[++l],v.visible=(p&32)>>5,v.rowLock=(p&16)>>4,v.columnLock=(p&8)>>3,v.priority=p&7,p=h[++l],v.relativePositioning=(p&128)>>7,v.anchorVertical=p&127,p=h[++l],v.anchorHorizontal=p,p=h[++l],v.anchorPoint=(p&240)>>4,v.rowCount=p&15,p=h[++l],v.columnCount=p&63,p=h[++l],v.windowStyle=(p&56)>>3,v.penStyle=p&7,v.virtualRowCount=v.rowCount+1,l},Qe.prototype.setWindowAttributes=function(l,d){var h=this.current708Packet.data,p=h[l],m=d.currentWindow.winAttr;return p=h[++l],m.fillOpacity=(p&192)>>6,m.fillRed=(p&48)>>4,m.fillGreen=(p&12)>>2,m.fillBlue=p&3,p=h[++l],m.borderType=(p&192)>>6,m.borderRed=(p&48)>>4,m.borderGreen=(p&12)>>2,m.borderBlue=p&3,p=h[++l],m.borderType+=(p&128)>>5,m.wordWrap=(p&64)>>6,m.printDirection=(p&48)>>4,m.scrollDirection=(p&12)>>2,m.justify=p&3,p=h[++l],m.effectSpeed=(p&240)>>4,m.effectDirection=(p&12)>>2,m.displayEffect=p&3,l},Qe.prototype.flushDisplayed=function(l,d){for(var h=[],p=0;p<8;p++)d.windows[p].visible&&!d.windows[p].isEmpty()&&h.push(d.windows[p].getText());d.endPts=l,d.text=h.join(` `),this.pushCaption(d),d.startPts=l},Qe.prototype.pushCaption=function(l){l.text!==""&&(this.trigger("data",{startPts:l.startPts,endPts:l.endPts,text:l.text,stream:"cc708_"+l.serviceNum}),l.text="",l.startPts=l.endPts)},Qe.prototype.displayWindows=function(l,d){var h=this.current708Packet.data,p=h[++l],m=this.getPts(l);this.flushDisplayed(m,d);for(var v=0;v<8;v++)p&1<>4,m.offset=(p&12)>>2,m.penSize=p&3,p=h[++l],m.italics=(p&128)>>7,m.underline=(p&64)>>6,m.edgeType=(p&56)>>3,m.fontStyle=p&7,l},Qe.prototype.setPenColor=function(l,d){var h=this.current708Packet.data,p=h[l],m=d.currentWindow.penColor;return p=h[++l],m.fgOpacity=(p&192)>>6,m.fgRed=(p&48)>>4,m.fgGreen=(p&12)>>2,m.fgBlue=p&3,p=h[++l],m.bgOpacity=(p&192)>>6,m.bgRed=(p&48)>>4,m.bgGreen=(p&12)>>2,m.bgBlue=p&3,p=h[++l],m.edgeRed=(p&48)>>4,m.edgeGreen=(p&12)>>2,m.edgeBlue=p&3,l},Qe.prototype.setPenLocation=function(l,d){var h=this.current708Packet.data,p=h[l],m=d.currentWindow.penLoc;return d.currentWindow.pendingNewLine=!0,p=h[++l],m.row=p&15,p=h[++l],m.column=p&63,l},Qe.prototype.reset=function(l,d){var h=this.getPts(l);return this.flushDisplayed(h,d),this.initService(d.serviceNum,l)};var r2={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},Eo=function(l){return l===null?"":(l=r2[l]||l,String.fromCharCode(l))},Co=14,a2=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],ps=function(){for(var l=[],d=Co+1;d--;)l.push({text:"",indent:0,offset:0});return l},ht=function(l,d){ht.prototype.init.call(this),this.field_=l||0,this.dataChannel_=d||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(h){var p,m,v,D,P;if(p=h.ccData&32639,p===this.lastControlCode_){this.lastControlCode_=null;return}if((p&61440)===4096?this.lastControlCode_=p:p!==this.PADDING_&&(this.lastControlCode_=null),v=p>>>8,D=p&255,p!==this.PADDING_)if(p===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(p===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(h.pts),this.flushDisplayed(h.pts),m=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=m,this.startPts_=h.pts;else if(p===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(h.pts);else if(p===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(h.pts);else if(p===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(h.pts);else if(p===this.CARRIAGE_RETURN_)this.clearFormatting(h.pts),this.flushDisplayed(h.pts),this.shiftRowsUp_(),this.startPts_=h.pts;else if(p===this.BACKSPACE_)this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1);else if(p===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(h.pts),this.displayed_=ps();else if(p===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=ps();else if(p===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(h.pts),this.displayed_=ps()),this.mode_="paintOn",this.startPts_=h.pts;else if(this.isSpecialCharacter(v,D))v=(v&3)<<8,P=Eo(v|D),this[this.mode_](h.pts,P),this.column_++;else if(this.isExtCharacter(v,D))this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1),v=(v&3)<<8,P=Eo(v|D),this[this.mode_](h.pts,P),this.column_++;else if(this.isMidRowCode(v,D))this.clearFormatting(h.pts),this[this.mode_](h.pts," "),this.column_++,(D&14)===14&&this.addFormatting(h.pts,["i"]),(D&1)===1&&this.addFormatting(h.pts,["u"]);else if(this.isOffsetControlCode(v,D)){const q=D&3;this.nonDisplayed_[this.row_].offset=q,this.column_+=q}else if(this.isPAC(v,D)){var N=a2.indexOf(p&7968);if(this.mode_==="rollUp"&&(N-this.rollUpRows_+1<0&&(N=this.rollUpRows_-1),this.setRollUp(h.pts,N)),N!==this.row_&&N>=0&&N<=14&&(this.clearFormatting(h.pts),this.row_=N),D&1&&this.formatting_.indexOf("u")===-1&&this.addFormatting(h.pts,["u"]),(p&16)===16){const q=(p&14)>>1;this.column_=q*4,this.nonDisplayed_[this.row_].indent+=q}this.isColorPAC(D)&&(D&14)===14&&this.addFormatting(h.pts,["i"])}else this.isNormalChar(v)&&(D===0&&(D=null),P=Eo(v),P+=Eo(D),this[this.mode_](h.pts,P),this.column_+=P.length)}};ht.prototype=new Fi,ht.prototype.flushDisplayed=function(l){const d=p=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+p+"."})},h=[];this.displayed_.forEach((p,m)=>{if(p&&p.text&&p.text.length){try{p.text=p.text.trim()}catch{d(m)}p.text.length&&h.push({text:p.text,line:m+1,position:10+Math.min(70,p.indent*10)+p.offset*2.5})}else p==null&&d(m)}),h.length&&this.trigger("data",{startPts:this.startPts_,endPts:l,content:h,stream:this.name_})},ht.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=ps(),this.nonDisplayed_=ps(),this.lastControlCode_=null,this.column_=0,this.row_=Co,this.rollUpRows_=2,this.formatting_=[]},ht.prototype.setConstants=function(){this.dataChannel_===0?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):this.dataChannel_===1&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=this.CONTROL_|32,this.END_OF_CAPTION_=this.CONTROL_|47,this.ROLL_UP_2_ROWS_=this.CONTROL_|37,this.ROLL_UP_3_ROWS_=this.CONTROL_|38,this.ROLL_UP_4_ROWS_=this.CONTROL_|39,this.CARRIAGE_RETURN_=this.CONTROL_|45,this.RESUME_DIRECT_CAPTIONING_=this.CONTROL_|41,this.BACKSPACE_=this.CONTROL_|33,this.ERASE_DISPLAYED_MEMORY_=this.CONTROL_|44,this.ERASE_NON_DISPLAYED_MEMORY_=this.CONTROL_|46},ht.prototype.isSpecialCharacter=function(l,d){return l===this.EXT_&&d>=48&&d<=63},ht.prototype.isExtCharacter=function(l,d){return(l===this.EXT_+1||l===this.EXT_+2)&&d>=32&&d<=63},ht.prototype.isMidRowCode=function(l,d){return l===this.EXT_&&d>=32&&d<=47},ht.prototype.isOffsetControlCode=function(l,d){return l===this.OFFSET_&&d>=33&&d<=35},ht.prototype.isPAC=function(l,d){return l>=this.BASE_&&l=64&&d<=127},ht.prototype.isColorPAC=function(l){return l>=64&&l<=79||l>=96&&l<=127},ht.prototype.isNormalChar=function(l){return l>=32&&l<=127},ht.prototype.setRollUp=function(l,d){if(this.mode_!=="rollUp"&&(this.row_=Co,this.mode_="rollUp",this.flushDisplayed(l),this.nonDisplayed_=ps(),this.displayed_=ps()),d!==void 0&&d!==this.row_)for(var h=0;h"},"");this[this.mode_](l,h)},ht.prototype.clearFormatting=function(l){if(this.formatting_.length){var d=this.formatting_.reverse().reduce(function(h,p){return h+""},"");this.formatting_=[],this[this.mode_](l,d)}},ht.prototype.popOn=function(l,d){var h=this.nonDisplayed_[this.row_].text;h+=d,this.nonDisplayed_[this.row_].text=h},ht.prototype.rollUp=function(l,d){var h=this.displayed_[this.row_].text;h+=d,this.displayed_[this.row_].text=h},ht.prototype.shiftRowsUp_=function(){var l;for(l=0;ld&&(h=-1);Math.abs(d-l)>u2;)l+=h*l2;return l},Zu=function(l){var d,h;Zu.prototype.init.call(this),this.type_=l||zf,this.push=function(p){if(p.type==="metadata"){this.trigger("data",p);return}this.type_!==zf&&p.type!==this.type_||(h===void 0&&(h=p.dts),p.dts=Ju(p.dts,h),p.pts=Ju(p.pts,h),d=p.dts,this.trigger("data",p))},this.flush=function(){h=d,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){h=void 0,d=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};Zu.prototype=new o2;var Wf={TimestampRolloverStream:Zu,handleRollover:Ju},c2=(l,d,h)=>{if(!l)return-1;for(var p=h;p";l.data[0]===Do.Utf8&&(h=Ao(l.data,0,d),!(h<0)&&(l.mimeType=Kr(l.data,d,h),d=h+1,l.pictureType=l.data[d],d++,p=Ao(l.data,0,d),!(p<0)&&(l.description=Gr(l.data,d,p),d=p+1,l.mimeType===m?l.url=Kr(l.data,d,l.data.length):l.pictureData=l.data.subarray(d,l.data.length))))},"T*":function(l){l.data[0]===Do.Utf8&&(l.value=Gr(l.data,1,l.data.length).replace(/\0*$/,""),l.values=l.value.split("\0"))},TXXX:function(l){var d;l.data[0]===Do.Utf8&&(d=Ao(l.data,0,1),d!==-1&&(l.description=Gr(l.data,1,d),l.value=Gr(l.data,d+1,l.data.length).replace(/\0*$/,""),l.data=l.value))},"W*":function(l){l.url=Kr(l.data,0,l.data.length).replace(/\0.*$/,"")},WXXX:function(l){var d;l.data[0]===Do.Utf8&&(d=Ao(l.data,0,1),d!==-1&&(l.description=Gr(l.data,1,d),l.url=Kr(l.data,d+1,l.data.length).replace(/\0.*$/,"")))},PRIV:function(l){var d;for(d=0;d>>2;Oe*=4,Oe+=de[7]&3,K.timeStamp=Oe,P.pts===void 0&&P.dts===void 0&&(P.pts=K.timeStamp,P.dts=K.timeStamp),this.trigger("timestamp",K)}P.frames.push(K),N+=10,N+=q}while(N>>4>1&&(D+=m[D]+1),v.pid===0)v.type="pat",l(m.subarray(D),v),this.trigger("data",v);else if(v.pid===this.pmtPid)for(v.type="pmt",l(m.subarray(D),v),this.trigger("data",v);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([m,D,v]):this.processPes_(m,D,v)},this.processPes_=function(m,v,D){D.pid===this.programMapTable.video?D.streamType=qi.H264_STREAM_TYPE:D.pid===this.programMapTable.audio?D.streamType=qi.ADTS_STREAM_TYPE:D.streamType=this.programMapTable["timed-metadata"][D.pid],D.type="pes",D.data=m.subarray(v),this.trigger("data",D)}},Qr.prototype=new ec,Qr.STREAM_TYPES={h264:27,adts:15},Po=function(){var l=this,d=!1,h={data:[],size:0},p={data:[],size:0},m={data:[],size:0},v,D=function(N,q){var K;const ae=N[0]<<16|N[1]<<8|N[2];q.data=new Uint8Array,ae===1&&(q.packetLength=6+(N[4]<<8|N[5]),q.dataAlignmentIndicator=(N[6]&4)!==0,K=N[7],K&192&&(q.pts=(N[9]&14)<<27|(N[10]&255)<<20|(N[11]&254)<<12|(N[12]&255)<<5|(N[13]&254)>>>3,q.pts*=4,q.pts+=(N[13]&6)>>>1,q.dts=q.pts,K&64&&(q.dts=(N[14]&14)<<27|(N[15]&255)<<20|(N[16]&254)<<12|(N[17]&255)<<5|(N[18]&254)>>>3,q.dts*=4,q.dts+=(N[18]&6)>>>1)),q.data=N.subarray(9+N[8]))},P=function(N,q,K){var ae=new Uint8Array(N.size),xe={type:q},de=0,Oe=0,Ue=!1,Pt;if(!(!N.data.length||N.size<9)){for(xe.trackId=N.data[0].pid,de=0;de>5,N=((d[m+6]&3)+1)*1024,q=N*v2/Yf[(d[m+2]&60)>>>2],d.byteLength-m>>6&3)+1,channelcount:(d[m+2]&1)<<2|(d[m+3]&192)>>>6,samplerate:Yf[(d[m+2]&60)>>>2],samplingfrequencyindex:(d[m+2]&60)>>>2,samplesize:16,data:d.subarray(m+7+D,m+v)}),h++,m+=v}typeof K=="number"&&(this.skipWarn_(K,m),K=null),d=d.subarray(m)}},this.flush=function(){h=0,this.trigger("done")},this.reset=function(){d=void 0,this.trigger("reset")},this.endTimeline=function(){d=void 0,this.trigger("endedtimeline")}},Oo.prototype=new _2;var b2=Oo,Qf;Qf=function(l){var d=l.byteLength,h=0,p=0;this.length=function(){return 8*d},this.bitsAvailable=function(){return 8*d+p},this.loadWord=function(){var m=l.byteLength-d,v=new Uint8Array(4),D=Math.min(4,d);if(D===0)throw new Error("no bytes available");v.set(l.subarray(m,m+D)),h=new DataView(v.buffer).getUint32(0),p=D*8,d-=D},this.skipBits=function(m){var v;p>m?(h<<=m,p-=m):(m-=p,v=Math.floor(m/8),m-=v*8,d-=v,this.loadWord(),h<<=m,p-=m)},this.readBits=function(m){var v=Math.min(p,m),D=h>>>32-v;return p-=v,p>0?h<<=v:d>0&&this.loadWord(),v=m-v,v>0?D<>>m)return h<<=m,p-=m,m;return this.loadWord(),m+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var m=this.skipLeadingZeros();return this.readBits(m+1)-1},this.readExpGolomb=function(){var m=this.readUnsignedExpGolomb();return 1&m?1+m>>>1:-1*(m>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var T2=Qf,Jf=i,x2=T2,Lo,Jr,Zf;Jr=function(){var l=0,d,h;Jr.prototype.init.call(this),this.push=function(p){var m;h?(m=new Uint8Array(h.byteLength+p.data.byteLength),m.set(h),m.set(p.data,h.byteLength),h=m):h=p.data;for(var v=h.byteLength;l3&&this.trigger("data",h.subarray(l+3)),h=null,l=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},Jr.prototype=new Jf,Zf={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},Lo=function(){var l=new Jr,d,h,p,m,v,D,P;Lo.prototype.init.call(this),d=this,this.push=function(N){N.type==="video"&&(h=N.trackId,p=N.pts,m=N.dts,l.push(N))},l.on("data",function(N){var q={trackId:h,pts:p,dts:m,data:N,nalUnitTypeCode:N[0]&31};switch(q.nalUnitTypeCode){case 5:q.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:q.nalUnitType="sei_rbsp",q.escapedRBSP=v(N.subarray(1));break;case 7:q.nalUnitType="seq_parameter_set_rbsp",q.escapedRBSP=v(N.subarray(1)),q.config=D(q.escapedRBSP);break;case 8:q.nalUnitType="pic_parameter_set_rbsp";break;case 9:q.nalUnitType="access_unit_delimiter_rbsp";break}d.trigger("data",q)}),l.on("done",function(){d.trigger("done")}),l.on("partialdone",function(){d.trigger("partialdone")}),l.on("reset",function(){d.trigger("reset")}),l.on("endedtimeline",function(){d.trigger("endedtimeline")}),this.flush=function(){l.flush()},this.partialFlush=function(){l.partialFlush()},this.reset=function(){l.reset()},this.endTimeline=function(){l.endTimeline()},P=function(N,q){var K=8,ae=8,xe,de;for(xe=0;xe>4;return h=h>=0?h:0,m?h+20:h+10},tp=function(l,d){return l.length-d<10||l[d]!==73||l[d+1]!==68||l[d+2]!==51?d:(d+=ep(l,d),tp(l,d))},C2=function(l){var d=tp(l,0);return l.length>=d+2&&(l[d]&255)===255&&(l[d+1]&240)===240&&(l[d+1]&22)===16},ip=function(l){return l[0]<<21|l[1]<<14|l[2]<<7|l[3]},w2=function(l,d,h){var p,m="";for(p=d;p>5,p=l[d+4]<<3,m=l[d+3]&6144;return m|p|h},k2=function(l,d){return l[d]===73&&l[d+1]===68&&l[d+2]===51?"timed-metadata":l[d]&!0&&(l[d+1]&240)===240?"audio":null},I2=function(l){for(var d=0;d+5>>2]}return null},P2=function(l){var d,h,p,m;d=10,l[5]&64&&(d+=4,d+=ip(l.subarray(10,14)));do{if(h=ip(l.subarray(d+4,d+8)),h<1)return null;if(m=String.fromCharCode(l[d],l[d+1],l[d+2],l[d+3]),m==="PRIV"){p=l.subarray(d+10,d+h+10);for(var v=0;v>>2;return N*=4,N+=P[7]&3,N}break}}d+=10,d+=h}while(d=3;){if(l[m]===73&&l[m+1]===68&&l[m+2]===51){if(l.length-m<10||(p=np.parseId3TagSize(l,m),m+p>l.length))break;D={type:"timed-metadata",data:l.subarray(m,m+p)},this.trigger("data",D),m+=p;continue}else if((l[m]&255)===255&&(l[m+1]&240)===240){if(l.length-m<7||(p=np.parseAdtsSize(l,m),m+p>l.length))break;P={type:"audio",data:l.subarray(m,m+p),pts:d,dts:d},this.trigger("data",P),m+=p;continue}m++}v=l.length-m,v>0?l=l.subarray(m):l=new Uint8Array},this.reset=function(){l=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){l=new Uint8Array,this.trigger("endedtimeline")}},Ro.prototype=new O2;var L2=Ro,R2=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],M2=R2,N2=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],B2=N2,Mo=i,Zr=te,ea=ce,No=So,$i=Te,_n=y2,Bo=He,sp=b2,F2=S2.H264Stream,U2=L2,q2=sc.isLikelyAacData,$2=He.ONE_SECOND_IN_TS,rc=M2,ac=B2,ta,Gs,Fo,gs,j2=function(l,d){d.stream=l,this.trigger("log",d)},rp=function(l,d){for(var h=Object.keys(d),p=0;p=-q&&ae<=N&&(!xe||K>ae)&&(xe=Oe,K=ae)));return xe?xe.gop:null},this.alignGopsAtStart_=function(P){var N,q,K,ae,xe,de,Oe,Ue;for(xe=P.byteLength,de=P.nalCount,Oe=P.duration,N=q=0;NK.pts){N++;continue}q++,xe-=ae.byteLength,de-=ae.nalCount,Oe-=ae.duration}return q===0?P:q===P.length?null:(Ue=P.slice(q),Ue.byteLength=xe,Ue.duration=Oe,Ue.nalCount=de,Ue.pts=Ue[0].pts,Ue.dts=Ue[0].dts,Ue)},this.alignGopsAtEnd_=function(P){var N,q,K,ae,xe,de;for(N=m.length-1,q=P.length-1,xe=null,de=!1;N>=0&&q>=0;){if(K=m[N],ae=P[q],K.pts===ae.pts){de=!0;break}if(K.pts>ae.pts){N--;continue}N===m.length-1&&(xe=q),q--}if(!de&&xe===null)return null;var Oe;if(de?Oe=q:Oe=xe,Oe===0)return P;var Ue=P.slice(Oe),Pt=Ue.reduce(function(di,Un){return di.byteLength+=Un.byteLength,di.duration+=Un.duration,di.nalCount+=Un.nalCount,di},{byteLength:0,duration:0,nalCount:0});return Ue.byteLength=Pt.byteLength,Ue.duration=Pt.duration,Ue.nalCount=Pt.nalCount,Ue.pts=Ue[0].pts,Ue.dts=Ue[0].dts,Ue},this.alignGopsWith=function(P){m=P}},ta.prototype=new Mo,gs=function(l,d){this.numberOfTracks=0,this.metadataStream=d,l=l||{},typeof l.remux<"u"?this.remuxTracks=!!l.remux:this.remuxTracks=!0,typeof l.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=l.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,gs.prototype.init.call(this),this.push=function(h){if(h.content||h.text)return this.pendingCaptions.push(h);if(h.frames)return this.pendingMetadata.push(h);this.pendingTracks.push(h.track),this.pendingBytes+=h.boxes.byteLength,h.track.type==="video"&&(this.videoTrack=h.track,this.pendingBoxes.push(h.boxes)),h.track.type==="audio"&&(this.audioTrack=h.track,this.pendingBoxes.unshift(h.boxes))}},gs.prototype=new Mo,gs.prototype.flush=function(l){var d=0,h={captions:[],captionStreams:{},metadata:[],info:{}},p,m,v,D=0,P;if(this.pendingTracks.length=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);return}}if(this.videoTrack?(D=this.videoTrack.timelineStartInfo.pts,ac.forEach(function(N){h.info[N]=this.videoTrack[N]},this)):this.audioTrack&&(D=this.audioTrack.timelineStartInfo.pts,rc.forEach(function(N){h.info[N]=this.audioTrack[N]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?h.type=this.pendingTracks[0].type:h.type="combined",this.emittedTracks+=this.pendingTracks.length,v=Zr.initSegment(this.pendingTracks),h.initSegment=new Uint8Array(v.byteLength),h.initSegment.set(v),h.data=new Uint8Array(this.pendingBytes),P=0;P=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},gs.prototype.setRemux=function(l){this.remuxTracks=l},Fo=function(l){var d=this,h=!0,p,m;Fo.prototype.init.call(this),l=l||{},this.baseMediaDecodeTime=l.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var v={};this.transmuxPipeline_=v,v.type="aac",v.metadataStream=new _n.MetadataStream,v.aacStream=new U2,v.audioTimestampRolloverStream=new _n.TimestampRolloverStream("audio"),v.timedMetadataTimestampRolloverStream=new _n.TimestampRolloverStream("timed-metadata"),v.adtsStream=new sp,v.coalesceStream=new gs(l,v.metadataStream),v.headOfPipeline=v.aacStream,v.aacStream.pipe(v.audioTimestampRolloverStream).pipe(v.adtsStream),v.aacStream.pipe(v.timedMetadataTimestampRolloverStream).pipe(v.metadataStream).pipe(v.coalesceStream),v.metadataStream.on("timestamp",function(D){v.aacStream.setTimestamp(D.timeStamp)}),v.aacStream.on("data",function(D){D.type!=="timed-metadata"&&D.type!=="audio"||v.audioSegmentStream||(m=m||{timelineStartInfo:{baseMediaDecodeTime:d.baseMediaDecodeTime},codec:"adts",type:"audio"},v.coalesceStream.numberOfTracks++,v.audioSegmentStream=new Gs(m,l),v.audioSegmentStream.on("log",d.getLogTrigger_("audioSegmentStream")),v.audioSegmentStream.on("timingInfo",d.trigger.bind(d,"audioTimingInfo")),v.adtsStream.pipe(v.audioSegmentStream).pipe(v.coalesceStream),d.trigger("trackinfo",{hasAudio:!!m,hasVideo:!!p}))}),v.coalesceStream.on("data",this.trigger.bind(this,"data")),v.coalesceStream.on("done",this.trigger.bind(this,"done")),rp(this,v)},this.setupTsPipeline=function(){var v={};this.transmuxPipeline_=v,v.type="ts",v.metadataStream=new _n.MetadataStream,v.packetStream=new _n.TransportPacketStream,v.parseStream=new _n.TransportParseStream,v.elementaryStream=new _n.ElementaryStream,v.timestampRolloverStream=new _n.TimestampRolloverStream,v.adtsStream=new sp,v.h264Stream=new F2,v.captionStream=new _n.CaptionStream(l),v.coalesceStream=new gs(l,v.metadataStream),v.headOfPipeline=v.packetStream,v.packetStream.pipe(v.parseStream).pipe(v.elementaryStream).pipe(v.timestampRolloverStream),v.timestampRolloverStream.pipe(v.h264Stream),v.timestampRolloverStream.pipe(v.adtsStream),v.timestampRolloverStream.pipe(v.metadataStream).pipe(v.coalesceStream),v.h264Stream.pipe(v.captionStream).pipe(v.coalesceStream),v.elementaryStream.on("data",function(D){var P;if(D.type==="metadata"){for(P=D.tracks.length;P--;)!p&&D.tracks[P].type==="video"?(p=D.tracks[P],p.timelineStartInfo.baseMediaDecodeTime=d.baseMediaDecodeTime):!m&&D.tracks[P].type==="audio"&&(m=D.tracks[P],m.timelineStartInfo.baseMediaDecodeTime=d.baseMediaDecodeTime);p&&!v.videoSegmentStream&&(v.coalesceStream.numberOfTracks++,v.videoSegmentStream=new ta(p,l),v.videoSegmentStream.on("log",d.getLogTrigger_("videoSegmentStream")),v.videoSegmentStream.on("timelineStartInfo",function(N){m&&!l.keepOriginalTimestamps&&(m.timelineStartInfo=N,v.audioSegmentStream.setEarliestDts(N.dts-d.baseMediaDecodeTime))}),v.videoSegmentStream.on("processedGopsInfo",d.trigger.bind(d,"gopInfo")),v.videoSegmentStream.on("segmentTimingInfo",d.trigger.bind(d,"videoSegmentTimingInfo")),v.videoSegmentStream.on("baseMediaDecodeTime",function(N){m&&v.audioSegmentStream.setVideoBaseMediaDecodeTime(N)}),v.videoSegmentStream.on("timingInfo",d.trigger.bind(d,"videoTimingInfo")),v.h264Stream.pipe(v.videoSegmentStream).pipe(v.coalesceStream)),m&&!v.audioSegmentStream&&(v.coalesceStream.numberOfTracks++,v.audioSegmentStream=new Gs(m,l),v.audioSegmentStream.on("log",d.getLogTrigger_("audioSegmentStream")),v.audioSegmentStream.on("timingInfo",d.trigger.bind(d,"audioTimingInfo")),v.audioSegmentStream.on("segmentTimingInfo",d.trigger.bind(d,"audioSegmentTimingInfo")),v.adtsStream.pipe(v.audioSegmentStream).pipe(v.coalesceStream)),d.trigger("trackinfo",{hasAudio:!!m,hasVideo:!!p})}}),v.coalesceStream.on("data",this.trigger.bind(this,"data")),v.coalesceStream.on("id3Frame",function(D){D.dispatchType=v.metadataStream.dispatchType,d.trigger("id3Frame",D)}),v.coalesceStream.on("caption",this.trigger.bind(this,"caption")),v.coalesceStream.on("done",this.trigger.bind(this,"done")),rp(this,v)},this.setBaseMediaDecodeTime=function(v){var D=this.transmuxPipeline_;l.keepOriginalTimestamps||(this.baseMediaDecodeTime=v),m&&(m.timelineStartInfo.dts=void 0,m.timelineStartInfo.pts=void 0,$i.clearDtsInfo(m),D.audioTimestampRolloverStream&&D.audioTimestampRolloverStream.discontinuity()),p&&(D.videoSegmentStream&&(D.videoSegmentStream.gopCache_=[]),p.timelineStartInfo.dts=void 0,p.timelineStartInfo.pts=void 0,$i.clearDtsInfo(p),D.captionStream.reset()),D.timestampRolloverStream&&D.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(v){m&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(v)},this.setRemux=function(v){var D=this.transmuxPipeline_;l.remux=v,D&&D.coalesceStream&&D.coalesceStream.setRemux(v)},this.alignGopsWith=function(v){p&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(v)},this.getLogTrigger_=function(v){var D=this;return function(P){P.stream=v,D.trigger("log",P)}},this.push=function(v){if(h){var D=q2(v);D&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!D&&this.transmuxPipeline_.type!=="ts"&&this.setupTsPipeline(),h=!1}this.transmuxPipeline_.headOfPipeline.push(v)},this.flush=function(){h=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},Fo.prototype=new Mo;var V2={Transmuxer:Fo,VideoSegmentStream:ta,AudioSegmentStream:Gs,AUDIO_PROPERTIES:rc,VIDEO_PROPERTIES:ac,generateSegmentTimingInfo:oc},H2=function(l){return l>>>0},z2=function(l){return("00"+l.toString(16)).slice(-2)},Uo={toUnsigned:H2,toHexString:z2},W2=function(l){var d="";return d+=String.fromCharCode(l[0]),d+=String.fromCharCode(l[1]),d+=String.fromCharCode(l[2]),d+=String.fromCharCode(l[3]),d},lc=W2,G2=Uo.toUnsigned,K2=lc,op=function(l,d){var h=[],p,m,v,D,P;if(!d.length)return null;for(p=0;p1?p+m:l.byteLength,v===d[0]&&(d.length===1?h.push(l.subarray(p+8,D)):(P=op(l.subarray(p+8,D),d.slice(1)),P.length&&(h=h.concat(P)))),p=D;return h},qo=op,X2=Uo.toUnsigned,Y2=r.getUint64,Q2=function(l){var d={version:l[0],flags:new Uint8Array(l.subarray(1,4))};return d.version===1?d.baseMediaDecodeTime=Y2(l.subarray(4)):d.baseMediaDecodeTime=X2(l[4]<<24|l[5]<<16|l[6]<<8|l[7]),d},uc=Q2,J2=function(l){var d=new DataView(l.buffer,l.byteOffset,l.byteLength),h={version:l[0],flags:new Uint8Array(l.subarray(1,4)),trackId:d.getUint32(4)},p=h.flags[2]&1,m=h.flags[2]&2,v=h.flags[2]&8,D=h.flags[2]&16,P=h.flags[2]&32,N=h.flags[0]&65536,q=h.flags[0]&131072,K;return K=8,p&&(K+=4,h.baseDataOffset=d.getUint32(12),K+=4),m&&(h.sampleDescriptionIndex=d.getUint32(K),K+=4),v&&(h.defaultSampleDuration=d.getUint32(K),K+=4),D&&(h.defaultSampleSize=d.getUint32(K),K+=4),P&&(h.defaultSampleFlags=d.getUint32(K)),N&&(h.durationIsEmpty=!0),!p&&q&&(h.baseDataOffsetIsMoof=!0),h},cc=J2,lp=r.getUint64,Z2=function(l){var d=new DataView(l.buffer,l.byteOffset,l.byteLength),h={version:l[0],flags:new Uint8Array(l.subarray(1,4)),references:[],referenceId:d.getUint32(4),timescale:d.getUint32(8)},p=12;h.version===0?(h.earliestPresentationTime=d.getUint32(p),h.firstOffset=d.getUint32(p+4),p+=8):(h.earliestPresentationTime=lp(l.subarray(p)),h.firstOffset=lp(l.subarray(p+8)),p+=16),p+=2;var m=d.getUint16(p);for(p+=2;m>0;p+=12,m--)h.references.push({referenceType:(l[p]&128)>>>7,referencedSize:d.getUint32(p)&2147483647,subsegmentDuration:d.getUint32(p+4),startsWithSap:!!(l[p+8]&128),sapType:(l[p+8]&112)>>>4,sapDeltaTime:d.getUint32(p+8)&268435455});return h},e1=Z2,t1=function(l){return{isLeading:(l[0]&12)>>>2,dependsOn:l[0]&3,isDependedOn:(l[1]&192)>>>6,hasRedundancy:(l[1]&48)>>>4,paddingValue:(l[1]&14)>>>1,isNonSyncSample:l[1]&1,degradationPriority:l[2]<<8|l[3]}},i1=t1,up=i1,n1=function(l){var d={version:l[0],flags:new Uint8Array(l.subarray(1,4)),samples:[]},h=new DataView(l.buffer,l.byteOffset,l.byteLength),p=d.flags[2]&1,m=d.flags[2]&4,v=d.flags[1]&1,D=d.flags[1]&2,P=d.flags[1]&4,N=d.flags[1]&8,q=h.getUint32(4),K=8,ae;for(p&&(d.dataOffset=h.getInt32(K),K+=4),m&&q&&(ae={flags:up(l.subarray(K,K+4))},K+=4,v&&(ae.duration=h.getUint32(K),K+=4),D&&(ae.size=h.getUint32(K),K+=4),N&&(d.version===1?ae.compositionTimeOffset=h.getInt32(K):ae.compositionTimeOffset=h.getUint32(K),K+=4),d.samples.push(ae),q--);q--;)ae={},v&&(ae.duration=h.getUint32(K),K+=4),D&&(ae.size=h.getUint32(K),K+=4),P&&(ae.flags=up(l.subarray(K,K+4)),K+=4),N&&(d.version===1?ae.compositionTimeOffset=h.getInt32(K):ae.compositionTimeOffset=h.getUint32(K),K+=4),d.samples.push(ae);return d},cp=n1,s1=r,dp=s1.getUint64,$t,dc,Si=function(l){return new Date(l*1e3-20828448e5)},ia=lc,r1=qo,a1=function(l){var d=new DataView(l.buffer,l.byteOffset,l.byteLength),h=[],p,m;for(p=0;p+4MALFORMED DATA");continue}switch(l[p]&31){case 1:h.push("slice_layer_without_partitioning_rbsp");break;case 5:h.push("slice_layer_without_partitioning_rbsp_idr");break;case 6:h.push("sei_rbsp");break;case 7:h.push("seq_parameter_set_rbsp");break;case 8:h.push("pic_parameter_set_rbsp");break;case 9:h.push("access_unit_delimiter_rbsp");break;default:h.push("UNKNOWN NAL - "+l[p]&31);break}}return h},Bn={avc1:function(l){var d=new DataView(l.buffer,l.byteOffset,l.byteLength);return{dataReferenceIndex:d.getUint16(6),width:d.getUint16(24),height:d.getUint16(26),horizresolution:d.getUint16(28)+d.getUint16(30)/16,vertresolution:d.getUint16(32)+d.getUint16(34)/16,frameCount:d.getUint16(40),depth:d.getUint16(74),config:$t(l.subarray(78,l.byteLength))}},avcC:function(l){var d=new DataView(l.buffer,l.byteOffset,l.byteLength),h={configurationVersion:l[0],avcProfileIndication:l[1],profileCompatibility:l[2],avcLevelIndication:l[3],lengthSizeMinusOne:l[4]&3,sps:[],pps:[]},p=l[5]&31,m,v,D,P;for(D=6,P=0;P>>2&63,bufferSize:l[13]<<16|l[14]<<8|l[15],maxBitrate:l[16]<<24|l[17]<<16|l[18]<<8|l[19],avgBitrate:l[20]<<24|l[21]<<16|l[22]<<8|l[23],decoderConfigDescriptor:{tag:l[24],length:l[25],audioObjectType:l[26]>>>3&31,samplingFrequencyIndex:(l[26]&7)<<1|l[27]>>>7&1,channelConfiguration:l[27]>>>3&15}}}},ftyp:function(l){for(var d=new DataView(l.buffer,l.byteOffset,l.byteLength),h={majorBrand:ia(l.subarray(0,4)),minorVersion:d.getUint32(4),compatibleBrands:[]},p=8;p>10)+96),m.language+=String.fromCharCode(((p&992)>>5)+96),m.language+=String.fromCharCode((p&31)+96),m},mdia:function(l){return{boxes:$t(l)}},mfhd:function(l){return{version:l[0],flags:new Uint8Array(l.subarray(1,4)),sequenceNumber:l[4]<<24|l[5]<<16|l[6]<<8|l[7]}},minf:function(l){return{boxes:$t(l)}},mp4a:function(l){var d=new DataView(l.buffer,l.byteOffset,l.byteLength),h={dataReferenceIndex:d.getUint16(6),channelcount:d.getUint16(16),samplesize:d.getUint16(18),samplerate:d.getUint16(24)+d.getUint16(26)/65536};return l.byteLength>28&&(h.streamDescriptor=$t(l.subarray(28))[0]),h},moof:function(l){return{boxes:$t(l)}},moov:function(l){return{boxes:$t(l)}},mvex:function(l){return{boxes:$t(l)}},mvhd:function(l){var d=new DataView(l.buffer,l.byteOffset,l.byteLength),h=4,p={version:d.getUint8(0),flags:new Uint8Array(l.subarray(1,4))};return p.version===1?(h+=4,p.creationTime=Si(d.getUint32(h)),h+=8,p.modificationTime=Si(d.getUint32(h)),h+=4,p.timescale=d.getUint32(h),h+=8,p.duration=d.getUint32(h)):(p.creationTime=Si(d.getUint32(h)),h+=4,p.modificationTime=Si(d.getUint32(h)),h+=4,p.timescale=d.getUint32(h),h+=4,p.duration=d.getUint32(h)),h+=4,p.rate=d.getUint16(h)+d.getUint16(h+2)/16,h+=4,p.volume=d.getUint8(h)+d.getUint8(h+1)/8,h+=2,h+=2,h+=2*4,p.matrix=new Uint32Array(l.subarray(h,h+9*4)),h+=9*4,h+=6*4,p.nextTrackId=d.getUint32(h),p},pdin:function(l){var d=new DataView(l.buffer,l.byteOffset,l.byteLength);return{version:d.getUint8(0),flags:new Uint8Array(l.subarray(1,4)),rate:d.getUint32(4),initialDelay:d.getUint32(8)}},sdtp:function(l){var d={version:l[0],flags:new Uint8Array(l.subarray(1,4)),samples:[]},h;for(h=4;h>4,isDependedOn:(l[h]&12)>>2,hasRedundancy:l[h]&3});return d},sidx:e1,smhd:function(l){return{version:l[0],flags:new Uint8Array(l.subarray(1,4)),balance:l[4]+l[5]/256}},stbl:function(l){return{boxes:$t(l)}},ctts:function(l){var d=new DataView(l.buffer,l.byteOffset,l.byteLength),h={version:d.getUint8(0),flags:new Uint8Array(l.subarray(1,4)),compositionOffsets:[]},p=d.getUint32(4),m;for(m=8;p;m+=8,p--)h.compositionOffsets.push({sampleCount:d.getUint32(m),sampleOffset:d[h.version===0?"getUint32":"getInt32"](m+4)});return h},stss:function(l){var d=new DataView(l.buffer,l.byteOffset,l.byteLength),h={version:d.getUint8(0),flags:new Uint8Array(l.subarray(1,4)),syncSamples:[]},p=d.getUint32(4),m;for(m=8;p;m+=4,p--)h.syncSamples.push(d.getUint32(m));return h},stco:function(l){var d=new DataView(l.buffer,l.byteOffset,l.byteLength),h={version:l[0],flags:new Uint8Array(l.subarray(1,4)),chunkOffsets:[]},p=d.getUint32(4),m;for(m=8;p;m+=4,p--)h.chunkOffsets.push(d.getUint32(m));return h},stsc:function(l){var d=new DataView(l.buffer,l.byteOffset,l.byteLength),h=d.getUint32(4),p={version:l[0],flags:new Uint8Array(l.subarray(1,4)),sampleToChunks:[]},m;for(m=8;h;m+=12,h--)p.sampleToChunks.push({firstChunk:d.getUint32(m),samplesPerChunk:d.getUint32(m+4),sampleDescriptionIndex:d.getUint32(m+8)});return p},stsd:function(l){return{version:l[0],flags:new Uint8Array(l.subarray(1,4)),sampleDescriptions:$t(l.subarray(8))}},stsz:function(l){var d=new DataView(l.buffer,l.byteOffset,l.byteLength),h={version:l[0],flags:new Uint8Array(l.subarray(1,4)),sampleSize:d.getUint32(4),entries:[]},p;for(p=12;p>6,sampleHasRedundancy:(l[21]&48)>>4,samplePaddingValue:(l[21]&14)>>1,sampleIsDifferenceSample:!!(l[21]&1),sampleDegradationPriority:d.getUint16(22)}},trun:cp,"url ":function(l){return{version:l[0],flags:new Uint8Array(l.subarray(1,4))}},vmhd:function(l){var d=new DataView(l.buffer,l.byteOffset,l.byteLength);return{version:l[0],flags:new Uint8Array(l.subarray(1,4)),graphicsmode:d.getUint16(4),opcolor:new Uint16Array([d.getUint16(6),d.getUint16(8),d.getUint16(10)])}}};$t=function(l){for(var d=0,h=[],p,m,v,D,P,N=new ArrayBuffer(l.length),q=new Uint8Array(N),K=0;K1?d+m:l.byteLength,P=(Bn[v]||function(ae){return{data:ae}})(l.subarray(d+8,D)),P.size=m,P.type=v,h.push(P),d=D;return h},dc=function(l,d){var h;return d=d||0,h=new Array(d*2+1).join(" "),l.map(function(p,m){return h+p.type+` `+Object.keys(p).filter(function(v){return v!=="type"&&v!=="boxes"}).map(function(v){var D=h+" "+v+": ",P=p[v];if(P instanceof Uint8Array||P instanceof Uint32Array){var N=Array.prototype.slice.call(new Uint8Array(P.buffer,P.byteOffset,P.byteLength)).map(function(q){return" "+("00"+q.toString(16)).slice(-2)}).join("").match(/.{1,24}/g);return N?N.length===1?D+"<"+N.join("").slice(1)+">":D+`< `+N.map(function(q){return h+" "+q}).join(` `)+` `+h+" >":D+"<>"}return D+JSON.stringify(P,null,2).split(` `).map(function(q,K){return K===0?q:h+" "+q}).join(` `)}).join(` `)+(p.boxes?` `+dc(p.boxes,d+1):"")}).join(` `)};var hp={inspect:$t,textify:dc,parseType:ia,findBox:r1,parseTraf:Bn.traf,parseTfdt:Bn.tfdt,parseHdlr:Bn.hdlr,parseTfhd:Bn.tfhd,parseTrun:Bn.trun,parseSidx:Bn.sidx},o1=function(l){for(var d=0,h=String.fromCharCode(l[d]),p="";h!=="\0";)p+=h,d++,h=String.fromCharCode(l[d]);return p+=h,p},l1={uint8ToCString:o1},$o=l1.uint8ToCString,u1=r.getUint64,c1=function(l){var d=4,h=l[0],p,m,v,D,P,N,q,K;if(h===0){p=$o(l.subarray(d)),d+=p.length,m=$o(l.subarray(d)),d+=m.length;var ae=new DataView(l.buffer);v=ae.getUint32(d),d+=4,P=ae.getUint32(d),d+=4,N=ae.getUint32(d),d+=4,q=ae.getUint32(d),d+=4}else if(h===1){var ae=new DataView(l.buffer);v=ae.getUint32(d),d+=4,D=u1(l.subarray(d)),d+=8,N=ae.getUint32(d),d+=4,q=ae.getUint32(d),d+=4,p=$o(l.subarray(d)),d+=p.length,m=$o(l.subarray(d)),d+=m.length}K=new Uint8Array(l.subarray(d,l.byteLength));var xe={scheme_id_uri:p,value:m,timescale:v||1,presentation_time:D,presentation_time_delta:P,event_duration:N,id:q,message_data:K};return h1(h,xe)?xe:void 0},d1=function(l,d,h,p){return l||l===0?l/d:p+h/d},h1=function(l,d){var h=d.scheme_id_uri!=="\0",p=l===0&&fp(d.presentation_time_delta)&&h,m=l===1&&fp(d.presentation_time)&&h;return!(l>1)&&p||m},fp=function(l){return l!==void 0||l!==null},f1={parseEmsgBox:c1,scaleTime:d1},na;typeof window<"u"?na=window:typeof t<"u"?na=t:typeof self<"u"?na=self:na={};var pp=na,jo=Uo.toUnsigned,sa=Uo.toHexString,Tt=qo,Ks=lc,hc=f1,p1=cc,g1=cp,m1=uc,y1=r.getUint64,gp,mp,yp,_p,vp,fc,bp,pc=pp,_1=Kf.parseId3Frames;gp=function(l){var d={},h=Tt(l,["moov","trak"]);return h.reduce(function(p,m){var v,D,P,N,q;return v=Tt(m,["tkhd"])[0],!v||(D=v[0],P=D===0?12:20,N=jo(v[P]<<24|v[P+1]<<16|v[P+2]<<8|v[P+3]),q=Tt(m,["mdia","mdhd"])[0],!q)?null:(D=q[0],P=D===0?12:20,p[N]=jo(q[P]<<24|q[P+1]<<16|q[P+2]<<8|q[P+3]),p)},d)},mp=function(l,d){var h;h=Tt(d,["moof","traf"]);var p=h.reduce(function(m,v){var D=Tt(v,["tfhd"])[0],P=jo(D[4]<<24|D[5]<<16|D[6]<<8|D[7]),N=l[P]||9e4,q=Tt(v,["tfdt"])[0],K=new DataView(q.buffer,q.byteOffset,q.byteLength),ae;q[0]===1?ae=y1(q.subarray(4,12)):ae=K.getUint32(4);let xe;return typeof ae=="bigint"?xe=ae/pc.BigInt(N):typeof ae=="number"&&!isNaN(ae)&&(xe=ae/N),xe11?(m.codec+=".",m.codec+=sa(de[9]),m.codec+=sa(de[10]),m.codec+=sa(de[11])):m.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(m.codec)?(de=xe.subarray(28),Oe=Ks(de.subarray(4,8)),Oe==="esds"&&de.length>20&&de[19]!==0?(m.codec+="."+sa(de[19]),m.codec+="."+sa(de[20]>>>2&63).replace(/^0/,"")):m.codec="mp4a.40.2"):m.codec=m.codec.toLowerCase())}var Ue=Tt(p,["mdia","mdhd"])[0];Ue&&(m.timescale=fc(Ue)),h.push(m)}),h},bp=function(l,d=0){var h=Tt(l,["emsg"]);return h.map(p=>{var m=hc.parseEmsgBox(new Uint8Array(p)),v=_1(m.message_data);return{cueTime:hc.scaleTime(m.presentation_time,m.timescale,m.presentation_time_delta,d),duration:hc.scaleTime(m.event_duration,m.timescale),frames:v}})};var ra={findBox:Tt,parseType:Ks,timescale:gp,startTime:mp,compositionStartTime:yp,videoTrackIds:_p,tracks:vp,getTimescaleFromMediaHeader:fc,getEmsgID3:bp};const{parseTrun:v1}=hp,{findBox:Tp}=ra;var xp=pp,b1=function(l){var d=Tp(l,["moof","traf"]),h=Tp(l,["mdat"]),p=[];return h.forEach(function(m,v){var D=d[v];p.push({mdat:m,traf:D})}),p},T1=function(l,d,h){var p=d,m=h.defaultSampleDuration||0,v=h.defaultSampleSize||0,D=h.trackId,P=[];return l.forEach(function(N){var q=v1(N),K=q.samples;K.forEach(function(ae){ae.duration===void 0&&(ae.duration=m),ae.size===void 0&&(ae.size=v),ae.trackId=D,ae.dts=p,ae.compositionTimeOffset===void 0&&(ae.compositionTimeOffset=0),typeof p=="bigint"?(ae.pts=p+xp.BigInt(ae.compositionTimeOffset),p+=xp.BigInt(ae.duration)):(ae.pts=p+ae.compositionTimeOffset,p+=ae.duration)}),P=P.concat(K)}),P},Sp={getMdatTrafPairs:b1,parseSamples:T1},x1=Qi.discardEmulationPreventionBytes,S1=Hf.CaptionStream,gc=qo,E1=uc,C1=cc,{getMdatTrafPairs:w1,parseSamples:A1}=Sp,D1=function(l,d){for(var h=l,p=0;p0?E1(K[0]).baseMediaDecodeTime:0,xe=gc(D,["trun"]),de,Oe;d===q&&xe.length>0&&(de=A1(xe,ae,N),Oe=k1(v,de,q),h[q]||(h[q]={seiNals:[],logs:[]}),h[q].seiNals=h[q].seiNals.concat(Oe.seiNals),h[q].logs=h[q].logs.concat(Oe.logs))}),h},P1=function(l,d,h){var p;if(d===null)return null;p=I1(l,d);var m=p[d]||{};return{seiNals:m.seiNals,logs:m.logs,timescale:h}},O1=function(){var l=!1,d,h,p,m,v,D;this.isInitialized=function(){return l},this.init=function(P){d=new S1,l=!0,D=P?P.isPartial:!1,d.on("data",function(N){N.startTime=N.startPts/m,N.endTime=N.endPts/m,v.captions.push(N),v.captionStreams[N.stream]=!0}),d.on("log",function(N){v.logs.push(N)})},this.isNewInit=function(P,N){return P&&P.length===0||N&&typeof N=="object"&&Object.keys(N).length===0?!1:p!==P[0]||m!==N[p]},this.parse=function(P,N,q){var K;if(this.isInitialized()){if(!N||!q)return null;if(this.isNewInit(N,q))p=N[0],m=q[p];else if(p===null||!m)return h.push(P),null}else return null;for(;h.length>0;){var ae=h.shift();this.parse(ae,N,q)}return K=P1(P,p,m),K&&K.logs&&(v.logs=v.logs.concat(K.logs)),K===null||!K.seiNals?v.logs.length?{logs:v.logs,captions:[],captionStreams:[]}:null:(this.pushNals(K.seiNals),this.flushStream(),v)},this.pushNals=function(P){if(!this.isInitialized()||!P||P.length===0)return null;P.forEach(function(N){d.push(N)})},this.flushStream=function(){if(!this.isInitialized())return null;D?d.partialFlush():d.flush()},this.clearParsedCaptions=function(){v.captions=[],v.captionStreams={},v.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;d.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){h=[],p=null,m=null,v?this.clearParsedCaptions():v={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},L1=O1;const{parseTfdt:R1}=hp,Fn=qo,{getTimescaleFromMediaHeader:M1}=ra,{parseSamples:N1,getMdatTrafPairs:B1}=Sp;var Ep=function(){let l=9e4;this.init=function(d){const h=Fn(d,["moov","trak","mdia","mdhd"])[0];h&&(l=M1(h))},this.parseSegment=function(d){const h=[],p=B1(d);let m=0;return p.forEach(function(v){const D=v.mdat,P=v.traf,N=Fn(P,["tfdt"])[0],q=Fn(P,["tfhd"])[0],K=Fn(P,["trun"]);if(N&&(m=R1(N).baseMediaDecodeTime),K.length&&q){const ae=N1(K,m,q);let xe=0;ae.forEach(function(de){const Oe="utf-8",Ue=new TextDecoder(Oe),Pt=D.slice(xe,xe+de.size);if(Fn(Pt,["vtte"])[0]){xe+=de.size;return}Fn(Pt,["vttc"]).forEach(function(aa){const oa=Fn(aa,["payl"])[0],la=Fn(aa,["sttg"])[0],ua=de.pts/l,zo=(de.pts+de.duration)/l;let lt,ca;if(oa)try{lt=Ue.decode(oa)}catch(ji){console.error(ji)}if(la)try{ca=Ue.decode(la)}catch(ji){console.error(ji)}de.duration&<&&h.push({cueText:lt,start:ua,end:zo,settings:ca})}),xe+=de.size})}}),h}},mc=wo,Cp=function(l){var d=l[1]&31;return d<<=8,d|=l[2],d},Vo=function(l){return!!(l[1]&64)},Ho=function(l){var d=0;return(l[3]&48)>>>4>1&&(d+=l[4]+1),d},F1=function(l,d){var h=Cp(l);return h===0?"pat":h===d?"pmt":d?"pes":null},U1=function(l){var d=Vo(l),h=4+Ho(l);return d&&(h+=l[h]+1),(l[h+10]&31)<<8|l[h+11]},q1=function(l){var d={},h=Vo(l),p=4+Ho(l);if(h&&(p+=l[p]+1),!!(l[p+5]&1)){var m,v,D;m=(l[p+1]&15)<<8|l[p+2],v=3+m-4,D=(l[p+10]&15)<<8|l[p+11];for(var P=12+D;P=l.byteLength)return null;var p=null,m;return m=l[h+7],m&192&&(p={},p.pts=(l[h+9]&14)<<27|(l[h+10]&255)<<20|(l[h+11]&254)<<12|(l[h+12]&255)<<5|(l[h+13]&254)>>>3,p.pts*=4,p.pts+=(l[h+13]&6)>>>1,p.dts=p.pts,m&64&&(p.dts=(l[h+14]&14)<<27|(l[h+15]&255)<<20|(l[h+16]&254)<<12|(l[h+17]&255)<<5|(l[h+18]&254)>>>3,p.dts*=4,p.dts+=(l[h+18]&6)>>>1)),p},yc=function(l){switch(l){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},V1=function(l){for(var d=4+Ho(l),h=l.subarray(d),p=0,m=0,v=!1,D;m3&&(D=yc(h[m+3]&31),D==="slice_layer_without_partitioning_rbsp_idr"&&(v=!0)),v},H1={parseType:F1,parsePat:U1,parsePmt:q1,parsePayloadUnitStartIndicator:Vo,parsePesType:$1,parsePesTime:j1,videoPacketContainsKeyFrame:V1},wp=wo,Xs=Wf.handleRollover,et={};et.ts=H1,et.aac=sc;var ms=He.ONE_SECOND_IN_TS,Qt=188,Ji=71,z1=function(l,d){for(var h=0,p=Qt,m,v;p=0;){if(l[p]===Ji&&(l[m]===Ji||m===l.byteLength)){switch(v=l.subarray(p,m),D=et.ts.parseType(v,d.pid),D){case"pes":P=et.ts.parsePesType(v,d.table),N=et.ts.parsePayloadUnitStartIndicator(v),P==="audio"&&N&&(q=et.ts.parsePesTime(v),q&&(q.type="audio",h.audio.push(q),K=!0));break}if(K)break;p-=Qt,m-=Qt;continue}p--,m--}},W1=function(l,d,h){for(var p=0,m=Qt,v,D,P,N,q,K,ae,xe,de=!1,Oe={data:[],size:0};m=0;){if(l[p]===Ji&&l[m]===Ji){switch(v=l.subarray(p,m),D=et.ts.parseType(v,d.pid),D){case"pes":P=et.ts.parsePesType(v,d.table),N=et.ts.parsePayloadUnitStartIndicator(v),P==="video"&&N&&(q=et.ts.parsePesTime(v),q&&(q.type="video",h.video.push(q),de=!0));break}if(de)break;p-=Qt,m-=Qt;continue}p--,m--}},G1=function(l,d){if(l.audio&&l.audio.length){var h=d;(typeof h>"u"||isNaN(h))&&(h=l.audio[0].dts),l.audio.forEach(function(v){v.dts=Xs(v.dts,h),v.pts=Xs(v.pts,h),v.dtsTime=v.dts/ms,v.ptsTime=v.pts/ms})}if(l.video&&l.video.length){var p=d;if((typeof p>"u"||isNaN(p))&&(p=l.video[0].dts),l.video.forEach(function(v){v.dts=Xs(v.dts,p),v.pts=Xs(v.pts,p),v.dtsTime=v.dts/ms,v.ptsTime=v.pts/ms}),l.firstKeyFrame){var m=l.firstKeyFrame;m.dts=Xs(m.dts,p),m.pts=Xs(m.pts,p),m.dtsTime=m.dts/ms,m.ptsTime=m.pts/ms}}},K1=function(l){for(var d=!1,h=0,p=null,m=null,v=0,D=0,P;l.length-D>=3;){var N=et.aac.parseType(l,D);switch(N){case"timed-metadata":if(l.length-D<10){d=!0;break}if(v=et.aac.parseId3TagSize(l,D),v>l.length){d=!0;break}m===null&&(P=l.subarray(D,D+v),m=et.aac.parseAacTimestamp(P)),D+=v;break;case"audio":if(l.length-D<7){d=!0;break}if(v=et.aac.parseAdtsSize(l,D),v>l.length){d=!0;break}p===null&&(P=l.subarray(D,D+v),p=et.aac.parseSampleRate(P)),h++,D+=v;break;default:D++;break}if(d)return null}if(p===null||m===null)return null;var q=ms/p,K={audio:[{type:"audio",dts:m,pts:m},{type:"audio",dts:m+h*1024*q,pts:m+h*1024*q}]};return K},X1=function(l){var d={pid:null,table:null},h={};z1(l,d);for(var p in d.table)if(d.table.hasOwnProperty(p)){var m=d.table[p];switch(m){case wp.H264_STREAM_TYPE:h.video=[],W1(l,d,h),h.video.length===0&&delete h.video;break;case wp.ADTS_STREAM_TYPE:h.audio=[],Ap(l,d,h),h.audio.length===0&&delete h.audio;break}}return h},Y1=function(l,d){var h=et.aac.isLikelyAacData(l),p;return h?p=K1(l):p=X1(l),!p||!p.audio&&!p.video?null:(G1(p,d),p)},Q1={inspect:Y1,parseAudioPes_:Ap};const J1=function(l,d){d.on("data",function(h){const p=h.initSegment;h.initSegment={data:p.buffer,byteOffset:p.byteOffset,byteLength:p.byteLength};const m=h.data;h.data=m.buffer,l.postMessage({action:"data",segment:h,byteOffset:m.byteOffset,byteLength:m.byteLength},[h.data])}),d.on("done",function(h){l.postMessage({action:"done"})}),d.on("gopInfo",function(h){l.postMessage({action:"gopInfo",gopInfo:h})}),d.on("videoSegmentTimingInfo",function(h){const p={start:{decode:He.videoTsToSeconds(h.start.dts),presentation:He.videoTsToSeconds(h.start.pts)},end:{decode:He.videoTsToSeconds(h.end.dts),presentation:He.videoTsToSeconds(h.end.pts)},baseMediaDecodeTime:He.videoTsToSeconds(h.baseMediaDecodeTime)};h.prependedContentDuration&&(p.prependedContentDuration=He.videoTsToSeconds(h.prependedContentDuration)),l.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:p})}),d.on("audioSegmentTimingInfo",function(h){const p={start:{decode:He.videoTsToSeconds(h.start.dts),presentation:He.videoTsToSeconds(h.start.pts)},end:{decode:He.videoTsToSeconds(h.end.dts),presentation:He.videoTsToSeconds(h.end.pts)},baseMediaDecodeTime:He.videoTsToSeconds(h.baseMediaDecodeTime)};h.prependedContentDuration&&(p.prependedContentDuration=He.videoTsToSeconds(h.prependedContentDuration)),l.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:p})}),d.on("id3Frame",function(h){l.postMessage({action:"id3Frame",id3Frame:h})}),d.on("caption",function(h){l.postMessage({action:"caption",caption:h})}),d.on("trackinfo",function(h){l.postMessage({action:"trackinfo",trackInfo:h})}),d.on("audioTimingInfo",function(h){l.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:He.videoTsToSeconds(h.start),end:He.videoTsToSeconds(h.end)}})}),d.on("videoTimingInfo",function(h){l.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:He.videoTsToSeconds(h.start),end:He.videoTsToSeconds(h.end)}})}),d.on("log",function(h){l.postMessage({action:"log",log:h})})};class Dp{constructor(d,h){this.options=h||{},this.self=d,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new V2.Transmuxer(this.options),J1(this.self,this.transmuxer)}pushMp4Captions(d){this.captionParser||(this.captionParser=new L1,this.captionParser.init());const h=new Uint8Array(d.data,d.byteOffset,d.byteLength),p=this.captionParser.parse(h,d.trackIds,d.timescales);this.self.postMessage({action:"mp4Captions",captions:p&&p.captions||[],logs:p&&p.logs||[],data:h.buffer},[h.buffer])}initMp4WebVttParser(d){this.webVttParser||(this.webVttParser=new Ep);const h=new Uint8Array(d.data,d.byteOffset,d.byteLength);this.webVttParser.init(h)}getMp4WebVttText(d){this.webVttParser||(this.webVttParser=new Ep);const h=new Uint8Array(d.data,d.byteOffset,d.byteLength),p=this.webVttParser.parseSegment(h);this.self.postMessage({action:"getMp4WebVttText",mp4VttCues:p||[],data:h.buffer},[h.buffer])}probeMp4StartTime({timescales:d,data:h}){const p=ra.startTime(d,h);this.self.postMessage({action:"probeMp4StartTime",startTime:p,data:h},[h.buffer])}probeMp4Tracks({data:d}){const h=ra.tracks(d);this.self.postMessage({action:"probeMp4Tracks",tracks:h,data:d},[d.buffer])}probeEmsgID3({data:d,offset:h}){const p=ra.getEmsgID3(d,h);this.self.postMessage({action:"probeEmsgID3",id3Frames:p,emsgData:d},[d.buffer])}probeTs({data:d,baseStartTime:h}){const p=typeof h=="number"&&!isNaN(h)?h*He.ONE_SECOND_IN_TS:void 0,m=Q1.inspect(d,p);let v=null;m&&(v={hasVideo:m.video&&m.video.length===2||!1,hasAudio:m.audio&&m.audio.length===2||!1},v.hasVideo&&(v.videoStart=m.video[0].ptsTime),v.hasAudio&&(v.audioStart=m.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:v,data:d},[d.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(d){const h=new Uint8Array(d.data,d.byteOffset,d.byteLength);this.transmuxer.push(h)}reset(){this.transmuxer.reset()}setTimestampOffset(d){const h=d.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(He.secondsToVideoTs(h)))}setAudioAppendStart(d){this.transmuxer.setAudioAppendStart(Math.ceil(He.secondsToVideoTs(d.appendStart)))}setRemux(d){this.transmuxer.setRemux(d.remux)}flush(d){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(d){this.transmuxer.alignGopsWith(d.gopsToAlignWith.slice())}}self.onmessage=function(l){if(l.data.action==="init"&&l.data.options){this.messageHandlers=new Dp(self,l.data.options);return}this.messageHandlers||(this.messageHandlers=new Dp(self)),l.data&&l.data.action&&l.data.action!=="init"&&this.messageHandlers[l.data.action]&&this.messageHandlers[l.data.action](l.data)}}));var Ek=Cb(Sk);const Ck=(t,e,i)=>{const{type:n,initSegment:s,captions:r,captionStreams:a,metadata:o,videoFrameDtsTime:u,videoFramePtsTime:c}=t.data.segment;e.buffer.push({captions:r,captionStreams:a,metadata:o});const f=t.data.segment.boxes||{data:t.data.segment.data},g={type:n,data:new Uint8Array(f.data,f.data.byteOffset,f.data.byteLength),initSegment:new Uint8Array(s.data,s.byteOffset,s.byteLength)};typeof u<"u"&&(g.videoFrameDtsTime=u),typeof c<"u"&&(g.videoFramePtsTime=c),i(g)},wk=({transmuxedData:t,callback:e})=>{t.buffer=[],e(t)},Ak=(t,e)=>{e.gopInfo=t.data.gopInfo},Db=t=>{const{transmuxer:e,bytes:i,audioAppendStart:n,gopsToAlignWith:s,remux:r,onData:a,onTrackInfo:o,onAudioTimingInfo:u,onVideoTimingInfo:c,onVideoSegmentTimingInfo:f,onAudioSegmentTimingInfo:g,onId3:y,onCaptions:_,onDone:x,onEndedTimeline:b,onTransmuxerLog:A,isEndOfTimeline:L,segment:C,triggerSegmentEventFn:w}=t,R={buffer:[]};let O=L;const U=X=>{e.currentTransmux===t&&(X.data.action==="data"&&Ck(X,R,a),X.data.action==="trackinfo"&&o(X.data.trackInfo),X.data.action==="gopInfo"&&Ak(X,R),X.data.action==="audioTimingInfo"&&u(X.data.audioTimingInfo),X.data.action==="videoTimingInfo"&&c(X.data.videoTimingInfo),X.data.action==="videoSegmentTimingInfo"&&f(X.data.videoSegmentTimingInfo),X.data.action==="audioSegmentTimingInfo"&&g(X.data.audioSegmentTimingInfo),X.data.action==="id3Frame"&&y([X.data.id3Frame],X.data.id3Frame.dispatchType),X.data.action==="caption"&&_(X.data.caption),X.data.action==="endedtimeline"&&(O=!1,b()),X.data.action==="log"&&A(X.data.log),X.data.type==="transmuxed"&&(O||(e.onmessage=null,wk({transmuxedData:R,callback:x}),kb(e))))},H=()=>{const X={message:"Received an error message from the transmuxer worker",metadata:{errorType:J.Error.StreamingFailedToTransmuxSegment,segmentInfo:ws({segment:C})}};x(null,X)};if(e.onmessage=U,e.onerror=H,n&&e.postMessage({action:"setAudioAppendStart",appendStart:n}),Array.isArray(s)&&e.postMessage({action:"alignGopsWith",gopsToAlignWith:s}),typeof r<"u"&&e.postMessage({action:"setRemux",remux:r}),i.byteLength){const X=i instanceof ArrayBuffer?i:i.buffer,T=i instanceof ArrayBuffer?0:i.byteOffset;w({type:"segmenttransmuxingstart",segment:C}),e.postMessage({action:"push",data:X,byteOffset:T,byteLength:i.byteLength},[X])}L&&e.postMessage({action:"endTimeline"}),e.postMessage({action:"flush"})},kb=t=>{t.currentTransmux=null,t.transmuxQueue.length&&(t.currentTransmux=t.transmuxQueue.shift(),typeof t.currentTransmux=="function"?t.currentTransmux():Db(t.currentTransmux))},Rm=(t,e)=>{t.postMessage({action:e}),kb(t)},Ib=(t,e)=>{if(!e.currentTransmux){e.currentTransmux=t,Rm(e,t);return}e.transmuxQueue.push(Rm.bind(null,e,t))},Dk=t=>{Ib("reset",t)},kk=t=>{Ib("endTimeline",t)},Pb=t=>{if(!t.transmuxer.currentTransmux){t.transmuxer.currentTransmux=t,Db(t);return}t.transmuxer.transmuxQueue.push(t)},Ik=t=>{const e=new Ek;e.currentTransmux=null,e.transmuxQueue=[];const i=e.terminate;return e.terminate=()=>(e.currentTransmux=null,e.transmuxQueue.length=0,i.call(e)),e.postMessage({action:"init",options:t}),e};var dd={reset:Dk,endTimeline:kk,transmux:Pb,createTransmuxer:Ik};const Tr=function(t){const e=t.transmuxer,i=t.endAction||t.action,n=t.callback,s=xt({},t,{endAction:null,transmuxer:null,callback:null}),r=a=>{a.data.action===i&&(e.removeEventListener("message",r),a.data.data&&(a.data.data=new Uint8Array(a.data.data,t.byteOffset||0,t.byteLength||a.data.data.byteLength),t.data&&(t.data=a.data.data)),n(a.data))};if(e.addEventListener("message",r),t.data){const a=t.data instanceof ArrayBuffer;s.byteOffset=a?0:t.data.byteOffset,s.byteLength=t.data.byteLength;const o=[a?t.data:t.data.buffer];e.postMessage(s,o)}else e.postMessage(s)},dn={FAILURE:2,TIMEOUT:-101,ABORTED:-102},Ob="wvtt",fh=t=>{t.forEach(e=>{e.abort()})},Pk=t=>({bandwidth:t.bandwidth,bytesReceived:t.bytesReceived||0,roundTripTime:t.roundTripTime||0}),Ok=t=>{const e=t.target,n={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-e.requestTime||0};return n.bytesReceived=t.loaded,n.bandwidth=Math.floor(n.bytesReceived/n.roundTripTime*8*1e3),n},Mf=(t,e)=>{const{requestType:i}=e,n=Ns({requestType:i,request:e,error:t});return e.timedout?{status:e.status,message:"HLS request timed-out at URL: "+e.uri,code:dn.TIMEOUT,xhr:e,metadata:n}:e.aborted?{status:e.status,message:"HLS request aborted at URL: "+e.uri,code:dn.ABORTED,xhr:e,metadata:n}:t?{status:e.status,message:"HLS request errored at URL: "+e.uri,code:dn.FAILURE,xhr:e,metadata:n}:e.responseType==="arraybuffer"&&e.response.byteLength===0?{status:e.status,message:"Empty HLS response at URL: "+e.uri,code:dn.FAILURE,xhr:e,metadata:n}:null},Mm=(t,e,i,n)=>(s,r)=>{const a=r.response,o=Mf(s,r);if(o)return i(o,t);if(a.byteLength!==16)return i({status:r.status,message:"Invalid HLS key at URL: "+r.uri,code:dn.FAILURE,xhr:r},t);const u=new DataView(a),c=new Uint32Array([u.getUint32(0),u.getUint32(4),u.getUint32(8),u.getUint32(12)]);for(let g=0;g{e===Ob&&t.transmuxer.postMessage({action:"initMp4WebVttParser",data:t.map.bytes})},Rk=(t,e,i)=>{e===Ob&&Tr({action:"getMp4WebVttText",data:t.bytes,transmuxer:t.transmuxer,callback:({data:n,mp4VttCues:s})=>{t.bytes=n,i(null,t,{mp4VttCues:s})}})},Lb=(t,e)=>{const i=rf(t.map.bytes);if(i!=="mp4"){const n=t.map.resolvedUri||t.map.uri,s=i||"unknown";return e({internal:!0,message:`Found unsupported ${s} container for initialization segment at URL: ${n}`,code:dn.FAILURE,metadata:{mediaType:s}})}Tr({action:"probeMp4Tracks",data:t.map.bytes,transmuxer:t.transmuxer,callback:({tracks:n,data:s})=>(t.map.bytes=s,n.forEach(function(r){t.map.tracks=t.map.tracks||{},!t.map.tracks[r.type]&&(t.map.tracks[r.type]=r,typeof r.id=="number"&&r.timescale&&(t.map.timescales=t.map.timescales||{},t.map.timescales[r.id]=r.timescale),r.type==="text"&&Lk(t,r.codec))}),e(null))})},Mk=({segment:t,finishProcessingFn:e,triggerSegmentEventFn:i})=>(n,s)=>{const r=Mf(n,s);if(r)return e(r,t);const a=new Uint8Array(s.response);if(i({type:"segmentloaded",segment:t}),t.map.key)return t.map.encryptedBytes=a,e(null,t);t.map.bytes=a,Lb(t,function(o){if(o)return o.xhr=s,o.status=s.status,e(o,t);e(null,t)})},Nk=({segment:t,finishProcessingFn:e,responseType:i,triggerSegmentEventFn:n})=>(s,r)=>{const a=Mf(s,r);if(a)return e(a,t);n({type:"segmentloaded",segment:t});const o=i==="arraybuffer"||!r.responseText?r.response:Tk(r.responseText.substring(t.lastReachedChar||0));return t.stats=Pk(r),t.key?t.encryptedBytes=new Uint8Array(o):t.bytes=new Uint8Array(o),e(null,t)},Bk=({segment:t,bytes:e,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:u,endedTimelineFn:c,dataFn:f,doneFn:g,onTransmuxerLog:y,triggerSegmentEventFn:_})=>{const x=t.map&&t.map.tracks||{},b=!!(x.audio&&x.video);let A=n.bind(null,t,"audio","start");const L=n.bind(null,t,"audio","end");let C=n.bind(null,t,"video","start");const w=n.bind(null,t,"video","end"),R=()=>Pb({bytes:e,transmuxer:t.transmuxer,audioAppendStart:t.audioAppendStart,gopsToAlignWith:t.gopsToAlignWith,remux:b,onData:O=>{O.type=O.type==="combined"?"video":O.type,f(t,O)},onTrackInfo:O=>{i&&(b&&(O.isMuxed=!0),i(t,O))},onAudioTimingInfo:O=>{A&&typeof O.start<"u"&&(A(O.start),A=null),L&&typeof O.end<"u"&&L(O.end)},onVideoTimingInfo:O=>{C&&typeof O.start<"u"&&(C(O.start),C=null),w&&typeof O.end<"u"&&w(O.end)},onVideoSegmentTimingInfo:O=>{const U={pts:{start:O.start.presentation,end:O.end.presentation},dts:{start:O.start.decode,end:O.end.decode}};_({type:"segmenttransmuxingtiminginfoavailable",segment:t,timingInfo:U}),s(O)},onAudioSegmentTimingInfo:O=>{const U={pts:{start:O.start.pts,end:O.end.pts},dts:{start:O.start.dts,end:O.end.dts}};_({type:"segmenttransmuxingtiminginfoavailable",segment:t,timingInfo:U}),r(O)},onId3:(O,U)=>{a(t,O,U)},onCaptions:O=>{o(t,[O])},isEndOfTimeline:u,onEndedTimeline:()=>{c()},onTransmuxerLog:y,onDone:(O,U)=>{g&&(O.type=O.type==="combined"?"video":O.type,_({type:"segmenttransmuxingcomplete",segment:t}),g(U,t,O))},segment:t,triggerSegmentEventFn:_});Tr({action:"probeTs",transmuxer:t.transmuxer,data:e,baseStartTime:t.baseStartTime,callback:O=>{t.bytes=e=O.data;const U=O.result;U&&(i(t,{hasAudio:U.hasAudio,hasVideo:U.hasVideo,isMuxed:b}),i=null),R()}})},Rb=({segment:t,bytes:e,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:u,endedTimelineFn:c,dataFn:f,doneFn:g,onTransmuxerLog:y,triggerSegmentEventFn:_})=>{let x=new Uint8Array(e);if(sA(x)){t.isFmp4=!0;const{tracks:b}=t.map;if(b.text&&(!b.audio||!b.video)){f(t,{data:x,type:"text"}),Rk(t,b.text.codec,g);return}const L={isFmp4:!0,hasVideo:!!b.video,hasAudio:!!b.audio};b.audio&&b.audio.codec&&b.audio.codec!=="enca"&&(L.audioCodec=b.audio.codec),b.video&&b.video.codec&&b.video.codec!=="encv"&&(L.videoCodec=b.video.codec),b.video&&b.audio&&(L.isMuxed=!0),i(t,L);const C=(w,R)=>{f(t,{data:x,type:L.hasAudio&&!L.isMuxed?"audio":"video"}),R&&R.length&&a(t,R),w&&w.length&&o(t,w),g(null,t,{})};Tr({action:"probeMp4StartTime",timescales:t.map.timescales,data:x,transmuxer:t.transmuxer,callback:({data:w,startTime:R})=>{e=w.buffer,t.bytes=x=w,L.hasAudio&&!L.isMuxed&&n(t,"audio","start",R),L.hasVideo&&n(t,"video","start",R),Tr({action:"probeEmsgID3",data:x,transmuxer:t.transmuxer,offset:R,callback:({emsgData:O,id3Frames:U})=>{if(e=O.buffer,t.bytes=x=O,!b.video||!O.byteLength||!t.transmuxer){C(void 0,U);return}Tr({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:t.transmuxer,data:x,timescales:t.map.timescales,trackIds:[b.video.id],callback:H=>{e=H.data.buffer,t.bytes=x=H.data,H.logs.forEach(function(X){y(Ze(X,{stream:"mp4CaptionParser"}))}),C(H.captions,U)}})}})}});return}if(!t.transmuxer){g(null,t,{});return}if(typeof t.container>"u"&&(t.container=rf(x)),t.container!=="ts"&&t.container!=="aac"){i(t,{hasAudio:!1,hasVideo:!1}),g(null,t,{});return}Bk({segment:t,bytes:e,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:u,endedTimelineFn:c,dataFn:f,doneFn:g,onTransmuxerLog:y,triggerSegmentEventFn:_})},Mb=function({id:t,key:e,encryptedBytes:i,decryptionWorker:n,segment:s,doneFn:r},a){const o=c=>{if(c.data.source===t){n.removeEventListener("message",o);const f=c.data.decrypted;a(new Uint8Array(f.bytes,f.byteOffset,f.byteLength))}};n.onerror=()=>{const c="An error occurred in the decryption worker",f=ws({segment:s}),g={message:c,metadata:{error:new Error(c),errorType:J.Error.StreamingFailedToDecryptSegment,segmentInfo:f,keyInfo:{uri:s.key.resolvedUri||s.map.key.resolvedUri}}};r(g,s)},n.addEventListener("message",o);let u;e.bytes.slice?u=e.bytes.slice():u=new Uint32Array(Array.prototype.slice.call(e.bytes)),n.postMessage(vb({source:t,encrypted:i,key:u,iv:e.iv}),[i.buffer,u.buffer])},Fk=({decryptionWorker:t,segment:e,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:u,endedTimelineFn:c,dataFn:f,doneFn:g,onTransmuxerLog:y,triggerSegmentEventFn:_})=>{_({type:"segmentdecryptionstart"}),Mb({id:e.requestId,key:e.key,encryptedBytes:e.encryptedBytes,decryptionWorker:t,segment:e,doneFn:g},x=>{e.bytes=x,_({type:"segmentdecryptioncomplete",segment:e}),Rb({segment:e,bytes:e.bytes,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:u,endedTimelineFn:c,dataFn:f,doneFn:g,onTransmuxerLog:y,triggerSegmentEventFn:_})})},Uk=({activeXhrs:t,decryptionWorker:e,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:u,endedTimelineFn:c,dataFn:f,doneFn:g,onTransmuxerLog:y,triggerSegmentEventFn:_})=>{let x=0,b=!1;return(A,L)=>{if(!b){if(A)return b=!0,fh(t),g(A,L);if(x+=1,x===t.length){const C=function(){if(L.encryptedBytes)return Fk({decryptionWorker:e,segment:L,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:u,endedTimelineFn:c,dataFn:f,doneFn:g,onTransmuxerLog:y,triggerSegmentEventFn:_});Rb({segment:L,bytes:L.bytes,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:u,endedTimelineFn:c,dataFn:f,doneFn:g,onTransmuxerLog:y,triggerSegmentEventFn:_})};if(L.endOfAllRequests=Date.now(),L.map&&L.map.encryptedBytes&&!L.map.bytes)return _({type:"segmentdecryptionstart",segment:L}),Mb({decryptionWorker:e,id:L.requestId+"-init",encryptedBytes:L.map.encryptedBytes,key:L.map.key,segment:L,doneFn:g},w=>{L.map.bytes=w,_({type:"segmentdecryptioncomplete",segment:L}),Lb(L,R=>{if(R)return fh(t),g(R,L);C()})});C()}}}},qk=({loadendState:t,abortFn:e})=>i=>{i.target.aborted&&e&&!t.calledAbortFn&&(e(),t.calledAbortFn=!0)},$k=({segment:t,progressFn:e,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:u,endedTimelineFn:c,dataFn:f})=>g=>{if(!g.target.aborted)return t.stats=Ze(t.stats,Ok(g)),!t.stats.firstBytesReceivedAt&&t.stats.bytesReceived&&(t.stats.firstBytesReceivedAt=Date.now()),e(g,t)},jk=({xhr:t,xhrOptions:e,decryptionWorker:i,segment:n,abortFn:s,progressFn:r,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:u,audioSegmentTimingInfoFn:c,id3Fn:f,captionsFn:g,isEndOfTimeline:y,endedTimelineFn:_,dataFn:x,doneFn:b,onTransmuxerLog:A,triggerSegmentEventFn:L})=>{const C=[],w=Uk({activeXhrs:C,decryptionWorker:i,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:u,audioSegmentTimingInfoFn:c,id3Fn:f,captionsFn:g,isEndOfTimeline:y,endedTimelineFn:_,dataFn:x,doneFn:b,onTransmuxerLog:A,triggerSegmentEventFn:L});if(n.key&&!n.key.bytes){const X=[n.key];n.map&&!n.map.bytes&&n.map.key&&n.map.key.resolvedUri===n.key.resolvedUri&&X.push(n.map.key);const T=Ze(e,{uri:n.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),S=Mm(n,X,w,L),B={uri:n.key.resolvedUri};L({type:"segmentkeyloadstart",segment:n,keyInfo:B});const k=t(T,S);C.push(k)}if(n.map&&!n.map.bytes){if(n.map.key&&(!n.key||n.key.resolvedUri!==n.map.key.resolvedUri)){const k=Ze(e,{uri:n.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),V=Mm(n,[n.map.key],w,L),F={uri:n.map.key.resolvedUri};L({type:"segmentkeyloadstart",segment:n,keyInfo:F});const Y=t(k,V);C.push(Y)}const T=Ze(e,{uri:n.map.resolvedUri,responseType:"arraybuffer",headers:dh(n.map),requestType:"segment-media-initialization"}),S=Mk({segment:n,finishProcessingFn:w,triggerSegmentEventFn:L});L({type:"segmentloadstart",segment:n});const B=t(T,S);C.push(B)}const R=Ze(e,{uri:n.part&&n.part.resolvedUri||n.resolvedUri,responseType:"arraybuffer",headers:dh(n),requestType:"segment"}),O=Nk({segment:n,finishProcessingFn:w,responseType:R.responseType,triggerSegmentEventFn:L});L({type:"segmentloadstart",segment:n});const U=t(R,O);U.addEventListener("progress",$k({segment:n,progressFn:r,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:u,audioSegmentTimingInfoFn:c,id3Fn:f,captionsFn:g,isEndOfTimeline:y,endedTimelineFn:_,dataFn:x})),C.push(U);const H={};return C.forEach(X=>{X.addEventListener("loadend",qk({loadendState:H,abortFn:s}))}),()=>fh(C)},Vk=Mi("CodecUtils"),Hk=function(t){const e=t.attributes||{};if(e.CODECS)return sn(e.CODECS)},Nb=(t,e)=>{const i=e.attributes||{};return t&&t.mediaGroups&&t.mediaGroups.AUDIO&&i.AUDIO&&t.mediaGroups.AUDIO[i.AUDIO]},zk=(t,e)=>{if(!Nb(t,e))return!0;const i=e.attributes||{},n=t.mediaGroups.AUDIO[i.AUDIO];for(const s in n)if(!n[s].uri&&!n[s].playlists)return!0;return!1},ou=function(t){const e={};return t.forEach(({mediaType:i,type:n,details:s})=>{e[i]=e[i]||[],e[i].push(T_(`${n}${s}`))}),Object.keys(e).forEach(function(i){if(e[i].length>1){Vk(`multiple ${i} codecs found as attributes: ${e[i].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),e[i]=null;return}e[i]=e[i][0]}),e},Nm=function(t){let e=0;return t.audio&&e++,t.video&&e++,e},$a=function(t,e){const i=e.attributes||{},n=ou(Hk(e)||[]);if(Nb(t,e)&&!n.audio&&!zk(t,e)){const s=ou(IC(t,i.AUDIO)||[]);s.audio&&(n.audio=s.audio)}return n},nl=Mi("PlaylistSelector"),Bm=function(t){if(!t||!t.playlist)return;const e=t.playlist;return JSON.stringify({id:e.id,bandwidth:t.bandwidth,width:t.width,height:t.height,codecs:e.attributes&&e.attributes.CODECS||""})},lu=function(t,e){if(!t)return"";const i=$.getComputedStyle(t);return i?i[e]:""},xr=function(t,e){const i=t.slice();t.sort(function(n,s){const r=e(n,s);return r===0?i.indexOf(n)-i.indexOf(s):r})},Nf=function(t,e){let i,n;return t.attributes.BANDWIDTH&&(i=t.attributes.BANDWIDTH),i=i||$.Number.MAX_VALUE,e.attributes.BANDWIDTH&&(n=e.attributes.BANDWIDTH),n=n||$.Number.MAX_VALUE,i-n},Wk=function(t,e){let i,n;return t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(i=t.attributes.RESOLUTION.width),i=i||$.Number.MAX_VALUE,e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(n=e.attributes.RESOLUTION.width),n=n||$.Number.MAX_VALUE,i===n&&t.attributes.BANDWIDTH&&e.attributes.BANDWIDTH?t.attributes.BANDWIDTH-e.attributes.BANDWIDTH:i-n};let Bb=function(t,e,i,n,s,r){if(!t)return;const a={bandwidth:e,width:i,height:n,limitRenditionByPlayerDimensions:s};let o=t.playlists;ui.isAudioOnly(t)&&(o=r.getAudioTrackPlaylists_(),a.audioOnly=!0);let u=o.map(O=>{let U;const H=O.attributes&&O.attributes.RESOLUTION&&O.attributes.RESOLUTION.width,X=O.attributes&&O.attributes.RESOLUTION&&O.attributes.RESOLUTION.height;return U=O.attributes&&O.attributes.BANDWIDTH,U=U||$.Number.MAX_VALUE,{bandwidth:U,width:H,height:X,playlist:O}});xr(u,(O,U)=>O.bandwidth-U.bandwidth),u=u.filter(O=>!ui.isIncompatible(O.playlist));let c=u.filter(O=>ui.isEnabled(O.playlist));c.length||(c=u.filter(O=>!ui.isDisabled(O.playlist)));const f=c.filter(O=>O.bandwidth*Ot.BANDWIDTH_VARIANCEO.bandwidth===g.bandwidth)[0];if(s===!1){const O=y||c[0]||u[0];if(O&&O.playlist){let U="sortedPlaylistReps";return y&&(U="bandwidthBestRep"),c[0]&&(U="enabledPlaylistReps"),nl(`choosing ${Bm(O)} using ${U} with options`,a),O.playlist}return nl("could not choose a playlist with options",a),null}const _=f.filter(O=>O.width&&O.height);xr(_,(O,U)=>O.width-U.width);const x=_.filter(O=>O.width===i&&O.height===n);g=x[x.length-1];const b=x.filter(O=>O.bandwidth===g.bandwidth)[0];let A,L,C;b||(A=_.filter(O=>O.width>i||O.height>n),L=A.filter(O=>O.width===A[0].width&&O.height===A[0].height),g=L[L.length-1],C=L.filter(O=>O.bandwidth===g.bandwidth)[0]);let w;if(r.leastPixelDiffSelector){const O=_.map(U=>(U.pixelDiff=Math.abs(U.width-i)+Math.abs(U.height-n),U));xr(O,(U,H)=>U.pixelDiff===H.pixelDiff?H.bandwidth-U.bandwidth:U.pixelDiff-H.pixelDiff),w=O[0]}const R=w||C||b||y||c[0]||u[0];if(R&&R.playlist){let O="sortedPlaylistReps";return w?O="leastPixelDiffRep":C?O="resolutionPlusOneRep":b?O="resolutionBestRep":y?O="bandwidthBestRep":c[0]&&(O="enabledPlaylistReps"),nl(`choosing ${Bm(R)} using ${O} with options`,a),R.playlist}return nl("could not choose a playlist with options",a),null};const Fm=function(){let t=this.useDevicePixelRatio&&$.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(t=this.customPixelRatio),Bb(this.playlists.main,this.systemBandwidth,parseInt(lu(this.tech_.el(),"width"),10)*t,parseInt(lu(this.tech_.el(),"height"),10)*t,this.limitRenditionByPlayerDimensions,this.playlistController_)},Gk=function(t){let e=-1,i=-1;if(t<0||t>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){let n=this.useDevicePixelRatio&&$.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(n=this.customPixelRatio),e<0&&(e=this.systemBandwidth,i=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==i&&(e=t*this.systemBandwidth+(1-t)*e,i=this.systemBandwidth),Bb(this.playlists.main,e,parseInt(lu(this.tech_.el(),"width"),10)*n,parseInt(lu(this.tech_.el(),"height"),10)*n,this.limitRenditionByPlayerDimensions,this.playlistController_)}},Kk=function(t){const{main:e,currentTime:i,bandwidth:n,duration:s,segmentDuration:r,timeUntilRebuffer:a,currentTimeline:o,syncController:u}=t,c=e.playlists.filter(x=>!ui.isIncompatible(x));let f=c.filter(ui.isEnabled);f.length||(f=c.filter(x=>!ui.isDisabled(x)));const y=f.filter(ui.hasAttribute.bind(null,"BANDWIDTH")).map(x=>{const A=u.getSyncPoint(x,s,o,i)?1:2,C=ui.estimateSegmentRequestTime(r,n,x)*A-a;return{playlist:x,rebufferingImpact:C}}),_=y.filter(x=>x.rebufferingImpact<=0);return xr(_,(x,b)=>Nf(b.playlist,x.playlist)),_.length?_[0]:(xr(y,(x,b)=>x.rebufferingImpact-b.rebufferingImpact),y[0]||null)},Xk=function(){const t=this.playlists.main.playlists.filter(ui.isEnabled);return xr(t,(i,n)=>Nf(i,n)),t.filter(i=>!!$a(this.playlists.main,i).video)[0]||null},Yk=t=>{let e=0,i;return t.bytes&&(i=new Uint8Array(t.bytes),t.segments.forEach(n=>{i.set(n,e),e+=n.byteLength})),i};function Fb(t){try{return new URL(t).pathname.split("/").slice(-2).join("/")}catch{return""}}const Qk=function(t,e,i){if(!t[i]){e.trigger({type:"usage",name:"vhs-608"});let n=i;/^cc708_/.test(i)&&(n="SERVICE"+i.split("_")[1]);const s=e.textTracks().getTrackById(n);if(s)t[i]=s;else{const r=e.options_.vhs&&e.options_.vhs.captionServices||{};let a=i,o=i,u=!1;const c=r[n];c&&(a=c.label,o=c.language,u=c.default),t[i]=e.addRemoteTextTrack({kind:"captions",id:n,default:u,label:a,language:o},!1).track}}},Jk=function({inbandTextTracks:t,captionArray:e,timestampOffset:i}){if(!e)return;const n=$.WebKitDataCue||$.VTTCue;e.forEach(s=>{const r=s.stream;s.content?s.content.forEach(a=>{const o=new n(s.startTime+i,s.endTime+i,a.text);o.line=a.line,o.align="left",o.position=a.position,o.positionAlign="line-left",t[r].addCue(o)}):t[r].addCue(new n(s.startTime+i,s.endTime+i,s.text))})},Zk=function(t){Object.defineProperties(t.frame,{id:{get(){return J.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),t.value.key}},value:{get(){return J.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),t.value.data}},privateData:{get(){return J.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),t.value.data}}})},eI=({inbandTextTracks:t,metadataArray:e,timestampOffset:i,videoDuration:n})=>{if(!e)return;const s=$.WebKitDataCue||$.VTTCue,r=t.metadataTrack_;if(!r||(e.forEach(f=>{const g=f.cueTime+i;typeof g!="number"||$.isNaN(g)||g<0||!(g<1/0)||!f.frames||!f.frames.length||f.frames.forEach(y=>{const _=new s(g,g,y.value||y.url||y.data||"");_.frame=y,_.value=y,Zk(_),r.addCue(_)})}),!r.cues||!r.cues.length))return;const a=r.cues,o=[];for(let f=0;f{const y=f[g.startTime]||[];return y.push(g),f[g.startTime]=y,f},{}),c=Object.keys(u).sort((f,g)=>Number(f)-Number(g));c.forEach((f,g)=>{const y=u[f],_=isFinite(n)?n:f,x=Number(c[g+1])||_;y.forEach(b=>{b.endTime=x})})},tI={id:"ID",class:"CLASS",startDate:"START-DATE",duration:"DURATION",endDate:"END-DATE",endOnNext:"END-ON-NEXT",plannedDuration:"PLANNED-DURATION",scte35Out:"SCTE35-OUT",scte35In:"SCTE35-IN"},iI=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),nI=({inbandTextTracks:t,dateRanges:e})=>{const i=t.metadataTrack_;if(!i)return;const n=$.WebKitDataCue||$.VTTCue;e.forEach(s=>{for(const r of Object.keys(s)){if(iI.has(r))continue;const a=new n(s.startTime,s.endTime,"");a.id=s.id,a.type="com.apple.quicktime.HLS",a.value={key:tI[r],data:s[r]},(r==="scte35Out"||r==="scte35In")&&(a.value.data=new Uint8Array(a.value.data.match(/[\da-f]{2}/gi)).buffer),i.addCue(a)}s.processDateRange()})},Um=(t,e,i)=>{t.metadataTrack_||(t.metadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,J.browser.IS_ANY_SAFARI||(t.metadataTrack_.inBandMetadataTrackDispatchType=e))},Da=function(t,e,i){let n,s;if(i&&i.cues)for(n=i.cues.length;n--;)s=i.cues[n],s.startTime>=t&&s.endTime<=e&&i.removeCue(s)},sI=function(t){const e=t.cues;if(!e)return;const i={};for(let n=e.length-1;n>=0;n--){const s=e[n],r=`${s.startTime}-${s.endTime}-${s.text}`;i[r]?t.removeCue(s):i[r]=s}},rI=(t,e,i)=>{if(typeof e>"u"||e===null||!t.length)return[];const n=Math.ceil((e-i+3)*As.ONE_SECOND_IN_TS);let s;for(s=0;sn);s++);return t.slice(s)},aI=(t,e,i)=>{if(!e.length)return t;if(i)return e.slice();const n=e[0].pts;let s=0;for(s;s=n);s++);return t.slice(0,s).concat(e)},oI=(t,e,i,n)=>{const s=Math.ceil((e-n)*As.ONE_SECOND_IN_TS),r=Math.ceil((i-n)*As.ONE_SECOND_IN_TS),a=t.slice();let o=t.length;for(;o--&&!(t[o].pts<=r););if(o===-1)return a;let u=o+1;for(;u--&&!(t[u].pts<=s););return u=Math.max(u,0),a.splice(u,o-u+1),a},lI=function(t,e){if(!t&&!e||!t&&e||t&&!e)return!1;if(t===e)return!0;const i=Object.keys(t).sort(),n=Object.keys(e).sort();if(i.length!==n.length)return!1;for(let s=0;si))return r}return n.length===0?0:n[n.length-1]},_a=1,cI=500,qm=t=>typeof t=="number"&&isFinite(t),sl=1/60,dI=(t,e,i)=>t!=="main"||!e||!i?null:!i.hasAudio&&!i.hasVideo?"Neither audio nor video found in segment.":e.hasVideo&&!i.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!e.hasVideo&&i.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null,hI=(t,e,i)=>{let n=e-Ot.BACK_BUFFER_LENGTH;t.length&&(n=Math.max(n,t.start(0)));const s=e-i;return Math.min(s,n)},Zs=t=>{const{startOfSegment:e,duration:i,segment:n,part:s,playlist:{mediaSequence:r,id:a,segments:o=[]},mediaIndex:u,partIndex:c,timeline:f}=t,g=o.length-1;let y="mediaIndex/partIndex increment";t.getMediaInfoForTime?y=`getMediaInfoForTime (${t.getMediaInfoForTime})`:t.isSyncRequest&&(y="getSyncSegmentCandidate (isSyncRequest)"),t.independent&&(y+=` with independent ${t.independent}`);const _=typeof c=="number",x=t.segment.uri?"segment":"pre-segment",b=_?nb({preloadSegment:n})-1:0;return`${x} [${r+u}/${r+g}]`+(_?` part [${c}/${b}]`:"")+` segment start/end [${n.start} => ${n.end}]`+(_?` part start/end [${s.start} => ${s.end}]`:"")+` startOfSegment [${e}] duration [${i}] timeline [${f}] selected by [${y}] playlist [${a}]`},$m=t=>`${t}TimingInfo`,fI=({segmentTimeline:t,currentTimeline:e,startOfSegment:i,buffered:n,overrideCheck:s})=>!s&&t===e?null:t{if(e===i)return!1;if(n==="audio"){const r=t.lastTimelineChange({type:"main"});return!r||r.to!==i}if(n==="main"&&s){const r=t.pendingTimelineChange({type:"audio"});return!(r&&r.to===i)}return!1},pI=t=>{if(!t)return!1;const e=t.pendingTimelineChange({type:"audio"}),i=t.pendingTimelineChange({type:"main"}),n=e&&i,s=n&&e.to!==i.to;return!!(n&&e.from!==-1&&i.from!==-1&&s)},gI=t=>{const e=t.timelineChangeController_.pendingTimelineChange({type:"audio"}),i=t.timelineChangeController_.pendingTimelineChange({type:"main"});return e&&i&&e.to{const e=t.pendingSegment_;if(!e)return;if(ph({timelineChangeController:t.timelineChangeController_,currentTimeline:t.currentTimeline_,segmentTimeline:e.timeline,loaderType:t.loaderType_,audioDisabled:t.audioDisabled_})&&pI(t.timelineChangeController_)){if(gI(t)){t.timelineChangeController_.trigger("audioTimelineBehind");return}t.timelineChangeController_.trigger("fixBadTimelineChange")}},mI=t=>{let e=0;return["video","audio"].forEach(function(i){const n=t[`${i}TimingInfo`];if(!n)return;const{start:s,end:r}=n;let a;typeof s=="bigint"||typeof r=="bigint"?a=$.BigInt(r)-$.BigInt(s):typeof s=="number"&&typeof r=="number"&&(a=r-s),typeof a<"u"&&a>e&&(e=a)}),typeof e=="bigint"&&et?Math.round(t)>e+un:!1,yI=(t,e)=>{if(e!=="hls")return null;const i=mI({audioTimingInfo:t.audioTimingInfo,videoTimingInfo:t.videoTimingInfo});if(!i)return null;const n=t.playlist.targetDuration,s=jm({segmentDuration:i,maxDuration:n*2}),r=jm({segmentDuration:i,maxDuration:n}),a=`Segment with index ${t.mediaIndex} from playlist ${t.playlist.id} has a duration of ${i} when the reported duration is ${t.duration} and the target duration is ${n}. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1`;return s||r?{severity:s?"warn":"info",message:a}:null},ws=({type:t,segment:e})=>{if(!e)return;const i=!!(e.key||e.map&&e.map.ke),n=!!(e.map&&!e.map.bytes),s=e.startOfSegment===void 0?e.start:e.startOfSegment;return{type:t||e.type,uri:e.resolvedUri||e.uri,start:s,duration:e.duration,isEncrypted:i,isMediaInitialization:n}};class gh extends J.EventTarget{constructor(e,i={}){if(super(),!e)throw new TypeError("Initialization settings are required");if(typeof e.currentTime!="function")throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.shouldForceTimestampOffsetAfterResync_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",()=>{this.isEndOfStream_()||(this.ended_=!1)}),this.fetchAtBuffer_=!1,this.logger_=Mi(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(n){n!==this.state_&&(this.logger_(`${this.state_} -> ${n}`),this.state_=n,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():Vn(this)}),this.sourceUpdater_.on("codecschange",n=>{this.trigger(xt({type:"codecschange"},n))}),this.loaderType_==="main"&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():Vn(this)}),this.loaderType_==="audio"&&this.timelineChangeController_.on("timelinechange",n=>{this.trigger(xt({type:"timelinechange"},n)),this.hasEnoughInfoToLoad_()?this.processLoadQueue_():Vn(this),this.hasEnoughInfoToAppend_()?this.processCallQueue_():Vn(this)})}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return dd.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&$.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){if(this.state!=="WAITING"){this.pendingSegment_&&(this.pendingSegment_=null),this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_);return}this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,$.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return this.state==="APPENDING"&&!this.pendingSegment_?(this.state="READY",!0):!this.pendingSegment_||this.pendingSegment_.requestId!==e}error(e){return typeof e<"u"&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&dd.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return Mt();if(this.loaderType_==="main"){const{hasAudio:i,hasVideo:n,isMuxed:s}=e;if(n&&i&&!this.audioDisabled_&&!s)return this.sourceUpdater_.buffered();if(n)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,i=!1){if(!e)return null;const n=au(e);let s=this.initSegments_[n];return i&&!s&&e.bytes&&(this.initSegments_[n]=s={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),s||e}segmentKey(e,i=!1){if(!e)return null;const n=bb(e);let s=this.keyCache_[n];this.cacheEncryptionKeys_&&i&&!s&&e.bytes&&(this.keyCache_[n]=s={resolvedUri:e.resolvedUri,bytes:e.bytes});const r={resolvedUri:(s||e).resolvedUri};return s&&(r.bytes=s.bytes),r}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),!!this.playlist_){if(this.state==="INIT"&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"||(this.state="READY")}}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,i={}){if(!e||this.playlist_&&this.playlist_.endList&&e.endList&&this.playlist_.uri===e.uri)return;const n=this.playlist_,s=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=i,this.state==="INIT"&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},this.loaderType_==="main"&&this.syncController_.setDateTimeMappingForStart(e));let r=null;if(n&&(n.id?r=n.id:n.uri&&(r=n.uri)),this.logger_(`playlist update [${r} => ${e.id||e.uri}]`),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(e,this.currentTime_()),this.logger_(`Playlist update: currentTime: ${this.currentTime_()} bufferedEnd: ${ud(this.buffered_())} `,this.mediaSequenceSync_.diagnostics)),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!n||n.uri!==e.uri){this.mediaIndex!==null&&(!e.endList&&typeof e.partTargetDuration=="number"?this.resetLoader():this.resyncLoader()),this.currentMediaInfo_=void 0,this.trigger("playlistupdate");return}const a=e.mediaSequence-n.mediaSequence;if(this.logger_(`live window shift [${a}]`),this.mediaIndex!==null)if(this.mediaIndex-=a,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{const o=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!o.parts||!o.parts.length||!o.parts[this.partIndex])){const u=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=u}}s&&(s.mediaIndex-=a,s.mediaIndex<0?(s.mediaIndex=null,s.partIndex=null):(s.mediaIndex>=0&&(s.segment=e.segments[s.mediaIndex]),s.partIndex>=0&&s.segment.parts&&(s.part=s.segment.parts[s.partIndex]))),this.syncController_.saveExpiredSegmentInfo(n,e)}pause(){this.checkBufferTimeout_&&($.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return this.checkBufferTimeout_===null}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1,this.mediaSequenceSync_&&this.mediaSequenceSync_.resetAppendedStatus(),this.resyncLoader()}resyncLoader(){this.transmuxer_&&dd.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1;const e=this.currentMediaInfo_&&this.currentMediaInfo_.isFmp4;this.sourceType_==="hls"&&!e&&(this.shouldForceTimestampOffsetAfterResync_=!0),this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,i,n=()=>{},s=!1){if(i===1/0&&(i=this.duration_()),i<=e){this.logger_("skipping remove because end ${end} is <= start ${start}");return}if(!this.sourceUpdater_||!this.getMediaInfo_()){this.logger_("skipping remove because no source updater or starting media info");return}let r=1;const a=()=>{r--,r===0&&n()};(s||!this.audioDisabled_)&&(r++,this.sourceUpdater_.removeAudio(e,i,a)),(s||this.loaderType_==="main")&&(this.gopBuffer_=oI(this.gopBuffer_,e,i,this.timeMapping_),r++,this.sourceUpdater_.removeVideo(e,i,a));for(const o in this.inbandTextTracks_)Da(e,i,this.inbandTextTracks_[o]);Da(e,i,this.segmentMetadataTrack_),a()}monitorBuffer_(){this.checkBufferTimeout_&&$.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=$.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&$.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=$.setTimeout(this.monitorBufferTick_.bind(this),cI)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();if(!e)return;const i={segmentInfo:ws({type:this.loaderType_,segment:e})};this.trigger({type:"segmentselected",metadata:i}),typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e)}isEndOfStream_(e=this.mediaIndex,i=this.playlist_,n=this.partIndex){if(!i||!this.mediaSource_)return!1;const s=typeof e=="number"&&i.segments[e],r=e+1===i.segments.length,a=!s||!s.parts||n+1===s.parts.length;return i.endList&&this.mediaSource_.readyState==="open"&&r&&a}chooseNextRequest_(){const e=this.buffered_(),i=ud(e)||0,n=Pf(e,this.currentTime_()),s=!this.hasPlayed_()&&n>=1,r=n>=this.goalBufferLength_(),a=this.playlist_.segments;if(!a.length||s||r)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);const o={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(o.isSyncRequest)o.mediaIndex=uI(this.currentTimeline_,a,i),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${o.mediaIndex}`);else if(this.mediaIndex!==null){const y=a[this.mediaIndex],_=typeof this.partIndex=="number"?this.partIndex:-1;o.startOfSegment=y.end?y.end:i,y.parts&&y.parts[_+1]?(o.mediaIndex=this.mediaIndex,o.partIndex=_+1):o.mediaIndex=this.mediaIndex+1}else{let y,_,x;const b=this.fetchAtBuffer_?i:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch: For TargetTime: ${b}. CurrentTime: ${this.currentTime_()} BufferedEnd: ${i} Fetch At Buffer: ${this.fetchAtBuffer_} `,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){const A=this.getSyncInfoFromMediaSequenceSync_(b);if(!A){const L="No sync info found while using media sequence sync";return this.error({message:L,metadata:{errorType:J.Error.StreamingFailedToSelectNextSegment,error:new Error(L)}}),this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null}this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${A.start} --> ${A.end})`),y=A.segmentIndex,_=A.partIndex,x=A.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");const A=ui.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:b,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});y=A.segmentIndex,_=A.partIndex,x=A.startTime}o.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${b}`:`currentTime ${b}`,o.mediaIndex=y,o.startOfSegment=x,o.partIndex=_,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${o.mediaIndex} `)}const u=a[o.mediaIndex];let c=u&&typeof o.partIndex=="number"&&u.parts&&u.parts[o.partIndex];if(!u||typeof o.partIndex=="number"&&!c)return null;typeof o.partIndex!="number"&&u.parts&&(o.partIndex=0,c=u.parts[0]);const f=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!n&&c&&!f&&!c.independent)if(o.partIndex===0){const y=a[o.mediaIndex-1],_=y.parts&&y.parts.length&&y.parts[y.parts.length-1];_&&_.independent&&(o.mediaIndex-=1,o.partIndex=y.parts.length-1,o.independent="previous segment")}else u.parts[o.partIndex-1].independent&&(o.partIndex-=1,o.independent="previous part");const g=this.mediaSource_&&this.mediaSource_.readyState==="ended";return o.mediaIndex>=a.length-1&&g&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,o.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(o))}getSyncInfoFromMediaSequenceSync_(e){if(!this.mediaSequenceSync_)return null;const i=Math.max(e,this.mediaSequenceSync_.start);e!==i&&this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ${i}`);const n=this.mediaSequenceSync_.getSyncInfoForTime(i);if(!n)return null;if(!n.isAppended)return n;const s=this.mediaSequenceSync_.getSyncInfoForTime(n.end);return s?(s.isAppended&&this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!"),s):null}generateSegmentInfo_(e){const{independent:i,playlist:n,mediaIndex:s,startOfSegment:r,isSyncRequest:a,partIndex:o,forceTimestampOffset:u,getMediaInfoForTime:c}=e,f=n.segments[s],g=typeof o=="number"&&f.parts[o],y={requestId:"segment-loader-"+Math.random(),uri:g&&g.resolvedUri||f.resolvedUri,mediaIndex:s,partIndex:g?o:null,isSyncRequest:a,startOfSegment:r,playlist:n,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:f.timeline,duration:g&&g.duration||f.duration,segment:f,part:g,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:c,independent:i},_=typeof u<"u"?u:this.isPendingTimestampOffset_;y.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:f.timeline,currentTimeline:this.currentTimeline_,startOfSegment:r,buffered:this.buffered_(),overrideCheck:_});const x=ud(this.sourceUpdater_.audioBuffered());return typeof x=="number"&&(y.audioAppendStart=x-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(y.gopsToAlignWith=rI(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),y}timestampOffsetForSegment_(e){return fI(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH||Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;const i=this.currentTime_(),n=e.bandwidth,s=this.pendingSegment_.duration,r=ui.estimateSegmentRequestTime(s,n,this.playlist_,e.bytesReceived),a=RD(this.buffered_(),i,this.vhs_.tech_.playbackRate())-1;if(r<=a)return;const o=Kk({main:this.vhs_.playlists.main,currentTime:i,bandwidth:n,duration:this.duration_(),segmentDuration:s,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!o)return;const c=r-a-o.rebufferingImpact;let f=.5;a<=un&&(f=1),!(!o.playlist||o.playlist.uri===this.playlist_.uri||c{r[a.stream]=r[a.stream]||{startTime:1/0,captions:[],endTime:0};const o=r[a.stream];o.startTime=Math.min(o.startTime,a.startTime+s),o.endTime=Math.max(o.endTime,a.endTime+s),o.captions.push(a)}),Object.keys(r).forEach(a=>{const{startTime:o,endTime:u,captions:c}=r[a],f=this.inbandTextTracks_;this.logger_(`adding cues from ${o} -> ${u} for ${a}`),Qk(f,this.vhs_.tech_,a),Da(o,u,f[a]),Jk({captionArray:c,inbandTextTracks:f,timestampOffset:s})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,i,n){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,i,n));return}this.addMetadataToTextTrack(n,i,this.duration_())}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e()),this.metadataQueue_.caption.forEach(e=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){const e=this.callQueue_;this.callQueue_=[],e.forEach(i=>i())}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[],e.forEach(i=>i())}hasEnoughInfoToLoad_(){if(this.loaderType_!=="audio")return!0;const e=this.pendingSegment_;return e?this.getCurrentMediaInfo_()?!ph({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}):!0:!1}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;const e=this.pendingSegment_,i=this.getCurrentMediaInfo_();if(!e||!i)return!1;const{hasAudio:n,hasVideo:s,isMuxed:r}=i;return!(s&&!e.videoTimingInfo||n&&!this.audioDisabled_&&!r&&!e.audioTimingInfo||ph({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}handleData_(e,i){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){Vn(this),this.callQueue_.push(this.handleData_.bind(this,e,i));return}const n=this.pendingSegment_;if(this.setTimeMapping_(n.timeline),this.updateMediaSecondsLoaded_(n.part||n.segment),this.mediaSource_.readyState!=="closed"){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),n.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),n.isFmp4=e.isFmp4,n.timingInfo=n.timingInfo||{},n.isFmp4)this.trigger("fmp4"),n.timingInfo.start=n[$m(i.type)].start;else{const s=this.getCurrentMediaInfo_(),r=this.loaderType_==="main"&&s&&s.hasVideo;let a;r&&(a=n.videoTimingInfo.start),n.timingInfo.start=this.trueSegmentStart_({currentStart:n.timingInfo.start,playlist:n.playlist,mediaIndex:n.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:r,firstVideoFrameTimeForData:a,videoTimingInfo:n.videoTimingInfo,audioTimingInfo:n.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(n,i.type),this.updateSourceBufferTimestampOffset_(n),n.isSyncRequest){this.updateTimingInfoEnd_(n),this.syncController_.saveSegmentTimingInfo({segmentInfo:n,shouldSaveTimelineMapping:this.loaderType_==="main"});const s=this.chooseNextRequest_();if(s.mediaIndex!==n.mediaIndex||s.partIndex!==n.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}n.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(n,i)}}updateAppendInitSegmentStatus(e,i){this.loaderType_==="main"&&typeof e.timestampOffset=="number"&&!e.changedTimestampOffset&&(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[i]!==e.playlist&&(this.appendInitSegment_[i]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:i,map:n,playlist:s}){if(n){const r=au(n);if(this.activeInitSegmentId_===r)return null;i=this.initSegmentForMap(n,!0).bytes,this.activeInitSegmentId_=r}return i&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=s,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,i):null}handleQuotaExceededError_({segmentInfo:e,type:i,bytes:n},s){const r=this.sourceUpdater_.audioBuffered(),a=this.sourceUpdater_.videoBuffered();r.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+Ds(r).join(", ")),a.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Ds(a).join(", "));const o=r.length?r.start(0):0,u=r.length?r.end(r.length-1):0,c=a.length?a.start(0):0,f=a.length?a.end(a.length-1):0;if(u-o<=_a&&f-c<=_a){this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${n.byteLength}, audio buffer: ${Ds(r).join(", ")}, video buffer: ${Ds(a).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),this.trigger("error");return}this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:i,bytes:n}));const y=this.currentTime_()-_a;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${y}`),this.remove(0,y,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${_a}s`),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=$.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},_a*1e3)},!0)}handleAppendError_({segmentInfo:e,type:i,bytes:n},s){if(s){if(s.code===pb){this.handleQuotaExceededError_({segmentInfo:e,type:i,bytes:n});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",s),this.error({message:`${i} append of ${n.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:J.Error.StreamingFailedToAppendSegment}}),this.trigger("appenderror")}}appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:n,data:s,bytes:r}){if(!r){const o=[s];let u=s.byteLength;n&&(o.unshift(n),u+=n.byteLength),r=Yk({bytes:u,segments:o})}const a={segmentInfo:ws({type:this.loaderType_,segment:e})};this.trigger({type:"segmentappendstart",metadata:a}),this.sourceUpdater_.appendBuffer({segmentInfo:e,type:i,bytes:r},this.handleAppendError_.bind(this,{segmentInfo:e,type:i,bytes:r}))}handleSegmentTimingInfo_(e,i,n){if(!this.pendingSegment_||i!==this.pendingSegment_.requestId)return;const s=this.pendingSegment_.segment,r=`${e}TimingInfo`;s[r]||(s[r]={}),s[r].transmuxerPrependedSeconds=n.prependedContentDuration||0,s[r].transmuxedPresentationStart=n.start.presentation,s[r].transmuxedDecodeStart=n.start.decode,s[r].transmuxedPresentationEnd=n.end.presentation,s[r].transmuxedDecodeEnd=n.end.decode,s[r].baseMediaDecodeTime=n.baseMediaDecodeTime}appendData_(e,i){const{type:n,data:s}=i;if(!s||!s.byteLength||n==="audio"&&this.audioDisabled_)return;const r=this.getInitSegmentAndUpdateState_({type:n,initSegment:i.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:n,initSegment:r,data:s})}loadSegment_(e){if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),typeof e.timestampOffset=="number"&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_()){Vn(this),this.loadQueue_.push(()=>{const i=xt({},e,{forceTimestampOffset:!0});xt(e,this.generateSegmentInfo_(i)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)});return}this.updateTransmuxerAndRequestSegment_(e)}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));const i=this.createSimplifiedSegmentObj_(e),n=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),s=this.mediaIndex!==null,r=e.timeline!==this.currentTimeline_&&e.timeline>0,a=n||s&&r;this.logger_(`Requesting ${Fb(e.uri)} ${Zs(e)}`),i.map&&!i.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=jk({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:i,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:a,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:o,level:u,stream:c})=>{this.logger_(`${Zs(e)} logged from transmuxer stream ${c} as a ${u}: ${o}`)},triggerSegmentEventFn:({type:o,segment:u,keyInfo:c,trackInfo:f,timingInfo:g})=>{const _={segmentInfo:ws({segment:u})};c&&(_.keyInfo=c),f&&(_.trackInfo=f),g&&(_.timingInfo=g),this.trigger({type:o,metadata:_})}})}trimBackBuffer_(e){const i=hI(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);i>0&&this.remove(0,i)}createSimplifiedSegmentObj_(e){const i=e.segment,n=e.part,s=e.segment.key||e.segment.map&&e.segment.map.key,r=e.segment.map&&!e.segment.map.bytes,a={resolvedUri:n?n.resolvedUri:i.resolvedUri,byterange:n?n.byterange:i.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part,type:this.loaderType_,start:e.startOfSegment,duration:e.duration,isEncrypted:s,isMediaInitialization:r},o=e.playlist.segments[e.mediaIndex-1];if(o&&o.timeline===i.timeline&&(o.videoTimingInfo?a.baseStartTime=o.videoTimingInfo.transmuxedDecodeEnd:o.audioTimingInfo&&(a.baseStartTime=o.audioTimingInfo.transmuxedDecodeEnd)),i.key){const u=i.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);a.key=this.segmentKey(i.key),a.key.iv=u}return i.map&&(a.map=this.initSegmentForMap(i.map)),a}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,i){if(this.pendingSegment_.byteLength=i.bytesReceived,e"u"||c.end!==s+r?s:o.start}waitForAppendsToComplete_(e){const i=this.getCurrentMediaInfo_(e);if(!i){this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:1/0}),this.trigger("error");return}const{hasAudio:n,hasVideo:s,isMuxed:r}=i,a=this.loaderType_==="main"&&s,o=!this.audioDisabled_&&n&&!r;if(e.waitingOnAppends=0,!e.hasAppendedData_){!e.timingInfo&&typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),this.checkAppendsDone_(e);return}a&&e.waitingOnAppends++,o&&e.waitingOnAppends++,a&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),o&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,e.waitingOnAppends===0&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){const i=dI(this.loaderType_,this.getCurrentMediaInfo_(),e);return i?(this.error({message:i,playlistExclusionDuration:1/0}),this.trigger("error"),!0):!1}updateSourceBufferTimestampOffset_(e){if(e.timestampOffset===null||typeof e.timingInfo.start!="number"||e.changedTimestampOffset||this.loaderType_!=="main")return;let i=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),i=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),i=!0),i&&this.trigger("timestampoffset")}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e,audioTimingInfo:i,timingInfo:n}){return this.useDtsForTimestampOffset_?e&&typeof e.transmuxedDecodeStart=="number"?e.transmuxedDecodeStart:i&&typeof i.transmuxedDecodeStart=="number"?i.transmuxedDecodeStart:n.start:n.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};const i=this.getMediaInfo_(),s=this.loaderType_==="main"&&i&&i.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;s&&(e.timingInfo.end=typeof s.end=="number"?s.end:s.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_){const u={segmentInfo:ws({type:this.loaderType_,segment:this.pendingSegment_})};this.trigger({type:"appendsdone",metadata:u})}if(!this.pendingSegment_){this.state="READY",this.paused()||this.monitorBuffer_();return}const e=this.pendingSegment_;e.part&&e.part.syncInfo?e.part.syncInfo.markAppended():e.segment.syncInfo&&e.segment.syncInfo.markAppended(),this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:this.loaderType_==="main"});const i=yI(e,this.sourceType_);if(i&&(i.severity==="warn"?J.log.warn(i.message):this.logger_(i.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_)){this.logger_(`Throwing away un-appended sync request ${Zs(e)}`);return}this.logger_(`Appended ${Zs(e)}`),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),this.loaderType_==="main"&&!this.audioDisabled_&&this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");const n=e.segment,s=e.part,r=n.end&&this.currentTime_()-n.end>e.playlist.targetDuration*3,a=s&&s.end&&this.currentTime_()-s.end>e.playlist.partTargetDuration*3;if(r||a){this.logger_(`bad ${r?"segment":"part"} ${Zs(e)}`),this.resetEverything();return}this.mediaIndex!==null&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}recordThroughput_(e){if(e.duratione.toUpperCase())},_I=["video","audio"],mh=(t,e)=>{const i=e[`${t}Buffer`];return i&&i.updating||e.queuePending[t]},vI=(t,e)=>{for(let i=0;i{if(e.queue.length===0)return;let i=0,n=e.queue[i];if(n.type==="mediaSource"){!e.updating()&&e.mediaSource.readyState!=="closed"&&(e.queue.shift(),n.action(e),n.doneFn&&n.doneFn(),Sr("audio",e),Sr("video",e));return}if(t!=="mediaSource"&&!(!e.ready()||e.mediaSource.readyState==="closed"||mh(t,e))){if(n.type!==t){if(i=vI(t,e.queue),i===null)return;n=e.queue[i]}if(e.queue.splice(i,1),e.queuePending[t]=n,n.action(t,e),!n.doneFn){e.queuePending[t]=null,Sr(t,e);return}}},qb=(t,e)=>{const i=e[`${t}Buffer`],n=Ub(t);i&&(i.removeEventListener("updateend",e[`on${n}UpdateEnd_`]),i.removeEventListener("error",e[`on${n}Error_`]),e.codecs[t]=null,e[`${t}Buffer`]=null)},an=(t,e)=>t&&e&&Array.prototype.indexOf.call(t.sourceBuffers,e)!==-1,hi={appendBuffer:(t,e,i)=>(n,s)=>{const r=s[`${n}Buffer`];if(an(s.mediaSource,r)){s.logger_(`Appending segment ${e.mediaIndex}'s ${t.length} bytes to ${n}Buffer`);try{r.appendBuffer(t)}catch(a){s.logger_(`Error with code ${a.code} `+(a.code===pb?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${e.mediaIndex} to ${n}Buffer`),s.queuePending[n]=null,i(a)}}},remove:(t,e)=>(i,n)=>{const s=n[`${i}Buffer`];if(an(n.mediaSource,s)){n.logger_(`Removing ${t} to ${e} from ${i}Buffer`);try{s.remove(t,e)}catch{n.logger_(`Remove ${t} to ${e} from ${i}Buffer failed`)}}},timestampOffset:t=>(e,i)=>{const n=i[`${e}Buffer`];an(i.mediaSource,n)&&(i.logger_(`Setting ${e}timestampOffset to ${t}`),n.timestampOffset=t)},callback:t=>(e,i)=>{t()},endOfStream:t=>e=>{if(e.mediaSource.readyState==="open"){e.logger_(`Calling mediaSource endOfStream(${t||""})`);try{e.mediaSource.endOfStream(t)}catch(i){J.log.warn("Failed to call media source endOfStream",i)}}},duration:t=>e=>{e.logger_(`Setting mediaSource duration to ${t}`);try{e.mediaSource.duration=t}catch(i){J.log.warn("Failed to set media source duration",i)}},abort:()=>(t,e)=>{if(e.mediaSource.readyState!=="open")return;const i=e[`${t}Buffer`];if(an(e.mediaSource,i)){e.logger_(`calling abort on ${t}Buffer`);try{i.abort()}catch(n){J.log.warn(`Failed to abort on ${t}Buffer`,n)}}},addSourceBuffer:(t,e)=>i=>{const n=Ub(t),s=Cr(e);i.logger_(`Adding ${t}Buffer with codec ${e} to mediaSource`);const r=i.mediaSource.addSourceBuffer(s);r.addEventListener("updateend",i[`on${n}UpdateEnd_`]),r.addEventListener("error",i[`on${n}Error_`]),i.codecs[t]=e,i[`${t}Buffer`]=r},removeSourceBuffer:t=>e=>{const i=e[`${t}Buffer`];if(qb(t,e),!!an(e.mediaSource,i)){e.logger_(`Removing ${t}Buffer with codec ${e.codecs[t]} from mediaSource`);try{e.mediaSource.removeSourceBuffer(i)}catch(n){J.log.warn(`Failed to removeSourceBuffer ${t}Buffer`,n)}}},changeType:t=>(e,i)=>{const n=i[`${e}Buffer`],s=Cr(t);if(!an(i.mediaSource,n))return;const r=t.substring(0,t.indexOf(".")),a=i.codecs[e];if(a.substring(0,a.indexOf("."))===r)return;const u={codecsChangeInfo:{from:a,to:t}};i.trigger({type:"codecschange",metadata:u}),i.logger_(`changing ${e}Buffer codec from ${a} to ${t}`);try{n.changeType(s),i.codecs[e]=t}catch(c){u.errorType=J.Error.StreamingCodecsChangeError,u.error=c,c.metadata=u,i.error_=c,i.trigger("error"),J.log.warn(`Failed to changeType on ${e}Buffer`,c)}}},fi=({type:t,sourceUpdater:e,action:i,doneFn:n,name:s})=>{e.queue.push({type:t,action:i,doneFn:n,name:s}),Sr(t,e)},Vm=(t,e)=>i=>{const n=e[`${t}Buffered`](),s=PD(n);if(e.logger_(`received "updateend" event for ${t} Source Buffer: `,s),e.queuePending[t]){const r=e.queuePending[t].doneFn;e.queuePending[t]=null,r&&r(e[`${t}Error_`])}Sr(t,e)};class $b extends J.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>Sr("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=Mi("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=Vm("video",this),this.onAudioUpdateEnd_=Vm("audio",this),this.onVideoError_=i=>{this.videoError_=i},this.onAudioError_=i=>{this.audioError_=i},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,i){fi({type:"mediaSource",sourceUpdater:this,action:hi.addSourceBuffer(e,i),name:"addSourceBuffer"})}abort(e){fi({type:e,sourceUpdater:this,action:hi.abort(e),name:"abort"})}removeSourceBuffer(e){if(!this.canRemoveSourceBuffer()){J.log.error("removeSourceBuffer is not supported!");return}fi({type:"mediaSource",sourceUpdater:this,action:hi.removeSourceBuffer(e),name:"removeSourceBuffer"})}canRemoveSourceBuffer(){return!J.browser.IS_FIREFOX&&$.MediaSource&&$.MediaSource.prototype&&typeof $.MediaSource.prototype.removeSourceBuffer=="function"}static canChangeType(){return $.SourceBuffer&&$.SourceBuffer.prototype&&typeof $.SourceBuffer.prototype.changeType=="function"}canChangeType(){return this.constructor.canChangeType()}changeType(e,i){if(!this.canChangeType()){J.log.error("changeType is not supported!");return}fi({type:e,sourceUpdater:this,action:hi.changeType(i),name:"changeType"})}addOrChangeSourceBuffers(e){if(!e||typeof e!="object"||Object.keys(e).length===0)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(i=>{const n=e[i];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(i,n);this.canChangeType()&&this.changeType(i,n)})}appendBuffer(e,i){const{segmentInfo:n,type:s,bytes:r}=e;if(this.processedAppend_=!0,s==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([e,i]),this.logger_(`delayed audio append of ${r.length} until video append`);return}const a=i;if(fi({type:s,sourceUpdater:this,action:hi.appendBuffer(r,n||{mediaIndex:-1},a),doneFn:i,name:"appendBuffer"}),s==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const o=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${o.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,o.forEach(u=>{this.appendBuffer.apply(this,u)})}}audioBuffered(){return an(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:Mt()}videoBuffered(){return an(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:Mt()}buffered(){const e=an(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,i=an(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return i&&!e?this.audioBuffered():e&&!i?this.videoBuffered():LD(this.audioBuffered(),this.videoBuffered())}setDuration(e,i=Dn){fi({type:"mediaSource",sourceUpdater:this,action:hi.duration(e),name:"duration",doneFn:i})}endOfStream(e=null,i=Dn){typeof e!="string"&&(e=void 0),fi({type:"mediaSource",sourceUpdater:this,action:hi.endOfStream(e),name:"endOfStream",doneFn:i})}removeAudio(e,i,n=Dn){if(!this.audioBuffered().length||this.audioBuffered().end(0)===0){n();return}fi({type:"audio",sourceUpdater:this,action:hi.remove(e,i),doneFn:n,name:"remove"})}removeVideo(e,i,n=Dn){if(!this.videoBuffered().length||this.videoBuffered().end(0)===0){n();return}fi({type:"video",sourceUpdater:this,action:hi.remove(e,i),doneFn:n,name:"remove"})}updating(){return!!(mh("audio",this)||mh("video",this))}audioTimestampOffset(e){return typeof e<"u"&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(fi({type:"audio",sourceUpdater:this,action:hi.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return typeof e<"u"&&this.videoBuffer&&this.videoTimestampOffset_!==e&&(fi({type:"video",sourceUpdater:this,action:hi.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&fi({type:"audio",sourceUpdater:this,action:hi.callback(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&fi({type:"video",sourceUpdater:this,action:hi.callback(e),name:"callback"})}dispose(){this.trigger("dispose"),_I.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>qb(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}const Hm=t=>decodeURIComponent(escape(String.fromCharCode.apply(null,t))),bI=t=>{const e=new Uint8Array(t);return Array.from(e).map(i=>i.toString(16).padStart(2,"0")).join("")},zm=new Uint8Array(` `.split("").map(t=>t.charCodeAt(0)));class TI extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class xI extends gh{constructor(e,i={}){super(e,i),this.mediaSource_=null,this.subtitlesTrack_=null,this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return Mt();const e=this.subtitlesTrack_.cues,i=e[0].startTime,n=e[e.length-1].startTime;return Mt([[i,n]])}initSegmentForMap(e,i=!1){if(!e)return null;const n=au(e);let s=this.initSegments_[n];if(i&&!s&&e.bytes){const r=zm.byteLength+e.bytes.byteLength,a=new Uint8Array(r);a.set(e.bytes),a.set(zm,e.bytes.byteLength),this.initSegments_[n]=s={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:a}}return s||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return typeof e>"u"?this.subtitlesTrack_:(this.subtitlesTrack_=e,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)}remove(e,i){Da(e,i,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(e){if(this.syncController_.timestampOffsetForTimeline(e.timeline)===null){const i=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};this.syncController_.one("timestampoffset",i),this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(e)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(e,i,n){if(!this.subtitlesTrack_){this.state="READY";return}if(this.saveTransferStats_(i.stats),!this.pendingSegment_){this.state="READY",this.mediaRequestsAborted+=1;return}if(e){e.code===dn.TIMEOUT&&this.handleTimeout_(),e.code===dn.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(e);return}const s=this.pendingSegment_,r=n.mp4VttCues&&n.mp4VttCues.length;r&&(s.mp4VttCues=n.mp4VttCues),this.saveBandwidthRelatedStats_(s.duration,i.stats),i.key&&this.segmentKey(i.key,!0),this.state="APPENDING",this.trigger("appending");const a=s.segment;if(a.map&&(a.map.bytes=i.map.bytes),s.bytes=i.bytes,typeof $.WebVTT!="function"&&typeof this.loadVttJs=="function"){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(()=>this.segmentRequestFinished_(e,i,n),()=>this.stopForError({message:"Error loading vtt.js"}));return}a.requested=!0;try{this.parseVTTCues_(s)}catch(o){this.stopForError({message:o.message,metadata:{errorType:J.Error.StreamingVttParserError,error:o}});return}if(r||this.updateTimeMapping_(s,this.syncController_.timelines[s.timeline],this.playlist_),s.cues.length?s.timingInfo={start:s.cues[0].startTime,end:s.cues[s.cues.length-1].endTime}:s.timingInfo={start:s.startOfSegment,end:s.startOfSegment+s.duration},s.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}s.byteLength=s.bytes.byteLength,this.mediaSecondsLoaded+=a.duration,s.cues.forEach(o=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new $.VTTCue(o.startTime,o.endTime,o.text):o)}),sI(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(e,i){const n=e&&e.type==="vtt",s=i&&i.type==="text";n&&s&&super.handleData_(e,i)}updateTimingInfoEnd_(){}parseMp4VttCues_(e){const i=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();e.mp4VttCues.forEach(n=>{const s=n.start+i,r=n.end+i,a=new $.VTTCue(s,r,n.cueText);n.settings&&n.settings.split(" ").forEach(o=>{const u=o.split(":"),c=u[0],f=u[1];a[c]=isNaN(f)?f:Number(f)}),e.cues.push(a)})}parseVTTCues_(e){let i,n=!1;if(typeof $.WebVTT!="function")throw new TI;if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},e.mp4VttCues){this.parseMp4VttCues_(e);return}typeof $.TextDecoder=="function"?i=new $.TextDecoder("utf8"):(i=$.WebVTT.StringDecoder(),n=!0);const s=new $.WebVTT.Parser($,$.vttjs,i);if(s.oncue=e.cues.push.bind(e.cues),s.ontimestampmap=a=>{e.timestampmap=a},s.onparsingerror=a=>{J.log.warn("Error encountered when parsing cues: "+a.message)},e.segment.map){let a=e.segment.map.bytes;n&&(a=Hm(a)),s.parse(a)}let r=e.bytes;n&&(r=Hm(r)),s.parse(r),s.flush()}updateTimeMapping_(e,i,n){const s=e.segment;if(!i)return;if(!e.cues.length){s.empty=!0;return}const{MPEGTS:r,LOCAL:a}=e.timestampmap,u=r/As.ONE_SECOND_IN_TS-a+i.mapping;if(e.cues.forEach(c=>{const f=c.endTime-c.startTime,g=this.handleRollover_(c.startTime+u,i.time);c.startTime=Math.max(g,0),c.endTime=Math.max(g+f,0)}),!n.syncInfo){const c=e.cues[0].startTime,f=e.cues[e.cues.length-1].startTime;n.syncInfo={mediaSequence:n.mediaSequence+e.mediaIndex,time:Math.min(c,f-s.duration)}}}handleRollover_(e,i){if(i===null)return e;let n=e*As.ONE_SECOND_IN_TS;const s=i*As.ONE_SECOND_IN_TS;let r;for(s4294967296;)n+=r;return n/As.ONE_SECOND_IN_TS}}const SI=function(t,e){const i=t.cues;for(let n=0;n=s.adStartTime&&e<=s.adEndTime)return s}return null},EI=function(t,e,i=0){if(!t.segments)return;let n=i,s;for(let r=0;r=this.start&&e0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus(),this.partsSyncInfo_.forEach(e=>e.resetAppendedStatus())}}class jb{constructor(){this.storage_=new Map,this.diagnostics_="",this.isReliable_=!1,this.start_=-1/0,this.end_=1/0}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach(e=>e.resetAppendStatus())}update(e,i){const{mediaSequence:n,segments:s}=e;if(this.isReliable_=this.isReliablePlaylist_(n,s),!!this.isReliable_)return this.updateStorage_(s,n,this.calculateBaseTime_(n,s,i))}getSyncInfoForTime(e){for(const{segmentSyncInfo:i,partsSyncInfo:n}of this.storage_.values())if(n.length){for(const s of n)if(s.isInRange(e))return s}else if(i.isInRange(e))return i;return null}getSyncInfoForMediaSequence(e){return this.storage_.get(e)}updateStorage_(e,i,n){const s=new Map;let r=` `,a=n,o=i;this.start_=a,e.forEach((u,c)=>{const f=this.storage_.get(o),g=a,y=g+u.duration,_=!!(f&&f.segmentSyncInfo&&f.segmentSyncInfo.isAppended),x=new Wm({start:g,end:y,appended:_,segmentIndex:c});u.syncInfo=x;let b=a;const A=(u.parts||[]).map((L,C)=>{const w=b,R=b+L.duration,O=!!(f&&f.partsSyncInfo&&f.partsSyncInfo[C]&&f.partsSyncInfo[C].isAppended),U=new Wm({start:w,end:R,appended:O,segmentIndex:c,partIndex:C});return b=R,r+=`Media Sequence: ${o}.${C} | Range: ${w} --> ${R} | Appended: ${O} `,L.syncInfo=U,U});s.set(o,new CI(x,A)),r+=`${Fb(u.resolvedUri)} | Media Sequence: ${o} | Range: ${g} --> ${y} | Appended: ${_} `,o++,a=y}),this.end_=a,this.storage_=s,this.diagnostics_=r}calculateBaseTime_(e,i,n){if(!this.storage_.size)return 0;if(this.storage_.has(e))return this.storage_.get(e).segmentSyncInfo.start;const s=Math.min(...this.storage_.keys());if(ei!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(t,e,i,n,s,r)=>{const a=t.getMediaSequenceSync(r);if(!a||!a.isReliable)return null;const o=a.getSyncInfoForTime(s);return o?{time:o.start,partIndex:o.partIndex,segmentIndex:o.segmentIndex}:null}},{name:"ProgramDateTime",run:(t,e,i,n,s)=>{if(!Object.keys(t.timelineToDatetimeMappings).length)return null;let r=null,a=null;const o=ah(e);s=s||0;for(let u=0;u{let r=null,a=null;s=s||0;const o=ah(e);for(let u=0;u=_)&&(a=_,r={time:y,segmentIndex:f.segmentIndex,partIndex:f.partIndex})}}return r}},{name:"Discontinuity",run:(t,e,i,n,s)=>{let r=null;if(s=s||0,e.discontinuityStarts&&e.discontinuityStarts.length){let a=null;for(let o=0;o=g)&&(a=g,r={time:f.time,segmentIndex:u,partIndex:null})}}}return r}},{name:"Playlist",run:(t,e,i,n,s)=>e.syncInfo?{time:e.syncInfo.time,segmentIndex:e.syncInfo.mediaSequence-e.mediaSequence,partIndex:null}:null}];class AI extends J.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};const i=new jb,n=new Gm(i),s=new Gm(i);this.mediaSequenceStorage_={main:i,audio:n,vtt:s},this.logger_=Mi("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,i,n,s,r){if(i!==1/0)return hd.find(({name:u})=>u==="VOD").run(this,e,i);const a=this.runStrategies_(e,i,n,s,r);if(!a.length)return null;for(const o of a){const{syncPoint:u,strategy:c}=o,{segmentIndex:f,time:g}=u;if(f<0)continue;const y=e.segments[f],_=g,x=_+y.duration;if(this.logger_(`Strategy: ${c}. Current time: ${s}. selected segment: ${f}. Time: [${_} -> ${x}]}`),s>=_&&s0&&(s.time*=-1),Math.abs(s.time+qa({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:s.segmentIndex,endIndex:0}))}runStrategies_(e,i,n,s,r){const a=[];for(let o=0;owI){J.log.warn(`Not saving expired segment info. Media sequence gap ${n} is too large.`);return}for(let s=n-1;s>=0;s--){const r=e.segments[s];if(r&&typeof r.start<"u"){i.syncInfo={mediaSequence:e.mediaSequence+s,time:r.start},this.logger_(`playlist refresh sync: [time:${i.syncInfo.time}, mediaSequence: ${i.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const i=e.segments[0],n=i.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[i.timeline]=-n}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:i}){const n=this.calculateSegmentTimeMapping_(e,e.timingInfo,i),s=e.segment;n&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:s.start}));const r=s.dateTimeObject;s.discontinuity&&i&&r&&(this.timelineToDatetimeMappings[s.timeline]=-(r.getTime()/1e3))}timestampOffsetForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].time}mappingForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,i,n){const s=e.segment,r=e.part;let a=this.timelines[e.timeline],o,u;if(typeof e.timestampOffset=="number")a={time:e.startOfSegment,mapping:e.startOfSegment-i.start},n&&(this.timelines[e.timeline]=a,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${a.time}] [mapping: ${a.mapping}]`)),o=e.startOfSegment,u=i.end+a.mapping;else if(a)o=i.start+a.mapping,u=i.end+a.mapping;else return!1;return r&&(r.start=o,r.end=u),(!s.start||ou){let c;o<0?c=n.start-qa({defaultDuration:i.targetDuration,durationList:i.segments,startIndex:e.mediaIndex,endIndex:r}):c=n.end+qa({defaultDuration:i.targetDuration,durationList:i.segments,startIndex:e.mediaIndex+1,endIndex:r}),this.discontinuities[a]={time:c,accuracy:u}}}}dispose(){this.trigger("dispose"),this.off()}}class DI extends J.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:i,to:n}){return typeof i=="number"&&typeof n=="number"&&(this.pendingTimelineChanges_[e]={type:e,from:i,to:n},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:i,to:n}){if(typeof i=="number"&&typeof n=="number"){this.lastTimelineChanges_[e]={type:e,from:i,to:n},delete this.pendingTimelineChanges_[e];const s={timelineChangeInfo:{from:i,to:n}};this.trigger({type:"timelinechange",metadata:s})}return this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const kI=wb(Ab(function(){var t=function(){function b(){this.listeners={}}var A=b.prototype;return A.on=function(C,w){this.listeners[C]||(this.listeners[C]=[]),this.listeners[C].push(w)},A.off=function(C,w){if(!this.listeners[C])return!1;var R=this.listeners[C].indexOf(w);return this.listeners[C]=this.listeners[C].slice(0),this.listeners[C].splice(R,1),R>-1},A.trigger=function(C){var w=this.listeners[C];if(w)if(arguments.length===2)for(var R=w.length,O=0;O>7)*283)^R]=R;for(O=U=0;!C[O];O^=T||1,U=X[U]||1)for(k=U^U<<1^U<<2^U<<3^U<<4,k=k>>8^k&255^99,C[O]=k,w[k]=O,B=H[S=H[T=H[O]]],F=B*16843009^S*65537^T*257^O*16843008,V=H[k]*257^k*16843008,R=0;R<4;R++)A[R][O]=V=V<<24^V>>>8,L[R][k]=F=F<<24^F>>>8;for(R=0;R<5;R++)A[R]=A[R].slice(0),L[R]=L[R].slice(0);return b};let n=null;class s{constructor(A){n||(n=i()),this._tables=[[n[0][0].slice(),n[0][1].slice(),n[0][2].slice(),n[0][3].slice(),n[0][4].slice()],[n[1][0].slice(),n[1][1].slice(),n[1][2].slice(),n[1][3].slice(),n[1][4].slice()]];let L,C,w;const R=this._tables[0][4],O=this._tables[1],U=A.length;let H=1;if(U!==4&&U!==6&&U!==8)throw new Error("Invalid aes key size");const X=A.slice(0),T=[];for(this._key=[X,T],L=U;L<4*U+28;L++)w=X[L-1],(L%U===0||U===8&&L%U===4)&&(w=R[w>>>24]<<24^R[w>>16&255]<<16^R[w>>8&255]<<8^R[w&255],L%U===0&&(w=w<<8^w>>>24^H<<24,H=H<<1^(H>>7)*283)),X[L]=X[L-U]^w;for(C=0;L;C++,L--)w=X[C&3?L:L-4],L<=4||C<4?T[C]=w:T[C]=O[0][R[w>>>24]]^O[1][R[w>>16&255]]^O[2][R[w>>8&255]]^O[3][R[w&255]]}decrypt(A,L,C,w,R,O){const U=this._key[1];let H=A^U[0],X=w^U[1],T=C^U[2],S=L^U[3],B,k,V;const F=U.length/4-2;let Y,Z=4;const G=this._tables[1],W=G[0],Q=G[1],se=G[2],re=G[3],ne=G[4];for(Y=0;Y>>24]^Q[X>>16&255]^se[T>>8&255]^re[S&255]^U[Z],k=W[X>>>24]^Q[T>>16&255]^se[S>>8&255]^re[H&255]^U[Z+1],V=W[T>>>24]^Q[S>>16&255]^se[H>>8&255]^re[X&255]^U[Z+2],S=W[S>>>24]^Q[H>>16&255]^se[X>>8&255]^re[T&255]^U[Z+3],Z+=4,H=B,X=k,T=V;for(Y=0;Y<4;Y++)R[(3&-Y)+O]=ne[H>>>24]<<24^ne[X>>16&255]<<16^ne[T>>8&255]<<8^ne[S&255]^U[Z++],B=H,H=X,X=T,T=S,S=B}}class r extends t{constructor(){super(t),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(A){this.jobs.push(A),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const a=function(b){return b<<24|(b&65280)<<8|(b&16711680)>>8|b>>>24},o=function(b,A,L){const C=new Int32Array(b.buffer,b.byteOffset,b.byteLength>>2),w=new s(Array.prototype.slice.call(A)),R=new Uint8Array(b.byteLength),O=new Int32Array(R.buffer);let U,H,X,T,S,B,k,V,F;for(U=L[0],H=L[1],X=L[2],T=L[3],F=0;F{const C=b[L];y(C)?A[L]={bytes:C.buffer,byteOffset:C.byteOffset,byteLength:C.byteLength}:A[L]=C}),A};self.onmessage=function(b){const A=b.data,L=new Uint8Array(A.encrypted.bytes,A.encrypted.byteOffset,A.encrypted.byteLength),C=new Uint32Array(A.key.bytes,A.key.byteOffset,A.key.byteLength/4),w=new Uint32Array(A.iv.bytes,A.iv.byteOffset,A.iv.byteLength/4);new u(L,C,w,function(R,O){self.postMessage(x({source:A.source,decrypted:O}),[O.buffer])})}}));var II=Cb(kI);const PI=t=>{let e=t.default?"main":"alternative";return t.characteristics&&t.characteristics.indexOf("public.accessibility.describes-video")>=0&&(e="main-desc"),e},Vb=(t,e)=>{t.abort(),t.pause(),e&&e.activePlaylistLoader&&(e.activePlaylistLoader.pause(),e.activePlaylistLoader=null)},yh=(t,e)=>{e.activePlaylistLoader=t,t.load()},OI=(t,e)=>()=>{const{segmentLoaders:{[t]:i,main:n},mediaTypes:{[t]:s}}=e,r=s.activeTrack(),a=s.getActiveGroup(),o=s.activePlaylistLoader,u=s.lastGroup_;if(!(a&&u&&a.id===u.id)&&(s.lastGroup_=a,s.lastTrack_=r,Vb(i,s),!(!a||a.isMainPlaylist))){if(!a.playlistLoader){o&&n.resetEverything();return}i.resyncLoader(),yh(a.playlistLoader,s)}},LI=(t,e)=>()=>{const{segmentLoaders:{[t]:i},mediaTypes:{[t]:n}}=e;n.lastGroup_=null,i.abort(),i.pause()},RI=(t,e)=>()=>{const{mainPlaylistLoader:i,segmentLoaders:{[t]:n,main:s},mediaTypes:{[t]:r}}=e,a=r.activeTrack(),o=r.getActiveGroup(),u=r.activePlaylistLoader,c=r.lastTrack_;if(!(c&&a&&c.id===a.id)&&(r.lastGroup_=o,r.lastTrack_=a,Vb(n,r),!!o)){if(o.isMainPlaylist){if(!a||!c||a.id===c.id)return;const f=e.vhs.playlistController_,g=f.selectPlaylist();if(f.media()===g)return;r.logger_(`track change. Switching main audio from ${c.id} to ${a.id}`),i.pause(),s.resetEverything(),f.fastQualityChange_(g);return}if(t==="AUDIO"){if(!o.playlistLoader){s.setAudio(!0),s.resetEverything();return}n.setAudio(!0),s.setAudio(!1)}if(u===o.playlistLoader){yh(o.playlistLoader,r);return}n.track&&n.track(a),n.resetEverything(),yh(o.playlistLoader,r)}},uu={AUDIO:(t,e)=>()=>{const{mediaTypes:{[t]:i},excludePlaylist:n}=e,s=i.activeTrack(),r=i.activeGroup(),a=(r.filter(u=>u.default)[0]||r[0]).id,o=i.tracks[a];if(s===o){n({error:{message:"Problem encountered loading the default audio track."}});return}J.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const u in i.tracks)i.tracks[u].enabled=i.tracks[u]===o;i.onTrackChanged()},SUBTITLES:(t,e)=>()=>{const{mediaTypes:{[t]:i}}=e;J.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const n=i.activeTrack();n&&(n.mode="disabled"),i.onTrackChanged()}},Km={AUDIO:(t,e,i)=>{if(!e)return;const{tech:n,requestOptions:s,segmentLoaders:{[t]:r}}=i;e.on("loadedmetadata",()=>{const a=e.media();r.playlist(a,s),(!n.paused()||a.endList&&n.preload()!=="none")&&r.load()}),e.on("loadedplaylist",()=>{r.playlist(e.media(),s),n.paused()||r.load()}),e.on("error",uu[t](t,i))},SUBTITLES:(t,e,i)=>{const{tech:n,requestOptions:s,segmentLoaders:{[t]:r},mediaTypes:{[t]:a}}=i;e.on("loadedmetadata",()=>{const o=e.media();r.playlist(o,s),r.track(a.activeTrack()),(!n.paused()||o.endList&&n.preload()!=="none")&&r.load()}),e.on("loadedplaylist",()=>{r.playlist(e.media(),s),n.paused()||r.load()}),e.on("error",uu[t](t,i))}},MI={AUDIO:(t,e)=>{const{vhs:i,sourceType:n,segmentLoaders:{[t]:s},requestOptions:r,main:{mediaGroups:a},mediaTypes:{[t]:{groups:o,tracks:u,logger_:c}},mainPlaylistLoader:f}=e,g=bo(f.main);(!a[t]||Object.keys(a[t]).length===0)&&(a[t]={main:{default:{default:!0}}},g&&(a[t].main.default.playlists=f.main.playlists));for(const y in a[t]){o[y]||(o[y]=[]);for(const _ in a[t][y]){let x=a[t][y][_],b;if(g?(c(`AUDIO group '${y}' label '${_}' is a main playlist`),x.isMainPlaylist=!0,b=null):n==="vhs-json"&&x.playlists?b=new lr(x.playlists[0],i,r):x.resolvedUri?b=new lr(x.resolvedUri,i,r):x.playlists&&n==="dash"?b=new hh(x.playlists[0],i,r,f):b=null,x=Ze({id:_,playlistLoader:b},x),Km[t](t,x.playlistLoader,e),o[y].push(x),typeof u[_]>"u"){const A=new J.AudioTrack({id:_,kind:PI(x),enabled:!1,language:x.language,default:x.default,label:_});u[_]=A}}}s.on("error",uu[t](t,e))},SUBTITLES:(t,e)=>{const{tech:i,vhs:n,sourceType:s,segmentLoaders:{[t]:r},requestOptions:a,main:{mediaGroups:o},mediaTypes:{[t]:{groups:u,tracks:c}},mainPlaylistLoader:f}=e;for(const g in o[t]){u[g]||(u[g]=[]);for(const y in o[t][g]){if(!n.options_.useForcedSubtitles&&o[t][g][y].forced)continue;let _=o[t][g][y],x;if(s==="hls")x=new lr(_.resolvedUri,n,a);else if(s==="dash"){if(!_.playlists.filter(A=>A.excludeUntil!==1/0).length)return;x=new hh(_.playlists[0],n,a,f)}else s==="vhs-json"&&(x=new lr(_.playlists?_.playlists[0]:_.resolvedUri,n,a));if(_=Ze({id:y,playlistLoader:x},_),Km[t](t,_.playlistLoader,e),u[g].push(_),typeof c[y]>"u"){const b=i.addRemoteTextTrack({id:y,kind:"subtitles",default:_.default&&_.autoselect,language:_.language,label:y},!1).track;c[y]=b}}}r.on("error",uu[t](t,e))},"CLOSED-CAPTIONS":(t,e)=>{const{tech:i,main:{mediaGroups:n},mediaTypes:{[t]:{groups:s,tracks:r}}}=e;for(const a in n[t]){s[a]||(s[a]=[]);for(const o in n[t][a]){const u=n[t][a][o];if(!/^(?:CC|SERVICE)/.test(u.instreamId))continue;const c=i.options_.vhs&&i.options_.vhs.captionServices||{};let f={label:o,language:u.language,instreamId:u.instreamId,default:u.default&&u.autoselect};if(c[f.instreamId]&&(f=Ze(f,c[f.instreamId])),f.default===void 0&&delete f.default,s[a].push(Ze({id:o},u)),typeof r[o]>"u"){const g=i.addRemoteTextTrack({id:f.instreamId,kind:"captions",default:f.default,language:f.language,label:f.label},!1).track;r[o]=g}}}}},Hb=(t,e)=>{for(let i=0;ii=>{const{mainPlaylistLoader:n,mediaTypes:{[t]:{groups:s}}}=e,r=n.media();if(!r)return null;let a=null;r.attributes[t]&&(a=s[r.attributes[t]]);const o=Object.keys(s);if(!a)if(t==="AUDIO"&&o.length>1&&bo(e.main))for(let u=0;u"u"?a:i===null||!a?null:a.filter(u=>u.id===i.id)[0]||null},BI={AUDIO:(t,e)=>()=>{const{mediaTypes:{[t]:{tracks:i}}}=e;for(const n in i)if(i[n].enabled)return i[n];return null},SUBTITLES:(t,e)=>()=>{const{mediaTypes:{[t]:{tracks:i}}}=e;for(const n in i)if(i[n].mode==="showing"||i[n].mode==="hidden")return i[n];return null}},FI=(t,{mediaTypes:e})=>()=>{const i=e[t].activeTrack();return i?e[t].activeGroup(i):null},UI=t=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(c=>{MI[c](c,t)});const{mediaTypes:e,mainPlaylistLoader:i,tech:n,vhs:s,segmentLoaders:{["AUDIO"]:r,main:a}}=t;["AUDIO","SUBTITLES"].forEach(c=>{e[c].activeGroup=NI(c,t),e[c].activeTrack=BI[c](c,t),e[c].onGroupChanged=OI(c,t),e[c].onGroupChanging=LI(c,t),e[c].onTrackChanged=RI(c,t),e[c].getActiveGroup=FI(c,t)});const o=e.AUDIO.activeGroup();if(o){const c=(o.filter(g=>g.default)[0]||o[0]).id;e.AUDIO.tracks[c].enabled=!0,e.AUDIO.onGroupChanged(),e.AUDIO.onTrackChanged(),e.AUDIO.getActiveGroup().playlistLoader?(a.setAudio(!1),r.setAudio(!0)):a.setAudio(!0)}i.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(c=>e[c].onGroupChanged())}),i.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(c=>e[c].onGroupChanging())});const u=()=>{e.AUDIO.onTrackChanged(),n.trigger({type:"usage",name:"vhs-audio-change"})};n.audioTracks().addEventListener("change",u),n.remoteTextTracks().addEventListener("change",e.SUBTITLES.onTrackChanged),s.on("dispose",()=>{n.audioTracks().removeEventListener("change",u),n.remoteTextTracks().removeEventListener("change",e.SUBTITLES.onTrackChanged)}),n.clearTracks("audio");for(const c in e.AUDIO.tracks)n.audioTracks().addTrack(e.AUDIO.tracks[c])},qI=()=>{const t={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{t[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Dn,activeTrack:Dn,getActiveGroup:Dn,onGroupChanged:Dn,onTrackChanged:Dn,lastTrack_:null,logger_:Mi(`MediaGroups[${e}]`)}}),t};class Xm{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){e===1&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=li(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map(i=>[i.ID,i])))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class $I extends J.EventTarget{constructor(e,i){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new Xm,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=Mi("Content Steering"),this.xhr_=e,this.getBandwidth_=i}assignTagProperties(e,i){this.manifestType_=i.serverUri?"HLS":"DASH";const n=i.serverUri||i.serverURL;if(!n){this.logger_(`steering manifest URL is ${n}, cannot request steering manifest.`),this.trigger("error");return}if(n.startsWith("data:")){this.decodeDataUriManifest_(n.substring(n.indexOf(",")+1));return}this.steeringManifest.reloadUri=li(e,n),this.defaultPathway=i.pathwayId||i.defaultServiceLocation,this.queryBeforeStart=i.queryBeforeStart,this.proxyServerUrl_=i.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering")}requestSteeringManifest(e){const i=this.steeringManifest.reloadUri;if(!i)return;const n=e?i:this.getRequestURI(i);if(!n){this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),this.dispose();return}const s={contentSteeringInfo:{uri:n}};this.trigger({type:"contentsteeringloadstart",metadata:s}),this.request_=this.xhr_({uri:n,requestType:"content-steering-manifest"},(r,a)=>{if(r){if(a.status===410){this.logger_(`manifest request 410 ${r}.`),this.logger_(`There will be no more content steering requests to ${n} this session.`),this.excludedSteeringManifestURLs.add(n);return}if(a.status===429){const c=a.responseHeaders["retry-after"];this.logger_(`manifest request 429 ${r}.`),this.logger_(`content steering will retry in ${c} seconds.`),this.startTTLTimeout_(parseInt(c,10));return}this.logger_(`manifest failed to load ${r}.`),this.startTTLTimeout_();return}this.trigger({type:"contentsteeringloadcomplete",metadata:s});let o;try{o=JSON.parse(this.request_.responseText)}catch(c){const f={errorType:J.Error.StreamingContentSteeringParserError,error:c};this.trigger({type:"error",metadata:f})}this.assignSteeringProperties_(o);const u={contentSteeringInfo:s.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:u}),this.startTTLTimeout_()})}setProxyServerUrl_(e){const i=new $.URL(e),n=new $.URL(this.proxyServerUrl_);return n.searchParams.set("url",encodeURI(i.toString())),this.setSteeringParams_(n.toString())}decodeDataUriManifest_(e){const i=JSON.parse($.atob(e));this.assignSteeringProperties_(i)}setSteeringParams_(e){const i=new $.URL(e),n=this.getPathway(),s=this.getBandwidth_();if(n){const r=`_${this.manifestType_}_pathway`;i.searchParams.set(r,n)}if(s){const r=`_${this.manifestType_}_throughput`;i.searchParams.set(r,s)}return i.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version){this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),this.trigger("error");return}this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e["RELOAD-URI"],this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=e["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose());const n=(s=>{for(const r of s)if(this.availablePathways_.has(r))return r;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==n&&(this.currentPathway=n,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;const i=s=>this.excludedSteeringManifestURLs.has(s);if(this.proxyServerUrl_){const s=this.setProxyServerUrl_(e);if(!i(s))return s}const n=this.setSteeringParams_(e);return i(n)?null:n}startTTLTimeout_(e=this.steeringManifest.ttl){const i=e*1e3;this.ttlTimeout_=$.setTimeout(()=>{this.requestSteeringManifest()},i)}clearTTLTimeout_(){$.clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new Xm}addAvailablePathway(e){e&&this.availablePathways_.add(e)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,i){return!i&&this.steeringManifest.reloadUri||i&&(li(e,i.serverURL)!==this.steeringManifest.reloadUri||i.defaultServiceLocation!==this.defaultPathway||i.queryBeforeStart!==this.queryBeforeStart||i.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const jI=(t,e)=>{let i=null;return(...n)=>{clearTimeout(i),i=setTimeout(()=>{t.apply(null,n)},e)}},VI=10;let Hn;const HI=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],zI=function(t){return this.audioSegmentLoader_[t]+this.mainSegmentLoader_[t]},WI=function({currentPlaylist:t,buffered:e,currentTime:i,nextPlaylist:n,bufferLowWaterLine:s,bufferHighWaterLine:r,duration:a,bufferBasedABR:o,log:u}){if(!n)return J.log.warn("We received no playlist to switch to. Please check your stream."),!1;const c=`allowing switch ${t&&t.id||"null"} -> ${n.id}`;if(!t)return u(`${c} as current playlist is not set`),!0;if(n.id===t.id)return!1;const f=!!or(e,i).length;if(!t.endList)return!f&&typeof t.partTargetDuration=="number"?(u(`not ${c} as current playlist is live llhls, but currentTime isn't in buffered.`),!1):(u(`${c} as current playlist is live`),!0);const g=Pf(e,i),y=o?Ot.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Ot.MAX_BUFFER_LOW_WATER_LINE;if(ax)&&g>=s){let b=`${c} as forwardBuffer >= bufferLowWaterLine (${g} >= ${s})`;return o&&(b+=` and next bandwidth > current bandwidth (${_} > ${x})`),u(b),!0}return u(`not ${c} as no switching criteria met`),!1};class GI extends J.EventTarget{constructor(e){super(),this.fastQualityChange_=jI(this.fastQualityChange_.bind(this),100);const{src:i,withCredentials:n,tech:s,bandwidth:r,externVhs:a,useCueTags:o,playlistExclusionDuration:u,enableLowInitialPlaylist:c,sourceType:f,cacheEncryptionKeys:g,bufferBasedABR:y,leastPixelDiffSelector:_,captionServices:x,experimentalUseMMS:b}=e;if(!i)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:A}=e;(A===null||typeof A>"u")&&(A=1/0),Hn=a,this.bufferBasedABR=!!y,this.leastPixelDiffSelector=!!_,this.withCredentials=n,this.tech_=s,this.vhs_=s.vhs,this.player_=e.player_,this.sourceType_=f,this.useCueTags_=o,this.playlistExclusionDuration=u,this.maxPlaylistRetries=A,this.enableLowInitialPlaylist=c,this.usingManagedMediaSource_=!1,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:n,maxPlaylistRetries:A,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=qI(),b&&$.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new $.ManagedMediaSource,this.usingManagedMediaSource_=!0,J.log("Using ManagedMediaSource")):$.MediaSource&&(this.mediaSource=new $.MediaSource),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.load=this.load.bind(this),this.pause=this.pause.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.mediaSource.addEventListener("startstreaming",this.load),this.mediaSource.addEventListener("endstreaming",this.pause),this.seekable_=Mt(),this.hasPlayed_=!1,this.syncController_=new AI(e),this.segmentMetadataTrack_=s.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.decrypter_=new II,this.sourceUpdater_=new $b(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new DI,this.keyStatusMap_=new Map;const L={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:x,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:r,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:g,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new hh(i,this.vhs_,Ze(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new lr(i,this.vhs_,Ze(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new gh(Ze(L,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new gh(Ze(L,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new xI(Ze(L,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((R,O)=>{function U(){s.off("vttjserror",H),R()}function H(){s.off("vttjsloaded",U),O()}s.one("vttjsloaded",U),s.one("vttjserror",H),s.addWebVttScript_()})}),e);const C=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new $I(this.vhs_.xhr,C),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),HI.forEach(R=>{this[R+"_"]=zI.bind(this,R)}),this.logger_=Mi("pc"),this.triggeredFmp4Usage=!1,this.tech_.preload()==="none"?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const w=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(w,()=>{const R=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-R,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_(),i=this.audioAppendsToLoadedData_();return e===-1||i===-1?-1:e+i}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const i=this.selectPlaylist();i&&this.shouldSwitchToMedia_(i)&&this.switchMedia_(i,e)}switchMedia_(e,i,n){const s=this.media(),r=s&&(s.id||s.uri),a=e&&(e.id||e.uri);if(r&&r!==a){this.logger_(`switch media ${r} -> ${a} from ${i}`);const o={renditionInfo:{id:a,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS},cause:i};this.trigger({type:"renditionselected",metadata:o}),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${i}`})}this.mainPlaylistLoader_.media(e,n)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{const i=this.mediaTypes_[e],n=i?i.activeGroup():null,s=this.contentSteeringController_.getPathway();if(n&&s){const a=(n.length?n[0].playlists:n.playlists).filter(o=>o.attributes.serviceLocation===s);a.length&&this.mediaTypes_[e].activePlaylistLoader.media(a[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=$.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||($.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const e=this.main(),i=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return i;const n=e.mediaGroups.AUDIO,s=Object.keys(n);let r;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)r=this.mediaTypes_.AUDIO.activeTrack();else{const o=n.main||s.length&&n[s[0]];for(const u in o)if(o[u].default){r={label:u};break}}if(!r)return i;const a=[];for(const o in n)if(n[o][r.label]){const u=n[o][r.label];if(u.playlists&&u.playlists.length)a.push.apply(a,u.playlists);else if(u.uri)a.push(u);else if(e.playlists.length)for(let c=0;c{const i=this.mainPlaylistLoader_.media(),n=i.targetDuration*1.5*1e3;oh(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=n,i.endList&&this.tech_.preload()!=="none"&&(this.mainSegmentLoader_.playlist(i,this.requestOptions_),this.mainSegmentLoader_.load()),UI({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),i),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}),this.mainPlaylistLoader_.on("loadedplaylist",()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let i=this.mainPlaylistLoader_.media();if(!i){this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_();let n;if(this.enableLowInitialPlaylist&&(n=this.selectInitialPlaylist()),n||(n=this.selectPlaylist()),!n||!this.shouldSwitchToMedia_(n)||(this.initialMedia_=n,this.switchMedia_(this.initialMedia_,"initial"),!(this.sourceType_==="vhs-json"&&this.initialMedia_.segments)))return;i=this.initialMedia_}this.handleUpdatedMediaPlaylist(i)}),this.mainPlaylistLoader_.on("error",()=>{const i=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:i.playlist,error:i})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{const i=this.mainPlaylistLoader_.media(),n=i.targetDuration*1.5*1e3;oh(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=n,this.sourceType_==="dash"&&this.mainPlaylistLoader_.isPaused&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(i,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{const i=this.mainPlaylistLoader_.media();if(i.lastExcludeReason_==="playlist-unchanged")return;this.stuckAtPlaylistEnd_(i)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))}),this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}),this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})}),["manifestrequeststart","manifestrequestcomplete","manifestparsestart","manifestparsecomplete","playlistrequeststart","playlistrequestcomplete","playlistparsestart","playlistparsecomplete","renditiondisabled","renditionenabled"].forEach(i=>{this.mainPlaylistLoader_.on(i,n=>{this.player_.trigger(xt({},n))})})}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,i){const n=e.mediaGroups||{};let s=!0;const r=Object.keys(n.AUDIO);for(const a in n.AUDIO)for(const o in n.AUDIO[a])n.AUDIO[a][o].uri||(s=!1);s&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(n.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),Hn.Playlist.isAes(i)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),r.length&&Object.keys(n.AUDIO[r[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){const i=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,n=this.tech_.currentTime(),s=this.bufferLowWaterLine(),r=this.bufferHighWaterLine(),a=this.tech_.buffered();return WI({buffered:a,currentTime:n,currentPlaylist:i,nextPlaylist:e,bufferLowWaterLine:s,bufferHighWaterLine:r,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")}),this.mainSegmentLoader_.on("error",()=>{const n=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:n.playlist,error:n})}),this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended"),this.onEndOfStream()}),this.timelineChangeController_.on("audioTimelineBehind",()=>{const n=this.audioSegmentLoader_.pendingSegment_;if(!n||!n.segment||!n.segment.syncInfo)return;const s=n.segment.syncInfo.end+.01;this.tech_.setCurrentTime(s)}),this.timelineChangeController_.on("fixBadTimelineChange",()=>{this.logger_("Fix bad timeline change. Restarting al segment loaders..."),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}),this.mainSegmentLoader_.on("earlyabort",n=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:VI}))});const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const n=this.getCodecsOrExclude_();n&&this.sourceUpdater_.addOrChangeSourceBuffers(n)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()}),["segmentselected","segmentloadstart","segmentloaded","segmentkeyloadstart","segmentkeyloadcomplete","segmentdecryptionstart","segmentdecryptioncomplete","segmenttransmuxingstart","segmenttransmuxingcomplete","segmenttransmuxingtrackinfoavailable","segmenttransmuxingtiminginfoavailable","segmentappendstart","appendsdone","bandwidthupdated","timelinechange","codecschange"].forEach(n=>{this.mainSegmentLoader_.on(n,s=>{this.player_.trigger(xt({},s))}),this.audioSegmentLoader_.on(n,s=>{this.player_.trigger(xt({},s))}),this.subtitleSegmentLoader_.on(n,s=>{this.player_.trigger(xt({},s))})})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}pause(){this.mainSegmentLoader_.pause(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.pause(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.pause()}fastQualityChange_(e=this.selectPlaylist()){if(e&&e===this.mainPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(e,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const e=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime(){})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;const i=this.duration();e[e.length-1].endTime=isNaN(i)||Math.abs(i)===1/0?Number.MAX_VALUE:i}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const i=this.mainSegmentLoader_.getCurrentMediaInfo_();!i||i.hasVideo?e=e&&this.audioSegmentLoader_.ended_:e=this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;const n=this.syncController_.getExpiredTime(e,this.duration());if(n===null)return!1;const s=Hn.Playlist.playlistEnd(e,n),r=this.tech_.currentTime(),a=this.tech_.buffered();if(!a.length)return s-r<=cn;const o=a.end(a.length-1);return o-r<=cn&&s-o<=cn}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:i={},playlistExclusionDuration:n}){if(e=e||this.mainPlaylistLoader_.media(),n=n||i.playlistExclusionDuration||this.playlistExclusionDuration,!e){this.error=i,this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}e.playlistErrors_++;const s=this.mainPlaylistLoader_.main.playlists,r=s.filter(Ku),a=r.length===1&&r[0]===e;if(s.length===1&&n!==1/0)return J.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(a);if(a){if(this.main().contentSteering){const x=this.pathwayAttribute_(e),b=this.contentSteeringController_.steeringManifest.ttl*1e3;this.contentSteeringController_.excludePathway(x),this.excludeThenChangePathway_(),setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(x)},b);return}let _=!1;s.forEach(x=>{if(x===e)return;const b=x.excludeUntil;typeof b<"u"&&b!==1/0&&(_=!0,delete x.excludeUntil)}),_&&(J.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let o;e.playlistErrors_>this.maxPlaylistRetries?o=1/0:o=Date.now()+n*1e3,e.excludeUntil=o,i.reason&&(e.lastExcludeReason_=i.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const u=this.selectPlaylist();if(!u){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}const c=i.internal?this.logger_:J.log.warn,f=i.message?" "+i.message:"";c(`${i.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${f} Switching to playlist ${u.id}.`),u.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),u.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const g=u.targetDuration/2*1e3||5*1e3,y=typeof u.lastRequest=="number"&&Date.now()-u.lastRequest<=g;return this.switchMedia_(u,"exclude",a||y)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,i){const n=[],s=e==="all";(s||e==="main")&&n.push(this.mainPlaylistLoader_);const r=[];(s||e==="audio")&&r.push("AUDIO"),(s||e==="subtitle")&&(r.push("CLOSED-CAPTIONS"),r.push("SUBTITLES")),r.forEach(a=>{const o=this.mediaTypes_[a]&&this.mediaTypes_[a].activePlaylistLoader;o&&n.push(o)}),["main","audio","subtitle"].forEach(a=>{const o=this[`${a}SegmentLoader_`];o&&(e===a||e==="all")&&n.push(o)}),n.forEach(a=>i.forEach(o=>{typeof a[o]=="function"&&a[o]()}))}setCurrentTime(e){const i=or(this.tech_.buffered(),e);if(!(this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media())||!this.mainPlaylistLoader_.media().segments)return 0;if(i&&i.length)return e;this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}duration(){if(!this.mainPlaylistLoader_)return 0;const e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Hn.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}getSeekableRange_(e,i){const n=e.media();if(!n)return null;const s=this.syncController_.getMediaSequenceSync(i);if(s&&s.isReliable){const o=s.start,u=s.end;if(!isFinite(o)||!isFinite(u))return null;const c=Hn.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,n),f=Math.max(0,u-c);return fs||n>a?e:Mt([[Math.max(n,r),Math.min(s,a)]])}onSyncInfoUpdate_(){if(!this.mainPlaylistLoader_)return;const e=this.getSeekableRange_(this.mainPlaylistLoader_,"main");if(!e)return;let i;if(this.mediaTypes_.AUDIO.activePlaylistLoader&&(i=this.getSeekableRange_(this.mediaTypes_.AUDIO.activePlaylistLoader,"audio"),!i))return;const n=this.seekable_;if(this.seekable_=this.computeFinalSeekable_(e,i),!this.seekable_||n&&n.length&&this.seekable_.length&&n.start(0)===this.seekable_.start(0)&&n.end(0)===this.seekable_.end(0))return;this.logger_(`seekable updated [${tb(this.seekable_)}]`);const s={seekableRanges:this.seekable_};this.trigger({type:"seekablerangeschanged",metadata:s}),this.tech_.trigger("seekablechanged")}updateDuration(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),this.mediaSource.readyState!=="open"){this.updateDuration_=this.updateDuration.bind(this,e),this.mediaSource.addEventListener("sourceopen",this.updateDuration_);return}if(e){const s=this.seekable();if(!s.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration0&&(n=Math.max(n,i.end(i.length-1))),this.mediaSource.duration!==n&&this.sourceUpdater_.setDuration(n)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(e=>{const i=this.mediaTypes_[e].groups;for(const n in i)i[n].forEach(s=>{s.playlistLoader&&s.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,i=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),n=e?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!i||!n)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},i=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const n=$a(this.main(),i),s={},r=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(s.video=n.video||e.main.videoCodec||OC),e.main.isMuxed&&(s.video+=`,${n.audio||e.main.audioCodec||Ng}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||r)&&(s.audio=n.audio||e.main.audioCodec||e.audio.audioCodec||Ng,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!s.audio&&!s.video){this.excludePlaylist({playlistToExclude:i,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});return}const a=(c,f)=>c?Na(f,this.usingManagedMediaSource_):Wc(f),o={};let u;if(["video","audio"].forEach(function(c){if(s.hasOwnProperty(c)&&!a(e[c].isFmp4,s[c])){const f=e[c].isFmp4?"browser":"muxer";o[f]=o[f]||[],o[f].push(s[c]),c==="audio"&&(u=f)}}),r&&u&&i.attributes.AUDIO){const c=i.attributes.AUDIO;this.main().playlists.forEach(f=>{(f.attributes&&f.attributes.AUDIO)===c&&f!==i&&(f.excludeUntil=1/0)}),this.logger_(`excluding audio group ${c} as ${u} does not support codec(s): "${s.audio}"`)}if(Object.keys(o).length){const c=Object.keys(o).reduce((f,g)=>(f&&(f+=", "),f+=`${g} does not support codec(s): "${o[g].join(",")}"`,f),"")+".";this.excludePlaylist({playlistToExclude:i,error:{internal:!0,message:c},playlistExclusionDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const c=[];if(["video","audio"].forEach(f=>{const g=(sn(this.sourceUpdater_.codecs[f]||"")[0]||{}).type,y=(sn(s[f]||"")[0]||{}).type;g&&y&&g.toLowerCase()!==y.toLowerCase()&&c.push(`"${this.sourceUpdater_.codecs[f]}" -> "${s[f]}"`)}),c.length){this.excludePlaylist({playlistToExclude:i,error:{message:`Codec switching not supported: ${c.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0});return}}return s}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers()||!this.areMediaTypesKnown_())return;const e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);const i=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(i)}excludeUnsupportedVariants_(){const e=this.main().playlists,i=[];Object.keys(e).forEach(n=>{const s=e[n];if(i.indexOf(s.id)!==-1)return;i.push(s.id);const r=$a(this.main,s),a=[];r.audio&&!Wc(r.audio)&&!Na(r.audio,this.usingManagedMediaSource_)&&a.push(`audio codec ${r.audio}`),r.video&&!Wc(r.video)&&!Na(r.video,this.usingManagedMediaSource_)&&a.push(`video codec ${r.video}`),r.text&&r.text==="stpp.ttml.im1t"&&a.push(`text codec ${r.text}`),a.length&&(s.excludeUntil=1/0,this.logger_(`excluding ${s.id} for unsupported: ${a.join(", ")}`))})}excludeIncompatibleVariants_(e){const i=[],n=this.main().playlists,s=ou(sn(e)),r=Nm(s),a=s.video&&sn(s.video)[0]||null,o=s.audio&&sn(s.audio)[0]||null;Object.keys(n).forEach(u=>{const c=n[u];if(i.indexOf(c.id)!==-1||c.excludeUntil===1/0)return;i.push(c.id);const f=[],g=$a(this.mainPlaylistLoader_.main,c),y=Nm(g);if(!(!g.audio&&!g.video)){if(y!==r&&f.push(`codec count "${y}" !== "${r}"`),!this.sourceUpdater_.canChangeType()){const _=g.video&&sn(g.video)[0]||null,x=g.audio&&sn(g.audio)[0]||null;_&&a&&_.type.toLowerCase()!==a.type.toLowerCase()&&f.push(`video codec "${_.type}" !== "${a.type}"`),x&&o&&x.type.toLowerCase()!==o.type.toLowerCase()&&f.push(`audio codec "${x.type}" !== "${o.type}"`)}f.length&&(c.excludeUntil=1/0,this.logger_(`excluding ${c.id}: ${f.join(" && ")}`))}})}updateAdCues_(e){let i=0;const n=this.seekable();n.length&&(i=n.start(0)),EI(e,this.cueTagsTrack_,i)}goalBufferLength(){const e=this.tech_.currentTime(),i=Ot.GOAL_BUFFER_LENGTH,n=Ot.GOAL_BUFFER_LENGTH_RATE,s=Math.max(i,Ot.MAX_GOAL_BUFFER_LENGTH);return Math.min(i+e*n,s)}bufferLowWaterLine(){const e=this.tech_.currentTime(),i=Ot.BUFFER_LOW_WATER_LINE,n=Ot.BUFFER_LOW_WATER_LINE_RATE,s=Math.max(i,Ot.MAX_BUFFER_LOW_WATER_LINE),r=Math.max(i,Ot.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(i+e*n,this.bufferBasedABR?r:s)}bufferHighWaterLine(){return Ot.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){Um(this.inbandTextTracks_,"com.apple.streaming",this.tech_),nI({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,i,n){const s=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();Um(this.inbandTextTracks_,e,this.tech_),eI({inbandTextTracks:this.inbandTextTracks_,metadataArray:i,timestampOffset:s,videoDuration:n})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){const e=this.main();if(e.contentSteering){for(const i of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(i));if(this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart){this.contentSteeringController_.requestSteeringManifest(!0);return}this.tech_.one("canplay",()=>{this.contentSteeringController_.requestSteeringManifest()})}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),["contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(i=>{this.contentSteeringController_.on(i,n=>{this.trigger(xt({},n))})}),this.sourceType_==="dash"&&this.mainPlaylistLoader_.on("loadedplaylist",()=>{const i=this.main();(this.contentSteeringController_.didDASHTagChange(i.uri,i.contentSteering)||(()=>{const r=this.contentSteeringController_.getAvailablePathways(),a=[];for(const o of i.playlists){const u=o.attributes.serviceLocation;if(u&&(a.push(u),!r.has(u)))return!0}return!!(!a.length&&r.size)})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){const e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();const n=this.main().playlists,s=new Set;let r=!1;Object.keys(n).forEach(a=>{const o=n[a],u=this.pathwayAttribute_(o),c=u&&e!==u;o.excludeUntil===1/0&&o.lastExcludeReason_==="content-steering"&&!c&&(delete o.excludeUntil,delete o.lastExcludeReason_,r=!0);const g=!o.excludeUntil&&o.excludeUntil!==1/0;!s.has(o.id)&&c&&g&&(s.add(o.id),o.excludeUntil=1/0,o.lastExcludeReason_="content-steering",this.logger_(`excluding ${o.id} for ${o.lastExcludeReason_}`))}),this.contentSteeringController_.manifestType_==="DASH"&&Object.keys(this.mediaTypes_).forEach(a=>{const o=this.mediaTypes_[a];if(o.activePlaylistLoader){const u=o.activePlaylistLoader.media_;u&&u.attributes.serviceLocation!==e&&(r=!0)}}),r&&this.changeSegmentPathway_()}handlePathwayClones_(){const i=this.main().playlists,n=this.contentSteeringController_.currentPathwayClones,s=this.contentSteeringController_.nextPathwayClones;if(n&&n.size||s&&s.size){for(const[a,o]of n.entries())s.get(a)||(this.mainPlaylistLoader_.updateOrDeleteClone(o),this.contentSteeringController_.excludePathway(a));for(const[a,o]of s.entries()){const u=n.get(a);if(!u){i.filter(f=>f.attributes["PATHWAY-ID"]===o["BASE-ID"]).forEach(f=>{this.mainPlaylistLoader_.addClonePathway(o,f)}),this.contentSteeringController_.addAvailablePathway(a);continue}this.equalPathwayClones_(u,o)||(this.mainPlaylistLoader_.updateOrDeleteClone(o,!0),this.contentSteeringController_.addAvailablePathway(a))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...s])))}}equalPathwayClones_(e,i){if(e["BASE-ID"]!==i["BASE-ID"]||e.ID!==i.ID||e["URI-REPLACEMENT"].HOST!==i["URI-REPLACEMENT"].HOST)return!1;const n=e["URI-REPLACEMENT"].PARAMS,s=i["URI-REPLACEMENT"].PARAMS;for(const r in n)if(n[r]!==s[r])return!1;for(const r in s)if(n[r]!==s[r])return!1;return!0}changeSegmentPathway_(){const e=this.selectPlaylist();this.pauseLoading(),this.contentSteeringController_.manifestType_==="DASH"&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let e=0;const i="non-usable";this.mainPlaylistLoader_.main.playlists.forEach(n=>{const s=this.mainPlaylistLoader_.getKeyIdSet(n);!s||!s.size||s.forEach(r=>{const a="usable",o=this.keyStatusMap_.has(r)&&this.keyStatusMap_.get(r)===a,u=n.lastExcludeReason_===i&&n.excludeUntil===1/0;o?o&&u&&(delete n.excludeUntil,delete n.lastExcludeReason_,this.logger_(`enabling playlist ${n.id} because key ID ${r} is ${a}`)):(n.excludeUntil!==1/0&&n.lastExcludeReason_!==i&&(n.excludeUntil=1/0,n.lastExcludeReason_=i,this.logger_(`excluding playlist ${n.id} because the key ID ${r} doesn't exist in the keyStatusMap or is not ${a}`)),e++)})}),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(n=>{const s=n&&n.attributes&&n.attributes.RESOLUTION&&n.attributes.RESOLUTION.height<720,r=n.excludeUntil===1/0&&n.lastExcludeReason_===i;s&&r&&(delete n.excludeUntil,J.log.warn(`enabling non-HD playlist ${n.id} because all playlists were excluded due to ${i} key IDs`))})}addKeyStatus_(e,i){const r=(typeof e=="string"?e:bI(e)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${i}' with key ID ${r} added to the keyStatusMap`),this.keyStatusMap_.set(r,i)}updatePlaylistByKeyStatus(e,i){this.addKeyStatus_(e,i),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}const KI=(t,e,i)=>n=>{const s=t.main.playlists[e],r=Lf(s),a=Ku(s);if(typeof n>"u")return a;n?delete s.disabled:s.disabled=!0;const o={renditionInfo:{id:e,bandwidth:s.attributes.BANDWIDTH,resolution:s.attributes.RESOLUTION,codecs:s.attributes.CODECS},cause:"fast-quality"};return n!==a&&!r&&(n?(i(s),t.trigger({type:"renditionenabled",metadata:o})):t.trigger({type:"renditiondisabled",metadata:o})),n};class XI{constructor(e,i,n){const{playlistController_:s}=e,r=s.fastQualityChange_.bind(s);if(i.attributes){const a=i.attributes.RESOLUTION;this.width=a&&a.width,this.height=a&&a.height,this.bandwidth=i.attributes.BANDWIDTH,this.frameRate=i.attributes["FRAME-RATE"]}this.codecs=$a(s.main(),i),this.playlist=i,this.id=n,this.enabled=KI(e.playlists,i.id,r)}}const YI=function(t){t.representations=()=>{const e=t.playlistController_.main(),i=bo(e)?t.playlistController_.getAudioTrackPlaylists_():e.playlists;return i?i.filter(n=>!Lf(n)).map((n,s)=>new XI(t,n,n.id)):[]}},Ym=["seeking","seeked","pause","playing","error"];class QI extends J.EventTarget{constructor(e){super(),this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.playedRanges_=[],this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=Mi("PlaybackWatcher"),this.logger_("initialize");const i=()=>this.monitorCurrentTime_(),n=()=>this.monitorCurrentTime_(),s=()=>this.techWaiting_(),r=()=>this.resetTimeUpdate_(),a=this.playlistController_,o=["main","subtitle","audio"],u={};o.forEach(f=>{u[f]={reset:()=>this.resetSegmentDownloads_(f),updateend:()=>this.checkSegmentDownloads_(f)},a[`${f}SegmentLoader_`].on("appendsdone",u[f].updateend),a[`${f}SegmentLoader_`].on("playlistupdate",u[f].reset),this.tech_.on(["seeked","seeking"],u[f].reset)});const c=f=>{["main","audio"].forEach(g=>{a[`${g}SegmentLoader_`][f]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),c("off"))},this.clearSeekingAppendCheck_=()=>c("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),c("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",s),this.tech_.on(Ym,r),this.tech_.on("canplay",n),this.tech_.one("play",i),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",s),this.tech_.off(Ym,r),this.tech_.off("canplay",n),this.tech_.off("play",i),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),o.forEach(f=>{a[`${f}SegmentLoader_`].off("appendsdone",u[f].updateend),a[`${f}SegmentLoader_`].off("playlistupdate",u[f].reset),this.tech_.off(["seeked","seeking"],u[f].reset)}),this.checkCurrentTimeTimeout_&&$.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&$.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=$.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const i=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=i.buffered_()}checkSegmentDownloads_(e){const i=this.playlistController_,n=i[`${e}SegmentLoader_`],s=n.buffered_(),r=MD(this[`${e}Buffered_`],s);if(this[`${e}Buffered_`]=s,r){const a={bufferedRanges:s};i.trigger({type:"bufferedrangeschanged",metadata:a}),this.resetSegmentDownloads_(e);return}this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:n.playlist_&&n.playlist_.id,buffered:Ds(s)}),!(this[`${e}StalledDownloads_`]<10)&&(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),e!=="subtitle"&&i.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0}))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const e=this.tech_.currentTime(),i=this.tech_.buffered();if(this.lastRecordedTime===e&&(!i.length||e+cn>=i.end(i.length-1)))return this.techWaiting_();if(this.consecutiveUpdates>=5&&e===this.lastRecordedTime)this.consecutiveUpdates++,this.waiting_();else if(e===this.lastRecordedTime)this.consecutiveUpdates++;else{this.playedRanges_.push(Mt([this.lastRecordedTime,e]));const n={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:n}),this.consecutiveUpdates=0,this.lastRecordedTime=e}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const i=this.seekable(),n=this.tech_.currentTime(),s=this.afterSeekableWindow_(i,n,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let r;if(s&&(r=i.end(i.length-1)),this.beforeSeekableWindow_(i,n)){const x=i.start(0);r=x+(x===i.end(0)?0:cn)}if(typeof r<"u")return this.logger_(`Trying to seek outside of seekable at time ${n} with seekable range ${tb(i)}. Seeking to ${r}.`),this.tech_.setCurrentTime(r),!0;const a=this.playlistController_.sourceUpdater_,o=this.tech_.buffered(),u=a.audioBuffer?a.audioBuffered():null,c=a.videoBuffer?a.videoBuffered():null,f=this.media(),g=f.partTargetDuration?f.partTargetDuration:(f.targetDuration-un)*2,y=[u,c];for(let x=0;x ${n.end(0)}]. Attempting to resume playback by seeking to the current time.`),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"});return}}techWaiting_(){const e=this.seekable(),i=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,i)){const o=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${i}. Seeking to live point (seekable end) ${o}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(o),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const n=this.tech_.vhs.playlistController_.sourceUpdater_,s=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:n.audioBuffered(),videoBuffered:n.videoBuffered(),currentTime:i}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const a=il(s,i);return a.length>0?(this.logger_(`Stopped at ${i} and seeking to ${a.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(i),!0):!1}afterSeekableWindow_(e,i,n,s=!1){if(!e.length)return!1;let r=e.end(e.length-1)+cn;const a=!n.endList,o=typeof n.partTargetDuration=="number";return a&&(o||s)&&(r=e.end(e.length-1)+n.targetDuration*3),i>r}beforeSeekableWindow_(e,i){return!!(e.length&&e.start(0)>0&&i2)return{start:r,end:a}}return null}}const JI={errorInterval:30,getSource(t){const i=this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource();return t(i)}},zb=function(t,e){let i=0,n=0;const s=Ze(JI,e);t.ready(()=>{t.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const r=function(){n&&t.currentTime(n)},a=function(f){f!=null&&(n=t.duration()!==1/0&&t.currentTime()||0,t.one("loadedmetadata",r),t.src(f),t.trigger({type:"usage",name:"vhs-error-reload"}),t.play())},o=function(){if(Date.now()-i{Object.defineProperty(gt,t,{get(){return J.log.warn(`using Vhs.${t} is UNSAFE be sure you know what you are doing`),Ot[t]},set(e){if(J.log.warn(`using Vhs.${t} is UNSAFE be sure you know what you are doing`),typeof e!="number"||e<0){J.log.warn(`value of Vhs.${t} must be greater than or equal to 0`);return}Ot[t]=e}})});const Gb="videojs-vhs",Kb=function(t,e){const i=e.media();let n=-1;for(let s=0;s{t.addQualityLevel(i)}),Kb(t,e.playlists)};gt.canPlaySource=function(){return J.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const rP=(t,e,i)=>{if(!t)return t;let n={};e&&e.attributes&&e.attributes.CODECS&&(n=ou(sn(e.attributes.CODECS))),i&&i.attributes&&i.attributes.CODECS&&(n.audio=i.attributes.CODECS);const s=Cr(n.video),r=Cr(n.audio),a={};for(const o in t)a[o]={},r&&(a[o].audioContentType=r),s&&(a[o].videoContentType=s),e.contentProtection&&e.contentProtection[o]&&e.contentProtection[o].pssh&&(a[o].pssh=e.contentProtection[o].pssh),typeof t[o]=="string"&&(a[o].url=t[o]);return Ze(t,a)},aP=(t,e)=>t.reduce((i,n)=>{if(!n.contentProtection)return i;const s=e.reduce((r,a)=>{const o=n.contentProtection[a];return o&&o.pssh&&(r[a]={pssh:o.pssh}),r},{});return Object.keys(s).length&&i.push(s),i},[]),oP=({player:t,sourceKeySystems:e,audioMedia:i,mainPlaylists:n})=>{if(!t.eme.initializeMediaKeys)return Promise.resolve();const s=i?n.concat([i]):n,r=aP(s,Object.keys(e)),a=[],o=[];return r.forEach(u=>{o.push(new Promise((c,f)=>{t.tech_.one("keysessioncreated",c)})),a.push(new Promise((c,f)=>{t.eme.initializeMediaKeys({keySystems:u},g=>{if(g){f(g);return}c()})}))}),Promise.race([Promise.all(a),Promise.race(o)])},lP=({player:t,sourceKeySystems:e,media:i,audioMedia:n})=>{const s=rP(e,i,n);return s?(t.currentSource().keySystems=s,s&&!t.eme?(J.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},Xb=()=>{if(!$.localStorage)return null;const t=$.localStorage.getItem(Gb);if(!t)return null;try{return JSON.parse(t)}catch{return null}},uP=t=>{if(!$.localStorage)return!1;let e=Xb();e=e?Ze(e,t):t;try{$.localStorage.setItem(Gb,JSON.stringify(e))}catch{return!1}return e},cP=t=>t.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(t.substring(t.indexOf(",")+1)):t,Yb=(t,e)=>{t._requestCallbackSet||(t._requestCallbackSet=new Set),t._requestCallbackSet.add(e)},Qb=(t,e)=>{t._responseCallbackSet||(t._responseCallbackSet=new Set),t._responseCallbackSet.add(e)},Jb=(t,e)=>{t._requestCallbackSet&&(t._requestCallbackSet.delete(e),t._requestCallbackSet.size||delete t._requestCallbackSet)},Zb=(t,e)=>{t._responseCallbackSet&&(t._responseCallbackSet.delete(e),t._responseCallbackSet.size||delete t._responseCallbackSet)};gt.supportsNativeHls=function(){if(!_e||!_e.createElement)return!1;const t=_e.createElement("video");return J.getTech("Html5").isSupported()?["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(i){return/maybe|probably/i.test(t.canPlayType(i))}):!1}();gt.supportsNativeDash=function(){return!_e||!_e.createElement||!J.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(_e.createElement("video").canPlayType("application/dash+xml"))}();gt.supportsTypeNatively=t=>t==="hls"?gt.supportsNativeHls:t==="dash"?gt.supportsNativeDash:!1;gt.isSupported=function(){return J.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};gt.xhr.onRequest=function(t){Yb(gt.xhr,t)};gt.xhr.onResponse=function(t){Qb(gt.xhr,t)};gt.xhr.offRequest=function(t){Jb(gt.xhr,t)};gt.xhr.offResponse=function(t){Zb(gt.xhr,t)};const dP=J.getComponent("Component");class eT extends dP{constructor(e,i,n){if(super(i,n.vhs),typeof n.initialBandwidth=="number"&&(this.options_.bandwidth=n.initialBandwidth),this.logger_=Mi("VhsHandler"),i.options_&&i.options_.playerId){const s=J.getPlayer(i.options_.playerId);this.player_=s}if(this.tech_=i,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&i.overrideNativeAudioTracks&&i.overrideNativeVideoTracks)i.overrideNativeAudioTracks(!0),i.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(i.featuresNativeVideoTracks||i.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(_e,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],s=>{const r=_e.fullscreenElement||_e.webkitFullscreenElement||_e.mozFullScreenElement||_e.msFullscreenElement;r&&r.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=!1;return}this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,"error",function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}),this.on(this.tech_,"play",this.play)}setOptions_(e={}){if(this.options_=Ze(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage<"u"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=this.options_.llhls!==!1,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,typeof this.options_.playlistExclusionDuration!="number"&&(this.options_.playlistExclusionDuration=60),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){const n=Xb();n&&n.bandwidth&&(this.options_.bandwidth=n.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),n&&n.throughput&&(this.options_.throughput=n.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=Ot.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Ot.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(n=>{typeof this.source_[n]<"u"&&(this.options_[n]=this.source_[n])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio;const i=this.options_.customPixelRatio;typeof i=="number"&&i>=0&&(this.customPixelRatio=i)}setOptions(e={}){this.setOptions_(e)}src(e,i){if(!e)return;this.setOptions_(),this.options_.src=cP(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=gt,this.options_.sourceType=S_(i),this.options_.seekTo=r=>{this.tech_.setCurrentTime(r)},this.options_.player_=this.player_,this.playlistController_=new GI(this.options_);const n=Ze({liveRangeSafeTimeDelta:cn},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new QI(n),this.attachStreamingEventListeners_(),this.playlistController_.on("error",()=>{const r=J.players[this.tech_.options_.playerId];let a=this.playlistController_.error;typeof a=="object"&&!a.code?a.code=3:typeof a=="string"&&(a={message:a,code:3}),r.error(a)});const s=this.options_.bufferBasedABR?gt.movingAverageBandwidthSelector(.55):gt.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):s.bind(this),this.playlistController_.selectInitialPlaylist=gt.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(r){this.playlistController_.selectPlaylist=r.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(r){this.playlistController_.mainSegmentLoader_.throughput.rate=r,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let r=this.playlistController_.mainSegmentLoader_.bandwidth;const a=$.navigator.connection||$.navigator.mozConnection||$.navigator.webkitConnection,o=1e7;if(this.options_.useNetworkInformationApi&&a){const u=a.downlink*1e3*1e3;u>=o&&r>=o?r=Math.max(r,u):r=u}return r},set(r){this.playlistController_.mainSegmentLoader_.bandwidth=r,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const r=1/(this.bandwidth||1);let a;return this.throughput>0?a=1/this.throughput:a=0,Math.floor(1/(r+a))},set(){J.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>Ds(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>Ds(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{this.options_.useBandwidthFromLocalStorage&&uP({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{YI(this)}),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()}),this.on(this.playlistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.playlistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=$.URL.createObjectURL(this.playlistController_.mediaSource),(J.browser.IS_ANY_SAFARI||J.browser.IS_IOS)&&this.options_.overrideNative&&this.options_.sourceType==="hls"&&typeof this.tech_.addSourceElement=="function"?(this.tech_.addSourceElement(this.mediaSourceUrl_),this.tech_.addSourceElement(this.source_.src)):this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),oP({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch(i=>{this.logger_("error while creating EME key session",i),this.player_.error({message:"Failed to initialize media keys for EME",code:3})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,i=lP({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});if(this.player_.tech_.on("keystatuschange",n=>{this.playlistController_.updatePlaylistByKeyStatus(n.keyId,n.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),!i){this.playlistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()}setupQualityLevels_(){const e=J.players[this.tech_.options_.playerId];!e||!e.qualityLevels||this.qualityLevels_||(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{sP(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{Kb(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":Wb,"mux.js":eP,"mpd-parser":tP,"m3u8-parser":iP,"aes-decrypter":nP}}version(){return this.constructor.version()}canChangeType(){return $b.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&$.URL.revokeObjectURL&&($.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,i){return hk({playlist:this.playlistController_.media(),time:e,callback:i})}seekToProgramTime(e,i,n=!0,s=2){return Sb({programTime:e,playlist:this.playlistController_.media(),retryCount:s,pauseAfterSeek:n,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:i})}setupXhrHooks_(){this.xhr.onRequest=e=>{Yb(this.xhr,e)},this.xhr.onResponse=e=>{Qb(this.xhr,e)},this.xhr.offRequest=e=>{Jb(this.xhr,e)},this.xhr.offResponse=e=>{Zb(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){const e=["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"],i=["gapjumped","playedrangeschanged"];e.forEach(n=>{this.playlistController_.on(n,s=>{this.player_.trigger(xt({},s))})}),i.forEach(n=>{this.playbackWatcher_.on(n,s=>{this.player_.trigger(xt({},s))})})}}const cu={name:"videojs-http-streaming",VERSION:Wb,canHandleSource(t,e={}){const i=Ze(J.options,e);return!i.vhs.experimentalUseMMS&&!Na("avc1.4d400d,mp4a.40.2",!1)?!1:cu.canPlayType(t.type,i)},handleSource(t,e,i={}){const n=Ze(J.options,i);return e.vhs=new eT(t,e,n),e.vhs.xhr=_b(),e.vhs.setupXhrHooks_(),e.vhs.src(t.src,t.type),e.vhs},canPlayType(t,e){const i=S_(t);if(!i)return"";const n=cu.getOverrideNative(e);return!gt.supportsTypeNatively(i)||n?"maybe":""},getOverrideNative(t={}){const{vhs:e={}}=t,i=!(J.browser.IS_ANY_SAFARI||J.browser.IS_IOS),{overrideNative:n=i}=e;return n}},hP=()=>Na("avc1.4d400d,mp4a.40.2",!0);hP()&&J.getTech("Html5").registerSourceHandler(cu,0);J.VhsHandler=eT;J.VhsSourceHandler=cu;J.Vhs=gt;J.use||J.registerComponent("Vhs",gt);J.options.vhs=J.options.vhs||{};(!J.getPlugin||!J.getPlugin("reloadSourceOnError"))&&J.registerPlugin("reloadSourceOnError",ZI);function fd(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function"){var s=0;for(n=Object.getOwnPropertySymbols(t);s{const i=t.__vccOpts||t;for(const[n,s]of e)i[n]=s;return i},xP={__name:"App",setup(t,{expose:e}){e();const i=Fl();i.use(Qm);const n={app:i,createApp:Fl,get VueVideoPlayer(){return Qm}};return Object.defineProperty(n,"__isScriptSetup",{enumerable:!1,value:!0}),n}},SP={class:"background"};function EP(t,e,i,n,s,r){const a=oS("router-view");return Ll(),qS("div",SP,[Wt(a)])}const CP=TP(xP,[["render",EP],["__file","App.vue"]]),rT=t=>t,SR=rT,wP=rT;function AP(){return aT().__VUE_DEVTOOLS_GLOBAL_HOOK__}function aT(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const DP=typeof Proxy=="function",kP="devtools-plugin:setup",IP="plugin:settings:set";let er,_h;function PP(){var t;return er!==void 0||(typeof window<"u"&&window.performance?(er=!0,_h=window.performance):typeof globalThis<"u"&&(!((t=globalThis.perf_hooks)===null||t===void 0)&&t.performance)?(er=!0,_h=globalThis.perf_hooks.performance):er=!1),er}function OP(){return PP()?_h.now():Date.now()}class LP{constructor(e,i){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=e,this.hook=i;const n={};if(e.settings)for(const a in e.settings){const o=e.settings[a];n[a]=o.defaultValue}const s=`__vue-devtools-plugin-settings__${e.id}`;let r=Object.assign({},n);try{const a=localStorage.getItem(s),o=JSON.parse(a);Object.assign(r,o)}catch{}this.fallbacks={getSettings(){return r},setSettings(a){try{localStorage.setItem(s,JSON.stringify(a))}catch{}r=a},now(){return OP()}},i&&i.on(IP,(a,o)=>{a===this.plugin.id&&this.fallbacks.setSettings(o)}),this.proxiedOn=new Proxy({},{get:(a,o)=>this.target?this.target.on[o]:(...u)=>{this.onQueue.push({method:o,args:u})}}),this.proxiedTarget=new Proxy({},{get:(a,o)=>this.target?this.target[o]:o==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(o)?(...u)=>(this.targetQueue.push({method:o,args:u,resolve:()=>{}}),this.fallbacks[o](...u)):(...u)=>new Promise(c=>{this.targetQueue.push({method:o,args:u,resolve:c})})})}async setRealTarget(e){this.target=e;for(const i of this.onQueue)this.target.on[i.method](...i.args);for(const i of this.targetQueue)i.resolve(await this.target[i.method](...i.args))}}function RP(t,e){const i=t,n=aT(),s=AP(),r=DP&&i.enableEarlyProxy;if(s&&(n.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!r))s.emit(kP,t,e);else{const a=r?new LP(i,s):null;(n.__VUE_DEVTOOLS_PLUGINS__=n.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:i,setupFn:e,proxy:a}),a&&e(a.proxiedTarget)}}/*! * vue-router v4.5.0 * (c) 2024 Eduardo San Martin Morote * @license MIT */const En=typeof document<"u";function oT(t){return typeof t=="object"||"displayName"in t||"props"in t||"__vccOpts"in t}function MP(t){return t.__esModule||t[Symbol.toStringTag]==="Module"||t.default&&oT(t.default)}const Ye=Object.assign;function md(t,e){const i={};for(const n in e){const s=e[n];i[n]=vi(s)?s.map(t):t(s)}return i}const Va=()=>{},vi=Array.isArray,lT=/#/g,NP=/&/g,BP=/\//g,FP=/=/g,UP=/\?/g,uT=/\+/g,qP=/%5B/g,$P=/%5D/g,cT=/%5E/g,jP=/%60/g,dT=/%7B/g,VP=/%7C/g,hT=/%7D/g,HP=/%20/g;function Ff(t){return encodeURI(""+t).replace(VP,"|").replace(qP,"[").replace($P,"]")}function zP(t){return Ff(t).replace(dT,"{").replace(hT,"}").replace(cT,"^")}function vh(t){return Ff(t).replace(uT,"%2B").replace(HP,"+").replace(lT,"%23").replace(NP,"%26").replace(jP,"`").replace(dT,"{").replace(hT,"}").replace(cT,"^")}function WP(t){return vh(t).replace(FP,"%3D")}function GP(t){return Ff(t).replace(lT,"%23").replace(UP,"%3F")}function KP(t){return t==null?"":GP(t).replace(BP,"%2F")}function Mr(t){try{return decodeURIComponent(""+t)}catch{}return""+t}const XP=/\/$/,YP=t=>t.replace(XP,"");function yd(t,e,i="/"){let n,s={},r="",a="";const o=e.indexOf("#");let u=e.indexOf("?");return o=0&&(u=-1),u>-1&&(n=e.slice(0,u),r=e.slice(u+1,o>-1?o:e.length),s=t(r)),o>-1&&(n=n||e.slice(0,o),a=e.slice(o,e.length)),n=eO(n??e,i),{fullPath:n+(r&&"?")+r+a,path:n,query:s,hash:Mr(a)}}function QP(t,e){const i=e.query?t(e.query):"";return e.path+(i&&"?")+i+(e.hash||"")}function Jm(t,e){return!e||!t.toLowerCase().startsWith(e.toLowerCase())?t:t.slice(e.length)||"/"}function JP(t,e,i){const n=e.matched.length-1,s=i.matched.length-1;return n>-1&&n===s&&os(e.matched[n],i.matched[s])&&fT(e.params,i.params)&&t(e.query)===t(i.query)&&e.hash===i.hash}function os(t,e){return(t.aliasOf||t)===(e.aliasOf||e)}function fT(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const i in t)if(!ZP(t[i],e[i]))return!1;return!0}function ZP(t,e){return vi(t)?Zm(t,e):vi(e)?Zm(e,t):t===e}function Zm(t,e){return vi(e)?t.length===e.length&&t.every((i,n)=>i===e[n]):t.length===1&&t[0]===e}function eO(t,e){if(t.startsWith("/"))return t;if(!t)return e;const i=e.split("/"),n=t.split("/"),s=n[n.length-1];(s===".."||s===".")&&n.push("");let r=i.length-1,a,o;for(a=0;a1&&r--;else break;return i.slice(0,r).join("/")+"/"+n.slice(a).join("/")}const zn={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var ro;(function(t){t.pop="pop",t.push="push"})(ro||(ro={}));var Ha;(function(t){t.back="back",t.forward="forward",t.unknown=""})(Ha||(Ha={}));function tO(t){if(!t)if(En){const e=document.querySelector("base");t=e&&e.getAttribute("href")||"/",t=t.replace(/^\w+:\/\/[^\/]+/,"")}else t="/";return t[0]!=="/"&&t[0]!=="#"&&(t="/"+t),YP(t)}const iO=/^[^#]+#/;function nO(t,e){return t.replace(iO,"#")+e}function sO(t,e){const i=document.documentElement.getBoundingClientRect(),n=t.getBoundingClientRect();return{behavior:e.behavior,left:n.left-i.left-(e.left||0),top:n.top-i.top-(e.top||0)}}const Xu=()=>({left:window.scrollX,top:window.scrollY});function rO(t){let e;if("el"in t){const i=t.el,n=typeof i=="string"&&i.startsWith("#"),s=typeof i=="string"?n?document.getElementById(i.slice(1)):document.querySelector(i):i;if(!s)return;e=sO(s,t)}else e=t;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(e.left!=null?e.left:window.scrollX,e.top!=null?e.top:window.scrollY)}function e0(t,e){return(history.state?history.state.position-e:-1)+t}const bh=new Map;function aO(t,e){bh.set(t,e)}function oO(t){const e=bh.get(t);return bh.delete(t),e}let lO=()=>location.protocol+"//"+location.host;function pT(t,e){const{pathname:i,search:n,hash:s}=e,r=t.indexOf("#");if(r>-1){let o=s.includes(t.slice(r))?t.slice(r).length:1,u=s.slice(o);return u[0]!=="/"&&(u="/"+u),Jm(u,"")}return Jm(i,t)+n+s}function uO(t,e,i,n){let s=[],r=[],a=null;const o=({state:y})=>{const _=pT(t,location),x=i.value,b=e.value;let A=0;if(y){if(i.value=_,e.value=y,a&&a===x){a=null;return}A=b?y.position-b.position:0}else n(_);s.forEach(L=>{L(i.value,x,{delta:A,type:ro.pop,direction:A?A>0?Ha.forward:Ha.back:Ha.unknown})})};function u(){a=i.value}function c(y){s.push(y);const _=()=>{const x=s.indexOf(y);x>-1&&s.splice(x,1)};return r.push(_),_}function f(){const{history:y}=window;y.state&&y.replaceState(Ye({},y.state,{scroll:Xu()}),"")}function g(){for(const y of r)y();r=[],window.removeEventListener("popstate",o),window.removeEventListener("beforeunload",f)}return window.addEventListener("popstate",o),window.addEventListener("beforeunload",f,{passive:!0}),{pauseListeners:u,listen:c,destroy:g}}function t0(t,e,i,n=!1,s=!1){return{back:t,current:e,forward:i,replaced:n,position:window.history.length,scroll:s?Xu():null}}function cO(t){const{history:e,location:i}=window,n={value:pT(t,i)},s={value:e.state};s.value||r(n.value,{back:null,current:n.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0);function r(u,c,f){const g=t.indexOf("#"),y=g>-1?(i.host&&document.querySelector("base")?t:t.slice(g))+u:lO()+t+u;try{e[f?"replaceState":"pushState"](c,"",y),s.value=c}catch(_){console.error(_),i[f?"replace":"assign"](y)}}function a(u,c){const f=Ye({},e.state,t0(s.value.back,u,s.value.forward,!0),c,{position:s.value.position});r(u,f,!0),n.value=u}function o(u,c){const f=Ye({},s.value,e.state,{forward:u,scroll:Xu()});r(f.current,f,!0);const g=Ye({},t0(n.value,u,null),{position:f.position+1},c);r(u,g,!1),n.value=u}return{location:n,state:s,push:o,replace:a}}function dO(t){t=tO(t);const e=cO(t),i=uO(t,e.state,e.location,e.replace);function n(r,a=!0){a||i.pauseListeners(),history.go(r)}const s=Ye({location:"",base:t,go:n,createHref:nO.bind(null,t)},e,i);return Object.defineProperty(s,"location",{enumerable:!0,get:()=>e.location.value}),Object.defineProperty(s,"state",{enumerable:!0,get:()=>e.state.value}),s}function hO(t){return t=location.host?t||location.pathname+location.search:"",t.includes("#")||(t+="#"),dO(t)}function gT(t){return typeof t=="string"||t&&typeof t=="object"}function mT(t){return typeof t=="string"||typeof t=="symbol"}const yT=Symbol("");var i0;(function(t){t[t.aborted=4]="aborted",t[t.cancelled=8]="cancelled",t[t.duplicated=16]="duplicated"})(i0||(i0={}));function Nr(t,e){return Ye(new Error,{type:t,[yT]:!0},e)}function Tn(t,e){return t instanceof Error&&yT in t&&(e==null||!!(t.type&e))}const n0="[^/]+?",fO={sensitive:!1,strict:!1,start:!0,end:!0},pO=/[.+*?^${}()[\]/\\]/g;function gO(t,e){const i=Ye({},fO,e),n=[];let s=i.start?"^":"";const r=[];for(const c of t){const f=c.length?[]:[90];i.strict&&!c.length&&(s+="/");for(let g=0;ge.length?e.length===1&&e[0]===80?1:-1:0}function _T(t,e){let i=0;const n=t.score,s=e.score;for(;i0&&e[e.length-1]<0}const yO={type:0,value:""},_O=/[a-zA-Z0-9_]/;function vO(t){if(!t)return[[]];if(t==="/")return[[yO]];if(!t.startsWith("/"))throw new Error(`Invalid path "${t}"`);function e(_){throw new Error(`ERR (${i})/"${c}": ${_}`)}let i=0,n=i;const s=[];let r;function a(){r&&s.push(r),r=[]}let o=0,u,c="",f="";function g(){c&&(i===0?r.push({type:0,value:c}):i===1||i===2||i===3?(r.length>1&&(u==="*"||u==="+")&&e(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),r.push({type:1,value:c,regexp:f,repeatable:u==="*"||u==="+",optional:u==="*"||u==="?"})):e("Invalid state to consume buffer"),c="")}function y(){c+=u}for(;o{a(w)}:Va}function a(g){if(mT(g)){const y=n.get(g);y&&(n.delete(g),i.splice(i.indexOf(y),1),y.children.forEach(a),y.alias.forEach(a))}else{const y=i.indexOf(g);y>-1&&(i.splice(y,1),g.record.name&&n.delete(g.record.name),g.children.forEach(a),g.alias.forEach(a))}}function o(){return i}function u(g){const y=EO(g,i);i.splice(y,0,g),g.record.name&&!o0(g)&&n.set(g.record.name,g)}function c(g,y){let _,x={},b,A;if("name"in g&&g.name){if(_=n.get(g.name),!_)throw Nr(1,{location:g});A=_.record.name,x=Ye(r0(y.params,_.keys.filter(w=>!w.optional).concat(_.parent?_.parent.keys.filter(w=>w.optional):[]).map(w=>w.name)),g.params&&r0(g.params,_.keys.map(w=>w.name))),b=_.stringify(x)}else if(g.path!=null)b=g.path,_=i.find(w=>w.re.test(b)),_&&(x=_.parse(b),A=_.record.name);else{if(_=y.name?n.get(y.name):i.find(w=>w.re.test(y.path)),!_)throw Nr(1,{location:g,currentLocation:y});A=_.record.name,x=Ye({},y.params,g.params),b=_.stringify(x)}const L=[];let C=_;for(;C;)L.unshift(C.record),C=C.parent;return{name:A,path:b,params:x,matched:L,meta:SO(L)}}t.forEach(g=>r(g));function f(){i.length=0,n.clear()}return{addRoute:r,resolve:c,removeRoute:a,clearRoutes:f,getRoutes:o,getRecordMatcher:s}}function r0(t,e){const i={};for(const n of e)n in t&&(i[n]=t[n]);return i}function a0(t){const e={path:t.path,redirect:t.redirect,name:t.name,meta:t.meta||{},aliasOf:t.aliasOf,beforeEnter:t.beforeEnter,props:xO(t),children:t.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in t?t.components||null:t.component&&{default:t.component}};return Object.defineProperty(e,"mods",{value:{}}),e}function xO(t){const e={},i=t.props||!1;if("component"in t)e.default=i;else for(const n in t.components)e[n]=typeof i=="object"?i[n]:i;return e}function o0(t){for(;t;){if(t.record.aliasOf)return!0;t=t.parent}return!1}function SO(t){return t.reduce((e,i)=>Ye(e,i.meta),{})}function l0(t,e){const i={};for(const n in t)i[n]=n in e?e[n]:t[n];return i}function EO(t,e){let i=0,n=e.length;for(;i!==n;){const r=i+n>>1;_T(t,e[r])<0?n=r:i=r+1}const s=CO(t);return s&&(n=e.lastIndexOf(s,n-1)),n}function CO(t){let e=t;for(;e=e.parent;)if(vT(e)&&_T(t,e)===0)return e}function vT({record:t}){return!!(t.name||t.components&&Object.keys(t.components).length||t.redirect)}function wO(t){const e={};if(t===""||t==="?")return e;const n=(t[0]==="?"?t.slice(1):t).split("&");for(let s=0;sr&&vh(r)):[n&&vh(n)]).forEach(r=>{r!==void 0&&(e+=(e.length?"&":"")+i,r!=null&&(e+="="+r))})}return e}function AO(t){const e={};for(const i in t){const n=t[i];n!==void 0&&(e[i]=vi(n)?n.map(s=>s==null?null:""+s):n==null?n:""+n)}return e}const DO=Symbol(""),c0=Symbol(""),Yu=Symbol(""),Uf=Symbol(""),Th=Symbol("");function va(){let t=[];function e(n){return t.push(n),()=>{const s=t.indexOf(n);s>-1&&t.splice(s,1)}}function i(){t=[]}return{add:e,list:()=>t.slice(),reset:i}}function Zn(t,e,i,n,s,r=a=>a()){const a=n&&(n.enterCallbacks[s]=n.enterCallbacks[s]||[]);return()=>new Promise((o,u)=>{const c=y=>{y===!1?u(Nr(4,{from:i,to:e})):y instanceof Error?u(y):gT(y)?u(Nr(2,{from:e,to:y})):(a&&n.enterCallbacks[s]===a&&typeof y=="function"&&a.push(y),o())},f=r(()=>t.call(n&&n.instances[s],e,i,c));let g=Promise.resolve(f);t.length<3&&(g=g.then(c)),g.catch(y=>u(y))})}function _d(t,e,i,n,s=r=>r()){const r=[];for(const a of t)for(const o in a.components){let u=a.components[o];if(!(e!=="beforeRouteEnter"&&!a.instances[o]))if(oT(u)){const f=(u.__vccOpts||u)[e];f&&r.push(Zn(f,i,n,a,o,s))}else{let c=u();r.push(()=>c.then(f=>{if(!f)throw new Error(`Couldn't resolve component "${o}" at "${a.path}"`);const g=MP(f)?f.default:f;a.mods[o]=f,a.components[o]=g;const _=(g.__vccOpts||g)[e];return _&&Zn(_,i,n,a,o,s)()}))}}return r}function d0(t){const e=Ii(Yu),i=Ii(Uf),n=oe(()=>{const u=ts(t.to);return e.resolve(u)}),s=oe(()=>{const{matched:u}=n.value,{length:c}=u,f=u[c-1],g=i.matched;if(!f||!g.length)return-1;const y=g.findIndex(os.bind(null,f));if(y>-1)return y;const _=h0(u[c-2]);return c>1&&h0(f)===_&&g[g.length-1].path!==_?g.findIndex(os.bind(null,u[c-2])):y}),r=oe(()=>s.value>-1&&LO(i.params,n.value.params)),a=oe(()=>s.value>-1&&s.value===i.matched.length-1&&fT(i.params,n.value.params));function o(u={}){if(OO(u)){const c=e[ts(t.replace)?"replace":"push"](ts(t.to)).catch(Va);return t.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>c),c}return Promise.resolve()}if(En){const u=yt();if(u){const c={route:n.value,isActive:r.value,isExactActive:a.value,error:null};u.__vrl_devtools=u.__vrl_devtools||[],u.__vrl_devtools.push(c),IS(()=>{c.route=n.value,c.isActive=r.value,c.isExactActive=a.value,c.error=gT(ts(t.to))?null:'Invalid "to" value'},{flush:"post"})}}return{route:n,href:oe(()=>n.value.href),isActive:r,isExactActive:a,navigate:o}}function kO(t){return t.length===1?t[0]:t}const IO=Tu({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:d0,setup(t,{slots:e}){const i=Fr(d0(t)),{options:n}=Ii(Yu),s=oe(()=>({[f0(t.activeClass,n.linkActiveClass,"router-link-active")]:i.isActive,[f0(t.exactActiveClass,n.linkExactActiveClass,"router-link-exact-active")]:i.isExactActive}));return()=>{const r=e.default&&kO(e.default(i));return t.custom?r:ue("a",{"aria-current":i.isExactActive?t.ariaCurrentValue:null,href:i.href,onClick:i.navigate,class:s.value},r)}}}),PO=IO;function OO(t){if(!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)&&!t.defaultPrevented&&!(t.button!==void 0&&t.button!==0)){if(t.currentTarget&&t.currentTarget.getAttribute){const e=t.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return t.preventDefault&&t.preventDefault(),!0}}function LO(t,e){for(const i in e){const n=e[i],s=t[i];if(typeof n=="string"){if(n!==s)return!1}else if(!vi(s)||s.length!==n.length||n.some((r,a)=>r!==s[a]))return!1}return!0}function h0(t){return t?t.aliasOf?t.aliasOf.path:t.path:""}const f0=(t,e,i)=>t??e??i,RO=Tu({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(t,{attrs:e,slots:i}){const n=Ii(Th),s=oe(()=>t.route||n.value),r=Ii(c0,0),a=oe(()=>{let c=ts(r);const{matched:f}=s.value;let g;for(;(g=f[c])&&!g.components;)c++;return c}),o=oe(()=>s.value.matched[a.value]);gl(c0,oe(()=>a.value+1)),gl(DO,o),gl(Th,s);const u=Ge();return tt(()=>[u.value,o.value,t.name],([c,f,g],[y,_,x])=>{f&&(f.instances[g]=c,_&&_!==f&&c&&c===y&&(f.leaveGuards.size||(f.leaveGuards=_.leaveGuards),f.updateGuards.size||(f.updateGuards=_.updateGuards))),c&&f&&(!_||!os(f,_)||!y)&&(f.enterCallbacks[g]||[]).forEach(b=>b(c))},{flush:"post"}),()=>{const c=s.value,f=t.name,g=o.value,y=g&&g.components[f];if(!y)return p0(i.default,{Component:y,route:c});const _=g.props[f],x=_?_===!0?c.params:typeof _=="function"?_(c):_:null,A=ue(y,Ye({},x,e,{onVnodeUnmounted:L=>{L.component.isUnmounted&&(g.instances[f]=null)},ref:u}));if(En&&A.ref){const L={depth:a.value,name:g.name,path:g.path,meta:g.meta};(vi(A.ref)?A.ref.map(w=>w.i):[A.ref.i]).forEach(w=>{w.__vrv_devtools=L})}return p0(i.default,{Component:A,route:c})||A}}});function p0(t,e){if(!t)return null;const i=t(e);return i.length===1?i[0]:i}const MO=RO;function ba(t,e){const i=Ye({},t,{matched:t.matched.map(n=>WO(n,["instances","children","aliasOf"]))});return{_custom:{type:null,readOnly:!0,display:t.fullPath,tooltip:e,value:i}}}function rl(t){return{_custom:{display:t}}}let NO=0;function BO(t,e,i){if(e.__hasDevtools)return;e.__hasDevtools=!0;const n=NO++;RP({id:"org.vuejs.router"+(n?"."+n:""),label:"Vue Router",packageName:"vue-router",homepage:"https://router.vuejs.org",logo:"https://router.vuejs.org/logo.png",componentStateTypes:["Routing"],app:t},s=>{typeof s.now!="function"&&console.warn("[Vue Router]: You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html."),s.on.inspectComponent((f,g)=>{f.instanceData&&f.instanceData.state.push({type:"Routing",key:"$route",editable:!1,value:ba(e.currentRoute.value,"Current Route")})}),s.on.visitComponentTree(({treeNode:f,componentInstance:g})=>{if(g.__vrv_devtools){const y=g.__vrv_devtools;f.tags.push({label:(y.name?`${y.name.toString()}: `:"")+y.path,textColor:0,tooltip:"This component is rendered by <router-view>",backgroundColor:bT})}vi(g.__vrl_devtools)&&(g.__devtoolsApi=s,g.__vrl_devtools.forEach(y=>{let _=y.route.path,x=ST,b="",A=0;y.error?(_=y.error,x=jO,A=VO):y.isExactActive?(x=xT,b="This is exactly active"):y.isActive&&(x=TT,b="This link is active"),f.tags.push({label:_,textColor:A,tooltip:b,backgroundColor:x})}))}),tt(e.currentRoute,()=>{u(),s.notifyComponentUpdate(),s.sendInspectorTree(o),s.sendInspectorState(o)});const r="router:navigations:"+n;s.addTimelineLayer({id:r,label:`Router${n?" "+n:""} Navigations`,color:4237508}),e.onError((f,g)=>{s.addTimelineEvent({layerId:r,event:{title:"Error during Navigation",subtitle:g.fullPath,logType:"error",time:s.now(),data:{error:f},groupId:g.meta.__navigationId}})});let a=0;e.beforeEach((f,g)=>{const y={guard:rl("beforeEach"),from:ba(g,"Current Location during this navigation"),to:ba(f,"Target location")};Object.defineProperty(f.meta,"__navigationId",{value:a++}),s.addTimelineEvent({layerId:r,event:{time:s.now(),title:"Start of navigation",subtitle:f.fullPath,data:y,groupId:f.meta.__navigationId}})}),e.afterEach((f,g,y)=>{const _={guard:rl("afterEach")};y?(_.failure={_custom:{type:Error,readOnly:!0,display:y?y.message:"",tooltip:"Navigation Failure",value:y}},_.status=rl("❌")):_.status=rl("✅"),_.from=ba(g,"Current Location during this navigation"),_.to=ba(f,"Target location"),s.addTimelineEvent({layerId:r,event:{title:"End of navigation",subtitle:f.fullPath,time:s.now(),data:_,logType:y?"warning":"default",groupId:f.meta.__navigationId}})});const o="router-inspector:"+n;s.addInspector({id:o,label:"Routes"+(n?" "+n:""),icon:"book",treeFilterPlaceholder:"Search routes"});function u(){if(!c)return;const f=c;let g=i.getRoutes().filter(y=>!y.parent||!y.parent.record.components);g.forEach(wT),f.filter&&(g=g.filter(y=>xh(y,f.filter.toLowerCase()))),g.forEach(y=>CT(y,e.currentRoute.value)),f.rootNodes=g.map(ET)}let c;s.on.getInspectorTree(f=>{c=f,f.app===t&&f.inspectorId===o&&u()}),s.on.getInspectorState(f=>{if(f.app===t&&f.inspectorId===o){const y=i.getRoutes().find(_=>_.record.__vd_id===f.nodeId);y&&(f.state={options:UO(y)})}}),s.sendInspectorTree(o),s.sendInspectorState(o)})}function FO(t){return t.optional?t.repeatable?"*":"?":t.repeatable?"+":""}function UO(t){const{record:e}=t,i=[{editable:!1,key:"path",value:e.path}];return e.name!=null&&i.push({editable:!1,key:"name",value:e.name}),i.push({editable:!1,key:"regexp",value:t.re}),t.keys.length&&i.push({editable:!1,key:"keys",value:{_custom:{type:null,readOnly:!0,display:t.keys.map(n=>`${n.name}${FO(n)}`).join(" "),tooltip:"Param keys",value:t.keys}}}),e.redirect!=null&&i.push({editable:!1,key:"redirect",value:e.redirect}),t.alias.length&&i.push({editable:!1,key:"aliases",value:t.alias.map(n=>n.record.path)}),Object.keys(t.record.meta).length&&i.push({editable:!1,key:"meta",value:t.record.meta}),i.push({key:"score",editable:!1,value:{_custom:{type:null,readOnly:!0,display:t.score.map(n=>n.join(", ")).join(" | "),tooltip:"Score used to sort routes",value:t.score}}}),i}const bT=15485081,TT=2450411,xT=8702998,qO=2282478,ST=16486972,$O=6710886,jO=16704226,VO=12131356;function ET(t){const e=[],{record:i}=t;i.name!=null&&e.push({label:String(i.name),textColor:0,backgroundColor:qO}),i.aliasOf&&e.push({label:"alias",textColor:0,backgroundColor:ST}),t.__vd_match&&e.push({label:"matches",textColor:0,backgroundColor:bT}),t.__vd_exactActive&&e.push({label:"exact",textColor:0,backgroundColor:xT}),t.__vd_active&&e.push({label:"active",textColor:0,backgroundColor:TT}),i.redirect&&e.push({label:typeof i.redirect=="string"?`redirect: ${i.redirect}`:"redirects",textColor:16777215,backgroundColor:$O});let n=i.__vd_id;return n==null&&(n=String(HO++),i.__vd_id=n),{id:n,label:i.path,tags:e,children:t.children.map(ET)}}let HO=0;const zO=/^\/(.*)\/([a-z]*)$/;function CT(t,e){const i=e.matched.length&&os(e.matched[e.matched.length-1],t.record);t.__vd_exactActive=t.__vd_active=i,i||(t.__vd_active=e.matched.some(n=>os(n,t.record))),t.children.forEach(n=>CT(n,e))}function wT(t){t.__vd_match=!1,t.children.forEach(wT)}function xh(t,e){const i=String(t.re).match(zO);if(t.__vd_match=!1,!i||i.length<3)return!1;if(new RegExp(i[1].replace(/\$$/,""),i[2]).test(e))return t.children.forEach(a=>xh(a,e)),t.record.path!=="/"||e==="/"?(t.__vd_match=t.re.test(e),!0):!1;const s=t.record.path.toLowerCase(),r=Mr(s);return!e.startsWith("/")&&(r.includes(e)||s.includes(e))||r.startsWith(e)||s.startsWith(e)||t.record.name&&String(t.record.name).includes(e)?!0:t.children.some(a=>xh(a,e))}function WO(t,e){const i={};for(const n in t)e.includes(n)||(i[n]=t[n]);return i}function GO(t){const e=TO(t.routes,t),i=t.parseQuery||wO,n=t.stringifyQuery||u0,s=t.history,r=va(),a=va(),o=va(),u=fl(zn);let c=zn;En&&t.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const f=md.bind(null,te=>""+te),g=md.bind(null,KP),y=md.bind(null,Mr);function _(te,ye){let ve,we;return mT(te)?(ve=e.getRecordMatcher(te),we=ye):we=te,e.addRoute(we,ve)}function x(te){const ye=e.getRecordMatcher(te);ye&&e.removeRoute(ye)}function b(){return e.getRoutes().map(te=>te.record)}function A(te){return!!e.getRecordMatcher(te)}function L(te,ye){if(ye=Ye({},ye||u.value),typeof te=="string"){const j=yd(i,te,ye.path),ee=e.resolve({path:j.path},ye),he=s.createHref(j.fullPath);return Ye(j,ee,{params:y(ee.params),hash:Mr(j.hash),redirectedFrom:void 0,href:he})}let ve;if(te.path!=null)ve=Ye({},te,{path:yd(i,te.path,ye.path).path});else{const j=Ye({},te.params);for(const ee in j)j[ee]==null&&delete j[ee];ve=Ye({},te,{params:g(j)}),ye.params=g(ye.params)}const we=e.resolve(ve,ye),Be=te.hash||"";we.params=f(y(we.params));const ze=QP(n,Ye({},te,{hash:zP(Be),path:we.path})),M=s.createHref(ze);return Ye({fullPath:ze,hash:Be,query:n===u0?AO(te.query):te.query||{}},we,{redirectedFrom:void 0,href:M})}function C(te){return typeof te=="string"?yd(i,te,u.value.path):Ye({},te)}function w(te,ye){if(c!==te)return Nr(8,{from:ye,to:te})}function R(te){return H(te)}function O(te){return R(Ye(C(te),{replace:!0}))}function U(te){const ye=te.matched[te.matched.length-1];if(ye&&ye.redirect){const{redirect:ve}=ye;let we=typeof ve=="function"?ve(te):ve;return typeof we=="string"&&(we=we.includes("?")||we.includes("#")?we=C(we):{path:we},we.params={}),Ye({query:te.query,hash:te.hash,params:we.path!=null?{}:te.params},we)}}function H(te,ye){const ve=c=L(te),we=u.value,Be=te.state,ze=te.force,M=te.replace===!0,j=U(ve);if(j)return H(Ye(C(j),{state:typeof j=="object"?Ye({},Be,j.state):Be,force:ze,replace:M}),ye||ve);const ee=ve;ee.redirectedFrom=ye;let he;return!ze&&JP(n,we,ve)&&(he=Nr(16,{to:ee,from:we}),re(we,we,!0,!1)),(he?Promise.resolve(he):S(ee,we)).catch(ce=>Tn(ce)?Tn(ce,2)?ce:se(ce):W(ce,ee,we)).then(ce=>{if(ce){if(Tn(ce,2))return H(Ye({replace:M},C(ce.to),{state:typeof ce.to=="object"?Ye({},Be,ce.to.state):Be,force:ze}),ye||ee)}else ce=k(ee,we,!0,M,Be);return B(ee,we,ce),ce})}function X(te,ye){const ve=w(te,ye);return ve?Promise.reject(ve):Promise.resolve()}function T(te){const ye=Ie.values().next().value;return ye&&typeof ye.runWithContext=="function"?ye.runWithContext(te):te()}function S(te,ye){let ve;const[we,Be,ze]=KO(te,ye);ve=_d(we.reverse(),"beforeRouteLeave",te,ye);for(const j of we)j.leaveGuards.forEach(ee=>{ve.push(Zn(ee,te,ye))});const M=X.bind(null,te,ye);return ve.push(M),Se(ve).then(()=>{ve=[];for(const j of r.list())ve.push(Zn(j,te,ye));return ve.push(M),Se(ve)}).then(()=>{ve=_d(Be,"beforeRouteUpdate",te,ye);for(const j of Be)j.updateGuards.forEach(ee=>{ve.push(Zn(ee,te,ye))});return ve.push(M),Se(ve)}).then(()=>{ve=[];for(const j of ze)if(j.beforeEnter)if(vi(j.beforeEnter))for(const ee of j.beforeEnter)ve.push(Zn(ee,te,ye));else ve.push(Zn(j.beforeEnter,te,ye));return ve.push(M),Se(ve)}).then(()=>(te.matched.forEach(j=>j.enterCallbacks={}),ve=_d(ze,"beforeRouteEnter",te,ye,T),ve.push(M),Se(ve))).then(()=>{ve=[];for(const j of a.list())ve.push(Zn(j,te,ye));return ve.push(M),Se(ve)}).catch(j=>Tn(j,8)?j:Promise.reject(j))}function B(te,ye,ve){o.list().forEach(we=>T(()=>we(te,ye,ve)))}function k(te,ye,ve,we,Be){const ze=w(te,ye);if(ze)return ze;const M=ye===zn,j=En?history.state:{};ve&&(we||M?s.replace(te.fullPath,Ye({scroll:M&&j&&j.scroll},Be)):s.push(te.fullPath,Be)),u.value=te,re(te,ye,ve,M),se()}let V;function F(){V||(V=s.listen((te,ye,ve)=>{if(!De.listening)return;const we=L(te),Be=U(we);if(Be){H(Ye(Be,{replace:!0,force:!0}),we).catch(Va);return}c=we;const ze=u.value;En&&aO(e0(ze.fullPath,ve.delta),Xu()),S(we,ze).catch(M=>Tn(M,12)?M:Tn(M,2)?(H(Ye(C(M.to),{force:!0}),we).then(j=>{Tn(j,20)&&!ve.delta&&ve.type===ro.pop&&s.go(-1,!1)}).catch(Va),Promise.reject()):(ve.delta&&s.go(-ve.delta,!1),W(M,we,ze))).then(M=>{M=M||k(we,ze,!1),M&&(ve.delta&&!Tn(M,8)?s.go(-ve.delta,!1):ve.type===ro.pop&&Tn(M,20)&&s.go(-1,!1)),B(we,ze,M)}).catch(Va)}))}let Y=va(),Z=va(),G;function W(te,ye,ve){se(te);const we=Z.list();return we.length?we.forEach(Be=>Be(te,ye,ve)):console.error(te),Promise.reject(te)}function Q(){return G&&u.value!==zn?Promise.resolve():new Promise((te,ye)=>{Y.add([te,ye])})}function se(te){return G||(G=!te,F(),Y.list().forEach(([ye,ve])=>te?ve(te):ye()),Y.reset()),te}function re(te,ye,ve,we){const{scrollBehavior:Be}=t;if(!En||!Be)return Promise.resolve();const ze=!ve&&oO(e0(te.fullPath,0))||(we||!ve)&&history.state&&history.state.scroll||null;return gi().then(()=>Be(te,ye,ze)).then(M=>M&&rO(M)).catch(M=>W(M,te,ye))}const ne=te=>s.go(te);let Ce;const Ie=new Set,De={currentRoute:u,listening:!0,addRoute:_,removeRoute:x,clearRoutes:e.clearRoutes,hasRoute:A,getRoutes:b,resolve:L,options:t,push:R,replace:O,go:ne,back:()=>ne(-1),forward:()=>ne(1),beforeEach:r.add,beforeResolve:a.add,afterEach:o.add,onError:Z.add,isReady:Q,install(te){const ye=this;te.component("RouterLink",PO),te.component("RouterView",MO),te.config.globalProperties.$router=ye,Object.defineProperty(te.config.globalProperties,"$route",{enumerable:!0,get:()=>ts(u)}),En&&!Ce&&u.value===zn&&(Ce=!0,R(s.location).catch(Be=>{}));const ve={};for(const Be in zn)Object.defineProperty(ve,Be,{get:()=>u.value[Be],enumerable:!0});te.provide(Yu,ye),te.provide(Uf,dy(ve)),te.provide(Th,u);const we=te.unmount;Ie.add(te),te.unmount=function(){Ie.delete(te),Ie.size<1&&(c=zn,V&&V(),V=null,u.value=zn,Ce=!1,G=!1),we()},En&&BO(te,ye,e)}};function Se(te){return te.reduce((ye,ve)=>ye.then(()=>T(ve)),Promise.resolve())}return De}function KO(t,e){const i=[],n=[],s=[],r=Math.max(e.matched.length,t.matched.length);for(let a=0;aos(c,o))?n.push(o):i.push(o));const u=t.matched[a];u&&(e.matched.find(c=>os(c,u))||s.push(u))}return[i,n,s]}function ER(){return Ii(Yu)}function CR(t){return Ii(Uf)}const XO=[{path:"/",component:()=>xn(()=>import("./MainLayout-CoehIdCA.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])),children:[{path:"/",name:"home",component:()=>xn(()=>import("./IndexPage-DuIKlpVx.js"),__vite__mapDeps([10,6,1,11,12,7,8,3,13,4,14]))},{path:"/level",name:"level",component:()=>xn(()=>import("./Level-0vOa2YqY.js"),__vite__mapDeps([15,11,12,3,13,4,7,8,16]))},{path:"/more",name:"more",component:()=>xn(()=>import("./More-BZQ-Z8BP.js"),__vite__mapDeps([17,6,11,12,3,13,4,7,8,18]))}]},{path:"/login",name:"login",component:()=>xn(()=>import("./Login-CujoDjOq.js"),__vite__mapDeps([19,2,3,4,5,20,11,12,21]))},{path:"/reg",name:"reg",component:()=>xn(()=>import("./Reg-B6ynSNzS.js"),__vite__mapDeps([22,2,3,4,5,20,11,12,23]))},{path:"/forbidden",name:"forbidden",component:()=>xn(()=>import("./Forbidden-DzEG47dH.js"),__vite__mapDeps([24,3]))},{path:"/:catchAll(.*)*",component:()=>xn(()=>import("./ErrorNotFound-B-u5z--J.js"),[])}],vd=wP(function(){return GO({scrollBehavior:()=>({left:0,top:0}),routes:XO,history:hO("/")})});async function YO(t,e){const i=t(CP);i.use(nC,e);const n=lo(typeof vd=="function"?await vd({}):vd);return{app:i,router:n}}const Sh={xs:18,sm:24,md:32,lg:38,xl:46},To={size:String};function xo(t,e=Sh){return oe(()=>t.size!==void 0?{fontSize:t.size in e?`${e[t.size]}px`:t.size}:null)}function Hi(t,e){return t!==void 0&&t()||e}function wR(t,e){if(t!==void 0){const i=t();if(i!=null)return i.slice()}return e}function ks(t,e){return t!==void 0?e.concat(t()):e}function QO(t,e){return t===void 0?e:e!==void 0?e.concat(t()):t()}function AR(t,e,i,n,s,r){e.key=n+s;const a=ue(t,e,i);return s===!0?Ty(a,r()):a}const g0="0 0 24 24",m0=t=>t,bd=t=>`ionicons ${t}`,AT={"mdi-":t=>`mdi ${t}`,"icon-":m0,"bt-":t=>`bt ${t}`,"eva-":t=>`eva ${t}`,"ion-md":bd,"ion-ios":bd,"ion-logo":bd,"iconfont ":m0,"ti-":t=>`themify-icon ${t}`,"bi-":t=>`bootstrap-icons ${t}`},DT={o_:"-outlined",r_:"-round",s_:"-sharp"},kT={sym_o_:"-outlined",sym_r_:"-rounded",sym_s_:"-sharp"},JO=new RegExp("^("+Object.keys(AT).join("|")+")"),ZO=new RegExp("^("+Object.keys(DT).join("|")+")"),y0=new RegExp("^("+Object.keys(kT).join("|")+")"),eL=/^[Mm]\s?[-+]?\.?\d/,tL=/^img:/,iL=/^svguse:/,nL=/^ion-/,sL=/^(fa-(classic|sharp|solid|regular|light|brands|duotone|thin)|[lf]a[srlbdk]?) /,On=Nt({name:"QIcon",props:{...To,tag:{type:String,default:"i"},name:String,color:String,left:Boolean,right:Boolean},setup(t,{slots:e}){const{proxy:{$q:i}}=yt(),n=xo(t),s=oe(()=>"q-icon"+(t.left===!0?" on-left":"")+(t.right===!0?" on-right":"")+(t.color!==void 0?` text-${t.color}`:"")),r=oe(()=>{let a,o=t.name;if(o==="none"||!o)return{none:!0};if(i.iconMapFn!==null){const f=i.iconMapFn(o);if(f!==void 0)if(f.icon!==void 0){if(o=f.icon,o==="none"||!o)return{none:!0}}else return{cls:f.cls,content:f.content!==void 0?f.content:" "}}if(eL.test(o)===!0){const[f,g=g0]=o.split("|");return{svg:!0,viewBox:g,nodes:f.split("&&").map(y=>{const[_,x,b]=y.split("@@");return ue("path",{style:x,d:_,transform:b})})}}if(tL.test(o)===!0)return{img:!0,src:o.substring(4)};if(iL.test(o)===!0){const[f,g=g0]=o.split("|");return{svguse:!0,src:f.substring(7),viewBox:g}}let u=" ";const c=o.match(JO);if(c!==null)a=AT[c[1]](o);else if(sL.test(o)===!0)a=o;else if(nL.test(o)===!0)a=`ionicons ion-${i.platform.is.ios===!0?"ios":"md"}${o.substring(3)}`;else if(y0.test(o)===!0){a="notranslate material-symbols";const f=o.match(y0);f!==null&&(o=o.substring(6),a+=kT[f[1]]),u=o}else{a="notranslate material-icons";const f=o.match(ZO);f!==null&&(o=o.substring(2),a+=DT[f[1]]),u=o}return{cls:a,content:u}});return()=>{const a={class:s.value,style:n.value,"aria-hidden":"true",role:"presentation"};return r.value.none===!0?ue(t.tag,a,Hi(e.default)):r.value.img===!0?ue(t.tag,a,ks(e.default,[ue("img",{src:r.value.src})])):r.value.svg===!0?ue(t.tag,a,ks(e.default,[ue("svg",{viewBox:r.value.viewBox||"0 0 24 24"},r.value.nodes)])):r.value.svguse===!0?ue(t.tag,a,ks(e.default,[ue("svg",{viewBox:r.value.viewBox},[ue("use",{"xlink:href":r.value.src})])])):(r.value.cls!==void 0&&(a.class+=" "+r.value.cls),ue(t.tag,a,ks(e.default,[r.value.content])))}}}),rL=Nt({name:"QAvatar",props:{...To,fontSize:String,color:String,textColor:String,icon:String,square:Boolean,rounded:Boolean},setup(t,{slots:e}){const i=xo(t),n=oe(()=>"q-avatar"+(t.color?` bg-${t.color}`:"")+(t.textColor?` text-${t.textColor} q-chip--colored`:"")+(t.square===!0?" q-avatar--square":t.rounded===!0?" rounded-borders":"")),s=oe(()=>t.fontSize?{fontSize:t.fontSize}:null);return()=>{const r=t.icon!==void 0?[ue(On,{name:t.icon})]:void 0;return ue("div",{class:n.value,style:i.value},[ue("div",{class:"q-avatar__content row flex-center overflow-hidden",style:s.value},QO(e.default,r))])}}}),aL={size:{type:[String,Number],default:"1em"},color:String};function oL(t){return{cSize:oe(()=>t.size in Sh?`${Sh[t.size]}px`:t.size),classes:oe(()=>"q-spinner"+(t.color?` text-${t.color}`:""))}}const ao=Nt({name:"QSpinner",props:{...aL,thickness:{type:Number,default:5}},setup(t){const{cSize:e,classes:i}=oL(t);return()=>ue("svg",{class:i.value+" q-spinner-mat",width:e.value,height:e.value,viewBox:"25 25 50 50"},[ue("circle",{class:"path",cx:"50",cy:"50",r:"20",fill:"none",stroke:"currentColor","stroke-width":t.thickness,"stroke-miterlimit":"10"})])}});function Eh(t,e){const i=t.style;for(const n in e)i[n]=e[n]}function lL(t){if(t==null)return;if(typeof t=="string")try{return document.querySelector(t)||void 0}catch{return}const e=ts(t);if(e)return e.$el||e}function uL(t,e){if(t==null||t.contains(e)===!0)return!0;for(let i=t.nextElementSibling;i!==null;i=i.nextElementSibling)if(i.contains(e))return!0;return!1}function cL(t,e=250){let i=!1,n;return function(){return i===!1&&(i=!0,setTimeout(()=>{i=!1},e),n=t.apply(this,arguments)),n}}function _0(t,e,i,n){i.modifiers.stop===!0&&Ul(t);const s=i.modifiers.color;let r=i.modifiers.center;r=r===!0||n===!0;const a=document.createElement("span"),o=document.createElement("span"),u=BE(t),{left:c,top:f,width:g,height:y}=e.getBoundingClientRect(),_=Math.sqrt(g*g+y*y),x=_/2,b=`${(g-_)/2}px`,A=r?b:`${u.left-c-x}px`,L=`${(y-_)/2}px`,C=r?L:`${u.top-f-x}px`;o.className="q-ripple__inner",Eh(o,{height:`${_}px`,width:`${_}px`,transform:`translate3d(${A},${C},0) scale3d(.2,.2,1)`,opacity:0}),a.className=`q-ripple${s?" text-"+s:""}`,a.setAttribute("dir","ltr"),a.appendChild(o),e.appendChild(a);const w=()=>{a.remove(),clearTimeout(R)};i.abort.push(w);let R=setTimeout(()=>{o.classList.add("q-ripple__inner--enter"),o.style.transform=`translate3d(${b},${L},0) scale3d(1,1,1)`,o.style.opacity=.2,R=setTimeout(()=>{o.classList.remove("q-ripple__inner--enter"),o.classList.add("q-ripple__inner--leave"),o.style.opacity=0,R=setTimeout(()=>{a.remove(),i.abort.splice(i.abort.indexOf(w),1)},275)},250)},50)}function v0(t,{modifiers:e,value:i,arg:n}){const s=Object.assign({},t.cfg.ripple,e,i);t.modifiers={early:s.early===!0,stop:s.stop===!0,center:s.center===!0,color:s.color||n,keyCodes:[].concat(s.keyCodes||13)}}const dL=NE({name:"ripple",beforeMount(t,e){const i=e.instance.$.appContext.config.globalProperties.$q.config||{};if(i.ripple===!1)return;const n={cfg:i,enabled:e.value!==!1,modifiers:{},abort:[],start(s){n.enabled===!0&&s.qSkipRipple!==!0&&s.type===(n.modifiers.early===!0?"pointerdown":"click")&&_0(s,t,n,s.qKeyEvent===!0)},keystart:cL(s=>{n.enabled===!0&&s.qSkipRipple!==!0&&Za(s,n.modifiers.keyCodes)===!0&&s.type===`key${n.modifiers.early===!0?"down":"up"}`&&_0(s,t,n,!0)},300)};v0(n,e),t.__qripple=n,UE(n,"main",[[t,"pointerdown","start","passive"],[t,"click","start","passive"],[t,"keydown","keystart","passive"],[t,"keyup","keystart","passive"]])},updated(t,e){if(e.oldValue!==e.value){const i=t.__qripple;i!==void 0&&(i.enabled=e.value!==!1,i.enabled===!0&&Object(e.value)===e.value&&v0(i,e))}},beforeUnmount(t){const e=t.__qripple;e!==void 0&&(e.abort.forEach(i=>{i()}),qE(e,"main"),delete t._qripple)}}),IT={left:"start",center:"center",right:"end",between:"between",around:"around",evenly:"evenly",stretch:"stretch"},hL=Object.keys(IT),PT={align:{type:String,validator:t=>hL.includes(t)}};function OT(t){return oe(()=>{const e=t.align===void 0?t.vertical===!0?"stretch":"left":t.align;return`${t.vertical===!0?"items":"justify"}-${IT[e]}`})}function Sl(t){if(Object(t.$parent)===t.$parent)return t.$parent;let{parent:e}=t.$;for(;Object(e)===e;){if(Object(e.proxy)===e.proxy)return e.proxy;e=e.parent}}function LT(t){return t.appContext.config.globalProperties.$router!==void 0}function RT(t){return t.isUnmounted===!0||t.isDeactivated===!0}function b0(t){return t?t.aliasOf?t.aliasOf.path:t.path:""}function T0(t,e){return(t.aliasOf||t)===(e.aliasOf||e)}function fL(t,e){for(const i in e){const n=e[i],s=t[i];if(typeof n=="string"){if(n!==s)return!1}else if(Array.isArray(s)===!1||s.length!==n.length||n.some((r,a)=>r!==s[a]))return!1}return!0}function x0(t,e){return Array.isArray(e)===!0?t.length===e.length&&t.every((i,n)=>i===e[n]):t.length===1&&t[0]===e}function pL(t,e){return Array.isArray(t)===!0?x0(t,e):Array.isArray(e)===!0?x0(e,t):t===e}function gL(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const i in t)if(pL(t[i],e[i])===!1)return!1;return!0}const MT={to:[String,Object],replace:Boolean,href:String,target:String,disable:Boolean},DR={...MT,exact:Boolean,activeClass:{type:String,default:"q-router-link--active"},exactActiveClass:{type:String,default:"q-router-link--exact-active"}};function mL({fallbackTag:t,useDisableForRouterLinkProps:e=!0}={}){const i=yt(),{props:n,proxy:s,emit:r}=i,a=LT(i),o=oe(()=>n.disable!==!0&&n.href!==void 0),u=oe(e===!0?()=>a===!0&&n.disable!==!0&&o.value!==!0&&n.to!==void 0&&n.to!==null&&n.to!=="":()=>a===!0&&o.value!==!0&&n.to!==void 0&&n.to!==null&&n.to!==""),c=oe(()=>u.value===!0?C(n.to):null),f=oe(()=>c.value!==null),g=oe(()=>o.value===!0||f.value===!0),y=oe(()=>n.type==="a"||g.value===!0?"a":n.tag||t||"div"),_=oe(()=>o.value===!0?{href:n.href,target:n.target}:f.value===!0?{href:c.value.href,target:n.target}:{}),x=oe(()=>{if(f.value===!1)return-1;const{matched:O}=c.value,{length:U}=O,H=O[U-1];if(H===void 0)return-1;const X=s.$route.matched;if(X.length===0)return-1;const T=X.findIndex(T0.bind(null,H));if(T!==-1)return T;const S=b0(O[U-2]);return U>1&&b0(H)===S&&X[X.length-1].path!==S?X.findIndex(T0.bind(null,O[U-2])):T}),b=oe(()=>f.value===!0&&x.value!==-1&&fL(s.$route.params,c.value.params)),A=oe(()=>b.value===!0&&x.value===s.$route.matched.length-1&&gL(s.$route.params,c.value.params)),L=oe(()=>f.value===!0?A.value===!0?` ${n.exactActiveClass} ${n.activeClass}`:n.exact===!0?"":b.value===!0?` ${n.activeClass}`:"":"");function C(O){try{return s.$router.resolve(O)}catch{}return null}function w(O,{returnRouterError:U,to:H=n.to,replace:X=n.replace}={}){if(n.disable===!0)return O.preventDefault(),Promise.resolve(!1);if(O.metaKey||O.altKey||O.ctrlKey||O.shiftKey||O.button!==void 0&&O.button!==0||n.target==="_blank")return Promise.resolve(!1);O.preventDefault();const T=s.$router[X===!0?"replace":"push"](H);return U===!0?T:T.then(()=>{}).catch(()=>{})}function R(O){if(f.value===!0){const U=H=>w(O,H);r("click",O,U),O.defaultPrevented!==!0&&U()}else r("click",O)}return{hasRouterLink:f,hasHrefLink:o,hasLink:g,linkTag:y,resolvedLink:c,linkIsActive:b,linkIsExactActive:A,linkClass:L,linkAttrs:_,getLink:C,navigateToRouterLink:w,navigateOnClick:R}}const S0={none:0,xs:4,sm:8,md:16,lg:24,xl:32},yL={xs:8,sm:10,md:14,lg:20,xl:24},_L=["button","submit","reset"],vL=/[^\s]\/[^\s]/,bL=["flat","outline","push","unelevated"];function NT(t,e){return t.flat===!0?"flat":t.outline===!0?"outline":t.push===!0?"push":t.unelevated===!0?"unelevated":e}function kR(t){const e=NT(t);return e!==void 0?{[e]:!0}:{}}const TL={...To,...MT,type:{type:String,default:"button"},label:[Number,String],icon:String,iconRight:String,...bL.reduce((t,e)=>(t[e]=Boolean)&&t,{}),square:Boolean,rounded:Boolean,glossy:Boolean,size:String,fab:Boolean,fabMini:Boolean,padding:String,color:String,textColor:String,noCaps:Boolean,noWrap:Boolean,dense:Boolean,tabindex:[Number,String],ripple:{type:[Boolean,Object],default:!0},align:{...PT.align,default:"center"},stack:Boolean,stretch:Boolean,loading:{type:Boolean,default:null},disable:Boolean},xL={...TL,round:Boolean};function SL(t){const e=xo(t,yL),i=OT(t),{hasRouterLink:n,hasLink:s,linkTag:r,linkAttrs:a,navigateOnClick:o}=mL({fallbackTag:"button"}),u=oe(()=>{const A=t.fab===!1&&t.fabMini===!1?e.value:{};return t.padding!==void 0?Object.assign({},A,{padding:t.padding.split(/\s+/).map(L=>L in S0?S0[L]+"px":L).join(" "),minWidth:"0",minHeight:"0"}):A}),c=oe(()=>t.rounded===!0||t.fab===!0||t.fabMini===!0),f=oe(()=>t.disable!==!0&&t.loading!==!0),g=oe(()=>f.value===!0?t.tabindex||0:-1),y=oe(()=>NT(t,"standard")),_=oe(()=>{const A={tabindex:g.value};return s.value===!0?Object.assign(A,a.value):_L.includes(t.type)===!0&&(A.type=t.type),r.value==="a"?(t.disable===!0?A["aria-disabled"]="true":A.href===void 0&&(A.role="button"),n.value!==!0&&vL.test(t.type)===!0&&(A.type=t.type)):t.disable===!0&&(A.disabled="",A["aria-disabled"]="true"),t.loading===!0&&t.percentage!==void 0&&Object.assign(A,{role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":t.percentage}),A}),x=oe(()=>{let A;t.color!==void 0?t.flat===!0||t.outline===!0?A=`text-${t.textColor||t.color}`:A=`bg-${t.color} text-${t.textColor||"white"}`:t.textColor&&(A=`text-${t.textColor}`);const L=t.round===!0?"round":`rectangle${c.value===!0?" q-btn--rounded":t.square===!0?" q-btn--square":""}`;return`q-btn--${y.value} q-btn--${L}`+(A!==void 0?" "+A:"")+(f.value===!0?" q-btn--actionable q-focusable q-hoverable":t.disable===!0?" disabled":"")+(t.fab===!0?" q-btn--fab":t.fabMini===!0?" q-btn--fab-mini":"")+(t.noCaps===!0?" q-btn--no-uppercase":"")+(t.dense===!0?" q-btn--dense":"")+(t.stretch===!0?" no-border-radius self-stretch":"")+(t.glossy===!0?" glossy":"")+(t.square?" q-btn--square":"")}),b=oe(()=>i.value+(t.stack===!0?" column":" row")+(t.noWrap===!0?" no-wrap text-no-wrap":"")+(t.loading===!0?" q-btn__content--hidden":""));return{classes:x,style:u,innerClasses:b,attributes:_,hasLink:s,linkTag:r,navigateOnClick:o,isActionable:f}}const{passiveCapture:wi}=oi;let tr=null,ir=null,nr=null;const Ch=Nt({name:"QBtn",props:{...xL,percentage:Number,darkPercentage:Boolean,onTouchstart:[Function,Array]},emits:["click","keydown","mousedown","keyup"],setup(t,{slots:e,emit:i}){const{proxy:n}=yt(),{classes:s,style:r,innerClasses:a,attributes:o,hasLink:u,linkTag:c,navigateOnClick:f,isActionable:g}=SL(t),y=Ge(null),_=Ge(null);let x=null,b,A=null;const L=oe(()=>t.label!==void 0&&t.label!==null&&t.label!==""),C=oe(()=>t.disable===!0||t.ripple===!1?!1:{keyCodes:u.value===!0?[13,32]:[13],...t.ripple===!0?{}:t.ripple}),w=oe(()=>({center:t.round})),R=oe(()=>{const F=Math.max(0,Math.min(100,t.percentage));return F>0?{transition:"transform 0.6s",transform:`translateX(${F-100}%)`}:{}}),O=oe(()=>{if(t.loading===!0)return{onMousedown:V,onTouchstart:V,onClick:V,onKeydown:V,onKeyup:V};if(g.value===!0){const F={onClick:H,onKeydown:X,onMousedown:S};if(n.$q.platform.has.touch===!0){const Y=t.onTouchstart!==void 0?"":"Passive";F[`onTouchstart${Y}`]=T}return F}return{onClick:Ai}}),U=oe(()=>({ref:y,class:"q-btn q-btn-item non-selectable no-outline "+s.value,style:r.value,...o.value,...O.value}));function H(F){if(y.value!==null){if(F!==void 0){if(F.defaultPrevented===!0)return;const Y=document.activeElement;if(t.type==="submit"&&Y!==document.body&&y.value.contains(Y)===!1&&Y.contains(y.value)===!1){y.value.focus();const Z=()=>{document.removeEventListener("keydown",Ai,!0),document.removeEventListener("keyup",Z,wi),y.value!==null&&y.value.removeEventListener("blur",Z,wi)};document.addEventListener("keydown",Ai,!0),document.addEventListener("keyup",Z,wi),y.value.addEventListener("blur",Z,wi)}}f(F)}}function X(F){y.value!==null&&(i("keydown",F),Za(F,[13,32])===!0&&ir!==y.value&&(ir!==null&&k(),F.defaultPrevented!==!0&&(y.value.focus(),ir=y.value,y.value.classList.add("q-btn--active"),document.addEventListener("keyup",B,!0),y.value.addEventListener("blur",B,wi)),Ai(F)))}function T(F){y.value!==null&&(i("touchstart",F),F.defaultPrevented!==!0&&(tr!==y.value&&(tr!==null&&k(),tr=y.value,x=F.target,x.addEventListener("touchcancel",B,wi),x.addEventListener("touchend",B,wi)),b=!0,A!==null&&clearTimeout(A),A=setTimeout(()=>{A=null,b=!1},200)))}function S(F){y.value!==null&&(F.qSkipRipple=b===!0,i("mousedown",F),F.defaultPrevented!==!0&&nr!==y.value&&(nr!==null&&k(),nr=y.value,y.value.classList.add("q-btn--active"),document.addEventListener("mouseup",B,wi)))}function B(F){if(y.value!==null&&!(F!==void 0&&F.type==="blur"&&document.activeElement===y.value)){if(F!==void 0&&F.type==="keyup"){if(ir===y.value&&Za(F,[13,32])===!0){const Y=new MouseEvent("click",F);Y.qKeyEvent=!0,F.defaultPrevented===!0&&es(Y),F.cancelBubble===!0&&Ul(Y),y.value.dispatchEvent(Y),Ai(F),F.qKeyEvent=!0}i("keyup",F)}k()}}function k(F){const Y=_.value;F!==!0&&(tr===y.value||nr===y.value)&&Y!==null&&Y!==document.activeElement&&(Y.setAttribute("tabindex",-1),Y.focus()),tr===y.value&&(x!==null&&(x.removeEventListener("touchcancel",B,wi),x.removeEventListener("touchend",B,wi)),tr=x=null),nr===y.value&&(document.removeEventListener("mouseup",B,wi),nr=null),ir===y.value&&(document.removeEventListener("keyup",B,!0),y.value!==null&&y.value.removeEventListener("blur",B,wi),ir=null),y.value!==null&&y.value.classList.remove("q-btn--active")}function V(F){Ai(F),F.qSkipRipple=!0}return bi(()=>{k(!0)}),Object.assign(n,{click:F=>{g.value===!0&&H(F)}}),()=>{let F=[];t.icon!==void 0&&F.push(ue(On,{name:t.icon,left:t.stack!==!0&&L.value===!0,role:"img"})),L.value===!0&&F.push(ue("span",{class:"block"},[t.label])),F=ks(e.default,F),t.iconRight!==void 0&&t.round===!1&&F.push(ue(On,{name:t.iconRight,right:t.stack!==!0&&L.value===!0,role:"img"}));const Y=[ue("span",{class:"q-focus-helper",ref:_})];return t.loading===!0&&t.percentage!==void 0&&Y.push(ue("span",{class:"q-btn__progress absolute-full overflow-hidden"+(t.darkPercentage===!0?" q-btn__progress--dark":"")},[ue("span",{class:"q-btn__progress-indicator fit block",style:R.value})])),Y.push(ue("span",{class:"q-btn__content text-center col items-center q-anchor--skip "+a.value},F)),t.loading!==null&&Y.push(ue(Ml,{name:"q-transition--fade"},()=>t.loading===!0?[ue("span",{key:"loading",class:"absolute-full flex flex-center"},e.loading!==void 0?e.loading():[ue(ao)])]:null)),Ty(ue(c.value,U.value,Y),[[dL,C.value,void 0,w.value]])}}});let EL=1,CL=document.body;function Qu(t,e){const i=document.createElement("div");if(i.id=e!==void 0?`q-portal--${e}--${EL++}`:t,$l.globalNodes!==void 0){const n=$l.globalNodes.class;n!==void 0&&(i.className=n)}return CL.appendChild(i),i}function BT(t){t.remove()}let wL=0;const El={},Cl={},Vi={},FT={},AL=/^\s*$/,UT=[],DL=[void 0,null,!0,!1,""],qf=["top-left","top-right","bottom-left","bottom-right","top","bottom","left","right","center"],kL=["top-left","top-right","bottom-left","bottom-right"],rr={positive:{icon:t=>t.iconSet.type.positive,color:"positive"},negative:{icon:t=>t.iconSet.type.negative,color:"negative"},warning:{icon:t=>t.iconSet.type.warning,color:"warning",textColor:"dark"},info:{icon:t=>t.iconSet.type.info,color:"info"},ongoing:{group:!1,timeout:0,spinner:!0,color:"grey-8"}};function qT(t,e,i){if(!t)return Ta("parameter required");let n;const s={textColor:"white"};if(t.ignoreDefaults!==!0&&Object.assign(s,El),Di(t)===!1&&(s.type&&Object.assign(s,rr[s.type]),t={message:t}),Object.assign(s,rr[t.type||s.type],t),typeof s.icon=="function"&&(s.icon=s.icon(e)),s.spinner?(s.spinner===!0&&(s.spinner=ao),s.spinner=lo(s.spinner)):s.spinner=!1,s.meta={hasMedia:!!(s.spinner!==!1||s.icon||s.avatar),hasText:E0(s.message)||E0(s.caption)},s.position){if(qf.includes(s.position)===!1)return Ta("wrong position",t)}else s.position="bottom";if(DL.includes(s.timeout)===!0)s.timeout=5e3;else{const u=Number(s.timeout);if(isNaN(u)||u<0)return Ta("wrong timeout",t);s.timeout=Number.isFinite(u)?u:0}s.timeout===0?s.progress=!1:s.progress===!0&&(s.meta.progressClass="q-notification__progress"+(s.progressClass?` ${s.progressClass}`:""),s.meta.progressStyle={animationDuration:`${s.timeout+1e3}ms`});const r=(Array.isArray(t.actions)===!0?t.actions:[]).concat(t.ignoreDefaults!==!0&&Array.isArray(El.actions)===!0?El.actions:[]).concat(rr[t.type]!==void 0&&Array.isArray(rr[t.type].actions)===!0?rr[t.type].actions:[]),{closeBtn:a}=s;if(a&&r.push({label:typeof a=="string"?a:e.lang.label.close}),s.actions=r.map(({handler:u,noDismiss:c,...f})=>({flat:!0,...f,onClick:typeof u=="function"?()=>{u(),c!==!0&&o()}:()=>{o()}})),s.multiLine===void 0&&(s.multiLine=s.actions.length>1),Object.assign(s.meta,{class:`q-notification row items-stretch q-notification--${s.multiLine===!0?"multi-line":"standard"}`+(s.color!==void 0?` bg-${s.color}`:"")+(s.textColor!==void 0?` text-${s.textColor}`:"")+(s.classes!==void 0?` ${s.classes}`:""),wrapperClass:"q-notification__wrapper col relative-position border-radius-inherit "+(s.multiLine===!0?"column no-wrap justify-center":"row items-center"),contentClass:"q-notification__content row items-center"+(s.multiLine===!0?"":" col"),leftClass:s.meta.hasText===!0?"additional":"single",attrs:{role:"alert",...s.attrs}}),s.group===!1?(s.group=void 0,s.meta.group=void 0):((s.group===void 0||s.group===!0)&&(s.group=[s.message,s.caption,s.multiline].concat(s.actions.map(u=>`${u.label}*${u.icon}`)).join("|")),s.meta.group=s.group+"|"+s.position),s.actions.length===0?s.actions=void 0:s.meta.actionsClass="q-notification__actions row items-center "+(s.multiLine===!0?"justify-end":"col-auto")+(s.meta.hasMedia===!0?" q-notification__actions--with-media":""),i!==void 0){i.notif.meta.timer&&(clearTimeout(i.notif.meta.timer),i.notif.meta.timer=void 0),s.meta.uid=i.notif.meta.uid;const u=Vi[s.position].value.indexOf(i.notif);Vi[s.position].value[u]=s}else{const u=Cl[s.meta.group];if(u===void 0){if(s.meta.uid=wL++,s.meta.badge=1,["left","right","center"].indexOf(s.position)!==-1)Vi[s.position].value.splice(Math.floor(Vi[s.position].value.length/2),0,s);else{const c=s.position.indexOf("top")!==-1?"unshift":"push";Vi[s.position].value[c](s)}s.group!==void 0&&(Cl[s.meta.group]=s)}else{if(u.meta.timer&&(clearTimeout(u.meta.timer),u.meta.timer=void 0),s.badgePosition!==void 0){if(kL.includes(s.badgePosition)===!1)return Ta("wrong badgePosition",t)}else s.badgePosition=`top-${s.position.indexOf("left")!==-1?"right":"left"}`;s.meta.uid=u.meta.uid,s.meta.badge=u.meta.badge+1,s.meta.badgeClass=`q-notification__badge q-notification__badge--${s.badgePosition}`+(s.badgeColor!==void 0?` bg-${s.badgeColor}`:"")+(s.badgeTextColor!==void 0?` text-${s.badgeTextColor}`:"")+(s.badgeClass?` ${s.badgeClass}`:"");const c=Vi[s.position].value.indexOf(u);Vi[s.position].value[c]=Cl[s.meta.group]=s}}const o=()=>{IL(s),n=void 0};if(s.timeout>0&&(s.meta.timer=setTimeout(()=>{s.meta.timer=void 0,o()},s.timeout+1e3)),s.group!==void 0)return u=>{u!==void 0?Ta("trying to update a grouped one which is forbidden",t):o()};if(n={dismiss:o,config:t,notif:s},i!==void 0){Object.assign(i,n);return}return u=>{if(n!==void 0)if(u===void 0)n.dismiss();else{const c=Object.assign({},n.config,u,{group:!1,position:s.position});qT(c,e,n)}}}function IL(t){t.meta.timer&&(clearTimeout(t.meta.timer),t.meta.timer=void 0);const e=Vi[t.position].value.indexOf(t);if(e!==-1){t.group!==void 0&&delete Cl[t.meta.group];const i=UT[""+t.meta.uid];if(i){const{width:n,height:s}=getComputedStyle(i);i.style.left=`${i.offsetLeft}px`,i.style.width=n,i.style.height=s}Vi[t.position].value.splice(e,1),typeof t.onDismiss=="function"&&t.onDismiss()}}function E0(t){return t!=null&&AL.test(t)!==!0}function Ta(t,e){return console.error(`Notify: ${t}`,e),!1}function PL(){return Nt({name:"QNotifications",devtools:{hide:!0},setup(){return()=>ue("div",{class:"q-notifications"},qf.map(t=>ue(SE,{key:t,class:FT[t],tag:"div",name:`q-notification--${t}`},()=>Vi[t].value.map(e=>{const i=e.meta,n=[];if(i.hasMedia===!0&&(e.spinner!==!1?n.push(ue(e.spinner,{class:"q-notification__spinner q-notification__spinner--"+i.leftClass,color:e.spinnerColor,size:e.spinnerSize})):e.icon?n.push(ue(On,{class:"q-notification__icon q-notification__icon--"+i.leftClass,name:e.icon,color:e.iconColor,size:e.iconSize,role:"img"})):e.avatar&&n.push(ue(rL,{class:"q-notification__avatar q-notification__avatar--"+i.leftClass},()=>ue("img",{src:e.avatar,"aria-hidden":"true"})))),i.hasText===!0){let r;const a={class:"q-notification__message col"};if(e.html===!0)a.innerHTML=e.caption?`
${e.message}
${e.caption}
`:e.message;else{const o=[e.message];r=e.caption?[ue("div",o),ue("div",{class:"q-notification__caption"},[e.caption])]:o}n.push(ue("div",a,r))}const s=[ue("div",{class:i.contentClass},n)];return e.progress===!0&&s.push(ue("div",{key:`${i.uid}|p|${i.badge}`,class:i.progressClass,style:i.progressStyle})),e.actions!==void 0&&s.push(ue("div",{class:i.actionsClass},e.actions.map(r=>ue(Ch,r)))),i.badge>1&&s.push(ue("div",{key:`${i.uid}|${i.badge}`,class:e.meta.badgeClass,style:e.badgeStyle},[i.badge])),ue("div",{ref:r=>{UT[""+i.uid]=r},key:i.uid,class:i.class,...i.attrs},[ue("div",{class:i.wrapperClass},s)])}))))}})}const OL={setDefaults(t){Di(t)===!0&&Object.assign(El,t)},registerType(t,e){Di(e)===!0&&(rr[t]=e)},install({$q:t,parentApp:e}){if(t.notify=this.create=i=>qT(i,t),t.notify.setDefaults=this.setDefaults,t.notify.registerType=this.registerType,t.config.notify!==void 0&&this.setDefaults(t.config.notify),this.__installed!==!0){qf.forEach(n=>{Vi[n]=Ge([]);const s=["left","center","right"].includes(n)===!0?"center":n.indexOf("top")!==-1?"top":"bottom",r=n.indexOf("left")!==-1?"start":n.indexOf("right")!==-1?"end":"center",a=["left","right"].includes(n)?`items-${n==="left"?"start":"end"} justify-center`:n==="center"?"flex-center":`items-${r}`;FT[n]=`q-notifications__list q-notifications__list--${s} fixed column no-wrap ${a}`});const i=Qu("q-notify");Jh(PL(),e).mount(i)}}};function LL(t,e,i){let n;function s(){n!==void 0&&(zd.remove(n),n=void 0)}return bi(()=>{t.value===!0&&s()}),{removeFromHistory:s,addToHistory(){n={condition:()=>i.value===!0,handler:e},zd.add(n)}}}function RL(){let t=null;const e=yt();function i(){t!==null&&(clearTimeout(t),t=null)}return Su(i),bi(i),{removeTimeout:i,registerTimeout(n,s){i(),RT(e)===!1&&(t=setTimeout(()=>{t=null,n()},s))}}}function ML(){let t;const e=yt();function i(){t=void 0}return Su(i),bi(i),{removeTick:i,registerTick(n){t=n,gi(()=>{t===n&&(RT(e)===!1&&t(),t=void 0)})}}}const NL={modelValue:{type:Boolean,default:null},"onUpdate:modelValue":[Function,Array]},BL=["beforeShow","show","beforeHide","hide"];function FL({showing:t,canShow:e,hideOnRouteChange:i,handleShow:n,handleHide:s,processOnMount:r}){const a=yt(),{props:o,emit:u,proxy:c}=a;let f;function g(C){t.value===!0?x(C):y(C)}function y(C){if(o.disable===!0||C!==void 0&&C.qAnchorHandled===!0||e!==void 0&&e(C)!==!0)return;const w=o["onUpdate:modelValue"]!==void 0;w===!0&&(u("update:modelValue",!0),f=C,gi(()=>{f===C&&(f=void 0)})),(o.modelValue===null||w===!1)&&_(C)}function _(C){t.value!==!0&&(t.value=!0,u("beforeShow",C),n!==void 0?n(C):u("show",C))}function x(C){if(o.disable===!0)return;const w=o["onUpdate:modelValue"]!==void 0;w===!0&&(u("update:modelValue",!1),f=C,gi(()=>{f===C&&(f=void 0)})),(o.modelValue===null||w===!1)&&b(C)}function b(C){t.value!==!1&&(t.value=!1,u("beforeHide",C),s!==void 0?s(C):u("hide",C))}function A(C){o.disable===!0&&C===!0?o["onUpdate:modelValue"]!==void 0&&u("update:modelValue",!1):C===!0!==t.value&&(C===!0?_:b)(f)}tt(()=>o.modelValue,A),i!==void 0&<(a)===!0&&tt(()=>c.$route.fullPath,()=>{i.value===!0&&t.value===!0&&x()}),r===!0&&Mn(()=>{A(o.modelValue)});const L={show:y,hide:x,toggle:g};return Object.assign(c,L),L}const UL={transitionShow:{type:String,default:"fade"},transitionHide:{type:String,default:"fade"},transitionDuration:{type:[String,Number],default:300}};function qL(t,e=()=>{},i=()=>{}){return{transitionProps:oe(()=>{const n=`q-transition--${t.transitionShow||e()}`,s=`q-transition--${t.transitionHide||i()}`;return{appear:!0,enterFromClass:`${n}-enter-from`,enterActiveClass:`${n}-enter-active`,enterToClass:`${n}-enter-to`,leaveFromClass:`${s}-leave-from`,leaveActiveClass:`${s}-leave-active`,leaveToClass:`${s}-leave-to`}}),transitionStyle:oe(()=>`--q-transition-duration: ${t.transitionDuration}ms`)}}let Is=[],oo=[];function $T(t){oo=oo.filter(e=>e!==t)}function $L(t){$T(t),oo.push(t)}function C0(t){$T(t),oo.length===0&&Is.length!==0&&(Is[Is.length-1](),Is=[])}function $f(t){oo.length===0?t():Is.push(t)}function jL(t){Is=Is.filter(e=>e!==t)}const wl=[];function IR(t){return wl.find(e=>e.contentEl!==null&&e.contentEl.contains(t))}function VL(t,e){do{if(t.$options.name==="QMenu"){if(t.hide(e),t.$props.separateClosePopup===!0)return Sl(t)}else if(t.__qPortal===!0){const i=Sl(t);return i!==void 0&&i.$options.name==="QPopupProxy"?(t.hide(e),i):t}t=Sl(t)}while(t!=null)}function PR(t,e,i){for(;i!==0&&t!==void 0&&t!==null;){if(t.__qPortal===!0){if(i--,t.$options.name==="QMenu"){t=VL(t,e);continue}t.hide(e)}t=Sl(t)}}const HL=Nt({name:"QPortal",setup(t,{slots:e}){return()=>e.default()}});function zL(t){for(t=t.parent;t!=null;){if(t.type.name==="QGlobalDialog")return!0;if(t.type.name==="QDialog"||t.type.name==="QMenu")return!1;t=t.parent}return!1}function WL(t,e,i,n){const s=Ge(!1),r=Ge(!1);let a=null;const o={},u=n==="dialog"&&zL(t);function c(g){if(g===!0){C0(o),r.value=!0;return}r.value=!1,s.value===!1&&(u===!1&&a===null&&(a=Qu(!1,n)),s.value=!0,wl.push(t.proxy),$L(o))}function f(g){if(r.value=!1,g!==!0)return;C0(o),s.value=!1;const y=wl.indexOf(t.proxy);y!==-1&&wl.splice(y,1),a!==null&&(BT(a),a=null)}return Wh(()=>{f(!0)}),t.proxy.__qPortal=!0,Vs(t.proxy,"contentEl",()=>e.value),{showPortal:c,hidePortal:f,portalIsActive:s,portalIsAccessible:r,renderPortal:()=>u===!0?i():s.value===!0?[ue(Qx,{to:a},ue(HL,i))]:void 0}}const OR=[Element,String],GL=[null,document,document.body,document.scrollingElement,document.documentElement];function LR(t,e){let i=lL(e);if(i===void 0){if(t==null)return window;i=t.closest(".scroll,.scroll-y,.overflow-auto")}return GL.includes(i)?window:i}function KL(t){return t===window?window.pageYOffset||window.scrollY||document.body.scrollTop||0:t.scrollTop}function XL(t){return t===window?window.pageXOffset||window.scrollX||document.body.scrollLeft||0:t.scrollLeft}let al;function RR(){if(al!==void 0)return al;const t=document.createElement("p"),e=document.createElement("div");Eh(t,{width:"100%",height:"200px"}),Eh(e,{position:"absolute",top:"0px",left:"0px",visibility:"hidden",width:"200px",height:"150px",overflow:"hidden"}),e.appendChild(t),document.body.appendChild(e);const i=t.offsetWidth;e.style.overflow="scroll";let n=t.offsetWidth;return i===n&&(n=e.clientWidth),e.remove(),al=i-n,al}function YL(t,e=!0){return!t||t.nodeType!==Node.ELEMENT_NODE?!1:e?t.scrollHeight>t.clientHeight&&(t.classList.contains("scroll")||t.classList.contains("overflow-auto")||["auto","scroll"].includes(window.getComputedStyle(t)["overflow-y"])):t.scrollWidth>t.clientWidth&&(t.classList.contains("scroll")||t.classList.contains("overflow-auto")||["auto","scroll"].includes(window.getComputedStyle(t)["overflow-x"]))}let xa=0,Td,xd,ka,Sd=!1,w0,A0,D0,xs=null;function QL(t){JL(t)&&Ai(t)}function JL(t){if(t.target===document.body||t.target.classList.contains("q-layout__backdrop"))return!0;const e=FE(t),i=t.shiftKey&&!t.deltaX,n=!i&&Math.abs(t.deltaX)<=Math.abs(t.deltaY),s=i||n?t.deltaY:t.deltaX;for(let r=0;r0&&a.scrollTop+a.clientHeight===a.scrollHeight:s<0&&a.scrollLeft===0?!0:s>0&&a.scrollLeft+a.clientWidth===a.scrollWidth}return!0}function k0(t){t.target===document&&(document.scrollingElement.scrollTop=document.scrollingElement.scrollTop)}function ol(t){Sd!==!0&&(Sd=!0,requestAnimationFrame(()=>{Sd=!1;const{height:e}=t.target,{clientHeight:i,scrollTop:n}=document.scrollingElement;(ka===void 0||e!==window.innerHeight)&&(ka=i-e,document.scrollingElement.scrollTop=n),n>ka&&(document.scrollingElement.scrollTop-=Math.ceil((n-ka)/8))}))}function I0(t){const e=document.body,i=window.visualViewport!==void 0;if(t==="add"){const{overflowY:n,overflowX:s}=window.getComputedStyle(e);Td=XL(window),xd=KL(window),w0=e.style.left,A0=e.style.top,D0=window.location.href,e.style.left=`-${Td}px`,e.style.top=`-${xd}px`,s!=="hidden"&&(s==="scroll"||e.scrollWidth>window.innerWidth)&&e.classList.add("q-body--force-scrollbar-x"),n!=="hidden"&&(n==="scroll"||e.scrollHeight>window.innerHeight)&&e.classList.add("q-body--force-scrollbar-y"),e.classList.add("q-body--prevent-scroll"),document.qScrollPrevented=!0,kt.is.ios===!0&&(i===!0?(window.scrollTo(0,0),window.visualViewport.addEventListener("resize",ol,oi.passiveCapture),window.visualViewport.addEventListener("scroll",ol,oi.passiveCapture),window.scrollTo(0,0)):window.addEventListener("scroll",k0,oi.passiveCapture))}kt.is.desktop===!0&&kt.is.mac===!0&&window[`${t}EventListener`]("wheel",QL,oi.notPassive),t==="remove"&&(kt.is.ios===!0&&(i===!0?(window.visualViewport.removeEventListener("resize",ol,oi.passiveCapture),window.visualViewport.removeEventListener("scroll",ol,oi.passiveCapture)):window.removeEventListener("scroll",k0,oi.passiveCapture)),e.classList.remove("q-body--prevent-scroll"),e.classList.remove("q-body--force-scrollbar-x"),e.classList.remove("q-body--force-scrollbar-y"),document.qScrollPrevented=!1,e.style.left=w0,e.style.top=A0,window.location.href===D0&&window.scrollTo(Td,xd),ka=void 0)}function ZL(t){let e="add";if(t===!0){if(xa++,xs!==null){clearTimeout(xs),xs=null;return}if(xa>1)return}else{if(xa===0||(xa--,xa>0))return;if(e="remove",kt.is.ios===!0&&kt.is.nativeMobile===!0){xs!==null&&clearTimeout(xs),xs=setTimeout(()=>{I0(e),xs=null},100);return}}I0(e)}function e4(){let t;return{preventBodyScroll(e){e!==t&&(t!==void 0||e===!0)&&(t=e,ZL(e))}}}const Bs=[];let Br;function t4(t){Br=t.keyCode===27}function i4(){Br===!0&&(Br=!1)}function n4(t){Br===!0&&(Br=!1,Za(t,27)===!0&&Bs[Bs.length-1](t))}function jT(t){window[t]("keydown",t4),window[t]("blur",i4),window[t]("keyup",n4),Br=!1}function s4(t){kt.is.desktop===!0&&(Bs.push(t),Bs.length===1&&jT("addEventListener"))}function P0(t){const e=Bs.indexOf(t);e!==-1&&(Bs.splice(e,1),Bs.length===0&&jT("removeEventListener"))}const Fs=[];function VT(t){Fs[Fs.length-1](t)}function r4(t){kt.is.desktop===!0&&(Fs.push(t),Fs.length===1&&document.body.addEventListener("focusin",VT))}function O0(t){const e=Fs.indexOf(t);e!==-1&&(Fs.splice(e,1),Fs.length===0&&document.body.removeEventListener("focusin",VT))}let ll=0;const a4={standard:"fixed-full flex-center",top:"fixed-top justify-center",bottom:"fixed-bottom justify-center",right:"fixed-right items-center",left:"fixed-left items-center"},L0={standard:["scale","scale"],top:["slide-down","slide-up"],bottom:["slide-up","slide-down"],right:["slide-left","slide-right"],left:["slide-right","slide-left"]},o4=Nt({name:"QDialog",inheritAttrs:!1,props:{...NL,...UL,transitionShow:String,transitionHide:String,persistent:Boolean,autoClose:Boolean,allowFocusOutside:Boolean,noEscDismiss:Boolean,noBackdropDismiss:Boolean,noRouteDismiss:Boolean,noRefocus:Boolean,noFocus:Boolean,noShake:Boolean,seamless:Boolean,maximized:Boolean,fullWidth:Boolean,fullHeight:Boolean,square:Boolean,backdropFilter:String,position:{type:String,default:"standard",validator:t=>["standard","top","bottom","left","right"].includes(t)}},emits:[...BL,"shake","click","escapeKey"],setup(t,{slots:e,emit:i,attrs:n}){const s=yt(),r=Ge(null),a=Ge(!1),o=Ge(!1);let u=null,c=null,f,g;const y=oe(()=>t.persistent!==!0&&t.noRouteDismiss!==!0&&t.seamless!==!0),{preventBodyScroll:_}=e4(),{registerTimeout:x}=RL(),{registerTick:b,removeTick:A}=ML(),{transitionProps:L,transitionStyle:C}=qL(t,()=>L0[t.position][0],()=>L0[t.position][1]),w=oe(()=>C.value+(t.backdropFilter!==void 0?`;backdrop-filter:${t.backdropFilter};-webkit-backdrop-filter:${t.backdropFilter}`:"")),{showPortal:R,hidePortal:O,portalIsAccessible:U,renderPortal:H}=WL(s,r,De,"dialog"),{hide:X}=FL({showing:a,hideOnRouteChange:y,handleShow:Y,handleHide:Z,processOnMount:!0}),{addToHistory:T,removeFromHistory:S}=LL(a,X,y),B=oe(()=>`q-dialog__inner flex no-pointer-events q-dialog__inner--${t.maximized===!0?"maximized":"minimized"} q-dialog__inner--${t.position} ${a4[t.position]}`+(o.value===!0?" q-dialog__inner--animating":"")+(t.fullWidth===!0?" q-dialog__inner--fullwidth":"")+(t.fullHeight===!0?" q-dialog__inner--fullheight":"")+(t.square===!0?" q-dialog__inner--square":"")),k=oe(()=>a.value===!0&&t.seamless!==!0),V=oe(()=>t.autoClose===!0?{onClick:ne}:{}),F=oe(()=>[`q-dialog fullscreen no-pointer-events q-dialog--${k.value===!0?"modal":"seamless"}`,n.class]);tt(()=>t.maximized,Se=>{a.value===!0&&re(Se)}),tt(k,Se=>{_(Se),Se===!0?(r4(Ie),s4(Q)):(O0(Ie),P0(Q))});function Y(Se){T(),c=t.noRefocus===!1&&document.activeElement!==null?document.activeElement:null,re(t.maximized),R(),o.value=!0,t.noFocus!==!0?(document.activeElement!==null&&document.activeElement.blur(),b(G)):A(),x(()=>{if(s.proxy.$q.platform.is.ios===!0){if(t.seamless!==!0&&document.activeElement){const{top:te,bottom:ye}=document.activeElement.getBoundingClientRect(),{innerHeight:ve}=window,we=window.visualViewport!==void 0?window.visualViewport.height:ve;te>0&&ye>we/2&&(document.scrollingElement.scrollTop=Math.min(document.scrollingElement.scrollHeight-we,ye>=ve?1/0:Math.ceil(document.scrollingElement.scrollTop+ye-we/2))),document.activeElement.scrollIntoView()}g=!0,r.value.click(),g=!1}R(!0),o.value=!1,i("show",Se)},t.transitionDuration)}function Z(Se){A(),S(),se(!0),o.value=!0,O(),c!==null&&(((Se&&Se.type.indexOf("key")===0?c.closest('[tabindex]:not([tabindex^="-"])'):void 0)||c).focus(),c=null),x(()=>{O(!0),o.value=!1,i("hide",Se)},t.transitionDuration)}function G(Se){$f(()=>{let te=r.value;if(te!==null){if(Se!==void 0){const ye=te.querySelector(Se);if(ye!==null){ye.focus({preventScroll:!0});return}}te.contains(document.activeElement)!==!0&&(te=te.querySelector("[autofocus][tabindex], [data-autofocus][tabindex]")||te.querySelector("[autofocus] [tabindex], [data-autofocus] [tabindex]")||te.querySelector("[autofocus], [data-autofocus]")||te,te.focus({preventScroll:!0}))}})}function W(Se){Se&&typeof Se.focus=="function"?Se.focus({preventScroll:!0}):G(),i("shake");const te=r.value;te!==null&&(te.classList.remove("q-animate--scale"),te.classList.add("q-animate--scale"),u!==null&&clearTimeout(u),u=setTimeout(()=>{u=null,r.value!==null&&(te.classList.remove("q-animate--scale"),G())},170))}function Q(){t.seamless!==!0&&(t.persistent===!0||t.noEscDismiss===!0?t.maximized!==!0&&t.noShake!==!0&&W():(i("escapeKey"),X()))}function se(Se){u!==null&&(clearTimeout(u),u=null),(Se===!0||a.value===!0)&&(re(!1),t.seamless!==!0&&(_(!1),O0(Ie),P0(Q))),Se!==!0&&(c=null)}function re(Se){Se===!0?f!==!0&&(ll<1&&document.body.classList.add("q-body--dialog"),ll++,f=!0):f===!0&&(ll<2&&document.body.classList.remove("q-body--dialog"),ll--,f=!1)}function ne(Se){g!==!0&&(X(Se),i("click",Se))}function Ce(Se){t.persistent!==!0&&t.noBackdropDismiss!==!0?X(Se):t.noShake!==!0&&W()}function Ie(Se){t.allowFocusOutside!==!0&&U.value===!0&&uL(r.value,Se.target)!==!0&&G('[tabindex]:not([tabindex="-1"])')}Object.assign(s.proxy,{focus:G,shake:W,__updateRefocusTarget(Se){c=Se||null}}),bi(se);function De(){return ue("div",{role:"dialog","aria-modal":k.value===!0?"true":"false",...n,class:F.value},[ue(Ml,{name:"q-transition--fade",appear:!0},()=>k.value===!0?ue("div",{class:"q-dialog__backdrop fixed-full",style:w.value,"aria-hidden":"true",tabindex:-1,onClick:Ce}):null),ue(Ml,L.value,()=>a.value===!0?ue("div",{ref:r,class:B.value,style:C.value,tabindex:-1,...V.value},Hi(e.default)):null)])}return H}}),Hs={dark:{type:Boolean,default:null}};function zs(t,e){return oe(()=>t.dark===null?e.dark.isActive:t.dark)}const l4=Nt({name:"QCard",props:{...Hs,tag:{type:String,default:"div"},square:Boolean,flat:Boolean,bordered:Boolean},setup(t,{slots:e}){const{proxy:{$q:i}}=yt(),n=zs(t,i),s=oe(()=>"q-card"+(n.value===!0?" q-card--dark q-dark":"")+(t.bordered===!0?" q-card--bordered":"")+(t.square===!0?" q-card--square no-border-radius":"")+(t.flat===!0?" q-card--flat no-shadow":""));return()=>ue(t.tag,{class:s.value},Hi(e.default))}}),Sa=Nt({name:"QCardSection",props:{tag:{type:String,default:"div"},horizontal:Boolean},setup(t,{slots:e}){const i=oe(()=>`q-card__section q-card__section--${t.horizontal===!0?"horiz row no-wrap":"vert"}`);return()=>ue(t.tag,{class:i.value},Hi(e.default))}}),u4=Nt({name:"QCardActions",props:{...PT,vertical:Boolean},setup(t,{slots:e}){const i=OT(t),n=oe(()=>`q-card__actions ${i.value} q-card__actions--${t.vertical===!0?"vert column":"horiz row"}`);return()=>ue("div",{class:n.value},Hi(e.default))}}),c4={true:"inset",item:"item-inset","item-thumbnail":"item-thumbnail-inset"},Ed={xs:2,sm:4,md:8,lg:16,xl:24},R0=Nt({name:"QSeparator",props:{...Hs,spaced:[Boolean,String],inset:[Boolean,String],vertical:Boolean,color:String,size:String},setup(t){const e=yt(),i=zs(t,e.proxy.$q),n=oe(()=>t.vertical===!0?"vertical":"horizontal"),s=oe(()=>` q-separator--${n.value}`),r=oe(()=>t.inset!==!1?`${s.value}-${c4[t.inset]}`:""),a=oe(()=>`q-separator${s.value}${r.value}`+(t.color!==void 0?` bg-${t.color}`:"")+(i.value===!0?" q-separator--dark":"")),o=oe(()=>{const u={};if(t.size!==void 0&&(u[t.vertical===!0?"width":"height"]=t.size),t.spaced!==!1){const c=t.spaced===!0?`${Ed.md}px`:t.spaced in Ed?`${Ed[t.spaced]}px`:t.spaced,f=t.vertical===!0?["Left","Right"]:["Top","Bottom"];u[`margin${f[0]}`]=u[`margin${f[1]}`]=c}return u});return()=>ue("hr",{class:a.value,style:o.value,"aria-orientation":n.value})}});let Cd,ul=0;const Bt=new Array(256);for(let t=0;t<256;t++)Bt[t]=(t+256).toString(16).substring(1);const d4=(()=>{const t=typeof crypto<"u"?crypto:typeof window<"u"?window.crypto||window.msCrypto:void 0;if(t!==void 0){if(t.randomBytes!==void 0)return t.randomBytes;if(t.getRandomValues!==void 0)return e=>{const i=new Uint8Array(e);return t.getRandomValues(i),i}}return e=>{const i=[];for(let n=e;n>0;n--)i.push(Math.floor(Math.random()*256));return i}})(),M0=4096;function wh(){(Cd===void 0||ul+16>M0)&&(ul=0,Cd=d4(M0));const t=Array.prototype.slice.call(Cd,ul,ul+=16);return t[6]=t[6]&15|64,t[8]=t[8]&63|128,Bt[t[0]]+Bt[t[1]]+Bt[t[2]]+Bt[t[3]]+"-"+Bt[t[4]]+Bt[t[5]]+"-"+Bt[t[6]]+Bt[t[7]]+"-"+Bt[t[8]]+Bt[t[9]]+"-"+Bt[t[10]]+Bt[t[11]]+Bt[t[12]]+Bt[t[13]]+Bt[t[14]]+Bt[t[15]]}function h4(t){return t??null}function N0(t,e){return t??(e===!0?`f_${wh()}`:null)}function f4({getValue:t,required:e=!0}={}){if(ss.value===!0){const i=Ge(t!==void 0?h4(t()):null);return e===!0&&i.value===null&&Mn(()=>{i.value=`f_${wh()}`}),t!==void 0&&tt(t,n=>{i.value=N0(n,e)}),i}return t!==void 0?oe(()=>N0(t(),e)):Ge(`f_${wh()}`)}const B0=/^on[A-Z]/;function p4(){const{attrs:t,vnode:e}=yt(),i={listeners:Ge({}),attributes:Ge({})};function n(){const s={},r={};for(const a in t)a!=="class"&&a!=="style"&&B0.test(a)===!1&&(s[a]=t[a]);for(const a in e.props)B0.test(a)===!0&&(r[a]=e.props[a]);i.attributes.value=s,i.listeners.value=r}return Ry(n),n(),i}function g4({validate:t,resetValidation:e,requiresQForm:i}){const n=Ii(ZE,!1);if(n!==!1){const{props:s,proxy:r}=yt();Object.assign(r,{validate:t,resetValidation:e}),tt(()=>s.disable,a=>{a===!0?(typeof e=="function"&&e(),n.unbindComponent(r)):n.bindComponent(r)}),Mn(()=>{s.disable!==!0&&n.bindComponent(r)}),bi(()=>{s.disable!==!0&&n.unbindComponent(r)})}else i===!0&&console.error("Parent QForm not found on useFormChild()!")}const F0=/^#[0-9a-fA-F]{3}([0-9a-fA-F]{3})?$/,U0=/^#[0-9a-fA-F]{4}([0-9a-fA-F]{4})?$/,q0=/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,cl=/^rgb\(((0|[1-9][\d]?|1[\d]{0,2}|2[\d]?|2[0-4][\d]|25[0-5]),){2}(0|[1-9][\d]?|1[\d]{0,2}|2[\d]?|2[0-4][\d]|25[0-5])\)$/,dl=/^rgba\(((0|[1-9][\d]?|1[\d]{0,2}|2[\d]?|2[0-4][\d]|25[0-5]),){2}(0|[1-9][\d]?|1[\d]{0,2}|2[\d]?|2[0-4][\d]|25[0-5]),(0|0\.[0-9]+[1-9]|0\.[1-9]+|1)\)$/,wd={date:t=>/^-?[\d]+\/[0-1]\d\/[0-3]\d$/.test(t),time:t=>/^([0-1]?\d|2[0-3]):[0-5]\d$/.test(t),fulltime:t=>/^([0-1]?\d|2[0-3]):[0-5]\d:[0-5]\d$/.test(t),timeOrFulltime:t=>/^([0-1]?\d|2[0-3]):[0-5]\d(:[0-5]\d)?$/.test(t),email:t=>/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(t),hexColor:t=>F0.test(t),hexaColor:t=>U0.test(t),hexOrHexaColor:t=>q0.test(t),rgbColor:t=>cl.test(t),rgbaColor:t=>dl.test(t),rgbOrRgbaColor:t=>cl.test(t)||dl.test(t),hexOrRgbColor:t=>F0.test(t)||cl.test(t),hexaOrRgbaColor:t=>U0.test(t)||dl.test(t),anyColor:t=>q0.test(t)||cl.test(t)||dl.test(t)},m4=[!0,!1,"ondemand"],y4={modelValue:{},error:{type:Boolean,default:null},errorMessage:String,noErrorIcon:Boolean,rules:Array,reactiveRules:Boolean,lazyRules:{type:[Boolean,String],default:!1,validator:t=>m4.includes(t)}};function _4(t,e){const{props:i,proxy:n}=yt(),s=Ge(!1),r=Ge(null),a=Ge(!1);g4({validate:b,resetValidation:x});let o=0,u;const c=oe(()=>i.rules!==void 0&&i.rules!==null&&i.rules.length!==0),f=oe(()=>i.disable!==!0&&c.value===!0&&e.value===!1),g=oe(()=>i.error===!0||s.value===!0),y=oe(()=>typeof i.errorMessage=="string"&&i.errorMessage.length!==0?i.errorMessage:r.value);tt(()=>i.modelValue,()=>{a.value=!0,f.value===!0&&i.lazyRules===!1&&A()});function _(){i.lazyRules!=="ondemand"&&f.value===!0&&a.value===!0&&A()}tt(()=>i.reactiveRules,L=>{L===!0?u===void 0&&(u=tt(()=>i.rules,_,{immediate:!0,deep:!0})):u!==void 0&&(u(),u=void 0)},{immediate:!0}),tt(()=>i.lazyRules,_),tt(t,L=>{L===!0?a.value=!0:f.value===!0&&i.lazyRules!=="ondemand"&&A()});function x(){o++,e.value=!1,a.value=!1,s.value=!1,r.value=null,A.cancel()}function b(L=i.modelValue){if(i.disable===!0||c.value===!1)return!0;const C=++o,w=e.value!==!0?()=>{a.value=!0}:()=>{},R=(U,H)=>{U===!0&&w(),s.value=U,r.value=H||null,e.value=!1},O=[];for(let U=0;U{if(U===void 0||Array.isArray(U)===!1||U.length===0)return C===o&&R(!1),!0;const H=U.find(X=>X===!1||typeof X=="string");return C===o&&R(H!==void 0,H),H===void 0},U=>(C===o&&(console.error(U),R(!0)),!1)))}const A=h_(b,0);return bi(()=>{u!==void 0&&u(),A.cancel()}),Object.assign(n,{resetValidation:x,validate:b}),Vs(n,"hasError",()=>g.value),{isDirtyModel:a,hasRules:c,hasError:g,errorMessage:y,validate:b,resetValidation:x}}function Ah(t){return t!=null&&(""+t).length!==0}const v4={...Hs,...y4,label:String,stackLabel:Boolean,hint:String,hideHint:Boolean,prefix:String,suffix:String,labelColor:String,color:String,bgColor:String,filled:Boolean,outlined:Boolean,borderless:Boolean,standout:[Boolean,String],square:Boolean,loading:Boolean,labelSlot:Boolean,bottomSlots:Boolean,hideBottomSpace:Boolean,rounded:Boolean,dense:Boolean,itemAligned:Boolean,counter:Boolean,clearable:Boolean,clearIcon:String,disable:Boolean,readonly:Boolean,autofocus:Boolean,for:String},b4={...v4,maxlength:[Number,String]},T4=["update:modelValue","clear","focus","blur"];function x4({requiredForAttr:t=!0,tagProp:e,changeEvent:i=!1}={}){const{props:n,proxy:s}=yt(),r=zs(n,s.$q),a=f4({required:t,getValue:()=>n.for});return{requiredForAttr:t,changeEvent:i,tag:e===!0?oe(()=>n.tag):{value:"label"},isDark:r,editable:oe(()=>n.disable!==!0&&n.readonly!==!0),innerLoading:Ge(!1),focused:Ge(!1),hasPopupOpen:!1,splitAttrs:p4(),targetUid:a,rootRef:Ge(null),targetRef:Ge(null),controlRef:Ge(null)}}function S4(t){const{props:e,emit:i,slots:n,attrs:s,proxy:r}=yt(),{$q:a}=r;let o=null;t.hasValue===void 0&&(t.hasValue=oe(()=>Ah(e.modelValue))),t.emitValue===void 0&&(t.emitValue=W=>{i("update:modelValue",W)}),t.controlEvents===void 0&&(t.controlEvents={onFocusin:T,onFocusout:S}),Object.assign(t,{clearValue:B,onControlFocusin:T,onControlFocusout:S,focus:H}),t.computedCounter===void 0&&(t.computedCounter=oe(()=>{if(e.counter!==!1){const W=typeof e.modelValue=="string"||typeof e.modelValue=="number"?(""+e.modelValue).length:Array.isArray(e.modelValue)===!0?e.modelValue.length:0,Q=e.maxlength!==void 0?e.maxlength:e.maxValues;return W+(Q!==void 0?" / "+Q:"")}}));const{isDirtyModel:u,hasRules:c,hasError:f,errorMessage:g,resetValidation:y}=_4(t.focused,t.innerLoading),_=t.floatingLabel!==void 0?oe(()=>e.stackLabel===!0||t.focused.value===!0||t.floatingLabel.value===!0):oe(()=>e.stackLabel===!0||t.focused.value===!0||t.hasValue.value===!0),x=oe(()=>e.bottomSlots===!0||e.hint!==void 0||c.value===!0||e.counter===!0||e.error!==null),b=oe(()=>e.filled===!0?"filled":e.outlined===!0?"outlined":e.borderless===!0?"borderless":e.standout?"standout":"standard"),A=oe(()=>`q-field row no-wrap items-start q-field--${b.value}`+(t.fieldClass!==void 0?` ${t.fieldClass.value}`:"")+(e.rounded===!0?" q-field--rounded":"")+(e.square===!0?" q-field--square":"")+(_.value===!0?" q-field--float":"")+(C.value===!0?" q-field--labeled":"")+(e.dense===!0?" q-field--dense":"")+(e.itemAligned===!0?" q-field--item-aligned q-item-type":"")+(t.isDark.value===!0?" q-field--dark":"")+(t.getControl===void 0?" q-field--auto-height":"")+(t.focused.value===!0?" q-field--focused":"")+(f.value===!0?" q-field--error":"")+(f.value===!0||t.focused.value===!0?" q-field--highlighted":"")+(e.hideBottomSpace!==!0&&x.value===!0?" q-field--with-bottom":"")+(e.disable===!0?" q-field--disabled":e.readonly===!0?" q-field--readonly":"")),L=oe(()=>"q-field__control relative-position row no-wrap"+(e.bgColor!==void 0?` bg-${e.bgColor}`:"")+(f.value===!0?" text-negative":typeof e.standout=="string"&&e.standout.length!==0&&t.focused.value===!0?` ${e.standout}`:e.color!==void 0?` text-${e.color}`:"")),C=oe(()=>e.labelSlot===!0||e.label!==void 0),w=oe(()=>"q-field__label no-pointer-events absolute ellipsis"+(e.labelColor!==void 0&&f.value!==!0?` text-${e.labelColor}`:"")),R=oe(()=>({id:t.targetUid.value,editable:t.editable.value,focused:t.focused.value,floatingLabel:_.value,modelValue:e.modelValue,emitValue:t.emitValue})),O=oe(()=>{const W={};return t.targetUid.value&&(W.for=t.targetUid.value),e.disable===!0&&(W["aria-disabled"]="true"),W});function U(){const W=document.activeElement;let Q=t.targetRef!==void 0&&t.targetRef.value;Q&&(W===null||W.id!==t.targetUid.value)&&(Q.hasAttribute("tabindex")===!0||(Q=Q.querySelector("[tabindex]")),Q&&Q!==W&&Q.focus({preventScroll:!0}))}function H(){$f(U)}function X(){jL(U);const W=document.activeElement;W!==null&&t.rootRef.value.contains(W)&&W.blur()}function T(W){o!==null&&(clearTimeout(o),o=null),t.editable.value===!0&&t.focused.value===!1&&(t.focused.value=!0,i("focus",W))}function S(W,Q){o!==null&&clearTimeout(o),o=setTimeout(()=>{o=null,!(document.hasFocus()===!0&&(t.hasPopupOpen===!0||t.controlRef===void 0||t.controlRef.value===null||t.controlRef.value.contains(document.activeElement)!==!1))&&(t.focused.value===!0&&(t.focused.value=!1,i("blur",W)),Q!==void 0&&Q())})}function B(W){Ai(W),a.platform.is.mobile!==!0?(t.targetRef!==void 0&&t.targetRef.value||t.rootRef.value).focus():t.rootRef.value.contains(document.activeElement)===!0&&document.activeElement.blur(),e.type==="file"&&(t.inputRef.value.value=null),i("update:modelValue",null),t.changeEvent===!0&&i("change",null),i("clear",e.modelValue),gi(()=>{const Q=u.value;y(),u.value=Q})}function k(W){[13,32].includes(W.keyCode)&&B(W)}function V(){const W=[];return n.prepend!==void 0&&W.push(ue("div",{class:"q-field__prepend q-field__marginal row no-wrap items-center",key:"prepend",onClick:es},n.prepend())),W.push(ue("div",{class:"q-field__control-container col relative-position row no-wrap q-anchor--skip"},F())),f.value===!0&&e.noErrorIcon===!1&&W.push(Z("error",[ue(On,{name:a.iconSet.field.error,color:"negative"})])),e.loading===!0||t.innerLoading.value===!0?W.push(Z("inner-loading-append",n.loading!==void 0?n.loading():[ue(ao,{color:e.color})])):e.clearable===!0&&t.hasValue.value===!0&&t.editable.value===!0&&W.push(Z("inner-clearable-append",[ue(On,{class:"q-field__focusable-action",name:e.clearIcon||a.iconSet.field.clear,tabindex:0,role:"button","aria-hidden":"false","aria-label":a.lang.label.clear,onKeyup:k,onClick:B})])),n.append!==void 0&&W.push(ue("div",{class:"q-field__append q-field__marginal row no-wrap items-center",key:"append",onClick:es},n.append())),t.getInnerAppend!==void 0&&W.push(Z("inner-append",t.getInnerAppend())),t.getControlChild!==void 0&&W.push(t.getControlChild()),W}function F(){const W=[];return e.prefix!==void 0&&e.prefix!==null&&W.push(ue("div",{class:"q-field__prefix no-pointer-events row items-center"},e.prefix)),t.getShadowControl!==void 0&&t.hasShadow.value===!0&&W.push(t.getShadowControl()),t.getControl!==void 0?W.push(t.getControl()):n.rawControl!==void 0?W.push(n.rawControl()):n.control!==void 0&&W.push(ue("div",{ref:t.targetRef,class:"q-field__native row",tabindex:-1,...t.splitAttrs.attributes.value,"data-autofocus":e.autofocus===!0||void 0},n.control(R.value))),C.value===!0&&W.push(ue("div",{class:w.value},Hi(n.label,e.label))),e.suffix!==void 0&&e.suffix!==null&&W.push(ue("div",{class:"q-field__suffix no-pointer-events row items-center"},e.suffix)),W.concat(Hi(n.default))}function Y(){let W,Q;f.value===!0?g.value!==null?(W=[ue("div",{role:"alert"},g.value)],Q=`q--slot-error-${g.value}`):(W=Hi(n.error),Q="q--slot-error"):(e.hideHint!==!0||t.focused.value===!0)&&(e.hint!==void 0?(W=[ue("div",e.hint)],Q=`q--slot-hint-${e.hint}`):(W=Hi(n.hint),Q="q--slot-hint"));const se=e.counter===!0||n.counter!==void 0;if(e.hideBottomSpace===!0&&se===!1&&W===void 0)return;const re=ue("div",{key:Q,class:"q-field__messages col"},W);return ue("div",{class:"q-field__bottom row items-start q-field__bottom--"+(e.hideBottomSpace!==!0?"animated":"stale"),onClick:es},[e.hideBottomSpace===!0?re:ue(Ml,{name:"q-transition--field-message"},()=>re),se===!0?ue("div",{class:"q-field__counter"},n.counter!==void 0?n.counter():t.computedCounter.value):null])}function Z(W,Q){return Q===null?null:ue("div",{key:W,class:"q-field__append q-field__marginal row no-wrap items-center q-anchor--skip"},Q)}let G=!1;return Su(()=>{G=!0}),Oy(()=>{G===!0&&e.autofocus===!0&&r.focus()}),e.autofocus===!0&&Mn(()=>{r.focus()}),bi(()=>{o!==null&&clearTimeout(o)}),Object.assign(r,{focus:H,blur:X}),function(){const Q=t.getControl===void 0&&n.control===void 0?{...t.splitAttrs.attributes.value,"data-autofocus":e.autofocus===!0||void 0,...O.value}:O.value;return ue(t.tag.value,{ref:t.rootRef,class:[A.value,s.class],style:s.style,...Q},[n.before!==void 0?ue("div",{class:"q-field__before q-field__marginal row no-wrap items-center",onClick:es},n.before()):null,ue("div",{class:"q-field__inner relative-position col self-stretch"},[ue("div",{ref:t.controlRef,class:L.value,tabindex:-1,...t.controlEvents},V()),x.value===!0?Y():null]),n.after!==void 0?ue("div",{class:"q-field__after q-field__marginal row no-wrap items-center",onClick:es},n.after()):null])}}const $0={date:"####/##/##",datetime:"####/##/## ##:##",time:"##:##",fulltime:"##:##:##",phone:"(###) ### - ####",card:"#### #### #### ####"},du={"#":{pattern:"[\\d]",negate:"[^\\d]"},S:{pattern:"[a-zA-Z]",negate:"[^a-zA-Z]"},N:{pattern:"[0-9a-zA-Z]",negate:"[^0-9a-zA-Z]"},A:{pattern:"[a-zA-Z]",negate:"[^a-zA-Z]",transform:t=>t.toLocaleUpperCase()},a:{pattern:"[a-zA-Z]",negate:"[^a-zA-Z]",transform:t=>t.toLocaleLowerCase()},X:{pattern:"[0-9a-zA-Z]",negate:"[^0-9a-zA-Z]",transform:t=>t.toLocaleUpperCase()},x:{pattern:"[0-9a-zA-Z]",negate:"[^0-9a-zA-Z]",transform:t=>t.toLocaleLowerCase()}},HT=Object.keys(du);HT.forEach(t=>{du[t].regex=new RegExp(du[t].pattern)});const E4=new RegExp("\\\\([^.*+?^${}()|([\\]])|([.*+?^${}()|[\\]])|(["+HT.join("")+"])|(.)","g"),j0=/[.*+?^${}()|[\]\\]/g,Ct="",C4={mask:String,reverseFillMask:Boolean,fillMask:[Boolean,String],unmaskedValue:Boolean};function w4(t,e,i,n){let s,r,a,o,u,c;const f=Ge(null),g=Ge(_());function y(){return t.autogrow===!0||["textarea","text","search","url","tel","password"].includes(t.type)}tt(()=>t.type+t.autogrow,b),tt(()=>t.mask,T=>{if(T!==void 0)A(g.value,!0);else{const S=H(g.value);b(),t.modelValue!==S&&e("update:modelValue",S)}}),tt(()=>t.fillMask+t.reverseFillMask,()=>{f.value===!0&&A(g.value,!0)}),tt(()=>t.unmaskedValue,()=>{f.value===!0&&A(g.value)});function _(){if(b(),f.value===!0){const T=O(H(t.modelValue));return t.fillMask!==!1?X(T):T}return t.modelValue}function x(T){if(T0;V--)S+=Ct;B=B.slice(0,k)+S+B.slice(k)}return B}function b(){if(f.value=t.mask!==void 0&&t.mask.length!==0&&y(),f.value===!1){o=void 0,s="",r="";return}const T=$0[t.mask]===void 0?t.mask:$0[t.mask],S=typeof t.fillMask=="string"&&t.fillMask.length!==0?t.fillMask.slice(0,1):"_",B=S.replace(j0,"\\$&"),k=[],V=[],F=[];let Y=t.reverseFillMask===!0,Z="",G="";T.replace(E4,(re,ne,Ce,Ie,De)=>{if(Ie!==void 0){const Se=du[Ie];F.push(Se),G=Se.negate,Y===!0&&(V.push("(?:"+G+"+)?("+Se.pattern+"+)?(?:"+G+"+)?("+Se.pattern+"+)?"),Y=!1),V.push("(?:"+G+"+)?("+Se.pattern+")?")}else if(Ce!==void 0)Z="\\"+(Ce==="\\"?"":Ce),F.push(Ce),k.push("([^"+Z+"]+)?"+Z+"?");else{const Se=ne!==void 0?ne:De;Z=Se==="\\"?"\\\\\\\\":Se.replace(j0,"\\\\$&"),F.push(Se),k.push("([^"+Z+"]+)?"+Z+"?")}});const W=new RegExp("^"+k.join("")+"("+(Z===""?".":"[^"+Z+"]")+"+)?"+(Z===""?"":"["+Z+"]*")+"$"),Q=V.length-1,se=V.map((re,ne)=>ne===0&&t.reverseFillMask===!0?new RegExp("^"+B+"*"+re):ne===Q?new RegExp("^"+re+"("+(G===""?".":G)+"+)?"+(t.reverseFillMask===!0?"$":B+"*")):new RegExp("^"+re));a=F,o=re=>{const ne=W.exec(t.reverseFillMask===!0?re:re.slice(0,F.length+1));ne!==null&&(re=ne.slice(1).join(""));const Ce=[],Ie=se.length;for(let De=0,Se=re;Detypeof re=="string"?re:Ct).join(""),r=s.split(Ct).join(S)}function A(T,S,B){const k=n.value,V=k.selectionEnd,F=k.value.length-V,Y=H(T);S===!0&&b();const Z=O(Y),G=t.fillMask!==!1?X(Z):Z,W=g.value!==G;k.value!==G&&(k.value=G),W===!0&&(g.value=G),document.activeElement===k&&gi(()=>{if(G===r){const se=t.reverseFillMask===!0?r.length:0;k.setSelectionRange(se,se,"forward");return}if(B==="insertFromPaste"&&t.reverseFillMask!==!0){const se=k.selectionEnd;let re=V-1;for(let ne=u;ne<=re&&neZ.length?1:0:Math.max(0,G.length-(G===r?0:Math.min(Z.length,F)+1))+1:V;k.setSelectionRange(se,se,"forward");return}if(t.reverseFillMask===!0)if(W===!0){const se=Math.max(0,G.length-(G===r?0:Math.min(Z.length,F+1)));se===1&&V===1?k.setSelectionRange(se,se,"forward"):C.rightReverse(k,se)}else{const se=G.length-F;k.setSelectionRange(se,se,"backward")}else if(W===!0){const se=Math.max(0,s.indexOf(Ct),Math.min(Z.length,V)-1);C.right(k,se)}else{const se=V-1;C.right(k,se)}});const Q=t.unmaskedValue===!0?H(G):G;String(t.modelValue)!==Q&&(t.modelValue!==null||Q!=="")&&i(Q,!0)}function L(T,S,B){const k=O(H(T.value));S=Math.max(0,s.indexOf(Ct),Math.min(k.length,S)),u=S,T.setSelectionRange(S,B,"forward")}const C={left(T,S){const B=s.slice(S-1).indexOf(Ct)===-1;let k=Math.max(0,S-1);for(;k>=0;k--)if(s[k]===Ct){S=k,B===!0&&S++;break}if(k<0&&s[S]!==void 0&&s[S]!==Ct)return C.right(T,0);S>=0&&T.setSelectionRange(S,S,"backward")},right(T,S){const B=T.value.length;let k=Math.min(B,S+1);for(;k<=B;k++)if(s[k]===Ct){S=k;break}else s[k-1]===Ct&&(S=k);if(k>B&&s[S-1]!==void 0&&s[S-1]!==Ct)return C.left(T,B);T.setSelectionRange(S,S,"forward")},leftReverse(T,S){const B=x(T.value.length);let k=Math.max(0,S-1);for(;k>=0;k--)if(B[k-1]===Ct){S=k;break}else if(B[k]===Ct&&(S=k,k===0))break;if(k<0&&B[S]!==void 0&&B[S]!==Ct)return C.rightReverse(T,0);S>=0&&T.setSelectionRange(S,S,"backward")},rightReverse(T,S){const B=T.value.length,k=x(B),V=k.slice(0,S+1).indexOf(Ct)===-1;let F=Math.min(B,S+1);for(;F<=B;F++)if(k[F-1]===Ct){S=F,S>0&&V===!0&&S--;break}if(F>B&&k[S-1]!==void 0&&k[S-1]!==Ct)return C.leftReverse(T,B);T.setSelectionRange(S,S,"forward")}};function w(T){e("click",T),c=void 0}function R(T){if(e("keydown",T),p_(T)===!0||T.altKey===!0)return;const S=n.value,B=S.selectionStart,k=S.selectionEnd;if(T.shiftKey||(c=void 0),T.keyCode===37||T.keyCode===39){T.shiftKey&&c===void 0&&(c=S.selectionDirection==="forward"?B:k);const V=C[(T.keyCode===39?"right":"left")+(t.reverseFillMask===!0?"Reverse":"")];if(T.preventDefault(),V(S,c===B?k:B),T.shiftKey){const F=S.selectionStart;S.setSelectionRange(Math.min(c,F),Math.max(c,F),"forward")}}else T.keyCode===8&&t.reverseFillMask!==!0&&B===k?(C.left(S,B),S.setSelectionRange(S.selectionStart,k,"backward")):T.keyCode===46&&t.reverseFillMask===!0&&B===k&&(C.rightReverse(S,k),S.setSelectionRange(B,S.selectionEnd,"forward"))}function O(T){if(T==null||T==="")return"";if(t.reverseFillMask===!0)return U(T);const S=a;let B=0,k="";for(let V=0;V=0&&k!==-1;F--){const Y=S[F];let Z=T[k];if(typeof Y=="string")V=Y+V,Z===Y&&k--;else if(Z!==void 0&&Y.regex.test(Z))do V=(Y.transform!==void 0?Y.transform(Z):Z)+V,k--,Z=T[k];while(B===F&&Z!==void 0&&Y.regex.test(Z));else return V}return V}function H(T){return typeof T!="string"||o===void 0?typeof T=="number"?o(""+T):T:o(T)}function X(T){return r.length-T.length<=0?T:t.reverseFillMask===!0&&T.length!==0?r.slice(0,-T.length)+T:T+r.slice(T.length)}return{innerValue:g,hasMask:f,moveCursorForPaste:L,updateMaskValue:A,onMaskedKeydown:R,onMaskedClick:w}}const jf={name:String};function zT(t={}){return(e,i,n)=>{e[i](ue("input",{class:"hidden"+(n||""),...t.value}))}}function A4(t){return oe(()=>t.name||t.for)}function D4(t,e){function i(){const n=t.modelValue;try{const s="DataTransfer"in window?new DataTransfer:"ClipboardEvent"in window?new ClipboardEvent("").clipboardData:void 0;return Object(n)===n&&("length"in n?Array.from(n):[n]).forEach(r=>{s.items.add(r)}),{files:s.files}}catch{return{files:void 0}}}return oe(()=>{if(t.type==="file")return i()})}const k4=/[\u3000-\u303f\u3040-\u309f\u30a0-\u30ff\uff00-\uff9f\u4e00-\u9faf\u3400-\u4dbf]/,I4=/[\u4e00-\u9fff\u3400-\u4dbf\u{20000}-\u{2a6df}\u{2a700}-\u{2b73f}\u{2b740}-\u{2b81f}\u{2b820}-\u{2ceaf}\uf900-\ufaff\u3300-\u33ff\ufe30-\ufe4f\uf900-\ufaff\u{2f800}-\u{2fa1f}]/u,P4=/[\u3131-\u314e\u314f-\u3163\uac00-\ud7a3]/,O4=/[a-z0-9_ -]$/i;function L4(t){return function(i){if(i.type==="compositionend"||i.type==="change"){if(i.target.qComposing!==!0)return;i.target.qComposing=!1,t(i)}else i.type==="compositionupdate"&&i.target.qComposing!==!0&&typeof i.data=="string"&&(kt.is.firefox===!0?O4.test(i.data)===!1:k4.test(i.data)===!0||I4.test(i.data)===!0||P4.test(i.data)===!0)===!0&&(i.target.qComposing=!0)}}const R4=Nt({name:"QInput",inheritAttrs:!1,props:{...b4,...C4,...jf,modelValue:[String,Number,FileList],shadowText:String,type:{type:String,default:"text"},debounce:[String,Number],autogrow:Boolean,inputClass:[Array,String,Object],inputStyle:[Array,String,Object]},emits:[...T4,"paste","change","keydown","click","animationend"],setup(t,{emit:e,attrs:i}){const{proxy:n}=yt(),{$q:s}=n,r={};let a=NaN,o,u,c=null,f;const g=Ge(null),y=A4(t),{innerValue:_,hasMask:x,moveCursorForPaste:b,updateMaskValue:A,onMaskedKeydown:L,onMaskedClick:C}=w4(t,e,Z,g),w=D4(t),R=oe(()=>Ah(_.value)),O=L4(F),U=x4({changeEvent:!0}),H=oe(()=>t.type==="textarea"||t.autogrow===!0),X=oe(()=>H.value===!0||["text","search","url","tel","password"].includes(t.type)),T=oe(()=>{const ne={...U.splitAttrs.listeners.value,onInput:F,onPaste:V,onChange:W,onBlur:Q,onFocus:Ul};return ne.onCompositionstart=ne.onCompositionupdate=ne.onCompositionend=O,x.value===!0&&(ne.onKeydown=L,ne.onClick=C),t.autogrow===!0&&(ne.onAnimationend=Y),ne}),S=oe(()=>{const ne={tabindex:0,"data-autofocus":t.autofocus===!0||void 0,rows:t.type==="textarea"?6:void 0,"aria-label":t.label,name:y.value,...U.splitAttrs.attributes.value,id:U.targetUid.value,maxlength:t.maxlength,disabled:t.disable===!0,readonly:t.readonly===!0};return H.value===!1&&(ne.type=t.type),t.autogrow===!0&&(ne.rows=1),ne});tt(()=>t.type,()=>{g.value&&(g.value.value=t.modelValue)}),tt(()=>t.modelValue,ne=>{if(x.value===!0){if(u===!0&&(u=!1,String(ne)===a))return;A(ne)}else _.value!==ne&&(_.value=ne,t.type==="number"&&r.hasOwnProperty("value")===!0&&(o===!0?o=!1:delete r.value));t.autogrow===!0&&gi(G)}),tt(()=>t.autogrow,ne=>{ne===!0?gi(G):g.value!==null&&i.rows>0&&(g.value.style.height="auto")}),tt(()=>t.dense,()=>{t.autogrow===!0&&gi(G)});function B(){$f(()=>{const ne=document.activeElement;g.value!==null&&g.value!==ne&&(ne===null||ne.id!==U.targetUid.value)&&g.value.focus({preventScroll:!0})})}function k(){g.value!==null&&g.value.select()}function V(ne){if(x.value===!0&&t.reverseFillMask!==!0){const Ce=ne.target;b(Ce,Ce.selectionStart,Ce.selectionEnd)}e("paste",ne)}function F(ne){if(!ne||!ne.target)return;if(t.type==="file"){e("update:modelValue",ne.target.files);return}const Ce=ne.target.value;if(ne.target.qComposing===!0){r.value=Ce;return}if(x.value===!0)A(Ce,!1,ne.inputType);else if(Z(Ce),X.value===!0&&ne.target===document.activeElement){const{selectionStart:Ie,selectionEnd:De}=ne.target;Ie!==void 0&&De!==void 0&&gi(()=>{ne.target===document.activeElement&&Ce.indexOf(ne.target.value)===0&&ne.target.setSelectionRange(Ie,De)})}t.autogrow===!0&&G()}function Y(ne){e("animationend",ne),G()}function Z(ne,Ce){f=()=>{c=null,t.type!=="number"&&r.hasOwnProperty("value")===!0&&delete r.value,t.modelValue!==ne&&a!==ne&&(a=ne,Ce===!0&&(u=!0),e("update:modelValue",ne),gi(()=>{a===ne&&(a=NaN)})),f=void 0},t.type==="number"&&(o=!0,r.value=ne),t.debounce!==void 0?(c!==null&&clearTimeout(c),r.value=ne,c=setTimeout(f,t.debounce)):f()}function G(){requestAnimationFrame(()=>{const ne=g.value;if(ne!==null){const Ce=ne.parentNode.style,{scrollTop:Ie}=ne,{overflowY:De,maxHeight:Se}=s.platform.is.firefox===!0?{}:window.getComputedStyle(ne),te=De!==void 0&&De!=="scroll";te===!0&&(ne.style.overflowY="hidden"),Ce.marginBottom=ne.scrollHeight-1+"px",ne.style.height="1px",ne.style.height=ne.scrollHeight+"px",te===!0&&(ne.style.overflowY=parseInt(Se,10){g.value!==null&&(g.value.value=_.value!==void 0?_.value:"")})}function se(){return r.hasOwnProperty("value")===!0?r.value:_.value!==void 0?_.value:""}bi(()=>{Q()}),Mn(()=>{t.autogrow===!0&&G()}),Object.assign(U,{innerValue:_,fieldClass:oe(()=>`q-${H.value===!0?"textarea":"input"}`+(t.autogrow===!0?" q-textarea--autogrow":"")),hasShadow:oe(()=>t.type!=="file"&&typeof t.shadowText=="string"&&t.shadowText.length!==0),inputRef:g,emitValue:Z,hasValue:R,floatingLabel:oe(()=>R.value===!0&&(t.type!=="number"||isNaN(_.value)===!1)||Ah(t.displayValue)),getControl:()=>ue(H.value===!0?"textarea":"input",{ref:g,class:["q-field__native q-placeholder",t.inputClass],style:t.inputStyle,...S.value,...T.value,...t.type!=="file"?{value:se()}:w.value}),getShadowControl:()=>ue("div",{class:"q-field__native q-field__shadow absolute-bottom no-pointer-events"+(H.value===!0?"":" text-no-wrap")},[ue("span",{class:"invisible"},se()),ue("span",t.shadowText)])});const re=S4(U);return Object.assign(n,{focus:B,select:k,getNativeElement:()=>g.value}),Vs(n,"nativeEl",()=>g.value),re}});function WT(t,e){const i=Ge(null),n=oe(()=>t.disable===!0?null:ue("span",{ref:i,class:"no-outline",tabindex:-1}));function s(r){const a=e.value;r!==void 0&&r.type.indexOf("key")===0?a!==null&&document.activeElement!==a&&a.contains(document.activeElement)===!0&&a.focus():i.value!==null&&(r===void 0||a!==null&&a.contains(r.target)===!0)&&i.value.focus()}return{refocusTargetEl:n,refocusTarget:s}}const GT={xs:30,sm:35,md:40,lg:50,xl:60},M4=()=>ue("svg",{key:"svg",class:"q-radio__bg absolute non-selectable",viewBox:"0 0 24 24"},[ue("path",{d:"M12,22a10,10 0 0 1 -10,-10a10,10 0 0 1 10,-10a10,10 0 0 1 10,10a10,10 0 0 1 -10,10m0,-22a12,12 0 0 0 -12,12a12,12 0 0 0 12,12a12,12 0 0 0 12,-12a12,12 0 0 0 -12,-12"}),ue("path",{class:"q-radio__check",d:"M12,6a6,6 0 0 0 -6,6a6,6 0 0 0 6,6a6,6 0 0 0 6,-6a6,6 0 0 0 -6,-6"})]),N4=Nt({name:"QRadio",props:{...Hs,...To,...jf,modelValue:{required:!0},val:{required:!0},label:String,leftLabel:Boolean,checkedIcon:String,uncheckedIcon:String,color:String,keepColor:Boolean,dense:Boolean,disable:Boolean,tabindex:[String,Number]},emits:["update:modelValue"],setup(t,{slots:e,emit:i}){const{proxy:n}=yt(),s=zs(t,n.$q),r=xo(t,GT),a=Ge(null),{refocusTargetEl:o,refocusTarget:u}=WT(t,a),c=oe(()=>Ve(t.modelValue)===Ve(t.val)),f=oe(()=>"q-radio cursor-pointer no-outline row inline no-wrap items-center"+(t.disable===!0?" disabled":"")+(s.value===!0?" q-radio--dark":"")+(t.dense===!0?" q-radio--dense":"")+(t.leftLabel===!0?" reverse":"")),g=oe(()=>{const R=t.color!==void 0&&(t.keepColor===!0||c.value===!0)?` text-${t.color}`:"";return`q-radio__inner relative-position q-radio__inner--${c.value===!0?"truthy":"falsy"}${R}`}),y=oe(()=>(c.value===!0?t.checkedIcon:t.uncheckedIcon)||null),_=oe(()=>t.disable===!0?-1:t.tabindex||0),x=oe(()=>{const R={type:"radio"};return t.name!==void 0&&Object.assign(R,{".checked":c.value===!0,"^checked":c.value===!0?"checked":void 0,name:t.name,value:t.val}),R}),b=zT(x);function A(R){R!==void 0&&(Ai(R),u(R)),t.disable!==!0&&c.value!==!0&&i("update:modelValue",t.val,R)}function L(R){(R.keyCode===13||R.keyCode===32)&&Ai(R)}function C(R){(R.keyCode===13||R.keyCode===32)&&A(R)}Object.assign(n,{set:A});const w=M4();return()=>{const R=y.value!==null?[ue("div",{key:"icon",class:"q-radio__icon-container absolute-full flex flex-center no-wrap"},[ue(On,{class:"q-radio__icon",name:y.value})])]:[w];t.disable!==!0&&b(R,"unshift"," q-radio__native q-ma-none q-pa-none");const O=[ue("div",{class:g.value,style:r.value,"aria-hidden":"true"},R)];o.value!==null&&O.push(o.value);const U=t.label!==void 0?ks(e.default,[t.label]):Hi(e.default);return U!==void 0&&O.push(ue("div",{class:"q-radio__label q-anchor--skip"},U)),ue("div",{ref:a,class:f.value,tabindex:_.value,role:"radio","aria-label":t.label,"aria-checked":c.value===!0?"true":"false","aria-disabled":t.disable===!0?"true":void 0,onClick:A,onKeydown:L,onKeyup:C},O)}}}),KT={...Hs,...To,...jf,modelValue:{required:!0,default:null},val:{},trueValue:{default:!0},falseValue:{default:!1},indeterminateValue:{default:null},checkedIcon:String,uncheckedIcon:String,indeterminateIcon:String,toggleOrder:{type:String,validator:t=>t==="tf"||t==="ft"},toggleIndeterminate:Boolean,label:String,leftLabel:Boolean,color:String,keepColor:Boolean,dense:Boolean,disable:Boolean,tabindex:[String,Number]},XT=["update:modelValue"];function YT(t,e){const{props:i,slots:n,emit:s,proxy:r}=yt(),{$q:a}=r,o=zs(i,a),u=Ge(null),{refocusTargetEl:c,refocusTarget:f}=WT(i,u),g=xo(i,GT),y=oe(()=>i.val!==void 0&&Array.isArray(i.modelValue)),_=oe(()=>{const k=Ve(i.val);return y.value===!0?i.modelValue.findIndex(V=>Ve(V)===k):-1}),x=oe(()=>y.value===!0?_.value!==-1:Ve(i.modelValue)===Ve(i.trueValue)),b=oe(()=>y.value===!0?_.value===-1:Ve(i.modelValue)===Ve(i.falseValue)),A=oe(()=>x.value===!1&&b.value===!1),L=oe(()=>i.disable===!0?-1:i.tabindex||0),C=oe(()=>`q-${t} cursor-pointer no-outline row inline no-wrap items-center`+(i.disable===!0?" disabled":"")+(o.value===!0?` q-${t}--dark`:"")+(i.dense===!0?` q-${t}--dense`:"")+(i.leftLabel===!0?" reverse":"")),w=oe(()=>{const k=x.value===!0?"truthy":b.value===!0?"falsy":"indet",V=i.color!==void 0&&(i.keepColor===!0||(t==="toggle"?x.value===!0:b.value!==!0))?` text-${i.color}`:"";return`q-${t}__inner relative-position non-selectable q-${t}__inner--${k}${V}`}),R=oe(()=>{const k={type:"checkbox"};return i.name!==void 0&&Object.assign(k,{".checked":x.value,"^checked":x.value===!0?"checked":void 0,name:i.name,value:y.value===!0?i.val:i.trueValue}),k}),O=zT(R),U=oe(()=>{const k={tabindex:L.value,role:t==="toggle"?"switch":"checkbox","aria-label":i.label,"aria-checked":A.value===!0?"mixed":x.value===!0?"true":"false"};return i.disable===!0&&(k["aria-disabled"]="true"),k});function H(k){k!==void 0&&(Ai(k),f(k)),i.disable!==!0&&s("update:modelValue",X(),k)}function X(){if(y.value===!0){if(x.value===!0){const k=i.modelValue.slice();return k.splice(_.value,1),k}return i.modelValue.concat([i.val])}if(x.value===!0){if(i.toggleOrder!=="ft"||i.toggleIndeterminate===!1)return i.falseValue}else if(b.value===!0){if(i.toggleOrder==="ft"||i.toggleIndeterminate===!1)return i.trueValue}else return i.toggleOrder!=="ft"?i.trueValue:i.falseValue;return i.indeterminateValue}function T(k){(k.keyCode===13||k.keyCode===32)&&Ai(k)}function S(k){(k.keyCode===13||k.keyCode===32)&&H(k)}const B=e(x,A);return Object.assign(r,{toggle:H}),()=>{const k=B();i.disable!==!0&&O(k,"unshift",` q-${t}__native absolute q-ma-none q-pa-none`);const V=[ue("div",{class:w.value,style:g.value,"aria-hidden":"true"},k)];c.value!==null&&V.push(c.value);const F=i.label!==void 0?ks(n.default,[i.label]):Hi(n.default);return F!==void 0&&V.push(ue("div",{class:`q-${t}__label q-anchor--skip`},F)),ue("div",{ref:u,class:C.value,...U.value,onClick:H,onKeydown:T,onKeyup:S},V)}}const B4=()=>ue("div",{key:"svg",class:"q-checkbox__bg absolute"},[ue("svg",{class:"q-checkbox__svg fit absolute-full",viewBox:"0 0 24 24"},[ue("path",{class:"q-checkbox__truthy",fill:"none",d:"M1.73,12.91 8.1,19.28 22.79,4.59"}),ue("path",{class:"q-checkbox__indet",d:"M4,14H20V10H4"})])]),F4=Nt({name:"QCheckbox",props:KT,emits:XT,setup(t){const e=B4();function i(n,s){const r=oe(()=>(n.value===!0?t.checkedIcon:s.value===!0?t.indeterminateIcon:t.uncheckedIcon)||null);return()=>r.value!==null?[ue("div",{key:"icon",class:"q-checkbox__icon-container absolute-full flex flex-center no-wrap"},[ue(On,{class:"q-checkbox__icon",name:r.value})])]:[e]}return YT("checkbox",i)}}),U4=Nt({name:"QToggle",props:{...KT,icon:String,iconColor:String},emits:XT,setup(t){function e(i,n){const s=oe(()=>(i.value===!0?t.checkedIcon:n.value===!0?t.indeterminateIcon:t.uncheckedIcon)||t.icon),r=oe(()=>i.value===!0?t.iconColor:null);return()=>[ue("div",{class:"q-toggle__track"}),ue("div",{class:"q-toggle__thumb absolute flex flex-center no-wrap"},s.value!==void 0?[ue(On,{name:s.value,color:r.value})]:void 0)]}return YT("toggle",e)}}),QT={radio:N4,checkbox:F4,toggle:U4},q4=Object.keys(QT);function Ad(t,e){if(typeof t=="function")return t;const i=t!==void 0?t:e;return n=>n[i]}const $4=Nt({name:"QOptionGroup",props:{...Hs,modelValue:{required:!0},options:{type:Array,validator:t=>t.every(Di),default:()=>[]},optionValue:[Function,String],optionLabel:[Function,String],optionDisable:[Function,String],name:String,type:{type:String,default:"radio",validator:t=>q4.includes(t)},color:String,keepColor:Boolean,dense:Boolean,size:String,leftLabel:Boolean,inline:Boolean,disable:Boolean},emits:["update:modelValue"],setup(t,{emit:e,slots:i}){const{proxy:{$q:n}}=yt(),s=Array.isArray(t.modelValue);t.type==="radio"?s===!0&&console.error("q-option-group: model should not be array"):s===!1&&console.error("q-option-group: model should be array in your case");const r=zs(t,n),a=oe(()=>QT[t.type]),o=oe(()=>Ad(t.optionValue,"value")),u=oe(()=>Ad(t.optionLabel,"label")),c=oe(()=>Ad(t.optionDisable,"disable")),f=oe(()=>t.options.map(x=>({val:o.value(x),name:x.name===void 0?t.name:x.name,disable:t.disable||c.value(x),leftLabel:x.leftLabel===void 0?t.leftLabel:x.leftLabel,color:x.color===void 0?t.color:x.color,checkedIcon:x.checkedIcon,uncheckedIcon:x.uncheckedIcon,dark:x.dark===void 0?r.value:x.dark,size:x.size===void 0?t.size:x.size,dense:t.dense,keepColor:x.keepColor===void 0?t.keepColor:x.keepColor}))),g=oe(()=>"q-option-group q-gutter-x-sm"+(t.inline===!0?" q-option-group--inline":"")),y=oe(()=>{const x={role:"group"};return t.type==="radio"&&(x.role="radiogroup",t.disable===!0&&(x["aria-disabled"]="true")),x});function _(x){e("update:modelValue",x)}return()=>ue("div",{class:g.value,...y.value},t.options.map((x,b)=>{const A=i["label-"+b]!==void 0?()=>i["label-"+b](x):i.label!==void 0?()=>i.label(x):void 0;return ue("div",[ue(a.value,{label:A===void 0?u.value(x):null,modelValue:t.modelValue,"onUpdate:modelValue":_,...f.value[b]},A)])}))}}),j4=Nt({name:"DialogPluginComponent",props:{...Hs,title:String,message:String,prompt:Object,options:Object,progress:[Boolean,Object],html:Boolean,ok:{type:[String,Object,Boolean],default:!0},cancel:[String,Object,Boolean],focus:{type:String,default:"ok",validator:t=>["ok","cancel","none"].includes(t)},stackButtons:Boolean,color:String,cardClass:[String,Array,Object],cardStyle:[String,Array,Object]},emits:["ok","hide"],setup(t,{emit:e}){const{proxy:i}=yt(),{$q:n}=i,s=zs(t,n),r=Ge(null),a=Ge(t.prompt!==void 0?t.prompt.model:t.options!==void 0?t.options.model:void 0),o=oe(()=>"q-dialog-plugin"+(s.value===!0?" q-dialog-plugin--dark q-dark":"")+(t.progress!==!1?" q-dialog-plugin--progress":"")),u=oe(()=>t.color||(s.value===!0?"amber":"primary")),c=oe(()=>t.progress===!1?null:Di(t.progress)===!0?{component:t.progress.spinner||ao,props:{color:t.progress.color||u.value}}:{component:ao,props:{color:u.value}}),f=oe(()=>t.prompt!==void 0||t.options!==void 0),g=oe(()=>{if(f.value!==!0)return{};const{model:F,isValid:Y,items:Z,...G}=t.prompt!==void 0?t.prompt:t.options;return G}),y=oe(()=>Di(t.ok)===!0||t.ok===!0?n.lang.label.ok:t.ok),_=oe(()=>Di(t.cancel)===!0||t.cancel===!0?n.lang.label.cancel:t.cancel),x=oe(()=>t.prompt!==void 0?t.prompt.isValid!==void 0&&t.prompt.isValid(a.value)!==!0:t.options!==void 0?t.options.isValid!==void 0&&t.options.isValid(a.value)!==!0:!1),b=oe(()=>({color:u.value,label:y.value,ripple:!1,disable:x.value,...Di(t.ok)===!0?t.ok:{flat:!0},"data-autofocus":t.focus==="ok"&&f.value!==!0||void 0,onClick:w})),A=oe(()=>({color:u.value,label:_.value,ripple:!1,...Di(t.cancel)===!0?t.cancel:{flat:!0},"data-autofocus":t.focus==="cancel"&&f.value!==!0||void 0,onClick:R}));tt(()=>t.prompt&&t.prompt.model,U),tt(()=>t.options&&t.options.model,U);function L(){r.value.show()}function C(){r.value.hide()}function w(){e("ok",Ve(a.value)),C()}function R(){C()}function O(){e("hide")}function U(F){a.value=F}function H(F){x.value!==!0&&t.prompt.type!=="textarea"&&Za(F,13)===!0&&w()}function X(F,Y){return t.html===!0?ue(Sa,{class:F,innerHTML:Y}):ue(Sa,{class:F},()=>Y)}function T(){return[ue(R4,{color:u.value,dense:!0,autofocus:!0,dark:s.value,...g.value,modelValue:a.value,"onUpdate:modelValue":U,onKeyup:H})]}function S(){return[ue($4,{color:u.value,options:t.options.items,dark:s.value,...g.value,modelValue:a.value,"onUpdate:modelValue":U})]}function B(){const F=[];return t.cancel&&F.push(ue(Ch,A.value)),t.ok&&F.push(ue(Ch,b.value)),ue(u4,{class:t.stackButtons===!0?"items-end":"",vertical:t.stackButtons,align:"right"},()=>F)}function k(){const F=[];return t.title&&F.push(X("q-dialog__title",t.title)),t.progress!==!1&&F.push(ue(Sa,{class:"q-dialog__progress"},()=>ue(c.value.component,c.value.props))),t.message&&F.push(X("q-dialog__message",t.message)),t.prompt!==void 0?F.push(ue(Sa,{class:"scroll q-dialog-plugin__form"},T)):t.options!==void 0&&F.push(ue(R0,{dark:s.value}),ue(Sa,{class:"scroll q-dialog-plugin__form"},S),ue(R0,{dark:s.value})),(t.ok||t.cancel)&&F.push(B()),F}function V(){return[ue(l4,{class:[o.value,t.cardClass],style:t.cardStyle,dark:s.value},k)]}return Object.assign(i,{show:L,hide:C}),()=>ue(o4,{ref:r,onHide:O},V)}});function JT(t,e){for(const i in e)i!=="spinner"&&Object(e[i])===e[i]?(t[i]=Object(t[i])!==t[i]?{}:{...t[i]},JT(t[i],e[i])):t[i]=e[i]}function V4(t,e,i){return n=>{let s,r;const a=n.component!==void 0;if(a===!0){const{component:C,componentProps:w}=n;s=typeof C=="string"?i.component(C):C,r=w||{}}else{const{class:C,style:w,...R}=n;s=t,r=R,C!==void 0&&(R.cardClass=C),w!==void 0&&(R.cardStyle=w)}let o,u=!1;const c=Ge(null),f=Qu(!1,"dialog"),g=C=>{if(c.value!==null&&c.value[C]!==void 0){c.value[C]();return}const w=o.$.subTree;if(w&&w.component){if(w.component.proxy&&w.component.proxy[C]){w.component.proxy[C]();return}if(w.component.subTree&&w.component.subTree.component&&w.component.subTree.component.proxy&&w.component.subTree.component.proxy[C]){w.component.subTree.component.proxy[C]();return}}console.error("[Quasar] Incorrectly defined Dialog component")},y=[],_=[],x={onOk(C){return y.push(C),x},onCancel(C){return _.push(C),x},onDismiss(C){return y.push(C),_.push(C),x},hide(){return g("hide"),x},update(C){if(o!==null){if(a===!0)Object.assign(r,C);else{const{class:w,style:R,...O}=C;w!==void 0&&(O.cardClass=w),R!==void 0&&(O.cardStyle=R),JT(r,O)}o.$forceUpdate()}return x}},b=C=>{u=!0,y.forEach(w=>{w(C)})},A=()=>{L.unmount(f),BT(f),L=null,o=null,u!==!0&&_.forEach(C=>{C()})};let L=Jh({name:"QGlobalDialog",setup:()=>()=>ue(s,{...r,ref:c,onOk:b,onHide:A,onVnodeMounted(...C){typeof r.onVnodeMounted=="function"&&r.onVnodeMounted(...C),gi(()=>g("show"))}})},i);return o=L.mount(f),x}}const H4={install({$q:t,parentApp:e}){t.dialog=this.create=V4(j4,!0,e)}};function ZT(t){return encodeURIComponent(t)}function e2(t){return decodeURIComponent(t)}function z4(t){return ZT(t===Object(t)?JSON.stringify(t):""+t)}function W4(t){if(t==="")return t;t.indexOf('"')===0&&(t=t.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\")),t=e2(t.replace(/\+/g," "));try{const e=JSON.parse(t);(e===Object(e)||Array.isArray(e)===!0)&&(t=e)}catch{}return t}function t2(t){const e=new Date;return e.setMilliseconds(e.getMilliseconds()+t),e.toUTCString()}function G4(t){let e=0;const i=t.match(/(\d+)d/),n=t.match(/(\d+)h/),s=t.match(/(\d+)m/),r=t.match(/(\d+)s/);return i&&(e+=i[1]*864e5),n&&(e+=n[1]*36e5),s&&(e+=s[1]*6e4),r&&(e+=r[1]*1e3),e===0?t:t2(e)}function i2(t,e,i={},n){let s,r;i.expires!==void 0&&(Object.prototype.toString.call(i.expires)==="[object Date]"?s=i.expires.toUTCString():typeof i.expires=="string"?s=G4(i.expires):(r=parseFloat(i.expires),s=isNaN(r)===!1?t2(r*864e5):i.expires));const o=[`${ZT(t)}=${z4(e)}`,s!==void 0?"; Expires="+s:"",i.path?"; Path="+i.path:"",i.domain?"; Domain="+i.domain:"",i.sameSite?"; SameSite="+i.sameSite:"",i.httpOnly?"; HttpOnly":"",i.secure?"; Secure":"",i.other?"; "+i.other:""].join("");document.cookie=o}function Dh(t,e){const i=document,n=i.cookie?i.cookie.split("; "):[],s=n.length;let r=t?null:{},a=0,o,u,c;for(;aDh(e),set:(e,i,n)=>i2(e,i,n),has:e=>X4(e),remove:(e,i)=>K4(e,i),getAll:()=>Dh(null)}}const n2={install({$q:t,ssrContext:e}){t.cookies=this}};Object.assign(n2,Y4());function Q4(t,e,i){return i<=e?e:Math.min(i,Math.max(e,t))}function MR(t,e,i){if(i<=e)return e;const n=i-e+1;let s=e+(t-e)%n;return s1)&&(Vf.prototype.open=function(e,i){const n=[],s=()=>{hu.forEach(a=>{(a.hijackFilter.value===null||a.hijackFilter.value(i)===!0)&&(a.start(),n.push(a.stop))})},r=()=>{n.forEach(a=>{a()})};this.addEventListener("loadstart",s,{once:!0}),this.addEventListener("loadend",r,{once:!0}),s2.apply(this,arguments)})}function iR(t){hu=hu.filter(e=>e.start!==t),za=Math.max(0,za-1),za===0&&(Vf.prototype.open=s2)}const nR=Nt({name:"QAjaxBar",props:{position:{type:String,default:"top",validator:t=>J4.includes(t)},size:{type:String,default:"2px"},color:String,skipHijack:Boolean,reverse:Boolean,hijackFilter:Function},emits:["start","stop"],setup(t,{emit:e}){const{proxy:i}=yt(),n=Ge(0),s=Ge(!1),r=Ge(!0);let a=0,o=null,u;const c=oe(()=>`q-loading-bar q-loading-bar--${t.position}`+(t.color!==void 0?` bg-${t.color}`:"")+(r.value===!0?"":" no-transition")),f=oe(()=>t.position==="top"||t.position==="bottom"),g=oe(()=>f.value===!0?"height":"width"),y=oe(()=>{const w=s.value,R=Z4({p:n.value,pos:t.position,active:w,horiz:f.value,reverse:i.$q.lang.rtl===!0&&["top","bottom"].includes(t.position)?t.reverse===!1:t.reverse,dir:i.$q.lang.rtl===!0?-1:1});return R[g.value]=t.size,R.opacity=w?1:0,R}),_=oe(()=>s.value===!0?{role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":n.value}:{"aria-hidden":"true"});function x(w=300){const R=u;return u=Math.max(0,w)||0,a++,a>1?(R===0&&w>0?L():o!==null&&R>0&&w<=0&&(clearTimeout(o),o=null),a):(o!==null&&clearTimeout(o),e("start"),n.value=0,o=setTimeout(()=>{o=null,r.value=!0,w>0&&L()},s._value===!0?500:1),s._value!==!0&&(s.value=!0,r.value=!1),a)}function b(w){return a>0&&(n.value=eR(n.value,w)),a}function A(){if(a=Math.max(0,a-1),a>0)return a;o!==null&&(clearTimeout(o),o=null),e("stop");const w=()=>{r.value=!0,n.value=100,o=setTimeout(()=>{o=null,s.value=!1},1e3)};return n.value===0?o=setTimeout(w,1):w(),a}function L(){n.value<100&&(o=setTimeout(()=>{o=null,b(),L()},u))}let C;return Mn(()=>{t.skipHijack!==!0&&(C=!0,tR({start:x,stop:A,hijackFilter:oe(()=>t.hijackFilter||null)}))}),bi(()=>{o!==null&&clearTimeout(o),C===!0&&iR(x)}),Object.assign(i,{start:x,stop:A,increment:b}),()=>ue("div",{class:c.value,style:y.value,..._.value})}}),hl=Ge(null),kh=fo({isActive:!1},{start:kn,stop:kn,increment:kn,setDefaults:kn,install({$q:t,parentApp:e}){if(t.loadingBar=this,this.__installed===!0){t.config.loadingBar!==void 0&&this.setDefaults(t.config.loadingBar);return}const i=Ge(t.config.loadingBar!==void 0?{...t.config.loadingBar}:{});function n(){kh.isActive=!0}function s(){kh.isActive=!1}const r=Qu("q-loading-bar");Jh({name:"LoadingBar",devtools:{hide:!0},setup:()=>()=>ue(nR,{...i.value,onStart:n,onStop:s,ref:hl})},e).mount(r),Object.assign(this,{start(a){hl.value.start(a)},stop(){hl.value.stop()},increment(){hl.value.increment.apply(null,arguments)},setDefaults(a){Di(a)===!0&&Object.assign(i.value,a)}})}}),sR={config:{dark:"auto"},plugins:{Notify:OL,Dialog:H4,Cookies:n2,LoadingBar:kh}},rR="/";async function aR({app:t,router:e},i){let n=!1;const s=o=>{try{return e.resolve(o).href}catch{}return Object(o)===o?null:o},r=o=>{if(n=!0,typeof o=="string"&&/^https?:\/\//.test(o)){window.location.href=o;return}const u=s(o);u!==null&&(window.location.href=u,window.location.reload())},a=window.location.href.replace(window.location.origin,"");for(let o=0;n===!1&&o{const[e,i]=Promise.allSettled!==void 0?["allSettled",n=>n.map(s=>{if(s.status==="rejected"){console.error("[Quasar] boot error:",s.reason);return}return s.value.default})]:["all",n=>n.map(s=>s.default)];return Promise[e]([xn(()=>import("./i18n-CAgyZLUx.js"),[])]).then(n=>{const s=i(n).filter(r=>typeof r=="function");aR(t,s)})});export{ks as $,wR as A,NL as B,Hs as C,BL as D,zs as E,ni as F,RL as G,FL as H,LL as I,gi as J,Q4 as K,Ty as L,AR as M,e4 as N,gl as O,yR as P,On as Q,OR as R,LR as S,co as T,kn as U,oi as V,KL as W,XL as X,ss as Y,RR as Z,Fr as _,Wh as a,Vs as a$,NE as a0,IR as a1,PR as a2,Za as a3,TP as a4,ER as a5,CR as a6,Ll as a7,Ud as a8,Xx as a9,Su as aA,Oy as aB,b4 as aC,T4 as aD,S4 as aE,x4 as aF,To as aG,xo as aH,QO as aI,dL as aJ,jf as aK,A4 as aL,Ah as aM,Oc as aN,Ry as aO,My as aP,es as aQ,L4 as aR,MR as aS,p_ as aT,LT as aU,zd as aV,TR as aW,vR as aX,Di as aY,fR as aZ,F4 as a_,dR as aa,VS as ab,px as ac,Sa as ad,e_ as ae,R4 as af,u4 as ag,o4 as ah,OL as ai,oS as aj,qS as ak,dr as al,jE as am,R0 as an,rL as ao,uR as ap,HS as aq,ML as ar,qL as as,WL as at,qE as au,UE as av,Ml as aw,Ai as ax,h_ as ay,tS as az,Gt as b,hR as b0,DR as b1,mL as b2,Hd as b3,wl as b4,kt as b5,s4 as b6,P0 as b7,r4 as b8,BE as b9,O0 as ba,VL as bb,uL as bc,$f as bd,pR as be,gR as bf,xR as bg,Rh as bh,cR as bi,l4 as bj,RT as bk,ZE as bl,ao as bm,bR as bn,JE as bo,n2 as bp,H4 as bq,oe as c,Tu as d,lR as e,RP as f,yt as g,ue as h,Ii as i,Wt as j,SR as k,Nt as l,Hi as m,TL as n,Mn as o,f4 as p,kR as q,Ge as r,fl as s,Ch as t,UL as u,Ul as v,tt as w,_R as x,mR as y,bi as z};