@shumai-one/shumai 0.1.9 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/chunk-09wp20mv.js +1 -0
- package/bin/{chunk-zd8tf4j1.js → chunk-2cmg5sfn.js} +1 -1
- package/bin/chunk-2s5a64nr.js +2 -0
- package/bin/chunk-33ee1cvv.js +2 -0
- package/bin/chunk-3m39v371.js +1 -0
- package/bin/{chunk-v1ax9cja.js → chunk-49ej1y67.js} +1 -1
- package/bin/{chunk-t1sv4zdb.js → chunk-4hnrd4qh.js} +2 -2
- package/bin/{chunk-e2ekkk1h.js → chunk-4kk5g619.js} +1 -1
- package/bin/chunk-4zq8vxcy.css +1 -0
- package/bin/{chunk-dh4tbp68.js → chunk-5tmf3c0g.js} +1 -1
- package/bin/chunk-6c4c7t0n.js +1 -0
- package/bin/chunk-6frqqxkv.js +1 -0
- package/bin/{chunk-by6reed2.js → chunk-6mn3jqm9.js} +1 -1
- package/bin/{chunk-22v60r4w.js → chunk-6r9w7z15.js} +1 -1
- package/bin/chunk-8s0ae37g.js +1 -0
- package/bin/{chunk-fjhbwem5.js → chunk-8wv3kdz9.js} +1 -1
- package/bin/{chunk-wsnrv2aa.js → chunk-ajqsprm0.js} +1 -1
- package/bin/{chunk-fybr479k.js → chunk-axx5bh38.js} +2 -2
- package/bin/{chunk-4ddrkmxq.js → chunk-cp18trqb.js} +1 -1
- package/bin/chunk-d0n8nxp3.js +3 -0
- package/bin/chunk-d22pyc5n.js +1 -0
- package/bin/chunk-dgx2zxze.js +320 -0
- package/bin/{chunk-62rqa4dq.js → chunk-e5833tbd.js} +1 -1
- package/bin/{chunk-9awf1xp6.js → chunk-frm7vz6v.js} +2 -2
- package/bin/{chunk-zyhr9ajx.js → chunk-fwf8yne2.js} +1 -1
- package/bin/chunk-g7wrxnmd.js +1 -0
- package/bin/{chunk-qzgkshc5.js → chunk-gk7158n4.js} +1 -1
- package/bin/chunk-hb5v9ees.js +2 -0
- package/bin/{chunk-2xx8j495.js → chunk-hdk93ghf.js} +1 -1
- package/bin/{chunk-qedhje78.js → chunk-j8q688sx.js} +1 -1
- package/bin/chunk-jrvrg4fx.js +1 -0
- package/bin/chunk-kef0rnwn.js +1 -0
- package/bin/{chunk-kqgfhhk4.js → chunk-kpy0kpna.js} +1 -1
- package/bin/{chunk-ej456cn5.js → chunk-m54p1cvp.js} +1 -1
- package/bin/{chunk-vqketj32.js → chunk-m7jfszqt.js} +1 -1
- package/bin/{chunk-mxwnzxmd.js → chunk-mnv6pj0k.js} +1 -1
- package/bin/chunk-nn8e9j7c.js +1 -0
- package/bin/chunk-nwtb6dt1.js +62 -0
- package/bin/{chunk-45yzs9sh.js → chunk-pf8edn5x.js} +1 -1
- package/bin/{chunk-vreyhvb6.js → chunk-pqm0g14r.js} +1 -1
- package/bin/chunk-ps4h3387.js +5 -0
- package/bin/chunk-q4f5vvtx.js +2 -0
- package/bin/{chunk-sj6fzxmd.js → chunk-r3n9zpfw.js} +1 -1
- package/bin/chunk-symna5cj.js +1 -0
- package/bin/chunk-twzgpwst.js +2 -0
- package/bin/chunk-vgvmt2m1.js +2 -0
- package/bin/{chunk-q9zn84ms.js → chunk-xpqcvxej.js} +2 -2
- package/bin/{chunk-2kp858g5.js → chunk-yk3k5g5w.js} +1 -1
- package/bin/{chunk-zxd1hrpf.js → chunk-z42cyc20.js} +1 -1
- package/bin/chunk-zsdwska1.js +1 -0
- package/bin/pdf.worker.min-szxdj13d.mjs +59109 -0
- package/bin/shumai-app.html +1 -1
- package/bin/shumai-app.js +240 -217
- package/package.json +8 -7
- package/prisma/migrations/20260719042433_add_split_transcode_task_types/migration.sql +14 -0
- package/prisma/migrations/20260719132047_backfill_media_proxy_type/migration.sql +32 -0
- package/prisma/schema.prisma +6 -0
- package/bin/chunk-1rvy3h5v.js +0 -1
- package/bin/chunk-23ggq8gr.js +0 -1
- package/bin/chunk-2cqxd8de.js +0 -2
- package/bin/chunk-314ncj75.js +0 -2
- package/bin/chunk-749eqers.js +0 -1
- package/bin/chunk-abm6b5hq.js +0 -5
- package/bin/chunk-at2kt8kk.js +0 -1
- package/bin/chunk-dfsfh3pw.js +0 -2
- package/bin/chunk-dsnnmmd9.js +0 -62
- package/bin/chunk-e1gzv3p0.js +0 -2
- package/bin/chunk-f9v92x1z.js +0 -2
- package/bin/chunk-j8e6ytkh.css +0 -1
- package/bin/chunk-jdgf23w4.js +0 -1
- package/bin/chunk-jm7c1sd3.js +0 -1
- package/bin/chunk-jwdf5dkn.js +0 -1
- package/bin/chunk-m3eys85a.js +0 -1
- package/bin/chunk-n2n6etpd.js +0 -2
- package/bin/chunk-parn6mr0.js +0 -1
- package/bin/chunk-raxnhtb0.js +0 -2
- package/bin/chunk-s3eadfmq.js +0 -266
- package/bin/chunk-saq2g4j3.js +0 -1
- package/bin/chunk-ts1w9p9a.js +0 -1
- package/bin/chunk-ycx0497z.js +0 -1
- package/bin/chunk-ywzht1v9.js +0 -3
package/bin/chunk-s3eadfmq.js
DELETED
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
import{A as dK,H as WH,I as lj,J as v$,K as z8,L as EJ,M as xB,N as tJ,O as RH,v as pj,y as iK,z as cK}from"./chunk-fybr479k.js";import{$ as VH}from"./chunk-314ncj75.js";import{Xa as HO}from"./chunk-wsnrv2aa.js";import{$e as AO,Ie as lJ,Je as iJ,Ke as _j,Me as YO,Ne as Gj,Oe as Yj,Qe as Xj,Re as Mj,Se as XO,Te as Kj,Ue as Zj,Ve as XH,We as KH,Xe as ZH,Ye as JH,Ze as mj,_e as fj,af as zO,hf as lK}from"./chunk-4ddrkmxq.js";import{Jf as MH}from"./chunk-qedhje78.js";import{Rf as lQ}from"./chunk-e2ekkk1h.js";import{Wf as kj,Xf as Xh,Yf as i2}from"./chunk-mxwnzxmd.js";import{Zf as TH,_f as uj}from"./chunk-e1gzv3p0.js";import{$h as oh,$i as t7,Gg as y1,Ni as HY,Pg as SH,Rh as $J,Ri as D5,Ti as j3,Ui as qH,Vh as LJ,Vi as QH,Wh as Jh,Wi as DH,Xi as VY,Yg as EH,Zh as $H,Zi as UY,_g as kQ,_h as F$,_i as EY,ah as aJ,ai as jJ,bg as l2,cg as hh,ci as LH,cj as NJ,dg as f,di as T$,eg as O0,fg as uK,fh as CH,fi as W$,hg as Gh,ih as nh,jg as Yh,jh as Kh,ji as jH,jj as c0,kg as bj,kj as pQ,lj as BH,mi as mQ,mj as OH,nj as AH,pj as zH,qh as NH,qi as FH,qj as HH,sh as vj,vh as A6,vi as R$,wi as S$,yh as pK,yi as Zh,zg as UH}from"./chunk-dsnnmmd9.js";import{$j as uq,Zj as S1,_j as U1}from"./chunk-kbzm1pwx.js";var AA=U1((ku,OA)=>{var QA=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,cT=/\n/g,dT=/^\s*/,aT=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,tT=/^:\s*/,sT=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,nT=/^[;\s]*/,oT=/^\s+|\s+$/g,rT=`
|
|
2
|
-
`,DA="/",MA="*",F7="",eT="comment",hW="declaration";function _W(h,_){if(typeof h!=="string")throw TypeError("First argument must be a string");if(!h)return[];_=_||{};var G=1,Y=1;function X(j){var W=j.match(cT);if(W)G+=W.length;var S=j.lastIndexOf(rT);Y=~S?j.length-S:Y+j.length}function K(){var j={line:G,column:Y};return function(W){return W.position=new Z(j),O(),W}}function Z(j){this.start=j,this.end={line:G,column:Y},this.source=_.source}Z.prototype.content=h;function Q(j){var W=Error(_.source+":"+G+":"+Y+": "+j);if(W.reason=j,W.filename=_.source,W.line=G,W.column=Y,W.source=h,_.silent);else throw W}function D(j){var W=j.exec(h);if(!W)return;var S=W[0];return X(S),h=h.slice(S.length),W}function O(){D(dT)}function A(j){var W;j=j||[];while(W=H())if(W!==!1)j.push(W);return j}function H(){var j=K();if(DA!=h.charAt(0)||MA!=h.charAt(1))return;var W=2;while(F7!=h.charAt(W)&&(MA!=h.charAt(W)||DA!=h.charAt(W+1)))++W;if(W+=2,F7===h.charAt(W-1))return Q("End of comment missing");var S=h.slice(2,W-2);return Y+=2,X(S),h=h.slice(W),Y+=2,j({type:eT,comment:S})}function C(){var j=K(),W=D(aT);if(!W)return;if(H(),!D(tT))return Q("property missing ':'");var S=D(sT),R=j({type:hW,property:BA(W[0].replace(QA,F7)),value:S?BA(S[0].replace(QA,F7)):F7});return D(nT),R}function N(){var j=[];A(j);var W;while(W=C())if(W!==!1)j.push(W),A(j);return j}return O(),N()}function BA(h){return h?h.replace(oT,F7):F7}OA.exports=_W});var zA=U1((MG)=>{var GW=MG&&MG.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(MG,"__esModule",{value:!0});MG.default=XW;var YW=GW(AA());function XW(h,_){let G=null;if(!h||typeof h!=="string")return G;let Y=(0,YW.default)(h),X=typeof _==="function";return Y.forEach((K)=>{if(K.type!=="declaration")return;let{property:Z,value:Q}=K;if(X)_(Z,Q,K);else if(Q)G=G||{},G[Z]=Q}),G}});var EA=U1((VA)=>{Object.defineProperty(VA,"__esModule",{value:!0});VA.camelCase=void 0;var KW=/^--[a-zA-Z0-9_-]+$/,ZW=/-([a-z])/g,JW=/^[^-]+$/,qW=/^-(webkit|moz|ms|o|khtml)-/,QW=/^-(ms)-/,DW=function(h){return!h||JW.test(h)||KW.test(h)},MW=function(h,_){return _.toUpperCase()},HA=function(h,_){return"".concat(_,"-")},BW=function(h,_){if(_===void 0)_={};if(DW(h))return h;if(h=h.toLowerCase(),_.reactCompat)h=h.replace(QW,HA);else h=h.replace(qW,HA);return h.replace(ZW,MW)};VA.camelCase=BW});var NA=U1((nq,CA)=>{var OW=nq&&nq.__importDefault||function(h){return h&&h.__esModule?h:{default:h}},AW=OW(zA()),zW=EA();function sq(h,_){var G={};if(!h||typeof h!=="string")return G;return(0,AW.default)(h,function(Y,X){if(Y&&X)G[(0,zW.camelCase)(Y,_)]=X}),G}sq.default=sq;CA.exports=sq});var cz=U1((va,iz)=>{var bK=Object.prototype.hasOwnProperty,lz=Object.prototype.toString,bz=Object.defineProperty,mz=Object.getOwnPropertyDescriptor,fz=function(_){if(typeof Array.isArray==="function")return Array.isArray(_);return lz.call(_)==="[object Array]"},kz=function(_){if(!_||lz.call(_)!=="[object Object]")return!1;var G=bK.call(_,"constructor"),Y=_.constructor&&_.constructor.prototype&&bK.call(_.constructor.prototype,"isPrototypeOf");if(_.constructor&&!G&&!Y)return!1;var X;for(X in _);return typeof X>"u"||bK.call(_,X)},uz=function(_,G){if(bz&&G.name==="__proto__")bz(_,G.name,{enumerable:!0,configurable:!0,value:G.newValue,writable:!0});else _[G.name]=G.newValue},pz=function(_,G){if(G==="__proto__"){if(!bK.call(_,G))return;else if(mz)return mz(_,G).value}return _[G]};iz.exports=function h(){var _,G,Y,X,K,Z,Q=arguments[0],D=1,O=arguments.length,A=!1;if(typeof Q==="boolean")A=Q,Q=arguments[1]||{},D=2;if(Q==null||typeof Q!=="object"&&typeof Q!=="function")Q={};for(;D<O;++D)if(_=arguments[D],_!=null){for(G in _)if(Y=pz(Q,G),X=pz(_,G),Q!==X){if(A&&X&&(kz(X)||(K=fz(X)))){if(K)K=!1,Z=Y&&fz(Y)?Y:[];else Z=Y&&kz(Y)?Y:{};uz(Q,{name:G,newValue:h(A,Z,X)})}else if(typeof X<"u")uz(Q,{name:G,newValue:X})}}return Q}});var F3=U1((qs,xH)=>{var SG;if(typeof window<"u")SG=window;else if(typeof global<"u")SG=global;else if(typeof self<"u")SG=self;else SG={};xH.exports=SG});var iQ=U1((Qs,gH)=>{var wH=Array.prototype.slice;gH.exports=sS;function sS(h,_){if(!("length"in h))h=[h];h=wH.call(h);while(h.length){var G=h.shift(),Y=_(G);if(Y)return Y;if(G.childNodes&&G.childNodes.length)h=wH.call(G.childNodes).concat(h)}}});var PH=U1((Ds,IH)=>{IH.exports=qh;function qh(h,_){if(!(this instanceof qh))return new qh(h,_);this.data=h,this.nodeValue=h,this.length=h.length,this.ownerDocument=_||null}qh.prototype.nodeType=8;qh.prototype.nodeName="#comment";qh.prototype.toString=function(){return"[object Comment]"}});var bH=U1((Ms,yH)=>{yH.exports=H8;function H8(h,_){if(!(this instanceof H8))return new H8(h);this.data=h||"",this.length=this.data.length,this.ownerDocument=_||null}H8.prototype.type="DOMTextNode";H8.prototype.nodeType=3;H8.prototype.nodeName="#text";H8.prototype.toString=function(){return this.data};H8.prototype.replaceData=function(_,G,Y){var X=this.data,K=X.substring(0,_),Z=X.substring(_+G,X.length);this.data=K+Y+Z,this.length=this.data.length}});var cQ=U1((Bs,mH)=>{mH.exports=nS;function nS(h){var _=this,G=h.type;if(!h.target)h.target=_;if(!_.listeners)_.listeners={};var Y=_.listeners[G];if(Y)return Y.forEach(function(X){if(h.currentTarget=_,typeof X==="function")X(h);else X.handleEvent(h)});if(_.parentNode)_.parentNode.dispatchEvent(h)}});var dQ=U1((Os,fH)=>{fH.exports=oS;function oS(h,_){var G=this;if(!G.listeners)G.listeners={};if(!G.listeners[h])G.listeners[h]=[];if(G.listeners[h].indexOf(_)===-1)G.listeners[h].push(_)}});var aQ=U1((As,kH)=>{kH.exports=rS;function rS(h,_){var G=this;if(!G.listeners)return;if(!G.listeners[h])return;var Y=G.listeners[h],X=Y.indexOf(_);if(X!==-1)Y.splice(X,1)}});var iH=U1((zs,lH)=>{lH.exports=uH;var eS=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"];function uH(h){switch(h.nodeType){case 3:return tQ(h.data);case 8:return"<!--"+h.data+"-->";default:return hv(h)}}function hv(h){var _=[],G=h.tagName;if(h.namespaceURI==="http://www.w3.org/1999/xhtml")G=G.toLowerCase();if(_.push("<"+G+Xv(h)+Yv(h)),eS.indexOf(G)>-1)_.push(" />");else{if(_.push(">"),h.childNodes.length)_.push.apply(_,h.childNodes.map(uH));else if(h.textContent||h.innerText)_.push(tQ(h.textContent||h.innerText));else if(h.innerHTML)_.push(h.innerHTML);_.push("</"+G+">")}return _.join("")}function _v(h,_){var G=typeof h[_];if(_==="style"&&Object.keys(h.style).length>0)return!0;return h.hasOwnProperty(_)&&(G==="string"||G==="boolean"||G==="number")&&_!=="nodeName"&&_!=="className"&&_!=="tagName"&&_!=="textContent"&&_!=="innerText"&&_!=="namespaceURI"&&_!=="innerHTML"}function Gv(h){if(typeof h==="string")return h;var _="";return Object.keys(h).forEach(function(G){var Y=h[G];G=G.replace(/[A-Z]/g,function(X){return"-"+X.toLowerCase()}),_+=G+":"+Y+";"}),_}function Yv(h){var _=h.dataset,G=[];for(var Y in _)G.push({name:"data-"+Y,value:_[Y]});return G.length?pH(G):""}function pH(h){var _=[];return h.forEach(function(G){var{name:Y,value:X}=G;if(Y==="style")X=Gv(X);_.push(Y+'="'+Kv(X)+'"')}),_.length?" "+_.join(" "):""}function Xv(h){var _=[];for(var G in h)if(_v(h,G))_.push({name:G,value:h[G]});for(var Y in h._attributes)for(var X in h._attributes[Y]){var K=h._attributes[Y][X],Z=(K.prefix?K.prefix+":":"")+X;_.push({name:Z,value:K.value})}if(h.className)_.push({name:"class",value:h.className});return _.length?pH(_):""}function tQ(h){var _="";if(typeof h==="string")_=h;else if(h)_=h.toString();return _.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function Kv(h){return tQ(h).replace(/"/g,""")}});var nQ=U1((Hs,dH)=>{var sQ=iQ(),Zv=cQ(),Jv=dQ(),qv=aQ(),Qv=iH(),cH="http://www.w3.org/1999/xhtml";dH.exports=D2;function D2(h,_,G){if(!(this instanceof D2))return new D2(h);var Y=G===void 0?cH:G||null;if(this.tagName=Y===cH?String(h).toUpperCase():h,this.nodeName=this.tagName,this.className="",this.dataset={},this.childNodes=[],this.parentNode=null,this.style={},this.ownerDocument=_||null,this.namespaceURI=Y,this._attributes={},this.tagName==="INPUT")this.type="text"}D2.prototype.type="DOMElement";D2.prototype.nodeType=1;D2.prototype.appendChild=function(_){if(_.parentNode)_.parentNode.removeChild(_);return this.childNodes.push(_),_.parentNode=this,_};D2.prototype.replaceChild=function(_,G){if(_.parentNode)_.parentNode.removeChild(_);var Y=this.childNodes.indexOf(G);return G.parentNode=null,this.childNodes[Y]=_,_.parentNode=this,G};D2.prototype.removeChild=function(_){var G=this.childNodes.indexOf(_);return this.childNodes.splice(G,1),_.parentNode=null,_};D2.prototype.insertBefore=function(_,G){if(_.parentNode)_.parentNode.removeChild(_);var Y=G===null||G===void 0?-1:this.childNodes.indexOf(G);if(Y>-1)this.childNodes.splice(Y,0,_);else this.childNodes.push(_);return _.parentNode=this,_};D2.prototype.setAttributeNS=function(_,G,Y){var X=null,K=G,Z=G.indexOf(":");if(Z>-1)X=G.substr(0,Z),K=G.substr(Z+1);if(this.tagName==="INPUT"&&G==="type")this.type=Y;else{var Q=this._attributes[_]||(this._attributes[_]={});Q[K]={value:Y,prefix:X}}};D2.prototype.getAttributeNS=function(_,G){var Y=this._attributes[_],X=Y&&Y[G]&&Y[G].value;if(this.tagName==="INPUT"&&G==="type")return this.type;if(typeof X!=="string")return null;return X};D2.prototype.removeAttributeNS=function(_,G){if(!Object.prototype.hasOwnProperty.call(this._attributes,_))return;var Y=this._attributes[_];if(Y&&Object.prototype.hasOwnProperty.call(Y,G))delete Y[G]};D2.prototype.hasAttributeNS=function(_,G){var Y=this._attributes[_];return!!Y&&G in Y};D2.prototype.setAttribute=function(_,G){return this.setAttributeNS(null,_,G)};D2.prototype.getAttribute=function(_){return this.getAttributeNS(null,_)};D2.prototype.removeAttribute=function(_){return this.removeAttributeNS(null,_)};D2.prototype.hasAttribute=function(_){return this.hasAttributeNS(null,_)};D2.prototype.removeEventListener=qv;D2.prototype.addEventListener=Jv;D2.prototype.dispatchEvent=Zv;D2.prototype.focus=function(){return};D2.prototype.toString=function(){return Qv(this)};D2.prototype.getElementsByClassName=function(_){var G=_.split(" "),Y=[];return sQ(this,function(X){if(X.nodeType===1){var K=X.className||"",Z=K.split(" ");if(G.every(function(Q){return Z.indexOf(Q)!==-1}))Y.push(X)}}),Y};D2.prototype.getElementsByTagName=function(_){_=_.toLowerCase();var G=[];return sQ(this.childNodes,function(Y){if(Y.nodeType===1&&(_==="*"||Y.tagName.toLowerCase()===_))G.push(Y)}),G};D2.prototype.contains=function(_){return sQ(this,function(G){return _===G})||!1}});var tH=U1((Vs,aH)=>{var oQ=nQ();aH.exports=T3;function T3(h){if(!(this instanceof T3))return new T3;this.childNodes=[],this.parentNode=null,this.ownerDocument=h||null}T3.prototype.type="DocumentFragment";T3.prototype.nodeType=11;T3.prototype.nodeName="#document-fragment";T3.prototype.appendChild=oQ.prototype.appendChild;T3.prototype.replaceChild=oQ.prototype.replaceChild;T3.prototype.removeChild=oQ.prototype.removeChild;T3.prototype.toString=function(){return this.childNodes.map(function(_){return String(_)}).join("")}});var nH=U1((Us,sH)=>{sH.exports=rQ;function rQ(h){}rQ.prototype.initEvent=function(_,G,Y){this.type=_,this.bubbles=G,this.cancelable=Y};rQ.prototype.preventDefault=function(){}});var rH=U1((Es,oH)=>{var Dv=iQ(),Mv=PH(),Bv=bH(),vG=nQ(),Ov=tH(),Av=nH(),zv=cQ(),Hv=dQ(),Vv=aQ();oH.exports=aK;function aK(){if(!(this instanceof aK))return new aK;this.head=this.createElement("head"),this.body=this.createElement("body"),this.documentElement=this.createElement("html"),this.documentElement.appendChild(this.head),this.documentElement.appendChild(this.body),this.childNodes=[this.documentElement],this.nodeType=9}var j4=aK.prototype;j4.createTextNode=function(_){return new Bv(_,this)};j4.createElementNS=function(_,G){var Y=_===null?null:String(_);return new vG(G,this,Y)};j4.createElement=function(_){return new vG(_,this)};j4.createDocumentFragment=function(){return new Ov(this)};j4.createEvent=function(_){return new Av(_)};j4.createComment=function(_){return new Mv(_,this)};j4.getElementById=function(_){_=String(_);var G=Dv(this.childNodes,function(Y){if(String(Y.id)===_)return Y});return G||null};j4.getElementsByClassName=vG.prototype.getElementsByClassName;j4.getElementsByTagName=vG.prototype.getElementsByTagName;j4.contains=vG.prototype.contains;j4.removeEventListener=Vv;j4.addEventListener=Hv;j4.dispatchEvent=zv});var hV=U1((Cs,eH)=>{var Uv=rH();eH.exports=new Uv});var eQ=U1((Ns,GV)=>{var _V=typeof global<"u"?global:typeof window<"u"?window:{},Ev=hV(),xG;if(typeof document<"u")xG=document;else if(xG=_V["__GLOBAL_DOCUMENT_CACHE@4"],!xG)xG=_V["__GLOBAL_DOCUMENT_CACHE@4"]=Ev;GV.exports=xG});var YV=U1(($s,z6)=>{function hD(){return z6.exports=hD=Object.assign?Object.assign.bind():function(h){for(var _=1;_<arguments.length;_++){var G=arguments[_];for(var Y in G)({}).hasOwnProperty.call(G,Y)&&(h[Y]=G[Y])}return h},z6.exports.__esModule=!0,z6.exports.default=z6.exports,hD.apply(null,arguments)}z6.exports=hD,z6.exports.__esModule=!0,z6.exports.default=z6.exports});var KV=U1((Ls,XV)=>{XV.exports=Nv;var Cv=Object.prototype.toString;function Nv(h){if(!h)return!1;var _=Cv.call(h);return _==="[object Function]"||typeof h==="function"&&_!=="[object RegExp]"||typeof window<"u"&&(h===window.setTimeout||h===window.alert||h===window.confirm||h===window.prompt)}});var qV=U1((js,JV)=>{function $v(h,_){var G=typeof Symbol<"u"&&h[Symbol.iterator]||h["@@iterator"];if(G)return(G=G.call(h)).next.bind(G);if(Array.isArray(h)||(G=Lv(h))||_&&h&&typeof h.length==="number"){if(G)h=G;var Y=0;return function(){if(Y>=h.length)return{done:!0};return{done:!1,value:h[Y++]}}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
3
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Lv(h,_){if(!h)return;if(typeof h==="string")return ZV(h,_);var G=Object.prototype.toString.call(h).slice(8,-1);if(G==="Object"&&h.constructor)G=h.constructor.name;if(G==="Map"||G==="Set")return Array.from(h);if(G==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(G))return ZV(h,_)}function ZV(h,_){if(_==null||_>h.length)_=h.length;for(var G=0,Y=Array(_);G<_;G++)Y[G]=h[G];return Y}var jv=function(){function h(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1}var _=h.prototype;return _.getIsEnabled=function(){return this.enabled_},_.enable=function(){this.enabled_=!0},_.disable=function(){this.enabled_=!1},_.reset=function(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1},_.addInterceptor=function(Y,X){if(!this.typeToInterceptorsMap_.has(Y))this.typeToInterceptorsMap_.set(Y,new Set);var K=this.typeToInterceptorsMap_.get(Y);if(K.has(X))return!1;return K.add(X),!0},_.removeInterceptor=function(Y,X){var K=this.typeToInterceptorsMap_.get(Y);if(K&&K.has(X))return K.delete(X),!0;return!1},_.clearInterceptorsByType=function(Y){var X=this.typeToInterceptorsMap_.get(Y);if(!X)return!1;return this.typeToInterceptorsMap_.delete(Y),this.typeToInterceptorsMap_.set(Y,new Set),!0},_.clear=function(){if(!this.typeToInterceptorsMap_.size)return!1;return this.typeToInterceptorsMap_=new Map,!0},_.getForType=function(Y){return this.typeToInterceptorsMap_.get(Y)||new Set},_.execute=function(Y,X){var K=this.getForType(Y);for(var Z=$v(K),Q;!(Q=Z()).done;){var D=Q.value;try{X=D(X)}catch(O){}}return X},h}();JV.exports=jv});var DV=U1((Fs,QV)=>{var Fv=function(){function h(){this.maxAttempts_=1,this.delayFactor_=0.1,this.fuzzFactor_=0.1,this.initialDelay_=1000,this.enabled_=!1}var _=h.prototype;return _.getIsEnabled=function(){return this.enabled_},_.enable=function(){this.enabled_=!0},_.disable=function(){this.enabled_=!1},_.reset=function(){this.maxAttempts_=1,this.delayFactor_=0.1,this.fuzzFactor_=0.1,this.initialDelay_=1000,this.enabled_=!1},_.getMaxAttempts=function(){return this.maxAttempts_},_.setMaxAttempts=function(Y){this.maxAttempts_=Y},_.getDelayFactor=function(){return this.delayFactor_},_.setDelayFactor=function(Y){this.delayFactor_=Y},_.getFuzzFactor=function(){return this.fuzzFactor_},_.setFuzzFactor=function(Y){this.fuzzFactor_=Y},_.getInitialDelay=function(){return this.initialDelay_},_.setInitialDelay=function(Y){this.initialDelay_=Y},_.createRetry=function(Y){var X=Y===void 0?{}:Y,K=X.maxAttempts,Z=X.delayFactor,Q=X.fuzzFactor,D=X.initialDelay;return new Tv({maxAttempts:K||this.maxAttempts_,delayFactor:Z||this.delayFactor_,fuzzFactor:Q||this.fuzzFactor_,initialDelay:D||this.initialDelay_})},h}(),Tv=function(){function h(G){this.maxAttempts_=G.maxAttempts,this.delayFactor_=G.delayFactor,this.fuzzFactor_=G.fuzzFactor,this.currentDelay_=G.initialDelay,this.currentAttempt_=1}var _=h.prototype;return _.moveToNextAttempt=function(){this.currentAttempt_++;var Y=this.currentDelay_*this.delayFactor_;this.currentDelay_=this.currentDelay_+Y},_.shouldRetry=function(){return this.currentAttempt_<this.maxAttempts_},_.getCurrentDelay=function(){return this.currentDelay_},_.getCurrentMinPossibleDelay=function(){return(1-this.fuzzFactor_)*this.currentDelay_},_.getCurrentMaxPossibleDelay=function(){return(1+this.fuzzFactor_)*this.currentDelay_},_.getCurrentFuzzedDelay=function(){var Y=this.getCurrentMinPossibleDelay(),X=this.getCurrentMaxPossibleDelay();return Y+Math.random()*(X-Y)},h}();QV.exports=Fv});var BV=U1((Ts,MV)=>{var Wv=F3(),Rv=function(_,G){if(G===void 0)G=!1;return function(Y,X,K){if(Y){_(Y);return}if(X.statusCode>=400&&X.statusCode<=599){var Z=K;if(G)if(Wv.TextDecoder){var Q=Sv(X.headers&&X.headers["content-type"]);try{Z=new TextDecoder(Q).decode(K)}catch(D){}}else Z=String.fromCharCode.apply(null,new Uint8Array(K));_({cause:Z});return}_(null,K)}};function Sv(h){if(h===void 0)h="";return h.toLowerCase().split(";").reduce(function(_,G){var Y=G.split("="),X=Y[0],K=Y[1];if(X.trim()==="charset")return K.trim();return _},"utf-8")}MV.exports=Rv});var HV=U1((Ws,GD)=>{var OV=F3(),vv=YV(),xv=KV(),AV=qV(),wv=DV();I2.httpHandler=BV();I2.requestInterceptorsStorage=new AV;I2.responseInterceptorsStorage=new AV;I2.retryManager=new wv;var gv=function(_){var G={};if(!_)return G;return _.trim().split(`
|
|
4
|
-
`).forEach(function(Y){var X=Y.indexOf(":"),K=Y.slice(0,X).trim().toLowerCase(),Z=Y.slice(X+1).trim();if(typeof G[K]>"u")G[K]=Z;else if(Array.isArray(G[K]))G[K].push(Z);else G[K]=[G[K],Z]}),G};GD.exports=I2;GD.exports.default=I2;I2.XMLHttpRequest=OV.XMLHttpRequest||bv;I2.XDomainRequest="withCredentials"in new I2.XMLHttpRequest?I2.XMLHttpRequest:OV.XDomainRequest;Iv(["get","put","post","patch","head","delete"],function(h){I2[h==="delete"?"del":h]=function(_,G,Y){return G=zV(_,G,Y),G.method=h.toUpperCase(),_D(G)}});function Iv(h,_){for(var G=0;G<h.length;G++)_(h[G])}function Pv(h){for(var _ in h)if(h.hasOwnProperty(_))return!1;return!0}function zV(h,_,G){var Y=h;if(xv(_)){if(G=_,typeof h==="string")Y={uri:h}}else Y=vv({},_,{uri:h});return Y.callback=G,Y}function I2(h,_,G){return _=zV(h,_,G),_D(_)}function _D(h){if(typeof h.callback>"u")throw Error("callback argument missing");if(h.requestType&&I2.requestInterceptorsStorage.getIsEnabled()){var _={uri:h.uri||h.url,headers:h.headers||{},body:h.body,metadata:h.metadata||{},retry:h.retry,timeout:h.timeout},G=I2.requestInterceptorsStorage.execute(h.requestType,_);h.uri=G.uri,h.headers=G.headers,h.body=G.body,h.metadata=G.metadata,h.retry=G.retry,h.timeout=G.timeout}var Y=!1,X=function(I,b,l){if(!Y)Y=!0,h.callback(I,b,l)};function K(){if(O.readyState===4&&!I2.responseInterceptorsStorage.getIsEnabled())setTimeout(D,0)}function Z(){var P=void 0;if(O.response)P=O.response;else P=O.responseText||yv(O);if(R)try{P=JSON.parse(P)}catch(I){}return P}function Q(P){if(clearTimeout(v),clearTimeout(h.retryTimeout),!(P instanceof Error))P=Error(""+(P||"Unknown XMLHttpRequest Error"));if(P.statusCode=0,!H&&I2.retryManager.getIsEnabled()&&h.retry&&h.retry.shouldRetry()){h.retryTimeout=setTimeout(function(){h.retry.moveToNextAttempt(),h.xhr=O,_D(h)},h.retry.getCurrentFuzzedDelay());return}if(h.requestType&&I2.responseInterceptorsStorage.getIsEnabled()){var I={headers:x.headers||{},body:x.body,responseUrl:O.responseURL,responseType:O.responseType},b=I2.responseInterceptorsStorage.execute(h.requestType,I);x.body=b.body,x.headers=b.headers}return X(P,x)}function D(){if(H)return;var P;if(clearTimeout(v),clearTimeout(h.retryTimeout),h.useXDR&&O.status===void 0)P=200;else P=O.status===1223?204:O.status;var I=x,b=null;if(P!==0){if(I={body:Z(),statusCode:P,method:N,headers:{},url:C,rawRequest:O},O.getAllResponseHeaders)I.headers=gv(O.getAllResponseHeaders())}else b=Error("Internal XMLHttpRequest Error");if(h.requestType&&I2.responseInterceptorsStorage.getIsEnabled()){var l={headers:I.headers||{},body:I.body,responseUrl:O.responseURL,responseType:O.responseType},i=I2.responseInterceptorsStorage.execute(h.requestType,l);I.body=i.body,I.headers=i.headers}return X(b,I,I.body)}var O=h.xhr||null;if(!O)if(h.cors||h.useXDR)O=new I2.XDomainRequest;else O=new I2.XMLHttpRequest;var A,H,C=O.url=h.uri||h.url,N=O.method=h.method||"GET",j=h.body||h.data,W=O.headers=h.headers||{},S=!!h.sync,R=!1,v,x={body:void 0,headers:{},statusCode:0,method:N,url:C,rawRequest:O};if("json"in h&&h.json!==!1){if(R=!0,W.accept||W.Accept||(W.Accept="application/json"),N!=="GET"&&N!=="HEAD")W["content-type"]||W["Content-Type"]||(W["Content-Type"]="application/json"),j=JSON.stringify(h.json===!0?j:h.json)}if(O.onreadystatechange=K,O.onload=D,O.onerror=Q,O.onprogress=function(){},O.onabort=function(){H=!0,clearTimeout(h.retryTimeout)},O.ontimeout=Q,O.open(N,C,!S,h.username,h.password),!S)O.withCredentials=!!h.withCredentials;if(!S&&h.timeout>0)v=setTimeout(function(){if(H)return;H=!0,O.abort("timeout");var P=Error("XMLHttpRequest timeout");P.code="ETIMEDOUT",Q(P)},h.timeout);if(O.setRequestHeader){for(A in W)if(W.hasOwnProperty(A))O.setRequestHeader(A,W[A])}else if(h.headers&&!Pv(h.headers))throw Error("Headers cannot be set on an XDomainRequest object");if("responseType"in h)O.responseType=h.responseType;if("beforeSend"in h&&typeof h.beforeSend==="function")h.beforeSend(O);return O.send(j||null),O}function yv(h){try{if(h.responseType==="document")return h.responseXML;var _=h.responseXML&&h.responseXML.documentElement.nodeName==="parsererror";if(h.responseType===""&&!_)return h.responseXML}catch(G){}return null}function bv(){}});var LV=U1((Rs,$V)=>{var VV=eQ(),XD=Object.create||function(){function h(){}return function(_){if(arguments.length!==1)throw Error("Object.create shim only accepts one parameter.");return h.prototype=_,new h}}();function F4(h,_){this.name="ParsingError",this.code=h.code,this.message=_||h.message}F4.prototype=XD(Error.prototype);F4.prototype.constructor=F4;F4.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}};function KD(h){function _(Y,X,K,Z){return(Y|0)*3600+(X|0)*60+(K|0)+(Z|0)/1000}var G=h.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);if(!G)return null;if(G[3])return _(G[1],G[2],G[3].replace(":",""),G[4]);else if(G[1]>59)return _(G[1],G[2],0,G[4]);else return _(0,G[1],G[2],G[4])}function gG(){this.values=XD(null)}gG.prototype={set:function(h,_){if(!this.get(h)&&_!=="")this.values[h]=_},get:function(h,_,G){if(G)return this.has(h)?this.values[h]:_[G];return this.has(h)?this.values[h]:_},has:function(h){return h in this.values},alt:function(h,_,G){for(var Y=0;Y<G.length;++Y)if(_===G[Y]){this.set(h,_);break}},integer:function(h,_){if(/^-?\d+$/.test(_))this.set(h,parseInt(_,10))},percent:function(h,_){var G;if(G=_.match(/^([\d]{1,3})(\.[\d]*)?%$/)){if(_=parseFloat(_),_>=0&&_<=100)return this.set(h,_),!0}return!1}};function wG(h,_,G,Y){var X=Y?h.split(Y):[h];for(var K in X){if(typeof X[K]!=="string")continue;var Z=X[K].split(G);if(Z.length!==2)continue;var Q=Z[0].trim(),D=Z[1].trim();_(Q,D)}}function mv(h,_,G){var Y=h;function X(){var Q=KD(h);if(Q===null)throw new F4(F4.Errors.BadTimeStamp,"Malformed timestamp: "+Y);return h=h.replace(/^[^\sa-zA-Z-]+/,""),Q}function K(Q,D){var O=new gG;wG(Q,function(A,H){switch(A){case"region":for(var C=G.length-1;C>=0;C--)if(G[C].id===H){O.set(A,G[C].region);break}break;case"vertical":O.alt(A,H,["rl","lr"]);break;case"line":var N=H.split(","),j=N[0];if(O.integer(A,j),O.percent(A,j)&&O.set("snapToLines",!1),O.alt(A,j,["auto"]),N.length===2)O.alt("lineAlign",N[1],["start","center","end"]);break;case"position":if(N=H.split(","),O.percent(A,N[0]),N.length===2)O.alt("positionAlign",N[1],["start","center","end"]);break;case"size":O.percent(A,H);break;case"align":O.alt(A,H,["start","center","end","left","right"]);break}},/:/,/\s/),D.region=O.get("region",null),D.vertical=O.get("vertical","");try{D.line=O.get("line","auto")}catch(A){}D.lineAlign=O.get("lineAlign","start"),D.snapToLines=O.get("snapToLines",!0),D.size=O.get("size",100);try{D.align=O.get("align","center")}catch(A){D.align=O.get("align","middle")}try{D.position=O.get("position","auto")}catch(A){D.position=O.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},D.align)}D.positionAlign=O.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},D.align)}function Z(){h=h.replace(/^\s+/,"")}if(Z(),_.startTime=X(),Z(),h.substr(0,3)!=="-->")throw new F4(F4.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+Y);h=h.substr(3),Z(),_.endTime=X(),Z(),K(h,_)}var YD=VV.createElement&&VV.createElement("textarea"),fv={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},UV={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)"},kv={v:"title",lang:"lang"},EV={rt:"ruby"};function NV(h,_){function G(){if(!_)return null;function j(S){return _=_.substr(S.length),S}var W=_.match(/^([^<]*)(<[^>]*>?)?/);return j(W[1]?W[1]:W[2])}function Y(j){return YD.innerHTML=j,j=YD.textContent,YD.textContent="",j}function X(j,W){return!EV[W.localName]||EV[W.localName]===j.localName}function K(j,W){var S=fv[j];if(!S)return null;var R=h.document.createElement(S),v=kv[j];if(v&&W)R[v]=W.trim();return R}var Z=h.document.createElement("div"),Q=Z,D,O=[];while((D=G())!==null){if(D[0]==="<"){if(D[1]==="/"){if(O.length&&O[O.length-1]===D.substr(2).replace(">",""))O.pop(),Q=Q.parentNode;continue}var A=KD(D.substr(1,D.length-2)),H;if(A){H=h.document.createProcessingInstruction("timestamp",A),Q.appendChild(H);continue}var C=D.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!C)continue;if(H=K(C[1],C[3]),!H)continue;if(!X(Q,H))continue;if(C[2]){var N=C[2].split(".");N.forEach(function(j){var W=/^bg_/.test(j),S=W?j.slice(3):j;if(UV.hasOwnProperty(S)){var R=W?"background-color":"color",v=UV[S];H.style[R]=v}}),H.className=N.join(" ")}O.push(C[1]),Q.appendChild(H),Q=H;continue}Q.appendChild(h.document.createTextNode(Y(D)))}return Z}var CV=[[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 uv(h){for(var _=0;_<CV.length;_++){var G=CV[_];if(h>=G[0]&&h<=G[1])return!0}return!1}function pv(h){var _=[],G="",Y;if(!h||!h.childNodes)return"ltr";function X(Q,D){for(var O=D.childNodes.length-1;O>=0;O--)Q.push(D.childNodes[O])}function K(Q){if(!Q||!Q.length)return null;var D=Q.pop(),O=D.textContent||D.innerText;if(O){var A=O.match(/^.*(\n|\r)/);if(A)return Q.length=0,A[0];return O}if(D.tagName==="ruby")return K(Q);if(D.childNodes)return X(Q,D),K(Q)}X(_,h);while(G=K(_))for(var Z=0;Z<G.length;Z++)if(Y=G.charCodeAt(Z),uv(Y))return"rtl";return"ltr"}function lv(h){if(typeof h.line==="number"&&(h.snapToLines||h.line>=0&&h.line<=100))return h.line;if(!h.track||!h.track.textTrackList||!h.track.textTrackList.mediaElement)return-1;var _=h.track,G=_.textTrackList,Y=0;for(var X=0;X<G.length&&G[X]!==_;X++)if(G[X].mode==="showing")Y++;return++Y*-1}function sK(){}sK.prototype.applyStyles=function(h,_){_=_||this.div;for(var G in h)if(h.hasOwnProperty(G))_.style[G]=h[G]};sK.prototype.formatStyle=function(h,_){return h===0?0:h+_};function tK(h,_,G){sK.call(this),this.cue=_,this.cueDiv=NV(h,_.text);var Y={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:_.vertical===""?"horizontal-tb":_.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(Y,this.cueDiv),this.div=h.document.createElement("div"),Y={direction:pv(this.cueDiv),writingMode:_.vertical===""?"horizontal-tb":_.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:_.align==="middle"?"center":_.align,font:G.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(Y),this.div.appendChild(this.cueDiv);var X=0;switch(_.positionAlign){case"start":case"line-left":X=_.position;break;case"center":X=_.position-_.size/2;break;case"end":case"line-right":X=_.position-_.size;break}if(_.vertical==="")this.applyStyles({left:this.formatStyle(X,"%"),width:this.formatStyle(_.size,"%")});else this.applyStyles({top:this.formatStyle(X,"%"),height:this.formatStyle(_.size,"%")});this.move=function(K){this.applyStyles({top:this.formatStyle(K.top,"px"),bottom:this.formatStyle(K.bottom,"px"),left:this.formatStyle(K.left,"px"),right:this.formatStyle(K.right,"px"),height:this.formatStyle(K.height,"px"),width:this.formatStyle(K.width,"px")})}}tK.prototype=XD(sK.prototype);tK.prototype.constructor=tK;function f5(h){var _,G,Y,X;if(h.div){G=h.div.offsetHeight,Y=h.div.offsetWidth,X=h.div.offsetTop;var K=(K=h.div.childNodes)&&(K=K[0])&&K.getClientRects&&K.getClientRects();h=h.div.getBoundingClientRect(),_=K?Math.max(K[0]&&K[0].height||0,h.height/K.length):0}this.left=h.left,this.right=h.right,this.top=h.top||X,this.height=h.height||G,this.bottom=h.bottom||X+(h.height||G),this.width=h.width||Y,this.lineHeight=_!==void 0?_:h.lineHeight}f5.prototype.move=function(h,_){switch(_=_!==void 0?_:this.lineHeight,h){case"+x":this.left+=_,this.right+=_;break;case"-x":this.left-=_,this.right-=_;break;case"+y":this.top+=_,this.bottom+=_;break;case"-y":this.top-=_,this.bottom-=_;break}};f5.prototype.overlaps=function(h){return this.left<h.right&&this.right>h.left&&this.top<h.bottom&&this.bottom>h.top};f5.prototype.overlapsAny=function(h){for(var _=0;_<h.length;_++)if(this.overlaps(h[_]))return!0;return!1};f5.prototype.within=function(h){return this.top>=h.top&&this.bottom<=h.bottom&&this.left>=h.left&&this.right<=h.right};f5.prototype.overlapsOppositeAxis=function(h,_){switch(_){case"+x":return this.left<h.left;case"-x":return this.right>h.right;case"+y":return this.top<h.top;case"-y":return this.bottom>h.bottom}};f5.prototype.intersectPercentage=function(h){var _=Math.max(0,Math.min(this.right,h.right)-Math.max(this.left,h.left)),G=Math.max(0,Math.min(this.bottom,h.bottom)-Math.max(this.top,h.top)),Y=_*G;return Y/(this.height*this.width)};f5.prototype.toCSSCompatValues=function(h){return{top:this.top-h.top,bottom:h.bottom-this.bottom,left:this.left-h.left,right:h.right-this.right,height:this.height,width:this.width}};f5.getSimpleBoxPosition=function(h){var _=h.div?h.div.offsetHeight:h.tagName?h.offsetHeight:0,G=h.div?h.div.offsetWidth:h.tagName?h.offsetWidth:0,Y=h.div?h.div.offsetTop:h.tagName?h.offsetTop:0;h=h.div?h.div.getBoundingClientRect():h.tagName?h.getBoundingClientRect():h;var X={left:h.left,right:h.right,top:h.top||Y,height:h.height||_,bottom:h.bottom||Y+(h.height||_),width:h.width||G};return X};function iv(h,_,G,Y){function X(S,R){var v,x=new f5(S),P=1;for(var I=0;I<R.length;I++){while(S.overlapsOppositeAxis(G,R[I])||S.within(G)&&S.overlapsAny(Y))S.move(R[I]);if(S.within(G))return S;var b=S.intersectPercentage(G);if(P>b)v=new f5(S),P=b;S=new f5(x)}return v||x}var K=new f5(_),Z=_.cue,Q=lv(Z),D=[];if(Z.snapToLines){var O;switch(Z.vertical){case"":D=["+y","-y"],O="height";break;case"rl":D=["+x","-x"],O="width";break;case"lr":D=["-x","+x"],O="width";break}var A=K.lineHeight,H=A*Math.round(Q),C=G[O]+A,N=D[0];if(Math.abs(H)>C)H=H<0?-1:1,H*=Math.ceil(C/A)*A;if(Q<0)H+=Z.vertical===""?G.height:G.width,D=D.reverse();K.move(N,H)}else{var j=K.lineHeight/G.height*100;switch(Z.lineAlign){case"center":Q-=j/2;break;case"end":Q-=j;break}switch(Z.vertical){case"":_.applyStyles({top:_.formatStyle(Q,"%")});break;case"rl":_.applyStyles({left:_.formatStyle(Q,"%")});break;case"lr":_.applyStyles({right:_.formatStyle(Q,"%")});break}D=["+y","-x","+x","-y"],K=new f5(_)}var W=X(K,D);_.move(W.toCSSCompatValues(G))}function Qh(){}Qh.StringDecoder=function(){return{decode:function(h){if(!h)return"";if(typeof h!=="string")throw Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(h))}}};Qh.convertCueToDOMTree=function(h,_){if(!h||!_)return null;return NV(h,_)};var cv=0.05,dv="sans-serif",av="1.5%";Qh.processCues=function(h,_,G){if(!h||!_||!G)return null;while(G.firstChild)G.removeChild(G.firstChild);var Y=h.document.createElement("div");Y.style.position="absolute",Y.style.left="0",Y.style.right="0",Y.style.top="0",Y.style.bottom="0",Y.style.margin=av,G.appendChild(Y);function X(A){for(var H=0;H<A.length;H++)if(A[H].hasBeenReset||!A[H].displayState)return!0;return!1}if(!X(_)){for(var K=0;K<_.length;K++)Y.appendChild(_[K].displayState);return}var Z=[],Q=f5.getSimpleBoxPosition(Y),D=Math.round(Q.height*cv*100)/100,O={font:D+"px "+dv};(function(){var A,H;for(var C=0;C<_.length;C++)H=_[C],A=new tK(h,H,O),Y.appendChild(A.div),iv(h,A,Q,Z),H.displayState=A.div,Z.push(f5.getSimpleBoxPosition(A))})()};Qh.Parser=function(h,_,G){if(!G)G=_,_={};if(!_)_={};this.window=h,this.vttjs=_,this.state="INITIAL",this.buffer="",this.decoder=G||new TextDecoder("utf8"),this.regionList=[]};Qh.Parser.prototype={reportOrThrowError:function(h){if(h instanceof F4)this.onparsingerror&&this.onparsingerror(h);else throw h},parse:function(h){var _=this;if(h)_.buffer+=_.decoder.decode(h,{stream:!0});function G(){var A=_.buffer,H=0;while(H<A.length&&A[H]!=="\r"&&A[H]!==`
|
|
5
|
-
`)++H;var C=A.substr(0,H);if(A[H]==="\r")++H;if(A[H]===`
|
|
6
|
-
`)++H;return _.buffer=A.substr(H),C}function Y(A){var H=new gG;if(wG(A,function(N,j){switch(N){case"id":H.set(N,j);break;case"width":H.percent(N,j);break;case"lines":H.integer(N,j);break;case"regionanchor":case"viewportanchor":var W=j.split(",");if(W.length!==2)break;var S=new gG;if(S.percent("x",W[0]),S.percent("y",W[1]),!S.has("x")||!S.has("y"))break;H.set(N+"X",S.get("x")),H.set(N+"Y",S.get("y"));break;case"scroll":H.alt(N,j,["up"]);break}},/=/,/\s/),H.has("id")){var C=new(_.vttjs.VTTRegion||_.window.VTTRegion);C.width=H.get("width",100),C.lines=H.get("lines",3),C.regionAnchorX=H.get("regionanchorX",0),C.regionAnchorY=H.get("regionanchorY",100),C.viewportAnchorX=H.get("viewportanchorX",0),C.viewportAnchorY=H.get("viewportanchorY",100),C.scroll=H.get("scroll",""),_.onregion&&_.onregion(C),_.regionList.push({id:H.get("id"),region:C})}}function X(A){var H=new gG;wG(A,function(C,N){switch(C){case"MPEGT":H.integer(C+"S",N);break;case"LOCA":H.set(C+"L",KD(N));break}},/[^\d]:/,/,/),_.ontimestampmap&&_.ontimestampmap({MPEGTS:H.get("MPEGTS"),LOCAL:H.get("LOCAL")})}function K(A){if(A.match(/X-TIMESTAMP-MAP/))wG(A,function(H,C){switch(H){case"X-TIMESTAMP-MAP":X(C);break}},/=/);else wG(A,function(H,C){switch(H){case"Region":Y(C);break}},/:/)}try{var Z;if(_.state==="INITIAL"){if(!/\r\n|\n/.test(_.buffer))return this;Z=G();var Q=Z.match(/^WEBVTT([ \t].*)?$/);if(!Q||!Q[0])throw new F4(F4.Errors.BadSignature);_.state="HEADER"}var D=!1;while(_.buffer){if(!/\r\n|\n/.test(_.buffer))return this;if(!D)Z=G();else D=!1;switch(_.state){case"HEADER":if(/:/.test(Z))K(Z);else if(!Z)_.state="ID";continue;case"NOTE":if(!Z)_.state="ID";continue;case"ID":if(/^NOTE($|[ \t])/.test(Z)){_.state="NOTE";break}if(!Z)continue;_.cue=new(_.vttjs.VTTCue||_.window.VTTCue)(0,0,"");try{_.cue.align="center"}catch(A){_.cue.align="middle"}if(_.state="CUE",Z.indexOf("-->")===-1){_.cue.id=Z;continue}case"CUE":try{mv(Z,_.cue,_.regionList)}catch(A){_.reportOrThrowError(A),_.cue=null,_.state="BADCUE";continue}_.state="CUETEXT";continue;case"CUETEXT":var O=Z.indexOf("-->")!==-1;if(!Z||O&&(D=!0)){_.oncue&&_.oncue(_.cue),_.cue=null,_.state="ID";continue}if(_.cue.text)_.cue.text+=`
|
|
7
|
-
`;_.cue.text+=Z.replace(/\u2028/g,`
|
|
8
|
-
`).replace(/u2029/g,`
|
|
9
|
-
`);continue;case"BADCUE":if(!Z)_.state="ID";continue}}}catch(A){if(_.reportOrThrowError(A),_.state==="CUETEXT"&&_.cue&&_.oncue)_.oncue(_.cue);_.cue=null,_.state=_.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var h=this;try{if(h.buffer+=h.decoder.decode(),h.cue||h.state==="HEADER")h.buffer+=`
|
|
10
|
-
|
|
11
|
-
`,h.parse();if(h.state==="INITIAL")throw new F4(F4.Errors.BadSignature)}catch(_){h.reportOrThrowError(_)}return h.onflush&&h.onflush(),this}};$V.exports=Qh});var TV=U1((Ss,FV)=>{var tv="auto",sv={"":1,lr:1,rl:1},nv={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function ov(h){if(typeof h!=="string")return!1;var _=sv[h.toLowerCase()];return _?h.toLowerCase():!1}function ZD(h){if(typeof h!=="string")return!1;var _=nv[h.toLowerCase()];return _?h.toLowerCase():!1}function jV(h,_,G){this.hasBeenReset=!1;var Y="",X=!1,K=h,Z=_,Q=G,D=null,O="",A=!0,H="auto",C="start",N="auto",j="auto",W=100,S="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return Y},set:function(R){Y=""+R}},pauseOnExit:{enumerable:!0,get:function(){return X},set:function(R){X=!!R}},startTime:{enumerable:!0,get:function(){return K},set:function(R){if(typeof R!=="number")throw TypeError("Start time must be set to a number.");K=R,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return Z},set:function(R){if(typeof R!=="number")throw TypeError("End time must be set to a number.");Z=R,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return Q},set:function(R){Q=""+R,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return D},set:function(R){D=R,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return O},set:function(R){var v=ov(R);if(v===!1)throw SyntaxError("Vertical: an invalid or illegal direction string was specified.");O=v,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return A},set:function(R){A=!!R,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return H},set:function(R){if(typeof R!=="number"&&R!==tv)throw SyntaxError("Line: an invalid number or illegal string was specified.");H=R,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return C},set:function(R){var v=ZD(R);if(!v)console.warn("lineAlign: an invalid or illegal string was specified.");else C=v,this.hasBeenReset=!0}},position:{enumerable:!0,get:function(){return N},set:function(R){if(R<0||R>100)throw Error("Position must be between 0 and 100.");N=R,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return j},set:function(R){var v=ZD(R);if(!v)console.warn("positionAlign: an invalid or illegal string was specified.");else j=v,this.hasBeenReset=!0}},size:{enumerable:!0,get:function(){return W},set:function(R){if(R<0||R>100)throw Error("Size must be between 0 and 100.");W=R,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return S},set:function(R){var v=ZD(R);if(!v)throw SyntaxError("align: an invalid or illegal alignment string was specified.");S=v,this.hasBeenReset=!0}}}),this.displayState=void 0}jV.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};FV.exports=jV});var RV=U1((vs,WV)=>{var rv={"":!0,up:!0};function ev(h){if(typeof h!=="string")return!1;var _=rv[h.toLowerCase()];return _?h.toLowerCase():!1}function IG(h){return typeof h==="number"&&(h>=0&&h<=100)}function hx(){var h=100,_=3,G=0,Y=100,X=0,K=100,Z="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return h},set:function(Q){if(!IG(Q))throw Error("Width must be between 0 and 100.");h=Q}},lines:{enumerable:!0,get:function(){return _},set:function(Q){if(typeof Q!=="number")throw TypeError("Lines must be set to a number.");_=Q}},regionAnchorY:{enumerable:!0,get:function(){return Y},set:function(Q){if(!IG(Q))throw Error("RegionAnchorX must be between 0 and 100.");Y=Q}},regionAnchorX:{enumerable:!0,get:function(){return G},set:function(Q){if(!IG(Q))throw Error("RegionAnchorY must be between 0 and 100.");G=Q}},viewportAnchorY:{enumerable:!0,get:function(){return K},set:function(Q){if(!IG(Q))throw Error("ViewportAnchorY must be between 0 and 100.");K=Q}},viewportAnchorX:{enumerable:!0,get:function(){return X},set:function(Q){if(!IG(Q))throw Error("ViewportAnchorX must be between 0 and 100.");X=Q}},scroll:{enumerable:!0,get:function(){return Z},set:function(Q){var D=ev(Q);if(D===!1)console.warn("Scroll: an invalid or illegal string was specified.");else Z=D}}})}WV.exports=hx});var vV=U1((xs,SV)=>{var H6=F3(),v7=SV.exports={WebVTT:LV(),VTTCue:TV(),VTTRegion:RV()};H6.vttjs=v7;H6.WebVTT=v7.WebVTT;var{VTTCue:_x,VTTRegion:Gx}=v7,Yx=H6.VTTCue,Xx=H6.VTTRegion;v7.shim=function(){H6.VTTCue=_x,H6.VTTRegion=Gx};v7.restore=function(){H6.VTTCue=Yx,H6.VTTRegion=Xx};if(!H6.VTTCue)v7.shim()});var yG=U1((Ex)=>{function Vx(h,_,G){if(G===void 0)G=Array.prototype;if(h&&typeof G.find==="function")return G.find.call(h,_);for(var Y=0;Y<h.length;Y++)if(Object.prototype.hasOwnProperty.call(h,Y)){var X=h[Y];if(_.call(void 0,X,Y,h))return X}}function ED(h,_){if(_===void 0)_=Object;return _&&typeof _.freeze==="function"?_.freeze(h):h}function Ux(h,_){if(h===null||typeof h!=="object")throw TypeError("target is not an object");for(var G in _)if(Object.prototype.hasOwnProperty.call(_,G))h[G]=_[G];return h}var pV=ED({HTML:"text/html",isHTML:function(h){return h===pV.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),lV=ED({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(h){return h===lV.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});Ex.assign=Ux;Ex.find=Vx;Ex.freeze=ED;Ex.MIME_TYPE=pV;Ex.NAMESPACE=lV});var xD=U1((fx)=>{var oV=yG(),W3=oV.find,bG=oV.NAMESPACE;function Fx(h){return h!==""}function Tx(h){return h?h.split(/[\t\n\f\r ]+/).filter(Fx):[]}function Wx(h,_){if(!h.hasOwnProperty(_))h[_]=!0;return h}function iV(h){if(!h)return[];var _=Tx(h);return Object.keys(_.reduce(Wx,{}))}function Rx(h){return function(_){return h&&h.indexOf(_)!==-1}}function fG(h,_){for(var G in h)if(Object.prototype.hasOwnProperty.call(h,G))_[G]=h[G]}function Y4(h,_){var G=h.prototype;if(!(G instanceof _)){let X=function(){};var Y=X;X.prototype=_.prototype,X=new X,fG(G,X),h.prototype=G=X}if(G.constructor!=h){if(typeof h!="function")console.error("unknown Class:"+h);G.constructor=h}}var X4={},p4=X4.ELEMENT_NODE=1,Ah=X4.ATTRIBUTE_NODE=2,hZ=X4.TEXT_NODE=3,rV=X4.CDATA_SECTION_NODE=4,eV=X4.ENTITY_REFERENCE_NODE=5,Sx=X4.ENTITY_NODE=6,CD=X4.PROCESSING_INSTRUCTION_NODE=7,ND=X4.COMMENT_NODE=8,hU=X4.DOCUMENT_NODE=9,_U=X4.DOCUMENT_TYPE_NODE=10,V6=X4.DOCUMENT_FRAGMENT_NODE=11,vx=X4.NOTATION_NODE=12,v5={},Z5={},ds=v5.INDEX_SIZE_ERR=(Z5[1]="Index size error",1),as=v5.DOMSTRING_SIZE_ERR=(Z5[2]="DOMString size error",2),G4=v5.HIERARCHY_REQUEST_ERR=(Z5[3]="Hierarchy request error",3),ts=v5.WRONG_DOCUMENT_ERR=(Z5[4]="Wrong document",4),xx=v5.INVALID_CHARACTER_ERR=(Z5[5]="Invalid character",5),ss=v5.NO_DATA_ALLOWED_ERR=(Z5[6]="No data allowed",6),ns=v5.NO_MODIFICATION_ALLOWED_ERR=(Z5[7]="No modification allowed",7),GU=v5.NOT_FOUND_ERR=(Z5[8]="Not found",8),os=v5.NOT_SUPPORTED_ERR=(Z5[9]="Not supported",9),cV=v5.INUSE_ATTRIBUTE_ERR=(Z5[10]="Attribute in use",10),Oh=v5.INVALID_STATE_ERR=(Z5[11]="Invalid state",11),rs=v5.SYNTAX_ERR=(Z5[12]="Syntax error",12),es=v5.INVALID_MODIFICATION_ERR=(Z5[13]="Invalid modification",13),hn=v5.NAMESPACE_ERR=(Z5[14]="Invalid namespace",14),_n=v5.INVALID_ACCESS_ERR=(Z5[15]="Invalid access",15);function r1(h,_){if(_ instanceof Error)var G=_;else if(G=this,Error.call(this,Z5[h]),this.message=Z5[h],Error.captureStackTrace)Error.captureStackTrace(this,r1);if(G.code=h,_)this.message=this.message+": "+_;return G}r1.prototype=Error.prototype;fG(v5,r1);function U6(){}U6.prototype={length:0,item:function(h){return h>=0&&h<this.length?this[h]:null},toString:function(h,_,G){var Y=!!G&&!!G.requireWellFormed;for(var X=[],K=0;K<this.length;K++)vD(this[K],X,h,_,null,Y);return X.join("")},filter:function(h){return Array.prototype.filter.call(this,h)},indexOf:function(h){return Array.prototype.indexOf.call(this,h)}};function zh(h,_){this._node=h,this._refresh=_,$D(this)}function $D(h){var _=h._node._inc||h._node.ownerDocument._inc;if(h._inc!==_){var G=h._refresh(h._node);if(AU(h,"length",G.length),!h.$$length||G.length<h.$$length){for(var Y=G.length;Y in h;Y++)if(Object.prototype.hasOwnProperty.call(h,Y))delete h[Y]}fG(G,h),h._inc=_}}zh.prototype.item=function(h){return $D(this),this[h]||null};Y4(zh,U6);function _Z(){}function YU(h,_){var G=h.length;while(G--)if(h[G]===_)return G}function dV(h,_,G,Y){if(Y)_[YU(_,Y)]=G;else _[_.length++]=G;if(h){G.ownerElement=h;var X=h.ownerDocument;if(X)Y&&ZU(X,h,Y),wx(X,h,G)}}function aV(h,_,G){var Y=YU(_,G);if(Y>=0){var X=_.length-1;while(Y<X)_[Y]=_[++Y];if(_.length=X,h){var K=h.ownerDocument;if(K)ZU(K,h,G),G.ownerElement=null}}else throw new r1(GU,Error(h.tagName+"@"+G))}_Z.prototype={length:0,item:U6.prototype.item,getNamedItem:function(h){var _=this.length;while(_--){var G=this[_];if(G.nodeName==h)return G}},setNamedItem:function(h){var _=h.ownerElement;if(_&&_!=this._ownerElement)throw new r1(cV);var G=this.getNamedItem(h.nodeName);return dV(this._ownerElement,this,h,G),G},setNamedItemNS:function(h){var _=h.ownerElement,G;if(_&&_!=this._ownerElement)throw new r1(cV);return G=this.getNamedItemNS(h.namespaceURI,h.localName),dV(this._ownerElement,this,h,G),G},removeNamedItem:function(h){var _=this.getNamedItem(h);return aV(this._ownerElement,this,_),_},removeNamedItemNS:function(h,_){var G=this.getNamedItemNS(h,_);return aV(this._ownerElement,this,G),G},getNamedItemNS:function(h,_){var G=this.length;while(G--){var Y=this[G];if(Y.localName==_&&Y.namespaceURI==h)return Y}return null}};function XU(){}XU.prototype={hasFeature:function(h,_){return!0},createDocument:function(h,_,G){var Y=new kG;if(Y.implementation=this,Y.childNodes=new U6,Y.doctype=G||null,G)Y.appendChild(G);if(_){var X=Y.createElementNS(h,_);Y.appendChild(X)}return Y},createDocumentType:function(h,_,G){var Y=new KZ;return Y.name=h,Y.nodeName=h,Y.publicId=_||"",Y.systemId=G||"",Y}};function a1(){}a1.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(h,_){return YZ(this,h,_)},replaceChild:function(h,_){if(YZ(this,h,_,qU),_)this.removeChild(_)},removeChild:function(h){return JU(this,h)},appendChild:function(h){return this.insertBefore(h,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(h){return OU(this.ownerDocument||this,this,h)},normalize:function(){K5(this,null,{enter:function(h){var _=h.firstChild;while(_){var G=_.nextSibling;if(G!==null&&G.nodeType===hZ&&_.nodeType===hZ)h.removeChild(G),_.appendData(G.data);else _=G}return!0}})},isSupported:function(h,_){return this.ownerDocument.implementation.hasFeature(h,_)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(h){var _=this;while(_){var G=_._nsMap;if(G){for(var Y in G)if(Object.prototype.hasOwnProperty.call(G,Y)&&G[Y]===h)return Y}_=_.nodeType==Ah?_.ownerDocument:_.parentNode}return null},lookupNamespaceURI:function(h){var _=this;while(_){var G=_._nsMap;if(G){if(Object.prototype.hasOwnProperty.call(G,h))return G[h]}_=_.nodeType==Ah?_.ownerDocument:_.parentNode}return null},isDefaultNamespace:function(h){var _=this.lookupPrefix(h);return _==null}};function KU(h){return h=="<"&&"<"||h==">"&&">"||h=="&"&&"&"||h=='"'&&"""||"&#"+h.charCodeAt()+";"}fG(X4,a1);fG(X4,a1.prototype);function GZ(h,_){return K5(h,null,{enter:function(G){return _(G)?K5.STOP:!0}})===K5.STOP}function K5(h,_,G){var Y=[{node:h,context:_,phase:K5.ENTER}];while(Y.length>0){var X=Y.pop();if(X.phase===K5.ENTER){var K=G.enter(X.node,X.context);if(K===K5.STOP)return K5.STOP;if(Y.push({node:X.node,context:K,phase:K5.EXIT}),K===null||K===void 0)continue;var Z=X.node.lastChild;while(Z)Y.push({node:Z,context:K,phase:K5.ENTER}),Z=Z.previousSibling}else if(G.exit)G.exit(X.node,X.context)}}K5.STOP=Symbol("walkDOM.STOP");K5.ENTER=0;K5.EXIT=1;function kG(){this.ownerDocument=this}function wx(h,_,G){h&&h._inc++;var Y=G.namespaceURI;if(Y===bG.XMLNS)_._nsMap[G.prefix?G.localName:""]=G.value}function ZU(h,_,G,Y){h&&h._inc++;var X=G.namespaceURI;if(X===bG.XMLNS)delete _._nsMap[G.prefix?G.localName:""]}function LD(h,_,G){if(h&&h._inc){h._inc++;var Y=_.childNodes;if(G)Y[Y.length++]=G;else{var X=_.firstChild,K=0;while(X)Y[K++]=X,X=X.nextSibling;Y.length=K,delete Y[Y.length]}}}function JU(h,_){var{previousSibling:G,nextSibling:Y}=_;if(G)G.nextSibling=Y;else h.firstChild=Y;if(Y)Y.previousSibling=G;else h.lastChild=G;return _.parentNode=null,_.previousSibling=null,_.nextSibling=null,LD(h.ownerDocument,h),_}function gx(h){return h&&(h.nodeType===a1.DOCUMENT_NODE||h.nodeType===a1.DOCUMENT_FRAGMENT_NODE||h.nodeType===a1.ELEMENT_NODE)}function Ix(h){return h&&(R3(h)||jD(h)||E6(h)||h.nodeType===a1.DOCUMENT_FRAGMENT_NODE||h.nodeType===a1.COMMENT_NODE||h.nodeType===a1.PROCESSING_INSTRUCTION_NODE)}function E6(h){return h&&h.nodeType===a1.DOCUMENT_TYPE_NODE}function R3(h){return h&&h.nodeType===a1.ELEMENT_NODE}function jD(h){return h&&h.nodeType===a1.TEXT_NODE}function tV(h,_){var G=h.childNodes||[];if(W3(G,R3)||E6(_))return!1;var Y=W3(G,E6);return!(_&&Y&&G.indexOf(Y)>G.indexOf(_))}function sV(h,_){var G=h.childNodes||[];function Y(K){return R3(K)&&K!==_}if(W3(G,Y))return!1;var X=W3(G,E6);return!(_&&X&&G.indexOf(X)>G.indexOf(_))}function Px(h,_,G){if(!gx(h))throw new r1(G4,"Unexpected parent node type "+h.nodeType);if(G&&G.parentNode!==h)throw new r1(GU,"child not in parent");if(!Ix(_)||E6(_)&&h.nodeType!==a1.DOCUMENT_NODE)throw new r1(G4,"Unexpected node type "+_.nodeType+" for parent node type "+h.nodeType)}function yx(h,_,G){var Y=h.childNodes||[],X=_.childNodes||[];if(_.nodeType===a1.DOCUMENT_FRAGMENT_NODE){var K=X.filter(R3);if(K.length>1||W3(X,jD))throw new r1(G4,"More than one element or text in fragment");if(K.length===1&&!tV(h,G))throw new r1(G4,"Element in fragment can not be inserted before doctype")}if(R3(_)){if(!tV(h,G))throw new r1(G4,"Only one element can be added and only after doctype")}if(E6(_)){if(W3(Y,E6))throw new r1(G4,"Only one doctype is allowed");var Z=W3(Y,R3);if(G&&Y.indexOf(Z)<Y.indexOf(G))throw new r1(G4,"Doctype can only be inserted before an element");if(!G&&Z)throw new r1(G4,"Doctype can not be appended since element is present")}}function qU(h,_,G){var Y=h.childNodes||[],X=_.childNodes||[];if(_.nodeType===a1.DOCUMENT_FRAGMENT_NODE){var K=X.filter(R3);if(K.length>1||W3(X,jD))throw new r1(G4,"More than one element or text in fragment");if(K.length===1&&!sV(h,G))throw new r1(G4,"Element in fragment can not be inserted before doctype")}if(R3(_)){if(!sV(h,G))throw new r1(G4,"Only one element can be added and only after doctype")}if(E6(_)){let D=function(O){return E6(O)&&O!==G};var Q=D;if(W3(Y,D))throw new r1(G4,"Only one doctype is allowed");var Z=W3(Y,R3);if(G&&Y.indexOf(Z)<Y.indexOf(G))throw new r1(G4,"Doctype can only be inserted before an element")}}function YZ(h,_,G,Y){if(Px(h,_,G),h.nodeType===a1.DOCUMENT_NODE)(Y||yx)(h,_,G);var X=_.parentNode;if(X)X.removeChild(_);if(_.nodeType===V6){var K=_.firstChild;if(K==null)return _;var Z=_.lastChild}else K=Z=_;var Q=G?G.previousSibling:h.lastChild;if(K.previousSibling=Q,Z.nextSibling=G,Q)Q.nextSibling=K;else h.firstChild=K;if(G==null)h.lastChild=Z;else G.previousSibling=Z;do{K.parentNode=h;var D=h.ownerDocument||h;mG(K,D)}while(K!==Z&&(K=K.nextSibling));if(LD(h.ownerDocument||h,h),_.nodeType==V6)_.firstChild=_.lastChild=null;return _}function mG(h,_){if(h.ownerDocument===_)return;if(h.ownerDocument=_,h.nodeType===p4&&h.attributes)for(var G=0;G<h.attributes.length;G++){var Y=h.attributes.item(G);if(Y)Y.ownerDocument=_}var X=h.firstChild;while(X)mG(X,_),X=X.nextSibling}function bx(h,_){if(_.parentNode)_.parentNode.removeChild(_);if(_.parentNode=h,_.previousSibling=h.lastChild,_.nextSibling=null,_.previousSibling)_.previousSibling.nextSibling=_;else h.firstChild=_;h.lastChild=_,LD(h.ownerDocument,h,_);var G=h.ownerDocument||h;return mG(_,G),_}kG.prototype={nodeName:"#document",nodeType:hU,doctype:null,documentElement:null,_inc:1,insertBefore:function(h,_){if(h.nodeType==V6){var G=h.firstChild;while(G){var Y=G.nextSibling;this.insertBefore(G,_),G=Y}return h}if(YZ(this,h,_),mG(h,this),this.documentElement===null&&h.nodeType===p4)this.documentElement=h;return h},removeChild:function(h){if(this.documentElement==h)this.documentElement=null;return JU(this,h)},replaceChild:function(h,_){if(YZ(this,h,_,qU),mG(h,this),_)this.removeChild(_);if(R3(h))this.documentElement=h},importNode:function(h,_){return mx(this,h,_)},getElementById:function(h){var _=null;return GZ(this.documentElement,function(G){if(G.nodeType==p4){if(G.getAttribute("id")==h)return _=G,!0}}),_},getElementsByClassName:function(h){var _=iV(h);return new zh(this,function(G){var Y=[];if(_.length>0)GZ(G.documentElement,function(X){if(X!==G&&X.nodeType===p4){var K=X.getAttribute("class");if(K){var Z=h===K;if(!Z){var Q=iV(K);Z=_.every(Rx(Q))}if(Z)Y.push(X)}}});return Y})},createElement:function(h){var _=new I7;_.ownerDocument=this,_.nodeName=h,_.tagName=h,_.localName=h,_.childNodes=new U6;var G=_.attributes=new _Z;return G._ownerElement=_,_},createDocumentFragment:function(){var h=new ZZ;return h.ownerDocument=this,h.childNodes=new U6,h},createTextNode:function(h){var _=new FD;return _.ownerDocument=this,_.appendData(h),_},createComment:function(h){var _=new TD;return _.ownerDocument=this,_.appendData(h),_},createCDATASection:function(h){if(h.indexOf("]]>")!==-1)throw new r1(xx,'data contains "]]>"');var _=new WD;return _.ownerDocument=this,_.appendData(h),_},createProcessingInstruction:function(h,_){var G=new SD;return G.ownerDocument=this,G.tagName=G.nodeName=G.target=h,G.nodeValue=G.data=_,G},createAttribute:function(h){var _=new XZ;return _.ownerDocument=this,_.name=h,_.nodeName=h,_.localName=h,_.specified=!0,_},createEntityReference:function(h){var _=new RD;return _.ownerDocument=this,_.nodeName=h,_},createElementNS:function(h,_){var G=new I7,Y=_.split(":"),X=G.attributes=new _Z;if(G.childNodes=new U6,G.ownerDocument=this,G.nodeName=_,G.tagName=_,G.namespaceURI=h,Y.length==2)G.prefix=Y[0],G.localName=Y[1];else G.localName=_;return X._ownerElement=G,G},createAttributeNS:function(h,_){var G=new XZ,Y=_.split(":");if(G.ownerDocument=this,G.nodeName=_,G.name=_,G.namespaceURI=h,G.specified=!0,Y.length==2)G.prefix=Y[0],G.localName=Y[1];else G.localName=_;return G}};Y4(kG,a1);function I7(){this._nsMap={}}I7.prototype={nodeType:p4,hasAttribute:function(h){return this.getAttributeNode(h)!=null},getAttribute:function(h){var _=this.getAttributeNode(h);return _&&_.value||""},getAttributeNode:function(h){return this.attributes.getNamedItem(h)},setAttribute:function(h,_){var G=this.ownerDocument.createAttribute(h);G.value=G.nodeValue=""+_,this.setAttributeNode(G)},removeAttribute:function(h){var _=this.getAttributeNode(h);_&&this.removeAttributeNode(_)},appendChild:function(h){if(h.nodeType===V6)return this.insertBefore(h,null);else return bx(this,h)},setAttributeNode:function(h){return this.attributes.setNamedItem(h)},setAttributeNodeNS:function(h){return this.attributes.setNamedItemNS(h)},removeAttributeNode:function(h){return this.attributes.removeNamedItem(h.nodeName)},removeAttributeNS:function(h,_){var G=this.getAttributeNodeNS(h,_);G&&this.removeAttributeNode(G)},hasAttributeNS:function(h,_){return this.getAttributeNodeNS(h,_)!=null},getAttributeNS:function(h,_){var G=this.getAttributeNodeNS(h,_);return G&&G.value||""},setAttributeNS:function(h,_,G){var Y=this.ownerDocument.createAttributeNS(h,_);Y.value=Y.nodeValue=""+G,this.setAttributeNode(Y)},getAttributeNodeNS:function(h,_){return this.attributes.getNamedItemNS(h,_)},getElementsByTagName:function(h){return new zh(this,function(_){var G=[];return GZ(_,function(Y){if(Y!==_&&Y.nodeType==p4&&(h==="*"||Y.tagName==h))G.push(Y)}),G})},getElementsByTagNameNS:function(h,_){return new zh(this,function(G){var Y=[];return GZ(G,function(X){if(X!==G&&X.nodeType===p4&&(h==="*"||X.namespaceURI===h)&&(_==="*"||X.localName==_))Y.push(X)}),Y})}};kG.prototype.getElementsByTagName=I7.prototype.getElementsByTagName;kG.prototype.getElementsByTagNameNS=I7.prototype.getElementsByTagNameNS;Y4(I7,a1);function XZ(){}XZ.prototype.nodeType=Ah;Y4(XZ,a1);function uG(){}uG.prototype={data:"",substringData:function(h,_){return this.data.substring(h,h+_)},appendData:function(h){h=this.data+h,this.nodeValue=this.data=h,this.length=h.length},insertData:function(h,_){this.replaceData(h,0,_)},appendChild:function(h){throw Error(Z5[G4])},deleteData:function(h,_){this.replaceData(h,_,"")},replaceData:function(h,_,G){var Y=this.data.substring(0,h),X=this.data.substring(h+_);G=Y+G+X,this.nodeValue=this.data=G,this.length=G.length}};Y4(uG,a1);function FD(){}FD.prototype={nodeName:"#text",nodeType:hZ,splitText:function(h){var _=this.data,G=_.substring(h);_=_.substring(0,h),this.data=this.nodeValue=_,this.length=_.length;var Y=this.ownerDocument.createTextNode(G);if(this.parentNode)this.parentNode.insertBefore(Y,this.nextSibling);return Y}};Y4(FD,uG);function TD(){}TD.prototype={nodeName:"#comment",nodeType:ND};Y4(TD,uG);function WD(){}WD.prototype={nodeName:"#cdata-section",nodeType:rV};Y4(WD,uG);function KZ(){}KZ.prototype.nodeType=_U;Y4(KZ,a1);function QU(){}QU.prototype.nodeType=vx;Y4(QU,a1);function DU(){}DU.prototype.nodeType=Sx;Y4(DU,a1);function RD(){}RD.prototype.nodeType=eV;Y4(RD,a1);function ZZ(){}ZZ.prototype.nodeName="#document-fragment";ZZ.prototype.nodeType=V6;Y4(ZZ,a1);function SD(){}SD.prototype.nodeType=CD;Y4(SD,a1);function MU(){}MU.prototype.serializeToString=function(h,_,G,Y){return BU.call(h,_,G,Y)};a1.prototype.toString=BU;function BU(h,_,G){var Y=!!G&&!!G.requireWellFormed,X=[],K=this.nodeType==9&&this.documentElement||this,Z=K.prefix,Q=K.namespaceURI;if(Q&&Z==null){var Z=K.lookupPrefix(Q);if(Z==null)var D=[{namespace:Q,prefix:null}]}return vD(this,X,h,_,D,Y),X.join("")}function nV(h,_,G){var Y=h.prefix||"",X=h.namespaceURI;if(!X)return!1;if(Y==="xml"&&X===bG.XML||X===bG.XMLNS)return!1;var K=G.length;while(K--){var Z=G[K];if(Z.prefix===Y)return Z.namespace!==X}return!0}function eK(h,_,G){h.push(" ",_,'="',G.replace(/[<>&"\t\n\r]/g,KU),'"')}function vD(h,_,G,Y,X,K){if(!X)X=[];K5(h,{ns:X,isHTML:G},{enter:function(Z,Q){var{ns:D,isHTML:O}=Q;if(Y)if(Z=Y(Z),Z){if(typeof Z=="string")return _.push(Z),null}else return null;switch(Z.nodeType){case p4:var A=Z.attributes,H=A.length,C=Z.tagName;O=bG.isHTML(Z.namespaceURI)||O;var N=C;if(!O&&!Z.prefix&&Z.namespaceURI){var j;for(var W=0;W<A.length;W++)if(A.item(W).name==="xmlns"){j=A.item(W).value;break}if(!j)for(var S=D.length-1;S>=0;S--){var R=D[S];if(R.prefix===""&&R.namespace===Z.namespaceURI){j=R.namespace;break}}if(j!==Z.namespaceURI)for(var S=D.length-1;S>=0;S--){var R=D[S];if(R.namespace===Z.namespaceURI){if(R.prefix)N=R.prefix+":"+C;break}}}_.push("<",N);var v=D.slice();for(var x=0;x<H;x++){var P=A.item(x);if(P.prefix=="xmlns")v.push({prefix:P.localName,namespace:P.value});else if(P.nodeName=="xmlns")v.push({prefix:"",namespace:P.value})}for(var x=0;x<H;x++){var P=A.item(x);if(nV(P,O,v)){var I=P.prefix||"",b=P.namespaceURI;eK(_,I?"xmlns:"+I:"xmlns",b),v.push({prefix:I,namespace:b})}var l=Y?Y(P):P;if(l)if(typeof l==="string")_.push(l);else eK(_,l.name,l.value)}if(C===N&&nV(Z,O,v)){var i=Z.prefix||"",b=Z.namespaceURI;eK(_,i?"xmlns:"+i:"xmlns",b),v.push({prefix:i,namespace:b})}var h0=Z.firstChild;if(h0||O&&!/^(?:meta|link|img|br|hr|input)$/i.test(C)){if(_.push(">"),O&&/^script$/i.test(C)){while(h0){if(h0.data)_.push(h0.data);else vD(h0,_,O,Y,v.slice(),K);h0=h0.nextSibling}return _.push("</",C,">"),null}return{ns:v,isHTML:O,tag:N}}else return _.push("/>"),null;case hU:case V6:return{ns:D.slice(),isHTML:O,tag:null};case Ah:return eK(_,Z.name,Z.value),null;case hZ:return _.push(Z.data.replace(/[<&>]/g,KU)),null;case rV:if(K&&Z.data.indexOf("]]>")!==-1)throw new r1(Oh,'The CDATASection data contains "]]>"');return _.push("<![CDATA[",Z.data.replace(/]]>/g,"]]]]><![CDATA[>"),"]]>"),null;case ND:if(K&&Z.data.indexOf("-->")!==-1)throw new r1(Oh,'The comment node data contains "-->"');return _.push("<!--",Z.data,"-->"),null;case _U:if(K){if(Z.publicId&&!/^("[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%']*"|'[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%'"]*')$/.test(Z.publicId))throw new r1(Oh,"DocumentType publicId is not a valid PubidLiteral");if(Z.systemId&&!/^("[^"]*"|'[^']*')$/.test(Z.systemId))throw new r1(Oh,"DocumentType systemId is not a valid SystemLiteral");if(Z.internalSubset&&Z.internalSubset.indexOf("]>")!==-1)throw new r1(Oh,'DocumentType internalSubset contains "]>"')}var{publicId:q0,systemId:Q0}=Z;if(_.push("<!DOCTYPE ",Z.name),q0){if(_.push(" PUBLIC ",q0),Q0&&Q0!=".")_.push(" ",Q0);_.push(">")}else if(Q0&&Q0!=".")_.push(" SYSTEM ",Q0,">");else{var o=Z.internalSubset;if(o)_.push(" [",o,"]");_.push(">")}return null;case CD:if(K&&Z.data.indexOf("?>")!==-1)throw new r1(Oh,'The ProcessingInstruction data contains "?>"');return _.push("<?",Z.target," ",Z.data,"?>"),null;case eV:return _.push("&",Z.nodeName,";"),null;default:return _.push("??",Z.nodeName),null}},exit:function(Z,Q){if(Q&&Q.tag)_.push("</",Q.tag,">")}})}function mx(h,_,G){var Y;return K5(_,null,{enter:function(X,K){var Z=X.cloneNode(!1);if(Z.ownerDocument=h,Z.parentNode=null,K===null)Y=Z;else K.appendChild(Z);var Q=X.nodeType===Ah||G;return Q?Z:null}}),Y}function OU(h,_,G){var Y;return K5(_,null,{enter:function(X,K){var Z=new X.constructor;for(var Q in X)if(Object.prototype.hasOwnProperty.call(X,Q)){var D=X[Q];if(typeof D!="object"){if(D!=Z[Q])Z[Q]=D}}if(X.childNodes)Z.childNodes=new U6;Z.ownerDocument=h;var O=G;switch(Z.nodeType){case p4:var A=X.attributes,H=Z.attributes=new _Z,C=A.length;H._ownerElement=Z;for(var N=0;N<C;N++)Z.setAttributeNode(OU(h,A.item(N),!0));break;case Ah:O=!0}if(K!==null)K.appendChild(Z);else Y=Z;return O?Z:null}}),Y}function AU(h,_,G){h[_]=G}try{if(Object.defineProperty)Object.defineProperty(zh.prototype,"length",{get:function(){return $D(this),this.$$length}}),Object.defineProperty(a1.prototype,"textContent",{get:function(){if(this.nodeType===p4||this.nodeType===V6){var h=[];return K5(this,null,{enter:function(_){if(_.nodeType===p4||_.nodeType===V6)return!0;if(_.nodeType===CD||_.nodeType===ND)return null;h.push(_.nodeValue)}}),h.join("")}return this.nodeValue},set:function(h){switch(this.nodeType){case p4:case V6:while(this.firstChild)this.removeChild(this.firstChild);if(h||String(h))this.appendChild(this.ownerDocument.createTextNode(h));break;default:this.data=h,this.value=h,this.nodeValue=h}}}),AU=function(h,_,G){h["$$"+_]=G}}catch(h){}fx.DocumentType=KZ;fx.DOMException=r1;fx.DOMImplementation=XU;fx.Element=I7;fx.Node=a1;fx.NodeList=U6;fx.walkDOM=K5;fx.XMLSerializer=MU});var VU=U1((tx)=>{var zU=yG().freeze;tx.XML_ENTITIES=zU({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});tx.HTML_ENTITIES=zU({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"",Afr:"\uD835\uDD04",afr:"\uD835\uDD1E",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:"\uD835\uDD38",aopf:"\uD835\uDD52",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"\uD835\uDC9C",ascr:"\uD835\uDCB6",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:"\uD835\uDD05",bfr:"\uD835\uDD1F",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:"\uD835\uDD39",bopf:"\uD835\uDD53",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:"\uD835\uDCB7",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:"\uD835\uDD20",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:"\uD835\uDD54",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"\uD835\uDC9E",cscr:"\uD835\uDCB8",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:"\uD835\uDD07",dfr:"\uD835\uDD21",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:"\uD835\uDD3B",dopf:"\uD835\uDD55",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:"\uD835\uDC9F",dscr:"\uD835\uDCB9",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:"\uD835\uDD08",efr:"\uD835\uDD22",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:"\uD835\uDD3C",eopf:"\uD835\uDD56",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:"\uD835\uDD09",ffr:"\uD835\uDD23",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"\uD835\uDD3D",fopf:"\uD835\uDD57",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:"\uD835\uDCBB",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:"\uD835\uDD0A",gfr:"\uD835\uDD24",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"\uD835\uDD3E",gopf:"\uD835\uDD58",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"\uD835\uDCA2",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:"\uD835\uDD25",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"\uD835\uDD59",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"\uD835\uDCBD",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"\uD835\uDD26",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:"\uD835\uDD40",iopf:"\uD835\uDD5A",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"\uD835\uDCBE",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"\uD835\uDD0D",jfr:"\uD835\uDD27",jmath:"ȷ",Jopf:"\uD835\uDD41",jopf:"\uD835\uDD5B",Jscr:"\uD835\uDCA5",jscr:"\uD835\uDCBF",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"\uD835\uDD0E",kfr:"\uD835\uDD28",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"\uD835\uDD42",kopf:"\uD835\uDD5C",Kscr:"\uD835\uDCA6",kscr:"\uD835\uDCC0",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:"\uD835\uDD0F",lfr:"\uD835\uDD29",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:"\uD835\uDD43",lopf:"\uD835\uDD5D",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"\uD835\uDCC1",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:"\uD835\uDD10",mfr:"\uD835\uDD2A",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"\uD835\uDD44",mopf:"\uD835\uDD5E",mp:"∓",Mscr:"ℳ",mscr:"\uD835\uDCC2",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:`
|
|
12
|
-
`,nexist:"∄",nexists:"∄",Nfr:"\uD835\uDD11",nfr:"\uD835\uDD2B",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:"\uD835\uDD5F",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:"\uD835\uDCA9",nscr:"\uD835\uDCC3",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:"\uD835\uDD12",ofr:"\uD835\uDD2C",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"\uD835\uDD46",oopf:"\uD835\uDD60",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"\uD835\uDCAA",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:"\uD835\uDD13",pfr:"\uD835\uDD2D",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:"\uD835\uDD61",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:"\uD835\uDCAB",pscr:"\uD835\uDCC5",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"\uD835\uDD14",qfr:"\uD835\uDD2E",qint:"⨌",Qopf:"ℚ",qopf:"\uD835\uDD62",qprime:"⁗",Qscr:"\uD835\uDCAC",qscr:"\uD835\uDCC6",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:"\uD835\uDD2F",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:"\uD835\uDD63",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"\uD835\uDCC7",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:"\uD835\uDD16",sfr:"\uD835\uDD30",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:"\uD835\uDD4A",sopf:"\uD835\uDD64",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:"\uD835\uDCAE",sscr:"\uD835\uDCC8",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:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"\uD835\uDD17",tfr:"\uD835\uDD31",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:"\uD835\uDD4B",topf:"\uD835\uDD65",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"\uD835\uDCAF",tscr:"\uD835\uDCC9",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:"\uD835\uDD18",ufr:"\uD835\uDD32",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"\uD835\uDD4C",uopf:"\uD835\uDD66",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:"\uD835\uDCB0",uscr:"\uD835\uDCCA",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:"\uD835\uDD19",vfr:"\uD835\uDD33",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"\uD835\uDD4D",vopf:"\uD835\uDD67",vprop:"∝",vrtri:"⊳",Vscr:"\uD835\uDCB1",vscr:"\uD835\uDCCB",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"\uD835\uDD1A",wfr:"\uD835\uDD34",Wopf:"\uD835\uDD4E",wopf:"\uD835\uDD68",wp:"℘",wr:"≀",wreath:"≀",Wscr:"\uD835\uDCB2",wscr:"\uD835\uDCCC",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"\uD835\uDD1B",xfr:"\uD835\uDD35",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"\uD835\uDD4F",xopf:"\uD835\uDD69",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"\uD835\uDCB3",xscr:"\uD835\uDCCD",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"\uD835\uDD1C",yfr:"\uD835\uDD36",YIcy:"Ї",yicy:"ї",Yopf:"\uD835\uDD50",yopf:"\uD835\uDD6A",Yscr:"\uD835\uDCB4",yscr:"\uD835\uDCCE",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"\uD835\uDD37",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"\uD835\uDD6B",Zscr:"\uD835\uDCB5",zscr:"\uD835\uDCCF",zwj:"",zwnj:""});tx.entityMap=tx.HTML_ENTITIES});var FU=U1((Xw)=>{var cG=yG().NAMESPACE,wD=/[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]/,UU=new RegExp("[\\-\\.0-9"+wD.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),EU=new RegExp("^"+wD.source+UU.source+"*(?::"+wD.source+UU.source+"*)?$"),pG=0,U8=1,Hh=2,lG=3,Vh=4,Uh=5,iG=6,JZ=7;function Eh(h,_){if(this.message=h,this.locator=_,Error.captureStackTrace)Error.captureStackTrace(this,Eh)}Eh.prototype=Error();Eh.prototype.name=Eh.name;function $U(){}$U.prototype={parse:function(h,_,G){var Y=this.domBuilder;Y.startDocument(),LU(_,_={}),ox(h,_,G,Y,this.errorHandler),Y.endDocument()}};function ox(h,_,G,Y,X){function K(_0){if(_0>65535){_0-=65536;var Z0=55296+(_0>>10),X0=56320+(_0&1023);return String.fromCharCode(Z0,X0)}else return String.fromCharCode(_0)}function Z(_0){var Z0=_0.slice(1,-1);if(Object.hasOwnProperty.call(G,Z0))return G[Z0];else if(Z0.charAt(0)==="#")return K(parseInt(Z0.substr(1).replace("x","0x")));else return X.error("entity not found:"+_0),_0}function Q(_0){if(_0>W){var Z0=h.substring(W,_0).replace(/&#?\w+;/g,Z);C&&D(W),Y.characters(Z0,0,_0-W),W=_0}}function D(_0,Z0){while(_0>=A&&(Z0=H.exec(h)))O=Z0.index,A=O+Z0[0].length,C.lineNumber++;C.columnNumber=_0-O+1}var O=0,A=0,H=/.*(?:\r\n?|\n)|.*$/g,C=Y.locator,N=[{currentNSMap:_}],j={},W=0;while(!0){try{var S=h.indexOf("<",W);if(S<0){if(!h.substr(W).match(/^\s*$/)){var R=Y.doc,v=R.createTextNode(h.substr(W));R.appendChild(v),Y.currentElement=v}return}if(S>W)Q(S);switch(h.charAt(S+1)){case"/":var Q0=h.indexOf(">",S+3),x=h.substring(S+2,Q0).replace(/[ \t\n\r]+$/g,""),P=N.pop();if(Q0<0)x=h.substring(S+2).replace(/[\s<].*/,""),X.error("end tag name: "+x+" is not complete:"+P.tagName),Q0=S+1+x.length;else if(x.match(/\s</))x=x.replace(/[\s<].*/,""),X.error("end tag name: "+x+" maybe not complete"),Q0=S+1+x.length;var I=P.localNSMap,b=P.tagName==x,l=b||P.tagName&&P.tagName.toLowerCase()==x.toLowerCase();if(l){if(Y.endElement(P.uri,P.localName,x),I){for(var i in I)if(Object.prototype.hasOwnProperty.call(I,i))Y.endPrefixMapping(i)}if(!b)X.fatalError("end tag name: "+x+" is not match the current start tagName:"+P.tagName)}else N.push(P);Q0++;break;case"?":C&&D(S),Q0=Gw(h,S,Y);break;case"!":C&&D(S),Q0=_w(h,S,Y,X);break;default:C&&D(S);var h0=new jU,q0=N[N.length-1].currentNSMap,Q0=rx(h,S,h0,q0,Z,X),o=h0.length;if(!h0.closed&&hw(h,Q0,h0.tagName,j)){if(h0.closed=!0,!G.nbsp)X.warning("unclosed xml attribute")}if(C&&o){var r=CU(C,{});for(var d=0;d<o;d++){var s=h0[d];D(s.offset),s.locator=CU(C,{})}if(Y.locator=r,NU(h0,Y,q0))N.push(h0);Y.locator=C}else if(NU(h0,Y,q0))N.push(h0);if(cG.isHTML(h0.uri)&&!h0.closed)Q0=ex(h,Q0,h0.tagName,Z,Y);else Q0++}}catch(_0){if(_0 instanceof Eh)throw _0;X.error("element parse error: "+_0),Q0=-1}if(Q0>W)W=Q0;else Q(Math.max(S,W)+1)}}function CU(h,_){return _.lineNumber=h.lineNumber,_.columnNumber=h.columnNumber,_}function rx(h,_,G,Y,X,K){function Z(N,j,W){if(G.attributeNames.hasOwnProperty(N))K.fatalError("Attribute "+N+" redefined");G.addValue(N,j.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,X),W)}var Q,D,O=++_,A=pG;while(!0){var H=h.charAt(O);switch(H){case"=":if(A===U8)Q=h.slice(_,O),A=lG;else if(A===Hh)A=lG;else throw Error("attribute equal must after attrName");break;case"'":case'"':if(A===lG||A===U8){if(A===U8)K.warning('attribute value must after "="'),Q=h.slice(_,O);if(_=O+1,O=h.indexOf(H,_),O>0)D=h.slice(_,O),Z(Q,D,_-1),A=Uh;else throw Error("attribute value no end '"+H+"' match")}else if(A==Vh)D=h.slice(_,O),Z(Q,D,_),K.warning('attribute "'+Q+'" missed start quot('+H+")!!"),_=O+1,A=Uh;else throw Error('attribute value must after "="');break;case"/":switch(A){case pG:G.setTagName(h.slice(_,O));case Uh:case iG:case JZ:A=JZ,G.closed=!0;case Vh:case U8:break;case Hh:G.closed=!0;break;default:throw Error("attribute invalid close char('/')")}break;case"":if(K.error("unexpected end of input"),A==pG)G.setTagName(h.slice(_,O));return O;case">":switch(A){case pG:G.setTagName(h.slice(_,O));case Uh:case iG:case JZ:break;case Vh:case U8:if(D=h.slice(_,O),D.slice(-1)==="/")G.closed=!0,D=D.slice(0,-1);case Hh:if(A===Hh)D=Q;if(A==Vh)K.warning('attribute "'+D+'" missed quot(")!'),Z(Q,D,_);else{if(!cG.isHTML(Y[""])||!D.match(/^(?:disabled|checked|selected)$/i))K.warning('attribute "'+D+'" missed value!! "'+D+'" instead!!');Z(D,D,_)}break;case lG:throw Error("attribute value missed!!")}return O;case"":H=" ";default:if(H<=" ")switch(A){case pG:G.setTagName(h.slice(_,O)),A=iG;break;case U8:Q=h.slice(_,O),A=Hh;break;case Vh:var D=h.slice(_,O);K.warning('attribute "'+D+'" missed quot(")!!'),Z(Q,D,_);case Uh:A=iG;break}else switch(A){case Hh:var C=G.tagName;if(!cG.isHTML(Y[""])||!Q.match(/^(?:disabled|checked|selected)$/i))K.warning('attribute "'+Q+'" missed value!! "'+Q+'" instead2!!');Z(Q,Q,_),_=O,A=U8;break;case Uh:K.warning('attribute space is required"'+Q+'"!!');case iG:A=U8,_=O;break;case lG:A=Vh,_=O;break;case JZ:throw Error("elements closed character '/' and '>' must be connected to")}}O++}}function NU(h,_,G){var Y=h.tagName,X=null,H=h.length;while(H--){var K=h[H],Z=K.qName,Q=K.value,C=Z.indexOf(":");if(C>0)var D=K.prefix=Z.slice(0,C),O=Z.slice(C+1),A=D==="xmlns"&&O;else O=Z,D=null,A=Z==="xmlns"&&"";if(K.localName=O,A!==!1){if(X==null)X={},LU(G,G={});G[A]=X[A]=Q,K.uri=cG.XMLNS,_.startPrefixMapping(A,Q)}}var H=h.length;while(H--){K=h[H];var D=K.prefix;if(D){if(D==="xml")K.uri=cG.XML;if(D!=="xmlns")K.uri=G[D||""]}}var C=Y.indexOf(":");if(C>0)D=h.prefix=Y.slice(0,C),O=h.localName=Y.slice(C+1);else D=null,O=h.localName=Y;var N=h.uri=G[D||""];if(_.startElement(N,O,Y,h),h.closed){if(_.endElement(N,O,Y),X){for(D in X)if(Object.prototype.hasOwnProperty.call(X,D))_.endPrefixMapping(D)}}else return h.currentNSMap=G,h.localNSMap=X,!0}function ex(h,_,G,Y,X){if(/^(?:script|textarea)$/i.test(G)){var K=h.indexOf("</"+G+">",_),Z=h.substring(_+1,K);if(/[&<]/.test(Z)){if(/^script$/i.test(G))return X.characters(Z,0,Z.length),K;return Z=Z.replace(/&#?\w+;/g,Y),X.characters(Z,0,Z.length),K}}return _+1}function hw(h,_,G,Y){var X=Y[G];if(X==null){if(X=h.lastIndexOf("</"+G+">"),X<_)X=h.lastIndexOf("</"+G);Y[G]=X}return X<_}function LU(h,_){for(var G in h)if(Object.prototype.hasOwnProperty.call(h,G))_[G]=h[G]}function _w(h,_,G,Y){var X=h.charAt(_+2);switch(X){case"-":if(h.charAt(_+3)==="-"){var K=h.indexOf("-->",_+4);if(K>_)return G.comment(h,_+4,K-_-4),K+3;else return Y.error("Unclosed comment"),-1}else return-1;default:if(h.substr(_+3,6)=="CDATA["){var K=h.indexOf("]]>",_+9);return G.startCDATA(),G.characters(h,_+9,K-_-9),G.endCDATA(),K+3}var Z=Yw(h,_),Q=Z.length;if(Q>1&&/!doctype/i.test(Z[0][0])){var D=Z[1][0],O=!1,A=!1;if(Q>3){if(/^public$/i.test(Z[2][0]))O=Z[3][0],A=Q>4&&Z[4][0];else if(/^system$/i.test(Z[2][0]))A=Z[3][0]}var H=Z[Q-1];return G.startDTD(D,O,A),G.endDTD(),H.index+H[0].length}}return-1}function Gw(h,_,G){var Y=h.indexOf("?>",_);if(Y){var X=h.substring(_,Y).match(/^<\?(\S*)\s*([\s\S]*?)$/);if(X){var K=X[0].length;return G.processingInstruction(X[1],X[2]),Y+2}else return-1}return-1}function jU(){this.attributeNames={}}jU.prototype={setTagName:function(h){if(!EU.test(h))throw Error("invalid tagName:"+h);this.tagName=h},addValue:function(h,_,G){if(!EU.test(h))throw Error("invalid attribute:"+h);this.attributeNames[h]=this.length,this[this.length++]={qName:h,value:_,offset:G}},length:0,getLocalName:function(h){return this[h].localName},getLocator:function(h){return this[h].locator},getQName:function(h){return this[h].qName},getURI:function(h){return this[h].uri},getValue:function(h){return this[h].value}};function Yw(h,_){var G,Y=[],X=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;X.lastIndex=_,X.exec(h);while(G=X.exec(h))if(Y.push(G),G[1])return Y}Xw.XMLReader=$U;Xw.ParseError=Eh});var wU=U1((Ow)=>{var Jw=yG(),qw=xD(),TU=VU(),SU=FU(),Qw=qw.DOMImplementation,WU=Jw.NAMESPACE,Dw=SU.ParseError,Mw=SU.XMLReader;function vU(h){return h.replace(/\r[\n\u0085]/g,`
|
|
13
|
-
`).replace(/[\r\u0085\u2028]/g,`
|
|
14
|
-
`)}function xU(h){this.options=h||{locator:{}}}xU.prototype.parseFromString=function(h,_){var G=this.options,Y=new Mw,X=G.domBuilder||new dG,K=G.errorHandler,Z=G.locator,Q=G.xmlns||{},D=/\/x?html?$/.test(_),O=D?TU.HTML_ENTITIES:TU.XML_ENTITIES;if(Z)X.setDocumentLocator(Z);if(Y.errorHandler=Bw(K,X,Z),Y.domBuilder=G.domBuilder||X,D)Q[""]=WU.HTML;Q.xml=Q.xml||WU.XML;var A=G.normalizeLineEndings||vU;if(h&&typeof h==="string")Y.parse(A(h),Q,O);else Y.errorHandler.error("invalid doc source");return X.doc};function Bw(h,_,G){if(!h){if(_ instanceof dG)return _;h=_}var Y={},X=h instanceof Function;G=G||{};function K(Z){var Q=h[Z];if(!Q&&X)Q=h.length==2?function(D){h(Z,D)}:h;Y[Z]=Q&&function(D){Q("[xmldom "+Z+"]\t"+D+gD(G))}||function(){}}return K("warning"),K("error"),K("fatalError"),Y}function dG(){this.cdata=!1}function Ch(h,_){_.lineNumber=h.lineNumber,_.columnNumber=h.columnNumber}dG.prototype={startDocument:function(){if(this.doc=new Qw().createDocument(null,null,null),this.locator)this.doc.documentURI=this.locator.systemId},startElement:function(h,_,G,Y){var X=this.doc,K=X.createElementNS(h,G||_),Z=Y.length;qZ(this,K),this.currentElement=K,this.locator&&Ch(this.locator,K);for(var Q=0;Q<Z;Q++){var h=Y.getURI(Q),D=Y.getValue(Q),G=Y.getQName(Q),O=X.createAttributeNS(h,G);this.locator&&Ch(Y.getLocator(Q),O),O.value=O.nodeValue=D,K.setAttributeNode(O)}},endElement:function(h,_,G){var Y=this.currentElement,X=Y.tagName;this.currentElement=Y.parentNode},startPrefixMapping:function(h,_){},endPrefixMapping:function(h){},processingInstruction:function(h,_){var G=this.doc.createProcessingInstruction(h,_);this.locator&&Ch(this.locator,G),qZ(this,G)},ignorableWhitespace:function(h,_,G){},characters:function(h,_,G){if(h=RU.apply(this,arguments),h){if(this.cdata)var Y=this.doc.createCDATASection(h);else var Y=this.doc.createTextNode(h);if(this.currentElement)this.currentElement.appendChild(Y);else if(/^\s*$/.test(h))this.doc.appendChild(Y);this.locator&&Ch(this.locator,Y)}},skippedEntity:function(h){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(h){if(this.locator=h)h.lineNumber=0},comment:function(h,_,G){h=RU.apply(this,arguments);var Y=this.doc.createComment(h);this.locator&&Ch(this.locator,Y),qZ(this,Y)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(h,_,G){var Y=this.doc.implementation;if(Y&&Y.createDocumentType){var X=Y.createDocumentType(h,_,G);this.locator&&Ch(this.locator,X),qZ(this,X),this.doc.doctype=X}},warning:function(h){console.warn("[xmldom warning]\t"+h,gD(this.locator))},error:function(h){console.error("[xmldom error]\t"+h,gD(this.locator))},fatalError:function(h){throw new Dw(h,this.locator)}};function gD(h){if(h)return`
|
|
15
|
-
@`+(h.systemId||"")+"#[line:"+h.lineNumber+",col:"+h.columnNumber+"]"}function RU(h,_,G){if(typeof h=="string")return h.substr(_,G);else{if(h.length>=_+G||_)return new java.lang.String(h,_,G)+"";return h}}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(h){dG.prototype[h]=function(){return null}});function qZ(h,_){if(!h.currentElement)h.doc.appendChild(_);else h.currentElement.appendChild(_)}Ow.__DOMHandler=dG;Ow.normalizeLineEndings=vU;Ow.DOMParser=xU});var oU=U1((Bn,nU)=>{var sU=Math.pow(2,32),Dg=function(h){var _=new DataView(h.buffer,h.byteOffset,h.byteLength),G;if(_.getBigUint64){if(G=_.getBigUint64(0),G<Number.MAX_SAFE_INTEGER)return Number(G);return G}return _.getUint32(0)*sU+_.getUint32(4)};nU.exports={getUint64:Dg,MAX_UINT32:sU}});var hE=U1((On,eU)=>{var rU=oU().getUint64,Mg=function(h){var _=new DataView(h.buffer,h.byteOffset,h.byteLength),G={version:h[0],flags:new Uint8Array(h.subarray(1,4)),references:[],referenceId:_.getUint32(4),timescale:_.getUint32(8)},Y=12;if(G.version===0)G.earliestPresentationTime=_.getUint32(Y),G.firstOffset=_.getUint32(Y+4),Y+=8;else G.earliestPresentationTime=rU(h.subarray(Y)),G.firstOffset=rU(h.subarray(Y+8)),Y+=16;Y+=2;var X=_.getUint16(Y);Y+=2;for(;X>0;Y+=12,X--)G.references.push({referenceType:(h[Y]&128)>>>7,referencedSize:_.getUint32(Y)&2147483647,subsegmentDuration:_.getUint32(Y+4),startsWithSap:!!(h[Y+8]&128),sapType:(h[Y+8]&112)>>>4,sapDeltaTime:_.getUint32(Y+8)&268435455});return G};eU.exports=Mg});var AE=U1((bn,OE)=>{var lD=90000,iD,cD,OZ,dD,DE,ME,BE;iD=function(h){return h*lD};cD=function(h,_){return h*_};OZ=function(h){return h/lD};dD=function(h,_){return h/_};DE=function(h,_){return iD(dD(h,_))};ME=function(h,_){return cD(OZ(h),_)};BE=function(h,_,G){return OZ(G?h:h-_)};OE.exports={ONE_SECOND_IN_TS:lD,secondsToVideoTs:iD,secondsToAudioTs:cD,videoTsToSeconds:OZ,audioTsToSeconds:dD,audioTsToVideoTs:DE,videoTsToAudioTs:ME,metadataTsToSeconds:BE}});var Jj=U1((s20,bY)=>{Zj();var KO=S1(l2());bY.exports=function(h){function _(J,q,M,z){return new c(J,q,M,z)}function G(){}function Y(J){var q="https://react.dev/errors/"+J;if(1<arguments.length){q+="?args[]="+encodeURIComponent(arguments[1]);for(var M=2;M<arguments.length;M++)q+="&args[]="+encodeURIComponent(arguments[M])}return"Minified React error #"+J+"; visit "+q+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function X(J){var q=J,M=J;if(J.alternate)for(;q.return;)q=q.return;else{J=q;do q=J,(q.flags&4098)!==0&&(M=q.return),J=q.return;while(J)}return q.tag===3?M:null}function K(J){if(X(J)!==J)throw Error(Y(188))}function Z(J){var q=J.alternate;if(!q){if(q=X(J),q===null)throw Error(Y(188));return q!==J?null:J}for(var M=J,z=q;;){var $=M.return;if($===null)break;var F=$.alternate;if(F===null){if(z=$.return,z!==null){M=z;continue}break}if($.child===F.child){for(F=$.child;F;){if(F===M)return K($),J;if(F===z)return K($),q;F=F.sibling}throw Error(Y(188))}if(M.return!==z.return)M=$,z=F;else{for(var w=!1,t=$.child;t;){if(t===M){w=!0,M=$,z=F;break}if(t===z){w=!0,z=$,M=F;break}t=t.sibling}if(!w){for(t=F.child;t;){if(t===M){w=!0,M=F,z=$;break}if(t===z){w=!0,z=F,M=$;break}t=t.sibling}if(!w)throw Error(Y(189))}}if(M.alternate!==z)throw Error(Y(190))}if(M.tag!==3)throw Error(Y(188));return M.stateNode.current===M?J:q}function Q(J){var q=J.tag;if(q===5||q===26||q===27||q===6)return J;for(J=J.child;J!==null;){if(q=Q(J),q!==null)return q;J=J.sibling}return null}function D(J){var q=J.tag;if(q===5||q===26||q===27||q===6)return J;for(J=J.child;J!==null;){if(J.tag!==4&&(q=D(J),q!==null))return q;J=J.sibling}return null}function O(J){if(J===null||typeof J!=="object")return null;return J=EO&&J[EO]||J["@@iterator"],typeof J==="function"?J:null}function A(J){if(J==null)return null;if(typeof J==="function")return J.$$typeof===dj?null:J.displayName||J.name||null;if(typeof J==="string")return J;switch(J){case j9:return"Fragment";case Kq:return"Profiler";case VO:return"StrictMode";case Jq:return"Suspense";case qq:return"SuspenseList";case Dq:return"Activity"}if(typeof J==="object")switch(J.$$typeof){case L9:return"Portal";case e6:return J.displayName||"Context";case UO:return(J._context.displayName||"Context")+".Consumer";case Zq:var q=J.render;return J=J.displayName,J||(J=q.displayName||q.name||"",J=J!==""?"ForwardRef("+J+")":"ForwardRef"),J;case Qq:return q=J.displayName||null,q!==null?q:A(J.type)||"Memo";case h8:q=J._payload,J=J._init;try{return A(J(q))}catch(M){}}return null}function H(J){return{current:J}}function C(J){0>W9||(J.current=Hq[W9],Hq[W9]=null,W9--)}function N(J,q){W9++,Hq[W9]=J.current,J.current=q}function j(J){return J>>>=0,J===0?32:31-(CT(J)/NT|0)|0}function W(J){var q=J&42;if(q!==0)return q;switch(J&-J){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return J&261888;case 262144:case 524288:case 1048576:case 2097152:return J&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return J&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return J}}function S(J,q,M){var z=J.pendingLanes;if(z===0)return 0;var $=0,F=J.suspendedLanes,w=J.pingedLanes;J=J.warmLanes;var t=z&134217727;return t!==0?(z=t&~F,z!==0?$=W(z):(w&=t,w!==0?$=W(w):M||(M=t&~J,M!==0&&($=W(M))))):(t=z&~F,t!==0?$=W(t):w!==0?$=W(w):M||(M=z&~J,M!==0&&($=W(M)))),$===0?0:q!==0&&q!==$&&(q&F)===0&&(F=$&-$,M=q&-q,F>=M||F===32&&(M&4194048)!==0)?q:$}function R(J,q){return(J.pendingLanes&~(J.suspendedLanes&~J.pingedLanes)&q)===0}function v(J,q){switch(J){case 1:case 2:case 4:case 8:case 64:return q+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return q+5000;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function x(){var J=lX;return lX<<=1,(lX&62914560)===0&&(lX=4194304),J}function P(J){for(var q=[],M=0;31>M;M++)q.push(J);return q}function I(J,q){J.pendingLanes|=q,q!==268435456&&(J.suspendedLanes=0,J.pingedLanes=0,J.warmLanes=0)}function b(J,q,M,z,$,F){var w=J.pendingLanes;J.pendingLanes=M,J.suspendedLanes=0,J.pingedLanes=0,J.warmLanes=0,J.expiredLanes&=M,J.entangledLanes&=M,J.errorRecoveryDisabledLanes&=M,J.shellSuspendCounter=0;var{entanglements:t,expirationTimes:B0,hiddenUpdates:L0}=J;for(M=w&~M;0<M;){var b0=31-V4(M),R0=1<<b0;t[b0]=0,B0[b0]=-1;var k0=L0[b0];if(k0!==null)for(L0[b0]=null,b0=0;b0<k0.length;b0++){var B1=k0[b0];B1!==null&&(B1.lane&=-536870913)}M&=~R0}z!==0&&l(J,z,0),F!==0&&$===0&&J.tag!==0&&(J.suspendedLanes|=F&~(w&~q))}function l(J,q,M){J.pendingLanes|=q,J.suspendedLanes&=~q;var z=31-V4(q);J.entangledLanes|=q,J.entanglements[z]=J.entanglements[z]|1073741824|M&261930}function i(J,q){var M=J.entangledLanes|=q;for(J=J.entanglements;M;){var z=31-V4(M),$=1<<z;$&q|J[z]&q&&(J[z]|=q),M&=~$}}function h0(J,q){var M=q&-q;return M=(M&42)!==0?1:q0(M),(M&(J.suspendedLanes|q))!==0?0:M}function q0(J){switch(J){case 2:J=1;break;case 8:J=4;break;case 32:J=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:J=128;break;case 268435456:J=134217728;break;default:J=0}return J}function Q0(J){return J&=-J,2<J?8<J?(J&134217727)!==0?32:268435456:8:2}function o(J){if(typeof TT==="function"&&WT(J),U4&&typeof U4.setStrictMode==="function")try{U4.setStrictMode(o_,J)}catch(q){}}function r(J,q){return J===q&&(J!==0||1/J===1/q)||J!==J&&q!==q}function d(J){if(Eq===void 0)try{throw Error()}catch(M){var q=M.stack.trim().match(/\n( *(at )?)/);Eq=q&&q[1]||"",cO=-1<M.stack.indexOf(`
|
|
16
|
-
at`)?" (<anonymous>)":-1<M.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
17
|
-
`+Eq+J+cO}function s(J,q){if(!J||Cq)return"";Cq=!0;var M=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var z={DetermineComponentFrameRoot:function(){try{if(q){var R0=function(){throw Error()};if(Object.defineProperty(R0.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==="object"&&Reflect.construct){try{Reflect.construct(R0,[])}catch(B1){var k0=B1}Reflect.construct(J,[],R0)}else{try{R0.call()}catch(B1){k0=B1}J.call(R0.prototype)}}else{try{throw Error()}catch(B1){k0=B1}(R0=J())&&typeof R0.catch==="function"&&R0.catch(function(){})}}catch(B1){if(B1&&k0&&typeof B1.stack==="string")return[B1.stack,k0.stack]}return[null,null]}};z.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var $=Object.getOwnPropertyDescriptor(z.DetermineComponentFrameRoot,"name");$&&$.configurable&&Object.defineProperty(z.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var F=z.DetermineComponentFrameRoot(),w=F[0],t=F[1];if(w&&t){var B0=w.split(`
|
|
18
|
-
`),L0=t.split(`
|
|
19
|
-
`);for($=z=0;z<B0.length&&!B0[z].includes("DetermineComponentFrameRoot");)z++;for(;$<L0.length&&!L0[$].includes("DetermineComponentFrameRoot");)$++;if(z===B0.length||$===L0.length)for(z=B0.length-1,$=L0.length-1;1<=z&&0<=$&&B0[z]!==L0[$];)$--;for(;1<=z&&0<=$;z--,$--)if(B0[z]!==L0[$]){if(z!==1||$!==1)do if(z--,$--,0>$||B0[z]!==L0[$]){var b0=`
|
|
20
|
-
`+B0[z].replace(" at new "," at ");return J.displayName&&b0.includes("<anonymous>")&&(b0=b0.replace("<anonymous>",J.displayName)),b0}while(1<=z&&0<=$);break}}}finally{Cq=!1,Error.prepareStackTrace=M}return(M=J?J.displayName||J.name:"")?d(M):""}function _0(J,q){switch(J.tag){case 26:case 27:case 5:return d(J.type);case 16:return d("Lazy");case 13:return J.child!==q&&q!==null?d("Suspense Fallback"):d("Suspense");case 19:return d("SuspenseList");case 0:case 15:return s(J.type,!1);case 11:return s(J.type.render,!1);case 1:return s(J.type,!0);case 31:return d("Activity");default:return""}}function Z0(J){try{var q="",M=null;do q+=_0(J,M),M=J,J=J.return;while(J);return q}catch(z){return`
|
|
21
|
-
Error generating stack: `+z.message+`
|
|
22
|
-
`+z.stack}}function X0(J,q){if(typeof J==="object"&&J!==null){var M=dO.get(J);if(M!==void 0)return M;return q={value:J,source:q,stack:Z0(q)},dO.set(J,q),q}return{value:J,source:q,stack:Z0(q)}}function E0(J,q){S9[v9++]=r_,S9[v9++]=cX,cX=J,r_=q}function m(J,q,M){I4[P4++]=$3,I4[P4++]=L3,I4[P4++]=_8,_8=J;var z=$3;J=L3;var $=32-V4(z)-1;z&=~(1<<$),M+=1;var F=32-V4(q)+$;if(30<F){var w=$-$%5;F=(z&(1<<w)-1).toString(32),z>>=w,$-=w,$3=1<<32-V4(q)+$|M<<$|z,L3=F+J}else $3=1<<F|M<<$|z,L3=J}function N0(J){J.return!==null&&(E0(J,1),m(J,1,0))}function x0(J){for(;J===cX;)cX=S9[--v9],S9[v9]=null,r_=S9[--v9],S9[v9]=null;for(;J===_8;)_8=I4[--P4],I4[P4]=null,L3=I4[--P4],I4[P4]=null,$3=I4[--P4],I4[P4]=null}function k(J,q){I4[P4++]=$3,I4[P4++]=L3,I4[P4++]=_8,$3=q.id,L3=q.overflow,_8=J}function y0(J,q){N(G8,q),N(e_,J),N(H5,null),J=sj(q),C(H5),N(H5,J)}function a0(){C(H5),C(e_),C(G8)}function n0(J){J.memoizedState!==null&&N(dX,J);var q=H5.current,M=nj(q,J.type);q!==M&&(N(e_,J),N(H5,M))}function w0(J){e_.current===J&&(C(H5),C(e_)),dX.current===J&&(C(dX),K6?z7._currentValue=F9:z7._currentValue2=F9)}function g0(J){var q=Error(Y(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw l1(X0(q,J)),Nq}function Q1(J,q){if(!R5)throw Error(Y(175));nF(J.stateNode,J.type,J.memoizedProps,q,J)||g0(J,!0)}function Y1(J){for(V5=J.return;V5;)switch(V5.tag){case 5:case 31:case 13:y4=!1;return;case 27:case 3:y4=!0;return;default:V5=V5.return}}function D1(J){if(!R5||J!==V5)return!1;if(!R1)return Y1(J),R1=!0,!1;var q=J.tag;if(t2?q!==3&&q!==27&&(q!==5||wO(J.type)&&!kX(J.type,J.memoizedProps))&&z2&&g0(J):q!==3&&(q!==5||wO(J.type)&&!kX(J.type,J.memoizedProps))&&z2&&g0(J),Y1(J),q===13){if(!R5)throw Error(Y(316));if(J=J.memoizedState,J=J!==null?J.dehydrated:null,!J)throw Error(Y(317));z2=_T(J)}else if(q===31){if(J=J.memoizedState,J=J!==null?J.dehydrated:null,!J)throw Error(Y(317));z2=hT(J)}else z2=t2&&q===27?kF(J.type,z2):V5?xO(J.stateNode):null;return!0}function b1(){R5&&(z2=V5=null,R1=!1)}function _1(){var J=Y8;return J!==null&&(h4===null?h4=J:h4.push.apply(h4,J),Y8=null),J}function l1(J){Y8===null?Y8=[J]:Y8.push(J)}function n1(J,q,M){K6?(N(aX,q._currentValue),q._currentValue=M):(N(aX,q._currentValue2),q._currentValue2=M)}function y2(J){var q=aX.current;K6?J._currentValue=q:J._currentValue2=q,C(aX)}function O2(J,q,M){for(;J!==null;){var z=J.alternate;if((J.childLanes&q)!==q?(J.childLanes|=q,z!==null&&(z.childLanes|=q)):z!==null&&(z.childLanes&q)!==q&&(z.childLanes|=q),J===M)break;J=J.return}}function h2(J,q,M,z){var $=J.child;$!==null&&($.return=J);for(;$!==null;){var F=$.dependencies;if(F!==null){var w=$.child;F=F.firstContext;h:for(;F!==null;){var t=F;F=$;for(var B0=0;B0<q.length;B0++)if(t.context===q[B0]){F.lanes|=M,t=F.alternate,t!==null&&(t.lanes|=M),O2(F.return,M,J),z||(w=null);break h}F=t.next}}else if($.tag===18){if(w=$.return,w===null)throw Error(Y(341));w.lanes|=M,F=w.alternate,F!==null&&(F.lanes|=M),O2(w,M,J),w=null}else w=$.child;if(w!==null)w.return=$;else for(w=$;w!==null;){if(w===J){w=null;break}if($=w.sibling,$!==null){$.return=w.return,w=$;break}w=w.return}$=w}}function Z2(J,q,M,z){J=null;for(var $=q,F=!1;$!==null;){if(!F){if(($.flags&524288)!==0)F=!0;else if(($.flags&262144)!==0)break}if($.tag===10){var w=$.alternate;if(w===null)throw Error(Y(387));if(w=w.memoizedProps,w!==null){var t=$.type;E4($.pendingProps.value,w.value)||(J!==null?J.push(t):J=[t])}}else if($===dX.current){if(w=$.alternate,w===null)throw Error(Y(387));w.memoizedState.memoizedState!==$.memoizedState.memoizedState&&(J!==null?J.push(z7):J=[z7])}$=$.return}J!==null&&h2(q,J,M,z),q.flags|=262144}function Z1(J){for(J=J.firstContext;J!==null;){var q=J.context;if(!E4(K6?q._currentValue:q._currentValue2,J.memoizedValue))return!0;J=J.next}return!1}function W2(J){H7=J,J6=null,J=J.dependencies,J!==null&&(J.firstContext=null)}function v1(J){return d2(H7,J)}function B5(J,q){return H7===null&&W2(J),d2(J,q)}function d2(J,q){var M=K6?q._currentValue:q._currentValue2;if(q={context:q,memoizedValue:M,next:null},J6===null){if(J===null)throw Error(Y(308));J6=q,J.dependencies={lanes:0,firstContext:q},J.flags|=524288}else J6=J6.next=q;return M}function a2(){return{controller:new ST,data:new Map,refCount:0}}function M0(J){J.refCount--,J.refCount===0&&vT(xT,function(){J.controller.abort()})}function j0(){}function u0(J){J!==x9&&J.next===null&&(x9===null?tX=x9=J:x9=x9.next=J),sX=!0,$q||($q=!0,m1())}function s0(J,q){if(!Lq&&sX){Lq=!0;do{var M=!1;for(var z=tX;z!==null;){if(!q)if(J!==0){var $=z.pendingLanes;if($===0)var F=0;else{var{suspendedLanes:w,pingedLanes:t}=z;F=(1<<31-V4(42|J)+1)-1,F&=$&~(w&~t),F=F&201326741?F&201326741|1:F?F|2:0}F!==0&&(M=!0,x1(z,F))}else F=T1,F=S(z,z===G2?F:0,z.cancelPendingCommit!==null||z.timeoutHandle!==A7),(F&3)===0||R(z,F)||(M=!0,x1(z,F));z=z.next}}while(M);Lq=!1}}function A0(){t0()}function t0(){sX=$q=!1;var J=0;V7!==0&&KF()&&(J=V7);for(var q=r5(),M=null,z=tX;z!==null;){var $=z.next,F=I0(z,q);if(F===0)z.next=null,M===null?tX=$:M.next=$,$===null&&(x9=M);else if(M=z,J!==0||(F&3)!==0)sX=!0;z=$}s2!==0&&s2!==5||s0(J,!1),V7!==0&&(V7=0)}function I0(J,q){for(var{suspendedLanes:M,pingedLanes:z,expirationTimes:$}=J,F=J.pendingLanes&-62914561;0<F;){var w=31-V4(F),t=1<<w,B0=$[w];if(B0===-1){if((t&M)===0||(t&z)!==0)$[w]=v(t,q)}else B0<=q&&(J.expiredLanes|=t);F&=~t}if(q=G2,M=T1,M=S(J,J===q?M:0,J.cancelPendingCommit!==null||J.timeoutHandle!==A7),z=J.callbackNode,M===0||J===q&&(c1===2||c1===9)||J.cancelPendingCommit!==null)return z!==null&&z!==null&&Vq(z),J.callbackNode=null,J.callbackPriority=0;if((M&3)===0||R(J,M)){if(q=M&-M,q===J.callbackPriority)return q;switch(z!==null&&Vq(z),Q0(M)){case 2:case 8:M=jT;break;case 32:M=Uq;break;case 268435456:M=FT;break;default:M=Uq}return z=V1.bind(null,J),M=iX(M,z),J.callbackPriority=q,J.callbackNode=M,q}return z!==null&&z!==null&&Vq(z),J.callbackPriority=2,J.callbackNode=null,2}function V1(J,q){if(s2!==0&&s2!==5)return J.callbackNode=null,J.callbackPriority=0,null;var M=J.callbackNode;if(X6()&&J.callbackNode!==M)return null;var z=T1;if(z=S(J,J===G2?z:0,J.cancelPendingCommit!==null||J.timeoutHandle!==A7),z===0)return null;return d_(J,z,q),I0(J,r5()),J.callbackNode!=null&&J.callbackNode===M?V1.bind(null,J):null}function x1(J,q){if(X6())return null;d_(J,q,!0)}function m1(){BF?OF(function(){(L1&6)!==0?iX(lO,A0):t0()}):iX(lO,A0)}function w1(){if(V7===0){var J=w9;J===0&&(J=uX,uX<<=1,(uX&261888)===0&&(uX=256)),V7=J}return V7}function J2(J,q){if(hG===null){var M=hG=[];jq=0,w9=w1(),g9={status:"pending",value:void 0,then:function(z){M.push(z)}}}return jq++,q.then(R2,R2),q}function R2(){if(--jq===0&&hG!==null){g9!==null&&(g9.status="fulfilled");var J=hG;hG=null,w9=0,g9=null;for(var q=0;q<J.length;q++)(0,J[q])()}}function e4(J,q){var M=[],z={status:"pending",value:null,reason:null,then:function($){M.push($)}};return J.then(function(){z.status="fulfilled",z.value=q;for(var $=0;$<M.length;$++)(0,M[$])(q)},function($){z.status="rejected",z.reason=$;for($=0;$<M.length;$++)(0,M[$])(void 0)}),z}function f0(){var J=U7.current;return J!==null?J:G2.pooledCache}function l0(J,q){q===null?N(U7,U7.current):N(U7,q.pool)}function W0(){var J=f0();return J===null?null:{parent:K6?H2._currentValue:H2._currentValue2,pool:J}}function v0(J,q){if(E4(J,q))return!0;if(typeof J!=="object"||J===null||typeof q!=="object"||q===null)return!1;var M=Object.keys(J),z=Object.keys(q);if(M.length!==z.length)return!1;for(z=0;z<M.length;z++){var $=M[z];if(!RT.call(q,$)||!E4(J[$],q[$]))return!1}return!0}function X1(J){return J=J.status,J==="fulfilled"||J==="rejected"}function N1(J,q,M){switch(M=J[M],M===void 0?J.push(q):M!==q&&(q.then(j0,j0),q=M),q.status){case"fulfilled":return q.value;case"rejected":throw J=q.reason,e7(J),J;default:if(typeof q.status==="string")q.then(j0,j0);else{if(J=G2,J!==null&&100<J.shellSuspendCounter)throw Error(Y(482));J=q,J.status="pending",J.then(function(z){if(q.status==="pending"){var $=q;$.status="fulfilled",$.value=z}},function(z){if(q.status==="pending"){var $=q;$.status="rejected",$.reason=z}})}switch(q.status){case"fulfilled":return q.value;case"rejected":throw J=q.reason,e7(J),J}throw E7=q,I9}}function S2(J){try{var q=J._init;return q(J._payload)}catch(M){if(M!==null&&typeof M==="object"&&typeof M.then==="function")throw E7=M,I9;throw M}}function h3(){if(E7===null)throw Error(Y(459));var J=E7;return E7=null,J}function e7(J){if(J===I9||J===nX)throw Error(Y(483))}function h9(J){var q=_G;return _G+=1,P9===null&&(P9=[]),N1(P9,J,q)}function y8(J,q){q=q.props.ref,J.ref=q!==void 0?q:null}function _9(J,q){if(q.$$typeof===ij)throw Error(Y(525));throw J=Object.prototype.toString.call(q),Error(Y(31,J==="[object Object]"?"object with keys {"+Object.keys(q).join(", ")+"}":J))}function Q_(J){function q(K0,G0){if(J){var D0=K0.deletions;D0===null?(K0.deletions=[G0],K0.flags|=16):D0.push(G0)}}function M(K0,G0){if(!J)return null;for(;G0!==null;)q(K0,G0),G0=G0.sibling;return null}function z(K0){for(var G0=new Map;K0!==null;)K0.key!==null?G0.set(K0.key,K0):G0.set(K0.index,K0),K0=K0.sibling;return G0}function $(K0,G0){return K0=J0(K0,G0),K0.index=0,K0.sibling=null,K0}function F(K0,G0,D0){if(K0.index=D0,!J)return K0.flags|=1048576,G0;if(D0=K0.alternate,D0!==null)return D0=D0.index,D0<G0?(K0.flags|=67108866,G0):D0;return K0.flags|=67108866,G0}function w(K0){return J&&K0.alternate===null&&(K0.flags|=67108866),K0}function t(K0,G0,D0,S0){if(G0===null||G0.tag!==6)return G0=e0(D0,K0.mode,S0),G0.return=K0,G0;return G0=$(G0,D0),G0.return=K0,G0}function B0(K0,G0,D0,S0){var r0=D0.type;if(r0===j9)return b0(K0,G0,D0.props.children,S0,D0.key);if(G0!==null&&(G0.elementType===r0||typeof r0==="object"&&r0!==null&&r0.$$typeof===h8&&S2(r0)===G0.type))return G0=$(G0,D0.props),y8(G0,D0),G0.return=K0,G0;return G0=H0(D0.type,D0.key,D0.props,null,K0.mode,S0),y8(G0,D0),G0.return=K0,G0}function L0(K0,G0,D0,S0){if(G0===null||G0.tag!==4||G0.stateNode.containerInfo!==D0.containerInfo||G0.stateNode.implementation!==D0.implementation)return G0=z5(D0,K0.mode,S0),G0.return=K0,G0;return G0=$(G0,D0.children||[]),G0.return=K0,G0}function b0(K0,G0,D0,S0,r0){if(G0===null||G0.tag!==7)return G0=i0(D0,K0.mode,S0,r0),G0.return=K0,G0;return G0=$(G0,D0),G0.return=K0,G0}function R0(K0,G0,D0){if(typeof G0==="string"&&G0!==""||typeof G0==="number"||typeof G0==="bigint")return G0=e0(""+G0,K0.mode,D0),G0.return=K0,G0;if(typeof G0==="object"&&G0!==null){switch(G0.$$typeof){case mX:return D0=H0(G0.type,G0.key,G0.props,null,K0.mode,D0),y8(D0,G0),D0.return=K0,D0;case L9:return G0=z5(G0,K0.mode,D0),G0.return=K0,G0;case h8:return G0=S2(G0),R0(K0,G0,D0)}if(fX(G0)||O(G0))return G0=i0(G0,K0.mode,D0,null),G0.return=K0,G0;if(typeof G0.then==="function")return R0(K0,h9(G0),D0);if(G0.$$typeof===e6)return R0(K0,B5(K0,G0),D0);_9(K0,G0)}return null}function k0(K0,G0,D0,S0){var r0=G0!==null?G0.key:null;if(typeof D0==="string"&&D0!==""||typeof D0==="number"||typeof D0==="bigint")return r0!==null?null:t(K0,G0,""+D0,S0);if(typeof D0==="object"&&D0!==null){switch(D0.$$typeof){case mX:return D0.key===r0?B0(K0,G0,D0,S0):null;case L9:return D0.key===r0?L0(K0,G0,D0,S0):null;case h8:return D0=S2(D0),k0(K0,G0,D0,S0)}if(fX(D0)||O(D0))return r0!==null?null:b0(K0,G0,D0,S0,null);if(typeof D0.then==="function")return k0(K0,G0,h9(D0),S0);if(D0.$$typeof===e6)return k0(K0,G0,B5(K0,D0),S0);_9(K0,D0)}return null}function B1(K0,G0,D0,S0,r0){if(typeof S0==="string"&&S0!==""||typeof S0==="number"||typeof S0==="bigint")return K0=K0.get(D0)||null,t(G0,K0,""+S0,r0);if(typeof S0==="object"&&S0!==null){switch(S0.$$typeof){case mX:return K0=K0.get(S0.key===null?D0:S0.key)||null,B0(G0,K0,S0,r0);case L9:return K0=K0.get(S0.key===null?D0:S0.key)||null,L0(G0,K0,S0,r0);case h8:return S0=S2(S0),B1(K0,G0,D0,S0,r0)}if(fX(S0)||O(S0))return K0=K0.get(D0)||null,b0(G0,K0,S0,r0,null);if(typeof S0.then==="function")return B1(K0,G0,D0,h9(S0),r0);if(S0.$$typeof===e6)return B1(K0,G0,D0,B5(G0,S0),r0);_9(G0,S0)}return null}function U5(K0,G0,D0,S0){for(var r0=null,V2=null,G1=G0,g1=G0=0,Y5=null;G1!==null&&g1<D0.length;g1++){G1.index>g1?(Y5=G1,G1=null):Y5=G1.sibling;var I1=k0(K0,G1,D0[g1],S0);if(I1===null){G1===null&&(G1=Y5);break}J&&G1&&I1.alternate===null&&q(K0,G1),G0=F(I1,G0,g1),V2===null?r0=I1:V2.sibling=I1,V2=I1,G1=Y5}if(g1===D0.length)return M(K0,G1),R1&&E0(K0,g1),r0;if(G1===null){for(;g1<D0.length;g1++)G1=R0(K0,D0[g1],S0),G1!==null&&(G0=F(G1,G0,g1),V2===null?r0=G1:V2.sibling=G1,V2=G1);return R1&&E0(K0,g1),r0}for(G1=z(G1);g1<D0.length;g1++)Y5=B1(G1,K0,g1,D0[g1],S0),Y5!==null&&(J&&Y5.alternate!==null&&G1.delete(Y5.key===null?g1:Y5.key),G0=F(Y5,G0,g1),V2===null?r0=Y5:V2.sibling=Y5,V2=Y5);return J&&G1.forEach(function(Q8){return q(K0,Q8)}),R1&&E0(K0,g1),r0}function qG(K0,G0,D0,S0){if(D0==null)throw Error(Y(151));for(var r0=null,V2=null,G1=G0,g1=G0=0,Y5=null,I1=D0.next();G1!==null&&!I1.done;g1++,I1=D0.next()){G1.index>g1?(Y5=G1,G1=null):Y5=G1.sibling;var Q8=k0(K0,G1,I1.value,S0);if(Q8===null){G1===null&&(G1=Y5);break}J&&G1&&Q8.alternate===null&&q(K0,G1),G0=F(Q8,G0,g1),V2===null?r0=Q8:V2.sibling=Q8,V2=Q8,G1=Y5}if(I1.done)return M(K0,G1),R1&&E0(K0,g1),r0;if(G1===null){for(;!I1.done;g1++,I1=D0.next())I1=R0(K0,I1.value,S0),I1!==null&&(G0=F(I1,G0,g1),V2===null?r0=I1:V2.sibling=I1,V2=I1);return R1&&E0(K0,g1),r0}for(G1=z(G1);!I1.done;g1++,I1=D0.next())I1=B1(G1,K0,g1,I1.value,S0),I1!==null&&(J&&I1.alternate!==null&&G1.delete(I1.key===null?g1:I1.key),G0=F(I1,G0,g1),V2===null?r0=I1:V2.sibling=I1,V2=I1);return J&&G1.forEach(function(PT){return q(K0,PT)}),R1&&E0(K0,g1),r0}function L7(K0,G0,D0,S0){if(typeof D0==="object"&&D0!==null&&D0.type===j9&&D0.key===null&&(D0=D0.props.children),typeof D0==="object"&&D0!==null){switch(D0.$$typeof){case mX:h:{for(var r0=D0.key;G0!==null;){if(G0.key===r0){if(r0=D0.type,r0===j9){if(G0.tag===7){M(K0,G0.sibling),S0=$(G0,D0.props.children),S0.return=K0,K0=S0;break h}}else if(G0.elementType===r0||typeof r0==="object"&&r0!==null&&r0.$$typeof===h8&&S2(r0)===G0.type){M(K0,G0.sibling),S0=$(G0,D0.props),y8(S0,D0),S0.return=K0,K0=S0;break h}M(K0,G0);break}else q(K0,G0);G0=G0.sibling}D0.type===j9?(S0=i0(D0.props.children,K0.mode,S0,D0.key),S0.return=K0,K0=S0):(S0=H0(D0.type,D0.key,D0.props,null,K0.mode,S0),y8(S0,D0),S0.return=K0,K0=S0)}return w(K0);case L9:h:{for(r0=D0.key;G0!==null;){if(G0.key===r0)if(G0.tag===4&&G0.stateNode.containerInfo===D0.containerInfo&&G0.stateNode.implementation===D0.implementation){M(K0,G0.sibling),S0=$(G0,D0.children||[]),S0.return=K0,K0=S0;break h}else{M(K0,G0);break}else q(K0,G0);G0=G0.sibling}S0=z5(D0,K0.mode,S0),S0.return=K0,K0=S0}return w(K0);case h8:return D0=S2(D0),L7(K0,G0,D0,S0)}if(fX(D0))return U5(K0,G0,D0,S0);if(O(D0)){if(r0=O(D0),typeof r0!=="function")throw Error(Y(150));return D0=r0.call(D0),qG(K0,G0,D0,S0)}if(typeof D0.then==="function")return L7(K0,G0,h9(D0),S0);if(D0.$$typeof===e6)return L7(K0,G0,B5(K0,D0),S0);_9(K0,D0)}return typeof D0==="string"&&D0!==""||typeof D0==="number"||typeof D0==="bigint"?(D0=""+D0,G0!==null&&G0.tag===6?(M(K0,G0.sibling),S0=$(G0,D0),S0.return=K0,K0=S0):(M(K0,G0),S0=e0(D0,K0.mode,S0),S0.return=K0,K0=S0),w(K0)):M(K0,G0)}return function(K0,G0,D0,S0){try{_G=0;var r0=L7(K0,G0,D0,S0);return P9=null,r0}catch(G1){if(G1===I9||G1===nX)throw G1;var V2=_(29,G1,null,K0.mode);return V2.lanes=S0,V2.return=K0,V2}finally{}}}function x6(){for(var J=y9,q=Tq=y9=0;q<J;){var M=b4[q];b4[q++]=null;var z=b4[q];b4[q++]=null;var $=b4[q];b4[q++]=null;var F=b4[q];if(b4[q++]=null,z!==null&&$!==null){var w=z.pending;w===null?$.next=$:($.next=w.next,w.next=$),z.pending=$}F!==0&&fY(M,$,F)}}function c3(J,q,M,z){b4[y9++]=J,b4[y9++]=q,b4[y9++]=M,b4[y9++]=z,Tq|=z,J.lanes|=z,J=J.alternate,J!==null&&(J.lanes|=z)}function o2(J,q,M,z){return c3(J,q,M,z),a3(J)}function d3(J,q){return c3(J,null,null,q),a3(J)}function fY(J,q,M){J.lanes|=M;var z=J.alternate;z!==null&&(z.lanes|=M);for(var $=!1,F=J.return;F!==null;)F.childLanes|=M,z=F.alternate,z!==null&&(z.childLanes|=M),F.tag===22&&(J=F.stateNode,J===null||J._visibility&1||($=!0)),J=F,F=F.return;return J.tag===3?(F=J.stateNode,$&&q!==null&&($=31-V4(M),J=F.hiddenUpdates,z=J[$],z===null?J[$]=[q]:z.push(q),q.lane=M|536870912),F):null}function a3(J){if(50<JG)throw JG=0,mq=null,Error(Y(185));for(var q=J.return;q!==null;)J=q,q=J.return;return J.tag===3?J.stateNode:null}function B4(J){J.updateQueue={baseState:J.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function w6(J,q){J=J.updateQueue,q.updateQueue===J&&(q.updateQueue={baseState:J.baseState,firstBaseUpdate:J.firstBaseUpdate,lastBaseUpdate:J.lastBaseUpdate,shared:J.shared,callbacks:null})}function F1(J){return{lane:J,tag:0,payload:null,callback:null,next:null}}function O3(J,q,M){var z=J.updateQueue;if(z===null)return null;if(z=z.shared,(L1&2)!==0){var $=z.pending;return $===null?q.next=q:(q.next=$.next,$.next=q),z.pending=q,q=a3(J),fY(J,null,M),q}return c3(J,z,q,M),a3(J)}function A3(J,q,M){if(q=q.updateQueue,q!==null&&(q=q.shared,(M&4194048)!==0)){var z=q.lanes;z&=J.pendingLanes,M|=z,q.lanes=M,i(J,M)}}function g6(J,q){var{updateQueue:M,alternate:z}=J;if(z!==null&&(z=z.updateQueue,M===z)){var $=null,F=null;if(M=M.firstBaseUpdate,M!==null){do{var w={lane:M.lane,tag:M.tag,payload:M.payload,callback:null,next:null};F===null?$=F=w:F=F.next=w,M=M.next}while(M!==null);F===null?$=F=q:F=F.next=q}else $=F=q;M={baseState:z.baseState,firstBaseUpdate:$,lastBaseUpdate:F,shared:z.shared,callbacks:z.callbacks},J.updateQueue=M;return}J=M.lastBaseUpdate,J===null?M.firstBaseUpdate=q:J.next=q,M.lastBaseUpdate=q}function b8(){if(Wq){var J=g9;if(J!==null)throw J}}function O4(J,q,M,z){Wq=!1;var $=J.updateQueue;X8=!1;var{firstBaseUpdate:F,lastBaseUpdate:w}=$,t=$.shared.pending;if(t!==null){$.shared.pending=null;var B0=t,L0=B0.next;B0.next=null,w===null?F=L0:w.next=L0,w=B0;var b0=J.alternate;b0!==null&&(b0=b0.updateQueue,t=b0.lastBaseUpdate,t!==w&&(t===null?b0.firstBaseUpdate=L0:t.next=L0,b0.lastBaseUpdate=B0))}if(F!==null){var R0=$.baseState;w=0,b0=L0=B0=null,t=F;do{var k0=t.lane&-536870913,B1=k0!==t.lane;if(B1?(T1&k0)===k0:(z&k0)===k0){k0!==0&&k0===w9&&(Wq=!0),b0!==null&&(b0=b0.next={lane:0,tag:t.tag,payload:t.payload,callback:null,next:null});h:{var U5=J,qG=t;k0=q;var L7=M;switch(qG.tag){case 1:if(U5=qG.payload,typeof U5==="function"){R0=U5.call(L7,R0,k0);break h}R0=U5;break h;case 3:U5.flags=U5.flags&-65537|128;case 0:if(U5=qG.payload,k0=typeof U5==="function"?U5.call(L7,R0,k0):U5,k0===null||k0===void 0)break h;R0=y5({},R0,k0);break h;case 2:X8=!0}}k0=t.callback,k0!==null&&(J.flags|=64,B1&&(J.flags|=8192),B1=$.callbacks,B1===null?$.callbacks=[k0]:B1.push(k0))}else B1={lane:k0,tag:t.tag,payload:t.payload,callback:t.callback,next:null},b0===null?(L0=b0=B1,B0=R0):b0=b0.next=B1,w|=k0;if(t=t.next,t===null)if(t=$.shared.pending,t===null)break;else B1=t,t=B1.next,B1.next=null,$.lastBaseUpdate=B1,$.shared.pending=null}while(1);b0===null&&(B0=R0),$.baseState=B0,$.firstBaseUpdate=L0,$.lastBaseUpdate=b0,F===null&&($.shared.lanes=0),Z8|=w,J.lanes=w,J.memoizedState=R0}}function _2(J,q){if(typeof J!=="function")throw Error(Y(191,J));J.call(q)}function D_(J,q){var M=J.callbacks;if(M!==null)for(J.callbacks=null,J=0;J<M.length;J++)_2(M[J],q)}function m8(J,q){J=D6,N(rX,J),N(b9,q),D6=J|q.baseLanes}function M_(){N(rX,D6),N(b9,b9.current)}function B_(){D6=rX.current,C(b9),C(rX)}function z3(J){var q=J.alternate;N(w2,w2.current&1),N(C4,J),m4===null&&(q===null||b9.current!==null?m4=J:q.memoizedState!==null&&(m4=J))}function G9(J){N(w2,w2.current),N(C4,J),m4===null&&(m4=J)}function Y9(J){J.tag===22?(N(w2,w2.current),N(C4,J),m4===null&&(m4=J)):S4(J)}function S4(){N(w2,w2.current),N(C4,C4.current)}function F5(J){C(C4),m4===J&&(m4=null),C(w2)}function X9(J){for(var q=J;q!==null;){if(q.tag===13){var M=q.memoizedState;if(M!==null&&(M=M.dehydrated,M===null||Oq(M)||Aq(M)))return q}else if(q.tag===19&&(q.memoizedProps.revealOrder==="forwards"||q.memoizedProps.revealOrder==="backwards"||q.memoizedProps.revealOrder==="unstable_legacy-backwards"||q.memoizedProps.revealOrder==="together")){if((q.flags&128)!==0)return q}else if(q.child!==null){q.child.return=q,q=q.child;continue}if(q===J)break;for(;q.sibling===null;){if(q.return===null||q.return===J)return null;q=q.return}q.sibling.return=q.return,q=q.sibling}return null}function M2(){throw Error(Y(321))}function I6(J,q){if(q===null)return!1;for(var M=0;M<q.length&&M<J.length;M++)if(!E4(J[M],q[M]))return!1;return!0}function P6(J,q,M,z,$,F){return q6=F,z1=q,q.memoizedState=null,q.updateQueue=null,q.lanes=0,o0.H=J===null||J.memoizedState===null?sO:Rq,N7=!1,F=M(z,$),N7=!1,m9&&(F=y6(q,M,z,$)),O_(J),F}function O_(J){o0.H=YG;var q=o1!==null&&o1.next!==null;if(q6=0,m2=o1=z1=null,eX=!1,GG=0,f9=null,q)throw Error(Y(300));J===null||f2||(J=J.dependencies,J!==null&&Z1(J)&&(f2=!0))}function y6(J,q,M,z){z1=J;var $=0;do{if(m9&&(f9=null),GG=0,m9=!1,25<=$)throw Error(Y(301));if($+=1,m2=o1=null,J.updateQueue!=null){var F=J.updateQueue;F.lastEffect=null,F.events=null,F.stores=null,F.memoCache!=null&&(F.memoCache.index=0)}o0.H=nO,F=q(M,z)}while(m9);return F}function f8(){var J=o0.H,q=J.useState()[0];return q=typeof q.then==="function"?t5(q):q,J=J.useState()[0],(o1!==null?o1.memoizedState:null)!==J&&(z1.flags|=1024),q}function t3(){var J=hK!==0;return hK=0,J}function s3(J,q,M){q.updateQueue=J.updateQueue,q.flags&=-2053,J.lanes&=~M}function A_(J){if(eX){for(J=J.memoizedState;J!==null;){var q=J.queue;q!==null&&(q.pending=null),J=J.next}eX=!1}q6=0,m2=o1=z1=null,m9=!1,GG=hK=0,f9=null}function r2(){var J={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return m2===null?z1.memoizedState=m2=J:m2=m2.next=J,m2}function A2(){if(o1===null){var J=z1.alternate;J=J!==null?J.memoizedState:null}else J=o1.next;var q=m2===null?z1.memoizedState:m2.next;if(q!==null)m2=q,o1=J;else{if(J===null){if(z1.alternate===null)throw Error(Y(467));throw Error(Y(310))}o1=J,J={memoizedState:o1.memoizedState,baseState:o1.baseState,baseQueue:o1.baseQueue,queue:o1.queue,next:null},m2===null?z1.memoizedState=m2=J:m2=m2.next=J}return m2}function K9(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function t5(J){var q=GG;return GG+=1,f9===null&&(f9=[]),J=N1(f9,J,q),q=z1,(m2===null?q.memoizedState:m2.next)===null&&(q=q.alternate,o0.H=q===null||q.memoizedState===null?sO:Rq),J}function n3(J){if(J!==null&&typeof J==="object"){if(typeof J.then==="function")return t5(J);if(J.$$typeof===e6)return v1(J)}throw Error(Y(438,String(J)))}function z_(J){var q=null,M=z1.updateQueue;if(M!==null&&(q=M.memoCache),q==null){var z=z1.alternate;z!==null&&(z=z.updateQueue,z!==null&&(z=z.memoCache,z!=null&&(q={data:z.data.map(function($){return $.slice()}),index:0})))}if(q==null&&(q={data:[],index:0}),M===null&&(M=K9(),z1.updateQueue=M),M.memoCache=q,M=q.data[q.index],M===void 0)for(M=q.data[q.index]=Array(J),z=0;z<J;z++)M[z]=cj;return q.index++,M}function A4(J,q){return typeof q==="function"?q(J):q}function b6(J){var q=A2();return g5(q,o1,J)}function g5(J,q,M){var z=J.queue;if(z===null)throw Error(Y(311));z.lastRenderedReducer=M;var $=J.baseQueue,F=z.pending;if(F!==null){if($!==null){var w=$.next;$.next=F.next,F.next=w}q.baseQueue=$=F,z.pending=null}if(F=J.baseState,$===null)J.memoizedState=F;else{q=$.next;var t=w=null,B0=null,L0=q,b0=!1;do{var R0=L0.lane&-536870913;if(R0!==L0.lane?(T1&R0)===R0:(q6&R0)===R0){var k0=L0.revertLane;if(k0===0)B0!==null&&(B0=B0.next={lane:0,revertLane:0,gesture:null,action:L0.action,hasEagerState:L0.hasEagerState,eagerState:L0.eagerState,next:null}),R0===w9&&(b0=!0);else if((q6&k0)===k0){L0=L0.next,k0===w9&&(b0=!0);continue}else R0={lane:0,revertLane:L0.revertLane,gesture:null,action:L0.action,hasEagerState:L0.hasEagerState,eagerState:L0.eagerState,next:null},B0===null?(t=B0=R0,w=F):B0=B0.next=R0,z1.lanes|=k0,Z8|=k0;R0=L0.action,N7&&M(F,R0),F=L0.hasEagerState?L0.eagerState:M(F,R0)}else k0={lane:R0,revertLane:L0.revertLane,gesture:L0.gesture,action:L0.action,hasEagerState:L0.hasEagerState,eagerState:L0.eagerState,next:null},B0===null?(t=B0=k0,w=F):B0=B0.next=k0,z1.lanes|=R0,Z8|=R0;L0=L0.next}while(L0!==null&&L0!==q);if(B0===null?w=F:B0.next=t,!E4(F,J.memoizedState)&&(f2=!0,b0&&(M=g9,M!==null)))throw M;J.memoizedState=F,J.baseState=w,J.baseQueue=B0,z.lastRenderedState=F}return $===null&&(z.lanes=0),[J.memoizedState,z.dispatch]}function H_(J){var q=A2(),M=q.queue;if(M===null)throw Error(Y(311));M.lastRenderedReducer=J;var{dispatch:z,pending:$}=M,F=q.memoizedState;if($!==null){M.pending=null;var w=$=$.next;do F=J(F,w.action),w=w.next;while(w!==$);E4(F,q.memoizedState)||(f2=!0),q.memoizedState=F,q.baseQueue===null&&(q.baseState=F),M.lastRenderedState=F}return[F,z]}function k8(J,q,M){var z=z1,$=A2(),F=R1;if(F){if(M===void 0)throw Error(Y(407));M=M()}else M=q();var w=!E4((o1||$).memoizedState,M);if(w&&($.memoizedState=M,f2=!0),$=$.queue,J9(o3.bind(null,z,$,J),[J]),$.getSnapshot!==q||w||m2!==null&&m2.memoizedState.tag&1){if(z.flags|=2048,f6(9,{destroy:void 0},u8.bind(null,z,$,M,q),null),G2===null)throw Error(Y(349));F||(q6&127)!==0||m6(z,q,M)}return M}function m6(J,q,M){J.flags|=16384,J={getSnapshot:q,value:M},q=z1.updateQueue,q===null?(q=K9(),z1.updateQueue=q,q.stores=[J]):(M=q.stores,M===null?q.stores=[J]:M.push(J))}function u8(J,q,M,z){q.value=M,q.getSnapshot=z,Z9(q)&&V_(J)}function o3(J,q,M){return M(function(){Z9(q)&&V_(J)})}function Z9(J){var q=J.getSnapshot;J=J.value;try{var M=q();return!E4(J,M)}catch(z){return!0}}function V_(J){var q=d3(J,2);q!==null&&h5(q,J,2)}function p8(J){var q=r2();if(typeof J==="function"){var M=J;if(J=M(),N7){o(!0);try{M()}finally{o(!1)}}}return q.memoizedState=q.baseState=J,q.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:A4,lastRenderedState:J},q}function kY(J,q,M,z){return J.baseState=M,g5(J,o1,typeof z==="function"?z:A4)}function eJ(J,q,M,z,$){if(r3(J))throw Error(Y(485));if(J=q.action,J!==null){var F={payload:$,action:J,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){F.listeners.push(w)}};o0.T!==null?M(!0):F.isTransition=!1,z(F),M=q.pending,M===null?(F.next=q.pending=F,uY(q,F)):(F.next=M.next,q.pending=M.next=F)}}function uY(J,q){var{action:M,payload:z}=q,$=J.state;if(q.isTransition){var F=o0.T,w={};o0.T=w;try{var t=M($,z),B0=o0.S;B0!==null&&B0(w,t),l8(J,q,t)}catch(L0){E_(J,q,L0)}finally{F!==null&&w.types!==null&&(F.types=w.types),o0.T=F}}else try{F=M($,z),l8(J,q,F)}catch(L0){E_(J,q,L0)}}function l8(J,q,M){M!==null&&typeof M==="object"&&typeof M.then==="function"?M.then(function(z){U_(J,q,z)},function(z){return E_(J,q,z)}):U_(J,q,M)}function U_(J,q,M){q.status="fulfilled",q.value=M,C_(q),J.state=M,q=J.pending,q!==null&&(M=q.next,M===q?J.pending=null:(M=M.next,q.next=M,uY(J,M)))}function E_(J,q,M){var z=J.pending;if(J.pending=null,z!==null){z=z.next;do q.status="rejected",q.reason=M,C_(q),q=q.next;while(q!==z)}J.action=null}function C_(J){J=J.listeners;for(var q=0;q<J.length;q++)(0,J[q])()}function pY(J,q){return q}function N_(J,q){if(R1){var M=G2.formState;if(M!==null){h:{var z=z1;if(R1){if(z2){var $=mF(z2,y4);if($){z2=xO($),z=fF($);break h}}g0(z)}z=!1}z&&(q=M[0])}}M=r2(),M.memoizedState=M.baseState=q,z={pending:null,lanes:0,dispatch:null,lastRenderedReducer:pY,lastRenderedState:q},M.queue=z,M=r8.bind(null,z1,z),z.dispatch=M,z=p8(!1);var F=z4.bind(null,z1,!1,z.queue);return z=r2(),$={state:q,dispatch:null,action:J,pending:null},z.queue=$,M=eJ.bind(null,z1,$,F,M),$.dispatch=M,z.memoizedState=J,[q,M,!1]}function lY(J){var q=A2();return i8(q,o1,J)}function i8(J,q,M){if(q=g5(J,q,pY)[0],J=b6(A4)[0],typeof q==="object"&&q!==null&&typeof q.then==="function")try{var z=t5(q)}catch(w){if(w===I9)throw nX;throw w}else z=q;q=A2();var $=q.queue,F=$.dispatch;return M!==q.memoizedState&&(z1.flags|=2048,f6(9,{destroy:void 0},c8.bind(null,$,M),null)),[z,F,J]}function c8(J,q){J.action=q}function $_(J){var q=A2(),M=o1;if(M!==null)return i8(q,M,J);A2(),q=q.memoizedState,M=A2();var z=M.queue.dispatch;return M.memoizedState=J,[q,z,!1]}function f6(J,q,M,z){return J={tag:J,create:M,deps:z,inst:q,next:null},q=z1.updateQueue,q===null&&(q=K9(),z1.updateQueue=q),M=q.lastEffect,M===null?q.lastEffect=J.next=J:(z=M.next,M.next=J,J.next=z,q.lastEffect=J),J}function iY(){return A2().memoizedState}function d8(J,q,M,z){var $=r2();z1.flags|=J,$.memoizedState=f6(1|q,{destroy:void 0},M,z===void 0?null:z)}function a8(J,q,M,z){var $=A2();z=z===void 0?null:z;var F=$.memoizedState.inst;o1!==null&&z!==null&&I6(z,o1.memoizedState.deps)?$.memoizedState=f6(q,F,M,z):(z1.flags|=J,$.memoizedState=f6(1|q,F,M,z))}function cY(J,q){d8(8390656,8,J,q)}function J9(J,q){a8(2048,8,J,q)}function hq(J){z1.flags|=4;var q=z1.updateQueue;if(q===null)q=K9(),z1.updateQueue=q,q.events=[J];else{var M=q.events;M===null?q.events=[J]:M.push(J)}}function dY(J){var q=A2().memoizedState;return hq({ref:q,nextImpl:J}),function(){if((L1&2)!==0)throw Error(Y(440));return q.impl.apply(void 0,arguments)}}function aY(J,q){return a8(4,2,J,q)}function tY(J,q){return a8(4,4,J,q)}function sY(J,q){if(typeof q==="function"){J=J();var M=q(J);return function(){typeof M==="function"?M():q(null)}}if(q!==null&&q!==void 0)return J=J(),q.current=J,function(){q.current=null}}function nY(J,q,M){M=M!==null&&M!==void 0?M.concat([J]):null,a8(4,4,sY.bind(null,q,J),M)}function t8(){}function oY(J,q){var M=A2();q=q===void 0?null:q;var z=M.memoizedState;if(q!==null&&I6(q,z[1]))return z[0];return M.memoizedState=[J,q],J}function L_(J,q){var M=A2();q=q===void 0?null:q;var z=M.memoizedState;if(q!==null&&I6(q,z[1]))return z[0];if(z=J(),N7){o(!0);try{J()}finally{o(!1)}}return M.memoizedState=[z,q],z}function k6(J,q,M){if(M===void 0||(q6&1073741824)!==0&&(T1&261930)===0)return J.memoizedState=q;return J.memoizedState=M,J=c_(),z1.lanes|=J,Z8|=J,M}function rY(J,q,M,z){if(E4(M,q))return M;if(b9.current!==null)return J=k6(J,M,z),E4(J,q)||(f2=!0),J;if((q6&42)===0||(q6&1073741824)!==0&&(T1&261930)===0)return f2=!0,J.memoizedState=M;return J=c_(),z1.lanes|=J,Z8|=J,q}function eY(J,q,M,z,$){var F=Z6();_5(F!==0&&8>F?F:8);var w=o0.T,t={};o0.T=t,z4(J,!1,q,M);try{var B0=$(),L0=o0.S;if(L0!==null&&L0(t,B0),B0!==null&&typeof B0==="object"&&typeof B0.then==="function"){var b0=e4(B0,z);O5(J,q,b0,o5(J))}else O5(J,q,z,o5(J))}catch(R0){O5(J,q,{then:function(){},status:"rejected",reason:R0},o5())}finally{_5(F),w!==null&&t.types!==null&&(w.types=t.types),o0.T=w}}function hX(J){var q=J.memoizedState;if(q!==null)return q;q={memoizedState:F9,baseState:F9,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:A4,lastRenderedState:F9},next:null};var M={};return q.next={memoizedState:M,baseState:M,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:A4,lastRenderedState:M},next:null},J.memoizedState=q,J=J.alternate,J!==null&&(J.memoizedState=q),q}function j_(){return v1(z7)}function _X(){return A2().memoizedState}function s8(){return A2().memoizedState}function n8(J){for(var q=J.return;q!==null;){switch(q.tag){case 24:case 3:var M=o5();J=F1(M);var z=O3(q,J,M);z!==null&&(h5(z,q,M),A3(z,q,M)),q={cache:a2()},J.payload=q;return}q=q.return}}function o8(J,q,M){var z=o5();M={lane:z,revertLane:0,gesture:null,action:M,hasEagerState:!1,eagerState:null,next:null},r3(J)?F_(q,M):(M=o2(J,q,M,z),M!==null&&(h5(M,J,z),GX(M,q,z)))}function r8(J,q,M){var z=o5();O5(J,q,M,z)}function O5(J,q,M,z){var $={lane:z,revertLane:0,gesture:null,action:M,hasEagerState:!1,eagerState:null,next:null};if(r3(J))F_(q,$);else{var F=J.alternate;if(J.lanes===0&&(F===null||F.lanes===0)&&(F=q.lastRenderedReducer,F!==null))try{var w=q.lastRenderedState,t=F(w,M);if($.hasEagerState=!0,$.eagerState=t,E4(t,w))return c3(J,q,$,0),G2===null&&x6(),!1}catch(B0){}finally{}if(M=o2(J,q,$,z),M!==null)return h5(M,J,z),GX(M,q,z),!0}return!1}function z4(J,q,M,z){if(z={lane:2,revertLane:w1(),gesture:null,action:z,hasEagerState:!1,eagerState:null,next:null},r3(J)){if(q)throw Error(Y(479))}else q=o2(J,M,z,2),q!==null&&h5(q,J,2)}function r3(J){var q=J.alternate;return J===z1||q!==null&&q===z1}function F_(J,q){m9=eX=!0;var M=J.pending;M===null?q.next=q:(q.next=M.next,M.next=q),J.pending=q}function GX(J,q,M){if((M&4194048)!==0){var z=q.lanes;z&=J.pendingLanes,M|=z,q.lanes=M,i(J,M)}}function T_(J,q,M,z){q=J.memoizedState,M=M(z,q),M=M===null||M===void 0?q:y5({},q,M),J.memoizedState=M,J.lanes===0&&(J.updateQueue.baseState=M)}function YX(J,q,M,z,$,F,w){return J=J.stateNode,typeof J.shouldComponentUpdate==="function"?J.shouldComponentUpdate(z,F,w):q.prototype&&q.prototype.isPureReactComponent?!v0(M,z)||!v0($,F):!0}function XX(J,q,M,z){J=q.state,typeof q.componentWillReceiveProps==="function"&&q.componentWillReceiveProps(M,z),typeof q.UNSAFE_componentWillReceiveProps==="function"&&q.UNSAFE_componentWillReceiveProps(M,z),q.state!==J&&Sq.enqueueReplaceState(q,q.state,null)}function _3(J,q){var M=q;if("ref"in q){M={};for(var z in q)z!=="ref"&&(M[z]=q[z])}if(J=J.defaultProps){M===q&&(M=y5({},M));for(var $ in J)M[$]===void 0&&(M[$]=J[$])}return M}function u6(J,q){try{var M=J.onUncaughtError;M(q.value,{componentStack:q.stack})}catch(z){setTimeout(function(){throw z})}}function p6(J,q,M){try{var z=J.onCaughtError;z(M.value,{componentStack:M.stack,errorBoundary:q.tag===1?q.stateNode:null})}catch($){setTimeout(function(){throw $})}}function H3(J,q,M){return M=F1(M),M.tag=3,M.payload={element:null},M.callback=function(){u6(J,q)},M}function e8(J){return J=F1(J),J.tag=3,J}function V3(J,q,M,z){var $=M.type.getDerivedStateFromError;if(typeof $==="function"){var F=z.value;J.payload=function(){return $(F)},J.callback=function(){p6(q,M,z)}}var w=M.stateNode;w!==null&&typeof w.componentDidCatch==="function"&&(J.callback=function(){p6(q,M,z),typeof $!=="function"&&(J8===null?J8=new Set([this]):J8.add(this));var t=z.stack;this.componentDidCatch(z.value,{componentStack:t!==null?t:""})})}function _q(J,q,M,z,$){if(M.flags|=32768,z!==null&&typeof z==="object"&&typeof z.then==="function"){if(q=M.alternate,q!==null&&Z2(q,M,$,!0),M=C4.current,M!==null){switch(M.tag){case 31:case 13:return m4===null?B7():M.alternate===null&&L2===0&&(L2=3),M.flags&=-257,M.flags|=65536,M.lanes=$,z===oX?M.flags|=16384:(q=M.updateQueue,q===null?M.updateQueue=new Set([z]):q.add(z),E(J,z,$)),!1;case 22:return M.flags|=65536,z===oX?M.flags|=16384:(q=M.updateQueue,q===null?(q={transitions:null,markerInstances:null,retryQueue:new Set([z])},M.updateQueue=q):(M=q.retryQueue,M===null?q.retryQueue=new Set([z]):M.add(z)),E(J,z,$)),!1}throw Error(Y(435,M.tag))}return E(J,z,$),B7(),!1}if(R1)return q=C4.current,q!==null?((q.flags&65536)===0&&(q.flags|=256),q.flags|=65536,q.lanes=$,z!==Nq&&(J=Error(Y(422),{cause:z}),l1(X0(J,M)))):(z!==Nq&&(q=Error(Y(423),{cause:z}),l1(X0(q,M))),J=J.current.alternate,J.flags|=65536,$&=-$,J.lanes|=$,z=X0(z,M),$=H3(J.stateNode,z,$),g6(J,$),L2!==4&&(L2=2)),!1;var F=Error(Y(520),{cause:z});if(F=X0(F,M),KG===null?KG=[F]:KG.push(F),L2!==4&&(L2=2),q===null)return!0;z=X0(z,M),M=q;do{switch(M.tag){case 3:return M.flags|=65536,J=$&-$,M.lanes|=J,J=H3(M.stateNode,z,J),g6(M,J),!1;case 1:if(q=M.type,F=M.stateNode,(M.flags&128)===0&&(typeof q.getDerivedStateFromError==="function"||F!==null&&typeof F.componentDidCatch==="function"&&(J8===null||!J8.has(F))))return M.flags|=65536,$&=-$,M.lanes|=$,$=e8($),V3($,J,M,z),g6(M,$),!1}M=M.return}while(M!==null);return!1}function b2(J,q,M,z){q.child=J===null?tO(q,null,M,z):C7(q,J.child,M,z)}function W_(J,q,M,z,$){M=M.render;var F=q.ref;if("ref"in z){var w={};for(var t in z)t!=="ref"&&(w[t]=z[t])}else w=z;if(W2(q),z=P6(J,q,M,w,F,$),t=t3(),J!==null&&!f2)return s3(J,q,$),v4(J,q,$);return R1&&t&&N0(q),q.flags|=1,b2(J,q,z,$),q.child}function q9(J,q,M,z,$){if(J===null){var F=M.type;if(typeof F==="function"&&!e(F)&&F.defaultProps===void 0&&M.compare===null)return q.tag=15,q.type=F,KX(J,q,F,z,$);return J=H0(M.type,null,z,q,q.mode,$),J.ref=q.ref,J.return=q,q.child=J}if(F=J.child,!x_(J,$)){var w=F.memoizedProps;if(M=M.compare,M=M!==null?M:v0,M(w,z)&&J.ref===q.ref)return v4(J,q,$)}return q.flags|=1,J=J0(F,z),J.ref=q.ref,J.return=q,q.child=J}function KX(J,q,M,z,$){if(J!==null){var F=J.memoizedProps;if(v0(F,z)&&J.ref===q.ref)if(f2=!1,q.pendingProps=z=F,x_(J,$))(J.flags&131072)!==0&&(f2=!0);else return q.lanes=J.lanes,v4(J,q,$)}return B9(J,q,M,z,$)}function ZX(J,q,M,z){var $=z.children,F=J!==null?J.memoizedState:null;if(J===null&&q.stateNode===null&&(q.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),z.mode==="hidden"){if((q.flags&128)!==0){if(F=F!==null?F.baseLanes|M:M,J!==null){z=q.child=J.child;for($=0;z!==null;)$=$|z.lanes|z.childLanes,z=z.sibling;z=$&~F}else z=0,q.child=null;return _7(J,q,F,M,z)}if((M&536870912)!==0)q.memoizedState={baseLanes:0,cachePool:null},J!==null&&l0(q,F!==null?F.cachePool:null),F!==null?m8(q,F):M_(),Y9(q);else return z=q.lanes=536870912,_7(J,q,F!==null?F.baseLanes|M:M,M,z)}else F!==null?(l0(q,F.cachePool),m8(q,F),S4(q),q.memoizedState=null):(J!==null&&l0(q,null),M_(),S4(q));return b2(J,q,$,M),q.child}function h7(J,q){return J!==null&&J.tag===22||q.stateNode!==null||(q.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),q.sibling}function _7(J,q,M,z,$){var F=f0();return F=F===null?null:{parent:K6?H2._currentValue:H2._currentValue2,pool:F},q.memoizedState={baseLanes:M,cachePool:F},J!==null&&l0(q,null),M_(),Y9(q),J!==null&&Z2(J,q,z,!0),q.childLanes=$,null}function Q9(J,q){return q=K7({mode:q.mode,children:q.children},J.mode),q.ref=J.ref,J.child=q,q.return=J,q}function D9(J,q,M){return C7(q,J.child,null,M),J=Q9(q,q.pendingProps),J.flags|=2,F5(q),q.memoizedState=null,J}function Gq(J,q,M){var z=q.pendingProps,$=(q.flags&128)!==0;if(q.flags&=-129,J===null){if(R1){if(z.mode==="hidden")return J=Q9(q,z),q.lanes=536870912,h7(null,J);if(G9(q),(J=z2)?(J=tF(J,y4),J!==null&&(q.memoizedState={dehydrated:J,treeContext:_8!==null?{id:$3,overflow:L3}:null,retryLane:536870912,hydrationErrors:null},M=x2(J),M.return=q,q.child=M,V5=q,z2=null)):J=null,J===null)throw g0(q);return q.lanes=536870912,null}return Q9(q,z)}var F=J.memoizedState;if(F!==null){var w=F.dehydrated;if(G9(q),$)if(q.flags&256)q.flags&=-257,q=D9(J,q,M);else if(q.memoizedState!==null)q.child=J.child,q.flags|=128,q=null;else throw Error(Y(558));else if(f2||Z2(J,q,M,!1),$=(M&J.childLanes)!==0,f2||$){if(z=G2,z!==null&&(w=h0(z,M),w!==0&&w!==F.retryLane))throw F.retryLane=w,d3(J,w),h5(z,J,w),vq;B7(),q=D9(J,q,M)}else J=F.treeContext,R5&&(z2=lF(w),V5=q,R1=!0,Y8=null,y4=!1,J!==null&&k(q,J)),q=Q9(q,z),q.flags|=4096;return q}return J=J0(J.child,{mode:z.mode,children:z.children}),J.ref=q.ref,q.child=J,J.return=q,J}function M9(J,q){var M=q.ref;if(M===null)J!==null&&J.ref!==null&&(q.flags|=4194816);else{if(typeof M!=="function"&&typeof M!=="object")throw Error(Y(284));if(J===null||J.ref!==M)q.flags|=4194816}}function B9(J,q,M,z,$){if(W2(q),M=P6(J,q,M,z,void 0,$),z=t3(),J!==null&&!f2)return s3(J,q,$),v4(J,q,$);return R1&&z&&N0(q),q.flags|=1,b2(J,q,M,$),q.child}function G7(J,q,M,z,$,F){if(W2(q),q.updateQueue=null,M=y6(q,z,M,$),O_(J),z=t3(),J!==null&&!f2)return s3(J,q,F),v4(J,q,F);return R1&&z&&N0(q),q.flags|=1,b2(J,q,M,F),q.child}function JX(J,q,M,z,$){if(W2(q),q.stateNode===null){var F=R9,w=M.contextType;typeof w==="object"&&w!==null&&(F=v1(w)),F=new M(z,F),q.memoizedState=F.state!==null&&F.state!==void 0?F.state:null,F.updater=Sq,q.stateNode=F,F._reactInternals=q,F=q.stateNode,F.props=z,F.state=q.memoizedState,F.refs={},B4(q),w=M.contextType,F.context=typeof w==="object"&&w!==null?v1(w):R9,F.state=q.memoizedState,w=M.getDerivedStateFromProps,typeof w==="function"&&(T_(q,M,w,z),F.state=q.memoizedState),typeof M.getDerivedStateFromProps==="function"||typeof F.getSnapshotBeforeUpdate==="function"||typeof F.UNSAFE_componentWillMount!=="function"&&typeof F.componentWillMount!=="function"||(w=F.state,typeof F.componentWillMount==="function"&&F.componentWillMount(),typeof F.UNSAFE_componentWillMount==="function"&&F.UNSAFE_componentWillMount(),w!==F.state&&Sq.enqueueReplaceState(F,F.state,null),O4(q,z,F,$),b8(),F.state=q.memoizedState),typeof F.componentDidMount==="function"&&(q.flags|=4194308),z=!0}else if(J===null){F=q.stateNode;var t=q.memoizedProps,B0=_3(M,t);F.props=B0;var L0=F.context,b0=M.contextType;w=R9,typeof b0==="object"&&b0!==null&&(w=v1(b0));var R0=M.getDerivedStateFromProps;b0=typeof R0==="function"||typeof F.getSnapshotBeforeUpdate==="function",t=q.pendingProps!==t,b0||typeof F.UNSAFE_componentWillReceiveProps!=="function"&&typeof F.componentWillReceiveProps!=="function"||(t||L0!==w)&&XX(q,F,z,w),X8=!1;var k0=q.memoizedState;F.state=k0,O4(q,z,F,$),b8(),L0=q.memoizedState,t||k0!==L0||X8?(typeof R0==="function"&&(T_(q,M,R0,z),L0=q.memoizedState),(B0=X8||YX(q,M,B0,z,k0,L0,w))?(b0||typeof F.UNSAFE_componentWillMount!=="function"&&typeof F.componentWillMount!=="function"||(typeof F.componentWillMount==="function"&&F.componentWillMount(),typeof F.UNSAFE_componentWillMount==="function"&&F.UNSAFE_componentWillMount()),typeof F.componentDidMount==="function"&&(q.flags|=4194308)):(typeof F.componentDidMount==="function"&&(q.flags|=4194308),q.memoizedProps=z,q.memoizedState=L0),F.props=z,F.state=L0,F.context=w,z=B0):(typeof F.componentDidMount==="function"&&(q.flags|=4194308),z=!1)}else{F=q.stateNode,w6(J,q),w=q.memoizedProps,b0=_3(M,w),F.props=b0,R0=q.pendingProps,k0=F.context,L0=M.contextType,B0=R9,typeof L0==="object"&&L0!==null&&(B0=v1(L0)),t=M.getDerivedStateFromProps,(L0=typeof t==="function"||typeof F.getSnapshotBeforeUpdate==="function")||typeof F.UNSAFE_componentWillReceiveProps!=="function"&&typeof F.componentWillReceiveProps!=="function"||(w!==R0||k0!==B0)&&XX(q,F,z,B0),X8=!1,k0=q.memoizedState,F.state=k0,O4(q,z,F,$),b8();var B1=q.memoizedState;w!==R0||k0!==B1||X8||J!==null&&J.dependencies!==null&&Z1(J.dependencies)?(typeof t==="function"&&(T_(q,M,t,z),B1=q.memoizedState),(b0=X8||YX(q,M,b0,z,k0,B1,B0)||J!==null&&J.dependencies!==null&&Z1(J.dependencies))?(L0||typeof F.UNSAFE_componentWillUpdate!=="function"&&typeof F.componentWillUpdate!=="function"||(typeof F.componentWillUpdate==="function"&&F.componentWillUpdate(z,B1,B0),typeof F.UNSAFE_componentWillUpdate==="function"&&F.UNSAFE_componentWillUpdate(z,B1,B0)),typeof F.componentDidUpdate==="function"&&(q.flags|=4),typeof F.getSnapshotBeforeUpdate==="function"&&(q.flags|=1024)):(typeof F.componentDidUpdate!=="function"||w===J.memoizedProps&&k0===J.memoizedState||(q.flags|=4),typeof F.getSnapshotBeforeUpdate!=="function"||w===J.memoizedProps&&k0===J.memoizedState||(q.flags|=1024),q.memoizedProps=z,q.memoizedState=B1),F.props=z,F.state=B1,F.context=B0,z=b0):(typeof F.componentDidUpdate!=="function"||w===J.memoizedProps&&k0===J.memoizedState||(q.flags|=4),typeof F.getSnapshotBeforeUpdate!=="function"||w===J.memoizedProps&&k0===J.memoizedState||(q.flags|=1024),z=!1)}return F=z,M9(J,q),z=(q.flags&128)!==0,F||z?(F=q.stateNode,M=z&&typeof M.getDerivedStateFromError!=="function"?null:F.render(),q.flags|=1,J!==null&&z?(q.child=C7(q,J.child,null,$),q.child=C7(q,null,M,$)):b2(J,q,M,$),q.memoizedState=F.state,J=q.child):J=v4(J,q,$),J}function qX(J,q,M,z){return b1(),q.flags|=256,b2(J,q,M,z),q.child}function R_(J){return{baseLanes:J,cachePool:W0()}}function Y7(J,q,M){return J=J!==null?J.childLanes&~M:0,q&&(J|=$4),J}function QX(J,q,M){var z=q.pendingProps,$=!1,F=(q.flags&128)!==0,w;if((w=F)||(w=J!==null&&J.memoizedState===null?!1:(w2.current&2)!==0),w&&($=!0,q.flags&=-129),w=(q.flags&32)!==0,q.flags&=-33,J===null){if(R1){if($?z3(q):S4(q),(J=z2)?(J=sF(J,y4),J!==null&&(q.memoizedState={dehydrated:J,treeContext:_8!==null?{id:$3,overflow:L3}:null,retryLane:536870912,hydrationErrors:null},M=x2(J),M.return=q,q.child=M,V5=q,z2=null)):J=null,J===null)throw g0(q);return Aq(J)?q.lanes=32:q.lanes=536870912,null}var t=z.children;if(z=z.fallback,$)return S4(q),$=q.mode,t=K7({mode:"hidden",children:t},$),z=i0(z,$,M,null),t.return=q,z.return=q,t.sibling=z,q.child=t,z=q.child,z.memoizedState=R_(M),z.childLanes=Y7(J,w,M),q.memoizedState=xq,h7(null,z);return z3(q),X7(q,t)}var B0=J.memoizedState;if(B0!==null&&(t=B0.dehydrated,t!==null)){if(F)q.flags&256?(z3(q),q.flags&=-257,q=S_(J,q,M)):q.memoizedState!==null?(S4(q),q.child=J.child,q.flags|=128,q=null):(S4(q),t=z.fallback,$=q.mode,z=K7({mode:"visible",children:z.children},$),t=i0(t,$,M,null),t.flags|=2,z.return=q,t.return=q,z.sibling=t,q.child=z,C7(q,J.child,null,M),z=q.child,z.memoizedState=R_(M),z.childLanes=Y7(J,w,M),q.memoizedState=xq,q=h7(null,z));else if(z3(q),Aq(t))w=yF(t).digest,z=Error(Y(419)),z.stack="",z.digest=w,l1({value:z,source:null,stack:null}),q=S_(J,q,M);else if(f2||Z2(J,q,M,!1),w=(M&J.childLanes)!==0,f2||w){if(w=G2,w!==null&&(z=h0(w,M),z!==0&&z!==B0.retryLane))throw B0.retryLane=z,d3(J,z),h5(w,J,z),vq;Oq(t)||B7(),q=S_(J,q,M)}else Oq(t)?(q.flags|=192,q.child=J.child,q=null):(J=B0.treeContext,R5&&(z2=iF(t),V5=q,R1=!0,Y8=null,y4=!1,J!==null&&k(q,J)),q=X7(q,z.children),q.flags|=4096);return q}if($)return S4(q),t=z.fallback,$=q.mode,B0=J.child,F=B0.sibling,z=J0(B0,{mode:"hidden",children:z.children}),z.subtreeFlags=B0.subtreeFlags&65011712,F!==null?t=J0(F,t):(t=i0(t,$,M,null),t.flags|=2),t.return=q,z.return=q,z.sibling=t,q.child=z,h7(null,z),z=q.child,t=J.child.memoizedState,t===null?t=R_(M):($=t.cachePool,$!==null?(B0=K6?H2._currentValue:H2._currentValue2,$=$.parent!==B0?{parent:B0,pool:B0}:$):$=W0(),t={baseLanes:t.baseLanes|M,cachePool:$}),z.memoizedState=t,z.childLanes=Y7(J,w,M),q.memoizedState=xq,h7(J.child,z);return z3(q),M=J.child,J=M.sibling,M=J0(M,{mode:"visible",children:z.children}),M.return=q,M.sibling=null,J!==null&&(w=q.deletions,w===null?(q.deletions=[J],q.flags|=16):w.push(J)),q.child=M,q.memoizedState=null,M}function X7(J,q){return q=K7({mode:"visible",children:q},J.mode),q.return=J,J.child=q}function K7(J,q){return J=_(22,J,null,q),J.lanes=0,J}function S_(J,q,M){return C7(q,J.child,null,M),J=X7(q,q.pendingProps.children),J.flags|=2,q.memoizedState=null,J}function DX(J,q,M){J.lanes|=q;var z=J.alternate;z!==null&&(z.lanes|=q),O2(J.return,q,M)}function v_(J,q,M,z,$,F){var w=J.memoizedState;w===null?J.memoizedState={isBackwards:q,rendering:null,renderingStartTime:0,last:z,tail:M,tailMode:$,treeForkCount:F}:(w.isBackwards=q,w.rendering=null,w.renderingStartTime=0,w.last=z,w.tail=M,w.tailMode=$,w.treeForkCount=F)}function MX(J,q,M){var z=q.pendingProps,$=z.revealOrder,F=z.tail;z=z.children;var w=w2.current,t=(w&2)!==0;if(t?(w=w&1|2,q.flags|=128):w&=1,N(w2,w),b2(J,q,z,M),z=R1?r_:0,!t&&J!==null&&(J.flags&128)!==0)h:for(J=q.child;J!==null;){if(J.tag===13)J.memoizedState!==null&&DX(J,M,q);else if(J.tag===19)DX(J,M,q);else if(J.child!==null){J.child.return=J,J=J.child;continue}if(J===q)break h;for(;J.sibling===null;){if(J.return===null||J.return===q)break h;J=J.return}J.sibling.return=J.return,J=J.sibling}switch($){case"forwards":M=q.child;for($=null;M!==null;)J=M.alternate,J!==null&&X9(J)===null&&($=M),M=M.sibling;M=$,M===null?($=q.child,q.child=null):($=M.sibling,M.sibling=null),v_(q,!1,$,M,F,z);break;case"backwards":case"unstable_legacy-backwards":M=null,$=q.child;for(q.child=null;$!==null;){if(J=$.alternate,J!==null&&X9(J)===null){q.child=$;break}J=$.sibling,$.sibling=M,M=$,$=J}v_(q,!0,M,null,F,z);break;case"together":v_(q,!1,null,null,void 0,z);break;default:q.memoizedState=null}return q.child}function v4(J,q,M){if(J!==null&&(q.dependencies=J.dependencies),Z8|=q.lanes,(M&q.childLanes)===0)if(J!==null){if(Z2(J,q,M,!1),(M&q.childLanes)===0)return null}else return null;if(J!==null&&q.child!==J.child)throw Error(Y(153));if(q.child!==null){J=q.child,M=J0(J,J.pendingProps),q.child=M;for(M.return=q;J.sibling!==null;)J=J.sibling,M=M.sibling=J0(J,J.pendingProps),M.return=q;M.sibling=null}return q.child}function x_(J,q){if((J.lanes&q)!==0)return!0;return J=J.dependencies,J!==null&&Z1(J)?!0:!1}function BX(J,q,M){switch(q.tag){case 3:y0(q,q.stateNode.containerInfo),n1(q,H2,J.memoizedState.cache),b1();break;case 27:case 5:n0(q);break;case 4:y0(q,q.stateNode.containerInfo);break;case 10:n1(q,q.type,q.memoizedProps.value);break;case 31:if(q.memoizedState!==null)return q.flags|=128,G9(q),null;break;case 13:var z=q.memoizedState;if(z!==null){if(z.dehydrated!==null)return z3(q),q.flags|=128,null;if((M&q.child.childLanes)!==0)return QX(J,q,M);return z3(q),J=v4(J,q,M),J!==null?J.sibling:null}z3(q);break;case 19:var $=(J.flags&128)!==0;if(z=(M&q.childLanes)!==0,z||(Z2(J,q,M,!1),z=(M&q.childLanes)!==0),$){if(z)return MX(J,q,M);q.flags|=128}if($=q.memoizedState,$!==null&&($.rendering=null,$.tail=null,$.lastEffect=null),N(w2,w2.current),z)break;else return null;case 22:return q.lanes=0,ZX(J,q,M,q.pendingProps);case 24:n1(q,H2,J.memoizedState.cache)}return v4(J,q,M)}function OX(J,q,M){if(J!==null)if(J.memoizedProps!==q.pendingProps)f2=!0;else{if(!x_(J,M)&&(q.flags&128)===0)return f2=!1,BX(J,q,M);f2=(J.flags&131072)!==0?!0:!1}else f2=!1,R1&&(q.flags&1048576)!==0&&m(q,r_,q.index);switch(q.lanes=0,q.tag){case 16:h:{var z=q.pendingProps;if(J=S2(q.elementType),q.type=J,typeof J==="function")e(J)?(z=_3(J,z),q.tag=1,q=JX(null,q,J,z,M)):(q.tag=0,q=B9(null,q,J,z,M));else{if(J!==void 0&&J!==null){var $=J.$$typeof;if($===Zq){q.tag=11,q=W_(null,q,J,z,M);break h}else if($===Qq){q.tag=14,q=q9(null,q,J,z,M);break h}}throw q=A(J)||J,Error(Y(306,q,""))}}return q;case 0:return B9(J,q,q.type,q.pendingProps,M);case 1:return z=q.type,$=_3(z,q.pendingProps),JX(J,q,z,$,M);case 3:h:{if(y0(q,q.stateNode.containerInfo),J===null)throw Error(Y(387));var F=q.pendingProps;$=q.memoizedState,z=$.element,w6(J,q),O4(q,F,null,M);var w=q.memoizedState;if(F=w.cache,n1(q,H2,F),F!==$.cache&&h2(q,[H2],M,!0),b8(),F=w.element,R5&&$.isDehydrated)if($={element:F,isDehydrated:!1,cache:w.cache},q.updateQueue.baseState=$,q.memoizedState=$,q.flags&256){q=qX(J,q,F,M);break h}else if(F!==z){z=X0(Error(Y(424)),q),l1(z),q=qX(J,q,F,M);break h}else for(R5&&(z2=pF(q.stateNode.containerInfo),V5=q,R1=!0,Y8=null,y4=!0),M=tO(q,null,F,M),q.child=M;M;)M.flags=M.flags&-3|4096,M=M.sibling;else{if(b1(),F===z){q=v4(J,q,M);break h}b2(J,q,F,M)}q=q.child}return q;case 26:if(X3)return M9(J,q),J===null?(M=IO(q.type,null,q.pendingProps,null))?q.memoizedState=M:R1||(q.stateNode=zT(q.type,q.pendingProps,G8.current,q)):q.memoizedState=IO(q.type,J.memoizedProps,q.pendingProps,J.memoizedState),null;case 27:if(t2)return n0(q),J===null&&t2&&R1&&(z=q.stateNode=kO(q.type,q.pendingProps,G8.current,H5.current,!1),V5=q,y4=!0,z2=cF(q.type,z,z2)),b2(J,q,q.pendingProps.children,M),M9(J,q),J===null&&(q.flags|=4194304),q.child;case 5:if(J===null&&R1){if(BT(q.type,q.pendingProps,H5.current),$=z=z2)z=dF(z,q.type,q.pendingProps,y4),z!==null?(q.stateNode=z,V5=q,z2=uF(z),y4=!1,$=!0):$=!1;$||g0(q)}return n0(q),$=q.type,F=q.pendingProps,w=J!==null?J.memoizedProps:null,z=F.children,kX($,F)?z=null:w!==null&&kX($,w)&&(q.flags|=32),q.memoizedState!==null&&($=P6(J,q,f8,null,null,M),K6?z7._currentValue=$:z7._currentValue2=$),M9(J,q),b2(J,q,z,M),q.child;case 6:if(J===null&&R1){if(OT(q.pendingProps,H5.current),J=M=z2)M=aF(M,q.pendingProps,y4),M!==null?(q.stateNode=M,V5=q,z2=null,J=!0):J=!1;J||g0(q)}return null;case 13:return QX(J,q,M);case 4:return y0(q,q.stateNode.containerInfo),z=q.pendingProps,J===null?q.child=C7(q,null,z,M):b2(J,q,z,M),q.child;case 11:return W_(J,q,q.type,q.pendingProps,M);case 7:return b2(J,q,q.pendingProps,M),q.child;case 8:return b2(J,q,q.pendingProps.children,M),q.child;case 12:return b2(J,q,q.pendingProps.children,M),q.child;case 10:return z=q.pendingProps,n1(q,q.type,z.value),b2(J,q,z.children,M),q.child;case 9:return $=q.type._context,z=q.pendingProps.children,W2(q),$=v1($),z=z($),q.flags|=1,b2(J,q,z,M),q.child;case 14:return q9(J,q,q.type,q.pendingProps,M);case 15:return KX(J,q,q.type,q.pendingProps,M);case 19:return MX(J,q,M);case 31:return Gq(J,q,M);case 22:return ZX(J,q,M,q.pendingProps);case 24:return W2(q),z=v1(H2),J===null?($=f0(),$===null&&($=G2,F=a2(),$.pooledCache=F,F.refCount++,F!==null&&($.pooledCacheLanes|=M),$=F),q.memoizedState={parent:z,cache:$},B4(q),n1(q,H2,$)):((J.lanes&M)!==0&&(w6(J,q),O4(q,null,null,M),b8()),$=J.memoizedState,F=q.memoizedState,$.parent!==z?($={parent:z,cache:z},q.memoizedState=$,q.lanes===0&&(q.memoizedState=q.updateQueue.baseState=$),n1(q,H2,z)):(z=F.cache,n1(q,H2,z),z!==$.cache&&h2(q,[H2],M,!0))),b2(J,q,q.pendingProps.children,M),q.child;case 29:throw q.pendingProps}throw Error(Y(156,q.tag))}function s5(J){J.flags|=4}function v2(J){N3&&(J.flags|=8)}function O9(J,q){if(J!==null&&J.child===q.child)return!1;if((q.flags&16)!==0)return!0;for(J=q.child;J!==null;){if((J.flags&8218)!==0||(J.subtreeFlags&8218)!==0)return!0;J=J.sibling}return!1}function T5(J,q,M,z){if(W5)for(M=q.child;M!==null;){if(M.tag===5||M.tag===6)Mq(J,M.stateNode);else if(!(M.tag===4||t2&&M.tag===27)&&M.child!==null){M.child.return=M,M=M.child;continue}if(M===q)break;for(;M.sibling===null;){if(M.return===null||M.return===q)return;M=M.return}M.sibling.return=M.return,M=M.sibling}else if(N3)for(var $=q.child;$!==null;){if($.tag===5){var F=$.stateNode;M&&z&&(F=SO(F,$.type,$.memoizedProps)),Mq(J,F)}else if($.tag===6)F=$.stateNode,M&&z&&(F=vO(F,$.memoizedProps)),Mq(J,F);else if($.tag!==4){if($.tag===22&&$.memoizedState!==null)F=$.child,F!==null&&(F.return=$),T5(J,$,!0,!0);else if($.child!==null){$.child.return=$,$=$.child;continue}}if($===q)break;for(;$.sibling===null;){if($.return===null||$.return===q)return;$=$.return}$.sibling.return=$.return,$=$.sibling}}function l6(J,q,M,z){var $=!1;if(N3)for(var F=q.child;F!==null;){if(F.tag===5){var w=F.stateNode;M&&z&&(w=SO(w,F.type,F.memoizedProps)),WO(J,w)}else if(F.tag===6)w=F.stateNode,M&&z&&(w=vO(w,F.memoizedProps)),WO(J,w);else if(F.tag!==4){if(F.tag===22&&F.memoizedState!==null)$=F.child,$!==null&&($.return=F),l6(J,F,!0,!0),$=!0;else if(F.child!==null){F.child.return=F,F=F.child;continue}}if(F===q)break;for(;F.sibling===null;){if(F.return===null||F.return===q)return $;F=F.return}F.sibling.return=F.return,F=F.sibling}return $}function AX(J,q){if(N3&&O9(J,q)){J=q.stateNode;var M=J.containerInfo,z=TO();l6(z,q,!1,!1),J.pendingChildren=z,s5(q),PF(M,z)}}function w_(J,q,M,z){if(W5)J.memoizedProps!==z&&s5(q);else if(N3){var{stateNode:$,memoizedProps:F}=J;if((J=O9(J,q))||F!==z){var w=H5.current;F=IF($,M,F,z,!J,null),F===$?q.stateNode=$:(v2(q),NO(F,M,z,w)&&s5(q),q.stateNode=F,J&&T5(F,q,!1,!1))}else q.stateNode=$}}function x4(J,q,M,z,$){if((J.mode&32)!==0&&(M===null?JF(q,z):qF(q,M,z))){if(J.flags|=16777216,($&335544128)===$||Bq(q,z))if(LO(J.stateNode,q,z))J.flags|=8192;else if(N9())J.flags|=8192;else throw E7=oX,Fq}else J.flags&=-16777217}function g_(J,q){if(VT(q)){if(J.flags|=16777216,!fO(q))if(N9())J.flags|=8192;else throw E7=oX,Fq}else J.flags&=-16777217}function A9(J,q){q!==null&&(J.flags|=4),J.flags&16384&&(q=J.tag!==22?x():536870912,J.lanes|=q,p9|=q)}function Z7(J,q){if(!R1)switch(J.tailMode){case"hidden":q=J.tail;for(var M=null;q!==null;)q.alternate!==null&&(M=q),q=q.sibling;M===null?J.tail=null:M.sibling=null;break;case"collapsed":M=J.tail;for(var z=null;M!==null;)M.alternate!==null&&(z=M),M=M.sibling;z===null?q||J.tail===null?J.tail=null:J.tail.sibling=null:z.sibling=null}}function f1(J){var q=J.alternate!==null&&J.alternate.child===J.child,M=0,z=0;if(q)for(var $=J.child;$!==null;)M|=$.lanes|$.childLanes,z|=$.subtreeFlags&65011712,z|=$.flags&65011712,$.return=J,$=$.sibling;else for($=J.child;$!==null;)M|=$.lanes|$.childLanes,z|=$.subtreeFlags,z|=$.flags,$.return=J,$=$.sibling;return J.subtreeFlags|=z,J.childLanes=M,q}function Yq(J,q,M){var z=q.pendingProps;switch(x0(q),q.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return f1(q),null;case 1:return f1(q),null;case 3:if(M=q.stateNode,z=null,J!==null&&(z=J.memoizedState.cache),q.memoizedState.cache!==z&&(q.flags|=2048),y2(H2),a0(),M.pendingContext&&(M.context=M.pendingContext,M.pendingContext=null),J===null||J.child===null)D1(q)?s5(q):J===null||J.memoizedState.isDehydrated&&(q.flags&256)===0||(q.flags|=1024,_1());return AX(J,q),f1(q),null;case 26:if(X3){var{type:$,memoizedState:F}=q;return J===null?(s5(q),F!==null?(f1(q),g_(q,F)):(f1(q),x4(q,$,null,z,M))):F?F!==J.memoizedState?(s5(q),f1(q),g_(q,F)):(f1(q),q.flags&=-16777217):(F=J.memoizedProps,W5?F!==z&&s5(q):w_(J,q,$,z),f1(q),x4(q,$,F,z,M)),null}case 27:if(t2){if(w0(q),M=G8.current,$=q.type,J!==null&&q.stateNode!=null)W5?J.memoizedProps!==z&&s5(q):w_(J,q,$,z);else{if(!z){if(q.stateNode===null)throw Error(Y(166));return f1(q),null}J=H5.current,D1(q)?Q1(q,J):(J=kO($,z,M,J,!0),q.stateNode=J,s5(q))}return f1(q),null}case 5:if(w0(q),$=q.type,J!==null&&q.stateNode!=null)w_(J,q,$,z);else{if(!z){if(q.stateNode===null)throw Error(Y(166));return f1(q),null}if(F=H5.current,D1(q))Q1(q,F),ZT(q.stateNode,$,z,F)&&(q.flags|=64);else{var w=ej($,z,G8.current,F,q);v2(q),T5(w,q,!1,!1),q.stateNode=w,NO(w,$,z,F)&&s5(q)}}return f1(q),x4(q,q.type,J===null?null:J.memoizedProps,q.pendingProps,M),null;case 6:if(J&&q.stateNode!=null)M=J.memoizedProps,W5?M!==z&&s5(q):N3&&(M!==z?(J=G8.current,M=H5.current,v2(q),q.stateNode=$O(z,J,M,q)):q.stateNode=J.stateNode);else{if(typeof z!=="string"&&q.stateNode===null)throw Error(Y(166));if(J=G8.current,M=H5.current,D1(q)){if(!R5)throw Error(Y(176));if(J=q.stateNode,M=q.memoizedProps,z=null,$=V5,$!==null)switch($.tag){case 27:case 5:z=$.memoizedProps}oF(J,M,q,z)||g0(q,!0)}else v2(q),q.stateNode=$O(z,J,M,q)}return f1(q),null;case 31:if(M=q.memoizedState,J===null||J.memoizedState!==null){if(z=D1(q),M!==null){if(J===null){if(!z)throw Error(Y(318));if(!R5)throw Error(Y(556));if(J=q.memoizedState,J=J!==null?J.dehydrated:null,!J)throw Error(Y(557));rF(J,q)}else b1(),(q.flags&128)===0&&(q.memoizedState=null),q.flags|=4;f1(q),J=!1}else M=_1(),J!==null&&J.memoizedState!==null&&(J.memoizedState.hydrationErrors=M),J=!0;if(!J){if(q.flags&256)return F5(q),q;return F5(q),null}if((q.flags&128)!==0)throw Error(Y(558))}return f1(q),null;case 13:if(z=q.memoizedState,J===null||J.memoizedState!==null&&J.memoizedState.dehydrated!==null){if($=D1(q),z!==null&&z.dehydrated!==null){if(J===null){if(!$)throw Error(Y(318));if(!R5)throw Error(Y(344));if($=q.memoizedState,$=$!==null?$.dehydrated:null,!$)throw Error(Y(317));eF($,q)}else b1(),(q.flags&128)===0&&(q.memoizedState=null),q.flags|=4;f1(q),$=!1}else $=_1(),J!==null&&J.memoizedState!==null&&(J.memoizedState.hydrationErrors=$),$=!0;if(!$){if(q.flags&256)return F5(q),q;return F5(q),null}}if(F5(q),(q.flags&128)!==0)return q.lanes=M,q;return M=z!==null,J=J!==null&&J.memoizedState!==null,M&&(z=q.child,$=null,z.alternate!==null&&z.alternate.memoizedState!==null&&z.alternate.memoizedState.cachePool!==null&&($=z.alternate.memoizedState.cachePool.pool),F=null,z.memoizedState!==null&&z.memoizedState.cachePool!==null&&(F=z.memoizedState.cachePool.pool),F!==$&&(z.flags|=2048)),M!==J&&M&&(q.child.flags|=8192),A9(q,q.updateQueue),f1(q),null;case 4:return a0(),AX(J,q),J===null&&YF(q.stateNode.containerInfo),f1(q),null;case 10:return y2(q.type),f1(q),null;case 19:if(C(w2),z=q.memoizedState,z===null)return f1(q),null;if($=(q.flags&128)!==0,F=z.rendering,F===null)if($)Z7(z,!1);else{if(L2!==0||J!==null&&(J.flags&128)!==0)for(J=q.child;J!==null;){if(F=X9(J),F!==null){q.flags|=128,Z7(z,!1),J=F.updateQueue,q.updateQueue=J,A9(q,J),q.subtreeFlags=0,J=M;for(M=q.child;M!==null;)P0(M,J),M=M.sibling;return N(w2,w2.current&1|2),R1&&E0(q,z.treeForkCount),q.child}J=J.sibling}z.tail!==null&&r5()>ZG&&(q.flags|=128,$=!0,Z7(z,!1),q.lanes=4194304)}else{if(!$)if(J=X9(F),J!==null){if(q.flags|=128,$=!0,J=J.updateQueue,q.updateQueue=J,A9(q,J),Z7(z,!0),z.tail===null&&z.tailMode==="hidden"&&!F.alternate&&!R1)return f1(q),null}else 2*r5()-z.renderingStartTime>ZG&&M!==536870912&&(q.flags|=128,$=!0,Z7(z,!1),q.lanes=4194304);z.isBackwards?(F.sibling=q.child,q.child=F):(J=z.last,J!==null?J.sibling=F:q.child=F,z.last=F)}if(z.tail!==null)return J=z.tail,z.rendering=J,z.tail=J.sibling,z.renderingStartTime=r5(),J.sibling=null,M=w2.current,N(w2,$?M&1|2:M&1),R1&&E0(q,z.treeForkCount),J;return f1(q),null;case 22:case 23:return F5(q),B_(),z=q.memoizedState!==null,J!==null?J.memoizedState!==null!==z&&(q.flags|=8192):z&&(q.flags|=8192),z?(M&536870912)!==0&&(q.flags&128)===0&&(f1(q),q.subtreeFlags&6&&(q.flags|=8192)):f1(q),M=q.updateQueue,M!==null&&A9(q,M.retryQueue),M=null,J!==null&&J.memoizedState!==null&&J.memoizedState.cachePool!==null&&(M=J.memoizedState.cachePool.pool),z=null,q.memoizedState!==null&&q.memoizedState.cachePool!==null&&(z=q.memoizedState.cachePool.pool),z!==M&&(q.flags|=2048),J!==null&&C(U7),null;case 24:return M=null,J!==null&&(M=J.memoizedState.cache),q.memoizedState.cache!==M&&(q.flags|=2048),y2(H2),f1(q),null;case 25:return null;case 30:return null}throw Error(Y(156,q.tag))}function Xq(J,q){switch(x0(q),q.tag){case 1:return J=q.flags,J&65536?(q.flags=J&-65537|128,q):null;case 3:return y2(H2),a0(),J=q.flags,(J&65536)!==0&&(J&128)===0?(q.flags=J&-65537|128,q):null;case 26:case 27:case 5:return w0(q),null;case 31:if(q.memoizedState!==null){if(F5(q),q.alternate===null)throw Error(Y(340));b1()}return J=q.flags,J&65536?(q.flags=J&-65537|128,q):null;case 13:if(F5(q),J=q.memoizedState,J!==null&&J.dehydrated!==null){if(q.alternate===null)throw Error(Y(340));b1()}return J=q.flags,J&65536?(q.flags=J&-65537|128,q):null;case 19:return C(w2),null;case 4:return a0(),null;case 10:return y2(q.type),null;case 22:case 23:return F5(q),B_(),J!==null&&C(U7),J=q.flags,J&65536?(q.flags=J&-65537|128,q):null;case 24:return y2(H2),null;case 25:return null;default:return null}}function zX(J,q){switch(x0(q),q.tag){case 3:y2(H2),a0();break;case 26:case 27:case 5:w0(q);break;case 4:a0();break;case 31:q.memoizedState!==null&&F5(q);break;case 13:F5(q);break;case 19:C(w2);break;case 10:y2(q.type);break;case 22:case 23:F5(q),B_(),J!==null&&C(U7);break;case 24:y2(H2)}}function J7(J,q){try{var M=q.updateQueue,z=M!==null?M.lastEffect:null;if(z!==null){var $=z.next;M=$;do{if((M.tag&J)===J){z=void 0;var{create:F,inst:w}=M;z=F(),w.destroy=z}M=M.next}while(M!==$)}}catch(t){U(q,q.return,t)}}function G3(J,q,M){try{var z=q.updateQueue,$=z!==null?z.lastEffect:null;if($!==null){var F=$.next;z=F;do{if((z.tag&J)===J){var w=z.inst,t=w.destroy;if(t!==void 0){w.destroy=void 0,$=q;var B0=M,L0=t;try{L0()}catch(b0){U($,B0,b0)}}}z=z.next}while(z!==F)}}catch(b0){U(q,q.return,b0)}}function HX(J){var q=J.updateQueue;if(q!==null){var M=J.stateNode;try{D_(q,M)}catch(z){U(J,J.return,z)}}}function i6(J,q,M){M.props=_3(J.type,J.memoizedProps),M.state=J.memoizedState;try{M.componentWillUnmount()}catch(z){U(J,q,z)}}function c6(J,q){try{var M=J.ref;if(M!==null){switch(J.tag){case 26:case 27:case 5:var z=t_(J.stateNode);break;case 30:z=J.stateNode;break;default:z=J.stateNode}typeof M==="function"?J.refCleanup=M(z):M.current=z}}catch($){U(J,q,$)}}function I5(J,q){var{ref:M,refCleanup:z}=J;if(M!==null)if(typeof z==="function")try{z()}catch($){U(J,q,$)}finally{J.refCleanup=null,J=J.alternate,J!=null&&(J.refCleanup=null)}else if(typeof M==="function")try{M(null)}catch($){U(J,q,$)}else M.current=null}function d6(J){var{type:q,memoizedProps:M,stateNode:z}=J;try{LF(z,q,M,J)}catch($){U(J,J.return,$)}}function q2(J,q,M){try{jF(J.stateNode,J.type,M,q,J)}catch(z){U(J,J.return,z)}}function e3(J){return J.tag===5||J.tag===3||(X3?J.tag===26:!1)||(t2?J.tag===27&&T9(J.type):!1)||J.tag===4}function q7(J){h:for(;;){for(;J.sibling===null;){if(J.return===null||e3(J.return))return null;J=J.return}J.sibling.return=J.return;for(J=J.sibling;J.tag!==5&&J.tag!==6&&J.tag!==18;){if(t2&&J.tag===27&&T9(J.type))continue h;if(J.flags&2)continue h;if(J.child===null||J.tag===4)continue h;else J.child.return=J,J=J.child}if(!(J.flags&2))return J.stateNode}}function I_(J,q,M){var z=J.tag;if(z===5||z===6)J=J.stateNode,q?TF(M,J,q):NF(M,J);else if(z!==4&&(t2&&z===27&&T9(J.type)&&(M=J.stateNode,q=null),J=J.child,J!==null))for(I_(J,q,M),J=J.sibling;J!==null;)I_(J,q,M),J=J.sibling}function z9(J,q,M){var z=J.tag;if(z===5||z===6)J=J.stateNode,q?FF(M,J,q):CF(M,J);else if(z!==4&&(t2&&z===27&&T9(J.type)&&(M=J.stateNode),J=J.child,J!==null))for(z9(J,q,M),J=J.sibling;J!==null;)z9(J,q,M),J=J.sibling}function VX(J,q,M){J=J.containerInfo;try{RO(J,M)}catch(z){U(q,q.return,z)}}function UX(J){var{stateNode:q,memoizedProps:M}=J;try{ET(J.type,M,q,J)}catch(z){U(J,J.return,z)}}function EX(J,q){oj(J.containerInfo);for(G5=q;G5!==null;)if(J=G5,q=J.child,(J.subtreeFlags&1028)!==0&&q!==null)q.return=J,G5=q;else for(;G5!==null;){J=G5;var M=J.alternate;switch(q=J.flags,J.tag){case 0:if((q&4)!==0&&(q=J.updateQueue,q=q!==null?q.events:null,q!==null))for(var z=0;z<q.length;z++){var $=q[z];$.ref.impl=$.nextImpl}break;case 11:case 15:break;case 1:if((q&1024)!==0&&M!==null){q=void 0,z=J,$=M.memoizedProps,M=M.memoizedState;var F=z.stateNode;try{var w=_3(z.type,$);q=F.getSnapshotBeforeUpdate(w,M),F.__reactInternalSnapshotBeforeUpdate=q}catch(t){U(z,z.return,t)}}break;case 3:(q&1024)!==0&&W5&&gF(J.stateNode.containerInfo);break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((q&1024)!==0)throw Error(Y(163))}if(q=J.sibling,q!==null){q.return=J.return,G5=q;break}G5=J.return}}function P_(J,q,M){var z=M.flags;switch(M.tag){case 0:case 11:case 15:Y3(J,M),z&4&&J7(5,M);break;case 1:if(Y3(J,M),z&4)if(J=M.stateNode,q===null)try{J.componentDidMount()}catch(w){U(M,M.return,w)}else{var $=_3(M.type,q.memoizedProps);q=q.memoizedState;try{J.componentDidUpdate($,q,J.__reactInternalSnapshotBeforeUpdate)}catch(w){U(M,M.return,w)}}z&64&&HX(M),z&512&&c6(M,M.return);break;case 3:if(Y3(J,M),z&64&&(z=M.updateQueue,z!==null)){if(J=null,M.child!==null)switch(M.child.tag){case 27:case 5:J=t_(M.child.stateNode);break;case 1:J=M.child.stateNode}try{D_(z,J)}catch(w){U(M,M.return,w)}}break;case 27:t2&&q===null&&z&4&&UX(M);case 26:case 5:if(Y3(J,M),q===null){if(z&4)d6(M);else if(z&64){J=M.type,q=M.memoizedProps,$=M.stateNode;try{GT($,J,q,M)}catch(w){U(M,M.return,w)}}}z&512&&c6(M,M.return);break;case 12:Y3(J,M);break;case 31:Y3(J,M),z&4&&V9(J,M);break;case 13:Y3(J,M),z&4&&b_(J,M),z&64&&(z=M.memoizedState,z!==null&&(z=z.dehydrated,z!==null&&(M=g.bind(null,M),bF(z,M))));break;case 22:if(z=M.memoizedState!==null||Q6,!z){q=q!==null&&q.memoizedState!==null||k2,$=Q6;var F=k2;Q6=z,(k2=q)&&!F?w4(J,M,(M.subtreeFlags&8772)!==0):Y3(J,M),Q6=$,k2=F}break;case 30:break;default:Y3(J,M)}}function y_(J){var q=J.alternate;q!==null&&(J.alternate=null,y_(q)),J.child=null,J.deletions=null,J.sibling=null,J.tag===5&&(q=J.stateNode,q!==null&&ZF(q)),J.stateNode=null,J.return=null,J.dependencies=null,J.memoizedProps=null,J.memoizedState=null,J.pendingProps=null,J.stateNode=null,J.updateQueue=null}function n5(J,q,M){for(M=M.child;M!==null;)H9(J,q,M),M=M.sibling}function H9(J,q,M){if(U4&&typeof U4.onCommitFiberUnmount==="function")try{U4.onCommitFiberUnmount(o_,M)}catch(F){}switch(M.tag){case 26:if(X3){k2||I5(M,q),n5(J,q,M),M.memoizedState?yO(M.memoizedState):M.stateNode&&mO(M.stateNode);break}case 27:if(t2){k2||I5(M,q);var z=u2,$=e5;T9(M.type)&&(u2=M.stateNode,e5=!1),n5(J,q,M),uO(M.stateNode),u2=z,e5=$;break}case 5:k2||I5(M,q);case 6:if(W5){if(z=u2,$=e5,u2=null,n5(J,q,M),u2=z,e5=$,u2!==null)if(e5)try{RF(u2,M.stateNode)}catch(F){U(M,q,F)}else try{WF(u2,M.stateNode)}catch(F){U(M,q,F)}}else n5(J,q,M);break;case 18:W5&&u2!==null&&(e5?QT(u2,M.stateNode):qT(u2,M.stateNode));break;case 4:W5?(z=u2,$=e5,u2=M.stateNode.containerInfo,e5=!0,n5(J,q,M),u2=z,e5=$):(N3&&VX(M.stateNode,M,TO()),n5(J,q,M));break;case 0:case 11:case 14:case 15:G3(2,M,q),k2||G3(4,M,q),n5(J,q,M);break;case 1:k2||(I5(M,q),z=M.stateNode,typeof z.componentWillUnmount==="function"&&i6(M,q,z)),n5(J,q,M);break;case 21:n5(J,q,M);break;case 22:k2=(z=k2)||M.memoizedState!==null,n5(J,q,M),k2=z;break;default:n5(J,q,M)}}function V9(J,q){if(R5&&q.memoizedState===null&&(J=q.alternate,J!==null&&(J=J.memoizedState,J!==null))){J=J.dehydrated;try{XT(J)}catch(M){U(q,q.return,M)}}}function b_(J,q){if(R5&&q.memoizedState===null&&(J=q.alternate,J!==null&&(J=J.memoizedState,J!==null&&(J=J.dehydrated,J!==null))))try{KT(J)}catch(M){U(q,q.return,M)}}function m_(J){switch(J.tag){case 31:case 13:case 19:var q=J.stateNode;return q===null&&(q=J.stateNode=new oO),q;case 22:return J=J.stateNode,q=J._retryCache,q===null&&(q=J._retryCache=new oO),q;default:throw Error(Y(435,J.tag))}}function U9(J,q){var M=m_(J);q.forEach(function(z){if(!M.has(z)){M.add(z);var $=y.bind(null,J,z);z.then($,$)}})}function $2(J,q){var M=q.deletions;if(M!==null)for(var z=0;z<M.length;z++){var $=M[z],F=J,w=q;if(W5){var t=w;h:for(;t!==null;){switch(t.tag){case 27:if(t2){if(T9(t.type)){u2=t.stateNode,e5=!1;break h}break}case 5:u2=t.stateNode,e5=!1;break h;case 3:case 4:u2=t.stateNode.containerInfo,e5=!0;break h}t=t.return}if(u2===null)throw Error(Y(160));H9(F,w,$),u2=null,e5=!1}else H9(F,w,$);F=$.alternate,F!==null&&(F.return=null),$.return=null}if(q.subtreeFlags&13886)for(q=q.child;q!==null;)CX(q,J),q=q.sibling}function CX(J,q){var{alternate:M,flags:z}=J;switch(J.tag){case 0:case 11:case 14:case 15:$2(q,J),e2(J),z&4&&(G3(3,J,J.return),J7(3,J),G3(5,J,J.return));break;case 1:$2(q,J),e2(J),z&512&&(k2||M===null||I5(M,M.return)),z&64&&Q6&&(J=J.updateQueue,J!==null&&(z=J.callbacks,z!==null&&(M=J.shared.hiddenCallbacks,J.shared.hiddenCallbacks=M===null?z:M.concat(z))));break;case 26:if(X3){var $=K3;if($2(q,J),e2(J),z&512&&(k2||M===null||I5(M,M.return)),z&4){z=M!==null?M.memoizedState:null;var F=J.memoizedState;M===null?F===null?J.stateNode===null?J.stateNode=AT($,J.type,J.memoizedProps,J):bO($,J.type,J.stateNode):J.stateNode=PO($,F,J.memoizedProps):z!==F?(z===null?M.stateNode!==null&&mO(M.stateNode):yO(z),F===null?bO($,J.type,J.stateNode):PO($,F,J.memoizedProps)):F===null&&J.stateNode!==null&&q2(J,J.memoizedProps,M.memoizedProps)}break}case 27:if(t2){$2(q,J),e2(J),z&512&&(k2||M===null||I5(M,M.return)),M!==null&&z&4&&q2(J,J.memoizedProps,M.memoizedProps);break}case 5:if($2(q,J),e2(J),z&512&&(k2||M===null||I5(M,M.return)),W5){if(J.flags&32){$=J.stateNode;try{FO($)}catch(R0){U(J,J.return,R0)}}z&4&&J.stateNode!=null&&($=J.memoizedProps,q2(J,$,M!==null?M.memoizedProps:$)),z&1024&&(wq=!0)}else N3&&J.alternate!==null&&(J.alternate.stateNode=J.stateNode);break;case 6:if($2(q,J),e2(J),z&4&&W5){if(J.stateNode===null)throw Error(Y(162));z=J.memoizedProps,M=M!==null?M.memoizedProps:z,$=J.stateNode;try{$F($,M,z)}catch(R0){U(J,J.return,R0)}}break;case 3:if(X3?(HT(),$=K3,K3=zq(q.containerInfo),$2(q,J),K3=$):$2(q,J),e2(J),z&4){if(W5&&R5&&M!==null&&M.memoizedState.isDehydrated)try{YT(q.containerInfo)}catch(R0){U(J,J.return,R0)}if(N3){z=q.containerInfo,M=q.pendingChildren;try{RO(z,M)}catch(R0){U(J,J.return,R0)}}}wq&&(wq=!1,f_(J));break;case 4:X3?(M=K3,K3=zq(J.stateNode.containerInfo),$2(q,J),e2(J),K3=M):($2(q,J),e2(J)),z&4&&N3&&VX(J.stateNode,J,J.stateNode.pendingChildren);break;case 12:$2(q,J),e2(J);break;case 31:$2(q,J),e2(J),z&4&&(z=J.updateQueue,z!==null&&(J.updateQueue=null,U9(J,z)));break;case 13:$2(q,J),e2(J),J.child.flags&8192&&J.memoizedState!==null!==(M!==null&&M.memoizedState!==null)&&(ZK=r5()),z&4&&(z=J.updateQueue,z!==null&&(J.updateQueue=null,U9(J,z)));break;case 22:$=J.memoizedState!==null;var w=M!==null&&M.memoizedState!==null,t=Q6,B0=k2;if(Q6=t||$,k2=B0||w,$2(q,J),k2=B0,Q6=t,e2(J),z&8192&&(q=J.stateNode,q._visibility=$?q._visibility&-2:q._visibility|1,$&&(M===null||w||Q6||k2||h6(J)),W5)){h:if(M=null,W5)for(q=J;;){if(q.tag===5||X3&&q.tag===26){if(M===null){w=M=q;try{F=w.stateNode,$?SF(F):xF(w.stateNode,w.memoizedProps)}catch(R0){U(w,w.return,R0)}}}else if(q.tag===6){if(M===null){w=q;try{var L0=w.stateNode;$?vF(L0):wF(L0,w.memoizedProps)}catch(R0){U(w,w.return,R0)}}}else if(q.tag===18){if(M===null){w=q;try{var b0=w.stateNode;$?DT(b0):MT(w.stateNode)}catch(R0){U(w,w.return,R0)}}}else if((q.tag!==22&&q.tag!==23||q.memoizedState===null||q===J)&&q.child!==null){q.child.return=q,q=q.child;continue}if(q===J)break h;for(;q.sibling===null;){if(q.return===null||q.return===J)break h;M===q&&(M=null),q=q.return}M===q&&(M=null),q.sibling.return=q.return,q=q.sibling}}z&4&&(z=J.updateQueue,z!==null&&(M=z.retryQueue,M!==null&&(z.retryQueue=null,U9(J,M))));break;case 19:$2(q,J),e2(J),z&4&&(z=J.updateQueue,z!==null&&(J.updateQueue=null,U9(J,z)));break;case 30:break;case 21:break;default:$2(q,J),e2(J)}}function e2(J){var q=J.flags;if(q&2){try{for(var M,z=J.return;z!==null;){if(e3(z)){M=z;break}z=z.return}if(W5){if(M==null)throw Error(Y(160));switch(M.tag){case 27:if(t2){var $=M.stateNode,F=q7(J);z9(J,F,$);break}case 5:var w=M.stateNode;M.flags&32&&(FO(w),M.flags&=-33);var t=q7(J);z9(J,t,w);break;case 3:case 4:var B0=M.stateNode.containerInfo,L0=q7(J);I_(J,L0,B0);break;default:throw Error(Y(161))}}}catch(b0){U(J,J.return,b0)}J.flags&=-3}q&4096&&(J.flags&=-4097)}function f_(J){if(J.subtreeFlags&1024)for(J=J.child;J!==null;){var q=J;f_(q),q.tag===5&&q.flags&1024&&MF(q.stateNode),J=J.sibling}}function Y3(J,q){if(q.subtreeFlags&8772)for(q=q.child;q!==null;)P_(J,q.alternate,q),q=q.sibling}function h6(J){for(J=J.child;J!==null;){var q=J;switch(q.tag){case 0:case 11:case 14:case 15:G3(4,q,q.return),h6(q);break;case 1:I5(q,q.return);var M=q.stateNode;typeof M.componentWillUnmount==="function"&&i6(q,q.return,M),h6(q);break;case 27:t2&&uO(q.stateNode);case 26:case 5:I5(q,q.return),h6(q);break;case 22:q.memoizedState===null&&h6(q);break;case 30:h6(q);break;default:h6(q)}J=J.sibling}}function w4(J,q,M){M=M&&(q.subtreeFlags&8772)!==0;for(q=q.child;q!==null;){var z=q.alternate,$=J,F=q,w=F.flags;switch(F.tag){case 0:case 11:case 15:w4($,F,M),J7(4,F);break;case 1:if(w4($,F,M),z=F,$=z.stateNode,typeof $.componentDidMount==="function")try{$.componentDidMount()}catch(L0){U(z,z.return,L0)}if(z=F,$=z.updateQueue,$!==null){var t=z.stateNode;try{var B0=$.shared.hiddenCallbacks;if(B0!==null)for($.shared.hiddenCallbacks=null,$=0;$<B0.length;$++)_2(B0[$],t)}catch(L0){U(z,z.return,L0)}}M&&w&64&&HX(F),c6(F,F.return);break;case 27:t2&&UX(F);case 26:case 5:w4($,F,M),M&&z===null&&w&4&&d6(F),c6(F,F.return);break;case 12:w4($,F,M);break;case 31:w4($,F,M),M&&w&4&&V9($,F);break;case 13:w4($,F,M),M&&w&4&&b_($,F);break;case 22:F.memoizedState===null&&w4($,F,M),c6(F,F.return);break;case 30:break;default:w4($,F,M)}q=q.sibling}}function k_(J,q){var M=null;J!==null&&J.memoizedState!==null&&J.memoizedState.cachePool!==null&&(M=J.memoizedState.cachePool.pool),J=null,q.memoizedState!==null&&q.memoizedState.cachePool!==null&&(J=q.memoizedState.cachePool.pool),J!==M&&(J!=null&&J.refCount++,M!=null&&M0(M))}function u_(J,q){J=null,q.alternate!==null&&(J=q.alternate.memoizedState.cache),q=q.memoizedState.cache,q!==J&&(q.refCount++,J!=null&&M0(J))}function P5(J,q,M,z){if(q.subtreeFlags&10256)for(q=q.child;q!==null;)NX(J,q,M,z),q=q.sibling}function NX(J,q,M,z){var $=q.flags;switch(q.tag){case 0:case 11:case 15:P5(J,q,M,z),$&2048&&J7(9,q);break;case 1:P5(J,q,M,z);break;case 3:P5(J,q,M,z),$&2048&&(J=null,q.alternate!==null&&(J=q.alternate.memoizedState.cache),q=q.memoizedState.cache,q!==J&&(q.refCount++,J!=null&&M0(J)));break;case 12:if($&2048){P5(J,q,M,z),J=q.stateNode;try{var F=q.memoizedProps,w=F.id,t=F.onPostCommit;typeof t==="function"&&t(w,q.alternate===null?"mount":"update",J.passiveEffectDuration,-0)}catch(B0){U(q,q.return,B0)}}else P5(J,q,M,z);break;case 31:P5(J,q,M,z);break;case 13:P5(J,q,M,z);break;case 23:break;case 22:F=q.stateNode,w=q.alternate,q.memoizedState!==null?F._visibility&2?P5(J,q,M,z):Q7(J,q):F._visibility&2?P5(J,q,M,z):(F._visibility|=2,a6(J,q,M,z,(q.subtreeFlags&10256)!==0||!1)),$&2048&&k_(w,q);break;case 24:P5(J,q,M,z),$&2048&&u_(q.alternate,q);break;default:P5(J,q,M,z)}}function a6(J,q,M,z,$){$=$&&((q.subtreeFlags&10256)!==0||!1);for(q=q.child;q!==null;){var F=J,w=q,t=M,B0=z,L0=w.flags;switch(w.tag){case 0:case 11:case 15:a6(F,w,t,B0,$),J7(8,w);break;case 23:break;case 22:var b0=w.stateNode;w.memoizedState!==null?b0._visibility&2?a6(F,w,t,B0,$):Q7(F,w):(b0._visibility|=2,a6(F,w,t,B0,$)),$&&L0&2048&&k_(w.alternate,w);break;case 24:a6(F,w,t,B0,$),$&&L0&2048&&u_(w.alternate,w);break;default:a6(F,w,t,B0,$)}q=q.sibling}}function Q7(J,q){if(q.subtreeFlags&10256)for(q=q.child;q!==null;){var M=J,z=q,$=z.flags;switch(z.tag){case 22:Q7(M,z),$&2048&&k_(z.alternate,z);break;case 24:Q7(M,z),$&2048&&u_(z.alternate,z);break;default:Q7(M,z)}q=q.sibling}}function _6(J,q,M){if(J.subtreeFlags&k9)for(J=J.child;J!==null;)$X(J,q,M),J=J.sibling}function $X(J,q,M){switch(J.tag){case 26:if(_6(J,q,M),J.flags&k9)if(J.memoizedState!==null)UT(M,K3,J.memoizedState,J.memoizedProps);else{var{stateNode:z,type:$}=J;J=J.memoizedProps,((q&335544128)===q||Bq($,J))&&jO(M,z,$,J)}break;case 5:_6(J,q,M),J.flags&k9&&(z=J.stateNode,$=J.type,J=J.memoizedProps,((q&335544128)===q||Bq($,J))&&jO(M,z,$,J));break;case 3:case 4:X3?(z=K3,K3=zq(J.stateNode.containerInfo),_6(J,q,M),K3=z):_6(J,q,M);break;case 22:J.memoizedState===null&&(z=J.alternate,z!==null&&z.memoizedState!==null?(z=k9,k9=16777216,_6(J,q,M),k9=z):_6(J,q,M));break;default:_6(J,q,M)}}function LX(J){var q=J.alternate;if(q!==null&&(J=q.child,J!==null)){q.child=null;do q=J.sibling,J.sibling=null,J=q;while(J!==null)}}function D7(J){var q=J.deletions;if((J.flags&16)!==0){if(q!==null)for(var M=0;M<q.length;M++){var z=q[M];G5=z,FX(z,J)}LX(J)}if(J.subtreeFlags&10256)for(J=J.child;J!==null;)jX(J),J=J.sibling}function jX(J){switch(J.tag){case 0:case 11:case 15:D7(J),J.flags&2048&&G3(9,J,J.return);break;case 3:D7(J);break;case 12:D7(J);break;case 22:var q=J.stateNode;J.memoizedState!==null&&q._visibility&2&&(J.return===null||J.return.tag!==13)?(q._visibility&=-3,E9(J)):D7(J);break;default:D7(J)}}function E9(J){var q=J.deletions;if((J.flags&16)!==0){if(q!==null)for(var M=0;M<q.length;M++){var z=q[M];G5=z,FX(z,J)}LX(J)}for(J=J.child;J!==null;){switch(q=J,q.tag){case 0:case 11:case 15:G3(8,q,q.return),E9(q);break;case 22:M=q.stateNode,M._visibility&2&&(M._visibility&=-3,E9(q));break;default:E9(q)}J=J.sibling}}function FX(J,q){for(;G5!==null;){var M=G5;switch(M.tag){case 0:case 11:case 15:G3(8,M,q);break;case 23:case 22:if(M.memoizedState!==null&&M.memoizedState.cachePool!==null){var z=M.memoizedState.cachePool.pool;z!=null&&z.refCount++}break;case 24:M0(M.memoizedState.cache)}if(z=M.child,z!==null)z.return=M,G5=z;else h:for(M=J;G5!==null;){z=G5;var{sibling:$,return:F}=z;if(y_(z),z===M){G5=null;break h}if($!==null){$.return=F,G5=$;break h}G5=F}}}function p_(J){var q=GF(J);if(q!=null){if(typeof q.memoizedProps["data-testname"]!=="string")throw Error(Y(364));return q}if(J=AF(J),J===null)throw Error(Y(362));return J.stateNode.current}function g4(J,q){var M=J.tag;switch(q.$$typeof){case _K:if(J.type===q.value)return!0;break;case GK:h:{q=q.value,J=[J,0];for(M=0;M<J.length;){var z=J[M++],$=z.tag,F=J[M++],w=q[F];if($!==5&&$!==26&&$!==27||!n_(z)){for(;w!=null&&g4(z,w);)F++,w=q[F];if(F===q.length){q=!0;break h}else for(z=z.child;z!==null;)J.push(z,F),z=z.sibling}}q=!1}return q;case YK:if((M===5||M===26||M===27)&&VF(J.stateNode,q.value))return!0;break;case KK:if(M===5||M===6||M===26||M===27){if(J=HF(J),J!==null&&0<=J.indexOf(q.value))return!0}break;case XK:if(M===5||M===26||M===27){if(J=J.memoizedProps["data-testname"],typeof J==="string"&&J.toLowerCase()===q.value.toLowerCase())return!0}break;default:throw Error(Y(365))}return!1}function l_(J){switch(J.$$typeof){case _K:return"<"+(A(J.value)||"Unknown")+">";case GK:return":has("+(l_(J)||"")+")";case YK:return'[role="'+J.value+'"]';case KK:return'"'+J.value+'"';case XK:return'[data-testname="'+J.value+'"]';default:throw Error(Y(365))}}function TX(J,q){var M=[];J=[J,0];for(var z=0;z<J.length;){var $=J[z++],F=$.tag,w=J[z++],t=q[w];if(F!==5&&F!==26&&F!==27||!n_($)){for(;t!=null&&g4($,t);)w++,t=q[w];if(w===q.length)M.push($);else for($=$.child;$!==null;)J.push($,w),$=$.sibling}}return M}function i_(J,q){if(!s_)throw Error(Y(363));J=p_(J),J=TX(J,q),q=[],J=Array.from(J);for(var M=0;M<J.length;){var z=J[M++],$=z.tag;if($===5||$===26||$===27)n_(z)||q.push(z.stateNode);else for(z=z.child;z!==null;)J.push(z),z=z.sibling}return q}function o5(){return(L1&2)!==0&&T1!==0?T1&-T1:o0.T!==null?w1():XF()}function c_(){if($4===0)if((T1&536870912)===0||R1){var J=pX;pX<<=1,(pX&3932160)===0&&(pX=262144),$4=J}else $4=536870912;return J=C4.current,J!==null&&(J.flags|=32),$4}function h5(J,q,M){if(J===G2&&(c1===2||c1===9)||J.cancelPendingCommit!==null)t6(J,0),U3(J,T1,$4,!1);if(I(J,M),(L1&2)===0||J!==G2)J===G2&&((L1&2)===0&&($7|=M),L2===4&&U3(J,T1,$4,!1)),u0(J)}function d_(J,q,M){if((L1&6)!==0)throw Error(Y(327));var z=!M&&(q&127)===0&&(q&J.expiredLanes)===0||R(J,q),$=z?G6(J,q):E3(J,q,!0),F=z;do{if($===0){u9&&!z&&U3(J,q,0,!1);break}else{if(M=J.current.alternate,F&&!C9(M)){$=E3(J,q,!1),F=!1;continue}if($===2){if(F=q,J.errorRecoveryDisabledLanes&F)var w=0;else w=J.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){q=w;h:{var t=J;$=KG;var B0=R5&&t.current.memoizedState.isDehydrated;if(B0&&(t6(t,w).flags|=256),w=E3(t,w,!1),w!==2){if(gq&&!B0){t.errorRecoveryDisabledLanes|=F,$7|=F,$=4;break h}F=h4,h4=$,F!==null&&(h4===null?h4=F:h4.push.apply(h4,F))}$=w}if(F=!1,$!==2)continue}}if($===1){t6(J,0),U3(J,q,0,!0);break}h:{switch(z=J,F=$,F){case 0:case 1:throw Error(Y(345));case 4:if((q&4194048)!==q)break;case 6:U3(z,q,$4,!K8);break h;case 2:h4=null;break;case 3:case 5:break;default:throw Error(Y(329))}if((q&62914560)===q&&($=ZK+300-r5(),10<$)){if(U3(z,q,$4,!K8),S(z,0,!0)!==0)break h;M6=q,z.timeoutHandle=hF(M7.bind(null,z,M,h4,JK,Pq,q,$4,$7,p9,K8,F,"Throttled",-0,0),$);break h}M7(z,M,h4,JK,Pq,q,$4,$7,p9,K8,F,null,-0,0)}}break}while(1);u0(J)}function M7(J,q,M,z,$,F,w,t,B0,L0,b0,R0,k0,B1){if(J.timeoutHandle=A7,R0=q.subtreeFlags,R0&8192||(R0&16785408)===16785408){R0=QF(),$X(q,F,R0);var U5=(F&62914560)===F?ZK-r5():(F&4194048)===F?rO-r5():0;if(U5=DF(R0,U5),U5!==null){M6=F,J.cancelPendingCommit=U5(gX.bind(null,J,q,F,M,z,$,w,t,B0,b0,R0,null,k0,B1)),U3(J,F,w,!L0);return}}gX(J,q,F,M,z,$,w,t,B0)}function C9(J){for(var q=J;;){var M=q.tag;if((M===0||M===11||M===15)&&q.flags&16384&&(M=q.updateQueue,M!==null&&(M=M.stores,M!==null)))for(var z=0;z<M.length;z++){var $=M[z],F=$.getSnapshot;$=$.value;try{if(!E4(F(),$))return!1}catch(w){return!1}}if(M=q.child,q.subtreeFlags&16384&&M!==null)M.return=q,q=M;else{if(q===J)break;for(;q.sibling===null;){if(q.return===null||q.return===J)return!0;q=q.return}q.sibling.return=q.return,q=q.sibling}}return!0}function U3(J,q,M,z){q&=~Iq,q&=~$7,J.suspendedLanes|=q,J.pingedLanes&=~q,z&&(J.warmLanes|=q),z=J.expirationTimes;for(var $=q;0<$;){var F=31-V4($),w=1<<F;z[F]=-1,$&=~w}M!==0&&l(J,M,q)}function WX(){return(L1&6)===0?(s0(0,!1),!1):!0}function a_(){if(j1!==null){if(c1===0)var J=j1.return;else J=j1,J6=H7=null,A_(J),P9=null,_G=0,J=j1;for(;J!==null;)zX(J.alternate,J),J=J.return;j1=null}}function t6(J,q){var M=J.timeoutHandle;M!==A7&&(J.timeoutHandle=A7,_F(M)),M=J.cancelPendingCommit,M!==null&&(J.cancelPendingCommit=null,M()),M6=0,a_(),G2=J,j1=M=J0(J.current,null),T1=q,c1=0,N4=null,K8=!1,u9=R(J,q),gq=!1,p9=$4=Iq=$7=Z8=L2=0,h4=KG=null,Pq=!1,(q&8)!==0&&(q|=q&32);var z=J.entangledLanes;if(z!==0)for(J=J.entanglements,z&=q;0<z;){var $=31-V4(z),F=1<<$;q|=J[$],z&=~F}return D6=q,x6(),M}function RX(J,q){z1=null,o0.H=YG,q===I9||q===nX?(q=h3(),c1=3):q===Fq?(q=h3(),c1=4):c1=q===vq?8:q!==null&&typeof q==="object"&&typeof q.then==="function"?6:1,N4=q,j1===null&&(L2=1,u6(J,X0(q,J.current)))}function N9(){var J=C4.current;return J===null?!0:(T1&4194048)===T1?m4===null?!0:!1:(T1&62914560)===T1||(T1&536870912)!==0?J===m4:!1}function SX(){var J=o0.H;return o0.H=YG,J===null?YG:J}function vX(){var J=o0.A;return o0.A=gT,J}function B7(){L2=4,K8||(T1&4194048)!==T1&&C4.current!==null||(u9=!0),(Z8&134217727)===0&&($7&134217727)===0||G2===null||U3(G2,T1,$4,!1)}function E3(J,q,M){var z=L1;L1|=2;var $=SX(),F=vX();if(G2!==J||T1!==q)JK=null,t6(J,q);q=!1;var w=L2;h:do try{if(c1!==0&&j1!==null){var t=j1,B0=N4;switch(c1){case 8:a_(),w=6;break h;case 3:case 2:case 9:case 6:C4.current===null&&(q=!0);var L0=c1;if(c1=0,N4=null,Y6(J,t,B0,L0),M&&u9){w=0;break h}break;default:L0=c1,c1=0,N4=null,Y6(J,t,B0,L0)}}P1(),w=L2;break}catch(b0){RX(J,b0)}while(1);return q&&J.shellSuspendCounter++,J6=H7=null,L1=z,o0.H=$,o0.A=F,j1===null&&(G2=null,T1=0,x6()),w}function P1(){for(;j1!==null;)H4(j1)}function G6(J,q){var M=L1;L1|=2;var z=SX(),$=vX();G2!==J||T1!==q?(JK=null,ZG=r5()+500,t6(J,q)):u9=R(J,q);h:do try{if(c1!==0&&j1!==null){q=j1;var F=N4;_:switch(c1){case 1:c1=0,N4=null,Y6(J,q,F,1);break;case 2:case 9:if(X1(F)){c1=0,N4=null,xX(q);break}q=function(){c1!==2&&c1!==9||G2!==J||(c1=7),u0(J)},F.then(q,q);break h;case 3:c1=7;break h;case 4:c1=5;break h;case 7:X1(F)?(c1=0,N4=null,xX(q)):(c1=0,N4=null,Y6(J,q,F,7));break;case 5:var w=null;switch(j1.tag){case 26:w=j1.memoizedState;case 5:case 27:var t=j1,B0=t.type,L0=t.pendingProps;if(w?fO(w):LO(t.stateNode,B0,L0)){c1=0,N4=null;var b0=t.sibling;if(b0!==null)j1=b0;else{var R0=t.return;R0!==null?(j1=R0,$9(R0)):j1=null}break _}}c1=0,N4=null,Y6(J,q,F,5);break;case 6:c1=0,N4=null,Y6(J,q,F,6);break;case 8:a_(),L2=6;break h;default:throw Error(Y(462))}}A5();break}catch(k0){RX(J,k0)}while(1);if(J6=H7=null,o0.H=z,o0.A=$,L1=M,j1!==null)return 0;return G2=null,T1=0,x6(),L2}function A5(){for(;j1!==null&&!$T();)H4(j1)}function H4(J){var q=OX(J.alternate,J,D6);J.memoizedProps=J.pendingProps,q===null?$9(J):j1=q}function xX(J){var q=J,M=q.alternate;switch(q.tag){case 15:case 0:q=G7(M,q,q.pendingProps,q.type,void 0,T1);break;case 11:q=G7(M,q,q.pendingProps,q.type.render,q.ref,T1);break;case 5:A_(q);default:zX(M,q),q=j1=P0(q,D6),q=OX(M,q,D6)}J.memoizedProps=J.pendingProps,q===null?$9(J):j1=q}function Y6(J,q,M,z){J6=H7=null,A_(q),P9=null,_G=0;var $=q.return;try{if(_q(J,$,q,M,T1)){L2=1,u6(J,X0(M,J.current)),j1=null;return}}catch(F){if($!==null)throw j1=$,F;L2=1,u6(J,X0(M,J.current)),j1=null;return}if(q.flags&32768){if(R1||z===1)J=!0;else if(u9||(T1&536870912)!==0)J=!1;else if(K8=J=!0,z===2||z===9||z===3||z===6)z=C4.current,z!==null&&z.tag===13&&(z.flags|=16384);wX(q,J)}else $9(q)}function $9(J){var q=J;do{if((q.flags&32768)!==0){wX(q,K8);return}J=q.return;var M=Yq(q.alternate,q,D6);if(M!==null){j1=M;return}if(q=q.sibling,q!==null){j1=q;return}j1=q=J}while(q!==null);L2===0&&(L2=5)}function wX(J,q){do{var M=Xq(J.alternate,J);if(M!==null){M.flags&=32767,j1=M;return}if(M=J.return,M!==null&&(M.flags|=32768,M.subtreeFlags=0,M.deletions=null),!q&&(J=J.sibling,J!==null)){j1=J;return}j1=J=M}while(J!==null);L2=6,j1=null}function gX(J,q,M,z,$,F,w,t,B0){J.cancelPendingCommit=null;do X6();while(s2!==0);if((L1&6)!==0)throw Error(Y(327));if(q!==null){if(q===J.current)throw Error(Y(177));if(F=q.lanes|q.childLanes,F|=Tq,b(J,M,F,w,t,B0),J===G2&&(j1=G2=null,T1=0),l9=q,q8=J,M6=M,yq=F,bq=$,eO=z,(q.subtreeFlags&10256)!==0||(q.flags&10256)!==0?(J.callbackNode=null,J.callbackPriority=0,p(Uq,function(){return B(),null})):(J.callbackNode=null,J.callbackPriority=0),z=(q.flags&13878)!==0,(q.subtreeFlags&13878)!==0||z){z=o0.T,o0.T=null,$=Z6(),_5(2),w=L1,L1|=4;try{EX(J,q,M)}finally{L1=w,_5($),o0.T=z}}s2=1,IX(),PX(),yX()}}function IX(){if(s2===1){s2=0;var J=q8,q=l9,M=(q.flags&13878)!==0;if((q.subtreeFlags&13878)!==0||M){M=o0.T,o0.T=null;var z=Z6();_5(2);var $=L1;L1|=4;try{CX(q,J),rj(J.containerInfo)}finally{L1=$,_5(z),o0.T=M}}J.current=q,s2=2}}function PX(){if(s2===2){s2=0;var J=q8,q=l9,M=(q.flags&8772)!==0;if((q.subtreeFlags&8772)!==0||M){M=o0.T,o0.T=null;var z=Z6();_5(2);var $=L1;L1|=4;try{P_(J,q.alternate,q)}finally{L1=$,_5(z),o0.T=M}}s2=3}}function yX(){if(s2===4||s2===3){s2=0,LT();var J=q8,q=l9,M=M6,z=eO;(q.subtreeFlags&10256)!==0||(q.flags&10256)!==0?s2=5:(s2=0,l9=q8=null,bX(J,J.pendingLanes));var $=J.pendingLanes;if($===0&&(J8=null),Q0(M),q=q.stateNode,U4&&typeof U4.onCommitFiberRoot==="function")try{U4.onCommitFiberRoot(o_,q,void 0,(q.current.flags&128)===128)}catch(B0){}if(z!==null){q=o0.T,$=Z6(),_5(2),o0.T=null;try{for(var F=J.onRecoverableError,w=0;w<z.length;w++){var t=z[w];F(t.value,{componentStack:t.stack})}}finally{o0.T=q,_5($)}}(M6&3)!==0&&X6(),u0(J),$=J.pendingLanes,(M&261930)!==0&&($&42)!==0?J===mq?JG++:(JG=0,mq=J):JG=0,R5&&JT(),s0(0,!1)}}function bX(J,q){(J.pooledCacheLanes&=q)===0&&(q=J.pooledCache,q!=null&&(J.pooledCache=null,M0(q)))}function X6(){return IX(),PX(),yX(),B()}function B(){if(s2!==5)return!1;var J=q8,q=yq;yq=0;var M=Q0(M6),z=32>M?32:M;M=o0.T;var $=Z6();try{_5(z),o0.T=null,z=bq,bq=null;var F=q8,w=M6;if(s2=0,l9=q8=null,M6=0,(L1&6)!==0)throw Error(Y(331));var t=L1;if(L1|=4,jX(F.current),NX(F,F.current,w,z),L1=t,s0(0,!1),U4&&typeof U4.onPostCommitFiberRoot==="function")try{U4.onPostCommitFiberRoot(o_,F)}catch(B0){}return!0}finally{_5($),o0.T=M,bX(J,q)}}function V(J,q,M){q=X0(M,q),q=H3(J.stateNode,q,2),J=O3(J,q,2),J!==null&&(I(J,2),u0(J))}function U(J,q,M){if(J.tag===3)V(J,J,M);else for(;q!==null;){if(q.tag===3){V(q,J,M);break}else if(q.tag===1){var z=q.stateNode;if(typeof q.type.getDerivedStateFromError==="function"||typeof z.componentDidCatch==="function"&&(J8===null||!J8.has(z))){J=X0(M,J),M=e8(2),z=O3(q,M,2),z!==null&&(V3(M,z,q,J),I(z,2),u0(z));break}}q=q.return}}function E(J,q,M){var z=J.pingCache;if(z===null){z=J.pingCache=new IT;var $=new Set;z.set(q,$)}else $=z.get(q),$===void 0&&($=new Set,z.set(q,$));$.has(M)||(gq=!0,$.add(M),J=L.bind(null,J,q,M),q.then(J,J))}function L(J,q,M){var z=J.pingCache;z!==null&&z.delete(q),J.pingedLanes|=J.suspendedLanes&M,J.warmLanes&=~M,G2===J&&(T1&M)===M&&(L2===4||L2===3&&(T1&62914560)===T1&&300>r5()-ZK?(L1&2)===0&&t6(J,0):Iq|=M,p9===T1&&(p9=0)),u0(J)}function T(J,q){q===0&&(q=x()),J=d3(J,q),J!==null&&(I(J,q),u0(J))}function g(J){var q=J.memoizedState,M=0;q!==null&&(M=q.retryLane),T(J,M)}function y(J,q){var M=0;switch(J.tag){case 31:case 13:var{stateNode:z,memoizedState:$}=J;$!==null&&(M=$.retryLane);break;case 19:z=J.stateNode;break;case 22:z=J.stateNode._retryCache;break;default:throw Error(Y(314))}z!==null&&z.delete(q),T(J,M)}function p(J,q){return iX(J,q)}function c(J,q,M,z){this.tag=J,this.key=M,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=q,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=z,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function e(J){return J=J.prototype,!(!J||!J.isReactComponent)}function J0(J,q){var M=J.alternate;return M===null?(M=_(J.tag,q,J.key,J.mode),M.elementType=J.elementType,M.type=J.type,M.stateNode=J.stateNode,M.alternate=J,J.alternate=M):(M.pendingProps=q,M.type=J.type,M.flags=0,M.subtreeFlags=0,M.deletions=null),M.flags=J.flags&65011712,M.childLanes=J.childLanes,M.lanes=J.lanes,M.child=J.child,M.memoizedProps=J.memoizedProps,M.memoizedState=J.memoizedState,M.updateQueue=J.updateQueue,q=J.dependencies,M.dependencies=q===null?null:{lanes:q.lanes,firstContext:q.firstContext},M.sibling=J.sibling,M.index=J.index,M.ref=J.ref,M.refCleanup=J.refCleanup,M}function P0(J,q){J.flags&=65011714;var M=J.alternate;return M===null?(J.childLanes=0,J.lanes=q,J.child=null,J.subtreeFlags=0,J.memoizedProps=null,J.memoizedState=null,J.updateQueue=null,J.dependencies=null,J.stateNode=null):(J.childLanes=M.childLanes,J.lanes=M.lanes,J.child=M.child,J.subtreeFlags=0,J.deletions=null,J.memoizedProps=M.memoizedProps,J.memoizedState=M.memoizedState,J.updateQueue=M.updateQueue,J.type=M.type,q=M.dependencies,J.dependencies=q===null?null:{lanes:q.lanes,firstContext:q.firstContext}),J}function H0(J,q,M,z,$,F){var w=0;if(z=J,typeof J==="function")e(J)&&(w=1);else if(typeof J==="string")w=X3&&t2?gO(J,M,H5.current)?26:pO(J)?27:5:X3?gO(J,M,H5.current)?26:5:t2?pO(J)?27:5:5;else h:switch(J){case Dq:return J=_(31,M,q,$),J.elementType=Dq,J.lanes=F,J;case j9:return i0(M.children,$,F,q);case VO:w=8,$|=24;break;case Kq:return J=_(12,M,q,$|2),J.elementType=Kq,J.lanes=F,J;case Jq:return J=_(13,M,q,$),J.elementType=Jq,J.lanes=F,J;case qq:return J=_(19,M,q,$),J.elementType=qq,J.lanes=F,J;default:if(typeof J==="object"&&J!==null)switch(J.$$typeof){case e6:w=10;break h;case UO:w=9;break h;case Zq:w=11;break h;case Qq:w=14;break h;case h8:w=16,z=null;break h}w=29,M=Error(Y(130,J===null?"null":typeof J,"")),z=null}return q=_(w,M,q,$),q.elementType=J,q.type=z,q.lanes=F,q}function i0(J,q,M,z){return J=_(7,J,z,q),J.lanes=M,J}function e0(J,q,M){return J=_(6,J,null,q),J.lanes=M,J}function x2(J){var q=_(18,null,null,0);return q.stateNode=J,q}function z5(J,q,M){return q=_(4,J.children!==null?J.children:[],J.key,q),q.lanes=M,q.stateNode={containerInfo:J.containerInfo,pendingChildren:null,implementation:J.implementation},q}function C3(J,q,M,z,$,F,w,t,B0){this.tag=1,this.containerInfo=J,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=A7,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=P(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=P(0),this.hiddenUpdates=P(null),this.identifierPrefix=z,this.onUncaughtError=$,this.onCaughtError=F,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=B0,this.incompleteTransitions=new Map}function s6(J,q,M,z,$,F,w,t,B0,L0,b0,R0){return J=new C3(J,q,M,w,B0,L0,b0,R0,t),q=1,F===!0&&(q|=24),F=_(3,null,null,q),J.current=F,F.stateNode=J,q=a2(),q.refCount++,J.pooledCache=q,q.refCount++,F.memoizedState={element:z,isDehydrated:M,cache:q},B4(F),J}function n6(J){if(!J)return R9;return J=R9,J}function o6(J){var q=J._reactInternals;if(q===void 0){if(typeof J.render==="function")throw Error(Y(188));throw J=Object.keys(J).join(","),Error(Y(268,J))}return J=Z(q),J=J!==null?Q(J):null,J===null?null:t_(J.stateNode)}function r6(J,q,M,z,$,F){$=n6($),z.context===null?z.context=$:z.pendingContext=$,z=F1(q),z.payload={element:M},F=F===void 0?null:F,F!==null&&(z.callback=F),M=O3(J,z,q),M!==null&&(h5(M,J,q),A3(M,J,q))}function O7(J,q){if(J=J.memoizedState,J!==null&&J.dehydrated!==null){var M=J.retryLane;J.retryLane=M!==0&&M<q?M:q}}function i1(J,q){O7(J,q),(J=J.alternate)&&O7(J,q)}var M1={},y5=Object.assign,ij=Symbol.for("react.element"),mX=Symbol.for("react.transitional.element"),L9=Symbol.for("react.portal"),j9=Symbol.for("react.fragment"),VO=Symbol.for("react.strict_mode"),Kq=Symbol.for("react.profiler"),UO=Symbol.for("react.consumer"),e6=Symbol.for("react.context"),Zq=Symbol.for("react.forward_ref"),Jq=Symbol.for("react.suspense"),qq=Symbol.for("react.suspense_list"),Qq=Symbol.for("react.memo"),h8=Symbol.for("react.lazy"),Dq=Symbol.for("react.activity"),cj=Symbol.for("react.memo_cache_sentinel"),EO=Symbol.iterator,dj=Symbol.for("react.client.reference"),fX=Array.isArray,o0=KO.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,aj=h.rendererVersion,tj=h.rendererPackageName,CO=h.extraDevToolsConfig,t_=h.getPublicInstance,sj=h.getRootHostContext,nj=h.getChildHostContext,oj=h.prepareForCommit,rj=h.resetAfterCommit,ej=h.createInstance;h.cloneMutableInstance;var{appendInitialChild:Mq,finalizeInitialChildren:NO,shouldSetTextContent:kX,createTextInstance:$O}=h;h.cloneMutableTextInstance;var{scheduleTimeout:hF,cancelTimeout:_F,noTimeout:A7,isPrimaryRenderer:K6}=h;h.warnsIfNotActing;var{supportsMutation:W5,supportsPersistence:N3,supportsHydration:R5,getInstanceFromNode:GF}=h;h.beforeActiveInstanceBlur;var YF=h.preparePortalMount;h.prepareScopeUpdate,h.getInstanceFromScope;var{setCurrentUpdatePriority:_5,getCurrentUpdatePriority:Z6,resolveUpdatePriority:XF}=h;h.trackSchedulerEvent,h.resolveEventType,h.resolveEventTimeStamp;var{shouldAttemptEagerTransition:KF,detachDeletedInstance:ZF}=h;h.requestPostPaintCallback;var{maySuspendCommit:JF,maySuspendCommitOnUpdate:qF,maySuspendCommitInSyncRender:Bq,preloadInstance:LO,startSuspendingCommit:QF,suspendInstance:jO}=h;h.suspendOnActiveViewTransition;var DF=h.waitForCommitToBeReady;h.getSuspendedCommitReason;var{NotPendingTransition:F9,HostTransitionContext:z7,resetFormInstance:MF}=h;h.bindToConsole;var{supportsMicrotasks:BF,scheduleMicrotask:OF,supportsTestSelectors:s_,findFiberRoot:AF,getBoundingRect:zF,getTextContent:HF,isHiddenSubtree:n_,matchAccessibilityRole:VF,setFocusIfFocusable:UF,setupIntersectionObserver:EF,appendChild:CF,appendChildToContainer:NF,commitTextUpdate:$F,commitMount:LF,commitUpdate:jF,insertBefore:FF,insertInContainerBefore:TF,removeChild:WF,removeChildFromContainer:RF,resetTextContent:FO,hideInstance:SF,hideTextInstance:vF,unhideInstance:xF,unhideTextInstance:wF}=h;h.cancelViewTransitionName,h.cancelRootViewTransitionName,h.restoreRootViewTransitionName,h.cloneRootViewTransitionContainer,h.removeRootViewTransitionClone,h.measureClonedInstance,h.hasInstanceChanged,h.hasInstanceAffectedParent,h.startViewTransition,h.startGestureTransition,h.stopViewTransition,h.getCurrentGestureOffset,h.createViewTransitionInstance;var gF=h.clearContainer;h.createFragmentInstance,h.updateFragmentInstanceFiber,h.commitNewChildToFragmentInstance,h.deleteChildFromFragmentInstance;var{cloneInstance:IF,createContainerChildSet:TO,appendChildToContainerChildSet:WO,finalizeContainerChildren:PF,replaceContainerChildren:RO,cloneHiddenInstance:SO,cloneHiddenTextInstance:vO,isSuspenseInstancePending:Oq,isSuspenseInstanceFallback:Aq,getSuspenseInstanceFallbackErrorDetails:yF,registerSuspenseInstanceRetry:bF,canHydrateFormStateMarker:mF,isFormStateMarkerMatching:fF,getNextHydratableSibling:xO,getNextHydratableSiblingAfterSingleton:kF,getFirstHydratableChild:uF,getFirstHydratableChildWithinContainer:pF,getFirstHydratableChildWithinActivityInstance:lF,getFirstHydratableChildWithinSuspenseInstance:iF,getFirstHydratableChildWithinSingleton:cF,canHydrateInstance:dF,canHydrateTextInstance:aF,canHydrateActivityInstance:tF,canHydrateSuspenseInstance:sF,hydrateInstance:nF,hydrateTextInstance:oF,hydrateActivityInstance:rF,hydrateSuspenseInstance:eF,getNextHydratableInstanceAfterActivityInstance:hT,getNextHydratableInstanceAfterSuspenseInstance:_T,commitHydratedInstance:GT,commitHydratedContainer:YT,commitHydratedActivityInstance:XT,commitHydratedSuspenseInstance:KT,finalizeHydratedChildren:ZT,flushHydrationEvents:JT}=h;h.clearActivityBoundary;var qT=h.clearSuspenseBoundary;h.clearActivityBoundaryFromContainer;var{clearSuspenseBoundaryFromContainer:QT,hideDehydratedBoundary:DT,unhideDehydratedBoundary:MT,shouldDeleteUnhydratedTailInstances:wO}=h;h.diffHydratedPropsForDevWarnings,h.diffHydratedTextForDevWarnings,h.describeHydratableInstanceForDevWarnings;var{validateHydratableInstance:BT,validateHydratableTextInstance:OT,supportsResources:X3,isHostHoistableType:gO,getHoistableRoot:zq,getResource:IO,acquireResource:PO,releaseResource:yO,hydrateHoistable:AT,mountHoistable:bO,unmountHoistable:mO,createHoistableInstance:zT,prepareToCommitHoistables:HT,mayResourceSuspendCommit:VT,preloadResource:fO,suspendResource:UT,supportsSingletons:t2,resolveSingletonInstance:kO,acquireSingletonInstance:ET,releaseSingletonInstance:uO,isHostSingletonType:pO,isSingletonScope:T9}=h,Hq=[],W9=-1,R9={},V4=Math.clz32?Math.clz32:j,CT=Math.log,NT=Math.LN2,uX=256,pX=262144,lX=4194304,iX=XO,Vq=Yj,$T=Kj,LT=Xj,r5=lJ,lO=_j,jT=Gj,Uq=YO,FT=iJ,TT=void 0,WT=void 0,o_=null,U4=null,E4=typeof Object.is==="function"?Object.is:r,iO=typeof reportError==="function"?reportError:function(J){if(typeof window==="object"&&typeof window.ErrorEvent==="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof J==="object"&&J!==null&&typeof J.message==="string"?String(J.message):String(J),error:J});if(!window.dispatchEvent(q))return}else if(typeof process==="object"&&typeof process.emit==="function"){process.emit("uncaughtException",J);return}console.error(J)},RT=Object.prototype.hasOwnProperty,Eq,cO,Cq=!1,dO=new WeakMap,S9=[],v9=0,cX=null,r_=0,I4=[],P4=0,_8=null,$3=1,L3="",H5=H(null),e_=H(null),G8=H(null),dX=H(null),V5=null,z2=null,R1=!1,Y8=null,y4=!1,Nq=Error(Y(519)),aX=H(null),H7=null,J6=null,ST=typeof AbortController<"u"?AbortController:function(){var J=[],q=this.signal={aborted:!1,addEventListener:function(M,z){J.push(z)}};this.abort=function(){q.aborted=!0,J.forEach(function(M){return M()})}},vT=XO,xT=YO,H2={$$typeof:e6,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0},tX=null,x9=null,$q=!1,sX=!1,Lq=!1,V7=0,hG=null,jq=0,w9=0,g9=null,aO=o0.S;o0.S=function(J,q){rO=r5(),typeof q==="object"&&q!==null&&typeof q.then==="function"&&J2(J,q),aO!==null&&aO(J,q)};var U7=H(null),I9=Error(Y(460)),Fq=Error(Y(474)),nX=Error(Y(542)),oX={then:function(){}},E7=null,P9=null,_G=0,C7=Q_(!0),tO=Q_(!1),b4=[],y9=0,Tq=0,X8=!1,Wq=!1,b9=H(null),rX=H(0),C4=H(null),m4=null,w2=H(0),q6=0,z1=null,o1=null,m2=null,eX=!1,m9=!1,N7=!1,hK=0,GG=0,f9=null,wT=0,YG={readContext:v1,use:n3,useCallback:M2,useContext:M2,useEffect:M2,useImperativeHandle:M2,useLayoutEffect:M2,useInsertionEffect:M2,useMemo:M2,useReducer:M2,useRef:M2,useState:M2,useDebugValue:M2,useDeferredValue:M2,useTransition:M2,useSyncExternalStore:M2,useId:M2,useHostTransitionStatus:M2,useFormState:M2,useActionState:M2,useOptimistic:M2,useMemoCache:M2,useCacheRefresh:M2};YG.useEffectEvent=M2;var sO={readContext:v1,use:n3,useCallback:function(J,q){return r2().memoizedState=[J,q===void 0?null:q],J},useContext:v1,useEffect:cY,useImperativeHandle:function(J,q,M){M=M!==null&&M!==void 0?M.concat([J]):null,d8(4194308,4,sY.bind(null,q,J),M)},useLayoutEffect:function(J,q){return d8(4194308,4,J,q)},useInsertionEffect:function(J,q){d8(4,2,J,q)},useMemo:function(J,q){var M=r2();q=q===void 0?null:q;var z=J();if(N7){o(!0);try{J()}finally{o(!1)}}return M.memoizedState=[z,q],z},useReducer:function(J,q,M){var z=r2();if(M!==void 0){var $=M(q);if(N7){o(!0);try{M(q)}finally{o(!1)}}}else $=q;return z.memoizedState=z.baseState=$,J={pending:null,lanes:0,dispatch:null,lastRenderedReducer:J,lastRenderedState:$},z.queue=J,J=J.dispatch=o8.bind(null,z1,J),[z.memoizedState,J]},useRef:function(J){var q=r2();return J={current:J},q.memoizedState=J},useState:function(J){J=p8(J);var q=J.queue,M=r8.bind(null,z1,q);return q.dispatch=M,[J.memoizedState,M]},useDebugValue:t8,useDeferredValue:function(J,q){var M=r2();return k6(M,J,q)},useTransition:function(){var J=p8(!1);return J=eY.bind(null,z1,J.queue,!0,!1),r2().memoizedState=J,[!1,J]},useSyncExternalStore:function(J,q,M){var z=z1,$=r2();if(R1){if(M===void 0)throw Error(Y(407));M=M()}else{if(M=q(),G2===null)throw Error(Y(349));(T1&127)!==0||m6(z,q,M)}$.memoizedState=M;var F={value:M,getSnapshot:q};return $.queue=F,cY(o3.bind(null,z,F,J),[J]),z.flags|=2048,f6(9,{destroy:void 0},u8.bind(null,z,F,M,q),null),M},useId:function(){var J=r2(),q=G2.identifierPrefix;if(R1){var M=L3,z=$3;M=(z&~(1<<32-V4(z)-1)).toString(32)+M,q="_"+q+"R_"+M,M=hK++,0<M&&(q+="H"+M.toString(32)),q+="_"}else M=wT++,q="_"+q+"r_"+M.toString(32)+"_";return J.memoizedState=q},useHostTransitionStatus:j_,useFormState:N_,useActionState:N_,useOptimistic:function(J){var q=r2();q.memoizedState=q.baseState=J;var M={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return q.queue=M,q=z4.bind(null,z1,!0,M),M.dispatch=q,[J,q]},useMemoCache:z_,useCacheRefresh:function(){return r2().memoizedState=n8.bind(null,z1)},useEffectEvent:function(J){var q=r2(),M={impl:J};return q.memoizedState=M,function(){if((L1&2)!==0)throw Error(Y(440));return M.impl.apply(void 0,arguments)}}},Rq={readContext:v1,use:n3,useCallback:oY,useContext:v1,useEffect:J9,useImperativeHandle:nY,useInsertionEffect:aY,useLayoutEffect:tY,useMemo:L_,useReducer:b6,useRef:iY,useState:function(){return b6(A4)},useDebugValue:t8,useDeferredValue:function(J,q){var M=A2();return rY(M,o1.memoizedState,J,q)},useTransition:function(){var J=b6(A4)[0],q=A2().memoizedState;return[typeof J==="boolean"?J:t5(J),q]},useSyncExternalStore:k8,useId:_X,useHostTransitionStatus:j_,useFormState:lY,useActionState:lY,useOptimistic:function(J,q){var M=A2();return kY(M,o1,J,q)},useMemoCache:z_,useCacheRefresh:s8};Rq.useEffectEvent=dY;var nO={readContext:v1,use:n3,useCallback:oY,useContext:v1,useEffect:J9,useImperativeHandle:nY,useInsertionEffect:aY,useLayoutEffect:tY,useMemo:L_,useReducer:H_,useRef:iY,useState:function(){return H_(A4)},useDebugValue:t8,useDeferredValue:function(J,q){var M=A2();return o1===null?k6(M,J,q):rY(M,o1.memoizedState,J,q)},useTransition:function(){var J=H_(A4)[0],q=A2().memoizedState;return[typeof J==="boolean"?J:t5(J),q]},useSyncExternalStore:k8,useId:_X,useHostTransitionStatus:j_,useFormState:$_,useActionState:$_,useOptimistic:function(J,q){var M=A2();if(o1!==null)return kY(M,o1,J,q);return M.baseState=J,[J,M.queue.dispatch]},useMemoCache:z_,useCacheRefresh:s8};nO.useEffectEvent=dY;var Sq={enqueueSetState:function(J,q,M){J=J._reactInternals;var z=o5(),$=F1(z);$.payload=q,M!==void 0&&M!==null&&($.callback=M),q=O3(J,$,z),q!==null&&(h5(q,J,z),A3(q,J,z))},enqueueReplaceState:function(J,q,M){J=J._reactInternals;var z=o5(),$=F1(z);$.tag=1,$.payload=q,M!==void 0&&M!==null&&($.callback=M),q=O3(J,$,z),q!==null&&(h5(q,J,z),A3(q,J,z))},enqueueForceUpdate:function(J,q){J=J._reactInternals;var M=o5(),z=F1(M);z.tag=2,q!==void 0&&q!==null&&(z.callback=q),q=O3(J,z,M),q!==null&&(h5(q,J,M),A3(q,J,M))}},vq=Error(Y(461)),f2=!1,xq={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null},Q6=!1,k2=!1,wq=!1,oO=typeof WeakSet==="function"?WeakSet:Set,G5=null,u2=null,e5=!1,K3=null,k9=8192,gT={getCacheForType:function(J){var q=v1(H2),M=q.data.get(J);return M===void 0&&(M=J(),q.data.set(J,M)),M},cacheSignal:function(){return v1(H2).controller.signal}},_K=0,GK=1,YK=2,XK=3,KK=4;if(typeof Symbol==="function"&&Symbol.for){var XG=Symbol.for;_K=XG("selector.component"),GK=XG("selector.has_pseudo_class"),YK=XG("selector.role"),XK=XG("selector.test_id"),KK=XG("selector.text")}var IT=typeof WeakMap==="function"?WeakMap:Map,L1=0,G2=null,j1=null,T1=0,c1=0,N4=null,K8=!1,u9=!1,gq=!1,D6=0,L2=0,Z8=0,$7=0,Iq=0,$4=0,p9=0,KG=null,h4=null,Pq=!1,ZK=0,rO=0,ZG=1/0,JK=null,J8=null,s2=0,q8=null,l9=null,M6=0,yq=0,bq=null,eO=null,JG=0,mq=null;return M1.attemptContinuousHydration=function(J){if(J.tag===13||J.tag===31){var q=d3(J,67108864);q!==null&&h5(q,J,67108864),i1(J,67108864)}},M1.attemptHydrationAtCurrentPriority=function(J){if(J.tag===13||J.tag===31){var q=o5();q=q0(q);var M=d3(J,q);M!==null&&h5(M,J,q),i1(J,q)}},M1.attemptSynchronousHydration=function(J){switch(J.tag){case 3:if(J=J.stateNode,J.current.memoizedState.isDehydrated){var q=W(J.pendingLanes);if(q!==0){J.pendingLanes|=2;for(J.entangledLanes|=2;q;){var M=1<<31-V4(q);J.entanglements[1]|=M,q&=~M}u0(J),(L1&6)===0&&(ZG=r5()+500,s0(0,!1))}}break;case 31:case 13:q=d3(J,2),q!==null&&h5(q,J,2),WX(),i1(J,2)}},M1.batchedUpdates=function(J,q){return J(q)},M1.createComponentSelector=function(J){return{$$typeof:_K,value:J}},M1.createContainer=function(J,q,M,z,$,F,w,t,B0,L0){return s6(J,q,!1,null,M,z,F,null,w,t,B0,L0)},M1.createHasPseudoClassSelector=function(J){return{$$typeof:GK,value:J}},M1.createHydrationContainer=function(J,q,M,z,$,F,w,t,B0,L0,b0,R0,k0,B1){return J=s6(M,z,!0,J,$,F,t,B1,B0,L0,b0,R0),J.context=n6(null),M=J.current,z=o5(),z=q0(z),$=F1(z),$.callback=q!==void 0&&q!==null?q:null,O3(M,$,z),q=z,J.current.lanes=q,I(J,q),u0(J),J},M1.createPortal=function(J,q,M){var z=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:L9,key:z==null?null:""+z,children:J,containerInfo:q,implementation:M}},M1.createRoleSelector=function(J){return{$$typeof:YK,value:J}},M1.createTestNameSelector=function(J){return{$$typeof:XK,value:J}},M1.createTextSelector=function(J){return{$$typeof:KK,value:J}},M1.defaultOnCaughtError=function(J){console.error(J)},M1.defaultOnRecoverableError=function(J){iO(J)},M1.defaultOnUncaughtError=function(J){iO(J)},M1.deferredUpdates=function(J){var q=o0.T,M=Z6();try{return _5(32),o0.T=null,J()}finally{_5(M),o0.T=q}},M1.discreteUpdates=function(J,q,M,z,$){var F=o0.T,w=Z6();try{return _5(2),o0.T=null,J(q,M,z,$)}finally{_5(w),o0.T=F,L1===0&&(ZG=r5()+500)}},M1.findAllNodes=i_,M1.findBoundingRects=function(J,q){if(!s_)throw Error(Y(363));q=i_(J,q),J=[];for(var M=0;M<q.length;M++)J.push(zF(q[M]));for(q=J.length-1;0<q;q--){M=J[q];for(var z=M.x,$=z+M.width,F=M.y,w=F+M.height,t=q-1;0<=t;t--)if(q!==t){var B0=J[t],L0=B0.x,b0=L0+B0.width,R0=B0.y,k0=R0+B0.height;if(z>=L0&&F>=R0&&$<=b0&&w<=k0){J.splice(q,1);break}else if(!(z!==L0||M.width!==B0.width||k0<F||R0>w)){R0>F&&(B0.height+=R0-F,B0.y=F),k0<w&&(B0.height=w-R0),J.splice(q,1);break}else if(!(F!==R0||M.height!==B0.height||b0<z||L0>$)){L0>z&&(B0.width+=L0-z,B0.x=z),b0<$&&(B0.width=$-L0),J.splice(q,1);break}}}return J},M1.findHostInstance=o6,M1.findHostInstanceWithNoPortals=function(J){return J=Z(J),J=J!==null?D(J):null,J===null?null:t_(J.stateNode)},M1.findHostInstanceWithWarning=function(J){return o6(J)},M1.flushPassiveEffects=X6,M1.flushSyncFromReconciler=function(J){var q=L1;L1|=1;var M=o0.T,z=Z6();try{if(_5(2),o0.T=null,J)return J()}finally{_5(z),o0.T=M,L1=q,(L1&6)===0&&s0(0,!1)}},M1.flushSyncWork=WX,M1.focusWithin=function(J,q){if(!s_)throw Error(Y(363));J=p_(J),q=TX(J,q),q=Array.from(q);for(J=0;J<q.length;){var M=q[J++],z=M.tag;if(!n_(M)){if((z===5||z===26||z===27)&&UF(M.stateNode))return!0;for(M=M.child;M!==null;)q.push(M),M=M.sibling}}return!1},M1.getFindAllNodesFailureDescription=function(J,q){if(!s_)throw Error(Y(363));var M=0,z=[];J=[p_(J),0];for(var $=0;$<J.length;){var F=J[$++],w=F.tag,t=J[$++],B0=q[t];if(w!==5&&w!==26&&w!==27||!n_(F)){if(g4(F,B0)&&(z.push(l_(B0)),t++,t>M&&(M=t)),t<q.length)for(F=F.child;F!==null;)J.push(F,t),F=F.sibling}}if(M<q.length){for(J=[];M<q.length;M++)J.push(l_(q[M]));return`findAllNodes was able to match part of the selector:
|
|
23
|
-
`+(z.join(" > ")+`
|
|
24
|
-
|
|
25
|
-
No matching component was found for:
|
|
26
|
-
`)+J.join(" > ")}return null},M1.getPublicRootInstance=function(J){if(J=J.current,!J.child)return null;switch(J.child.tag){case 27:case 5:return t_(J.child.stateNode);default:return J.child.stateNode}},M1.injectIntoDevTools=function(){var J={bundleType:0,version:aj,rendererPackageName:tj,currentDispatcherRef:o0,reconcilerVersion:"19.2.0"};if(CO!==null&&(J.rendererConfig=CO),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")J=!1;else{var q=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(q.isDisabled||!q.supportsFiber)J=!0;else{try{o_=q.inject(J),U4=q}catch(M){}J=q.checkDCE?!0:!1}}return J},M1.isAlreadyRendering=function(){return(L1&6)!==0},M1.observeVisibleRects=function(J,q,M,z){if(!s_)throw Error(Y(363));J=i_(J,q);var $=EF(J,M,z).disconnect;return{disconnect:function(){$()}}},M1.shouldError=function(){return null},M1.shouldSuspend=function(){return!1},M1.startHostTransition=function(J,q,M,z){if(J.tag!==5)throw Error(Y(476));var $=hX(J).queue;eY(J,$,q,F9,M===null?G:function(){var F=hX(J);return F.next===null&&(F=J.alternate.memoizedState),O5(J,F.next.queue,{},o5()),M(z)})},M1.updateContainer=function(J,q,M,z){var $=q.current,F=o5();return r6($,F,J,q,M,z),F},M1.updateContainerSync=function(J,q,M,z){return r6(q.current,2,J,q,M,z),2},M1};bY.exports.default=bY.exports;Object.defineProperty(bY.exports,"__esModule",{value:!0})});var Fj=U1((z50,jj)=>{var i3=S1(l2());jj.exports=function(_,G,Y){let X=i3.useRef("loading"),K=i3.useRef(),[Z,Q]=i3.useState(0),D=i3.useRef(),O=i3.useRef(),A=i3.useRef();if(D.current!==_||O.current!==G||A.current!==Y)X.current="loading",K.current=void 0,D.current=_,O.current=G,A.current=Y;return i3.useLayoutEffect(function(){if(!_)return;var H=document.createElement("img");function C(){H.decode().catch(()=>{}).finally(()=>{X.current="loaded",K.current=H,Q(Math.random())})}function N(){X.current="failed",K.current=void 0,Q(Math.random())}return H.addEventListener("load",C),H.addEventListener("error",N),G&&(H.crossOrigin=G),Y&&(H.referrerPolicy=Y),H.src=_,function(){H.removeEventListener("load",C),H.removeEventListener("error",N)}},[_,G,Y]),[K.current,X.current]}});function Ik(h){if(!h||h.length<2)return null;let _=[...h].sort((G,Y)=>Y.version-G.version);return{left:_[0],right:_[1]}}function hA(h,_){return Math.max(0,Math.min(h,Math.max(0,_-1)))}var r4=S1(l2(),1);var kK=S1(l2(),1);function b5(){}function qK(){}function _A(h,_){let G=_||{};return(h[h.length-1]===""?[...h,""]:h).join((G.padRight?" ":"")+","+(G.padLeft===!1?"":" ")).trim()}var yT=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,bT=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,mT={};function QK(h,_){return((_||mT).jsx?bT:yT).test(h)}var fT=/[ \t\n\f\r]/g;function fq(h){return typeof h==="object"?h.type==="text"?GA(h.value):!1:GA(h)}function GA(h){return h.replace(fT,"")===""}class D8{constructor(h,_,G){if(this.normal=_,this.property=h,G)this.space=G}}D8.prototype.normal={};D8.prototype.property={};D8.prototype.space=void 0;function kq(h,_){let G={},Y={};for(let X of h)Object.assign(G,X.property),Object.assign(Y,X.normal);return new D8(G,Y,_)}function QG(h){return h.toLowerCase()}class E5{constructor(h,_){this.attribute=_,this.property=h}}E5.prototype.attribute="";E5.prototype.booleanish=!1;E5.prototype.boolean=!1;E5.prototype.commaOrSpaceSeparated=!1;E5.prototype.commaSeparated=!1;E5.prototype.defined=!1;E5.prototype.mustUseProperty=!1;E5.prototype.number=!1;E5.prototype.overloadedBoolean=!1;E5.prototype.property="";E5.prototype.spaceSeparated=!1;E5.prototype.space=void 0;var DG={};uq(DG,{spaceSeparated:()=>k1,overloadedBoolean:()=>DK,number:()=>F0,commaSeparated:()=>B6,commaOrSpaceSeparated:()=>_4,booleanish:()=>j2,boolean:()=>K1});var kT=0,K1=j7(),j2=j7(),DK=j7(),F0=j7(),k1=j7(),B6=j7(),_4=j7();function j7(){return 2**++kT}var pq=Object.keys(DG);class i9 extends E5{constructor(h,_,G,Y){let X=-1;super(h,_);if(YA(this,"space",Y),typeof G==="number")while(++X<pq.length){let K=pq[X];YA(this,pq[X],(G&DG[K])===DG[K])}}}i9.prototype.defined=!0;function YA(h,_,G){if(G)h[_]=G}function f4(h){let _={},G={};for(let[Y,X]of Object.entries(h.properties)){let K=new i9(Y,h.transform(h.attributes||{},Y),X,h.space);if(h.mustUseProperty&&h.mustUseProperty.includes(Y))K.mustUseProperty=!0;_[Y]=K,G[QG(Y)]=Y,G[QG(K.attribute)]=Y}return new D8(_,G,h.space)}var lq=f4({properties:{ariaActiveDescendant:null,ariaAtomic:j2,ariaAutoComplete:null,ariaBusy:j2,ariaChecked:j2,ariaColCount:F0,ariaColIndex:F0,ariaColSpan:F0,ariaControls:k1,ariaCurrent:null,ariaDescribedBy:k1,ariaDetails:null,ariaDisabled:j2,ariaDropEffect:k1,ariaErrorMessage:null,ariaExpanded:j2,ariaFlowTo:k1,ariaGrabbed:j2,ariaHasPopup:null,ariaHidden:j2,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:k1,ariaLevel:F0,ariaLive:null,ariaModal:j2,ariaMultiLine:j2,ariaMultiSelectable:j2,ariaOrientation:null,ariaOwns:k1,ariaPlaceholder:null,ariaPosInSet:F0,ariaPressed:j2,ariaReadOnly:j2,ariaRelevant:null,ariaRequired:j2,ariaRoleDescription:k1,ariaRowCount:F0,ariaRowIndex:F0,ariaRowSpan:F0,ariaSelected:j2,ariaSetSize:F0,ariaSort:null,ariaValueMax:F0,ariaValueMin:F0,ariaValueNow:F0,ariaValueText:null,role:null},transform(h,_){return _==="role"?_:"aria-"+_.slice(4).toLowerCase()}});function MK(h,_){return _ in h?h[_]:_}function BK(h,_){return MK(h,_.toLowerCase())}var XA=f4({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:B6,acceptCharset:k1,accessKey:k1,action:null,allow:null,allowFullScreen:K1,allowPaymentRequest:K1,allowUserMedia:K1,alpha:K1,alt:null,as:null,async:K1,autoCapitalize:null,autoComplete:k1,autoFocus:K1,autoPlay:K1,blocking:k1,capture:null,charSet:null,checked:K1,cite:null,className:k1,closedBy:null,colorSpace:null,cols:F0,colSpan:F0,command:null,commandFor:null,content:null,contentEditable:j2,controls:K1,controlsList:k1,coords:F0|B6,crossOrigin:null,data:null,dateTime:null,decoding:null,default:K1,defer:K1,dir:null,dirName:null,disabled:K1,download:DK,draggable:j2,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:K1,formTarget:null,headers:k1,height:F0,hidden:DK,high:F0,href:null,hrefLang:null,htmlFor:k1,httpEquiv:k1,id:null,imageSizes:null,imageSrcSet:null,inert:K1,inputMode:null,integrity:null,is:null,isMap:K1,itemId:null,itemProp:k1,itemRef:k1,itemScope:K1,itemType:k1,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:K1,low:F0,manifest:null,max:null,maxLength:F0,media:null,method:null,min:null,minLength:F0,multiple:K1,muted:K1,name:null,nonce:null,noModule:K1,noValidate:K1,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:K1,optimum:F0,pattern:null,ping:k1,placeholder:null,playsInline:K1,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:K1,referrerPolicy:null,rel:k1,required:K1,reversed:K1,rows:F0,rowSpan:F0,sandbox:k1,scope:null,scoped:K1,seamless:K1,selected:K1,shadowRootClonable:K1,shadowRootCustomElementRegistry:K1,shadowRootDelegatesFocus:K1,shadowRootMode:null,shadowRootSerializable:K1,shape:null,size:F0,sizes:null,slot:null,span:F0,spellCheck:j2,src:null,srcDoc:null,srcLang:null,srcSet:null,start:F0,step:null,style:null,tabIndex:F0,target:null,title:null,translate:null,type:null,typeMustMatch:K1,useMap:null,value:j2,width:F0,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:k1,axis:null,background:null,bgColor:null,border:F0,borderColor:null,bottomMargin:F0,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:K1,declare:K1,event:null,face:null,frame:null,frameBorder:null,hSpace:F0,leftMargin:F0,link:null,longDesc:null,lowSrc:null,marginHeight:F0,marginWidth:F0,noResize:K1,noHref:K1,noShade:K1,noWrap:K1,object:null,profile:null,prompt:null,rev:null,rightMargin:F0,rules:null,scheme:null,scrolling:j2,standby:null,summary:null,text:null,topMargin:F0,valueType:null,version:null,vAlign:null,vLink:null,vSpace:F0,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:K1,disablePictureInPicture:K1,disableRemotePlayback:K1,exportParts:B6,part:k1,prefix:null,property:null,results:F0,security:null,unselectable:null},space:"html",transform:BK});var KA=f4({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:_4,accentHeight:F0,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:F0,amplitude:F0,arabicForm:null,ascent:F0,attributeName:null,attributeType:null,azimuth:F0,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:F0,by:null,calcMode:null,capHeight:F0,className:k1,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:F0,diffuseConstant:F0,direction:null,display:null,dur:null,divisor:F0,dominantBaseline:null,download:K1,dx:null,dy:null,edgeMode:null,editable:null,elevation:F0,enableBackground:null,end:null,event:null,exponent:F0,externalResourcesRequired:null,fill:null,fillOpacity:F0,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:B6,g2:B6,glyphName:B6,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:F0,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:F0,horizOriginX:F0,horizOriginY:F0,id:null,ideographic:F0,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:F0,k:F0,k1:F0,k2:F0,k3:F0,k4:F0,kernelMatrix:_4,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:F0,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:F0,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:F0,overlineThickness:F0,paintOrder:null,panose1:null,path:null,pathLength:F0,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:k1,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:F0,pointsAtY:F0,pointsAtZ:F0,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:_4,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:_4,rev:_4,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:_4,requiredFeatures:_4,requiredFonts:_4,requiredFormats:_4,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:F0,specularExponent:F0,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:F0,strikethroughThickness:F0,string:null,stroke:null,strokeDashArray:_4,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:F0,strokeOpacity:F0,strokeWidth:null,style:null,surfaceScale:F0,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:_4,tabIndex:F0,tableValues:null,target:null,targetX:F0,targetY:F0,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:_4,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:F0,underlineThickness:F0,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:F0,values:null,vAlphabetic:F0,vMathematical:F0,vectorEffect:null,vHanging:F0,vIdeographic:F0,version:null,vertAdvY:F0,vertOriginX:F0,vertOriginY:F0,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:F0,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:MK});var iq=f4({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(h,_){return"xlink:"+_.slice(5).toLowerCase()}});var cq=f4({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:BK});var dq=f4({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(h,_){return"xml:"+_.slice(3).toLowerCase()}});var aq={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};var uT=/[A-Z]/g,ZA=/-[a-z]/g,pT=/^data[-\w.:]+$/i;function tq(h,_){let G=QG(_),Y=_,X=E5;if(G in h.normal)return h.property[h.normal[G]];if(G.length>4&&G.slice(0,4)==="data"&&pT.test(_)){if(_.charAt(4)==="-"){let K=_.slice(5).replace(ZA,iT);Y="data"+K.charAt(0).toUpperCase()+K.slice(1)}else{let K=_.slice(4);if(!ZA.test(K)){let Z=K.replace(uT,lT);if(Z.charAt(0)!=="-")Z="-"+Z;_="data"+Z}}X=i9}return new X(Y,_)}function lT(h){return"-"+h.toLowerCase()}function iT(h){return h.charAt(1).toUpperCase()}var JA=kq([lq,XA,iq,cq,dq],"html"),OK=kq([lq,KA,iq,cq,dq],"svg");function qA(h){return h.join(" ").trim()}var FA=S1(NA(),1);var AK=$A("end"),c9=$A("start");function $A(h){return _;function _(G){let Y=G&&G.position&&G.position[h]||{};if(typeof Y.line==="number"&&Y.line>0&&typeof Y.column==="number"&&Y.column>0)return{line:Y.line,column:Y.column,offset:typeof Y.offset==="number"&&Y.offset>-1?Y.offset:void 0}}}function oq(h){let _=c9(h),G=AK(h);if(_&&G)return{start:_,end:G}}function M8(h){if(!h||typeof h!=="object")return"";if("position"in h||"type"in h)return LA(h.position);if("start"in h||"end"in h)return LA(h);if("line"in h||"column"in h)return rq(h);return""}function rq(h){return jA(h&&h.line)+":"+jA(h&&h.column)}function LA(h){return rq(h&&h.start)+"-"+rq(h&&h.end)}function jA(h){return h&&typeof h==="number"?h:1}class p2 extends Error{constructor(h,_,G){super();if(typeof _==="string")G=_,_=void 0;let Y="",X={},K=!1;if(_)if("line"in _&&"column"in _)X={place:_};else if("start"in _&&"end"in _)X={place:_};else if("type"in _)X={ancestors:[_],place:_.position};else X={..._};if(typeof h==="string")Y=h;else if(!X.cause&&h)K=!0,Y=h.message,X.cause=h;if(!X.ruleId&&!X.source&&typeof G==="string"){let Q=G.indexOf(":");if(Q===-1)X.ruleId=G;else X.source=G.slice(0,Q),X.ruleId=G.slice(Q+1)}if(!X.place&&X.ancestors&&X.ancestors){let Q=X.ancestors[X.ancestors.length-1];if(Q)X.place=Q.position}let Z=X.place&&"start"in X.place?X.place.start:X.place;this.ancestors=X.ancestors||void 0,this.cause=X.cause||void 0,this.column=Z?Z.column:void 0,this.fatal=void 0,this.file="",this.message=Y,this.line=Z?Z.line:void 0,this.name=M8(X.place)||"1:1",this.place=X.place||void 0,this.reason=this.message,this.ruleId=X.ruleId||void 0,this.source=X.source||void 0,this.stack=K&&X.cause&&typeof X.cause.stack==="string"?X.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}p2.prototype.file="";p2.prototype.name="";p2.prototype.reason="";p2.prototype.message="";p2.prototype.stack="";p2.prototype.column=void 0;p2.prototype.line=void 0;p2.prototype.ancestors=void 0;p2.prototype.cause=void 0;p2.prototype.fatal=void 0;p2.prototype.place=void 0;p2.prototype.ruleId=void 0;p2.prototype.source=void 0;var eq={}.hasOwnProperty,HW=new Map,VW=/[A-Z]/g,UW=new Set(["table","tbody","thead","tfoot","tr"]),EW=new Set(["td","th"]),TA="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function hQ(h,_){if(!_||_.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let G=_.filePath||void 0,Y;if(_.development){if(typeof _.jsxDEV!=="function")throw TypeError("Expected `jsxDEV` in options when `development: true`");Y=WW(G,_.jsxDEV)}else{if(typeof _.jsx!=="function")throw TypeError("Expected `jsx` in production options");if(typeof _.jsxs!=="function")throw TypeError("Expected `jsxs` in production options");Y=TW(G,_.jsx,_.jsxs)}let X={Fragment:_.Fragment,ancestors:[],components:_.components||{},create:Y,elementAttributeNameCase:_.elementAttributeNameCase||"react",evaluater:_.createEvaluater?_.createEvaluater():void 0,filePath:G,ignoreInvalidStyle:_.ignoreInvalidStyle||!1,passKeys:_.passKeys!==!1,passNode:_.passNode||!1,schema:_.space==="svg"?OK:JA,stylePropertyNameCase:_.stylePropertyNameCase||"dom",tableCellAlignToStyle:_.tableCellAlignToStyle!==!1},K=WA(X,h,void 0);if(K&&typeof K!=="string")return K;return X.create(h,X.Fragment,{children:K||void 0},void 0)}function WA(h,_,G){if(_.type==="element")return CW(h,_,G);if(_.type==="mdxFlowExpression"||_.type==="mdxTextExpression")return NW(h,_);if(_.type==="mdxJsxFlowElement"||_.type==="mdxJsxTextElement")return LW(h,_,G);if(_.type==="mdxjsEsm")return $W(h,_);if(_.type==="root")return jW(h,_,G);if(_.type==="text")return FW(h,_)}function CW(h,_,G){let Y=h.schema,X=Y;if(_.tagName.toLowerCase()==="svg"&&Y.space==="html")X=OK,h.schema=X;h.ancestors.push(_);let K=SA(h,_.tagName,!1),Z=RW(h,_),Q=GQ(h,_);if(UW.has(_.tagName))Q=Q.filter(function(D){return typeof D==="string"?!fq(D):!0});return RA(h,Z,K,_),_Q(Z,Q),h.ancestors.pop(),h.schema=Y,h.create(_,K,Z,G)}function NW(h,_){if(_.data&&_.data.estree&&h.evaluater){let Y=_.data.estree.body[0];return b5(Y.type==="ExpressionStatement"),h.evaluater.evaluateExpression(Y.expression)}BG(h,_.position)}function $W(h,_){if(_.data&&_.data.estree&&h.evaluater)return h.evaluater.evaluateProgram(_.data.estree);BG(h,_.position)}function LW(h,_,G){let Y=h.schema,X=Y;if(_.name==="svg"&&Y.space==="html")X=OK,h.schema=X;h.ancestors.push(_);let K=_.name===null?h.Fragment:SA(h,_.name,!0),Z=SW(h,_),Q=GQ(h,_);return RA(h,Z,K,_),_Q(Z,Q),h.ancestors.pop(),h.schema=Y,h.create(_,K,Z,G)}function jW(h,_,G){let Y={};return _Q(Y,GQ(h,_)),h.create(_,h.Fragment,Y,G)}function FW(h,_){return _.value}function RA(h,_,G,Y){if(typeof G!=="string"&&G!==h.Fragment&&h.passNode)_.node=Y}function _Q(h,_){if(_.length>0){let G=_.length>1?_:_[0];if(G)h.children=G}}function TW(h,_,G){return Y;function Y(X,K,Z,Q){let O=Array.isArray(Z.children)?G:_;return Q?O(K,Z,Q):O(K,Z)}}function WW(h,_){return G;function G(Y,X,K,Z){let Q=Array.isArray(K.children),D=c9(Y);return _(X,K,Z,Q,{columnNumber:D?D.column-1:void 0,fileName:h,lineNumber:D?D.line:void 0},void 0)}}function RW(h,_){let G={},Y,X;for(X in _.properties)if(X!=="children"&&eq.call(_.properties,X)){let K=vW(h,X,_.properties[X]);if(K){let[Z,Q]=K;if(h.tableCellAlignToStyle&&Z==="align"&&typeof Q==="string"&&EW.has(_.tagName))Y=Q;else G[Z]=Q}}if(Y){let K=G.style||(G.style={});K[h.stylePropertyNameCase==="css"?"text-align":"textAlign"]=Y}return G}function SW(h,_){let G={};for(let Y of _.attributes)if(Y.type==="mdxJsxExpressionAttribute")if(Y.data&&Y.data.estree&&h.evaluater){let K=Y.data.estree.body[0];b5(K.type==="ExpressionStatement");let Z=K.expression;b5(Z.type==="ObjectExpression");let Q=Z.properties[0];b5(Q.type==="SpreadElement"),Object.assign(G,h.evaluater.evaluateExpression(Q.argument))}else BG(h,_.position);else{let X=Y.name,K;if(Y.value&&typeof Y.value==="object")if(Y.value.data&&Y.value.data.estree&&h.evaluater){let Q=Y.value.data.estree.body[0];b5(Q.type==="ExpressionStatement"),K=h.evaluater.evaluateExpression(Q.expression)}else BG(h,_.position);else K=Y.value===null?!0:Y.value;G[X]=K}return G}function GQ(h,_){let G=[],Y=-1,X=h.passKeys?new Map:HW;while(++Y<_.children.length){let K=_.children[Y],Z;if(h.passKeys){let D=K.type==="element"?K.tagName:K.type==="mdxJsxFlowElement"||K.type==="mdxJsxTextElement"?K.name:void 0;if(D){let O=X.get(D)||0;Z=D+"-"+O,X.set(D,O+1)}}let Q=WA(h,K,Z);if(Q!==void 0)G.push(Q)}return G}function vW(h,_,G){let Y=tq(h.schema,_);if(G===null||G===void 0||typeof G==="number"&&Number.isNaN(G))return;if(Array.isArray(G))G=Y.commaSeparated?_A(G):qA(G);if(Y.property==="style"){let X=typeof G==="object"?G:xW(h,String(G));if(h.stylePropertyNameCase==="css")X=wW(X);return["style",X]}return[h.elementAttributeNameCase==="react"&&Y.space?aq[Y.property]||Y.property:Y.attribute,G]}function xW(h,_){try{return FA.default(_,{reactCompat:!0})}catch(G){if(h.ignoreInvalidStyle)return{};let Y=G,X=new p2("Cannot parse `style` attribute",{ancestors:h.ancestors,cause:Y,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw X.file=h.filePath||void 0,X.url=TA+"#cannot-parse-style-attribute",X}}function SA(h,_,G){let Y;if(!G)Y={type:"Literal",value:_};else if(_.includes(".")){let X=_.split("."),K=-1,Z;while(++K<X.length){let Q=QK(X[K])?{type:"Identifier",name:X[K]}:{type:"Literal",value:X[K]};Z=Z?{type:"MemberExpression",object:Z,property:Q,computed:Boolean(K&&Q.type==="Literal"),optional:!1}:Q}b5(Z,"always a result"),Y=Z}else Y=QK(_)&&!/^[a-z]/.test(_)?{type:"Identifier",name:_}:{type:"Literal",value:_};if(Y.type==="Literal"){let X=Y.value;return eq.call(h.components,X)?h.components[X]:X}if(h.evaluater)return h.evaluater.evaluateExpression(Y);BG(h)}function BG(h,_){let G=new p2("Cannot handle MDX estrees without `createEvaluater`",{ancestors:h.ancestors,place:_,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw G.file=h.filePath||void 0,G.url=TA+"#cannot-handle-mdx-estrees-without-createevaluater",G}function wW(h){let _={},G;for(G in h)if(eq.call(h,G))_[gW(G)]=h[G];return _}function gW(h){let _=h.replace(VW,IW);if(_.slice(0,3)==="ms-")_="-"+_;return _}function IW(h){return"-"+h.toLowerCase()}var OG={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]};var _H=S1(l2(),1);var PW={};function YQ(h,_){let G=_||PW,Y=typeof G.includeImageAlt==="boolean"?G.includeImageAlt:!0,X=typeof G.includeHtml==="boolean"?G.includeHtml:!0;return xA(h,Y,X)}function xA(h,_,G){if(yW(h)){if("value"in h)return h.type==="html"&&!G?"":h.value;if(_&&"alt"in h&&h.alt)return h.alt;if("children"in h)return vA(h.children,_,G)}if(Array.isArray(h))return vA(h,_,G);return""}function vA(h,_,G){let Y=[],X=-1;while(++X<h.length)Y[X]=xA(h[X],_,G);return Y.join("")}function yW(h){return Boolean(h&&typeof h==="object")}var wA=document.createElement("i");function d9(h){let _="&"+h+";";wA.innerHTML=_;let G=wA.textContent;if(G.charCodeAt(G.length-1)===59&&h!=="semi")return!1;return G===_?!1:G}function C5(h,_,G,Y){let X=h.length,K=0,Z;if(_<0)_=-_>X?0:X+_;else _=_>X?X:_;if(G=G>0?G:0,Y.length<1e4)Z=Array.from(Y),Z.unshift(_,G),h.splice(...Z);else{if(G)h.splice(_,G);while(K<Y.length)Z=Y.slice(K,K+1e4),Z.unshift(_,0),h.splice(...Z),K+=1e4,_+=1e4}}function m5(h,_){if(h.length>0)return C5(h,h.length,0,_),h;return _}var gA={}.hasOwnProperty;function IA(h){let _={},G=-1;while(++G<h.length)bW(_,h[G]);return _}function bW(h,_){let G;for(G in _){let X=(gA.call(h,G)?h[G]:void 0)||(h[G]={}),K=_[G],Z;if(K)for(Z in K){if(!gA.call(X,Z))X[Z]=[];let Q=K[Z];mW(X[Z],Array.isArray(Q)?Q:Q?[Q]:[])}}}function mW(h,_){let G=-1,Y=[];while(++G<_.length)(_[G].add==="after"?h:Y).push(_[G]);C5(h,0,0,Y)}function zK(h,_){let G=Number.parseInt(h,_);if(G<9||G===11||G>13&&G<32||G>126&&G<160||G>55295&&G<57344||G>64975&&G<65008||(G&65535)===65535||(G&65535)===65534||G>1114111)return"�";return String.fromCodePoint(G)}function O6(h){return h.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var L4=B8(/[A-Za-z]/),X5=B8(/[\dA-Za-z]/),PA=B8(/[#-'*+\--9=?A-Z^-~]/);function AG(h){return h!==null&&(h<32||h===127)}var zG=B8(/\d/),yA=B8(/[\dA-Fa-f]/),bA=B8(/[!-/:-@[-`{-~]/);function p0(h){return h!==null&&h<-2}function g2(h){return h!==null&&(h<0||h===32)}function J1(h){return h===-2||h===-1||h===32}var mA=B8(/\p{P}|\p{S}/u),fA=B8(/\s/);function B8(h){return _;function _(G){return G!==null&&G>-1&&h.test(String.fromCharCode(G))}}function k4(h){let _=[],G=-1,Y=0,X=0;while(++G<h.length){let K=h.charCodeAt(G),Z="";if(K===37&&X5(h.charCodeAt(G+1))&&X5(h.charCodeAt(G+2)))X=2;else if(K<128){if(!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(K)))Z=String.fromCharCode(K)}else if(K>55295&&K<57344){let Q=h.charCodeAt(G+1);if(K<56320&&Q>56319&&Q<57344)Z=String.fromCharCode(K,Q),X=1;else Z="�"}else Z=String.fromCharCode(K);if(Z)_.push(h.slice(Y,G),encodeURIComponent(Z)),Y=G+X+1,Z="";if(X)G+=X,X=0}return _.join("")+h.slice(Y)}function O1(h,_,G,Y){let X=Y?Y-1:Number.POSITIVE_INFINITY,K=0;return Z;function Z(D){if(J1(D))return h.enter(G),Q(D);return _(D)}function Q(D){if(J1(D)&&K++<X)return h.consume(D),Q;return h.exit(G),_(D)}}var kA={tokenize:fW};function fW(h){let _=h.attempt(this.parser.constructs.contentInitial,Y,X),G;return _;function Y(Q){if(Q===null){h.consume(Q);return}return h.enter("lineEnding"),h.consume(Q),h.exit("lineEnding"),O1(h,_,"linePrefix")}function X(Q){return h.enter("paragraph"),K(Q)}function K(Q){let D=h.enter("chunkText",{contentType:"text",previous:G});if(G)G.next=D;return G=D,Z(Q)}function Z(Q){if(Q===null){h.exit("chunkText"),h.exit("paragraph"),h.consume(Q);return}if(p0(Q))return h.consume(Q),h.exit("chunkText"),K;return h.consume(Q),Z}}var pA={tokenize:kW},uA={tokenize:uW};function kW(h){let _=this,G=[],Y=0,X,K,Z;return Q;function Q(x){if(Y<G.length){let P=G[Y];return _.containerState=P[1],h.attempt(P[0].continuation,D,O)(x)}return O(x)}function D(x){if(Y++,_.containerState._closeFlow){if(_.containerState._closeFlow=void 0,X)v();let P=_.events.length,I=P,b;while(I--)if(_.events[I][0]==="exit"&&_.events[I][1].type==="chunkFlow"){b=_.events[I][1].end;break}R(Y);let l=P;while(l<_.events.length)_.events[l][1].end={...b},l++;return C5(_.events,I+1,0,_.events.slice(P)),_.events.length=l,O(x)}return Q(x)}function O(x){if(Y===G.length){if(!X)return C(x);if(X.currentConstruct&&X.currentConstruct.concrete)return j(x);_.interrupt=Boolean(X.currentConstruct&&!X._gfmTableDynamicInterruptHack)}return _.containerState={},h.check(uA,A,H)(x)}function A(x){if(X)v();return R(Y),C(x)}function H(x){return _.parser.lazy[_.now().line]=Y!==G.length,Z=_.now().offset,j(x)}function C(x){return _.containerState={},h.attempt(uA,N,j)(x)}function N(x){return Y++,G.push([_.currentConstruct,_.containerState]),C(x)}function j(x){if(x===null){if(X)v();R(0),h.consume(x);return}return X=X||_.parser.flow(_.now()),h.enter("chunkFlow",{_tokenizer:X,contentType:"flow",previous:K}),W(x)}function W(x){if(x===null){S(h.exit("chunkFlow"),!0),R(0),h.consume(x);return}if(p0(x))return h.consume(x),S(h.exit("chunkFlow")),Y=0,_.interrupt=void 0,Q;return h.consume(x),W}function S(x,P){let I=_.sliceStream(x);if(P)I.push(null);if(x.previous=K,K)K.next=x;if(K=x,X.defineSkip(x.start),X.write(I),_.parser.lazy[x.start.line]){let b=X.events.length;while(b--)if(X.events[b][1].start.offset<Z&&(!X.events[b][1].end||X.events[b][1].end.offset>Z))return;let l=_.events.length,i=l,h0,q0;while(i--)if(_.events[i][0]==="exit"&&_.events[i][1].type==="chunkFlow"){if(h0){q0=_.events[i][1].end;break}h0=!0}R(Y),b=l;while(b<_.events.length)_.events[b][1].end={...q0},b++;C5(_.events,i+1,0,_.events.slice(l)),_.events.length=b}}function R(x){let P=G.length;while(P-- >x){let I=G[P];_.containerState=I[1],I[0].exit.call(_,h)}G.length=x}function v(){X.write([null]),K=void 0,X=void 0,_.containerState._closeFlow=void 0}}function uW(h,_,G){return O1(h,h.attempt(this.parser.constructs.document,_,G),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function XQ(h){if(h===null||g2(h)||fA(h))return 1;if(mA(h))return 2}function a9(h,_,G){let Y=[],X=-1;while(++X<h.length){let K=h[X].resolveAll;if(K&&!Y.includes(K))_=K(_,G),Y.push(K)}return _}var HG={name:"attention",resolveAll:pW,tokenize:lW};function pW(h,_){let G=-1,Y,X,K,Z,Q,D,O,A;while(++G<h.length)if(h[G][0]==="enter"&&h[G][1].type==="attentionSequence"&&h[G][1]._close){Y=G;while(Y--)if(h[Y][0]==="exit"&&h[Y][1].type==="attentionSequence"&&h[Y][1]._open&&_.sliceSerialize(h[Y][1]).charCodeAt(0)===_.sliceSerialize(h[G][1]).charCodeAt(0)){if((h[Y][1]._close||h[G][1]._open)&&(h[G][1].end.offset-h[G][1].start.offset)%3&&!((h[Y][1].end.offset-h[Y][1].start.offset+h[G][1].end.offset-h[G][1].start.offset)%3))continue;D=h[Y][1].end.offset-h[Y][1].start.offset>1&&h[G][1].end.offset-h[G][1].start.offset>1?2:1;let H={...h[Y][1].end},C={...h[G][1].start};if(lA(H,-D),lA(C,D),Z={type:D>1?"strongSequence":"emphasisSequence",start:H,end:{...h[Y][1].end}},Q={type:D>1?"strongSequence":"emphasisSequence",start:{...h[G][1].start},end:C},K={type:D>1?"strongText":"emphasisText",start:{...h[Y][1].end},end:{...h[G][1].start}},X={type:D>1?"strong":"emphasis",start:{...Z.start},end:{...Q.end}},h[Y][1].end={...Z.start},h[G][1].start={...Q.end},O=[],h[Y][1].end.offset-h[Y][1].start.offset)O=m5(O,[["enter",h[Y][1],_],["exit",h[Y][1],_]]);if(O=m5(O,[["enter",X,_],["enter",Z,_],["exit",Z,_],["enter",K,_]]),O=m5(O,a9(_.parser.constructs.insideSpan.null,h.slice(Y+1,G),_)),O=m5(O,[["exit",K,_],["enter",Q,_],["exit",Q,_],["exit",X,_]]),h[G][1].end.offset-h[G][1].start.offset)A=2,O=m5(O,[["enter",h[G][1],_],["exit",h[G][1],_]]);else A=0;C5(h,Y-1,G-Y+3,O),G=Y+O.length-A-2;break}}G=-1;while(++G<h.length)if(h[G][1].type==="attentionSequence")h[G][1].type="data";return h}function lW(h,_){let G=this.parser.constructs.attentionMarkers.null,Y=this.previous,X=XQ(Y),K;return Z;function Z(D){return K=D,h.enter("attentionSequence"),Q(D)}function Q(D){if(D===K)return h.consume(D),Q;let O=h.exit("attentionSequence"),A=XQ(D),H=!A||A===2&&X||G.includes(D),C=!X||X===2&&A||G.includes(Y);return O._open=Boolean(K===42?H:H&&(X||!C)),O._close=Boolean(K===42?C:C&&(A||!H)),_(D)}}function lA(h,_){h.column+=_,h.offset+=_,h._bufferIndex+=_}var KQ={name:"autolink",tokenize:iW};function iW(h,_,G){let Y=0;return X;function X(N){return h.enter("autolink"),h.enter("autolinkMarker"),h.consume(N),h.exit("autolinkMarker"),h.enter("autolinkProtocol"),K}function K(N){if(L4(N))return h.consume(N),Z;if(N===64)return G(N);return O(N)}function Z(N){if(N===43||N===45||N===46||X5(N))return Y=1,Q(N);return O(N)}function Q(N){if(N===58)return h.consume(N),Y=0,D;if((N===43||N===45||N===46||X5(N))&&Y++<32)return h.consume(N),Q;return Y=0,O(N)}function D(N){if(N===62)return h.exit("autolinkProtocol"),h.enter("autolinkMarker"),h.consume(N),h.exit("autolinkMarker"),h.exit("autolink"),_;if(N===null||N===32||N===60||AG(N))return G(N);return h.consume(N),D}function O(N){if(N===64)return h.consume(N),A;if(PA(N))return h.consume(N),O;return G(N)}function A(N){return X5(N)?H(N):G(N)}function H(N){if(N===46)return h.consume(N),Y=0,A;if(N===62)return h.exit("autolinkProtocol").type="autolinkEmail",h.enter("autolinkMarker"),h.consume(N),h.exit("autolinkMarker"),h.exit("autolink"),_;return C(N)}function C(N){if((N===45||X5(N))&&Y++<63){let j=N===45?C:H;return h.consume(N),j}return G(N)}}var O8={partial:!0,tokenize:cW};function cW(h,_,G){return Y;function Y(K){return J1(K)?O1(h,X,"linePrefix")(K):X(K)}function X(K){return K===null||p0(K)?_(K):G(K)}}var HK={continuation:{tokenize:aW},exit:tW,name:"blockQuote",tokenize:dW};function dW(h,_,G){let Y=this;return X;function X(Z){if(Z===62){let Q=Y.containerState;if(!Q.open)h.enter("blockQuote",{_container:!0}),Q.open=!0;return h.enter("blockQuotePrefix"),h.enter("blockQuoteMarker"),h.consume(Z),h.exit("blockQuoteMarker"),K}return G(Z)}function K(Z){if(J1(Z))return h.enter("blockQuotePrefixWhitespace"),h.consume(Z),h.exit("blockQuotePrefixWhitespace"),h.exit("blockQuotePrefix"),_;return h.exit("blockQuotePrefix"),_(Z)}}function aW(h,_,G){let Y=this;return X;function X(Z){if(J1(Z))return O1(h,K,"linePrefix",Y.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Z);return K(Z)}function K(Z){return h.attempt(HK,_,G)(Z)}}function tW(h){h.exit("blockQuote")}var VK={name:"characterEscape",tokenize:sW};function sW(h,_,G){return Y;function Y(K){return h.enter("characterEscape"),h.enter("escapeMarker"),h.consume(K),h.exit("escapeMarker"),X}function X(K){if(bA(K))return h.enter("characterEscapeValue"),h.consume(K),h.exit("characterEscapeValue"),h.exit("characterEscape"),_;return G(K)}}var UK={name:"characterReference",tokenize:nW};function nW(h,_,G){let Y=this,X=0,K,Z;return Q;function Q(H){return h.enter("characterReference"),h.enter("characterReferenceMarker"),h.consume(H),h.exit("characterReferenceMarker"),D}function D(H){if(H===35)return h.enter("characterReferenceMarkerNumeric"),h.consume(H),h.exit("characterReferenceMarkerNumeric"),O;return h.enter("characterReferenceValue"),K=31,Z=X5,A(H)}function O(H){if(H===88||H===120)return h.enter("characterReferenceMarkerHexadecimal"),h.consume(H),h.exit("characterReferenceMarkerHexadecimal"),h.enter("characterReferenceValue"),K=6,Z=yA,A;return h.enter("characterReferenceValue"),K=7,Z=zG,A(H)}function A(H){if(H===59&&X){let C=h.exit("characterReferenceValue");if(Z===X5&&!d9(Y.sliceSerialize(C)))return G(H);return h.enter("characterReferenceMarker"),h.consume(H),h.exit("characterReferenceMarker"),h.exit("characterReference"),_}if(Z(H)&&X++<K)return h.consume(H),A;return G(H)}}var iA={partial:!0,tokenize:rW},EK={concrete:!0,name:"codeFenced",tokenize:oW};function oW(h,_,G){let Y=this,X={partial:!0,tokenize:I},K=0,Z=0,Q;return D;function D(b){return O(b)}function O(b){let l=Y.events[Y.events.length-1];return K=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0,Q=b,h.enter("codeFenced"),h.enter("codeFencedFence"),h.enter("codeFencedFenceSequence"),A(b)}function A(b){if(b===Q)return Z++,h.consume(b),A;if(Z<3)return G(b);return h.exit("codeFencedFenceSequence"),J1(b)?O1(h,H,"whitespace")(b):H(b)}function H(b){if(b===null||p0(b))return h.exit("codeFencedFence"),Y.interrupt?_(b):h.check(iA,W,P)(b);return h.enter("codeFencedFenceInfo"),h.enter("chunkString",{contentType:"string"}),C(b)}function C(b){if(b===null||p0(b))return h.exit("chunkString"),h.exit("codeFencedFenceInfo"),H(b);if(J1(b))return h.exit("chunkString"),h.exit("codeFencedFenceInfo"),O1(h,N,"whitespace")(b);if(b===96&&b===Q)return G(b);return h.consume(b),C}function N(b){if(b===null||p0(b))return H(b);return h.enter("codeFencedFenceMeta"),h.enter("chunkString",{contentType:"string"}),j(b)}function j(b){if(b===null||p0(b))return h.exit("chunkString"),h.exit("codeFencedFenceMeta"),H(b);if(b===96&&b===Q)return G(b);return h.consume(b),j}function W(b){return h.attempt(X,P,S)(b)}function S(b){return h.enter("lineEnding"),h.consume(b),h.exit("lineEnding"),R}function R(b){return K>0&&J1(b)?O1(h,v,"linePrefix",K+1)(b):v(b)}function v(b){if(b===null||p0(b))return h.check(iA,W,P)(b);return h.enter("codeFlowValue"),x(b)}function x(b){if(b===null||p0(b))return h.exit("codeFlowValue"),v(b);return h.consume(b),x}function P(b){return h.exit("codeFenced"),_(b)}function I(b,l,i){let h0=0;return q0;function q0(s){return b.enter("lineEnding"),b.consume(s),b.exit("lineEnding"),Q0}function Q0(s){return b.enter("codeFencedFence"),J1(s)?O1(b,o,"linePrefix",Y.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){if(s===Q)return b.enter("codeFencedFenceSequence"),r(s);return i(s)}function r(s){if(s===Q)return h0++,b.consume(s),r;if(h0>=Z)return b.exit("codeFencedFenceSequence"),J1(s)?O1(b,d,"whitespace")(s):d(s);return i(s)}function d(s){if(s===null||p0(s))return b.exit("codeFencedFence"),l(s);return i(s)}}}function rW(h,_,G){let Y=this;return X;function X(Z){if(Z===null)return G(Z);return h.enter("lineEnding"),h.consume(Z),h.exit("lineEnding"),K}function K(Z){return Y.parser.lazy[Y.now().line]?G(Z):_(Z)}}var VG={name:"codeIndented",tokenize:hR},eW={partial:!0,tokenize:_R};function hR(h,_,G){let Y=this;return X;function X(O){return h.enter("codeIndented"),O1(h,K,"linePrefix",5)(O)}function K(O){let A=Y.events[Y.events.length-1];return A&&A[1].type==="linePrefix"&&A[2].sliceSerialize(A[1],!0).length>=4?Z(O):G(O)}function Z(O){if(O===null)return D(O);if(p0(O))return h.attempt(eW,Z,D)(O);return h.enter("codeFlowValue"),Q(O)}function Q(O){if(O===null||p0(O))return h.exit("codeFlowValue"),Z(O);return h.consume(O),Q}function D(O){return h.exit("codeIndented"),_(O)}}function _R(h,_,G){let Y=this;return X;function X(Z){if(Y.parser.lazy[Y.now().line])return G(Z);if(p0(Z))return h.enter("lineEnding"),h.consume(Z),h.exit("lineEnding"),X;return O1(h,K,"linePrefix",5)(Z)}function K(Z){let Q=Y.events[Y.events.length-1];return Q&&Q[1].type==="linePrefix"&&Q[2].sliceSerialize(Q[1],!0).length>=4?_(Z):p0(Z)?X(Z):G(Z)}}var ZQ={name:"codeText",previous:YR,resolve:GR,tokenize:XR};function GR(h){let _=h.length-4,G=3,Y,X;if((h[G][1].type==="lineEnding"||h[G][1].type==="space")&&(h[_][1].type==="lineEnding"||h[_][1].type==="space")){Y=G;while(++Y<_)if(h[Y][1].type==="codeTextData"){h[G][1].type="codeTextPadding",h[_][1].type="codeTextPadding",G+=2,_-=2;break}}Y=G-1,_++;while(++Y<=_)if(X===void 0){if(Y!==_&&h[Y][1].type!=="lineEnding")X=Y}else if(Y===_||h[Y][1].type==="lineEnding"){if(h[X][1].type="codeTextData",Y!==X+2)h[X][1].end=h[Y-1][1].end,h.splice(X+2,Y-X-2),_-=Y-X-2,Y=X+2;X=void 0}return h}function YR(h){return h!==96||this.events[this.events.length-1][1].type==="characterEscape"}function XR(h,_,G){let Y=this,X=0,K,Z;return Q;function Q(C){return h.enter("codeText"),h.enter("codeTextSequence"),D(C)}function D(C){if(C===96)return h.consume(C),X++,D;return h.exit("codeTextSequence"),O(C)}function O(C){if(C===null)return G(C);if(C===32)return h.enter("space"),h.consume(C),h.exit("space"),O;if(C===96)return Z=h.enter("codeTextSequence"),K=0,H(C);if(p0(C))return h.enter("lineEnding"),h.consume(C),h.exit("lineEnding"),O;return h.enter("codeTextData"),A(C)}function A(C){if(C===null||C===32||C===96||p0(C))return h.exit("codeTextData"),O(C);return h.consume(C),A}function H(C){if(C===96)return h.consume(C),K++,H;if(K===X)return h.exit("codeTextSequence"),h.exit("codeText"),_(C);return Z.type="codeTextData",A(C)}}class JQ{constructor(h){this.left=h?[...h]:[],this.right=[]}get(h){if(h<0||h>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+h+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");if(h<this.left.length)return this.left[h];return this.right[this.right.length-h+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(h,_){let G=_===null||_===void 0?Number.POSITIVE_INFINITY:_;if(G<this.left.length)return this.left.slice(h,G);if(h>this.left.length)return this.right.slice(this.right.length-G+this.left.length,this.right.length-h+this.left.length).reverse();return this.left.slice(h).concat(this.right.slice(this.right.length-G+this.left.length).reverse())}splice(h,_,G){let Y=_||0;this.setCursor(Math.trunc(h));let X=this.right.splice(this.right.length-Y,Number.POSITIVE_INFINITY);if(G)UG(this.left,G);return X.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(h){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(h)}pushMany(h){this.setCursor(Number.POSITIVE_INFINITY),UG(this.left,h)}unshift(h){this.setCursor(0),this.right.push(h)}unshiftMany(h){this.setCursor(0),UG(this.right,h.reverse())}setCursor(h){if(h===this.left.length||h>this.left.length&&this.right.length===0||h<0&&this.left.length===0)return;if(h<this.left.length){let _=this.left.splice(h,Number.POSITIVE_INFINITY);UG(this.right,_.reverse())}else{let _=this.right.splice(this.left.length+this.right.length-h,Number.POSITIVE_INFINITY);UG(this.left,_.reverse())}}}function UG(h,_){let G=0;if(_.length<1e4)h.push(..._);else while(G<_.length)h.push(..._.slice(G,G+1e4)),G+=1e4}function CK(h){let _={},G=-1,Y,X,K,Z,Q,D,O,A=new JQ(h);while(++G<A.length){while(G in _)G=_[G];if(Y=A.get(G),G&&Y[1].type==="chunkFlow"&&A.get(G-1)[1].type==="listItemPrefix"){if(D=Y[1]._tokenizer.events,K=0,K<D.length&&D[K][1].type==="lineEndingBlank")K+=2;if(K<D.length&&D[K][1].type==="content")while(++K<D.length){if(D[K][1].type==="content")break;if(D[K][1].type==="chunkText")D[K][1]._isInFirstContentOfListItem=!0,K++}}if(Y[0]==="enter"){if(Y[1].contentType)Object.assign(_,KR(A,G)),G=_[G],O=!0}else if(Y[1]._container){K=G,X=void 0;while(K--)if(Z=A.get(K),Z[1].type==="lineEnding"||Z[1].type==="lineEndingBlank"){if(Z[0]==="enter"){if(X)A.get(X)[1].type="lineEndingBlank";Z[1].type="lineEnding",X=K}}else if(Z[1].type==="linePrefix"||Z[1].type==="listItemIndent");else break;if(X)Y[1].end={...A.get(X)[1].start},Q=A.slice(X,G),Q.unshift(Y),A.splice(X,G-X+1,Q)}}return C5(h,0,Number.POSITIVE_INFINITY,A.slice(0)),!O}function KR(h,_){let G=h.get(_)[1],Y=h.get(_)[2],X=_-1,K=[],Z=G._tokenizer;if(!Z){if(Z=Y.parser[G.contentType](G.start),G._contentTypeTextTrailing)Z._contentTypeTextTrailing=!0}let Q=Z.events,D=[],O={},A,H,C=-1,N=G,j=0,W=0,S=[W];while(N){while(h.get(++X)[1]!==N);if(K.push(X),!N._tokenizer){if(A=Y.sliceStream(N),!N.next)A.push(null);if(H)Z.defineSkip(N.start);if(N._isInFirstContentOfListItem)Z._gfmTasklistFirstContentOfListItem=!0;if(Z.write(A),N._isInFirstContentOfListItem)Z._gfmTasklistFirstContentOfListItem=void 0}H=N,N=N.next}N=G;while(++C<Q.length)if(Q[C][0]==="exit"&&Q[C-1][0]==="enter"&&Q[C][1].type===Q[C-1][1].type&&Q[C][1].start.line!==Q[C][1].end.line)W=C+1,S.push(W),N._tokenizer=void 0,N.previous=void 0,N=N.next;if(Z.events=[],N)N._tokenizer=void 0,N.previous=void 0;else S.pop();C=S.length;while(C--){let R=Q.slice(S[C],S[C+1]),v=K.pop();D.push([v,v+R.length-1]),h.splice(v,2,R)}D.reverse(),C=-1;while(++C<D.length)O[j+D[C][0]]=j+D[C][1],j+=D[C][1]-D[C][0]-1;return O}var qQ={resolve:JR,tokenize:qR},ZR={partial:!0,tokenize:QR};function JR(h){return CK(h),h}function qR(h,_){let G;return Y;function Y(Q){return h.enter("content"),G=h.enter("chunkContent",{contentType:"content"}),X(Q)}function X(Q){if(Q===null)return K(Q);if(p0(Q))return h.check(ZR,Z,K)(Q);return h.consume(Q),X}function K(Q){return h.exit("chunkContent"),h.exit("content"),_(Q)}function Z(Q){return h.consume(Q),h.exit("chunkContent"),G.next=h.enter("chunkContent",{contentType:"content",previous:G}),G=G.next,X}}function QR(h,_,G){let Y=this;return X;function X(Z){return h.exit("chunkContent"),h.enter("lineEnding"),h.consume(Z),h.exit("lineEnding"),O1(h,K,"linePrefix")}function K(Z){if(Z===null||p0(Z))return G(Z);let Q=Y.events[Y.events.length-1];if(!Y.parser.constructs.disable.null.includes("codeIndented")&&Q&&Q[1].type==="linePrefix"&&Q[2].sliceSerialize(Q[1],!0).length>=4)return _(Z);return h.interrupt(Y.parser.constructs.flow,G,_)(Z)}}function NK(h,_,G,Y,X,K,Z,Q,D){let O=D||Number.POSITIVE_INFINITY,A=0;return H;function H(R){if(R===60)return h.enter(Y),h.enter(X),h.enter(K),h.consume(R),h.exit(K),C;if(R===null||R===32||R===41||AG(R))return G(R);return h.enter(Y),h.enter(Z),h.enter(Q),h.enter("chunkString",{contentType:"string"}),W(R)}function C(R){if(R===62)return h.enter(K),h.consume(R),h.exit(K),h.exit(X),h.exit(Y),_;return h.enter(Q),h.enter("chunkString",{contentType:"string"}),N(R)}function N(R){if(R===62)return h.exit("chunkString"),h.exit(Q),C(R);if(R===null||R===60||p0(R))return G(R);return h.consume(R),R===92?j:N}function j(R){if(R===60||R===62||R===92)return h.consume(R),N;return N(R)}function W(R){if(!A&&(R===null||R===41||g2(R)))return h.exit("chunkString"),h.exit(Q),h.exit(Z),h.exit(Y),_(R);if(A<O&&R===40)return h.consume(R),A++,W;if(R===41)return h.consume(R),A--,W;if(R===null||R===32||R===40||AG(R))return G(R);return h.consume(R),R===92?S:W}function S(R){if(R===40||R===41||R===92)return h.consume(R),W;return W(R)}}function $K(h,_,G,Y,X,K){let Z=this,Q=0,D;return O;function O(N){return h.enter(Y),h.enter(X),h.consume(N),h.exit(X),h.enter(K),A}function A(N){if(Q>999||N===null||N===91||N===93&&!D||N===94&&!Q&&"_hiddenFootnoteSupport"in Z.parser.constructs)return G(N);if(N===93)return h.exit(K),h.enter(X),h.consume(N),h.exit(X),h.exit(Y),_;if(p0(N))return h.enter("lineEnding"),h.consume(N),h.exit("lineEnding"),A;return h.enter("chunkString",{contentType:"string"}),H(N)}function H(N){if(N===null||N===91||N===93||p0(N)||Q++>999)return h.exit("chunkString"),A(N);if(h.consume(N),!D)D=!J1(N);return N===92?C:H}function C(N){if(N===91||N===92||N===93)return h.consume(N),Q++,H;return H(N)}}function LK(h,_,G,Y,X,K){let Z;return Q;function Q(C){if(C===34||C===39||C===40)return h.enter(Y),h.enter(X),h.consume(C),h.exit(X),Z=C===40?41:C,D;return G(C)}function D(C){if(C===Z)return h.enter(X),h.consume(C),h.exit(X),h.exit(Y),_;return h.enter(K),O(C)}function O(C){if(C===Z)return h.exit(K),D(Z);if(C===null)return G(C);if(p0(C))return h.enter("lineEnding"),h.consume(C),h.exit("lineEnding"),O1(h,O,"linePrefix");return h.enter("chunkString",{contentType:"string"}),A(C)}function A(C){if(C===Z||C===null||p0(C))return h.exit("chunkString"),O(C);return h.consume(C),C===92?H:A}function H(C){if(C===Z||C===92)return h.consume(C),A;return A(C)}}function T7(h,_){let G;return Y;function Y(X){if(p0(X))return h.enter("lineEnding"),h.consume(X),h.exit("lineEnding"),G=!0,Y;if(J1(X))return O1(h,Y,G?"linePrefix":"lineSuffix")(X);return _(X)}}var QQ={name:"definition",tokenize:MR},DR={partial:!0,tokenize:BR};function MR(h,_,G){let Y=this,X;return K;function K(N){return h.enter("definition"),Z(N)}function Z(N){return $K.call(Y,h,Q,G,"definitionLabel","definitionLabelMarker","definitionLabelString")(N)}function Q(N){if(X=O6(Y.sliceSerialize(Y.events[Y.events.length-1][1]).slice(1,-1)),N===58)return h.enter("definitionMarker"),h.consume(N),h.exit("definitionMarker"),D;return G(N)}function D(N){return g2(N)?T7(h,O)(N):O(N)}function O(N){return NK(h,A,G,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(N)}function A(N){return h.attempt(DR,H,H)(N)}function H(N){return J1(N)?O1(h,C,"whitespace")(N):C(N)}function C(N){if(N===null||p0(N))return h.exit("definition"),Y.parser.defined.push(X),_(N);return G(N)}}function BR(h,_,G){return Y;function Y(Q){return g2(Q)?T7(h,X)(Q):G(Q)}function X(Q){return LK(h,K,G,"definitionTitle","definitionTitleMarker","definitionTitleString")(Q)}function K(Q){return J1(Q)?O1(h,Z,"whitespace")(Q):Z(Q)}function Z(Q){return Q===null||p0(Q)?_(Q):G(Q)}}var DQ={name:"hardBreakEscape",tokenize:OR};function OR(h,_,G){return Y;function Y(K){return h.enter("hardBreakEscape"),h.consume(K),X}function X(K){if(p0(K))return h.exit("hardBreakEscape"),_(K);return G(K)}}var MQ={name:"headingAtx",resolve:AR,tokenize:zR};function AR(h,_){let G=h.length-2,Y=3,X,K;if(h[Y][1].type==="whitespace")Y+=2;if(G-2>Y&&h[G][1].type==="whitespace")G-=2;if(h[G][1].type==="atxHeadingSequence"&&(Y===G-1||G-4>Y&&h[G-2][1].type==="whitespace"))G-=Y+1===G?2:4;if(G>Y)X={type:"atxHeadingText",start:h[Y][1].start,end:h[G][1].end},K={type:"chunkText",start:h[Y][1].start,end:h[G][1].end,contentType:"text"},C5(h,Y,G-Y+1,[["enter",X,_],["enter",K,_],["exit",K,_],["exit",X,_]]);return h}function zR(h,_,G){let Y=0;return X;function X(A){return h.enter("atxHeading"),K(A)}function K(A){return h.enter("atxHeadingSequence"),Z(A)}function Z(A){if(A===35&&Y++<6)return h.consume(A),Z;if(A===null||g2(A))return h.exit("atxHeadingSequence"),Q(A);return G(A)}function Q(A){if(A===35)return h.enter("atxHeadingSequence"),D(A);if(A===null||p0(A))return h.exit("atxHeading"),_(A);if(J1(A))return O1(h,Q,"whitespace")(A);return h.enter("atxHeadingText"),O(A)}function D(A){if(A===35)return h.consume(A),D;return h.exit("atxHeadingSequence"),Q(A)}function O(A){if(A===null||A===35||g2(A))return h.exit("atxHeadingText"),Q(A);return h.consume(A),O}}var cA=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],BQ=["pre","script","style","textarea"];var OQ={concrete:!0,name:"htmlFlow",resolveTo:UR,tokenize:ER},HR={partial:!0,tokenize:NR},VR={partial:!0,tokenize:CR};function UR(h){let _=h.length;while(_--)if(h[_][0]==="enter"&&h[_][1].type==="htmlFlow")break;if(_>1&&h[_-2][1].type==="linePrefix")h[_][1].start=h[_-2][1].start,h[_+1][1].start=h[_-2][1].start,h.splice(_-2,2);return h}function ER(h,_,G){let Y=this,X,K,Z,Q,D;return O;function O(k){return A(k)}function A(k){return h.enter("htmlFlow"),h.enter("htmlFlowData"),h.consume(k),H}function H(k){if(k===33)return h.consume(k),C;if(k===47)return h.consume(k),K=!0,W;if(k===63)return h.consume(k),X=3,Y.interrupt?_:m;if(L4(k))return h.consume(k),Z=String.fromCharCode(k),S;return G(k)}function C(k){if(k===45)return h.consume(k),X=2,N;if(k===91)return h.consume(k),X=5,Q=0,j;if(L4(k))return h.consume(k),X=4,Y.interrupt?_:m;return G(k)}function N(k){if(k===45)return h.consume(k),Y.interrupt?_:m;return G(k)}function j(k){if(k==="CDATA[".charCodeAt(Q++)){if(h.consume(k),Q===6)return Y.interrupt?_:o;return j}return G(k)}function W(k){if(L4(k))return h.consume(k),Z=String.fromCharCode(k),S;return G(k)}function S(k){if(k===null||k===47||k===62||g2(k)){let y0=k===47,a0=Z.toLowerCase();if(!y0&&!K&&BQ.includes(a0))return X=1,Y.interrupt?_(k):o(k);if(cA.includes(Z.toLowerCase())){if(X=6,y0)return h.consume(k),R;return Y.interrupt?_(k):o(k)}return X=7,Y.interrupt&&!Y.parser.lazy[Y.now().line]?G(k):K?v(k):x(k)}if(k===45||X5(k))return h.consume(k),Z+=String.fromCharCode(k),S;return G(k)}function R(k){if(k===62)return h.consume(k),Y.interrupt?_:o;return G(k)}function v(k){if(J1(k))return h.consume(k),v;return q0(k)}function x(k){if(k===47)return h.consume(k),q0;if(k===58||k===95||L4(k))return h.consume(k),P;if(J1(k))return h.consume(k),x;return q0(k)}function P(k){if(k===45||k===46||k===58||k===95||X5(k))return h.consume(k),P;return I(k)}function I(k){if(k===61)return h.consume(k),b;if(J1(k))return h.consume(k),I;return x(k)}function b(k){if(k===null||k===60||k===61||k===62||k===96)return G(k);if(k===34||k===39)return h.consume(k),D=k,l;if(J1(k))return h.consume(k),b;return i(k)}function l(k){if(k===D)return h.consume(k),D=null,h0;if(k===null||p0(k))return G(k);return h.consume(k),l}function i(k){if(k===null||k===34||k===39||k===47||k===60||k===61||k===62||k===96||g2(k))return I(k);return h.consume(k),i}function h0(k){if(k===47||k===62||J1(k))return x(k);return G(k)}function q0(k){if(k===62)return h.consume(k),Q0;return G(k)}function Q0(k){if(k===null||p0(k))return o(k);if(J1(k))return h.consume(k),Q0;return G(k)}function o(k){if(k===45&&X===2)return h.consume(k),_0;if(k===60&&X===1)return h.consume(k),Z0;if(k===62&&X===4)return h.consume(k),N0;if(k===63&&X===3)return h.consume(k),m;if(k===93&&X===5)return h.consume(k),E0;if(p0(k)&&(X===6||X===7))return h.exit("htmlFlowData"),h.check(HR,x0,r)(k);if(k===null||p0(k))return h.exit("htmlFlowData"),r(k);return h.consume(k),o}function r(k){return h.check(VR,d,x0)(k)}function d(k){return h.enter("lineEnding"),h.consume(k),h.exit("lineEnding"),s}function s(k){if(k===null||p0(k))return r(k);return h.enter("htmlFlowData"),o(k)}function _0(k){if(k===45)return h.consume(k),m;return o(k)}function Z0(k){if(k===47)return h.consume(k),Z="",X0;return o(k)}function X0(k){if(k===62){let y0=Z.toLowerCase();if(BQ.includes(y0))return h.consume(k),N0;return o(k)}if(L4(k)&&Z.length<8)return h.consume(k),Z+=String.fromCharCode(k),X0;return o(k)}function E0(k){if(k===93)return h.consume(k),m;return o(k)}function m(k){if(k===62)return h.consume(k),N0;if(k===45&&X===2)return h.consume(k),m;return o(k)}function N0(k){if(k===null||p0(k))return h.exit("htmlFlowData"),x0(k);return h.consume(k),N0}function x0(k){return h.exit("htmlFlow"),_(k)}}function CR(h,_,G){let Y=this;return X;function X(Z){if(p0(Z))return h.enter("lineEnding"),h.consume(Z),h.exit("lineEnding"),K;return G(Z)}function K(Z){return Y.parser.lazy[Y.now().line]?G(Z):_(Z)}}function NR(h,_,G){return Y;function Y(X){return h.enter("lineEnding"),h.consume(X),h.exit("lineEnding"),h.attempt(O8,_,G)}}var AQ={name:"htmlText",tokenize:$R};function $R(h,_,G){let Y=this,X,K,Z;return Q;function Q(m){return h.enter("htmlText"),h.enter("htmlTextData"),h.consume(m),D}function D(m){if(m===33)return h.consume(m),O;if(m===47)return h.consume(m),I;if(m===63)return h.consume(m),x;if(L4(m))return h.consume(m),i;return G(m)}function O(m){if(m===45)return h.consume(m),A;if(m===91)return h.consume(m),K=0,j;if(L4(m))return h.consume(m),v;return G(m)}function A(m){if(m===45)return h.consume(m),N;return G(m)}function H(m){if(m===null)return G(m);if(m===45)return h.consume(m),C;if(p0(m))return Z=H,Z0(m);return h.consume(m),H}function C(m){if(m===45)return h.consume(m),N;return H(m)}function N(m){return m===62?_0(m):m===45?C(m):H(m)}function j(m){if(m==="CDATA[".charCodeAt(K++))return h.consume(m),K===6?W:j;return G(m)}function W(m){if(m===null)return G(m);if(m===93)return h.consume(m),S;if(p0(m))return Z=W,Z0(m);return h.consume(m),W}function S(m){if(m===93)return h.consume(m),R;return W(m)}function R(m){if(m===62)return _0(m);if(m===93)return h.consume(m),R;return W(m)}function v(m){if(m===null||m===62)return _0(m);if(p0(m))return Z=v,Z0(m);return h.consume(m),v}function x(m){if(m===null)return G(m);if(m===63)return h.consume(m),P;if(p0(m))return Z=x,Z0(m);return h.consume(m),x}function P(m){return m===62?_0(m):x(m)}function I(m){if(L4(m))return h.consume(m),b;return G(m)}function b(m){if(m===45||X5(m))return h.consume(m),b;return l(m)}function l(m){if(p0(m))return Z=l,Z0(m);if(J1(m))return h.consume(m),l;return _0(m)}function i(m){if(m===45||X5(m))return h.consume(m),i;if(m===47||m===62||g2(m))return h0(m);return G(m)}function h0(m){if(m===47)return h.consume(m),_0;if(m===58||m===95||L4(m))return h.consume(m),q0;if(p0(m))return Z=h0,Z0(m);if(J1(m))return h.consume(m),h0;return _0(m)}function q0(m){if(m===45||m===46||m===58||m===95||X5(m))return h.consume(m),q0;return Q0(m)}function Q0(m){if(m===61)return h.consume(m),o;if(p0(m))return Z=Q0,Z0(m);if(J1(m))return h.consume(m),Q0;return h0(m)}function o(m){if(m===null||m===60||m===61||m===62||m===96)return G(m);if(m===34||m===39)return h.consume(m),X=m,r;if(p0(m))return Z=o,Z0(m);if(J1(m))return h.consume(m),o;return h.consume(m),d}function r(m){if(m===X)return h.consume(m),X=void 0,s;if(m===null)return G(m);if(p0(m))return Z=r,Z0(m);return h.consume(m),r}function d(m){if(m===null||m===34||m===39||m===60||m===61||m===96)return G(m);if(m===47||m===62||g2(m))return h0(m);return h.consume(m),d}function s(m){if(m===47||m===62||g2(m))return h0(m);return G(m)}function _0(m){if(m===62)return h.consume(m),h.exit("htmlTextData"),h.exit("htmlText"),_;return G(m)}function Z0(m){return h.exit("htmlTextData"),h.enter("lineEnding"),h.consume(m),h.exit("lineEnding"),X0}function X0(m){return J1(m)?O1(h,E0,"linePrefix",Y.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):E0(m)}function E0(m){return h.enter("htmlTextData"),Z(m)}}var W7={name:"labelEnd",resolveAll:TR,resolveTo:WR,tokenize:RR},LR={tokenize:SR},jR={tokenize:vR},FR={tokenize:xR};function TR(h){let _=-1,G=[];while(++_<h.length){let Y=h[_][1];if(G.push(h[_]),Y.type==="labelImage"||Y.type==="labelLink"||Y.type==="labelEnd"){let X=Y.type==="labelImage"?4:2;Y.type="data",_+=X}}if(h.length!==G.length)C5(h,0,h.length,G);return h}function WR(h,_){let G=h.length,Y=0,X,K,Z,Q;while(G--)if(X=h[G][1],K){if(X.type==="link"||X.type==="labelLink"&&X._inactive)break;if(h[G][0]==="enter"&&X.type==="labelLink")X._inactive=!0}else if(Z){if(h[G][0]==="enter"&&(X.type==="labelImage"||X.type==="labelLink")&&!X._balanced){if(K=G,X.type!=="labelLink"){Y=2;break}}}else if(X.type==="labelEnd")Z=G;let D={type:h[K][1].type==="labelLink"?"link":"image",start:{...h[K][1].start},end:{...h[h.length-1][1].end}},O={type:"label",start:{...h[K][1].start},end:{...h[Z][1].end}},A={type:"labelText",start:{...h[K+Y+2][1].end},end:{...h[Z-2][1].start}};return Q=[["enter",D,_],["enter",O,_]],Q=m5(Q,h.slice(K+1,K+Y+3)),Q=m5(Q,[["enter",A,_]]),Q=m5(Q,a9(_.parser.constructs.insideSpan.null,h.slice(K+Y+4,Z-3),_)),Q=m5(Q,[["exit",A,_],h[Z-2],h[Z-1],["exit",O,_]]),Q=m5(Q,h.slice(Z+1)),Q=m5(Q,[["exit",D,_]]),C5(h,K,h.length,Q),h}function RR(h,_,G){let Y=this,X=Y.events.length,K,Z;while(X--)if((Y.events[X][1].type==="labelImage"||Y.events[X][1].type==="labelLink")&&!Y.events[X][1]._balanced){K=Y.events[X][1];break}return Q;function Q(C){if(!K)return G(C);if(K._inactive)return H(C);return Z=Y.parser.defined.includes(O6(Y.sliceSerialize({start:K.end,end:Y.now()}))),h.enter("labelEnd"),h.enter("labelMarker"),h.consume(C),h.exit("labelMarker"),h.exit("labelEnd"),D}function D(C){if(C===40)return h.attempt(LR,A,Z?A:H)(C);if(C===91)return h.attempt(jR,A,Z?O:H)(C);return Z?A(C):H(C)}function O(C){return h.attempt(FR,A,H)(C)}function A(C){return _(C)}function H(C){return K._balanced=!0,G(C)}}function SR(h,_,G){return Y;function Y(H){return h.enter("resource"),h.enter("resourceMarker"),h.consume(H),h.exit("resourceMarker"),X}function X(H){return g2(H)?T7(h,K)(H):K(H)}function K(H){if(H===41)return A(H);return NK(h,Z,Q,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(H)}function Z(H){return g2(H)?T7(h,D)(H):A(H)}function Q(H){return G(H)}function D(H){if(H===34||H===39||H===40)return LK(h,O,G,"resourceTitle","resourceTitleMarker","resourceTitleString")(H);return A(H)}function O(H){return g2(H)?T7(h,A)(H):A(H)}function A(H){if(H===41)return h.enter("resourceMarker"),h.consume(H),h.exit("resourceMarker"),h.exit("resource"),_;return G(H)}}function vR(h,_,G){let Y=this;return X;function X(Q){return $K.call(Y,h,K,Z,"reference","referenceMarker","referenceString")(Q)}function K(Q){return Y.parser.defined.includes(O6(Y.sliceSerialize(Y.events[Y.events.length-1][1]).slice(1,-1)))?_(Q):G(Q)}function Z(Q){return G(Q)}}function xR(h,_,G){return Y;function Y(K){return h.enter("reference"),h.enter("referenceMarker"),h.consume(K),h.exit("referenceMarker"),X}function X(K){if(K===93)return h.enter("referenceMarker"),h.consume(K),h.exit("referenceMarker"),h.exit("reference"),_;return G(K)}}var zQ={name:"labelStartImage",resolveAll:W7.resolveAll,tokenize:wR};function wR(h,_,G){let Y=this;return X;function X(Q){return h.enter("labelImage"),h.enter("labelImageMarker"),h.consume(Q),h.exit("labelImageMarker"),K}function K(Q){if(Q===91)return h.enter("labelMarker"),h.consume(Q),h.exit("labelMarker"),h.exit("labelImage"),Z;return G(Q)}function Z(Q){return Q===94&&"_hiddenFootnoteSupport"in Y.parser.constructs?G(Q):_(Q)}}var HQ={name:"labelStartLink",resolveAll:W7.resolveAll,tokenize:gR};function gR(h,_,G){let Y=this;return X;function X(Z){return h.enter("labelLink"),h.enter("labelMarker"),h.consume(Z),h.exit("labelMarker"),h.exit("labelLink"),K}function K(Z){return Z===94&&"_hiddenFootnoteSupport"in Y.parser.constructs?G(Z):_(Z)}}var EG={name:"lineEnding",tokenize:IR};function IR(h,_){return G;function G(Y){return h.enter("lineEnding"),h.consume(Y),h.exit("lineEnding"),O1(h,_,"linePrefix")}}var R7={name:"thematicBreak",tokenize:PR};function PR(h,_,G){let Y=0,X;return K;function K(O){return h.enter("thematicBreak"),Z(O)}function Z(O){return X=O,Q(O)}function Q(O){if(O===X)return h.enter("thematicBreakSequence"),D(O);if(Y>=3&&(O===null||p0(O)))return h.exit("thematicBreak"),_(O);return G(O)}function D(O){if(O===X)return h.consume(O),Y++,D;return h.exit("thematicBreakSequence"),J1(O)?O1(h,Q,"whitespace")(O):Q(O)}}var S5={continuation:{tokenize:fR},exit:uR,name:"list",tokenize:mR},yR={partial:!0,tokenize:pR},bR={partial:!0,tokenize:kR};function mR(h,_,G){let Y=this,X=Y.events[Y.events.length-1],K=X&&X[1].type==="linePrefix"?X[2].sliceSerialize(X[1],!0).length:0,Z=0;return Q;function Q(N){let j=Y.containerState.type||(N===42||N===43||N===45?"listUnordered":"listOrdered");if(j==="listUnordered"?!Y.containerState.marker||N===Y.containerState.marker:zG(N)){if(!Y.containerState.type)Y.containerState.type=j,h.enter(j,{_container:!0});if(j==="listUnordered")return h.enter("listItemPrefix"),N===42||N===45?h.check(R7,G,O)(N):O(N);if(!Y.interrupt||N===49)return h.enter("listItemPrefix"),h.enter("listItemValue"),D(N)}return G(N)}function D(N){if(zG(N)&&++Z<10)return h.consume(N),D;if((!Y.interrupt||Z<2)&&(Y.containerState.marker?N===Y.containerState.marker:N===41||N===46))return h.exit("listItemValue"),O(N);return G(N)}function O(N){return h.enter("listItemMarker"),h.consume(N),h.exit("listItemMarker"),Y.containerState.marker=Y.containerState.marker||N,h.check(O8,Y.interrupt?G:A,h.attempt(yR,C,H))}function A(N){return Y.containerState.initialBlankLine=!0,K++,C(N)}function H(N){if(J1(N))return h.enter("listItemPrefixWhitespace"),h.consume(N),h.exit("listItemPrefixWhitespace"),C;return G(N)}function C(N){return Y.containerState.size=K+Y.sliceSerialize(h.exit("listItemPrefix"),!0).length,_(N)}}function fR(h,_,G){let Y=this;return Y.containerState._closeFlow=void 0,h.check(O8,X,K);function X(Q){return Y.containerState.furtherBlankLines=Y.containerState.furtherBlankLines||Y.containerState.initialBlankLine,O1(h,_,"listItemIndent",Y.containerState.size+1)(Q)}function K(Q){if(Y.containerState.furtherBlankLines||!J1(Q))return Y.containerState.furtherBlankLines=void 0,Y.containerState.initialBlankLine=void 0,Z(Q);return Y.containerState.furtherBlankLines=void 0,Y.containerState.initialBlankLine=void 0,h.attempt(bR,_,Z)(Q)}function Z(Q){return Y.containerState._closeFlow=!0,Y.interrupt=void 0,O1(h,h.attempt(S5,_,G),"linePrefix",Y.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Q)}}function kR(h,_,G){let Y=this;return O1(h,X,"listItemIndent",Y.containerState.size+1);function X(K){let Z=Y.events[Y.events.length-1];return Z&&Z[1].type==="listItemIndent"&&Z[2].sliceSerialize(Z[1],!0).length===Y.containerState.size?_(K):G(K)}}function uR(h){h.exit(this.containerState.type)}function pR(h,_,G){let Y=this;return O1(h,X,"listItemPrefixWhitespace",Y.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function X(K){let Z=Y.events[Y.events.length-1];return!J1(K)&&Z&&Z[1].type==="listItemPrefixWhitespace"?_(K):G(K)}}var jK={name:"setextUnderline",resolveTo:lR,tokenize:iR};function lR(h,_){let G=h.length,Y,X,K;while(G--)if(h[G][0]==="enter"){if(h[G][1].type==="content"){Y=G;break}if(h[G][1].type==="paragraph")X=G}else{if(h[G][1].type==="content")h.splice(G,1);if(!K&&h[G][1].type==="definition")K=G}let Z={type:"setextHeading",start:{...h[Y][1].start},end:{...h[h.length-1][1].end}};if(h[X][1].type="setextHeadingText",K)h.splice(X,0,["enter",Z,_]),h.splice(K+1,0,["exit",h[Y][1],_]),h[Y][1].end={...h[K][1].end};else h[Y][1]=Z;return h.push(["exit",Z,_]),h}function iR(h,_,G){let Y=this,X;return K;function K(O){let A=Y.events.length,H;while(A--)if(Y.events[A][1].type!=="lineEnding"&&Y.events[A][1].type!=="linePrefix"&&Y.events[A][1].type!=="content"){H=Y.events[A][1].type==="paragraph";break}if(!Y.parser.lazy[Y.now().line]&&(Y.interrupt||H))return h.enter("setextHeadingLine"),X=O,Z(O);return G(O)}function Z(O){return h.enter("setextHeadingLineSequence"),Q(O)}function Q(O){if(O===X)return h.consume(O),Q;return h.exit("setextHeadingLineSequence"),J1(O)?O1(h,D,"lineSuffix")(O):D(O)}function D(O){if(O===null||p0(O))return h.exit("setextHeadingLine"),_(O);return G(O)}}var dA={tokenize:cR};function cR(h){let _=this,G=h.attempt(O8,Y,h.attempt(this.parser.constructs.flowInitial,X,O1(h,h.attempt(this.parser.constructs.flow,X,h.attempt(qQ,X)),"linePrefix")));return G;function Y(K){if(K===null){h.consume(K);return}return h.enter("lineEndingBlank"),h.consume(K),h.exit("lineEndingBlank"),_.currentConstruct=void 0,G}function X(K){if(K===null){h.consume(K);return}return h.enter("lineEnding"),h.consume(K),h.exit("lineEnding"),_.currentConstruct=void 0,G}}var aA={resolveAll:oA()},tA=nA("string"),sA=nA("text");function nA(h){return{resolveAll:oA(h==="text"?dR:void 0),tokenize:_};function _(G){let Y=this,X=this.parser.constructs[h],K=G.attempt(X,Z,Q);return Z;function Z(A){return O(A)?K(A):Q(A)}function Q(A){if(A===null){G.consume(A);return}return G.enter("data"),G.consume(A),D}function D(A){if(O(A))return G.exit("data"),K(A);return G.consume(A),D}function O(A){if(A===null)return!0;let H=X[A],C=-1;if(H)while(++C<H.length){let N=H[C];if(!N.previous||N.previous.call(Y,Y.previous))return!0}return!1}}}function oA(h){return _;function _(G,Y){let X=-1,K;while(++X<=G.length)if(K===void 0){if(G[X]&&G[X][1].type==="data")K=X,X++}else if(!G[X]||G[X][1].type!=="data"){if(X!==K+2)G[K][1].end=G[X-1][1].end,G.splice(K+2,X-K-2),X=K+2;K=void 0}return h?h(G,Y):G}}function dR(h,_){let G=0;while(++G<=h.length)if((G===h.length||h[G][1].type==="lineEnding")&&h[G-1][1].type==="data"){let Y=h[G-1][1],X=_.sliceStream(Y),K=X.length,Z=-1,Q=0,D;while(K--){let O=X[K];if(typeof O==="string"){Z=O.length;while(O.charCodeAt(Z-1)===32)Q++,Z--;if(Z)break;Z=-1}else if(O===-2)D=!0,Q++;else if(O===-1);else{K++;break}}if(_._contentTypeTextTrailing&&G===h.length)Q=0;if(Q){let O={type:G===h.length||D||Q<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:K?Z:Y.start._bufferIndex+Z,_index:Y.start._index+K,line:Y.end.line,column:Y.end.column-Q,offset:Y.end.offset-Q},end:{...Y.end}};if(Y.end={...O.start},Y.start.offset===Y.end.offset)Object.assign(Y,O);else h.splice(G,0,["enter",O,_],["exit",O,_]),G+=2}G++}return h}var VQ={};uq(VQ,{text:()=>rR,string:()=>oR,insideSpan:()=>eR,flowInitial:()=>sR,flow:()=>nR,document:()=>aR,disable:()=>_S,contentInitial:()=>tR,attentionMarkers:()=>hS});var aR={[42]:S5,[43]:S5,[45]:S5,[48]:S5,[49]:S5,[50]:S5,[51]:S5,[52]:S5,[53]:S5,[54]:S5,[55]:S5,[56]:S5,[57]:S5,[62]:HK},tR={[91]:QQ},sR={[-2]:VG,[-1]:VG,[32]:VG},nR={[35]:MQ,[42]:R7,[45]:[jK,R7],[60]:OQ,[61]:jK,[95]:R7,[96]:EK,[126]:EK},oR={[38]:UK,[92]:VK},rR={[-5]:EG,[-4]:EG,[-3]:EG,[33]:zQ,[38]:UK,[42]:HG,[60]:[KQ,AQ],[91]:HQ,[92]:[DQ,VK],[93]:W7,[95]:HG,[96]:ZQ},eR={null:[HG,aA]},hS={null:[42,95]},_S={null:[]};function rA(h,_,G){let Y={_bufferIndex:-1,_index:0,line:G&&G.line||1,column:G&&G.column||1,offset:G&&G.offset||0},X={},K=[],Z=[],Q=[],D=!0,O={attempt:h0(l),check:h0(i),consume:P,enter:I,exit:b,interrupt:h0(i,{interrupt:!0})},A={code:null,containerState:{},defineSkip:R,events:[],now:S,parser:h,previous:null,sliceSerialize:j,sliceStream:W,write:N},H=_.tokenize.call(A,O),C;if(_.resolveAll)K.push(_);return A;function N(r){if(Z=m5(Z,r),v(),Z[Z.length-1]!==null)return[];return q0(_,0),A.events=a9(K,A.events,A),A.events}function j(r,d){return YS(W(r),d)}function W(r){return GS(Z,r)}function S(){let{_bufferIndex:r,_index:d,line:s,column:_0,offset:Z0}=Y;return{_bufferIndex:r,_index:d,line:s,column:_0,offset:Z0}}function R(r){X[r.line]=r.column,o()}function v(){let r;while(Y._index<Z.length){let d=Z[Y._index];if(typeof d==="string"){if(r=Y._index,Y._bufferIndex<0)Y._bufferIndex=0;while(Y._index===r&&Y._bufferIndex<d.length)x(d.charCodeAt(Y._bufferIndex))}else x(d)}}function x(r){D=void 0,C=r,H=H(r)}function P(r){if(p0(r))Y.line++,Y.column=1,Y.offset+=r===-3?2:1,o();else if(r!==-1)Y.column++,Y.offset++;if(Y._bufferIndex<0)Y._index++;else if(Y._bufferIndex++,Y._bufferIndex===Z[Y._index].length)Y._bufferIndex=-1,Y._index++;A.previous=r,D=!0}function I(r,d){let s=d||{};return s.type=r,s.start=S(),A.events.push(["enter",s,A]),Q.push(s),s}function b(r){let d=Q.pop();return d.end=S(),A.events.push(["exit",d,A]),d}function l(r,d){q0(r,d.from)}function i(r,d){d.restore()}function h0(r,d){return s;function s(_0,Z0,X0){let E0,m,N0,x0;return Array.isArray(_0)?y0(_0):("tokenize"in _0)?y0([_0]):k(_0);function k(g0){return Q1;function Q1(Y1){let D1=Y1!==null&&g0[Y1],b1=Y1!==null&&g0.null,_1=[...Array.isArray(D1)?D1:D1?[D1]:[],...Array.isArray(b1)?b1:b1?[b1]:[]];return y0(_1)(Y1)}}function y0(g0){if(E0=g0,m=0,g0.length===0)return X0;return a0(g0[m])}function a0(g0){return Q1;function Q1(Y1){if(x0=Q0(),N0=g0,!g0.partial)A.currentConstruct=g0;if(g0.name&&A.parser.constructs.disable.null.includes(g0.name))return w0(Y1);return g0.tokenize.call(d?Object.assign(Object.create(A),d):A,O,n0,w0)(Y1)}}function n0(g0){return D=!0,r(N0,x0),Z0}function w0(g0){if(D=!0,x0.restore(),++m<E0.length)return a0(E0[m]);return X0}}}function q0(r,d){if(r.resolveAll&&!K.includes(r))K.push(r);if(r.resolve)C5(A.events,d,A.events.length-d,r.resolve(A.events.slice(d),A));if(r.resolveTo)A.events=r.resolveTo(A.events,A)}function Q0(){let r=S(),d=A.previous,s=A.currentConstruct,_0=A.events.length,Z0=Array.from(Q);return{from:_0,restore:X0};function X0(){Y=r,A.previous=d,A.currentConstruct=s,A.events.length=_0,Q=Z0,o()}}function o(){if(Y.line in X&&Y.column<2)Y.column=X[Y.line],Y.offset+=X[Y.line]-1}}function GS(h,_){let G=_.start._index,Y=_.start._bufferIndex,X=_.end._index,K=_.end._bufferIndex,Z;if(G===X)Z=[h[G].slice(Y,K)];else{if(Z=h.slice(G,X),Y>-1){let Q=Z[0];if(typeof Q==="string")Z[0]=Q.slice(Y);else Z.shift()}if(K>0)Z.push(h[X].slice(0,K))}return Z}function YS(h,_){let G=-1,Y=[],X;while(++G<h.length){let K=h[G],Z;if(typeof K==="string")Z=K;else switch(K){case-5:{Z="\r";break}case-4:{Z=`
|
|
27
|
-
`;break}case-3:{Z=`\r
|
|
28
|
-
`;break}case-2:{Z=_?" ":"\t";break}case-1:{if(!_&&X)continue;Z=" ";break}default:Z=String.fromCharCode(K)}X=K===-2,Y.push(Z)}return Y.join("")}function UQ(h){let Y={constructs:IA([VQ,...(h||{}).extensions||[]]),content:X(kA),defined:[],document:X(pA),flow:X(dA),lazy:{},string:X(tA),text:X(sA)};return Y;function X(K){return Z;function Z(Q){return rA(Y,K,Q)}}}function EQ(h){while(!CK(h));return h}var eA=/[\0\t\n\r]/g;function CQ(){let h=1,_="",G=!0,Y;return X;function X(K,Z,Q){let D=[],O,A,H,C,N;if(K=_+(typeof K==="string"?K.toString():new TextDecoder(Z||void 0).decode(K)),H=0,_="",G){if(K.charCodeAt(0)===65279)H++;G=void 0}while(H<K.length){if(eA.lastIndex=H,O=eA.exec(K),C=O&&O.index!==void 0?O.index:K.length,N=K.charCodeAt(C),!O){_=K.slice(H);break}if(N===10&&H===C&&Y)D.push(-3),Y=void 0;else{if(Y)D.push(-5),Y=void 0;if(H<C)D.push(K.slice(H,C)),h+=C-H;switch(N){case 0:{D.push(65533),h++;break}case 9:{A=Math.ceil(h/4)*4,D.push(-2);while(h++<A)D.push(-1);break}case 10:{D.push(-4),h=1;break}default:Y=!0,h=1}}H=C+1}if(Q){if(Y)D.push(-5);if(_)D.push(_);D.push(null)}return D}}var XS=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function hz(h){return h.replace(XS,KS)}function KS(h,_,G){if(_)return _;if(G.charCodeAt(0)===35){let X=G.charCodeAt(1),K=X===120||X===88;return zK(G.slice(K?2:1),K?16:10)}return d9(G)||h}var Gz={}.hasOwnProperty;function NQ(h,_,G){if(_&&typeof _==="object")G=_,_=void 0;return ZS(G)(EQ(UQ(G).document().write(CQ()(h,_,!0))))}function ZS(h){let _={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:K(Z2),autolinkProtocol:h0,autolinkEmail:h0,atxHeading:K(n1),blockQuote:K(Y1),characterEscape:h0,characterReference:h0,codeFenced:K(D1),codeFencedFenceInfo:Z,codeFencedFenceMeta:Z,codeIndented:K(D1,Z),codeText:K(b1,Z),codeTextData:h0,data:h0,codeFlowValue:h0,definition:K(_1),definitionDestinationString:Z,definitionLabelString:Z,definitionTitleString:Z,emphasis:K(l1),hardBreakEscape:K(y2),hardBreakTrailing:K(y2),htmlFlow:K(O2,Z),htmlFlowData:h0,htmlText:K(O2,Z),htmlTextData:h0,image:K(h2),label:Z,link:K(Z2),listItem:K(W2),listItemValue:C,listOrdered:K(Z1,H),listUnordered:K(Z1),paragraph:K(v1),reference:k,referenceString:Z,resourceDestinationString:Z,resourceTitleString:Z,setextHeading:K(n1),strong:K(B5),thematicBreak:K(a2)},exit:{atxHeading:D(),atxHeadingSequence:I,autolink:D(),autolinkEmail:Q1,autolinkProtocol:g0,blockQuote:D(),characterEscapeValue:q0,characterReferenceMarkerHexadecimal:a0,characterReferenceMarkerNumeric:a0,characterReferenceValue:n0,characterReference:w0,codeFenced:D(S),codeFencedFence:W,codeFencedFenceInfo:N,codeFencedFenceMeta:j,codeFlowValue:q0,codeIndented:D(R),codeText:D(s),codeTextData:q0,data:q0,definition:D(),definitionDestinationString:P,definitionLabelString:v,definitionTitleString:x,emphasis:D(),hardBreakEscape:D(o),hardBreakTrailing:D(o),htmlFlow:D(r),htmlFlowData:q0,htmlText:D(d),htmlTextData:q0,image:D(Z0),label:E0,labelText:X0,lineEnding:Q0,link:D(_0),listItem:D(),listOrdered:D(),listUnordered:D(),paragraph:D(),referenceString:y0,resourceDestinationString:m,resourceTitleString:N0,resource:x0,setextHeading:D(i),setextHeadingLineSequence:l,setextHeadingText:b,strong:D(),thematicBreak:D()}};Yz(_,(h||{}).mdastExtensions||[]);let G={};return Y;function Y(M0){let j0={type:"root",children:[]},u0={stack:[j0],tokenStack:[],config:_,enter:Q,exit:O,buffer:Z,resume:A,data:G},s0=[],A0=-1;while(++A0<M0.length)if(M0[A0][1].type==="listOrdered"||M0[A0][1].type==="listUnordered")if(M0[A0][0]==="enter")s0.push(A0);else{let t0=s0.pop();A0=X(M0,t0,A0)}A0=-1;while(++A0<M0.length){let t0=_[M0[A0][0]];if(Gz.call(t0,M0[A0][1].type))t0[M0[A0][1].type].call(Object.assign({sliceSerialize:M0[A0][2].sliceSerialize},u0),M0[A0][1])}if(u0.tokenStack.length>0){let t0=u0.tokenStack[u0.tokenStack.length-1];(t0[1]||_z).call(u0,void 0,t0[0])}j0.position={start:A8(M0.length>0?M0[0][1].start:{line:1,column:1,offset:0}),end:A8(M0.length>0?M0[M0.length-2][1].end:{line:1,column:1,offset:0})},A0=-1;while(++A0<_.transforms.length)j0=_.transforms[A0](j0)||j0;return j0}function X(M0,j0,u0){let s0=j0-1,A0=-1,t0=!1,I0,V1,x1,m1;while(++s0<=u0){let w1=M0[s0];switch(w1[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{if(w1[0]==="enter")A0++;else A0--;m1=void 0;break}case"lineEndingBlank":{if(w1[0]==="enter"){if(I0&&!m1&&!A0&&!x1)x1=s0;m1=void 0}break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:m1=void 0}if(!A0&&w1[0]==="enter"&&w1[1].type==="listItemPrefix"||A0===-1&&w1[0]==="exit"&&(w1[1].type==="listUnordered"||w1[1].type==="listOrdered")){if(I0){let J2=s0;V1=void 0;while(J2--){let R2=M0[J2];if(R2[1].type==="lineEnding"||R2[1].type==="lineEndingBlank"){if(R2[0]==="exit")continue;if(V1)M0[V1][1].type="lineEndingBlank",t0=!0;R2[1].type="lineEnding",V1=J2}else if(R2[1].type==="linePrefix"||R2[1].type==="blockQuotePrefix"||R2[1].type==="blockQuotePrefixWhitespace"||R2[1].type==="blockQuoteMarker"||R2[1].type==="listItemIndent");else break}if(x1&&(!V1||x1<V1))I0._spread=!0;I0.end=Object.assign({},V1?M0[V1][1].start:w1[1].end),M0.splice(V1||s0,0,["exit",I0,w1[2]]),s0++,u0++}if(w1[1].type==="listItemPrefix"){let J2={type:"listItem",_spread:!1,start:Object.assign({},w1[1].start),end:void 0};I0=J2,M0.splice(s0,0,["enter",J2,w1[2]]),s0++,u0++,x1=void 0,m1=!0}}}return M0[j0][1]._spread=t0,u0}function K(M0,j0){return u0;function u0(s0){if(Q.call(this,M0(s0),s0),j0)j0.call(this,s0)}}function Z(){this.stack.push({type:"fragment",children:[]})}function Q(M0,j0,u0){this.stack[this.stack.length-1].children.push(M0),this.stack.push(M0),this.tokenStack.push([j0,u0||void 0]),M0.position={start:A8(j0.start),end:void 0}}function D(M0){return j0;function j0(u0){if(M0)M0.call(this,u0);O.call(this,u0)}}function O(M0,j0){let u0=this.stack.pop(),s0=this.tokenStack.pop();if(!s0)throw Error("Cannot close `"+M0.type+"` ("+M8({start:M0.start,end:M0.end})+"): it’s not open");else if(s0[0].type!==M0.type)if(j0)j0.call(this,M0,s0[0]);else(s0[1]||_z).call(this,M0,s0[0]);u0.position.end=A8(M0.end)}function A(){return YQ(this.stack.pop())}function H(){this.data.expectingFirstListItemValue=!0}function C(M0){if(this.data.expectingFirstListItemValue){let j0=this.stack[this.stack.length-2];j0.start=Number.parseInt(this.sliceSerialize(M0),10),this.data.expectingFirstListItemValue=void 0}}function N(){let M0=this.resume(),j0=this.stack[this.stack.length-1];j0.lang=M0}function j(){let M0=this.resume(),j0=this.stack[this.stack.length-1];j0.meta=M0}function W(){if(this.data.flowCodeInside)return;this.buffer(),this.data.flowCodeInside=!0}function S(){let M0=this.resume(),j0=this.stack[this.stack.length-1];j0.value=M0.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function R(){let M0=this.resume(),j0=this.stack[this.stack.length-1];j0.value=M0.replace(/(\r?\n|\r)$/g,"")}function v(M0){let j0=this.resume(),u0=this.stack[this.stack.length-1];u0.label=j0,u0.identifier=O6(this.sliceSerialize(M0)).toLowerCase()}function x(){let M0=this.resume(),j0=this.stack[this.stack.length-1];j0.title=M0}function P(){let M0=this.resume(),j0=this.stack[this.stack.length-1];j0.url=M0}function I(M0){let j0=this.stack[this.stack.length-1];if(!j0.depth){let u0=this.sliceSerialize(M0).length;j0.depth=u0}}function b(){this.data.setextHeadingSlurpLineEnding=!0}function l(M0){let j0=this.stack[this.stack.length-1];j0.depth=this.sliceSerialize(M0).codePointAt(0)===61?1:2}function i(){this.data.setextHeadingSlurpLineEnding=void 0}function h0(M0){let u0=this.stack[this.stack.length-1].children,s0=u0[u0.length-1];if(!s0||s0.type!=="text")s0=d2(),s0.position={start:A8(M0.start),end:void 0},u0.push(s0);this.stack.push(s0)}function q0(M0){let j0=this.stack.pop();j0.value+=this.sliceSerialize(M0),j0.position.end=A8(M0.end)}function Q0(M0){let j0=this.stack[this.stack.length-1];if(this.data.atHardBreak){let u0=j0.children[j0.children.length-1];u0.position.end=A8(M0.end),this.data.atHardBreak=void 0;return}if(!this.data.setextHeadingSlurpLineEnding&&_.canContainEols.includes(j0.type))h0.call(this,M0),q0.call(this,M0)}function o(){this.data.atHardBreak=!0}function r(){let M0=this.resume(),j0=this.stack[this.stack.length-1];j0.value=M0}function d(){let M0=this.resume(),j0=this.stack[this.stack.length-1];j0.value=M0}function s(){let M0=this.resume(),j0=this.stack[this.stack.length-1];j0.value=M0}function _0(){let M0=this.stack[this.stack.length-1];if(this.data.inReference){let j0=this.data.referenceType||"shortcut";M0.type+="Reference",M0.referenceType=j0,delete M0.url,delete M0.title}else delete M0.identifier,delete M0.label;this.data.referenceType=void 0}function Z0(){let M0=this.stack[this.stack.length-1];if(this.data.inReference){let j0=this.data.referenceType||"shortcut";M0.type+="Reference",M0.referenceType=j0,delete M0.url,delete M0.title}else delete M0.identifier,delete M0.label;this.data.referenceType=void 0}function X0(M0){let j0=this.sliceSerialize(M0),u0=this.stack[this.stack.length-2];u0.label=hz(j0),u0.identifier=O6(j0).toLowerCase()}function E0(){let M0=this.stack[this.stack.length-1],j0=this.resume(),u0=this.stack[this.stack.length-1];if(this.data.inReference=!0,u0.type==="link"){let s0=M0.children;u0.children=s0}else u0.alt=j0}function m(){let M0=this.resume(),j0=this.stack[this.stack.length-1];j0.url=M0}function N0(){let M0=this.resume(),j0=this.stack[this.stack.length-1];j0.title=M0}function x0(){this.data.inReference=void 0}function k(){this.data.referenceType="collapsed"}function y0(M0){let j0=this.resume(),u0=this.stack[this.stack.length-1];u0.label=j0,u0.identifier=O6(this.sliceSerialize(M0)).toLowerCase(),this.data.referenceType="full"}function a0(M0){this.data.characterReferenceType=M0.type}function n0(M0){let j0=this.sliceSerialize(M0),u0=this.data.characterReferenceType,s0;if(u0)s0=zK(j0,u0==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0;else s0=d9(j0);let A0=this.stack[this.stack.length-1];A0.value+=s0}function w0(M0){let j0=this.stack.pop();j0.position.end=A8(M0.end)}function g0(M0){q0.call(this,M0);let j0=this.stack[this.stack.length-1];j0.url=this.sliceSerialize(M0)}function Q1(M0){q0.call(this,M0);let j0=this.stack[this.stack.length-1];j0.url="mailto:"+this.sliceSerialize(M0)}function Y1(){return{type:"blockquote",children:[]}}function D1(){return{type:"code",lang:null,meta:null,value:""}}function b1(){return{type:"inlineCode",value:""}}function _1(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function l1(){return{type:"emphasis",children:[]}}function n1(){return{type:"heading",depth:0,children:[]}}function y2(){return{type:"break"}}function O2(){return{type:"html",value:""}}function h2(){return{type:"image",title:null,url:"",alt:null}}function Z2(){return{type:"link",title:null,url:"",children:[]}}function Z1(M0){return{type:"list",ordered:M0.type==="listOrdered",start:null,spread:M0._spread,children:[]}}function W2(M0){return{type:"listItem",spread:M0._spread,checked:null,children:[]}}function v1(){return{type:"paragraph",children:[]}}function B5(){return{type:"strong",children:[]}}function d2(){return{type:"text",value:""}}function a2(){return{type:"thematicBreak"}}}function A8(h){return{line:h.line,column:h.column,offset:h.offset}}function Yz(h,_){let G=-1;while(++G<_.length){let Y=_[G];if(Array.isArray(Y))Yz(h,Y);else JS(h,Y)}}function JS(h,_){let G;for(G in _)if(Gz.call(_,G))switch(G){case"canContainEols":{let Y=_[G];if(Y)h[G].push(...Y);break}case"transforms":{let Y=_[G];if(Y)h[G].push(...Y);break}case"enter":case"exit":{let Y=_[G];if(Y)Object.assign(h[G],Y);break}}}function _z(h,_){if(h)throw Error("Cannot close `"+h.type+"` ("+M8({start:h.start,end:h.end})+"): a different token (`"+_.type+"`, "+M8({start:_.start,end:_.end})+") is open");else throw Error("Cannot close document, a token (`"+_.type+"`, "+M8({start:_.start,end:_.end})+") is still open")}function FK(h){let _=this;_.parser=G;function G(Y){return NQ(Y,{..._.data("settings"),...h,extensions:_.data("micromarkExtensions")||[],mdastExtensions:_.data("fromMarkdownExtensions")||[]})}}var TK=-1,t9=0,S7=1,s9=2,CG=3,NG=4,$G=5,LG=6,WK=7,RK=8;var qS=typeof self==="object"?self:globalThis,Xz=(h,_)=>{switch(h){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw TypeError("unable to deserialize "+h)}return new qS[h](_)},QS=(h,_)=>{let G=(X,K)=>{return h.set(K,X),X},Y=(X)=>{if(h.has(X))return h.get(X);let[K,Z]=_[X];switch(K){case t9:case TK:return G(Z,X);case S7:{let Q=G([],X);for(let D of Z)Q.push(Y(D));return Q}case s9:{let Q=G({},X);for(let[D,O]of Z)Q[Y(D)]=Y(O);return Q}case CG:return G(new Date(Z),X);case NG:{let{source:Q,flags:D}=Z;return G(new RegExp(Q,D),X)}case $G:{let Q=G(new Map,X);for(let[D,O]of Z)Q.set(Y(D),Y(O));return Q}case LG:{let Q=G(new Set,X);for(let D of Z)Q.add(Y(D));return Q}case WK:{let{name:Q,message:D}=Z;return G(Xz(Q,D),X)}case RK:return G(BigInt(Z),X);case"BigInt":return G(Object(BigInt(Z)),X);case"ArrayBuffer":return G(new Uint8Array(Z).buffer,Z);case"DataView":{let{buffer:Q}=new Uint8Array(Z);return G(new DataView(Q),Z)}}return G(Xz(K,Z),X)};return Y},$Q=(h)=>QS(new Map,h)(0);var n9="",{toString:DS}={},{keys:MS}=Object,jG=(h)=>{let _=typeof h;if(_!=="object"||!h)return[t9,_];let G=DS.call(h).slice(8,-1);switch(G){case"Array":return[S7,n9];case"Object":return[s9,n9];case"Date":return[CG,n9];case"RegExp":return[NG,n9];case"Map":return[$G,n9];case"Set":return[LG,n9];case"DataView":return[S7,G]}if(G.includes("Array"))return[S7,G];if(G.includes("Error"))return[WK,G];return[s9,G]},SK=([h,_])=>h===t9&&(_==="function"||_==="symbol"),BS=(h,_,G,Y)=>{let X=(Z,Q)=>{let D=Y.push(Z)-1;return G.set(Q,D),D},K=(Z)=>{if(G.has(Z))return G.get(Z);let[Q,D]=jG(Z);switch(Q){case t9:{let A=Z;switch(D){case"bigint":Q=RK,A=Z.toString();break;case"function":case"symbol":if(h)throw TypeError("unable to serialize "+D);A=null;break;case"undefined":return X([TK],Z)}return X([Q,A],Z)}case S7:{if(D){let C=Z;if(D==="DataView")C=new Uint8Array(Z.buffer);else if(D==="ArrayBuffer")C=new Uint8Array(Z);return X([D,[...C]],Z)}let A=[],H=X([Q,A],Z);for(let C of Z)A.push(K(C));return H}case s9:{if(D)switch(D){case"BigInt":return X([D,Z.toString()],Z);case"Boolean":case"Number":case"String":return X([D,Z.valueOf()],Z)}if(_&&"toJSON"in Z)return K(Z.toJSON());let A=[],H=X([Q,A],Z);for(let C of MS(Z))if(h||!SK(jG(Z[C])))A.push([K(C),K(Z[C])]);return H}case CG:return X([Q,Z.toISOString()],Z);case NG:{let{source:A,flags:H}=Z;return X([Q,{source:A,flags:H}],Z)}case $G:{let A=[],H=X([Q,A],Z);for(let[C,N]of Z)if(h||!(SK(jG(C))||SK(jG(N))))A.push([K(C),K(N)]);return H}case LG:{let A=[],H=X([Q,A],Z);for(let C of Z)if(h||!SK(jG(C)))A.push(K(C));return H}}let{message:O}=Z;return X([Q,{name:D,message:O}],Z)};return K},LQ=(h,{json:_,lossy:G}={})=>{let Y=[];return BS(!(_||G),!!_,new Map,Y)(h),Y};var o9=typeof structuredClone==="function"?(h,_)=>_&&(("json"in _)||("lossy"in _))?$Q(LQ(h,_)):structuredClone(h):(h,_)=>$Q(LQ(h,_));function OS(h,_){let G=[{type:"text",value:"↩"}];if(_>1)G.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(_)}]});return G}function AS(h,_){return"Back to reference "+(h+1)+(_>1?"-"+_:"")}function Kz(h){let _=typeof h.options.clobberPrefix==="string"?h.options.clobberPrefix:"user-content-",G=h.options.footnoteBackContent||OS,Y=h.options.footnoteBackLabel||AS,X=h.options.footnoteLabel||"Footnotes",K=h.options.footnoteLabelTagName||"h2",Z=h.options.footnoteLabelProperties||{className:["sr-only"]},Q=[],D=-1;while(++D<h.footnoteOrder.length){let O=h.footnoteById.get(h.footnoteOrder[D]);if(!O)continue;let A=h.all(O),H=String(O.identifier).toUpperCase(),C=k4(H.toLowerCase()),N=0,j=[],W=h.footnoteCounts.get(H);while(W!==void 0&&++N<=W){if(j.length>0)j.push({type:"text",value:" "});let v=typeof G==="string"?G:G(D,N);if(typeof v==="string")v={type:"text",value:v};j.push({type:"element",tagName:"a",properties:{href:"#"+_+"fnref-"+C+(N>1?"-"+N:""),dataFootnoteBackref:"",ariaLabel:typeof Y==="string"?Y:Y(D,N),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}let S=A[A.length-1];if(S&&S.type==="element"&&S.tagName==="p"){let v=S.children[S.children.length-1];if(v&&v.type==="text")v.value+=" ";else S.children.push({type:"text",value:" "});S.children.push(...j)}else A.push(...j);let R={type:"element",tagName:"li",properties:{id:_+"fn-"+C},children:h.wrap(A,!0)};h.patch(O,R),Q.push(R)}if(Q.length===0)return;return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:K,properties:{...o9(Z),id:"footnote-label"},children:[{type:"text",value:X}]},{type:"text",value:`
|
|
29
|
-
`},{type:"element",tagName:"ol",properties:{},children:h.wrap(Q,!0)},{type:"text",value:`
|
|
30
|
-
`}]}}var vK=function(h){if(h===null||h===void 0)return US;if(typeof h==="function")return xK(h);if(typeof h==="object")return Array.isArray(h)?zS(h):HS(h);if(typeof h==="string")return VS(h);throw Error("Expected function, string, or object as test")};function zS(h){let _=[],G=-1;while(++G<h.length)_[G]=vK(h[G]);return xK(Y);function Y(...X){let K=-1;while(++K<_.length)if(_[K].apply(this,X))return!0;return!1}}function HS(h){let _=h;return xK(G);function G(Y){let X=Y,K;for(K in h)if(X[K]!==_[K])return!1;return!0}}function VS(h){return xK(_);function _(G){return G&&G.type===h}}function xK(h){return _;function _(G,Y,X){return Boolean(ES(G)&&h.call(this,G,typeof Y==="number"?Y:void 0,X||void 0))}}function US(){return!0}function ES(h){return h!==null&&typeof h==="object"&&"type"in h}function Zz(h){return h}var Jz=[],jQ=!0,wK=!1,FQ="skip";function TQ(h,_,G,Y){let X;if(typeof _==="function"&&typeof G!=="function")Y=G,G=_;else X=_;let K=vK(X),Z=Y?-1:1;Q(h,void 0,[])();function Q(D,O,A){let H=D&&typeof D==="object"?D:{};if(typeof H.type==="string"){let N=typeof H.tagName==="string"?H.tagName:typeof H.name==="string"?H.name:void 0;Object.defineProperty(C,"name",{value:"node ("+Zz(D.type+(N?"<"+N+">":""))+")"})}return C;function C(){let N=Jz,j,W,S;if(!_||K(D,O,A[A.length-1]||void 0)){if(N=CS(G(D,A)),N[0]===wK)return N}if("children"in D&&D.children){let R=D;if(R.children&&N[0]!==FQ){W=(Y?R.children.length:-1)+Z,S=A.concat(R);while(W>-1&&W<R.children.length){let v=R.children[W];if(j=Q(v,W,S)(),j[0]===wK)return j;W=typeof j[1]==="number"?j[1]:W+Z}}}return N}}}function CS(h){if(Array.isArray(h))return h;if(typeof h==="number")return[jQ,h];return h===null||h===void 0?Jz:[h]}function FG(h,_,G,Y){let X,K,Z;if(typeof _==="function"&&typeof G!=="function")K=void 0,Z=_,X=G;else K=_,Z=G,X=Y;TQ(h,K,Q,X);function Q(D,O){let A=O[O.length-1],H=A?A.children.indexOf(D):void 0;return Z(D,H,A)}}function qz(h,_){let G={type:"element",tagName:"blockquote",properties:{},children:h.wrap(h.all(_),!0)};return h.patch(_,G),h.applyData(_,G)}function Qz(h,_){let G={type:"element",tagName:"br",properties:{},children:[]};return h.patch(_,G),[h.applyData(_,G),{type:"text",value:`
|
|
31
|
-
`}]}function Dz(h,_){let G=_.value?_.value+`
|
|
32
|
-
`:"",Y={},X=_.lang?_.lang.split(/\s+/):[];if(X.length>0)Y.className=["language-"+X[0]];let K={type:"element",tagName:"code",properties:Y,children:[{type:"text",value:G}]};if(_.meta)K.data={meta:_.meta};return h.patch(_,K),K=h.applyData(_,K),K={type:"element",tagName:"pre",properties:{},children:[K]},h.patch(_,K),K}function Mz(h,_){let G={type:"element",tagName:"del",properties:{},children:h.all(_)};return h.patch(_,G),h.applyData(_,G)}function Bz(h,_){let G={type:"element",tagName:"em",properties:{},children:h.all(_)};return h.patch(_,G),h.applyData(_,G)}function Oz(h,_){let G=typeof h.options.clobberPrefix==="string"?h.options.clobberPrefix:"user-content-",Y=String(_.identifier).toUpperCase(),X=k4(Y.toLowerCase()),K=h.footnoteOrder.indexOf(Y),Z,Q=h.footnoteCounts.get(Y);if(Q===void 0)Q=0,h.footnoteOrder.push(Y),Z=h.footnoteOrder.length;else Z=K+1;Q+=1,h.footnoteCounts.set(Y,Q);let D={type:"element",tagName:"a",properties:{href:"#"+G+"fn-"+X,id:G+"fnref-"+X+(Q>1?"-"+Q:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(Z)}]};h.patch(_,D);let O={type:"element",tagName:"sup",properties:{},children:[D]};return h.patch(_,O),h.applyData(_,O)}function Az(h,_){let G={type:"element",tagName:"h"+_.depth,properties:{},children:h.all(_)};return h.patch(_,G),h.applyData(_,G)}function zz(h,_){if(h.options.allowDangerousHtml){let G={type:"raw",value:_.value};return h.patch(_,G),h.applyData(_,G)}return}function gK(h,_){let G=_.referenceType,Y="]";if(G==="collapsed")Y+="[]";else if(G==="full")Y+="["+(_.label||_.identifier)+"]";if(_.type==="imageReference")return[{type:"text",value:"!["+_.alt+Y}];let X=h.all(_),K=X[0];if(K&&K.type==="text")K.value="["+K.value;else X.unshift({type:"text",value:"["});let Z=X[X.length-1];if(Z&&Z.type==="text")Z.value+=Y;else X.push({type:"text",value:Y});return X}function Hz(h,_){let G=String(_.identifier).toUpperCase(),Y=h.definitionById.get(G);if(!Y)return gK(h,_);let X={src:k4(Y.url||""),alt:_.alt};if(Y.title!==null&&Y.title!==void 0)X.title=Y.title;let K={type:"element",tagName:"img",properties:X,children:[]};return h.patch(_,K),h.applyData(_,K)}function Vz(h,_){let G={src:k4(_.url)};if(_.alt!==null&&_.alt!==void 0)G.alt=_.alt;if(_.title!==null&&_.title!==void 0)G.title=_.title;let Y={type:"element",tagName:"img",properties:G,children:[]};return h.patch(_,Y),h.applyData(_,Y)}function Uz(h,_){let G={type:"text",value:_.value.replace(/\r?\n|\r/g," ")};h.patch(_,G);let Y={type:"element",tagName:"code",properties:{},children:[G]};return h.patch(_,Y),h.applyData(_,Y)}function Ez(h,_){let G=String(_.identifier).toUpperCase(),Y=h.definitionById.get(G);if(!Y)return gK(h,_);let X={href:k4(Y.url||"")};if(Y.title!==null&&Y.title!==void 0)X.title=Y.title;let K={type:"element",tagName:"a",properties:X,children:h.all(_)};return h.patch(_,K),h.applyData(_,K)}function Cz(h,_){let G={href:k4(_.url)};if(_.title!==null&&_.title!==void 0)G.title=_.title;let Y={type:"element",tagName:"a",properties:G,children:h.all(_)};return h.patch(_,Y),h.applyData(_,Y)}function Nz(h,_,G){let Y=h.all(_),X=G?NS(G):$z(_),K={},Z=[];if(typeof _.checked==="boolean"){let A=Y[0],H;if(A&&A.type==="element"&&A.tagName==="p")H=A;else H={type:"element",tagName:"p",properties:{},children:[]},Y.unshift(H);if(H.children.length>0)H.children.unshift({type:"text",value:" "});H.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:_.checked,disabled:!0},children:[]}),K.className=["task-list-item"]}let Q=-1;while(++Q<Y.length){let A=Y[Q];if(X||Q!==0||A.type!=="element"||A.tagName!=="p")Z.push({type:"text",value:`
|
|
33
|
-
`});if(A.type==="element"&&A.tagName==="p"&&!X)Z.push(...A.children);else Z.push(A)}let D=Y[Y.length-1];if(D&&(X||D.type!=="element"||D.tagName!=="p"))Z.push({type:"text",value:`
|
|
34
|
-
`});let O={type:"element",tagName:"li",properties:K,children:Z};return h.patch(_,O),h.applyData(_,O)}function NS(h){let _=!1;if(h.type==="list"){_=h.spread||!1;let G=h.children,Y=-1;while(!_&&++Y<G.length)_=$z(G[Y])}return _}function $z(h){let _=h.spread;return _===null||_===void 0?h.children.length>1:_}function Lz(h,_){let G={},Y=h.all(_),X=-1;if(typeof _.start==="number"&&_.start!==1)G.start=_.start;while(++X<Y.length){let Z=Y[X];if(Z.type==="element"&&Z.tagName==="li"&&Z.properties&&Array.isArray(Z.properties.className)&&Z.properties.className.includes("task-list-item")){G.className=["contains-task-list"];break}}let K={type:"element",tagName:_.ordered?"ol":"ul",properties:G,children:h.wrap(Y,!0)};return h.patch(_,K),h.applyData(_,K)}function jz(h,_){let G={type:"element",tagName:"p",properties:{},children:h.all(_)};return h.patch(_,G),h.applyData(_,G)}function Fz(h,_){let G={type:"root",children:h.wrap(h.all(_))};return h.patch(_,G),h.applyData(_,G)}function Tz(h,_){let G={type:"element",tagName:"strong",properties:{},children:h.all(_)};return h.patch(_,G),h.applyData(_,G)}function Wz(h,_){let G=h.all(_),Y=G.shift(),X=[];if(Y){let Z={type:"element",tagName:"thead",properties:{},children:h.wrap([Y],!0)};h.patch(_.children[0],Z),X.push(Z)}if(G.length>0){let Z={type:"element",tagName:"tbody",properties:{},children:h.wrap(G,!0)},Q=c9(_.children[1]),D=AK(_.children[_.children.length-1]);if(Q&&D)Z.position={start:Q,end:D};X.push(Z)}let K={type:"element",tagName:"table",properties:{},children:h.wrap(X,!0)};return h.patch(_,K),h.applyData(_,K)}function Rz(h,_,G){let Y=G?G.children:void 0,K=(Y?Y.indexOf(_):1)===0?"th":"td",Z=G&&G.type==="table"?G.align:void 0,Q=Z?Z.length:_.children.length,D=-1,O=[];while(++D<Q){let H=_.children[D],C={},N=Z?Z[D]:void 0;if(N)C.align=N;let j={type:"element",tagName:K,properties:C,children:[]};if(H)j.children=h.all(H),h.patch(H,j),j=h.applyData(H,j);O.push(j)}let A={type:"element",tagName:"tr",properties:{},children:h.wrap(O,!0)};return h.patch(_,A),h.applyData(_,A)}function Sz(h,_){let G={type:"element",tagName:"td",properties:{},children:h.all(_)};return h.patch(_,G),h.applyData(_,G)}function xz(h){let _=String(h),G=/\r?\n|\r/g,Y=G.exec(_),X=0,K=[];while(Y)K.push(vz(_.slice(X,Y.index),X>0,!0),Y[0]),X=Y.index+Y[0].length,Y=G.exec(_);return K.push(vz(_.slice(X),X>0,!1)),K.join("")}function vz(h,_,G){let Y=0,X=h.length;if(_){let K=h.codePointAt(Y);while(K===9||K===32)Y++,K=h.codePointAt(Y)}if(G){let K=h.codePointAt(X-1);while(K===9||K===32)X--,K=h.codePointAt(X-1)}return X>Y?h.slice(Y,X):""}function wz(h,_){let G={type:"text",value:xz(String(_.value))};return h.patch(_,G),h.applyData(_,G)}function gz(h,_){let G={type:"element",tagName:"hr",properties:{},children:[]};return h.patch(_,G),h.applyData(_,G)}var Iz={blockquote:qz,break:Qz,code:Dz,delete:Mz,emphasis:Bz,footnoteReference:Oz,heading:Az,html:zz,imageReference:Hz,image:Vz,inlineCode:Uz,linkReference:Ez,link:Cz,listItem:Nz,list:Lz,paragraph:jz,root:Fz,strong:Tz,table:Wz,tableCell:Sz,tableRow:Rz,text:wz,thematicBreak:gz,toml:IK,yaml:IK,definition:IK,footnoteDefinition:IK};function IK(){return}var WQ={}.hasOwnProperty,$S={};function yz(h,_){let G=_||$S,Y=new Map,X=new Map,K=new Map,Z={...Iz,...G.handlers},Q={all:O,applyData:jS,definitionById:Y,footnoteById:X,footnoteCounts:K,footnoteOrder:[],handlers:Z,one:D,options:G,patch:LS,wrap:TS};return FG(h,function(A){if(A.type==="definition"||A.type==="footnoteDefinition"){let H=A.type==="definition"?Y:X,C=String(A.identifier).toUpperCase();if(!H.has(C))H.set(C,A)}}),Q;function D(A,H){let C=A.type,N=Q.handlers[C];if(WQ.call(Q.handlers,C)&&N)return N(Q,A,H);if(Q.options.passThrough&&Q.options.passThrough.includes(C)){if("children"in A){let{children:W,...S}=A,R=o9(S);return R.children=Q.all(A),R}return o9(A)}return(Q.options.unknownHandler||FS)(Q,A,H)}function O(A){let H=[];if("children"in A){let C=A.children,N=-1;while(++N<C.length){let j=Q.one(C[N],A);if(j){if(N&&C[N-1].type==="break"){if(!Array.isArray(j)&&j.type==="text")j.value=Pz(j.value);if(!Array.isArray(j)&&j.type==="element"){let W=j.children[0];if(W&&W.type==="text")W.value=Pz(W.value)}}if(Array.isArray(j))H.push(...j);else H.push(j)}}}return H}}function LS(h,_){if(h.position)_.position=oq(h)}function jS(h,_){let G=_;if(h&&h.data){let Y=h.data.hName,X=h.data.hChildren,K=h.data.hProperties;if(typeof Y==="string")if(G.type==="element")G.tagName=Y;else{let Z="children"in G?G.children:[G];G={type:"element",tagName:Y,properties:{},children:Z}}if(G.type==="element"&&K)Object.assign(G.properties,o9(K));if("children"in G&&G.children&&X!==null&&X!==void 0)G.children=X}return G}function FS(h,_){let G=_.data||{},Y="value"in _&&!(WQ.call(G,"hProperties")||WQ.call(G,"hChildren"))?{type:"text",value:_.value}:{type:"element",tagName:"div",properties:{},children:h.all(_)};return h.patch(_,Y),h.applyData(_,Y)}function TS(h,_){let G=[],Y=-1;if(_)G.push({type:"text",value:`
|
|
35
|
-
`});while(++Y<h.length){if(Y)G.push({type:"text",value:`
|
|
36
|
-
`});G.push(h[Y])}if(_&&h.length>0)G.push({type:"text",value:`
|
|
37
|
-
`});return G}function Pz(h){let _=0,G=h.charCodeAt(_);while(G===9||G===32)_++,G=h.charCodeAt(_);return h.slice(_)}function PK(h,_){let G=yz(h,_),Y=G.one(h,void 0),X=Kz(G),K=Array.isArray(Y)?{type:"root",children:Y}:Y||{type:"root",children:[]};if(X)b5("children"in K),K.children.push({type:"text",value:`
|
|
38
|
-
`},X);return K}function yK(h,_){if(h&&"run"in h)return async function(G,Y){let X=PK(G,{file:Y,..._});await h.run(X,Y)};return function(G,Y){return PK(G,{file:Y,...h||_})}}function RQ(h){if(h)throw h}var fK=S1(cz(),1);function TG(h){if(typeof h!=="object"||h===null)return!1;let _=Object.getPrototypeOf(h);return(_===null||_===Object.prototype||Object.getPrototypeOf(_)===null)&&!(Symbol.toStringTag in h)&&!(Symbol.iterator in h)}function SQ(){let h=[],_={run:G,use:Y};return _;function G(...X){let K=-1,Z=X.pop();if(typeof Z!=="function")throw TypeError("Expected function as last argument, not "+Z);Q(null,...X);function Q(D,...O){let A=h[++K],H=-1;if(D){Z(D);return}while(++H<X.length)if(O[H]===null||O[H]===void 0)O[H]=X[H];if(X=O,A)dz(A,Q)(...O);else Z(null,...O)}}function Y(X){if(typeof X!=="function")throw TypeError("Expected `middelware` to be a function, not "+X);return h.push(X),_}}function dz(h,_){let G;return Y;function Y(...Z){let Q=h.length>Z.length,D;if(Q)Z.push(X);try{D=h.apply(this,Z)}catch(O){let A=O;if(Q&&G)throw A;return X(A)}if(!Q)if(D&&D.then&&typeof D.then==="function")D.then(K,X);else if(D instanceof Error)X(D);else K(D)}function X(Z,...Q){if(!G)G=!0,_(Z,...Q)}function K(Z){X(null,Z)}}var Z3={basename:WS,dirname:RS,extname:SS,join:vS,sep:"/"};function WS(h,_){if(_!==void 0&&typeof _!=="string")throw TypeError('"ext" argument must be a string');WG(h);let G=0,Y=-1,X=h.length,K;if(_===void 0||_.length===0||_.length>h.length){while(X--)if(h.codePointAt(X)===47){if(K){G=X+1;break}}else if(Y<0)K=!0,Y=X+1;return Y<0?"":h.slice(G,Y)}if(_===h)return"";let Z=-1,Q=_.length-1;while(X--)if(h.codePointAt(X)===47){if(K){G=X+1;break}}else{if(Z<0)K=!0,Z=X+1;if(Q>-1)if(h.codePointAt(X)===_.codePointAt(Q--)){if(Q<0)Y=X}else Q=-1,Y=Z}if(G===Y)Y=Z;else if(Y<0)Y=h.length;return h.slice(G,Y)}function RS(h){if(WG(h),h.length===0)return".";let _=-1,G=h.length,Y;while(--G)if(h.codePointAt(G)===47){if(Y){_=G;break}}else if(!Y)Y=!0;return _<0?h.codePointAt(0)===47?"/":".":_===1&&h.codePointAt(0)===47?"//":h.slice(0,_)}function SS(h){WG(h);let _=h.length,G=-1,Y=0,X=-1,K=0,Z;while(_--){let Q=h.codePointAt(_);if(Q===47){if(Z){Y=_+1;break}continue}if(G<0)Z=!0,G=_+1;if(Q===46){if(X<0)X=_;else if(K!==1)K=1}else if(X>-1)K=-1}if(X<0||G<0||K===0||K===1&&X===G-1&&X===Y+1)return"";return h.slice(X,G)}function vS(...h){let _=-1,G;while(++_<h.length)if(WG(h[_]),h[_])G=G===void 0?h[_]:G+"/"+h[_];return G===void 0?".":xS(G)}function xS(h){WG(h);let _=h.codePointAt(0)===47,G=wS(h,!_);if(G.length===0&&!_)G=".";if(G.length>0&&h.codePointAt(h.length-1)===47)G+="/";return _?"/"+G:G}function wS(h,_){let G="",Y=0,X=-1,K=0,Z=-1,Q,D;while(++Z<=h.length){if(Z<h.length)Q=h.codePointAt(Z);else if(Q===47)break;else Q=47;if(Q===47){if(X===Z-1||K===1);else if(X!==Z-1&&K===2){if(G.length<2||Y!==2||G.codePointAt(G.length-1)!==46||G.codePointAt(G.length-2)!==46){if(G.length>2){if(D=G.lastIndexOf("/"),D!==G.length-1){if(D<0)G="",Y=0;else G=G.slice(0,D),Y=G.length-1-G.lastIndexOf("/");X=Z,K=0;continue}}else if(G.length>0){G="",Y=0,X=Z,K=0;continue}}if(_)G=G.length>0?G+"/..":"..",Y=2}else{if(G.length>0)G+="/"+h.slice(X+1,Z);else G=h.slice(X+1,Z);Y=Z-X-1}X=Z,K=0}else if(Q===46&&K>-1)K++;else K=-1}return G}function WG(h){if(typeof h!=="string")throw TypeError("Path must be a string. Received "+JSON.stringify(h))}var az={cwd:gS};function gS(){return"/"}function r9(h){return Boolean(h!==null&&typeof h==="object"&&"href"in h&&h.href&&"protocol"in h&&h.protocol&&h.auth===void 0)}function tz(h){if(typeof h==="string")h=new URL(h);else if(!r9(h)){let _=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+h+"`");throw _.code="ERR_INVALID_ARG_TYPE",_}if(h.protocol!=="file:"){let _=TypeError("The URL must be of scheme file");throw _.code="ERR_INVALID_URL_SCHEME",_}return IS(h)}function IS(h){if(h.hostname!==""){let Y=TypeError('File URL host must be "localhost" or empty on darwin');throw Y.code="ERR_INVALID_FILE_URL_HOST",Y}let _=h.pathname,G=-1;while(++G<_.length)if(_.codePointAt(G)===37&&_.codePointAt(G+1)===50){let Y=_.codePointAt(G+2);if(Y===70||Y===102){let X=TypeError("File URL path must not include encoded / characters");throw X.code="ERR_INVALID_FILE_URL_PATH",X}}return decodeURIComponent(_)}var vQ=["history","path","basename","stem","extname","dirname"];class e9{constructor(h){let _;if(!h)_={};else if(r9(h))_={path:h};else if(typeof h==="string"||PS(h))_={value:h};else _=h;this.cwd="cwd"in _?"":az.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let G=-1;while(++G<vQ.length){let X=vQ[G];if(X in _&&_[X]!==void 0&&_[X]!==null)this[X]=X==="history"?[..._[X]]:_[X]}let Y;for(Y in _)if(!vQ.includes(Y))this[Y]=_[Y]}get basename(){return typeof this.path==="string"?Z3.basename(this.path):void 0}set basename(h){wQ(h,"basename"),xQ(h,"basename"),this.path=Z3.join(this.dirname||"",h)}get dirname(){return typeof this.path==="string"?Z3.dirname(this.path):void 0}set dirname(h){sz(this.basename,"dirname"),this.path=Z3.join(h||"",this.basename)}get extname(){return typeof this.path==="string"?Z3.extname(this.path):void 0}set extname(h){if(xQ(h,"extname"),sz(this.dirname,"extname"),h){if(h.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(h.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=Z3.join(this.dirname,this.stem+(h||""))}get path(){return this.history[this.history.length-1]}set path(h){if(r9(h))h=tz(h);if(wQ(h,"path"),this.path!==h)this.history.push(h)}get stem(){return typeof this.path==="string"?Z3.basename(this.path,this.extname):void 0}set stem(h){wQ(h,"stem"),xQ(h,"stem"),this.path=Z3.join(this.dirname||"",h+(this.extname||""))}fail(h,_,G){let Y=this.message(h,_,G);throw Y.fatal=!0,Y}info(h,_,G){let Y=this.message(h,_,G);return Y.fatal=void 0,Y}message(h,_,G){let Y=new p2(h,_,G);if(this.path)Y.name=this.path+":"+Y.name,Y.file=this.path;return Y.fatal=!1,this.messages.push(Y),Y}toString(h){if(this.value===void 0)return"";if(typeof this.value==="string")return this.value;return new TextDecoder(h||void 0).decode(this.value)}}function xQ(h,_){if(h&&h.includes(Z3.sep))throw Error("`"+_+"` cannot be a path: did not expect `"+Z3.sep+"`")}function wQ(h,_){if(!h)throw Error("`"+_+"` cannot be empty")}function sz(h,_){if(!h)throw Error("Setting `"+_+"` requires `path` to be set too")}function PS(h){return Boolean(h&&typeof h==="object"&&"byteLength"in h&&"byteOffset"in h)}var nz=function(h){let Y=this.constructor.prototype,X=Y[h],K=function(){return X.apply(K,arguments)};return Object.setPrototypeOf(K,Y),K};var yS={}.hasOwnProperty;class yQ extends nz{constructor(){super("copy");this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=SQ()}copy(){let h=new yQ,_=-1;while(++_<this.attachers.length){let G=this.attachers[_];h.use(...G)}return h.data(fK.default(!0,{},this.namespace)),h}data(h,_){if(typeof h==="string"){if(arguments.length===2)return PQ("data",this.frozen),this.namespace[h]=_,this;return yS.call(this.namespace,h)&&this.namespace[h]||void 0}if(h)return PQ("data",this.frozen),this.namespace=h,this;return this.namespace}freeze(){if(this.frozen)return this;let h=this;while(++this.freezeIndex<this.attachers.length){let[_,...G]=this.attachers[this.freezeIndex];if(G[0]===!1)continue;if(G[0]===!0)G[0]=void 0;let Y=_.call(h,...G);if(typeof Y==="function")this.transformers.use(Y)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(h){this.freeze();let _=mK(h),G=this.parser||this.Parser;return gQ("parse",G),G(String(_),_)}process(h,_){let G=this;return this.freeze(),gQ("process",this.parser||this.Parser),IQ("process",this.compiler||this.Compiler),_?Y(void 0,_):new Promise(Y);function Y(X,K){let Z=mK(h),Q=G.parse(Z);G.run(Q,Z,function(O,A,H){if(O||!A||!H)return D(O);let C=A,N=G.stringify(C,H);if(mS(N))H.value=N;else H.result=N;D(O,H)});function D(O,A){if(O||!A)K(O);else if(X)X(A);else b5(_,"`done` is defined if `resolve` is not"),_(void 0,A)}}}processSync(h){let _=!1,G;return this.freeze(),gQ("processSync",this.parser||this.Parser),IQ("processSync",this.compiler||this.Compiler),this.process(h,Y),rz("processSync","process",_),b5(G,"we either bailed on an error or have a tree"),G;function Y(X,K){_=!0,RQ(X),G=K}}run(h,_,G){oz(h),this.freeze();let Y=this.transformers;if(!G&&typeof _==="function")G=_,_=void 0;return G?X(void 0,G):new Promise(X);function X(K,Z){b5(typeof _!=="function","`file` can’t be a `done` anymore, we checked");let Q=mK(_);Y.run(h,Q,D);function D(O,A,H){let C=A||h;if(O)Z(O);else if(K)K(C);else b5(G,"`done` is defined if `resolve` is not"),G(void 0,C,H)}}}runSync(h,_){let G=!1,Y;return this.run(h,_,X),rz("runSync","run",G),b5(Y,"we either bailed on an error or have a tree"),Y;function X(K,Z){RQ(K),Y=Z,G=!0}}stringify(h,_){this.freeze();let G=mK(_),Y=this.compiler||this.Compiler;return IQ("stringify",Y),oz(h),Y(h,G)}use(h,..._){let G=this.attachers,Y=this.namespace;if(PQ("use",this.frozen),h===null||h===void 0);else if(typeof h==="function")Q(h,_);else if(typeof h==="object")if(Array.isArray(h))Z(h);else K(h);else throw TypeError("Expected usable value, not `"+h+"`");return this;function X(D){if(typeof D==="function")Q(D,[]);else if(typeof D==="object")if(Array.isArray(D)){let[O,...A]=D;Q(O,A)}else K(D);else throw TypeError("Expected usable value, not `"+D+"`")}function K(D){if(!("plugins"in D)&&!("settings"in D))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");if(Z(D.plugins),D.settings)Y.settings=fK.default(!0,Y.settings,D.settings)}function Z(D){let O=-1;if(D===null||D===void 0);else if(Array.isArray(D))while(++O<D.length){let A=D[O];X(A)}else throw TypeError("Expected a list of plugins, not `"+D+"`")}function Q(D,O){let A=-1,H=-1;while(++A<G.length)if(G[A][0]===D){H=A;break}if(H===-1)G.push([D,...O]);else if(O.length>0){let[C,...N]=O,j=G[H][1];if(TG(j)&&TG(C))C=fK.default(!0,j,C);G[H]=[D,C,...N]}}}}var bQ=new yQ().freeze();function gQ(h,_){if(typeof _!=="function")throw TypeError("Cannot `"+h+"` without `parser`")}function IQ(h,_){if(typeof _!=="function")throw TypeError("Cannot `"+h+"` without `compiler`")}function PQ(h,_){if(_)throw Error("Cannot call `"+h+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function oz(h){if(!TG(h)||typeof h.type!=="string")throw TypeError("Expected node, got `"+h+"`")}function rz(h,_,G){if(!G)throw Error("`"+h+"` finished async. Use `"+_+"` instead")}function mK(h){return bS(h)?h:new e9(h)}function bS(h){return Boolean(h&&typeof h==="object"&&"message"in h&&"messages"in h)}function mS(h){return typeof h==="string"||fS(h)}function fS(h){return Boolean(h&&typeof h==="object"&&"byteLength"in h&&"byteOffset"in h)}var kS="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",ez=[],hH={allowDangerousHtml:!0},uS=/^(https?|ircs?|mailto|xmpp)$/i,pS=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function _h(h){let _=lS(h),G=iS(h);return cS(_.runSync(_.parse(G),G),h)}function lS(h){let _=h.rehypePlugins||ez,G=h.remarkPlugins||ez,Y=h.remarkRehypeOptions?{...h.remarkRehypeOptions,...hH}:hH;return bQ().use(FK).use(G).use(yK,Y).use(_)}function iS(h){let _=h.children||"",G=new e9;if(typeof _==="string")G.value=_;else qK("Unexpected value `"+_+"` for `children` prop, expected `string`");return G}function cS(h,_){let{allowedElements:G,allowElement:Y,components:X,disallowedElements:K,skipHtml:Z,unwrapDisallowed:Q}=_,D=_.urlTransform||GH;for(let A of pS)if(Object.hasOwn(_,A.from))qK("Unexpected `"+A.from+"` prop, "+(A.to?"use `"+A.to+"` instead":"remove it")+" (see <"+kS+"#"+A.id+"> for more info)");if(G&&K)qK("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other");return FG(h,O),hQ(h,{Fragment:hh,components:X,ignoreInvalidStyle:!0,jsx:f,jsxs:O0,passKeys:!0,passNode:!0});function O(A,H,C){if(A.type==="raw"&&C&&typeof H==="number"){if(Z)C.children.splice(H,1);else C.children[H]={type:"text",value:A.value};return H}if(A.type==="element"){let N;for(N in OG)if(Object.hasOwn(OG,N)&&Object.hasOwn(A.properties,N)){let j=A.properties[N],W=OG[N];if(W===null||W.includes(A.tagName))A.properties[N]=D(String(j||""),N,A)}}if(A.type==="element"){let N=G?!G.includes(A.tagName):K?K.includes(A.tagName):!1;if(!N&&Y&&typeof H==="number")N=!Y(A,H,C);if(N&&C&&typeof H==="number"){if(Q&&A.children)C.children.splice(H,1,...A.children);else C.children.splice(H,1);return H}}}}function GH(h){let _=h.indexOf(":"),G=h.indexOf("?"),Y=h.indexOf("#"),X=h.indexOf("/");if(_===-1||X!==-1&&_>X||G!==-1&&_>G||Y!==-1&&_>Y||uS.test(h.slice(0,_)))return h;return""}var dS=(h)=>O0("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...h,children:[f("circle",{cx:"12",cy:"12",r:"10"}),f("path",{d:"m9 12 2 2 4-4"})]}),aS=(h)=>O0("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",stroke:"none",...h,children:[f("circle",{cx:"12",cy:"12",r:"10"}),f("path",{d:"m9 12 2 2 4-4",fill:"none",stroke:"white",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),YH={__CHAT__:"Generating...",__AUTOFILL__:"Autofilling metadata...",__EMBEDDING__:"Generating embeddings...",__RUNNING__:"Generating..."},fQ=({teamId:h,message:_,isReply:G,hasReplies:Y,isLastReply:X,getUser:K,onReply:Z,onViewAttachment:Q,isSelected:D,onSelect:O,frameRate:A,startTimecode:H})=>{let C=_,N=!!C.annotations&&Array.isArray(C.annotations)&&C.annotations.length>0,j=C.creator,W=!!C.sessionId&&!!C.message&&C.message in YH,S=C.message&&YH[C.message]||"Generating...",[R,v]=kK.default.useState(!1),{videoTimeDisplayMode:x}=Xh(),P=kK.default.useMemo(()=>{if(C.second===null||C.second===void 0||!A)return"";let d=Math.round(C.second*A);return z8(d,A,x,H)},[C.second,A,x,H]),{data:I}=Gh({queryKey:["teams",h,"me"],queryFn:async()=>{let d=await y1.api.teams[":teamId"].me.$get({param:{teamId:h}});if(!d.ok)throw Error("Failed to fetch current member info");return await d.json()},enabled:!!h,staleTime:300000}),b=I?.role==="owner",l=uK(),{mutate:i}=Yh({mutationFn:async()=>{let d=await y1.api.comments[":commentId"].complete.$post({param:{commentId:C.id},json:{isCompleted:!C.isCompleted}});if(!d.ok)throw Error("Failed to update comment completion status");return await d.json()},onSuccess:()=>{l.invalidateQueries({predicate:(d)=>d.queryKey.includes("comments")})}}),{data:h0,isLoading:q0}=Gh({queryKey:["agent-sessions",C.sessionId,"entries"],queryFn:async()=>{let d=await y1.api["agent-sessions"][":sessionId"].entries.$get({param:{sessionId:C.sessionId}});if(!d.ok)throw Error("Failed to fetch session logs");return await d.json()},enabled:R&&!!C.sessionId}),Q0=(d)=>{return d.split(/(<@[a-zA-Z0-9_-]+>)/g).map((_0,Z0)=>{if(_0.match(/^<@[a-zA-Z0-9_-]+>$/)){let X0=_0.slice(2,-1),E0=C.mentions?.find((m)=>m.id===X0)||K(X0);return O0("span",{className:"text-primary font-medium hover:underline cursor-pointer",children:["@",E0?.name||"Unknown"]},Z0)}return f("span",{children:_0},Z0)})},o=(d)=>{return d.replace(/<@([a-zA-Z0-9_-]+)>/g,"@$1").replace(/^\[([^\]]+)\]:/gm,"\\[$1\\]:")},r=()=>{Z(C)};return O0("div",{onClick:O,className:`relative flex gap-4 ${G?"mt-[-1px]":"mt-3"} mr-3 group p-3 py-4 border transition-all duration-200 cursor-pointer ${G?X?"rounded-b-xl rounded-t-none":"rounded-none":Y?"rounded-t-xl rounded-b-none":"rounded-xl"} ${D?"z-20 border-blue-500/40 dark:border-blue-400/40 bg-blue-500/10 dark:bg-blue-400/10 shadow-sm":"z-10 border-transparent bg-foreground/2 dark:bg-foreground/10 hover:bg-foreground/4 dark:hover:bg-foreground/15"}`,children:[O0("div",{className:"flex flex-col items-center shrink-0 w-8 relative",children:[G&&f("div",{className:"absolute top-[-1rem] h-8 w-0.5 bg-foreground/10 left-1/2 -translate-x-1/2 z-0"}),(Y&&!G||G&&!X)&&f("div",{className:"absolute top-4 bottom-[-1rem] w-0.5 bg-foreground/10 left-1/2 -translate-x-1/2 z-0"}),O0(qH,{className:"z-10 relative",children:[j?.image&&f(QH,{src:j.image,alt:j.name||"",className:"object-cover"}),f(DH,{className:"bg-rose-400 text-black",children:j?.name?.[0]?.toUpperCase()||"U"})]})]}),O0("div",{className:"flex-1 min-w-0",children:[O0("div",{className:"flex items-center gap-2 mb-1",children:[f("span",{className:"font-semibold text-sm",children:j?.name||"Unknown"}),f("span",{className:"text-xs text-gray-400",children:new Date(C.createdAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]}),O0("div",{className:"flow-root mt-1",children:[C.second!==null&&C.second!==void 0&&A&&f("div",{className:"float-left select-none bg-blue-100 dark:bg-blue-900/40 text-blue-600 dark:text-blue-300 px-2.5 py-1 mt-[2px] mr-2 rounded-sm text-xs leading-none font-mono font-bold flex items-center gap-1",children:P}),N&&f("div",{className:"float-left select-none bg-blue-100 dark:bg-blue-900/40 text-blue-600 dark:text-blue-300 px-1 py-1 mt-[2px] mr-2 rounded-sm text-xs leading-none font-bold flex items-center gap-1",title:"Contains drawing annotations",children:f(lK,{className:"w-3.5 h-3.5"})}),W?O0("div",{className:"space-y-2",children:[f(i2,{className:"h-4 w-3/4"}),f(i2,{className:"h-4 w-1/2"}),f("span",{className:"text-xs text-muted-foreground animate-pulse",children:S})]}):C.sessionId?f("div",{className:"text-sm leading-[1.8] prose prose-sm dark:prose-invert max-w-none break-words",children:f(_h,{children:o(C.message)})}):f("div",{className:"text-sm leading-[1.8] whitespace-pre-wrap break-words text-wrap break-all",children:Q0(C.message)})]}),C.attachments&&C.attachments.length>0&&f("div",{className:"flex flex-wrap gap-2 mt-3",children:C.attachments.map((d)=>{let s=d.mediaType?.startsWith("image/"),_0=d.url?.split("/").pop()?.split("?")[0]||"file";return O0("div",{className:"relative group rounded-lg overflow-hidden border bg-white shadow-sm hover:shadow-md transition-shadow w-48 h-32",onClick:()=>s&&Q(d),children:[s?f("img",{src:d.url,alt:_0,className:"w-full h-full object-cover cursor-pointer"}):O0("div",{className:"w-full h-full bg-gray-100 flex flex-col items-center justify-center p-2 text-center",children:[f(pK,{className:"w-8 h-8 text-gray-500 mb-2"}),f("span",{className:"text-xs font-medium text-gray-700 break-all line-clamp-2",children:_0})]}),f("a",{href:d.url,target:"_blank",rel:"noreferrer",download:_0,className:"absolute right-2 bottom-2 bg-black/60 text-white hover:bg-black/80 p-1.5 rounded-full opacity-0 group-hover:opacity-100 transition-opacity",onClick:(Z0)=>Z0.stopPropagation(),children:f(A6,{className:"w-4 h-4"})})]},d.id)})}),C.sessionId&&O0("div",{className:"mt-3 pt-2 border-t border-foreground/5 flex items-center justify-between text-xs text-muted-foreground/60",children:[f("span",{className:"flex items-center gap-1.5 font-medium text-muted-foreground/80",children:"Created by Agent"}),b&&f(j3,{variant:"outline",size:"xs",onClick:()=>v(!0),className:"cursor-pointer border-violet-500/20 text-violet-600 dark:text-violet-400 hover:bg-violet-500/10 hover:text-violet-700 hover:border-violet-500/30 font-semibold",children:"Logs"})]}),O0("div",{className:"mt-2 flex items-center justify-between w-full",children:[f("button",{onClick:r,className:"text-xs font-medium text-gray-500 hover:text-blue-600 flex items-center gap-1 cursor-pointer",children:c0.reply()}),f(XH,{children:O0(KH,{children:[f(ZH,{asChild:!0,children:f("button",{onClick:(d)=>{d.stopPropagation(),i()},className:`flex items-center justify-center p-1 rounded-full transition-colors cursor-pointer ${C.isCompleted?"text-green-500 hover:text-green-600 hover:bg-green-500/10":"text-gray-400 hover:text-green-500 hover:bg-green-500/10"}`,children:C.isCompleted?f(aS,{className:"w-5 h-5"}):f(dS,{className:"w-5 h-5"})})}),f(JH,{children:C.isCompleted?c0.mark_as_incomplete():c0.mark_as_complete()})]})})]})]}),f(BH,{open:R,onOpenChange:v,children:O0(OH,{className:"sm:max-w-2xl max-h-[80vh] flex flex-col p-6 overflow-hidden bg-background/95 backdrop-blur-md border border-foreground/15 shadow-2xl",children:[O0(AH,{className:"pb-4 border-b border-foreground/15",children:[O0(zH,{className:"flex items-center gap-2 text-xl font-bold",children:[f(mQ,{className:"w-5 h-5 text-violet-500"}),c0.agent_session_logs()]}),f(HH,{children:c0.agent_logs_description()})]}),f("div",{className:"flex-1 overflow-y-auto pr-1 py-4 space-y-4 min-h-0 select-text",children:q0?O0("div",{className:"space-y-4",children:[O0("div",{className:"flex gap-4",children:[f(i2,{className:"h-5 w-5 rounded-full shrink-0"}),O0("div",{className:"flex-1 space-y-2",children:[f(i2,{className:"h-4 w-1/4"}),f(i2,{className:"h-20 w-full"})]})]}),O0("div",{className:"flex gap-4",children:[f(i2,{className:"h-5 w-5 rounded-full shrink-0"}),O0("div",{className:"flex-1 space-y-2",children:[f(i2,{className:"h-4 w-1/4"}),f(i2,{className:"h-12 w-full"})]})]})]}):h0&&h0.length>0?f("div",{className:"flex flex-col",children:h0.map((d)=>{let s=d.entry,_0=s?.timestamp||d.timestamp,Z0="";if(typeof _0==="string"||typeof _0==="number"){let X0=new Date(_0);if(!isNaN(X0.getTime()))Z0=MH(X0.toISOString())}if(s&&typeof s==="object"){if(s.type==="message"&&s.message){let X0=s.message,E0="bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-200",m=String(X0.role||"");if(X0.role==="user")E0="bg-slate-100 text-slate-800 dark:bg-slate-900/30 dark:text-slate-300",m=c0.role_user();else if(X0.role==="assistant")E0="bg-violet-100 text-violet-800 dark:bg-violet-900/30 dark:text-violet-300",m=c0.role_agent();else if(X0.role==="toolResult")E0=X0.isError?"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-300":"bg-emerald-100 text-emerald-800 dark:bg-emerald-900/30 dark:text-emerald-300",m=c0.tool_result_with_name({name:String(X0.toolName||c0.unknown())});else if(X0.role==="thought")E0="bg-amber-100 text-amber-800 dark:bg-amber-900/30 dark:text-amber-300",m=c0.role_thinking();let N0=(k)=>{let y0=k;if(typeof k==="string")try{y0=JSON.parse(k)}catch{}if(y0&&typeof y0==="object"&&!Array.isArray(y0))return f("div",{className:"mt-1 space-y-1.5 pt-3",children:Object.entries(y0).map(([n0,w0])=>{let g0=w0&&typeof w0==="object"?JSON.stringify(w0,null,2):String(w0);return O0("div",{className:"text-xs leading-relaxed break-words",children:[O0("span",{className:"font-semibold text-violet-600 dark:text-violet-400",children:[n0,":"]})," ",f("span",{className:"text-foreground/90 font-mono whitespace-pre-wrap",children:g0})]},n0)})});return f("div",{className:"text-xs font-mono whitespace-pre-wrap",children:String(k)})},x0=()=>{let k=X0.content;if(!k)return null;if(typeof k==="string"){if(!k.trim())return null;return f("div",{className:"text-xs text-foreground/80 dark:text-foreground/95 leading-relaxed prose prose-sm dark:prose-invert max-w-none break-words",children:f(_h,{children:o(k)})})}if(Array.isArray(k)){let y0=[];if(k.forEach((a0,n0)=>{if(!a0)return;if(typeof a0==="string"){if(!a0.trim())return;y0.push(f("div",{className:"text-xs text-foreground/80 dark:text-foreground/95 leading-relaxed prose prose-sm dark:prose-invert max-w-none break-words",children:f(_h,{children:o(a0)})},`str-${n0}`));return}if(typeof a0==="object"){let w0=a0,g0=w0.type;if(g0==="text"){let Y1=w0.text;if(typeof Y1!=="string"||!Y1.trim())return;y0.push(f("div",{className:"text-xs text-foreground/80 dark:text-foreground/95 leading-relaxed prose prose-sm dark:prose-invert max-w-none break-words",children:f(_h,{children:o(Y1)})},`txt-${n0}`));return}if(g0==="toolCall"){let Y1=String(w0.name||w0.toolName||c0.unknown()),D1=w0.arguments||w0.args;y0.push(O0("div",{className:"text-xs space-y-2 py-1",children:[O0("div",{className:"font-semibold text-violet-600 dark:text-violet-400 flex items-center gap-1.5",children:[c0.calling_tool()," ",f("span",{className:"font-mono bg-violet-500/10 px-1 py-0.5 rounded text-[11px]",children:Y1})]}),!!D1&&O0("div",{className:"space-y-1 pt-3",children:[f("div",{className:"text-[10px] text-muted-foreground/60 uppercase font-bold tracking-wider",children:c0.tool_arguments()}),N0(D1)]})]},`tool-${n0}`));return}if(g0==="image"){y0.push(f("div",{className:"text-xs text-muted-foreground italic flex items-center gap-1.5 py-1",children:c0.image_object()},`img-${n0}`));return}let Q1=JSON.stringify(a0,null,2);if(Q1==="{}")return;y0.push(f("pre",{className:"text-xs text-foreground/80 font-mono whitespace-pre-wrap break-words bg-muted/20 p-2 rounded",children:Q1},`other-${n0}`))}}),y0.length===0)return null;return f("div",{className:"space-y-3 w-full",children:y0.map((a0,n0)=>O0(kK.default.Fragment,{children:[n0>0&&f(VH,{className:"my-3 opacity-50"}),a0]},n0))})}return null};return O0("div",{className:"relative pl-6 pb-6 last:pb-0",children:[f("div",{className:"absolute left-[9px] top-2 bottom-0 w-0.5 bg-foreground/10 last:hidden"}),f("div",{className:`absolute left-0 top-1.5 h-5 w-5 rounded-full border-4 border-background flex items-center justify-center ${X0.role==="user"?"bg-slate-500":X0.role==="assistant"?"bg-violet-500":X0.role==="toolResult"?X0.isError?"bg-red-500":"bg-emerald-500":"bg-amber-500"}`}),O0("div",{className:"flex flex-col gap-1.5 bg-muted/30 dark:bg-muted/10 p-3 rounded-lg border border-foreground/5 backdrop-blur-xs w-full",children:[O0("div",{className:"flex items-center justify-between gap-2",children:[f("span",{className:`text-[10px] px-2 py-0.5 rounded-full font-semibold uppercase tracking-wider ${E0}`,children:m}),f("span",{className:"text-[10px] text-muted-foreground/60",children:Z0})]}),x0()]})]},d.id)}}return O0("div",{className:"relative pl-6 pb-6 last:pb-0",children:[f("div",{className:"absolute left-[9px] top-2 bottom-0 w-0.5 bg-foreground/10 last:hidden"}),f("div",{className:"absolute left-0 top-1.5 h-5 w-5 rounded-full border-4 border-background bg-gray-400"}),O0("div",{className:"bg-muted/30 p-3 rounded-lg border border-foreground/5",children:[f("div",{className:"text-[10px] text-muted-foreground/60",children:Z0}),f("pre",{className:"text-xs text-foreground/80 font-mono whitespace-pre-wrap break-words",children:JSON.stringify(d.entry,null,2)})]})]},d.id)})}):O0("div",{className:"flex flex-col items-center justify-center py-12 text-center text-muted-foreground",children:[f(mQ,{className:"w-8 h-8 text-muted-foreground/40 mb-2 animate-pulse"}),f("p",{className:"text-sm font-medium",children:c0.no_logs_found()}),f("p",{className:"text-xs text-muted-foreground/60 mt-1",children:c0.session_no_entries_yet()})]})})]})})]})};var u4=UH((h,_)=>({isDrawing:!1,currentTool:"arrow",currentColor:"#ef4444",annotations:[],history:[[]],historyIndex:0,setIsDrawing:(G)=>h({isDrawing:G}),setTool:(G)=>h({currentTool:G}),setColor:(G)=>h({currentColor:G}),addAnnotation:(G)=>{let{annotations:Y,history:X,historyIndex:K}=_(),Z=[...Y,G],Q=X.slice(0,K+1);Q.push(Z),h({annotations:Z,history:Q,historyIndex:Q.length-1})},setAnnotations:(G)=>{h({annotations:G,history:[G],historyIndex:0})},undo:()=>{let{historyIndex:G,history:Y}=_();if(G>0){let X=G-1;h({annotations:Y[X],historyIndex:X})}},redo:()=>{let{historyIndex:G,history:Y}=_();if(G<Y.length-1){let X=G+1;h({annotations:Y[X],historyIndex:X})}},reset:()=>h({isDrawing:!1,currentTool:"arrow",annotations:[],history:[[]],historyIndex:0})}));var Q2=S1(l2(),1);var tS=["#ef4444","#f97316","#eab308","#22c55e","#3b82f6","#a855f7","#ec4899","#000000","#ffffff"],uQ=Q2.default.forwardRef(({projectId:h,onSendMessage:_,replyingTo:G,onCancelReply:Y,bots:X=[],initialText:K="",hideAnnotationControl:Z=!1,disableMentions:Q=!1,currentTime:D,frameRate:O,startTimecode:A,onTyping:H},C)=>{let[N,j]=Q2.useState([]),[W,S]=Q2.useState(null),[R,v]=Q2.useState(!0),{videoTimeDisplayMode:x}=Xh(),P=Q2.default.useMemo(()=>{if(D===void 0||!O)return"";let A0=Math.round(D*O);return z8(A0,O,x,A)},[D,O,x,A]),{teamId:I,ensureTeamIdForProject:b}=TH(),{members:l,loading:i,fetchMembers:h0}=WH();Q2.useEffect(()=>{if(h&&!I)b(h)},[h,I,b]);let{isDrawing:q0,setIsDrawing:Q0,currentTool:o,setTool:r,currentColor:d,setColor:s,undo:_0,redo:Z0,history:X0,historyIndex:E0,annotations:m,reset:N0}=u4(),[x0,k]=Q2.useState(!1),[y0,a0]=Q2.useState(""),[n0,w0]=Q2.useState(0),[g0,Q1]=Q2.useState({bots:!1,users:!1}),[Y1,D1]=Q2.useState(!1),b1=Q2.default.useMemo(()=>{if(!R||D===void 0||!O||Y1)return"";if(x==="timecode")return"pl-[120px]";return"pl-[85px]"},[R,D,O,Y1,x]),_1=Q2.useRef(null),l1=Q2.useRef(null),n1=Q2.useRef(null),{mutateAsync:y2}=Yh({mutationFn:async({projectId:A0,data:t0})=>{let I0=await y1.api.projects[":projectId"].attachments.$post({param:{projectId:A0},json:t0});if(!I0.ok)throw Error("Failed to create attachment");return await I0.json()}});Q2.useEffect(()=>{if(K&&_1.current){_1.current.innerText=K,D1(!!K.trim()),_1.current.focus();let A0=document.createRange(),t0=window.getSelection();A0.selectNodeContents(_1.current),A0.collapse(!1),t0?.removeAllRanges(),t0?.addRange(A0)}},[K]),Q2.useEffect(()=>{if(G&&_1.current){_1.current.focus();let A0=document.createRange(),t0=window.getSelection();A0.selectNodeContents(_1.current),A0.collapse(!1),t0?.removeAllRanges(),t0?.addRange(A0)}},[G]),Q2.useEffect(()=>{return()=>{Q0(!1)}},[Q0]);let O2=[...l.filter((A0)=>A0.type==="agent"&&A0.name?.toLowerCase().startsWith(y0.toLowerCase())).map((A0)=>({type:"user",data:A0})),...X.filter((A0)=>A0.name?.toLowerCase().startsWith(y0.toLowerCase())).map((A0)=>({type:"bot",data:A0}))],h2=l.filter((A0)=>A0.type!=="agent"&&A0.name?.toLowerCase().startsWith(y0.toLowerCase())).map((A0)=>({type:"user",data:A0})),Z2=[...g0.bots?[]:O2,...g0.users?[]:h2];Q2.useEffect(()=>{w0(0)},[y0,x0,g0]);let Z1=()=>{if(!_1.current)return;if(D1(!!_1.current.innerText.trim()),H?.(),Q){k(!1),n1.current=null;return}let A0=window.getSelection();if(!A0||A0.rangeCount===0)return;let t0=A0.getRangeAt(0),I0=t0.startContainer,V1=t0.startOffset;if(I0.nodeType===Node.TEXT_NODE){let m1=(I0.textContent||"").slice(0,V1),w1=m1.lastIndexOf("@");if(w1!==-1){let J2=w1===0,R2=m1[w1-1];if(J2||/\s/.test(R2)){let f0=m1.slice(w1+1);if(!/\s/.test(f0)){if(a0(f0),k(!0),I)h0(I,!0,!0);let l0=document.createRange();l0.setStart(I0,w1),l0.setEnd(I0,V1),n1.current=l0;return}}}}k(!1),n1.current=null},W2=(A0)=>{if(!n1.current||!_1.current)return;let t0=n1.current;t0.deleteContents();let I0=document.createElement("span");I0.contentEditable="false",I0.dataset.type="mention",I0.dataset.id=A0.data.id,I0.className="inline-block bg-blue-100 text-blue-700 dark:bg-blue-900/40 dark:text-blue-300 px-1.5 py-0.5 rounded-md text-sm font-medium align-middle select-none mx-0.5",I0.innerText=`@${A0.data.name}`,t0.insertNode(I0);let V1=document.createTextNode(" ");I0.after(V1);let x1=document.createRange(),m1=window.getSelection();x1.setStartAfter(V1),x1.collapse(!0),m1?.removeAllRanges(),m1?.addRange(x1),k(!1),n1.current=null,D1(!0),_1.current.focus()},v1=(A0)=>{if(A0.nativeEvent.isComposing)return;if(x0&&Z2.length>0){if(A0.key==="ArrowUp"){A0.preventDefault(),w0((t0)=>t0>0?t0-1:Z2.length-1);return}if(A0.key==="ArrowDown"){A0.preventDefault(),w0((t0)=>t0<Z2.length-1?t0+1:0);return}if(A0.key==="Enter"||A0.key==="Tab"){A0.preventDefault(),W2(Z2[n0]);return}if(A0.key==="Escape"){A0.preventDefault(),k(!1);return}}if(A0.key==="Enter"&&!A0.shiftKey)A0.preventDefault(),a2()},B5=Q2.useCallback(async(A0)=>{if(!A0.target.files)return;let t0=Array.from(A0.target.files);for(let I0 of t0){let V1=`${Date.now()}-${I0.name}`,x1={id:V1,file:I0,progress:0};j((m1)=>[...m1,x1]);try{let m1=await y2({projectId:h,data:{fileName:I0.name,contentType:I0.type,size:I0.size}});if(m1.uploadUrl&&m1.id)await fetch(m1.uploadUrl,{method:"PUT",body:I0,headers:{"Content-Type":I0.type}}),j((w1)=>w1.map((J2)=>J2.id===V1?{...J2,progress:100,attachmentId:m1.id}:J2))}catch(m1){j((w1)=>w1.map((J2)=>J2.id===V1?{...J2,error:m1 instanceof Error?m1.message:"Upload failed"}:J2))}}if(l1.current)l1.current.value=""},[h,y2]),d2=(A0)=>{j((t0)=>t0.filter((I0)=>I0.id!==A0))},a2=()=>{if(!_1.current)return;if(N.some((V1)=>!V1.attachmentId&&!V1.error))return;let t0=N.map((V1)=>V1.attachmentId).filter((V1)=>!!V1),I0="";if(_1.current.childNodes.forEach((V1)=>{if(V1.nodeType===Node.TEXT_NODE)I0+=V1.textContent;else if(V1.nodeType===Node.ELEMENT_NODE){let x1=V1;if(x1.dataset.type==="mention")I0+=`<@${x1.dataset.id}>`;else if(x1.tagName==="BR")I0+=`
|
|
39
|
-
`;else if(x1.tagName==="DIV"||x1.tagName==="P")I0+=`
|
|
40
|
-
`+x1.innerText;else I0+=x1.innerText}}),I0=I0.trim(),!I0&&t0.length===0&&m.length===0)return;if(_(I0,t0,m,G?.id,R?D:void 0),_1.current.innerHTML="",D1(!1),j([]),S(null),Q0(!1),N0(),k(!1),Y)Y()},M0=N.some((A0)=>!A0.attachmentId&&!A0.error),j0=N.some((A0)=>!!A0.attachmentId),u0=Y1||j0||m.length>0,s0=N.length>0||!!G;return O0("div",{ref:C,className:"relative flex flex-col w-full border border-foreground/35 rounded-3xl shadow-sm transition-all duration-200",children:[f("style",{children:`
|
|
41
|
-
[contenteditable]:empty:before {
|
|
42
|
-
content: attr(data-placeholder);
|
|
43
|
-
color: #9ca3af;
|
|
44
|
-
cursor: text;
|
|
45
|
-
}
|
|
46
|
-
`}),x0&&(i||O2.length>0||h2.length>0)&&f("div",{className:"absolute bottom-full left-4 mb-2 w-64 rounded-xl shadow-lg border border-border overflow-hidden z-20 bg-popover text-popover-foreground animate-in fade-in slide-in-from-bottom-2 duration-200",children:f("div",{className:"h-64 overflow-y-auto",children:i?O0("div",{className:"p-2 space-y-4 animate-pulse",children:[O0("div",{className:"space-y-2",children:[f("div",{className:"px-3 py-1.5 bg-muted/50 border-b border-border",children:f(i2,{className:"h-3 w-16"})}),O0("div",{className:"flex items-center gap-2 px-3 py-2",children:[f(i2,{className:"w-6 h-6 rounded-full"}),f(i2,{className:"h-4 w-28"})]}),O0("div",{className:"flex items-center gap-2 px-3 py-2",children:[f(i2,{className:"w-6 h-6 rounded-full"}),f(i2,{className:"h-4 w-20"})]})]}),O0("div",{className:"space-y-2",children:[f("div",{className:"px-3 py-1.5 bg-muted/50 border-b border-border",children:f(i2,{className:"h-3 w-16"})}),O0("div",{className:"flex items-center gap-2 px-3 py-2",children:[f(i2,{className:"w-6 h-6 rounded-full"}),f(i2,{className:"h-4 w-32"})]}),O0("div",{className:"flex items-center gap-2 px-3 py-2",children:[f(i2,{className:"w-6 h-6 rounded-full"}),f(i2,{className:"h-4 w-24"})]})]})]}):O0(hh,{children:[O2.length>0&&O0(hh,{children:[O0("button",{onClick:(A0)=>{A0.preventDefault(),A0.stopPropagation(),Q1((t0)=>({...t0,bots:!t0.bots}))},className:"w-full text-xs font-semibold text-muted-foreground px-3 py-2 bg-muted/50 border-b border-border sticky top-0 flex items-center justify-between hover:bg-muted transition-colors",children:[f("span",{children:"Agents"}),f(Kh,{className:`w-3 h-3 transition-transform ${g0.bots?"-rotate-90":""}`})]}),!g0.bots&&O2.map((A0,t0)=>{let I0=t0;return O0("button",{onClick:()=>W2(A0),onMouseEnter:()=>w0(I0),className:`w-full flex items-center gap-2 px-3 py-2 transition-colors text-left ${I0===n0?"bg-accent text-accent-foreground":"hover:bg-accent/50"}`,children:[f("div",{className:"w-6 h-6 rounded-full bg-purple-100 dark:bg-purple-900/40 flex items-center justify-center text-xs font-bold text-purple-600 dark:text-purple-300",children:A0.data.name?.[0]}),f("span",{className:"text-sm",children:A0.data.name})]},A0.data.id)})]}),h2.length>0&&O0(hh,{children:[O0("button",{onClick:(A0)=>{A0.preventDefault(),A0.stopPropagation(),Q1((t0)=>({...t0,users:!t0.users}))},className:"w-full text-xs font-semibold text-muted-foreground px-3 py-2 bg-muted/50 border-b border-border sticky top-0 flex items-center justify-between hover:bg-muted transition-colors",children:[f("span",{children:"Members"}),f(Kh,{className:`w-3 h-3 transition-transform ${g0.users?"-rotate-90":""}`})]}),!g0.users&&h2.map((A0,t0)=>{let I0=(g0.bots?0:O2.length)+t0;return O0("button",{onClick:()=>W2(A0),onMouseEnter:()=>w0(I0),className:`w-full flex items-center gap-2 px-3 py-2 transition-colors text-left ${I0===n0?"bg-accent text-accent-foreground":"hover:bg-accent/50"}`,children:[f("div",{className:"w-6 h-6 rounded-full bg-blue-100 dark:bg-blue-900/40 flex items-center justify-center text-xs font-bold text-blue-600 dark:text-blue-300",children:A0.data.name?.[0]}),f("span",{className:"text-sm",children:A0.data.name})]},A0.data.id)})]})]})})}),s0&&O0("div",{className:"flex flex-col gap-2 p-3 pb-0 animate-in fade-in slide-in-from-bottom-2 duration-200",children:[G&&O0("div",{className:"flex items-center justify-between bg-muted p-2 px-3 rounded-lg border border-border",children:[f("div",{className:"text-xs text-muted-foreground truncate mr-2",children:c0.reply_to_message({message:G.message||""})}),f("button",{onClick:Y,className:"text-muted-foreground hover:text-foreground p-1 rounded-full hover:bg-muted-foreground/10 shrink-0",children:f(Zh,{className:"w-3.5 h-3.5"})})]}),N.length>0&&f("div",{className:"flex gap-3 overflow-x-auto py-2 px-1 scrollbar-hide",children:N.map((A0)=>O0("div",{className:"relative group flex-shrink-0",children:[O0("div",{className:"w-16 h-16 rounded-lg border border-gray-200 overflow-hidden bg-gray-50 flex items-center justify-center",children:[A0.file.type.startsWith("image/")?f("img",{src:URL.createObjectURL(A0.file),alt:"preview",onClick:()=>S(A0.file),className:`w-full h-full object-cover ${!A0.attachmentId?"opacity-50":""}`}):f(pK,{className:"w-8 h-8 text-gray-400"}),M0&&!A0.attachmentId&&!A0.error&&f("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50",children:f(RH,{progress:A0.progress,className:"w-10 h-10"})})]}),f("button",{onClick:()=>d2(A0.id),className:"absolute -top-1.5 -right-1.5 bg-gray-500 text-white rounded-full p-0.5 shadow-md opacity-0 group-hover:opacity-100 transition-opacity hover:bg-red-500 z-10",children:f(Zh,{className:"w-3 h-3"})}),f("span",{className:"text-[10px] text-gray-500 mt-1 block max-w-[4rem] truncate text-center",children:A0.file.name})]},A0.id))})]}),O0("div",{onClick:()=>_1.current?.focus(),className:"w-full px-4 pt-1 pb-1 cursor-text flow-root max-h-60 overflow-y-auto",children:[R&&D!==void 0&&O!==void 0&&f("div",{onClick:(A0)=>{A0.stopPropagation(),_1.current?.focus()},className:"float-left select-none bg-blue-100 dark:bg-blue-900/40 text-blue-600 dark:text-blue-300 px-2.5 py-0.5 mt-3 mr-2 rounded-sm text-xs font-mono font-bold flex items-center gap-1 cursor-text",children:P}),f("div",{ref:_1,contentEditable:!0,suppressContentEditableWarning:!0,onInput:Z1,onKeyDown:v1,"data-placeholder":G?c0.reply_placeholder():c0.message_placeholder(),className:`bg-transparent border-none focus:ring-0 resize-none min-h-[40px] leading-relaxed py-2 focus:outline-none block ${b1}`})]}),O0("div",{className:"flex justify-between items-center px-2 pb-2",children:[q0?O0("div",{className:"flex items-center gap-2 overflow-x-auto scrollbar-hide w-full mr-2",children:[f(j3,{onClick:()=>{Q0(!1),N0()},variant:"ghost",size:"icon",className:"p-2 rounded-full cursor-pointer text-gray-500 hover:text-gray-700 hover:bg-gray-100 mr-2",title:"Back",children:f(EH,{className:"w-4 h-4"})}),f("div",{className:"h-4 w-px bg-gray-300 mx-1"}),f("button",{onClick:()=>r("arrow"),className:`p-1.5 rounded hover:bg-gray-100 ${o==="arrow"?"text-blue-500 bg-blue-50":"text-gray-500"}`,title:"Arrow",children:f(kQ,{size:16,className:"rotate-45"})}),f("button",{onClick:()=>r("line"),className:`p-1.5 rounded hover:bg-gray-100 ${o==="line"?"text-blue-500 bg-blue-50":"text-gray-500"}`,title:"Line",children:f(Jh,{size:16,className:"-rotate-45"})}),f("button",{onClick:()=>r("box"),className:`p-1.5 rounded hover:bg-gray-100 ${o==="box"?"text-blue-500 bg-blue-50":"text-gray-500"}`,title:"Box",children:f(jH,{size:16})}),f("button",{onClick:()=>r("freehand"),className:`p-1.5 rounded hover:bg-gray-100 ${o==="freehand"?"text-blue-500 bg-blue-50":"text-gray-500"}`,title:"Freehand",children:f(CH,{size:16})}),f("div",{className:"h-4 w-px bg-gray-300 mx-1"}),O0(iK,{children:[f(cK,{asChild:!0,children:O0("button",{className:"flex items-center gap-1 p-1 rounded hover:bg-gray-100",children:[f("div",{className:"w-4 h-4 rounded-full border border-gray-200",style:{backgroundColor:d}}),f(Kh,{size:12,className:"text-gray-500"})]})}),f(dK,{className:"w-auto p-2",align:"center",side:"top",children:f("div",{className:"flex items-center gap-1",children:tS.map((A0)=>f("button",{onClick:()=>s(A0),className:`w-6 h-6 rounded-full border border-gray-200 transition-transform hover:scale-110 ${d===A0?"ring-2 ring-blue-500 ring-offset-1":""}`,style:{backgroundColor:A0}},A0))})})]}),f("div",{className:"h-4 w-px bg-gray-300 mx-1"}),f("button",{onClick:_0,disabled:E0<=0,className:"p-1.5 rounded hover:bg-gray-100 disabled:opacity-30 disabled:cursor-not-allowed text-gray-500",children:f(FH,{size:16})}),f("button",{onClick:Z0,disabled:E0>=X0.length-1,className:"p-1.5 rounded hover:bg-gray-100 disabled:opacity-30 disabled:cursor-not-allowed text-gray-500",children:f(LH,{size:16})})]}):O0("div",{className:"flex items-center gap-1",children:[f("input",{type:"file",ref:l1,className:"hidden",multiple:!0,onChange:B5}),D!==void 0&&O!==void 0&&f(j3,{onClick:()=>v(!R),variant:R?"secondary":"ghost",size:"icon",className:`p-2 rounded-full cursor-pointer ${R?"text-blue-600 bg-blue-50 dark:bg-blue-900/20":""}`,title:R?c0.disable_timestamp():c0.enable_timestamp(),children:f(NH,{className:"w-4 h-4"})}),f(j3,{onClick:()=>l1.current?.click(),className:"p-2 rounded-full cursor-pointer",variant:"ghost",size:"icon",title:c0.attach_files(),children:f($H,{className:"w-4 h-4"})}),!Z&&f(j3,{onClick:()=>Q0(!0),variant:"ghost",size:"icon",className:"p-2 rounded-full cursor-pointer",title:c0.toggle_annotation(),children:f(lK,{className:"w-4 h-4"})})]}),f("button",{onClick:a2,disabled:!u0||M0,className:`p-2 rounded-full transition-all duration-200 flex items-center justify-center shrink-0 ${u0&&!M0?"bg-blue-600 text-white shadow-md hover:bg-blue-700 hover:shadow-lg transform hover:-translate-y-0.5":"bg-gray-400 cursor-not-allowed"}`,children:f(kQ,{className:"w-4 h-4"})})]}),W&&O0("div",{className:"fixed inset-0 z-[100] bg-black/95 flex flex-col items-center justify-center p-4 animate-in fade-in duration-200",onClick:()=>S(null),children:[f("button",{className:"absolute top-4 right-4 text-white/70 hover:text-white hover:bg-white/20 rounded-full p-2 transition-colors z-50",children:f(Zh,{className:"w-8 h-8"})}),f("div",{className:"w-full h-full flex items-center justify-center p-2",children:f("img",{src:URL.createObjectURL(W),alt:"Enlarged view",className:"max-w-full max-h-[85vh] object-contain rounded shadow-2xl cursor-zoom-out",onClick:(A0)=>{A0.stopPropagation(),S(null)}})}),f("div",{className:"absolute bottom-6 text-white text-sm font-medium bg-black/50 px-4 py-2 rounded-full backdrop-blur-sm",children:W.name})]})]})});uQ.displayName="ChatInput";var RG=S1(l2(),1);function vH({isOpen:h,onClose:_,onSuccess:G,children:Y}){let[X,K]=RG.useState(""),[Z,Q]=RG.useState(""),[D,O]=RG.useState(!1),[A,H]=RG.useState(null);return O0(iK,{open:h,onOpenChange:(N)=>!N&&_(),children:[f(cK,{asChild:!0,children:Y}),f(dK,{className:"w-80",align:"end",side:"top",children:O0("form",{onSubmit:async(N)=>{N.preventDefault(),O(!0),H(null);try{let j=await y1.api.identify.$post({json:{username:X,email:Z}});if(!j.ok){let S=await j.json();throw Error(S.error||"Failed to identify")}let{id:W}=await j.json();localStorage.setItem("guest_user_id",W),G(W),_()}catch(j){H(j.message)}finally{O(!1)}},className:"space-y-4",children:[O0("div",{className:"space-y-2",children:[f("h4",{className:"font-medium leading-none",children:c0.enter_your_details()}),f("p",{className:"text-sm text-muted-foreground",children:c0.provide_name_email_for_comment()})]}),O0("div",{className:"grid gap-2",children:[O0("div",{className:"grid gap-1",children:[f(lQ,{htmlFor:"name",children:c0.name()}),f(pQ,{id:"name",value:X,onChange:(N)=>K(N.target.value),placeholder:c0.name_placeholder(),size:32,required:!0})]}),O0("div",{className:"grid gap-1",children:[f(lQ,{htmlFor:"email",children:c0.email()}),f(pQ,{id:"email",type:"email",value:Z,onChange:(N)=>Q(N.target.value),placeholder:c0.email_field_placeholder(),required:!0})]}),A&&f("p",{className:"text-xs text-destructive",children:A})]}),O0("div",{className:"flex justify-end gap-2",children:[f(j3,{type:"button",variant:"outline",size:"sm",onClick:_,children:c0.cancel()}),O0(j3,{type:"submit",size:"sm",disabled:D,children:[D&&f(SH,{className:"mr-2 h-3 w-3 animate-spin"}),c0.confirm()]})]})]})})]})}var C1=S1(l2(),1);var a=S1(F3(),1),T0=S1(eQ(),1),IM=S1(HV(),1),qM=S1(vV(),1);function U2(){return U2=Object.assign?Object.assign.bind():function(h){for(var _=1;_<arguments.length;_++){var G=arguments[_];for(var Y in G)({}).hasOwnProperty.call(G,Y)&&(h[Y]=G[Y])}return h},U2.apply(null,arguments)}var Dh=S1(F3(),1),xV="https://example.com",Kx=function(_,G){if(/^[a-z]+:/i.test(G))return G;if(/^data:/.test(_))_=Dh.default.location&&Dh.default.location.href||"";var Y=/^\/\//.test(_),X=!Dh.default.location&&!/\/\//i.test(_);_=new Dh.default.URL(_,Dh.default.location||xV);var K=new URL(G,_);if(X)return K.href.slice(xV.length);else if(Y)return K.href.slice(K.protocol.length);return K.href},Mh=Kx;var nK=function(){function h(){this.listeners={}}var _=h.prototype;return _.on=function(Y,X){if(!this.listeners[Y])this.listeners[Y]=[];this.listeners[Y].push(X)},_.off=function(Y,X){if(!this.listeners[Y])return!1;var K=this.listeners[Y].indexOf(X);return this.listeners[Y]=this.listeners[Y].slice(0),this.listeners[Y].splice(K,1),K>-1},_.trigger=function(Y){var X=this.listeners[Y];if(!X)return;if(arguments.length===2){var K=X.length;for(var Z=0;Z<K;++Z)X[Z].call(this,arguments[1])}else{var Q=Array.prototype.slice.call(arguments,1),D=X.length;for(var O=0;O<D;++O)X[O].apply(this,Q)}},_.dispose=function(){this.listeners={}},_.pipe=function(Y){this.on("data",function(X){Y.push(X)})},h}();var JD=S1(F3(),1),Zx=function(_){return JD.default.atob?JD.default.atob(_):Buffer.from(_,"base64").toString("binary")};function PG(h){var _=Zx(h),G=new Uint8Array(_.length);for(var Y=0;Y<_.length;Y++)G[Y]=_.charCodeAt(Y);return G}/*! @name m3u8-parser @version 7.2.0 @license Apache-2.0 */class gV extends nK{constructor(){super();this.buffer=""}push(h){let _;this.buffer+=h,_=this.buffer.indexOf(`
|
|
47
|
-
`);for(;_>-1;_=this.buffer.indexOf(`
|
|
48
|
-
`))this.trigger("data",this.buffer.substring(0,_)),this.buffer=this.buffer.substring(_+1)}}var Jx=String.fromCharCode(9),qD=function(h){let _=/([0-9.]*)?@?([0-9.]*)?/.exec(h||""),G={};if(_[1])G.length=parseInt(_[1],10);if(_[2])G.offset=parseInt(_[2],10);return G},qx=function(){return new RegExp("(?:^|,)("+'(?:[^=]*)=(?:"[^"]*"|[^,]*)'+")")},k5=function(h){let _={};if(!h)return _;let G=h.split(qx()),Y=G.length,X;while(Y--){if(G[Y]==="")continue;X=/([^=]*)=(.*)/.exec(G[Y]).slice(1),X[0]=X[0].replace(/^\s+|\s+$/g,""),X[1]=X[1].replace(/^\s+|\s+$/g,""),X[1]=X[1].replace(/^['"](.*)['"]$/g,"$1"),_[X[0]]=X[1]}return _},wV=(h)=>{let _=h.split("x"),G={};if(_[0])G.width=parseInt(_[0],10);if(_[1])G.height=parseInt(_[1],10);return G};class IV extends nK{constructor(){super();this.customParsers=[],this.tagMappers=[]}push(h){let _,G;if(h=h.trim(),h.length===0)return;if(h[0]!=="#"){this.trigger("data",{type:"uri",uri:h});return}this.tagMappers.reduce((X,K)=>{let Z=K(h);if(Z===h)return X;return X.concat([Z])},[h]).forEach((X)=>{for(let K=0;K<this.customParsers.length;K++)if(this.customParsers[K].call(this,X))return;if(X.indexOf("#EXT")!==0){this.trigger("data",{type:"comment",text:X.slice(1)});return}if(X=X.replace("\r",""),_=/^#EXTM3U/.exec(X),_){this.trigger("data",{type:"tag",tagType:"m3u"});return}if(_=/^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(X),_){if(G={type:"tag",tagType:"inf"},_[1])G.duration=parseFloat(_[1]);if(_[2])G.title=_[2];this.trigger("data",G);return}if(_=/^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(X),_){if(G={type:"tag",tagType:"targetduration"},_[1])G.duration=parseInt(_[1],10);this.trigger("data",G);return}if(_=/^#EXT-X-VERSION:([0-9.]*)?/.exec(X),_){if(G={type:"tag",tagType:"version"},_[1])G.version=parseInt(_[1],10);this.trigger("data",G);return}if(_=/^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(X),_){if(G={type:"tag",tagType:"media-sequence"},_[1])G.number=parseInt(_[1],10);this.trigger("data",G);return}if(_=/^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(X),_){if(G={type:"tag",tagType:"discontinuity-sequence"},_[1])G.number=parseInt(_[1],10);this.trigger("data",G);return}if(_=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(X),_){if(G={type:"tag",tagType:"playlist-type"},_[1])G.playlistType=_[1];this.trigger("data",G);return}if(_=/^#EXT-X-BYTERANGE:(.*)?$/.exec(X),_){G=U2(qD(_[1]),{type:"tag",tagType:"byterange"}),this.trigger("data",G);return}if(_=/^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(X),_){if(G={type:"tag",tagType:"allow-cache"},_[1])G.allowed=!/NO/.test(_[1]);this.trigger("data",G);return}if(_=/^#EXT-X-MAP:(.*)$/.exec(X),_){if(G={type:"tag",tagType:"map"},_[1]){let K=k5(_[1]);if(K.URI)G.uri=K.URI;if(K.BYTERANGE)G.byterange=qD(K.BYTERANGE)}this.trigger("data",G);return}if(_=/^#EXT-X-STREAM-INF:(.*)$/.exec(X),_){if(G={type:"tag",tagType:"stream-inf"},_[1]){if(G.attributes=k5(_[1]),G.attributes.RESOLUTION)G.attributes.RESOLUTION=wV(G.attributes.RESOLUTION);if(G.attributes.BANDWIDTH)G.attributes.BANDWIDTH=parseInt(G.attributes.BANDWIDTH,10);if(G.attributes["FRAME-RATE"])G.attributes["FRAME-RATE"]=parseFloat(G.attributes["FRAME-RATE"]);if(G.attributes["PROGRAM-ID"])G.attributes["PROGRAM-ID"]=parseInt(G.attributes["PROGRAM-ID"],10)}this.trigger("data",G);return}if(_=/^#EXT-X-MEDIA:(.*)$/.exec(X),_){if(G={type:"tag",tagType:"media"},_[1])G.attributes=k5(_[1]);this.trigger("data",G);return}if(_=/^#EXT-X-ENDLIST/.exec(X),_){this.trigger("data",{type:"tag",tagType:"endlist"});return}if(_=/^#EXT-X-DISCONTINUITY/.exec(X),_){this.trigger("data",{type:"tag",tagType:"discontinuity"});return}if(_=/^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(X),_){if(G={type:"tag",tagType:"program-date-time"},_[1])G.dateTimeString=_[1],G.dateTimeObject=new Date(_[1]);this.trigger("data",G);return}if(_=/^#EXT-X-KEY:(.*)$/.exec(X),_){if(G={type:"tag",tagType:"key"},_[1]){if(G.attributes=k5(_[1]),G.attributes.IV){if(G.attributes.IV.substring(0,2).toLowerCase()==="0x")G.attributes.IV=G.attributes.IV.substring(2);G.attributes.IV=G.attributes.IV.match(/.{8}/g),G.attributes.IV[0]=parseInt(G.attributes.IV[0],16),G.attributes.IV[1]=parseInt(G.attributes.IV[1],16),G.attributes.IV[2]=parseInt(G.attributes.IV[2],16),G.attributes.IV[3]=parseInt(G.attributes.IV[3],16),G.attributes.IV=new Uint32Array(G.attributes.IV)}}this.trigger("data",G);return}if(_=/^#EXT-X-START:(.*)$/.exec(X),_){if(G={type:"tag",tagType:"start"},_[1])G.attributes=k5(_[1]),G.attributes["TIME-OFFSET"]=parseFloat(G.attributes["TIME-OFFSET"]),G.attributes.PRECISE=/YES/.test(G.attributes.PRECISE);this.trigger("data",G);return}if(_=/^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(X),_){if(G={type:"tag",tagType:"cue-out-cont"},_[1])G.data=_[1];else G.data="";this.trigger("data",G);return}if(_=/^#EXT-X-CUE-OUT:(.*)?$/.exec(X),_){if(G={type:"tag",tagType:"cue-out"},_[1])G.data=_[1];else G.data="";this.trigger("data",G);return}if(_=/^#EXT-X-CUE-IN:?(.*)?$/.exec(X),_){if(G={type:"tag",tagType:"cue-in"},_[1])G.data=_[1];else G.data="";this.trigger("data",G);return}if(_=/^#EXT-X-SKIP:(.*)$/.exec(X),_&&_[1]){if(G={type:"tag",tagType:"skip"},G.attributes=k5(_[1]),G.attributes.hasOwnProperty("SKIPPED-SEGMENTS"))G.attributes["SKIPPED-SEGMENTS"]=parseInt(G.attributes["SKIPPED-SEGMENTS"],10);if(G.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES"))G.attributes["RECENTLY-REMOVED-DATERANGES"]=G.attributes["RECENTLY-REMOVED-DATERANGES"].split(Jx);this.trigger("data",G);return}if(_=/^#EXT-X-PART:(.*)$/.exec(X),_&&_[1]){if(G={type:"tag",tagType:"part"},G.attributes=k5(_[1]),["DURATION"].forEach(function(K){if(G.attributes.hasOwnProperty(K))G.attributes[K]=parseFloat(G.attributes[K])}),["INDEPENDENT","GAP"].forEach(function(K){if(G.attributes.hasOwnProperty(K))G.attributes[K]=/YES/.test(G.attributes[K])}),G.attributes.hasOwnProperty("BYTERANGE"))G.attributes.byterange=qD(G.attributes.BYTERANGE);this.trigger("data",G);return}if(_=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(X),_&&_[1]){G={type:"tag",tagType:"server-control"},G.attributes=k5(_[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach(function(K){if(G.attributes.hasOwnProperty(K))G.attributes[K]=parseFloat(G.attributes[K])}),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach(function(K){if(G.attributes.hasOwnProperty(K))G.attributes[K]=/YES/.test(G.attributes[K])}),this.trigger("data",G);return}if(_=/^#EXT-X-PART-INF:(.*)$/.exec(X),_&&_[1]){G={type:"tag",tagType:"part-inf"},G.attributes=k5(_[1]),["PART-TARGET"].forEach(function(K){if(G.attributes.hasOwnProperty(K))G.attributes[K]=parseFloat(G.attributes[K])}),this.trigger("data",G);return}if(_=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(X),_&&_[1]){G={type:"tag",tagType:"preload-hint"},G.attributes=k5(_[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach(function(K){if(G.attributes.hasOwnProperty(K)){G.attributes[K]=parseInt(G.attributes[K],10);let Z=K==="BYTERANGE-LENGTH"?"length":"offset";G.attributes.byterange=G.attributes.byterange||{},G.attributes.byterange[Z]=G.attributes[K],delete G.attributes[K]}}),this.trigger("data",G);return}if(_=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(X),_&&_[1]){G={type:"tag",tagType:"rendition-report"},G.attributes=k5(_[1]),["LAST-MSN","LAST-PART"].forEach(function(K){if(G.attributes.hasOwnProperty(K))G.attributes[K]=parseInt(G.attributes[K],10)}),this.trigger("data",G);return}if(_=/^#EXT-X-DATERANGE:(.*)$/.exec(X),_&&_[1]){G={type:"tag",tagType:"daterange"},G.attributes=k5(_[1]),["ID","CLASS"].forEach(function(Z){if(G.attributes.hasOwnProperty(Z))G.attributes[Z]=String(G.attributes[Z])}),["START-DATE","END-DATE"].forEach(function(Z){if(G.attributes.hasOwnProperty(Z))G.attributes[Z]=new Date(G.attributes[Z])}),["DURATION","PLANNED-DURATION"].forEach(function(Z){if(G.attributes.hasOwnProperty(Z))G.attributes[Z]=parseFloat(G.attributes[Z])}),["END-ON-NEXT"].forEach(function(Z){if(G.attributes.hasOwnProperty(Z))G.attributes[Z]=/YES/i.test(G.attributes[Z])}),["SCTE35-CMD"," SCTE35-OUT","SCTE35-IN"].forEach(function(Z){if(G.attributes.hasOwnProperty(Z))G.attributes[Z]=G.attributes[Z].toString(16)});let K=/^X-([A-Z]+-)+[A-Z]+$/;for(let Z in G.attributes){if(!K.test(Z))continue;let Q=/[0-9A-Fa-f]{6}/g.test(G.attributes[Z]),D=/^\d+(\.\d+)?$/.test(G.attributes[Z]);G.attributes[Z]=Q?G.attributes[Z].toString(16):D?parseFloat(G.attributes[Z]):String(G.attributes[Z])}this.trigger("data",G);return}if(_=/^#EXT-X-INDEPENDENT-SEGMENTS/.exec(X),_){this.trigger("data",{type:"tag",tagType:"independent-segments"});return}if(_=/^#EXT-X-I-FRAMES-ONLY/.exec(X),_){this.trigger("data",{type:"tag",tagType:"i-frames-only"});return}if(_=/^#EXT-X-CONTENT-STEERING:(.*)$/.exec(X),_){G={type:"tag",tagType:"content-steering"},G.attributes=k5(_[1]),this.trigger("data",G);return}if(_=/^#EXT-X-I-FRAME-STREAM-INF:(.*)$/.exec(X),_){if(G={type:"tag",tagType:"i-frame-playlist"},G.attributes=k5(_[1]),G.attributes.URI)G.uri=G.attributes.URI;if(G.attributes.BANDWIDTH)G.attributes.BANDWIDTH=parseInt(G.attributes.BANDWIDTH,10);if(G.attributes.RESOLUTION)G.attributes.RESOLUTION=wV(G.attributes.RESOLUTION);if(G.attributes["AVERAGE-BANDWIDTH"])G.attributes["AVERAGE-BANDWIDTH"]=parseInt(G.attributes["AVERAGE-BANDWIDTH"],10);if(G.attributes["FRAME-RATE"])G.attributes["FRAME-RATE"]=parseFloat(G.attributes["FRAME-RATE"]);this.trigger("data",G);return}if(_=/^#EXT-X-DEFINE:(.*)$/.exec(X),_){G={type:"tag",tagType:"define"},G.attributes=k5(_[1]),this.trigger("data",G);return}this.trigger("data",{type:"tag",data:X.slice(4)})})}addParser({expression:h,customType:_,dataParser:G,segment:Y}){if(typeof G!=="function")G=(X)=>X;this.customParsers.push((X)=>{if(h.exec(X))return this.trigger("data",{type:"custom",data:G(X),customType:_,segment:Y}),!0})}addTagMapper({expression:h,map:_}){let G=(Y)=>{if(h.test(Y))return _(Y);return Y};this.tagMappers.push(G)}}var Qx=(h)=>h.toLowerCase().replace(/-(\w)/g,(_)=>_[1].toUpperCase()),V8=function(h){let _={};return Object.keys(h).forEach(function(G){_[Qx(G)]=h[G]}),_},QD=function(h){let{serverControl:_,targetDuration:G,partTargetDuration:Y}=h;if(!_)return;let X="#EXT-X-SERVER-CONTROL",K="holdBack",Z="partHoldBack",Q=G&&G*3,D=Y&&Y*2;if(G&&!_.hasOwnProperty(K))_[K]=Q,this.trigger("info",{message:`${X} defaulting HOLD-BACK to targetDuration * 3 (${Q}).`});if(Q&&_[K]<Q)this.trigger("warn",{message:`${X} clamping HOLD-BACK (${_[K]}) to targetDuration * 3 (${Q})`}),_[K]=Q;if(Y&&!_.hasOwnProperty(Z))_[Z]=Y*3,this.trigger("info",{message:`${X} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${_[Z]}).`});if(Y&&_[Z]<D)this.trigger("warn",{message:`${X} clamping PART-HOLD-BACK (${_[Z]}) to partTargetDuration * 2 (${D}).`}),_[Z]=D};class DD extends nK{constructor(h={}){super();this.lineStream=new gV,this.parseStream=new IV,this.lineStream.pipe(this.parseStream),this.mainDefinitions=h.mainDefinitions||{},this.params=new URL(h.uri,"https://a.com").searchParams,this.lastProgramDateTime=null;let _=this,G=[],Y={},X,K,Z=!1,Q=function(){},D={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},O="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",A=0;this.manifest={allowCache:!0,discontinuityStarts:[],dateRanges:[],iFramePlaylists:[],segments:[]};let H=0,C=0,N={};this.on("end",()=>{if(Y.uri||!Y.parts&&!Y.preloadHints)return;if(!Y.map&&X)Y.map=X;if(!Y.key&&K)Y.key=K;if(!Y.timeline&&typeof A==="number")Y.timeline=A;this.manifest.preloadSegment=Y}),this.parseStream.on("data",function(j){let W,S;if(_.manifest.definitions)for(let R in _.manifest.definitions){if(j.uri)j.uri=j.uri.replace(`{$${R}}`,_.manifest.definitions[R]);if(j.attributes){for(let v in j.attributes)if(typeof j.attributes[v]==="string")j.attributes[v]=j.attributes[v].replace(`{$${R}}`,_.manifest.definitions[R])}}({tag(){({version(){if(j.version)this.manifest.version=j.version},"allow-cache"(){if(this.manifest.allowCache=j.allowed,!("allowed"in j))this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0},byterange(){let R={};if("length"in j){if(Y.byterange=R,R.length=j.length,!("offset"in j))j.offset=H}if("offset"in j)Y.byterange=R,R.offset=j.offset;H=R.offset+R.length},endlist(){this.manifest.endList=!0},inf(){if(!("mediaSequence"in this.manifest))this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"});if(!("discontinuitySequence"in this.manifest))this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"});if(j.title)Y.title=j.title;if(j.duration>0)Y.duration=j.duration;if(j.duration===0)Y.duration=0.01,this.trigger("info",{message:"updating zero segment duration to a small value"});this.manifest.segments=G},key(){if(!j.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(j.attributes.METHOD==="NONE"){K=null;return}if(!j.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(j.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:j.attributes};return}if(j.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.microsoft.playready"]={uri:j.attributes.URI};return}if(j.attributes.KEYFORMAT===O){if(["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(j.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(j.attributes.METHOD==="SAMPLE-AES-CENC")this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"});if(j.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(j.attributes.KEYID&&j.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:j.attributes.KEYFORMAT,keyId:j.attributes.KEYID.substring(2)},pssh:PG(j.attributes.URI.split(",")[1])};return}if(!j.attributes.METHOD)this.trigger("warn",{message:"defaulting key method to AES-128"});if(K={method:j.attributes.METHOD||"AES-128",uri:j.attributes.URI},typeof j.attributes.IV<"u")K.iv=j.attributes.IV},"media-sequence"(){if(!isFinite(j.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+j.number});return}this.manifest.mediaSequence=j.number},"discontinuity-sequence"(){if(!isFinite(j.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+j.number});return}this.manifest.discontinuitySequence=j.number,A=j.number},"playlist-type"(){if(!/VOD|EVENT/.test(j.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+j.playlist});return}this.manifest.playlistType=j.playlistType},map(){if(X={},j.uri)X.uri=j.uri;if(j.byterange)X.byterange=j.byterange;if(K)X.key=K},"stream-inf"(){if(this.manifest.playlists=G,this.manifest.mediaGroups=this.manifest.mediaGroups||D,!j.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}if(!Y.attributes)Y.attributes={};U2(Y.attributes,j.attributes)},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||D,!(j.attributes&&j.attributes.TYPE&&j.attributes["GROUP-ID"]&&j.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}let R=this.manifest.mediaGroups[j.attributes.TYPE];if(R[j.attributes["GROUP-ID"]]=R[j.attributes["GROUP-ID"]]||{},W=R[j.attributes["GROUP-ID"]],S={default:/yes/i.test(j.attributes.DEFAULT)},S.default)S.autoselect=!0;else S.autoselect=/yes/i.test(j.attributes.AUTOSELECT);if(j.attributes.LANGUAGE)S.language=j.attributes.LANGUAGE;if(j.attributes.URI)S.uri=j.attributes.URI;if(j.attributes["INSTREAM-ID"])S.instreamId=j.attributes["INSTREAM-ID"];if(j.attributes.CHARACTERISTICS)S.characteristics=j.attributes.CHARACTERISTICS;if(j.attributes.FORCED)S.forced=/yes/i.test(j.attributes.FORCED);W[j.attributes.NAME]=S},discontinuity(){A+=1,Y.discontinuity=!0,this.manifest.discontinuityStarts.push(G.length)},"program-date-time"(){if(typeof this.manifest.dateTimeString>"u")this.manifest.dateTimeString=j.dateTimeString,this.manifest.dateTimeObject=j.dateTimeObject;Y.dateTimeString=j.dateTimeString,Y.dateTimeObject=j.dateTimeObject;let{lastProgramDateTime:R}=this;if(this.lastProgramDateTime=new Date(j.dateTimeString).getTime(),R===null)this.manifest.segments.reduceRight((v,x)=>{return x.programDateTime=v-x.duration*1000,x.programDateTime},this.lastProgramDateTime)},targetduration(){if(!isFinite(j.duration)||j.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+j.duration});return}this.manifest.targetDuration=j.duration,QD.call(this,this.manifest)},start(){if(!j.attributes||isNaN(j.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:j.attributes["TIME-OFFSET"],precise:j.attributes.PRECISE}},"cue-out"(){Y.cueOut=j.data},"cue-out-cont"(){Y.cueOutCont=j.data},"cue-in"(){Y.cueIn=j.data},skip(){this.manifest.skip=V8(j.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",j.attributes,["SKIPPED-SEGMENTS"])},part(){Z=!0;let R=this.manifest.segments.length,v=V8(j.attributes);if(Y.parts=Y.parts||[],Y.parts.push(v),v.byterange){if(!v.byterange.hasOwnProperty("offset"))v.byterange.offset=C;C=v.byterange.offset+v.byterange.length}let x=Y.parts.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PART #${x} for segment #${R}`,j.attributes,["URI","DURATION"]),this.manifest.renditionReports)this.manifest.renditionReports.forEach((P,I)=>{if(!P.hasOwnProperty("lastPart"))this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${I} lacks required attribute(s): LAST-PART`})})},"server-control"(){let R=this.manifest.serverControl=V8(j.attributes);if(!R.hasOwnProperty("canBlockReload"))R.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"});if(QD.call(this,this.manifest),R.canSkipDateranges&&!R.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"(){let R=this.manifest.segments.length,v=V8(j.attributes),x=v.type&&v.type==="PART";if(Y.preloadHints=Y.preloadHints||[],Y.preloadHints.push(v),v.byterange){if(!v.byterange.hasOwnProperty("offset")){if(v.byterange.offset=x?C:0,x)C=v.byterange.offset+v.byterange.length}}let P=Y.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${P} for segment #${R}`,j.attributes,["TYPE","URI"]),!v.type)return;for(let I=0;I<Y.preloadHints.length-1;I++){let b=Y.preloadHints[I];if(!b.type)continue;if(b.type===v.type)this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${P} for segment #${R} has the same TYPE ${v.type} as preload hint #${I}`})}},"rendition-report"(){let R=V8(j.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(R);let v=this.manifest.renditionReports.length-1,x=["LAST-MSN","URI"];if(Z)x.push("LAST-PART");this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${v}`,j.attributes,x)},"part-inf"(){if(this.manifest.partInf=V8(j.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",j.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget)this.manifest.partTargetDuration=this.manifest.partInf.partTarget;QD.call(this,this.manifest)},daterange(){this.manifest.dateRanges.push(V8(j.attributes));let R=this.manifest.dateRanges.length-1;this.warnOnMissingAttributes_(`#EXT-X-DATERANGE #${R}`,j.attributes,["ID","START-DATE"]);let v=this.manifest.dateRanges[R];if(v.endDate&&v.startDate&&new Date(v.endDate)<new Date(v.startDate))this.trigger("warn",{message:"EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE"});if(v.duration&&v.duration<0)this.trigger("warn",{message:"EXT-X-DATERANGE DURATION must not be negative"});if(v.plannedDuration&&v.plannedDuration<0)this.trigger("warn",{message:"EXT-X-DATERANGE PLANNED-DURATION must not be negative"});let x=!!v.endOnNext;if(x&&!v.class)this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must have a CLASS attribute"});if(x&&(v.duration||v.endDate))this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes"});if(v.duration&&v.endDate){let I=v.startDate.getTime()+v.duration*1000;this.manifest.dateRanges[R].endDate=new Date(I)}if(!N[v.id])N[v.id]=v;else{for(let I in N[v.id])if(!!v[I]&&JSON.stringify(N[v.id][I])!==JSON.stringify(v[I])){this.trigger("warn",{message:"EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes values"});break}let P=this.manifest.dateRanges.findIndex((I)=>I.id===v.id);this.manifest.dateRanges[P]=U2(this.manifest.dateRanges[P],v),N[v.id]=U2(N[v.id],v),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=V8(j.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",j.attributes,["SERVER-URI"])},define(){this.manifest.definitions=this.manifest.definitions||{};let R=(v,x)=>{if(v in this.manifest.definitions){this.trigger("error",{message:`EXT-X-DEFINE: Duplicate name ${v}`});return}this.manifest.definitions[v]=x};if("QUERYPARAM"in j.attributes){if("NAME"in j.attributes||"IMPORT"in j.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}let v=this.params.get(j.attributes.QUERYPARAM);if(!v){this.trigger("error",{message:`EXT-X-DEFINE: No query param ${j.attributes.QUERYPARAM}`});return}R(j.attributes.QUERYPARAM,decodeURIComponent(v));return}if("NAME"in j.attributes){if("IMPORT"in j.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}if(!("VALUE"in j.attributes)||typeof j.attributes.VALUE!=="string"){this.trigger("error",{message:`EXT-X-DEFINE: No value for ${j.attributes.NAME}`});return}R(j.attributes.NAME,j.attributes.VALUE);return}if("IMPORT"in j.attributes){if(!this.mainDefinitions[j.attributes.IMPORT]){this.trigger("error",{message:`EXT-X-DEFINE: No value ${j.attributes.IMPORT} to import, or IMPORT used on main playlist`});return}R(j.attributes.IMPORT,this.mainDefinitions[j.attributes.IMPORT]);return}this.trigger("error",{message:"EXT-X-DEFINE: No attribute"})},"i-frame-playlist"(){this.manifest.iFramePlaylists.push({attributes:j.attributes,uri:j.uri,timeline:A}),this.warnOnMissingAttributes_("#EXT-X-I-FRAME-STREAM-INF",j.attributes,["BANDWIDTH","URI"])}}[j.tagType]||Q).call(_)},uri(){if(Y.uri=j.uri,G.push(Y),this.manifest.targetDuration&&!("duration"in Y))this.trigger("warn",{message:"defaulting segment duration to the target duration"}),Y.duration=this.manifest.targetDuration;if(K)Y.key=K;if(Y.timeline=A,X)Y.map=X;if(C=0,this.lastProgramDateTime!==null)Y.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=Y.duration*1000;Y={}},comment(){},custom(){if(j.segment)Y.custom=Y.custom||{},Y.custom[j.customType]=j.data;else this.manifest.custom=this.manifest.custom||{},this.manifest.custom[j.customType]=j.data}})[j.type].call(_)})}requiredCompatibilityversion(h,_){if(h<_||!h)this.trigger("warn",{message:`manifest must be at least version ${_}`})}warnOnMissingAttributes_(h,_,G){let Y=[];if(G.forEach(function(X){if(!_.hasOwnProperty(X))Y.push(X)}),Y.length)this.trigger("warn",{message:`${h} lacks required attribute(s): ${Y.join(", ")}`})}push(h){this.lineStream.push(h)}end(){if(this.lineStream.push(`
|
|
49
|
-
`),this.manifest.dateRanges.length&&this.lastProgramDateTime===null)this.trigger("warn",{message:"A playlist with EXT-X-DATERANGE tag must contain atleast one EXT-X-PROGRAM-DATE-TIME tag"});this.lastProgramDateTime=null,this.trigger("end")}addParser(h){this.parseStream.addParser(h)}addTagMapper(h){this.parseStream.addTagMapper(h)}}var x7=S1(F3(),1),w7={mp4:/^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,webm:/^(vp0?[89]|av0?1|opus|vorbis)/,ogg:/^(vp0?[89]|theora|flac|opus|vorbis)/,video:/^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,audio:/^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,text:/^(stpp.ttml.im1t)/,muxerVideo:/^(avc0?1)/,muxerAudio:/^(mp4a)/,muxerText:/a^/},Dx=["video","audio","text"],PV=["Video","Audio","Text"],MD=function(_){if(!_)return _;return _.replace(/avc1\.(\d+)\.(\d+)/i,function(G,Y,X){var K=("00"+Number(Y).toString(16)).slice(-2),Z=("00"+Number(X).toString(16)).slice(-2);return"avc1."+K+"00"+Z})};var J3=function(_){if(_===void 0)_="";var G=_.split(","),Y=[];return G.forEach(function(X){X=X.trim();var K;if(Dx.forEach(function(Z){var Q=w7[Z].exec(X.toLowerCase());if(!Q||Q.length<=1)return;K=Z;var D=X.substring(0,Q[1].length),O=X.replace(D,"");Y.push({type:D,details:O,mediaType:Z})}),!K)Y.push({type:X,details:"",mediaType:"unknown"})}),Y},yV=function(_,G){if(!_.mediaGroups.AUDIO||!G)return null;var Y=_.mediaGroups.AUDIO[G];if(!Y)return null;for(var X in Y){var K=Y[X];if(K.default&&K.playlists)return J3(K.playlists[0].attributes.CODECS)}return null};var BD=function(_){if(_===void 0)_="";return w7.audio.test(_.trim().toLowerCase())},Mx=function(_){if(_===void 0)_="";return w7.text.test(_.trim().toLowerCase())},g7=function(_){if(!_||typeof _!=="string")return;var G=_.toLowerCase().split(",").map(function(K){return MD(K.trim())}),Y="video";if(G.length===1&&BD(G[0]))Y="audio";else if(G.length===1&&Mx(G[0]))Y="application";var X="mp4";if(G.every(function(K){return w7.mp4.test(K)}))X="mp4";else if(G.every(function(K){return w7.webm.test(K)}))X="webm";else if(G.every(function(K){return w7.ogg.test(K)}))X="ogg";return Y+"/"+X+';codecs="'+_+'"'},Bh=function(_,G){if(_===void 0)_="";if(G===void 0)G=!1;return x7.default.MediaSource&&x7.default.MediaSource.isTypeSupported&&x7.default.MediaSource.isTypeSupported(g7(_))||G&&x7.default.ManagedMediaSource&&x7.default.ManagedMediaSource.isTypeSupported&&x7.default.ManagedMediaSource.isTypeSupported(g7(_))||!1},oK=function(_){if(_===void 0)_="";return _.toLowerCase().split(",").every(function(G){G=G.trim();for(var Y=0;Y<PV.length;Y++){var X=PV[Y];if(w7["muxer"+X].test(G))return!0}return!1})},OD="mp4a.40.2",bV="avc1.4d400d";var Bx=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,Ox=/^application\/dash\+xml/i,AD=function(_){if(Bx.test(_))return"hls";if(Ox.test(_))return"dash";if(_==="application/vnd.videojs.vhs+json")return"vhs-json";return null};var mV=S1(F3(),1);var Ax=function(_){return _.toString(2).length},zx=function(_){return Math.ceil(Ax(_)/8)};var HD=function(_){if(ArrayBuffer.isView==="function")return ArrayBuffer.isView(_);return _&&_.buffer instanceof ArrayBuffer},Hx=function(_){return HD(_)},d0=function(_){if(_ instanceof Uint8Array)return _;if(!Array.isArray(_)&&!Hx(_)&&!(_ instanceof ArrayBuffer))if(typeof _!=="number"||typeof _==="number"&&_!==_)_=0;else _=[_];return new Uint8Array(_&&_.buffer||_,_&&_.byteOffset||0,_&&_.byteLength||0)};var N5=mV.default.BigInt||Number,zD=[N5("0x1"),N5("0x100"),N5("0x10000"),N5("0x1000000"),N5("0x100000000"),N5("0x10000000000"),N5("0x1000000000000"),N5("0x100000000000000"),N5("0x10000000000000000")],ps=function(){var h=new Uint16Array([65484]),_=new Uint8Array(h.buffer,h.byteOffset,h.byteLength);if(_[0]===255)return"big";if(_[0]===204)return"little";return"unknown"}();var VD=function(_,G){var Y=G===void 0?{}:G,X=Y.signed,K=X===void 0?!1:X,Z=Y.le,Q=Z===void 0?!1:Z;_=d0(_);var D=Q?"reduce":"reduceRight",O=_[D]?_[D]:Array.prototype[D],A=O.call(_,function(C,N,j){var W=Q?j:Math.abs(j+1-_.length);return C+N5(N)*zD[W]},N5(0));if(K){var H=zD[_.length]/N5(2)-N5(1);if(A=N5(A),A>H)A-=H,A-=H,A-=N5(2)}return Number(A)},fV=function(_,G){var Y=G===void 0?{}:G,X=Y.le,K=X===void 0?!1:X;if(typeof _!=="bigint"&&typeof _!=="number"||typeof _==="number"&&_!==_)_=0;_=N5(_);var Z=zx(_),Q=new Uint8Array(new ArrayBuffer(Z));for(var D=0;D<Z;D++){var O=K?D:Math.abs(D+1-Q.length);if(Q[O]=Number(_/zD[D]&N5(255)),_<0)Q[O]=Math.abs(~Q[O]),Q[O]-=D===0?1:2}return Q},UD=function(_){if(!_)return"";_=Array.prototype.slice.call(_);var G=String.fromCharCode.apply(null,d0(_));try{return decodeURIComponent(escape(G))}catch(Y){}return G},rK=function(_,G){if(typeof _!=="string"&&_&&typeof _.toString==="function")_=_.toString();if(typeof _!=="string")return new Uint8Array;if(!G)_=unescape(encodeURIComponent(_));var Y=new Uint8Array(_.length);for(var X=0;X<_.length;X++)Y[X]=_.charCodeAt(X);return Y},kV=function(){for(var _=arguments.length,G=Array(_),Y=0;Y<_;Y++)G[Y]=arguments[Y];if(G=G.filter(function(Q){return Q&&(Q.byteLength||Q.length)&&typeof Q!=="string"}),G.length<=1)return d0(G[0]);var X=G.reduce(function(Q,D,O){return Q+(D.byteLength||D.length)},0),K=new Uint8Array(X),Z=0;return G.forEach(function(Q){Q=d0(Q),K.set(Q,Z),Z+=Q.byteLength}),K},d1=function(_,G,Y){var X=Y===void 0?{}:Y,K=X.offset,Z=K===void 0?0:K,Q=X.mask,D=Q===void 0?[]:Q;_=d0(_),G=d0(G);var O=G.every?G.every:Array.prototype.every;return G.length&&_.length-Z>=G.length&&O.call(G,function(A,H){var C=D[H]?D[H]&_[Z+H]:_[Z+H];return A===C})};var u5=S1(F3(),1);var uV=function(_,G,Y){G.forEach(function(X){for(var K in _.mediaGroups[X])for(var Z in _.mediaGroups[X][K]){var Q=_.mediaGroups[X][K][Z];Y(Q,X,K,Z)}})};var gU=xD();var{DOMImplementation:Vw,XMLSerializer:Uw}=gU,ID=wU().DOMParser;/*! @name mpd-parser @version 1.3.1 @license Apache-2.0 */var IU=(h)=>{return!!h&&typeof h==="object"},J5=(...h)=>{return h.reduce((_,G)=>{if(typeof G!=="object")return _;return Object.keys(G).forEach((Y)=>{if(Array.isArray(_[Y])&&Array.isArray(G[Y]))_[Y]=_[Y].concat(G[Y]);else if(IU(_[Y])&&IU(G[Y]))_[Y]=J5(_[Y],G[Y]);else _[Y]=G[Y]}),_},{})},uU=(h)=>Object.keys(h).map((_)=>h[_]),Ew=(h,_)=>{let G=[];for(let Y=h;Y<_;Y++)G.push(Y);return G},$h=(h)=>h.reduce((_,G)=>_.concat(G),[]),pU=(h)=>{if(!h.length)return[];let _=[];for(let G=0;G<h.length;G++)_.push(h[G]);return _},Cw=(h,_)=>h.reduce((G,Y,X)=>{if(Y[_])G.push(X);return G},[]),Nw=(h,_)=>{return uU(h.reduce((G,Y)=>{return Y.forEach((X)=>{G[_(X)]=X}),G},{}))},Lh={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"},aG=({baseUrl:h="",source:_="",range:G="",indexRange:Y=""})=>{let X={uri:_,resolvedUri:Mh(h||"",_)};if(G||Y){let Z=(G?G:Y).split("-"),Q=u5.default.BigInt?u5.default.BigInt(Z[0]):parseInt(Z[0],10),D=u5.default.BigInt?u5.default.BigInt(Z[1]):parseInt(Z[1],10);if(Q<Number.MAX_SAFE_INTEGER&&typeof Q==="bigint")Q=Number(Q);if(D<Number.MAX_SAFE_INTEGER&&typeof D==="bigint")D=Number(D);let O;if(typeof D==="bigint"||typeof Q==="bigint")O=u5.default.BigInt(D)-u5.default.BigInt(Q)+u5.default.BigInt(1);else O=D-Q+1;if(typeof O==="bigint"&&O<Number.MAX_SAFE_INTEGER)O=Number(O);X.byterange={length:O,offset:Q}}return X},$w=(h)=>{let _;if(typeof h.offset==="bigint"||typeof h.length==="bigint")_=u5.default.BigInt(h.offset)+u5.default.BigInt(h.length)-u5.default.BigInt(1);else _=h.offset+h.length-1;return`${h.offset}-${_}`},PU=(h)=>{if(h&&typeof h!=="number")h=parseInt(h,10);if(isNaN(h))return null;return h},Lw={static(h){let{duration:_,timescale:G=1,sourceDuration:Y,periodDuration:X}=h,K=PU(h.endNumber),Z=_/G;if(typeof K==="number")return{start:0,end:K};if(typeof X==="number")return{start:0,end:X/Z};return{start:0,end:Y/Z}},dynamic(h){let{NOW:_,clientOffset:G,availabilityStartTime:Y,timescale:X=1,duration:K,periodStart:Z=0,minimumUpdatePeriod:Q=0,timeShiftBufferDepth:D=1/0}=h,O=PU(h.endNumber),A=(_+G)/1000,H=Y+Z,N=A+Q-H,j=Math.ceil(N*X/K),W=Math.floor((A-H-D)*X/K),S=Math.floor((A-H)*X/K);return{start:Math.max(0,W),end:typeof O==="number"?O:Math.min(j,S)}}},jw=(h)=>(_)=>{let{duration:G,timescale:Y=1,periodStart:X,startNumber:K=1}=h;return{number:K+_,duration:G/Y,timeline:X,time:_*G}},yD=(h)=>{let{type:_,duration:G,timescale:Y=1,periodDuration:X,sourceDuration:K}=h,{start:Z,end:Q}=Lw[_](h),D=Ew(Z,Q).map(jw(h));if(_==="static"){let O=D.length-1,A=typeof X==="number"?X:K;D[O].duration=A-G/Y*O}return D},lU=(h)=>{let{baseUrl:_,initialization:G={},sourceDuration:Y,indexRange:X="",periodStart:K,presentationTime:Z,number:Q=0,duration:D}=h;if(!_)throw Error(Lh.NO_BASE_URL);let O=aG({baseUrl:_,source:G.sourceURL,range:G.range}),A=aG({baseUrl:_,source:_,indexRange:X});if(A.map=O,D){let H=yD(h);if(H.length)A.duration=H[0].duration,A.timeline=H[0].timeline}else if(Y)A.duration=Y,A.timeline=K;return A.presentationTime=Z||K,A.number=Q,[A]},QZ=(h,_,G)=>{let Y=h.sidx.map?h.sidx.map:null,X=h.sidx.duration,K=h.timeline||0,Z=h.sidx.byterange,Q=Z.offset+Z.length,D=_.timescale,O=_.references.filter((S)=>S.referenceType!==1),A=[],H=h.endList?"static":"dynamic",C=h.sidx.timeline,N=C,j=h.mediaSequence||0,W;if(typeof _.firstOffset==="bigint")W=u5.default.BigInt(Q)+_.firstOffset;else W=Q+_.firstOffset;for(let S=0;S<O.length;S++){let R=_.references[S],v=R.referencedSize,x=R.subsegmentDuration,P;if(typeof W==="bigint")P=W+u5.default.BigInt(v)-u5.default.BigInt(1);else P=W+v-1;let I=`${W}-${P}`,l=lU({baseUrl:G,timescale:D,timeline:K,periodStart:C,presentationTime:N,number:j,duration:x,sourceDuration:X,indexRange:I,type:H})[0];if(Y)l.map=Y;if(A.push(l),typeof W==="bigint")W+=u5.default.BigInt(v);else W+=v;N+=x/D,j++}return h.segments=A,h},Fw=["AUDIO","SUBTITLES"],Tw=0.016666666666666666,iU=(h)=>{return Nw(h,({timeline:_})=>_).sort((_,G)=>_.timeline>G.timeline?1:-1)},Ww=(h,_)=>{for(let G=0;G<h.length;G++)if(h[G].attributes.NAME===_)return h[G];return null},yU=(h)=>{let _=[];return uV(h,Fw,(G,Y,X,K)=>{_=_.concat(G.playlists||[])}),_},bU=({playlist:h,mediaSequence:_})=>{h.mediaSequence=_,h.segments.forEach((G,Y)=>{G.number=h.mediaSequence+Y})},Rw=({oldPlaylists:h,newPlaylists:_,timelineStarts:G})=>{_.forEach((Y)=>{Y.discontinuitySequence=G.findIndex(function({timeline:D}){return D===Y.timeline});let X=Ww(h,Y.attributes.NAME);if(!X)return;if(Y.sidx)return;let K=Y.segments[0],Z=X.segments.findIndex(function(D){return Math.abs(D.presentationTime-K.presentationTime)<Tw});if(Z===-1){if(bU({playlist:Y,mediaSequence:X.mediaSequence+X.segments.length}),Y.segments[0].discontinuity=!0,Y.discontinuityStarts.unshift(0),!X.segments.length&&Y.timeline>X.timeline||X.segments.length&&Y.timeline>X.segments[X.segments.length-1].timeline)Y.discontinuitySequence--;return}if(X.segments[Z].discontinuity&&!K.discontinuity)K.discontinuity=!0,Y.discontinuityStarts.unshift(0),Y.discontinuitySequence--;bU({playlist:Y,mediaSequence:X.segments[Z].number})})},Sw=({oldManifest:h,newManifest:_})=>{let G=h.playlists.concat(yU(h)),Y=_.playlists.concat(yU(_));return _.timelineStarts=iU([h.timelineStarts,_.timelineStarts]),Rw({oldPlaylists:G,newPlaylists:Y,timelineStarts:_.timelineStarts}),_},tG=(h)=>h&&h.uri+"-"+$w(h.byterange),PD=(h)=>{let _=h.reduce(function(Y,X){if(!Y[X.attributes.baseUrl])Y[X.attributes.baseUrl]=[];return Y[X.attributes.baseUrl].push(X),Y},{}),G=[];return Object.values(_).forEach((Y)=>{let X=uU(Y.reduce((K,Z)=>{let Q=Z.attributes.id+(Z.attributes.lang||"");if(!K[Q])K[Q]=Z,K[Q].attributes.timelineStarts=[];else{if(Z.segments){if(Z.segments[0])Z.segments[0].discontinuity=!0;K[Q].segments.push(...Z.segments)}if(Z.attributes.contentProtection)K[Q].attributes.contentProtection=Z.attributes.contentProtection}return K[Q].attributes.timelineStarts.push({start:Z.attributes.periodStart,timeline:Z.attributes.periodStart}),K},{}));G=G.concat(X)}),G.map((Y)=>{return Y.discontinuityStarts=Cw(Y.segments||[],"discontinuity"),Y})},bD=(h,_)=>{let G=tG(h.sidx),Y=G&&_[G]&&_[G].sidx;if(Y)QZ(h,Y,h.sidx.resolvedUri);return h},vw=(h,_={})=>{if(!Object.keys(_).length)return h;for(let G in h)h[G]=bD(h[G],_);return h},xw=({attributes:h,segments:_,sidx:G,mediaSequence:Y,discontinuitySequence:X,discontinuityStarts:K},Z)=>{let Q={attributes:{NAME:h.id,BANDWIDTH:h.bandwidth,CODECS:h.codecs,["PROGRAM-ID"]:1},uri:"",endList:h.type==="static",timeline:h.periodStart,resolvedUri:h.baseUrl||"",targetDuration:h.duration,discontinuitySequence:X,discontinuityStarts:K,timelineStarts:h.timelineStarts,mediaSequence:Y,segments:_};if(h.contentProtection)Q.contentProtection=h.contentProtection;if(h.serviceLocation)Q.attributes.serviceLocation=h.serviceLocation;if(G)Q.sidx=G;if(Z)Q.attributes.AUDIO="audio",Q.attributes.SUBTITLES="subs";return Q},ww=({attributes:h,segments:_,mediaSequence:G,discontinuityStarts:Y,discontinuitySequence:X})=>{if(typeof _>"u")_=[{uri:h.baseUrl,timeline:h.periodStart,resolvedUri:h.baseUrl||"",duration:h.sourceDuration,number:0}],h.duration=h.sourceDuration;let K={NAME:h.id,BANDWIDTH:h.bandwidth,["PROGRAM-ID"]:1};if(h.codecs)K.CODECS=h.codecs;let Z={attributes:K,uri:"",endList:h.type==="static",timeline:h.periodStart,resolvedUri:h.baseUrl||"",targetDuration:h.duration,timelineStarts:h.timelineStarts,discontinuityStarts:Y,discontinuitySequence:X,mediaSequence:G,segments:_};if(h.serviceLocation)Z.attributes.serviceLocation=h.serviceLocation;return Z},gw=(h,_={},G=!1)=>{let Y,X=h.reduce((K,Z)=>{let Q=Z.attributes.role&&Z.attributes.role.value||"",D=Z.attributes.lang||"",O=Z.attributes.label||"main";if(D&&!Z.attributes.label){let H=Q?` (${Q})`:"";O=`${Z.attributes.lang}${H}`}if(!K[O])K[O]={language:D,autoselect:!0,default:Q==="main",playlists:[],uri:""};let A=bD(xw(Z,G),_);if(K[O].playlists.push(A),typeof Y>"u"&&Q==="main")Y=Z,Y.default=!0;return K},{});if(!Y){let K=Object.keys(X)[0];X[K].default=!0}return X},Iw=(h,_={})=>{return h.reduce((G,Y)=>{let X=Y.attributes.label||Y.attributes.lang||"text",K=Y.attributes.lang||"und";if(!G[X])G[X]={language:K,default:!1,autoselect:!1,playlists:[],uri:""};return G[X].playlists.push(bD(ww(Y),_)),G},{})},Pw=(h)=>h.reduce((_,G)=>{if(!G)return _;return G.forEach((Y)=>{let{channel:X,language:K}=Y;if(_[K]={autoselect:!1,default:!1,instreamId:X,language:K},Y.hasOwnProperty("aspectRatio"))_[K].aspectRatio=Y.aspectRatio;if(Y.hasOwnProperty("easyReader"))_[K].easyReader=Y.easyReader;if(Y.hasOwnProperty("3D"))_[K]["3D"]=Y["3D"]}),_},{}),yw=({attributes:h,segments:_,sidx:G,discontinuityStarts:Y})=>{let X={attributes:{NAME:h.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:h.width,height:h.height},CODECS:h.codecs,BANDWIDTH:h.bandwidth,["PROGRAM-ID"]:1},uri:"",endList:h.type==="static",timeline:h.periodStart,resolvedUri:h.baseUrl||"",targetDuration:h.duration,discontinuityStarts:Y,timelineStarts:h.timelineStarts,segments:_};if(h.frameRate)X.attributes["FRAME-RATE"]=h.frameRate;if(h.contentProtection)X.contentProtection=h.contentProtection;if(h.serviceLocation)X.attributes.serviceLocation=h.serviceLocation;if(G)X.sidx=G;return X},bw=({attributes:h})=>h.mimeType==="video/mp4"||h.mimeType==="video/webm"||h.contentType==="video",mw=({attributes:h})=>h.mimeType==="audio/mp4"||h.mimeType==="audio/webm"||h.contentType==="audio",fw=({attributes:h})=>h.mimeType==="text/vtt"||h.contentType==="text",kw=(h,_)=>{h.forEach((G)=>{if(G.mediaSequence=0,G.discontinuitySequence=_.findIndex(function({timeline:Y}){return Y===G.timeline}),!G.segments)return;G.segments.forEach((Y,X)=>{Y.number=X})})},mU=(h)=>{if(!h)return[];return Object.keys(h).reduce((_,G)=>{let Y=h[G];return _.concat(Y.playlists)},[])},uw=({dashPlaylists:h,locations:_,contentSteering:G,sidxMapping:Y={},previousManifest:X,eventStream:K})=>{if(!h.length)return{};let{sourceDuration:Z,type:Q,suggestedPresentationDelay:D,minimumUpdatePeriod:O}=h[0].attributes,A=PD(h.filter(bw)).map(yw),H=PD(h.filter(mw)),C=PD(h.filter(fw)),N=h.map((P)=>P.attributes.captionServices).filter(Boolean),j={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},["CLOSED-CAPTIONS"]:{},SUBTITLES:{}},uri:"",duration:Z,playlists:vw(A,Y)};if(O>=0)j.minimumUpdatePeriod=O*1000;if(_)j.locations=_;if(G)j.contentSteering=G;if(Q==="dynamic")j.suggestedPresentationDelay=D;if(K&&K.length>0)j.eventStream=K;let W=j.playlists.length===0,S=H.length?gw(H,Y,W):null,R=C.length?Iw(C,Y):null,v=A.concat(mU(S),mU(R)),x=v.map(({timelineStarts:P})=>P);if(j.timelineStarts=iU(x),kw(v,j.timelineStarts),S)j.mediaGroups.AUDIO.audio=S;if(R)j.mediaGroups.SUBTITLES.subs=R;if(N.length)j.mediaGroups["CLOSED-CAPTIONS"].cc=Pw(N);if(X)return Sw({oldManifest:X,newManifest:j});return j},pw=(h,_,G)=>{let{NOW:Y,clientOffset:X,availabilityStartTime:K,timescale:Z=1,periodStart:Q=0,minimumUpdatePeriod:D=0}=h,O=(Y+X)/1000,A=K+Q,C=O+D-A;return Math.ceil((C*Z-_)/G)},cU=(h,_)=>{let{type:G,minimumUpdatePeriod:Y=0,media:X="",sourceDuration:K,timescale:Z=1,startNumber:Q=1,periodStart:D}=h,O=[],A=-1;for(let H=0;H<_.length;H++){let C=_[H],N=C.d,j=C.r||0,W=C.t||0;if(A<0)A=W;if(W&&W>A)A=W;let S;if(j<0){let x=H+1;if(x===_.length)if(G==="dynamic"&&Y>0&&X.indexOf("$Number$")>0)S=pw(h,A,N);else S=(K*Z-A)/N;else S=(_[x].t-A)/N}else S=j+1;let R=Q+O.length+S,v=Q+O.length;while(v<R)O.push({number:v,duration:N/Z,time:A,timeline:D}),A+=N,v++}return O},lw=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,iw=(h)=>(_,G,Y,X)=>{if(_==="$$")return"$";if(typeof h[G]>"u")return _;let K=""+h[G];if(G==="RepresentationID")return K;if(!Y)X=1;else X=parseInt(X,10);if(K.length>=X)return K;return`${Array(X-K.length+1).join("0")}${K}`},fU=(h,_)=>h.replace(lw,iw(_)),cw=(h,_)=>{if(!h.duration&&!_)return[{number:h.startNumber||1,duration:h.sourceDuration,time:0,timeline:h.periodStart}];if(h.duration)return yD(h);return cU(h,_)},dw=(h,_)=>{let G={RepresentationID:h.id,Bandwidth:h.bandwidth||0},{initialization:Y={sourceURL:"",range:""}}=h,X=aG({baseUrl:h.baseUrl,source:fU(Y.sourceURL,G),range:Y.range});return cw(h,_).map((Z)=>{G.Number=Z.number,G.Time=Z.time;let Q=fU(h.media||"",G),D=h.timescale||1,O=h.presentationTimeOffset||0,A=h.periodStart+(Z.time-O)/D;return{uri:Q,timeline:Z.timeline,duration:Z.duration,resolvedUri:Mh(h.baseUrl||"",Q),map:X,number:Z.number,presentationTime:A}})},aw=(h,_)=>{let{baseUrl:G,initialization:Y={}}=h,X=aG({baseUrl:G,source:Y.sourceURL,range:Y.range}),K=aG({baseUrl:G,source:_.media,range:_.mediaRange});return K.map=X,K},tw=(h,_)=>{let{duration:G,segmentUrls:Y=[],periodStart:X}=h;if(!G&&!_||G&&_)throw Error(Lh.SEGMENT_TIME_UNSPECIFIED);let K=Y.map((D)=>aw(h,D)),Z;if(G)Z=yD(h);if(_)Z=cU(h,_);return Z.map((D,O)=>{if(K[O]){let A=K[O],H=h.timescale||1,C=h.presentationTimeOffset||0;return A.timeline=D.timeline,A.duration=D.duration,A.number=D.number,A.presentationTime=X+(D.time-C)/H,A}}).filter((D)=>D)},sw=({attributes:h,segmentInfo:_})=>{let G,Y;if(_.template)Y=dw,G=J5(h,_.template);else if(_.base)Y=lU,G=J5(h,_.base);else if(_.list)Y=tw,G=J5(h,_.list);let X={attributes:h};if(!Y)return X;let K=Y(G,_.segmentTimeline);if(G.duration){let{duration:Z,timescale:Q=1}=G;G.duration=Z/Q}else if(K.length)G.duration=K.reduce((Z,Q)=>{return Math.max(Z,Math.ceil(Q.duration))},0);else G.duration=0;if(X.attributes=G,X.segments=K,_.base&&G.indexRange)X.sidx=K[0],X.segments=[];return X},nw=(h)=>h.map(sw),B2=(h,_)=>pU(h.childNodes).filter(({tagName:G})=>G===_),sG=(h)=>h.textContent.trim(),ow=(h)=>{return parseFloat(h.split("/").reduce((_,G)=>_/G))},Nh=(h)=>{let Q=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(h);if(!Q)return 0;let[D,O,A,H,C,N]=Q.slice(1);return parseFloat(D||0)*31536000+parseFloat(O||0)*2592000+parseFloat(A||0)*86400+parseFloat(H||0)*3600+parseFloat(C||0)*60+parseFloat(N||0)},rw=(h)=>{if(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(h))h+="Z";return Date.parse(h)},kU={mediaPresentationDuration(h){return Nh(h)},availabilityStartTime(h){return rw(h)/1000},minimumUpdatePeriod(h){return Nh(h)},suggestedPresentationDelay(h){return Nh(h)},type(h){return h},timeShiftBufferDepth(h){return Nh(h)},start(h){return Nh(h)},width(h){return parseInt(h,10)},height(h){return parseInt(h,10)},bandwidth(h){return parseInt(h,10)},frameRate(h){return ow(h)},startNumber(h){return parseInt(h,10)},timescale(h){return parseInt(h,10)},presentationTimeOffset(h){return parseInt(h,10)},duration(h){let _=parseInt(h,10);if(isNaN(_))return Nh(h);return _},d(h){return parseInt(h,10)},t(h){return parseInt(h,10)},r(h){return parseInt(h,10)},presentationTime(h){return parseInt(h,10)},DEFAULT(h){return h}},c2=(h)=>{if(!(h&&h.attributes))return{};return pU(h.attributes).reduce((_,G)=>{let Y=kU[G.name]||kU.DEFAULT;return _[G.name]=Y(G.value),_},{})},ew={"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"},DZ=(h,_)=>{if(!_.length)return h;return $h(h.map(function(G){return _.map(function(Y){let X=sG(Y),K=Mh(G.baseUrl,X),Z=J5(c2(Y),{baseUrl:K});if(K!==X&&!Z.serviceLocation&&G.serviceLocation)Z.serviceLocation=G.serviceLocation;return Z})}))},mD=(h)=>{let _=B2(h,"SegmentTemplate")[0],G=B2(h,"SegmentList")[0],Y=G&&B2(G,"SegmentURL").map((H)=>J5({tag:"SegmentURL"},c2(H))),X=B2(h,"SegmentBase")[0],K=G||_,Z=K&&B2(K,"SegmentTimeline")[0],Q=G||X||_,D=Q&&B2(Q,"Initialization")[0],O=_&&c2(_);if(O&&D)O.initialization=D&&c2(D);else if(O&&O.initialization)O.initialization={sourceURL:O.initialization};let A={template:O,segmentTimeline:Z&&B2(Z,"S").map((H)=>c2(H)),list:G&&J5(c2(G),{segmentUrls:Y,initialization:c2(D)}),base:X&&J5(c2(X),{initialization:c2(D)})};return Object.keys(A).forEach((H)=>{if(!A[H])delete A[H]}),A},hg=(h,_,G)=>(Y)=>{let X=B2(Y,"BaseURL"),K=DZ(_,X),Z=J5(h,c2(Y)),Q=mD(Y);return K.map((D)=>{return{segmentInfo:J5(G,Q),attributes:J5(Z,D)}})},_g=(h)=>{return h.reduce((_,G)=>{let Y=c2(G);if(Y.schemeIdUri)Y.schemeIdUri=Y.schemeIdUri.toLowerCase();let X=ew[Y.schemeIdUri];if(X){_[X]={attributes:Y};let K=B2(G,"cenc:pssh")[0];if(K){let Z=sG(K);_[X].pssh=Z&&PG(Z)}}return _},{})},Gg=(h)=>{if(h.schemeIdUri==="urn:scte:dash:cc:cea-608:2015")return(typeof h.value!=="string"?[]:h.value.split(";")).map((G)=>{let Y,X;if(X=G,/^CC\d=/.test(G))[Y,X]=G.split("=");else if(/^CC\d$/.test(G))Y=G;return{channel:Y,language:X}});else if(h.schemeIdUri==="urn:scte:dash:cc:cea-708:2015")return(typeof h.value!=="string"?[]:h.value.split(";")).map((G)=>{let Y={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(G)){let[X,K=""]=G.split("=");Y.channel=X,Y.language=G,K.split(",").forEach((Z)=>{let[Q,D]=Z.split(":");if(Q==="lang")Y.language=D;else if(Q==="er")Y.easyReader=Number(D);else if(Q==="war")Y.aspectRatio=Number(D);else if(Q==="3D")Y["3D"]=Number(D)})}else Y.language=G;if(Y.channel)Y.channel="SERVICE"+Y.channel;return Y})},Yg=(h)=>{return $h(B2(h.node,"EventStream").map((_)=>{let G=c2(_),Y=G.schemeIdUri;return B2(_,"Event").map((X)=>{let K=c2(X),Z=K.presentationTime||0,Q=G.timescale||1,D=K.duration||0,O=Z/Q+h.attributes.start;return{schemeIdUri:Y,value:G.value,id:K.id,start:O,end:O+D/Q,messageData:sG(X)||K.messageData,contentEncoding:G.contentEncoding,presentationTimeOffset:G.presentationTimeOffset||0}})}))},Xg=(h,_,G)=>(Y)=>{let X=c2(Y),K=DZ(_,B2(Y,"BaseURL")),Z=B2(Y,"Role")[0],Q={role:c2(Z)},D=J5(h,X,Q),O=B2(Y,"Accessibility")[0],A=Gg(c2(O));if(A)D=J5(D,{captionServices:A});let H=B2(Y,"Label")[0];if(H&&H.childNodes.length){let S=H.childNodes[0].nodeValue.trim();D=J5(D,{label:S})}let C=_g(B2(Y,"ContentProtection"));if(Object.keys(C).length)D=J5(D,{contentProtection:C});let N=mD(Y),j=B2(Y,"Representation"),W=J5(G,N);return $h(j.map(hg(D,K,W)))},Kg=(h,_)=>(G,Y)=>{let X=DZ(_,B2(G.node,"BaseURL")),K=J5(h,{periodStart:G.attributes.start});if(typeof G.attributes.duration==="number")K.periodDuration=G.attributes.duration;let Z=B2(G.node,"AdaptationSet"),Q=mD(G.node);return $h(Z.map(Xg(K,X,Q)))},Zg=(h,_)=>{if(h.length>1)_({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"});if(!h.length)return null;let G=J5({serverURL:sG(h[0])},c2(h[0]));return G.queryBeforeStart=G.queryBeforeStart==="true",G},Jg=({attributes:h,priorPeriodAttributes:_,mpdType:G})=>{if(typeof h.start==="number")return h.start;if(_&&typeof _.start==="number"&&typeof _.duration==="number")return _.start+_.duration;if(!_&&G==="static")return 0;return null},qg=(h,_={})=>{let{manifestUri:G="",NOW:Y=Date.now(),clientOffset:X=0,eventHandler:K=function(){}}=_,Z=B2(h,"Period");if(!Z.length)throw Error(Lh.INVALID_NUMBER_OF_PERIOD);let Q=B2(h,"Location"),D=c2(h),O=DZ([{baseUrl:G}],B2(h,"BaseURL")),A=B2(h,"ContentSteering");if(D.type=D.type||"static",D.sourceDuration=D.mediaPresentationDuration||0,D.NOW=Y,D.clientOffset=X,Q.length)D.locations=Q.map(sG);let H=[];return Z.forEach((C,N)=>{let j=c2(C),W=H[N-1];j.start=Jg({attributes:j,priorPeriodAttributes:W?W.attributes:null,mpdType:D.type}),H.push({node:C,attributes:j})}),{locations:D.locations,contentSteeringInfo:Zg(A,K),representationInfo:$h(H.map(Kg(D,O))),eventStream:$h(H.map(Yg))}},dU=(h)=>{if(h==="")throw Error(Lh.DASH_EMPTY_MANIFEST);let _=new ID,G,Y;try{G=_.parseFromString(h,"application/xml"),Y=G&&G.documentElement.tagName==="MPD"?G.documentElement:null}catch(X){}if(!Y||Y&&Y.getElementsByTagName("parsererror").length>0)throw Error(Lh.DASH_INVALID_XML);return Y},Qg=(h)=>{let _=B2(h,"UTCTiming")[0];if(!_)return null;let G=c2(_);switch(G.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":G.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":G.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":G.method="DIRECT",G.value=Date.parse(G.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 Error(Lh.UNSUPPORTED_UTC_TIMING_SCHEME)}return G};var aU=(h,_={})=>{let G=qg(dU(h),_),Y=nw(G.representationInfo);return uw({dashPlaylists:Y,locations:G.locations,contentSteering:G.contentSteeringInfo,sidxMapping:_.sidxMapping,previousManifest:_.previousManifest,eventStream:G.eventStream})},tU=(h)=>Qg(dU(h));var XC=S1(hE(),1);var Bg=d0([73,68,51]),Og=function(_,G){if(G===void 0)G=0;_=d0(_);var Y=_[G+5],X=_[G+6]<<21|_[G+7]<<14|_[G+8]<<7|_[G+9],K=(Y&16)>>4;if(K)return X+20;return X+10},P7=function h(_,G){if(G===void 0)G=0;if(_=d0(_),_.length-G<10||!d1(_,Bg,{offset:G}))return G;return G+=Og(_,G),h(_,G)};var En=new Uint8Array([79,112,117,115,72,101,97,100]);var GE=function(_){if(typeof _==="string")return rK(_);if(typeof _==="number")return _;return _},Ug=function(_){if(!Array.isArray(_))return[GE(_)];return _.map(function(G){return GE(G)})},fD,YE=function(_){_=d0(_);var G=[],Y=0;while(_.length>Y){var X=_[Y],K=0,Z=0;Z++;var Q=_[Z];Z++;while(Q&128)K=(Q&127)<<7,Q=_[Z],Z++;K+=Q&127;for(var D=0;D<fD.length;D++){var O=fD[D],A=O.id,H=O.parser;if(X===A){G.push(H(_.subarray(Z,Z+K)));break}}Y+=K+Z}return G};fD=[{id:3,parser:function(_){var G={tag:3,id:_[0]<<8|_[1],flags:_[2],size:3,dependsOnEsId:0,ocrEsId:0,descriptors:[],url:""};if(G.flags&128)G.dependsOnEsId=_[G.size]<<8|_[G.size+1],G.size+=2;if(G.flags&64){var Y=_[G.size];G.url=UD(_.subarray(G.size+1,G.size+1+Y)),G.size+=Y}if(G.flags&32)G.ocrEsId=_[G.size]<<8|_[G.size+1],G.size+=2;return G.descriptors=YE(_.subarray(G.size))||[],G}},{id:4,parser:function(_){var G={tag:4,oti:_[0],streamType:_[1],bufferSize:_[2]<<16|_[3]<<8|_[4],maxBitrate:_[5]<<24|_[6]<<16|_[7]<<8|_[8],avgBitrate:_[9]<<24|_[10]<<16|_[11]<<8|_[12],descriptors:YE(_.subarray(13))};return G}},{id:5,parser:function(_){return{tag:5,bytes:_}}},{id:6,parser:function(_){return{tag:6,bytes:_}}}];var XE=function h(_,G,Y){if(Y===void 0)Y=!1;G=Ug(G),_=d0(_);var X=[];if(!G.length)return X;var K=0;while(K<_.length){var Z=(_[K]<<24|_[K+1]<<16|_[K+2]<<8|_[K+3])>>>0,Q=_.subarray(K+4,K+8);if(Z===0)break;var D=K+Z;if(D>_.length){if(Y)break;D=_.length}var O=_.subarray(K+8,D);if(d1(Q,G[0]))if(G.length===1)X.push(O);else X.push.apply(X,h(O,G.slice(1),Y));K=D}return X};var nG={EBML:d0([26,69,223,163]),DocType:d0([66,130]),Segment:d0([24,83,128,103]),SegmentInfo:d0([21,73,169,102]),Tracks:d0([22,84,174,107]),Track:d0([174]),TrackNumber:d0([215]),DefaultDuration:d0([35,227,131]),TrackEntry:d0([174]),TrackType:d0([131]),FlagDefault:d0([136]),CodecID:d0([134]),CodecPrivate:d0([99,162]),VideoTrack:d0([224]),AudioTrack:d0([225]),Cluster:d0([31,67,182,117]),Timestamp:d0([231]),TimestampScale:d0([42,215,177]),BlockGroup:d0([160]),BlockDuration:d0([155]),Block:d0([161]),SimpleBlock:d0([163])},kD=[128,64,32,16,8,4,2,1],Eg=function(_){var G=1;for(var Y=0;Y<kD.length;Y++){if(_&kD[Y])break;G++}return G},MZ=function(_,G,Y,X){if(Y===void 0)Y=!0;if(X===void 0)X=!1;var K=Eg(_[G]),Z=_.subarray(G,G+K);if(Y)Z=Array.prototype.slice.call(_,G,G+K),Z[0]^=kD[K-1];return{length:K,value:VD(Z,{signed:X}),bytes:Z}},KE=function h(_){if(typeof _==="string")return _.match(/.{1,2}/g).map(function(G){return h(G)});if(typeof _==="number")return fV(_);return _},Cg=function(_){if(!Array.isArray(_))return[KE(_)];return _.map(function(G){return KE(G)})},Ng=function h(_,G,Y){if(Y>=G.length)return G.length;var X=MZ(G,Y,!1);if(d1(_.bytes,X.bytes))return Y;var K=MZ(G,Y+X.length);return h(_,G,Y+K.length+K.value+X.length)},uD=function h(_,G){G=Cg(G),_=d0(_);var Y=[];if(!G.length)return Y;var X=0;while(X<_.length){var K=MZ(_,X,!1),Z=MZ(_,X+K.length),Q=X+K.length+Z.length;if(Z.value===127){if(Z.value=Ng(K,_,Q),Z.value!==_.length)Z.value-=Q}var D=Q+Z.value>_.length?_.length:Q+Z.value,O=_.subarray(Q,D);if(d1(G[0],K.bytes))if(G.length===1)Y.push(O);else Y=Y.concat(h(O,G.slice(1)));var A=K.length+Z.length+O.length;X+=A}return Y};var $g=d0([0,0,0,1]),Lg=d0([0,0,1]),jg=d0([0,0,3]),Fg=function(_){var G=[],Y=1;while(Y<_.length-2){if(d1(_.subarray(Y,Y+3),jg))G.push(Y+2),Y++;Y++}if(G.length===0)return _;var X=_.length-G.length,K=new Uint8Array(X),Z=0;for(Y=0;Y<X;Z++,Y++){if(Z===G[0])Z++,G.shift();K[Y]=_[Z]}return K},ZE=function(_,G,Y,X){if(X===void 0)X=1/0;_=d0(_),Y=[].concat(Y);var K=0,Z,Q=0;while(K<_.length&&(Q<X||Z)){var D=void 0;if(d1(_.subarray(K),$g))D=4;else if(d1(_.subarray(K),Lg))D=3;if(!D){K++;continue}if(Q++,Z)return Fg(_.subarray(Z,K));var O=void 0;if(G==="h264")O=_[K+D]&31;else if(G==="h265")O=_[K+D]>>1&63;if(Y.indexOf(O)!==-1)Z=K+D;K+=D+(G==="h264"?1:2)}return _.subarray(0,0)},JE=function(_,G,Y){return ZE(_,"h264",G,Y)},qE=function(_,G,Y){return ZE(_,"h265",G,Y)};var p5={webm:d0([119,101,98,109]),matroska:d0([109,97,116,114,111,115,107,97]),flac:d0([102,76,97,67]),ogg:d0([79,103,103,83]),ac3:d0([11,119]),riff:d0([82,73,70,70]),avi:d0([65,86,73]),wav:d0([87,65,86,69]),"3gp":d0([102,116,121,112,51,103]),mp4:d0([102,116,121,112]),fmp4:d0([115,116,121,112]),mov:d0([102,116,121,112,113,116]),moov:d0([109,111,111,118]),moof:d0([109,111,111,102])},jh={aac:function(_){var G=P7(_);return d1(_,[255,16],{offset:G,mask:[255,22]})},mp3:function(_){var G=P7(_);return d1(_,[255,2],{offset:G,mask:[255,6]})},webm:function(_){var G=uD(_,[nG.EBML,nG.DocType])[0];return d1(G,p5.webm)},mkv:function(_){var G=uD(_,[nG.EBML,nG.DocType])[0];return d1(G,p5.matroska)},mp4:function(_){if(jh["3gp"](_)||jh.mov(_))return!1;if(d1(_,p5.mp4,{offset:4})||d1(_,p5.fmp4,{offset:4}))return!0;if(d1(_,p5.moof,{offset:4})||d1(_,p5.moov,{offset:4}))return!0},mov:function(_){return d1(_,p5.mov,{offset:4})},"3gp":function(_){return d1(_,p5["3gp"],{offset:4})},ac3:function(_){var G=P7(_);return d1(_,p5.ac3,{offset:G})},ts:function(_){if(_.length<189&&_.length>=1)return _[0]===71;var G=0;while(G+188<_.length&&G<188){if(_[G]===71&&_[G+188]===71)return!0;G+=1}return!1},flac:function(_){var G=P7(_);return d1(_,p5.flac,{offset:G})},ogg:function(_){return d1(_,p5.ogg)},avi:function(_){return d1(_,p5.riff)&&d1(_,p5.avi,{offset:8})},wav:function(_){return d1(_,p5.riff)&&d1(_,p5.wav,{offset:8})},h264:function(_){return JE(_,7,3).length},h265:function(_){return qE(_,[32,33],3).length}},pD=Object.keys(jh).filter(function(h){return h!=="ts"&&h!=="h264"&&h!=="h265"}).concat(["ts","h264","h265"]);pD.forEach(function(h){var _=jh[h];jh[h]=function(G){return _(d0(G))}});var Tg=jh,BZ=function(_){_=d0(_);for(var G=0;G<pD.length;G++){var Y=pD[G];if(Tg[Y](_))return Y}return""},QE=function(_){return XE(_,["moof"]).length>0};var L8=S1(AE(),1),QM="8.23.7",N6={},F8=function(h,_){if(N6[h]=N6[h]||[],_)N6[h]=N6[h].concat(_);return N6[h]},Wg=function(h,_){F8(h,_)},KC=function(h,_){let G=F8(h).indexOf(_);if(G<=-1)return!1;return N6[h]=N6[h].slice(),N6[h].splice(G,1),!0},Rg=function(h,_){F8(h,[].concat(_).map((G)=>{let Y=(...X)=>{return KC(h,Y),G(...X)};return Y}))},NZ={prefixed:!0},UZ=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],zE=UZ[0],hY;for(let h=0;h<UZ.length;h++)if(UZ[h][1]in T0.default){hY=UZ[h];break}if(hY){for(let h=0;h<hY.length;h++)NZ[zE[h]]=hY[h];NZ.prefixed=hY[0]!==zE[0]}var K4=[],Sg=(h,_,G)=>(Y,X,K)=>{let Z=_.levels[X],Q=new RegExp(`^(${Z})$`),D=h;if(Y!=="log")K.unshift(Y.toUpperCase()+":");if(G)D=`%c${h}`,K.unshift(G);if(K.unshift(D+":"),K4){K4.push([].concat(K));let A=K4.length-1000;K4.splice(0,A>0?A:0)}if(!a.default.console)return;let O=a.default.console[Y];if(!O&&Y==="debug")O=a.default.console.info||a.default.console.log;if(!O||!Z||!Q.test(Y))return;O[Array.isArray(K)?"apply":"call"](a.default.console,K)};function DM(h,_=":",G=""){let Y="info",X;function K(...Z){X("log",Y,Z)}return X=Sg(h,K,G),K.createLogger=(Z,Q,D)=>{let O=Q!==void 0?Q:_,A=D!==void 0?D:G,H=`${h} ${O} ${Z}`;return DM(H,O,A)},K.createNewLogger=(Z,Q,D)=>{return DM(Z,Q,D)},K.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:Y},K.level=(Z)=>{if(typeof Z==="string"){if(!K.levels.hasOwnProperty(Z))throw Error(`"${Z}" in not a valid log level`);Y=Z}return Y},K.history=()=>K4?[].concat(K4):[],K.history.filter=(Z)=>{return(K4||[]).filter((Q)=>{return new RegExp(`.*${Z}.*`).test(Q[0])})},K.history.clear=()=>{if(K4)K4.length=0},K.history.disable=()=>{if(K4!==null)K4.length=0,K4=null},K.history.enable=()=>{if(K4===null)K4=[]},K.error=(...Z)=>X("error",Y,Z),K.warn=(...Z)=>X("warn",Y,Z),K.debug=(...Z)=>X("debug",Y,Z),K}var E1=DM("VIDEOJS"),ZC=E1.createLogger,vg=Object.prototype.toString,JC=function(h){return P3(h)?Object.keys(h):[]};function Sh(h,_){JC(h).forEach((G)=>_(h[G],G))}function qC(h,_,G=0){return JC(h).reduce((Y,X)=>_(Y,h[X],X),G)}function P3(h){return!!h&&typeof h==="object"}function mh(h){return P3(h)&&vg.call(h)==="[object Object]"&&h.constructor===Object}function e1(...h){let _={};return h.forEach((G)=>{if(!G)return;Sh(G,(Y,X)=>{if(!mh(Y)){_[X]=Y;return}if(!mh(_[X]))_[X]={};_[X]=e1(_[X],Y)})}),_}function QC(h={}){let _=[];for(let G in h)if(h.hasOwnProperty(G)){let Y=h[G];_.push(Y)}return _}function pZ(h,_,G,Y=!0){let X=(Z)=>Object.defineProperty(h,_,{value:Z,enumerable:!0,writable:!0}),K={configurable:!0,enumerable:!0,get(){let Z=G();return X(Z),Z}};if(Y)K.set=X;return Object.defineProperty(h,_,K)}var xg=Object.freeze({__proto__:null,each:Sh,reduce:qC,isObject:P3,isPlain:mh,merge:e1,values:QC,defineLazyProperty:pZ}),PM=!1,DC=null,Q3=!1,MC,BC=!1,vh=!1,xh=!1,y3=!1,yM=null,lZ=null,wg=Boolean(a.default.cast&&a.default.cast.framework&&a.default.cast.framework.CastReceiverContext),OC=null,$Z=!1,iZ=!1,LZ=!1,cZ=!1,jZ=!1,FZ=!1,TZ=!1,JY=Boolean(lh()&&(("ontouchstart"in a.default)||a.default.navigator.maxTouchPoints||a.default.DocumentTouch&&a.default.document instanceof a.default.DocumentTouch)),E8=a.default.navigator&&a.default.navigator.userAgentData;if(E8&&E8.platform&&E8.brands)Q3=E8.platform==="Android",vh=Boolean(E8.brands.find((h)=>h.brand==="Microsoft Edge")),xh=Boolean(E8.brands.find((h)=>h.brand==="Chromium")),y3=!vh&&xh,yM=lZ=(E8.brands.find((h)=>h.brand==="Chromium")||{}).version||null,iZ=E8.platform==="Windows";if(!xh){let h=a.default.navigator&&a.default.navigator.userAgent||"";PM=/iPod/i.test(h),DC=function(){let _=h.match(/OS (\d+)_/i);if(_&&_[1])return _[1];return null}(),Q3=/Android/i.test(h),MC=function(){let _=h.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!_)return null;let G=_[1]&&parseFloat(_[1]),Y=_[2]&&parseFloat(_[2]);if(G&&Y)return parseFloat(_[1]+"."+_[2]);else if(G)return G;return null}(),BC=/Firefox/i.test(h),vh=/Edg/i.test(h),xh=/Chrome/i.test(h)||/CriOS/i.test(h),y3=!vh&&xh,yM=lZ=function(){let _=h.match(/(Chrome|CriOS)\/(\d+)/);if(_&&_[2])return parseFloat(_[2]);return null}(),OC=function(){let _=/MSIE\s(\d+)\.\d/.exec(h),G=_&&parseFloat(_[1]);if(!G&&/Trident\/7.0/i.test(h)&&/rv:11.0/.test(h))G=11;return G}(),jZ=/Tizen/i.test(h),FZ=/Web0S/i.test(h),TZ=jZ||FZ,$Z=/Safari/i.test(h)&&!y3&&!Q3&&!vh&&!TZ,iZ=/Windows/i.test(h),LZ=/iPad/i.test(h)||$Z&&JY&&!/iPhone/i.test(h),cZ=/iPhone/i.test(h)&&!LZ}var x5=cZ||LZ||PM,dZ=($Z||x5)&&!y3,AC=Object.freeze({__proto__:null,get IS_IPOD(){return PM},get IOS_VERSION(){return DC},get IS_ANDROID(){return Q3},get ANDROID_VERSION(){return MC},get IS_FIREFOX(){return BC},get IS_EDGE(){return vh},get IS_CHROMIUM(){return xh},get IS_CHROME(){return y3},get CHROMIUM_VERSION(){return yM},get CHROME_VERSION(){return lZ},IS_CHROMECAST_RECEIVER:wg,get IE_VERSION(){return OC},get IS_SAFARI(){return $Z},get IS_WINDOWS(){return iZ},get IS_IPAD(){return LZ},get IS_IPHONE(){return cZ},get IS_TIZEN(){return jZ},get IS_WEBOS(){return FZ},get IS_SMART_TV(){return TZ},TOUCH_ENABLED:JY,IS_IOS:x5,IS_ANY_SAFARI:dZ});function HE(h){return typeof h==="string"&&Boolean(h.trim())}function gg(h){if(h.indexOf(" ")>=0)throw Error("class has illegal whitespace characters")}function lh(){return T0.default===a.default.document}function ih(h){return P3(h)&&h.nodeType===1}function zC(){try{return a.default.parent!==a.default.self}catch(h){return!0}}function HC(h){return function(_,G){if(!HE(_))return T0.default[h](null);if(HE(G))G=T0.default.querySelector(G);let Y=ih(G)?G:T0.default;return Y[h]&&Y[h](_)}}function h1(h="div",_={},G={},Y){let X=T0.default.createElement(h);if(Object.getOwnPropertyNames(_).forEach(function(K){let Z=_[K];if(K==="textContent")R8(X,Z);else if(X[K]!==Z||K==="tabIndex")X[K]=Z}),Object.getOwnPropertyNames(G).forEach(function(K){X.setAttribute(K,G[K])}),Y)bM(X,Y);return X}function R8(h,_){if(typeof h.textContent>"u")h.innerText=_;else h.textContent=_;return h}function MM(h,_){if(_.firstChild)_.insertBefore(h,_.firstChild);else _.appendChild(h)}function GY(h,_){return gg(_),h.classList.contains(_)}function u7(h,..._){return h.classList.add(..._.reduce((G,Y)=>G.concat(Y.split(/\s+/)),[])),h}function aZ(h,..._){if(!h)return E1.warn("removeClass was called with an element that doesn't exist"),null;return h.classList.remove(..._.reduce((G,Y)=>G.concat(Y.split(/\s+/)),[])),h}function VC(h,_,G){if(typeof G==="function")G=G(h,_);if(typeof G!=="boolean")G=void 0;return _.split(/\s+/).forEach((Y)=>h.classList.toggle(Y,G)),h}function UC(h,_){Object.getOwnPropertyNames(_).forEach(function(G){let Y=_[G];if(Y===null||typeof Y>"u"||Y===!1)h.removeAttribute(G);else h.setAttribute(G,Y===!0?"":Y)})}function N8(h){let _={},G=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(h&&h.attributes&&h.attributes.length>0){let Y=h.attributes;for(let X=Y.length-1;X>=0;X--){let K=Y[X].name,Z=Y[X].value;if(G.includes(K))Z=Z!==null?!0:!1;_[K]=Z}}return _}function EC(h,_){return h.getAttribute(_)}function fh(h,_,G){h.setAttribute(_,G)}function tZ(h,_){h.removeAttribute(_)}function CC(){T0.default.body.focus(),T0.default.onselectstart=function(){return!1}}function NC(){T0.default.onselectstart=function(){return!0}}function kh(h){if(h&&h.getBoundingClientRect&&h.parentNode){let _=h.getBoundingClientRect(),G={};if(["bottom","height","left","right","top","width"].forEach((Y)=>{if(_[Y]!==void 0)G[Y]=_[Y]}),!G.height)G.height=parseFloat(uh(h,"height"));if(!G.width)G.width=parseFloat(uh(h,"width"));return G}}function qY(h){if(!h||h&&!h.offsetParent)return{left:0,top:0,width:0,height:0};let{offsetWidth:_,offsetHeight:G}=h,Y=0,X=0;while(h.offsetParent&&h!==T0.default[NZ.fullscreenElement])Y+=h.offsetLeft,X+=h.offsetTop,h=h.offsetParent;return{left:Y,top:X,width:_,height:G}}function sZ(h,_){let G={x:0,y:0};if(x5){let A=h;while(A&&A.nodeName.toLowerCase()!=="html"){let H=uh(A,"transform");if(/^matrix/.test(H)){let C=H.slice(7,-1).split(/,\s/).map(Number);G.x+=C[4],G.y+=C[5]}else if(/^matrix3d/.test(H)){let C=H.slice(9,-1).split(/,\s/).map(Number);G.x+=C[12],G.y+=C[13]}if(A.assignedSlot&&A.assignedSlot.parentElement&&a.default.WebKitCSSMatrix){let C=a.default.getComputedStyle(A.assignedSlot.parentElement).transform,N=new a.default.WebKitCSSMatrix(C);G.x+=N.m41,G.y+=N.m42}A=A.parentNode||A.host}}let Y={},X=qY(_.target),K=qY(h),Z=K.width,Q=K.height,D=_.offsetY-(K.top-X.top),O=_.offsetX-(K.left-X.left);if(_.changedTouches){if(O=_.changedTouches[0].pageX-K.left,D=_.changedTouches[0].pageY+K.top,x5)O-=G.x,D-=G.y}return Y.y=1-Math.max(0,Math.min(1,D/Q)),Y.x=Math.max(0,Math.min(1,O/Z)),Y}function $C(h){return P3(h)&&h.nodeType===3}function nZ(h){while(h.firstChild)h.removeChild(h.firstChild);return h}function LC(h){if(typeof h==="function")h=h();return(Array.isArray(h)?h:[h]).map((_)=>{if(typeof _==="function")_=_();if(ih(_)||$C(_))return _;if(typeof _==="string"&&/\S/.test(_))return T0.default.createTextNode(_)}).filter((_)=>_)}function bM(h,_){return LC(_).forEach((G)=>h.appendChild(G)),h}function jC(h,_){return bM(nZ(h),_)}function QY(h){if(h.button===void 0&&h.buttons===void 0)return!0;if(h.button===0&&h.buttons===void 0)return!0;if(h.type==="mouseup"&&h.button===0&&h.buttons===0)return!0;if(h.type==="mousedown"&&h.button===0&&h.buttons===0)return!0;if(h.button!==0||h.buttons!==1)return!1;return!0}var T8=HC("querySelector"),FC=HC("querySelectorAll");function uh(h,_){if(!h||!_)return"";if(typeof a.default.getComputedStyle==="function"){let G;try{G=a.default.getComputedStyle(h)}catch(Y){return""}return G?G.getPropertyValue(_)||G[_]:""}return""}function TC(h){[...T0.default.styleSheets].forEach((_)=>{try{let G=[..._.cssRules].map((X)=>X.cssText).join(""),Y=T0.default.createElement("style");Y.textContent=G,h.document.head.appendChild(Y)}catch(G){let Y=T0.default.createElement("link");Y.rel="stylesheet",Y.type=_.type,Y.media=_.media.mediaText,Y.href=_.href,h.document.head.appendChild(Y)}})}var WC=Object.freeze({__proto__:null,isReal:lh,isEl:ih,isInFrame:zC,createEl:h1,textContent:R8,prependTo:MM,hasClass:GY,addClass:u7,removeClass:aZ,toggleClass:VC,setAttributes:UC,getAttributes:N8,getAttribute:EC,setAttribute:fh,removeAttribute:tZ,blockTextSelection:CC,unblockTextSelection:NC,getBoundingClientRect:kh,findPosition:qY,getPointerPosition:sZ,isTextNode:$C,emptyEl:nZ,normalizeContent:LC,appendContent:bM,insertContent:jC,isSingleLeftClick:QY,$:T8,$$:FC,computedStyle:uh,copyStyleSheetsToWindow:TC}),RC=!1,BM,Ig=function(){if(BM.options.autoSetup===!1)return;let h=Array.prototype.slice.call(T0.default.getElementsByTagName("video")),_=Array.prototype.slice.call(T0.default.getElementsByTagName("audio")),G=Array.prototype.slice.call(T0.default.getElementsByTagName("video-js")),Y=h.concat(_,G);if(Y&&Y.length>0)for(let X=0,K=Y.length;X<K;X++){let Z=Y[X];if(Z&&Z.getAttribute){if(Z.player===void 0){if(Z.getAttribute("data-setup")!==null)BM(Z)}}else{OM(1);break}}else if(!RC)OM(1)};function OM(h,_){if(!lh())return;if(_)BM=_;a.default.setTimeout(Ig,h)}function AM(){RC=!0,a.default.removeEventListener("load",AM)}if(lh())if(T0.default.readyState==="complete")AM();else a.default.addEventListener("load",AM);var SC=function(h){let _=T0.default.createElement("style");return _.className=h,_},vC=function(h,_){if(h.styleSheet)h.styleSheet.cssText=_;else h.textContent=_},i5=new WeakMap,Pg=3,yg=Pg;function c4(){return yg++}function VE(h,_){if(!i5.has(h))return;let G=i5.get(h);if(G.handlers[_].length===0){if(delete G.handlers[_],h.removeEventListener)h.removeEventListener(_,G.dispatcher,!1);else if(h.detachEvent)h.detachEvent("on"+_,G.dispatcher)}if(Object.getOwnPropertyNames(G.handlers).length<=0)delete G.handlers,delete G.dispatcher,delete G.disabled;if(Object.getOwnPropertyNames(G).length===0)i5.delete(h)}function mM(h,_,G,Y){G.forEach(function(X){h(_,X,Y)})}function oZ(h){if(h.fixed_)return h;function _(){return!0}function G(){return!1}if(!h||!h.isPropagationStopped||!h.isImmediatePropagationStopped){let Y=h||a.default.event;h={};let X=["layerX","layerY","keyLocation","path","webkitMovementX","webkitMovementY","mozPressure","mozInputSource"];for(let K in Y)if(!X.includes(K)){if(!(K==="returnValue"&&Y.preventDefault))h[K]=Y[K]}if(!h.target)h.target=h.srcElement||T0.default;if(!h.relatedTarget)h.relatedTarget=h.fromElement===h.target?h.toElement:h.fromElement;if(h.preventDefault=function(){if(Y.preventDefault)Y.preventDefault();h.returnValue=!1,Y.returnValue=!1,h.defaultPrevented=!0},h.defaultPrevented=!1,h.stopPropagation=function(){if(Y.stopPropagation)Y.stopPropagation();h.cancelBubble=!0,Y.cancelBubble=!0,h.isPropagationStopped=_},h.isPropagationStopped=G,h.stopImmediatePropagation=function(){if(Y.stopImmediatePropagation)Y.stopImmediatePropagation();h.isImmediatePropagationStopped=_,h.stopPropagation()},h.isImmediatePropagationStopped=G,h.clientX!==null&&h.clientX!==void 0){let K=T0.default.documentElement,Z=T0.default.body;h.pageX=h.clientX+(K&&K.scrollLeft||Z&&Z.scrollLeft||0)-(K&&K.clientLeft||Z&&Z.clientLeft||0),h.pageY=h.clientY+(K&&K.scrollTop||Z&&Z.scrollTop||0)-(K&&K.clientTop||Z&&Z.clientTop||0)}if(h.which=h.charCode||h.keyCode,h.button!==null&&h.button!==void 0)h.button=h.button&1?0:h.button&4?1:h.button&2?2:0}return h.fixed_=!0,h}var AZ,bg=function(){if(typeof AZ!=="boolean"){AZ=!1;try{let h=Object.defineProperty({},"passive",{get(){AZ=!0}});a.default.addEventListener("test",null,h),a.default.removeEventListener("test",null,h)}catch(h){}}return AZ},mg=["touchstart","touchmove"];function R4(h,_,G){if(Array.isArray(_))return mM(R4,h,_,G);if(!i5.has(h))i5.set(h,{});let Y=i5.get(h);if(!Y.handlers)Y.handlers={};if(!Y.handlers[_])Y.handlers[_]=[];if(!G.guid)G.guid=c4();if(Y.handlers[_].push(G),!Y.dispatcher)Y.disabled=!1,Y.dispatcher=function(X,K){if(Y.disabled)return;X=oZ(X);let Z=Y.handlers[X.type];if(Z){let Q=Z.slice(0);for(let D=0,O=Q.length;D<O;D++)if(X.isImmediatePropagationStopped())break;else try{Q[D].call(h,X,K)}catch(A){E1.error(A)}}};if(Y.handlers[_].length===1){if(h.addEventListener){let X=!1;if(bg()&&mg.indexOf(_)>-1)X={passive:!0};h.addEventListener(_,Y.dispatcher,X)}else if(h.attachEvent)h.attachEvent("on"+_,Y.dispatcher)}}function w5(h,_,G){if(!i5.has(h))return;let Y=i5.get(h);if(!Y.handlers)return;if(Array.isArray(_))return mM(w5,h,_,G);let X=function(Z,Q){Y.handlers[Q]=[],VE(Z,Q)};if(_===void 0){for(let Z in Y.handlers)if(Object.prototype.hasOwnProperty.call(Y.handlers||{},Z))X(h,Z);return}let K=Y.handlers[_];if(!K)return;if(!G){X(h,_);return}if(G.guid){for(let Z=0;Z<K.length;Z++)if(K[Z].guid===G.guid)K.splice(Z--,1)}VE(h,_)}function ch(h,_,G){let Y=i5.has(h)?i5.get(h):{},X=h.parentNode||h.ownerDocument;if(typeof _==="string")_={type:_,target:h};else if(!_.target)_.target=h;if(_=oZ(_),Y.dispatcher)Y.dispatcher.call(h,_,G);if(X&&!_.isPropagationStopped()&&_.bubbles===!0)ch.call(null,X,_,G);else if(!X&&!_.defaultPrevented&&_.target&&_.target[_.type]){if(!i5.has(_.target))i5.set(_.target,{});let K=i5.get(_.target);if(_.target[_.type]){if(K.disabled=!0,typeof _.target[_.type]==="function")_.target[_.type]();K.disabled=!1}}return!_.defaultPrevented}function rZ(h,_,G){if(Array.isArray(_))return mM(rZ,h,_,G);let Y=function(){w5(h,_,Y),G.apply(this,arguments)};Y.guid=G.guid=G.guid||c4(),R4(h,_,Y)}function fM(h,_,G){let Y=function(){w5(h,_,Y),G.apply(this,arguments)};Y.guid=G.guid=G.guid||c4(),R4(h,_,Y)}var fg=Object.freeze({__proto__:null,fixEvent:oZ,on:R4,off:w5,trigger:ch,one:rZ,any:fM}),d4=30,K2=function(h,_,G){if(!_.guid)_.guid=c4();let Y=_.bind(h);return Y.guid=G?G+"_"+_.guid:_.guid,Y},b3=function(h,_){let G=a.default.performance.now();return function(...X){let K=a.default.performance.now();if(K-G>=_)h(...X),G=K}},xC=function(h,_,G,Y=a.default){let X,K=()=>{Y.clearTimeout(X),X=null},Z=function(){let Q=this,D=arguments,O=function(){if(X=null,O=null,!G)h.apply(Q,D)};if(!X&&G)h.apply(Q,D);Y.clearTimeout(X),X=Y.setTimeout(O,_)};return Z.cancel=K,Z},kg=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:d4,bind_:K2,throttle:b3,debounce:xC}),oG;class Q4{on(h,_){let G=this.addEventListener;this.addEventListener=()=>{},R4(this,h,_),this.addEventListener=G}off(h,_){w5(this,h,_)}one(h,_){let G=this.addEventListener;this.addEventListener=()=>{},rZ(this,h,_),this.addEventListener=G}any(h,_){let G=this.addEventListener;this.addEventListener=()=>{},fM(this,h,_),this.addEventListener=G}trigger(h){let _=h.type||h;if(typeof h==="string")h={type:_};if(h=oZ(h),this.allowedEvents_[_]&&this["on"+_])this["on"+_](h);ch(this,h)}queueTrigger(h){if(!oG)oG=new Map;let _=h.type||h,G=oG.get(this);if(!G)G=new Map,oG.set(this,G);let Y=G.get(_);G.delete(_),a.default.clearTimeout(Y);let X=a.default.setTimeout(()=>{if(G.delete(_),G.size===0)G=null,oG.delete(this);this.trigger(h)},0);G.set(_,X)}}Q4.prototype.allowedEvents_={};Q4.prototype.addEventListener=Q4.prototype.on;Q4.prototype.removeEventListener=Q4.prototype.off;Q4.prototype.dispatchEvent=Q4.prototype.trigger;var eZ=(h)=>{if(typeof h.name==="function")return h.name();if(typeof h.name==="string")return h.name;if(h.name_)return h.name_;if(h.constructor&&h.constructor.name)return h.constructor.name;return typeof h},L6=(h)=>h instanceof Q4||!!h.eventBusEl_&&["on","one","off","trigger"].every((_)=>typeof h[_]==="function"),ug=(h,_)=>{if(L6(h))_();else{if(!h.eventedCallbacks)h.eventedCallbacks=[];h.eventedCallbacks.push(_)}},zM=(h)=>typeof h==="string"&&/\S/.test(h)||Array.isArray(h)&&!!h.length,WZ=(h,_,G)=>{if(!h||!h.nodeName&&!L6(h))throw Error(`Invalid target for ${eZ(_)}#${G}; must be a DOM node or evented object.`)},wC=(h,_,G)=>{if(!zM(h))throw Error(`Invalid event type for ${eZ(_)}#${G}; must be a non-empty string or array.`)},gC=(h,_,G)=>{if(typeof h!=="function")throw Error(`Invalid listener for ${eZ(_)}#${G}; must be a function.`)},aD=(h,_,G)=>{let Y=_.length<3||_[0]===h||_[0]===h.eventBusEl_,X,K,Z;if(Y){if(X=h.eventBusEl_,_.length>=3)_.shift();[K,Z]=_}else X=_[0],K=_[1],Z=_[2];return WZ(X,h,G),wC(K,h,G),gC(Z,h,G),Z=K2(h,Z),{isTargetingSelf:Y,target:X,type:K,listener:Z}},y7=(h,_,G,Y)=>{if(WZ(h,h,_),h.nodeName)fg[_](h,G,Y);else h[_](G,Y)},pg={on(...h){let{isTargetingSelf:_,target:G,type:Y,listener:X}=aD(this,h,"on");if(y7(G,"on",Y,X),!_){let K=()=>this.off(G,Y,X);K.guid=X.guid;let Z=()=>this.off("dispose",K);Z.guid=X.guid,y7(this,"on","dispose",K),y7(G,"on","dispose",Z)}},one(...h){let{isTargetingSelf:_,target:G,type:Y,listener:X}=aD(this,h,"one");if(_)y7(G,"one",Y,X);else{let K=(...Z)=>{this.off(G,Y,K),X.apply(null,Z)};K.guid=X.guid,y7(G,"one",Y,K)}},any(...h){let{isTargetingSelf:_,target:G,type:Y,listener:X}=aD(this,h,"any");if(_)y7(G,"any",Y,X);else{let K=(...Z)=>{this.off(G,Y,K),X.apply(null,Z)};K.guid=X.guid,y7(G,"any",Y,K)}},off(h,_,G){if(!h||zM(h))w5(this.eventBusEl_,h,_);else{let Y=h,X=_;if(WZ(Y,this,"off"),wC(X,this,"off"),gC(G,this,"off"),G=K2(this,G),this.off("dispose",G),Y.nodeName)w5(Y,X,G),w5(Y,"dispose",G);else if(L6(Y))Y.off(X,G),Y.off("dispose",G)}},trigger(h,_){WZ(this.eventBusEl_,this,"trigger");let G=h&&typeof h!=="string"?h.type:h;if(!zM(G))throw Error(`Invalid event type for ${eZ(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return ch(this.eventBusEl_,h,_)}};function kM(h,_={}){let{eventBusKey:G}=_;if(G){if(!h[G].nodeName)throw Error(`The eventBusKey "${G}" does not refer to an element.`);h.eventBusEl_=h[G]}else h.eventBusEl_=h1("span",{className:"vjs-event-bus"});if(Object.assign(h,pg),h.eventedCallbacks)h.eventedCallbacks.forEach((Y)=>{Y()});return h.on("dispose",()=>{h.off(),[h,h.el_,h.eventBusEl_].forEach(function(Y){if(Y&&i5.has(Y))i5.delete(Y)}),a.default.setTimeout(()=>{h.eventBusEl_=null},0)}),h}var lg={state:{},setState(h){if(typeof h==="function")h=h();let _;if(Sh(h,(G,Y)=>{if(this.state[Y]!==G)_=_||{},_[Y]={from:this.state[Y],to:G};this.state[Y]=G}),_&&L6(this))this.trigger({changes:_,type:"statechanged"});return _}};function IC(h,_){if(Object.assign(h,lg),h.state=Object.assign({},h.state,_),typeof h.handleStateChanged==="function"&&L6(h))h.on("statechanged",h.handleStateChanged);return h}var YY=function(h){if(typeof h!=="string")return h;return h.replace(/./,(_)=>_.toLowerCase())},F2=function(h){if(typeof h!=="string")return h;return h.replace(/./,(_)=>_.toUpperCase())},PC=function(h,_){return F2(h)===F2(_)},ig=Object.freeze({__proto__:null,toLowerCase:YY,toTitleCase:F2,titleCaseEquals:PC});class z0{constructor(h,_,G){if(!h&&this.play)this.player_=h=this;else this.player_=h;if(this.isDisposed_=!1,this.parentComponent_=null,this.options_=e1({},this.options_),_=this.options_=e1(this.options_,_),this.id_=_.id||_.el&&_.el.id,!this.id_){let Y=h&&h.id&&h.id()||"no_player";this.id_=`${Y}_component_${c4()}`}if(this.name_=_.name||null,_.el)this.el_=_.el;else if(_.createEl!==!1)this.el_=this.createEl();if(_.className&&this.el_)_.className.split(" ").forEach((Y)=>this.addClass(Y));if(["on","off","one","any","trigger"].forEach((Y)=>{this[Y]=void 0}),_.evented!==!1)kM(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange);if(IC(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,_.initChildren!==!1)this.initChildren();if(this.ready(G),_.reportTouchActivity!==!1)this.enableTouchActivity()}dispose(h={}){if(this.isDisposed_)return;if(this.readyQueue_)this.readyQueue_.length=0;if(this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_){for(let _=this.children_.length-1;_>=0;_--)if(this.children_[_].dispose)this.children_[_].dispose()}if(this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_){if(this.el_.parentNode)if(h.restoreEl)this.el_.parentNode.replaceChild(h.restoreEl,this.el_);else this.el_.parentNode.removeChild(this.el_);this.el_=null}this.player_=null}isDisposed(){return Boolean(this.isDisposed_)}player(){return this.player_}options(h){if(!h)return this.options_;return this.options_=e1(this.options_,h),this.options_}el(){return this.el_}createEl(h,_,G){return h1(h,_,G)}localize(h,_,G=h){let Y=this.player_.language&&this.player_.language(),X=this.player_.languages&&this.player_.languages(),K=X&&X[Y],Z=Y&&Y.split("-")[0],Q=X&&X[Z],D=G;if(K&&K[h])D=K[h];else if(Q&&Q[h])D=Q[h];if(_)D=D.replace(/\{(\d+)\}/g,function(O,A){let H=_[A-1],C=H;if(typeof H>"u")C=O;return C});return D}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(h){return this.childIndex_[h]}getChild(h){if(!h)return;return this.childNameIndex_[h]}getDescendant(...h){h=h.reduce((G,Y)=>G.concat(Y),[]);let _=this;for(let G=0;G<h.length;G++)if(_=_.getChild(h[G]),!_||!_.getChild)return;return _}setIcon(h,_=this.el()){if(!this.player_.options_.experimentalSvgIcons)return;let G="http://www.w3.org/2000/svg",Y=h1("span",{className:"vjs-icon-placeholder vjs-svg-icon"},{"aria-hidden":"true"}),X=T0.default.createElementNS(G,"svg");X.setAttributeNS(null,"viewBox","0 0 512 512");let K=T0.default.createElementNS(G,"use");if(X.appendChild(K),K.setAttributeNS(null,"href",`#vjs-icon-${h}`),Y.appendChild(X),this.iconIsSet_)_.replaceChild(Y,_.querySelector(".vjs-icon-placeholder"));else _.appendChild(Y);return this.iconIsSet_=!0,Y}addChild(h,_={},G=this.children_.length){let Y,X;if(typeof h==="string"){X=F2(h);let K=_.componentClass||X;_.name=X;let Z=z0.getComponent(K);if(!Z)throw Error(`Component ${K} does not exist`);if(typeof Z!=="function")return null;Y=new Z(this.player_||this,_)}else Y=h;if(Y.parentComponent_)Y.parentComponent_.removeChild(Y);if(this.children_.splice(G,0,Y),Y.parentComponent_=this,typeof Y.id==="function")this.childIndex_[Y.id()]=Y;if(X=X||Y.name&&F2(Y.name()),X)this.childNameIndex_[X]=Y,this.childNameIndex_[YY(X)]=Y;if(typeof Y.el==="function"&&Y.el()){let K=null;if(this.children_[G+1]){if(this.children_[G+1].el_)K=this.children_[G+1].el_;else if(ih(this.children_[G+1]))K=this.children_[G+1]}this.contentEl().insertBefore(Y.el(),K)}return Y}removeChild(h){if(typeof h==="string")h=this.getChild(h);if(!h||!this.children_)return;let _=!1;for(let Y=this.children_.length-1;Y>=0;Y--)if(this.children_[Y]===h){_=!0,this.children_.splice(Y,1);break}if(!_)return;h.parentComponent_=null,this.childIndex_[h.id()]=null,this.childNameIndex_[F2(h.name())]=null,this.childNameIndex_[YY(h.name())]=null;let G=h.el();if(G&&G.parentNode===this.contentEl())this.contentEl().removeChild(h.el())}initChildren(){let h=this.options_.children;if(h){let _=this.options_,G=(K)=>{let{name:Z,opts:Q}=K;if(_[Z]!==void 0)Q=_[Z];if(Q===!1)return;if(Q===!0)Q={};Q.playerOptions=this.options_.playerOptions;let D=this.addChild(Z,Q);if(D)this[Z]=D},Y,X=z0.getComponent("Tech");if(Array.isArray(h))Y=h;else Y=Object.keys(h);Y.concat(Object.keys(this.options_).filter(function(K){return!Y.some(function(Z){if(typeof Z==="string")return K===Z;return K===Z.name})})).map((K)=>{let Z,Q;if(typeof K==="string")Z=K,Q=h[Z]||this.options_[Z]||{};else Z=K.name,Q=K;return{name:Z,opts:Q}}).filter((K)=>{let Z=z0.getComponent(K.opts.componentClass||F2(K.name));return Z&&!X.isTech(Z)}).forEach(G)}}buildCSSClass(){return""}ready(h,_=!1){if(!h)return;if(!this.isReady_){this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(h);return}if(_)h.call(this);else this.setTimeout(h,1)}triggerReady(){this.isReady_=!0,this.setTimeout(function(){let h=this.readyQueue_;if(this.readyQueue_=[],h&&h.length>0)h.forEach(function(_){_.call(this)},this);this.trigger("ready")},1)}$(h,_){return T8(h,_||this.contentEl())}$$(h,_){return FC(h,_||this.contentEl())}hasClass(h){return GY(this.el_,h)}addClass(...h){u7(this.el_,...h)}removeClass(...h){aZ(this.el_,...h)}toggleClass(h,_){VC(this.el_,h,_)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(h){return EC(this.el_,h)}setAttribute(h,_){fh(this.el_,h,_)}removeAttribute(h){tZ(this.el_,h)}width(h,_){return this.dimension("width",h,_)}height(h,_){return this.dimension("height",h,_)}dimensions(h,_){this.width(h,!0),this.height(_)}dimension(h,_,G){if(_!==void 0){if(_===null||_!==_)_=0;if((""+_).indexOf("%")!==-1||(""+_).indexOf("px")!==-1)this.el_.style[h]=_;else if(_==="auto")this.el_.style[h]="";else this.el_.style[h]=_+"px";if(!G)this.trigger("componentresize");return}if(!this.el_)return 0;let Y=this.el_.style[h],X=Y.indexOf("px");if(X!==-1)return parseInt(Y.slice(0,X),10);return parseInt(this.el_["offset"+F2(h)],10)}currentDimension(h){let _=0;if(h!=="width"&&h!=="height")throw Error("currentDimension only accepts width or height value");if(_=uh(this.el_,h),_=parseFloat(_),_===0||isNaN(_)){let G=`offset${F2(h)}`;_=this.el_[G]}return _}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}getPositions(){let h=this.el_.getBoundingClientRect(),_={x:h.x,y:h.y,width:h.width,height:h.height,top:h.top,right:h.right,bottom:h.bottom,left:h.left},G={x:h.left+h.width/2,y:h.top+h.height/2,width:0,height:0,top:h.top+h.height/2,right:h.left+h.width/2,bottom:h.top+h.height/2,left:h.left+h.width/2};return{boundingClientRect:_,center:G}}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(h){if(this.player_){if(h.key!=="Tab"&&!(this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled))h.stopPropagation();this.player_.handleKeyDown(h)}}handleKeyPress(h){this.handleKeyDown(h)}emitTapEvents(){let h=0,_=null,G=10,Y=200,X;this.on("touchstart",function(Z){if(Z.touches.length===1)_={pageX:Z.touches[0].pageX,pageY:Z.touches[0].pageY},h=a.default.performance.now(),X=!0}),this.on("touchmove",function(Z){if(Z.touches.length>1)X=!1;else if(_){let Q=Z.touches[0].pageX-_.pageX,D=Z.touches[0].pageY-_.pageY;if(Math.sqrt(Q*Q+D*D)>G)X=!1}});let K=function(){X=!1};this.on("touchleave",K),this.on("touchcancel",K),this.on("touchend",function(Z){if(_=null,X===!0){if(a.default.performance.now()-h<Y)Z.preventDefault(),this.trigger("tap")}})}enableTouchActivity(){if(!this.player()||!this.player().reportUserActivity)return;let h=K2(this.player(),this.player().reportUserActivity),_;this.on("touchstart",function(){h(),this.clearInterval(_),_=this.setInterval(h,250)});let G=function(Y){h(),this.clearInterval(_)};this.on("touchmove",h),this.on("touchend",G),this.on("touchcancel",G)}setTimeout(h,_){var G;return h=K2(this,h),this.clearTimersOnDispose_(),G=a.default.setTimeout(()=>{if(this.setTimeoutIds_.has(G))this.setTimeoutIds_.delete(G);h()},_),this.setTimeoutIds_.add(G),G}clearTimeout(h){if(this.setTimeoutIds_.has(h))this.setTimeoutIds_.delete(h),a.default.clearTimeout(h);return h}setInterval(h,_){h=K2(this,h),this.clearTimersOnDispose_();let G=a.default.setInterval(h,_);return this.setIntervalIds_.add(G),G}clearInterval(h){if(this.setIntervalIds_.has(h))this.setIntervalIds_.delete(h),a.default.clearInterval(h);return h}requestAnimationFrame(h){this.clearTimersOnDispose_();var _;return h=K2(this,h),_=a.default.requestAnimationFrame(()=>{if(this.rafIds_.has(_))this.rafIds_.delete(_);h()}),this.rafIds_.add(_),_}requestNamedAnimationFrame(h,_){if(this.namedRafs_.has(h))this.cancelNamedAnimationFrame(h);this.clearTimersOnDispose_(),_=K2(this,_);let G=this.requestAnimationFrame(()=>{if(_(),this.namedRafs_.has(h))this.namedRafs_.delete(h)});return this.namedRafs_.set(h,G),h}cancelNamedAnimationFrame(h){if(!this.namedRafs_.has(h))return;this.cancelAnimationFrame(this.namedRafs_.get(h)),this.namedRafs_.delete(h)}cancelAnimationFrame(h){if(this.rafIds_.has(h))this.rafIds_.delete(h),a.default.cancelAnimationFrame(h);return h}clearTimersOnDispose_(){if(this.clearingTimersOnDispose_)return;this.clearingTimersOnDispose_=!0,this.one("dispose",()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(([h,_])=>{this[h].forEach((G,Y)=>this[_](Y))}),this.clearingTimersOnDispose_=!1})}getIsDisabled(){return Boolean(this.el_.disabled)}getIsExpresslyInert(){return this.el_.inert&&!this.el_.ownerDocument.documentElement.inert}getIsFocusable(h){return(h||this.el_).tabIndex>=0&&!(this.getIsDisabled()||this.getIsExpresslyInert())}getIsAvailableToBeFocused(h){function _(X){let K=a.default.getComputedStyle(X,null),Z=K.getPropertyValue("visibility");return K.getPropertyValue("display")!=="none"&&!["hidden","collapse"].includes(Z)}function G(X){if(!_(X.parentElement))return!1;if(!_(X)||X.style.opacity==="0"||a.default.getComputedStyle(X).height==="0px"||a.default.getComputedStyle(X).width==="0px")return!1;return!0}function Y(X){if(X.offsetWidth+X.offsetHeight+X.getBoundingClientRect().height+X.getBoundingClientRect().width===0)return!1;let K={x:X.getBoundingClientRect().left+X.offsetWidth/2,y:X.getBoundingClientRect().top+X.offsetHeight/2};if(K.x<0)return!1;if(K.x>(T0.default.documentElement.clientWidth||a.default.innerWidth))return!1;if(K.y<0)return!1;if(K.y>(T0.default.documentElement.clientHeight||a.default.innerHeight))return!1;let Z=T0.default.elementFromPoint(K.x,K.y);while(Z){if(Z===X)return!0;if(Z.parentNode)Z=Z.parentNode;else return!1}}if(!h)h=this.el();if(Y(h)&&G(h)&&(!h.parentElement||h.tabIndex>=0))return!0;return!1}static registerComponent(h,_){if(typeof h!=="string"||!h)throw Error(`Illegal component name, "${h}"; must be a non-empty string.`);let G=z0.getComponent("Tech"),Y=G&&G.isTech(_),X=z0===_||z0.prototype.isPrototypeOf(_.prototype);if(Y||!X){let Z;if(Y)Z="techs must be registered using Tech.registerTech()";else Z="must be a Component subclass";throw Error(`Illegal component, "${h}"; ${Z}.`)}if(h=F2(h),!z0.components_)z0.components_={};let K=z0.getComponent("Player");if(h==="Player"&&K&&K.players){let Z=K.players,Q=Object.keys(Z);if(Z&&Q.length>0){for(let D=0;D<Q.length;D++)if(Z[Q[D]]!==null)throw Error("Can not register Player component after player has been created.")}}return z0.components_[h]=_,z0.components_[YY(h)]=_,_}static getComponent(h){if(!h||!z0.components_)return;return z0.components_[h]}}z0.registerComponent("Component",z0);function cg(h,_,G){if(typeof _!=="number"||_<0||_>G)throw Error(`Failed to execute '${h}' on 'TimeRanges': The index provided (${_}) is non-numeric or out of bounds (0-${G}).`)}function UE(h,_,G,Y){return cg(h,Y,G.length-1),G[Y][_]}function tD(h){let _;if(h===void 0||h.length===0)_={length:0,start(){throw Error("This TimeRanges object is empty")},end(){throw Error("This TimeRanges object is empty")}};else _={length:h.length,start:UE.bind(null,"start",0,h),end:UE.bind(null,"end",1,h)};if(a.default.Symbol&&a.default.Symbol.iterator)_[a.default.Symbol.iterator]=()=>(h||[]).values();return _}function q3(h,_){if(Array.isArray(h))return tD(h);else if(h===void 0||_===void 0)return tD();return tD([[h,_]])}var yC=function(h,_){h=h<0?0:h;let G=Math.floor(h%60),Y=Math.floor(h/60%60),X=Math.floor(h/3600),K=Math.floor(_/60%60),Z=Math.floor(_/3600);if(isNaN(h)||h===1/0)X=Y=G="-";return X=X>0||Z>0?X+":":"",Y=((X||K>=10)&&Y<10?"0"+Y:Y)+":",G=G<10?"0"+G:G,X+Y+G},uM=yC;function bC(h){uM=h}function mC(){uM=yC}function i7(h,_=h){return uM(h,_)}var dg=Object.freeze({__proto__:null,createTimeRanges:q3,createTimeRange:q3,setFormatTime:bC,resetFormatTime:mC,formatTime:i7});function fC(h,_){let G=0,Y,X;if(!_)return 0;if(!h||!h.length)h=q3(0,0);for(let K=0;K<h.length;K++){if(Y=h.start(K),X=h.end(K),X>_)X=_;G+=X-Y}return G/_}function C2(h){if(h instanceof C2)return h;if(typeof h==="number")this.code=h;else if(typeof h==="string")this.message=h;else if(P3(h)){if(typeof h.code==="number")this.code=h.code;Object.assign(this,h)}if(!this.message)this.message=C2.defaultMessages[this.code]||""}C2.prototype.code=0;C2.prototype.message="";C2.prototype.status=null;C2.prototype.metadata=null;C2.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"];C2.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."};C2.MEDIA_ERR_CUSTOM=0;C2.prototype.MEDIA_ERR_CUSTOM=0;C2.MEDIA_ERR_ABORTED=1;C2.prototype.MEDIA_ERR_ABORTED=1;C2.MEDIA_ERR_NETWORK=2;C2.prototype.MEDIA_ERR_NETWORK=2;C2.MEDIA_ERR_DECODE=3;C2.prototype.MEDIA_ERR_DECODE=3;C2.MEDIA_ERR_SRC_NOT_SUPPORTED=4;C2.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4;C2.MEDIA_ERR_ENCRYPTED=5;C2.prototype.MEDIA_ERR_ENCRYPTED=5;function XY(h){return h!==void 0&&h!==null&&typeof h.then==="function"}function x3(h){if(XY(h))h.then(null,(_)=>{})}var HM=function(h){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((G,Y,X)=>{if(h[Y])G[Y]=h[Y];return G},{cues:h.cues&&Array.prototype.map.call(h.cues,function(G){return{startTime:G.startTime,endTime:G.endTime,text:G.text,id:G.id}})})},ag=function(h){let _=h.$$("track"),G=Array.prototype.map.call(_,(X)=>X.track);return Array.prototype.map.call(_,function(X){let K=HM(X.track);if(X.src)K.src=X.src;return K}).concat(Array.prototype.filter.call(h.textTracks(),function(X){return G.indexOf(X)===-1}).map(HM))},tg=function(h,_){return h.forEach(function(G){let Y=_.addRemoteTextTrack(G).track;if(!G.src&&G.cues)G.cues.forEach((X)=>Y.addCue(X))}),_.textTracks()},VM={textTracksToJson:ag,jsonToTextTracks:tg,trackToJson:HM},sD="vjs-modal-dialog";class c7 extends z0{constructor(h,_){super(h,_);this.handleKeyDown_=(G)=>this.handleKeyDown(G),this.close_=(G)=>this.close(G),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=h1("div",{className:`${sD}-content`},{role:"document"}),this.descEl_=h1("p",{className:`${sD}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),R8(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`${sD} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let h=this.options_.description||this.localize("This is a modal window.");if(this.closeable())h+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.");return h}open(){if(this.opened_){if(this.options_.fillAlways)this.fill();return}let h=this.player();if(this.trigger("beforemodalopen"),this.opened_=!0,this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)this.fill();if(this.wasPlaying_=!h.paused(),this.options_.pauseOnOpen&&this.wasPlaying_)h.pause();this.on("keydown",this.handleKeyDown_),this.hadControls_=h.controls(),h.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}opened(h){if(typeof h==="boolean")this[h?"open":"close"]();return this.opened_}close(){if(!this.opened_)return;let h=this.player();if(this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen)h.play();if(this.off("keydown",this.handleKeyDown_),this.hadControls_)h.controls(!0);if(this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger({type:"modalclose",bubbles:!0}),this.conditionalBlur_(),this.options_.temporary)this.dispose()}closeable(h){if(typeof h==="boolean"){let _=this.closeable_=!!h,G=this.getChild("closeButton");if(_&&!G){let Y=this.contentEl_;this.contentEl_=this.el_,G=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=Y,this.on(G,"close",this.close_)}if(!_&&G)this.off(G,"close",this.close_),this.removeChild(G),G.dispose()}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(h){let _=this.contentEl(),G=_.parentNode,Y=_.nextSibling;if(this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,G.removeChild(_),this.empty(),jC(_,h),this.trigger("modalfill"),Y)G.insertBefore(_,Y);else G.appendChild(_);let X=this.getChild("closeButton");if(X)G.appendChild(X.el_);this.trigger("aftermodalfill")}empty(){this.trigger("beforemodalempty"),nZ(this.contentEl()),this.trigger("modalempty")}content(h){if(typeof h<"u")this.content_=h;return this.content_}conditionalFocus_(){let h=T0.default.activeElement,_=this.player_.el_;if(this.previouslyActiveEl_=null,_.contains(h)||_===h)this.previouslyActiveEl_=h,this.focus()}conditionalBlur_(){if(this.previouslyActiveEl_)this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null}handleKeyDown(h){if(this.trigger({type:"modalKeydown",originalEvent:h,target:this,bubbles:!0}),h.stopPropagation(),h.key==="Escape"&&this.closeable()){h.preventDefault(),this.close();return}if(h.key!=="Tab")return;let _=this.focusableEls_(),G=this.el_.querySelector(":focus"),Y;for(let X=0;X<_.length;X++)if(G===_[X]){Y=X;break}if(T0.default.activeElement===this.el_)Y=0;if(h.shiftKey&&Y===0)_[_.length-1].focus(),h.preventDefault();else if(!h.shiftKey&&Y===_.length-1)_[0].focus(),h.preventDefault()}focusableEls_(){let h=this.el_.querySelectorAll("*");return Array.prototype.filter.call(h,(_)=>{return(_ instanceof a.default.HTMLAnchorElement||_ instanceof a.default.HTMLAreaElement)&&_.hasAttribute("href")||(_ instanceof a.default.HTMLInputElement||_ instanceof a.default.HTMLSelectElement||_ instanceof a.default.HTMLTextAreaElement||_ instanceof a.default.HTMLButtonElement)&&!_.hasAttribute("disabled")||_ instanceof a.default.HTMLIFrameElement||_ instanceof a.default.HTMLObjectElement||_ instanceof a.default.HTMLEmbedElement||_.hasAttribute("tabindex")&&_.getAttribute("tabindex")!==-1||_.hasAttribute("contenteditable")})}}c7.prototype.options_={pauseOnOpen:!0,temporary:!0};z0.registerComponent("ModalDialog",c7);class W8 extends Q4{constructor(h=[]){super();this.tracks_=[];for(let _=0;_<h.length;_++)this.addTrack(h[_])}get length(){return this.tracks_.length}addTrack(h){let _=this.tracks_.length;if(!(""+_ in this))Object.defineProperty(this,_,{get(){return this.tracks_[_]}});if(this.tracks_.indexOf(h)===-1)this.tracks_.push(h),this.trigger({track:h,type:"addtrack",target:this});if(h.labelchange_=()=>{this.trigger({track:h,type:"labelchange",target:this})},L6(h))h.addEventListener("labelchange",h.labelchange_)}removeTrack(h){let _;for(let G=0,Y=this.length;G<Y;G++)if(this[G]===h){if(_=this[G],_.off)_.off();this.tracks_.splice(G,1);break}if(!_)return;this.trigger({track:_,type:"removetrack",target:this})}getTrackById(h){let _=null;for(let G=0,Y=this.length;G<Y;G++){let X=this[G];if(X.id===h){_=X;break}}return _}}W8.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(let h in W8.prototype.allowedEvents_)W8.prototype["on"+h]=null;var nD=function(h,_){for(let G=0;G<h.length;G++){if(!Object.keys(h[G]).length||_.id===h[G].id)continue;h[G].enabled=!1}};class pM extends W8{constructor(h=[]){for(let _=h.length-1;_>=0;_--)if(h[_].enabled){nD(h,h[_]);break}super(h);this.changing_=!1}addTrack(h){if(h.enabled)nD(this,h);if(super.addTrack(h),!h.addEventListener)return;h.enabledChange_=()=>{if(this.changing_)return;this.changing_=!0,nD(this,h),this.changing_=!1,this.trigger("change")},h.addEventListener("enabledchange",h.enabledChange_)}removeTrack(h){if(super.removeTrack(h),h.removeEventListener&&h.enabledChange_)h.removeEventListener("enabledchange",h.enabledChange_),h.enabledChange_=null}}var oD=function(h,_){for(let G=0;G<h.length;G++){if(!Object.keys(h[G]).length||_.id===h[G].id)continue;h[G].selected=!1}};class lM extends W8{constructor(h=[]){for(let _=h.length-1;_>=0;_--)if(h[_].selected){oD(h,h[_]);break}super(h);this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let _=0;_<this.length;_++)if(this[_].selected)return _;return-1},set(){}})}addTrack(h){if(h.selected)oD(this,h);if(super.addTrack(h),!h.addEventListener)return;h.selectedChange_=()=>{if(this.changing_)return;this.changing_=!0,oD(this,h),this.changing_=!1,this.trigger("change")},h.addEventListener("selectedchange",h.selectedChange_)}removeTrack(h){if(super.removeTrack(h),h.removeEventListener&&h.selectedChange_)h.removeEventListener("selectedchange",h.selectedChange_),h.selectedChange_=null}}class hJ extends W8{addTrack(h){if(super.addTrack(h),!this.queueChange_)this.queueChange_=()=>this.queueTrigger("change");if(!this.triggerSelectedlanguagechange)this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange");if(h.addEventListener("modechange",this.queueChange_),["metadata","chapters"].indexOf(h.kind)===-1)h.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(h){if(super.removeTrack(h),h.removeEventListener){if(this.queueChange_)h.removeEventListener("modechange",this.queueChange_);if(this.selectedlanguagechange_)h.removeEventListener("modechange",this.triggerSelectedlanguagechange_)}}toJSON(){return this.tracks_.map((h)=>h.toJSON())}}class kC{constructor(h=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let _=0,G=h.length;_<G;_++)this.addTrackElement_(h[_])}addTrackElement_(h){let _=this.trackElements_.length;if(!(""+_ in this))Object.defineProperty(this,_,{get(){return this.trackElements_[_]}});if(this.trackElements_.indexOf(h)===-1)this.trackElements_.push(h)}getTrackElementByTrack_(h){let _;for(let G=0,Y=this.trackElements_.length;G<Y;G++)if(h===this.trackElements_[G].track){_=this.trackElements_[G];break}return _}removeTrackElement_(h){for(let _=0,G=this.trackElements_.length;_<G;_++)if(h===this.trackElements_[_]){if(this.trackElements_[_].track&&typeof this.trackElements_[_].track.off==="function")this.trackElements_[_].track.off();if(typeof this.trackElements_[_].off==="function")this.trackElements_[_].off();this.trackElements_.splice(_,1);break}}}class RZ{constructor(h){RZ.prototype.setCues_.call(this,h),Object.defineProperty(this,"length",{get(){return this.length_}})}setCues_(h){let _=this.length||0,G=0,Y=h.length;this.cues_=h,this.length_=h.length;let X=function(K){if(!(""+K in this))Object.defineProperty(this,""+K,{get(){return this.cues_[K]}})};if(_<Y){G=_;for(;G<Y;G++)X.call(this,G)}}getCueById(h){let _=null;for(let G=0,Y=this.length;G<Y;G++){let X=this[G];if(X.id===h){_=X;break}}return _}}var sg={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},ng={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},og={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},EE={disabled:"disabled",hidden:"hidden",showing:"showing"};class _J extends Q4{constructor(h={}){super();let _={id:h.id||"vjs_track_"+c4(),kind:h.kind||"",language:h.language||""},G=h.label||"";for(let Y in _)Object.defineProperty(this,Y,{get(){return _[Y]},set(){}});Object.defineProperty(this,"label",{get(){return G},set(Y){if(Y!==G)G=Y,this.trigger("labelchange")}})}}var iM=function(h){return new URL(h,T0.default.baseURI)},uC=function(h){return new URL(h,T0.default.baseURI).href},cM=function(h){if(typeof h==="string"){let G=h.split("?")[0].replace(/\/+$/,"").match(/\.([^.\/]+)$/);return G?G[1].toLowerCase():""}return""},GJ=function(h,_=a.default.location){return iM(h).origin!==_.origin},rg=Object.freeze({__proto__:null,parseUrl:iM,getAbsoluteURL:uC,getFileExtension:cM,isCrossOrigin:GJ}),CE=function(h,_){let G=new a.default.WebVTT.Parser(a.default,a.default.vttjs,a.default.WebVTT.StringDecoder()),Y=[];if(G.oncue=function(X){_.addCue(X)},G.onparsingerror=function(X){Y.push(X)},G.onflush=function(){_.trigger({type:"loadeddata",target:_})},G.parse(h),Y.length>0){if(a.default.console&&a.default.console.groupCollapsed)a.default.console.groupCollapsed(`Text Track parsing errors for ${_.src}`);if(Y.forEach((X)=>E1.error(X)),a.default.console&&a.default.console.groupEnd)a.default.console.groupEnd()}G.flush()},NE=function(h,_){let G={uri:h},Y=GJ(h);if(Y)G.cors=Y;let X=_.tech_.crossOrigin()==="use-credentials";if(X)G.withCredentials=X;IM.default(G,K2(this,function(K,Z,Q){if(K)return E1.error(K,Z);if(_.loaded_=!0,typeof a.default.WebVTT!=="function"){if(_.tech_)_.tech_.any(["vttjsloaded","vttjserror"],(D)=>{if(D.type==="vttjserror"){E1.error(`vttjs failed to load, stopping trying to process ${_.src}`);return}return CE(Q,_)})}else CE(Q,_)}))};class dh extends _J{constructor(h={}){if(!h.tech)throw Error("A tech was not provided.");let _=e1(h,{kind:og[h.kind]||"subtitles",language:h.language||h.srclang||""}),G=EE[_.mode]||"disabled",Y=_.default;if(_.kind==="metadata"||_.kind==="chapters")G="hidden";super(_);this.tech_=_.tech,this.cues_=[],this.activeCues_=[],this.preload_=this.tech_.preloadTextTracks!==!1;let X=new RZ(this.cues_),K=new RZ(this.activeCues_),Z=!1;this.timeupdateHandler=K2(this,function(D={}){if(this.tech_.isDisposed())return;if(!this.tech_.isReady_){if(D.type!=="timeupdate")this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler);return}if(this.activeCues=this.activeCues,Z)this.trigger("cuechange"),Z=!1;if(D.type!=="timeupdate")this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)});let Q=()=>{this.stopTracking()};if(this.tech_.one("dispose",Q),G!=="disabled")this.startTracking();if(Object.defineProperties(this,{default:{get(){return Y},set(){}},mode:{get(){return G},set(D){if(!EE[D])return;if(G===D)return;if(G=D,!this.preload_&&G!=="disabled"&&this.cues.length===0)NE(this.src,this);if(this.stopTracking(),G!=="disabled")this.startTracking();this.trigger("modechange")}},cues:{get(){if(!this.loaded_)return null;return X},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(this.cues.length===0)return K;let D=this.tech_.currentTime(),O=[];for(let A=0,H=this.cues.length;A<H;A++){let C=this.cues[A];if(C.startTime<=D&&C.endTime>=D)O.push(C)}if(Z=!1,O.length!==this.activeCues_.length)Z=!0;else for(let A=0;A<O.length;A++)if(this.activeCues_.indexOf(O[A])===-1)Z=!0;return this.activeCues_=O,K.setCues_(this.activeCues_),K},set(){}}}),_.src){if(this.src=_.src,!this.preload_)this.loaded_=!0;if(this.preload_||_.kind!=="subtitles"&&_.kind!=="captions")NE(this.src,this)}else this.loaded_=!0}startTracking(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler),this.tech_.on("timeupdate",this.timeupdateHandler)}stopTracking(){if(this.rvf_)this.tech_.cancelVideoFrameCallback(this.rvf_),this.rvf_=void 0;this.tech_.off("timeupdate",this.timeupdateHandler)}addCue(h){let _=h;if(!("getCueAsHTML"in _)){_=new a.default.vttjs.VTTCue(h.startTime,h.endTime,h.text);for(let Y in h)if(!(Y in _))_[Y]=h[Y];_.id=h.id,_.originalCue_=h}let G=this.tech_.textTracks();for(let Y=0;Y<G.length;Y++)if(G[Y]!==this)G[Y].removeCue(_);this.cues_.push(_),this.cues.setCues_(this.cues_)}toJSON(){return VM.trackToJson(this)}removeCue(h){let _=this.cues_.length;while(_--){let G=this.cues_[_];if(G===h||G.originalCue_&&G.originalCue_===h){this.cues_.splice(_,1),this.cues.setCues_(this.cues_);break}}}}dh.prototype.allowedEvents_={cuechange:"cuechange"};class dM extends _J{constructor(h={}){let _=e1(h,{kind:ng[h.kind]||""});super(_);let G=!1;if(Object.defineProperty(this,"enabled",{get(){return G},set(Y){if(typeof Y!=="boolean"||Y===G)return;G=Y,this.trigger("enabledchange")}}),_.enabled)this.enabled=_.enabled;this.loaded_=!0}}class aM extends _J{constructor(h={}){let _=e1(h,{kind:sg[h.kind]||""});super(_);let G=!1;if(Object.defineProperty(this,"selected",{get(){return G},set(Y){if(typeof Y!=="boolean"||Y===G)return;G=Y,this.trigger("selectedchange")}}),_.selected)this.selected=_.selected}}class j6 extends Q4{constructor(h={}){super();let _,G=new dh(h);this.kind=G.kind,this.src=G.src,this.srclang=G.language,this.label=G.label,this.default=G.default,Object.defineProperties(this,{readyState:{get(){return _}},track:{get(){return G}}}),_=j6.NONE,G.addEventListener("loadeddata",()=>{_=j6.LOADED,this.trigger({type:"load",target:this})})}}j6.prototype.allowedEvents_={load:"load"};j6.NONE=0;j6.LOADING=1;j6.LOADED=2;j6.ERROR=3;var i4={audio:{ListClass:pM,TrackClass:dM,capitalName:"Audio"},video:{ListClass:lM,TrackClass:aM,capitalName:"Video"},text:{ListClass:hJ,TrackClass:dh,capitalName:"Text"}};Object.keys(i4).forEach(function(h){i4[h].getterName=`${h}Tracks`,i4[h].privateName=`${h}Tracks_`});var ph={remoteText:{ListClass:hJ,TrackClass:dh,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:kC,TrackClass:j6,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},l5=Object.assign({},i4,ph);ph.names=Object.keys(ph);i4.names=Object.keys(i4);l5.names=[].concat(ph.names).concat(i4.names);function eg(h,_,G,Y,X={}){let K=h.textTracks();if(X.kind=_,G)X.label=G;if(Y)X.language=Y;X.tech=h;let Z=new l5.text.TrackClass(X);return K.addTrack(Z),Z}class A1 extends z0{constructor(h={},_=function(){}){h.reportTouchActivity=!1;super(null,h,_);if(this.onDurationChange_=(G)=>this.onDurationChange(G),this.trackProgress_=(G)=>this.trackProgress(G),this.trackCurrentTime_=(G)=>this.trackCurrentTime(G),this.stopTrackingCurrentTime_=(G)=>this.stopTrackingCurrentTime(G),this.disposeSourceHandler_=(G)=>this.disposeSourceHandler(G),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",function(){this.hasStarted_=!0}),this.on("loadstart",function(){this.hasStarted_=!1}),l5.names.forEach((G)=>{let Y=l5[G];if(h&&h[Y.getterName])this[Y.privateName]=h[Y.getterName]}),!this.featuresProgressEvents)this.manualProgressOn();if(!this.featuresTimeupdateEvents)this.manualTimeUpdatesOn();if(["Text","Audio","Video"].forEach((G)=>{if(h[`native${G}Tracks`]===!1)this[`featuresNative${G}Tracks`]=!1}),h.nativeCaptions===!1||h.nativeTextTracks===!1)this.featuresNativeTextTracks=!1;else if(h.nativeCaptions===!0||h.nativeTextTracks===!0)this.featuresNativeTextTracks=!0;if(!this.featuresNativeTextTracks)this.emulateTextTracks();if(this.preloadTextTracks=h.preloadTextTracks!==!1,this.autoRemoteTextTracks_=new l5.text.ListClass,this.initTrackListeners(),!h.nativeControlsForTouch)this.emitTapEvents();if(this.constructor)this.name_=this.constructor.name||"Unknown Tech"}triggerSourceset(h){if(!this.isReady_)this.one("ready",()=>this.setTimeout(()=>this.triggerSourceset(h),1));this.trigger({src:h,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(h){this.stopTrackingProgress(),this.progressInterval=this.setInterval(K2(this,function(){let _=this.bufferedPercent();if(this.bufferedPercent_!==_)this.trigger("progress");if(this.bufferedPercent_=_,_===1)this.stopTrackingProgress()}),500)}onDurationChange(h){this.duration_=this.duration()}buffered(){return q3(0,0)}bufferedPercent(){return fC(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(){if(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(){if(this.clearTracks(i4.names),this.manualProgress)this.manualProgressOff();if(this.manualTimeUpdates)this.manualTimeUpdatesOff();super.dispose()}clearTracks(h){h=[].concat(h),h.forEach((_)=>{let G=this[`${_}Tracks`]()||[],Y=G.length;while(Y--){let X=G[Y];if(_==="text")this.removeRemoteTextTrack(X);G.removeTrack(X)}})}cleanupAutoTextTracks(){let h=this.autoRemoteTextTracks_||[],_=h.length;while(_--){let G=h[_];this.removeRemoteTextTrack(G)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(h){if(h!==void 0)this.error_=new C2(h),this.trigger("error");return this.error_}played(){if(this.hasStarted_)return q3(0,0);return q3()}play(){}setScrubbing(h){}scrubbing(){}setCurrentTime(h){if(this.manualTimeUpdates)this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){i4.names.forEach((h)=>{let _=i4[h],G=()=>{this.trigger(`${h}trackchange`)},Y=this[_.getterName]();Y.addEventListener("removetrack",G),Y.addEventListener("addtrack",G),this.on("dispose",()=>{Y.removeEventListener("removetrack",G),Y.removeEventListener("addtrack",G)})})}addWebVttScript_(){if(a.default.WebVTT)return;if(T0.default.body.contains(this.el())){if(!this.options_["vtt.js"]&&mh(qM.default)&&Object.keys(qM.default).length>0){this.trigger("vttjsloaded");return}let h=T0.default.createElement("script");h.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",h.onload=()=>{this.trigger("vttjsloaded")},h.onerror=()=>{this.trigger("vttjserror")},this.on("dispose",()=>{h.onload=null,h.onerror=null}),a.default.WebVTT=!0,this.el().parentNode.appendChild(h)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){let h=this.textTracks(),_=this.remoteTextTracks(),G=(Z)=>h.addTrack(Z.track),Y=(Z)=>h.removeTrack(Z.track);_.on("addtrack",G),_.on("removetrack",Y),this.addWebVttScript_();let X=()=>this.trigger("texttrackchange"),K=()=>{X();for(let Z=0;Z<h.length;Z++){let Q=h[Z];if(Q.removeEventListener("cuechange",X),Q.mode==="showing")Q.addEventListener("cuechange",X)}};K(),h.addEventListener("change",K),h.addEventListener("addtrack",K),h.addEventListener("removetrack",K),this.on("dispose",function(){_.off("addtrack",G),_.off("removetrack",Y),h.removeEventListener("change",K),h.removeEventListener("addtrack",K),h.removeEventListener("removetrack",K);for(let Z=0;Z<h.length;Z++)h[Z].removeEventListener("cuechange",X)})}addTextTrack(h,_,G){if(!h)throw Error("TextTrack kind is required but was not provided");return eg(this,h,_,G)}createRemoteTextTrack(h){let _=e1(h,{tech:this});return new ph.remoteTextEl.TrackClass(_)}addRemoteTextTrack(h={},_){let G=this.createRemoteTextTrack(h);if(typeof _!=="boolean")_=!1;if(this.remoteTextTrackEls().addTrackElement_(G),this.remoteTextTracks().addTrack(G.track),_===!1)this.ready(()=>this.autoRemoteTextTracks_.addTrack(G.track));return G}removeRemoteTextTrack(h){let _=this.remoteTextTrackEls().getTrackElementByTrack_(h);this.remoteTextTrackEls().removeTrackElement_(_),this.remoteTextTracks().removeTrack(h),this.autoRemoteTextTracks_.removeTrack(h)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return!0}setDisablePictureInPicture(){}requestVideoFrameCallback(h){let _=c4();if(!this.isReady_||this.paused())this.queuedHanders_.add(_),this.one("playing",()=>{if(this.queuedHanders_.has(_))this.queuedHanders_.delete(_),h()});else this.requestNamedAnimationFrame(_,h);return _}cancelVideoFrameCallback(h){if(this.queuedHanders_.has(h))this.queuedHanders_.delete(h);else this.cancelNamedAnimationFrame(h)}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(h){}overrideNativeVideoTracks(h){}canPlayType(h){return""}static canPlayType(h){return""}static canPlaySource(h,_){return A1.canPlayType(h.type)}static isTech(h){return h.prototype instanceof A1||h instanceof A1||h===A1}static registerTech(h,_){if(!A1.techs_)A1.techs_={};if(!A1.isTech(_))throw Error(`Tech ${h} must be a Tech`);if(!A1.canPlayType)throw Error("Techs must have a static canPlayType method on them");if(!A1.canPlaySource)throw Error("Techs must have a static canPlaySource method on them");if(h=F2(h),A1.techs_[h]=_,A1.techs_[YY(h)]=_,h!=="Tech")A1.defaultTechOrder_.push(h);return _}static getTech(h){if(!h)return;if(A1.techs_&&A1.techs_[h])return A1.techs_[h];if(h=F2(h),a.default&&a.default.videojs&&a.default.videojs[h])return E1.warn(`The ${h} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),a.default.videojs[h]}}l5.names.forEach(function(h){let _=l5[h];A1.prototype[_.getterName]=function(){return this[_.privateName]=this[_.privateName]||new _.ListClass,this[_.privateName]}});A1.prototype.featuresVolumeControl=!0;A1.prototype.featuresMuteControl=!0;A1.prototype.featuresFullscreenResize=!1;A1.prototype.featuresPlaybackRate=!1;A1.prototype.featuresProgressEvents=!1;A1.prototype.featuresSourceset=!1;A1.prototype.featuresTimeupdateEvents=!1;A1.prototype.featuresNativeTextTracks=!1;A1.prototype.featuresVideoFrameCallback=!1;A1.withSourceHandlers=function(h){h.registerSourceHandler=function(G,Y){let X=h.sourceHandlers;if(!X)X=h.sourceHandlers=[];if(Y===void 0)Y=X.length;X.splice(Y,0,G)},h.canPlayType=function(G){let Y=h.sourceHandlers||[],X;for(let K=0;K<Y.length;K++)if(X=Y[K].canPlayType(G),X)return X;return""},h.selectSourceHandler=function(G,Y){let X=h.sourceHandlers||[],K;for(let Z=0;Z<X.length;Z++)if(K=X[Z].canHandleSource(G,Y),K)return X[Z];return null},h.canPlaySource=function(G,Y){let X=h.selectSourceHandler(G,Y);if(X)return X.canHandleSource(G,Y);return""},["seekable","seeking","duration"].forEach(function(G){let Y=this[G];if(typeof Y!=="function")return;this[G]=function(){if(this.sourceHandler_&&this.sourceHandler_[G])return this.sourceHandler_[G].apply(this.sourceHandler_,arguments);return Y.apply(this,arguments)}},h.prototype),h.prototype.setSource=function(G){let Y=h.selectSourceHandler(G,this.options_);if(!Y)if(h.nativeSourceHandler)Y=h.nativeSourceHandler;else E1.error("No source handler found for the current source.");if(this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),Y!==h.nativeSourceHandler)this.currentSource_=G;this.sourceHandler_=Y.handleSource(G,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},h.prototype.disposeSourceHandler=function(){if(this.currentSource_)this.clearTracks(["audio","video"]),this.currentSource_=null;if(this.cleanupAutoTextTracks(),this.sourceHandler_){if(this.sourceHandler_.dispose)this.sourceHandler_.dispose();this.sourceHandler_=null}}};z0.registerComponent("Tech",A1);A1.registerTech("Tech",A1);A1.defaultTechOrder_=[];var p7={},SZ={},vZ={};function hI(h,_){p7[h]=p7[h]||[],p7[h].push(_)}function _I(h,_,G){h.setTimeout(()=>b7(_,p7[_.type],G,h),1)}function GI(h,_){h.forEach((G)=>G.setTech&&G.setTech(_))}function YI(h,_,G){return h.reduceRight(tM(G),_[G]())}function XI(h,_,G,Y){return _[G](h.reduce(tM(G),Y))}function $E(h,_,G,Y=null){let X="call"+F2(G),K=h.reduce(tM(X),Y),Z=K===vZ,Q=Z?null:_[G](K);return JI(h,G,Q,Z),Q}var KI={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},ZI={setCurrentTime:1,setMuted:1,setVolume:1},LE={play:1,pause:1};function tM(h){return(_,G)=>{if(_===vZ)return vZ;if(G[h])return G[h](_);return _}}function JI(h,_,G,Y){for(let X=h.length-1;X>=0;X--){let K=h[X];if(K[_])K[_](Y,G)}}function qI(h){if(SZ.hasOwnProperty(h.id()))delete SZ[h.id()]}function QI(h,_){let G=SZ[h.id()],Y=null;if(G===void 0||G===null)return Y=_(h),SZ[h.id()]=[[_,Y]],Y;for(let X=0;X<G.length;X++){let[K,Z]=G[X];if(K!==_)continue;Y=Z}if(Y===null)Y=_(h),G.push([_,Y]);return Y}function b7(h={},_=[],G,Y,X=[],K=!1){let[Z,...Q]=_;if(typeof Z==="string")b7(h,p7[Z],G,Y,X,K);else if(Z){let D=QI(Y,Z);if(!D.setSource)return X.push(D),b7(h,Q,G,Y,X,K);D.setSource(Object.assign({},h),function(O,A){if(O)return b7(h,Q,G,Y,X,K);X.push(D),b7(A,h.type===A.type?Q:p7[A.type],G,Y,X,K)})}else if(Q.length)b7(h,Q,G,Y,X,K);else if(K)G(h,X);else b7(h,p7["*"],G,Y,X,!0)}var DI={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",caf:"audio/x-caf",flac:"audio/flac",oga:"audio/ogg",wav:"audio/wav",m3u8:"application/x-mpegURL",mpd:"application/dash+xml",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},xZ=function(h=""){let _=cM(h);return DI[_.toLowerCase()]||""},MI=(h,_)=>{if(!_)return"";if(h.cache_.source.src===_&&h.cache_.source.type)return h.cache_.source.type;let G=h.cache_.sources.filter((X)=>X.src===_);if(G.length)return G[0].type;let Y=h.$$("source");for(let X=0;X<Y.length;X++){let K=Y[X];if(K.type&&K.src&&K.src===_)return K.type}return xZ(_)},pC=function(h){if(Array.isArray(h)){let _=[];h.forEach(function(G){if(G=pC(G),Array.isArray(G))_=_.concat(G);else if(P3(G))_.push(G)}),h=_}else if(typeof h==="string"&&h.trim())h=[jE({src:h})];else if(P3(h)&&typeof h.src==="string"&&h.src&&h.src.trim())h=[jE(h)];else h=[];return h};function jE(h){if(!h.type){let _=xZ(h.src);if(_)h.type=_}return h}var BI=`<svg xmlns="http://www.w3.org/2000/svg">
|
|
50
|
-
<defs>
|
|
51
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-play">
|
|
52
|
-
<path d="M16 10v28l22-14z"></path>
|
|
53
|
-
</symbol>
|
|
54
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-pause">
|
|
55
|
-
<path d="M12 38h8V10h-8v28zm16-28v28h8V10h-8z"></path>
|
|
56
|
-
</symbol>
|
|
57
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-audio">
|
|
58
|
-
<path d="M24 2C14.06 2 6 10.06 6 20v14c0 3.31 2.69 6 6 6h6V24h-8v-4c0-7.73 6.27-14 14-14s14 6.27 14 14v4h-8v16h6c3.31 0 6-2.69 6-6V20c0-9.94-8.06-18-18-18z"></path>
|
|
59
|
-
</symbol>
|
|
60
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-captions">
|
|
61
|
-
<path d="M38 8H10c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h28c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM22 22h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2zm14 0h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2z"></path>
|
|
62
|
-
</symbol>
|
|
63
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-subtitles">
|
|
64
|
-
<path d="M40 8H8c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h32c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM8 24h8v4H8v-4zm20 12H8v-4h20v4zm12 0h-8v-4h8v4zm0-8H20v-4h20v4z"></path>
|
|
65
|
-
</symbol>
|
|
66
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-enter">
|
|
67
|
-
<path d="M14 28h-4v10h10v-4h-6v-6zm-4-8h4v-6h6v-4H10v10zm24 14h-6v4h10V28h-4v6zm-6-24v4h6v6h4V10H28z"></path>
|
|
68
|
-
</symbol>
|
|
69
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-exit">
|
|
70
|
-
<path d="M10 32h6v6h4V28H10v4zm6-16h-6v4h10V10h-4v6zm12 22h4v-6h6v-4H28v10zm4-22v-6h-4v10h10v-4h-6z"></path>
|
|
71
|
-
</symbol>
|
|
72
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-play-circle">
|
|
73
|
-
<path d="M20 33l12-9-12-9v18zm4-29C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>
|
|
74
|
-
</symbol>
|
|
75
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-volume-mute">
|
|
76
|
-
<path d="M33 24c0-3.53-2.04-6.58-5-8.05v4.42l4.91 4.91c.06-.42.09-.85.09-1.28zm5 0c0 1.88-.41 3.65-1.08 5.28l3.03 3.03C41.25 29.82 42 27 42 24c0-8.56-5.99-15.72-14-17.54v4.13c5.78 1.72 10 7.07 10 13.41zM8.55 6L6 8.55 15.45 18H6v12h8l10 10V26.55l8.51 8.51c-1.34 1.03-2.85 1.86-4.51 2.36v4.13a17.94 17.94 0 0 0 7.37-3.62L39.45 42 42 39.45l-18-18L8.55 6zM24 8l-4.18 4.18L24 16.36V8z"></path>
|
|
77
|
-
</symbol>
|
|
78
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-volume-low">
|
|
79
|
-
<path d="M14 18v12h8l10 10V8L22 18h-8z"></path>
|
|
80
|
-
</symbol>
|
|
81
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-volume-medium">
|
|
82
|
-
<path d="M37 24c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zm-27-6v12h8l10 10V8L18 18h-8z"></path>
|
|
83
|
-
</symbol>
|
|
84
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-volume-high">
|
|
85
|
-
<path d="M6 18v12h8l10 10V8L14 18H6zm27 6c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zM28 6.46v4.13c5.78 1.72 10 7.07 10 13.41s-4.22 11.69-10 13.41v4.13c8.01-1.82 14-8.97 14-17.54S36.01 8.28 28 6.46z"></path>
|
|
86
|
-
</symbol>
|
|
87
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-spinner">
|
|
88
|
-
<path d="M18.8 21l9.53-16.51C26.94 4.18 25.49 4 24 4c-4.8 0-9.19 1.69-12.64 4.51l7.33 12.69.11-.2zm24.28-3c-1.84-5.85-6.3-10.52-11.99-12.68L23.77 18h19.31zm.52 2H28.62l.58 1 9.53 16.5C41.99 33.94 44 29.21 44 24c0-1.37-.14-2.71-.4-4zm-26.53 4l-7.8-13.5C6.01 14.06 4 18.79 4 24c0 1.37.14 2.71.4 4h14.98l-2.31-4zM4.92 30c1.84 5.85 6.3 10.52 11.99 12.68L24.23 30H4.92zm22.54 0l-7.8 13.51c1.4.31 2.85.49 4.34.49 4.8 0 9.19-1.69 12.64-4.51L29.31 26.8 27.46 30z"></path>
|
|
89
|
-
</symbol>
|
|
90
|
-
<symbol viewBox="0 0 24 24" id="vjs-icon-hd">
|
|
91
|
-
<path d="M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-8 12H9.5v-2h-2v2H6V9h1.5v2.5h2V9H11v6zm2-6h4c.55 0 1 .45 1 1v4c0 .55-.45 1-1 1h-4V9zm1.5 4.5h2v-3h-2v3z"></path>
|
|
92
|
-
</symbol>
|
|
93
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-chapters">
|
|
94
|
-
<path d="M6 26h4v-4H6v4zm0 8h4v-4H6v4zm0-16h4v-4H6v4zm8 8h28v-4H14v4zm0 8h28v-4H14v4zm0-20v4h28v-4H14z"></path>
|
|
95
|
-
</symbol>
|
|
96
|
-
<symbol viewBox="0 0 40 40" id="vjs-icon-downloading">
|
|
97
|
-
<path d="M18.208 36.875q-3.208-.292-5.979-1.729-2.771-1.438-4.812-3.729-2.042-2.292-3.188-5.229-1.146-2.938-1.146-6.23 0-6.583 4.334-11.416 4.333-4.834 10.833-5.5v3.166q-5.167.75-8.583 4.646Q6.25 14.75 6.25 19.958q0 5.209 3.396 9.104 3.396 3.896 8.562 4.646zM20 28.417L11.542 20l2.083-2.083 4.917 4.916v-11.25h2.916v11.25l4.875-4.916L28.417 20zm1.792 8.458v-3.167q1.833-.25 3.541-.958 1.709-.708 3.167-1.875l2.333 2.292q-1.958 1.583-4.25 2.541-2.291.959-4.791 1.167zm6.791-27.792q-1.541-1.125-3.25-1.854-1.708-.729-3.541-1.021V3.042q2.5.25 4.77 1.208 2.271.958 4.271 2.5zm4.584 21.584l-2.25-2.25q1.166-1.5 1.854-3.209.687-1.708.937-3.541h3.209q-.292 2.5-1.229 4.791-.938 2.292-2.521 4.209zm.541-12.417q-.291-1.833-.958-3.562-.667-1.73-1.833-3.188l2.375-2.208q1.541 1.916 2.458 4.208.917 2.292 1.167 4.75z"></path>
|
|
98
|
-
</symbol>
|
|
99
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-file-download">
|
|
100
|
-
<path d="M10.8 40.55q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h26.35v-7.7h3.4v7.7q0 1.4-1 2.4t-2.4 1zM24 32.1L13.9 22.05l2.45-2.45 5.95 5.95V7.15h3.4v18.4l5.95-5.95 2.45 2.45z"></path>
|
|
101
|
-
</symbol>
|
|
102
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-file-download-done">
|
|
103
|
-
<path d="M9.8 40.5v-3.45h28.4v3.45zm9.2-9.05L7.4 19.85l2.45-2.35L19 26.65l19.2-19.2 2.4 2.4z"></path>
|
|
104
|
-
</symbol>
|
|
105
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-file-download-off">
|
|
106
|
-
<path d="M4.9 4.75L43.25 43.1 41 45.3l-4.75-4.75q-.05.05-.075.025-.025-.025-.075-.025H10.8q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h22.05l-7-7-1.85 1.8L13.9 21.9l1.85-1.85L2.7 7zm26.75 14.7l2.45 2.45-3.75 3.8-2.45-2.5zM25.7 7.15V21.1l-3.4-3.45V7.15z"></path>
|
|
107
|
-
</symbol>
|
|
108
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-share">
|
|
109
|
-
<path d="M36 32.17c-1.52 0-2.89.59-3.93 1.54L17.82 25.4c.11-.45.18-.92.18-1.4s-.07-.95-.18-1.4l14.1-8.23c1.07 1 2.5 1.62 4.08 1.62 3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6c0 .48.07.95.18 1.4l-14.1 8.23c-1.07-1-2.5-1.62-4.08-1.62-3.31 0-6 2.69-6 6s2.69 6 6 6c1.58 0 3.01-.62 4.08-1.62l14.25 8.31c-.1.42-.16.86-.16 1.31A5.83 5.83 0 1 0 36 32.17z"></path>
|
|
110
|
-
</symbol>
|
|
111
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-cog">
|
|
112
|
-
<path d="M38.86 25.95c.08-.64.14-1.29.14-1.95s-.06-1.31-.14-1.95l4.23-3.31c.38-.3.49-.84.24-1.28l-4-6.93c-.25-.43-.77-.61-1.22-.43l-4.98 2.01c-1.03-.79-2.16-1.46-3.38-1.97L29 4.84c-.09-.47-.5-.84-1-.84h-8c-.5 0-.91.37-.99.84l-.75 5.3a14.8 14.8 0 0 0-3.38 1.97L9.9 10.1a1 1 0 0 0-1.22.43l-4 6.93c-.25.43-.14.97.24 1.28l4.22 3.31C9.06 22.69 9 23.34 9 24s.06 1.31.14 1.95l-4.22 3.31c-.38.3-.49.84-.24 1.28l4 6.93c.25.43.77.61 1.22.43l4.98-2.01c1.03.79 2.16 1.46 3.38 1.97l.75 5.3c.08.47.49.84.99.84h8c.5 0 .91-.37.99-.84l.75-5.3a14.8 14.8 0 0 0 3.38-1.97l4.98 2.01a1 1 0 0 0 1.22-.43l4-6.93c.25-.43.14-.97-.24-1.28l-4.22-3.31zM24 31c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"></path>
|
|
113
|
-
</symbol>
|
|
114
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-square">
|
|
115
|
-
<path d="M36 8H12c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h24c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zm0 28H12V12h24v24z"></path>
|
|
116
|
-
</symbol>
|
|
117
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-circle">
|
|
118
|
-
<circle cx="24" cy="24" r="20"></circle>
|
|
119
|
-
</symbol>
|
|
120
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-circle-outline">
|
|
121
|
-
<path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>
|
|
122
|
-
</symbol>
|
|
123
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-circle-inner-circle">
|
|
124
|
-
<path d="M24 4C12.97 4 4 12.97 4 24s8.97 20 20 20 20-8.97 20-20S35.03 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16zm6-16c0 3.31-2.69 6-6 6s-6-2.69-6-6 2.69-6 6-6 6 2.69 6 6z"></path>
|
|
125
|
-
</symbol>
|
|
126
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-cancel">
|
|
127
|
-
<path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm10 27.17L31.17 34 24 26.83 16.83 34 14 31.17 21.17 24 14 16.83 16.83 14 24 21.17 31.17 14 34 16.83 26.83 24 34 31.17z"></path>
|
|
128
|
-
</symbol>
|
|
129
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-replay">
|
|
130
|
-
<path d="M24 10V2L14 12l10 10v-8c6.63 0 12 5.37 12 12s-5.37 12-12 12-12-5.37-12-12H8c0 8.84 7.16 16 16 16s16-7.16 16-16-7.16-16-16-16z"></path>
|
|
131
|
-
</symbol>
|
|
132
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-repeat">
|
|
133
|
-
<path d="M14 14h20v6l8-8-8-8v6H10v12h4v-8zm20 20H14v-6l-8 8 8 8v-6h24V26h-4v8z"></path>
|
|
134
|
-
</symbol>
|
|
135
|
-
<symbol viewBox="0 96 48 48" id="vjs-icon-replay-5">
|
|
136
|
-
<path d="M17.689 98l-8.697 8.696 8.697 8.697 2.486-2.485-4.32-4.319h1.302c4.93 0 9.071 1.722 12.424 5.165 3.352 3.443 5.029 7.638 5.029 12.584h3.55c0-2.958-.553-5.73-1.658-8.313-1.104-2.583-2.622-4.841-4.555-6.774-1.932-1.932-4.19-3.45-6.773-4.555-2.584-1.104-5.355-1.657-8.313-1.657H15.5l4.615-4.615zm-8.08 21.659v13.861h11.357v5.008H9.609V143h12.7c.834 0 1.55-.298 2.146-.894.596-.597.895-1.31.895-2.145v-7.781c0-.835-.299-1.55-.895-2.147a2.929 2.929 0 0 0-2.147-.894h-8.227v-5.096H25.35v-4.384z"></path>
|
|
137
|
-
</symbol>
|
|
138
|
-
<symbol viewBox="0 96 48 48" id="vjs-icon-replay-10">
|
|
139
|
-
<path d="M42.315 125.63c0-4.997-1.694-9.235-5.08-12.713-3.388-3.479-7.571-5.218-12.552-5.218h-1.315l4.363 4.363-2.51 2.51-8.787-8.786L25.221 97l2.45 2.45-4.662 4.663h1.375c2.988 0 5.788.557 8.397 1.673 2.61 1.116 4.892 2.65 6.844 4.602 1.953 1.953 3.487 4.234 4.602 6.844 1.116 2.61 1.674 5.41 1.674 8.398zM8.183 142v-19.657H3.176V117.8h9.643V142zm13.63 0c-1.156 0-2.127-.393-2.912-1.178-.778-.778-1.168-1.746-1.168-2.902v-16.04c0-1.156.393-2.127 1.178-2.912.779-.779 1.746-1.168 2.902-1.168h7.696c1.156 0 2.126.392 2.911 1.177.779.78 1.168 1.747 1.168 2.903v16.04c0 1.156-.392 2.127-1.177 2.912-.779.779-1.746 1.168-2.902 1.168zm.556-4.636h6.583v-15.02H22.37z"></path>
|
|
140
|
-
</symbol>
|
|
141
|
-
<symbol viewBox="0 96 48 48" id="vjs-icon-replay-30">
|
|
142
|
-
<path d="M26.047 97l-8.733 8.732 8.733 8.733 2.496-2.494-4.336-4.338h1.307c4.95 0 9.108 1.73 12.474 5.187 3.367 3.458 5.051 7.668 5.051 12.635h3.565c0-2.97-.556-5.751-1.665-8.346-1.109-2.594-2.633-4.862-4.574-6.802-1.94-1.941-4.208-3.466-6.803-4.575-2.594-1.109-5.375-1.664-8.345-1.664H23.85l4.634-4.634zM2.555 117.531v4.688h10.297v5.25H5.873v4.687h6.979v5.156H2.555V142H13.36c1.061 0 1.95-.395 2.668-1.186.718-.79 1.076-1.772 1.076-2.94v-16.218c0-1.168-.358-2.149-1.076-2.94-.717-.79-1.607-1.185-2.668-1.185zm22.482.14c-1.149 0-2.11.39-2.885 1.165-.78.78-1.172 1.744-1.172 2.893v15.943c0 1.149.388 2.11 1.163 2.885.78.78 1.745 1.172 2.894 1.172h7.649c1.148 0 2.11-.388 2.884-1.163.78-.78 1.17-1.745 1.17-2.894v-15.943c0-1.15-.386-2.111-1.16-2.885-.78-.78-1.746-1.172-2.894-1.172zm.553 4.518h6.545v14.93H25.59z"></path>
|
|
143
|
-
</symbol>
|
|
144
|
-
<symbol viewBox="0 96 48 48" id="vjs-icon-forward-5">
|
|
145
|
-
<path d="M29.508 97l-2.431 2.43 4.625 4.625h-1.364c-2.965 0-5.742.554-8.332 1.66-2.589 1.107-4.851 2.629-6.788 4.566-1.937 1.937-3.458 4.2-4.565 6.788-1.107 2.59-1.66 5.367-1.66 8.331h3.557c0-4.957 1.68-9.16 5.04-12.611 3.36-3.45 7.51-5.177 12.451-5.177h1.304l-4.326 4.33 2.49 2.49 8.715-8.716zm-9.783 21.61v13.89h11.382v5.018H19.725V142h12.727a2.93 2.93 0 0 0 2.15-.896 2.93 2.93 0 0 0 .896-2.15v-7.798c0-.837-.299-1.554-.896-2.152a2.93 2.93 0 0 0-2.15-.896h-8.245V123h11.29v-4.392z"></path>
|
|
146
|
-
</symbol>
|
|
147
|
-
<symbol viewBox="0 96 48 48" id="vjs-icon-forward-10">
|
|
148
|
-
<path d="M23.119 97l-2.386 2.383 4.538 4.538h-1.339c-2.908 0-5.633.543-8.173 1.63-2.54 1.085-4.76 2.577-6.66 4.478-1.9 1.9-3.392 4.12-4.478 6.66-1.085 2.54-1.629 5.264-1.629 8.172h3.49c0-4.863 1.648-8.986 4.944-12.372 3.297-3.385 7.368-5.078 12.216-5.078h1.279l-4.245 4.247 2.443 2.442 8.55-8.55zm-9.52 21.45v4.42h4.871V142h4.513v-23.55zm18.136 0c-1.125 0-2.066.377-2.824 1.135-.764.764-1.148 1.709-1.148 2.834v15.612c0 1.124.38 2.066 1.139 2.824.764.764 1.708 1.145 2.833 1.145h7.489c1.125 0 2.066-.378 2.824-1.136.764-.764 1.145-1.709 1.145-2.833v-15.612c0-1.125-.378-2.067-1.136-2.825-.764-.764-1.708-1.145-2.833-1.145zm.54 4.42h6.408v14.617h-6.407z"></path>
|
|
149
|
-
</symbol>
|
|
150
|
-
<symbol viewBox="0 96 48 48" id="vjs-icon-forward-30">
|
|
151
|
-
<path d="M25.549 97l-2.437 2.434 4.634 4.635H26.38c-2.97 0-5.753.555-8.347 1.664-2.594 1.109-4.861 2.633-6.802 4.574-1.94 1.94-3.465 4.207-4.574 6.802-1.109 2.594-1.664 5.377-1.664 8.347h3.565c0-4.967 1.683-9.178 5.05-12.636 3.366-3.458 7.525-5.187 12.475-5.187h1.307l-4.335 4.338 2.495 2.494 8.732-8.732zm-11.553 20.53v4.689h10.297v5.249h-6.978v4.688h6.978v5.156H13.996V142h10.808c1.06 0 1.948-.395 2.666-1.186.718-.79 1.077-1.771 1.077-2.94v-16.217c0-1.169-.36-2.15-1.077-2.94-.718-.79-1.605-1.186-2.666-1.186zm21.174.168c-1.149 0-2.11.389-2.884 1.163-.78.78-1.172 1.745-1.172 2.894v15.942c0 1.15.388 2.11 1.162 2.885.78.78 1.745 1.17 2.894 1.17h7.649c1.149 0 2.11-.386 2.885-1.16.78-.78 1.17-1.746 1.17-2.895v-15.942c0-1.15-.387-2.11-1.161-2.885-.78-.78-1.745-1.172-2.894-1.172zm.552 4.516h6.542v14.931h-6.542z"></path>
|
|
152
|
-
</symbol>
|
|
153
|
-
<symbol viewBox="0 0 512 512" id="vjs-icon-audio-description">
|
|
154
|
-
<g fill-rule="evenodd"><path d="M227.29 381.351V162.993c50.38-1.017 89.108-3.028 117.631 17.126 27.374 19.342 48.734 56.965 44.89 105.325-4.067 51.155-41.335 94.139-89.776 98.475-24.085 2.155-71.972 0-71.972 0s-.84-1.352-.773-2.568m48.755-54.804c31.43 1.26 53.208-16.633 56.495-45.386 4.403-38.51-21.188-63.552-58.041-60.796v103.612c-.036 1.466.575 2.22 1.546 2.57"></path><path d="M383.78 381.328c13.336 3.71 17.387-11.06 23.215-21.408 12.722-22.571 22.294-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.226 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M425.154 381.328c13.336 3.71 17.384-11.061 23.215-21.408 12.721-22.571 22.291-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.511c-.586 3.874 2.226 7.315 3.866 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M466.26 381.328c13.337 3.71 17.385-11.061 23.216-21.408 12.722-22.571 22.292-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.225 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894M4.477 383.005H72.58l18.573-28.484 64.169-.135s.065 19.413.065 28.62h48.756V160.307h-58.816c-5.653 9.537-140.85 222.697-140.85 222.697zm152.667-145.282v71.158l-40.453-.27 40.453-70.888z"></path></g>
|
|
155
|
-
</symbol>
|
|
156
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-next-item">
|
|
157
|
-
<path d="M12 36l17-12-17-12v24zm20-24v24h4V12h-4z"></path>
|
|
158
|
-
</symbol>
|
|
159
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-previous-item">
|
|
160
|
-
<path d="M12 12h4v24h-4zm7 12l17 12V12z"></path>
|
|
161
|
-
</symbol>
|
|
162
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-shuffle">
|
|
163
|
-
<path d="M21.17 18.34L10.83 8 8 10.83l10.34 10.34 2.83-2.83zM29 8l4.09 4.09L8 37.17 10.83 40l25.09-25.09L40 19V8H29zm.66 18.83l-2.83 2.83 6.26 6.26L29 40h11V29l-4.09 4.09-6.25-6.26z"></path>
|
|
164
|
-
</symbol>
|
|
165
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-cast">
|
|
166
|
-
<path d="M42 6H6c-2.21 0-4 1.79-4 4v6h4v-6h36v28H28v4h14c2.21 0 4-1.79 4-4V10c0-2.21-1.79-4-4-4zM2 36v6h6c0-3.31-2.69-6-6-6zm0-8v4c5.52 0 10 4.48 10 10h4c0-7.73-6.27-14-14-14zm0-8v4c9.94 0 18 8.06 18 18h4c0-12.15-9.85-22-22-22z"></path>
|
|
167
|
-
</symbol>
|
|
168
|
-
<symbol viewBox="0 0 48 48" id="vjs-icon-picture-in-picture-enter">
|
|
169
|
-
<path d="M38 22H22v11.99h16V22zm8 16V9.96C46 7.76 44.2 6 42 6H6C3.8 6 2 7.76 2 9.96V38c0 2.2 1.8 4 4 4h36c2.2 0 4-1.8 4-4zm-4 .04H6V9.94h36v28.1z"></path>
|
|
170
|
-
</symbol>
|
|
171
|
-
<symbol viewBox="0 0 22 18" id="vjs-icon-picture-in-picture-exit">
|
|
172
|
-
<path d="M18 4H4v10h14V4zm4 12V1.98C22 .88 21.1 0 20 0H2C.9 0 0 .88 0 1.98V16c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zm-2 .02H2V1.97h18v14.05z"></path>
|
|
173
|
-
<path fill="none" d="M-1-3h24v24H-1z"></path>
|
|
174
|
-
</symbol>
|
|
175
|
-
<symbol viewBox="0 0 1792 1792" id="vjs-icon-facebook">
|
|
176
|
-
<path d="M1343 12v264h-157q-86 0-116 36t-30 108v189h293l-39 296h-254v759H734V905H479V609h255V391q0-186 104-288.5T1115 0q147 0 228 12z"></path>
|
|
177
|
-
</symbol>
|
|
178
|
-
<symbol viewBox="0 0 1792 1792" id="vjs-icon-linkedin">
|
|
179
|
-
<path d="M477 625v991H147V625h330zm21-306q1 73-50.5 122T312 490h-2q-82 0-132-49t-50-122q0-74 51.5-122.5T314 148t133 48.5T498 319zm1166 729v568h-329v-530q0-105-40.5-164.5T1168 862q-63 0-105.5 34.5T999 982q-11 30-11 81v553H659q2-399 2-647t-1-296l-1-48h329v144h-2q20-32 41-56t56.5-52 87-43.5T1285 602q171 0 275 113.5t104 332.5z"></path>
|
|
180
|
-
</symbol>
|
|
181
|
-
<symbol viewBox="0 0 1200 1227" id="vjs-icon-twitter">
|
|
182
|
-
<path d="M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z"/>
|
|
183
|
-
</symbol>
|
|
184
|
-
<symbol viewBox="0 0 1792 1792" id="vjs-icon-tumblr">
|
|
185
|
-
<path d="M1328 1329l80 237q-23 35-111 66t-177 32q-104 2-190.5-26T787 1564t-95-106-55.5-120-16.5-118V676H452V461q72-26 129-69.5t91-90 58-102 34-99T779 12q1-5 4.5-8.5T791 0h244v424h333v252h-334v518q0 30 6.5 56t22.5 52.5 49.5 41.5 81.5 14q78-2 134-29z"></path>
|
|
186
|
-
</symbol>
|
|
187
|
-
<symbol viewBox="0 0 1792 1792" id="vjs-icon-pinterest">
|
|
188
|
-
<path d="M1664 896q0 209-103 385.5T1281.5 1561 896 1664q-111 0-218-32 59-93 78-164 9-34 54-211 20 39 73 67.5t114 28.5q121 0 216-68.5t147-188.5 52-270q0-114-59.5-214T1180 449t-255-63q-105 0-196 29t-154.5 77-109 110.5-67 129.5T377 866q0 104 40 183t117 111q30 12 38-20 2-7 8-31t8-30q6-23-11-43-51-61-51-151 0-151 104.5-259.5T904 517q151 0 235.5 82t84.5 213q0 170-68.5 289T980 1220q-61 0-98-43.5T859 1072q8-35 26.5-93.5t30-103T927 800q0-50-27-83t-77-33q-62 0-105 57t-43 142q0 73 25 122l-99 418q-17 70-13 177-206-91-333-281T128 896q0-209 103-385.5T510.5 231 896 128t385.5 103T1561 510.5 1664 896z"></path>
|
|
189
|
-
</symbol>
|
|
190
|
-
</defs>
|
|
191
|
-
</svg>`,FE=jZ?10009:FZ?461:8,Fh={codes:{play:415,pause:19,ff:417,rw:412,back:FE},names:{415:"play",19:"pause",417:"ff",412:"rw",[FE]:"back"},isEventKey(h,_){if(_=_.toLowerCase(),this.names[h.keyCode]&&this.names[h.keyCode]===_)return!0;return!1},getEventName(h){if(this.names[h.keyCode])return this.names[h.keyCode];else if(this.codes[h.code]){let _=this.codes[h.code];return this.names[_]}return null}},TE=5;class lC extends Q4{constructor(h){super();this.player_=h,this.focusableComponents=[],this.isListening_=!1,this.isPaused_=!1,this.onKeyDown_=this.onKeyDown_.bind(this),this.lastFocusedComponent_=null}start(){if(this.isListening_)return;if(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",()=>{if(this.updateFocusableComponents(),this.focusableComponents.length)if(this.focusableComponents.length>1)this.focusableComponents[1].focus();else this.focusableComponents[0].focus()})}stop(){this.player_.off("keydown",this.onKeyDown_),this.isListening_=!1}onKeyDown_(h){let _=h.originalEvent?h.originalEvent:h;if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(_.key)){if(this.isPaused_)return;_.preventDefault();let G=_.key.substring(5).toLowerCase();this.move(G)}else if(Fh.isEventKey(_,"play")||Fh.isEventKey(_,"pause")||Fh.isEventKey(_,"ff")||Fh.isEventKey(_,"rw")){_.preventDefault();let G=Fh.getEventName(_);this.performMediaAction_(G)}else if(Fh.isEventKey(_,"Back")&&h.target&&typeof h.target.closeable==="function"&&h.target.closeable())_.preventDefault(),h.target.close()}performMediaAction_(h){if(this.player_)switch(h){case"play":if(this.player_.paused())this.player_.play();break;case"pause":if(!this.player_.paused())this.player_.pause();break;case"ff":this.userSeek_(this.player_.currentTime()+TE);break;case"rw":this.userSeek_(this.player_.currentTime()-TE);break}}userSeek_(h){if(this.player_.liveTracker&&this.player_.liveTracker.isLive())this.player_.liveTracker.nextSeekedFromUser();this.player_.currentTime(h)}pause(){this.isPaused_=!0}resume(){this.isPaused_=!1}handlePlayerBlur_(h){let _=h.relatedTarget,G=null,Y=this.getCurrentComponent(h.target);if(_){if(G=Boolean(_.closest(".video-js")),_.classList.contains("vjs-text-track-settings")&&!this.isPaused_)this.searchForTrackSelect_()}if(!h.currentTarget.contains(h.relatedTarget)&&!G||!_){if(Y&&Y.name()==="CloseButton")this.refocusComponent();else if(this.pause(),Y&&Y.el())this.lastFocusedComponent_=Y}}handlePlayerFocus_(){if(this.getCurrentComponent()&&this.getCurrentComponent().getIsFocusable())this.resume()}updateFocusableComponents(){let h=this.player_,_=[];function G(Y){for(let X of Y){if(X.hasOwnProperty("el_")&&X.getIsFocusable()&&X.getIsAvailableToBeFocused(X.el()))_.push(X);if(X.hasOwnProperty("children_")&&X.children_.length>0)G(X.children_)}}return h.children_.forEach((Y)=>{if(Y.hasOwnProperty("el_")){if(Y.getIsFocusable&&Y.getIsAvailableToBeFocused&&Y.getIsFocusable()&&Y.getIsAvailableToBeFocused(Y.el())){_.push(Y);return}else if(Y.hasOwnProperty("children_")&&Y.children_.length>0)G(Y.children_);else if(Y.hasOwnProperty("items")&&Y.items.length>0)G(Y.items);else if(this.findSuitableDOMChild(Y))_.push(Y)}if(Y.name_==="ErrorDisplay"&&Y.opened_){let X=Y.el_.querySelector(".vjs-errors-ok-button-container");if(X)X.querySelectorAll("button").forEach((Z,Q)=>{_.push({name:()=>{return"ModalButton"+(Q+1)},el:()=>Z,getPositions:()=>{let D=Z.getBoundingClientRect(),O={x:D.x,y:D.y,width:D.width,height:D.height,top:D.top,right:D.right,bottom:D.bottom,left:D.left},A={x:D.left+D.width/2,y:D.top+D.height/2,width:0,height:0,top:D.top+D.height/2,right:D.left+D.width/2,bottom:D.top+D.height/2,left:D.left+D.width/2};return{boundingClientRect:O,center:A}},getIsAvailableToBeFocused:()=>!0,getIsFocusable:(D)=>!0,focus:()=>Z.focus()})})}}),this.focusableComponents=_,this.focusableComponents}findSuitableDOMChild(h){function _(G){if(h.getIsFocusable(G)&&h.getIsAvailableToBeFocused(G))return G;for(let Y=0;Y<G.children.length;Y++){let X=G.children[Y],K=_(X);if(K)return K}return null}if(h.el())return _(h.el());return null}getCurrentComponent(h){this.updateFocusableComponents();let _=h||document.activeElement;if(this.focusableComponents.length){for(let G of this.focusableComponents)if(G.el()===_)return G}}add(h){let _=[...this.focusableComponents];if(h.hasOwnProperty("el_")&&h.getIsFocusable()&&h.getIsAvailableToBeFocused(h.el()))_.push(h);this.focusableComponents=_,this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents})}remove(h){for(let _=0;_<this.focusableComponents.length;_++)if(this.focusableComponents[_].name()===h.name()){this.focusableComponents.splice(_,1),this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents});return}}clear(){if(this.focusableComponents.length>0)this.focusableComponents=[],this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents})}move(h){let _=this.getCurrentComponent();if(!_)return;let G=_.getPositions(),Y=this.focusableComponents.filter((K)=>K!==_&&this.isInDirection_(G.boundingClientRect,K.getPositions().boundingClientRect,h)),X=this.findBestCandidate_(G.center,Y,h);if(X)this.focus(X);else this.trigger({type:"endOfFocusableComponents",direction:h,focusedComponent:_})}findBestCandidate_(h,_,G){let Y=1/0,X=null;for(let K of _){let Z=K.getPositions().center,Q=this.calculateDistance_(h,Z,G);if(Q<Y)Y=Q,X=K}return X}isInDirection_(h,_,G){switch(G){case"right":return _.left>=h.right;case"left":return _.right<=h.left;case"down":return _.top>=h.bottom;case"up":return _.bottom<=h.top;default:return!1}}refocusComponent(){if(this.lastFocusedComponent_){if(!this.player_.userActive())this.player_.userActive(!0);this.updateFocusableComponents();for(let h=0;h<this.focusableComponents.length;h++)if(this.focusableComponents[h].name()===this.lastFocusedComponent_.name()){this.focus(this.focusableComponents[h]);return}}else this.focus(this.updateFocusableComponents()[0])}focus(h){if(typeof h!=="object")return;if(h.getIsAvailableToBeFocused(h.el()))h.focus();else if(this.findSuitableDOMChild(h))this.findSuitableDOMChild(h).focus()}calculateDistance_(h,_,G){let Y=Math.abs(h.x-_.x),X=Math.abs(h.y-_.y),K;switch(G){case"right":case"left":K=Y+X*100;break;case"up":K=X*2+Y*0.5;break;case"down":K=X*5+Y;break;default:K=Y+X}return K}searchForTrackSelect_(){let h=this;for(let _ of h.updateFocusableComponents())if(_.constructor.name==="TextTrackSelect"){h.focus(_);break}}}class iC extends z0{constructor(h,_,G){let Y=e1({createEl:!1},_);super(h,Y,G);if(!_.playerOptions.sources||_.playerOptions.sources.length===0)for(let X=0,K=_.playerOptions.techOrder;X<K.length;X++){let Z=F2(K[X]),Q=A1.getTech(Z);if(!Z)Q=z0.getComponent(Z);if(Q&&Q.isSupported()){h.loadTech_(Z);break}}else h.src(_.playerOptions.sources)}}z0.registerComponent("MediaLoader",iC);class BY extends z0{constructor(h,_){super(h,_);if(this.options_.controlText)this.controlText(this.options_.controlText);this.handleMouseOver_=(G)=>this.handleMouseOver(G),this.handleMouseOut_=(G)=>this.handleMouseOut(G),this.handleClick_=(G)=>this.handleClick(G),this.handleKeyDown_=(G)=>this.handleKeyDown(G),this.emitTapEvents(),this.enable()}createEl(h="div",_={},G={}){if(_=Object.assign({className:this.buildCSSClass(),tabIndex:0},_),h==="button")E1.error(`Creating a ClickableComponent with an HTML element of ${h} is not supported; use a Button instead.`);G=Object.assign({role:"button"},G),this.tabIndex_=_.tabIndex;let Y=h1(h,_,G);if(!this.player_.options_.experimentalSvgIcons)Y.appendChild(h1("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0}));return this.createControlTextEl(Y),Y}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(h){if(this.controlTextEl_=h1("span",{className:"vjs-control-text"},{"aria-live":"polite"}),h)h.appendChild(this.controlTextEl_);return this.controlText(this.controlText_,h),this.controlTextEl_}controlText(h,_=this.el()){if(h===void 0)return this.controlText_||"Need Text";let G=this.localize(h);if(this.controlText_=h,R8(this.controlTextEl_,G),!this.nonIconControl&&!this.player_.options_.noUITitleAttributes)_.setAttribute("title",G)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){if(!this.enabled_){if(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(){if(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(h){if(this.options_.clickHandler)this.options_.clickHandler.call(this,arguments)}handleKeyDown(h){if(h.key===" "||h.key==="Enter")h.preventDefault(),h.stopPropagation(),this.trigger("click");else super.handleKeyDown(h)}}z0.registerComponent("ClickableComponent",BY);class wZ extends BY{constructor(h,_){super(h,_);this.update(),this.update_=(G)=>this.update(G),h.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return h1("div",{className:"vjs-poster"})}crossOrigin(h){if(typeof h>"u"){if(this.$("img"))return this.$("img").crossOrigin;else if(this.player_.tech_&&this.player_.tech_.isReady_)return this.player_.crossOrigin();return this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null}if(h!==null&&h!=="anonymous"&&h!=="use-credentials"){this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${h}"`);return}if(this.$("img"))this.$("img").crossOrigin=h;return}update(h){let _=this.player().poster();if(this.setSrc(_),_)this.show();else this.hide()}setSrc(h){if(!h){this.el_.textContent="";return}if(!this.$("img"))this.el_.appendChild(h1("picture",{className:"vjs-poster",tabIndex:-1},{},h1("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""})));this.$("img").src=h}handleClick(h){if(!this.player_.controls())return;if(this.player_.tech(!0))this.player_.tech(!0).focus();if(this.player_.paused())x3(this.player_.play());else this.player_.pause()}}wZ.prototype.crossorigin=wZ.prototype.crossOrigin;z0.registerComponent("PosterImage",wZ);var l4="#222",WE="#ccc",OI={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 rD(h,_){let G;if(h.length===4)G=h[1]+h[1]+h[2]+h[2]+h[3]+h[3];else if(h.length===7)G=h.slice(1);else throw Error("Invalid color code provided, "+h+"; must be formatted as e.g. #f0e or #f604e2.");return"rgba("+parseInt(G.slice(0,2),16)+","+parseInt(G.slice(2,4),16)+","+parseInt(G.slice(4,6),16)+","+_+")"}function S3(h,_,G){try{h.style[_]=G}catch(Y){return}}function RE(h){return h?`${h}px`:""}class cC extends z0{constructor(h,_,G){super(h,_,G);let Y=(K)=>this.updateDisplay(K),X=(K)=>{this.updateDisplayOverlay(),this.updateDisplay(K)};h.on("loadstart",(K)=>this.toggleDisplay(K)),h.on("useractive",Y),h.on("userinactive",Y),h.on("texttrackchange",Y),h.on("loadedmetadata",(K)=>{this.updateDisplayOverlay(),this.preselectTrack(K)}),h.ready(K2(this,function(){if(h.tech_&&h.tech_.featuresNativeTextTracks){this.hide();return}h.on("fullscreenchange",X),h.on("playerresize",X);let K=a.default.screen.orientation||a.default,Z=a.default.screen.orientation?"change":"orientationchange";K.addEventListener(Z,X),h.on("dispose",()=>K.removeEventListener(Z,X));let Q=this.options_.playerOptions.tracks||[];for(let D=0;D<Q.length;D++)this.player_.addRemoteTextTrack(Q[D],!0);this.preselectTrack()}))}preselectTrack(){let h={captions:1,subtitles:1},_=this.player_.textTracks(),G=this.player_.cache_.selectedLanguage,Y,X,K;for(let Z=0;Z<_.length;Z++){let Q=_[Z];if(G&&G.enabled&&G.language&&G.language===Q.language&&Q.kind in h){if(Q.kind===G.kind)K=Q;else if(!K)K=Q}else if(G&&!G.enabled)K=null,Y=null,X=null;else if(Q.default){if(Q.kind==="descriptions"&&!Y)Y=Q;else if(Q.kind in h&&!X)X=Q}}if(K)K.mode="showing";else if(X)X.mode="showing";else if(Y)Y.mode="showing"}toggleDisplay(){if(this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks)this.hide();else this.show()}createEl(){return super.createEl("div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"})}clearDisplay(){if(typeof a.default.WebVTT==="function")a.default.WebVTT.processCues(a.default,[],this.el_)}updateDisplay(){let h=this.player_.textTracks(),_=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),_){let K=[];for(let Z=0;Z<h.length;++Z){let Q=h[Z];if(Q.mode!=="showing")continue;K.push(Q)}this.updateForTrack(K);return}let G=null,Y=null,X=h.length;while(X--){let K=h[X];if(K.mode==="showing")if(K.kind==="descriptions")G=K;else Y=K}if(Y){if(this.getAttribute("aria-live")!=="off")this.setAttribute("aria-live","off");this.updateForTrack(Y)}else if(G){if(this.getAttribute("aria-live")!=="assertive")this.setAttribute("aria-live","assertive");this.updateForTrack(G)}if(!(a.default.CSS!==void 0&&a.default.CSS.supports("inset","10px"))){let K=this.el_,Z=K.querySelectorAll(".vjs-text-track-cue"),Q=this.player_.controlBar.el_.getBoundingClientRect().height,D=this.player_.el_.getBoundingClientRect().height;if(K.style="",S3(K,"position","relative"),S3(K,"height",D-Q+"px"),S3(K,"top","unset"),TZ)S3(K,"bottom",D+"px");else S3(K,"bottom","0px");if(Z.length>0)Z.forEach((O)=>{if(O.style.inset){let A=O.style.inset.split(" ");if(A.length===3)Object.assign(O.style,{top:A[0],right:A[1],bottom:A[2],left:"unset"})}})}}updateDisplayOverlay(){if(!this.player_.videoHeight()||!(a.default.CSS!==void 0&&a.default.CSS.supports("inset-inline: 10px")))return;let h=this.player_.currentWidth(),_=this.player_.currentHeight(),G=h/_,Y=this.player_.videoWidth()/this.player_.videoHeight(),X=0,K=0;if(Math.abs(G-Y)>0.1)if(G>Y)X=Math.round((h-_*Y)/2);else K=Math.round((_-h/Y)/2);S3(this.el_,"insetInline",RE(X)),S3(this.el_,"insetBlock",RE(K))}updateDisplayState(h){let _=this.player_.textTrackSettings.getValues(),G=h.activeCues,Y=G.length;while(Y--){let X=G[Y];if(!X)continue;let K=X.displayState;if(_.color)K.firstChild.style.color=_.color;if(_.textOpacity)S3(K.firstChild,"color",rD(_.color||"#fff",_.textOpacity));if(_.backgroundColor)K.firstChild.style.backgroundColor=_.backgroundColor;if(_.backgroundOpacity)S3(K.firstChild,"backgroundColor",rD(_.backgroundColor||"#000",_.backgroundOpacity));if(_.windowColor)if(_.windowOpacity)S3(K,"backgroundColor",rD(_.windowColor,_.windowOpacity));else K.style.backgroundColor=_.windowColor;if(_.edgeStyle){if(_.edgeStyle==="dropshadow")K.firstChild.style.textShadow=`2px 2px 3px ${l4}, 2px 2px 4px ${l4}, 2px 2px 5px ${l4}`;else if(_.edgeStyle==="raised")K.firstChild.style.textShadow=`1px 1px ${l4}, 2px 2px ${l4}, 3px 3px ${l4}`;else if(_.edgeStyle==="depressed")K.firstChild.style.textShadow=`1px 1px ${WE}, 0 1px ${WE}, -1px -1px ${l4}, 0 -1px ${l4}`;else if(_.edgeStyle==="uniform")K.firstChild.style.textShadow=`0 0 4px ${l4}, 0 0 4px ${l4}, 0 0 4px ${l4}, 0 0 4px ${l4}`}if(_.fontPercent&&_.fontPercent!==1){let Z=a.default.parseFloat(K.style.fontSize);K.style.fontSize=Z*_.fontPercent+"px",K.style.height="auto",K.style.top="auto"}if(_.fontFamily&&_.fontFamily!=="default")if(_.fontFamily==="small-caps")K.firstChild.style.fontVariant="small-caps";else K.firstChild.style.fontFamily=OI[_.fontFamily]}}updateForTrack(h){if(!Array.isArray(h))h=[h];if(typeof a.default.WebVTT!=="function"||h.every((G)=>{return!G.activeCues}))return;let _=[];for(let G=0;G<h.length;++G){let Y=h[G];for(let X=0;X<Y.activeCues.length;++X)_.push(Y.activeCues[X])}a.default.WebVTT.processCues(a.default,_,this.el_);for(let G=0;G<h.length;++G){let Y=h[G];for(let X=0;X<Y.activeCues.length;++X){let K=Y.activeCues[X].displayState;if(u7(K,"vjs-text-track-cue","vjs-text-track-cue-"+(Y.language?Y.language:G)),Y.language)fh(K,"lang",Y.language)}if(this.player_.textTrackSettings)this.updateDisplayState(Y)}}}z0.registerComponent("TextTrackDisplay",cC);class dC extends z0{createEl(){let h=this.player_.isAudio(),_=this.localize(h?"Audio Player":"Video Player"),G=h1("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[_])}),Y=super.createEl("div",{className:"vjs-loading-spinner",dir:"ltr"});return Y.appendChild(G),Y}handleLanguagechange(){this.$(".vjs-control-text").textContent=this.localize("{1} is loading.",[this.player_.isAudio()?"Audio Player":"Video Player"])}}z0.registerComponent("LoadingSpinner",dC);class $5 extends BY{createEl(h,_={},G={}){h="button",_=Object.assign({className:this.buildCSSClass()},_),G=Object.assign({type:"button"},G);let Y=h1(h,_,G);if(!this.player_.options_.experimentalSvgIcons)Y.appendChild(h1("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0}));return this.createControlTextEl(Y),Y}addChild(h,_={}){let G=this.constructor.name;return E1.warn(`Adding an actionable (user controllable) child to a Button (${G}) is not supported; use a ClickableComponent instead.`),z0.prototype.addChild.call(this,h,_)}enable(){super.enable(),this.el_.removeAttribute("disabled")}disable(){super.disable(),this.el_.setAttribute("disabled","disabled")}handleKeyDown(h){if(h.key===" "||h.key==="Enter"){h.stopPropagation();return}super.handleKeyDown(h)}}z0.registerComponent("Button",$5);class sM extends $5{constructor(h,_){super(h,_);this.mouseused_=!1,this.setIcon("play"),this.on("mousedown",(G)=>this.handleMouseDown(G))}buildCSSClass(){return"vjs-big-play-button"}handleClick(h){let _=this.player_.play();if(h.type==="tap"||this.mouseused_&&"clientX"in h&&"clientY"in h){if(x3(_),this.player_.tech(!0))this.player_.tech(!0).focus();return}let G=this.player_.getChild("controlBar"),Y=G&&G.getChild("playToggle");if(!Y){this.player_.tech(!0).focus();return}let X=()=>Y.focus();if(XY(_))_.then(X,()=>{});else this.setTimeout(X,1)}handleKeyDown(h){this.mouseused_=!1,super.handleKeyDown(h)}handleMouseDown(h){this.mouseused_=!0}}sM.prototype.controlText_="Play Video";z0.registerComponent("BigPlayButton",sM);class aC extends $5{constructor(h,_){super(h,_);this.setIcon("cancel"),this.controlText(_&&_.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(h){this.trigger({type:"close",bubbles:!1})}handleKeyDown(h){if(h.key==="Escape")h.preventDefault(),h.stopPropagation(),this.trigger("click");else super.handleKeyDown(h)}}z0.registerComponent("CloseButton",aC);class nM extends $5{constructor(h,_={}){super(h,_);if(_.replay=_.replay===void 0||_.replay,this.setIcon("play"),this.on(h,"play",(G)=>this.handlePlay(G)),this.on(h,"pause",(G)=>this.handlePause(G)),_.replay)this.on(h,"ended",(G)=>this.handleEnded(G))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(h){if(this.player_.paused())x3(this.player_.play());else this.player_.pause()}handleSeeked(h){if(this.removeClass("vjs-ended"),this.player_.paused())this.handlePause(h);else this.handlePlay(h)}handlePlay(h){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.setIcon("pause"),this.controlText("Pause")}handlePause(h){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.setIcon("play"),this.controlText("Play")}handleEnded(h){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.setIcon("replay"),this.controlText("Replay"),this.one(this.player_,"seeked",(_)=>this.handleSeeked(_))}}nM.prototype.controlText_="Play";z0.registerComponent("PlayToggle",nM);class d7 extends z0{constructor(h,_){super(h,_);this.on(h,["timeupdate","ended","seeking"],(G)=>this.update(G)),this.updateTextNode_()}createEl(){let h=this.buildCSSClass(),_=super.createEl("div",{className:`${h} vjs-time-control vjs-control`}),G=h1("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)} `},{role:"presentation"});return _.appendChild(G),this.contentEl_=h1("span",{className:`${h}-display`},{role:"presentation"}),_.appendChild(this.contentEl_),_}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}update(h){if(!this.player_.options_.enableSmoothSeeking&&h.type==="seeking")return;this.updateContent(h)}updateTextNode_(h=0){if(h=i7(h),this.formattedTime_===h)return;this.formattedTime_=h,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",()=>{if(!this.contentEl_)return;let _=this.textNode_;if(_&&this.contentEl_.firstChild!==_)_=null,E1.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.");if(this.textNode_=T0.default.createTextNode(this.formattedTime_),!this.textNode_)return;if(_)this.contentEl_.replaceChild(this.textNode_,_);else this.contentEl_.appendChild(this.textNode_)})}updateContent(h){}}d7.prototype.labelText_="Time";d7.prototype.controlText_="Time";z0.registerComponent("TimeDisplay",d7);class YJ extends d7{buildCSSClass(){return"vjs-current-time"}updateContent(h){let _;if(this.player_.ended())_=this.player_.duration();else if(h&&h.target&&typeof h.target.pendingSeekTime==="function"&&h.target.pendingSeekTime()!==null)_=h.target.pendingSeekTime();else _=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();this.updateTextNode_(_)}}YJ.prototype.labelText_="Current Time";YJ.prototype.controlText_="Current Time";z0.registerComponent("CurrentTimeDisplay",YJ);class XJ extends d7{constructor(h,_){super(h,_);let G=(Y)=>this.updateContent(Y);this.on(h,"durationchange",G),this.on(h,"loadstart",G),this.on(h,"loadedmetadata",G)}buildCSSClass(){return"vjs-duration"}updateContent(h){let _=this.player_.duration();this.updateTextNode_(_)}}XJ.prototype.labelText_="Duration";XJ.prototype.controlText_="Duration";z0.registerComponent("DurationDisplay",XJ);class tC extends z0{createEl(){let h=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),_=super.createEl("div"),G=super.createEl("span",{textContent:"/"});return _.appendChild(G),h.appendChild(_),h}}z0.registerComponent("TimeDivider",tC);class KJ extends d7{constructor(h,_){super(h,_);this.on(h,"durationchange",(G)=>this.updateContent(G))}buildCSSClass(){return"vjs-remaining-time"}createEl(){let h=super.createEl();if(this.options_.displayNegative!==!1)h.insertBefore(h1("span",{},{"aria-hidden":!0},"-"),this.contentEl_);return h}updateContent(h){if(typeof this.player_.duration()!=="number")return;let _;if(this.player_.ended())_=0;else if(this.player_.remainingTimeDisplay)_=this.player_.remainingTimeDisplay();else _=this.player_.remainingTime();this.updateTextNode_(_)}}KJ.prototype.labelText_="Remaining Time";KJ.prototype.controlText_="Remaining Time";z0.registerComponent("RemainingTimeDisplay",KJ);class sC extends z0{constructor(h,_){super(h,_);this.updateShowing(),this.on(this.player(),"durationchange",(G)=>this.updateShowing(G))}createEl(){let h=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=h1("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(h1("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")} `})),this.contentEl_.appendChild(T0.default.createTextNode(this.localize("LIVE"))),h.appendChild(this.contentEl_),h}dispose(){this.contentEl_=null,super.dispose()}updateShowing(h){if(this.player().duration()===1/0)this.show();else this.hide()}}z0.registerComponent("LiveDisplay",sC);class oM extends $5{constructor(h,_){super(h,_);if(this.updateLiveEdgeStatus(),this.player_.liveTracker)this.updateLiveEdgeStatusHandler_=(G)=>this.updateLiveEdgeStatus(G),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_)}createEl(){let h=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.setIcon("circle",h),this.textEl_=h1("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),h.appendChild(this.textEl_),h}updateLiveEdgeStatus(){if(!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");else 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(){if(this.player_.liveTracker)this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_);this.textEl_=null,super.dispose()}}oM.prototype.controlText_="Seek to live, currently playing live";z0.registerComponent("SeekToLive",oM);function OY(h,_,G){return h=Number(h),Math.min(G,Math.max(_,isNaN(h)?_:h))}var AI=Object.freeze({__proto__:null,clamp:OY});class ZJ extends z0{constructor(h,_){super(h,_);this.handleMouseDown_=(G)=>this.handleMouseDown(G),this.handleMouseUp_=(G)=>this.handleMouseUp(G),this.handleKeyDown_=(G)=>this.handleKeyDown(G),this.handleClick_=(G)=>this.handleClick(G),this.handleMouseMove_=(G)=>this.handleMouseMove(G),this.update_=(G)=>this.update(G),this.bar=this.getChild(this.options_.barName),this.vertical(!!this.options_.vertical),this.enable()}enabled(){return this.enabled_}enable(){if(this.enabled())return;if(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;let h=this.bar.el_.ownerDocument;if(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(h,"mousemove",this.handleMouseMove_),this.off(h,"mouseup",this.handleMouseUp_),this.off(h,"touchmove",this.handleMouseMove_),this.off(h,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent)this.off(this.player_,this.playerEvent,this.update);this.enabled_=!1}createEl(h,_={},G={}){return _.className=_.className+" vjs-slider",_=Object.assign({tabIndex:0},_),G=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},G),super.createEl(h,_,G)}handleMouseDown(h){let _=this.bar.el_.ownerDocument;if(h.type==="mousedown")h.preventDefault();if(h.type==="touchstart"&&!y3)h.preventDefault();CC(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(_,"mousemove",this.handleMouseMove_),this.on(_,"mouseup",this.handleMouseUp_),this.on(_,"touchmove",this.handleMouseMove_),this.on(_,"touchend",this.handleMouseUp_),this.handleMouseMove(h,!0)}handleMouseMove(h){}handleMouseUp(h){let _=this.bar.el_.ownerDocument;NC(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(_,"mousemove",this.handleMouseMove_),this.off(_,"mouseup",this.handleMouseUp_),this.off(_,"touchmove",this.handleMouseMove_),this.off(_,"touchend",this.handleMouseUp_),this.update()}update(){if(!this.el_||!this.bar)return;let h=this.getProgress();if(h===this.progress_)return h;return this.progress_=h,this.requestNamedAnimationFrame("Slider#update",()=>{let _=this.vertical()?"height":"width";this.bar.el().style[_]=(h*100).toFixed(2)+"%"}),h}getProgress(){return Number(OY(this.getPercent(),0,1).toFixed(4))}calculateDistance(h){let _=sZ(this.el_,h);if(this.vertical())return _.y;return _.x}handleKeyDown(h){let _=this.options_.playerOptions.spatialNavigation,G=_&&_.enabled,Y=_&&_.horizontalSeek;if(G)if(Y&&h.key==="ArrowLeft"||!Y&&h.key==="ArrowDown")h.preventDefault(),h.stopPropagation(),this.stepBack();else if(Y&&h.key==="ArrowRight"||!Y&&h.key==="ArrowUp")h.preventDefault(),h.stopPropagation(),this.stepForward();else{if(this.pendingSeekTime())this.pendingSeekTime(null),this.userSeek_(this.player_.currentTime());super.handleKeyDown(h)}else if(h.key==="ArrowLeft"||h.key==="ArrowDown")h.preventDefault(),h.stopPropagation(),this.stepBack();else if(h.key==="ArrowUp"||h.key==="ArrowRight")h.preventDefault(),h.stopPropagation(),this.stepForward();else super.handleKeyDown(h)}handleClick(h){h.stopPropagation(),h.preventDefault()}vertical(h){if(h===void 0)return this.vertical_||!1;if(this.vertical_=!!h,this.vertical_)this.addClass("vjs-slider-vertical");else this.addClass("vjs-slider-horizontal")}}z0.registerComponent("Slider",ZJ);var eD=(h,_)=>OY(h/_*100,0,100).toFixed(2)+"%";class nC extends z0{constructor(h,_){super(h,_);this.partEls_=[],this.on(h,"progress",(G)=>this.update(G))}createEl(){let h=super.createEl("div",{className:"vjs-load-progress"}),_=h1("span",{className:"vjs-control-text"}),G=h1("span",{textContent:this.localize("Loaded")}),Y=T0.default.createTextNode(": ");return this.percentageEl_=h1("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),h.appendChild(_),_.appendChild(G),_.appendChild(Y),_.appendChild(this.percentageEl_),h}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(h){this.requestNamedAnimationFrame("LoadProgressBar#update",()=>{let _=this.player_.liveTracker,G=this.player_.buffered(),Y=_&&_.isLive()?_.seekableEnd():this.player_.duration(),X=this.player_.bufferedEnd(),K=this.partEls_,Z=eD(X,Y);if(this.percent_!==Z)this.el_.style.width=Z,R8(this.percentageEl_,Z),this.percent_=Z;for(let Q=0;Q<G.length;Q++){let D=G.start(Q),O=G.end(Q),A=K[Q];if(!A)A=this.el_.appendChild(h1()),K[Q]=A;if(A.dataset.start===D&&A.dataset.end===O)continue;A.dataset.start=D,A.dataset.end=O,A.style.left=eD(D,X),A.style.width=eD(O-D,X)}for(let Q=K.length;Q>G.length;Q--)this.el_.removeChild(K[Q-1]);K.length=G.length})}}z0.registerComponent("LoadProgressBar",nC);class oC extends z0{constructor(h,_){super(h,_);this.update=b3(K2(this,this.update),d4)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(h,_,G){let Y=qY(this.el_),X=kh(this.player_.el()),K=h.width*_;if(!X||!Y)return;let Z=h.left-X.left+K,Q=h.width-K+(X.right-h.right);if(!Q)Q=h.width-K,Z=K;let D=Y.width/2;if(Z<D)D+=D-Z;else if(Q<D)D=Q;if(D<0)D=0;else if(D>Y.width)D=Y.width;D=Math.round(D),this.el_.style.right=`-${D}px`,this.write(G)}write(h){R8(this.el_,h)}updateTime(h,_,G,Y){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{let X,K=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){let Z=this.player_.liveTracker.liveWindow(),Q=Z-_*Z;X=(Q<1?"":"-")+i7(Q,Z)}else X=i7(G,K);if(this.update(h,_,X),Y)Y()})}}z0.registerComponent("TimeTooltip",oC);class JJ extends z0{constructor(h,_){super(h,_);this.setIcon("circle"),this.update=b3(K2(this,this.update),d4)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(h,_,G){let Y=this.getChild("timeTooltip");if(!Y)return;let X=G&&G.target&&typeof G.target.pendingSeekTime==="function"?G.target.pendingSeekTime():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();Y.updateTime(h,_,X)}}JJ.prototype.options_={children:[]};if(!x5&&!Q3)JJ.prototype.options_.children.push("timeTooltip");z0.registerComponent("PlayProgressBar",JJ);class rM extends z0{constructor(h,_){super(h,_);this.update=b3(K2(this,this.update),d4)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(h,_){let G=_*this.player_.duration();this.getChild("timeTooltip").updateTime(h,_,G,()=>{this.el_.style.left=`${h.width*_}px`})}}rM.prototype.options_={children:["timeTooltip"]};z0.registerComponent("MouseTimeDisplay",rM);class qJ extends ZJ{constructor(h,_){_=e1(qJ.prototype.options_,_),_.children=[..._.children];let G=h.options_.disableSeekWhileScrubbingOnMobile&&(x5||Q3)||h.options_.disableSeekWhileScrubbingOnSTV;if(!x5&&!Q3||G)_.children.splice(1,0,"mouseTimeDisplay");super(h,_);this.shouldDisableSeekWhileScrubbing_=G,this.pendingSeekTime_=null,this.setEventHandlers_()}setEventHandlers_(){if(this.update_=K2(this,this.update),this.update=b3(this.update_,d4),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);if(this.updateInterval=null,this.enableIntervalHandler_=(h)=>this.enableInterval_(h),this.disableIntervalHandler_=(h)=>this.disableInterval_(h),this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in T0.default&&"visibilityState"in T0.default)this.on(T0.default,"visibilitychange",this.toggleVisibility_)}toggleVisibility_(h){if(T0.default.visibilityState==="hidden")this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(h);else{if(!this.player_.ended()&&!this.player_.paused())this.enableInterval_();this.update()}}enableInterval_(){if(this.updateInterval)return;this.updateInterval=this.setInterval(this.update,d4)}disableInterval_(h){if(this.player_.liveTracker&&this.player_.liveTracker.isLive()&&h&&h.type!=="ended")return;if(!this.updateInterval)return;this.clearInterval(this.updateInterval),this.updateInterval=null}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(h){if(T0.default.visibilityState==="hidden")return;let _=super.update();return this.requestNamedAnimationFrame("SeekBar#update",()=>{let G=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),Y=this.player_.liveTracker,X=this.player_.duration();if(Y&&Y.isLive())X=this.player_.liveTracker.liveCurrentTime();if(this.percent_!==_)this.el_.setAttribute("aria-valuenow",(_*100).toFixed(2)),this.percent_=_;if(this.currentTime_!==G||this.duration_!==X)this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[i7(G,X),i7(X,X)],"{1} of {2}")),this.currentTime_=G,this.duration_=X;if(this.bar)this.bar.update(kh(this.el()),this.getProgress(),h)}),_}userSeek_(h){if(this.player_.liveTracker&&this.player_.liveTracker.isLive())this.player_.liveTracker.nextSeekedFromUser();this.player_.currentTime(h)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}pendingSeekTime(h){if(h!==void 0)if(h!==null){let _=this.player_.duration();this.pendingSeekTime_=Math.max(0,Math.min(h,_))}else this.pendingSeekTime_=null;return this.pendingSeekTime_}getPercent(){if(this.pendingSeekTime()!==null)return this.pendingSeekTime()/this.player_.duration();let h=this.getCurrentTime_(),_,G=this.player_.liveTracker;if(G&&G.isLive()){if(_=(h-G.seekableStart())/G.liveWindow(),G.atLiveEdge())_=1}else _=h/this.player_.duration();return _}handleMouseDown(h){if(!QY(h))return;if(h.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),!this.shouldDisableSeekWhileScrubbing_)this.player_.pause();super.handleMouseDown(h)}handleMouseMove(h,_=!1){if(!QY(h)||isNaN(this.player_.duration()))return;if(!_&&!this.player_.scrubbing())this.player_.scrubbing(!0);let G,Y=this.calculateDistance(h),X=this.player_.liveTracker;if(!X||!X.isLive()){if(G=Y*this.player_.duration(),G===this.player_.duration())G=G-0.1}else{if(Y>=0.99){X.seekToLiveEdge();return}let K=X.seekableStart(),Z=X.liveCurrentTime();if(G=K+Y*X.liveWindow(),G>=Z)G=Z;if(G<=K)G=K+0.1;if(G===1/0)return}if(this.shouldDisableSeekWhileScrubbing_)this.pendingSeekTime(G);else this.userSeek_(G);if(this.player_.options_.enableSmoothSeeking)this.update()}enable(){super.enable();let h=this.getChild("mouseTimeDisplay");if(!h)return;h.show()}disable(){super.disable();let h=this.getChild("mouseTimeDisplay");if(!h)return;h.hide()}handleMouseUp(h){if(super.handleMouseUp(h),h)h.stopPropagation();if(this.player_.scrubbing(!1),this.pendingSeekTime()!==null)this.userSeek_(this.pendingSeekTime()),this.pendingSeekTime(null);if(this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying)x3(this.player_.play());else this.update_()}handlePendingSeek_(h){if(!this.player_.paused())this.player_.pause();let _=this.pendingSeekTime()!==null?this.pendingSeekTime():this.player_.currentTime();this.pendingSeekTime(_+h),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}stepForward(){if(this.shouldDisableSeekWhileScrubbing_)this.handlePendingSeek_(this.options().stepSeconds);else this.userSeek_(this.player_.currentTime()+this.options().stepSeconds)}stepBack(){if(this.shouldDisableSeekWhileScrubbing_)this.handlePendingSeek_(-this.options().stepSeconds);else this.userSeek_(this.player_.currentTime()-this.options().stepSeconds)}handleAction(h){if(this.pendingSeekTime()!==null)this.userSeek_(this.pendingSeekTime()),this.pendingSeekTime(null);if(this.player_.paused())this.player_.play();else this.player_.pause()}handleKeyDown(h){let _=this.player_.liveTracker;if(h.key===" "||h.key==="Enter")h.preventDefault(),h.stopPropagation(),this.handleAction(h);else if(h.key==="Home")h.preventDefault(),h.stopPropagation(),this.userSeek_(0);else if(h.key==="End")if(h.preventDefault(),h.stopPropagation(),_&&_.isLive())this.userSeek_(_.liveCurrentTime());else this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(h.key)){h.preventDefault(),h.stopPropagation();let G=parseInt(h.key,10)*0.1;if(_&&_.isLive())this.userSeek_(_.seekableStart()+_.liveWindow()*G);else this.userSeek_(this.player_.duration()*G)}else if(h.key==="PageDown")h.preventDefault(),h.stopPropagation(),this.userSeek_(this.player_.currentTime()-this.options().stepSeconds*this.options().pageMultiplier);else if(h.key==="PageUp")h.preventDefault(),h.stopPropagation(),this.userSeek_(this.player_.currentTime()+this.options().stepSeconds*this.options().pageMultiplier);else super.handleKeyDown(h)}dispose(){if(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);if(this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in T0.default&&"visibilityState"in T0.default)this.off(T0.default,"visibilitychange",this.toggleVisibility_);super.dispose()}}qJ.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar",stepSeconds:5,pageMultiplier:12};z0.registerComponent("SeekBar",qJ);class eM extends z0{constructor(h,_){super(h,_);this.handleMouseMove=b3(K2(this,this.handleMouseMove),d4),this.throttledHandleMouseSeek=b3(K2(this,this.handleMouseSeek),d4),this.handleMouseUpHandler_=(G)=>this.handleMouseUp(G),this.handleMouseDownHandler_=(G)=>this.handleMouseDown(G),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(h){let _=this.getChild("seekBar");if(!_)return;let G=_.getChild("playProgressBar"),Y=_.getChild("mouseTimeDisplay");if(!G&&!Y)return;let X=_.el(),K=qY(X),Z=sZ(X,h).x;if(Z=OY(Z,0,1),Y)Y.update(K,Z);if(G)G.update(K,_.getProgress())}handleMouseSeek(h){let _=this.getChild("seekBar");if(_)_.handleMouseMove(h)}enabled(){return this.enabled_}disable(){if(this.children().forEach((h)=>h.disable&&h.disable()),!this.enabled())return;if(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()){let h=this.getChild("seekBar");if(this.player_.scrubbing(!1),h.videoWasPlaying)x3(this.player_.play())}}enable(){if(this.children().forEach((h)=>h.enable&&h.enable()),this.enabled())return;this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,["mousemove","touchmove"],this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0}removeListenersAddedOnMousedownAndTouchstart(){let h=this.el_.ownerDocument;this.off(h,"mousemove",this.throttledHandleMouseSeek),this.off(h,"touchmove",this.throttledHandleMouseSeek),this.off(h,"mouseup",this.handleMouseUpHandler_),this.off(h,"touchend",this.handleMouseUpHandler_)}handleMouseDown(h){let _=this.el_.ownerDocument,G=this.getChild("seekBar");if(G)G.handleMouseDown(h);this.on(_,"mousemove",this.throttledHandleMouseSeek),this.on(_,"touchmove",this.throttledHandleMouseSeek),this.on(_,"mouseup",this.handleMouseUpHandler_),this.on(_,"touchend",this.handleMouseUpHandler_)}handleMouseUp(h){let _=this.getChild("seekBar");if(_)_.handleMouseUp(h);this.removeListenersAddedOnMousedownAndTouchstart()}}eM.prototype.options_={children:["seekBar"]};z0.registerComponent("ProgressControl",eM);class hB extends $5{constructor(h,_){super(h,_);this.setIcon("picture-in-picture-enter"),this.on(h,["enterpictureinpicture","leavepictureinpicture"],(G)=>this.handlePictureInPictureChange(G)),this.on(h,["disablepictureinpicturechanged","loadedmetadata"],(G)=>this.handlePictureInPictureEnabledChange(G)),this.on(h,["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}if(this.player_.isInPictureInPicture())this.player_.exitPictureInPicture();this.hide()}handlePictureInPictureEnabledChange(){if(T0.default.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in a.default)this.enable();else this.disable()}handlePictureInPictureChange(h){if(this.player_.isInPictureInPicture())this.setIcon("picture-in-picture-exit"),this.controlText("Exit Picture-in-Picture");else this.setIcon("picture-in-picture-enter"),this.controlText("Picture-in-Picture");this.handlePictureInPictureEnabledChange()}handleClick(h){if(!this.player_.isInPictureInPicture())this.player_.requestPictureInPicture();else this.player_.exitPictureInPicture()}show(){if(typeof T0.default.exitPictureInPicture!=="function")return;super.show()}}hB.prototype.controlText_="Picture-in-Picture";z0.registerComponent("PictureInPictureToggle",hB);class _B extends $5{constructor(h,_){super(h,_);if(this.setIcon("fullscreen-enter"),this.on(h,"fullscreenchange",(G)=>this.handleFullscreenChange(G)),T0.default[h.fsApi_.fullscreenEnabled]===!1)this.disable()}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(h){if(this.player_.isFullscreen())this.controlText("Exit Fullscreen"),this.setIcon("fullscreen-exit");else this.controlText("Fullscreen"),this.setIcon("fullscreen-enter")}handleClick(h){if(!this.player_.isFullscreen())this.player_.requestFullscreen();else this.player_.exitFullscreen()}}_B.prototype.controlText_="Fullscreen";z0.registerComponent("FullscreenToggle",_B);var zI=function(h,_){if(_.tech_&&!_.tech_.featuresVolumeControl)h.addClass("vjs-hidden");h.on(_,"loadstart",function(){if(!_.tech_.featuresVolumeControl)h.addClass("vjs-hidden");else h.removeClass("vjs-hidden")})};class rC extends z0{createEl(){let h=super.createEl("div",{className:"vjs-volume-level"});return this.setIcon("circle",h),h.appendChild(super.createEl("span",{className:"vjs-control-text"})),h}}z0.registerComponent("VolumeLevel",rC);class eC extends z0{constructor(h,_){super(h,_);this.update=b3(K2(this,this.update),d4)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(h,_,G,Y){if(!G){let X=kh(this.el_),K=kh(this.player_.el()),Z=h.width*_;if(!K||!X)return;let Q=h.left-K.left+Z,D=h.width-Z+(K.right-h.right),O=X.width/2;if(Q<O)O+=O-Q;else if(D<O)O=D;if(O<0)O=0;else if(O>X.width)O=X.width;this.el_.style.right=`-${O}px`}this.write(`${Y}%`)}write(h){R8(this.el_,h)}updateVolume(h,_,G,Y,X){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{if(this.update(h,_,G,Y.toFixed(0)),X)X()})}}z0.registerComponent("VolumeLevelTooltip",eC);class GB extends z0{constructor(h,_){super(h,_);this.update=b3(K2(this,this.update),d4)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(h,_,G){let Y=100*_;this.getChild("volumeLevelTooltip").updateVolume(h,_,G,Y,()=>{if(G)this.el_.style.bottom=`${h.height*_}px`;else this.el_.style.left=`${h.width*_}px`})}}GB.prototype.options_={children:["volumeLevelTooltip"]};z0.registerComponent("MouseVolumeLevelDisplay",GB);class AY extends ZJ{constructor(h,_){super(h,_);this.on("slideractive",(G)=>this.updateLastVolume_(G)),this.on(h,"volumechange",(G)=>this.updateARIAAttributes(G)),h.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(h){if(!QY(h))return;super.handleMouseDown(h)}handleMouseMove(h){let _=this.getChild("mouseVolumeLevelDisplay");if(_){let G=this.el(),Y=kh(G),X=this.vertical(),K=sZ(G,h);K=X?K.y:K.x,K=OY(K,0,1),_.update(Y,K,X)}if(!QY(h))return;this.checkMuted(),this.player_.volume(this.calculateDistance(h))}checkMuted(){if(this.player_.muted())this.player_.muted(!1)}getPercent(){if(this.player_.muted())return 0;return this.player_.volume()}stepForward(){this.checkMuted(),this.player_.volume(this.player_.volume()+0.1)}stepBack(){this.checkMuted(),this.player_.volume(this.player_.volume()-0.1)}updateARIAAttributes(h){let _=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",_),this.el_.setAttribute("aria-valuetext",_+"%")}volumeAsPercentage_(){return Math.round(this.player_.volume()*100)}updateLastVolume_(){let h=this.player_.volume();this.one("sliderinactive",()=>{if(this.player_.volume()===0)this.player_.lastVolume_(h)})}}AY.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};if(!x5&&!Q3)AY.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay");AY.prototype.playerEvent="volumechange";z0.registerComponent("VolumeBar",AY);class YB extends z0{constructor(h,_={}){if(_.vertical=_.vertical||!1,typeof _.volumeBar>"u"||mh(_.volumeBar))_.volumeBar=_.volumeBar||{},_.volumeBar.vertical=_.vertical;super(h,_);zI(this,h),this.throttledHandleMouseMove=b3(K2(this,this.handleMouseMove),d4),this.handleMouseUpHandler_=(G)=>this.handleMouseUp(G),this.on("mousedown",(G)=>this.handleMouseDown(G)),this.on("touchstart",(G)=>this.handleMouseDown(G)),this.on("mousemove",(G)=>this.handleMouseMove(G)),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 h="vjs-volume-horizontal";if(this.options_.vertical)h="vjs-volume-vertical";return super.createEl("div",{className:`vjs-volume-control vjs-control ${h}`})}handleMouseDown(h){let _=this.el_.ownerDocument;this.on(_,"mousemove",this.throttledHandleMouseMove),this.on(_,"touchmove",this.throttledHandleMouseMove),this.on(_,"mouseup",this.handleMouseUpHandler_),this.on(_,"touchend",this.handleMouseUpHandler_)}handleMouseUp(h){let _=this.el_.ownerDocument;this.off(_,"mousemove",this.throttledHandleMouseMove),this.off(_,"touchmove",this.throttledHandleMouseMove),this.off(_,"mouseup",this.handleMouseUpHandler_),this.off(_,"touchend",this.handleMouseUpHandler_)}handleMouseMove(h){this.volumeBar.handleMouseMove(h)}}YB.prototype.options_={children:["volumeBar"]};z0.registerComponent("VolumeControl",YB);var HI=function(h,_){if(_.tech_&&!_.tech_.featuresMuteControl)h.addClass("vjs-hidden");h.on(_,"loadstart",function(){if(!_.tech_.featuresMuteControl)h.addClass("vjs-hidden");else h.removeClass("vjs-hidden")})};class XB extends $5{constructor(h,_){super(h,_);HI(this,h),this.on(h,["loadstart","volumechange"],(G)=>this.update(G))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(h){let _=this.player_.volume(),G=this.player_.lastVolume_();if(_===0){let Y=G<0.1?0.1:G;this.player_.volume(Y),this.player_.muted(!1)}else this.player_.muted(this.player_.muted()?!1:!0)}update(h){this.updateIcon_(),this.updateControlText_()}updateIcon_(){let h=this.player_.volume(),_=3;if(this.setIcon("volume-high"),x5&&this.player_.tech_&&this.player_.tech_.el_)this.player_.muted(this.player_.tech_.el_.muted);if(h===0||this.player_.muted())this.setIcon("volume-mute"),_=0;else if(h<0.33)this.setIcon("volume-low"),_=1;else if(h<0.67)this.setIcon("volume-medium"),_=2;aZ(this.el_,[0,1,2,3].reduce((G,Y)=>G+`${Y?" ":""}vjs-vol-${Y}`,"")),u7(this.el_,`vjs-vol-${_}`)}updateControlText_(){let _=this.player_.muted()||this.player_.volume()===0?"Unmute":"Mute";if(this.controlText()!==_)this.controlText(_)}}XB.prototype.controlText_="Mute";z0.registerComponent("MuteToggle",XB);class KB extends z0{constructor(h,_={}){if(typeof _.inline<"u")_.inline=_.inline;else _.inline=!0;if(typeof _.volumeControl>"u"||mh(_.volumeControl))_.volumeControl=_.volumeControl||{},_.volumeControl.vertical=!_.inline;super(h,_);this.handleKeyPressHandler_=(G)=>this.handleKeyPress(G),this.on(h,["loadstart"],(G)=>this.volumePanelState_(G)),this.on(this.muteToggle,"keyup",(G)=>this.handleKeyPress(G)),this.on(this.volumeControl,"keyup",(G)=>this.handleVolumeControlKeyUp(G)),this.on("keydown",(G)=>this.handleKeyPress(G)),this.on("mouseover",(G)=>this.handleMouseOver(G)),this.on("mouseout",(G)=>this.handleMouseOut(G)),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_(){if(this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden"))this.addClass("vjs-hidden");if(this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden"))this.addClass("vjs-mute-toggle-only")}createEl(){let h="vjs-volume-panel-horizontal";if(!this.options_.inline)h="vjs-volume-panel-vertical";return super.createEl("div",{className:`vjs-volume-panel vjs-control ${h}`})}dispose(){this.handleMouseOut(),super.dispose()}handleVolumeControlKeyUp(h){if(h.key==="Escape")this.muteToggle.focus()}handleMouseOver(h){this.addClass("vjs-hover"),R4(T0.default,"keyup",this.handleKeyPressHandler_)}handleMouseOut(h){this.removeClass("vjs-hover"),w5(T0.default,"keyup",this.handleKeyPressHandler_)}handleKeyPress(h){if(h.key==="Escape")this.handleMouseOut()}}KB.prototype.options_={children:["muteToggle","volumeControl"]};z0.registerComponent("VolumePanel",KB);class ZB extends $5{constructor(h,_){super(h,_);if(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(h.language())])),this.show();else this.hide()}getSkipForwardTime(){let h=this.options_.playerOptions;return h.controlBar&&h.controlBar.skipButtons&&h.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(h){if(isNaN(this.player_.duration()))return;let _=this.player_.currentTime(),G=this.player_.liveTracker,Y=G&&G.isLive()?G.seekableEnd():this.player_.duration(),X;if(_+this.skipTime<=Y)X=_+this.skipTime;else X=Y;this.player_.currentTime(X)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}ZB.prototype.controlText_="Skip Forward";z0.registerComponent("SkipForward",ZB);class JB extends $5{constructor(h,_){super(h,_);if(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(h.language())])),this.show();else this.hide()}getSkipBackwardTime(){let h=this.options_.playerOptions;return h.controlBar&&h.controlBar.skipButtons&&h.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(h){let _=this.player_.currentTime(),G=this.player_.liveTracker,Y=G&&G.isLive()&&G.seekableStart(),X;if(Y&&_-this.skipTime<=Y)X=Y;else if(_>=this.skipTime)X=_-this.skipTime;else X=0;this.player_.currentTime(X)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}JB.prototype.controlText_="Skip Backward";z0.registerComponent("SkipBackward",JB);class qB extends z0{constructor(h,_){super(h,_);if(_)this.menuButton_=_.menuButton;this.focusedChild_=-1,this.on("keydown",(G)=>this.handleKeyDown(G)),this.boundHandleBlur_=(G)=>this.handleBlur(G),this.boundHandleTapClick_=(G)=>this.handleTapClick(G)}addEventListenerForItem(h){if(!(h instanceof z0))return;this.on(h,"blur",this.boundHandleBlur_),this.on(h,["tap","click"],this.boundHandleTapClick_)}removeEventListenerForItem(h){if(!(h instanceof z0))return;this.off(h,"blur",this.boundHandleBlur_),this.off(h,["tap","click"],this.boundHandleTapClick_)}removeChild(h){if(typeof h==="string")h=this.getChild(h);this.removeEventListenerForItem(h),super.removeChild(h)}addItem(h){let _=this.addChild(h);if(_)this.addEventListenerForItem(_)}createEl(){let h=this.options_.contentElType||"ul";this.contentEl_=h1(h,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");let _=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});return _.appendChild(this.contentEl_),R4(_,"click",function(G){G.preventDefault(),G.stopImmediatePropagation()}),_}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(h){let _=h.relatedTarget||T0.default.activeElement;if(!this.children().some((G)=>{return G.el()===_})){let G=this.menuButton_;if(G&&G.buttonPressed_&&_!==G.el().firstChild)G.unpressButton()}}handleTapClick(h){if(this.menuButton_){this.menuButton_.unpressButton();let _=this.children();if(!Array.isArray(_))return;let G=_.filter((Y)=>Y.el()===h.target)[0];if(!G)return;if(G.name()!=="CaptionSettingsMenuItem")this.menuButton_.focus()}}handleKeyDown(h){if(h.key==="ArrowLeft"||h.key==="ArrowDown")h.preventDefault(),h.stopPropagation(),this.stepForward();else if(h.key==="ArrowRight"||h.key==="ArrowUp")h.preventDefault(),h.stopPropagation(),this.stepBack()}stepForward(){let h=0;if(this.focusedChild_!==void 0)h=this.focusedChild_+1;this.focus(h)}stepBack(){let h=0;if(this.focusedChild_!==void 0)h=this.focusedChild_-1;this.focus(h)}focus(h=0){let _=this.children().slice();if(_.length&&_[0].hasClass("vjs-menu-title"))_.shift();if(_.length>0){if(h<0)h=0;else if(h>=_.length)h=_.length-1;this.focusedChild_=h,_[h].el_.focus()}}}z0.registerComponent("Menu",qB);class QJ extends z0{constructor(h,_={}){super(h,_);this.menuButton_=new $5(h,_),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");let G=$5.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+G,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;let Y=(X)=>this.handleClick(X);this.handleMenuKeyUp_=(X)=>this.handleMenuKeyUp(X),this.on(this.menuButton_,"tap",Y),this.on(this.menuButton_,"click",Y),this.on(this.menuButton_,"keydown",(X)=>this.handleKeyDown(X)),this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover"),this.menu.show(),R4(T0.default,"keyup",this.handleMenuKeyUp_)}),this.on("mouseleave",(X)=>this.handleMouseLeave(X)),this.on("keydown",(X)=>this.handleSubmenuKeyDown(X))}update(){let h=this.createMenu();if(this.menu)this.menu.dispose(),this.removeChild(this.menu);if(this.menu=h,this.addChild(h),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_)this.hide(),this.menu.contentEl_.removeAttribute("role");else this.show(),this.menu.contentEl_.setAttribute("role","menu")}createMenu(){let h=new qB(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){let _=h1("li",{className:"vjs-menu-title",textContent:F2(this.options_.title),tabIndex:-1}),G=new z0(this.player_,{el:_});h.addItem(G)}if(this.items=this.createItems(),this.items)for(let _=0;_<this.items.length;_++)h.addItem(this.items[_]);return h}createItems(){}createEl(){return super.createEl("div",{className:this.buildWrapperCSSClass()},{})}setIcon(h){return super.setIcon(h,this.menuButton_.el_)}buildWrapperCSSClass(){let h="vjs-menu-button";if(this.options_.inline===!0)h+="-inline";else h+="-popup";let _=$5.prototype.buildCSSClass();return`vjs-menu-button ${h} ${_} ${super.buildCSSClass()}`}buildCSSClass(){let h="vjs-menu-button";if(this.options_.inline===!0)h+="-inline";else h+="-popup";return`vjs-menu-button ${h} ${super.buildCSSClass()}`}controlText(h,_=this.menuButton_.el()){return this.menuButton_.controlText(h,_)}dispose(){this.handleMouseLeave(),super.dispose()}handleClick(h){if(this.buttonPressed_)this.unpressButton();else this.pressButton()}handleMouseLeave(h){this.removeClass("vjs-hover"),w5(T0.default,"keyup",this.handleMenuKeyUp_)}focus(){this.menuButton_.focus()}blur(){this.menuButton_.blur()}handleKeyDown(h){if(h.key==="Escape"||h.key==="Tab"){if(this.buttonPressed_)this.unpressButton();if(!h.key==="Tab")h.preventDefault(),this.menuButton_.focus()}else if(h.key==="Up"||h.key==="Down"&&!(this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled)){if(!this.buttonPressed_)h.preventDefault(),this.pressButton()}}handleMenuKeyUp(h){if(h.key==="Escape"||h.key==="Tab")this.removeClass("vjs-hover")}handleSubmenuKeyPress(h){this.handleSubmenuKeyDown(h)}handleSubmenuKeyDown(h){if(h.key==="Escape"||h.key==="Tab"){if(this.buttonPressed_)this.unpressButton();if(!h.key==="Tab")h.preventDefault(),this.menuButton_.focus()}}pressButton(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),x5&&zC())return;this.menu.focus()}}unpressButton(){if(this.enabled_)this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false")}disable(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()}enable(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()}}z0.registerComponent("MenuButton",QJ);class DJ extends QJ{constructor(h,_){let G=_.tracks;super(h,_);if(this.items.length<=1)this.hide();if(!G)return;let Y=K2(this,this.update);G.addEventListener("removetrack",Y),G.addEventListener("addtrack",Y),G.addEventListener("labelchange",Y),this.player_.on("ready",Y),this.player_.on("dispose",function(){G.removeEventListener("removetrack",Y),G.removeEventListener("addtrack",Y),G.removeEventListener("labelchange",Y)})}}z0.registerComponent("TrackButton",DJ);class ah extends BY{constructor(h,_){super(h,_);if(this.selectable=_.selectable,this.isSelected_=_.selected||!1,this.multiSelectable=_.multiSelectable,this.selected(this.isSelected_),this.selectable)if(this.multiSelectable)this.el_.setAttribute("role","menuitemcheckbox");else this.el_.setAttribute("role","menuitemradio");else this.el_.setAttribute("role","menuitem")}createEl(h,_,G){this.nonIconControl=!0;let Y=super.createEl("li",Object.assign({className:"vjs-menu-item",tabIndex:-1},_),G),X=h1("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)});if(this.player_.options_.experimentalSvgIcons)Y.appendChild(X);else Y.replaceChild(X,Y.querySelector(".vjs-icon-placeholder"));return Y}handleKeyDown(h){if(!["Tab","Escape","ArrowUp","ArrowLeft","ArrowRight","ArrowDown"].includes(h.key))super.handleKeyDown(h)}handleClick(h){this.selected(!0)}selected(h){if(this.selectable)if(h)this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0;else this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1}}z0.registerComponent("MenuItem",ah);class th extends ah{constructor(h,_){let G=_.track,Y=h.textTracks();_.label=G.label||G.language||"Unknown",_.selected=G.mode==="showing";super(h,_);this.track=G,this.kinds=(_.kinds||[_.kind||this.track.kind]).filter(Boolean);let X=(...Z)=>{this.handleTracksChange.apply(this,Z)},K=(...Z)=>{this.handleSelectedLanguageChange.apply(this,Z)};if(h.on(["loadstart","texttrackchange"],X),Y.addEventListener("change",X),Y.addEventListener("selectedlanguagechange",K),this.on("dispose",function(){h.off(["loadstart","texttrackchange"],X),Y.removeEventListener("change",X),Y.removeEventListener("selectedlanguagechange",K)}),Y.onchange===void 0){let Z;this.on(["tap","click"],function(){if(typeof a.default.Event!=="object")try{Z=new a.default.Event("change")}catch(Q){}if(!Z)Z=T0.default.createEvent("Event"),Z.initEvent("change",!0,!0);Y.dispatchEvent(Z)})}this.handleTracksChange()}handleClick(h){let _=this.track,G=this.player_.textTracks();if(super.handleClick(h),!G)return;for(let Y=0;Y<G.length;Y++){let X=G[Y];if(this.kinds.indexOf(X.kind)===-1)continue;if(X===_){if(X.mode!=="showing")X.mode="showing"}else if(X.mode!=="disabled")X.mode="disabled"}}handleTracksChange(h){let _=this.track.mode==="showing";if(_!==this.isSelected_)this.selected(_)}handleSelectedLanguageChange(h){if(this.track.mode==="showing"){let _=this.player_.cache_.selectedLanguage;if(_&&_.enabled&&_.language===this.track.language&&_.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}}dispose(){this.track=null,super.dispose()}}z0.registerComponent("TextTrackMenuItem",th);class QB extends th{constructor(h,_){if(_.track={player:h,kind:_.kind,kinds:_.kinds,default:!1,mode:"disabled"},!_.kinds)_.kinds=[_.kind];if(_.label)_.track.label=_.label;else _.track.label=_.kinds.join(" and ")+" off";_.selectable=!0,_.multiSelectable=!1;super(h,_)}handleTracksChange(h){let _=this.player().textTracks(),G=!0;for(let Y=0,X=_.length;Y<X;Y++){let K=_[Y];if(this.options_.kinds.indexOf(K.kind)>-1&&K.mode==="showing"){G=!1;break}}if(G!==this.isSelected_)this.selected(G)}handleSelectedLanguageChange(h){let _=this.player().textTracks(),G=!0;for(let Y=0,X=_.length;Y<X;Y++){let K=_[Y];if(["captions","descriptions","subtitles"].indexOf(K.kind)>-1&&K.mode==="showing"){G=!1;break}}if(G)this.player_.cache_.selectedLanguage={enabled:!1}}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}}z0.registerComponent("OffTextTrackMenuItem",QB);class a7 extends DJ{constructor(h,_={}){_.tracks=h.textTracks();super(h,_)}createItems(h=[],_=th){let G;if(this.label_)G=`${this.label_} off`;h.push(new QB(this.player_,{kinds:this.kinds_,kind:this.kind_,label:G})),this.hideThreshold_+=1;let Y=this.player_.textTracks();if(!Array.isArray(this.kinds_))this.kinds_=[this.kind_];for(let X=0;X<Y.length;X++){let K=Y[X];if(this.kinds_.indexOf(K.kind)>-1){let Z=new _(this.player_,{track:K,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});Z.addClass(`vjs-${K.kind}-menu-item`),h.push(Z)}}return h}}z0.registerComponent("TextTrackButton",a7);class DB extends ah{constructor(h,_){let{track:G,cue:Y}=_,X=h.currentTime();_.selectable=!0,_.multiSelectable=!1,_.label=Y.text,_.selected=Y.startTime<=X&&X<Y.endTime;super(h,_);this.track=G,this.cue=Y}handleClick(h){super.handleClick(),this.player_.currentTime(this.cue.startTime)}}z0.registerComponent("ChaptersTrackMenuItem",DB);class MJ extends a7{constructor(h,_,G){super(h,_,G);this.setIcon("chapters"),this.selectCurrentItem_=()=>{this.items.forEach((Y)=>{Y.selected(this.track_.activeCues[0]===Y.cue)})}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(h){if(h&&h.track&&h.track.kind!=="chapters")return;let _=this.findChaptersTrack();if(_!==this.track_)this.setTrack(_),super.update();else if(!this.items||_&&_.cues&&_.cues.length!==this.items.length)super.update()}setTrack(h){if(this.track_===h)return;if(!this.updateHandler_)this.updateHandler_=this.update.bind(this);if(this.track_){let _=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);if(_)_.removeEventListener("load",this.updateHandler_);this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=h,this.track_){this.track_.mode="hidden";let _=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);if(_)_.addEventListener("load",this.updateHandler_);this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}findChaptersTrack(){let h=this.player_.textTracks()||[];for(let _=h.length-1;_>=0;_--){let G=h[_];if(G.kind===this.kind_)return G}}getMenuCaption(){if(this.track_&&this.track_.label)return this.track_.label;return this.localize(F2(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){let h=[];if(!this.track_)return h;let _=this.track_.cues;if(!_)return h;for(let G=0,Y=_.length;G<Y;G++){let X=_[G],K=new DB(this.player_,{track:this.track_,cue:X});h.push(K)}return h}}MJ.prototype.kind_="chapters";MJ.prototype.controlText_="Chapters";z0.registerComponent("ChaptersButton",MJ);class BJ extends a7{constructor(h,_,G){super(h,_,G);this.setIcon("audio-description");let Y=h.textTracks(),X=K2(this,this.handleTracksChange);Y.addEventListener("change",X),this.on("dispose",function(){Y.removeEventListener("change",X)})}handleTracksChange(h){let _=this.player().textTracks(),G=!1;for(let Y=0,X=_.length;Y<X;Y++){let K=_[Y];if(K.kind!==this.kind_&&K.mode==="showing"){G=!0;break}}if(G)this.disable();else this.enable()}buildCSSClass(){return`vjs-descriptions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-descriptions-button ${super.buildWrapperCSSClass()}`}}BJ.prototype.kind_="descriptions";BJ.prototype.controlText_="Descriptions";z0.registerComponent("DescriptionsButton",BJ);class OJ extends a7{constructor(h,_,G){super(h,_,G);this.setIcon("subtitles")}buildCSSClass(){return`vjs-subtitles-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subtitles-button ${super.buildWrapperCSSClass()}`}}OJ.prototype.kind_="subtitles";OJ.prototype.controlText_="Subtitles";z0.registerComponent("SubtitlesButton",OJ);class AJ extends th{constructor(h,_){_.track={player:h,kind:_.kind,label:_.kind+" settings",selectable:!1,default:!1,mode:"disabled"},_.selectable=!1,_.name="CaptionSettingsMenuItem";super(h,_);this.addClass("vjs-texttrack-settings"),this.controlText(", opens "+_.kind+" settings dialog")}handleClick(h){this.player().getChild("textTrackSettings").open()}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.kind+" settings"),super.handleLanguagechange()}}z0.registerComponent("CaptionSettingsMenuItem",AJ);class zJ extends a7{constructor(h,_,G){super(h,_,G);this.setIcon("captions")}buildCSSClass(){return`vjs-captions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-captions-button ${super.buildWrapperCSSClass()}`}createItems(){let h=[];if(!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings"))h.push(new AJ(this.player_,{kind:this.kind_})),this.hideThreshold_+=1;return super.createItems(h)}}zJ.prototype.kind_="captions";zJ.prototype.controlText_="Captions";z0.registerComponent("CaptionsButton",zJ);class MB extends th{createEl(h,_,G){let Y=super.createEl(h,_,G),X=Y.querySelector(".vjs-menu-item-text");if(this.options_.track.kind==="captions"){if(this.player_.options_.experimentalSvgIcons)this.setIcon("captions",Y);else X.appendChild(h1("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0}));X.appendChild(h1("span",{className:"vjs-control-text",textContent:` ${this.localize("Captions")}`}))}return Y}}z0.registerComponent("SubsCapsMenuItem",MB);class HJ extends a7{constructor(h,_={}){super(h,_);if(this.label_="subtitles",this.setIcon("subtitles"),["en","en-us","en-ca","fr-ca"].indexOf(this.player_.language_)>-1)this.label_="captions",this.setIcon("captions");this.menuButton_.controlText(F2(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let h=[];if(!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings"))h.push(new AJ(this.player_,{kind:this.label_})),this.hideThreshold_+=1;return h=super.createItems(h,MB),h}}HJ.prototype.kinds_=["captions","subtitles"];HJ.prototype.controlText_="Subtitles";z0.registerComponent("SubsCapsButton",HJ);class BB extends ah{constructor(h,_){let G=_.track,Y=h.audioTracks();_.label=G.label||G.language||"Unknown",_.selected=G.enabled;super(h,_);this.track=G,this.addClass(`vjs-${G.kind}-menu-item`);let X=(...K)=>{this.handleTracksChange.apply(this,K)};Y.addEventListener("change",X),this.on("dispose",()=>{Y.removeEventListener("change",X)})}createEl(h,_,G){let Y=super.createEl(h,_,G),X=Y.querySelector(".vjs-menu-item-text");if(["main-desc","descriptions"].indexOf(this.options_.track.kind)>=0)X.appendChild(h1("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),X.appendChild(h1("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}));return Y}handleClick(h){if(super.handleClick(h),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){let _=this.player_.audioTracks();for(let G=0;G<_.length;G++){let Y=_[G];if(Y===this.track)continue;Y.enabled=Y===this.track}}}handleTracksChange(h){this.selected(this.track.enabled)}}z0.registerComponent("AudioTrackMenuItem",BB);class OB extends DJ{constructor(h,_={}){_.tracks=h.audioTracks();super(h,_);this.setIcon("audio")}buildCSSClass(){return`vjs-audio-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-audio-button ${super.buildWrapperCSSClass()}`}createItems(h=[]){this.hideThreshold_=1;let _=this.player_.audioTracks();for(let G=0;G<_.length;G++){let Y=_[G];h.push(new BB(this.player_,{track:Y,selectable:!0,multiSelectable:!1}))}return h}}OB.prototype.controlText_="Audio Track";z0.registerComponent("AudioTrackButton",OB);class VJ extends ah{constructor(h,_){let G=_.rate,Y=parseFloat(G,10);_.label=G,_.selected=Y===h.playbackRate(),_.selectable=!0,_.multiSelectable=!1;super(h,_);this.label=G,this.rate=Y,this.on(h,"ratechange",(X)=>this.update(X))}handleClick(h){super.handleClick(),this.player().playbackRate(this.rate)}update(h){this.selected(this.player().playbackRate()===this.rate)}}VJ.prototype.contentElType="button";z0.registerComponent("PlaybackRateMenuItem",VJ);class AB extends QJ{constructor(h,_){super(h,_);this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(h,"loadstart",(G)=>this.updateVisibility(G)),this.on(h,"ratechange",(G)=>this.updateLabel(G)),this.on(h,"playbackrateschange",(G)=>this.handlePlaybackRateschange(G))}createEl(){let h=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=h1("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),h.appendChild(this.labelEl_),h}dispose(){this.labelEl_=null,super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){let h=this.playbackRates(),_=[];for(let G=h.length-1;G>=0;G--)_.push(new VJ(this.player(),{rate:h[G]+"x"}));return _}handlePlaybackRateschange(h){this.update()}playbackRates(){let h=this.player();return h.playbackRates&&h.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(h){if(this.playbackRateSupported())this.removeClass("vjs-hidden");else this.addClass("vjs-hidden")}updateLabel(h){if(this.playbackRateSupported())this.labelEl_.textContent=this.player().playbackRate()+"x"}}AB.prototype.controlText_="Playback Rate";z0.registerComponent("PlaybackRateMenuButton",AB);class zB extends z0{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(h="div",_={},G={}){if(!_.className)_.className=this.buildCSSClass();return super.createEl(h,_,G)}}z0.registerComponent("Spacer",zB);class hN extends zB{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:" "})}}z0.registerComponent("CustomControlSpacer",hN);class HB extends z0{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}HB.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]};z0.registerComponent("ControlBar",HB);class VB extends c7{constructor(h,_){super(h,_);this.on(h,"error",(G)=>{this.open(G)})}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){let h=this.player().error();return h?this.localize(h.message):""}}VB.prototype.options_=Object.assign({},c7.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0});z0.registerComponent("ErrorDisplay",VB);class UB extends z0{constructor(h,_={}){super(h,_);this.el_.setAttribute("aria-labelledby",this.selectLabelledbyIds)}createEl(){return this.selectLabelledbyIds=[this.options_.legendId,this.options_.labelId].join(" ").trim(),h1("select",{id:this.options_.id},{},this.options_.SelectOptions.map((_)=>{let G=(this.options_.labelId?this.options_.labelId:`vjs-track-option-${c4()}`)+"-"+_[1].replace(/\W+/g,""),Y=h1("option",{id:G,value:this.localize(_[0]),textContent:this.localize(_[1])});return Y.setAttribute("aria-labelledby",`${this.selectLabelledbyIds} ${G}`),Y}))}}z0.registerComponent("TextTrackSelect",UB);class j8 extends z0{constructor(h,_={}){super(h,_);let G=h1("legend",{textContent:this.localize(this.options_.legendText),id:this.options_.legendId});this.el().appendChild(G);let Y=this.options_.selects;for(let X of Y){let K=this.options_.selectConfigs[X],Z=K.className,Q=K.id.replace("%s",this.options_.id_),D=null,O=`vjs_select_${c4()}`;if(this.options_.type==="colors"){D=h1("span",{className:Z});let H=h1("label",{id:Q,className:"vjs-label",textContent:this.localize(K.label)});H.setAttribute("for",O),D.appendChild(H)}let A=new UB(h,{SelectOptions:K.options,legendId:this.options_.legendId,id:O,labelId:Q});if(this.addChild(A),this.options_.type==="colors")D.appendChild(A.el()),this.el().appendChild(D)}}createEl(){return h1("fieldset",{className:this.options_.className})}}z0.registerComponent("TextTrackFieldset",j8);class EB extends z0{constructor(h,_={}){super(h,_);let G=this.options_.textTrackComponentid,Y=new j8(h,{id_:G,legendId:`captions-text-legend-${G}`,legendText:this.localize("Text"),className:"vjs-fg vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(Y);let X=new j8(h,{id_:G,legendId:`captions-background-${G}`,legendText:this.localize("Text Background"),className:"vjs-bg vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(X);let K=new j8(h,{id_:G,legendId:`captions-window-${G}`,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(K)}createEl(){return h1("div",{className:"vjs-track-settings-colors"})}}z0.registerComponent("TextTrackSettingsColors",EB);class CB extends z0{constructor(h,_={}){super(h,_);let G=this.options_.textTrackComponentid,Y=new j8(h,{id_:G,legendId:`captions-font-size-${G}`,legendText:"Font Size",className:"vjs-font-percent vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(Y);let X=new j8(h,{id_:G,legendId:`captions-edge-style-${G}`,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(X);let K=new j8(h,{id_:G,legendId:`captions-font-family-${G}`,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(K)}createEl(){return h1("div",{className:"vjs-track-settings-font"})}}z0.registerComponent("TextTrackSettingsFont",CB);class NB extends z0{constructor(h,_={}){super(h,_);let G=new $5(h,{controlText:this.localize("restore all settings to the default values"),className:"vjs-default-button"});G.el().classList.remove("vjs-control","vjs-button"),G.el().textContent=this.localize("Reset"),this.addChild(G);let Y=this.localize("Done"),X=new $5(h,{controlText:Y,className:"vjs-done-button"});X.el().classList.remove("vjs-control","vjs-button"),X.el().textContent=Y,this.addChild(X)}createEl(){return h1("div",{className:"vjs-track-settings-controls"})}}z0.registerComponent("TrackSettingsControls",NB);var hM="vjs-text-track-settings",SE=["#000","Black"],vE=["#00F","Blue"],xE=["#0FF","Cyan"],wE=["#0F0","Green"],gE=["#F0F","Magenta"],IE=["#F00","Red"],PE=["#FFF","White"],yE=["#FF0","Yellow"],_M=["1","Opaque"],GM=["0.5","Semi-Transparent"],bE=["0","Transparent"],$8={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[SE,PE,IE,wE,vE,yE,gE,xE],className:"vjs-bg-color"},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[_M,GM,bE],className:"vjs-bg-opacity vjs-opacity"},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[PE,SE,IE,wE,vE,yE,gE,xE],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:(h)=>h==="1.00"?null:Number(h)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[_M,GM],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:[bE,GM,_M],className:"vjs-window-opacity vjs-opacity"}};$8.windowColor.options=$8.backgroundColor.options;function _N(h,_){if(_)h=_(h);if(h&&h!=="none")return h}function VI(h,_){let G=h.options[h.options.selectedIndex].value;return _N(G,_)}function UI(h,_,G){if(!_)return;for(let Y=0;Y<h.options.length;Y++)if(_N(h.options[Y].value,G)===_){h.selectedIndex=Y;break}}class GN extends c7{constructor(h,_){_.temporary=!1;super(h,_);if(this.updateDisplay=this.updateDisplay.bind(this),this.fill(),this.hasBeenOpened_=this.hasBeenFilled_=!0,this.renderModalComponents(h),this.endDialog=h1("p",{className:"vjs-control-text",textContent:this.localize("End of dialog window.")}),this.el().appendChild(this.endDialog),this.setDefaults(),_.persistTextTrackSettings===void 0)this.options_.persistTextTrackSettings=this.options_.playerOptions.persistTextTrackSettings;if(this.bindFunctionsToSelectsAndButtons(),this.options_.persistTextTrackSettings)this.restoreSettings()}renderModalComponents(h){let _=new EB(h,{textTrackComponentid:this.id_,selectConfigs:$8,fieldSets:[["color","textOpacity"],["backgroundColor","backgroundOpacity"],["windowColor","windowOpacity"]]});this.addChild(_);let G=new CB(h,{textTrackComponentid:this.id_,selectConfigs:$8,fieldSets:[["fontPercent"],["edgeStyle"],["fontFamily"]]});this.addChild(G);let Y=new NB(h);this.addChild(Y)}bindFunctionsToSelectsAndButtons(){this.on(this.$(".vjs-done-button"),["click","tap"],()=>{this.saveSettings(),this.close()}),this.on(this.$(".vjs-default-button"),["click","tap"],()=>{this.setDefaults(),this.updateDisplay()}),Sh($8,(h)=>{this.on(this.$(h.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 qC($8,(h,_,G)=>{let Y=VI(this.$(_.selector),_.parser);if(Y!==void 0)h[G]=Y;return h},{})}setValues(h){Sh($8,(_,G)=>{UI(this.$(_.selector),h[G],_.parser)})}setDefaults(){Sh($8,(h)=>{let _=h.hasOwnProperty("default")?h.default:0;this.$(h.selector).selectedIndex=_})}restoreSettings(){let h;try{h=JSON.parse(a.default.localStorage.getItem(hM))}catch(_){E1.warn(_)}if(h)this.setValues(h)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;let h=this.getValues();try{if(Object.keys(h).length)a.default.localStorage.setItem(hM,JSON.stringify(h));else a.default.localStorage.removeItem(hM)}catch(_){E1.warn(_)}}updateDisplay(){let h=this.player_.getChild("textTrackDisplay");if(h)h.updateDisplay()}handleLanguagechange(){this.fill(),this.renderModalComponents(this.player_),this.bindFunctionsToSelectsAndButtons()}}z0.registerComponent("TextTrackSettings",GN);class YN extends z0{constructor(h,_){let G=_.ResizeObserver||a.default.ResizeObserver;if(_.ResizeObserver===null)G=!1;let Y=e1({createEl:!G,reportTouchActivity:!1},_);super(h,Y);if(this.ResizeObserver=_.ResizeObserver||a.default.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=xC(()=>{this.resizeHandler()},100,!1,this),G)this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(h.el());else this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;let X=this.debouncedHandler_,K=this.unloadListener_=function(){w5(this,"resize",X),w5(this,"unload",K),K=null};R4(this.el_.contentWindow,"unload",K),R4(this.el_.contentWindow,"resize",X)},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(){if(!this.player_||!this.player_.trigger)return;this.player_.trigger("playerresize")}dispose(){if(this.debouncedHandler_)this.debouncedHandler_.cancel();if(this.resizeObserver_){if(this.player_.el())this.resizeObserver_.unobserve(this.player_.el());this.resizeObserver_.disconnect()}if(this.loadListener_)this.off("load",this.loadListener_);if(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()}}z0.registerComponent("ResizeManager",YN);var EI={trackingThreshold:20,liveTolerance:15};class XN extends z0{constructor(h,_){let G=e1(EI,_,{createEl:!1});super(h,G);this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=(Y)=>this.handlePlay(Y),this.handleFirstTimeupdate_=(Y)=>this.handleFirstTimeupdate(Y),this.handleSeeked_=(Y)=>this.handleSeeked(Y),this.seekToLiveEdge_=(Y)=>this.seekToLiveEdge(Y),this.reset_(),this.on(this.player_,"durationchange",(Y)=>this.handleDurationchange(Y)),this.on(this.player_,"canplay",()=>this.toggleTracking())}trackLive_(){let h=this.player_.seekable();if(!h||!h.length)return;let _=Number(a.default.performance.now().toFixed(4)),G=this.lastTime_===-1?0:(_-this.lastTime_)/1000;this.lastTime_=_,this.pastSeekEnd_=this.pastSeekEnd()+G;let Y=this.liveCurrentTime(),X=this.player_.currentTime(),K=this.player_.paused()||this.seekedBehindLive_||Math.abs(Y-X)>this.options_.liveTolerance;if(!this.timeupdateSeen_||Y===1/0)K=!1;if(K!==this.behindLiveEdge_)this.behindLiveEdge_=K,this.trigger("liveedgechange")}handleDurationchange(){this.toggleTracking()}toggleTracking(){if(this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold){if(this.player_.options_.liveui)this.player_.addClass("vjs-liveui");this.startTracking()}else this.player_.removeClass("vjs-liveui"),this.stopTracking()}startTracking(){if(this.isTracking())return;if(!this.timeupdateSeen_)this.timeupdateSeen_=this.player_.hasStarted();if(this.trackingInterval_=this.setInterval(this.trackLiveHandler_,d4),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),!this.timeupdateSeen_)this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_);else this.on(this.player_,"seeked",this.handleSeeked_)}handleFirstTimeupdate(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){let h=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&h>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(){if(!this.isTracking())return;this.reset_(),this.trigger("liveedgechange")}seekableEnd(){let h=this.player_.seekable(),_=[],G=h?h.length:0;while(G--)_.push(h.end(G));return _.length?_.sort()[_.length-1]:1/0}seekableStart(){let h=this.player_.seekable(),_=[],G=h?h.length:0;while(G--)_.push(h.start(G));return _.length?_.sort()[0]:0}liveWindow(){let h=this.liveCurrentTime();if(h===1/0)return 0;return h-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){let h=this.seekableEnd();if(this.lastSeekEnd_!==-1&&h!==this.lastSeekEnd_)this.pastSeekEnd_=0;return this.lastSeekEnd_=h,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return typeof this.trackingInterval_==="number"}seekToLiveEdge(){if(this.seekedBehindLive_=!1,this.atLiveEdge())return;this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime())}dispose(){this.stopTracking(),super.dispose()}}z0.registerComponent("LiveTracker",XN);class KN extends z0{constructor(h,_){super(h,_);this.on("statechanged",(G)=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:h1("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${c4()}`}),description:h1("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${c4()}`})},h1("div",{className:"vjs-title-bar"},{},QC(this.els))}updateDom_(){let h=this.player_.tech_,_=h&&h.el_,G={title:"aria-labelledby",description:"aria-describedby"};if(["title","description"].forEach((Y)=>{let X=this.state[Y],K=this.els[Y],Z=G[Y];if(nZ(K),X)R8(K,X);if(_){if(_.removeAttribute(Z),X)_.setAttribute(Z,K.id)}}),this.state.title||this.state.description)this.show();else this.hide()}update(h){this.setState(h)}dispose(){let h=this.player_.tech_,_=h&&h.el_;if(_)_.removeAttribute("aria-labelledby"),_.removeAttribute("aria-describedby");super.dispose(),this.els=null}}z0.registerComponent("TitleBar",KN);var CI={initialDisplay:4000,position:[],takeFocus:!1};class ZN extends $5{constructor(h,_){_=e1(CI,_);super(h,_);this.controlText(_.controlText),this.hide(),this.on(this.player_,["useractive","userinactive"],(G)=>{this.removeClass("force-display")})}buildCSSClass(){return`vjs-transient-button focus-visible ${this.options_.position.map((h)=>`vjs-${h}`).join(" ")}`}createEl(){let h=h1("button",{},{type:"button",class:this.buildCSSClass()},h1("span"));return this.controlTextEl_=h.querySelector("span"),h}show(){if(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()}}z0.registerComponent("TransientButton",ZN);var UM=(h)=>{let _=h.el();if(_.hasAttribute("src"))return h.triggerSourceset(_.src),!0;let G=h.$$("source"),Y=[],X="";if(!G.length)return!1;for(let K=0;K<G.length;K++){let Z=G[K].src;if(Z&&Y.indexOf(Z)===-1)Y.push(Z)}if(!Y.length)return!1;if(Y.length===1)X=Y[0];return h.triggerSourceset(X),!0},NI=Object.defineProperty({},"innerHTML",{get(){return this.cloneNode(!0).innerHTML},set(h){let _=T0.default.createElement(this.nodeName.toLowerCase());_.innerHTML=h;let G=T0.default.createDocumentFragment();while(_.childNodes.length)G.appendChild(_.childNodes[0]);return this.innerText="",a.default.Element.prototype.appendChild.call(this,G),this.innerHTML}}),JN=(h,_)=>{let G={};for(let Y=0;Y<h.length;Y++)if(G=Object.getOwnPropertyDescriptor(h[Y],_),G&&G.set&&G.get)break;return G.enumerable=!0,G.configurable=!0,G},$I=(h)=>JN([h.el(),a.default.HTMLMediaElement.prototype,a.default.Element.prototype,NI],"innerHTML"),mE=function(h){let _=h.el();if(_.resetSourceWatch_)return;let G={},Y=$I(h),X=(K)=>(...Z)=>{let Q=K.apply(_,Z);return UM(h),Q};["append","appendChild","insertAdjacentHTML"].forEach((K)=>{if(!_[K])return;G[K]=_[K],_[K]=X(G[K])}),Object.defineProperty(_,"innerHTML",e1(Y,{set:X(Y.set)})),_.resetSourceWatch_=()=>{_.resetSourceWatch_=null,Object.keys(G).forEach((K)=>{_[K]=G[K]}),Object.defineProperty(_,"innerHTML",Y)},h.one("sourceset",_.resetSourceWatch_)},LI=Object.defineProperty({},"src",{get(){if(this.hasAttribute("src"))return uC(a.default.Element.prototype.getAttribute.call(this,"src"));return""},set(h){return a.default.Element.prototype.setAttribute.call(this,"src",h),h}}),jI=(h)=>JN([h.el(),a.default.HTMLMediaElement.prototype,LI],"src"),FI=function(h){if(!h.featuresSourceset)return;let _=h.el();if(_.resetSourceset_)return;let G=jI(h),Y=_.setAttribute,X=_.load;if(Object.defineProperty(_,"src",e1(G,{set:(K)=>{let Z=G.set.call(_,K);return h.triggerSourceset(_.src),Z}})),_.setAttribute=(K,Z)=>{let Q=Y.call(_,K,Z);if(/src/i.test(K))h.triggerSourceset(_.src);return Q},_.load=()=>{let K=X.call(_);if(!UM(h))h.triggerSourceset(""),mE(h);return K},_.currentSrc)h.triggerSourceset(_.currentSrc);else if(!UM(h))mE(h);_.resetSourceset_=()=>{if(_.resetSourceset_=null,_.load=X,_.setAttribute=Y,Object.defineProperty(_,"src",G),_.resetSourceWatch_)_.resetSourceWatch_()}};class m0 extends A1{constructor(h,_){super(h,_);let G=h.source,Y=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&this.el_.tagName==="VIDEO",G&&(this.el_.currentSrc!==G.src||h.tag&&h.tag.initNetworkState_===3))this.setSource(G);else this.handleLateInit_(this.el_);if(h.enableSourceset)this.setupSourcesetHandling_();if(this.isScrubbing_=!1,this.el_.hasChildNodes()){let X=this.el_.childNodes,K=X.length,Z=[];while(K--){let Q=X[K];if(Q.nodeName.toLowerCase()==="track"){if(!this.featuresNativeTextTracks)Z.push(Q);else if(this.remoteTextTrackEls().addTrackElement_(Q),this.remoteTextTracks().addTrack(Q.track),this.textTracks().addTrack(Q.track),!Y&&!this.el_.hasAttribute("crossorigin")&&GJ(Q.src))Y=!0}}for(let Q=0;Q<Z.length;Q++)this.el_.removeChild(Z[Q])}if(this.proxyNativeTracks_(),this.featuresNativeTextTracks&&Y)E1.warn(`Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.
|
|
192
|
-
This may prevent text tracks from loading.`);if(this.restoreMetadataTracksInIOSNativePlayer_(),(JY||cZ)&&h.nativeControlsForTouch===!0)this.setControls(!0);this.proxyWebkitFullscreen_(),this.triggerReady()}dispose(){if(this.el_&&this.el_.resetSourceset_)this.el_.resetSourceset_();m0.disposeMediaElement(this.el_),this.options_=null,super.dispose()}setupSourcesetHandling_(){FI(this)}restoreMetadataTracksInIOSNativePlayer_(){let h=this.textTracks(),_,G=()=>{_=[];for(let X=0;X<h.length;X++){let K=h[X];if(K.kind==="metadata")_.push({track:K,storedMode:K.mode})}};G(),h.addEventListener("change",G),this.on("dispose",()=>h.removeEventListener("change",G));let Y=()=>{for(let X=0;X<_.length;X++){let K=_[X];if(K.track.mode==="disabled"&&K.track.mode!==K.storedMode)K.track.mode=K.storedMode}h.removeEventListener("change",Y)};this.on("webkitbeginfullscreen",()=>{h.removeEventListener("change",G),h.removeEventListener("change",Y),h.addEventListener("change",Y)}),this.on("webkitendfullscreen",()=>{h.removeEventListener("change",G),h.addEventListener("change",G),h.removeEventListener("change",Y)})}overrideNative_(h,_){if(_!==this[`featuresNative${h}Tracks`])return;let G=h.toLowerCase();if(this[`${G}TracksListeners_`])Object.keys(this[`${G}TracksListeners_`]).forEach((Y)=>{this.el()[`${G}Tracks`].removeEventListener(Y,this[`${G}TracksListeners_`][Y])});this[`featuresNative${h}Tracks`]=!_,this[`${G}TracksListeners_`]=null,this.proxyNativeTracksForType_(G)}overrideNativeAudioTracks(h){this.overrideNative_("Audio",h)}overrideNativeVideoTracks(h){this.overrideNative_("Video",h)}proxyNativeTracksForType_(h){let _=i4[h],G=this.el()[_.getterName],Y=this[_.getterName]();if(!this[`featuresNative${_.capitalName}Tracks`]||!G||!G.addEventListener)return;let X={change:(Z)=>{let Q={type:"change",target:Y,currentTarget:Y,srcElement:Y};if(Y.trigger(Q),h==="text")this[ph.remoteText.getterName]().trigger(Q)},addtrack(Z){Y.addTrack(Z.track)},removetrack(Z){Y.removeTrack(Z.track)}},K=function(){let Z=[];for(let Q=0;Q<Y.length;Q++){let D=!1;for(let O=0;O<G.length;O++)if(G[O]===Y[Q]){D=!0;break}if(!D)Z.push(Y[Q])}while(Z.length)Y.removeTrack(Z.shift())};this[_.getterName+"Listeners_"]=X,Object.keys(X).forEach((Z)=>{let Q=X[Z];G.addEventListener(Z,Q),this.on("dispose",(D)=>G.removeEventListener(Z,Q))}),this.on("loadstart",K),this.on("dispose",(Z)=>this.off("loadstart",K))}proxyNativeTracks_(){i4.names.forEach((h)=>{this.proxyNativeTracksForType_(h)})}createEl(){let h=this.options_.tag;if(!h||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(h){let G=h.cloneNode(!0);if(h.parentNode)h.parentNode.insertBefore(G,h);m0.disposeMediaElement(h),h=G}else{h=T0.default.createElement("video");let G=this.options_.tag&&N8(this.options_.tag),Y=e1({},G);if(!JY||this.options_.nativeControlsForTouch!==!0)delete Y.controls;UC(h,Object.assign(Y,{id:this.options_.techId,class:"vjs-tech"}))}h.playerId=this.options_.playerId}if(typeof this.options_.preload<"u")fh(h,"preload",this.options_.preload);if(this.options_.disablePictureInPicture!==void 0)h.disablePictureInPicture=this.options_.disablePictureInPicture;let _=["loop","muted","playsinline","autoplay"];for(let G=0;G<_.length;G++){let Y=_[G],X=this.options_[Y];if(typeof X<"u"){if(X)fh(h,Y,Y);else tZ(h,Y);h[Y]=X}}return h}handleLateInit_(h){if(h.networkState===0||h.networkState===3)return;if(h.readyState===0){let G=!1,Y=function(){G=!0};this.on("loadstart",Y);let X=function(){if(!G)this.trigger("loadstart")};this.on("loadedmetadata",X),this.ready(function(){if(this.off("loadstart",Y),this.off("loadedmetadata",X),!G)this.trigger("loadstart")});return}let _=["loadstart"];if(_.push("loadedmetadata"),h.readyState>=2)_.push("loadeddata");if(h.readyState>=3)_.push("canplay");if(h.readyState>=4)_.push("canplaythrough");this.ready(function(){_.forEach(function(G){this.trigger(G)},this)})}setScrubbing(h){this.isScrubbing_=h}scrubbing(){return this.isScrubbing_}setCurrentTime(h){try{if(this.isScrubbing_&&this.el_.fastSeek&&dZ)this.el_.fastSeek(h);else this.el_.currentTime=h}catch(_){E1(_,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&Q3&&y3&&this.el_.currentTime===0){let h=()=>{if(this.el_.currentTime>0){if(this.el_.duration===1/0)this.trigger("durationchange");this.off("timeupdate",h)}};return this.on("timeupdate",h),NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!("webkitDisplayingFullscreen"in this.el_))return;let h=function(){if(this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls())this.el_.controls=!1},_=function(){if("webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture")this.one("webkitendfullscreen",h),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0})};this.on("webkitbeginfullscreen",_),this.on("dispose",()=>{this.off("webkitbeginfullscreen",_),this.off("webkitendfullscreen",h)})}supportsFullScreen(){return typeof this.el_.webkitEnterFullScreen==="function"}enterFullScreen(){let h=this.el_;if(h.paused&&h.networkState<=h.HAVE_METADATA)x3(this.el_.play()),this.setTimeout(function(){h.pause();try{h.webkitEnterFullScreen()}catch(_){this.trigger("fullscreenerror",_)}},0);else try{h.webkitEnterFullScreen()}catch(_){this.trigger("fullscreenerror",_)}}exitFullScreen(){if(!this.el_.webkitDisplayingFullscreen){this.trigger("fullscreenerror",Error("The video is not fullscreen"));return}this.el_.webkitExitFullScreen()}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(h){if(this.featuresVideoFrameCallback&&!this.el_.webkitKeys)return this.el_.requestVideoFrameCallback(h);return super.requestVideoFrameCallback(h)}cancelVideoFrameCallback(h){if(this.featuresVideoFrameCallback&&!this.el_.webkitKeys)this.el_.cancelVideoFrameCallback(h);else super.cancelVideoFrameCallback(h)}src(h){if(h===void 0)return this.el_.src;this.setSrc(h)}addSourceElement(h,_){if(!h)return E1.error("Invalid source URL."),!1;let G={src:h};if(_)G.type=_;let Y=h1("source",{},G);return this.el_.appendChild(Y),!0}removeSourceElement(h){if(!h)return E1.error("Source URL is required to remove the source element."),!1;let _=this.el_.querySelectorAll("source");for(let G of _)if(G.src===h)return this.el_.removeChild(G),!0;return E1.warn(`No matching source element found with src: ${h}`),!1}reset(){m0.resetMediaElement(this.el_)}currentSrc(){if(this.currentSource_)return this.currentSource_.src;return this.el_.currentSrc}setControls(h){this.el_.controls=!!h}addTextTrack(h,_,G){if(!this.featuresNativeTextTracks)return super.addTextTrack(h,_,G);return this.el_.addTextTrack(h,_,G)}createRemoteTextTrack(h){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(h);let _=T0.default.createElement("track");if(h.kind)_.kind=h.kind;if(h.label)_.label=h.label;if(h.language||h.srclang)_.srclang=h.language||h.srclang;if(h.default)_.default=h.default;if(h.id)_.id=h.id;if(h.src)_.src=h.src;return _}addRemoteTextTrack(h,_){let G=super.addRemoteTextTrack(h,_);if(this.featuresNativeTextTracks)this.el().appendChild(G);return G}removeRemoteTextTrack(h){if(super.removeRemoteTextTrack(h),this.featuresNativeTextTracks){let _=this.$$("track"),G=_.length;while(G--)if(h===_[G]||h===_[G].track)this.el().removeChild(_[G])}}getVideoPlaybackQuality(){if(typeof this.el().getVideoPlaybackQuality==="function")return this.el().getVideoPlaybackQuality();let h={};if(typeof this.el().webkitDroppedFrameCount<"u"&&typeof this.el().webkitDecodedFrameCount<"u")h.droppedVideoFrames=this.el().webkitDroppedFrameCount,h.totalVideoFrames=this.el().webkitDecodedFrameCount;if(a.default.performance)h.creationTime=a.default.performance.now();return h}}pZ(m0,"TEST_VID",function(){if(!lh())return;let h=T0.default.createElement("video"),_=T0.default.createElement("track");return _.kind="captions",_.srclang="en",_.label="English",h.appendChild(_),h});m0.isSupported=function(){try{m0.TEST_VID.volume=0.5}catch(h){return!1}return!!(m0.TEST_VID&&m0.TEST_VID.canPlayType)};m0.canPlayType=function(h){return m0.TEST_VID.canPlayType(h)};m0.canPlaySource=function(h,_){return m0.canPlayType(h.type)};m0.canControlVolume=function(){try{let h=m0.TEST_VID.volume;m0.TEST_VID.volume=h/2+0.1;let _=h!==m0.TEST_VID.volume;if(_&&x5)return a.default.setTimeout(()=>{if(m0&&m0.prototype)m0.prototype.featuresVolumeControl=h!==m0.TEST_VID.volume}),!1;return _}catch(h){return!1}};m0.canMuteVolume=function(){try{let h=m0.TEST_VID.muted;if(m0.TEST_VID.muted=!h,m0.TEST_VID.muted)fh(m0.TEST_VID,"muted","muted");else tZ(m0.TEST_VID,"muted","muted");return h!==m0.TEST_VID.muted}catch(h){return!1}};m0.canControlPlaybackRate=function(){if(Q3&&y3&&lZ<58)return!1;try{let h=m0.TEST_VID.playbackRate;return m0.TEST_VID.playbackRate=h/2+0.1,h!==m0.TEST_VID.playbackRate}catch(h){return!1}};m0.canOverrideAttributes=function(){try{let h=()=>{};Object.defineProperty(T0.default.createElement("video"),"src",{get:h,set:h}),Object.defineProperty(T0.default.createElement("audio"),"src",{get:h,set:h}),Object.defineProperty(T0.default.createElement("video"),"innerHTML",{get:h,set:h}),Object.defineProperty(T0.default.createElement("audio"),"innerHTML",{get:h,set:h})}catch(h){return!1}return!0};m0.supportsNativeTextTracks=function(){return dZ||x5&&y3};m0.supportsNativeVideoTracks=function(){return!!(m0.TEST_VID&&m0.TEST_VID.videoTracks)};m0.supportsNativeAudioTracks=function(){return!!(m0.TEST_VID&&m0.TEST_VID.audioTracks)};m0.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([h,_]){pZ(m0.prototype,h,()=>m0[_](),!0)});m0.prototype.featuresVolumeControl=m0.canControlVolume();m0.prototype.movingMediaElementInDOM=!x5;m0.prototype.featuresFullscreenResize=!0;m0.prototype.featuresProgressEvents=!0;m0.prototype.featuresTimeupdateEvents=!0;m0.prototype.featuresVideoFrameCallback=!!(m0.TEST_VID&&m0.TEST_VID.requestVideoFrameCallback);m0.disposeMediaElement=function(h){if(!h)return;if(h.parentNode)h.parentNode.removeChild(h);while(h.hasChildNodes())h.removeChild(h.firstChild);if(h.removeAttribute("src"),typeof h.load==="function")(function(){try{h.load()}catch(_){}})()};m0.resetMediaElement=function(h){if(!h)return;let _=h.querySelectorAll("source"),G=_.length;while(G--)h.removeChild(_[G]);if(h.removeAttribute("src"),typeof h.load==="function")(function(){try{h.load()}catch(Y){}})()};["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(h){m0.prototype[h]=function(){return this.el_[h]||this.el_.hasAttribute(h)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(h){m0.prototype["set"+F2(h)]=function(_){if(this.el_[h]=_,_)this.el_.setAttribute(h,h);else this.el_.removeAttribute(h)}});["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(h){m0.prototype[h]=function(){return this.el_[h]}});["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(h){m0.prototype["set"+F2(h)]=function(_){this.el_[h]=_}});["pause","load","play"].forEach(function(h){m0.prototype[h]=function(){return this.el_[h]()}});A1.withSourceHandlers(m0);m0.nativeSourceHandler={};m0.nativeSourceHandler.canPlayType=function(h){try{return m0.TEST_VID.canPlayType(h)}catch(_){return""}};m0.nativeSourceHandler.canHandleSource=function(h,_){if(h.type)return m0.nativeSourceHandler.canPlayType(h.type);else if(h.src){let G=cM(h.src);return m0.nativeSourceHandler.canPlayType(`video/${G}`)}return""};m0.nativeSourceHandler.handleSource=function(h,_,G){_.setSrc(h.src)};m0.nativeSourceHandler.dispose=function(){};m0.registerSourceHandler(m0.nativeSourceHandler);A1.registerTech("Html5",m0);var qN=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],YM={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},EM=["tiny","xsmall","small","medium","large","xlarge","huge"],EZ={};EM.forEach((h)=>{let _=h.charAt(0)==="x"?`x-${h.substring(1)}`:h;EZ[h]=`vjs-layout-${_}`});var TI={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};class u1 extends z0{constructor(h,_,G){if(h.id=h.id||_.id||`vjs_video_${c4()}`,_=Object.assign(u1.getTagSettings(h),_),_.initChildren=!1,_.createEl=!1,_.evented=!1,_.reportTouchActivity=!1,!_.language){let K=h.closest("[lang]");if(K)_.language=K.getAttribute("lang")}super(null,_,G);if(this.boundDocumentFullscreenChange_=(K)=>this.documentFullscreenChange_(K),this.boundFullWindowOnEscKey_=(K)=>this.fullWindowOnEscKey(K),this.boundUpdateStyleEl_=(K)=>this.updateStyleEl_(K),this.boundApplyInitTime_=(K)=>this.applyInitTime_(K),this.boundUpdateCurrentBreakpoint_=(K)=>this.updateCurrentBreakpoint_(K),this.boundHandleTechClick_=(K)=>this.handleTechClick_(K),this.boundHandleTechDoubleClick_=(K)=>this.handleTechDoubleClick_(K),this.boundHandleTechTouchStart_=(K)=>this.handleTechTouchStart_(K),this.boundHandleTechTouchMove_=(K)=>this.handleTechTouchMove_(K),this.boundHandleTechTouchEnd_=(K)=>this.handleTechTouchEnd_(K),this.boundHandleTechTap_=(K)=>this.handleTechTap_(K),this.boundUpdatePlayerHeightOnAudioOnlyMode_=(K)=>this.updatePlayerHeightOnAudioOnlyMode_(K),this.isFullscreen_=!1,this.log=ZC(this.id_),this.fsApi_=NZ,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 Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(this.tag=h,this.tagAttributes=h&&N8(h),this.language(this.options_.language),_.languages){let K={};Object.getOwnPropertyNames(_.languages).forEach(function(Z){K[Z.toLowerCase()]=_.languages[Z]}),this.languages_=K}else this.languages_=u1.prototype.options_.languages;if(this.resetCache_(),this.poster_=_.poster||"",this.controls_=!!_.controls,h.controls=!1,h.removeAttribute("controls"),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],h.hasAttribute("autoplay"))this.autoplay(!0);else this.autoplay(this.options_.autoplay);if(_.plugins)Object.keys(_.plugins).forEach((K)=>{if(typeof this[K]!=="function")throw Error(`plugin "${K}" does not exist`)});if(this.scrubbing_=!1,this.el_=this.createEl(),kM(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen)R4(T0.default,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_);if(this.fluid_)this.on(["playerreset","resize"],this.boundUpdateStyleEl_);let Y=e1(this.options_);if(_.plugins)Object.keys(_.plugins).forEach((K)=>{this[K](_.plugins[K])});if(_.debug)this.debug(!0);if(this.options_.playerOptions=Y,this.middleware_=[],this.playbackRates(_.playbackRates),_.experimentalSvgIcons){let Z=new a.default.DOMParser().parseFromString(BI,"image/svg+xml");if(Z.querySelector("parsererror"))E1.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{let D=Z.documentElement;D.style.display="none",this.el_.appendChild(D),this.addClass("vjs-svg-icons-enabled")}}if(this.initChildren(),this.isAudio(h.nodeName.toLowerCase()==="audio"),this.controls())this.addClass("vjs-controls-enabled");else this.addClass("vjs-controls-disabled");if(this.el_.setAttribute("role","region"),this.isAudio())this.el_.setAttribute("aria-label",this.localize("Audio Player"));else this.el_.setAttribute("aria-label",this.localize("Video Player"));if(this.isAudio())this.addClass("vjs-audio");if(_.spatialNavigation&&_.spatialNavigation.enabled)this.spatialNavigation=new lC(this),this.addClass("vjs-spatial-navigation-enabled");if(JY)this.addClass("vjs-touch-enabled");if(!x5)this.addClass("vjs-workinghover");u1.players[this.id_]=this;let X=QM.split(".")[0];this.addClass(`vjs-v${X}`),this.userActive(!0),this.reportUserActivity(),this.one("play",(K)=>this.listenForUserActivity_(K)),this.on("keydown",(K)=>this.handleKeyDown(K)),this.on("languagechange",(K)=>this.handleLanguagechange(K)),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on("ready",()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode)})}dispose(){if(this.trigger("dispose"),this.off("dispose"),w5(T0.default,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),w5(T0.default,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode)this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null;if(u1.players[this.id_]=null,this.tag&&this.tag.player)this.tag.player=null;if(this.el_&&this.el_.player)this.el_.player=null;if(this.tech_)this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_="";if(this.playerElIngest_)this.playerElIngest_=null;if(this.tag)this.tag=null;qI(this),l5.names.forEach((h)=>{let _=l5[h],G=this[_.getterName]();if(G&&G.off)G.off()}),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let h=this.tag,_,G=this.playerElIngest_=h.parentNode&&h.parentNode.hasAttribute&&h.parentNode.hasAttribute("data-vjs-player"),Y=this.tag.tagName.toLowerCase()==="video-js";if(G)_=this.el_=h.parentNode;else if(!Y)_=this.el_=super.createEl("div");let X=N8(h);if(Y){_=this.el_=h,h=this.tag=T0.default.createElement("video");while(_.children.length)h.appendChild(_.firstChild);if(!GY(_,"video-js"))u7(_,"video-js");_.appendChild(h),G=this.playerElIngest_=_,Object.keys(_).forEach((Q)=>{try{h[Q]=_[Q]}catch(D){}})}if(h.setAttribute("tabindex","-1"),X.tabindex="-1",y3&&iZ)h.setAttribute("role","application"),X.role="application";if(h.removeAttribute("width"),h.removeAttribute("height"),"width"in X)delete X.width;if("height"in X)delete X.height;Object.getOwnPropertyNames(X).forEach(function(Q){if(!(Y&&Q==="class"))_.setAttribute(Q,X[Q]);if(Y)h.setAttribute(Q,X[Q])}),h.playerId=h.id,h.id+="_html5_api",h.className="vjs-tech",h.player=_.player=this,this.addClass("vjs-paused");let K=["IS_SMART_TV","IS_TIZEN","IS_WEBOS","IS_ANDROID","IS_IPAD","IS_IPHONE","IS_CHROMECAST_RECEIVER"].filter((Q)=>AC[Q]).map((Q)=>{return"vjs-device-"+Q.substring(3).toLowerCase().replace(/\_/g,"-")});if(this.addClass(...K),a.default.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=SC("vjs-styles-dimensions");let Q=T8(".vjs-styles-defaults"),D=T8("head");D.insertBefore(this.styleEl_,Q?Q.nextSibling:D.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);let Z=h.getElementsByTagName("a");for(let Q=0;Q<Z.length;Q++){let D=Z.item(Q);u7(D,"vjs-hidden"),D.setAttribute("hidden","hidden")}if(h.initNetworkState_=h.networkState,h.parentNode&&!G)h.parentNode.insertBefore(_,h);return MM(h,_),this.children_.unshift(h),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=_,_}crossOrigin(h){if(typeof h>"u")return this.techGet_("crossOrigin");if(h!==null&&h!=="anonymous"&&h!=="use-credentials"){E1.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${h}"`);return}if(this.techCall_("setCrossOrigin",h),this.posterImage)this.posterImage.crossOrigin(h);return}width(h){return this.dimension("width",h)}height(h){return this.dimension("height",h)}dimension(h,_){let G=h+"_";if(_===void 0)return this[G]||0;if(_===""||_==="auto"){this[G]=void 0,this.updateStyleEl_();return}let Y=parseFloat(_);if(isNaN(Y)){E1.error(`Improper value "${_}" supplied for for ${h}`);return}this[G]=Y,this.updateStyleEl_()}fluid(h){if(h===void 0)return!!this.fluid_;if(this.fluid_=!!h,L6(this))this.off(["playerreset","resize"],this.boundUpdateStyleEl_);if(h)this.addClass("vjs-fluid"),this.fill(!1),ug(this,()=>{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)});else this.removeClass("vjs-fluid");this.updateStyleEl_()}fill(h){if(h===void 0)return!!this.fill_;if(this.fill_=!!h,h)this.addClass("vjs-fill"),this.fluid(!1);else this.removeClass("vjs-fill")}aspectRatio(h){if(h===void 0)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(h))throw Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=h,this.fluid(!0),this.updateStyleEl_()}updateStyleEl_(){if(a.default.VIDEOJS_NO_DYNAMIC_STYLE===!0){let Z=typeof this.width_==="number"?this.width_:this.options_.width,Q=typeof this.height_==="number"?this.height_:this.options_.height,D=this.tech_&&this.tech_.el();if(D){if(Z>=0)D.width=Z;if(Q>=0)D.height=Q}return}let h,_,G,Y;if(this.aspectRatio_!==void 0&&this.aspectRatio_!=="auto")G=this.aspectRatio_;else if(this.videoWidth()>0)G=this.videoWidth()+":"+this.videoHeight();else G="16:9";let X=G.split(":"),K=X[1]/X[0];if(this.width_!==void 0)h=this.width_;else if(this.height_!==void 0)h=this.height_/K;else h=this.videoWidth()||300;if(this.height_!==void 0)_=this.height_;else _=h*K;if(/^[^a-zA-Z]/.test(this.id()))Y="dimensions-"+this.id();else Y=this.id()+"-dimensions";this.addClass(Y),vC(this.styleEl_,`
|
|
193
|
-
.${Y} {
|
|
194
|
-
width: ${h}px;
|
|
195
|
-
height: ${_}px;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
.${Y}.vjs-fluid:not(.vjs-audio-only-mode) {
|
|
199
|
-
padding-top: ${K*100}%;
|
|
200
|
-
}
|
|
201
|
-
`)}loadTech_(h,_){if(this.tech_)this.unloadTech_();let G=F2(h),Y=h.charAt(0).toLowerCase()+h.slice(1);if(G!=="Html5"&&this.tag)A1.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null;this.techName_=G,this.isReady_=!1;let X=this.autoplay();if(typeof this.autoplay()==="string"||this.autoplay()===!0&&this.options_.normalizeAutoplay)X=!1;let K={source:_,autoplay:X,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${Y}_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};if(l5.names.forEach((Q)=>{let D=l5[Q];K[D.getterName]=this[D.privateName]}),Object.assign(K,this.options_[G]),Object.assign(K,this.options_[Y]),Object.assign(K,this.options_[h.toLowerCase()]),this.tag)K.tag=this.tag;if(_&&_.src===this.cache_.src&&this.cache_.currentTime>0)K.startTime=this.cache_.currentTime;let Z=A1.getTech(h);if(!Z)throw Error(`No Tech named '${G}' exists! '${G}' should be registered using videojs.registerTech()'`);if(this.tech_=new Z(K),this.tech_.ready(K2(this,this.handleTechReady_),!0),VM.jsonToTextTracks(this.textTracksJson_||[],this.tech_),qN.forEach((Q)=>{this.on(this.tech_,Q,(D)=>this[`handleTech${F2(Q)}_`](D))}),Object.keys(YM).forEach((Q)=>{this.on(this.tech_,Q,(D)=>{if(this.tech_.playbackRate()===0&&this.tech_.seeking()){this.queuedCallbacks_.push({callback:this[`handleTech${YM[Q]}_`].bind(this),event:D});return}this[`handleTech${YM[Q]}_`](D)})}),this.on(this.tech_,"loadstart",(Q)=>this.handleTechLoadStart_(Q)),this.on(this.tech_,"sourceset",(Q)=>this.handleTechSourceset_(Q)),this.on(this.tech_,"waiting",(Q)=>this.handleTechWaiting_(Q)),this.on(this.tech_,"ended",(Q)=>this.handleTechEnded_(Q)),this.on(this.tech_,"seeking",(Q)=>this.handleTechSeeking_(Q)),this.on(this.tech_,"play",(Q)=>this.handleTechPlay_(Q)),this.on(this.tech_,"pause",(Q)=>this.handleTechPause_(Q)),this.on(this.tech_,"durationchange",(Q)=>this.handleTechDurationChange_(Q)),this.on(this.tech_,"fullscreenchange",(Q,D)=>this.handleTechFullscreenChange_(Q,D)),this.on(this.tech_,"fullscreenerror",(Q,D)=>this.handleTechFullscreenError_(Q,D)),this.on(this.tech_,"enterpictureinpicture",(Q)=>this.handleTechEnterPictureInPicture_(Q)),this.on(this.tech_,"leavepictureinpicture",(Q)=>this.handleTechLeavePictureInPicture_(Q)),this.on(this.tech_,"error",(Q)=>this.handleTechError_(Q)),this.on(this.tech_,"posterchange",(Q)=>this.handleTechPosterChange_(Q)),this.on(this.tech_,"textdata",(Q)=>this.handleTechTextData_(Q)),this.on(this.tech_,"ratechange",(Q)=>this.handleTechRateChange_(Q)),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls())this.addTechControlsListeners_();if(this.tech_.el().parentNode!==this.el()&&(G!=="Html5"||!this.tag))MM(this.tech_.el(),this.el());if(this.tag)this.tag.player=null,this.tag=null}unloadTech_(){if(l5.names.forEach((h)=>{let _=l5[h];this[_.privateName]=this[_.getterName]()}),this.textTracksJson_=VM.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_)this.poster_="",this.trigger("posterchange");this.isPosterFromTech_=!1}tech(h){if(h===void 0)E1.warn(`Using the tech directly can be dangerous. I hope you know what you're doing.
|
|
202
|
-
See https://github.com/videojs/video.js/issues/2617 for more info.
|
|
203
|
-
`);return this.tech_}version(){return{"video.js":QM}}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_(){if(this.triggerReady(),this.cache_.volume)this.techCall_("setVolume",this.cache_.volume);this.handleTechPosterChange_(),this.handleTechDurationChange_()}handleTechLoadStart_(){if(this.removeClass("vjs-ended","vjs-seeking"),this.error(null),this.handleTechDurationChange_(),!this.paused())this.trigger("loadstart");else this.hasStarted(!1),this.trigger("loadstart");this.manualAutoplay_(this.autoplay()===!0&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(h){if(!this.tech_||typeof h!=="string")return;let _=()=>{let Y=this.muted();this.muted(!0);let X=()=>{this.muted(Y)};this.playTerminatedQueue_.push(X);let K=this.play();if(!XY(K))return;return K.catch((Z)=>{throw X(),Error(`Rejection at manualAutoplay. Restoring muted value. ${Z?Z:""}`)})},G;if(h==="any"&&!this.muted()){if(G=this.play(),XY(G))G=G.catch(_)}else if(h==="muted"&&!this.muted())G=_();else G=this.play();if(!XY(G))return;return G.then(()=>{this.trigger({type:"autoplay-success",autoplay:h})}).catch(()=>{this.trigger({type:"autoplay-failure",autoplay:h})})}updateSourceCaches_(h=""){let _=h,G="";if(typeof _!=="string")_=h.src,G=h.type;if(this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],_&&!G)G=MI(this,_);this.cache_.source=e1({},h,{src:_,type:G});let Y=this.cache_.sources.filter((Q)=>Q.src&&Q.src===_),X=[],K=this.$$("source"),Z=[];for(let Q=0;Q<K.length;Q++){let D=N8(K[Q]);if(X.push(D),D.src&&D.src===_)Z.push(D.src)}if(Z.length&&!Y.length)this.cache_.sources=X;else if(!Y.length)this.cache_.sources=[this.cache_.source];this.cache_.src=_}handleTechSourceset_(h){if(!this.changingSrc_){let _=(X)=>this.updateSourceCaches_(X),G=this.currentSource().src,Y=h.src;if(G&&!/^blob:/.test(G)&&/^blob:/.test(Y)){if(!this.lastSource_||this.lastSource_.tech!==Y&&this.lastSource_.player!==G)_=()=>{}}if(_(Y),!h.src)this.tech_.any(["sourceset","loadstart"],(X)=>{if(X.type==="sourceset")return;let K=this.techGet_("currentSrc");this.lastSource_.tech=K,this.updateSourceCaches_(K)})}this.lastSource_={player:this.currentSource().src,tech:h.src},this.trigger({src:h.src,type:"sourceset"})}hasStarted(h){if(h===void 0)return this.hasStarted_;if(h===this.hasStarted_)return;if(this.hasStarted_=h,this.hasStarted_)this.addClass("vjs-has-started");else this.removeClass("vjs-has-started")}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")}handleTechRateChange_(){if(this.tech_.playbackRate()>0&&this.cache_.lastPlaybackRate===0)this.queuedCallbacks_.forEach((h)=>h.callback(h.event)),this.queuedCallbacks_=[];this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting"),this.trigger("waiting");let h=this.currentTime(),_=()=>{if(h!==this.currentTime())this.removeClass("vjs-waiting"),this.off("timeupdate",_)};this.on("timeupdate",_)}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_(){if(this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop)this.currentTime(0),this.play();else if(!this.paused())this.pause();this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(h){if(!this.controls_)return;if(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.click===void 0||this.options_.userActions.click!==!1)if(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.click==="function")this.options_.userActions.click.call(this,h);else if(this.paused())x3(this.play());else this.pause()}handleTechDoubleClick_(h){if(!this.controls_)return;if(!Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),(G)=>G.contains(h.target))){if(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.doubleClick===void 0||this.options_.userActions.doubleClick!==!1)if(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.doubleClick==="function")this.options_.userActions.doubleClick.call(this,h);else if(this.isInPictureInPicture()&&!T0.default.pictureInPictureElement)this.exitPictureInPicture();else if(this.isFullscreen())this.exitFullscreen();else this.requestFullscreen()}}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){if(this.userWasActive)this.reportUserActivity()}handleTechTouchEnd_(h){if(h.cancelable)h.preventDefault()}toggleFullscreenClass_(){if(this.isFullscreen())this.addClass("vjs-fullscreen");else this.removeClass("vjs-fullscreen")}documentFullscreenChange_(h){let _=h.target.player;if(_&&_!==this)return;let G=this.el(),Y=T0.default[this.fsApi_.fullscreenElement]===G;if(!Y&&G.matches)Y=G.matches(":"+this.fsApi_.fullscreen);this.isFullscreen(Y)}handleTechFullscreenChange_(h,_){if(_){if(_.nativeIOSFullscreen)this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",()=>{this.removeClass("vjs-ios-native-fs")});this.isFullscreen(_.isFullscreen)}}handleTechFullscreenError_(h,_){this.trigger("fullscreenerror",_)}togglePictureInPictureClass_(){if(this.isInPictureInPicture())this.addClass("vjs-picture-in-picture");else this.removeClass("vjs-picture-in-picture")}handleTechEnterPictureInPicture_(h){this.isInPictureInPicture(!0)}handleTechLeavePictureInPicture_(h){this.isInPictureInPicture(!1)}handleTechError_(){let h=this.tech_.error();if(h)this.error(h)}handleTechTextData_(){let h=null;if(arguments.length>1)h=arguments[1];this.trigger("textdata",h)}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_(h,_){this.ready(function(){if(h in ZI)return XI(this.middleware_,this.tech_,h,_);else if(h in LE)return $E(this.middleware_,this.tech_,h,_);try{if(this.tech_)this.tech_[h](_)}catch(G){throw E1(G),G}},!0)}techGet_(h){if(!this.tech_||!this.tech_.isReady_)return;if(h in KI)return YI(this.middleware_,this.tech_,h);else if(h in LE)return $E(this.middleware_,this.tech_,h);try{return this.tech_[h]()}catch(_){if(this.tech_[h]===void 0)throw E1(`Video.js: ${h} method not defined for ${this.techName_} playback technology.`,_),_;if(_.name==="TypeError")throw E1(`Video.js: ${h} unavailable on ${this.techName_} playback technology element.`,_),this.tech_.isReady_=!1,_;throw E1(_),_}}play(){return new Promise((h)=>{this.play_(h)})}play_(h=x3){this.playCallbacks_.push(h);let _=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc())),G=Boolean(dZ||x5);if(this.waitToPlay_)this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null;if(!this.isReady_||!_){if(this.waitToPlay_=(K)=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),!_&&G)this.load();return}let Y=this.techGet_("play");if(G&&this.hasClass("vjs-ended"))this.resetProgressBar_();if(Y===null)this.runPlayTerminatedQueue_();else this.runPlayCallbacks_(Y)}runPlayTerminatedQueue_(){let h=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],h.forEach(function(_){_()})}runPlayCallbacks_(h){let _=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],_.forEach(function(G){G(h)})}pause(){this.techCall_("pause")}paused(){return this.techGet_("paused")===!1?!1:!0}played(){return this.techGet_("played")||q3(0,0)}scrubbing(h){if(typeof h>"u")return this.scrubbing_;if(this.scrubbing_=!!h,this.techCall_("setScrubbing",this.scrubbing_),h)this.addClass("vjs-scrubbing");else this.removeClass("vjs-scrubbing")}currentTime(h){if(h===void 0)return this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime;if(h<0)h=0;if(!this.isReady_||this.changingSrc_||!this.tech_||!this.tech_.isReady_){this.cache_.initTime=h,this.off("canplay",this.boundApplyInitTime_),this.one("canplay",this.boundApplyInitTime_);return}if(this.techCall_("setCurrentTime",h),this.cache_.initTime=0,isFinite(h))this.cache_.currentTime=Number(h)}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(h){if(h===void 0)return this.cache_.duration!==void 0?this.cache_.duration:NaN;if(h=parseFloat(h),h<0)h=1/0;if(h!==this.cache_.duration){if(this.cache_.duration=h,h===1/0)this.addClass("vjs-live");else this.removeClass("vjs-live");if(!isNaN(h))this.trigger("durationchange")}}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let h=this.techGet_("buffered");if(!h||!h.length)h=q3(0,0);return h}seekable(){let h=this.techGet_("seekable");if(!h||!h.length)h=q3(0,0);return h}seeking(){return this.techGet_("seeking")}ended(){return this.techGet_("ended")}networkState(){return this.techGet_("networkState")}readyState(){return this.techGet_("readyState")}bufferedPercent(){return fC(this.buffered(),this.duration())}bufferedEnd(){let h=this.buffered(),_=this.duration(),G=h.end(h.length-1);if(G>_)G=_;return G}volume(h){let _;if(h!==void 0){if(_=Math.max(0,Math.min(1,h)),this.cache_.volume=_,this.techCall_("setVolume",_),_>0)this.lastVolume_(_);return}return _=parseFloat(this.techGet_("volume")),isNaN(_)?1:_}muted(h){if(h!==void 0){this.techCall_("setMuted",h);return}return this.techGet_("muted")||!1}defaultMuted(h){if(h!==void 0)this.techCall_("setDefaultMuted",h);return this.techGet_("defaultMuted")||!1}lastVolume_(h){if(h!==void 0&&h!==0){this.cache_.lastVolume=h;return}return this.cache_.lastVolume}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(h){if(h!==void 0){let _=this.isFullscreen_;if(this.isFullscreen_=Boolean(h),this.isFullscreen_!==_&&this.fsApi_.prefixed)this.trigger("fullscreenchange");this.toggleFullscreenClass_();return}return this.isFullscreen_}requestFullscreen(h){if(this.isInPictureInPicture())this.exitPictureInPicture();let _=this;return new Promise((G,Y)=>{function X(){_.off("fullscreenerror",Z),_.off("fullscreenchange",K)}function K(){X(),G()}function Z(D,O){X(),Y(O)}_.one("fullscreenchange",K),_.one("fullscreenerror",Z);let Q=_.requestFullscreenHelper_(h);if(Q)Q.then(X,X),Q.then(G,Y)})}requestFullscreenHelper_(h){let _;if(!this.fsApi_.prefixed){if(_=this.options_.fullscreen&&this.options_.fullscreen.options||{},h!==void 0)_=h}if(this.fsApi_.requestFullscreen){let G=this.el_[this.fsApi_.requestFullscreen](_);if(G)G.then(()=>this.isFullscreen(!0),()=>this.isFullscreen(!1));return G}else if(this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow===!0)this.techCall_("enterFullScreen");else this.enterFullWindow()}exitFullscreen(){let h=this;return new Promise((_,G)=>{function Y(){h.off("fullscreenerror",K),h.off("fullscreenchange",X)}function X(){Y(),_()}function K(Q,D){Y(),G(D)}h.one("fullscreenchange",X),h.one("fullscreenerror",K);let Z=h.exitFullscreenHelper_();if(Z)Z.then(Y,Y),Z.then(_,G)})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){let h=T0.default[this.fsApi_.exitFullscreen]();if(h)x3(h.then(()=>this.isFullscreen(!1)));return h}else if(this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow===!0)this.techCall_("exitFullScreen");else this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=T0.default.documentElement.style.overflow,R4(T0.default,"keydown",this.boundFullWindowOnEscKey_),T0.default.documentElement.style.overflow="hidden",u7(T0.default.body,"vjs-full-window"),this.trigger("enterFullWindow")}fullWindowOnEscKey(h){if(h.key==="Escape"){if(this.isFullscreen()===!0)if(!this.isFullWindow)this.exitFullscreen();else this.exitFullWindow()}}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,w5(T0.default,"keydown",this.boundFullWindowOnEscKey_),T0.default.documentElement.style.overflow=this.docOrigOverflow,aZ(T0.default.body,"vjs-full-window"),this.trigger("exitFullWindow")}disablePictureInPicture(h){if(h===void 0)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",h),this.options_.disablePictureInPicture=h,this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(h){if(h!==void 0){this.isInPictureInPicture_=!!h,this.togglePictureInPictureClass_();return}return!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&a.default.documentPictureInPicture){let h=T0.default.createElement(this.el().tagName);if(h.classList=this.el().classList,h.classList.add("vjs-pip-container"),this.posterImage)h.appendChild(this.posterImage.el().cloneNode(!0));if(this.titleBar)h.appendChild(this.titleBar.el().cloneNode(!0));return h.appendChild(h1("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),a.default.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then((_)=>{return TC(_),this.el_.parentNode.insertBefore(h,this.el_),_.document.body.appendChild(this.el_),_.document.body.classList.add("vjs-pip-window"),this.player_.isInPictureInPicture(!0),this.player_.trigger({type:"enterpictureinpicture",pipWindow:_}),_.addEventListener("pagehide",(G)=>{let Y=G.target.querySelector(".video-js");h.parentNode.replaceChild(Y,h),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")}),_})}if("pictureInPictureEnabled"in T0.default&&this.disablePictureInPicture()===!1)return this.techGet_("requestPictureInPicture");return Promise.reject("No PiP mode is available")}exitPictureInPicture(){if(a.default.documentPictureInPicture&&a.default.documentPictureInPicture.window)return a.default.documentPictureInPicture.window.close(),Promise.resolve();if("pictureInPictureEnabled"in T0.default)return T0.default.exitPictureInPicture()}handleKeyDown(h){let{userActions:_}=this.options_;if(!_||!_.hotkeys)return;if(((Y)=>{let X=Y.tagName.toLowerCase();if(Y.isContentEditable)return!0;let K=["button","checkbox","hidden","radio","reset","submit"];if(X==="input")return K.indexOf(Y.type)===-1;return["textarea"].indexOf(X)!==-1})(this.el_.ownerDocument.activeElement))return;if(typeof _.hotkeys==="function")_.hotkeys.call(this,h);else this.handleHotkeys(h)}handleHotkeys(h){let _=this.options_.userActions?this.options_.userActions.hotkeys:{},{fullscreenKey:G=(K)=>h.key.toLowerCase()==="f",muteKey:Y=(K)=>h.key.toLowerCase()==="m",playPauseKey:X=(K)=>h.key.toLowerCase()==="k"||h.key.toLowerCase()===" "}=_;if(G.call(this,h)){h.preventDefault(),h.stopPropagation();let K=z0.getComponent("FullscreenToggle");if(T0.default[this.fsApi_.fullscreenEnabled]!==!1)K.prototype.handleClick.call(this,h)}else if(Y.call(this,h))h.preventDefault(),h.stopPropagation(),z0.getComponent("MuteToggle").prototype.handleClick.call(this,h);else if(X.call(this,h))h.preventDefault(),h.stopPropagation(),z0.getComponent("PlayToggle").prototype.handleClick.call(this,h)}canPlayType(h){let _;for(let G=0,Y=this.options_.techOrder;G<Y.length;G++){let X=Y[G],K=A1.getTech(X);if(!K)K=z0.getComponent(X);if(!K){E1.error(`The "${X}" tech is undefined. Skipped browser support check for that tech.`);continue}if(K.isSupported()){if(_=K.canPlayType(h),_)return _}}return""}selectSource(h){let _=this.options_.techOrder.map((Z)=>{return[Z,A1.getTech(Z)]}).filter(([Z,Q])=>{if(Q)return Q.isSupported();return E1.error(`The "${Z}" tech is undefined. Skipped browser support check for that tech.`),!1}),G=function(Z,Q,D){let O;return Z.some((A)=>{return Q.some((H)=>{if(O=D(A,H),O)return!0})}),O},Y,X=(Z)=>(Q,D)=>Z(D,Q),K=([Z,Q],D)=>{if(Q.canPlaySource(D,this.options_[Z.toLowerCase()]))return{source:D,tech:Z}};if(this.options_.sourceOrder)Y=G(h,_,X(K));else Y=G(_,h,K);return Y||!1}handleSrc_(h,_){if(typeof h>"u")return this.cache_.src||"";if(this.resetRetryOnError_)this.resetRetryOnError_();let G=pC(h);if(!G.length){this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);return}if(this.changingSrc_=!0,!_)this.cache_.sources=G;if(this.updateSourceCaches_(G[0]),_I(this,G[0],(Y,X)=>{if(this.middleware_=X,!_)this.cache_.sources=G;if(this.updateSourceCaches_(Y),this.src_(Y)){if(G.length>1)return this.handleSrc_(G.slice(1));this.changingSrc_=!1,this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),this.triggerReady();return}GI(X,this.tech_)}),G.length>1){let Y=()=>{this.error(null),this.handleSrc_(G.slice(1),!0)},X=()=>{this.off("error",Y)};this.one("error",Y),this.one("playing",X),this.resetRetryOnError_=()=>{this.off("error",Y),this.off("playing",X)}}}src(h){return this.handleSrc_(h,!1)}src_(h){let _=this.selectSource([h]);if(!_)return!0;if(!PC(_.tech,this.techName_))return this.changingSrc_=!0,this.loadTech_(_.tech,_.source),this.tech_.ready(()=>{this.changingSrc_=!1}),!1;return this.ready(function(){if(this.tech_.constructor.prototype.hasOwnProperty("setSource"))this.techCall_("setSource",h);else this.techCall_("src",h.src);this.changingSrc_=!1},!0),!1}addSourceElement(h,_){if(!this.tech_)return!1;return this.tech_.addSourceElement(h,_)}removeSourceElement(h){if(!this.tech_)return!1;return this.tech_.removeSourceElement(h)}load(){if(this.tech_&&this.tech_.vhs){this.src(this.currentSource());return}this.techCall_("load")}reset(){if(this.paused())this.doReset_();else{let h=this.play();x3(h.then(()=>this.doReset_()))}}doReset_(){if(this.tech_)this.tech_.clearTracks("text");if(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});if(L6(this))this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);let{currentTimeDisplay:h,durationDisplay:_,progressControl:G,remainingTimeDisplay:Y}=this.controlBar||{},{seekBar:X}=G||{};if(h)h.updateContent();if(_)_.updateContent();if(Y)Y.updateContent();if(X){if(X.update(),X.loadProgressBar)X.loadProgressBar.update()}}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger("volumechange")}currentSources(){let h=this.currentSource(),_=[];if(Object.keys(h).length!==0)_.push(h);return this.cache_.sources||_}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(h){if(h!==void 0){this.techCall_("setPreload",h),this.options_.preload=h;return}return this.techGet_("preload")}autoplay(h){if(h===void 0)return this.options_.autoplay||!1;let _;if(typeof h==="string"&&/(any|play|muted)/.test(h)||h===!0&&this.options_.normalizeAutoplay)this.options_.autoplay=h,this.manualAutoplay_(typeof h==="string"?h:"play"),_=!1;else if(!h)this.options_.autoplay=!1;else this.options_.autoplay=!0;if(_=typeof _>"u"?this.options_.autoplay:_,this.tech_)this.techCall_("setAutoplay",_)}playsinline(h){if(h!==void 0)this.techCall_("setPlaysinline",h),this.options_.playsinline=h;return this.techGet_("playsinline")}loop(h){if(h!==void 0){this.techCall_("setLoop",h),this.options_.loop=h;return}return this.techGet_("loop")}poster(h){if(h===void 0)return this.poster_;if(!h)h="";if(h===this.poster_)return;this.poster_=h,this.techCall_("setPoster",h),this.isPosterFromTech_=!1,this.trigger("posterchange")}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){let h=this.tech_.poster()||"";if(h!==this.poster_)this.poster_=h,this.isPosterFromTech_=!0,this.trigger("posterchange")}}controls(h){if(h===void 0)return!!this.controls_;if(h=!!h,this.controls_===h)return;if(this.controls_=h,this.usingNativeControls())this.techCall_("setControls",h);if(this.controls_){if(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),!this.usingNativeControls())this.addTechControlsListeners_()}else if(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),!this.usingNativeControls())this.removeTechControlsListeners_()}usingNativeControls(h){if(h===void 0)return!!this.usingNativeControls_;if(h=!!h,this.usingNativeControls_===h)return;if(this.usingNativeControls_=h,this.usingNativeControls_)this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols");else this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")}error(h){if(h===void 0)return this.error_||null;if(F8("beforeerror").forEach((_)=>{let G=_(this,h);if(!(P3(G)&&!Array.isArray(G)||typeof G==="string"||typeof G==="number"||G===null)){this.log.error("please return a value that MediaError expects in beforeerror hooks");return}h=G}),this.options_.suppressNotSupportedError&&h&&h.code===4){let _=function(){this.error(h)};this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],_),this.one("loadstart",function(){this.off(["click","touchstart"],_)});return}if(h===null){if(this.error_=null,this.removeClass("vjs-error"),this.errorDisplay)this.errorDisplay.close();return}this.error_=new C2(h),this.addClass("vjs-error"),E1.error(`(CODE:${this.error_.code} ${C2.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),F8("error").forEach((_)=>_(this,this.error_));return}reportUserActivity(h){this.userActivity_=!0}userActive(h){if(h===void 0)return this.userActive_;if(h=!!h,h===this.userActive_)return;if(this.userActive_=h,this.userActive_){this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),this.trigger("useractive");return}if(this.tech_)this.tech_.one("mousemove",function(_){_.stopPropagation(),_.preventDefault()});this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}listenForUserActivity_(){let h,_,G,Y=K2(this,this.reportUserActivity),X=function(A){if(A.screenX!==_||A.screenY!==G)_=A.screenX,G=A.screenY,Y()},K=function(){Y(),this.clearInterval(h),h=this.setInterval(Y,250)},Z=function(A){Y(),this.clearInterval(h)};this.on("mousedown",K),this.on("mousemove",X),this.on("mouseup",Z),this.on("mouseleave",Z);let Q=this.getChild("controlBar");if(Q&&!x5&&!Q3)Q.on("mouseenter",function(A){if(this.player().options_.inactivityTimeout!==0)this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout;this.player().options_.inactivityTimeout=0}),Q.on("mouseleave",function(A){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout});this.on("keydown",Y),this.on("keyup",Y);let D,O=function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(D);let A=this.options_.inactivityTimeout;if(A<=0)return;D=this.setTimeout(function(){if(!this.userActivity_)this.userActive(!1)},A)};this.setInterval(O,250)}playbackRate(h){if(h!==void 0){this.techCall_("setPlaybackRate",h);return}if(this.tech_&&this.tech_.featuresPlaybackRate)return this.cache_.lastPlaybackRate||this.techGet_("playbackRate");return 1}defaultPlaybackRate(h){if(h!==void 0)return this.techCall_("setDefaultPlaybackRate",h);if(this.tech_&&this.tech_.featuresPlaybackRate)return this.techGet_("defaultPlaybackRate");return 1}isAudio(h){if(h!==void 0){this.isAudio_=!!h;return}return!!this.isAudio_}updatePlayerHeightOnAudioOnlyMode_(){let h=this.getChild("ControlBar");if(!h||this.audioOnlyCache_.controlBarHeight===h.currentHeight())return;this.audioOnlyCache_.controlBarHeight=h.currentHeight(),this.height(this.audioOnlyCache_.controlBarHeight)}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");let h=this.children(),_=this.getChild("ControlBar"),G=_&&_.currentHeight();h.forEach((Y)=>{if(Y===_)return;if(Y.el_&&!Y.hasClass("vjs-hidden"))Y.hide(),this.audioOnlyCache_.hiddenChildren.push(Y)}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.audioOnlyCache_.controlBarHeight=G,this.on("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.height(G),this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode"),this.off("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.audioOnlyCache_.hiddenChildren.forEach((h)=>h.show()),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")}audioOnlyMode(h){if(typeof h!=="boolean"||h===this.audioOnlyMode_)return this.audioOnlyMode_;if(this.audioOnlyMode_=h,h){let _=[];if(this.isInPictureInPicture())_.push(this.exitPictureInPicture());if(this.isFullscreen())_.push(this.exitFullscreen());if(this.audioPosterMode())_.push(this.audioPosterMode(!1));return Promise.all(_).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(h){if(typeof h!=="boolean"||h===this.audioPosterMode_)return this.audioPosterMode_;if(this.audioPosterMode_=h,h){if(this.audioOnlyMode())return this.audioOnlyMode(!1).then(()=>{this.enablePosterModeUI_()});return Promise.resolve().then(()=>{this.enablePosterModeUI_()})}return Promise.resolve().then(()=>{this.disablePosterModeUI_()})}addTextTrack(h,_,G){if(this.tech_)return this.tech_.addTextTrack(h,_,G)}addRemoteTextTrack(h,_){if(this.tech_)return this.tech_.addRemoteTextTrack(h,_)}removeRemoteTextTrack(h={}){let{track:_}=h;if(!_)_=h;if(this.tech_)return this.tech_.removeRemoteTextTrack(_)}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(h){if(h===void 0)return this.language_;if(this.language_!==String(h).toLowerCase()){if(this.language_=String(h).toLowerCase(),L6(this))this.trigger("languagechange")}}languages(){return e1(u1.prototype.options_.languages,this.languages_)}toJSON(){let h=e1(this.options_),_=h.tracks;h.tracks=[];for(let G=0;G<_.length;G++){let Y=_[G];Y=e1(Y),Y.player=void 0,h.tracks[G]=Y}return h}createModal(h,_){_=_||{},_.content=h||"";let G=new c7(this,_);return this.addChild(G),G.on("dispose",()=>{this.removeChild(G)}),G.open(),G}updateCurrentBreakpoint_(){if(!this.responsive())return;let h=this.currentBreakpoint(),_=this.currentWidth();for(let G=0;G<EM.length;G++){let Y=EM[G],X=this.breakpoints_[Y];if(_<=X){if(h===Y)return;if(h)this.removeClass(EZ[h]);this.addClass(EZ[Y]),this.breakpoint_=Y;break}}}removeCurrentBreakpoint_(){let h=this.currentBreakpointClass();if(this.breakpoint_="",h)this.removeClass(h)}breakpoints(h){if(h===void 0)return Object.assign(this.breakpoints_);return this.breakpoint_="",this.breakpoints_=Object.assign({},TI,h),this.updateCurrentBreakpoint_(),Object.assign(this.breakpoints_)}responsive(h){if(h===void 0)return this.responsive_;h=Boolean(h);let _=this.responsive_;if(h===_)return;if(this.responsive_=h,h)this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_();else this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_();return h}currentBreakpoint(){return this.breakpoint_}currentBreakpointClass(){return EZ[this.breakpoint_]||""}loadMedia(h,_){if(!h||typeof h!=="object")return;let G=this.crossOrigin();this.reset(),this.cache_.media=e1(h);let{artist:Y,artwork:X,description:K,poster:Z,src:Q,textTracks:D,title:O}=this.cache_.media;if(!X&&Z)this.cache_.media.artwork=[{src:Z,type:xZ(Z)}];if(G)this.crossOrigin(G);if(Q)this.src(Q);if(Z)this.poster(Z);if(Array.isArray(D))D.forEach((A)=>this.addRemoteTextTrack(A,!1));if(this.titleBar)this.titleBar.update({title:O,description:K||Y||""});this.ready(_)}getMedia(){if(!this.cache_.media){let h=this.poster(),_=this.currentSources(),G=Array.prototype.map.call(this.remoteTextTracks(),(X)=>({kind:X.kind,label:X.label,language:X.language,src:X.src})),Y={src:_,textTracks:G};if(h)Y.poster=h,Y.artwork=[{src:Y.poster,type:xZ(Y.poster)}];return Y}return e1(this.cache_.media)}static getTagSettings(h){let _={sources:[],tracks:[]},G=N8(h),Y=G["data-setup"];if(GY(h,"vjs-fill"))G.fill=!0;if(GY(h,"vjs-fluid"))G.fluid=!0;if(Y!==null)try{Object.assign(G,JSON.parse(Y||"{}"))}catch(X){E1.error("data-setup",X)}if(Object.assign(_,G),h.hasChildNodes()){let X=h.childNodes;for(let K=0,Z=X.length;K<Z;K++){let Q=X[K],D=Q.nodeName.toLowerCase();if(D==="source")_.sources.push(N8(Q));else if(D==="track")_.tracks.push(N8(Q))}}return _}debug(h){if(h===void 0)return this.debugEnabled_;if(h)this.trigger("debugon"),this.previousLogLevel_=this.log.level,this.log.level("debug"),this.debugEnabled_=!0;else this.trigger("debugoff"),this.log.level(this.previousLogLevel_),this.previousLogLevel_=void 0,this.debugEnabled_=!1}playbackRates(h){if(h===void 0)return this.cache_.playbackRates;if(!Array.isArray(h))return;if(!h.every((_)=>typeof _==="number"))return;this.cache_.playbackRates=h,this.trigger("playbackrateschange")}}u1.prototype.videoTracks=()=>{};u1.prototype.audioTracks=()=>{};u1.prototype.textTracks=()=>{};u1.prototype.remoteTextTracks=()=>{};u1.prototype.remoteTextTrackEls=()=>{};l5.names.forEach(function(h){let _=l5[h];u1.prototype[_.getterName]=function(){if(this.tech_)return this.tech_[_.getterName]();return this[_.privateName]=this[_.privateName]||new _.ListClass,this[_.privateName]}});u1.prototype.crossorigin=u1.prototype.crossOrigin;u1.players={};var rG=a.default.navigator;u1.prototype.options_={techOrder:A1.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2000,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:rG&&(rG.languages&&rG.languages[0]||rG.userLanguage||rG.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,disableSeekWhileScrubbingOnSTV:!1};qN.forEach(function(h){u1.prototype[`handleTech${F2(h)}_`]=function(){return this.trigger(h)}});z0.registerComponent("Player",u1);var gZ="plugin",wh="activePlugins_",Wh={},IZ=(h)=>Wh.hasOwnProperty(h),CZ=(h)=>IZ(h)?Wh[h]:void 0,QN=(h,_)=>{h[wh]=h[wh]||{},h[wh][_]=!0},PZ=(h,_,G)=>{let Y=(G?"before":"")+"pluginsetup";h.trigger(Y,_),h.trigger(Y+":"+_.name,_)},WI=function(h,_){let G=function(){PZ(this,{name:h,plugin:_,instance:null},!0);let Y=_.apply(this,arguments);return QN(this,h),PZ(this,{name:h,plugin:_,instance:Y}),Y};return Object.keys(_).forEach(function(Y){G[Y]=_[Y]}),G},fE=(h,_)=>{return _.prototype.name=h,function(...G){PZ(this,{name:h,plugin:_,instance:null},!0);let Y=new _(...[this,...G]);return this[h]=()=>Y,PZ(this,Y.getEventHash()),Y}};class q4{constructor(h){if(this.constructor===q4)throw Error("Plugin must be sub-classed; not directly instantiated.");if(this.player=h,!this.log)this.log=this.player.log.createLogger(this.name);kM(this),delete this.trigger,IC(this,this.constructor.defaultState),QN(h,this.name),this.dispose=this.dispose.bind(this),h.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(h={}){return h.name=this.name,h.plugin=this.constructor,h.instance=this,h}trigger(h,_={}){return ch(this.eventBusEl_,h,this.getEventHash(_))}handleStateChanged(h){}dispose(){let{name:h,player:_}=this;this.trigger("dispose"),this.off(),_.off("dispose",this.dispose),_[wh][h]=!1,this.player=this.state=null,_[h]=fE(h,Wh[h])}static isBasic(h){let _=typeof h==="string"?CZ(h):h;return typeof _==="function"&&!q4.prototype.isPrototypeOf(_.prototype)}static registerPlugin(h,_){if(typeof h!=="string")throw Error(`Illegal plugin name, "${h}", must be a string, was ${typeof h}.`);if(IZ(h))E1.warn(`A plugin named "${h}" already exists. You may want to avoid re-registering plugins!`);else if(u1.prototype.hasOwnProperty(h))throw Error(`Illegal plugin name, "${h}", cannot share a name with an existing player method!`);if(typeof _!=="function")throw Error(`Illegal plugin for "${h}", must be a function, was ${typeof _}.`);if(Wh[h]=_,h!==gZ)if(q4.isBasic(_))u1.prototype[h]=WI(h,_);else u1.prototype[h]=fE(h,_);return _}static deregisterPlugin(h){if(h===gZ)throw Error("Cannot de-register base plugin.");if(IZ(h))delete Wh[h],delete u1.prototype[h]}static getPlugins(h=Object.keys(Wh)){let _;return h.forEach((G)=>{let Y=CZ(G);if(Y)_=_||{},_[G]=Y}),_}static getPluginVersion(h){let _=CZ(h);return _&&_.VERSION||""}}q4.getPlugin=CZ;q4.BASE_PLUGIN_NAME=gZ;q4.registerPlugin(gZ,q4);u1.prototype.usingPlugin=function(h){return!!this[wh]&&this[wh][h]===!0};u1.prototype.hasPlugin=function(h){return!!IZ(h)};function RI(h,_){let G=!1;return function(...Y){if(!G)E1.warn(h);return G=!0,_.apply(this,Y)}}function D3(h,_,G,Y){return RI(`${_} is deprecated and will be removed in ${h}.0; please use ${G} instead.`,Y)}var SI={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"},DN=(h)=>h.indexOf("#")===0?h.slice(1):h;function Y0(h,_,G){let Y=Y0.getPlayer(h);if(Y){if(_)E1.warn(`Player "${h}" is already initialised. Options will not be applied.`);if(G)Y.ready(G);return Y}let X=typeof h==="string"?T8("#"+DN(h)):h;if(!ih(X))throw TypeError("The element or ID supplied is not valid. (videojs)");let Z=("getRootNode"in X?X.getRootNode()instanceof a.default.ShadowRoot:!1)?X.getRootNode():X.ownerDocument.body;if(!X.ownerDocument.defaultView||!Z.contains(X))E1.warn("The element supplied is not included in the DOM");if(_=_||{},_.restoreEl===!0)_.restoreEl=(X.parentNode&&X.parentNode.hasAttribute&&X.parentNode.hasAttribute("data-vjs-player")?X.parentNode:X).cloneNode(!0);return F8("beforesetup").forEach((D)=>{let O=D(X,e1(_));if(!P3(O)||Array.isArray(O)){E1.error("please return an object in beforesetup hooks");return}_=e1(_,O)}),Y=new(z0.getComponent("Player"))(X,_,G),F8("setup").forEach((D)=>D(Y)),Y}Y0.hooks_=N6;Y0.hooks=F8;Y0.hook=Wg;Y0.hookOnce=Rg;Y0.removeHook=KC;if(a.default.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&lh()){let h=T8(".vjs-styles-defaults");if(!h){h=SC("vjs-styles-defaults");let _=T8("head");if(_)_.insertBefore(h,_.firstChild);vC(h,`
|
|
204
|
-
.video-js {
|
|
205
|
-
width: 300px;
|
|
206
|
-
height: 150px;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
.vjs-fluid:not(.vjs-audio-only-mode) {
|
|
210
|
-
padding-top: 56.25%
|
|
211
|
-
}
|
|
212
|
-
`)}}OM(1,Y0);Y0.VERSION=QM;Y0.options=u1.prototype.options_;Y0.getPlayers=()=>u1.players;Y0.getPlayer=(h)=>{let _=u1.players,G;if(typeof h==="string"){let Y=DN(h),X=_[Y];if(X)return X;G=T8("#"+Y)}else G=h;if(ih(G)){let{player:Y,playerId:X}=G;if(Y||_[X])return Y||_[X]}};Y0.getAllPlayers=()=>Object.keys(u1.players).map((h)=>u1.players[h]).filter(Boolean);Y0.players=u1.players;Y0.getComponent=z0.getComponent;Y0.registerComponent=(h,_)=>{if(A1.isTech(_))E1.warn(`The ${h} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`);return z0.registerComponent.call(z0,h,_)};Y0.getTech=A1.getTech;Y0.registerTech=A1.registerTech;Y0.use=hI;Object.defineProperty(Y0,"middleware",{value:{},writeable:!1,enumerable:!0});Object.defineProperty(Y0.middleware,"TERMINATOR",{value:vZ,writeable:!1,enumerable:!0});Y0.browser=AC;Y0.obj=xg;Y0.mergeOptions=D3(9,"videojs.mergeOptions","videojs.obj.merge",e1);Y0.defineLazyProperty=D3(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",pZ);Y0.bind=D3(9,"videojs.bind","native Function.prototype.bind",K2);Y0.registerPlugin=q4.registerPlugin;Y0.deregisterPlugin=q4.deregisterPlugin;Y0.plugin=(h,_)=>{return E1.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),q4.registerPlugin(h,_)};Y0.getPlugins=q4.getPlugins;Y0.getPlugin=q4.getPlugin;Y0.getPluginVersion=q4.getPluginVersion;Y0.addLanguage=function(h,_){return h=(""+h).toLowerCase(),Y0.options.languages=e1(Y0.options.languages,{[h]:_}),Y0.options.languages[h]};Y0.log=E1;Y0.createLogger=ZC;Y0.time=dg;Y0.createTimeRange=D3(9,"videojs.createTimeRange","videojs.time.createTimeRanges",q3);Y0.createTimeRanges=D3(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",q3);Y0.formatTime=D3(9,"videojs.formatTime","videojs.time.formatTime",i7);Y0.setFormatTime=D3(9,"videojs.setFormatTime","videojs.time.setFormatTime",bC);Y0.resetFormatTime=D3(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",mC);Y0.parseUrl=D3(9,"videojs.parseUrl","videojs.url.parseUrl",iM);Y0.isCrossOrigin=D3(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",GJ);Y0.EventTarget=Q4;Y0.any=fM;Y0.on=R4;Y0.one=rZ;Y0.off=w5;Y0.trigger=ch;Y0.xhr=IM.default;Y0.TrackList=W8;Y0.TextTrack=dh;Y0.TextTrackList=hJ;Y0.AudioTrack=dM;Y0.AudioTrackList=pM;Y0.VideoTrack=aM;Y0.VideoTrackList=lM;["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach((h)=>{Y0[h]=function(){return E1.warn(`videojs.${h}() is deprecated; use videojs.dom.${h}() instead`),WC[h].apply(null,arguments)}});Y0.computedStyle=D3(9,"videojs.computedStyle","videojs.dom.computedStyle",uh);Y0.dom=WC;Y0.fn=kg;Y0.num=AI;Y0.str=ig;Y0.url=rg;Y0.Error=SI;/*! @name videojs-contrib-quality-levels @version 4.1.0 @license Apache-2.0 */class MN{constructor(h){let _=this;return _.id=h.id,_.label=_.id,_.width=h.width,_.height=h.height,_.bitrate=h.bandwidth,_.frameRate=h.frameRate,_.enabled_=h.enabled,Object.defineProperty(_,"enabled",{get(){return _.enabled_()},set(G){_.enabled_(G)}}),_}}class DY extends Y0.EventTarget{constructor(){super();let h=this;return h.levels_=[],h.selectedIndex_=-1,Object.defineProperty(h,"selectedIndex",{get(){return h.selectedIndex_}}),Object.defineProperty(h,"length",{get(){return h.levels_.length}}),h[Symbol.iterator]=()=>h.levels_.values(),h}addQualityLevel(h){let _=this.getQualityLevelById(h.id);if(_)return _;let G=this.levels_.length;if(_=new MN(h),!(""+G in this))Object.defineProperty(this,G,{get(){return this.levels_[G]}});return this.levels_.push(_),this.trigger({qualityLevel:_,type:"addqualitylevel"}),_}removeQualityLevel(h){let _=null;for(let G=0,Y=this.length;G<Y;G++)if(this[G]===h){if(_=this.levels_.splice(G,1)[0],this.selectedIndex_===G)this.selectedIndex_=-1;else if(this.selectedIndex_>G)this.selectedIndex_--;break}if(_)this.trigger({qualityLevel:h,type:"removequalitylevel"});return _}getQualityLevelById(h){for(let _=0,G=this.length;_<G;_++){let Y=this[_];if(Y.id===h)return Y}return null}dispose(){this.selectedIndex_=-1,this.levels_.length=0}}DY.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"};for(let h in DY.prototype.allowedEvents_)DY.prototype["on"+h]=null;var BN="4.1.0",vI=function(h,_){let G=h.qualityLevels,Y=new DY,X=function(){Y.dispose(),h.qualityLevels=G,h.off("dispose",X)};return h.on("dispose",X),h.qualityLevels=()=>Y,h.qualityLevels.VERSION=BN,Y},ON=function(h){return vI(this,Y0.obj.merge({},h))};Y0.registerPlugin("qualityLevels",ON);ON.VERSION=BN;/*! @name @videojs/http-streaming @version 3.17.3 @license Apache-2.0 */var Z4=Mh,yZ=(h,_)=>{if(_&&_.responseURL&&h!==_.responseURL)return _.responseURL;return h},a4=(h)=>{if(Y0.log.debug)return Y0.log.debug.bind(Y0,"VHS:",`${h} >`);return function(){}};function p1(...h){let _=Y0.obj||Y0;return(_.merge||_.mergeOptions).apply(_,h)}function Q5(...h){let _=Y0.time||Y0;return(_.createTimeRanges||_.createTimeRanges).apply(_,h)}function xI(h){if(h.length===0)return"Buffered Ranges are empty";let _=`Buffered Ranges:
|
|
213
|
-
`;for(let G=0;G<h.length;G++){let Y=h.start(G),X=h.end(G);_+=`${Y} --> ${X}. Duration (${X-Y})
|
|
214
|
-
`}return _}var w3=0.03333333333333333,g3=w3*3,AN=function(h,_){let G=[],Y;if(h&&h.length){for(Y=0;Y<h.length;Y++)if(_(h.start(Y),h.end(Y)))G.push([h.start(Y),h.end(Y)])}return Q5(G)},Rh=function(h,_){return AN(h,function(G,Y){return G-g3<=_&&Y+g3>=_})},zZ=function(h,_){return AN(h,function(G){return G-w3>=_})},wI=function(h){if(h.length<2)return Q5();let _=[];for(let G=1;G<h.length;G++){let Y=h.end(G-1),X=h.start(G);_.push([Y,X])}return Q5(_)},gI=function(h,_){let G=null,Y=null,X=0,K=[],Z=[];if(!h||!h.length||!_||!_.length)return Q5();let Q=h.length;while(Q--)K.push({time:h.start(Q),type:"start"}),K.push({time:h.end(Q),type:"end"});Q=_.length;while(Q--)K.push({time:_.start(Q),type:"start"}),K.push({time:_.end(Q),type:"end"});K.sort(function(D,O){return D.time-O.time});for(Q=0;Q<K.length;Q++){if(K[Q].type==="start"){if(X++,X===2)G=K[Q].time}else if(K[Q].type==="end"){if(X--,X===1)Y=K[Q].time}if(G!==null&&Y!==null)Z.push([G,Y]),G=null,Y=null}return Q5(Z)},zN=(h)=>{let _=[];if(!h||!h.length)return"";for(let G=0;G<h.length;G++)_.push(h.start(G)+" => "+h.end(G));return _.join(", ")},II=function(h,_,G=1){return((h.length?h.end(h.length-1):0)-_)/G},f7=(h)=>{let _=[];for(let G=0;G<h.length;G++)_.push({start:h.start(G),end:h.end(G)});return _},PI=function(h,_){if(h===_)return!1;if(!h&&_||!_&&h)return!0;if(h.length!==_.length)return!0;for(let G=0;G<h.length;G++)if(h.start(G)!==_.start(G)||h.end(G)!==_.end(G))return!0;return!1},XM=function(h){if(!h||!h.length||!h.end)return;return h.end(h.length-1)},$B=function(h,_){let G=0;if(!h||!h.length)return G;for(let Y=0;Y<h.length;Y++){let X=h.start(Y),K=h.end(Y);if(_>K)continue;if(_>X&&_<=K){G+=K-_;continue}G+=K-X}return G},LB=(h,_)=>{if(!_.preload)return _.duration;let G=0;return(_.parts||[]).forEach(function(Y){G+=Y.duration}),(_.preloadHints||[]).forEach(function(Y){if(Y.type==="PART")G+=h.partTargetDuration}),G},CM=(h)=>(h.segments||[]).reduce((_,G,Y)=>{if(G.parts)G.parts.forEach(function(X,K){_.push({duration:X.duration,segmentIndex:Y,partIndex:K,part:X,segment:G})});else _.push({duration:G.duration,segmentIndex:Y,partIndex:null,segment:G,part:null});return _},[]),HN=(h)=>{let _=h.segments&&h.segments.length&&h.segments[h.segments.length-1];return _&&_.parts||[]},VN=({preloadSegment:h})=>{if(!h)return;let{parts:_,preloadHints:G}=h,Y=(G||[]).reduce((X,K)=>X+(K.type==="PART"?1:0),0);return Y+=_&&_.length?_.length:0,Y},UN=(h,_)=>{if(_.endList)return 0;if(h&&h.suggestedPresentationDelay)return h.suggestedPresentationDelay;let G=HN(_).length>0;if(G&&_.serverControl&&_.serverControl.partHoldBack)return _.serverControl.partHoldBack;else if(G&&_.partTargetDuration)return _.partTargetDuration*3;else if(_.serverControl&&_.serverControl.holdBack)return _.serverControl.holdBack;else if(_.targetDuration)return _.targetDuration*3;return 0},yI=function(h,_){let G=0,Y=_-h.mediaSequence,X=h.segments[Y];if(X){if(typeof X.start<"u")return{result:X.start,precise:!0};if(typeof X.end<"u")return{result:X.end-X.duration,precise:!0}}while(Y--){if(X=h.segments[Y],typeof X.end<"u")return{result:G+X.end,precise:!0};if(G+=LB(h,X),typeof X.start<"u")return{result:G+X.start,precise:!0}}return{result:G,precise:!1}},bI=function(h,_){let G=0,Y,X=_-h.mediaSequence;for(;X<h.segments.length;X++){if(Y=h.segments[X],typeof Y.start<"u")return{result:Y.start-G,precise:!0};if(G+=LB(h,Y),typeof Y.end<"u")return{result:Y.end-G,precise:!0}}return{result:-1,precise:!1}},EN=function(h,_,G){if(typeof _>"u")_=h.mediaSequence+h.segments.length;if(_<h.mediaSequence)return 0;let Y=yI(h,_);if(Y.precise)return Y.result;let X=bI(h,_);if(X.precise)return X.result;return Y.result+G},CN=function(h,_,G){if(!h)return 0;if(typeof G!=="number")G=0;if(typeof _>"u"){if(h.totalDuration)return h.totalDuration;if(!h.endList)return a.default.Infinity}return EN(h,_,G)},KY=function({defaultDuration:h,durationList:_,startIndex:G,endIndex:Y}){let X=0;if(G>Y)[G,Y]=[Y,G];if(G<0){for(let K=G;K<Math.min(0,Y);K++)X+=h;G=0}for(let K=G;K<Y;K++)X+=_[K].duration;return X},NN=function(h,_,G,Y){if(!h||!h.segments)return null;if(h.endList)return CN(h);if(_===null)return null;_=_||0;let X=EN(h,h.mediaSequence+h.segments.length,_);if(G)Y=typeof Y==="number"?Y:UN(null,h),X-=Y;return Math.max(0,X)},mI=function(h,_,G){let X=_||0,K=NN(h,_,!0,G);if(K===null)return Q5();if(K<X)K=X;return Q5(X,K)},fI=function({playlist:h,currentTime:_,startingSegmentIndex:G,startingPartIndex:Y,startTime:X,exactManifestTimings:K}){let Z=_-X,Q=CM(h),D=0;for(let O=0;O<Q.length;O++){let A=Q[O];if(G!==A.segmentIndex)continue;if(typeof Y==="number"&&typeof A.partIndex==="number"&&Y!==A.partIndex)continue;D=O;break}if(Z<0){if(D>0)for(let O=D-1;O>=0;O--){let A=Q[O];if(Z+=A.duration,K){if(Z<0)continue}else if(Z+w3<=0)continue;return{partIndex:A.partIndex,segmentIndex:A.segmentIndex,startTime:X-KY({defaultDuration:h.targetDuration,durationList:Q,startIndex:D,endIndex:O})}}return{partIndex:Q[0]&&Q[0].partIndex||null,segmentIndex:Q[0]&&Q[0].segmentIndex||0,startTime:_}}if(D<0){for(let O=D;O<0;O++)if(Z-=h.targetDuration,Z<0)return{partIndex:Q[0]&&Q[0].partIndex||null,segmentIndex:Q[0]&&Q[0].segmentIndex||0,startTime:_};D=0}for(let O=D;O<Q.length;O++){let A=Q[O];Z-=A.duration;let H=A.duration>w3,C=Z===0,N=H&&Z+w3>=0;if(C||N){if(O!==Q.length-1)continue}if(K){if(Z>0)continue}else if(Z-w3>=0)continue;return{partIndex:A.partIndex,segmentIndex:A.segmentIndex,startTime:X+KY({defaultDuration:h.targetDuration,durationList:Q,startIndex:D,endIndex:O})}}return{segmentIndex:Q[Q.length-1].segmentIndex,partIndex:Q[Q.length-1].partIndex,startTime:_}},$N=function(h){return h.excludeUntil&&h.excludeUntil>Date.now()},jB=function(h){return h.excludeUntil&&h.excludeUntil===1/0},UJ=function(h){let _=$N(h);return!h.disabled&&!_},kI=function(h){return h.disabled},uI=function(h){for(let _=0;_<h.segments.length;_++)if(h.segments[_].key)return!0;return!1},LN=function(h,_){return _.attributes&&_.attributes[h]},pI=function(h,_,G,Y=0){if(!LN("BANDWIDTH",G))return NaN;return(h*G.attributes.BANDWIDTH-Y*8)/_},NM=(h,_)=>{if(h.playlists.length===1)return!0;let G=_.attributes.BANDWIDTH||Number.MAX_VALUE;return h.playlists.filter((Y)=>{if(!UJ(Y))return!1;return(Y.attributes.BANDWIDTH||0)<G}).length===0},FB=(h,_)=>{if(!h&&!_||!h&&_||h&&!_)return!1;if(h===_)return!0;if(h.id&&_.id&&h.id===_.id)return!0;if(h.resolvedUri&&_.resolvedUri&&h.resolvedUri===_.resolvedUri)return!0;if(h.uri&&_.uri&&h.uri===_.uri)return!0;return!1},kE=function(h,_){let G=h&&h.mediaGroups&&h.mediaGroups.AUDIO||{},Y=!1;for(let X in G){for(let K in G[X])if(Y=_(G[X][K]),Y)break;if(Y)break}return!!Y},zY=(h)=>{if(!h||!h.playlists||!h.playlists.length)return kE(h,(G)=>G.playlists&&G.playlists.length||G.uri);for(let _=0;_<h.playlists.length;_++){let G=h.playlists[_],Y=G.attributes&&G.attributes.CODECS;if(Y&&Y.split(",").every((K)=>BD(K)))continue;if(kE(h,(K)=>FB(G,K)))continue;return!1}return!0},J4={liveEdgeDelay:UN,duration:CN,seekable:mI,getMediaInfoForTime:fI,isEnabled:UJ,isDisabled:kI,isExcluded:$N,isIncompatible:jB,playlistEnd:NN,isAes:uI,hasAttribute:LN,estimateSegmentRequestTime:pI,isLowestEnabledRendition:NM,isAudioOnly:zY,playlistMatch:FB,segmentDurationWithParts:LB},{log:jN}=Y0,gh=(h,_)=>{return`${h}-${_}`},FN=(h,_,G)=>{return`placeholder-uri-${h}-${_}-${G}`},lI=({onwarn:h,oninfo:_,manifestString:G,customTagParsers:Y=[],customTagMappers:X=[],llhls:K})=>{let Z=new DD;if(h)Z.on("warn",h);if(_)Z.on("info",_);Y.forEach((O)=>Z.addParser(O)),X.forEach((O)=>Z.addTagMapper(O)),Z.push(G),Z.end();let Q=Z.manifest;if(!K){if(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(O){if(Q.hasOwnProperty(O))delete Q[O]}),Q.segments)Q.segments.forEach(function(O){["parts","preloadHints"].forEach(function(A){if(O.hasOwnProperty(A))delete O[A]})})}if(!Q.targetDuration){let O=10;if(Q.segments&&Q.segments.length)O=Q.segments.reduce((A,H)=>Math.max(A,H.duration),0);if(h)h({message:`manifest has no targetDuration defaulting to ${O}`});Q.targetDuration=O}let D=HN(Q);if(D.length&&!Q.partTargetDuration){let O=D.reduce((A,H)=>Math.max(A,H.duration),0);if(h)h({message:`manifest has no partTargetDuration defaulting to ${O}`}),jN.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.");Q.partTargetDuration=O}return Q},sh=(h,_)=>{if(!h.mediaGroups)return;["AUDIO","SUBTITLES"].forEach((G)=>{if(!h.mediaGroups[G])return;for(let Y in h.mediaGroups[G])for(let X in h.mediaGroups[G][Y]){let K=h.mediaGroups[G][Y][X];_(K,G,Y,X)}})},TN=({playlist:h,uri:_,id:G})=>{if(h.id=G,h.playlistErrors_=0,_)h.uri=_;h.attributes=h.attributes||{}},iI=(h)=>{let _=h.playlists.length;while(_--){let G=h.playlists[_];if(TN({playlist:G,id:gh(_,G.uri)}),G.resolvedUri=Z4(h.uri,G.uri),h.playlists[G.id]=G,h.playlists[G.uri]=G,!G.attributes.BANDWIDTH)jN.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},cI=(h)=>{sh(h,(_)=>{if(_.uri)_.resolvedUri=Z4(h.uri,_.uri)})},dI=(h,_)=>{let G=gh(0,_),Y={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:a.default.location.href,resolvedUri:a.default.location.href,playlists:[{uri:_,id:G,resolvedUri:_,attributes:{}}]};return Y.playlists[G]=Y.playlists[0],Y.playlists[_]=Y.playlists[0],Y},WN=(h,_,G=FN)=>{h.uri=_;for(let X=0;X<h.playlists.length;X++)if(!h.playlists[X].uri){let K=`placeholder-uri-${X}`;h.playlists[X].uri=K}let Y=zY(h);sh(h,(X,K,Z,Q)=>{if(!X.playlists||!X.playlists.length){if(Y&&K==="AUDIO"&&!X.uri)for(let D=0;D<h.playlists.length;D++){let O=h.playlists[D];if(O.attributes&&O.attributes.AUDIO&&O.attributes.AUDIO===Z)return}X.playlists=[U2({},X)]}X.playlists.forEach(function(D,O){let A=G(K,Z,Q,D),H=gh(O,A);if(D.uri)D.resolvedUri=D.resolvedUri||Z4(h.uri,D.uri);else D.uri=O===0?A:H,D.resolvedUri=D.uri;D.id=D.id||H,D.attributes=D.attributes||{},h.playlists[D.id]=D,h.playlists[D.uri]=D})}),iI(h),cI(h)};class $M{constructor(){this.offset_=null,this.pendingDateRanges_=new Map,this.processedDateRanges_=new Map}setOffset(h=[]){if(this.offset_!==null)return;if(!h.length)return;let[_]=h;if(_.programDateTime===void 0)return;this.offset_=_.programDateTime/1000}setPendingDateRanges(h=[]){if(!h.length)return;let[_]=h,G=_.startDate.getTime();this.trimProcessedDateRanges_(G),this.pendingDateRanges_=h.reduce((Y,X)=>{return Y.set(X.id,X),Y},new Map)}processDateRange(h){this.pendingDateRanges_.delete(h.id),this.processedDateRanges_.set(h.id,h)}getDateRangesToProcess(){if(this.offset_===null)return[];let h={},_=[];this.pendingDateRanges_.forEach((G,Y)=>{if(this.processedDateRanges_.has(Y))return;if(G.startTime=G.startDate.getTime()/1000-this.offset_,G.processDateRange=()=>this.processDateRange(G),_.push(G),!G.class)return;if(h[G.class]){let X=h[G.class].push(G);G.classListIndex=X-1}else h[G.class]=[G],G.classListIndex=0});for(let G of _){let Y=h[G.class]||[];if(G.endDate)G.endTime=G.endDate.getTime()/1000-this.offset_;else if(G.endOnNext&&Y[G.classListIndex+1])G.endTime=Y[G.classListIndex+1].startTime;else if(G.duration)G.endTime=G.startTime+G.duration;else if(G.plannedDuration)G.endTime=G.startTime+G.plannedDuration;else G.endTime=G.startTime}return _}trimProcessedDateRanges_(h){new Map(this.processedDateRanges_).forEach((G,Y)=>{if(G.startDate.getTime()<h)this.processedDateRanges_.delete(Y)})}}var RN=22,l7=({requestType:h,request:_,error:G,parseFailure:Y})=>{let X=_.status<200||_.status>299,K=_.status>=400&&_.status<=499,Z={uri:_.uri,requestType:h},Q=X&&!K||Y;if(G&&K)Z.error=U2({},G),Z.errorType=Y0.Error.NetworkRequestFailed;else if(_.aborted)Z.errorType=Y0.Error.NetworkRequestAborted;else if(_.timedout)Z.errorType=Y0.Error.NetworkRequestTimeout;else if(Q){let D=Y?Y0.Error.NetworkBodyParserFailed:Y0.Error.NetworkBadStatus;Z.errorType=D,Z.status=_.status,Z.headers=_.headers}return Z},aI=a4("CodecUtils"),SN=function(h){let _=h.attributes||{};if(_.CODECS)return J3(_.CODECS)},vN=(h,_)=>{let G=_.attributes||{};return h&&h.mediaGroups&&h.mediaGroups.AUDIO&&G.AUDIO&&h.mediaGroups.AUDIO[G.AUDIO]},tI=(h,_)=>{if(!vN(h,_))return!0;let G=_.attributes||{},Y=h.mediaGroups.AUDIO[G.AUDIO];for(let X in Y)if(!Y[X].uri&&!Y[X].playlists)return!0;return!1},MY=function(h){let _={};return h.forEach(({mediaType:G,type:Y,details:X})=>{_[G]=_[G]||[],_[G].push(MD(`${Y}${X}`))}),Object.keys(_).forEach(function(G){if(_[G].length>1){aI(`multiple ${G} codecs found as attributes: ${_[G].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),_[G]=null;return}_[G]=_[G][0]}),_},uE=function(h){let _=0;if(h.audio)_++;if(h.video)_++;return _},ZY=function(h,_){let G=_.attributes||{},Y=MY(SN(_)||[]);if(vN(h,_)&&!Y.audio){if(!tI(h,_)){let X=MY(yV(h,G.AUDIO)||[]);if(X.audio)Y.audio=X.audio}}return Y},{EventTarget:sI}=Y0,nI=(h,_)=>{if(_.endList||!_.serverControl)return h;let G={};if(_.serverControl.canBlockReload){let{preloadSegment:Y}=_,X=_.mediaSequence+_.segments.length;if(Y){let K=Y.parts||[],Z=VN(_)-1;if(Z>-1&&Z!==K.length-1)G._HLS_part=Z;if(Z>-1||K.length)X--}G._HLS_msn=X}if(_.serverControl&&_.serverControl.canSkipUntil)G._HLS_skip=_.serverControl.canSkipDateranges?"v2":"YES";if(Object.keys(G).length){let Y=new a.default.URL(h);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(X){if(!G.hasOwnProperty(X))return;Y.searchParams.set(X,G[X])}),h=Y.toString()}return h},oI=(h,_)=>{if(!h)return _;let G=p1(h,_);if(h.preloadHints&&!_.preloadHints)delete G.preloadHints;if(h.parts&&!_.parts)delete G.parts;else if(h.parts&&_.parts){for(let Y=0;Y<_.parts.length;Y++)if(h.parts&&h.parts[Y])G.parts[Y]=p1(h.parts[Y],_.parts[Y])}if(!h.skipped&&_.skipped)G.skipped=!1;if(h.preload&&!_.preload)G.preload=!1;return G},rI=(h,_,G)=>{let Y=h.slice(),X=_.slice();G=G||0;let K=[],Z;for(let Q=0;Q<X.length;Q++){let D=Y[Q+G],O=X[Q];if(D)Z=D.map||Z,K.push(oI(D,O));else{if(Z&&!O.map)O.map=Z;K.push(O)}}return K},xN=(h,_)=>{if(!h.resolvedUri&&h.uri)h.resolvedUri=Z4(_,h.uri);if(h.key&&!h.key.resolvedUri)h.key.resolvedUri=Z4(_,h.key.uri);if(h.map&&!h.map.resolvedUri)h.map.resolvedUri=Z4(_,h.map.uri);if(h.map&&h.map.key&&!h.map.key.resolvedUri)h.map.key.resolvedUri=Z4(_,h.map.key.uri);if(h.parts&&h.parts.length)h.parts.forEach((G)=>{if(G.resolvedUri)return;G.resolvedUri=Z4(_,G.uri)});if(h.preloadHints&&h.preloadHints.length)h.preloadHints.forEach((G)=>{if(G.resolvedUri)return;G.resolvedUri=Z4(_,G.uri)})},wN=function(h){let _=h.segments||[],G=h.preloadSegment;if(G&&G.parts&&G.parts.length){if(G.preloadHints){for(let Y=0;Y<G.preloadHints.length;Y++)if(G.preloadHints[Y].type==="MAP")return _}G.duration=h.targetDuration,G.preload=!0,_.push(G)}return _},gN=(h,_)=>h===_||h.segments&&_.segments&&h.segments.length===_.segments.length&&h.endList===_.endList&&h.mediaSequence===_.mediaSequence&&h.preloadSegment===_.preloadSegment,LM=(h,_,G=gN)=>{let Y=p1(h,{}),X=Y.playlists[_.id];if(!X)return null;if(G(X,_))return null;_.segments=wN(_);let K=p1(X,_);if(K.preloadSegment&&!_.preloadSegment)delete K.preloadSegment;if(X.segments){if(_.skip){_.segments=_.segments||[];for(let Z=0;Z<_.skip.skippedSegments;Z++)_.segments.unshift({skipped:!0})}K.segments=rI(X.segments,_.segments,_.mediaSequence-X.mediaSequence)}K.segments.forEach((Z)=>{xN(Z,K.resolvedUri)});for(let Z=0;Z<Y.playlists.length;Z++)if(Y.playlists[Z].id===_.id)Y.playlists[Z]=K;return Y.playlists[_.id]=K,Y.playlists[_.uri]=K,sh(h,(Z,Q,D,O)=>{if(!Z.playlists)return;for(let A=0;A<Z.playlists.length;A++)if(_.id===Z.playlists[A].id)Z.playlists[A]=K}),Y},jM=(h,_)=>{let G=h.segments||[],Y=G[G.length-1],X=Y&&Y.parts&&Y.parts[Y.parts.length-1],K=X&&X.duration||Y&&Y.duration;if(_&&K)return K*1000;return(h.partTargetDuration||h.targetDuration||10)*500},pE=(h,_,G)=>{if(!h)return;let Y=[];return h.forEach((X)=>{if(!X.attributes)return;let{BANDWIDTH:K,RESOLUTION:Z,CODECS:Q}=X.attributes;Y.push({id:X.id,bandwidth:K,resolution:Z,codecs:Q})}),{type:_,isLive:G,renditions:Y}};class k7 extends sI{constructor(h,_,G={}){super();if(!h)throw Error("A non-empty playlist URL or object is required");this.logger_=a4("PlaylistLoader");let{withCredentials:Y=!1}=G;this.src=h,this.vhs_=_,this.withCredentials=Y,this.addDateRangesToTextTrack_=G.addDateRangesToTextTrack;let X=_.options_;this.customTagParsers=X&&X.customTagParsers||[],this.customTagMappers=X&&X.customTagMappers||[],this.llhls=X&&X.llhls,this.dateRangesStorage_=new $M,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_),this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){let h=this.media();if(!h)return;this.dateRangesStorage_.setOffset(h.segments),this.dateRangesStorage_.setPendingDateRanges(h.dateRanges);let _=this.dateRangesStorage_.getDateRangesToProcess();if(!_.length||!this.addDateRangesToTextTrack_)return;this.addDateRangesToTextTrack_(_)}handleMediaupdatetimeout_(){if(this.state!=="HAVE_METADATA")return;let h=this.media(),_=Z4(this.main.uri,h.uri);if(this.llhls)_=nI(_,h);this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:_,withCredentials:this.withCredentials,requestType:"hls-playlist"},(G,Y)=>{if(!this.request)return;if(G)return this.playlistRequestError(this.request,this.media(),"HAVE_METADATA");this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})})}playlistRequestError(h,_,G){let{uri:Y,id:X}=_;if(this.request=null,G)this.state=G;this.error={playlist:this.main.playlists[X],status:h.status,message:`HLS playlist request error at URL: ${Y}.`,responseText:h.responseText,code:h.status>=500?4:2,metadata:l7({requestType:h.requestType,request:h,error:h.error})},this.trigger("error")}parseManifest_({url:h,manifestString:_}){try{let G=lI({onwarn:({message:Y})=>this.logger_(`m3u8-parser warn for ${h}: ${Y}`),oninfo:({message:Y})=>this.logger_(`m3u8-parser info for ${h}: ${Y}`),manifestString:_,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls});if(!G.playlists||!G.playlists.length)return G;return this.excludeAudioOnlyVariants(G.playlists),G}catch(G){this.error=G,this.error.metadata={errorType:Y0.Error.StreamingHlsPlaylistParserError,error:G}}}excludeAudioOnlyVariants(h){let _=(G)=>{let Y=G.attributes||{},{width:X,height:K}=Y.RESOLUTION||{};if(X&&K)return!0;let Z=SN(G)||[],Q=MY(Z);return Boolean(Q.video)};if(h.some(_))h.forEach((G)=>{if(!_(G))G.excludeUntil=1/0})}haveMetadata({playlistString:h,playlistObject:_,url:G,id:Y}){this.request=null,this.state="HAVE_METADATA";let X={playlistInfo:{type:"media",uri:G}};this.trigger({type:"playlistparsestart",metadata:X});let K=_||this.parseManifest_({url:G,manifestString:h});K.lastRequest=Date.now(),TN({playlist:K,uri:G,id:Y});let Z=LM(this.main,K);if(this.targetDuration=K.partTargetDuration||K.targetDuration,this.pendingMedia_=null,Z)this.main=Z,this.media_=this.main.playlists[Y];else this.trigger("playlistunchanged");this.updateMediaUpdateTimeout_(jM(this.media(),!!Z)),X.parsedPlaylist=pE(this.main.playlists,X.playlistInfo.type,!this.media_.endList),this.trigger({type:"playlistparsecomplete",metadata:X}),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),a.default.clearTimeout(this.mediaUpdateTimeout),a.default.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new $M,this.off()}stopRequest(){if(this.request){let h=this.request;this.request=null,h.onreadystatechange=null,h.abort()}}media(h,_){if(!h)return this.media_;if(this.state==="HAVE_NOTHING")throw Error("Cannot switch media playlist from "+this.state);if(typeof h==="string"){if(!this.main.playlists[h])throw Error("Unknown playlist URI: "+h);h=this.main.playlists[h]}if(a.default.clearTimeout(this.finalRenditionTimeout),_){let Z=(h.partTargetDuration||h.targetDuration)/2*1000||5000;this.finalRenditionTimeout=a.default.setTimeout(this.media.bind(this,h,!1),Z);return}let G=this.state,Y=!this.media_||h.id!==this.media_.id,X=this.main.playlists[h.id];if(X&&X.endList||h.endList&&h.segments.length){if(this.request)this.request.onreadystatechange=null,this.request.abort(),this.request=null;if(this.state="HAVE_METADATA",this.media_=h,Y)if(this.trigger("mediachanging"),G==="HAVE_MAIN_MANIFEST")this.trigger("loadedmetadata");else this.trigger("mediachange");return}if(this.updateMediaUpdateTimeout_(jM(h,!0)),!Y)return;if(this.state="SWITCHING_MEDIA",this.request){if(h.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}if(this.media_)this.trigger("mediachanging");this.pendingMedia_=h;let K={playlistInfo:{type:"media",uri:h.uri}};this.trigger({type:"playlistrequeststart",metadata:K}),this.request=this.vhs_.xhr({uri:h.resolvedUri,withCredentials:this.withCredentials,requestType:"hls-playlist"},(Z,Q)=>{if(!this.request)return;if(h.lastRequest=Date.now(),h.resolvedUri=yZ(h.resolvedUri,Q),Z)return this.playlistRequestError(this.request,h,G);if(this.trigger({type:"playlistrequestcomplete",metadata:K}),this.haveMetadata({playlistString:Q.responseText,url:h.uri,id:h.id}),G==="HAVE_MAIN_MANIFEST")this.trigger("loadedmetadata");else this.trigger("mediachange")})}pause(){if(this.mediaUpdateTimeout)a.default.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;if(this.stopRequest(),this.state==="HAVE_NOTHING")this.started=!1;if(this.state==="SWITCHING_MEDIA")if(this.media_)this.state="HAVE_METADATA";else this.state="HAVE_MAIN_MANIFEST";else if(this.state==="HAVE_CURRENT_METADATA")this.state="HAVE_METADATA"}load(h){if(this.mediaUpdateTimeout)a.default.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;let _=this.media();if(h){let G=_?(_.partTargetDuration||_.targetDuration)/2*1000:5000;this.mediaUpdateTimeout=a.default.setTimeout(()=>{this.mediaUpdateTimeout=null,this.load()},G);return}if(!this.started){this.start();return}if(_&&!_.endList)this.trigger("mediaupdatetimeout");else this.trigger("loadedplaylist")}updateMediaUpdateTimeout_(h){if(this.mediaUpdateTimeout)a.default.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;if(!this.media()||this.media().endList)return;this.mediaUpdateTimeout=a.default.setTimeout(()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(h)},h)}start(){if(this.started=!0,typeof this.src==="object"){if(!this.src.uri)this.src.uri=a.default.location.href;this.src.resolvedUri=this.src.uri,setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);return}let h={playlistInfo:{type:"multivariant",uri:this.src}};this.trigger({type:"playlistrequeststart",metadata:h}),this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials,requestType:"hls-playlist"},(_,G)=>{if(!this.request)return;if(this.request=null,_){if(this.error={status:G.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:G.responseText,code:2,metadata:l7({requestType:G.requestType,request:G,error:_})},this.state==="HAVE_NOTHING")this.started=!1;return this.trigger("error")}this.trigger({type:"playlistrequestcomplete",metadata:h}),this.src=yZ(this.src,G),this.trigger({type:"playlistparsestart",metadata:h});let Y=this.parseManifest_({manifestString:G.responseText,url:this.src});h.parsedPlaylist=pE(Y.playlists,h.playlistInfo.type,!1),this.trigger({type:"playlistparsecomplete",metadata:h}),this.setupInitialPlaylist(Y)})}srcUri(){return typeof this.src==="string"?this.src:this.src.uri}setupInitialPlaylist(h){if(this.state="HAVE_MAIN_MANIFEST",h.playlists){if(this.main=h,WN(this.main,this.srcUri()),h.playlists.forEach((G)=>{G.segments=wN(G),G.segments.forEach((Y)=>{xN(Y,G.resolvedUri)})}),this.trigger("loadedplaylist"),!this.request)this.media(this.main.playlists[0]);return}let _=this.srcUri()||a.default.location.href;this.main=dI(h,_),this.haveMetadata({playlistObject:h,url:_,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(h,_){let G=this.main,Y=h.ID,X=G.playlists.length;while(X--){let K=G.playlists[X];if(K.attributes["PATHWAY-ID"]===Y){let{resolvedUri:Z,id:Q}=K;if(_){let D=this.createCloneURI_(K.resolvedUri,h),O=gh(Y,D),A=this.createCloneAttributes_(Y,K.attributes),H=this.createClonePlaylist_(K,O,h,A);G.playlists[X]=H,G.playlists[O]=H,G.playlists[D]=H}else G.playlists.splice(X,1);delete G.playlists[Q],delete G.playlists[Z]}}this.updateOrDeleteCloneMedia(h,_)}updateOrDeleteCloneMedia(h,_){let G=this.main,Y=h.ID;if(["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((X)=>{if(!G.mediaGroups[X]||!G.mediaGroups[X][Y])return;for(let K in G.mediaGroups[X])if(K===Y){for(let Z in G.mediaGroups[X][K])G.mediaGroups[X][K][Z].playlists.forEach((D,O)=>{let A=G.playlists[D.id],H=A.id,C=A.resolvedUri;delete G.playlists[H],delete G.playlists[C]});delete G.mediaGroups[X][K]}}),_)this.createClonedMediaGroups_(h)}addClonePathway(h,_={}){let G=this.main,Y=G.playlists.length,X=this.createCloneURI_(_.resolvedUri,h),K=gh(h.ID,X),Z=this.createCloneAttributes_(h.ID,_.attributes),Q=this.createClonePlaylist_(_,K,h,Z);G.playlists[Y]=Q,G.playlists[K]=Q,G.playlists[X]=Q,this.createClonedMediaGroups_(h)}createClonedMediaGroups_(h){let _=h.ID,G=h["BASE-ID"],Y=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((X)=>{if(!Y.mediaGroups[X]||Y.mediaGroups[X][_])return;for(let K in Y.mediaGroups[X]){if(K===G)Y.mediaGroups[X][_]={};else continue;for(let Z in Y.mediaGroups[X][K]){let Q=Y.mediaGroups[X][K][Z];Y.mediaGroups[X][_][Z]=U2({},Q);let D=Y.mediaGroups[X][_][Z],O=this.createCloneURI_(Q.resolvedUri,h);D.resolvedUri=O,D.uri=O,D.playlists=[],Q.playlists.forEach((A,H)=>{let C=Y.playlists[A.id],N=FN(X,_,Z),j=gh(_,N);if(C&&!Y.playlists[j]){let W=this.createClonePlaylist_(C,j,h),S=W.resolvedUri;Y.playlists[j]=W,Y.playlists[S]=W}D.playlists[H]=this.createClonePlaylist_(A,j,h)})}}})}createClonePlaylist_(h,_,G,Y){let X=this.createCloneURI_(h.resolvedUri,G),K={resolvedUri:X,uri:X,id:_};if(h.segments)K.segments=[];if(Y)K.attributes=Y;return p1(h,K)}createCloneURI_(h,_){let G=new URL(h);G.hostname=_["URI-REPLACEMENT"].HOST;let Y=_["URI-REPLACEMENT"].PARAMS;for(let X of Object.keys(Y))G.searchParams.set(X,Y[X]);return G.href}createCloneAttributes_(h,_){let G={["PATHWAY-ID"]:h};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((Y)=>{if(_[Y])G[Y]=h}),G}getKeyIdSet(h){let _=new Set;if(!h||!h.contentProtection)return _;for(let G in h.contentProtection)if(h.contentProtection[G]&&h.contentProtection[G].attributes&&h.contentProtection[G].attributes.keyId){let Y=h.contentProtection[G].attributes.keyId;_.add(Y.toLowerCase())}return _}}var FM=function(h,_,G,Y){let X=h.responseType==="arraybuffer"?h.response:h.responseText;if(!_&&X){if(h.responseTime=Date.now(),h.roundTripTime=h.responseTime-h.requestTime,h.bytesReceived=X.byteLength||X.length,!h.bandwidth)h.bandwidth=Math.floor(h.bytesReceived/h.roundTripTime*8*1000)}if(G.headers)h.responseHeaders=G.headers;if(_&&_.code==="ETIMEDOUT")h.timedout=!0;if(!_&&!h.aborted&&G.statusCode!==200&&G.statusCode!==206&&G.statusCode!==0)_=Error("XHR Failed with a response of: "+(h&&(X||h.responseText)));Y(_,h)},eI=(h,_)=>{if(!h||!h.size)return;let G=_;return h.forEach((Y)=>{G=Y(G)}),G},hP=(h,_,G,Y)=>{if(!h||!h.size)return;h.forEach((X)=>{X(_,G,Y)})},IN=function(){let h=function _(G,Y){G=p1({timeout:45000},G);let X=_.beforeRequest||Y0.Vhs.xhr.beforeRequest,K=_._requestCallbackSet||Y0.Vhs.xhr._requestCallbackSet||new Set,Z=_._responseCallbackSet||Y0.Vhs.xhr._responseCallbackSet;if(X&&typeof X==="function")Y0.log.warn("beforeRequest is deprecated, use onRequest instead."),K.add(X);let Q=Y0.Vhs.xhr.original===!0?Y0.xhr:Y0.Vhs.xhr,D=eI(K,G);K.delete(X);let O=Q(D||G,function(H,C){return hP(Z,O,H,C),FM(O,H,C,Y)}),A=O.abort;return O.abort=function(){return O.aborted=!0,A.apply(O,arguments)},O.uri=G.uri,O.requestType=G.requestType,O.requestTime=Date.now(),O};return h.original=!0,h},_P=function(h){let _,G=h.offset;if(typeof h.offset==="bigint"||typeof h.length==="bigint")_=a.default.BigInt(h.offset)+a.default.BigInt(h.length)-a.default.BigInt(1);else _=h.offset+h.length-1;return"bytes="+G+"-"+_},TM=function(h){let _={};if(h.byterange)_.Range=_P(h.byterange);return _},GP=function(h,_){return h.start(_)+"-"+h.end(_)},YP=function(h,_){let G=h.toString(16);return"00".substring(0,2-G.length)+G+(_%2?" ":"")},XP=function(h){if(h>=32&&h<126)return String.fromCharCode(h);return"."},PN=function(h){let _={};return Object.keys(h).forEach((G)=>{let Y=h[G];if(HD(Y))_[G]={bytes:Y.buffer,byteOffset:Y.byteOffset,byteLength:Y.byteLength};else _[G]=Y}),_},bZ=function(h){let _=h.byterange||{length:1/0,offset:0};return[_.length,_.offset,h.resolvedUri].join(",")},yN=function(h){return h.resolvedUri},bN=(h)=>{let _=Array.prototype.slice.call(h),G=16,Y="",X,K;for(let Z=0;Z<_.length/16;Z++)X=_.slice(Z*16,Z*16+16).map(YP).join(""),K=_.slice(Z*16,Z*16+16).map(XP).join(""),Y+=X+" "+K+`
|
|
215
|
-
`;return Y},KP=({bytes:h})=>bN(h),ZP=(h)=>{let _="",G;for(G=0;G<h.length;G++)_+=GP(h,G)+" ";return _},JP=Object.freeze({__proto__:null,createTransferableMessage:PN,initSegmentId:bZ,segmentKeyId:yN,hexDump:bN,tagDump:KP,textRanges:ZP}),mN=0.25,qP=(h,_)=>{if(!_.dateTimeObject)return null;let G=_.videoTimingInfo.transmuxerPrependedSeconds,X=_.videoTimingInfo.transmuxedPresentationStart+G,K=h-X;return new Date(_.dateTimeObject.getTime()+K*1000)},QP=(h)=>{return h.transmuxedPresentationEnd-h.transmuxedPresentationStart-h.transmuxerPrependedSeconds},DP=(h,_)=>{let G;try{G=new Date(h)}catch(D){return null}if(!_||!_.segments||_.segments.length===0)return null;let Y=_.segments[0];if(G<new Date(Y.dateTimeObject))return null;for(let D=0;D<_.segments.length-1;D++){Y=_.segments[D];let O=new Date(_.segments[D+1].dateTimeObject);if(G<O)break}let X=_.segments[_.segments.length-1],K=X.dateTimeObject,Z=X.videoTimingInfo?QP(X.videoTimingInfo):X.duration+X.duration*mN,Q=new Date(K.getTime()+Z*1000);if(G>Q)return null;if(G>new Date(K))Y=X;return{segment:Y,estimatedStart:Y.videoTimingInfo?Y.videoTimingInfo.transmuxedPresentationStart:J4.duration(_,_.mediaSequence+_.segments.indexOf(Y)),type:Y.videoTimingInfo?"accurate":"estimate"}},MP=(h,_)=>{if(!_||!_.segments||_.segments.length===0)return null;let G=0,Y;for(let K=0;K<_.segments.length;K++)if(Y=_.segments[K],G=Y.videoTimingInfo?Y.videoTimingInfo.transmuxedPresentationEnd:G+Y.duration,h<=G)break;let X=_.segments[_.segments.length-1];if(X.videoTimingInfo&&X.videoTimingInfo.transmuxedPresentationEnd<h)return null;if(h>G){if(h>G+X.duration*mN)return null;Y=X}return{segment:Y,estimatedStart:Y.videoTimingInfo?Y.videoTimingInfo.transmuxedPresentationStart:G-Y.duration,type:Y.videoTimingInfo?"accurate":"estimate"}},BP=(h,_)=>{let G,Y;try{G=new Date(h),Y=new Date(_)}catch(Z){}let X=G.getTime();return(Y.getTime()-X)/1000},OP=(h)=>{if(!h.segments||h.segments.length===0)return!1;for(let _=0;_<h.segments.length;_++)if(!h.segments[_].dateTimeObject)return!1;return!0},AP=({playlist:h,time:_=void 0,callback:G})=>{if(!G)throw Error("getProgramTime: callback must be provided");if(!h||_===void 0)return G({message:"getProgramTime: playlist and time must be provided"});let Y=MP(_,h);if(!Y)return G({message:"valid programTime was not found"});if(Y.type==="estimate")return G({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:Y.estimatedStart});let X={mediaSeconds:_},K=qP(_,Y.segment);if(K)X.programDateTime=K.toISOString();return G(null,X)},fN=({programTime:h,playlist:_,retryCount:G=2,seekTo:Y,pauseAfterSeek:X=!0,tech:K,callback:Z})=>{if(!Z)throw Error("seekToProgramTime: callback must be provided");if(typeof h>"u"||!_||!Y)return Z({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!_.endList&&!K.hasStarted_)return Z({message:"player must be playing a live stream to start buffering"});if(!OP(_))return Z({message:"programDateTime tags must be provided in the manifest "+_.resolvedUri});let Q=DP(h,_);if(!Q)return Z({message:`${h} was not found in the stream`});let D=Q.segment,O=BP(D.dateTimeObject,h);if(Q.type==="estimate"){if(G===0)return Z({message:`${h} is not buffered yet. Try again`});Y(Q.estimatedStart+O),K.one("seeked",()=>{fN({programTime:h,playlist:_,retryCount:G-1,seekTo:Y,pauseAfterSeek:X,tech:K,callback:Z})});return}let A=D.start+O,H=()=>{return Z(null,K.currentTime())};if(K.one("seeked",H),X)K.pause();Y(A)},KM=(h,_)=>{if(h.readyState===4)return _();return},zP=(h,_,G,Y)=>{let X=[],K,Z=!1,Q=function(H,C,N,j){return C.abort(),Z=!0,G(H,C,N,j)},D=function(H,C){if(Z)return;if(H)return H.metadata=l7({requestType:Y,request:C,error:H}),Q(H,C,"",X);let N=C.responseText.substring(X&&X.byteLength||0,C.responseText.length);if(X=kV(X,rK(N,!0)),K=K||P7(X),X.length<10||K&&X.length<K+2)return KM(C,()=>Q(H,C,"",X));let j=BZ(X);if(j==="ts"&&X.length<188)return KM(C,()=>Q(H,C,"",X));if(!j&&X.length<376)return KM(C,()=>Q(H,C,"",X));return Q(null,C,j,X)},A=_({uri:h,beforeSend(H){H.overrideMimeType("text/plain; charset=x-user-defined"),H.addEventListener("progress",function({total:C,loaded:N}){return FM(H,null,{statusCode:H.status},D)})}},function(H,C){return FM(A,H,C,D)});return A},{EventTarget:HP}=Y0,lE=function(h,_){if(!gN(h,_))return!1;if(h.sidx&&_.sidx&&(h.sidx.offset!==_.sidx.offset||h.sidx.length!==_.sidx.length))return!1;else if(!h.sidx&&_.sidx||h.sidx&&!_.sidx)return!1;if(h.segments&&!_.segments||!h.segments&&_.segments)return!1;if(!h.segments&&!_.segments)return!0;for(let G=0;G<h.segments.length;G++){let Y=h.segments[G],X=_.segments[G];if(Y.uri!==X.uri)return!1;if(!Y.byterange&&!X.byterange)continue;let K=Y.byterange,Z=X.byterange;if(K&&!Z||!K&&Z)return!1;if(K.offset!==Z.offset||K.length!==Z.length)return!1}return!0},VP=(h,_,G,Y)=>{let X=Y.attributes.NAME||G;return`placeholder-uri-${h}-${_}-${X}`},UP=({mainXml:h,srcUrl:_,clientOffset:G,sidxMapping:Y,previousManifest:X})=>{let K=aU(h,{manifestUri:_,clientOffset:G,sidxMapping:Y,previousManifest:X});return WN(K,_,VP),K},EP=(h,_)=>{sh(h,(G,Y,X,K)=>{if(!_.mediaGroups[Y][X]||!(K in _.mediaGroups[Y][X]))delete h.mediaGroups[Y][X][K]})},CP=(h,_,G)=>{let Y=!0,X=p1(h,{duration:_.duration,minimumUpdatePeriod:_.minimumUpdatePeriod,timelineStarts:_.timelineStarts});for(let K=0;K<_.playlists.length;K++){let Z=_.playlists[K];if(Z.sidx){let D=tG(Z.sidx);if(G&&G[D]&&G[D].sidx)QZ(Z,G[D].sidx,Z.sidx.resolvedUri)}let Q=LM(X,Z,lE);if(Q)X=Q,Y=!1}if(sh(_,(K,Z,Q,D)=>{if(K.playlists&&K.playlists.length){let O=K.playlists[0].id,A=LM(X,K.playlists[0],lE);if(A){if(X=A,!(D in X.mediaGroups[Z][Q]))X.mediaGroups[Z][Q][D]=K;X.mediaGroups[Z][Q][D].playlists[0]=X.playlists[O],Y=!1}}}),EP(X,_),_.minimumUpdatePeriod!==h.minimumUpdatePeriod)Y=!1;if(Y)return null;return X},NP=(h,_)=>{return(Boolean(!h.map&&!_.map)||Boolean(h.map&&_.map&&h.map.byterange.offset===_.map.byterange.offset&&h.map.byterange.length===_.map.byterange.length))&&h.uri===_.uri&&h.byterange.offset===_.byterange.offset&&h.byterange.length===_.byterange.length},iE=(h,_)=>{let G={};for(let Y in h){let K=h[Y].sidx;if(K){let Z=tG(K);if(!_[Z])break;let Q=_[Z].sidxInfo;if(NP(Q,K))G[Z]=_[Z]}}return G},$P=(h,_)=>{let Y=iE(h.playlists,_);return sh(h,(X,K,Z,Q)=>{if(X.playlists&&X.playlists.length){let D=X.playlists;Y=p1(Y,iE(D,_))}}),Y};class mZ extends HP{constructor(h,_,G={},Y){super();if(this.isPaused_=!0,this.mainPlaylistLoader_=Y||this,!Y)this.isMain_=!0;let{withCredentials:X=!1}=G;if(this.vhs_=_,this.withCredentials=X,this.addMetadataToTextTrack=G.addMetadataToTextTrack,!h)throw Error("A non-empty playlist URL or object is required");if(this.on("minimumUpdatePeriod",()=>{this.refreshXml_()}),this.on("mediaupdatetimeout",()=>{this.refreshMedia_(this.media().id)}),this.state="HAVE_NOTHING",this.loadedPlaylists_={},this.logger_=a4("DashPlaylistLoader"),this.isMain_)this.mainPlaylistLoader_.srcUrl=h,this.mainPlaylistLoader_.sidxMapping_={};else this.childPlaylist_=h}get isPaused(){return this.isPaused_}requestErrored_(h,_,G){if(!this.request)return!0;if(this.request=null,h){if(this.error=typeof h==="object"&&!(h instanceof Error)?h:{status:_.status,message:"DASH request error at URL: "+_.uri,response:_.response,code:2,metadata:h.metadata},G)this.state=G;return this.trigger("error"),!0}}addSidxSegments_(h,_,G){let Y=h.sidx&&tG(h.sidx);if(!h.sidx||!Y||this.mainPlaylistLoader_.sidxMapping_[Y]){a.default.clearTimeout(this.mediaRequest_),this.mediaRequest_=a.default.setTimeout(()=>G(!1),0);return}let X=yZ(h.sidx.resolvedUri),K=(Q,D)=>{if(this.requestErrored_(Q,D,_))return;let O=this.mainPlaylistLoader_.sidxMapping_,{requestType:A}=D,H;try{H=XC.default(d0(D.response).subarray(8))}catch(C){C.metadata=l7({requestType:A,request:D,parseFailure:!0}),this.requestErrored_(C,D,_);return}return O[Y]={sidxInfo:h.sidx,sidx:H},QZ(h,H,h.sidx.resolvedUri),G(!0)},Z="dash-sidx";this.request=zP(X,this.vhs_.xhr,(Q,D,O,A)=>{if(Q)return K(Q,D);if(!O||O!=="mp4"){let N=O||"unknown";return K({status:D.status,message:`Unsupported ${N} container type for sidx segment at URL: ${X}`,response:"",playlist:h,internal:!0,playlistExclusionDuration:1/0,code:2},D)}let{offset:H,length:C}=h.sidx.byterange;if(A.length>=C+H)return K(Q,{response:A.subarray(H,H+C),status:D.status,uri:D.uri});this.request=this.vhs_.xhr({uri:X,responseType:"arraybuffer",requestType:"dash-sidx",headers:TM({byterange:h.sidx.byterange})},K)},Z)}dispose(){if(this.isPaused_=!0,this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},a.default.clearTimeout(this.minimumUpdatePeriodTimeout_),a.default.clearTimeout(this.mediaRequest_),a.default.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){let h=this.request;this.request=null,h.onreadystatechange=null,h.abort()}}media(h){if(!h)return this.media_;if(this.state==="HAVE_NOTHING")throw Error("Cannot switch media playlist from "+this.state);let _=this.state;if(typeof h==="string"){if(!this.mainPlaylistLoader_.main.playlists[h])throw Error("Unknown playlist URI: "+h);h=this.mainPlaylistLoader_.main.playlists[h]}let G=!this.media_||h.id!==this.media_.id;if(G&&this.loadedPlaylists_[h.id]&&this.loadedPlaylists_[h.id].endList){if(this.state="HAVE_METADATA",this.media_=h,G)this.trigger("mediachanging"),this.trigger("mediachange");return}if(!G)return;if(this.media_)this.trigger("mediachanging");this.addSidxSegments_(h,_,(Y)=>{this.haveMetadata({startingState:_,playlist:h})})}haveMetadata({startingState:h,playlist:_}){if(this.state="HAVE_METADATA",this.loadedPlaylists_[_.id]=_,a.default.clearTimeout(this.mediaRequest_),this.mediaRequest_=null,this.refreshMedia_(_.id),h==="HAVE_MAIN_MANIFEST")this.trigger("loadedmetadata");else this.trigger("mediachange")}pause(){if(this.isPaused_=!0,this.mainPlaylistLoader_.createMupOnMedia_)this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null;if(this.stopRequest(),a.default.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_)a.default.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null;if(this.state==="HAVE_NOTHING")this.started=!1}load(h){this.isPaused_=!1,a.default.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;let _=this.media();if(h){let G=_?_.targetDuration/2*1000:5000;this.mediaUpdateTimeout=a.default.setTimeout(()=>this.load(),G);return}if(!this.started){this.start();return}if(_&&!_.endList){if(this.isMain_&&!this.minimumUpdatePeriodTimeout_)this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_();this.trigger("mediaupdatetimeout")}else this.trigger("loadedplaylist")}start(){if(this.started=!0,!this.isMain_){a.default.clearTimeout(this.mediaRequest_),this.mediaRequest_=a.default.setTimeout(()=>this.haveMain_(),0);return}this.requestMain_((h,_)=>{if(this.haveMain_(),!this.hasPendingRequest()&&!this.media_)this.media(this.mainPlaylistLoader_.main.playlists[0])})}requestMain_(h){let _={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestrequeststart",metadata:_}),this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials,requestType:"dash-manifest"},(G,Y)=>{if(G){let{requestType:K}=Y;G.metadata=l7({requestType:K,request:Y,error:G})}if(this.requestErrored_(G,Y)){if(this.state==="HAVE_NOTHING")this.started=!1;return}this.trigger({type:"manifestrequestcomplete",metadata:_});let X=Y.responseText!==this.mainPlaylistLoader_.mainXml_;if(this.mainPlaylistLoader_.mainXml_=Y.responseText,Y.responseHeaders&&Y.responseHeaders.date)this.mainLoaded_=Date.parse(Y.responseHeaders.date);else this.mainLoaded_=Date.now();if(this.mainPlaylistLoader_.srcUrl=yZ(this.mainPlaylistLoader_.srcUrl,Y),X){this.handleMain_(),this.syncClientServerClock_(()=>{return h(Y,X)});return}return h(Y,X)})}syncClientServerClock_(h){let _=tU(this.mainPlaylistLoader_.mainXml_);if(_===null)return this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),h();if(_.method==="DIRECT")return this.mainPlaylistLoader_.clientOffset_=_.value-Date.now(),h();this.request=this.vhs_.xhr({uri:Z4(this.mainPlaylistLoader_.srcUrl,_.value),method:_.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},(G,Y)=>{if(!this.request)return;if(G){let{requestType:K}=Y;return this.error.metadata=l7({requestType:K,request:Y,error:G}),this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),h()}let X;if(_.method==="HEAD")if(!Y.responseHeaders||!Y.responseHeaders.date)X=this.mainLoaded_;else X=Date.parse(Y.responseHeaders.date);else X=Date.parse(Y.responseText);this.mainPlaylistLoader_.clientOffset_=X-Date.now(),h()})}haveMain_(){if(this.state="HAVE_MAIN_MANIFEST",this.isMain_)this.trigger("loadedplaylist");else if(!this.media_)this.media(this.childPlaylist_)}handleMain_(){a.default.clearTimeout(this.mediaRequest_),this.mediaRequest_=null;let h=this.mainPlaylistLoader_.main,_={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestparsestart",metadata:_});let G;try{G=UP({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:h})}catch(X){this.error=X,this.error.metadata={errorType:Y0.Error.StreamingDashManifestParserError,error:X},this.trigger("error")}if(h)G=CP(h,G,this.mainPlaylistLoader_.sidxMapping_);this.mainPlaylistLoader_.main=G?G:h;let Y=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(Y&&Y!==this.mainPlaylistLoader_.srcUrl)this.mainPlaylistLoader_.srcUrl=Y;if(!h||G&&G.minimumUpdatePeriod!==h.minimumUpdatePeriod)this.updateMinimumUpdatePeriodTimeout_();if(this.addEventStreamToMetadataTrack_(G),G){let{duration:X,endList:K}=G,Z=[];G.playlists.forEach((D)=>{Z.push({id:D.id,bandwidth:D.attributes.BANDWIDTH,resolution:D.attributes.RESOLUTION,codecs:D.attributes.CODECS})});let Q={duration:X,isLive:!K,renditions:Z};_.parsedManifest=Q,this.trigger({type:"manifestparsecomplete",metadata:_})}return Boolean(G)}updateMinimumUpdatePeriodTimeout_(){let h=this.mainPlaylistLoader_;if(h.createMupOnMedia_)h.off("loadedmetadata",h.createMupOnMedia_),h.createMupOnMedia_=null;if(h.minimumUpdatePeriodTimeout_)a.default.clearTimeout(h.minimumUpdatePeriodTimeout_),h.minimumUpdatePeriodTimeout_=null;let _=h.main&&h.main.minimumUpdatePeriod;if(_===0)if(h.media())_=h.media().targetDuration*1000;else h.createMupOnMedia_=h.updateMinimumUpdatePeriodTimeout_,h.one("loadedmetadata",h.createMupOnMedia_);if(typeof _!=="number"||_<=0){if(_<0)this.logger_(`found invalid minimumUpdatePeriod of ${_}, not setting a timeout`);return}this.createMUPTimeout_(_)}createMUPTimeout_(h){let _=this.mainPlaylistLoader_;_.minimumUpdatePeriodTimeout_=a.default.setTimeout(()=>{_.minimumUpdatePeriodTimeout_=null,_.trigger("minimumUpdatePeriod"),_.createMUPTimeout_(h)},h)}refreshXml_(){this.requestMain_((h,_)=>{if(!_)return;if(this.media_)this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id];this.mainPlaylistLoader_.sidxMapping_=$P(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,(G)=>{this.refreshMedia_(this.media().id)})})}refreshMedia_(h){if(!h)throw Error("refreshMedia_ must take a media id");if(this.media_&&this.isMain_)this.handleMain_();let _=this.mainPlaylistLoader_.main.playlists,G=!this.media_||this.media_!==_[h];if(G)this.media_=_[h];else this.trigger("playlistunchanged");if(!this.mediaUpdateTimeout){let Y=()=>{if(this.media().endList)return;this.mediaUpdateTimeout=a.default.setTimeout(()=>{this.trigger("mediaupdatetimeout"),Y()},jM(this.media(),Boolean(G)))};Y()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(h){if(h&&this.mainPlaylistLoader_.main.eventStream){let _=this.mainPlaylistLoader_.main.eventStream.map((G)=>{return{cueTime:G.start,frames:[{data:G.messageData}]}});this.addMetadataToTextTrack("EventStream",_,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(h){if(h.contentProtection){let _=new Set;for(let G in h.contentProtection){let Y=h.contentProtection[G].attributes["cenc:default_KID"];if(Y)_.add(Y.replace(/-/g,"").toLowerCase())}return _}}}var q5={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},LP=(h)=>{let _=new Uint8Array(new ArrayBuffer(h.length));for(let G=0;G<h.length;G++)_[G]=h.charCodeAt(G);return _.buffer},kN=function(h){return h.on=h.addEventListener,h.off=h.removeEventListener,h},jP=function(h){try{return URL.createObjectURL(new Blob([h],{type:"application/javascript"}))}catch(_){let G=new BlobBuilder;return G.append(h),URL.createObjectURL(G.getBlob())}},uN=function(h){return function(){let _=jP(h),G=kN(new Worker(_));G.objURL=_;let Y=G.terminate;return G.on=G.addEventListener,G.off=G.removeEventListener,G.terminate=function(){return URL.revokeObjectURL(_),Y.call(this)},G}},pN=function(h){return`var browserWorkerPolyFill = ${kN.toString()};
|
|
216
|
-
browserWorkerPolyFill(self);
|
|
217
|
-
`+h},lN=function(h){return h.toString().replace(/^function.+?{/,"").slice(0,-1)},FP=pN(lN(function(){var h=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},_=function(){this.init=function(){var B={};this.on=function(V,U){if(!B[V])B[V]=[];B[V]=B[V].concat(U)},this.off=function(V,U){var E;if(!B[V])return!1;return E=B[V].indexOf(U),B[V]=B[V].slice(),B[V].splice(E,1),E>-1},this.trigger=function(V){var U,E,L,T;if(U=B[V],!U)return;if(arguments.length===2){L=U.length;for(E=0;E<L;++E)U[E].call(this,arguments[1])}else{T=[],E=arguments.length;for(E=1;E<arguments.length;++E)T.push(arguments[E]);L=U.length;for(E=0;E<L;++E)U[E].apply(this,T)}},this.dispose=function(){B={}}}};_.prototype.pipe=function(B){return this.on("data",function(V){B.push(V)}),this.on("done",function(V){B.flush(V)}),this.on("partialdone",function(V){B.partialFlush(V)}),this.on("endedtimeline",function(V){B.endTimeline(V)}),this.on("reset",function(V){B.reset(V)}),B},_.prototype.push=function(B){this.trigger("data",B)},_.prototype.flush=function(B){this.trigger("done",B)},_.prototype.partialFlush=function(B){this.trigger("partialdone",B)},_.prototype.endTimeline=function(B){this.trigger("endedtimeline",B)},_.prototype.reset=function(B){this.trigger("reset",B)};var G=_,Y=Math.pow(2,32),X=function(B){var V=new DataView(B.buffer,B.byteOffset,B.byteLength),U;if(V.getBigUint64){if(U=V.getBigUint64(0),U<Number.MAX_SAFE_INTEGER)return Number(U);return U}return V.getUint32(0)*Y+V.getUint32(4)},K={getUint64:X,MAX_UINT32:Y},Z=K.MAX_UINT32,Q,D,O,A,H,C,N,j,W,S,R,v,x,P,I,b,l,i,h0,q0,Q0,o,r,d,s,_0,Z0,X0,E0,m,N0,x0,k,y0,a0,n0;(function(){var B;if(r={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},typeof Uint8Array>"u")return;for(B in r)if(r.hasOwnProperty(B))r[B]=[B.charCodeAt(0),B.charCodeAt(1),B.charCodeAt(2),B.charCodeAt(3)];d=new Uint8Array([105,115,111,109]),_0=new Uint8Array([97,118,99,49]),s=new Uint8Array([0,0,0,1]),Z0=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]),X0=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]),E0={video:Z0,audio:X0},x0=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),N0=new Uint8Array([0,0,0,0,0,0,0,0]),k=new Uint8Array([0,0,0,0,0,0,0,0]),y0=k,a0=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),n0=k,m=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])})(),Q=function(B){var V=[],U=0,E,L,T;for(E=1;E<arguments.length;E++)V.push(arguments[E]);E=V.length;while(E--)U+=V[E].byteLength;L=new Uint8Array(U+8),T=new DataView(L.buffer,L.byteOffset,L.byteLength),T.setUint32(0,L.byteLength),L.set(B,4);for(E=0,U=8;E<V.length;E++)L.set(V[E],U),U+=V[E].byteLength;return L},D=function(){return Q(r.dinf,Q(r.dref,x0))},O=function(B){return Q(r.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,B.audioobjecttype<<3|B.samplingfrequencyindex>>>1,B.samplingfrequencyindex<<7|B.channelcount<<3,6,1,2]))},A=function(){return Q(r.ftyp,d,s,d,_0)},b=function(B){return Q(r.hdlr,E0[B])},H=function(B){return Q(r.mdat,B)},I=function(B){var V=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,B.duration>>>24&255,B.duration>>>16&255,B.duration>>>8&255,B.duration&255,85,196,0,0]);if(B.samplerate)V[12]=B.samplerate>>>24&255,V[13]=B.samplerate>>>16&255,V[14]=B.samplerate>>>8&255,V[15]=B.samplerate&255;return Q(r.mdhd,V)},P=function(B){return Q(r.mdia,I(B),b(B.type),N(B))},C=function(B){return Q(r.mfhd,new Uint8Array([0,0,0,0,(B&4278190080)>>24,(B&16711680)>>16,(B&65280)>>8,B&255]))},N=function(B){return Q(r.minf,B.type==="video"?Q(r.vmhd,m):Q(r.smhd,N0),D(),i(B))},j=function(B,V){var U=[],E=V.length;while(E--)U[E]=q0(V[E]);return Q.apply(null,[r.moof,C(B)].concat(U))},W=function(B){var V=B.length,U=[];while(V--)U[V]=v(B[V]);return Q.apply(null,[r.moov,R(4294967295)].concat(U).concat(S(B)))},S=function(B){var V=B.length,U=[];while(V--)U[V]=Q0(B[V]);return Q.apply(null,[r.mvex].concat(U))},R=function(B){var V=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(B&4278190080)>>24,(B&16711680)>>16,(B&65280)>>8,B&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 Q(r.mvhd,V)},l=function(B){var V=B.samples||[],U=new Uint8Array(4+V.length),E,L;for(L=0;L<V.length;L++)E=V[L].flags,U[L+4]=E.dependsOn<<4|E.isDependedOn<<2|E.hasRedundancy;return Q(r.sdtp,U)},i=function(B){return Q(r.stbl,h0(B),Q(r.stts,n0),Q(r.stsc,y0),Q(r.stsz,a0),Q(r.stco,k))},function(){var B,V;h0=function(U){return Q(r.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),U.type==="video"?B(U):V(U))},B=function(U){var E=U.sps||[],L=U.pps||[],T=[],g=[],y,p;for(y=0;y<E.length;y++)T.push((E[y].byteLength&65280)>>>8),T.push(E[y].byteLength&255),T=T.concat(Array.prototype.slice.call(E[y]));for(y=0;y<L.length;y++)g.push((L[y].byteLength&65280)>>>8),g.push(L[y].byteLength&255),g=g.concat(Array.prototype.slice.call(L[y]));if(p=[r.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,(U.width&65280)>>8,U.width&255,(U.height&65280)>>8,U.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]),Q(r.avcC,new Uint8Array([1,U.profileIdc,U.profileCompatibility,U.levelIdc,255].concat([E.length],T,[L.length],g))),Q(r.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],U.sarRatio){var c=U.sarRatio[0],e=U.sarRatio[1];p.push(Q(r.pasp,new Uint8Array([(c&4278190080)>>24,(c&16711680)>>16,(c&65280)>>8,c&255,(e&4278190080)>>24,(e&16711680)>>16,(e&65280)>>8,e&255])))}return Q.apply(null,p)},V=function(U){return Q(r.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(U.channelcount&65280)>>8,U.channelcount&255,(U.samplesize&65280)>>8,U.samplesize&255,0,0,0,0,(U.samplerate&65280)>>8,U.samplerate&255,0,0]),O(U))}}(),x=function(B){var V=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(B.id&4278190080)>>24,(B.id&16711680)>>16,(B.id&65280)>>8,B.id&255,0,0,0,0,(B.duration&4278190080)>>24,(B.duration&16711680)>>16,(B.duration&65280)>>8,B.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,(B.width&65280)>>8,B.width&255,0,0,(B.height&65280)>>8,B.height&255,0,0]);return Q(r.tkhd,V)},q0=function(B){var V,U,E,L,T,g,y;if(V=Q(r.tfhd,new Uint8Array([0,0,0,58,(B.id&4278190080)>>24,(B.id&16711680)>>16,(B.id&65280)>>8,B.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),g=Math.floor(B.baseMediaDecodeTime/Z),y=Math.floor(B.baseMediaDecodeTime%Z),U=Q(r.tfdt,new Uint8Array([1,0,0,0,g>>>24&255,g>>>16&255,g>>>8&255,g&255,y>>>24&255,y>>>16&255,y>>>8&255,y&255])),T=92,B.type==="audio")return E=o(B,T),Q(r.traf,V,U,E);return L=l(B),E=o(B,L.length+T),Q(r.traf,V,U,E,L)},v=function(B){return B.duration=B.duration||4294967295,Q(r.trak,x(B),P(B))},Q0=function(B){var V=new Uint8Array([0,0,0,0,(B.id&4278190080)>>24,(B.id&16711680)>>16,(B.id&65280)>>8,B.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);if(B.type!=="video")V[V.length-1]=0;return Q(r.trex,V)},function(){var B,V,U;U=function(E,L){var T=0,g=0,y=0,p=0;if(E.length){if(E[0].duration!==void 0)T=1;if(E[0].size!==void 0)g=2;if(E[0].flags!==void 0)y=4;if(E[0].compositionTimeOffset!==void 0)p=8}return[0,0,T|g|y|p,1,(E.length&4278190080)>>>24,(E.length&16711680)>>>16,(E.length&65280)>>>8,E.length&255,(L&4278190080)>>>24,(L&16711680)>>>16,(L&65280)>>>8,L&255]},V=function(E,L){var T,g,y,p,c,e;p=E.samples||[],L+=20+16*p.length,y=U(p,L),g=new Uint8Array(y.length+p.length*16),g.set(y),T=y.length;for(e=0;e<p.length;e++)c=p[e],g[T++]=(c.duration&4278190080)>>>24,g[T++]=(c.duration&16711680)>>>16,g[T++]=(c.duration&65280)>>>8,g[T++]=c.duration&255,g[T++]=(c.size&4278190080)>>>24,g[T++]=(c.size&16711680)>>>16,g[T++]=(c.size&65280)>>>8,g[T++]=c.size&255,g[T++]=c.flags.isLeading<<2|c.flags.dependsOn,g[T++]=c.flags.isDependedOn<<6|c.flags.hasRedundancy<<4|c.flags.paddingValue<<1|c.flags.isNonSyncSample,g[T++]=c.flags.degradationPriority&61440,g[T++]=c.flags.degradationPriority&15,g[T++]=(c.compositionTimeOffset&4278190080)>>>24,g[T++]=(c.compositionTimeOffset&16711680)>>>16,g[T++]=(c.compositionTimeOffset&65280)>>>8,g[T++]=c.compositionTimeOffset&255;return Q(r.trun,g)},B=function(E,L){var T,g,y,p,c,e;p=E.samples||[],L+=20+8*p.length,y=U(p,L),T=new Uint8Array(y.length+p.length*8),T.set(y),g=y.length;for(e=0;e<p.length;e++)c=p[e],T[g++]=(c.duration&4278190080)>>>24,T[g++]=(c.duration&16711680)>>>16,T[g++]=(c.duration&65280)>>>8,T[g++]=c.duration&255,T[g++]=(c.size&4278190080)>>>24,T[g++]=(c.size&16711680)>>>16,T[g++]=(c.size&65280)>>>8,T[g++]=c.size&255;return Q(r.trun,T)},o=function(E,L){if(E.type==="audio")return B(E,L);return V(E,L)}}();var w0={ftyp:A,mdat:H,moof:j,moov:W,initSegment:function(B){var V=A(),U=W(B),E;return E=new Uint8Array(V.byteLength+U.byteLength),E.set(V),E.set(U,V.byteLength),E}},g0=function(B){var V,U,E=[],L=[];L.byteLength=0,L.nalCount=0,L.duration=0,E.byteLength=0;for(V=0;V<B.length;V++)if(U=B[V],U.nalUnitType==="access_unit_delimiter_rbsp"){if(E.length)E.duration=U.dts-E.dts,L.byteLength+=E.byteLength,L.nalCount+=E.length,L.duration+=E.duration,L.push(E);E=[U],E.byteLength=U.data.byteLength,E.pts=U.pts,E.dts=U.dts}else{if(U.nalUnitType==="slice_layer_without_partitioning_rbsp_idr")E.keyFrame=!0;E.duration=U.dts-E.dts,E.byteLength+=U.data.byteLength,E.push(U)}if(L.length&&(!E.duration||E.duration<=0))E.duration=L[L.length-1].duration;return L.byteLength+=E.byteLength,L.nalCount+=E.length,L.duration+=E.duration,L.push(E),L},Q1=function(B){var V,U,E=[],L=[];E.byteLength=0,E.nalCount=0,E.duration=0,E.pts=B[0].pts,E.dts=B[0].dts,L.byteLength=0,L.nalCount=0,L.duration=0,L.pts=B[0].pts,L.dts=B[0].dts;for(V=0;V<B.length;V++)if(U=B[V],U.keyFrame){if(E.length)L.push(E),L.byteLength+=E.byteLength,L.nalCount+=E.nalCount,L.duration+=E.duration;E=[U],E.nalCount=U.length,E.byteLength=U.byteLength,E.pts=U.pts,E.dts=U.dts,E.duration=U.duration}else E.duration+=U.duration,E.nalCount+=U.length,E.byteLength+=U.byteLength,E.push(U);if(L.length&&E.duration<=0)E.duration=L[L.length-1].duration;return L.byteLength+=E.byteLength,L.nalCount+=E.nalCount,L.duration+=E.duration,L.push(E),L},Y1=function(B){var V;if(!B[0][0].keyFrame&&B.length>1)V=B.shift(),B.byteLength-=V.byteLength,B.nalCount-=V.nalCount,B[0][0].dts=V.dts,B[0][0].pts=V.pts,B[0][0].duration+=V.duration;return B},D1=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},b1=function(B,V){var U=D1();if(U.dataOffset=V,U.compositionTimeOffset=B.pts-B.dts,U.duration=B.duration,U.size=4*B.length,U.size+=B.byteLength,B.keyFrame)U.flags.dependsOn=2,U.flags.isNonSyncSample=0;return U},_1=function(B,V){var U,E,L,T,g,y=V||0,p=[];for(U=0;U<B.length;U++){T=B[U];for(E=0;E<T.length;E++)g=T[E],L=b1(g,y),y+=L.size,p.push(L)}return p},l1=function(B){var V,U,E,L,T,g,y=0,p=B.byteLength,c=B.nalCount,e=p+4*c,J0=new Uint8Array(e),P0=new DataView(J0.buffer);for(V=0;V<B.length;V++){L=B[V];for(U=0;U<L.length;U++){T=L[U];for(E=0;E<T.length;E++)g=T[E],P0.setUint32(y,g.data.byteLength),y+=4,J0.set(g.data,y),y+=g.data.byteLength}}return J0},n1=function(B,V){var U,E=V||0,L=[];return U=b1(B,E),L.push(U),L},y2=function(B){var V,U,E=0,L=B.byteLength,T=B.length,g=L+4*T,y=new Uint8Array(g),p=new DataView(y.buffer);for(V=0;V<B.length;V++)U=B[V],p.setUint32(E,U.data.byteLength),E+=4,y.set(U.data,E),E+=U.data.byteLength;return y},O2={groupNalsIntoFrames:g0,groupFramesIntoGops:Q1,extendFirstKeyFrame:Y1,generateSampleTable:_1,concatenateNalData:l1,generateSampleTableForFrame:n1,concatenateNalDataForFrame:y2},h2=[33,16,5,32,164,27],Z2=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],Z1=function(B){var V=[];while(B--)V.push(0);return V},W2=function(B){return Object.keys(B).reduce(function(V,U){return V[U]=new Uint8Array(B[U].reduce(function(E,L){return E.concat(L)},[])),V},{})},v1,B5=function(){if(!v1){var B={96000:[h2,[227,64],Z1(154),[56]],88200:[h2,[231],Z1(170),[56]],64000:[h2,[248,192],Z1(240),[56]],48000:[h2,[255,192],Z1(268),[55,148,128],Z1(54),[112]],44100:[h2,[255,192],Z1(268),[55,163,128],Z1(84),[112]],32000:[h2,[255,192],Z1(268),[55,234],Z1(226),[112]],24000:[h2,[255,192],Z1(268),[55,255,128],Z1(268),[111,112],Z1(126),[224]],16000:[h2,[255,192],Z1(268),[55,255,128],Z1(268),[111,255],Z1(269),[223,108],Z1(195),[1,192]],12000:[Z2,Z1(268),[3,127,248],Z1(268),[6,255,240],Z1(268),[13,255,224],Z1(268),[27,253,128],Z1(259),[56]],11025:[Z2,Z1(268),[3,127,248],Z1(268),[6,255,240],Z1(268),[13,255,224],Z1(268),[27,255,192],Z1(268),[55,175,128],Z1(108),[112]],8000:[Z2,Z1(268),[3,121,16],Z1(47),[7]]};v1=W2(B)}return v1},d2=90000,a2,M0,j0,u0,s0,A0,t0;a2=function(B){return B*d2},M0=function(B,V){return B*V},j0=function(B){return B/d2},u0=function(B,V){return B/V},s0=function(B,V){return a2(u0(B,V))},A0=function(B,V){return M0(j0(B),V)},t0=function(B,V,U){return j0(U?B:B-V)};var I0={ONE_SECOND_IN_TS:d2,secondsToVideoTs:a2,secondsToAudioTs:M0,videoTsToSeconds:j0,audioTsToSeconds:u0,audioTsToVideoTs:s0,videoTsToAudioTs:A0,metadataTsToSeconds:t0},V1=B5,x1=I0,m1=function(B){var V,U,E=0;for(V=0;V<B.length;V++)U=B[V],E+=U.data.byteLength;return E},w1=function(B,V,U,E){var L,T=0,g=0,y=0,p=0,c,e,J0;if(!V.length)return;if(L=x1.audioTsToVideoTs(B.baseMediaDecodeTime,B.samplerate),T=Math.ceil(x1.ONE_SECOND_IN_TS/(B.samplerate/1024)),U&&E)g=L-Math.max(U,E),y=Math.floor(g/T),p=y*T;if(y<1||p>x1.ONE_SECOND_IN_TS/2)return;if(c=V1()[B.samplerate],!c)c=V[0].data;for(e=0;e<y;e++)J0=V[0],V.splice(0,0,{data:c,dts:J0.dts-T,pts:J0.pts-T});return B.baseMediaDecodeTime-=Math.floor(x1.videoTsToAudioTs(p,B.samplerate)),p},J2=function(B,V,U){if(V.minSegmentDts>=U)return B;return V.minSegmentDts=1/0,B.filter(function(E){if(E.dts>=U)return V.minSegmentDts=Math.min(V.minSegmentDts,E.dts),V.minSegmentPts=V.minSegmentDts,!0;return!1})},R2=function(B){var V,U,E=[];for(V=0;V<B.length;V++)U=B[V],E.push({size:U.data.byteLength,duration:1024});return E},e4=function(B){var V,U,E=0,L=new Uint8Array(m1(B));for(V=0;V<B.length;V++)U=B[V],L.set(U.data,E),E+=U.data.byteLength;return L},f0={prefixWithSilence:w1,trimAdtsFramesByEarliestDts:J2,generateSampleTable:R2,concatenateFrameData:e4},l0=I0.ONE_SECOND_IN_TS,W0=function(B,V){if(typeof V.pts==="number"){if(B.timelineStartInfo.pts===void 0)B.timelineStartInfo.pts=V.pts;if(B.minSegmentPts===void 0)B.minSegmentPts=V.pts;else B.minSegmentPts=Math.min(B.minSegmentPts,V.pts);if(B.maxSegmentPts===void 0)B.maxSegmentPts=V.pts;else B.maxSegmentPts=Math.max(B.maxSegmentPts,V.pts)}if(typeof V.dts==="number"){if(B.timelineStartInfo.dts===void 0)B.timelineStartInfo.dts=V.dts;if(B.minSegmentDts===void 0)B.minSegmentDts=V.dts;else B.minSegmentDts=Math.min(B.minSegmentDts,V.dts);if(B.maxSegmentDts===void 0)B.maxSegmentDts=V.dts;else B.maxSegmentDts=Math.max(B.maxSegmentDts,V.dts)}},v0=function(B){delete B.minSegmentDts,delete B.maxSegmentDts,delete B.minSegmentPts,delete B.maxSegmentPts},X1=function(B,V){var U,E,L=B.minSegmentDts;if(!V)L-=B.timelineStartInfo.dts;if(U=B.timelineStartInfo.baseMediaDecodeTime,U+=L,U=Math.max(0,U),B.type==="audio")E=B.samplerate/l0,U*=E,U=Math.floor(U);return U},N1={clearDtsInfo:v0,calculateTrackBaseMediaDecodeTime:X1,collectDtsInfo:W0},S2=4,h3=128,e7=function(B){var V=0,U={payloadType:-1,payloadSize:0},E=0,L=0;while(V<B.byteLength){if(B[V]===h3)break;while(B[V]===255)E+=255,V++;E+=B[V++];while(B[V]===255)L+=255,V++;if(L+=B[V++],!U.payload&&E===S2){var T=String.fromCharCode(B[V+3],B[V+4],B[V+5],B[V+6]);if(T==="GA94"){U.payloadType=E,U.payloadSize=L,U.payload=B.subarray(V,V+L);break}else U.payload=void 0}V+=L,E=0,L=0}return U},h9=function(B){if(B.payload[0]!==181)return null;if((B.payload[1]<<8|B.payload[2])!==49)return null;if(String.fromCharCode(B.payload[3],B.payload[4],B.payload[5],B.payload[6])!=="GA94")return null;if(B.payload[7]!==3)return null;return B.payload.subarray(8,B.payload.length-1)},y8=function(B,V){var U=[],E,L,T,g;if(!(V[0]&64))return U;L=V[0]&31;for(E=0;E<L;E++)if(T=E*3,g={type:V[T+2]&3,pts:B},V[T+2]&4)g.ccData=V[T+3]<<8|V[T+4],U.push(g);return U},_9=function(B){var V=B.byteLength,U=[],E=1,L,T;while(E<V-2)if(B[E]===0&&B[E+1]===0&&B[E+2]===3)U.push(E+2),E+=2;else E++;if(U.length===0)return B;L=V-U.length,T=new Uint8Array(L);var g=0;for(E=0;E<L;g++,E++){if(g===U[0])g++,U.shift();T[E]=B[g]}return T},Q_={parseSei:e7,parseUserData:h9,parseCaptionPackets:y8,discardEmulationPreventionBytes:_9,USER_DATA_REGISTERED_ITU_T_T35:S2},x6=G,c3=Q_,o2=function(B){if(B=B||{},o2.prototype.init.call(this),this.parse708captions_=typeof B.parse708captions==="boolean"?B.parse708captions:!0,this.captionPackets_=[],this.ccStreams_=[new _2(0,0),new _2(0,1),new _2(1,0),new _2(1,1)],this.parse708captions_)this.cc708Stream_=new F1({captionServices:B.captionServices});if(this.reset(),this.ccStreams_.forEach(function(V){V.on("data",this.trigger.bind(this,"data")),V.on("partialdone",this.trigger.bind(this,"partialdone")),V.on("done",this.trigger.bind(this,"done"))},this),this.parse708captions_)this.cc708Stream_.on("data",this.trigger.bind(this,"data")),this.cc708Stream_.on("partialdone",this.trigger.bind(this,"partialdone")),this.cc708Stream_.on("done",this.trigger.bind(this,"done"))};o2.prototype=new x6,o2.prototype.push=function(B){var V,U,E;if(B.nalUnitType!=="sei_rbsp")return;if(V=c3.parseSei(B.escapedRBSP),!V.payload)return;if(V.payloadType!==c3.USER_DATA_REGISTERED_ITU_T_T35)return;if(U=c3.parseUserData(V),!U)return;if(B.dts<this.latestDts_){this.ignoreNextEqualDts_=!0;return}else if(B.dts===this.latestDts_&&this.ignoreNextEqualDts_){if(this.numSameDts_--,!this.numSameDts_)this.ignoreNextEqualDts_=!1;return}if(E=c3.parseCaptionPackets(B.pts,U),this.captionPackets_=this.captionPackets_.concat(E),this.latestDts_!==B.dts)this.numSameDts_=0;this.numSameDts_++,this.latestDts_=B.dts},o2.prototype.flushCCStreams=function(B){this.ccStreams_.forEach(function(V){return B==="flush"?V.flush():V.partialFlush()},this)},o2.prototype.flushStream=function(B){if(!this.captionPackets_.length){this.flushCCStreams(B);return}this.captionPackets_.forEach(function(V,U){V.presortIndex=U}),this.captionPackets_.sort(function(V,U){if(V.pts===U.pts)return V.presortIndex-U.presortIndex;return V.pts-U.pts}),this.captionPackets_.forEach(function(V){if(V.type<2)this.dispatchCea608Packet(V);else this.dispatchCea708Packet(V)},this),this.captionPackets_.length=0,this.flushCCStreams(B)},o2.prototype.flush=function(){return this.flushStream("flush")},o2.prototype.partialFlush=function(){return this.flushStream("partialFlush")},o2.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(B){B.reset()})},o2.prototype.dispatchCea608Packet=function(B){if(this.setsTextOrXDSActive(B))this.activeCea608Channel_[B.type]=null;else if(this.setsChannel1Active(B))this.activeCea608Channel_[B.type]=0;else if(this.setsChannel2Active(B))this.activeCea608Channel_[B.type]=1;if(this.activeCea608Channel_[B.type]===null)return;this.ccStreams_[(B.type<<1)+this.activeCea608Channel_[B.type]].push(B)},o2.prototype.setsChannel1Active=function(B){return(B.ccData&30720)===4096},o2.prototype.setsChannel2Active=function(B){return(B.ccData&30720)===6144},o2.prototype.setsTextOrXDSActive=function(B){return(B.ccData&28928)===256||(B.ccData&30974)===4138||(B.ccData&30974)===6186},o2.prototype.dispatchCea708Packet=function(B){if(this.parse708captions_)this.cc708Stream_.push(B)};var d3={127:9834,4128:32,4129:160,4133:8230,4138:352,4140:338,4144:9608,4145:8216,4146:8217,4147:8220,4148:8221,4149:8226,4153:8482,4154:353,4156:339,4157:8480,4159:376,4214:8539,4215:8540,4216:8541,4217:8542,4218:9168,4219:9124,4220:9123,4221:9135,4222:9126,4223:9121,4256:12600},fY=function(B){var V=d3[B]||B;if(B&4096&&B===V)return"";return String.fromCharCode(V)},a3=function(B){return 32<=B&&B<=127||160<=B&&B<=255},B4=function(B){this.windowNum=B,this.reset()};B4.prototype.reset=function(){this.clearText(),this.pendingNewLine=!1,this.winAttr={},this.penAttr={},this.penLoc={},this.penColor={},this.visible=0,this.rowLock=0,this.columnLock=0,this.priority=0,this.relativePositioning=0,this.anchorVertical=0,this.anchorHorizontal=0,this.anchorPoint=0,this.rowCount=1,this.virtualRowCount=this.rowCount+1,this.columnCount=41,this.windowStyle=0,this.penStyle=0},B4.prototype.getText=function(){return this.rows.join(`
|
|
218
|
-
`)},B4.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},B4.prototype.newLine=function(B){if(this.rows.length>=this.virtualRowCount&&typeof this.beforeRowOverflow==="function")this.beforeRowOverflow(B);if(this.rows.length>0)this.rows.push(""),this.rowIdx++;while(this.rows.length>this.virtualRowCount)this.rows.shift(),this.rowIdx--},B4.prototype.isEmpty=function(){if(this.rows.length===0)return!0;else if(this.rows.length===1)return this.rows[0]==="";return!1},B4.prototype.addText=function(B){this.rows[this.rowIdx]+=B},B4.prototype.backspace=function(){if(!this.isEmpty()){var B=this.rows[this.rowIdx];this.rows[this.rowIdx]=B.substr(0,B.length-1)}};var w6=function(B,V,U){if(this.serviceNum=B,this.text="",this.currentWindow=new B4(-1),this.windows=[],this.stream=U,typeof V==="string")this.createTextDecoder(V)};w6.prototype.init=function(B,V){this.startPts=B;for(var U=0;U<8;U++)if(this.windows[U]=new B4(U),typeof V==="function")this.windows[U].beforeRowOverflow=V},w6.prototype.setCurrentWindow=function(B){this.currentWindow=this.windows[B]},w6.prototype.createTextDecoder=function(B){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(B)}catch(V){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+B+" encoding. "+V})}};var F1=function(B){B=B||{},F1.prototype.init.call(this);var V=this,U=B.captionServices||{},E={},L;Object.keys(U).forEach((T)=>{if(L=U[T],/^SERVICE/.test(T))E[T]=L.encoding}),this.serviceEncodings=E,this.current708Packet=null,this.services={},this.push=function(T){if(T.type===3)V.new708Packet(),V.add708Bytes(T);else{if(V.current708Packet===null)V.new708Packet();V.add708Bytes(T)}}};F1.prototype=new x6,F1.prototype.new708Packet=function(){if(this.current708Packet!==null)this.push708Packet();this.current708Packet={data:[],ptsVals:[]}},F1.prototype.add708Bytes=function(B){var V=B.ccData,U=V>>>8,E=V&255;this.current708Packet.ptsVals.push(B.pts),this.current708Packet.data.push(U),this.current708Packet.data.push(E)},F1.prototype.push708Packet=function(){var B=this.current708Packet,V=B.data,U=null,E=null,L=0,T=V[L++];B.seq=T>>6,B.sizeCode=T&63;for(;L<V.length;L++){if(T=V[L++],U=T>>5,E=T&31,U===7&&E>0)T=V[L++],U=T;if(this.pushServiceBlock(U,L,E),E>0)L+=E-1}},F1.prototype.pushServiceBlock=function(B,V,U){var E,L=V,T=this.current708Packet.data,g=this.services[B];if(!g)g=this.initService(B,L);for(;L<V+U&&L<T.length;L++)if(E=T[L],a3(E))L=this.handleText(L,g);else if(E===24)L=this.multiByteCharacter(L,g);else if(E===16)L=this.extendedCommands(L,g);else if(128<=E&&E<=135)L=this.setCurrentWindow(L,g);else if(152<=E&&E<=159)L=this.defineWindow(L,g);else if(E===136)L=this.clearWindows(L,g);else if(E===140)L=this.deleteWindows(L,g);else if(E===137)L=this.displayWindows(L,g);else if(E===138)L=this.hideWindows(L,g);else if(E===139)L=this.toggleWindows(L,g);else if(E===151)L=this.setWindowAttributes(L,g);else if(E===144)L=this.setPenAttributes(L,g);else if(E===145)L=this.setPenColor(L,g);else if(E===146)L=this.setPenLocation(L,g);else if(E===143)g=this.reset(L,g);else if(E===8)g.currentWindow.backspace();else if(E===12)g.currentWindow.clearText();else if(E===13)g.currentWindow.pendingNewLine=!0;else if(E===14)g.currentWindow.clearText();else if(E===141)L++},F1.prototype.extendedCommands=function(B,V){var U=this.current708Packet.data,E=U[++B];if(a3(E))B=this.handleText(B,V,{isExtended:!0});return B},F1.prototype.getPts=function(B){return this.current708Packet.ptsVals[Math.floor(B/2)]},F1.prototype.initService=function(B,V){var E="SERVICE"+B,U=this,E,L;if(E in this.serviceEncodings)L=this.serviceEncodings[E];return this.services[B]=new w6(B,L,U),this.services[B].init(this.getPts(V),function(T){U.flushDisplayed(T,U.services[B])}),this.services[B]},F1.prototype.handleText=function(B,V,U){var E=U&&U.isExtended,L=U&&U.isMultiByte,T=this.current708Packet.data,g=E?4096:0,y=T[B],p=T[B+1],c=V.currentWindow,e,J0;function P0(H0){return H0.map((i0)=>{return("0"+(i0&255).toString(16)).slice(-2)}).join("")}if(L)J0=[y,p],B++;else J0=[y];if(V.textDecoder_&&!E)e=V.textDecoder_.decode(new Uint8Array(J0));else if(L){let H0=P0(J0);e=String.fromCharCode(parseInt(H0,16))}else e=fY(g|y);if(c.pendingNewLine&&!c.isEmpty())c.newLine(this.getPts(B));return c.pendingNewLine=!1,c.addText(e),B},F1.prototype.multiByteCharacter=function(B,V){var U=this.current708Packet.data,E=U[B+1],L=U[B+2];if(a3(E)&&a3(L))B=this.handleText(++B,V,{isMultiByte:!0});return B},F1.prototype.setCurrentWindow=function(B,V){var U=this.current708Packet.data,E=U[B],L=E&7;return V.setCurrentWindow(L),B},F1.prototype.defineWindow=function(B,V){var U=this.current708Packet.data,E=U[B],L=E&7;V.setCurrentWindow(L);var T=V.currentWindow;return E=U[++B],T.visible=(E&32)>>5,T.rowLock=(E&16)>>4,T.columnLock=(E&8)>>3,T.priority=E&7,E=U[++B],T.relativePositioning=(E&128)>>7,T.anchorVertical=E&127,E=U[++B],T.anchorHorizontal=E,E=U[++B],T.anchorPoint=(E&240)>>4,T.rowCount=E&15,E=U[++B],T.columnCount=E&63,E=U[++B],T.windowStyle=(E&56)>>3,T.penStyle=E&7,T.virtualRowCount=T.rowCount+1,B},F1.prototype.setWindowAttributes=function(B,V){var U=this.current708Packet.data,E=U[B],L=V.currentWindow.winAttr;return E=U[++B],L.fillOpacity=(E&192)>>6,L.fillRed=(E&48)>>4,L.fillGreen=(E&12)>>2,L.fillBlue=E&3,E=U[++B],L.borderType=(E&192)>>6,L.borderRed=(E&48)>>4,L.borderGreen=(E&12)>>2,L.borderBlue=E&3,E=U[++B],L.borderType+=(E&128)>>5,L.wordWrap=(E&64)>>6,L.printDirection=(E&48)>>4,L.scrollDirection=(E&12)>>2,L.justify=E&3,E=U[++B],L.effectSpeed=(E&240)>>4,L.effectDirection=(E&12)>>2,L.displayEffect=E&3,B},F1.prototype.flushDisplayed=function(B,V){var U=[];for(var E=0;E<8;E++)if(V.windows[E].visible&&!V.windows[E].isEmpty())U.push(V.windows[E].getText());V.endPts=B,V.text=U.join(`
|
|
219
|
-
|
|
220
|
-
`),this.pushCaption(V),V.startPts=B},F1.prototype.pushCaption=function(B){if(B.text!=="")this.trigger("data",{startPts:B.startPts,endPts:B.endPts,text:B.text,stream:"cc708_"+B.serviceNum}),B.text="",B.startPts=B.endPts},F1.prototype.displayWindows=function(B,V){var U=this.current708Packet.data,E=U[++B],L=this.getPts(B);this.flushDisplayed(L,V);for(var T=0;T<8;T++)if(E&1<<T)V.windows[T].visible=1;return B},F1.prototype.hideWindows=function(B,V){var U=this.current708Packet.data,E=U[++B],L=this.getPts(B);this.flushDisplayed(L,V);for(var T=0;T<8;T++)if(E&1<<T)V.windows[T].visible=0;return B},F1.prototype.toggleWindows=function(B,V){var U=this.current708Packet.data,E=U[++B],L=this.getPts(B);this.flushDisplayed(L,V);for(var T=0;T<8;T++)if(E&1<<T)V.windows[T].visible^=1;return B},F1.prototype.clearWindows=function(B,V){var U=this.current708Packet.data,E=U[++B],L=this.getPts(B);this.flushDisplayed(L,V);for(var T=0;T<8;T++)if(E&1<<T)V.windows[T].clearText();return B},F1.prototype.deleteWindows=function(B,V){var U=this.current708Packet.data,E=U[++B],L=this.getPts(B);this.flushDisplayed(L,V);for(var T=0;T<8;T++)if(E&1<<T)V.windows[T].reset();return B},F1.prototype.setPenAttributes=function(B,V){var U=this.current708Packet.data,E=U[B],L=V.currentWindow.penAttr;return E=U[++B],L.textTag=(E&240)>>4,L.offset=(E&12)>>2,L.penSize=E&3,E=U[++B],L.italics=(E&128)>>7,L.underline=(E&64)>>6,L.edgeType=(E&56)>>3,L.fontStyle=E&7,B},F1.prototype.setPenColor=function(B,V){var U=this.current708Packet.data,E=U[B],L=V.currentWindow.penColor;return E=U[++B],L.fgOpacity=(E&192)>>6,L.fgRed=(E&48)>>4,L.fgGreen=(E&12)>>2,L.fgBlue=E&3,E=U[++B],L.bgOpacity=(E&192)>>6,L.bgRed=(E&48)>>4,L.bgGreen=(E&12)>>2,L.bgBlue=E&3,E=U[++B],L.edgeRed=(E&48)>>4,L.edgeGreen=(E&12)>>2,L.edgeBlue=E&3,B},F1.prototype.setPenLocation=function(B,V){var U=this.current708Packet.data,E=U[B],L=V.currentWindow.penLoc;return V.currentWindow.pendingNewLine=!0,E=U[++B],L.row=E&15,E=U[++B],L.column=E&63,B},F1.prototype.reset=function(B,V){var U=this.getPts(B);return this.flushDisplayed(U,V),this.initService(V.serviceNum,B)};var O3={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},A3=function(B){if(B===null)return"";return B=O3[B]||B,String.fromCharCode(B)},g6=14,b8=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],O4=function(){var B=[],V=g6+1;while(V--)B.push({text:"",indent:0,offset:0});return B},_2=function(B,V){_2.prototype.init.call(this),this.field_=B||0,this.dataChannel_=V||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(U){var E,L,T,g,y;if(E=U.ccData&32639,E===this.lastControlCode_){this.lastControlCode_=null;return}if((E&61440)===4096)this.lastControlCode_=E;else if(E!==this.PADDING_)this.lastControlCode_=null;if(T=E>>>8,g=E&255,E===this.PADDING_)return;else if(E===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(E===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(U.pts),this.flushDisplayed(U.pts),L=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=L,this.startPts_=U.pts;else if(E===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(U.pts);else if(E===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(U.pts);else if(E===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(U.pts);else if(E===this.CARRIAGE_RETURN_)this.clearFormatting(U.pts),this.flushDisplayed(U.pts),this.shiftRowsUp_(),this.startPts_=U.pts;else if(E===this.BACKSPACE_)if(this.mode_==="popOn")this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1);else this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1);else if(E===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(U.pts),this.displayed_=O4();else if(E===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=O4();else if(E===this.RESUME_DIRECT_CAPTIONING_){if(this.mode_!=="paintOn")this.flushDisplayed(U.pts),this.displayed_=O4();this.mode_="paintOn",this.startPts_=U.pts}else if(this.isSpecialCharacter(T,g))T=(T&3)<<8,y=A3(T|g),this[this.mode_](U.pts,y),this.column_++;else if(this.isExtCharacter(T,g)){if(this.mode_==="popOn")this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1);else this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1);T=(T&3)<<8,y=A3(T|g),this[this.mode_](U.pts,y),this.column_++}else if(this.isMidRowCode(T,g)){if(this.clearFormatting(U.pts),this[this.mode_](U.pts," "),this.column_++,(g&14)===14)this.addFormatting(U.pts,["i"]);if((g&1)===1)this.addFormatting(U.pts,["u"])}else if(this.isOffsetControlCode(T,g)){let c=g&3;this.nonDisplayed_[this.row_].offset=c,this.column_+=c}else if(this.isPAC(T,g)){var p=b8.indexOf(E&7968);if(this.mode_==="rollUp"){if(p-this.rollUpRows_+1<0)p=this.rollUpRows_-1;this.setRollUp(U.pts,p)}if(p!==this.row_&&p>=0&&p<=14)this.clearFormatting(U.pts),this.row_=p;if(g&1&&this.formatting_.indexOf("u")===-1)this.addFormatting(U.pts,["u"]);if((E&16)===16){let c=(E&14)>>1;this.column_=c*4,this.nonDisplayed_[this.row_].indent+=c}if(this.isColorPAC(g)){if((g&14)===14)this.addFormatting(U.pts,["i"])}}else if(this.isNormalChar(T)){if(g===0)g=null;y=A3(T),y+=A3(g),this[this.mode_](U.pts,y),this.column_+=y.length}}};_2.prototype=new x6,_2.prototype.flushDisplayed=function(B){let V=(E)=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+E+"."})},U=[];if(this.displayed_.forEach((E,L)=>{if(E&&E.text&&E.text.length){try{E.text=E.text.trim()}catch(T){V(L)}if(E.text.length)U.push({text:E.text,line:L+1,position:10+Math.min(70,E.indent*10)+E.offset*2.5})}else if(E===void 0||E===null)V(L)}),U.length)this.trigger("data",{startPts:this.startPts_,endPts:B,content:U,stream:this.name_})},_2.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=O4(),this.nonDisplayed_=O4(),this.lastControlCode_=null,this.column_=0,this.row_=g6,this.rollUpRows_=2,this.formatting_=[]},_2.prototype.setConstants=function(){if(this.dataChannel_===0)this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23;else if(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},_2.prototype.isSpecialCharacter=function(B,V){return B===this.EXT_&&V>=48&&V<=63},_2.prototype.isExtCharacter=function(B,V){return(B===this.EXT_+1||B===this.EXT_+2)&&V>=32&&V<=63},_2.prototype.isMidRowCode=function(B,V){return B===this.EXT_&&V>=32&&V<=47},_2.prototype.isOffsetControlCode=function(B,V){return B===this.OFFSET_&&V>=33&&V<=35},_2.prototype.isPAC=function(B,V){return B>=this.BASE_&&B<this.BASE_+8&&V>=64&&V<=127},_2.prototype.isColorPAC=function(B){return B>=64&&B<=79||B>=96&&B<=127},_2.prototype.isNormalChar=function(B){return B>=32&&B<=127},_2.prototype.setRollUp=function(B,V){if(this.mode_!=="rollUp")this.row_=g6,this.mode_="rollUp",this.flushDisplayed(B),this.nonDisplayed_=O4(),this.displayed_=O4();if(V!==void 0&&V!==this.row_)for(var U=0;U<this.rollUpRows_;U++)this.displayed_[V-U]=this.displayed_[this.row_-U],this.displayed_[this.row_-U]={text:"",indent:0,offset:0};if(V===void 0)V=this.row_;this.topRow_=V-this.rollUpRows_+1},_2.prototype.addFormatting=function(B,V){this.formatting_=this.formatting_.concat(V);var U=V.reduce(function(E,L){return E+"<"+L+">"},"");this[this.mode_](B,U)},_2.prototype.clearFormatting=function(B){if(!this.formatting_.length)return;var V=this.formatting_.reverse().reduce(function(U,E){return U+"</"+E+">"},"");this.formatting_=[],this[this.mode_](B,V)},_2.prototype.popOn=function(B,V){var U=this.nonDisplayed_[this.row_].text;U+=V,this.nonDisplayed_[this.row_].text=U},_2.prototype.rollUp=function(B,V){var U=this.displayed_[this.row_].text;U+=V,this.displayed_[this.row_].text=U},_2.prototype.shiftRowsUp_=function(){var B;for(B=0;B<this.topRow_;B++)this.displayed_[B]={text:"",indent:0,offset:0};for(B=this.row_+1;B<g6+1;B++)this.displayed_[B]={text:"",indent:0,offset:0};for(B=this.topRow_;B<this.row_;B++)this.displayed_[B]=this.displayed_[B+1];this.displayed_[this.row_]={text:"",indent:0,offset:0}},_2.prototype.paintOn=function(B,V){var U=this.displayed_[this.row_].text;U+=V,this.displayed_[this.row_].text=U};var D_={CaptionStream:o2,Cea608Stream:_2,Cea708Stream:F1},m8={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},M_=G,B_=8589934592,z3=4294967296,G9="shared",Y9=function(B,V){var U=1;if(B>V)U=-1;while(Math.abs(V-B)>z3)B+=U*B_;return B},S4=function(B){var V,U;S4.prototype.init.call(this),this.type_=B||G9,this.push=function(E){if(E.type==="metadata"){this.trigger("data",E);return}if(this.type_!==G9&&E.type!==this.type_)return;if(U===void 0)U=E.dts;E.dts=Y9(E.dts,U),E.pts=Y9(E.pts,U),V=E.dts,this.trigger("data",E)},this.flush=function(){U=V,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){U=void 0,V=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};S4.prototype=new M_;var F5={TimestampRolloverStream:S4,handleRollover:Y9},X9=(B,V,U)=>{if(!B)return-1;var E=U;for(;E<B.length;E++)if(B[E]===V)return E;return-1},M2={typedArrayIndexOf:X9},I6=M2.typedArrayIndexOf,P6={Iso88591:0,Utf16:1,Utf16be:2,Utf8:3},O_=function(B,V,U){var E,L="";for(E=V;E<U;E++)L+="%"+("00"+B[E].toString(16)).slice(-2);return L},y6=function(B,V,U){return decodeURIComponent(O_(B,V,U))},f8=function(B,V,U){return unescape(O_(B,V,U))},t3=function(B){return B[0]<<21|B[1]<<14|B[2]<<7|B[3]},s3={APIC:function(B){var V=1,U,E,L="-->";if(B.data[0]!==P6.Utf8)return;if(U=I6(B.data,0,V),U<0)return;if(B.mimeType=f8(B.data,V,U),V=U+1,B.pictureType=B.data[V],V++,E=I6(B.data,0,V),E<0)return;if(B.description=y6(B.data,V,E),V=E+1,B.mimeType===L)B.url=f8(B.data,V,B.data.length);else B.pictureData=B.data.subarray(V,B.data.length)},"T*":function(B){if(B.data[0]!==P6.Utf8)return;B.value=y6(B.data,1,B.data.length).replace(/\0*$/,""),B.values=B.value.split("\x00")},TXXX:function(B){var V;if(B.data[0]!==P6.Utf8)return;if(V=I6(B.data,0,1),V===-1)return;B.description=y6(B.data,1,V),B.value=y6(B.data,V+1,B.data.length).replace(/\0*$/,""),B.data=B.value},"W*":function(B){B.url=f8(B.data,0,B.data.length).replace(/\0.*$/,"")},WXXX:function(B){var V;if(B.data[0]!==P6.Utf8)return;if(V=I6(B.data,0,1),V===-1)return;B.description=y6(B.data,1,V),B.url=f8(B.data,V+1,B.data.length).replace(/\0.*$/,"")},PRIV:function(B){var V;for(V=0;V<B.data.length;V++)if(B.data[V]===0){B.owner=f8(B.data,0,V);break}B.privateData=B.data.subarray(V+1),B.data=B.privateData}},A_=function(B){var V,U,E=10,L=0,T=[];if(B.length<10||B[0]!==73||B[1]!==68||B[2]!==51)return;L=t3(B.subarray(6,10)),L+=10;var g=B[5]&64;if(g)E+=4,E+=t3(B.subarray(10,14)),L-=t3(B.subarray(16,20));do{if(V=t3(B.subarray(E+4,E+8)),V<1)break;U=String.fromCharCode(B[E],B[E+1],B[E+2],B[E+3]);var y={id:U,data:B.subarray(E+10,E+V+10)};if(y.key=y.id,s3[y.id])s3[y.id](y);else if(y.id[0]==="T")s3["T*"](y);else if(y.id[0]==="W")s3["W*"](y);T.push(y),E+=10,E+=V}while(E<L);return T},r2={parseId3Frames:A_,parseSyncSafeInteger:t3,frameParsers:s3},A2=G,K9=m8,t5=r2,n3;n3=function(B){var V={descriptor:B&&B.descriptor},U=0,E=[],L=0,T;if(n3.prototype.init.call(this),this.dispatchType=K9.METADATA_STREAM_TYPE.toString(16),V.descriptor)for(T=0;T<V.descriptor.length;T++)this.dispatchType+=("00"+V.descriptor[T].toString(16)).slice(-2);this.push=function(g){var y,p,c,e,J0,P0;if(g.type!=="timed-metadata")return;if(g.dataAlignmentIndicator)L=0,E.length=0;if(E.length===0&&(g.data.length<10||g.data[0]!==73||g.data[1]!==68||g.data[2]!==51)){this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});return}if(E.push(g),L+=g.data.byteLength,E.length===1)U=t5.parseSyncSafeInteger(g.data.subarray(6,10)),U+=10;if(L<U)return;y={data:new Uint8Array(U),frames:[],pts:E[0].pts,dts:E[0].dts};for(J0=0;J0<U;)y.data.set(E[0].data.subarray(0,U-J0),J0),J0+=E[0].data.byteLength,L-=E[0].data.byteLength,E.shift();if(p=10,y.data[5]&64)p+=4,p+=t5.parseSyncSafeInteger(y.data.subarray(10,14)),U-=t5.parseSyncSafeInteger(y.data.subarray(16,20));do{if(c=t5.parseSyncSafeInteger(y.data.subarray(p+4,p+8)),c<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break}if(P0=String.fromCharCode(y.data[p],y.data[p+1],y.data[p+2],y.data[p+3]),e={id:P0,data:y.data.subarray(p+10,p+c+10)},e.key=e.id,t5.frameParsers[e.id])t5.frameParsers[e.id](e);else if(e.id[0]==="T")t5.frameParsers["T*"](e);else if(e.id[0]==="W")t5.frameParsers["W*"](e);if(e.owner==="com.apple.streaming.transportStreamTimestamp"){var H0=e.data,i0=(H0[3]&1)<<30|H0[4]<<22|H0[5]<<14|H0[6]<<6|H0[7]>>>2;if(i0*=4,i0+=H0[7]&3,e.timeStamp=i0,y.pts===void 0&&y.dts===void 0)y.pts=e.timeStamp,y.dts=e.timeStamp;this.trigger("timestamp",e)}y.frames.push(e),p+=10,p+=c}while(p<U);this.trigger("data",y)}},n3.prototype=new A2;var z_=n3,A4=G,b6=D_,g5=m8,H_=F5.TimestampRolloverStream,k8,m6,u8,o3=188,Z9=71;k8=function(){var B=new Uint8Array(o3),V=0;k8.prototype.init.call(this),this.push=function(U){var E=0,L=o3,T;if(V)T=new Uint8Array(U.byteLength+V),T.set(B.subarray(0,V)),T.set(U,V),V=0;else T=U;while(L<T.byteLength){if(T[E]===Z9&&T[L]===Z9){this.trigger("data",T.subarray(E,L)),E+=o3,L+=o3;continue}E++,L++}if(E<T.byteLength)B.set(T.subarray(E),0),V=T.byteLength-E},this.flush=function(){if(V===o3&&B[0]===Z9)this.trigger("data",B),V=0;this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){V=0,this.trigger("reset")}},k8.prototype=new A4,m6=function(){var B,V,U,E;m6.prototype.init.call(this),E=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,B=function(L,T){var g=0;if(T.payloadUnitStartIndicator)g+=L[g]+1;if(T.type==="pat")V(L.subarray(g),T);else U(L.subarray(g),T)},V=function(L,T){T.section_number=L[7],T.last_section_number=L[8],E.pmtPid=(L[10]&31)<<8|L[11],T.pmtPid=E.pmtPid},U=function(L,T){var g,y,p,c;if(!(L[5]&1))return;E.programMapTable={video:null,audio:null,"timed-metadata":{}},g=(L[1]&15)<<8|L[2],y=3+g-4,p=(L[10]&15)<<8|L[11],c=12+p;while(c<y){var e=L[c],J0=(L[c+1]&31)<<8|L[c+2];if(e===g5.H264_STREAM_TYPE&&E.programMapTable.video===null)E.programMapTable.video=J0;else if(e===g5.ADTS_STREAM_TYPE&&E.programMapTable.audio===null)E.programMapTable.audio=J0;else if(e===g5.METADATA_STREAM_TYPE)E.programMapTable["timed-metadata"][J0]=e;c+=((L[c+3]&15)<<8|L[c+4])+5}T.programMapTable=E.programMapTable},this.push=function(L){var T={},g=4;if(T.payloadUnitStartIndicator=!!(L[1]&64),T.pid=L[1]&31,T.pid<<=8,T.pid|=L[2],(L[3]&48)>>>4>1)g+=L[g]+1;if(T.pid===0)T.type="pat",B(L.subarray(g),T),this.trigger("data",T);else if(T.pid===this.pmtPid){T.type="pmt",B(L.subarray(g),T),this.trigger("data",T);while(this.packetsWaitingForPmt.length)this.processPes_.apply(this,this.packetsWaitingForPmt.shift())}else if(this.programMapTable===void 0)this.packetsWaitingForPmt.push([L,g,T]);else this.processPes_(L,g,T)},this.processPes_=function(L,T,g){if(g.pid===this.programMapTable.video)g.streamType=g5.H264_STREAM_TYPE;else if(g.pid===this.programMapTable.audio)g.streamType=g5.ADTS_STREAM_TYPE;else g.streamType=this.programMapTable["timed-metadata"][g.pid];g.type="pes",g.data=L.subarray(T),this.trigger("data",g)}},m6.prototype=new A4,m6.STREAM_TYPES={h264:27,adts:15},u8=function(){var B=this,V=!1,U={data:[],size:0},E={data:[],size:0},L={data:[],size:0},T,g=function(p,c){var e;let J0=p[0]<<16|p[1]<<8|p[2];if(c.data=new Uint8Array,J0!==1)return;if(c.packetLength=6+(p[4]<<8|p[5]),c.dataAlignmentIndicator=(p[6]&4)!==0,e=p[7],e&192){if(c.pts=(p[9]&14)<<27|(p[10]&255)<<20|(p[11]&254)<<12|(p[12]&255)<<5|(p[13]&254)>>>3,c.pts*=4,c.pts+=(p[13]&6)>>>1,c.dts=c.pts,e&64)c.dts=(p[14]&14)<<27|(p[15]&255)<<20|(p[16]&254)<<12|(p[17]&255)<<5|(p[18]&254)>>>3,c.dts*=4,c.dts+=(p[18]&6)>>>1}c.data=p.subarray(9+p[8])},y=function(p,c,e){var J0=new Uint8Array(p.size),P0={type:c},H0=0,i0=0,e0=!1,x2;if(!p.data.length||p.size<9)return;P0.trackId=p.data[0].pid;for(H0=0;H0<p.data.length;H0++)x2=p.data[H0],J0.set(x2.data,i0),i0+=x2.data.byteLength;if(g(J0,P0),e0=c==="video"||P0.packetLength<=p.size,e||e0)p.size=0,p.data.length=0;if(e0)B.trigger("data",P0)};u8.prototype.init.call(this),this.push=function(p){({pat:function(){},pes:function(){var c,e;switch(p.streamType){case g5.H264_STREAM_TYPE:c=U,e="video";break;case g5.ADTS_STREAM_TYPE:c=E,e="audio";break;case g5.METADATA_STREAM_TYPE:c=L,e="timed-metadata";break;default:return}if(p.payloadUnitStartIndicator)y(c,e,!0);c.data.push(p),c.size+=p.data.byteLength},pmt:function(){var c={type:"metadata",tracks:[]};if(T=p.programMapTable,T.video!==null)c.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+T.video,codec:"avc",type:"video"});if(T.audio!==null)c.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+T.audio,codec:"adts",type:"audio"});V=!0,B.trigger("data",c)}})[p.type]()},this.reset=function(){U.size=0,U.data.length=0,E.size=0,E.data.length=0,this.trigger("reset")},this.flushStreams_=function(){y(U,"video"),y(E,"audio"),y(L,"timed-metadata")},this.flush=function(){if(!V&&T){var p={type:"metadata",tracks:[]};if(T.video!==null)p.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+T.video,codec:"avc",type:"video"});if(T.audio!==null)p.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+T.audio,codec:"adts",type:"audio"});B.trigger("data",p)}V=!1,this.flushStreams_(),this.trigger("done")}},u8.prototype=new A4;var V_={PAT_PID:0,MP2T_PACKET_LENGTH:o3,TransportPacketStream:k8,TransportParseStream:m6,ElementaryStream:u8,TimestampRolloverStream:H_,CaptionStream:b6.CaptionStream,Cea608Stream:b6.Cea608Stream,Cea708Stream:b6.Cea708Stream,MetadataStream:z_};for(var p8 in g5)if(g5.hasOwnProperty(p8))V_[p8]=g5[p8];var kY=V_,eJ=G,uY=I0.ONE_SECOND_IN_TS,l8,U_=[96000,88200,64000,48000,44100,32000,24000,22050,16000,12000,11025,8000,7350];l8=function(B){var V,U=0;l8.prototype.init.call(this),this.skipWarn_=function(E,L){this.trigger("log",{level:"warn",message:`adts skiping bytes ${E} to ${L} in frame ${U} outside syncword`})},this.push=function(E){var L=0,T,g,y,p,c;if(!B)U=0;if(E.type!=="audio")return;if(V&&V.length)y=V,V=new Uint8Array(y.byteLength+E.data.byteLength),V.set(y),V.set(E.data,y.byteLength);else V=E.data;var e;while(L+7<V.length){if(V[L]!==255||(V[L+1]&246)!==240){if(typeof e!=="number")e=L;L++;continue}if(typeof e==="number")this.skipWarn_(e,L),e=null;if(g=(~V[L+1]&1)*2,T=(V[L+3]&3)<<11|V[L+4]<<3|(V[L+5]&224)>>5,p=((V[L+6]&3)+1)*1024,c=p*uY/U_[(V[L+2]&60)>>>2],V.byteLength-L<T)break;this.trigger("data",{pts:E.pts+U*c,dts:E.dts+U*c,sampleCount:p,audioobjecttype:(V[L+2]>>>6&3)+1,channelcount:(V[L+2]&1)<<2|(V[L+3]&192)>>>6,samplerate:U_[(V[L+2]&60)>>>2],samplingfrequencyindex:(V[L+2]&60)>>>2,samplesize:16,data:V.subarray(L+7+g,L+T)}),U++,L+=T}if(typeof e==="number")this.skipWarn_(e,L),e=null;V=V.subarray(L)},this.flush=function(){U=0,this.trigger("done")},this.reset=function(){V=void 0,this.trigger("reset")},this.endTimeline=function(){V=void 0,this.trigger("endedtimeline")}},l8.prototype=new eJ;var E_=l8,C_;C_=function(B){var V=B.byteLength,U=0,E=0;this.length=function(){return 8*V},this.bitsAvailable=function(){return 8*V+E},this.loadWord=function(){var L=B.byteLength-V,T=new Uint8Array(4),g=Math.min(4,V);if(g===0)throw Error("no bytes available");T.set(B.subarray(L,L+g)),U=new DataView(T.buffer).getUint32(0),E=g*8,V-=g},this.skipBits=function(L){var T;if(E>L)U<<=L,E-=L;else L-=E,T=Math.floor(L/8),L-=T*8,V-=T,this.loadWord(),U<<=L,E-=L},this.readBits=function(L){var T=Math.min(E,L),g=U>>>32-T;if(E-=T,E>0)U<<=T;else if(V>0)this.loadWord();if(T=L-T,T>0)return g<<T|this.readBits(T);return g},this.skipLeadingZeros=function(){var L;for(L=0;L<E;++L)if((U&2147483648>>>L)!==0)return U<<=L,E-=L,L;return this.loadWord(),L+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var L=this.skipLeadingZeros();return this.readBits(L+1)-1},this.readExpGolomb=function(){var L=this.readUnsignedExpGolomb();if(1&L)return 1+L>>>1;return-1*(L>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var pY=C_,N_=G,lY=pY,i8,c8,$_;c8=function(){var B=0,V,U;c8.prototype.init.call(this),this.push=function(E){var L;if(!U)U=E.data;else L=new Uint8Array(U.byteLength+E.data.byteLength),L.set(U),L.set(E.data,U.byteLength),U=L;var T=U.byteLength;for(;B<T-3;B++)if(U[B+2]===1){V=B+5;break}while(V<T)switch(U[V]){case 0:if(U[V-1]!==0){V+=2;break}else if(U[V-2]!==0){V++;break}if(B+3!==V-2)this.trigger("data",U.subarray(B+3,V-2));do V++;while(U[V]!==1&&V<T);B=V-2,V+=3;break;case 1:if(U[V-1]!==0||U[V-2]!==0){V+=3;break}this.trigger("data",U.subarray(B+3,V-2)),B=V-2,V+=3;break;default:V+=3;break}U=U.subarray(B),V-=B,B=0},this.reset=function(){U=null,B=0,this.trigger("reset")},this.flush=function(){if(U&&U.byteLength>3)this.trigger("data",U.subarray(B+3));U=null,B=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},c8.prototype=new N_,$_={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},i8=function(){var B=new c8,V,U,E,L,T,g,y;i8.prototype.init.call(this),V=this,this.push=function(p){if(p.type!=="video")return;U=p.trackId,E=p.pts,L=p.dts,B.push(p)},B.on("data",function(p){var c={trackId:U,pts:E,dts:L,data:p,nalUnitTypeCode:p[0]&31};switch(c.nalUnitTypeCode){case 5:c.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:c.nalUnitType="sei_rbsp",c.escapedRBSP=T(p.subarray(1));break;case 7:c.nalUnitType="seq_parameter_set_rbsp",c.escapedRBSP=T(p.subarray(1)),c.config=g(c.escapedRBSP);break;case 8:c.nalUnitType="pic_parameter_set_rbsp";break;case 9:c.nalUnitType="access_unit_delimiter_rbsp";break}V.trigger("data",c)}),B.on("done",function(){V.trigger("done")}),B.on("partialdone",function(){V.trigger("partialdone")}),B.on("reset",function(){V.trigger("reset")}),B.on("endedtimeline",function(){V.trigger("endedtimeline")}),this.flush=function(){B.flush()},this.partialFlush=function(){B.partialFlush()},this.reset=function(){B.reset()},this.endTimeline=function(){B.endTimeline()},y=function(p,c){var e=8,J0=8,P0,H0;for(P0=0;P0<p;P0++){if(J0!==0)H0=c.readExpGolomb(),J0=(e+H0+256)%256;e=J0===0?e:J0}},T=function(p){var c=p.byteLength,e=[],J0=1,P0,H0;while(J0<c-2)if(p[J0]===0&&p[J0+1]===0&&p[J0+2]===3)e.push(J0+2),J0+=2;else J0++;if(e.length===0)return p;P0=c-e.length,H0=new Uint8Array(P0);var i0=0;for(J0=0;J0<P0;i0++,J0++){if(i0===e[0])i0++,e.shift();H0[J0]=p[i0]}return H0},g=function(p){var c=0,e=0,J0=0,P0=0,H0,i0,e0,x2,z5,C3,s6,n6,o6,r6,O7,i1=[1,1],M1,y5;if(H0=new lY(p),i0=H0.readUnsignedByte(),x2=H0.readUnsignedByte(),e0=H0.readUnsignedByte(),H0.skipUnsignedExpGolomb(),$_[i0]){if(z5=H0.readUnsignedExpGolomb(),z5===3)H0.skipBits(1);if(H0.skipUnsignedExpGolomb(),H0.skipUnsignedExpGolomb(),H0.skipBits(1),H0.readBoolean()){O7=z5!==3?8:12;for(y5=0;y5<O7;y5++)if(H0.readBoolean())if(y5<6)y(16,H0);else y(64,H0)}}if(H0.skipUnsignedExpGolomb(),C3=H0.readUnsignedExpGolomb(),C3===0)H0.readUnsignedExpGolomb();else if(C3===1){H0.skipBits(1),H0.skipExpGolomb(),H0.skipExpGolomb(),s6=H0.readUnsignedExpGolomb();for(y5=0;y5<s6;y5++)H0.skipExpGolomb()}if(H0.skipUnsignedExpGolomb(),H0.skipBits(1),n6=H0.readUnsignedExpGolomb(),o6=H0.readUnsignedExpGolomb(),r6=H0.readBits(1),r6===0)H0.skipBits(1);if(H0.skipBits(1),H0.readBoolean())c=H0.readUnsignedExpGolomb(),e=H0.readUnsignedExpGolomb(),J0=H0.readUnsignedExpGolomb(),P0=H0.readUnsignedExpGolomb();if(H0.readBoolean()){if(H0.readBoolean()){switch(M1=H0.readUnsignedByte(),M1){case 1:i1=[1,1];break;case 2:i1=[12,11];break;case 3:i1=[10,11];break;case 4:i1=[16,11];break;case 5:i1=[40,33];break;case 6:i1=[24,11];break;case 7:i1=[20,11];break;case 8:i1=[32,11];break;case 9:i1=[80,33];break;case 10:i1=[18,11];break;case 11:i1=[15,11];break;case 12:i1=[64,33];break;case 13:i1=[160,99];break;case 14:i1=[4,3];break;case 15:i1=[3,2];break;case 16:i1=[2,1];break;case 255:{i1=[H0.readUnsignedByte()<<8|H0.readUnsignedByte(),H0.readUnsignedByte()<<8|H0.readUnsignedByte()];break}}if(i1)i1[0]/i1[1]}}return{profileIdc:i0,levelIdc:e0,profileCompatibility:x2,width:(n6+1)*16-c*2-e*2,height:(2-r6)*(o6+1)*16-J0*2-P0*2,sarRatio:i1}}},i8.prototype=new N_;var f6={H264Stream:i8,NalByteStream:c8},iY=[96000,88200,64000,48000,44100,32000,24000,22050,16000,12000,11025,8000,7350],d8=function(B,V){var U=B[V+6]<<21|B[V+7]<<14|B[V+8]<<7|B[V+9],E=B[V+5],L=(E&16)>>4;if(U=U>=0?U:0,L)return U+20;return U+10},a8=function(B,V){if(B.length-V<10||B[V]!==73||B[V+1]!==68||B[V+2]!==51)return V;return V+=d8(B,V),a8(B,V)},cY=function(B){var V=a8(B,0);return B.length>=V+2&&(B[V]&255)===255&&(B[V+1]&240)===240&&(B[V+1]&22)===16},J9=function(B){return B[0]<<21|B[1]<<14|B[2]<<7|B[3]},hq=function(B,V,U){var E,L="";for(E=V;E<U;E++)L+="%"+("00"+B[E].toString(16)).slice(-2);return L},dY=function(B,V,U){return unescape(hq(B,V,U))},aY=function(B,V){var U=(B[V+5]&224)>>5,E=B[V+4]<<3,L=B[V+3]&6144;return L|E|U},tY=function(B,V){if(B[V]===73&&B[V+1]===68&&B[V+2]===51)return"timed-metadata";else if(B[V]&!0&&(B[V+1]&240)===240)return"audio";return null},sY=function(B){var V=0;while(V+5<B.length){if(B[V]!==255||(B[V+1]&246)!==240){V++;continue}return iY[(B[V+2]&60)>>>2]}return null},nY=function(B){var V,U,E,L;if(V=10,B[5]&64)V+=4,V+=J9(B.subarray(10,14));do{if(U=J9(B.subarray(V+4,V+8)),U<1)return null;if(L=String.fromCharCode(B[V],B[V+1],B[V+2],B[V+3]),L==="PRIV"){E=B.subarray(V+10,V+U+10);for(var T=0;T<E.byteLength;T++)if(E[T]===0){var g=dY(E,0,T);if(g==="com.apple.streaming.transportStreamTimestamp"){var y=E.subarray(T+1),p=(y[3]&1)<<30|y[4]<<22|y[5]<<14|y[6]<<6|y[7]>>>2;return p*=4,p+=y[7]&3,p}break}}V+=10,V+=U}while(V<B.byteLength);return null},t8={isLikelyAacData:cY,parseId3TagSize:d8,parseAdtsSize:aY,parseType:tY,parseSampleRate:sY,parseAacTimestamp:nY},oY=G,L_=t8,k6;k6=function(){var B=new Uint8Array,V=0;k6.prototype.init.call(this),this.setTimestamp=function(U){V=U},this.push=function(U){var E=0,L=0,T,g,y,p;if(B.length)p=B.length,B=new Uint8Array(U.byteLength+p),B.set(B.subarray(0,p)),B.set(U,p);else B=U;while(B.length-L>=3){if(B[L]===73&&B[L+1]===68&&B[L+2]===51){if(B.length-L<10)break;if(E=L_.parseId3TagSize(B,L),L+E>B.length)break;g={type:"timed-metadata",data:B.subarray(L,L+E)},this.trigger("data",g),L+=E;continue}else if((B[L]&255)===255&&(B[L+1]&240)===240){if(B.length-L<7)break;if(E=L_.parseAdtsSize(B,L),L+E>B.length)break;y={type:"audio",data:B.subarray(L,L+E),pts:V,dts:V},this.trigger("data",y),L+=E;continue}L++}if(T=B.length-L,T>0)B=B.subarray(L);else B=new Uint8Array},this.reset=function(){B=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){B=new Uint8Array,this.trigger("endedtimeline")}},k6.prototype=new oY;var rY=k6,eY=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],hX=eY,j_=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],_X=j_,s8=G,n8=w0,o8=O2,r8=f0,O5=N1,z4=kY,r3=I0,F_=E_,GX=f6.H264Stream,T_=rY,YX=t8.isLikelyAacData,XX=I0.ONE_SECOND_IN_TS,_3=hX,u6=_X,p6,H3,e8,V3,_q=function(B,V){V.stream=B,this.trigger("log",V)},b2=function(B,V){var U=Object.keys(V);for(var E=0;E<U.length;E++){var L=U[E];if(L==="headOfPipeline"||!V[L].on)continue;V[L].on("log",_q.bind(B,L))}},W_=function(B,V){var U;if(B.length!==V.length)return!1;for(U=0;U<B.length;U++)if(B[U]!==V[U])return!1;return!0},q9=function(B,V,U,E,L,T){var g=U-V,y=E-V,p=L-U;return{start:{dts:B,pts:B+g},end:{dts:B+y,pts:B+p},prependedContentDuration:T,baseMediaDecodeTime:B}};H3=function(B,V){var U=[],E,L=0,T=0,g=1/0;V=V||{},E=V.firstSequenceNumber||0,H3.prototype.init.call(this),this.push=function(y){if(O5.collectDtsInfo(B,y),B)_3.forEach(function(p){B[p]=y[p]});U.push(y)},this.setEarliestDts=function(y){L=y},this.setVideoBaseMediaDecodeTime=function(y){g=y},this.setAudioAppendStart=function(y){T=y},this.flush=function(){var y,p,c,e,J0,P0,H0;if(U.length===0){this.trigger("done","AudioSegmentStream");return}if(y=r8.trimAdtsFramesByEarliestDts(U,B,L),B.baseMediaDecodeTime=O5.calculateTrackBaseMediaDecodeTime(B,V.keepOriginalTimestamps),H0=r8.prefixWithSilence(B,y,T,g),B.samples=r8.generateSampleTable(y),c=n8.mdat(r8.concatenateFrameData(y)),U=[],p=n8.moof(E,[B]),e=new Uint8Array(p.byteLength+c.byteLength),E++,e.set(p),e.set(c,p.byteLength),O5.clearDtsInfo(B),J0=Math.ceil(XX*1024/B.samplerate),y.length)P0=y.length*J0,this.trigger("segmentTimingInfo",q9(r3.audioTsToVideoTs(B.baseMediaDecodeTime,B.samplerate),y[0].dts,y[0].pts,y[0].dts+P0,y[0].pts+P0,H0||0)),this.trigger("timingInfo",{start:y[0].pts,end:y[0].pts+P0});this.trigger("data",{track:B,boxes:e}),this.trigger("done","AudioSegmentStream")},this.reset=function(){O5.clearDtsInfo(B),U=[],this.trigger("reset")}},H3.prototype=new s8,p6=function(B,V){var U,E=[],L=[],T,g;V=V||{},U=V.firstSequenceNumber||0,p6.prototype.init.call(this),delete B.minPTS,this.gopCache_=[],this.push=function(y){if(O5.collectDtsInfo(B,y),y.nalUnitType==="seq_parameter_set_rbsp"&&!T)T=y.config,B.sps=[y.data],u6.forEach(function(p){B[p]=T[p]},this);if(y.nalUnitType==="pic_parameter_set_rbsp"&&!g)g=y.data,B.pps=[y.data];E.push(y)},this.flush=function(){var y,p,c,e,J0,P0,H0=0,i0,e0;while(E.length){if(E[0].nalUnitType==="access_unit_delimiter_rbsp")break;E.shift()}if(E.length===0){this.resetStream_(),this.trigger("done","VideoSegmentStream");return}if(y=o8.groupNalsIntoFrames(E),c=o8.groupFramesIntoGops(y),!c[0][0].keyFrame)if(p=this.getGopForFusion_(E[0],B),p)H0=p.duration,c.unshift(p),c.byteLength+=p.byteLength,c.nalCount+=p.nalCount,c.pts=p.pts,c.dts=p.dts,c.duration+=p.duration;else c=o8.extendFirstKeyFrame(c);if(L.length){var x2;if(V.alignGopsAtEnd)x2=this.alignGopsAtEnd_(c);else x2=this.alignGopsAtStart_(c);if(!x2){this.gopCache_.unshift({gop:c.pop(),pps:B.pps,sps:B.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),E=[],this.resetStream_(),this.trigger("done","VideoSegmentStream");return}O5.clearDtsInfo(B),c=x2}O5.collectDtsInfo(B,c),B.samples=o8.generateSampleTable(c),J0=n8.mdat(o8.concatenateNalData(c)),B.baseMediaDecodeTime=O5.calculateTrackBaseMediaDecodeTime(B,V.keepOriginalTimestamps),this.trigger("processedGopsInfo",c.map(function(z5){return{pts:z5.pts,dts:z5.dts,byteLength:z5.byteLength}})),i0=c[0],e0=c[c.length-1],this.trigger("segmentTimingInfo",q9(B.baseMediaDecodeTime,i0.dts,i0.pts,e0.dts+e0.duration,e0.pts+e0.duration,H0)),this.trigger("timingInfo",{start:c[0].pts,end:c[c.length-1].pts+c[c.length-1].duration}),this.gopCache_.unshift({gop:c.pop(),pps:B.pps,sps:B.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),E=[],this.trigger("baseMediaDecodeTime",B.baseMediaDecodeTime),this.trigger("timelineStartInfo",B.timelineStartInfo),e=n8.moof(U,[B]),P0=new Uint8Array(e.byteLength+J0.byteLength),U++,P0.set(e),P0.set(J0,e.byteLength),this.trigger("data",{track:B,boxes:P0}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),E=[],this.gopCache_.length=0,L.length=0,this.trigger("reset")},this.resetStream_=function(){O5.clearDtsInfo(B),T=void 0,g=void 0},this.getGopForFusion_=function(y){var p=45000,c=1e4,e=1/0,J0,P0,H0,i0,e0;for(e0=0;e0<this.gopCache_.length;e0++){if(i0=this.gopCache_[e0],H0=i0.gop,!(B.pps&&W_(B.pps[0],i0.pps[0]))||!(B.sps&&W_(B.sps[0],i0.sps[0])))continue;if(H0.dts<B.timelineStartInfo.dts)continue;if(J0=y.dts-H0.dts-H0.duration,J0>=-c&&J0<=p){if(!P0||e>J0)P0=i0,e=J0}}if(P0)return P0.gop;return null},this.alignGopsAtStart_=function(y){var p,c,e,J0,P0,H0,i0,e0;P0=y.byteLength,H0=y.nalCount,i0=y.duration,p=c=0;while(p<L.length&&c<y.length){if(e=L[p],J0=y[c],e.pts===J0.pts)break;if(J0.pts>e.pts){p++;continue}c++,P0-=J0.byteLength,H0-=J0.nalCount,i0-=J0.duration}if(c===0)return y;if(c===y.length)return null;return e0=y.slice(c),e0.byteLength=P0,e0.duration=i0,e0.nalCount=H0,e0.pts=e0[0].pts,e0.dts=e0[0].dts,e0},this.alignGopsAtEnd_=function(y){var p,c,e,J0,P0,H0;p=L.length-1,c=y.length-1,P0=null,H0=!1;while(p>=0&&c>=0){if(e=L[p],J0=y[c],e.pts===J0.pts){H0=!0;break}if(e.pts>J0.pts){p--;continue}if(p===L.length-1)P0=c;c--}if(!H0&&P0===null)return null;var i0;if(H0)i0=c;else i0=P0;if(i0===0)return y;var e0=y.slice(i0),x2=e0.reduce(function(z5,C3){return z5.byteLength+=C3.byteLength,z5.duration+=C3.duration,z5.nalCount+=C3.nalCount,z5},{byteLength:0,duration:0,nalCount:0});return e0.byteLength=x2.byteLength,e0.duration=x2.duration,e0.nalCount=x2.nalCount,e0.pts=e0[0].pts,e0.dts=e0[0].dts,e0},this.alignGopsWith=function(y){L=y}},p6.prototype=new s8,V3=function(B,V){if(this.numberOfTracks=0,this.metadataStream=V,B=B||{},typeof B.remux<"u")this.remuxTracks=!!B.remux;else this.remuxTracks=!0;if(typeof B.keepOriginalTimestamps==="boolean")this.keepOriginalTimestamps=B.keepOriginalTimestamps;else this.keepOriginalTimestamps=!1;this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,V3.prototype.init.call(this),this.push=function(U){if(U.content||U.text)return this.pendingCaptions.push(U);if(U.frames)return this.pendingMetadata.push(U);if(this.pendingTracks.push(U.track),this.pendingBytes+=U.boxes.byteLength,U.track.type==="video")this.videoTrack=U.track,this.pendingBoxes.push(U.boxes);if(U.track.type==="audio")this.audioTrack=U.track,this.pendingBoxes.unshift(U.boxes)}},V3.prototype=new s8,V3.prototype.flush=function(B){var V=0,U={captions:[],captionStreams:{},metadata:[],info:{}},E,L,T,g=0,y;if(this.pendingTracks.length<this.numberOfTracks){if(B!=="VideoSegmentStream"&&B!=="AudioSegmentStream")return;else if(this.remuxTracks)return;else if(this.pendingTracks.length===0){if(this.emittedTracks++,this.emittedTracks>=this.numberOfTracks)this.trigger("done"),this.emittedTracks=0;return}}if(this.videoTrack)g=this.videoTrack.timelineStartInfo.pts,u6.forEach(function(p){U.info[p]=this.videoTrack[p]},this);else if(this.audioTrack)g=this.audioTrack.timelineStartInfo.pts,_3.forEach(function(p){U.info[p]=this.audioTrack[p]},this);if(this.videoTrack||this.audioTrack){if(this.pendingTracks.length===1)U.type=this.pendingTracks[0].type;else U.type="combined";this.emittedTracks+=this.pendingTracks.length,T=n8.initSegment(this.pendingTracks),U.initSegment=new Uint8Array(T.byteLength),U.initSegment.set(T),U.data=new Uint8Array(this.pendingBytes);for(y=0;y<this.pendingBoxes.length;y++)U.data.set(this.pendingBoxes[y],V),V+=this.pendingBoxes[y].byteLength;for(y=0;y<this.pendingCaptions.length;y++)E=this.pendingCaptions[y],E.startTime=r3.metadataTsToSeconds(E.startPts,g,this.keepOriginalTimestamps),E.endTime=r3.metadataTsToSeconds(E.endPts,g,this.keepOriginalTimestamps),U.captionStreams[E.stream]=!0,U.captions.push(E);for(y=0;y<this.pendingMetadata.length;y++)L=this.pendingMetadata[y],L.cueTime=r3.metadataTsToSeconds(L.pts,g,this.keepOriginalTimestamps),U.metadata.push(L);U.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",U);for(y=0;y<U.captions.length;y++)E=U.captions[y],this.trigger("caption",E);for(y=0;y<U.metadata.length;y++)L=U.metadata[y],this.trigger("id3Frame",L)}if(this.emittedTracks>=this.numberOfTracks)this.trigger("done"),this.emittedTracks=0},V3.prototype.setRemux=function(B){this.remuxTracks=B},e8=function(B){var V=this,U=!0,E,L;e8.prototype.init.call(this),B=B||{},this.baseMediaDecodeTime=B.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var T={};this.transmuxPipeline_=T,T.type="aac",T.metadataStream=new z4.MetadataStream,T.aacStream=new T_,T.audioTimestampRolloverStream=new z4.TimestampRolloverStream("audio"),T.timedMetadataTimestampRolloverStream=new z4.TimestampRolloverStream("timed-metadata"),T.adtsStream=new F_,T.coalesceStream=new V3(B,T.metadataStream),T.headOfPipeline=T.aacStream,T.aacStream.pipe(T.audioTimestampRolloverStream).pipe(T.adtsStream),T.aacStream.pipe(T.timedMetadataTimestampRolloverStream).pipe(T.metadataStream).pipe(T.coalesceStream),T.metadataStream.on("timestamp",function(g){T.aacStream.setTimestamp(g.timeStamp)}),T.aacStream.on("data",function(g){if(g.type!=="timed-metadata"&&g.type!=="audio"||T.audioSegmentStream)return;L=L||{timelineStartInfo:{baseMediaDecodeTime:V.baseMediaDecodeTime},codec:"adts",type:"audio"},T.coalesceStream.numberOfTracks++,T.audioSegmentStream=new H3(L,B),T.audioSegmentStream.on("log",V.getLogTrigger_("audioSegmentStream")),T.audioSegmentStream.on("timingInfo",V.trigger.bind(V,"audioTimingInfo")),T.adtsStream.pipe(T.audioSegmentStream).pipe(T.coalesceStream),V.trigger("trackinfo",{hasAudio:!!L,hasVideo:!!E})}),T.coalesceStream.on("data",this.trigger.bind(this,"data")),T.coalesceStream.on("done",this.trigger.bind(this,"done")),b2(this,T)},this.setupTsPipeline=function(){var T={};this.transmuxPipeline_=T,T.type="ts",T.metadataStream=new z4.MetadataStream,T.packetStream=new z4.TransportPacketStream,T.parseStream=new z4.TransportParseStream,T.elementaryStream=new z4.ElementaryStream,T.timestampRolloverStream=new z4.TimestampRolloverStream,T.adtsStream=new F_,T.h264Stream=new GX,T.captionStream=new z4.CaptionStream(B),T.coalesceStream=new V3(B,T.metadataStream),T.headOfPipeline=T.packetStream,T.packetStream.pipe(T.parseStream).pipe(T.elementaryStream).pipe(T.timestampRolloverStream),T.timestampRolloverStream.pipe(T.h264Stream),T.timestampRolloverStream.pipe(T.adtsStream),T.timestampRolloverStream.pipe(T.metadataStream).pipe(T.coalesceStream),T.h264Stream.pipe(T.captionStream).pipe(T.coalesceStream),T.elementaryStream.on("data",function(g){var y;if(g.type==="metadata"){y=g.tracks.length;while(y--)if(!E&&g.tracks[y].type==="video")E=g.tracks[y],E.timelineStartInfo.baseMediaDecodeTime=V.baseMediaDecodeTime;else if(!L&&g.tracks[y].type==="audio")L=g.tracks[y],L.timelineStartInfo.baseMediaDecodeTime=V.baseMediaDecodeTime;if(E&&!T.videoSegmentStream)T.coalesceStream.numberOfTracks++,T.videoSegmentStream=new p6(E,B),T.videoSegmentStream.on("log",V.getLogTrigger_("videoSegmentStream")),T.videoSegmentStream.on("timelineStartInfo",function(p){if(L&&!B.keepOriginalTimestamps)L.timelineStartInfo=p,T.audioSegmentStream.setEarliestDts(p.dts-V.baseMediaDecodeTime)}),T.videoSegmentStream.on("processedGopsInfo",V.trigger.bind(V,"gopInfo")),T.videoSegmentStream.on("segmentTimingInfo",V.trigger.bind(V,"videoSegmentTimingInfo")),T.videoSegmentStream.on("baseMediaDecodeTime",function(p){if(L)T.audioSegmentStream.setVideoBaseMediaDecodeTime(p)}),T.videoSegmentStream.on("timingInfo",V.trigger.bind(V,"videoTimingInfo")),T.h264Stream.pipe(T.videoSegmentStream).pipe(T.coalesceStream);if(L&&!T.audioSegmentStream)T.coalesceStream.numberOfTracks++,T.audioSegmentStream=new H3(L,B),T.audioSegmentStream.on("log",V.getLogTrigger_("audioSegmentStream")),T.audioSegmentStream.on("timingInfo",V.trigger.bind(V,"audioTimingInfo")),T.audioSegmentStream.on("segmentTimingInfo",V.trigger.bind(V,"audioSegmentTimingInfo")),T.adtsStream.pipe(T.audioSegmentStream).pipe(T.coalesceStream);V.trigger("trackinfo",{hasAudio:!!L,hasVideo:!!E})}}),T.coalesceStream.on("data",this.trigger.bind(this,"data")),T.coalesceStream.on("id3Frame",function(g){g.dispatchType=T.metadataStream.dispatchType,V.trigger("id3Frame",g)}),T.coalesceStream.on("caption",this.trigger.bind(this,"caption")),T.coalesceStream.on("done",this.trigger.bind(this,"done")),b2(this,T)},this.setBaseMediaDecodeTime=function(T){var g=this.transmuxPipeline_;if(!B.keepOriginalTimestamps)this.baseMediaDecodeTime=T;if(L){if(L.timelineStartInfo.dts=void 0,L.timelineStartInfo.pts=void 0,O5.clearDtsInfo(L),g.audioTimestampRolloverStream)g.audioTimestampRolloverStream.discontinuity()}if(E){if(g.videoSegmentStream)g.videoSegmentStream.gopCache_=[];E.timelineStartInfo.dts=void 0,E.timelineStartInfo.pts=void 0,O5.clearDtsInfo(E),g.captionStream.reset()}if(g.timestampRolloverStream)g.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(T){if(L)this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(T)},this.setRemux=function(T){var g=this.transmuxPipeline_;if(B.remux=T,g&&g.coalesceStream)g.coalesceStream.setRemux(T)},this.alignGopsWith=function(T){if(E&&this.transmuxPipeline_.videoSegmentStream)this.transmuxPipeline_.videoSegmentStream.alignGopsWith(T)},this.getLogTrigger_=function(T){var g=this;return function(y){y.stream=T,g.trigger("log",y)}},this.push=function(T){if(U){var g=YX(T);if(g&&this.transmuxPipeline_.type!=="aac")this.setupAacPipeline();else if(!g&&this.transmuxPipeline_.type!=="ts")this.setupTsPipeline();U=!1}this.transmuxPipeline_.headOfPipeline.push(T)},this.flush=function(){U=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){if(this.transmuxPipeline_.headOfPipeline)this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){if(this.transmuxPipeline_.captionStream)this.transmuxPipeline_.captionStream.reset()}},e8.prototype=new s8;var KX={Transmuxer:e8,VideoSegmentStream:p6,AudioSegmentStream:H3,AUDIO_PROPERTIES:_3,VIDEO_PROPERTIES:u6,generateSegmentTimingInfo:q9},ZX=function(B){return B>>>0},h7=function(B){return("00"+B.toString(16)).slice(-2)},_7={toUnsigned:ZX,toHexString:h7},Q9=function(B){var V="";return V+=String.fromCharCode(B[0]),V+=String.fromCharCode(B[1]),V+=String.fromCharCode(B[2]),V+=String.fromCharCode(B[3]),V},D9=Q9,Gq=_7.toUnsigned,M9=D9,B9=function(B,V){var U=[],E,L,T,g,y;if(!V.length)return null;for(E=0;E<B.byteLength;){if(L=Gq(B[E]<<24|B[E+1]<<16|B[E+2]<<8|B[E+3]),T=M9(B.subarray(E+4,E+8)),g=L>1?E+L:B.byteLength,T===V[0]){if(V.length===1)U.push(B.subarray(E+8,g));else if(y=B9(B.subarray(E+8,g),V.slice(1)),y.length)U=U.concat(y)}E=g}return U},G7=B9,JX=_7.toUnsigned,qX=K.getUint64,R_=function(B){var V={version:B[0],flags:new Uint8Array(B.subarray(1,4))};if(V.version===1)V.baseMediaDecodeTime=qX(B.subarray(4));else V.baseMediaDecodeTime=JX(B[4]<<24|B[5]<<16|B[6]<<8|B[7]);return V},Y7=R_,QX=function(B){var V=new DataView(B.buffer,B.byteOffset,B.byteLength),U={version:B[0],flags:new Uint8Array(B.subarray(1,4)),trackId:V.getUint32(4)},E=U.flags[2]&1,L=U.flags[2]&2,T=U.flags[2]&8,g=U.flags[2]&16,y=U.flags[2]&32,p=U.flags[0]&65536,c=U.flags[0]&131072,e;if(e=8,E)e+=4,U.baseDataOffset=V.getUint32(12),e+=4;if(L)U.sampleDescriptionIndex=V.getUint32(e),e+=4;if(T)U.defaultSampleDuration=V.getUint32(e),e+=4;if(g)U.defaultSampleSize=V.getUint32(e),e+=4;if(y)U.defaultSampleFlags=V.getUint32(e);if(p)U.durationIsEmpty=!0;if(!E&&c)U.baseDataOffsetIsMoof=!0;return U},X7=QX,K7=K.getUint64,S_=function(B){var V=new DataView(B.buffer,B.byteOffset,B.byteLength),U={version:B[0],flags:new Uint8Array(B.subarray(1,4)),references:[],referenceId:V.getUint32(4),timescale:V.getUint32(8)},E=12;if(U.version===0)U.earliestPresentationTime=V.getUint32(E),U.firstOffset=V.getUint32(E+4),E+=8;else U.earliestPresentationTime=K7(B.subarray(E)),U.firstOffset=K7(B.subarray(E+8)),E+=16;E+=2;var L=V.getUint16(E);E+=2;for(;L>0;E+=12,L--)U.references.push({referenceType:(B[E]&128)>>>7,referencedSize:V.getUint32(E)&2147483647,subsegmentDuration:V.getUint32(E+4),startsWithSap:!!(B[E+8]&128),sapType:(B[E+8]&112)>>>4,sapDeltaTime:V.getUint32(E+8)&268435455});return U},DX=S_,v_=function(B){return{isLeading:(B[0]&12)>>>2,dependsOn:B[0]&3,isDependedOn:(B[1]&192)>>>6,hasRedundancy:(B[1]&48)>>>4,paddingValue:(B[1]&14)>>>1,isNonSyncSample:B[1]&1,degradationPriority:B[2]<<8|B[3]}},MX=v_,v4=MX,x_=function(B){var V={version:B[0],flags:new Uint8Array(B.subarray(1,4)),samples:[]},U=new DataView(B.buffer,B.byteOffset,B.byteLength),E=V.flags[2]&1,L=V.flags[2]&4,T=V.flags[1]&1,g=V.flags[1]&2,y=V.flags[1]&4,p=V.flags[1]&8,c=U.getUint32(4),e=8,J0;if(E)V.dataOffset=U.getInt32(e),e+=4;if(L&&c){if(J0={flags:v4(B.subarray(e,e+4))},e+=4,T)J0.duration=U.getUint32(e),e+=4;if(g)J0.size=U.getUint32(e),e+=4;if(p){if(V.version===1)J0.compositionTimeOffset=U.getInt32(e);else J0.compositionTimeOffset=U.getUint32(e);e+=4}V.samples.push(J0),c--}while(c--){if(J0={},T)J0.duration=U.getUint32(e),e+=4;if(g)J0.size=U.getUint32(e),e+=4;if(y)J0.flags=v4(B.subarray(e,e+4)),e+=4;if(p){if(V.version===1)J0.compositionTimeOffset=U.getInt32(e);else J0.compositionTimeOffset=U.getUint32(e);e+=4}V.samples.push(J0)}return V},BX=x_,OX=K,s5=OX.getUint64,v2,O9,T5=function(B){return new Date(B*1000-2082844800000)},l6=D9,AX=G7,w_=function(B){var V=new DataView(B.buffer,B.byteOffset,B.byteLength),U=[],E,L;for(E=0;E+4<B.length;E+=L){if(L=V.getUint32(E),E+=4,L<=0){U.push("<span style='color:red;'>MALFORMED DATA</span>");continue}switch(B[E]&31){case 1:U.push("slice_layer_without_partitioning_rbsp");break;case 5:U.push("slice_layer_without_partitioning_rbsp_idr");break;case 6:U.push("sei_rbsp");break;case 7:U.push("seq_parameter_set_rbsp");break;case 8:U.push("pic_parameter_set_rbsp");break;case 9:U.push("access_unit_delimiter_rbsp");break;default:U.push("UNKNOWN NAL - "+B[E]&31);break}}return U},x4={avc1:function(B){var V=new DataView(B.buffer,B.byteOffset,B.byteLength);return{dataReferenceIndex:V.getUint16(6),width:V.getUint16(24),height:V.getUint16(26),horizresolution:V.getUint16(28)+V.getUint16(30)/16,vertresolution:V.getUint16(32)+V.getUint16(34)/16,frameCount:V.getUint16(40),depth:V.getUint16(74),config:v2(B.subarray(78,B.byteLength))}},avcC:function(B){var V=new DataView(B.buffer,B.byteOffset,B.byteLength),U={configurationVersion:B[0],avcProfileIndication:B[1],profileCompatibility:B[2],avcLevelIndication:B[3],lengthSizeMinusOne:B[4]&3,sps:[],pps:[]},E=B[5]&31,L,T,g,y;g=6;for(y=0;y<E;y++)T=V.getUint16(g),g+=2,U.sps.push(new Uint8Array(B.subarray(g,g+T))),g+=T;L=B[g],g++;for(y=0;y<L;y++)T=V.getUint16(g),g+=2,U.pps.push(new Uint8Array(B.subarray(g,g+T))),g+=T;return U},btrt:function(B){var V=new DataView(B.buffer,B.byteOffset,B.byteLength);return{bufferSizeDB:V.getUint32(0),maxBitrate:V.getUint32(4),avgBitrate:V.getUint32(8)}},edts:function(V){return{boxes:v2(V)}},elst:function(V){var U=new DataView(V.buffer,V.byteOffset,V.byteLength),E={version:U.getUint8(0),flags:new Uint8Array(V.subarray(1,4)),edits:[]},L=U.getUint32(4),T;for(T=8;L;L--)if(E.version===0)E.edits.push({segmentDuration:U.getUint32(T),mediaTime:U.getInt32(T+4),mediaRate:U.getUint16(T+8)+U.getUint16(T+10)/65536}),T+=12;else E.edits.push({segmentDuration:s5(V.subarray(T)),mediaTime:s5(V.subarray(T+8)),mediaRate:U.getUint16(T+16)+U.getUint16(T+18)/65536}),T+=20;return E},esds:function(B){return{version:B[0],flags:new Uint8Array(B.subarray(1,4)),esId:B[6]<<8|B[7],streamPriority:B[8]&31,decoderConfig:{objectProfileIndication:B[11],streamType:B[12]>>>2&63,bufferSize:B[13]<<16|B[14]<<8|B[15],maxBitrate:B[16]<<24|B[17]<<16|B[18]<<8|B[19],avgBitrate:B[20]<<24|B[21]<<16|B[22]<<8|B[23],decoderConfigDescriptor:{tag:B[24],length:B[25],audioObjectType:B[26]>>>3&31,samplingFrequencyIndex:(B[26]&7)<<1|B[27]>>>7&1,channelConfiguration:B[27]>>>3&15}}}},ftyp:function(B){var V=new DataView(B.buffer,B.byteOffset,B.byteLength),U={majorBrand:l6(B.subarray(0,4)),minorVersion:V.getUint32(4),compatibleBrands:[]},E=8;while(E<B.byteLength)U.compatibleBrands.push(l6(B.subarray(E,E+4))),E+=4;return U},dinf:function(B){return{boxes:v2(B)}},dref:function(B){return{version:B[0],flags:new Uint8Array(B.subarray(1,4)),dataReferences:v2(B.subarray(8))}},hdlr:function(B){var V=new DataView(B.buffer,B.byteOffset,B.byteLength),U={version:V.getUint8(0),flags:new Uint8Array(B.subarray(1,4)),handlerType:l6(B.subarray(8,12)),name:""},E=8;for(E=24;E<B.byteLength;E++){if(B[E]===0){E++;break}U.name+=String.fromCharCode(B[E])}return U.name=decodeURIComponent(escape(U.name)),U},mdat:function(B){return{byteLength:B.byteLength,nals:w_(B)}},mdhd:function(B){var V=new DataView(B.buffer,B.byteOffset,B.byteLength),U=4,E,L={version:V.getUint8(0),flags:new Uint8Array(B.subarray(1,4)),language:""};if(L.version===1)U+=4,L.creationTime=T5(V.getUint32(U)),U+=8,L.modificationTime=T5(V.getUint32(U)),U+=4,L.timescale=V.getUint32(U),U+=8,L.duration=V.getUint32(U);else L.creationTime=T5(V.getUint32(U)),U+=4,L.modificationTime=T5(V.getUint32(U)),U+=4,L.timescale=V.getUint32(U),U+=4,L.duration=V.getUint32(U);return U+=4,E=V.getUint16(U),L.language+=String.fromCharCode((E>>10)+96),L.language+=String.fromCharCode(((E&992)>>5)+96),L.language+=String.fromCharCode((E&31)+96),L},mdia:function(B){return{boxes:v2(B)}},mfhd:function(B){return{version:B[0],flags:new Uint8Array(B.subarray(1,4)),sequenceNumber:B[4]<<24|B[5]<<16|B[6]<<8|B[7]}},minf:function(B){return{boxes:v2(B)}},mp4a:function(B){var V=new DataView(B.buffer,B.byteOffset,B.byteLength),U={dataReferenceIndex:V.getUint16(6),channelcount:V.getUint16(16),samplesize:V.getUint16(18),samplerate:V.getUint16(24)+V.getUint16(26)/65536};if(B.byteLength>28)U.streamDescriptor=v2(B.subarray(28))[0];return U},moof:function(B){return{boxes:v2(B)}},moov:function(B){return{boxes:v2(B)}},mvex:function(B){return{boxes:v2(B)}},mvhd:function(B){var V=new DataView(B.buffer,B.byteOffset,B.byteLength),U=4,E={version:V.getUint8(0),flags:new Uint8Array(B.subarray(1,4))};if(E.version===1)U+=4,E.creationTime=T5(V.getUint32(U)),U+=8,E.modificationTime=T5(V.getUint32(U)),U+=4,E.timescale=V.getUint32(U),U+=8,E.duration=V.getUint32(U);else E.creationTime=T5(V.getUint32(U)),U+=4,E.modificationTime=T5(V.getUint32(U)),U+=4,E.timescale=V.getUint32(U),U+=4,E.duration=V.getUint32(U);return U+=4,E.rate=V.getUint16(U)+V.getUint16(U+2)/16,U+=4,E.volume=V.getUint8(U)+V.getUint8(U+1)/8,U+=2,U+=2,U+=8,E.matrix=new Uint32Array(B.subarray(U,U+36)),U+=36,U+=24,E.nextTrackId=V.getUint32(U),E},pdin:function(B){var V=new DataView(B.buffer,B.byteOffset,B.byteLength);return{version:V.getUint8(0),flags:new Uint8Array(B.subarray(1,4)),rate:V.getUint32(4),initialDelay:V.getUint32(8)}},sdtp:function(B){var V={version:B[0],flags:new Uint8Array(B.subarray(1,4)),samples:[]},U;for(U=4;U<B.byteLength;U++)V.samples.push({dependsOn:(B[U]&48)>>4,isDependedOn:(B[U]&12)>>2,hasRedundancy:B[U]&3});return V},sidx:DX,smhd:function(B){return{version:B[0],flags:new Uint8Array(B.subarray(1,4)),balance:B[4]+B[5]/256}},stbl:function(B){return{boxes:v2(B)}},ctts:function(B){var V=new DataView(B.buffer,B.byteOffset,B.byteLength),U={version:V.getUint8(0),flags:new Uint8Array(B.subarray(1,4)),compositionOffsets:[]},E=V.getUint32(4),L;for(L=8;E;L+=8,E--)U.compositionOffsets.push({sampleCount:V.getUint32(L),sampleOffset:V[U.version===0?"getUint32":"getInt32"](L+4)});return U},stss:function(B){var V=new DataView(B.buffer,B.byteOffset,B.byteLength),U={version:V.getUint8(0),flags:new Uint8Array(B.subarray(1,4)),syncSamples:[]},E=V.getUint32(4),L;for(L=8;E;L+=4,E--)U.syncSamples.push(V.getUint32(L));return U},stco:function(B){var V=new DataView(B.buffer,B.byteOffset,B.byteLength),U={version:B[0],flags:new Uint8Array(B.subarray(1,4)),chunkOffsets:[]},E=V.getUint32(4),L;for(L=8;E;L+=4,E--)U.chunkOffsets.push(V.getUint32(L));return U},stsc:function(B){var V=new DataView(B.buffer,B.byteOffset,B.byteLength),U=V.getUint32(4),E={version:B[0],flags:new Uint8Array(B.subarray(1,4)),sampleToChunks:[]},L;for(L=8;U;L+=12,U--)E.sampleToChunks.push({firstChunk:V.getUint32(L),samplesPerChunk:V.getUint32(L+4),sampleDescriptionIndex:V.getUint32(L+8)});return E},stsd:function(B){return{version:B[0],flags:new Uint8Array(B.subarray(1,4)),sampleDescriptions:v2(B.subarray(8))}},stsz:function(B){var V=new DataView(B.buffer,B.byteOffset,B.byteLength),U={version:B[0],flags:new Uint8Array(B.subarray(1,4)),sampleSize:V.getUint32(4),entries:[]},E;for(E=12;E<B.byteLength;E+=4)U.entries.push(V.getUint32(E));return U},stts:function(B){var V=new DataView(B.buffer,B.byteOffset,B.byteLength),U={version:B[0],flags:new Uint8Array(B.subarray(1,4)),timeToSamples:[]},E=V.getUint32(4),L;for(L=8;E;L+=8,E--)U.timeToSamples.push({sampleCount:V.getUint32(L),sampleDelta:V.getUint32(L+4)});return U},styp:function(B){return x4.ftyp(B)},tfdt:Y7,tfhd:X7,tkhd:function(B){var V=new DataView(B.buffer,B.byteOffset,B.byteLength),U=4,E={version:V.getUint8(0),flags:new Uint8Array(B.subarray(1,4))};if(E.version===1)U+=4,E.creationTime=T5(V.getUint32(U)),U+=8,E.modificationTime=T5(V.getUint32(U)),U+=4,E.trackId=V.getUint32(U),U+=4,U+=8,E.duration=V.getUint32(U);else E.creationTime=T5(V.getUint32(U)),U+=4,E.modificationTime=T5(V.getUint32(U)),U+=4,E.trackId=V.getUint32(U),U+=4,U+=4,E.duration=V.getUint32(U);return U+=4,U+=8,E.layer=V.getUint16(U),U+=2,E.alternateGroup=V.getUint16(U),U+=2,E.volume=V.getUint8(U)+V.getUint8(U+1)/8,U+=2,U+=2,E.matrix=new Uint32Array(B.subarray(U,U+36)),U+=36,E.width=V.getUint16(U)+V.getUint16(U+2)/65536,U+=4,E.height=V.getUint16(U)+V.getUint16(U+2)/65536,E},traf:function(B){return{boxes:v2(B)}},trak:function(B){return{boxes:v2(B)}},trex:function(B){var V=new DataView(B.buffer,B.byteOffset,B.byteLength);return{version:B[0],flags:new Uint8Array(B.subarray(1,4)),trackId:V.getUint32(4),defaultSampleDescriptionIndex:V.getUint32(8),defaultSampleDuration:V.getUint32(12),defaultSampleSize:V.getUint32(16),sampleDependsOn:B[20]&3,sampleIsDependedOn:(B[21]&192)>>6,sampleHasRedundancy:(B[21]&48)>>4,samplePaddingValue:(B[21]&14)>>1,sampleIsDifferenceSample:!!(B[21]&1),sampleDegradationPriority:V.getUint16(22)}},trun:BX,"url ":function(B){return{version:B[0],flags:new Uint8Array(B.subarray(1,4))}},vmhd:function(B){var V=new DataView(B.buffer,B.byteOffset,B.byteLength);return{version:B[0],flags:new Uint8Array(B.subarray(1,4)),graphicsmode:V.getUint16(4),opcolor:new Uint16Array([V.getUint16(6),V.getUint16(8),V.getUint16(10)])}}};v2=function(B){var V=0,U=[],E,L,T,g,y,p=new ArrayBuffer(B.length),c=new Uint8Array(p);for(var e=0;e<B.length;++e)c[e]=B[e];E=new DataView(p);while(V<B.byteLength)L=E.getUint32(V),T=l6(B.subarray(V+4,V+8)),g=L>1?V+L:B.byteLength,y=(x4[T]||function(J0){return{data:J0}})(B.subarray(V+8,g)),y.size=L,y.type=T,U.push(y),V=g;return U},O9=function(B,V){var U;return V=V||0,U=Array(V*2+1).join(" "),B.map(function(E,L){return U+E.type+`
|
|
221
|
-
`+Object.keys(E).filter(function(T){return T!=="type"&&T!=="boxes"}).map(function(T){var g=U+" "+T+": ",y=E[T];if(y instanceof Uint8Array||y instanceof Uint32Array){var p=Array.prototype.slice.call(new Uint8Array(y.buffer,y.byteOffset,y.byteLength)).map(function(c){return" "+("00"+c.toString(16)).slice(-2)}).join("").match(/.{1,24}/g);if(!p)return g+"<>";if(p.length===1)return g+"<"+p.join("").slice(1)+">";return g+`<
|
|
222
|
-
`+p.map(function(c){return U+" "+c}).join(`
|
|
223
|
-
`)+`
|
|
224
|
-
`+U+" >"}return g+JSON.stringify(y,null,2).split(`
|
|
225
|
-
`).map(function(c,e){if(e===0)return c;return U+" "+c}).join(`
|
|
226
|
-
`)}).join(`
|
|
227
|
-
`)+(E.boxes?`
|
|
228
|
-
`+O9(E.boxes,V+1):"")}).join(`
|
|
229
|
-
`)};var g_={inspect:v2,textify:O9,parseType:l6,findBox:AX,parseTraf:x4.traf,parseTfdt:x4.tfdt,parseHdlr:x4.hdlr,parseTfhd:x4.tfhd,parseTrun:x4.trun,parseSidx:x4.sidx},A9=function(B){var V=0,U=String.fromCharCode(B[V]),E="";while(U!=="\x00")E+=U,V++,U=String.fromCharCode(B[V]);return E+=U,E},Z7={uint8ToCString:A9},f1=Z7.uint8ToCString,Yq=K.getUint64,Xq=function(B){var V=4,U=B[0],E,L,T,g,y,p,c,e;if(U===0){E=f1(B.subarray(V)),V+=E.length,L=f1(B.subarray(V)),V+=L.length;var J0=new DataView(B.buffer);T=J0.getUint32(V),V+=4,y=J0.getUint32(V),V+=4,p=J0.getUint32(V),V+=4,c=J0.getUint32(V),V+=4}else if(U===1){var J0=new DataView(B.buffer);T=J0.getUint32(V),V+=4,g=Yq(B.subarray(V)),V+=8,p=J0.getUint32(V),V+=4,c=J0.getUint32(V),V+=4,E=f1(B.subarray(V)),V+=E.length,L=f1(B.subarray(V)),V+=L.length}e=new Uint8Array(B.subarray(V,B.byteLength));var P0={scheme_id_uri:E,value:L,timescale:T?T:1,presentation_time:g,presentation_time_delta:y,event_duration:p,id:c,message_data:e};return J7(U,P0)?P0:void 0},zX=function(B,V,U,E){return B||B===0?B/V:E+U/V},J7=function(B,V){var U=V.scheme_id_uri!=="\x00",E=B===0&&G3(V.presentation_time_delta)&&U,L=B===1&&G3(V.presentation_time)&&U;return!(B>1)&&E||L},G3=function(B){return B!==void 0||B!==null},HX={parseEmsgBox:Xq,scaleTime:zX},i6;if(typeof window<"u")i6=window;else if(typeof h<"u")i6=h;else if(typeof self<"u")i6=self;else i6={};var c6=i6,I5=_7.toUnsigned,d6=_7.toHexString,q2=G7,e3=D9,q7=HX,I_=X7,z9=BX,VX=Y7,UX=K.getUint64,EX,P_,y_,n5,H9,V9,b_,m_=c6,U9=r2.parseId3Frames;EX=function(B){var V={},U=q2(B,["moov","trak"]);return U.reduce(function(E,L){var T,g,y,p,c;if(T=q2(L,["tkhd"])[0],!T)return null;if(g=T[0],y=g===0?12:20,p=I5(T[y]<<24|T[y+1]<<16|T[y+2]<<8|T[y+3]),c=q2(L,["mdia","mdhd"])[0],!c)return null;return g=c[0],y=g===0?12:20,E[p]=I5(c[y]<<24|c[y+1]<<16|c[y+2]<<8|c[y+3]),E},V)},P_=function(B,V){var U=q2(V,["moof","traf"]),E=U.reduce(function(L,T){var g=q2(T,["tfhd"])[0],y=I5(g[4]<<24|g[5]<<16|g[6]<<8|g[7]),p=B[y]||90000,c=q2(T,["tfdt"])[0],e=new DataView(c.buffer,c.byteOffset,c.byteLength),J0;if(c[0]===1)J0=UX(c.subarray(4,12));else J0=e.getUint32(4);let P0;if(typeof J0==="bigint")P0=J0/m_.BigInt(p);else if(typeof J0==="number"&&!isNaN(J0))P0=J0/p;if(P0<Number.MAX_SAFE_INTEGER)P0=Number(P0);if(P0<L)L=P0;return L},1/0);return typeof E==="bigint"||isFinite(E)?E:0},y_=function(B,V){var U=q2(V,["moof","traf"]),E=0,L=0,T;if(U&&U.length){var g=q2(U[0],["tfhd"])[0],y=q2(U[0],["trun"])[0],p=q2(U[0],["tfdt"])[0];if(g){var c=I_(g);T=c.trackId}if(p){var e=VX(p);E=e.baseMediaDecodeTime}if(y){var J0=z9(y);if(J0.samples&&J0.samples.length)L=J0.samples[0].compositionTimeOffset||0}}var P0=B[T]||90000;if(typeof E==="bigint")L=m_.BigInt(L),P0=m_.BigInt(P0);var H0=(E+L)/P0;if(typeof H0==="bigint"&&H0<Number.MAX_SAFE_INTEGER)H0=Number(H0);return H0},n5=function(B){var V=q2(B,["moov","trak"]),U=[];return V.forEach(function(E){var L=q2(E,["mdia","hdlr"]),T=q2(E,["tkhd"]);L.forEach(function(g,y){var p=e3(g.subarray(8,12)),c=T[y],e,J0,P0;if(p==="vide")e=new DataView(c.buffer,c.byteOffset,c.byteLength),J0=e.getUint8(0),P0=J0===0?e.getUint32(12):e.getUint32(20),U.push(P0)})}),U},V9=function(B){var V=B[0],U=V===0?12:20;return I5(B[U]<<24|B[U+1]<<16|B[U+2]<<8|B[U+3])},H9=function(B){var V=q2(B,["moov","trak"]),U=[];return V.forEach(function(E){var L={},T=q2(E,["tkhd"])[0],g,y;if(T)g=new DataView(T.buffer,T.byteOffset,T.byteLength),y=g.getUint8(0),L.id=y===0?g.getUint32(12):g.getUint32(20);var p=q2(E,["mdia","hdlr"])[0];if(p){var c=e3(p.subarray(8,12));if(c==="vide")L.type="video";else if(c==="soun")L.type="audio";else L.type=c}var e=q2(E,["mdia","minf","stbl","stsd"])[0];if(e){var J0=e.subarray(8);L.codec=e3(J0.subarray(4,8));var P0=q2(J0,[L.codec])[0],H0,i0;if(P0)if(/^[asm]vc[1-9]$/i.test(L.codec))if(H0=P0.subarray(78),i0=e3(H0.subarray(4,8)),i0==="avcC"&&H0.length>11)L.codec+=".",L.codec+=d6(H0[9]),L.codec+=d6(H0[10]),L.codec+=d6(H0[11]);else L.codec="avc1.4d400d";else if(/^mp4[a,v]$/i.test(L.codec))if(H0=P0.subarray(28),i0=e3(H0.subarray(4,8)),i0==="esds"&&H0.length>20&&H0[19]!==0)L.codec+="."+d6(H0[19]),L.codec+="."+d6(H0[20]>>>2&63).replace(/^0/,"");else L.codec="mp4a.40.2";else L.codec=L.codec.toLowerCase()}var e0=q2(E,["mdia","mdhd"])[0];if(e0)L.timescale=V9(e0);U.push(L)}),U},b_=function(B,V=0){var U=q2(B,["emsg"]);return U.map((E)=>{var L=q7.parseEmsgBox(new Uint8Array(E)),T=U9(L.message_data);return{cueTime:q7.scaleTime(L.presentation_time,L.timescale,L.presentation_time_delta,V),duration:q7.scaleTime(L.event_duration,L.timescale),frames:T}})};var $2={findBox:q2,parseType:e3,timescale:EX,startTime:P_,compositionStartTime:y_,videoTrackIds:n5,tracks:H9,getTimescaleFromMediaHeader:V9,getEmsgID3:b_};let{parseTrun:CX}=g_,{findBox:e2}=$2;var f_=c6,Y3=function(B){var V=e2(B,["moof","traf"]),U=e2(B,["mdat"]),E=[];return U.forEach(function(L,T){var g=V[T];E.push({mdat:L,traf:g})}),E},h6=function(B,V,U){var E=V,L=U.defaultSampleDuration||0,T=U.defaultSampleSize||0,g=U.trackId,y=[];return B.forEach(function(p){var c=CX(p),e=c.samples;e.forEach(function(J0){if(J0.duration===void 0)J0.duration=L;if(J0.size===void 0)J0.size=T;if(J0.trackId=g,J0.dts=E,J0.compositionTimeOffset===void 0)J0.compositionTimeOffset=0;if(typeof E==="bigint")J0.pts=E+f_.BigInt(J0.compositionTimeOffset),E+=f_.BigInt(J0.duration);else J0.pts=E+J0.compositionTimeOffset,E+=J0.duration}),y=y.concat(e)}),y},w4={getMdatTrafPairs:Y3,parseSamples:h6},k_=Q_.discardEmulationPreventionBytes,u_=D_.CaptionStream,P5=G7,NX=Y7,a6=X7,{getMdatTrafPairs:Q7,parseSamples:_6}=w4,$X=function(B,V){var U=B;for(var E=0;E<V.length;E++){var L=V[E];if(U<L.size)return L;U-=L.size}return null},LX=function(B,V,U){var E=new DataView(B.buffer,B.byteOffset,B.byteLength),L={logs:[],seiNals:[]},T,g,y,p;for(g=0;g+4<B.length;g+=y){if(y=E.getUint32(g),g+=4,y<=0)continue;switch(B[g]&31){case 6:var c=B.subarray(g+1,g+1+y),e=$X(g,V);if(T={nalUnitType:"sei_rbsp",size:y,data:c,escapedRBSP:k_(c),trackId:U},e)T.pts=e.pts,T.dts=e.dts,p=e;else if(p)T.pts=p.pts,T.dts=p.dts;else{L.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+g+" for trackId "+U+". See mux.js#223."});break}L.seiNals.push(T);break}}return L},D7=function(B,V){var U={},E=Q7(B);return E.forEach(function(L){var{mdat:T,traf:g}=L,y=P5(g,["tfhd"]),p=a6(y[0]),c=p.trackId,e=P5(g,["tfdt"]),J0=e.length>0?NX(e[0]).baseMediaDecodeTime:0,P0=P5(g,["trun"]),H0,i0;if(V===c&&P0.length>0){if(H0=_6(P0,J0,p),i0=LX(T,H0,c),!U[c])U[c]={seiNals:[],logs:[]};U[c].seiNals=U[c].seiNals.concat(i0.seiNals),U[c].logs=U[c].logs.concat(i0.logs)}}),U},jX=function(B,V,U){var E;if(V===null)return null;E=D7(B,V);var L=E[V]||{};return{seiNals:L.seiNals,logs:L.logs,timescale:U}},E9=function(){var B=!1,V,U,E,L,T,g;this.isInitialized=function(){return B},this.init=function(y){V=new u_,B=!0,g=y?y.isPartial:!1,V.on("data",function(p){p.startTime=p.startPts/L,p.endTime=p.endPts/L,T.captions.push(p),T.captionStreams[p.stream]=!0}),V.on("log",function(p){T.logs.push(p)})},this.isNewInit=function(y,p){if(y&&y.length===0||p&&typeof p==="object"&&Object.keys(p).length===0)return!1;return E!==y[0]||L!==p[E]},this.parse=function(y,p,c){var e;if(!this.isInitialized())return null;else if(!p||!c)return null;else if(this.isNewInit(p,c))E=p[0],L=c[E];else if(E===null||!L)return U.push(y),null;while(U.length>0){var J0=U.shift();this.parse(J0,p,c)}if(e=jX(y,E,L),e&&e.logs)T.logs=T.logs.concat(e.logs);if(e===null||!e.seiNals){if(T.logs.length)return{logs:T.logs,captions:[],captionStreams:[]};return null}return this.pushNals(e.seiNals),this.flushStream(),T},this.pushNals=function(y){if(!this.isInitialized()||!y||y.length===0)return null;y.forEach(function(p){V.push(p)})},this.flushStream=function(){if(!this.isInitialized())return null;if(!g)V.flush();else V.partialFlush()},this.clearParsedCaptions=function(){T.captions=[],T.captionStreams={},T.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;V.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){if(U=[],E=null,L=null,!T)T={captions:[],captionStreams:{},logs:[]};else this.clearParsedCaptions();this.resetCaptionStream()},this.reset()},FX=E9;let{parseTfdt:p_}=g_,g4=G7,{getTimescaleFromMediaHeader:l_}=$2,{parseSamples:TX,getMdatTrafPairs:i_}=w4;var c_=function(){let B=90000;this.init=function(V){let U=g4(V,["moov","trak","mdia","mdhd"])[0];if(U)B=l_(U)},this.parseSegment=function(V){let U=[],E=i_(V),L=0;return E.forEach(function(T){let{mdat:g,traf:y}=T,p=g4(y,["tfdt"])[0],c=g4(y,["tfhd"])[0],e=g4(y,["trun"]);if(p)L=p_(p).baseMediaDecodeTime;if(e.length&&c){let J0=TX(e,L,c),P0=0;J0.forEach(function(H0){let e0=new TextDecoder("utf-8"),x2=g.slice(P0,P0+H0.size);if(g4(x2,["vtte"])[0]){P0+=H0.size;return}g4(x2,["vttc"]).forEach(function(s6){let n6=g4(s6,["payl"])[0],o6=g4(s6,["sttg"])[0],r6=H0.pts/B,O7=(H0.pts+H0.duration)/B,i1,M1;if(n6)try{i1=e0.decode(n6)}catch(y5){console.error(y5)}if(o6)try{M1=e0.decode(o6)}catch(y5){console.error(y5)}if(H0.duration&&i1)U.push({cueText:i1,start:r6,end:O7,settings:M1})}),P0+=H0.size})}}),U}},h5=m8,d_=function(B){var V=B[1]&31;return V<<=8,V|=B[2],V},M7=function(B){return!!(B[1]&64)},C9=function(B){var V=0;if((B[3]&48)>>>4>1)V+=B[4]+1;return V},U3=function(B,V){var U=d_(B);if(U===0)return"pat";else if(U===V)return"pmt";else if(V)return"pes";return null},WX=function(B){var V=M7(B),U=4+C9(B);if(V)U+=B[U]+1;return(B[U+10]&31)<<8|B[U+11]},a_=function(B){var V={},U=M7(B),E=4+C9(B);if(U)E+=B[E]+1;if(!(B[E+5]&1))return;var L,T,g;L=(B[E+1]&15)<<8|B[E+2],T=3+L-4,g=(B[E+10]&15)<<8|B[E+11];var y=12+g;while(y<T){var p=E+y;V[(B[p+1]&31)<<8|B[p+2]]=B[p],y+=((B[p+3]&15)<<8|B[p+4])+5}return V},t6=function(B,V){var U=d_(B),E=V[U];switch(E){case h5.H264_STREAM_TYPE:return"video";case h5.ADTS_STREAM_TYPE:return"audio";case h5.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},RX=function(B){var V=M7(B);if(!V)return null;var U=4+C9(B);if(U>=B.byteLength)return null;var E=null,L;if(L=B[U+7],L&192){if(E={},E.pts=(B[U+9]&14)<<27|(B[U+10]&255)<<20|(B[U+11]&254)<<12|(B[U+12]&255)<<5|(B[U+13]&254)>>>3,E.pts*=4,E.pts+=(B[U+13]&6)>>>1,E.dts=E.pts,L&64)E.dts=(B[U+14]&14)<<27|(B[U+15]&255)<<20|(B[U+16]&254)<<12|(B[U+17]&255)<<5|(B[U+18]&254)>>>3,E.dts*=4,E.dts+=(B[U+18]&6)>>>1}return E},N9=function(B){switch(B){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}},SX=function(B){var V=4+C9(B),U=B.subarray(V),E=0,L=0,T=!1,g;for(;L<U.byteLength-3;L++)if(U[L+2]===1){E=L+5;break}while(E<U.byteLength)switch(U[E]){case 0:if(U[E-1]!==0){E+=2;break}else if(U[E-2]!==0){E++;break}if(L+3!==E-2){if(g=N9(U[L+3]&31),g==="slice_layer_without_partitioning_rbsp_idr")T=!0}do E++;while(U[E]!==1&&E<U.length);L=E-2,E+=3;break;case 1:if(U[E-1]!==0||U[E-2]!==0){E+=3;break}if(g=N9(U[L+3]&31),g==="slice_layer_without_partitioning_rbsp_idr")T=!0;L=E-2,E+=3;break;default:E+=3;break}if(U=U.subarray(L),E-=L,L=0,U&&U.byteLength>3){if(g=N9(U[L+3]&31),g==="slice_layer_without_partitioning_rbsp_idr")T=!0}return T},vX={parseType:U3,parsePat:WX,parsePmt:a_,parsePayloadUnitStartIndicator:M7,parsePesType:t6,parsePesTime:RX,videoPacketContainsKeyFrame:SX},B7=m8,E3=F5.handleRollover,P1={};P1.ts=vX,P1.aac=t8;var G6=I0.ONE_SECOND_IN_TS,A5=188,H4=71,xX=function(B,V){var U=0,E=A5,L,T;while(E<B.byteLength){if(B[U]===H4&&B[E]===H4){switch(L=B.subarray(U,E),T=P1.ts.parseType(L,V.pid),T){case"pat":V.pid=P1.ts.parsePat(L);break;case"pmt":var g=P1.ts.parsePmt(L);V.table=V.table||{},Object.keys(g).forEach(function(y){V.table[y]=g[y]});break}U+=A5,E+=A5;continue}U++,E++}},Y6=function(B,V,U){var E=0,L=A5,T,g,y,p,c,e=!1;while(L<=B.byteLength){if(B[E]===H4&&(B[L]===H4||L===B.byteLength)){switch(T=B.subarray(E,L),g=P1.ts.parseType(T,V.pid),g){case"pes":if(y=P1.ts.parsePesType(T,V.table),p=P1.ts.parsePayloadUnitStartIndicator(T),y==="audio"&&p){if(c=P1.ts.parsePesTime(T),c)c.type="audio",U.audio.push(c),e=!0}break}if(e)break;E+=A5,L+=A5;continue}E++,L++}L=B.byteLength,E=L-A5,e=!1;while(E>=0){if(B[E]===H4&&(B[L]===H4||L===B.byteLength)){switch(T=B.subarray(E,L),g=P1.ts.parseType(T,V.pid),g){case"pes":if(y=P1.ts.parsePesType(T,V.table),p=P1.ts.parsePayloadUnitStartIndicator(T),y==="audio"&&p){if(c=P1.ts.parsePesTime(T),c)c.type="audio",U.audio.push(c),e=!0}break}if(e)break;E-=A5,L-=A5;continue}E--,L--}},$9=function(B,V,U){var E=0,L=A5,T,g,y,p,c,e,J0,P0,H0=!1,i0={data:[],size:0};while(L<B.byteLength){if(B[E]===H4&&B[L]===H4){switch(T=B.subarray(E,L),g=P1.ts.parseType(T,V.pid),g){case"pes":if(y=P1.ts.parsePesType(T,V.table),p=P1.ts.parsePayloadUnitStartIndicator(T),y==="video"){if(p&&!H0){if(c=P1.ts.parsePesTime(T),c)c.type="video",U.video.push(c),H0=!0}if(!U.firstKeyFrame){if(p){if(i0.size!==0){e=new Uint8Array(i0.size),J0=0;while(i0.data.length)P0=i0.data.shift(),e.set(P0,J0),J0+=P0.byteLength;if(P1.ts.videoPacketContainsKeyFrame(e)){var e0=P1.ts.parsePesTime(e);if(e0)U.firstKeyFrame=e0,U.firstKeyFrame.type="video";else console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.")}i0.size=0}}i0.data.push(T),i0.size+=T.byteLength}}break}if(H0&&U.firstKeyFrame)break;E+=A5,L+=A5;continue}E++,L++}L=B.byteLength,E=L-A5,H0=!1;while(E>=0){if(B[E]===H4&&B[L]===H4){switch(T=B.subarray(E,L),g=P1.ts.parseType(T,V.pid),g){case"pes":if(y=P1.ts.parsePesType(T,V.table),p=P1.ts.parsePayloadUnitStartIndicator(T),y==="video"&&p){if(c=P1.ts.parsePesTime(T),c)c.type="video",U.video.push(c),H0=!0}break}if(H0)break;E-=A5,L-=A5;continue}E--,L--}},wX=function(B,V){if(B.audio&&B.audio.length){var U=V;if(typeof U>"u"||isNaN(U))U=B.audio[0].dts;B.audio.forEach(function(T){T.dts=E3(T.dts,U),T.pts=E3(T.pts,U),T.dtsTime=T.dts/G6,T.ptsTime=T.pts/G6})}if(B.video&&B.video.length){var E=V;if(typeof E>"u"||isNaN(E))E=B.video[0].dts;if(B.video.forEach(function(T){T.dts=E3(T.dts,E),T.pts=E3(T.pts,E),T.dtsTime=T.dts/G6,T.ptsTime=T.pts/G6}),B.firstKeyFrame){var L=B.firstKeyFrame;L.dts=E3(L.dts,E),L.pts=E3(L.pts,E),L.dtsTime=L.dts/G6,L.ptsTime=L.pts/G6}}},gX=function(B){var V=!1,U=0,E=null,L=null,T=0,g=0,y;while(B.length-g>=3){var p=P1.aac.parseType(B,g);switch(p){case"timed-metadata":if(B.length-g<10){V=!0;break}if(T=P1.aac.parseId3TagSize(B,g),T>B.length){V=!0;break}if(L===null)y=B.subarray(g,g+T),L=P1.aac.parseAacTimestamp(y);g+=T;break;case"audio":if(B.length-g<7){V=!0;break}if(T=P1.aac.parseAdtsSize(B,g),T>B.length){V=!0;break}if(E===null)y=B.subarray(g,g+T),E=P1.aac.parseSampleRate(y);U++,g+=T;break;default:g++;break}if(V)return null}if(E===null||L===null)return null;var c=G6/E,e={audio:[{type:"audio",dts:L,pts:L},{type:"audio",dts:L+U*1024*c,pts:L+U*1024*c}]};return e},IX=function(B){var V={pid:null,table:null},U={};xX(B,V);for(var E in V.table)if(V.table.hasOwnProperty(E)){var L=V.table[E];switch(L){case B7.H264_STREAM_TYPE:if(U.video=[],$9(B,V,U),U.video.length===0)delete U.video;break;case B7.ADTS_STREAM_TYPE:if(U.audio=[],Y6(B,V,U),U.audio.length===0)delete U.audio;break}}return U},PX=function(B,V){var U=P1.aac.isLikelyAacData(B),E;if(U)E=gX(B);else E=IX(B);if(!E||!E.audio&&!E.video)return null;return wX(E,V),E},yX={inspect:PX,parseAudioPes_:Y6};let bX=function(B,V){V.on("data",function(U){let E=U.initSegment;U.initSegment={data:E.buffer,byteOffset:E.byteOffset,byteLength:E.byteLength};let L=U.data;U.data=L.buffer,B.postMessage({action:"data",segment:U,byteOffset:L.byteOffset,byteLength:L.byteLength},[U.data])}),V.on("done",function(U){B.postMessage({action:"done"})}),V.on("gopInfo",function(U){B.postMessage({action:"gopInfo",gopInfo:U})}),V.on("videoSegmentTimingInfo",function(U){let E={start:{decode:I0.videoTsToSeconds(U.start.dts),presentation:I0.videoTsToSeconds(U.start.pts)},end:{decode:I0.videoTsToSeconds(U.end.dts),presentation:I0.videoTsToSeconds(U.end.pts)},baseMediaDecodeTime:I0.videoTsToSeconds(U.baseMediaDecodeTime)};if(U.prependedContentDuration)E.prependedContentDuration=I0.videoTsToSeconds(U.prependedContentDuration);B.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:E})}),V.on("audioSegmentTimingInfo",function(U){let E={start:{decode:I0.videoTsToSeconds(U.start.dts),presentation:I0.videoTsToSeconds(U.start.pts)},end:{decode:I0.videoTsToSeconds(U.end.dts),presentation:I0.videoTsToSeconds(U.end.pts)},baseMediaDecodeTime:I0.videoTsToSeconds(U.baseMediaDecodeTime)};if(U.prependedContentDuration)E.prependedContentDuration=I0.videoTsToSeconds(U.prependedContentDuration);B.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:E})}),V.on("id3Frame",function(U){B.postMessage({action:"id3Frame",id3Frame:U})}),V.on("caption",function(U){B.postMessage({action:"caption",caption:U})}),V.on("trackinfo",function(U){B.postMessage({action:"trackinfo",trackInfo:U})}),V.on("audioTimingInfo",function(U){B.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:I0.videoTsToSeconds(U.start),end:I0.videoTsToSeconds(U.end)}})}),V.on("videoTimingInfo",function(U){B.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:I0.videoTsToSeconds(U.start),end:I0.videoTsToSeconds(U.end)}})}),V.on("log",function(U){B.postMessage({action:"log",log:U})})};class X6{constructor(B,V){this.options=V||{},this.self=B,this.init()}init(){if(this.transmuxer)this.transmuxer.dispose();this.transmuxer=new KX.Transmuxer(this.options),bX(this.self,this.transmuxer)}pushMp4Captions(B){if(!this.captionParser)this.captionParser=new FX,this.captionParser.init();let V=new Uint8Array(B.data,B.byteOffset,B.byteLength),U=this.captionParser.parse(V,B.trackIds,B.timescales);this.self.postMessage({action:"mp4Captions",captions:U&&U.captions||[],logs:U&&U.logs||[],data:V.buffer},[V.buffer])}initMp4WebVttParser(B){if(!this.webVttParser)this.webVttParser=new c_;let V=new Uint8Array(B.data,B.byteOffset,B.byteLength);this.webVttParser.init(V)}getMp4WebVttText(B){if(!this.webVttParser)this.webVttParser=new c_;let V=new Uint8Array(B.data,B.byteOffset,B.byteLength),U=this.webVttParser.parseSegment(V);this.self.postMessage({action:"getMp4WebVttText",mp4VttCues:U||[],data:V.buffer},[V.buffer])}probeMp4StartTime({timescales:B,data:V}){let U=$2.startTime(B,V);this.self.postMessage({action:"probeMp4StartTime",startTime:U,data:V},[V.buffer])}probeMp4Tracks({data:B}){let V=$2.tracks(B);this.self.postMessage({action:"probeMp4Tracks",tracks:V,data:B},[B.buffer])}probeEmsgID3({data:B,offset:V}){let U=$2.getEmsgID3(B,V);this.self.postMessage({action:"probeEmsgID3",id3Frames:U,emsgData:B},[B.buffer])}probeTs({data:B,baseStartTime:V}){let U=typeof V==="number"&&!isNaN(V)?V*I0.ONE_SECOND_IN_TS:void 0,E=yX.inspect(B,U),L=null;if(E){if(L={hasVideo:E.video&&E.video.length===2||!1,hasAudio:E.audio&&E.audio.length===2||!1},L.hasVideo)L.videoStart=E.video[0].ptsTime;if(L.hasAudio)L.audioStart=E.audio[0].ptsTime}this.self.postMessage({action:"probeTs",result:L,data:B},[B.buffer])}clearAllMp4Captions(){if(this.captionParser)this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){if(this.captionParser)this.captionParser.clearParsedCaptions()}push(B){let V=new Uint8Array(B.data,B.byteOffset,B.byteLength);this.transmuxer.push(V)}reset(){this.transmuxer.reset()}setTimestampOffset(B){let V=B.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(I0.secondsToVideoTs(V)))}setAudioAppendStart(B){this.transmuxer.setAudioAppendStart(Math.ceil(I0.secondsToVideoTs(B.appendStart)))}setRemux(B){this.transmuxer.setRemux(B.remux)}flush(B){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(B){this.transmuxer.alignGopsWith(B.gopsToAlignWith.slice())}}self.onmessage=function(B){if(B.data.action==="init"&&B.data.options){this.messageHandlers=new X6(self,B.data.options);return}if(!this.messageHandlers)this.messageHandlers=new X6(self);if(B.data&&B.data.action&&B.data.action!=="init"){if(this.messageHandlers[B.data.action])this.messageHandlers[B.data.action](B.data)}}})),TP=uN(FP),WP=(h,_,G)=>{let{type:Y,initSegment:X,captions:K,captionStreams:Z,metadata:Q,videoFrameDtsTime:D,videoFramePtsTime:O}=h.data.segment;_.buffer.push({captions:K,captionStreams:Z,metadata:Q});let A=h.data.segment.boxes||{data:h.data.segment.data},H={type:Y,data:new Uint8Array(A.data,A.data.byteOffset,A.data.byteLength),initSegment:new Uint8Array(X.data,X.byteOffset,X.byteLength)};if(typeof D<"u")H.videoFrameDtsTime=D;if(typeof O<"u")H.videoFramePtsTime=O;G(H)},RP=({transmuxedData:h,callback:_})=>{h.buffer=[],_(h)},SP=(h,_)=>{_.gopInfo=h.data.gopInfo},iN=(h)=>{let{transmuxer:_,bytes:G,audioAppendStart:Y,gopsToAlignWith:X,remux:K,onData:Z,onTrackInfo:Q,onAudioTimingInfo:D,onVideoTimingInfo:O,onVideoSegmentTimingInfo:A,onAudioSegmentTimingInfo:H,onId3:C,onCaptions:N,onDone:j,onEndedTimeline:W,onTransmuxerLog:S,isEndOfTimeline:R,segment:v,triggerSegmentEventFn:x}=h,P={buffer:[]},I=R,b=(i)=>{if(_.currentTransmux!==h)return;if(i.data.action==="data")WP(i,P,Z);if(i.data.action==="trackinfo")Q(i.data.trackInfo);if(i.data.action==="gopInfo")SP(i,P);if(i.data.action==="audioTimingInfo")D(i.data.audioTimingInfo);if(i.data.action==="videoTimingInfo")O(i.data.videoTimingInfo);if(i.data.action==="videoSegmentTimingInfo")A(i.data.videoSegmentTimingInfo);if(i.data.action==="audioSegmentTimingInfo")H(i.data.audioSegmentTimingInfo);if(i.data.action==="id3Frame")C([i.data.id3Frame],i.data.id3Frame.dispatchType);if(i.data.action==="caption")N(i.data.caption);if(i.data.action==="endedtimeline")I=!1,W();if(i.data.action==="log")S(i.data.log);if(i.data.type!=="transmuxed")return;if(I)return;_.onmessage=null,RP({transmuxedData:P,callback:j}),cN(_)},l=()=>{let i={message:"Received an error message from the transmuxer worker",metadata:{errorType:Y0.Error.StreamingFailedToTransmuxSegment,segmentInfo:m7({segment:v})}};j(null,i)};if(_.onmessage=b,_.onerror=l,Y)_.postMessage({action:"setAudioAppendStart",appendStart:Y});if(Array.isArray(X))_.postMessage({action:"alignGopsWith",gopsToAlignWith:X});if(typeof K<"u")_.postMessage({action:"setRemux",remux:K});if(G.byteLength){let i=G instanceof ArrayBuffer?G:G.buffer,h0=G instanceof ArrayBuffer?0:G.byteOffset;x({type:"segmenttransmuxingstart",segment:v}),_.postMessage({action:"push",data:i,byteOffset:h0,byteLength:G.byteLength},[i])}if(R)_.postMessage({action:"endTimeline"});_.postMessage({action:"flush"})},cN=(h)=>{if(h.currentTransmux=null,h.transmuxQueue.length)if(h.currentTransmux=h.transmuxQueue.shift(),typeof h.currentTransmux==="function")h.currentTransmux();else iN(h.currentTransmux)},cE=(h,_)=>{h.postMessage({action:_}),cN(h)},dN=(h,_)=>{if(!_.currentTransmux){_.currentTransmux=h,cE(_,h);return}_.transmuxQueue.push(cE.bind(null,_,h))},vP=(h)=>{dN("reset",h)},xP=(h)=>{dN("endTimeline",h)},aN=(h)=>{if(!h.transmuxer.currentTransmux){h.transmuxer.currentTransmux=h,iN(h);return}h.transmuxer.transmuxQueue.push(h)},wP=(h)=>{let _=new TP;_.currentTransmux=null,_.transmuxQueue=[];let G=_.terminate;return _.terminate=()=>{return _.currentTransmux=null,_.transmuxQueue.length=0,G.call(_)},_.postMessage({action:"init",options:h}),_},ZM={reset:vP,endTimeline:xP,transmux:aN,createTransmuxer:wP},Ih=function(h){let _=h.transmuxer,G=h.endAction||h.action,Y=h.callback,X=U2({},h,{endAction:null,transmuxer:null,callback:null}),K=(Z)=>{if(Z.data.action!==G)return;if(_.removeEventListener("message",K),Z.data.data){if(Z.data.data=new Uint8Array(Z.data.data,h.byteOffset||0,h.byteLength||Z.data.data.byteLength),h.data)h.data=Z.data.data}Y(Z.data)};if(_.addEventListener("message",K),h.data){let Z=h.data instanceof ArrayBuffer;X.byteOffset=Z?0:h.data.byteOffset,X.byteLength=h.data.byteLength;let Q=[Z?h.data:h.data.buffer];_.postMessage(X,Q)}else _.postMessage(X)},I3={FAILURE:2,TIMEOUT:-101,ABORTED:-102},tN="wvtt",WM=(h)=>{h.forEach((_)=>{_.abort()})},gP=(h)=>{return{bandwidth:h.bandwidth,bytesReceived:h.bytesReceived||0,roundTripTime:h.roundTripTime||0}},IP=(h)=>{let _=h.target,Y={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-_.requestTime||0};return Y.bytesReceived=h.loaded,Y.bandwidth=Math.floor(Y.bytesReceived/Y.roundTripTime*8*1000),Y},TB=(h,_)=>{let{requestType:G}=_,Y=l7({requestType:G,request:_,error:h});if(_.timedout)return{status:_.status,message:"HLS request timed-out at URL: "+_.uri,code:I3.TIMEOUT,xhr:_,metadata:Y};if(_.aborted)return{status:_.status,message:"HLS request aborted at URL: "+_.uri,code:I3.ABORTED,xhr:_,metadata:Y};if(h)return{status:_.status,message:"HLS request errored at URL: "+_.uri,code:I3.FAILURE,xhr:_,metadata:Y};if(_.responseType==="arraybuffer"&&_.response.byteLength===0)return{status:_.status,message:"Empty HLS response at URL: "+_.uri,code:I3.FAILURE,xhr:_,metadata:Y};return null},dE=(h,_,G,Y)=>(X,K)=>{let Z=K.response,Q=TB(X,K);if(Q)return G(Q,h);if(Z.byteLength!==16)return G({status:K.status,message:"Invalid HLS key at URL: "+K.uri,code:I3.FAILURE,xhr:K},h);let D=new DataView(Z),O=new Uint32Array([D.getUint32(0),D.getUint32(4),D.getUint32(8),D.getUint32(12)]);for(let H=0;H<_.length;H++)_[H].bytes=O;let A={uri:K.uri};return Y({type:"segmentkeyloadcomplete",segment:h,keyInfo:A}),G(null,h)},PP=(h,_)=>{if(_===tN)h.transmuxer.postMessage({action:"initMp4WebVttParser",data:h.map.bytes})},yP=(h,_,G)=>{if(_===tN)Ih({action:"getMp4WebVttText",data:h.bytes,transmuxer:h.transmuxer,callback:({data:Y,mp4VttCues:X})=>{h.bytes=Y,G(null,h,{mp4VttCues:X})}})},sN=(h,_)=>{let G=BZ(h.map.bytes);if(G!=="mp4"){let Y=h.map.resolvedUri||h.map.uri,X=G||"unknown";return _({internal:!0,message:`Found unsupported ${X} container for initialization segment at URL: ${Y}`,code:I3.FAILURE,metadata:{mediaType:X}})}Ih({action:"probeMp4Tracks",data:h.map.bytes,transmuxer:h.transmuxer,callback:({tracks:Y,data:X})=>{return h.map.bytes=X,Y.forEach(function(K){if(h.map.tracks=h.map.tracks||{},h.map.tracks[K.type])return;if(h.map.tracks[K.type]=K,typeof K.id==="number"&&K.timescale)h.map.timescales=h.map.timescales||{},h.map.timescales[K.id]=K.timescale;if(K.type==="text")PP(h,K.codec)}),_(null)}})},bP=({segment:h,finishProcessingFn:_,triggerSegmentEventFn:G})=>(Y,X)=>{let K=TB(Y,X);if(K)return _(K,h);let Z=new Uint8Array(X.response);if(G({type:"segmentloaded",segment:h}),h.map.key)return h.map.encryptedBytes=Z,_(null,h);h.map.bytes=Z,sN(h,function(Q){if(Q)return Q.xhr=X,Q.status=X.status,_(Q,h);_(null,h)})},mP=({segment:h,finishProcessingFn:_,responseType:G,triggerSegmentEventFn:Y})=>(X,K)=>{let Z=TB(X,K);if(Z)return _(Z,h);Y({type:"segmentloaded",segment:h});let Q=G==="arraybuffer"||!K.responseText?K.response:LP(K.responseText.substring(h.lastReachedChar||0));if(h.stats=gP(K),h.key)h.encryptedBytes=new Uint8Array(Q);else h.bytes=new Uint8Array(Q);return _(null,h)},fP=({segment:h,bytes:_,trackInfoFn:G,timingInfoFn:Y,videoSegmentTimingInfoFn:X,audioSegmentTimingInfoFn:K,id3Fn:Z,captionsFn:Q,isEndOfTimeline:D,endedTimelineFn:O,dataFn:A,doneFn:H,onTransmuxerLog:C,triggerSegmentEventFn:N})=>{let j=h.map&&h.map.tracks||{},W=Boolean(j.audio&&j.video),S=Y.bind(null,h,"audio","start"),R=Y.bind(null,h,"audio","end"),v=Y.bind(null,h,"video","start"),x=Y.bind(null,h,"video","end"),P=()=>aN({bytes:_,transmuxer:h.transmuxer,audioAppendStart:h.audioAppendStart,gopsToAlignWith:h.gopsToAlignWith,remux:W,onData:(I)=>{I.type=I.type==="combined"?"video":I.type,A(h,I)},onTrackInfo:(I)=>{if(G){if(W)I.isMuxed=!0;G(h,I)}},onAudioTimingInfo:(I)=>{if(S&&typeof I.start<"u")S(I.start),S=null;if(R&&typeof I.end<"u")R(I.end)},onVideoTimingInfo:(I)=>{if(v&&typeof I.start<"u")v(I.start),v=null;if(x&&typeof I.end<"u")x(I.end)},onVideoSegmentTimingInfo:(I)=>{let b={pts:{start:I.start.presentation,end:I.end.presentation},dts:{start:I.start.decode,end:I.end.decode}};N({type:"segmenttransmuxingtiminginfoavailable",segment:h,timingInfo:b}),X(I)},onAudioSegmentTimingInfo:(I)=>{let b={pts:{start:I.start.pts,end:I.end.pts},dts:{start:I.start.dts,end:I.end.dts}};N({type:"segmenttransmuxingtiminginfoavailable",segment:h,timingInfo:b}),K(I)},onId3:(I,b)=>{Z(h,I,b)},onCaptions:(I)=>{Q(h,[I])},isEndOfTimeline:D,onEndedTimeline:()=>{O()},onTransmuxerLog:C,onDone:(I,b)=>{if(!H)return;I.type=I.type==="combined"?"video":I.type,N({type:"segmenttransmuxingcomplete",segment:h}),H(b,h,I)},segment:h,triggerSegmentEventFn:N});Ih({action:"probeTs",transmuxer:h.transmuxer,data:_,baseStartTime:h.baseStartTime,callback:(I)=>{h.bytes=_=I.data;let b=I.result;if(b)G(h,{hasAudio:b.hasAudio,hasVideo:b.hasVideo,isMuxed:W}),G=null;P()}})},nN=({segment:h,bytes:_,trackInfoFn:G,timingInfoFn:Y,videoSegmentTimingInfoFn:X,audioSegmentTimingInfoFn:K,id3Fn:Z,captionsFn:Q,isEndOfTimeline:D,endedTimelineFn:O,dataFn:A,doneFn:H,onTransmuxerLog:C,triggerSegmentEventFn:N})=>{let j=new Uint8Array(_);if(QE(j)){h.isFmp4=!0;let{tracks:W}=h.map;if(W.text&&(!W.audio||!W.video)){A(h,{data:j,type:"text"}),yP(h,W.text.codec,H);return}let R={isFmp4:!0,hasVideo:!!W.video,hasAudio:!!W.audio};if(W.audio&&W.audio.codec&&W.audio.codec!=="enca")R.audioCodec=W.audio.codec;if(W.video&&W.video.codec&&W.video.codec!=="encv")R.videoCodec=W.video.codec;if(W.video&&W.audio)R.isMuxed=!0;G(h,R);let v=(x,P)=>{if(A(h,{data:j,type:R.hasAudio&&!R.isMuxed?"audio":"video"}),P&&P.length)Z(h,P);if(x&&x.length)Q(h,x);H(null,h,{})};Ih({action:"probeMp4StartTime",timescales:h.map.timescales,data:j,transmuxer:h.transmuxer,callback:({data:x,startTime:P})=>{if(_=x.buffer,h.bytes=j=x,R.hasAudio&&!R.isMuxed)Y(h,"audio","start",P);if(R.hasVideo)Y(h,"video","start",P);Ih({action:"probeEmsgID3",data:j,transmuxer:h.transmuxer,offset:P,callback:({emsgData:I,id3Frames:b})=>{if(_=I.buffer,h.bytes=j=I,!W.video||!I.byteLength||!h.transmuxer){v(void 0,b);return}Ih({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:h.transmuxer,data:j,timescales:h.map.timescales,trackIds:[W.video.id],callback:(l)=>{_=l.data.buffer,h.bytes=j=l.data,l.logs.forEach(function(i){C(p1(i,{stream:"mp4CaptionParser"}))}),v(l.captions,b)}})}})}});return}if(!h.transmuxer){H(null,h,{});return}if(typeof h.container>"u")h.container=BZ(j);if(h.container!=="ts"&&h.container!=="aac"){G(h,{hasAudio:!1,hasVideo:!1}),H(null,h,{});return}fP({segment:h,bytes:_,trackInfoFn:G,timingInfoFn:Y,videoSegmentTimingInfoFn:X,audioSegmentTimingInfoFn:K,id3Fn:Z,captionsFn:Q,isEndOfTimeline:D,endedTimelineFn:O,dataFn:A,doneFn:H,onTransmuxerLog:C,triggerSegmentEventFn:N})},oN=function({id:h,key:_,encryptedBytes:G,decryptionWorker:Y,segment:X,doneFn:K},Z){let Q=(O)=>{if(O.data.source===h){Y.removeEventListener("message",Q);let A=O.data.decrypted;Z(new Uint8Array(A.bytes,A.byteOffset,A.byteLength))}};Y.onerror=()=>{let A=m7({segment:X}),H={message:"An error occurred in the decryption worker",metadata:{error:Error("An error occurred in the decryption worker"),errorType:Y0.Error.StreamingFailedToDecryptSegment,segmentInfo:A,keyInfo:{uri:X.key.resolvedUri||X.map.key.resolvedUri}}};K(H,X)},Y.addEventListener("message",Q);let D;if(_.bytes.slice)D=_.bytes.slice();else D=new Uint32Array(Array.prototype.slice.call(_.bytes));Y.postMessage(PN({source:h,encrypted:G,key:D,iv:_.iv}),[G.buffer,D.buffer])},kP=({decryptionWorker:h,segment:_,trackInfoFn:G,timingInfoFn:Y,videoSegmentTimingInfoFn:X,audioSegmentTimingInfoFn:K,id3Fn:Z,captionsFn:Q,isEndOfTimeline:D,endedTimelineFn:O,dataFn:A,doneFn:H,onTransmuxerLog:C,triggerSegmentEventFn:N})=>{N({type:"segmentdecryptionstart"}),oN({id:_.requestId,key:_.key,encryptedBytes:_.encryptedBytes,decryptionWorker:h,segment:_,doneFn:H},(j)=>{_.bytes=j,N({type:"segmentdecryptioncomplete",segment:_}),nN({segment:_,bytes:_.bytes,trackInfoFn:G,timingInfoFn:Y,videoSegmentTimingInfoFn:X,audioSegmentTimingInfoFn:K,id3Fn:Z,captionsFn:Q,isEndOfTimeline:D,endedTimelineFn:O,dataFn:A,doneFn:H,onTransmuxerLog:C,triggerSegmentEventFn:N})})},uP=({activeXhrs:h,decryptionWorker:_,trackInfoFn:G,timingInfoFn:Y,videoSegmentTimingInfoFn:X,audioSegmentTimingInfoFn:K,id3Fn:Z,captionsFn:Q,isEndOfTimeline:D,endedTimelineFn:O,dataFn:A,doneFn:H,onTransmuxerLog:C,triggerSegmentEventFn:N})=>{let j=0,W=!1;return(S,R)=>{if(W)return;if(S)return W=!0,WM(h),H(S,R);if(j+=1,j===h.length){let v=function(){if(R.encryptedBytes)return kP({decryptionWorker:_,segment:R,trackInfoFn:G,timingInfoFn:Y,videoSegmentTimingInfoFn:X,audioSegmentTimingInfoFn:K,id3Fn:Z,captionsFn:Q,isEndOfTimeline:D,endedTimelineFn:O,dataFn:A,doneFn:H,onTransmuxerLog:C,triggerSegmentEventFn:N});nN({segment:R,bytes:R.bytes,trackInfoFn:G,timingInfoFn:Y,videoSegmentTimingInfoFn:X,audioSegmentTimingInfoFn:K,id3Fn:Z,captionsFn:Q,isEndOfTimeline:D,endedTimelineFn:O,dataFn:A,doneFn:H,onTransmuxerLog:C,triggerSegmentEventFn:N})};if(R.endOfAllRequests=Date.now(),R.map&&R.map.encryptedBytes&&!R.map.bytes)return N({type:"segmentdecryptionstart",segment:R}),oN({decryptionWorker:_,id:R.requestId+"-init",encryptedBytes:R.map.encryptedBytes,key:R.map.key,segment:R,doneFn:H},(x)=>{R.map.bytes=x,N({type:"segmentdecryptioncomplete",segment:R}),sN(R,(P)=>{if(P)return WM(h),H(P,R);v()})});v()}}},pP=({loadendState:h,abortFn:_})=>(G)=>{if(G.target.aborted&&_&&!h.calledAbortFn)_(),h.calledAbortFn=!0},lP=({segment:h,progressFn:_,trackInfoFn:G,timingInfoFn:Y,videoSegmentTimingInfoFn:X,audioSegmentTimingInfoFn:K,id3Fn:Z,captionsFn:Q,isEndOfTimeline:D,endedTimelineFn:O,dataFn:A})=>(H)=>{if(H.target.aborted)return;if(h.stats=p1(h.stats,IP(H)),!h.stats.firstBytesReceivedAt&&h.stats.bytesReceived)h.stats.firstBytesReceivedAt=Date.now();return _(H,h)},iP=({xhr:h,xhrOptions:_,decryptionWorker:G,segment:Y,abortFn:X,progressFn:K,trackInfoFn:Z,timingInfoFn:Q,videoSegmentTimingInfoFn:D,audioSegmentTimingInfoFn:O,id3Fn:A,captionsFn:H,isEndOfTimeline:C,endedTimelineFn:N,dataFn:j,doneFn:W,onTransmuxerLog:S,triggerSegmentEventFn:R})=>{let v=[],x=uP({activeXhrs:v,decryptionWorker:G,trackInfoFn:Z,timingInfoFn:Q,videoSegmentTimingInfoFn:D,audioSegmentTimingInfoFn:O,id3Fn:A,captionsFn:H,isEndOfTimeline:C,endedTimelineFn:N,dataFn:j,doneFn:W,onTransmuxerLog:S,triggerSegmentEventFn:R});if(Y.key&&!Y.key.bytes){let i=[Y.key];if(Y.map&&!Y.map.bytes&&Y.map.key&&Y.map.key.resolvedUri===Y.key.resolvedUri)i.push(Y.map.key);let h0=p1(_,{uri:Y.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),q0=dE(Y,i,x,R),Q0={uri:Y.key.resolvedUri};R({type:"segmentkeyloadstart",segment:Y,keyInfo:Q0});let o=h(h0,q0);v.push(o)}if(Y.map&&!Y.map.bytes){if(Y.map.key&&(!Y.key||Y.key.resolvedUri!==Y.map.key.resolvedUri)){let o=p1(_,{uri:Y.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),r=dE(Y,[Y.map.key],x,R),d={uri:Y.map.key.resolvedUri};R({type:"segmentkeyloadstart",segment:Y,keyInfo:d});let s=h(o,r);v.push(s)}let h0=p1(_,{uri:Y.map.resolvedUri,responseType:"arraybuffer",headers:TM(Y.map),requestType:"segment-media-initialization"}),q0=bP({segment:Y,finishProcessingFn:x,triggerSegmentEventFn:R});R({type:"segmentloadstart",segment:Y});let Q0=h(h0,q0);v.push(Q0)}let P=p1(_,{uri:Y.part&&Y.part.resolvedUri||Y.resolvedUri,responseType:"arraybuffer",headers:TM(Y),requestType:"segment"}),I=mP({segment:Y,finishProcessingFn:x,responseType:P.responseType,triggerSegmentEventFn:R});R({type:"segmentloadstart",segment:Y});let b=h(P,I);b.addEventListener("progress",lP({segment:Y,progressFn:K,trackInfoFn:Z,timingInfoFn:Q,videoSegmentTimingInfoFn:D,audioSegmentTimingInfoFn:O,id3Fn:A,captionsFn:H,isEndOfTimeline:C,endedTimelineFn:N,dataFn:j})),v.push(b);let l={};return v.forEach((i)=>{i.addEventListener("loadend",pP({loadendState:l,abortFn:X}))}),()=>WM(v)},HZ=a4("PlaylistSelector"),aE=function(h){if(!h||!h.playlist)return;let _=h.playlist;return JSON.stringify({id:_.id,bandwidth:h.bandwidth,width:h.width,height:h.height,codecs:_.attributes&&_.attributes.CODECS||""})},Ph=function(h,_){if(!h)return"";let G=a.default.getComputedStyle(h);if(!G)return"";return G[_]},yh=function(h,_){let G=h.slice();h.sort(function(Y,X){let K=_(Y,X);if(K===0)return G.indexOf(Y)-G.indexOf(X);return K})},WB=function(h,_){let G,Y;if(h.attributes.BANDWIDTH)G=h.attributes.BANDWIDTH;if(G=G||a.default.Number.MAX_VALUE,_.attributes.BANDWIDTH)Y=_.attributes.BANDWIDTH;return Y=Y||a.default.Number.MAX_VALUE,G-Y},cP=function(h,_){let G,Y;if(h.attributes.RESOLUTION&&h.attributes.RESOLUTION.width)G=h.attributes.RESOLUTION.width;if(G=G||a.default.Number.MAX_VALUE,_.attributes.RESOLUTION&&_.attributes.RESOLUTION.width)Y=_.attributes.RESOLUTION.width;if(Y=Y||a.default.Number.MAX_VALUE,G===Y&&h.attributes.BANDWIDTH&&_.attributes.BANDWIDTH)return h.attributes.BANDWIDTH-_.attributes.BANDWIDTH;return G-Y},rN=function(h){let{main:_,bandwidth:G,playerWidth:Y,playerHeight:X,playerObjectFit:K,limitRenditionByPlayerDimensions:Z,playlistController:Q}=h;if(!_)return;let D={bandwidth:G,width:Y,height:X,limitRenditionByPlayerDimensions:Z},O=_.playlists;if(J4.isAudioOnly(_))O=Q.getAudioTrackPlaylists_(),D.audioOnly=!0;let A=O.map((l)=>{let i,h0=l.attributes&&l.attributes.RESOLUTION&&l.attributes.RESOLUTION.width,q0=l.attributes&&l.attributes.RESOLUTION&&l.attributes.RESOLUTION.height;return i=l.attributes&&l.attributes.BANDWIDTH,i=i||a.default.Number.MAX_VALUE,{bandwidth:i,width:h0,height:q0,playlist:l}});yh(A,(l,i)=>l.bandwidth-i.bandwidth),A=A.filter((l)=>!J4.isIncompatible(l.playlist));let H=A.filter((l)=>J4.isEnabled(l.playlist));if(!H.length)H=A.filter((l)=>!J4.isDisabled(l.playlist));let C=H.filter((l)=>l.bandwidth*q5.BANDWIDTH_VARIANCE<G),N=C[C.length-1],j=C.filter((l)=>l.bandwidth===N.bandwidth)[0];if(Z===!1){let l=j||H[0]||A[0];if(l&&l.playlist){let i="sortedPlaylistReps";if(j)i="bandwidthBestRep";if(H[0])i="enabledPlaylistReps";return HZ(`choosing ${aE(l)} using ${i} with options`,D),l.playlist}return HZ("could not choose a playlist with options",D),null}let W=C.filter((l)=>l.width&&l.height);yh(W,(l,i)=>l.width-i.width);let S=W.filter((l)=>l.width===Y&&l.height===X);N=S[S.length-1];let R=S.filter((l)=>l.bandwidth===N.bandwidth)[0],v,x,P;if(!R)v=W.filter((l)=>{if(K==="cover")return l.width>Y&&l.height>X;return l.width>Y||l.height>X}),x=v.filter((l)=>l.width===v[0].width&&l.height===v[0].height),N=x[x.length-1],P=x.filter((l)=>l.bandwidth===N.bandwidth)[0];let I;if(Q.leastPixelDiffSelector){let l=W.map((i)=>{return i.pixelDiff=Math.abs(i.width-Y)+Math.abs(i.height-X),i});yh(l,(i,h0)=>{if(i.pixelDiff===h0.pixelDiff)return h0.bandwidth-i.bandwidth;return i.pixelDiff-h0.pixelDiff}),I=l[0]}let b=I||P||R||j||H[0]||A[0];if(b&&b.playlist){let l="sortedPlaylistReps";if(I)l="leastPixelDiffRep";else if(P)l="resolutionPlusOneRep";else if(R)l="resolutionBestRep";else if(j)l="bandwidthBestRep";else if(H[0])l="enabledPlaylistReps";return HZ(`choosing ${aE(b)} using ${l} with options`,D),b.playlist}return HZ("could not choose a playlist with options",D),null},tE=function(){let h=this.useDevicePixelRatio?a.default.devicePixelRatio||1:1;if(!isNaN(this.customPixelRatio))h=this.customPixelRatio;return rN({main:this.playlists.main,bandwidth:this.systemBandwidth,playerWidth:parseInt(Ph(this.tech_.el(),"width"),10)*h,playerHeight:parseInt(Ph(this.tech_.el(),"height"),10)*h,playerObjectFit:this.usePlayerObjectFit?Ph(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})},dP=function(h){let _=-1,G=-1;if(h<0||h>1)throw Error("Moving average bandwidth decay must be between 0 and 1.");return function(){let Y=this.useDevicePixelRatio?a.default.devicePixelRatio||1:1;if(!isNaN(this.customPixelRatio))Y=this.customPixelRatio;if(_<0)_=this.systemBandwidth,G=this.systemBandwidth;if(this.systemBandwidth>0&&this.systemBandwidth!==G)_=h*this.systemBandwidth+(1-h)*_,G=this.systemBandwidth;return rN({main:this.playlists.main,bandwidth:_,playerWidth:parseInt(Ph(this.tech_.el(),"width"),10)*Y,playerHeight:parseInt(Ph(this.tech_.el(),"height"),10)*Y,playerObjectFit:this.usePlayerObjectFit?Ph(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})}},aP=function(h){let{main:_,currentTime:G,bandwidth:Y,duration:X,segmentDuration:K,timeUntilRebuffer:Z,currentTimeline:Q,syncController:D}=h,O=_.playlists.filter((j)=>!J4.isIncompatible(j)),A=O.filter(J4.isEnabled);if(!A.length)A=O.filter((j)=>!J4.isDisabled(j));let C=A.filter(J4.hasAttribute.bind(null,"BANDWIDTH")).map((j)=>{let S=D.getSyncPoint(j,X,Q,G)?1:2,v=J4.estimateSegmentRequestTime(K,Y,j)*S-Z;return{playlist:j,rebufferingImpact:v}}),N=C.filter((j)=>j.rebufferingImpact<=0);if(yh(N,(j,W)=>WB(W.playlist,j.playlist)),N.length)return N[0];return yh(C,(j,W)=>j.rebufferingImpact-W.rebufferingImpact),C[0]||null},tP=function(){let h=this.playlists.main.playlists.filter(J4.isEnabled);return yh(h,(G,Y)=>WB(G,Y)),h.filter((G)=>!!ZY(this.playlists.main,G).video)[0]||null},sP=(h)=>{let _=0,G;if(h.bytes)G=new Uint8Array(h.bytes),h.segments.forEach((Y)=>{G.set(Y,_),_+=Y.byteLength});return G};function eN(h){try{return new URL(h).pathname.split("/").slice(-2).join("/")}catch(_){return""}}var nP=function(h,_,G){if(!h[G]){_.trigger({type:"usage",name:"vhs-608"});let Y=G;if(/^cc708_/.test(G))Y="SERVICE"+G.split("_")[1];let X=_.textTracks().getTrackById(Y);if(X)h[G]=X;else{let K=_.options_.vhs&&_.options_.vhs.captionServices||{},Z=G,Q=G,D=!1,O=K[Y];if(O)Z=O.label,Q=O.language,D=O.default;h[G]=_.addRemoteTextTrack({kind:"captions",id:Y,default:D,label:Z,language:Q},!1).track}}},oP=function({inbandTextTracks:h,captionArray:_,timestampOffset:G}){if(!_)return;let Y=a.default.WebKitDataCue||a.default.VTTCue;_.forEach((X)=>{let K=X.stream;if(X.content)X.content.forEach((Z)=>{let Q=new Y(X.startTime+G,X.endTime+G,Z.text);Q.line=Z.line,Q.align="left",Q.position=Z.position,Q.positionAlign="line-left",h[K].addCue(Q)});else h[K].addCue(new Y(X.startTime+G,X.endTime+G,X.text))})},rP=function(h){Object.defineProperties(h.frame,{id:{get(){return Y0.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),h.value.key}},value:{get(){return Y0.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),h.value.data}},privateData:{get(){return Y0.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),h.value.data}}})},eP=({inbandTextTracks:h,metadataArray:_,timestampOffset:G,videoDuration:Y})=>{if(!_)return;let X=a.default.WebKitDataCue||a.default.VTTCue,K=h.metadataTrack_;if(!K)return;if(_.forEach((A)=>{let H=A.cueTime+G;if(typeof H!=="number"||a.default.isNaN(H)||H<0||!(H<1/0))return;if(!A.frames||!A.frames.length)return;A.frames.forEach((C)=>{let N=new X(H,H,C.value||C.url||C.data||"");N.frame=C,N.value=C,rP(N),K.addCue(N)})}),!K.cues||!K.cues.length)return;let Z=K.cues,Q=[];for(let A=0;A<Z.length;A++)if(Z[A])Q.push(Z[A]);let D=Q.reduce((A,H)=>{let C=A[H.startTime]||[];return C.push(H),A[H.startTime]=C,A},{}),O=Object.keys(D).sort((A,H)=>Number(A)-Number(H));O.forEach((A,H)=>{let C=D[A],N=isFinite(Y)?Y:A,j=Number(O[H+1])||N;C.forEach((W)=>{W.endTime=j})})},hy={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"},_y=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),Gy=({inbandTextTracks:h,dateRanges:_})=>{let G=h.metadataTrack_;if(!G)return;let Y=a.default.WebKitDataCue||a.default.VTTCue;_.forEach((X)=>{for(let K of Object.keys(X)){if(_y.has(K))continue;let Z=new Y(X.startTime,X.endTime,"");if(Z.id=X.id,Z.type="com.apple.quicktime.HLS",Z.value={key:hy[K],data:X[K]},K==="scte35Out"||K==="scte35In")Z.value.data=new Uint8Array(Z.value.data.match(/[\da-f]{2}/gi)).buffer;G.addCue(Z)}X.processDateRange()})},sE=(h,_,G)=>{if(h.metadataTrack_)return;if(h.metadataTrack_=G.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,!Y0.browser.IS_ANY_SAFARI)h.metadataTrack_.inBandMetadataTrackDispatchType=_},_Y=function(h,_,G){let Y,X;if(!G)return;if(!G.cues)return;Y=G.cues.length;while(Y--)if(X=G.cues[Y],X.startTime>=h&&X.endTime<=_)G.removeCue(X)},Yy=function(h){let _=h.cues;if(!_)return;let G={};for(let Y=_.length-1;Y>=0;Y--){let X=_[Y],K=`${X.startTime}-${X.endTime}-${X.text}`;if(G[K])h.removeCue(X);else G[K]=X}},Xy=(h,_,G)=>{if(typeof _>"u"||_===null||!h.length)return[];let Y=Math.ceil((_-G+3)*L8.ONE_SECOND_IN_TS),X;for(X=0;X<h.length;X++)if(h[X].pts>Y)break;return h.slice(X)},Ky=(h,_,G)=>{if(!_.length)return h;if(G)return _.slice();let Y=_[0].pts,X=0;for(X;X<h.length;X++)if(h[X].pts>=Y)break;return h.slice(0,X).concat(_)},Zy=(h,_,G,Y)=>{let X=Math.ceil((_-Y)*L8.ONE_SECOND_IN_TS),K=Math.ceil((G-Y)*L8.ONE_SECOND_IN_TS),Z=h.slice(),Q=h.length;while(Q--)if(h[Q].pts<=K)break;if(Q===-1)return Z;let D=Q+1;while(D--)if(h[D].pts<=X)break;return D=Math.max(D,0),Z.splice(D,Q-D+1),Z},Jy=function(h,_){if(!h&&!_||!h&&_||h&&!_)return!1;if(h===_)return!0;let G=Object.keys(h).sort(),Y=Object.keys(_).sort();if(G.length!==Y.length)return!1;for(let X=0;X<G.length;X++){let K=G[X];if(K!==Y[X])return!1;if(h[K]!==_[K])return!1}return!0},qy=function(h,_,G){_=_||[];let Y=[],X=0;for(let K=0;K<_.length;K++){let Z=_[K];if(h===Z.timeline){if(Y.push(K),X+=Z.duration,X>G)return K}}if(Y.length===0)return 0;return Y[Y.length-1]},eG=1,Qy=500,nE=(h)=>typeof h==="number"&&isFinite(h),VZ=0.016666666666666666,Dy=(h,_,G)=>{if(h!=="main"||!_||!G)return null;if(!G.hasAudio&&!G.hasVideo)return"Neither audio nor video found in segment.";if(_.hasVideo&&!G.hasVideo)return"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.";if(!_.hasVideo&&G.hasVideo)return"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.";return null},My=(h,_,G)=>{let Y=_-q5.BACK_BUFFER_LENGTH;if(h.length)Y=Math.max(Y,h.start(0));let X=_-G;return Math.min(X,Y)},Th=(h)=>{let{startOfSegment:_,duration:G,segment:Y,part:X,playlist:{mediaSequence:K,id:Z,segments:Q=[]},mediaIndex:D,partIndex:O,timeline:A}=h,H=Q.length-1,C="mediaIndex/partIndex increment";if(h.getMediaInfoForTime)C=`getMediaInfoForTime (${h.getMediaInfoForTime})`;else if(h.isSyncRequest)C="getSyncSegmentCandidate (isSyncRequest)";if(h.independent)C+=` with independent ${h.independent}`;let N=typeof O==="number",j=h.segment.uri?"segment":"pre-segment",W=N?VN({preloadSegment:Y})-1:0;return`${j} [${K+D}/${K+H}]`+(N?` part [${O}/${W}]`:"")+` segment start/end [${Y.start} => ${Y.end}]`+(N?` part start/end [${X.start} => ${X.end}]`:"")+` startOfSegment [${_}] duration [${G}] timeline [${A}] selected by [${C}] playlist [${Z}]`},oE=(h)=>`${h}TimingInfo`,By=({segmentTimeline:h,currentTimeline:_,startOfSegment:G,buffered:Y,overrideCheck:X})=>{if(!X&&h===_)return null;if(h<_)return G;return Y.length?Y.end(Y.length-1):G},RM=({timelineChangeController:h,currentTimeline:_,segmentTimeline:G,loaderType:Y,audioDisabled:X})=>{if(_===G)return!1;if(Y==="audio"){let K=h.lastTimelineChange({type:"main"});return!K||K.to!==G}if(Y==="main"&&X){let K=h.pendingTimelineChange({type:"audio"});if(K&&K.to===G)return!1;return!0}return!1},Oy=(h)=>{if(!h)return!1;let _=h.pendingTimelineChange({type:"audio"}),G=h.pendingTimelineChange({type:"main"}),Y=_&&G,X=Y&&_.to!==G.to;if(Y&&_.from!==-1&&G.from!==-1&&X)return!0;return!1},Ay=(h)=>{let _=h.timelineChangeController_.pendingTimelineChange({type:"audio"}),G=h.timelineChangeController_.pendingTimelineChange({type:"main"});return _&&G&&_.to<G.to},C8=(h)=>{let _=h.pendingSegment_;if(!_)return;if(RM({timelineChangeController:h.timelineChangeController_,currentTimeline:h.currentTimeline_,segmentTimeline:_.timeline,loaderType:h.loaderType_,audioDisabled:h.audioDisabled_})&&Oy(h.timelineChangeController_)){if(Ay(h)){h.timelineChangeController_.trigger("audioTimelineBehind");return}h.timelineChangeController_.trigger("fixBadTimelineChange")}},zy=(h)=>{let _=0;if(["video","audio"].forEach(function(G){let Y=h[`${G}TimingInfo`];if(!Y)return;let{start:X,end:K}=Y,Z;if(typeof X==="bigint"||typeof K==="bigint")Z=a.default.BigInt(K)-a.default.BigInt(X);else if(typeof X==="number"&&typeof K==="number")Z=K-X;if(typeof Z<"u"&&Z>_)_=Z}),typeof _==="bigint"&&_<Number.MAX_SAFE_INTEGER)_=Number(_);return _},rE=({segmentDuration:h,maxDuration:_})=>{if(!h)return!1;return Math.round(h)>_+w3},Hy=(h,_)=>{if(_!=="hls")return null;let G=zy({audioTimingInfo:h.audioTimingInfo,videoTimingInfo:h.videoTimingInfo});if(!G)return null;let Y=h.playlist.targetDuration,X=rE({segmentDuration:G,maxDuration:Y*2}),K=rE({segmentDuration:G,maxDuration:Y}),Z=`Segment with index ${h.mediaIndex} from playlist ${h.playlist.id} has a duration of ${G} when the reported duration is ${h.duration} and the target duration is ${Y}. 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`;if(X||K)return{severity:X?"warn":"info",message:Z};return null},m7=({type:h,segment:_})=>{if(!_)return;let G=Boolean(_.key||_.map&&_.map.ke),Y=Boolean(_.map&&!_.map.bytes),X=_.startOfSegment===void 0?_.start:_.startOfSegment;return{type:h||_.type,uri:_.resolvedUri||_.uri,start:X,duration:_.duration,isEncrypted:G,isMediaInitialization:Y}};class fZ extends Y0.EventTarget{constructor(h,_={}){super();if(!h)throw TypeError("Initialization settings are required");if(typeof h.currentTime!=="function")throw TypeError("No currentTime getter specified");if(!h.mediaSource)throw TypeError("No MediaSource specified");if(this.bandwidth=h.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=h.hasPlayed,this.currentTime_=h.currentTime,this.seekable_=h.seekable,this.seeking_=h.seeking,this.duration_=h.duration,this.mediaSource_=h.mediaSource,this.vhs_=h.vhs,this.loaderType_=h.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=h.segmentMetadataTrack,this.goalBufferLength_=h.goalBufferLength,this.sourceType_=h.sourceType,this.sourceUpdater_=h.sourceUpdater,this.inbandTextTracks_=h.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=h.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=h.parse708captions,this.useDtsForTimestampOffset_=h.useDtsForTimestampOffset,this.captionServices_=h.captionServices,this.exactManifestTimings=h.exactManifestTimings,this.addMetadataToTextTrack=h.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_=h.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=h.decrypter,this.syncController_=h.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",()=>{if(!this.isEndOfStream_())this.ended_=!1}),this.fetchAtBuffer_=!1,this.logger_=a4(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(G){if(G!==this.state_)this.logger_(`${this.state_} -> ${G}`),this.state_=G,this.trigger("statechange")}}),this.sourceUpdater_.on("ready",()=>{if(this.hasEnoughInfoToAppend_())this.processCallQueue_();else C8(this)}),this.sourceUpdater_.on("codecschange",(G)=>{this.trigger(U2({type:"codecschange"},G))}),this.loaderType_==="main")this.timelineChangeController_.on("pendingtimelinechange",()=>{if(this.hasEnoughInfoToAppend_())this.processCallQueue_();else C8(this)});if(this.loaderType_==="audio")this.timelineChangeController_.on("timelinechange",(G)=>{if(this.trigger(U2({type:"timelinechange"},G)),this.hasEnoughInfoToLoad_())this.processLoadQueue_();else C8(this);if(this.hasEnoughInfoToAppend_())this.processCallQueue_();else C8(this)})}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return ZM.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(){if(this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_)this.transmuxer_.terminate();if(this.resetStats_(),this.checkBufferTimeout_)a.default.clearTimeout(this.checkBufferTimeout_);if(this.syncController_&&this.triggerSyncInfoUpdate_)this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_);this.off()}setAudio(h){if(this.audioDisabled_=!h,h)this.appendInitSegment_.audio=!0;else this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){if(this.state!=="WAITING"){if(this.pendingSegment_)this.pendingSegment_=null;this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_);return}if(this.abort_(),this.state="READY",!this.paused())this.monitorBuffer_()}abort_(){if(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,a.default.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(h){if(this.state==="APPENDING"&&!this.pendingSegment_)return this.state="READY",!0;if(!this.pendingSegment_||this.pendingSegment_.requestId!==h)return!0;return!1}error(h){if(typeof h<"u")this.logger_("error occurred:",h),this.error_=h;return this.pendingSegment_=null,this.error_}endOfStream(){if(this.ended_=!0,this.transmuxer_)ZM.reset(this.transmuxer_);this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){let h=this.getMediaInfo_();if(!this.sourceUpdater_||!h)return Q5();if(this.loaderType_==="main"){let{hasAudio:_,hasVideo:G,isMuxed:Y}=h;if(G&&_&&!this.audioDisabled_&&!Y)return this.sourceUpdater_.buffered();if(G)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(h,_=!1){if(!h)return null;let G=bZ(h),Y=this.initSegments_[G];if(_&&!Y&&h.bytes)this.initSegments_[G]=Y={resolvedUri:h.resolvedUri,byterange:h.byterange,bytes:h.bytes,tracks:h.tracks,timescales:h.timescales};return Y||h}segmentKey(h,_=!1){if(!h)return null;let G=yN(h),Y=this.keyCache_[G];if(this.cacheEncryptionKeys_&&_&&!Y&&h.bytes)this.keyCache_[G]=Y={resolvedUri:h.resolvedUri,bytes:h.bytes};let X={resolvedUri:(Y||h).resolvedUri};if(Y)X.bytes=Y.bytes;return X}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),!this.playlist_)return;if(this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT")return;this.state="READY"}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(h,_={}){if(!h)return;if(this.playlist_&&this.playlist_.endList&&h.endList&&this.playlist_.uri===h.uri)return;let G=this.playlist_,Y=this.pendingSegment_;if(this.playlist_=h,this.xhrOptions_=_,this.state==="INIT"){if(h.syncInfo={mediaSequence:h.mediaSequence,time:0},this.loaderType_==="main")this.syncController_.setDateTimeMappingForStart(h)}let X=null;if(G){if(G.id)X=G.id;else if(G.uri)X=G.uri}if(this.logger_(`playlist update [${X} => ${h.id||h.uri}]`),this.mediaSequenceSync_)this.mediaSequenceSync_.update(h,this.currentTime_()),this.logger_(`Playlist update:
|
|
230
|
-
currentTime: ${this.currentTime_()}
|
|
231
|
-
bufferedEnd: ${XM(this.buffered_())}
|
|
232
|
-
`,this.mediaSequenceSync_.diagnostics);if(this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!G||G.uri!==h.uri){if(this.mediaIndex!==null)if(!h.endList&&typeof h.partTargetDuration==="number")this.resetLoader();else this.resyncLoader();this.currentMediaInfo_=void 0,this.trigger("playlistupdate");return}let K=h.mediaSequence-G.mediaSequence;if(this.logger_(`live window shift [${K}]`),this.mediaIndex!==null)if(this.mediaIndex-=K,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{let Z=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!Z.parts||!Z.parts.length||!Z.parts[this.partIndex])){let Q=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=Q}}if(Y)if(Y.mediaIndex-=K,Y.mediaIndex<0)Y.mediaIndex=null,Y.partIndex=null;else{if(Y.mediaIndex>=0)Y.segment=h.segments[Y.mediaIndex];if(Y.partIndex>=0&&Y.segment.parts)Y.part=Y.segment.parts[Y.partIndex]}this.syncController_.saveExpiredSegmentInfo(G,h)}pause(){if(this.checkBufferTimeout_)a.default.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null}paused(){return this.checkBufferTimeout_===null}resetEverything(h){if(this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,h),this.transmuxer_)this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"})}resetLoader(){if(this.fetchAtBuffer_=!1,this.mediaSequenceSync_)this.mediaSequenceSync_.resetAppendedStatus();this.resyncLoader()}resyncLoader(){if(this.transmuxer_)ZM.reset(this.transmuxer_);this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1;let h=this.currentMediaInfo_&&this.currentMediaInfo_.isFmp4;if(this.sourceType_==="hls"&&!h)this.shouldForceTimestampOffsetAfterResync_=!0;if(this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_)this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(h,_,G=()=>{},Y=!1){if(_===1/0)_=this.duration_();if(_<=h){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 X=1,K=()=>{if(X--,X===0)G()};if(Y||!this.audioDisabled_)X++,this.sourceUpdater_.removeAudio(h,_,K);if(Y||this.loaderType_==="main")this.gopBuffer_=Zy(this.gopBuffer_,h,_,this.timeMapping_),X++,this.sourceUpdater_.removeVideo(h,_,K);for(let Z in this.inbandTextTracks_)_Y(h,_,this.inbandTextTracks_[Z]);_Y(h,_,this.segmentMetadataTrack_),K()}monitorBuffer_(){if(this.checkBufferTimeout_)a.default.clearTimeout(this.checkBufferTimeout_);this.checkBufferTimeout_=a.default.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){if(this.state==="READY")this.fillBuffer_();if(this.checkBufferTimeout_)a.default.clearTimeout(this.checkBufferTimeout_);this.checkBufferTimeout_=a.default.setTimeout(this.monitorBufferTick_.bind(this),Qy)}fillBuffer_(){if(this.sourceUpdater_.updating())return;let h=this.chooseNextRequest_();if(!h)return;let _={segmentInfo:m7({type:this.loaderType_,segment:h})};if(this.trigger({type:"segmentselected",metadata:_}),typeof h.timestampOffset==="number")this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:h.timeline});this.loadSegment_(h)}isEndOfStream_(h=this.mediaIndex,_=this.playlist_,G=this.partIndex){if(!_||!this.mediaSource_)return!1;let Y=typeof h==="number"&&_.segments[h],X=h+1===_.segments.length,K=!Y||!Y.parts||G+1===Y.parts.length;return _.endList&&this.mediaSource_.readyState==="open"&&X&&K}chooseNextRequest_(){let h=this.buffered_(),_=XM(h)||0,G=$B(h,this.currentTime_()),Y=!this.hasPlayed_()&&G>=1,X=G>=this.goalBufferLength_(),K=this.playlist_.segments;if(!K.length||Y||X)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);let Z={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)};if(Z.isSyncRequest)Z.mediaIndex=qy(this.currentTimeline_,K,_),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${Z.mediaIndex}`);else if(this.mediaIndex!==null){let H=K[this.mediaIndex],C=typeof this.partIndex==="number"?this.partIndex:-1;if(Z.startOfSegment=H.end?H.end:_,H.parts&&H.parts[C+1])Z.mediaIndex=this.mediaIndex,Z.partIndex=C+1;else Z.mediaIndex=this.mediaIndex+1}else{let H,C,N,j=this.fetchAtBuffer_?_:this.currentTime_();if(this.mediaSequenceSync_)this.logger_(`chooseNextRequest_ request after Quality Switch:
|
|
233
|
-
For TargetTime: ${j}.
|
|
234
|
-
CurrentTime: ${this.currentTime_()}
|
|
235
|
-
BufferedEnd: ${_}
|
|
236
|
-
Fetch At Buffer: ${this.fetchAtBuffer_}
|
|
237
|
-
`,this.mediaSequenceSync_.diagnostics);if(this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){let W=this.getSyncInfoFromMediaSequenceSync_(j);if(!W)return this.error({message:"No sync info found while using media sequence sync",metadata:{errorType:Y0.Error.StreamingFailedToSelectNextSegment,error:Error("No sync info found while using media sequence sync")}}),this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null;this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${W.start} --> ${W.end})`),H=W.segmentIndex,C=W.partIndex,N=W.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");let W=J4.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:j,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});H=W.segmentIndex,C=W.partIndex,N=W.startTime}Z.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${j}`:`currentTime ${j}`,Z.mediaIndex=H,Z.startOfSegment=N,Z.partIndex=C,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${Z.mediaIndex} `)}let Q=K[Z.mediaIndex],D=Q&&typeof Z.partIndex==="number"&&Q.parts&&Q.parts[Z.partIndex];if(!Q||typeof Z.partIndex==="number"&&!D)return null;if(typeof Z.partIndex!=="number"&&Q.parts)Z.partIndex=0,D=Q.parts[0];let O=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!G&&D&&!O&&!D.independent){if(Z.partIndex===0){let H=K[Z.mediaIndex-1],C=H.parts&&H.parts.length&&H.parts[H.parts.length-1];if(C&&C.independent)Z.mediaIndex-=1,Z.partIndex=H.parts.length-1,Z.independent="previous segment"}else if(Q.parts[Z.partIndex-1].independent)Z.partIndex-=1,Z.independent="previous part"}let A=this.mediaSource_&&this.mediaSource_.readyState==="ended";if(Z.mediaIndex>=K.length-1&&A&&!this.seeking_())return null;if(this.shouldForceTimestampOffsetAfterResync_)this.shouldForceTimestampOffsetAfterResync_=!1,Z.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync");return this.generateSegmentInfo_(Z)}getSyncInfoFromMediaSequenceSync_(h){if(!this.mediaSequenceSync_)return null;let _=Math.max(h,this.mediaSequenceSync_.start);if(h!==_)this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${h} to ${_}`);let G=this.mediaSequenceSync_.getSyncInfoForTime(_);if(!G)return null;if(!G.isAppended)return G;let Y=this.mediaSequenceSync_.getSyncInfoForTime(G.end);if(!Y)return null;if(Y.isAppended)this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!");return Y}generateSegmentInfo_(h){let{independent:_,playlist:G,mediaIndex:Y,startOfSegment:X,isSyncRequest:K,partIndex:Z,forceTimestampOffset:Q,getMediaInfoForTime:D}=h,O=G.segments[Y],A=typeof Z==="number"&&O.parts[Z],H={requestId:"segment-loader-"+Math.random(),uri:A&&A.resolvedUri||O.resolvedUri,mediaIndex:Y,partIndex:A?Z:null,isSyncRequest:K,startOfSegment:X,playlist:G,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:O.timeline,duration:A&&A.duration||O.duration,segment:O,part:A,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:D,independent:_},C=typeof Q<"u"?Q:this.isPendingTimestampOffset_;H.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:O.timeline,currentTimeline:this.currentTimeline_,startOfSegment:X,buffered:this.buffered_(),overrideCheck:C});let N=XM(this.sourceUpdater_.audioBuffered());if(typeof N==="number")H.audioAppendStart=N-this.sourceUpdater_.audioTimestampOffset();if(this.sourceUpdater_.videoBuffered().length)H.gopsToAlignWith=Xy(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_);return H}timestampOffsetForSegment_(h){return By(h)}earlyAbortWhenNeeded_(h){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH)return;if(Date.now()-(h.firstBytesReceivedAt||Date.now())<1000)return;let _=this.currentTime_(),G=h.bandwidth,Y=this.pendingSegment_.duration,X=J4.estimateSegmentRequestTime(Y,G,this.playlist_,h.bytesReceived),K=II(this.buffered_(),_,this.vhs_.tech_.playbackRate())-1;if(X<=K)return;let Z=aP({main:this.vhs_.playlists.main,currentTime:_,bandwidth:G,duration:this.duration_(),segmentDuration:Y,timeUntilRebuffer:K,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!Z)return;let D=X-K-Z.rebufferingImpact,O=0.5;if(K<=w3)O=1;if(!Z.playlist||Z.playlist.uri===this.playlist_.uri||D<O)return;this.bandwidth=Z.playlist.attributes.BANDWIDTH*q5.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort")}handleAbort_(h){this.logger_(`Aborting ${Th(h)}`),this.mediaRequestsAborted+=1}handleProgress_(h,_){if(this.earlyAbortWhenNeeded_(_.stats),this.checkForAbort_(_.requestId))return;this.trigger("progress")}handleTrackInfo_(h,_){let{hasAudio:G,hasVideo:Y}=_,X={segmentInfo:m7({type:this.loaderType_,segment:h}),trackInfo:{hasAudio:G,hasVideo:Y}};if(this.trigger({type:"segmenttransmuxingtrackinfoavailable",metadata:X}),this.earlyAbortWhenNeeded_(h.stats),this.checkForAbort_(h.requestId))return;if(this.checkForIllegalMediaSwitch(_))return;if(_=_||{},!Jy(this.currentMediaInfo_,_))this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=_,this.currentMediaInfo_=_,this.logger_("trackinfo update",_),this.trigger("trackinfo");if(this.checkForAbort_(h.requestId))return;if(this.pendingSegment_.trackInfo=_,this.hasEnoughInfoToAppend_())this.processCallQueue_();else C8(this)}handleTimingInfo_(h,_,G,Y){if(this.earlyAbortWhenNeeded_(h.stats),this.checkForAbort_(h.requestId))return;let X=this.pendingSegment_,K=oE(_);if(X[K]=X[K]||{},X[K][G]=Y,this.logger_(`timinginfo: ${_} - ${G} - ${Y}`),this.hasEnoughInfoToAppend_())this.processCallQueue_();else C8(this)}handleCaptions_(h,_){if(this.earlyAbortWhenNeeded_(h.stats),this.checkForAbort_(h.requestId))return;if(_.length===0){this.logger_("SegmentLoader received no captions from a caption event");return}if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,h,_));return}let Y=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),X={};if(_.forEach((K)=>{X[K.stream]=X[K.stream]||{startTime:1/0,captions:[],endTime:0};let Z=X[K.stream];Z.startTime=Math.min(Z.startTime,K.startTime+Y),Z.endTime=Math.max(Z.endTime,K.endTime+Y),Z.captions.push(K)}),Object.keys(X).forEach((K)=>{let{startTime:Z,endTime:Q,captions:D}=X[K],O=this.inbandTextTracks_;this.logger_(`adding cues from ${Z} -> ${Q} for ${K}`),nP(O,this.vhs_.tech_,K),_Y(Z,Q,O[K]),oP({captionArray:D,inbandTextTracks:O,timestampOffset:Y})}),this.transmuxer_)this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(h,_,G){if(this.earlyAbortWhenNeeded_(h.stats),this.checkForAbort_(h.requestId))return;if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,h,_,G));return}this.addMetadataToTextTrack(G,_,this.duration_())}processMetadataQueue_(){this.metadataQueue_.id3.forEach((h)=>h()),this.metadataQueue_.caption.forEach((h)=>h()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){let h=this.callQueue_;this.callQueue_=[],h.forEach((_)=>_())}processLoadQueue_(){let h=this.loadQueue_;this.loadQueue_=[],h.forEach((_)=>_())}hasEnoughInfoToLoad_(){if(this.loaderType_!=="audio")return!0;let h=this.pendingSegment_;if(!h)return!1;if(!this.getCurrentMediaInfo_())return!0;if(RM({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:h.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))return!1;return!0}getCurrentMediaInfo_(h=this.pendingSegment_){return h&&h.trackInfo||this.currentMediaInfo_}getMediaInfo_(h=this.pendingSegment_){return this.getCurrentMediaInfo_(h)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready())return!1;if(this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;let h=this.pendingSegment_,_=this.getCurrentMediaInfo_();if(!h||!_)return!1;let{hasAudio:G,hasVideo:Y,isMuxed:X}=_;if(Y&&!h.videoTimingInfo)return!1;if(G&&!this.audioDisabled_&&!X&&!h.audioTimingInfo)return!1;if(RM({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:h.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))return!1;return!0}handleData_(h,_){if(this.earlyAbortWhenNeeded_(h.stats),this.checkForAbort_(h.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){C8(this),this.callQueue_.push(this.handleData_.bind(this,h,_));return}let G=this.pendingSegment_;if(this.setTimeMapping_(G.timeline),this.updateMediaSecondsLoaded_(G.part||G.segment),this.mediaSource_.readyState==="closed")return;if(h.map)h.map=this.initSegmentForMap(h.map,!0),G.segment.map=h.map;if(h.key)this.segmentKey(h.key,!0);if(G.isFmp4=h.isFmp4,G.timingInfo=G.timingInfo||{},G.isFmp4)this.trigger("fmp4"),G.timingInfo.start=G[oE(_.type)].start;else{let Y=this.getCurrentMediaInfo_(),X=this.loaderType_==="main"&&Y&&Y.hasVideo,K;if(X)K=G.videoTimingInfo.start;G.timingInfo.start=this.trueSegmentStart_({currentStart:G.timingInfo.start,playlist:G.playlist,mediaIndex:G.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:X,firstVideoFrameTimeForData:K,videoTimingInfo:G.videoTimingInfo,audioTimingInfo:G.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(G,_.type),this.updateSourceBufferTimestampOffset_(G),G.isSyncRequest){this.updateTimingInfoEnd_(G),this.syncController_.saveSegmentTimingInfo({segmentInfo:G,shouldSaveTimelineMapping:this.loaderType_==="main"});let Y=this.chooseNextRequest_();if(Y.mediaIndex!==G.mediaIndex||Y.partIndex!==G.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}G.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(G,_)}updateAppendInitSegmentStatus(h,_){if(this.loaderType_==="main"&&typeof h.timestampOffset==="number"&&!h.changedTimestampOffset)this.appendInitSegment_={audio:!0,video:!0};if(this.playlistOfLastInitSegment_[_]!==h.playlist)this.appendInitSegment_[_]=!0}getInitSegmentAndUpdateState_({type:h,initSegment:_,map:G,playlist:Y}){if(G){let X=bZ(G);if(this.activeInitSegmentId_===X)return null;_=this.initSegmentForMap(G,!0).bytes,this.activeInitSegmentId_=X}if(_&&this.appendInitSegment_[h])return this.playlistOfLastInitSegment_[h]=Y,this.appendInitSegment_[h]=!1,this.activeInitSegmentId_=null,_;return null}handleQuotaExceededError_({segmentInfo:h,type:_,bytes:G},Y){let X=this.sourceUpdater_.audioBuffered(),K=this.sourceUpdater_.videoBuffered();if(X.length>1)this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+f7(X).join(", "));if(K.length>1)this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+f7(K).join(", "));let Z=X.length?X.start(0):0,Q=X.length?X.end(X.length-1):0,D=K.length?K.start(0):0,O=K.length?K.end(K.length-1):0;if(Q-Z<=eG&&O-D<=eG){this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${G.byteLength}, audio buffer: ${f7(X).join(", ")}, video buffer: ${f7(K).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:h,type:_,bytes:G}));let H=this.currentTime_()-eG;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${H}`),this.remove(0,H,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${eG}s`),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=a.default.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},eG*1000)},!0)}handleAppendError_({segmentInfo:h,type:_,bytes:G},Y){if(!Y)return;if(Y.code===RN){this.handleQuotaExceededError_({segmentInfo:h,type:_,bytes:G});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",Y),this.error({message:`${_} append of ${G.length}b failed for segment #${h.mediaIndex} in playlist ${h.playlist.id}`,metadata:{errorType:Y0.Error.StreamingFailedToAppendSegment}}),this.trigger("appenderror")}appendToSourceBuffer_({segmentInfo:h,type:_,initSegment:G,data:Y,bytes:X}){if(!X){let Z=[Y],Q=Y.byteLength;if(G)Z.unshift(G),Q+=G.byteLength;X=sP({bytes:Q,segments:Z})}let K={segmentInfo:m7({type:this.loaderType_,segment:h})};this.trigger({type:"segmentappendstart",metadata:K}),this.sourceUpdater_.appendBuffer({segmentInfo:h,type:_,bytes:X},this.handleAppendError_.bind(this,{segmentInfo:h,type:_,bytes:X}))}handleSegmentTimingInfo_(h,_,G){if(!this.pendingSegment_||_!==this.pendingSegment_.requestId)return;let Y=this.pendingSegment_.segment,X=`${h}TimingInfo`;if(!Y[X])Y[X]={};Y[X].transmuxerPrependedSeconds=G.prependedContentDuration||0,Y[X].transmuxedPresentationStart=G.start.presentation,Y[X].transmuxedDecodeStart=G.start.decode,Y[X].transmuxedPresentationEnd=G.end.presentation,Y[X].transmuxedDecodeEnd=G.end.decode,Y[X].baseMediaDecodeTime=G.baseMediaDecodeTime}appendData_(h,_){let{type:G,data:Y}=_;if(!Y||!Y.byteLength)return;if(G==="audio"&&this.audioDisabled_)return;let X=this.getInitSegmentAndUpdateState_({type:G,initSegment:_.initSegment,playlist:h.playlist,map:h.isFmp4?h.segment.map:null});this.appendToSourceBuffer_({segmentInfo:h,type:G,initSegment:X,data:Y})}loadSegment_(h){if(this.state="WAITING",this.pendingSegment_=h,this.trimBackBuffer_(h),typeof h.timestampOffset==="number"){if(this.transmuxer_)this.transmuxer_.postMessage({action:"clearAllMp4Captions"})}if(!this.hasEnoughInfoToLoad_()){C8(this),this.loadQueue_.push(()=>{let _=U2({},h,{forceTimestampOffset:!0});U2(h,this.generateSegmentInfo_(_)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(h)});return}this.updateTransmuxerAndRequestSegment_(h)}updateTransmuxerAndRequestSegment_(h){if(this.shouldUpdateTransmuxerTimestampOffset_(h.timestampOffset))this.gopBuffer_.length=0,h.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:h.timestampOffset});let _=this.createSimplifiedSegmentObj_(h),G=this.isEndOfStream_(h.mediaIndex,h.playlist,h.partIndex),Y=this.mediaIndex!==null,X=h.timeline!==this.currentTimeline_&&h.timeline>0,K=G||Y&&X;if(this.logger_(`Requesting
|
|
238
|
-
${eN(h.uri)}
|
|
239
|
-
${Th(h)}`),_.map&&!_.map.bytes)this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0};h.abortRequests=iP({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:_,abortFn:this.handleAbort_.bind(this,h),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",h.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",h.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:K,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:Z,level:Q,stream:D})=>{this.logger_(`${Th(h)} logged from transmuxer stream ${D} as a ${Q}: ${Z}`)},triggerSegmentEventFn:({type:Z,segment:Q,keyInfo:D,trackInfo:O,timingInfo:A})=>{let C={segmentInfo:m7({segment:Q})};if(D)C.keyInfo=D;if(O)C.trackInfo=O;if(A)C.timingInfo=A;this.trigger({type:Z,metadata:C})}})}trimBackBuffer_(h){let _=My(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);if(_>0)this.remove(0,_)}createSimplifiedSegmentObj_(h){let{segment:_,part:G}=h,Y=h.segment.key||h.segment.map&&h.segment.map.key,X=h.segment.map&&!h.segment.map.bytes,K={resolvedUri:G?G.resolvedUri:_.resolvedUri,byterange:G?G.byterange:_.byterange,requestId:h.requestId,transmuxer:h.transmuxer,audioAppendStart:h.audioAppendStart,gopsToAlignWith:h.gopsToAlignWith,part:h.part,type:this.loaderType_,start:h.startOfSegment,duration:h.duration,isEncrypted:Y,isMediaInitialization:X},Z=h.playlist.segments[h.mediaIndex-1];if(Z&&Z.timeline===_.timeline){if(Z.videoTimingInfo)K.baseStartTime=Z.videoTimingInfo.transmuxedDecodeEnd;else if(Z.audioTimingInfo)K.baseStartTime=Z.audioTimingInfo.transmuxedDecodeEnd}if(_.key){let Q=_.key.iv||new Uint32Array([0,0,0,h.mediaIndex+h.playlist.mediaSequence]);K.key=this.segmentKey(_.key),K.key.iv=Q}if(_.map)K.map=this.initSegmentForMap(_.map);return K}saveTransferStats_(h){if(this.mediaRequests+=1,h)this.mediaBytesTransferred+=h.bytesReceived,this.mediaTransferDuration+=h.roundTripTime}saveBandwidthRelatedStats_(h,_){if(this.pendingSegment_.byteLength=_.bytesReceived,h<VZ){this.logger_(`Ignoring segment's bandwidth because its duration of ${h} is less than the min to record ${VZ}`);return}let G={bandwidthInfo:{from:this.bandwidth,to:_.bandwidth}};this.trigger({type:"bandwidthupdated",metadata:G}),this.bandwidth=_.bandwidth,this.roundTrip=_.roundTripTime}handleTimeout_(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate"),this.trigger("timeout")}segmentRequestFinished_(h,_,G){if(this.callQueue_.length){this.callQueue_.push(this.segmentRequestFinished_.bind(this,h,_,G));return}if(this.saveTransferStats_(_.stats),!this.pendingSegment_)return;if(_.requestId!==this.pendingSegment_.requestId)return;if(h){if(this.pendingSegment_=null,this.state="READY",h.code===I3.ABORTED)return;if(this.pause(),h.code===I3.TIMEOUT){this.handleTimeout_();return}this.mediaRequestsErrored+=1,this.error(h),this.trigger("error");return}let Y=this.pendingSegment_;if(this.saveBandwidthRelatedStats_(Y.duration,_.stats),Y.endOfAllRequests=_.endOfAllRequests,G.gopInfo)this.gopBuffer_=Ky(this.gopBuffer_,G.gopInfo,this.safeAppend_);this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(Y)}setTimeMapping_(h){let _=this.syncController_.mappingForTimeline(h);if(_!==null)this.timeMapping_=_}updateMediaSecondsLoaded_(h){if(typeof h.start==="number"&&typeof h.end==="number")this.mediaSecondsLoaded+=h.end-h.start;else this.mediaSecondsLoaded+=h.duration}shouldUpdateTransmuxerTimestampOffset_(h){if(h===null)return!1;if(this.loaderType_==="main"&&h!==this.sourceUpdater_.videoTimestampOffset())return!0;if(!this.audioDisabled_&&h!==this.sourceUpdater_.audioTimestampOffset())return!0;return!1}trueSegmentStart_({currentStart:h,playlist:_,mediaIndex:G,firstVideoFrameTimeForData:Y,currentVideoTimestampOffset:X,useVideoTimingInfo:K,videoTimingInfo:Z,audioTimingInfo:Q}){if(typeof h<"u")return h;if(!K)return Q.start;let D=_.segments[G-1];if(G===0||!D||typeof D.start>"u"||D.end!==Y+X)return Y;return Z.start}waitForAppendsToComplete_(h){let _=this.getCurrentMediaInfo_(h);if(!_){this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:1/0}),this.trigger("error");return}let{hasAudio:G,hasVideo:Y,isMuxed:X}=_,K=this.loaderType_==="main"&&Y,Z=!this.audioDisabled_&&G&&!X;if(h.waitingOnAppends=0,!h.hasAppendedData_){if(!h.timingInfo&&typeof h.timestampOffset==="number")this.isPendingTimestampOffset_=!0;if(h.timingInfo={start:0},h.waitingOnAppends++,!this.isPendingTimestampOffset_)this.updateSourceBufferTimestampOffset_(h),this.processMetadataQueue_();this.checkAppendsDone_(h);return}if(K)h.waitingOnAppends++;if(Z)h.waitingOnAppends++;if(K)this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,h));if(Z)this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,h))}checkAppendsDone_(h){if(this.checkForAbort_(h.requestId))return;if(h.waitingOnAppends--,h.waitingOnAppends===0)this.handleAppendsDone_()}checkForIllegalMediaSwitch(h){let _=Dy(this.loaderType_,this.getCurrentMediaInfo_(),h);if(_)return this.error({message:_,playlistExclusionDuration:1/0}),this.trigger("error"),!0;return!1}updateSourceBufferTimestampOffset_(h){if(h.timestampOffset===null||typeof h.timingInfo.start!=="number"||h.changedTimestampOffset||this.loaderType_!=="main")return;let _=!1;if(h.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:h.segment.videoTimingInfo,audioTimingInfo:h.segment.audioTimingInfo,timingInfo:h.timingInfo}),h.changedTimestampOffset=!0,h.timestampOffset!==this.sourceUpdater_.videoTimestampOffset())this.sourceUpdater_.videoTimestampOffset(h.timestampOffset),_=!0;if(h.timestampOffset!==this.sourceUpdater_.audioTimestampOffset())this.sourceUpdater_.audioTimestampOffset(h.timestampOffset),_=!0;if(_)this.trigger("timestampoffset")}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:h,audioTimingInfo:_,timingInfo:G}){if(!this.useDtsForTimestampOffset_)return G.start;if(h&&typeof h.transmuxedDecodeStart==="number")return h.transmuxedDecodeStart;if(_&&typeof _.transmuxedDecodeStart==="number")return _.transmuxedDecodeStart;return G.start}updateTimingInfoEnd_(h){h.timingInfo=h.timingInfo||{};let _=this.getMediaInfo_(),Y=this.loaderType_==="main"&&_&&_.hasVideo&&h.videoTimingInfo?h.videoTimingInfo:h.audioTimingInfo;if(!Y)return;h.timingInfo.end=typeof Y.end==="number"?Y.end:Y.start+h.duration}handleAppendsDone_(){if(this.pendingSegment_){let Q={segmentInfo:m7({type:this.loaderType_,segment:this.pendingSegment_})};this.trigger({type:"appendsdone",metadata:Q})}if(!this.pendingSegment_){if(this.state="READY",!this.paused())this.monitorBuffer_();return}let h=this.pendingSegment_;if(h.part&&h.part.syncInfo)h.part.syncInfo.markAppended();else if(h.segment.syncInfo)h.segment.syncInfo.markAppended();if(this.updateTimingInfoEnd_(h),this.shouldSaveSegmentTimingInfo_)this.syncController_.saveSegmentTimingInfo({segmentInfo:h,shouldSaveTimelineMapping:this.loaderType_==="main"});let _=Hy(h,this.sourceType_);if(_)if(_.severity==="warn")Y0.log.warn(_.message);else this.logger_(_.message);if(this.recordThroughput_(h),this.pendingSegment_=null,this.state="READY",h.isSyncRequest){if(this.trigger("syncinfoupdate"),!h.hasAppendedData_){this.logger_(`Throwing away un-appended sync request ${Th(h)}`);return}}if(this.logger_(`Appended ${Th(h)}`),this.addSegmentMetadataCue_(h),this.fetchAtBuffer_=!0,this.currentTimeline_!==h.timeline){if(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:h.timeline}),this.loaderType_==="main"&&!this.audioDisabled_)this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:h.timeline})}this.currentTimeline_=h.timeline,this.trigger("syncinfoupdate");let{segment:G,part:Y}=h,X=G.end&&this.currentTime_()-G.end>h.playlist.targetDuration*3,K=Y&&Y.end&&this.currentTime_()-Y.end>h.playlist.partTargetDuration*3;if(X||K){this.logger_(`bad ${X?"segment":"part"} ${Th(h)}`),this.resetEverything();return}if(this.mediaIndex!==null)this.trigger("bandwidthupdate");if(this.trigger("progress"),this.mediaIndex=h.mediaIndex,this.partIndex=h.partIndex,this.isEndOfStream_(h.mediaIndex,h.playlist,h.partIndex))this.endOfStream();if(this.trigger("appended"),h.hasAppendedData_)this.mediaAppends++;if(!this.paused())this.monitorBuffer_()}recordThroughput_(h){if(h.duration<VZ){this.logger_(`Ignoring segment's throughput because its duration of ${h.duration} is less than the min to record ${VZ}`);return}let _=this.throughput.rate,G=Date.now()-h.endOfAllRequests+1,Y=Math.floor(h.byteLength/G*8*1000);this.throughput.rate+=(Y-_)/++this.throughput.count}addSegmentMetadataCue_(h){if(!this.segmentMetadataTrack_)return;let _=h.segment,G=_.start,Y=_.end;if(!nE(G)||!nE(Y))return;_Y(G,Y,this.segmentMetadataTrack_);let X=a.default.WebKitDataCue||a.default.VTTCue,K={custom:_.custom,dateTimeObject:_.dateTimeObject,dateTimeString:_.dateTimeString,programDateTime:_.programDateTime,bandwidth:h.playlist.attributes.BANDWIDTH,resolution:h.playlist.attributes.RESOLUTION,codecs:h.playlist.attributes.CODECS,byteLength:h.byteLength,uri:h.uri,timeline:h.timeline,playlist:h.playlist.id,start:G,end:Y},Z=JSON.stringify(K),Q=new X(G,Y,Z);Q.value=K,this.segmentMetadataTrack_.addCue(Q)}}function $6(){}var h$=function(h){if(typeof h!=="string")return h;return h.replace(/./,(_)=>_.toUpperCase())},Vy=["video","audio"],SM=(h,_)=>{let G=_[`${h}Buffer`];return G&&G.updating||_.queuePending[h]},Uy=(h,_)=>{for(let G=0;G<_.length;G++){let Y=_[G];if(Y.type==="mediaSource")return null;if(Y.type===h)return G}return null},bh=(h,_)=>{if(_.queue.length===0)return;let G=0,Y=_.queue[G];if(Y.type==="mediaSource"){if(!_.updating()&&_.mediaSource.readyState!=="closed"){if(_.queue.shift(),Y.action(_),Y.doneFn)Y.doneFn();bh("audio",_),bh("video",_)}return}if(h==="mediaSource")return;if(!_.ready()||_.mediaSource.readyState==="closed"||SM(h,_))return;if(Y.type!==h){if(G=Uy(h,_.queue),G===null)return;Y=_.queue[G]}if(_.queue.splice(G,1),_.queuePending[h]=Y,Y.action(h,_),!Y.doneFn){_.queuePending[h]=null,bh(h,_);return}},_$=(h,_)=>{let G=_[`${h}Buffer`],Y=h$(h);if(!G)return;G.removeEventListener("updateend",_[`on${Y}UpdateEnd_`]),G.removeEventListener("error",_[`on${Y}Error_`]),_.codecs[h]=null,_[`${h}Buffer`]=null},v3=(h,_)=>h&&_&&Array.prototype.indexOf.call(h.sourceBuffers,_)!==-1,T4={appendBuffer:(h,_,G)=>(Y,X)=>{let K=X[`${Y}Buffer`];if(!v3(X.mediaSource,K))return;X.logger_(`Appending segment ${_.mediaIndex}'s ${h.length} bytes to ${Y}Buffer`);try{K.appendBuffer(h)}catch(Z){X.logger_(`Error with code ${Z.code} `+(Z.code===RN?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${_.mediaIndex} to ${Y}Buffer`),X.queuePending[Y]=null,G(Z)}},remove:(h,_)=>(G,Y)=>{let X=Y[`${G}Buffer`];if(!v3(Y.mediaSource,X))return;Y.logger_(`Removing ${h} to ${_} from ${G}Buffer`);try{X.remove(h,_)}catch(K){Y.logger_(`Remove ${h} to ${_} from ${G}Buffer failed`)}},timestampOffset:(h)=>(_,G)=>{let Y=G[`${_}Buffer`];if(!v3(G.mediaSource,Y))return;G.logger_(`Setting ${_}timestampOffset to ${h}`),Y.timestampOffset=h},callback:(h)=>(_,G)=>{h()},endOfStream:(h)=>(_)=>{if(_.mediaSource.readyState!=="open")return;_.logger_(`Calling mediaSource endOfStream(${h||""})`);try{_.mediaSource.endOfStream(h)}catch(G){Y0.log.warn("Failed to call media source endOfStream",G)}},duration:(h)=>(_)=>{_.logger_(`Setting mediaSource duration to ${h}`);try{_.mediaSource.duration=h}catch(G){Y0.log.warn("Failed to set media source duration",G)}},abort:()=>(h,_)=>{if(_.mediaSource.readyState!=="open")return;let G=_[`${h}Buffer`];if(!v3(_.mediaSource,G))return;_.logger_(`calling abort on ${h}Buffer`);try{G.abort()}catch(Y){Y0.log.warn(`Failed to abort on ${h}Buffer`,Y)}},addSourceBuffer:(h,_)=>(G)=>{let Y=h$(h),X=g7(_);G.logger_(`Adding ${h}Buffer with codec ${_} to mediaSource`);let K=G.mediaSource.addSourceBuffer(X);K.addEventListener("updateend",G[`on${Y}UpdateEnd_`]),K.addEventListener("error",G[`on${Y}Error_`]),G.codecs[h]=_,G[`${h}Buffer`]=K},removeSourceBuffer:(h)=>(_)=>{let G=_[`${h}Buffer`];if(_$(h,_),!v3(_.mediaSource,G))return;_.logger_(`Removing ${h}Buffer with codec ${_.codecs[h]} from mediaSource`);try{_.mediaSource.removeSourceBuffer(G)}catch(Y){Y0.log.warn(`Failed to removeSourceBuffer ${h}Buffer`,Y)}},changeType:(h)=>(_,G)=>{let Y=G[`${_}Buffer`],X=g7(h);if(!v3(G.mediaSource,Y))return;let K=h.substring(0,h.indexOf(".")),Z=G.codecs[_];if(Z.substring(0,Z.indexOf("."))===K)return;let D={codecsChangeInfo:{from:Z,to:h}};G.trigger({type:"codecschange",metadata:D}),G.logger_(`changing ${_}Buffer codec from ${Z} to ${h}`);try{Y.changeType(X),G.codecs[_]=h}catch(O){D.errorType=Y0.Error.StreamingCodecsChangeError,D.error=O,O.metadata=D,G.error_=O,G.trigger("error"),Y0.log.warn(`Failed to changeType on ${_}Buffer`,O)}}},W4=({type:h,sourceUpdater:_,action:G,doneFn:Y,name:X})=>{_.queue.push({type:h,action:G,doneFn:Y,name:X}),bh(h,_)},eE=(h,_)=>(G)=>{let Y=_[`${h}Buffered`](),X=xI(Y);if(_.logger_(`received "updateend" event for ${h} Source Buffer: `,X),_.queuePending[h]){let K=_.queuePending[h].doneFn;if(_.queuePending[h]=null,K)K(_[`${h}Error_`])}bh(h,_)};class RB extends Y0.EventTarget{constructor(h){super();this.mediaSource=h,this.sourceopenListener_=()=>bh("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=a4("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=eE("video",this),this.onAudioUpdateEnd_=eE("audio",this),this.onVideoError_=(_)=>{this.videoError_=_},this.onAudioError_=(_)=>{this.audioError_=_},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(h){if(this.hasCreatedSourceBuffers())return;this.addOrChangeSourceBuffers(h),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady()}triggerReady(){if(this.ready()&&!this.triggeredReady_)this.triggeredReady_=!0,this.trigger("ready")}addSourceBuffer(h,_){W4({type:"mediaSource",sourceUpdater:this,action:T4.addSourceBuffer(h,_),name:"addSourceBuffer"})}abort(h){W4({type:h,sourceUpdater:this,action:T4.abort(h),name:"abort"})}removeSourceBuffer(h){if(!this.canRemoveSourceBuffer()){Y0.log.error("removeSourceBuffer is not supported!");return}W4({type:"mediaSource",sourceUpdater:this,action:T4.removeSourceBuffer(h),name:"removeSourceBuffer"})}canRemoveSourceBuffer(){return!Y0.browser.IS_FIREFOX&&a.default.MediaSource&&a.default.MediaSource.prototype&&typeof a.default.MediaSource.prototype.removeSourceBuffer==="function"}static canChangeType(){return a.default.SourceBuffer&&a.default.SourceBuffer.prototype&&typeof a.default.SourceBuffer.prototype.changeType==="function"}canChangeType(){return this.constructor.canChangeType()}changeType(h,_){if(!this.canChangeType()){Y0.log.error("changeType is not supported!");return}W4({type:h,sourceUpdater:this,action:T4.changeType(_),name:"changeType"})}addOrChangeSourceBuffers(h){if(!h||typeof h!=="object"||Object.keys(h).length===0)throw Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(h).forEach((_)=>{let G=h[_];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(_,G);if(this.canChangeType())this.changeType(_,G)})}appendBuffer(h,_){let{segmentInfo:G,type:Y,bytes:X}=h;if(this.processedAppend_=!0,Y==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([h,_]),this.logger_(`delayed audio append of ${X.length} until video append`);return}let K=_;if(W4({type:Y,sourceUpdater:this,action:T4.appendBuffer(X,G||{mediaIndex:-1},K),doneFn:_,name:"appendBuffer"}),Y==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;let Z=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${Z.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,Z.forEach((Q)=>{this.appendBuffer.apply(this,Q)})}}audioBuffered(){if(!v3(this.mediaSource,this.audioBuffer))return Q5();return this.audioBuffer.buffered?this.audioBuffer.buffered:Q5()}videoBuffered(){if(!v3(this.mediaSource,this.videoBuffer))return Q5();return this.videoBuffer.buffered?this.videoBuffer.buffered:Q5()}buffered(){let h=v3(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,_=v3(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;if(_&&!h)return this.audioBuffered();if(h&&!_)return this.videoBuffered();return gI(this.audioBuffered(),this.videoBuffered())}setDuration(h,_=$6){W4({type:"mediaSource",sourceUpdater:this,action:T4.duration(h),name:"duration",doneFn:_})}endOfStream(h=null,_=$6){if(typeof h!=="string")h=void 0;W4({type:"mediaSource",sourceUpdater:this,action:T4.endOfStream(h),name:"endOfStream",doneFn:_})}removeAudio(h,_,G=$6){if(!this.audioBuffered().length||this.audioBuffered().end(0)===0){G();return}W4({type:"audio",sourceUpdater:this,action:T4.remove(h,_),doneFn:G,name:"remove"})}removeVideo(h,_,G=$6){if(!this.videoBuffered().length||this.videoBuffered().end(0)===0){G();return}W4({type:"video",sourceUpdater:this,action:T4.remove(h,_),doneFn:G,name:"remove"})}updating(){if(SM("audio",this)||SM("video",this))return!0;return!1}audioTimestampOffset(h){if(typeof h<"u"&&this.audioBuffer&&this.audioTimestampOffset_!==h)W4({type:"audio",sourceUpdater:this,action:T4.timestampOffset(h),name:"timestampOffset"}),this.audioTimestampOffset_=h;return this.audioTimestampOffset_}videoTimestampOffset(h){if(typeof h<"u"&&this.videoBuffer&&this.videoTimestampOffset_!==h)W4({type:"video",sourceUpdater:this,action:T4.timestampOffset(h),name:"timestampOffset"}),this.videoTimestampOffset_=h;return this.videoTimestampOffset_}audioQueueCallback(h){if(!this.audioBuffer)return;W4({type:"audio",sourceUpdater:this,action:T4.callback(h),name:"callback"})}videoQueueCallback(h){if(!this.videoBuffer)return;W4({type:"video",sourceUpdater:this,action:T4.callback(h),name:"callback"})}dispose(){if(this.trigger("dispose"),Vy.forEach((h)=>{if(this.abort(h),this.canRemoveSourceBuffer())this.removeSourceBuffer(h);else this[`${h}QueueCallback`](()=>_$(h,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_)this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_);this.off()}}var hC=(h)=>decodeURIComponent(escape(String.fromCharCode.apply(null,h))),Ey=(h)=>{let _=new Uint8Array(h);return Array.from(_).map((G)=>G.toString(16).padStart(2,"0")).join("")},_C=new Uint8Array(`
|
|
240
|
-
|
|
241
|
-
`.split("").map((h)=>h.charCodeAt(0)));class G$ extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class Y$ extends fZ{constructor(h,_={}){super(h,_);this.mediaSource_=null,this.subtitlesTrack_=null,this.featuresNativeTextTracks_=h.featuresNativeTextTracks,this.loadVttJs=h.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return Q5();let h=this.subtitlesTrack_.cues,_=h[0].startTime,G=h[h.length-1].startTime;return Q5([[_,G]])}initSegmentForMap(h,_=!1){if(!h)return null;let G=bZ(h),Y=this.initSegments_[G];if(_&&!Y&&h.bytes){let X=_C.byteLength+h.bytes.byteLength,K=new Uint8Array(X);K.set(h.bytes),K.set(_C,h.bytes.byteLength),this.initSegments_[G]=Y={resolvedUri:h.resolvedUri,byterange:h.byterange,bytes:K}}return Y||h}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(h){if(typeof h>"u")return this.subtitlesTrack_;if(this.subtitlesTrack_=h,this.state==="INIT"&&this.couldBeginLoading_())this.init_();return this.subtitlesTrack_}remove(h,_){_Y(h,_,this.subtitlesTrack_)}fillBuffer_(){let h=this.chooseNextRequest_();if(!h)return;if(this.syncController_.timestampOffsetForTimeline(h.timeline)===null){let _=()=>{if(this.state="READY",!this.paused())this.monitorBuffer_()};this.syncController_.one("timestampoffset",_),this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(h)}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(h){while(h&&h.segment.empty){if(h.mediaIndex+1>=h.playlist.segments.length){h=null;break}h=this.generateSegmentInfo_({playlist:h.playlist,mediaIndex:h.mediaIndex+1,startOfSegment:h.startOfSegment+h.duration,isSyncRequest:h.isSyncRequest})}return h}stopForError(h){this.error(h),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(h,_,G){if(!this.subtitlesTrack_){this.state="READY";return}if(this.saveTransferStats_(_.stats),!this.pendingSegment_){this.state="READY",this.mediaRequestsAborted+=1;return}if(h){if(h.code===I3.TIMEOUT)this.handleTimeout_();if(h.code===I3.ABORTED)this.mediaRequestsAborted+=1;else this.mediaRequestsErrored+=1;this.stopForError(h);return}let Y=this.pendingSegment_,X=G.mp4VttCues&&G.mp4VttCues.length;if(X)Y.mp4VttCues=G.mp4VttCues;if(this.saveBandwidthRelatedStats_(Y.duration,_.stats),_.key)this.segmentKey(_.key,!0);this.state="APPENDING",this.trigger("appending");let K=Y.segment;if(K.map)K.map.bytes=_.map.bytes;if(Y.bytes=_.bytes,typeof a.default.WebVTT!=="function"&&typeof this.loadVttJs==="function"){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(()=>this.segmentRequestFinished_(h,_,G),()=>this.stopForError({message:"Error loading vtt.js"}));return}K.requested=!0;try{this.parseVTTCues_(Y)}catch(Z){this.stopForError({message:Z.message,metadata:{errorType:Y0.Error.StreamingVttParserError,error:Z}});return}if(!X)this.updateTimeMapping_(Y,this.syncController_.timelines[Y.timeline],this.playlist_);if(Y.cues.length)Y.timingInfo={start:Y.cues[0].startTime,end:Y.cues[Y.cues.length-1].endTime};else Y.timingInfo={start:Y.startOfSegment,end:Y.startOfSegment+Y.duration};if(Y.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}Y.byteLength=Y.bytes.byteLength,this.mediaSecondsLoaded+=K.duration,Y.cues.forEach((Z)=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new a.default.VTTCue(Z.startTime,Z.endTime,Z.text):Z)}),Yy(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(h,_){let G=h&&h.type==="vtt",Y=_&&_.type==="text";if(G&&Y)super.handleData_(h,_)}updateTimingInfoEnd_(){}parseMp4VttCues_(h){let _=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();h.mp4VttCues.forEach((G)=>{let Y=G.start+_,X=G.end+_,K=new a.default.VTTCue(Y,X,G.cueText);if(G.settings)G.settings.split(" ").forEach((Z)=>{let Q=Z.split(":"),D=Q[0],O=Q[1];K[D]=isNaN(O)?O:Number(O)});h.cues.push(K)})}parseVTTCues_(h){let _,G=!1;if(typeof a.default.WebVTT!=="function")throw new G$;if(h.cues=[],h.timestampmap={MPEGTS:0,LOCAL:0},h.mp4VttCues){this.parseMp4VttCues_(h);return}if(typeof a.default.TextDecoder==="function")_=new a.default.TextDecoder("utf8");else _=a.default.WebVTT.StringDecoder(),G=!0;let Y=new a.default.WebVTT.Parser(a.default,a.default.vttjs,_);if(Y.oncue=h.cues.push.bind(h.cues),Y.ontimestampmap=(K)=>{h.timestampmap=K},Y.onparsingerror=(K)=>{Y0.log.warn("Error encountered when parsing cues: "+K.message)},h.segment.map){let K=h.segment.map.bytes;if(G)K=hC(K);Y.parse(K)}let X=h.bytes;if(G)X=hC(X);Y.parse(X),Y.flush()}updateTimeMapping_(h,_,G){let Y=h.segment;if(!_)return;if(!h.cues.length){Y.empty=!0;return}let{MPEGTS:X,LOCAL:K}=h.timestampmap,Q=X/L8.ONE_SECOND_IN_TS-K+_.mapping;if(h.cues.forEach((D)=>{let O=D.endTime-D.startTime,A=this.handleRollover_(D.startTime+Q,_.time);D.startTime=Math.max(A,0),D.endTime=Math.max(A+O,0)}),!G.syncInfo){let D=h.cues[0].startTime,O=h.cues[h.cues.length-1].startTime;G.syncInfo={mediaSequence:G.mediaSequence+h.mediaIndex,time:Math.min(D,O-Y.duration)}}}handleRollover_(h,_){if(_===null)return h;let G=h*L8.ONE_SECOND_IN_TS,Y=_*L8.ONE_SECOND_IN_TS,X;if(Y<G)X=-8589934592;else X=8589934592;while(Math.abs(G-Y)>4294967296)G+=X;return G/L8.ONE_SECOND_IN_TS}}var Cy=function(h,_){let G=h.cues;for(let Y=0;Y<G.length;Y++){let X=G[Y];if(_>=X.adStartTime&&_<=X.adEndTime)return X}return null},Ny=function(h,_,G=0){if(!h.segments)return;let Y=G,X;for(let K=0;K<h.segments.length;K++){let Z=h.segments[K];if(!X)X=Cy(_,Y+Z.duration/2);if(X){if("cueIn"in Z){X.endTime=Y,X.adEndTime=Y,Y+=Z.duration,X=null;continue}if(Y<X.endTime){Y+=Z.duration;continue}X.endTime+=Z.duration}else{if("cueOut"in Z)X=new a.default.VTTCue(Y,Y+Z.duration,Z.cueOut),X.adStartTime=Y,X.adEndTime=Y+parseFloat(Z.cueOut),_.addCue(X);if("cueOutCont"in Z){let[Q,D]=Z.cueOutCont.split("/").map(parseFloat);X=new a.default.VTTCue(Y,Y+Z.duration,""),X.adStartTime=Y-Q,X.adEndTime=X.adStartTime+D,_.addCue(X)}}Y+=Z.duration}};class vM{constructor({start:h,end:_,segmentIndex:G,partIndex:Y=null,appended:X=!1}){this.start_=h,this.end_=_,this.segmentIndex_=G,this.partIndex_=Y,this.appended_=X}isInRange(h){return h>=this.start&&h<this.end}markAppended(){this.appended_=!0}resetAppendedStatus(){this.appended_=!1}get isAppended(){return this.appended_}get start(){return this.start_}get end(){return this.end_}get segmentIndex(){return this.segmentIndex_}get partIndex(){return this.partIndex_}}class X${constructor(h,_=[]){this.segmentSyncInfo_=h,this.partsSyncInfo_=_}get segmentSyncInfo(){return this.segmentSyncInfo_}get partsSyncInfo(){return this.partsSyncInfo_}get hasPartsSyncInfo(){return this.partsSyncInfo_.length>0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus(),this.partsSyncInfo_.forEach((h)=>h.resetAppendedStatus())}}class SB{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((h)=>h.resetAppendStatus())}update(h,_){let{mediaSequence:G,segments:Y}=h;if(this.isReliable_=this.isReliablePlaylist_(G,Y),!this.isReliable_)return;return this.updateStorage_(Y,G,this.calculateBaseTime_(G,Y,_))}getSyncInfoForTime(h){for(let{segmentSyncInfo:_,partsSyncInfo:G}of this.storage_.values())if(!G.length){if(_.isInRange(h))return _}else for(let Y of G)if(Y.isInRange(h))return Y;return null}getSyncInfoForMediaSequence(h){return this.storage_.get(h)}updateStorage_(h,_,G){let Y=new Map,X=`
|
|
242
|
-
`,K=G,Z=_;this.start_=K,h.forEach((Q,D)=>{let O=this.storage_.get(Z),A=K,H=A+Q.duration,C=Boolean(O&&O.segmentSyncInfo&&O.segmentSyncInfo.isAppended),N=new vM({start:A,end:H,appended:C,segmentIndex:D});Q.syncInfo=N;let j=K,W=(Q.parts||[]).map((S,R)=>{let v=j,x=j+S.duration,P=Boolean(O&&O.partsSyncInfo&&O.partsSyncInfo[R]&&O.partsSyncInfo[R].isAppended),I=new vM({start:v,end:x,appended:P,segmentIndex:D,partIndex:R});return j=x,X+=`Media Sequence: ${Z}.${R} | Range: ${v} --> ${x} | Appended: ${P}
|
|
243
|
-
`,S.syncInfo=I,I});Y.set(Z,new X$(N,W)),X+=`${eN(Q.resolvedUri)} | Media Sequence: ${Z} | Range: ${A} --> ${H} | Appended: ${C}
|
|
244
|
-
`,Z++,K=H}),this.end_=K,this.storage_=Y,this.diagnostics_=X}calculateBaseTime_(h,_,G){if(!this.storage_.size)return 0;if(this.storage_.has(h))return this.storage_.get(h).segmentSyncInfo.start;let Y=Math.min(...this.storage_.keys());if(h<Y){let X=Y-h,K=this.storage_.get(Y).segmentSyncInfo.start;for(let Z=0;Z<X;Z++){let Q=_[Z];K-=Q.duration}return K}return G}isReliablePlaylist_(h,_){return h!==void 0&&h!==null&&Array.isArray(_)&&_.length}}class xM extends SB{constructor(h){super();this.parent_=h}calculateBaseTime_(h,_,G){if(!this.storage_.size){let Y=this.parent_.getSyncInfoForMediaSequence(h);if(Y)return Y.segmentSyncInfo.start;return 0}return super.calculateBaseTime_(h,_,G)}}var $y=86400,JM=[{name:"VOD",run:(h,_,G,Y,X)=>{if(G!==1/0)return{time:0,segmentIndex:0,partIndex:null};return null}},{name:"MediaSequence",run:(h,_,G,Y,X,K)=>{let Z=h.getMediaSequenceSync(K);if(!Z)return null;if(!Z.isReliable)return null;let Q=Z.getSyncInfoForTime(X);if(!Q)return null;return{time:Q.start,partIndex:Q.partIndex,segmentIndex:Q.segmentIndex}}},{name:"ProgramDateTime",run:(h,_,G,Y,X)=>{if(!Object.keys(h.timelineToDatetimeMappings).length)return null;let K=null,Z=null,Q=CM(_);X=X||0;for(let D=0;D<Q.length;D++){let O=_.endList||X===0?D:Q.length-(D+1),A=Q[O],H=A.segment,C=h.timelineToDatetimeMappings[H.timeline];if(!C||!H.dateTimeObject)continue;let j=H.dateTimeObject.getTime()/1000+C;if(H.parts&&typeof A.partIndex==="number")for(let S=0;S<A.partIndex;S++)j+=H.parts[S].duration;let W=Math.abs(X-j);if(Z!==null&&(W===0||Z<W))break;Z=W,K={time:j,segmentIndex:A.segmentIndex,partIndex:A.partIndex}}return K}},{name:"Segment",run:(h,_,G,Y,X)=>{let K=null,Z=null;X=X||0;let Q=CM(_);for(let D=0;D<Q.length;D++){let O=_.endList||X===0?D:Q.length-(D+1),A=Q[O],H=A.segment,C=A.part&&A.part.start||H&&H.start;if(H.timeline===Y&&typeof C<"u"){let N=Math.abs(X-C);if(Z!==null&&Z<N)break;if(!K||Z===null||Z>=N)Z=N,K={time:C,segmentIndex:A.segmentIndex,partIndex:A.partIndex}}}return K}},{name:"Discontinuity",run:(h,_,G,Y,X)=>{let K=null;if(X=X||0,_.discontinuityStarts&&_.discontinuityStarts.length){let Z=null;for(let Q=0;Q<_.discontinuityStarts.length;Q++){let D=_.discontinuityStarts[Q],O=_.discontinuitySequence+Q+1,A=h.discontinuities[O];if(A){let H=Math.abs(X-A.time);if(Z!==null&&Z<H)break;if(!K||Z===null||Z>=H)Z=H,K={time:A.time,segmentIndex:D,partIndex:null}}}}return K}},{name:"Playlist",run:(h,_,G,Y,X)=>{if(_.syncInfo)return{time:_.syncInfo.time,segmentIndex:_.syncInfo.mediaSequence-_.mediaSequence,partIndex:null};return null}}];class K$ extends Y0.EventTarget{constructor(h={}){super();this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};let _=new SB,G=new xM(_),Y=new xM(_);this.mediaSequenceStorage_={main:_,audio:G,vtt:Y},this.logger_=a4("SyncController")}getMediaSequenceSync(h){return this.mediaSequenceStorage_[h]||null}getSyncPoint(h,_,G,Y,X){if(_!==1/0)return JM.find(({name:Q})=>Q==="VOD").run(this,h,_);let K=this.runStrategies_(h,_,G,Y,X);if(!K.length)return null;for(let Z of K){let{syncPoint:Q,strategy:D}=Z,{segmentIndex:O,time:A}=Q;if(O<0)continue;let H=h.segments[O],C=A,N=C+H.duration;if(this.logger_(`Strategy: ${D}. Current time: ${Y}. selected segment: ${O}. Time: [${C} -> ${N}]}`),Y>=C&&Y<N)return this.logger_("Found sync point with exact match: ",Q),Q}return this.selectSyncPoint_(K,{key:"time",value:Y})}getExpiredTime(h,_){if(!h||!h.segments)return null;let G=this.runStrategies_(h,_,h.discontinuitySequence,0);if(!G.length)return null;let Y=this.selectSyncPoint_(G,{key:"segmentIndex",value:0});if(Y.segmentIndex>0)Y.time*=-1;return Math.abs(Y.time+KY({defaultDuration:h.targetDuration,durationList:h.segments,startIndex:Y.segmentIndex,endIndex:0}))}runStrategies_(h,_,G,Y,X){let K=[];for(let Z=0;Z<JM.length;Z++){let Q=JM[Z],D=Q.run(this,h,_,G,Y,X);if(D)D.strategy=Q.name,K.push({strategy:Q.name,syncPoint:D})}return K}selectSyncPoint_(h,_){let G=h[0].syncPoint,Y=Math.abs(h[0].syncPoint[_.key]-_.value),X=h[0].strategy;for(let K=1;K<h.length;K++){let Z=Math.abs(h[K].syncPoint[_.key]-_.value);if(Z<Y)Y=Z,G=h[K].syncPoint,X=h[K].strategy}return this.logger_(`syncPoint for [${_.key}: ${_.value}] chosen with strategy [${X}]: [time:${G.time}, segmentIndex:${G.segmentIndex}`+(typeof G.partIndex==="number"?`,partIndex:${G.partIndex}`:"")+"]"),G}saveExpiredSegmentInfo(h,_){let G=_.mediaSequence-h.mediaSequence;if(G>$y){Y0.log.warn(`Not saving expired segment info. Media sequence gap ${G} is too large.`);return}for(let Y=G-1;Y>=0;Y--){let X=h.segments[Y];if(X&&typeof X.start<"u"){_.syncInfo={mediaSequence:h.mediaSequence+Y,time:X.start},this.logger_(`playlist refresh sync: [time:${_.syncInfo.time}, mediaSequence: ${_.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(h){if(this.timelineToDatetimeMappings={},h.segments&&h.segments.length&&h.segments[0].dateTimeObject){let _=h.segments[0],G=_.dateTimeObject.getTime()/1000;this.timelineToDatetimeMappings[_.timeline]=-G}}saveSegmentTimingInfo({segmentInfo:h,shouldSaveTimelineMapping:_}){let G=this.calculateSegmentTimeMapping_(h,h.timingInfo,_),Y=h.segment;if(G){if(this.saveDiscontinuitySyncInfo_(h),!h.playlist.syncInfo)h.playlist.syncInfo={mediaSequence:h.playlist.mediaSequence+h.mediaIndex,time:Y.start}}let X=Y.dateTimeObject;if(Y.discontinuity&&_&&X)this.timelineToDatetimeMappings[Y.timeline]=-(X.getTime()/1000)}timestampOffsetForTimeline(h){if(typeof this.timelines[h]>"u")return null;return this.timelines[h].time}mappingForTimeline(h){if(typeof this.timelines[h]>"u")return null;return this.timelines[h].mapping}calculateSegmentTimeMapping_(h,_,G){let{segment:Y,part:X}=h,K=this.timelines[h.timeline],Z,Q;if(typeof h.timestampOffset==="number"){if(K={time:h.startOfSegment,mapping:h.startOfSegment-_.start},G)this.timelines[h.timeline]=K,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${h.timeline}: [time: ${K.time}] [mapping: ${K.mapping}]`);Z=h.startOfSegment,Q=_.end+K.mapping}else if(K)Z=_.start+K.mapping,Q=_.end+K.mapping;else return!1;if(X)X.start=Z,X.end=Q;if(!Y.start||Z<Y.start)Y.start=Z;return Y.end=Q,!0}saveDiscontinuitySyncInfo_(h){let{playlist:_,segment:G}=h;if(G.discontinuity)this.discontinuities[G.timeline]={time:G.start,accuracy:0};else if(_.discontinuityStarts&&_.discontinuityStarts.length)for(let Y=0;Y<_.discontinuityStarts.length;Y++){let X=_.discontinuityStarts[Y],K=_.discontinuitySequence+Y+1,Z=X-h.mediaIndex,Q=Math.abs(Z);if(!this.discontinuities[K]||this.discontinuities[K].accuracy>Q){let D;if(Z<0)D=G.start-KY({defaultDuration:_.targetDuration,durationList:_.segments,startIndex:h.mediaIndex,endIndex:X});else D=G.end+KY({defaultDuration:_.targetDuration,durationList:_.segments,startIndex:h.mediaIndex+1,endIndex:X});this.discontinuities[K]={time:D,accuracy:Q}}}}dispose(){this.trigger("dispose"),this.off()}}class Z$ extends Y0.EventTarget{constructor(){super();this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(h){this.pendingTimelineChanges_[h]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:h,from:_,to:G}){if(typeof _==="number"&&typeof G==="number")this.pendingTimelineChanges_[h]={type:h,from:_,to:G},this.trigger("pendingtimelinechange");return this.pendingTimelineChanges_[h]}lastTimelineChange({type:h,from:_,to:G}){if(typeof _==="number"&&typeof G==="number"){this.lastTimelineChanges_[h]={type:h,from:_,to:G},delete this.pendingTimelineChanges_[h];let Y={timelineChangeInfo:{from:_,to:G}};this.trigger({type:"timelinechange",metadata:Y})}return this.lastTimelineChanges_[h]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}var Ly=pN(lN(function(){var h=function(){function W(){this.listeners={}}var S=W.prototype;return S.on=function(v,x){if(!this.listeners[v])this.listeners[v]=[];this.listeners[v].push(x)},S.off=function(v,x){if(!this.listeners[v])return!1;var P=this.listeners[v].indexOf(x);return this.listeners[v]=this.listeners[v].slice(0),this.listeners[v].splice(P,1),P>-1},S.trigger=function(v){var x=this.listeners[v];if(!x)return;if(arguments.length===2){var P=x.length;for(var I=0;I<P;++I)x[I].call(this,arguments[1])}else{var b=Array.prototype.slice.call(arguments,1),l=x.length;for(var i=0;i<l;++i)x[i].apply(this,b)}},S.dispose=function(){this.listeners={}},S.pipe=function(v){this.on("data",function(x){v.push(x)})},W}();/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */function _(W){return W.subarray(0,W.byteLength-W[W.byteLength-1])}/*! @name aes-decrypter @version 4.0.2 @license Apache-2.0 */let G=function(){let W=[[[],[],[],[],[]],[[],[],[],[],[]]],S=W[0],R=W[1],v=S[4],x=R[4],P,I,b,l=[],i=[],h0,q0,Q0,o,r,d;for(P=0;P<256;P++)i[(l[P]=P<<1^(P>>7)*283)^P]=P;for(I=b=0;!v[I];I^=h0||1,b=i[b]||1){o=b^b<<1^b<<2^b<<3^b<<4,o=o>>8^o&255^99,v[I]=o,x[o]=I,Q0=l[q0=l[h0=l[I]]],d=Q0*16843009^q0*65537^h0*257^I*16843008,r=l[o]*257^o*16843008;for(P=0;P<4;P++)S[P][I]=r=r<<24^r>>>8,R[P][o]=d=d<<24^d>>>8}for(P=0;P<5;P++)S[P]=S[P].slice(0),R[P]=R[P].slice(0);return W},Y=null;class X{constructor(W){if(!Y)Y=G();this._tables=[[Y[0][0].slice(),Y[0][1].slice(),Y[0][2].slice(),Y[0][3].slice(),Y[0][4].slice()],[Y[1][0].slice(),Y[1][1].slice(),Y[1][2].slice(),Y[1][3].slice(),Y[1][4].slice()]];let S,R,v,x=this._tables[0][4],P=this._tables[1],I=W.length,b=1;if(I!==4&&I!==6&&I!==8)throw Error("Invalid aes key size");let l=W.slice(0),i=[];this._key=[l,i];for(S=I;S<4*I+28;S++){if(v=l[S-1],S%I===0||I===8&&S%I===4){if(v=x[v>>>24]<<24^x[v>>16&255]<<16^x[v>>8&255]<<8^x[v&255],S%I===0)v=v<<8^v>>>24^b<<24,b=b<<1^(b>>7)*283}l[S]=l[S-I]^v}for(R=0;S;R++,S--)if(v=l[R&3?S:S-4],S<=4||R<4)i[R]=v;else i[R]=P[0][x[v>>>24]]^P[1][x[v>>16&255]]^P[2][x[v>>8&255]]^P[3][x[v&255]]}decrypt(W,S,R,v,x,P){let I=this._key[1],b=W^I[0],l=v^I[1],i=R^I[2],h0=S^I[3],q0,Q0,o,r=I.length/4-2,d,s=4,_0=this._tables[1],Z0=_0[0],X0=_0[1],E0=_0[2],m=_0[3],N0=_0[4];for(d=0;d<r;d++)q0=Z0[b>>>24]^X0[l>>16&255]^E0[i>>8&255]^m[h0&255]^I[s],Q0=Z0[l>>>24]^X0[i>>16&255]^E0[h0>>8&255]^m[b&255]^I[s+1],o=Z0[i>>>24]^X0[h0>>16&255]^E0[b>>8&255]^m[l&255]^I[s+2],h0=Z0[h0>>>24]^X0[b>>16&255]^E0[l>>8&255]^m[i&255]^I[s+3],s+=4,b=q0,l=Q0,i=o;for(d=0;d<4;d++)x[(3&-d)+P]=N0[b>>>24]<<24^N0[l>>16&255]<<16^N0[i>>8&255]<<8^N0[h0&255]^I[s++],q0=b,b=l,l=i,i=h0,h0=q0}}class K extends h{constructor(){super(h);this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){if(this.jobs.shift()(),this.jobs.length)this.timeout_=setTimeout(this.processJob_.bind(this),this.delay);else this.timeout_=null}push(W){if(this.jobs.push(W),!this.timeout_)this.timeout_=setTimeout(this.processJob_.bind(this),this.delay)}}let Z=function(W){return W<<24|(W&65280)<<8|(W&16711680)>>8|W>>>24},Q=function(W,S,R){let v=new Int32Array(W.buffer,W.byteOffset,W.byteLength>>2),x=new X(Array.prototype.slice.call(S)),P=new Uint8Array(W.byteLength),I=new Int32Array(P.buffer),b,l,i,h0,q0,Q0,o,r,d;b=R[0],l=R[1],i=R[2],h0=R[3];for(d=0;d<v.length;d+=4)q0=Z(v[d]),Q0=Z(v[d+1]),o=Z(v[d+2]),r=Z(v[d+3]),x.decrypt(q0,Q0,o,r,I,d),I[d]=Z(I[d]^b),I[d+1]=Z(I[d+1]^l),I[d+2]=Z(I[d+2]^i),I[d+3]=Z(I[d+3]^h0),b=q0,l=Q0,i=o,h0=r;return P};class D{constructor(W,S,R,v){let x=D.STEP,P=new Int32Array(W.buffer),I=new Uint8Array(W.byteLength),b=0;this.asyncStream_=new K,this.asyncStream_.push(this.decryptChunk_(P.subarray(b,b+x),S,R,I));for(b=x;b<P.length;b+=x)R=new Uint32Array([Z(P[b-4]),Z(P[b-3]),Z(P[b-2]),Z(P[b-1])]),this.asyncStream_.push(this.decryptChunk_(P.subarray(b,b+x),S,R,I));this.asyncStream_.push(function(){v(null,_(I))})}static get STEP(){return 32000}decryptChunk_(W,S,R,v){return function(){let x=Q(W,S,R);v.set(x,W.byteOffset)}}}var O=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},A;if(typeof window<"u")A=window;else if(typeof O<"u")A=O;else if(typeof self<"u")A=self;else A={};var H=A,C=function(S){if(ArrayBuffer.isView==="function")return ArrayBuffer.isView(S);return S&&S.buffer instanceof ArrayBuffer},N=H.BigInt||Number;N("0x1"),N("0x100"),N("0x10000"),N("0x1000000"),N("0x100000000"),N("0x10000000000"),N("0x1000000000000"),N("0x100000000000000"),N("0x10000000000000000"),function(){var W=new Uint16Array([65484]),S=new Uint8Array(W.buffer,W.byteOffset,W.byteLength);if(S[0]===255)return"big";if(S[0]===204)return"little";return"unknown"}();let j=function(W){let S={};return Object.keys(W).forEach((R)=>{let v=W[R];if(C(v))S[R]={bytes:v.buffer,byteOffset:v.byteOffset,byteLength:v.byteLength};else S[R]=v}),S};self.onmessage=function(W){let S=W.data,R=new Uint8Array(S.encrypted.bytes,S.encrypted.byteOffset,S.encrypted.byteLength),v=new Uint32Array(S.key.bytes,S.key.byteOffset,S.key.byteLength/4),x=new Uint32Array(S.iv.bytes,S.iv.byteOffset,S.iv.byteLength/4);new D(R,v,x,function(P,I){self.postMessage(j({source:S.source,decrypted:I}),[I.buffer])})}})),jy=uN(Ly),Fy=(h)=>{let _=h.default?"main":"alternative";if(h.characteristics&&h.characteristics.indexOf("public.accessibility.describes-video")>=0)_="main-desc";return _},J$=(h,_)=>{if(h.abort(),h.pause(),_&&_.activePlaylistLoader)_.activePlaylistLoader.pause(),_.activePlaylistLoader=null},wM=(h,_)=>{_.activePlaylistLoader=h,h.load()},Ty=(h,_)=>()=>{let{segmentLoaders:{[h]:G,main:Y},mediaTypes:{[h]:X}}=_,K=X.activeTrack(),Z=X.getActiveGroup(),Q=X.activePlaylistLoader,D=X.lastGroup_;if(Z&&D&&Z.id===D.id)return;if(X.lastGroup_=Z,X.lastTrack_=K,J$(G,X),!Z||Z.isMainPlaylist)return;if(!Z.playlistLoader){if(Q)Y.resetEverything();return}G.resyncLoader(),wM(Z.playlistLoader,X)},Wy=(h,_)=>()=>{let{segmentLoaders:{[h]:G},mediaTypes:{[h]:Y}}=_;Y.lastGroup_=null,G.abort(),G.pause()},Ry=(h,_)=>()=>{let{mainPlaylistLoader:G,segmentLoaders:{[h]:Y,main:X},mediaTypes:{[h]:K}}=_,Z=K.activeTrack(),Q=K.getActiveGroup(),D=K.activePlaylistLoader,O=K.lastTrack_;if(O&&Z&&O.id===Z.id)return;if(K.lastGroup_=Q,K.lastTrack_=Z,J$(Y,K),!Q)return;if(Q.isMainPlaylist){if(!Z||!O||Z.id===O.id)return;let A=_.vhs.playlistController_,H=A.selectPlaylist();if(A.media()===H)return;K.logger_(`track change. Switching main audio from ${O.id} to ${Z.id}`),G.pause(),X.resetEverything(),A.fastQualityChange_(H);return}if(h==="AUDIO"){if(!Q.playlistLoader){X.setAudio(!0),X.resetEverything();return}Y.setAudio(!0),X.setAudio(!1)}if(D===Q.playlistLoader){wM(Q.playlistLoader,K);return}if(Y.track)Y.track(Z);Y.resetEverything(),wM(Q.playlistLoader,K)},kZ={AUDIO:(h,_)=>()=>{let{mediaTypes:{[h]:G},excludePlaylist:Y}=_,X=G.activeTrack(),K=G.activeGroup(),Z=(K.filter((D)=>D.default)[0]||K[0]).id,Q=G.tracks[Z];if(X===Q){Y({error:{message:"Problem encountered loading the default audio track."}});return}Y0.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(let D in G.tracks)G.tracks[D].enabled=G.tracks[D]===Q;G.onTrackChanged()},SUBTITLES:(h,_)=>()=>{let{mediaTypes:{[h]:G}}=_;Y0.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");let Y=G.activeTrack();if(Y)Y.mode="disabled";G.onTrackChanged()}},GC={AUDIO:(h,_,G)=>{if(!_)return;let{tech:Y,requestOptions:X,segmentLoaders:{[h]:K}}=G;_.on("loadedmetadata",()=>{let Z=_.media();if(K.playlist(Z,X),!Y.paused()||Z.endList&&Y.preload()!=="none")K.load()}),_.on("loadedplaylist",()=>{if(K.playlist(_.media(),X),!Y.paused())K.load()}),_.on("error",kZ[h](h,G))},SUBTITLES:(h,_,G)=>{let{tech:Y,requestOptions:X,segmentLoaders:{[h]:K},mediaTypes:{[h]:Z}}=G;_.on("loadedmetadata",()=>{let Q=_.media();if(K.playlist(Q,X),K.track(Z.activeTrack()),!Y.paused()||Q.endList&&Y.preload()!=="none")K.load()}),_.on("loadedplaylist",()=>{if(K.playlist(_.media(),X),!Y.paused())K.load()}),_.on("error",kZ[h](h,G))}},Sy={AUDIO:(h,_)=>{let{vhs:G,sourceType:Y,segmentLoaders:{[h]:X},requestOptions:K,main:{mediaGroups:Z},mediaTypes:{[h]:{groups:Q,tracks:D,logger_:O}},mainPlaylistLoader:A}=_,H=zY(A.main);if(!Z[h]||Object.keys(Z[h]).length===0){if(Z[h]={main:{default:{default:!0}}},H)Z[h].main.default.playlists=A.main.playlists}for(let C in Z[h]){if(!Q[C])Q[C]=[];for(let N in Z[h][C]){let j=Z[h][C][N],W;if(H)O(`AUDIO group '${C}' label '${N}' is a main playlist`),j.isMainPlaylist=!0,W=null;else if(Y==="vhs-json"&&j.playlists)W=new k7(j.playlists[0],G,K);else if(j.resolvedUri)W=new k7(j.resolvedUri,G,K);else if(j.playlists&&Y==="dash")W=new mZ(j.playlists[0],G,K,A);else W=null;if(j=p1({id:N,playlistLoader:W},j),GC[h](h,j.playlistLoader,_),Q[C].push(j),typeof D[N]>"u"){let S=new Y0.AudioTrack({id:N,kind:Fy(j),enabled:!1,language:j.language,default:j.default,label:N});D[N]=S}}}X.on("error",kZ[h](h,_))},SUBTITLES:(h,_)=>{let{tech:G,vhs:Y,sourceType:X,segmentLoaders:{[h]:K},requestOptions:Z,main:{mediaGroups:Q},mediaTypes:{[h]:{groups:D,tracks:O}},mainPlaylistLoader:A}=_;for(let H in Q[h]){if(!D[H])D[H]=[];for(let C in Q[h][H]){if(!Y.options_.useForcedSubtitles&&Q[h][H][C].forced)continue;let N=Q[h][H][C],j;if(X==="hls")j=new k7(N.resolvedUri,Y,Z);else if(X==="dash"){if(!N.playlists.filter((S)=>S.excludeUntil!==1/0).length)return;j=new mZ(N.playlists[0],Y,Z,A)}else if(X==="vhs-json")j=new k7(N.playlists?N.playlists[0]:N.resolvedUri,Y,Z);if(N=p1({id:C,playlistLoader:j},N),GC[h](h,N.playlistLoader,_),D[H].push(N),typeof O[C]>"u"){let W=G.addRemoteTextTrack({id:C,kind:"subtitles",default:N.default&&N.autoselect,language:N.language,label:C},!1).track;O[C]=W}}}K.on("error",kZ[h](h,_))},"CLOSED-CAPTIONS":(h,_)=>{let{tech:G,main:{mediaGroups:Y},mediaTypes:{[h]:{groups:X,tracks:K}}}=_;for(let Z in Y[h]){if(!X[Z])X[Z]=[];for(let Q in Y[h][Z]){let D=Y[h][Z][Q];if(!/^(?:CC|SERVICE)/.test(D.instreamId))continue;let O=G.options_.vhs&&G.options_.vhs.captionServices||{},A={label:Q,language:D.language,instreamId:D.instreamId,default:D.default&&D.autoselect};if(O[A.instreamId])A=p1(A,O[A.instreamId]);if(A.default===void 0)delete A.default;if(X[Z].push(p1({id:Q},D)),typeof K[Q]>"u"){let H=G.addRemoteTextTrack({id:A.instreamId,kind:"captions",default:A.default,language:A.language,label:A.label},!1).track;K[Q]=H}}}}},q$=(h,_)=>{for(let G=0;G<h.length;G++){if(FB(_,h[G]))return!0;if(h[G].playlists&&q$(h[G].playlists,_))return!0}return!1},vy=(h,_)=>(G)=>{let{mainPlaylistLoader:Y,mediaTypes:{[h]:{groups:X}}}=_,K=Y.media();if(!K)return null;let Z=null;if(K.attributes[h])Z=X[K.attributes[h]];let Q=Object.keys(X);if(!Z){if(h==="AUDIO"&&Q.length>1&&zY(_.main))for(let D=0;D<Q.length;D++){let O=X[Q[D]];if(q$(O,K)){Z=O;break}}else if(X.main)Z=X.main;else if(Q.length===1)Z=X[Q[0]]}if(typeof G>"u")return Z;if(G===null||!Z)return null;return Z.filter((D)=>D.id===G.id)[0]||null},xy={AUDIO:(h,_)=>()=>{let{mediaTypes:{[h]:{tracks:G}}}=_;for(let Y in G)if(G[Y].enabled)return G[Y];return null},SUBTITLES:(h,_)=>()=>{let{mediaTypes:{[h]:{tracks:G}}}=_;for(let Y in G)if(G[Y].mode==="showing"||G[Y].mode==="hidden")return G[Y];return null}},wy=(h,{mediaTypes:_})=>()=>{let G=_[h].activeTrack();if(!G)return null;return _[h].activeGroup(G)},gy=(h)=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((O)=>{Sy[O](O,h)});let{mediaTypes:_,mainPlaylistLoader:G,tech:Y,vhs:X,segmentLoaders:{["AUDIO"]:K,main:Z}}=h;["AUDIO","SUBTITLES"].forEach((O)=>{_[O].activeGroup=vy(O,h),_[O].activeTrack=xy[O](O,h),_[O].onGroupChanged=Ty(O,h),_[O].onGroupChanging=Wy(O,h),_[O].onTrackChanged=Ry(O,h),_[O].getActiveGroup=wy(O,h)});let Q=_.AUDIO.activeGroup();if(Q){let O=(Q.filter((H)=>H.default)[0]||Q[0]).id;if(_.AUDIO.tracks[O].enabled=!0,_.AUDIO.onGroupChanged(),_.AUDIO.onTrackChanged(),!_.AUDIO.getActiveGroup().playlistLoader)Z.setAudio(!0);else Z.setAudio(!1),K.setAudio(!0)}G.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach((O)=>_[O].onGroupChanged())}),G.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach((O)=>_[O].onGroupChanging())});let D=()=>{_.AUDIO.onTrackChanged(),Y.trigger({type:"usage",name:"vhs-audio-change"})};Y.audioTracks().addEventListener("change",D),Y.remoteTextTracks().addEventListener("change",_.SUBTITLES.onTrackChanged),X.on("dispose",()=>{Y.audioTracks().removeEventListener("change",D),Y.remoteTextTracks().removeEventListener("change",_.SUBTITLES.onTrackChanged)}),Y.clearTracks("audio");for(let O in _.AUDIO.tracks)Y.audioTracks().addTrack(_.AUDIO.tracks[O])},Iy=()=>{let h={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((_)=>{h[_]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:$6,activeTrack:$6,getActiveGroup:$6,onGroupChanged:$6,onTrackChanged:$6,lastTrack_:null,logger_:a4(`MediaGroups[${_}]`)}}),h};class gM{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(h){if(h===1)this.version_=h}set ttl(h){this.ttl_=h||300}set reloadUri(h){if(h)this.reloadUri_=Z4(this.reloadUri_,h)}set priority(h){if(h&&h.length)this.priority_=h}set pathwayClones(h){if(h&&h.length)this.pathwayClones_=new Map(h.map((_)=>[_.ID,_]))}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 Q$ extends Y0.EventTarget{constructor(h,_){super();this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new gM,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_=a4("Content Steering"),this.xhr_=h,this.getBandwidth_=_}assignTagProperties(h,_){this.manifestType_=_.serverUri?"HLS":"DASH";let G=_.serverUri||_.serverURL;if(!G){this.logger_(`steering manifest URL is ${G}, cannot request steering manifest.`),this.trigger("error");return}if(G.startsWith("data:")){this.decodeDataUriManifest_(G.substring(G.indexOf(",")+1));return}if(this.steeringManifest.reloadUri=Z4(h,G),this.defaultPathway=_.pathwayId||_.defaultServiceLocation,this.queryBeforeStart=_.queryBeforeStart,this.proxyServerUrl_=_.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart)this.trigger("content-steering")}requestSteeringManifest(h){let _=this.steeringManifest.reloadUri;if(!_)return;let G=h?_:this.getRequestURI(_);if(!G){this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),this.dispose();return}let Y={contentSteeringInfo:{uri:G}};this.trigger({type:"contentsteeringloadstart",metadata:Y}),this.request_=this.xhr_({uri:G,requestType:"content-steering-manifest"},(X,K)=>{if(X){if(K.status===410){this.logger_(`manifest request 410 ${X}.`),this.logger_(`There will be no more content steering requests to ${G} this session.`),this.excludedSteeringManifestURLs.add(G);return}if(K.status===429){let D=K.responseHeaders["retry-after"];this.logger_(`manifest request 429 ${X}.`),this.logger_(`content steering will retry in ${D} seconds.`),this.startTTLTimeout_(parseInt(D,10));return}this.logger_(`manifest failed to load ${X}.`),this.startTTLTimeout_();return}this.trigger({type:"contentsteeringloadcomplete",metadata:Y});let Z;try{Z=JSON.parse(this.request_.responseText)}catch(D){let O={errorType:Y0.Error.StreamingContentSteeringParserError,error:D};this.trigger({type:"error",metadata:O})}this.assignSteeringProperties_(Z);let Q={contentSteeringInfo:Y.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:Q}),this.startTTLTimeout_()})}setProxyServerUrl_(h){let _=new a.default.URL(h),G=new a.default.URL(this.proxyServerUrl_);return G.searchParams.set("url",encodeURI(_.toString())),this.setSteeringParams_(G.toString())}decodeDataUriManifest_(h){let _=JSON.parse(a.default.atob(h));this.assignSteeringProperties_(_)}setSteeringParams_(h){let _=new a.default.URL(h),G=this.getPathway(),Y=this.getBandwidth_();if(G){let X=`_${this.manifestType_}_pathway`;_.searchParams.set(X,G)}if(Y){let X=`_${this.manifestType_}_throughput`;_.searchParams.set(X,Y)}return _.toString()}assignSteeringProperties_(h){if(this.steeringManifest.version=h.VERSION,!this.steeringManifest.version){this.logger_(`manifest version is ${h.VERSION}, which is not supported.`),this.trigger("error");return}if(this.steeringManifest.ttl=h.TTL,this.steeringManifest.reloadUri=h["RELOAD-URI"],this.steeringManifest.priority=h["PATHWAY-PRIORITY"]||h["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=h["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();let G=((Y)=>{for(let X of Y)if(this.availablePathways_.has(X))return X;return[...this.availablePathways_][0]})(this.steeringManifest.priority);if(this.currentPathway!==G)this.currentPathway=G,this.trigger("content-steering")}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(h){if(!h)return null;let _=(Y)=>this.excludedSteeringManifestURLs.has(Y);if(this.proxyServerUrl_){let Y=this.setProxyServerUrl_(h);if(!_(Y))return Y}let G=this.setSteeringParams_(h);if(!_(G))return G;return null}startTTLTimeout_(h=this.steeringManifest.ttl){let _=h*1000;this.ttlTimeout_=a.default.setTimeout(()=>{this.requestSteeringManifest()},_)}clearTTLTimeout_(){a.default.clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){if(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 gM}addAvailablePathway(h){if(h)this.availablePathways_.add(h)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(h){return this.availablePathways_.delete(h)}didDASHTagChange(h,_){return!_&&this.steeringManifest.reloadUri||_&&(Z4(h,_.serverURL)!==this.steeringManifest.reloadUri||_.defaultServiceLocation!==this.defaultPathway||_.queryBeforeStart!==this.queryBeforeStart||_.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}var Py=(h,_)=>{let G=null;return(...Y)=>{clearTimeout(G),G=setTimeout(()=>{h.apply(null,Y)},_)}},yy=10,C6,by=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],my=function(h){return this.audioSegmentLoader_[h]+this.mainSegmentLoader_[h]},fy=function({currentPlaylist:h,buffered:_,currentTime:G,nextPlaylist:Y,bufferLowWaterLine:X,bufferHighWaterLine:K,duration:Z,bufferBasedABR:Q,log:D}){if(!Y)return Y0.log.warn("We received no playlist to switch to. Please check your stream."),!1;let O=`allowing switch ${h&&h.id||"null"} -> ${Y.id}`;if(!h)return D(`${O} as current playlist is not set`),!0;if(Y.id===h.id)return!1;let A=Boolean(Rh(_,G).length);if(!h.endList){if(!A&&typeof h.partTargetDuration==="number")return D(`not ${O} as current playlist is live llhls, but currentTime isn't in buffered.`),!1;return D(`${O} as current playlist is live`),!0}let H=$B(_,G),C=Q?q5.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:q5.MAX_BUFFER_LOW_WATER_LINE;if(Z<C)return D(`${O} as duration < max low water line (${Z} < ${C})`),!0;let N=Y.attributes.BANDWIDTH,j=h.attributes.BANDWIDTH;if(N<j&&(!Q||H<K)){let W=`${O} as next bandwidth < current bandwidth (${N} < ${j})`;if(Q)W+=` and forwardBuffer < bufferHighWaterLine (${H} < ${K})`;return D(W),!0}if((!Q||N>j)&&H>=X){let W=`${O} as forwardBuffer >= bufferLowWaterLine (${H} >= ${X})`;if(Q)W+=` and next bandwidth > current bandwidth (${N} > ${j})`;return D(W),!0}return D(`not ${O} as no switching criteria met`),!1};class D$ extends Y0.EventTarget{constructor(h){super();this.fastQualityChange_=Py(this.fastQualityChange_.bind(this),100);let{src:_,withCredentials:G,tech:Y,bandwidth:X,externVhs:K,useCueTags:Z,playlistExclusionDuration:Q,enableLowInitialPlaylist:D,sourceType:O,cacheEncryptionKeys:A,bufferBasedABR:H,leastPixelDiffSelector:C,captionServices:N,experimentalUseMMS:j}=h;if(!_)throw Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:W}=h;if(W===null||typeof W>"u")W=1/0;if(C6=K,this.bufferBasedABR=Boolean(H),this.leastPixelDiffSelector=Boolean(C),this.withCredentials=G,this.tech_=Y,this.vhs_=Y.vhs,this.player_=h.player_,this.sourceType_=O,this.useCueTags_=Z,this.playlistExclusionDuration=Q,this.maxPlaylistRetries=W,this.enableLowInitialPlaylist=D,this.usingManagedMediaSource_=!1,this.useCueTags_)this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType="";if(this.requestOptions_={withCredentials:G,maxPlaylistRetries:W,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=Iy(),j&&a.default.ManagedMediaSource)this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new a.default.ManagedMediaSource,this.usingManagedMediaSource_=!0,Y0.log("Using ManagedMediaSource");else if(a.default.MediaSource)this.mediaSource=new a.default.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_=Q5(),this.hasPlayed_=!1,this.syncController_=new K$(h),this.segmentMetadataTrack_=Y.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.segmentMetadataTrack_.mode="hidden",this.decrypter_=new jy,this.sourceUpdater_=new RB(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new Z$,this.keyStatusMap_=new Map;let S={vhs:this.vhs_,parse708captions:h.parse708captions,useDtsForTimestampOffset:h.useDtsForTimestampOffset,captionServices:N,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:X,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:A,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:h.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new mZ(_,this.vhs_,p1(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new k7(_,this.vhs_,p1(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new fZ(p1(S,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),h),this.audioSegmentLoader_=new fZ(p1(S,{loaderType:"audio"}),h),this.subtitleSegmentLoader_=new Y$(p1(S,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((x,P)=>{function I(){Y.off("vttjserror",b),x()}function b(){Y.off("vttjsloaded",I),P()}Y.one("vttjsloaded",I),Y.one("vttjserror",b),Y.addWebVttScript_()})}),h);let R=()=>{return this.mainSegmentLoader_.bandwidth};if(this.contentSteeringController_=new Q$(this.vhs_.xhr,R),this.setupSegmentLoaderListeners_(),this.bufferBasedABR)this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_());if(by.forEach((x)=>{this[x+"_"]=my.bind(this,x)}),this.logger_=a4("pc"),this.triggeredFmp4Usage=!1,this.tech_.preload()==="none")this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_);else this.mainPlaylistLoader_.load();this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;let v=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(v,()=>{let x=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-x,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){let h=this.mainAppendsToLoadedData_(),_=this.audioAppendsToLoadedData_();if(h===-1||_===-1)return-1;return h+_}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(h="abr"){let _=this.selectPlaylist();if(_&&this.shouldSwitchToMedia_(_))this.switchMedia_(_,h)}switchMedia_(h,_,G){let Y=this.media(),X=Y&&(Y.id||Y.uri),K=h&&(h.id||h.uri);if(X&&X!==K){this.logger_(`switch media ${X} -> ${K} from ${_}`);let Z={renditionInfo:{id:K,bandwidth:h.attributes.BANDWIDTH,resolution:h.attributes.RESOLUTION,codecs:h.attributes.CODECS},cause:_};this.trigger({type:"renditionselected",metadata:Z}),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${_}`})}this.mainPlaylistLoader_.media(h,G)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((h)=>{let _=this.mediaTypes_[h],G=_?_.activeGroup():null,Y=this.contentSteeringController_.getPathway();if(G&&Y){let K=(G.length?G[0].playlists:G.playlists).filter((Z)=>Z.attributes.serviceLocation===Y);if(K.length)this.mediaTypes_[h].activePlaylistLoader.media(K[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=a.default.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){if(this.tech_.scrubbing&&this.tech_.scrubbing())return;a.default.clearInterval(this.abrTimer_),this.abrTimer_=null}getAudioTrackPlaylists_(){let h=this.main(),_=h&&h.playlists||[];if(!h||!h.mediaGroups||!h.mediaGroups.AUDIO)return _;let G=h.mediaGroups.AUDIO,Y=Object.keys(G),X;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)X=this.mediaTypes_.AUDIO.activeTrack();else{let Z=G.main||Y.length&&G[Y[0]];for(let Q in Z)if(Z[Q].default){X={label:Q};break}}if(!X)return _;let K=[];for(let Z in G)if(G[Z][X.label]){let Q=G[Z][X.label];if(Q.playlists&&Q.playlists.length)K.push.apply(K,Q.playlists);else if(Q.uri)K.push(Q);else if(h.playlists.length)for(let D=0;D<h.playlists.length;D++){let O=h.playlists[D];if(O.attributes&&O.attributes.AUDIO&&O.attributes.AUDIO===Z)K.push(O)}}if(!K.length)return _;return K}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",()=>{let _=this.mainPlaylistLoader_.media(),G=_.targetDuration*1.5*1000;if(NM(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media()))this.requestOptions_.timeout=0;else this.requestOptions_.timeout=G;if(_.endList&&this.tech_.preload()!=="none")this.mainSegmentLoader_.playlist(_,this.requestOptions_),this.mainSegmentLoader_.load();if(gy({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(),_),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media())this.trigger("selectedinitialmedia");else this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}),this.mainPlaylistLoader_.on("loadedplaylist",()=>{if(this.loadOnPlay_)this.tech_.off("play",this.loadOnPlay_);let _=this.mainPlaylistLoader_.media();if(!_){this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_();let G;if(this.enableLowInitialPlaylist)G=this.selectInitialPlaylist();if(!G)G=this.selectPlaylist();if(!G||!this.shouldSwitchToMedia_(G))return;if(this.initialMedia_=G,this.switchMedia_(this.initialMedia_,"initial"),!(this.sourceType_==="vhs-json"&&this.initialMedia_.segments))return;_=this.initialMedia_}this.handleUpdatedMediaPlaylist(_)}),this.mainPlaylistLoader_.on("error",()=>{let _=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:_.playlist,error:_})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{let _=this.mainPlaylistLoader_.media(),G=_.targetDuration*1.5*1000;if(NM(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media()))this.requestOptions_.timeout=0;else this.requestOptions_.timeout=G;if(this.sourceType_==="dash"){if(this.mainPlaylistLoader_.isPaused)this.mainPlaylistLoader_.load()}if(this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(_,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_)this.runFastQualitySwitch_();else this.mainSegmentLoader_.load();this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{let _=this.mainPlaylistLoader_.media();if(_.lastExcludeReason_==="playlist-unchanged")return;if(this.stuckAtPlaylistEnd_(_))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((_)=>{this.mainPlaylistLoader_.on(_,(G)=>{this.player_.trigger(U2({},G))})})}handleUpdatedMediaPlaylist(h){if(this.useCueTags_)this.updateAdCues_(h);if(this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(h,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_)this.runFastQualitySwitch_();if(this.updateDuration(!h.endList),!this.tech_.paused()){if(this.mainSegmentLoader_.load(),this.audioSegmentLoader_)this.audioSegmentLoader_.load()}}triggerPresenceUsage_(h,_){let G=h.mediaGroups||{},Y=!0,X=Object.keys(G.AUDIO);for(let K in G.AUDIO)for(let Z in G.AUDIO[K])if(!G.AUDIO[K][Z].uri)Y=!1;if(Y)this.tech_.trigger({type:"usage",name:"vhs-demuxed"});if(Object.keys(G.SUBTITLES).length)this.tech_.trigger({type:"usage",name:"vhs-webvtt"});if(C6.Playlist.isAes(_))this.tech_.trigger({type:"usage",name:"vhs-aes"});if(X.length&&Object.keys(G.AUDIO[X[0]]).length>1)this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"});if(this.useCueTags_)this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(h){let _=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,G=this.tech_.currentTime(),Y=this.bufferLowWaterLine(),X=this.bufferHighWaterLine(),K=this.tech_.buffered();return fy({buffered:K,currentTime:G,currentPlaylist:_,nextPlaylist:h,bufferLowWaterLine:Y,bufferHighWaterLine:X,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){if(this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",()=>{if(this.bufferBasedABR)this.mainSegmentLoader_.load()}),!this.bufferBasedABR)this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")});this.mainSegmentLoader_.on("error",()=>{let G=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:G.playlist,error:G})}),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",()=>{let G=this.audioSegmentLoader_.pendingSegment_;if(!G||!G.segment||!G.segment.syncInfo)return;let Y=G.segment.syncInfo.end+0.01;this.tech_.setCurrentTime(Y)}),this.timelineChangeController_.on("fixBadTimelineChange",()=>{if(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();if(this.mediaTypes_.SUBTITLES.activePlaylistLoader)this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything();this.load()}),this.mainSegmentLoader_.on("earlyabort",(G)=>{if(this.bufferBasedABR)return;this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:yy})});let h=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();let G=this.getCodecsOrExclude_();if(!G)return;this.sourceUpdater_.addOrChangeSourceBuffers(G)};this.mainSegmentLoader_.on("trackinfo",h),this.audioSegmentLoader_.on("trackinfo",h),this.mainSegmentLoader_.on("fmp4",()=>{if(!this.triggeredFmp4Usage)this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0}),this.audioSegmentLoader_.on("fmp4",()=>{if(!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((G)=>{this.mainSegmentLoader_.on(G,(Y)=>{this.player_.trigger(U2({},Y))}),this.audioSegmentLoader_.on(G,(Y)=>{this.player_.trigger(U2({},Y))}),this.subtitleSegmentLoader_.on(G,(Y)=>{this.player_.trigger(U2({},Y))})})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){if(this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader)this.audioSegmentLoader_.load();if(this.mediaTypes_.SUBTITLES.activePlaylistLoader)this.subtitleSegmentLoader_.load()}pause(){if(this.mainSegmentLoader_.pause(),this.mediaTypes_.AUDIO.activePlaylistLoader)this.audioSegmentLoader_.pause();if(this.mediaTypes_.SUBTITLES.activePlaylistLoader)this.subtitleSegmentLoader_.pause()}fastQualityChange_(h=this.selectPlaylist()){if(h&&h===this.mainPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(h,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0}runFastQualitySwitch_(){if(this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader)this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything();if(this.mediaTypes_.SUBTITLES.activePlaylistLoader)this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything();this.load()}play(){if(this.setupFirstPlay())return;if(this.tech_.ended())this.tech_.setCurrentTime(0);if(this.hasPlayed_)this.load();let h=this.tech_.seekable();if(this.tech_.duration()===1/0){if(this.tech_.currentTime()<h.start(0))return this.tech_.setCurrentTime(h.end(h.length-1))}}setupFirstPlay(){let h=this.mainPlaylistLoader_.media();if(!h||this.tech_.paused()||this.hasPlayed_)return!1;if(!h.endList||h.start){let _=this.seekable();if(!_.length)return!1;let G=_.end(0),Y=G;if(h.start){let X=h.start.timeOffset;if(X<0){let K=this.mainPlaylistLoader_.main,Z=C6.Playlist.liveEdgeDelay(K,h),Q=G+Z;Y=Math.max(Math.min(Q+X,G),_.start(0))}else Y=Math.min(G,X)}this.trigger("firstplay"),this.tech_.setCurrentTime(Y)}return this.hasPlayed_=!0,this.load(),!0}handleSourceOpen_(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){let h=this.tech_.play();if(typeof h<"u"&&typeof h.then==="function")h.then(null,(_)=>{})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;let h=this.inbandTextTracks_.metadataTrack_.cues;if(!h||!h.length)return;let _=this.duration();h[h.length-1].endTime=isNaN(_)||Math.abs(_)===1/0?Number.MAX_VALUE:_}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let h=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){let _=this.mainSegmentLoader_.getCurrentMediaInfo_();if(!_||_.hasVideo)h=h&&this.audioSegmentLoader_.ended_;else h=this.audioSegmentLoader_.ended_}if(!h)return;this.stopABRTimer_(),this.sourceUpdater_.endOfStream()}stuckAtPlaylistEnd_(h){if(!this.seekable().length)return!1;let G=this.syncController_.getExpiredTime(h,this.duration());if(G===null)return!1;let Y=C6.Playlist.playlistEnd(h,G),X=this.tech_.currentTime(),K=this.tech_.buffered();if(!K.length)return Y-X<=g3;let Z=K.end(K.length-1);return Z-X<=g3&&Y-Z<=g3}excludePlaylist({playlistToExclude:h=this.mainPlaylistLoader_.media(),error:_={},playlistExclusionDuration:G}){if(h=h||this.mainPlaylistLoader_.media(),G=G||_.playlistExclusionDuration||this.playlistExclusionDuration,!h){if(this.error=_,this.mediaSource.readyState!=="open")this.trigger("error");else this.sourceUpdater_.endOfStream("network");return}h.playlistErrors_++;let Y=this.mainPlaylistLoader_.main.playlists,X=Y.filter(UJ),K=X.length===1&&X[0]===h;if(Y.length===1&&G!==1/0)return Y0.log.warn(`Problem encountered with playlist ${h.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(K);if(K){if(this.main().contentSteering){let N=this.pathwayAttribute_(h),j=this.contentSteeringController_.steeringManifest.ttl*1000;this.contentSteeringController_.excludePathway(N),this.excludeThenChangePathway_(),setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(N)},j);return}let C=!1;if(Y.forEach((N)=>{if(N===h)return;let j=N.excludeUntil;if(typeof j<"u"&&j!==1/0)C=!0,delete N.excludeUntil}),C)Y0.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist")}let Z;if(h.playlistErrors_>this.maxPlaylistRetries)Z=1/0;else Z=Date.now()+G*1000;if(h.excludeUntil=Z,_.reason)h.lastExcludeReason_=_.reason;this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});let Q=this.selectPlaylist();if(!Q){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}let D=_.internal?this.logger_:Y0.log.warn,O=_.message?" "+_.message:"";if(D(`${_.internal?"Internal problem":"Problem"} encountered with playlist ${h.id}.${O} Switching to playlist ${Q.id}.`),Q.attributes.AUDIO!==h.attributes.AUDIO)this.delegateLoaders_("audio",["abort","pause"]);if(Q.attributes.SUBTITLES!==h.attributes.SUBTITLES)this.delegateLoaders_("subtitle",["abort","pause"]);this.delegateLoaders_("main",["abort","pause"]);let A=Q.targetDuration/2*1000||5000,H=typeof Q.lastRequest==="number"&&Date.now()-Q.lastRequest<=A;return this.switchMedia_(Q,"exclude",K||H)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(h,_){let G=[],Y=h==="all";if(Y||h==="main")G.push(this.mainPlaylistLoader_);let X=[];if(Y||h==="audio")X.push("AUDIO");if(Y||h==="subtitle")X.push("CLOSED-CAPTIONS"),X.push("SUBTITLES");X.forEach((K)=>{let Z=this.mediaTypes_[K]&&this.mediaTypes_[K].activePlaylistLoader;if(Z)G.push(Z)}),["main","audio","subtitle"].forEach((K)=>{let Z=this[`${K}SegmentLoader_`];if(Z&&(h===K||h==="all"))G.push(Z)}),G.forEach((K)=>_.forEach((Z)=>{if(typeof K[Z]==="function")K[Z]()}))}setCurrentTime(h){let _=Rh(this.tech_.buffered(),h);if(!(this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media()))return 0;if(!this.mainPlaylistLoader_.media().segments)return 0;if(_&&_.length)return h;if(this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader)this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything();if(this.mediaTypes_.SUBTITLES.activePlaylistLoader)this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything();this.load()}duration(){if(!this.mainPlaylistLoader_)return 0;let h=this.mainPlaylistLoader_.media();if(!h)return 0;if(!h.endList)return 1/0;if(this.mediaSource)return this.mediaSource.duration;return C6.Playlist.duration(h)}seekable(){return this.seekable_}getSeekableRange_(h,_){let G=h.media();if(!G)return null;let Y=this.syncController_.getMediaSequenceSync(_);if(Y&&Y.isReliable){let{start:Z,end:Q}=Y;if(!isFinite(Z)||!isFinite(Q))return null;let D=C6.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,G),O=Math.max(Z,Q-D);return Q5([[Z,O]])}let X=this.syncController_.getExpiredTime(G,this.duration());if(X===null)return null;let K=C6.Playlist.seekable(G,X,C6.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,G));return K.length?K:null}computeFinalSeekable_(h,_){if(!_)return h;let G=h.start(0),Y=h.end(0),X=_.start(0),K=_.end(0);if(X>Y||G>K)return h;return Q5([[Math.max(G,X),Math.min(Y,K)]])}onSyncInfoUpdate_(){if(!this.mainPlaylistLoader_)return;let h=this.getSeekableRange_(this.mainPlaylistLoader_,"main");if(!h)return;let _;if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(_=this.getSeekableRange_(this.mediaTypes_.AUDIO.activePlaylistLoader,"audio"),!_)return}let G=this.seekable_;if(this.seekable_=this.computeFinalSeekable_(h,_),!this.seekable_)return;if(G&&G.length&&this.seekable_.length){if(G.start(0)===this.seekable_.start(0)&&G.end(0)===this.seekable_.end(0))return}this.logger_(`seekable updated [${zN(this.seekable_)}]`);let Y={seekableRanges:this.seekable_};this.trigger({type:"seekablerangeschanged",metadata:Y}),this.tech_.trigger("seekablechanged")}updateDuration(h){if(this.updateDuration_)this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null;if(this.mediaSource.readyState!=="open"){this.updateDuration_=this.updateDuration.bind(this,h),this.mediaSource.addEventListener("sourceopen",this.updateDuration_);return}if(h){let Y=this.seekable();if(!Y.length)return;if(isNaN(this.mediaSource.duration)||this.mediaSource.duration<Y.end(Y.length-1))this.sourceUpdater_.setDuration(Y.end(Y.length-1));return}let _=this.tech_.buffered(),G=C6.Playlist.duration(this.mainPlaylistLoader_.media());if(_.length>0)G=Math.max(G,_.end(_.length-1));if(this.mediaSource.duration!==G)this.sourceUpdater_.setDuration(G)}dispose(){if(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_);if(["AUDIO","SUBTITLES"].forEach((h)=>{let _=this.mediaTypes_[h].groups;for(let G in _)_[G].forEach((Y)=>{if(Y.playlistLoader)Y.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_(){let h=!!this.mediaTypes_.AUDIO.activePlaylistLoader,_=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),G=!h?!0:!!this.audioSegmentLoader_.getCurrentMediaInfo_();if(!_||!G)return!1;return!0}getCodecsOrExclude_(){let h={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},_=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();h.video=h.main;let G=ZY(this.main(),_),Y={},X=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(h.main.hasVideo)Y.video=G.video||h.main.videoCodec||bV;if(h.main.isMuxed)Y.video+=`,${G.audio||h.main.audioCodec||OD}`;if(h.main.hasAudio&&!h.main.isMuxed||h.audio.hasAudio||X)Y.audio=G.audio||h.main.audioCodec||h.audio.audioCodec||OD,h.audio.isFmp4=h.main.hasAudio&&!h.main.isMuxed?h.main.isFmp4:h.audio.isFmp4;if(!Y.audio&&!Y.video){this.excludePlaylist({playlistToExclude:_,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});return}let K=(D,O)=>D?Bh(O,this.usingManagedMediaSource_):oK(O),Z={},Q;if(["video","audio"].forEach(function(D){if(Y.hasOwnProperty(D)&&!K(h[D].isFmp4,Y[D])){let O=h[D].isFmp4?"browser":"muxer";if(Z[O]=Z[O]||[],Z[O].push(Y[D]),D==="audio")Q=O}}),X&&Q&&_.attributes.AUDIO){let D=_.attributes.AUDIO;this.main().playlists.forEach((O)=>{if((O.attributes&&O.attributes.AUDIO)===D&&O!==_)O.excludeUntil=1/0}),this.logger_(`excluding audio group ${D} as ${Q} does not support codec(s): "${Y.audio}"`)}if(Object.keys(Z).length){let D=Object.keys(Z).reduce((O,A)=>{if(O)O+=", ";return O+=`${A} does not support codec(s): "${Z[A].join(",")}"`,O},"")+".";this.excludePlaylist({playlistToExclude:_,error:{internal:!0,message:D},playlistExclusionDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){let D=[];if(["video","audio"].forEach((O)=>{let A=(J3(this.sourceUpdater_.codecs[O]||"")[0]||{}).type,H=(J3(Y[O]||"")[0]||{}).type;if(A&&H&&A.toLowerCase()!==H.toLowerCase())D.push(`"${this.sourceUpdater_.codecs[O]}" -> "${Y[O]}"`)}),D.length){this.excludePlaylist({playlistToExclude:_,error:{message:`Codec switching not supported: ${D.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0});return}}return Y}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers())return;if(!this.areMediaTypesKnown_())return;let h=this.getCodecsOrExclude_();if(!h)return;this.sourceUpdater_.createSourceBuffers(h);let _=[h.video,h.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(_)}excludeUnsupportedVariants_(){let h=this.main().playlists,_=[];Object.keys(h).forEach((G)=>{let Y=h[G];if(_.indexOf(Y.id)!==-1)return;_.push(Y.id);let X=ZY(this.main,Y),K=[];if(X.audio&&!oK(X.audio)&&!Bh(X.audio,this.usingManagedMediaSource_))K.push(`audio codec ${X.audio}`);if(X.video&&!oK(X.video)&&!Bh(X.video,this.usingManagedMediaSource_))K.push(`video codec ${X.video}`);if(X.text&&X.text==="stpp.ttml.im1t")K.push(`text codec ${X.text}`);if(K.length)Y.excludeUntil=1/0,this.logger_(`excluding ${Y.id} for unsupported: ${K.join(", ")}`)})}excludeIncompatibleVariants_(h){let _=[],G=this.main().playlists,Y=MY(J3(h)),X=uE(Y),K=Y.video&&J3(Y.video)[0]||null,Z=Y.audio&&J3(Y.audio)[0]||null;Object.keys(G).forEach((Q)=>{let D=G[Q];if(_.indexOf(D.id)!==-1||D.excludeUntil===1/0)return;_.push(D.id);let O=[],A=ZY(this.mainPlaylistLoader_.main,D),H=uE(A);if(!A.audio&&!A.video)return;if(H!==X)O.push(`codec count "${H}" !== "${X}"`);if(!this.sourceUpdater_.canChangeType()){let C=A.video&&J3(A.video)[0]||null,N=A.audio&&J3(A.audio)[0]||null;if(C&&K&&C.type.toLowerCase()!==K.type.toLowerCase())O.push(`video codec "${C.type}" !== "${K.type}"`);if(N&&Z&&N.type.toLowerCase()!==Z.type.toLowerCase())O.push(`audio codec "${N.type}" !== "${Z.type}"`)}if(O.length)D.excludeUntil=1/0,this.logger_(`excluding ${D.id}: ${O.join(" && ")}`)})}updateAdCues_(h){let _=0,G=this.seekable();if(G.length)_=G.start(0);Ny(h,this.cueTagsTrack_,_)}goalBufferLength(){let h=this.tech_.currentTime(),_=q5.GOAL_BUFFER_LENGTH,G=q5.GOAL_BUFFER_LENGTH_RATE,Y=Math.max(_,q5.MAX_GOAL_BUFFER_LENGTH);return Math.min(_+h*G,Y)}bufferLowWaterLine(){let h=this.tech_.currentTime(),_=q5.BUFFER_LOW_WATER_LINE,G=q5.BUFFER_LOW_WATER_LINE_RATE,Y=Math.max(_,q5.MAX_BUFFER_LOW_WATER_LINE),X=Math.max(_,q5.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(_+h*G,this.bufferBasedABR?X:Y)}bufferHighWaterLine(){return q5.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(h){sE(this.inbandTextTracks_,"com.apple.streaming",this.tech_),Gy({inbandTextTracks:this.inbandTextTracks_,dateRanges:h})}addMetadataToTextTrack(h,_,G){let Y=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();sE(this.inbandTextTracks_,h,this.tech_),eP({inbandTextTracks:this.inbandTextTracks_,metadataArray:_,timestampOffset:Y,videoDuration:G})}pathwayAttribute_(h){return h.attributes["PATHWAY-ID"]||h.attributes.serviceLocation}initContentSteeringController_(){let h=this.main();if(!h.contentSteering)return;for(let _ of h.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(_));if(this.contentSteeringController_.assignTagProperties(h.uri,h.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_(){if(this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),["contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach((_)=>{this.contentSteeringController_.on(_,(G)=>{this.trigger(U2({},G))})}),this.sourceType_==="dash")this.mainPlaylistLoader_.on("loadedplaylist",()=>{let _=this.main();if(this.contentSteeringController_.didDASHTagChange(_.uri,_.contentSteering)||(()=>{let X=this.contentSteeringController_.getAvailablePathways(),K=[];for(let Z of _.playlists){let Q=Z.attributes.serviceLocation;if(Q){if(K.push(Q),!X.has(Q))return!0}}if(!K.length&&X.size)return!0;return!1})())this.resetContentSteeringController_()})}excludeThenChangePathway_(){let h=this.contentSteeringController_.getPathway();if(!h)return;this.handlePathwayClones_();let G=this.main().playlists,Y=new Set,X=!1;if(Object.keys(G).forEach((K)=>{let Z=G[K],Q=this.pathwayAttribute_(Z),D=Q&&h!==Q;if(Z.excludeUntil===1/0&&Z.lastExcludeReason_==="content-steering"&&!D)delete Z.excludeUntil,delete Z.lastExcludeReason_,X=!0;let A=!Z.excludeUntil&&Z.excludeUntil!==1/0;if(!(!Y.has(Z.id)&&D&&A))return;Y.add(Z.id),Z.excludeUntil=1/0,Z.lastExcludeReason_="content-steering",this.logger_(`excluding ${Z.id} for ${Z.lastExcludeReason_}`)}),this.contentSteeringController_.manifestType_==="DASH")Object.keys(this.mediaTypes_).forEach((K)=>{let Z=this.mediaTypes_[K];if(Z.activePlaylistLoader){let Q=Z.activePlaylistLoader.media_;if(Q&&Q.attributes.serviceLocation!==h)X=!0}});if(X)this.changeSegmentPathway_()}handlePathwayClones_(){let _=this.main().playlists,G=this.contentSteeringController_.currentPathwayClones,Y=this.contentSteeringController_.nextPathwayClones;if(!(G&&G.size||Y&&Y.size))return;for(let[K,Z]of G.entries())if(!Y.get(K))this.mainPlaylistLoader_.updateOrDeleteClone(Z),this.contentSteeringController_.excludePathway(K);for(let[K,Z]of Y.entries()){let Q=G.get(K);if(!Q){_.filter((O)=>{return O.attributes["PATHWAY-ID"]===Z["BASE-ID"]}).forEach((O)=>{this.mainPlaylistLoader_.addClonePathway(Z,O)}),this.contentSteeringController_.addAvailablePathway(K);continue}if(this.equalPathwayClones_(Q,Z))continue;this.mainPlaylistLoader_.updateOrDeleteClone(Z,!0),this.contentSteeringController_.addAvailablePathway(K)}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...Y])))}equalPathwayClones_(h,_){if(h["BASE-ID"]!==_["BASE-ID"]||h.ID!==_.ID||h["URI-REPLACEMENT"].HOST!==_["URI-REPLACEMENT"].HOST)return!1;let G=h["URI-REPLACEMENT"].PARAMS,Y=_["URI-REPLACEMENT"].PARAMS;for(let X in G)if(G[X]!==Y[X])return!1;for(let X in Y)if(G[X]!==Y[X])return!1;return!0}changeSegmentPathway_(){let h=this.selectPlaylist();if(this.pauseLoading(),this.contentSteeringController_.manifestType_==="DASH")this.switchMediaForDASHContentSteering_();this.switchMedia_(h,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let h=0,_="non-usable";if(this.mainPlaylistLoader_.main.playlists.forEach((G)=>{let Y=this.mainPlaylistLoader_.getKeyIdSet(G);if(!Y||!Y.size)return;Y.forEach((X)=>{let Z=this.keyStatusMap_.has(X)&&this.keyStatusMap_.get(X)==="usable",Q=G.lastExcludeReason_===_&&G.excludeUntil===1/0;if(!Z){if(G.excludeUntil!==1/0&&G.lastExcludeReason_!==_)G.excludeUntil=1/0,G.lastExcludeReason_=_,this.logger_(`excluding playlist ${G.id} because the key ID ${X} doesn't exist in the keyStatusMap or is not usable`);h++}else if(Z&&Q)delete G.excludeUntil,delete G.lastExcludeReason_,this.logger_(`enabling playlist ${G.id} because key ID ${X} is usable`)})}),h>=this.mainPlaylistLoader_.main.playlists.length)this.mainPlaylistLoader_.main.playlists.forEach((G)=>{let Y=G&&G.attributes&&G.attributes.RESOLUTION&&G.attributes.RESOLUTION.height<720,X=G.excludeUntil===1/0&&G.lastExcludeReason_===_;if(Y&&X)delete G.excludeUntil,Y0.log.warn(`enabling non-HD playlist ${G.id} because all playlists were excluded due to ${_} key IDs`)})}addKeyStatus_(h,_){let X=(typeof h==="string"?h:Ey(h)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${_}' with key ID ${X} added to the keyStatusMap`),this.keyStatusMap_.set(X,_)}updatePlaylistByKeyStatus(h,_){if(this.addKeyStatus_(h,_),!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_()}}var ky=(h,_,G)=>(Y)=>{let X=h.main.playlists[_],K=jB(X),Z=UJ(X);if(typeof Y>"u")return Z;if(Y)delete X.disabled;else X.disabled=!0;let Q={renditionInfo:{id:_,bandwidth:X.attributes.BANDWIDTH,resolution:X.attributes.RESOLUTION,codecs:X.attributes.CODECS},cause:"fast-quality"};if(Y!==Z&&!K)if(Y)G(X),h.trigger({type:"renditionenabled",metadata:Q});else h.trigger({type:"renditiondisabled",metadata:Q});return Y};class M${constructor(h,_,G){let{playlistController_:Y}=h,X=Y.fastQualityChange_.bind(Y);if(_.attributes){let K=_.attributes.RESOLUTION;this.width=K&&K.width,this.height=K&&K.height,this.bandwidth=_.attributes.BANDWIDTH,this.frameRate=_.attributes["FRAME-RATE"]}this.codecs=ZY(Y.main(),_),this.playlist=_,this.id=G,this.enabled=ky(h.playlists,_.id,X)}}var uy=function(h){h.representations=()=>{let _=h.playlistController_.main(),G=zY(_)?h.playlistController_.getAudioTrackPlaylists_():_.playlists;if(!G)return[];return G.filter((Y)=>!jB(Y)).map((Y,X)=>new M$(h,Y,Y.id))}},YC=["seeking","seeked","pause","playing","error"];class B$ extends Y0.EventTarget{constructor(h){super();this.playlistController_=h.playlistController,this.tech_=h.tech,this.seekable=h.seekable,this.allowSeeksWithinUnsafeLiveWindow=h.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=h.liveRangeSafeTimeDelta,this.media=h.media,this.playedRanges_=[],this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=a4("PlaybackWatcher"),this.logger_("initialize");let _=()=>this.monitorCurrentTime_(),G=()=>this.monitorCurrentTime_(),Y=()=>this.techWaiting_(),X=()=>this.resetTimeUpdate_(),K=this.playlistController_,Z=["main","subtitle","audio"],Q={};Z.forEach((O)=>{Q[O]={reset:()=>this.resetSegmentDownloads_(O),updateend:()=>this.checkSegmentDownloads_(O)},K[`${O}SegmentLoader_`].on("appendsdone",Q[O].updateend),K[`${O}SegmentLoader_`].on("playlistupdate",Q[O].reset),this.tech_.on(["seeked","seeking"],Q[O].reset)});let D=(O)=>{["main","audio"].forEach((A)=>{K[`${A}SegmentLoader_`][O]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{if(this.fixesBadSeeks_())this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),D("off")},this.clearSeekingAppendCheck_=()=>D("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),D("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",Y),this.tech_.on(YC,X),this.tech_.on("canplay",G),this.tech_.one("play",_),this.dispose=()=>{if(this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",Y),this.tech_.off(YC,X),this.tech_.off("canplay",G),this.tech_.off("play",_),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),Z.forEach((O)=>{K[`${O}SegmentLoader_`].off("appendsdone",Q[O].updateend),K[`${O}SegmentLoader_`].off("playlistupdate",Q[O].reset),this.tech_.off(["seeked","seeking"],Q[O].reset)}),this.checkCurrentTimeTimeout_)a.default.clearTimeout(this.checkCurrentTimeTimeout_);this.resetTimeUpdate_()}}monitorCurrentTime_(){if(this.checkCurrentTime_(),this.checkCurrentTimeTimeout_)a.default.clearTimeout(this.checkCurrentTimeTimeout_);this.checkCurrentTimeTimeout_=a.default.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(h){let _=this.playlistController_[`${h}SegmentLoader_`];if(this[`${h}StalledDownloads_`]>0)this.logger_(`resetting possible stalled download count for ${h} loader`);this[`${h}StalledDownloads_`]=0,this[`${h}Buffered_`]=_.buffered_()}checkSegmentDownloads_(h){let _=this.playlistController_,G=_[`${h}SegmentLoader_`],Y=G.buffered_(),X=PI(this[`${h}Buffered_`],Y);if(this[`${h}Buffered_`]=Y,X){let K={bufferedRanges:Y};_.trigger({type:"bufferedrangeschanged",metadata:K}),this.resetSegmentDownloads_(h);return}if(this[`${h}StalledDownloads_`]++,this.logger_(`found #${this[`${h}StalledDownloads_`]} ${h} appends that did not increase buffer (possible stalled download)`,{playlistId:G.playlist_&&G.playlist_.id,buffered:f7(Y)}),this[`${h}StalledDownloads_`]<10)return;if(this.logger_(`${h} loader stalled download exclusion`),this.resetSegmentDownloads_(h),this.tech_.trigger({type:"usage",name:`vhs-${h}-download-exclusion`}),h==="subtitle")return;_.excludePlaylist({error:{message:`Excessive ${h} segment downloading detected.`},playlistExclusionDuration:1/0})}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;let h=this.tech_.currentTime(),_=this.tech_.buffered();if(this.lastRecordedTime===h&&(!_.length||h+g3>=_.end(_.length-1)))return this.techWaiting_();if(this.consecutiveUpdates>=5&&h===this.lastRecordedTime)this.consecutiveUpdates++,this.waiting_();else if(h===this.lastRecordedTime)this.consecutiveUpdates++;else{this.playedRanges_.push(Q5([this.lastRecordedTime,h]));let G={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:G}),this.consecutiveUpdates=0,this.lastRecordedTime=h}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;let _=this.seekable(),G=this.tech_.currentTime(),Y=this.afterSeekableWindow_(_,G,this.media(),this.allowSeeksWithinUnsafeLiveWindow),X;if(Y)X=_.end(_.length-1);if(this.beforeSeekableWindow_(_,G)){let N=_.start(0);X=N+(N===_.end(0)?0:g3)}if(typeof X<"u")return this.logger_(`Trying to seek outside of seekable at time ${G} with seekable range ${zN(_)}. Seeking to ${X}.`),this.tech_.setCurrentTime(X),!0;let K=this.playlistController_.sourceUpdater_,Z=this.tech_.buffered(),Q=K.audioBuffer?K.audioBuffered():null,D=K.videoBuffer?K.videoBuffered():null,O=this.media(),A=O.partTargetDuration?O.partTargetDuration:(O.targetDuration-w3)*2,H=[Q,D];for(let N=0;N<H.length;N++){if(!H[N])continue;if($B(H[N],G)<A)return!1}let C=zZ(Z,G);if(C.length===0)return!1;return X=C.start(0)+g3,this.logger_(`Buffered region starts (${C.start(0)}) just beyond seek point (${G}). Seeking to ${X}.`),this.tech_.setCurrentTime(X),!0}waiting_(){if(this.techWaiting_())return;let h=this.tech_.currentTime(),_=this.tech_.buffered(),G=Rh(_,h);if(G.length&&h+3<=G.end(0)){this.resetTimeUpdate_(),this.tech_.setCurrentTime(h),this.logger_(`Stopped at ${h} while inside a buffered region [${G.start(0)} -> ${G.end(0)}]. Attempting to resume playback by seeking to the current time.`),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"});return}}techWaiting_(){let h=this.seekable(),_=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(h,_)){let Z=h.end(h.length-1);return this.logger_(`Fell out of live window at time ${_}. Seeking to live point (seekable end) ${Z}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(Z),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}let G=this.tech_.vhs.playlistController_.sourceUpdater_,Y=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:G.audioBuffered(),videoBuffered:G.videoBuffered(),currentTime:_}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(_),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;let K=zZ(Y,_);if(K.length>0)return this.logger_(`Stopped at ${_} and seeking to ${K.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(_),!0;return!1}afterSeekableWindow_(h,_,G,Y=!1){if(!h.length)return!1;let X=h.end(h.length-1)+g3,K=!G.endList,Z=typeof G.partTargetDuration==="number";if(K&&(Z||Y))X=h.end(h.length-1)+G.targetDuration*3;if(_>X)return!0;return!1}beforeSeekableWindow_(h,_){if(h.length&&h.start(0)>0&&_<h.start(0)-this.liveRangeSafeTimeDelta)return!0;return!1}videoUnderflow_({videoBuffered:h,audioBuffered:_,currentTime:G}){if(!h)return;let Y;if(h.length&&_.length){let X=Rh(h,G-3),K=Rh(h,G),Z=Rh(_,G);if(Z.length&&!K.length&&X.length)Y={start:X.end(0),end:Z.end(0)}}else if(!zZ(h,G).length)Y=this.gapFromVideoUnderflow_(h,G);if(Y)return this.logger_(`Encountered a gap in video from ${Y.start} to ${Y.end}. Seeking to current time ${G}`),!0;return!1}skipTheGap_(h){let _=this.tech_.buffered(),G=this.tech_.currentTime(),Y=zZ(_,G);if(this.resetTimeUpdate_(),Y.length===0||G!==h)return;this.logger_("skipTheGap_:","currentTime:",G,"scheduled currentTime:",h,"nextRange start:",Y.start(0)),this.tech_.setCurrentTime(Y.start(0)+w3);let X={gapInfo:{from:G,to:Y.start(0)}};this.playlistController_.trigger({type:"gapjumped",metadata:X}),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"})}gapFromVideoUnderflow_(h,_){let G=wI(h);for(let Y=0;Y<G.length;Y++){let X=G.start(Y),K=G.end(Y);if(_-X<4&&_-X>2)return{start:X,end:K}}return null}}var py={errorInterval:30,getSource(h){let G=this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource();return h(G)}},O$=function(h,_){let G=0,Y=0,X=p1(py,_);h.ready(()=>{h.trigger({type:"usage",name:"vhs-error-reload-initialized"})});let K=function(){if(Y)h.currentTime(Y)},Z=function(A){if(A===null||A===void 0)return;Y=h.duration()!==1/0&&h.currentTime()||0,h.one("loadedmetadata",K),h.src(A),h.trigger({type:"usage",name:"vhs-error-reload"}),h.play()},Q=function(){if(Date.now()-G<X.errorInterval*1000){h.trigger({type:"usage",name:"vhs-error-reload-canceled"});return}if(!X.getSource||typeof X.getSource!=="function"){Y0.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}return G=Date.now(),X.getSource.call(h,Z)},D=function(){h.off("loadedmetadata",K),h.off("error",Q),h.off("dispose",D)},O=function(A){D(),O$(h,A)};h.on("error",Q),h.on("dispose",D),h.reloadSourceOnError=O},ly=function(h){O$(this,h)},A$="3.17.3",iy="7.1.0",cy="1.3.1",dy="7.2.0",ay="4.0.2",E2={PlaylistLoader:k7,Playlist:J4,utils:JP,STANDARD_PLAYLIST_SELECTOR:tE,INITIAL_PLAYLIST_SELECTOR:tP,lastBandwidthSelector:tE,movingAverageBandwidthSelector:dP,comparePlaylistBandwidth:WB,comparePlaylistResolution:cP,xhr:IN()};Object.keys(q5).forEach((h)=>{Object.defineProperty(E2,h,{get(){return Y0.log.warn(`using Vhs.${h} is UNSAFE be sure you know what you are doing`),q5[h]},set(_){if(Y0.log.warn(`using Vhs.${h} is UNSAFE be sure you know what you are doing`),typeof _!=="number"||_<0){Y0.log.warn(`value of Vhs.${h} must be greater than or equal to 0`);return}q5[h]=_}})});var z$="videojs-vhs",H$=function(h,_){let G=_.media(),Y=-1;for(let X=0;X<h.length;X++)if(h[X].id===G.id){Y=X;break}h.selectedIndex_=Y,h.trigger({selectedIndex:Y,type:"change"})},ty=function(h,_){_.representations().forEach((G)=>{h.addQualityLevel(G)}),H$(h,_.playlists)};E2.canPlaySource=function(){return Y0.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};var sy=(h,_,G)=>{if(!h)return h;let Y={};if(_&&_.attributes&&_.attributes.CODECS)Y=MY(J3(_.attributes.CODECS));if(G&&G.attributes&&G.attributes.CODECS)Y.audio=G.attributes.CODECS;let X=g7(Y.video),K=g7(Y.audio),Z={};for(let Q in h){if(Z[Q]={},K)Z[Q].audioContentType=K;if(X)Z[Q].videoContentType=X;if(_.contentProtection&&_.contentProtection[Q]&&_.contentProtection[Q].pssh)Z[Q].pssh=_.contentProtection[Q].pssh;if(typeof h[Q]==="string")Z[Q].url=h[Q]}return p1(h,Z)},ny=(h,_)=>{return h.reduce((G,Y)=>{if(!Y.contentProtection)return G;let X=_.reduce((K,Z)=>{let Q=Y.contentProtection[Z];if(Q&&Q.pssh)K[Z]={pssh:Q.pssh};return K},{});if(Object.keys(X).length)G.push(X);return G},[])},oy=({player:h,sourceKeySystems:_,audioMedia:G,mainPlaylists:Y})=>{if(!h.eme.initializeMediaKeys)return Promise.resolve();let X=G?Y.concat([G]):Y,K=ny(X,Object.keys(_)),Z=[],Q=[];return K.forEach((D)=>{Q.push(new Promise((O,A)=>{h.tech_.one("keysessioncreated",O)})),Z.push(new Promise((O,A)=>{h.eme.initializeMediaKeys({keySystems:D},(H)=>{if(H){A(H);return}O()})}))}),Promise.race([Promise.all(Z),Promise.race(Q)])},ry=({player:h,sourceKeySystems:_,media:G,audioMedia:Y})=>{let X=sy(_,G,Y);if(!X)return!1;if(h.currentSource().keySystems=X,X&&!h.eme)return Y0.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1;return!0},V$=()=>{if(!a.default.localStorage)return null;let h=a.default.localStorage.getItem(z$);if(!h)return null;try{return JSON.parse(h)}catch(_){return null}},ey=(h)=>{if(!a.default.localStorage)return!1;let _=V$();_=_?p1(_,h):h;try{a.default.localStorage.setItem(z$,JSON.stringify(_))}catch(G){return!1}return _},hb=(h)=>{if(h.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0)return JSON.parse(h.substring(h.indexOf(",")+1));return h},U$=(h,_)=>{if(!h._requestCallbackSet)h._requestCallbackSet=new Set;h._requestCallbackSet.add(_)},E$=(h,_)=>{if(!h._responseCallbackSet)h._responseCallbackSet=new Set;h._responseCallbackSet.add(_)},C$=(h,_)=>{if(!h._requestCallbackSet)return;if(h._requestCallbackSet.delete(_),!h._requestCallbackSet.size)delete h._requestCallbackSet},N$=(h,_)=>{if(!h._responseCallbackSet)return;if(h._responseCallbackSet.delete(_),!h._responseCallbackSet.size)delete h._responseCallbackSet};E2.supportsNativeHls=function(){if(!T0.default||!T0.default.createElement)return!1;let h=T0.default.createElement("video");if(!Y0.getTech("Html5").isSupported())return!1;return["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(G){return/maybe|probably/i.test(h.canPlayType(G))})}();E2.supportsNativeDash=function(){if(!T0.default||!T0.default.createElement||!Y0.getTech("Html5").isSupported())return!1;return/maybe|probably/i.test(T0.default.createElement("video").canPlayType("application/dash+xml"))}();E2.supportsTypeNatively=(h)=>{if(h==="hls")return E2.supportsNativeHls;if(h==="dash")return E2.supportsNativeDash;return!1};E2.isSupported=function(){return Y0.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};E2.xhr.onRequest=function(h){U$(E2.xhr,h)};E2.xhr.onResponse=function(h){E$(E2.xhr,h)};E2.xhr.offRequest=function(h){C$(E2.xhr,h)};E2.xhr.offResponse=function(h){N$(E2.xhr,h)};var _b=Y0.getComponent("Component");class vB extends _b{constructor(h,_,G){super(_,G.vhs);if(typeof G.initialBandwidth==="number")this.options_.bandwidth=G.initialBandwidth;if(this.logger_=a4("VhsHandler"),_.options_&&_.options_.playerId){let Y=Y0.getPlayer(_.options_.playerId);this.player_=Y}if(this.tech_=_,this.source_=h,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&_.overrideNativeAudioTracks&&_.overrideNativeVideoTracks)_.overrideNativeAudioTracks(!0),_.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(_.featuresNativeVideoTracks||_.featuresNativeAudioTracks))throw Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(T0.default,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],(Y)=>{let X=T0.default.fullscreenElement||T0.default.webkitFullscreenElement||T0.default.mozFullScreenElement||T0.default.msFullscreenElement;if(X&&X.contains(this.tech_.el()))this.playlistController_.fastQualityChange_();else 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(){if(this.tech_.error()&&this.playlistController_)this.playlistController_.pauseLoading()}),this.on(this.tech_,"play",this.play)}setOptions_(h={}){if(this.options_=p1(this.options_,h),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions===!1?!1:!0,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.usePlayerObjectFit=this.options_.usePlayerObjectFit||!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=typeof this.options_.useNetworkInformationApi<"u"?this.options_.useNetworkInformationApi:!0,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?!1:!0,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,typeof this.options_.playlistExclusionDuration!=="number")this.options_.playlistExclusionDuration=60;if(typeof this.options_.bandwidth!=="number"){if(this.options_.useBandwidthFromLocalStorage){let G=V$();if(G&&G.bandwidth)this.options_.bandwidth=G.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"});if(G&&G.throughput)this.options_.throughput=G.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"})}}if(typeof this.options_.bandwidth!=="number")this.options_.bandwidth=q5.INITIAL_BANDWIDTH;this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===q5.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","usePlayerObjectFit","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach((G)=>{if(typeof this.source_[G]<"u")this.options_[G]=this.source_[G]}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio,this.usePlayerObjectFit=this.options_.usePlayerObjectFit;let _=this.options_.customPixelRatio;if(typeof _==="number"&&_>=0)this.customPixelRatio=_}setOptions(h={}){this.setOptions_(h)}src(h,_){if(!h)return;this.setOptions_(),this.options_.src=hb(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=E2,this.options_.sourceType=AD(_),this.options_.seekTo=(X)=>{this.tech_.setCurrentTime(X)},this.options_.player_=this.player_,this.playlistController_=new D$(this.options_);let G=p1({liveRangeSafeTimeDelta:g3},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new B$(G),this.attachStreamingEventListeners_(),this.playlistController_.on("error",()=>{let X=Y0.players[this.tech_.options_.playerId],K=this.playlistController_.error;if(typeof K==="object"&&!K.code)K.code=3;else if(typeof K==="string")K={message:K,code:3};X.error(K)});let Y=this.options_.bufferBasedABR?E2.movingAverageBandwidthSelector(0.55):E2.STANDARD_PLAYLIST_SELECTOR;if(this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):Y.bind(this),this.playlistController_.selectInitialPlaylist=E2.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(X){this.playlistController_.selectPlaylist=X.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(X){this.playlistController_.mainSegmentLoader_.throughput.rate=X,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let X=this.playlistController_.mainSegmentLoader_.bandwidth,K=a.default.navigator.connection||a.default.navigator.mozConnection||a.default.navigator.webkitConnection,Z=1e7;if(this.options_.useNetworkInformationApi&&K){let Q=K.downlink*1000*1000;if(Q>=Z&&X>=Z)X=Math.max(X,Q);else X=Q}return X},set(X){this.playlistController_.mainSegmentLoader_.bandwidth=X,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){let X=1/(this.bandwidth||1),K;if(this.throughput>0)K=1/this.throughput;else K=0;return Math.floor(1/(X+K))},set(){Y0.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth)this.bandwidth=this.options_.bandwidth;if(this.options_.throughput)this.throughput=this.options_.throughput;if(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:()=>f7(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:()=>f7(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",()=>{if(this.options_.useBandwidthFromLocalStorage)ey({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{uy(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())return;if(this.mediaSourceUrl_=a.default.URL.createObjectURL(this.playlistController_.mediaSource),(Y0.browser.IS_ANY_SAFARI||Y0.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);else this.tech_.src(this.mediaSourceUrl_)}createKeySessions_(){let h=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),oy({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:h&&h.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch((_)=>{this.logger_("error while creating EME key session",_),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_(){let h=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,_=ry({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:h&&h.media()});if(this.player_.tech_.on("keystatuschange",(G)=>{this.playlistController_.updatePlaylistByKeyStatus(G.keyId,G.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),!_){this.playlistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()}setupQualityLevels_(){let h=Y0.players[this.tech_.options_.playerId];if(!h||!h.qualityLevels||this.qualityLevels_)return;this.qualityLevels_=h.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{ty(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{H$(this.qualityLevels_,this.playlists)})}static version(){return{"@videojs/http-streaming":A$,"mux.js":iy,"mpd-parser":cy,"m3u8-parser":dy,"aes-decrypter":ay}}version(){return this.constructor.version()}canChangeType(){return RB.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(h){this.playlistController_.setCurrentTime(h)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){if(this.playbackWatcher_)this.playbackWatcher_.dispose();if(this.playlistController_)this.playlistController_.dispose();if(this.qualityLevels_)this.qualityLevels_.dispose();if(this.tech_&&this.tech_.vhs)delete this.tech_.vhs;if(this.mediaSourceUrl_&&a.default.URL.revokeObjectURL)a.default.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null;if(this.tech_)this.tech_.off("waitingforkey",this.handleWaitingForKey_);super.dispose()}convertToProgramTime(h,_){return AP({playlist:this.playlistController_.media(),time:h,callback:_})}seekToProgramTime(h,_,G=!0,Y=2){return fN({programTime:h,playlist:this.playlistController_.media(),retryCount:Y,pauseAfterSeek:G,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:_})}setupXhrHooks_(){this.xhr.onRequest=(h)=>{U$(this.xhr,h)},this.xhr.onResponse=(h)=>{E$(this.xhr,h)},this.xhr.offRequest=(h)=>{C$(this.xhr,h)},this.xhr.offResponse=(h)=>{N$(this.xhr,h)},this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){let h=["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"],_=["gapjumped","playedrangeschanged"];h.forEach((G)=>{this.playlistController_.on(G,(Y)=>{this.player_.trigger(U2({},Y))})}),_.forEach((G)=>{this.playbackWatcher_.on(G,(Y)=>{this.player_.trigger(U2({},Y))})})}}var uZ={name:"videojs-http-streaming",VERSION:A$,canHandleSource(h,_={}){let G=p1(Y0.options,_);if(!G.vhs.experimentalUseMMS&&!Bh("avc1.4d400d,mp4a.40.2",!1))return!1;return uZ.canPlayType(h.type,G)},handleSource(h,_,G={}){let Y=p1(Y0.options,G);return _.vhs=new vB(h,_,Y),_.vhs.xhr=IN(),_.vhs.setupXhrHooks_(),_.vhs.src(h.src,h.type),_.vhs},canPlayType(h,_){let G=AD(h);if(!G)return"";let Y=uZ.getOverrideNative(_);return!E2.supportsTypeNatively(G)||Y?"maybe":""},getOverrideNative(h={}){let{vhs:_={}}=h,G=!(Y0.browser.IS_ANY_SAFARI||Y0.browser.IS_IOS),{overrideNative:Y=G}=_;return Y}},Gb=()=>{return Bh("avc1.4d400d,mp4a.40.2",!0)};if(Gb())Y0.getTech("Html5").registerSourceHandler(uZ,0);Y0.VhsHandler=vB;Y0.VhsSourceHandler=uZ;Y0.Vhs=E2;if(!Y0.use)Y0.registerComponent("Vhs",E2);Y0.options.vhs=Y0.options.vhs||{};if(!Y0.getPlugin||!Y0.getPlugin("reloadSourceOnError"))Y0.registerPlugin("reloadSourceOnError",ly);var D4=S1(l2(),1);var Yb=1000;function CJ(h,_,G,Y){let[X,K]=D4.useState(0),Z=D4.useRef(!1),Q=D4.useRef(!1),D=D4.useRef(null),O=D4.useRef(X);O.current=X,D4.useEffect(()=>{let H=h.current;if(!H)return;let C=()=>{Q.current=!0},N=()=>{Q.current=!1};return H.addEventListener("play",C),H.addEventListener("pause",N),Q.current=!H.paused,()=>{H.removeEventListener("play",C),H.removeEventListener("pause",N)}},[h.current]),D4.useEffect(()=>{let H=h.current;if(!H)return;let C=null,N=null,j=!0,W=Date.now(),S=!1,R=-1,v=()=>{W=Date.now(),S=!1,R=-1},x=()=>{if(!j)return;if(H.paused||H.ended)return;let l=H,i=!!l.requestVideoFrameCallback,h0=xB(_),q0=Date.now()-W,Q0=S&&q0>h0,o=!S&&q0>Yb;if(Y||!i||Q0||o){let d=Math.floor(H.currentTime*_+0.45),s=Math.max(0,Math.min(d,G-1));K(s)}if(N=requestAnimationFrame(x),l.requestVideoFrameCallback&&C===null)C=l.requestVideoFrameCallback((d,s)=>{C=null,W=Date.now(),S=!0,R=s.mediaTime;let _0=Math.floor(s.mediaTime*_+0.45),Z0=Math.max(0,Math.min(_0,G-1));K(Z0)})},P=()=>{v(),x()},I=()=>{if(C!==null){let o=H;if(o.cancelVideoFrameCallback)try{o.cancelVideoFrameCallback(C)}catch{}C=null}if(N!==null)cancelAnimationFrame(N),N=null;let l=xB(_),h0=S&&R>=0&&Date.now()-W<=l?R:H.currentTime,q0=Math.floor(h0*_+0.45),Q0=Math.max(0,Math.min(q0,G-1));if(K(Q0),!H.ended){let o=EJ(Q0,_);H.currentTime=o}},b=()=>{K(G-1)};if(H.addEventListener("play",P),H.addEventListener("pause",I),H.addEventListener("ended",b),!H.paused)v(),x();return()=>{if(j=!1,H.removeEventListener("play",P),H.removeEventListener("pause",I),H.removeEventListener("ended",b),C!==null){let l=H;if(l.cancelVideoFrameCallback)try{l.cancelVideoFrameCallback(C)}catch{}}if(N!==null)cancelAnimationFrame(N)}},[h.current,_,G]);let A=D4.useCallback(async(H)=>{let C=h.current;if(!C)return;let N=Math.round(H),j=Math.max(0,Math.min(N,G-1));if(Z.current){D.current=j,K(j);return}Z.current=!0,K(j);let W=async(S)=>{let R=EJ(S,_),v=!C.paused;if(C.currentTime=R,await new Promise((b)=>{let l=null,i=()=>{if(l)clearTimeout(l);C.removeEventListener("seeked",i),b()};C.addEventListener("seeked",i),l=setTimeout(()=>{C.removeEventListener("seeked",i),b()},500)}),!v&&!Q.current)C.pause();let x=Math.floor(C.currentTime*_+0.45),P=Math.max(0,Math.min(x,G-1));K(P);let I=C;if(I.requestVideoFrameCallback)I.requestVideoFrameCallback((b,l)=>{let i=Math.floor(l.mediaTime*_+0.45),h0=Math.max(0,Math.min(i,G-1));K(h0)});if(D.current!==null){let b=D.current;D.current=null,await W(b)}else Z.current=!1};await W(j)},[h,_,G]);return D4.useEffect(()=>{let H=(C)=>{let N=C.target;if(N instanceof HTMLInputElement||N instanceof HTMLTextAreaElement||N.isContentEditable)return;if(C.key==="ArrowRight"){C.preventDefault();let j=C.shiftKey?10:1;A(O.current+j)}else if(C.key==="ArrowLeft"){C.preventDefault();let j=C.shiftKey?10:1;A(O.current-j)}};return window.addEventListener("keydown",H),()=>{window.removeEventListener("keydown",H)}},[A]),D4.useEffect(()=>{let H=h.current;if(!H)return;let C=()=>{if(!Z.current){let N=Math.floor(H.currentTime*_+0.45),j=Math.max(0,Math.min(N,G-1));K(j);let W=EJ(j,_),S=1/_;if(Math.abs(H.currentTime-W)>S/4)H.currentTime=W}};return H.addEventListener("seeked",C),()=>{H.removeEventListener("seeked",C)}},[h.current,_,G]),{currentFrame:X,setCurrentFrame:K,seekToFrame:A,isSeeking:Z}}var $$=S1(l2(),1);function L$({className:h,defaultValue:_,value:G,min:Y=0,max:X=100,...K}){let Z=$$.useMemo(()=>Array.isArray(G)?G:Array.isArray(_)?_:[Y,X],[G,_,Y,X]);return O0(HY.Root,{"data-slot":"slider",defaultValue:_,value:G,min:Y,max:X,className:D5("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",h),...K,children:[f(HY.Track,{"data-slot":"slider-track",className:D5("relative grow overflow-hidden rounded-full bg-muted data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:f(HY.Range,{"data-slot":"slider-range",className:D5("absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:Z.length},(Q,D)=>f(HY.Thumb,{"data-slot":"slider-thumb",className:"block size-4 shrink-0 rounded-full border border-primary bg-white shadow-sm ring-ring/50 transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},D))]})}var c5=S1(l2(),1);var Xb=(h)=>{if(isNaN(h))return"00:00";let _=new Date(h*1000),G=_.getUTCHours(),Y=_.getUTCMinutes(),X=_.getUTCSeconds().toString().padStart(2,"0");if(G)return`${G}:${Y.toString().padStart(2,"0")}:${X}`;return`${Y}:${X}`},Kb=({totalFrames:h,currentFrame:_,fps:G,previewUrl:Y,onSeek:X,buffered:K=0,metadata:Z})=>{let Q=c5.useRef(null),D=c5.useRef(null),[O,A]=c5.useState(null),[H,C]=c5.useState(!1),[N,j]=c5.useState(!1),W=c5.useRef(X);c5.useEffect(()=>{W.current=X},[X]),c5.useEffect(()=>{if(D.current&&Y)D.current.load()},[Y]);let S=c5.useCallback((q0)=>{if(!Q.current)return 0;let Q0=Q.current.getBoundingClientRect();return Math.max(0,Math.min(q0-Q0.left,Q0.width))/Q0.width},[]),R=c5.useCallback((q0)=>{if(N)return;if(!Q.current)return;let Q0=Q.current.getBoundingClientRect(),r=Math.max(0,Math.min(q0.clientX-Q0.left,Q0.width))/Q0.width;if(A(r),C(!0),D.current&&h){let d=r*h,s=1/G,_0=d*s+s/2,Z0=D.current;if(Number.isFinite(_0))Z0.currentTime=_0}},[h,G,N]),v=()=>{if(!N)C(!1),A(null)},x=(q0)=>{if(q0.button!==0)return;q0.preventDefault(),j(!0);let Q0=S(q0.clientX);A(Q0),C(!0),W.current(Q0*h)},P=(q0)=>{j(!0);let Q0=S(q0.touches[0].clientX);A(Q0),C(!0),W.current(Q0*h)};c5.useEffect(()=>{if(!N)return;let q0=(d)=>{let s=S(d.clientX);if(A(s),C(!0),D.current&&h){let _0=s*h,Z0=1/G,X0=_0*Z0+Z0/2,E0=D.current;if(Number.isFinite(X0))E0.currentTime=X0}W.current(s*h)},Q0=(d)=>{j(!1);let s=!1;if(Q.current){let Z0=Q.current.getBoundingClientRect();s=d.clientX>=Z0.left&&d.clientX<=Z0.right&&d.clientY>=Z0.top&&d.clientY<=Z0.bottom}if(!s)C(!1),A(null);let _0=S(d.clientX);W.current(_0*h)},o=(d)=>{if(d.touches.length===0)return;let s=S(d.touches[0].clientX);if(A(s),C(!0),D.current&&h){let _0=s*h,Z0=1/G,X0=_0*Z0+Z0/2,E0=D.current;if(Number.isFinite(X0))E0.currentTime=X0}W.current(s*h)},r=(d)=>{j(!1);let s=d.changedTouches.length>0?d.changedTouches[0].clientX:null,_0=d.changedTouches.length>0?d.changedTouches[0].clientY:null,Z0=!1;if(s!==null&&_0!==null&&Q.current){let X0=Q.current.getBoundingClientRect();Z0=s>=X0.left&&s<=X0.right&&_0>=X0.top&&_0<=X0.bottom}if(!Z0)C(!1),A(null);if(s!==null){let X0=S(s);W.current(X0*h)}};return window.addEventListener("mousemove",q0),window.addEventListener("mouseup",Q0),window.addEventListener("touchmove",o,{passive:!0}),window.addEventListener("touchend",r),()=>{window.removeEventListener("mousemove",q0),window.removeEventListener("mouseup",Q0),window.removeEventListener("touchmove",o),window.removeEventListener("touchend",r)}},[N,h,G,S]);let I=N&&O!==null?O*100:h>0?_/h*100:0,b=O!==null?O*100:0,l=()=>{if(O===null)return{};return{left:`${b}%`,transform:`translateX(-${b}%)`}},i=180,h0={width:`${i}px`,height:"auto"};if(Z&&Z.originalWidth&&Z.originalHeight){let{originalWidth:q0,originalHeight:Q0}=Z;if(q0>=Q0){let o=i*Q0/q0;h0={width:`${i}px`,height:`${o}px`}}else h0={width:`${i*q0/Q0}px`,height:`${i}px`}}return O0("div",{ref:Q,className:"group relative h-1.5 w-full cursor-pointer touch-none rounded-full bg-muted transition-colors duration-200",onMouseMove:R,onMouseLeave:v,onMouseDown:x,onTouchStart:P,"data-testid":"seekbar",children:[f("video",{ref:D,src:Y,className:"hidden",preload:"auto",muted:!0,playsInline:!0}),H&&h>0&&f("div",{className:"pointer-events-none absolute bottom-full z-50 mb-3 flex w-max flex-col",style:l(),children:O0("div",{className:"relative overflow-hidden rounded-lg border-2 border-border bg-popover shadow-2xl",children:[f("video",{src:Y,className:"bg-black object-cover",style:h0,muted:!0,ref:(q0)=>{if(q0&&D.current)q0.currentTime=D.current.currentTime}}),f("div",{className:"absolute bottom-0 w-full bg-popover/80 py-0.5 text-center text-xs font-medium text-popover-foreground",children:Xb(O*h/G)})]})}),f("div",{className:"absolute top-0 left-0 h-full rounded-full bg-muted-foreground/30 transition-all duration-200",style:{width:`${K}%`}}),H&&f("div",{className:"absolute top-0 left-0 h-full rounded-full bg-primary/30",style:{width:`${b}%`}}),f("div",{className:"relative absolute top-0 left-0 h-full rounded-full bg-primary",style:{width:`${I}%`},"data-testid":"seekbar-fill",children:f("div",{className:D5("absolute top-1/2 right-0 h-3.5 w-3.5 -translate-y-1/2 translate-x-1/2 rounded-full border border-border bg-primary shadow-md transition-transform duration-100",H||N?"scale-100":"scale-0 group-hover:scale-100")})})]})},j$=Kb;var x$=({state:h,zoom:_,isControlsVisible:G,buffered:Y,data:X,resolutions:K,togglePlay:Z,toggleLoop:Q,toggleMute:D,handleVolumeChange:O,changePlaybackRate:A,changeResolution:H,handleDownload:C,toggleFullScreen:N,onZoomChange:j,onZoomReset:W,frameRate:S,totalFrames:R,currentFrame:v,seekToFrame:x,floatOverlayInFullScreen:P=!0,onMouseEnter:I,onMouseLeave:b})=>{let{videoTimeDisplayMode:l,setVideoTimeDisplayMode:i}=Xh();if(!X.media?.metadata)return null;let h0=h.isFullScreen&&P,q0=X.mediaType?.startsWith("audio/"),Q0=K.filter((s)=>!s.isRaw),o=X.media?.metadata?.startTimecode,r=Math.max(0,R-1),d=l==="frames"?`${v} / ${r} fr`:l==="standard"?`${z8(v,S,"standard")} / ${v$(R/S)}`:`${z8(v,S,l,o)} / ${z8(r,S,l,o)}`;return O0("div",{className:D5("transition-all duration-300 ease-in-out z-20 text-foreground",h0?"absolute bottom-0 left-0 right-0 px-4 py-4 bg-card/90 backdrop-blur-md border-t border-border":"relative w-full bg-card border-t border-border px-4 py-3 z-10 transition-colors duration-200",G?"opacity-100 translate-y-0":"opacity-0 translate-y-4 pointer-events-none"),onMouseEnter:I,onMouseLeave:b,children:[f("div",{className:"mb-4 px-1",children:f(j$,{totalFrames:R,currentFrame:v,fps:S,buffered:Y,previewUrl:X.media.videoPreview?.url,onSeek:x,metadata:{...X.media.metadata,frameRate:S}})}),O0("div",{className:"flex items-center justify-between text-foreground",children:[O0("div",{className:"flex items-center gap-4",children:[f("button",{onClick:Z,className:"hover:text-primary transition-colors","data-testid":"play-toggle","data-playing":h.isPlaying,"aria-label":h.isPlaying?"Pause":"Play",children:h.isPlaying?f(F$,{className:"w-6 h-6 fill-current"}):f(oh,{className:"w-6 h-6 fill-current"})}),f("button",{onClick:Q,className:D5("transition-colors",h.isLooping?"text-primary":"text-muted-foreground"),title:"Loop",children:f(T$,{className:"w-5 h-5"})}),O0("div",{className:"flex items-center gap-3 group/vol",children:[f("button",{onClick:D,className:"hover:text-primary",children:h.isMuted||h.volume===0?f(S$,{className:"w-6 h-6"}):f(R$,{className:"w-6 h-6"})}),f("div",{className:"w-0 overflow-hidden group-hover/vol:w-24 transition-all duration-300 ease-in-out",children:f("div",{className:"w-24 px-1",children:f(L$,{value:h.isMuted?[0]:[h.volume],onValueChange:(s)=>O(s[0]),max:1,step:0.05})})})]}),O0("div",{className:"flex items-center gap-1 text-sm font-medium tabular-nums select-none min-w-[100px]",children:[f("span",{className:"text-muted-foreground font-mono","data-testid":"time-readout",children:d}),O0(VY,{modal:!1,children:[f(UY,{asChild:!0,children:f("button",{className:"h-6 w-6 inline-flex items-center justify-center rounded-md hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer focus:outline-none",children:f(Kh,{className:"h-3.5 w-3.5"})})}),O0(EY,{align:"start",className:"w-40 z-30",children:[f(NJ,{className:"text-[10px] font-bold text-muted-foreground uppercase tracking-wider",children:"Format"}),O0(t7,{onClick:()=>i("standard"),className:"flex items-center justify-between cursor-pointer text-xs",children:[f("span",{children:"Standard Time"}),l==="standard"&&f(nh,{className:"h-3.5 w-3.5 text-primary"})]}),O0(t7,{onClick:()=>i("frames"),className:"flex items-center justify-between cursor-pointer text-xs",children:[f("span",{children:"Frames"}),l==="frames"&&f(nh,{className:"h-3.5 w-3.5 text-primary"})]}),O0(t7,{onClick:()=>i("timecode"),className:"flex items-center justify-between cursor-pointer text-xs",children:[f("span",{children:"Timecode"}),l==="timecode"&&f(nh,{className:"h-3.5 w-3.5 text-primary"})]})]})]})]})]}),O0("div",{className:"relative flex items-center gap-3",children:[!q0&&O0("div",{className:"flex items-center gap-1",children:[O0("div",{className:"flex items-center gap-1 rounded-md bg-muted p-0.5",children:[f("button",{onClick:()=>j(_*0.8),className:"p-1 hover:text-primary rounded",title:c0.zoom_out(),children:f(Jh,{size:14})}),O0("span",{className:"text-xs w-8 text-center tabular-nums",children:[Math.round(_*100),"%"]}),f("button",{onClick:()=>j(_*1.2),className:"p-1 hover:text-primary rounded",title:c0.zoom_in(),children:f(jJ,{size:14})})]}),f("button",{onClick:W,className:"text-xs font-medium px-2 py-1 rounded bg-muted hover:text-primary transition-colors",children:c0.fit()})]}),O0(VY,{children:[f(UY,{asChild:!0,children:O0("button",{className:"w-8 text-sm font-bold hover:text-primary",children:[h.playbackRate,"x"]})}),f(EY,{children:[0.5,1,1.5,2].map((s)=>O0(t7,{onClick:()=>A(s),className:D5("rounded py-1 px-2 text-left text-xs",h.playbackRate===s?"bg-primary text-primary-foreground focus:bg-primary focus:text-primary-foreground":"text-foreground"),children:[s,"x"]},s))})]}),!q0&&Q0.length>0&&O0(VY,{children:[f(UY,{asChild:!0,children:O0("button",{className:"flex items-center gap-1 rounded border border-border px-2 py-0.5 text-sm font-semibold hover:bg-muted transition-colors",children:[f(W$,{className:"h-3.5 w-3.5"}),f("span",{children:h.currentResolution==="Original"?c0.original():h.currentResolution})]})}),O0(EY,{children:[f(NJ,{children:c0.quality()}),Q0.map((s)=>O0(t7,{onClick:()=>H(s),className:D5("flex w-full items-center justify-between",h.currentResolution===s.resolution?"text-primary font-medium":"text-foreground"),children:[f("span",{children:s.resolution==="Original"?c0.original():s.resolution}),O0("span",{className:"pl-5 text-xs text-muted-foreground",children:[s.width,"x",s.height]})]},s.resolution))]})]}),q0?f("button",{onClick:()=>C(X.media?.original?.key||""),className:"transition-colors hover:text-primary",title:c0.download(),disabled:!X.media?.original?.key,children:f(A6,{className:"h-5 w-5"})}):O0(VY,{children:[f(UY,{asChild:!0,children:f("button",{className:"transition-colors hover:text-primary",title:c0.download(),children:f(A6,{className:"h-5 w-5"})})}),O0(EY,{children:[f(NJ,{children:c0.download()}),K.map((s)=>O0(t7,{onClick:()=>C(s.key??""),className:"flex w-full items-center justify-between px-3 py-2 text-left text-sm text-foreground",children:[f("span",{children:s.resolution==="Original"?c0.original():s.resolution}),f("span",{className:"text-xs text-muted-foreground",children:s.isRaw?X.name?.split(".").pop()?.toUpperCase()||"RAW":"MP4"})]},s.resolution))]})]}),f("button",{onClick:N,className:"transition-colors hover:text-primary",title:c0.fullscreen(),children:h.isFullScreen?f(LJ,{className:"h-6 w-6"}):f($J,{className:"h-6 w-6"})})]})]})]})};var Zb=Math.PI/180;function Jb(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}var S8=typeof global<"u"?global:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},$0={_global:S8,version:"10.3.0",isBrowser:Jb(),isUnminified:/param/.test(function(h){}.toString()),dblClickWindow:400,getAngle(h){return $0.angleDeg?h*Zb:h},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,_renderBackend:"web",legacyTextRendering:!1,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return $0.DD.isDragging},isTransforming(){var h,_;return(_=(h=$0.Transformer)===null||h===void 0?void 0:h.isTransforming())!==null&&_!==void 0?_:!1},isDragReady(){return!!$0.DD.node},releaseCanvasOnDestroy:!0,document:S8.document,_injectGlobal(h){if(typeof S8.Konva<"u")console.error("Several Konva instances detected. It is not recommended to use multiple Konva instances in the same environment.");S8.Konva=h}},q1=(h)=>{$0[h.prototype.getClassName()]=h};$0._injectGlobal($0);var qb=`Konva.js unsupported environment.
|
|
245
|
-
|
|
246
|
-
Looks like you are trying to use Konva.js in Node.js environment. because "document" object is undefined.
|
|
247
|
-
|
|
248
|
-
To use Konva.js in Node.js environment, you need to use the "canvas-backend" or "skia-backend" module.
|
|
249
|
-
|
|
250
|
-
bash: npm install canvas
|
|
251
|
-
js: import "konva/canvas-backend";
|
|
252
|
-
|
|
253
|
-
or
|
|
254
|
-
|
|
255
|
-
bash: npm install skia-canvas
|
|
256
|
-
js: import "konva/skia-backend";
|
|
257
|
-
`,w$=()=>{if(typeof document>"u")throw Error(qb)};class L5{constructor(h=[1,0,0,1,0,0]){this.dirty=!1,this.m=h&&h.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new L5(this.m)}copyInto(h){h.m[0]=this.m[0],h.m[1]=this.m[1],h.m[2]=this.m[2],h.m[3]=this.m[3],h.m[4]=this.m[4],h.m[5]=this.m[5]}point(h){let _=this.m;return{x:_[0]*h.x+_[2]*h.y+_[4],y:_[1]*h.x+_[3]*h.y+_[5]}}translate(h,_){return this.m[4]+=this.m[0]*h+this.m[2]*_,this.m[5]+=this.m[1]*h+this.m[3]*_,this}scale(h,_){return this.m[0]*=h,this.m[1]*=h,this.m[2]*=_,this.m[3]*=_,this}rotate(h){let _=Math.cos(h),G=Math.sin(h),Y=this.m[0]*_+this.m[2]*G,X=this.m[1]*_+this.m[3]*G,K=this.m[0]*-G+this.m[2]*_,Z=this.m[1]*-G+this.m[3]*_;return this.m[0]=Y,this.m[1]=X,this.m[2]=K,this.m[3]=Z,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(h,_){let G=this.m[0]+this.m[2]*_,Y=this.m[1]+this.m[3]*_,X=this.m[2]+this.m[0]*h,K=this.m[3]+this.m[1]*h;return this.m[0]=G,this.m[1]=Y,this.m[2]=X,this.m[3]=K,this}multiply(h){let _=this.m[0]*h.m[0]+this.m[2]*h.m[1],G=this.m[1]*h.m[0]+this.m[3]*h.m[1],Y=this.m[0]*h.m[2]+this.m[2]*h.m[3],X=this.m[1]*h.m[2]+this.m[3]*h.m[3],K=this.m[0]*h.m[4]+this.m[2]*h.m[5]+this.m[4],Z=this.m[1]*h.m[4]+this.m[3]*h.m[5]+this.m[5];return this.m[0]=_,this.m[1]=G,this.m[2]=Y,this.m[3]=X,this.m[4]=K,this.m[5]=Z,this}invert(){let h=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),_=this.m[3]*h,G=-this.m[1]*h,Y=-this.m[2]*h,X=this.m[0]*h,K=h*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),Z=h*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=_,this.m[1]=G,this.m[2]=Y,this.m[3]=X,this.m[4]=K,this.m[5]=Z,this}getMatrix(){return this.m}decompose(){let h=this.m[0],_=this.m[1],G=this.m[2],Y=this.m[3],X=this.m[4],K=this.m[5],Z=h*Y-_*G,Q={x:X,y:K,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(h!=0||_!=0){let D=Math.sqrt(h*h+_*_);Q.rotation=_>0?Math.acos(h/D):-Math.acos(h/D),Q.scaleX=D,Q.scaleY=Z/D,Q.skewX=(h*G+_*Y)/Z,Q.skewY=0}else if(G!=0||Y!=0){let D=Math.sqrt(G*G+Y*Y);Q.rotation=Math.PI/2-(Y>0?Math.acos(-G/D):-Math.acos(G/D)),Q.scaleX=Z/D,Q.scaleY=D,Q.skewX=0,Q.skewY=(h*G+_*Y)/Z}return Q.rotation=n._getRotation(Q.rotation),Q}}var Qb="[object Array]",Db="[object Number]",Mb="[object String]",Bb="[object Boolean]",Ob=Math.PI/180,Ab=180/Math.PI,CY="#",zb="",Hb="0",Vb="Konva warning: ",g$="Konva error: ",Ub="rgb(",wB={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},Eb=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,FJ=[],NY=null,Cb=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(h){setTimeout(h,16)},n={_isElement(h){return!!(h&&h.nodeType==1)},_isFunction(h){return!!(h&&h.constructor&&h.call&&h.apply)},_isPlainObject(h){return!!h&&h.constructor===Object},_isArray(h){return Object.prototype.toString.call(h)===Qb},_isNumber(h){return Object.prototype.toString.call(h)===Db&&!isNaN(h)&&isFinite(h)},_isString(h){return Object.prototype.toString.call(h)===Mb},_isBoolean(h){return Object.prototype.toString.call(h)===Bb},isObject(h){return h instanceof Object},isValidSelector(h){if(typeof h!=="string")return!1;let _=h[0];return _==="#"||_==="."||_===_.toUpperCase()},_sign(h){if(h===0)return 1;if(h>0)return 1;else return-1},requestAnimFrame(h){if(FJ.push(h),FJ.length===1)Cb(function(){let _=FJ;FJ=[],_.forEach(function(G){G()})})},createCanvasElement(){w$();let h=document.createElement("canvas");try{h.style=h.style||{}}catch(_){}return h},createImageElement(){return w$(),document.createElement("img")},_isInDocument(h){while(h=h.parentNode)if(h==document)return!0;return!1},_urlToImage(h,_){let G=n.createImageElement();G.onload=function(){_(G)},G.src=h},_rgbToHex(h,_,G){return(16777216+(h<<16)+(_<<8)+G).toString(16).slice(1)},_hexToRgb(h){h=h.replace(CY,zb);let _=parseInt(h,16);return{r:_>>16&255,g:_>>8&255,b:_&255}},getRandomColor(){let h=(Math.random()*16777215<<0).toString(16);while(h.length<6)h=Hb+h;return CY+h},isCanvasFarblingActive(){if(NY!==null)return NY;if(typeof document>"u")return NY=!1,!1;let h=this.createCanvasElement();h.width=10,h.height=10;let _=h.getContext("2d",{willReadFrequently:!0});_.clearRect(0,0,10,10),_.fillStyle="#282828",_.fillRect(0,0,10,10);let G=_.getImageData(0,0,10,10).data,Y=!1;for(let X=0;X<100;X++)if(G[X*4]!==40||G[X*4+1]!==40||G[X*4+2]!==40||G[X*4+3]!==255){Y=!0;break}return NY=Y,this.releaseCanvas(h),NY},getHitColor(){let h=this.getRandomColor();return this.isCanvasFarblingActive()?this.getSnappedHexColor(h):h},getHitColorKey(h,_,G){if(this.isCanvasFarblingActive())h=Math.round(h/5)*5,_=Math.round(_/5)*5,G=Math.round(G/5)*5;return CY+this._rgbToHex(h,_,G)},getSnappedHexColor(h){let _=this._hexToRgb(h);return CY+this._rgbToHex(Math.round(_.r/5)*5,Math.round(_.g/5)*5,Math.round(_.b/5)*5)},getRGB(h){let _;if(h in wB)return _=wB[h],{r:_[0],g:_[1],b:_[2]};else if(h[0]===CY)return this._hexToRgb(h.substring(1));else if(h.substr(0,4)===Ub)return _=Eb.exec(h.replace(/ /g,"")),{r:parseInt(_[1],10),g:parseInt(_[2],10),b:parseInt(_[3],10)};else return{r:0,g:0,b:0}},colorToRGBA(h){return h=h||"black",n._namedColorToRBA(h)||n._hex3ColorToRGBA(h)||n._hex4ColorToRGBA(h)||n._hex6ColorToRGBA(h)||n._hex8ColorToRGBA(h)||n._rgbColorToRGBA(h)||n._rgbaColorToRGBA(h)||n._hslColorToRGBA(h)},_namedColorToRBA(h){let _=wB[h.toLowerCase()];if(!_)return null;return{r:_[0],g:_[1],b:_[2],a:1}},_rgbColorToRGBA(h){if(h.indexOf("rgb(")===0){h=h.match(/rgb\(([^)]+)\)/)[1];let _=h.split(/ *, */).map(Number);return{r:_[0],g:_[1],b:_[2],a:1}}},_rgbaColorToRGBA(h){if(h.indexOf("rgba(")===0){h=h.match(/rgba\(([^)]+)\)/)[1];let _=h.split(/ *, */).map((G,Y)=>{if(G.slice(-1)==="%")return Y===3?parseInt(G)/100:parseInt(G)/100*255;return Number(G)});return{r:_[0],g:_[1],b:_[2],a:_[3]}}},_hex8ColorToRGBA(h){if(h[0]==="#"&&h.length===9)return{r:parseInt(h.slice(1,3),16),g:parseInt(h.slice(3,5),16),b:parseInt(h.slice(5,7),16),a:parseInt(h.slice(7,9),16)/255}},_hex6ColorToRGBA(h){if(h[0]==="#"&&h.length===7)return{r:parseInt(h.slice(1,3),16),g:parseInt(h.slice(3,5),16),b:parseInt(h.slice(5,7),16),a:1}},_hex4ColorToRGBA(h){if(h[0]==="#"&&h.length===5)return{r:parseInt(h[1]+h[1],16),g:parseInt(h[2]+h[2],16),b:parseInt(h[3]+h[3],16),a:parseInt(h[4]+h[4],16)/255}},_hex3ColorToRGBA(h){if(h[0]==="#"&&h.length===4)return{r:parseInt(h[1]+h[1],16),g:parseInt(h[2]+h[2],16),b:parseInt(h[3]+h[3],16),a:1}},_hslColorToRGBA(h){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(h)){let[_,...G]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(h),Y=Number(G[0])/360,X=Number(G[1])/100,K=Number(G[2])/100,Z,Q,D;if(X===0)return D=K*255,{r:Math.round(D),g:Math.round(D),b:Math.round(D),a:1};if(K<0.5)Z=K*(1+X);else Z=K+X-K*X;let O=2*K-Z,A=[0,0,0];for(let H=0;H<3;H++){if(Q=Y+0.3333333333333333*-(H-1),Q<0)Q++;if(Q>1)Q--;if(6*Q<1)D=O+(Z-O)*6*Q;else if(2*Q<1)D=Z;else if(3*Q<2)D=O+(Z-O)*(0.6666666666666666-Q)*6;else D=O;A[H]=D*255}return{r:Math.round(A[0]),g:Math.round(A[1]),b:Math.round(A[2]),a:1}}},haveIntersection(h,_){return!(_.x>h.x+h.width||_.x+_.width<h.x||_.y>h.y+h.height||_.y+_.height<h.y)},cloneObject(h){let _={};for(let G in h)if(this._isPlainObject(h[G]))_[G]=this.cloneObject(h[G]);else if(this._isArray(h[G]))_[G]=this.cloneArray(h[G]);else _[G]=h[G];return _},cloneArray(h){return h.slice(0)},degToRad(h){return h*Ob},radToDeg(h){return h*Ab},_degToRad(h){return n.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),n.degToRad(h)},_radToDeg(h){return n.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),n.radToDeg(h)},_getRotation(h){return $0.angleDeg?n.radToDeg(h):h},_capitalize(h){return h.charAt(0).toUpperCase()+h.slice(1)},throw(h){throw Error(g$+h)},error(h){console.error(g$+h)},warn(h){if(!$0.showWarnings)return;console.warn(Vb+h)},each(h,_){for(let G in h)_(G,h[G])},_inRange(h,_,G){return _<=h&&h<G},_getProjectionToSegment(h,_,G,Y,X,K){let Z,Q,D,O=(h-G)*(h-G)+(_-Y)*(_-Y);if(O==0)Z=h,Q=_,D=(X-G)*(X-G)+(K-Y)*(K-Y);else{let A=((X-h)*(G-h)+(K-_)*(Y-_))/O;if(A<0)Z=h,Q=_,D=(h-X)*(h-X)+(_-K)*(_-K);else if(A>1)Z=G,Q=Y,D=(G-X)*(G-X)+(Y-K)*(Y-K);else Z=h+A*(G-h),Q=_+A*(Y-_),D=(Z-X)*(Z-X)+(Q-K)*(Q-K)}return[Z,Q,D]},_getProjectionToLine(h,_,G){let Y=n.cloneObject(h),X=Number.MAX_VALUE;return _.forEach(function(K,Z){if(!G&&Z===_.length-1)return;let Q=_[(Z+1)%_.length],D=n._getProjectionToSegment(K.x,K.y,Q.x,Q.y,h.x,h.y),O=D[0],A=D[1],H=D[2];if(H<X)Y.x=O,Y.y=A,X=H}),Y},_prepareArrayForTween(h,_,G){let Y=[],X=[];if(h.length>_.length){let Z=_;_=h,h=Z}for(let Z=0;Z<h.length;Z+=2)Y.push({x:h[Z],y:h[Z+1]});for(let Z=0;Z<_.length;Z+=2)X.push({x:_[Z],y:_[Z+1]});let K=[];return X.forEach(function(Z){let Q=n._getProjectionToLine(Z,Y,G);K.push(Q.x),K.push(Q.y)}),K},_prepareToStringify(h){let _;h.visitedByCircularReferenceRemoval=!0;for(let G in h){if(!(h.hasOwnProperty(G)&&h[G]&&typeof h[G]=="object"))continue;if(_=Object.getOwnPropertyDescriptor(h,G),h[G].visitedByCircularReferenceRemoval||n._isElement(h[G]))if(_.configurable)delete h[G];else return null;else if(n._prepareToStringify(h[G])===null)if(_.configurable)delete h[G];else return null}return delete h.visitedByCircularReferenceRemoval,h},_assign(h,_){for(let G in _)h[G]=_[G];return h},_getFirstPointerId(h){if(!h.touches)return h.pointerId||999;else return h.changedTouches[0].identifier},releaseCanvas(...h){if(!$0.releaseCanvasOnDestroy)return;h.forEach((_)=>{_.width=0,_.height=0})},drawRoundedRectPath(h,_,G,Y){let X=_<0?_:0,K=G<0?G:0;_=Math.abs(_),G=Math.abs(G);let Z=0,Q=0,D=0,O=0;if(typeof Y==="number")Z=Q=D=O=Math.min(Y,_/2,G/2);else Z=Math.min(Y[0]||0,_/2,G/2),Q=Math.min(Y[1]||0,_/2,G/2),O=Math.min(Y[2]||0,_/2,G/2),D=Math.min(Y[3]||0,_/2,G/2);h.moveTo(X+Z,K),h.lineTo(X+_-Q,K),h.arc(X+_-Q,K+Q,Q,Math.PI*3/2,0,!1),h.lineTo(X+_,K+G-O),h.arc(X+_-O,K+G-O,O,0,Math.PI/2,!1),h.lineTo(X+D,K+G),h.arc(X+D,K+G-D,D,Math.PI/2,Math.PI,!1),h.lineTo(X,K+Z),h.arc(X+Z,K+Z,Z,Math.PI,Math.PI*3/2,!1)},drawRoundedPolygonPath(h,_,G,Y,X){Y=Math.abs(Y);for(let K=0;K<G;K++){let Z=_[(K-1+G)%G],Q=_[K],D=_[(K+1)%G],O={x:Q.x-Z.x,y:Q.y-Z.y},A={x:D.x-Q.x,y:D.y-Q.y},H=Math.hypot(O.x,O.y),C=Math.hypot(A.x,A.y),N;if(typeof X==="number")N=X;else N=K<X.length?X[K]:0;N=Y*Math.cos(Math.PI/G)*Math.min(1,N/Y*2);let W={x:O.x/H,y:O.y/H},S={x:A.x/C,y:A.y/C},R={x:Q.x-W.x*N,y:Q.y-W.y*N},v={x:Q.x+S.x*N,y:Q.y+S.y*N};if(K===0)h.moveTo(R.x,R.y);else h.lineTo(R.x,R.y);h.arcTo(Q.x,Q.y,v.x,v.y,N)}}};function Nb(h){let _=[],G=h.length,Y=n;for(let X=0;X<G;X++){let K=h[X];if(Y._isNumber(K))K=Math.round(K*1000)/1000;else if(!Y._isString(K))K=K+"";_.push(K)}return _}var I$=",",$b="(",Lb=")",jb="([",Fb="])",Tb=";",Wb="()",Rb="=",P$=["arc","arcTo","beginPath","bezierCurveTo","clearRect","clip","closePath","createLinearGradient","createPattern","createRadialGradient","drawImage","ellipse","fill","fillText","getImageData","createImageData","lineTo","moveTo","putImageData","quadraticCurveTo","rect","roundRect","restore","rotate","save","scale","setLineDash","setTransform","stroke","strokeText","transform","translate"],Sb=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled","filter"],vb=100,TJ=null;function gB(){if(TJ!==null)return TJ;try{let _=n.createCanvasElement().getContext("2d");if(!_)return TJ=!1,!1;return!!_&&"filter"in _}catch(h){return TJ=!1,!1}}class rh{constructor(h){if(this.canvas=h,$0.enableTrace)this.traceArr=[],this._enableTrace()}fillShape(h){if(h.fillEnabled())this._fill(h)}_fill(h){}strokeShape(h){if(h.hasStroke())this._stroke(h)}_stroke(h){}fillStrokeShape(h){if(h.attrs.fillAfterStrokeEnabled)this.strokeShape(h),this.fillShape(h);else this.fillShape(h),this.strokeShape(h)}getTrace(h,_){let G=this.traceArr,Y=G.length,X="",K,Z,Q,D;for(K=0;K<Y;K++){if(Z=G[K],Q=Z.method,Q)if(D=Z.args,X+=Q,h)X+=Wb;else if(n._isArray(D[0]))X+=jb+D.join(I$)+Fb;else{if(_)D=D.map((O)=>typeof O==="number"?Math.floor(O):O);X+=$b+D.join(I$)+Lb}else if(X+=Z.property,!h)X+=Rb+Z.val;X+=Tb}return X}clearTrace(){this.traceArr=[]}_trace(h){let _=this.traceArr,G;if(_.push(h),G=_.length,G>=vb)_.shift()}reset(){let h=this.getCanvas().getPixelRatio();this.setTransform(1*h,0,0,1*h,0,0)}getCanvas(){return this.canvas}clear(h){let _=this.getCanvas();if(h)this.clearRect(h.x||0,h.y||0,h.width||0,h.height||0);else this.clearRect(0,0,_.getWidth()/_.pixelRatio,_.getHeight()/_.pixelRatio)}_applyLineCap(h){let _=h.attrs.lineCap;if(_)this.setAttr("lineCap",_)}_applyOpacity(h){let _=h.getAbsoluteOpacity();if(_!==1)this.setAttr("globalAlpha",_)}_applyLineJoin(h){let _=h.attrs.lineJoin;if(_)this.setAttr("lineJoin",_)}_applyMiterLimit(h){let _=h.attrs.miterLimit;if(_!=null)this.setAttr("miterLimit",_)}setAttr(h,_){this._context[h]=_}arc(h,_,G,Y,X,K){this._context.arc(h,_,G,Y,X,K)}arcTo(h,_,G,Y,X){this._context.arcTo(h,_,G,Y,X)}beginPath(){this._context.beginPath()}bezierCurveTo(h,_,G,Y,X,K){this._context.bezierCurveTo(h,_,G,Y,X,K)}clearRect(h,_,G,Y){this._context.clearRect(h,_,G,Y)}clip(...h){this._context.clip.apply(this._context,h)}closePath(){this._context.closePath()}createImageData(h,_){let G=arguments;if(G.length===2)return this._context.createImageData(h,_);else if(G.length===1)return this._context.createImageData(h)}createLinearGradient(h,_,G,Y){return this._context.createLinearGradient(h,_,G,Y)}createPattern(h,_){return this._context.createPattern(h,_)}createRadialGradient(h,_,G,Y,X,K){return this._context.createRadialGradient(h,_,G,Y,X,K)}drawImage(h,_,G,Y,X,K,Z,Q,D){let O=arguments,A=this._context;if(O.length===3)A.drawImage(h,_,G);else if(O.length===5)A.drawImage(h,_,G,Y,X);else if(O.length===9)A.drawImage(h,_,G,Y,X,K,Z,Q,D)}ellipse(h,_,G,Y,X,K,Z,Q){this._context.ellipse(h,_,G,Y,X,K,Z,Q)}isPointInPath(h,_,G,Y){if(G)return this._context.isPointInPath(G,h,_,Y);return this._context.isPointInPath(h,_,Y)}fill(...h){this._context.fill.apply(this._context,h)}fillRect(h,_,G,Y){this._context.fillRect(h,_,G,Y)}strokeRect(h,_,G,Y){this._context.strokeRect(h,_,G,Y)}fillText(h,_,G,Y){if(Y)this._context.fillText(h,_,G,Y);else this._context.fillText(h,_,G)}measureText(h){return this._context.measureText(h)}getImageData(h,_,G,Y){return this._context.getImageData(h,_,G,Y)}lineTo(h,_){this._context.lineTo(h,_)}moveTo(h,_){this._context.moveTo(h,_)}rect(h,_,G,Y){this._context.rect(h,_,G,Y)}roundRect(h,_,G,Y,X){this._context.roundRect(h,_,G,Y,X)}putImageData(h,_,G){this._context.putImageData(h,_,G)}quadraticCurveTo(h,_,G,Y){this._context.quadraticCurveTo(h,_,G,Y)}restore(){this._context.restore()}rotate(h){this._context.rotate(h)}save(){this._context.save()}scale(h,_){this._context.scale(h,_)}setLineDash(h){if(this._context.setLineDash)this._context.setLineDash(h);else if("mozDash"in this._context)this._context.mozDash=h;else if("webkitLineDash"in this._context)this._context.webkitLineDash=h}getLineDash(){return this._context.getLineDash()}setTransform(h,_,G,Y,X,K){this._context.setTransform(h,_,G,Y,X,K)}stroke(h){if(h)this._context.stroke(h);else this._context.stroke()}strokeText(h,_,G,Y){this._context.strokeText(h,_,G,Y)}transform(h,_,G,Y,X,K){this._context.transform(h,_,G,Y,X,K)}translate(h,_){this._context.translate(h,_)}_enableTrace(){let h=this,_=P$.length,G=this.setAttr,Y,X,K=function(Z){let Q=h[Z],D;h[Z]=function(){return X=Nb(Array.prototype.slice.call(arguments,0)),D=Q.apply(h,arguments),h._trace({method:Z,args:X}),D}};for(Y=0;Y<_;Y++)K(P$[Y]);h.setAttr=function(){G.apply(h,arguments);let Z=arguments[0],Q=arguments[1];if(Z==="shadowOffsetX"||Z==="shadowOffsetY"||Z==="shadowBlur")Q=Q/this.canvas.getPixelRatio();h._trace({property:Z,val:Q})}}_applyGlobalCompositeOperation(h){let _=h.attrs.globalCompositeOperation;if(!(!_||_==="source-over"))this.setAttr("globalCompositeOperation",_)}}Sb.forEach(function(h){Object.defineProperty(rh.prototype,h,{get(){return this._context[h]},set(_){this._context[h]=_}})});class IB extends rh{constructor(h,{willReadFrequently:_=!1}={}){super(h);this._context=h._canvas.getContext("2d",{willReadFrequently:_})}_fillColor(h){let _=h.fill();this.setAttr("fillStyle",_),h._fillFunc(this)}_fillPattern(h){this.setAttr("fillStyle",h._getFillPattern()),h._fillFunc(this)}_fillLinearGradient(h){let _=h._getLinearGradient();if(_)this.setAttr("fillStyle",_),h._fillFunc(this)}_fillRadialGradient(h){let _=h._getRadialGradient();if(_)this.setAttr("fillStyle",_),h._fillFunc(this)}_fill(h){let _=h.fill(),G=h.getFillPriority();if(_&&G==="color"){this._fillColor(h);return}let Y=h.getFillPatternImage();if(Y&&G==="pattern"){this._fillPattern(h);return}let X=h.getFillLinearGradientColorStops();if(X&&G==="linear-gradient"){this._fillLinearGradient(h);return}let K=h.getFillRadialGradientColorStops();if(K&&G==="radial-gradient"){this._fillRadialGradient(h);return}if(_)this._fillColor(h);else if(Y)this._fillPattern(h);else if(X)this._fillLinearGradient(h);else if(K)this._fillRadialGradient(h)}_strokeLinearGradient(h){let _=h.getStrokeLinearGradientStartPoint(),G=h.getStrokeLinearGradientEndPoint(),Y=h.getStrokeLinearGradientColorStops(),X=this.createLinearGradient(_.x,_.y,G.x,G.y);if(Y){for(let K=0;K<Y.length;K+=2)X.addColorStop(Y[K],Y[K+1]);this.setAttr("strokeStyle",X)}}_stroke(h){let _=h.dash(),G=h.getStrokeScaleEnabled();if(h.hasStroke()){if(!G){this.save();let X=this.getCanvas().getPixelRatio();this.setTransform(X,0,0,X,0,0)}if(this._applyLineCap(h),_&&h.dashEnabled())this.setLineDash(_),this.setAttr("lineDashOffset",h.dashOffset());if(this.setAttr("lineWidth",h.strokeWidth()),!h.getShadowForStrokeEnabled())this.setAttr("shadowColor","rgba(0,0,0,0)");if(h.getStrokeLinearGradientColorStops())this._strokeLinearGradient(h);else this.setAttr("strokeStyle",h.stroke());if(h._strokeFunc(this),!G)this.restore()}}_applyShadow(h){var _,G,Y;let X=(_=h.getShadowRGBA())!==null&&_!==void 0?_:"black",K=(G=h.getShadowBlur())!==null&&G!==void 0?G:5,Z=(Y=h.getShadowOffset())!==null&&Y!==void 0?Y:{x:0,y:0},Q=h.getAbsoluteScale(),D=this.canvas.getPixelRatio(),O=Q.x*D,A=Q.y*D;this.setAttr("shadowColor",X),this.setAttr("shadowBlur",K*Math.min(Math.abs(O),Math.abs(A))),this.setAttr("shadowOffsetX",Z.x*O),this.setAttr("shadowOffsetY",Z.y*A)}}class PB extends rh{constructor(h){super(h);this._context=h._canvas.getContext("2d",{willReadFrequently:!0})}_fill(h){this.save(),this.setAttr("fillStyle",h.colorKey),h._fillFuncHit(this),this.restore()}strokeShape(h){if(h.hasHitStroke())this._stroke(h)}_stroke(h){if(h.hasHitStroke()){let _=h.getStrokeScaleEnabled();if(!_){this.save();let X=this.getCanvas().getPixelRatio();this.setTransform(X,0,0,X,0,0)}this._applyLineCap(h);let G=h.hitStrokeWidth(),Y=G==="auto"?h.strokeWidth():G;if(this.setAttr("lineWidth",Y),this.setAttr("strokeStyle",h.colorKey),h._strokeFuncHit(this),!_)this.restore()}}}var WJ;function xb(){if(WJ)return WJ;let h=n.createCanvasElement(),_=h.getContext("2d");return WJ=function(){let G=$0._global.devicePixelRatio||1,Y=_.webkitBackingStorePixelRatio||_.mozBackingStorePixelRatio||_.msBackingStorePixelRatio||_.oBackingStorePixelRatio||_.backingStorePixelRatio||1;return G/Y}(),n.releaseCanvas(h),WJ}class $Y{constructor(h){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;let G=(h||{}).pixelRatio||$0.pixelRatio||xb();this.pixelRatio=G,this._canvas=n.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(h){let _=this.pixelRatio;this.pixelRatio=h,this.setSize(this.getWidth()/_,this.getHeight()/_)}setWidth(h){this.width=this._canvas.width=h*this.pixelRatio,this._canvas.style.width=h+"px";let _=this.pixelRatio;this.getContext()._context.scale(_,_)}setHeight(h){this.height=this._canvas.height=h*this.pixelRatio,this._canvas.style.height=h+"px";let _=this.pixelRatio;this.getContext()._context.scale(_,_)}getWidth(){return this.width}getHeight(){return this.height}setSize(h,_){this.setWidth(h||0),this.setHeight(_||0)}toDataURL(h,_){try{return this._canvas.toDataURL(h,_)}catch(G){try{return this._canvas.toDataURL()}catch(Y){return n.error("Unable to get data URL. "+Y.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}class t4 extends $Y{constructor(h={width:0,height:0,willReadFrequently:!1}){super(h);this.context=new IB(this,{willReadFrequently:h.willReadFrequently}),this.setSize(h.width,h.height)}}class s7 extends $Y{constructor(h={width:0,height:0}){super(h);this.hitCanvas=!0,this.context=new PB(this),this.setSize(h.width,h.height)}}var W1={get isDragging(){let h=!1;return W1._dragElements.forEach((_)=>{if(_.dragStatus==="dragging")h=!0}),h},justDragged:!1,get node(){let h;return W1._dragElements.forEach((_)=>{h=_.node}),h},_dragElements:new Map,_drag(h){let _=[];W1._dragElements.forEach((G,Y)=>{let{node:X}=G,K=X.getStage();if(K.setPointersPositions(h),G.pointerId===void 0)G.pointerId=n._getFirstPointerId(h);let Z=K._changedPointerPositions.find((Q)=>Q.id===G.pointerId);if(!Z)return;if(G.dragStatus!=="dragging"){let Q=X.dragDistance();if(Math.max(Math.abs(Z.x-G.startPointerPos.x),Math.abs(Z.y-G.startPointerPos.y))<Q)return;if(X.startDrag({evt:h}),!X.isDragging())return}X._setDragPosition(h,G),_.push(X)}),_.forEach((G)=>{if(!G.getStage())return;G.fire("dragmove",{type:"dragmove",target:G,evt:h},!0)})},_endDragBefore(h){let _=[];W1._dragElements.forEach((G)=>{let{node:Y}=G,X=Y.getStage();if(h)X.setPointersPositions(h);if(!X._changedPointerPositions.find((Q)=>Q.id===G.pointerId))return;if(G.dragStatus==="dragging"||G.dragStatus==="stopped")W1.justDragged=!0,$0._mouseListenClick=!1,$0._touchListenClick=!1,$0._pointerListenClick=!1,G.dragStatus="stopped";let Z=G.node.getLayer()||G.node instanceof $0.Stage&&G.node;if(Z&&_.indexOf(Z)===-1)_.push(Z)}),_.forEach((G)=>{G.draw()})},_endDragAfter(h){W1._dragElements.forEach((_,G)=>{if(_.dragStatus==="stopped")_.node.fire("dragend",{type:"dragend",target:_.node,evt:h},!0);if(_.dragStatus!=="dragging")W1._dragElements.delete(G)})}};if($0.isBrowser)window.addEventListener("mouseup",W1._endDragBefore,!0),window.addEventListener("touchend",W1._endDragBefore,!0),window.addEventListener("touchcancel",W1._endDragBefore,!0),window.addEventListener("mousemove",W1._drag),window.addEventListener("touchmove",W1._drag),window.addEventListener("mouseup",W1._endDragAfter,!1),window.addEventListener("touchend",W1._endDragAfter,!1),window.addEventListener("touchcancel",W1._endDragAfter,!1);function v8(h){if(n._isString(h))return'"'+h+'"';if(Object.prototype.toString.call(h)==="[object Number]")return h;if(n._isBoolean(h))return h;return Object.prototype.toString.call(h)}function RJ(h){if(h>255)return 255;else if(h<0)return 0;return Math.round(h)}function V0(){if($0.isUnminified)return function(h,_){if(!n._isNumber(h))n.warn(v8(h)+' is a not valid value for "'+_+'" attribute. The value should be a number.');return h}}function x8(h){if($0.isUnminified)return function(_,G){let Y=n._isNumber(_),X=n._isArray(_)&&_.length==h;if(!Y&&!X)n.warn(v8(_)+' is a not valid value for "'+G+'" attribute. The value should be a number or Array<number>('+h+")");return _}}function LY(){if($0.isUnminified)return function(h,_){if(!(n._isNumber(h)||h==="auto"))n.warn(v8(h)+' is a not valid value for "'+_+'" attribute. The value should be a number or "auto".');return h}}function m3(){if($0.isUnminified)return function(h,_){if(!n._isString(h))n.warn(v8(h)+' is a not valid value for "'+_+'" attribute. The value should be a string.');return h}}function yB(){if($0.isUnminified)return function(h,_){let G=n._isString(h),Y=Object.prototype.toString.call(h)==="[object CanvasGradient]"||h&&h.addColorStop;if(!(G||Y))n.warn(v8(h)+' is a not valid value for "'+_+'" attribute. The value should be a string or a native gradient.');return h}}function y$(){if($0.isUnminified)return function(h,_){let G=Int8Array?Object.getPrototypeOf(Int8Array):null;if(G&&h instanceof G)return h;if(!n._isArray(h))n.warn(v8(h)+' is a not valid value for "'+_+'" attribute. The value should be a array of numbers.');else h.forEach(function(Y){if(!n._isNumber(Y))n.warn('"'+_+'" attribute has non numeric element '+Y+". Make sure that all elements are numbers.")});return h}}function j5(){if($0.isUnminified)return function(h,_){if(!(h===!0||h===!1))n.warn(v8(h)+' is a not valid value for "'+_+'" attribute. The value should be a boolean.');return h}}function b$(h){if($0.isUnminified)return function(_,G){if(_===void 0||_===null)return _;if(!n.isObject(_))n.warn(v8(_)+' is a not valid value for "'+G+'" attribute. The value should be an object with properties '+h);return _}}var jY="get",FY="set",u={addGetterSetter(h,_,G,Y,X){u.addGetter(h,_,G),u.addSetter(h,_,Y,X),u.addOverloadedGetterSetter(h,_)},addGetter(h,_,G){let Y=jY+n._capitalize(_);h.prototype[Y]=h.prototype[Y]||function(){let X=this.attrs[_];return X===void 0?G:X}},addSetter(h,_,G,Y){let X=FY+n._capitalize(_);if(!h.prototype[X])u.overWriteSetter(h,_,G,Y)},overWriteSetter(h,_,G,Y){let X=FY+n._capitalize(_);h.prototype[X]=function(K){if(G&&K!==void 0&&K!==null)K=G.call(this,K,_);if(this._setAttr(_,K),Y)Y.call(this);return this}},addComponentsGetterSetter(h,_,G,Y,X){let K=G.length,Z=n._capitalize,Q=jY+Z(_),D=FY+Z(_);h.prototype[Q]=function(){let A={};for(let H=0;H<K;H++){let C=G[H];A[C]=this.getAttr(_+Z(C))}return A};let O=b$(G);h.prototype[D]=function(A){let H=this.attrs[_];if(Y)A=Y.call(this,A,_);if(O)O.call(this,A,_);for(let C in A){if(!A.hasOwnProperty(C))continue;this._setAttr(_+Z(C),A[C])}if(!A)G.forEach((C)=>{this._setAttr(_+Z(C),void 0)});if(this._fireChangeEvent(_,H,A),X)X.call(this);return this},u.addOverloadedGetterSetter(h,_)},addOverloadedGetterSetter(h,_){let G=n._capitalize(_),Y=FY+G,X=jY+G;h.prototype[_]=function(){if(arguments.length)return this[Y](arguments[0]),this;return this[X]()}},addDeprecatedGetterSetter(h,_,G,Y){n.error("Adding deprecated "+_);let X=jY+n._capitalize(_),K=_+" property is deprecated and will be removed soon. Look at Konva change log for more information.";h.prototype[X]=function(){n.error(K);let Z=this.attrs[_];return Z===void 0?G:Z},u.addSetter(h,_,Y,function(){n.error(K)}),u.addOverloadedGetterSetter(h,_)},backCompat(h,_){n.each(_,function(G,Y){let X=h.prototype[Y],K=jY+n._capitalize(G),Z=FY+n._capitalize(G);function Q(){X.apply(this,arguments),n.error('"'+G+'" method is deprecated and will be removed soon. Use ""'+Y+'" instead.')}h.prototype[G]=Q,h.prototype[K]=Q,h.prototype[Z]=Q})},afterSetFilter(){this._filterUpToDate=!1}};function wb(h){let _=/(\w+)\(([^)]+)\)/g,G;while((G=_.exec(h))!==null){let[,Y,X]=G;switch(Y){case"blur":{let K=parseFloat(X.replace("px",""));return function(Z){this.blurRadius(K*0.5);let Q=$0.Filters;if(Q&&Q.Blur)Q.Blur.call(this,Z)}}case"brightness":{let K=X.includes("%")?parseFloat(X)/100:parseFloat(X);return function(Z){this.brightness(K);let Q=$0.Filters;if(Q&&Q.Brightness)Q.Brightness.call(this,Z)}}case"contrast":{let K=parseFloat(X);return function(Z){let Q=100*(Math.sqrt(K)-1);this.contrast(Q);let D=$0.Filters;if(D&&D.Contrast)D.Contrast.call(this,Z)}}case"grayscale":return function(K){let Z=$0.Filters;if(Z&&Z.Grayscale)Z.Grayscale.call(this,K)};case"sepia":return function(K){let Z=$0.Filters;if(Z&&Z.Sepia)Z.Sepia.call(this,K)};case"invert":return function(K){let Z=$0.Filters;if(Z&&Z.Invert)Z.Invert.call(this,K)};default:n.warn(`CSS filter "${Y}" is not supported in fallback mode. Consider using function filters for better compatibility.`);break}}return()=>{}}var SJ="absoluteOpacity",m$="allEventListeners",F6="absoluteTransform",f$="absoluteScale",n7="canvas",gb="Change",Ib="children",Pb="konva",bB="listening",yb="mouseenter",bb="mouseleave",mb="pointerenter",fb="pointerleave",kb="touchenter",ub="touchleave";var k$="set",u$="Shape",vJ=" ",p$="stage",w8="transform",pb="Stage",mB="visible",lb=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(vJ),ib=1;class C0{constructor(h){this._id=ib++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(h),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(h){if((h===w8||h===F6)&&this._cache.get(h))this._cache.get(h).dirty=!0;else if(h)this._cache.delete(h);else this._cache.clear()}_getCache(h,_){let G=this._cache.get(h);if(G===void 0||(h===w8||h===F6)&&G.dirty===!0)G=_.call(this),this._cache.set(h,G);return G}_calculate(h,_,G){if(!this._attachedDepsListeners.get(h)){let Y=_.map((X)=>X+"Change.konva").join(vJ);this.on(Y,()=>{this._clearCache(h)}),this._attachedDepsListeners.set(h,!0)}return this._getCache(h,G)}_getCanvasCache(){return this._cache.get(n7)}_clearSelfAndDescendantCache(h){if(this._clearCache(h),h===F6)this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(n7)){let{scene:h,filter:_,hit:G}=this._cache.get(n7);n.releaseCanvas(h._canvas,_._canvas,G._canvas),this._cache.delete(n7)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(h){let _=h||{},G={};if(_.x===void 0||_.y===void 0||_.width===void 0||_.height===void 0)G=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0});let Y=Math.ceil(_.width||G.width),X=Math.ceil(_.height||G.height),K=_.pixelRatio,Z=_.x===void 0?Math.floor(G.x):_.x,Q=_.y===void 0?Math.floor(G.y):_.y,D=_.offset||0,O=_.drawBorder||!1,A=_.hitCanvasPixelRatio||1;if(!Y||!X){n.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}let H=Math.abs(Math.round(G.x)-Z)>0.5?1:0,C=Math.abs(Math.round(G.y)-Q)>0.5?1:0;Y+=D*2+H,X+=D*2+C,Z-=D,Q-=D;let N=new t4({pixelRatio:K,width:Y,height:X}),j=new t4({pixelRatio:K,width:0,height:0,willReadFrequently:!0}),W=new s7({pixelRatio:A,width:Y,height:X}),S=N.getContext(),R=W.getContext(),v=new t4({width:N.width/N.pixelRatio+Math.abs(Z),height:N.height/N.pixelRatio+Math.abs(Q),pixelRatio:N.pixelRatio}),x=v.getContext();if(W.isCache=!0,N.isCache=!0,this._cache.delete(n7),this._filterUpToDate=!1,_.imageSmoothingEnabled===!1)N.getContext()._context.imageSmoothingEnabled=!1,j.getContext()._context.imageSmoothingEnabled=!1;if(S.save(),R.save(),x.save(),S.translate(-Z,-Q),R.translate(-Z,-Q),x.translate(-Z,-Q),v.x=Z,v.y=Q,this._isUnderCache=!0,this._clearSelfAndDescendantCache(SJ),this._clearSelfAndDescendantCache(f$),this.drawScene(N,this,v),this.drawHit(W,this),this._isUnderCache=!1,S.restore(),R.restore(),O)S.save(),S.beginPath(),S.rect(0,0,Y,X),S.closePath(),S.setAttr("strokeStyle","red"),S.setAttr("lineWidth",5),S.stroke(),S.restore();return n.releaseCanvas(v._canvas),this._cache.set(n7,{scene:N,filter:j,hit:W,x:Z,y:Q}),this._requestDraw(),this}isCached(){return this._cache.has(n7)}getClientRect(h){throw Error('abstract "getClientRect" method call')}_transformedRect(h,_){let G=[{x:h.x,y:h.y},{x:h.x+h.width,y:h.y},{x:h.x+h.width,y:h.y+h.height},{x:h.x,y:h.y+h.height}],Y=1/0,X=1/0,K=-1/0,Z=-1/0,Q=this.getAbsoluteTransform(_);return G.forEach(function(D){let O=Q.point(D);if(Y===void 0)Y=K=O.x,X=Z=O.y;Y=Math.min(Y,O.x),X=Math.min(X,O.y),K=Math.max(K,O.x),Z=Math.max(Z,O.y)}),{x:Y,y:X,width:K-Y,height:Z-X}}_drawCachedSceneCanvas(h){h.save(),h._applyOpacity(this),h._applyGlobalCompositeOperation(this);let _=this._getCanvasCache();h.translate(_.x,_.y);let G=this._getCachedSceneCanvas(),Y=G.pixelRatio;h.drawImage(G._canvas,0,0,G.width/Y,G.height/Y),h.restore()}_drawCachedHitCanvas(h){let _=this._getCanvasCache(),G=_.hit;h.save(),h.translate(_.x,_.y),h.drawImage(G._canvas,0,0,G.width/G.pixelRatio,G.height/G.pixelRatio),h.restore()}_getCachedSceneCanvas(){let h=this.filters(),_=this._getCanvasCache(),G=_.scene,Y=_.filter,X=Y.getContext(),K,Z,Q,D;if(!h||h.length===0)return G;if(this._filterUpToDate)return Y;let O=!0;for(let H=0;H<h.length;H++){let C=typeof h[H]==="string"&&!gB();if(typeof h[H]!=="string"||!gB()){O=!1;break}}let A=G.pixelRatio;if(Y.setSize(G.width/G.pixelRatio,G.height/G.pixelRatio),O){let H=h.join(" ");return X.save(),X.setAttr("filter",H),X.drawImage(G._canvas,0,0,G.getWidth()/A,G.getHeight()/A),X.restore(),this._filterUpToDate=!0,Y}try{K=h.length,X.clear(),X.drawImage(G._canvas,0,0,G.getWidth()/A,G.getHeight()/A),Z=X.getImageData(0,0,Y.getWidth(),Y.getHeight());for(Q=0;Q<K;Q++){if(D=h[Q],typeof D==="string")D=wb(D);D.call(this,Z),X.putImageData(Z,0,0)}}catch(H){n.error("Unable to apply filter. "+H.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}return this._filterUpToDate=!0,Y}on(...h){let _=h[0],G=h[1],Y=h[2];if(this._cache)this._cache.delete(m$);if(h.length===3)return this._delegate.apply(this,h);let X=_.split(vJ);for(let K=0;K<X.length;K++){let Q=X[K].split("."),D=Q[0],O=Q[1]||"";if(!this.eventListeners[D])this.eventListeners[D]=[];this.eventListeners[D].push({name:O,handler:G})}return this}off(h,_){let G=(h||"").split(vJ),Y=G.length,X,K,Z,Q,D,O;if(this._cache&&this._cache.delete(m$),!h)for(K in this.eventListeners)this._off(K);for(X=0;X<Y;X++)if(Z=G[X],Q=Z.split("."),D=Q[0],O=Q[1],D){if(this.eventListeners[D])this._off(D,O,_)}else for(K in this.eventListeners)this._off(K,O,_);return this}dispatchEvent(h){let _={target:this,type:h.type,evt:h};return this.fire(h.type,_),this}addEventListener(h,_){return this.on(h,function(G){_.call(this,G.evt)}),this}removeEventListener(h){return this.off(h),this}_delegate(h,_,G){let Y=this;return this.on(h,function(X){let K=X.target.findAncestors(_,!0,Y);for(let Z=0;Z<K.length;Z++)X=n.cloneObject(X),X.currentTarget=K[Z],G.call(K[Z],X)}),this}remove(){if(this.isDragging())this.stopDrag();return W1._dragElements.delete(this._id),W1._dragElements.forEach((h,_)=>{if(this.isAncestorOf(h.node))W1._dragElements.delete(_)}),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(F6),this._clearSelfAndDescendantCache(SJ),this._clearSelfAndDescendantCache(f$),this._clearSelfAndDescendantCache(p$),this._clearSelfAndDescendantCache(mB),this._clearSelfAndDescendantCache(bB)}_remove(){this._clearCaches();let h=this.getParent();if(h&&h.children)h.children.splice(this.index,1),h._setChildrenIndices(),this.parent=null}destroy(){return this.remove(),this.clearCache(),this}getAttr(h){let _="get"+n._capitalize(h);if(n._isFunction(this[_]))return this[_]();return this.attrs[h]}getAncestors(){let h=this.getParent(),_=[];while(h)_.push(h),h=h.getParent();return _}getAttrs(){return this.attrs||{}}setAttrs(h){return this._batchTransformChanges(()=>{let _,G;if(!h)return this;for(_ in h){if(_===Ib)continue;if(G=k$+n._capitalize(_),n._isFunction(this[G]))this[G](h[_]);else this._setAttr(_,h[_])}}),this}isListening(){return this._getCache(bB,this._isListening)}_isListening(h){if(!this.listening())return!1;let G=this.getParent();if(G&&G!==h&&this!==h)return G._isListening(h);else return!0}isVisible(){return this._getCache(mB,this._isVisible)}_isVisible(h){if(!this.visible())return!1;let G=this.getParent();if(G&&G!==h&&this!==h)return G._isVisible(h);else return!0}shouldDrawHit(h,_=!1){if(h)return this._isVisible(h)&&this._isListening(h);let G=this.getLayer(),Y=!1;W1._dragElements.forEach((K)=>{if(K.dragStatus!=="dragging")return;else if(K.node.nodeType==="Stage")Y=!0;else if(K.node.getLayer()===G)Y=!0});let X=!_&&!$0.hitOnDragEnabled&&(Y||$0.isTransforming());return this.isListening()&&this.isVisible()&&!X}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){let h=this.getDepth(),_=this,G=0,Y,X,K,Z;function Q(O){Y=[],X=O.length;for(K=0;K<X;K++){if(Z=O[K],G++,Z.nodeType!==u$)Y=Y.concat(Z.getChildren().slice());if(Z._id===_._id)K=X}if(Y.length>0&&Y[0].getDepth()<=h)Q(Y)}let D=this.getStage();if(_.nodeType!==pb&&D)Q(D.getChildren());return G}getDepth(){let h=0,_=this.parent;while(_)h++,_=_.parent;return h}_batchTransformChanges(h){if(this._batchingTransformChange=!0,h(),this._batchingTransformChange=!1,this._needClearTransformCache)this._clearCache(w8),this._clearSelfAndDescendantCache(F6);this._needClearTransformCache=!1}setPosition(h){return this._batchTransformChanges(()=>{this.x(h.x),this.y(h.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){let h=this.getStage();if(!h)return null;let _=h.getPointerPosition();if(!_)return null;let G=this.getAbsoluteTransform().copy();return G.invert(),G.point(_)}getAbsolutePosition(h){let _=!1,G=this.parent;while(G){if(G.isCached()){_=!0;break}G=G.parent}if(_&&!h)h=!0;let Y=this.getAbsoluteTransform(h).getMatrix(),X=new L5,K=this.offset();return X.m=Y.slice(),X.translate(K.x,K.y),X.getTranslation()}setAbsolutePosition(h){let{x:_,y:G,...Y}=this._clearTransform();this.attrs.x=_,this.attrs.y=G,this._clearCache(w8);let X=this._getAbsoluteTransform().copy();return X.invert(),X.translate(h.x,h.y),h={x:this.attrs.x+X.getTranslation().x,y:this.attrs.y+X.getTranslation().y},this._setTransform(Y),this.setPosition({x:h.x,y:h.y}),this._clearCache(w8),this._clearSelfAndDescendantCache(F6),this}_setTransform(h){let _;for(_ in h)this.attrs[_]=h[_]}_clearTransform(){let h={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,h}move(h){let{x:_,y:G}=h,Y=this.x(),X=this.y();if(_!==void 0)Y+=_;if(G!==void 0)X+=G;return this.setPosition({x:Y,y:X}),this}_eachAncestorReverse(h,_){let G=[],Y=this.getParent(),X,K;if(_&&_._id===this._id)return;G.unshift(this);while(Y&&(!_||Y._id!==_._id))G.unshift(Y),Y=Y.parent;X=G.length;for(K=0;K<X;K++)h(G[K])}rotate(h){return this.rotation(this.rotation()+h),this}moveToTop(){if(!this.parent)return n.warn("Node has no parent. moveToTop function is ignored."),!1;let h=this.index,_=this.parent.getChildren().length;if(h<_-1)return this.parent.children.splice(h,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0;return!1}moveUp(){if(!this.parent)return n.warn("Node has no parent. moveUp function is ignored."),!1;let h=this.index,_=this.parent.getChildren().length;if(h<_-1)return this.parent.children.splice(h,1),this.parent.children.splice(h+1,0,this),this.parent._setChildrenIndices(),!0;return!1}moveDown(){if(!this.parent)return n.warn("Node has no parent. moveDown function is ignored."),!1;let h=this.index;if(h>0)return this.parent.children.splice(h,1),this.parent.children.splice(h-1,0,this),this.parent._setChildrenIndices(),!0;return!1}moveToBottom(){if(!this.parent)return n.warn("Node has no parent. moveToBottom function is ignored."),!1;let h=this.index;if(h>0)return this.parent.children.splice(h,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0;return!1}setZIndex(h){if(!this.parent)return n.warn("Node has no parent. zIndex parameter is ignored."),this;if(h<0||h>=this.parent.children.length)n.warn("Unexpected value "+h+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");let _=this.index;return this.parent.children.splice(_,1),this.parent.children.splice(h,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(SJ,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){let h=this.opacity(),_=this.getParent();if(_&&!_._isUnderCache)h*=_.getAbsoluteOpacity();return h}moveTo(h){if(this.getParent()!==h)this._remove(),h.add(this);return this}toObject(){let h=this.getAttrs(),_,G,Y,X,K,Z={attrs:{},className:this.getClassName()};for(_ in h){if(G=h[_],K=n.isObject(G)&&!n._isPlainObject(G)&&!n._isArray(G),K)continue;if(Y=typeof this[_]==="function"&&this[_],delete h[_],X=Y?Y.call(this):null,h[_]=G,X!==G)Z.attrs[_]=G}return n._prepareToStringify(Z)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(h,_,G){let Y=[];if(_&&this._isMatch(h))Y.push(this);let X=this.parent;while(X){if(X===G)return Y;if(X._isMatch(h))Y.push(X);X=X.parent}return Y}isAncestorOf(h){return!1}findAncestor(h,_,G){return this.findAncestors(h,_,G)[0]}_isMatch(h){if(!h)return!1;if(typeof h==="function")return h(this);let _=h.replace(/ /g,"").split(","),G=_.length,Y,X;for(Y=0;Y<G;Y++){if(X=_[Y],!n.isValidSelector(X))n.warn('Selector "'+X+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),n.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),n.warn("Konva is awesome, right?");if(X.charAt(0)==="#"){if(this.id()===X.slice(1))return!0}else if(X.charAt(0)==="."){if(this.hasName(X.slice(1)))return!0}else if(this.className===X||this.nodeType===X)return!0}return!1}getLayer(){let h=this.getParent();return h?h.getLayer():null}getStage(){return this._getCache(p$,this._getStage)}_getStage(){let h=this.getParent();if(h)return h.getStage();else return null}fire(h,_={},G){if(_.target=_.target||this,G)this._fireAndBubble(h,_);else this._fire(h,_);return this}getAbsoluteTransform(h){if(h)return this._getAbsoluteTransform(h);else return this._getCache(F6,this._getAbsoluteTransform)}_getAbsoluteTransform(h){let _;if(h)return _=new L5,this._eachAncestorReverse(function(G){let Y=G.transformsEnabled();if(Y==="all")_.multiply(G.getTransform());else if(Y==="position")_.translate(G.x()-G.offsetX(),G.y()-G.offsetY())},h),_;else{if(_=this._cache.get(F6)||new L5,this.parent)this.parent.getAbsoluteTransform().copyInto(_);else _.reset();let G=this.transformsEnabled();if(G==="all")_.multiply(this.getTransform());else if(G==="position"){let Y=this.attrs.x||0,X=this.attrs.y||0,K=this.attrs.offsetX||0,Z=this.attrs.offsetY||0;_.translate(Y-K,X-Z)}return _.dirty=!1,_}}getAbsoluteScale(h){let _=this;while(_){if(_._isUnderCache)h=_;_=_.getParent()}let Y=this.getAbsoluteTransform(h).decompose();return{x:Y.scaleX,y:Y.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(w8,this._getTransform)}_getTransform(){var h,_;let G=this._cache.get(w8)||new L5;G.reset();let Y=this.x(),X=this.y(),K=$0.getAngle(this.rotation()),Z=(h=this.attrs.scaleX)!==null&&h!==void 0?h:1,Q=(_=this.attrs.scaleY)!==null&&_!==void 0?_:1,D=this.attrs.skewX||0,O=this.attrs.skewY||0,A=this.attrs.offsetX||0,H=this.attrs.offsetY||0;if(Y!==0||X!==0)G.translate(Y,X);if(K!==0)G.rotate(K);if(D!==0||O!==0)G.skew(D,O);if(Z!==1||Q!==1)G.scale(Z,Q);if(A!==0||H!==0)G.translate(-1*A,-1*H);return G.dirty=!1,G}clone(h){let _=n.cloneObject(this.attrs),G,Y,X,K,Z;for(G in h)_[G]=h[G];let Q=new this.constructor(_);for(G in this.eventListeners){Y=this.eventListeners[G],X=Y.length;for(K=0;K<X;K++)if(Z=Y[K],Z.name.indexOf(Pb)<0){if(!Q.eventListeners[G])Q.eventListeners[G]=[];Q.eventListeners[G].push(Z)}}return Q}_toKonvaCanvas(h){h=h||{};let _=this.getClientRect(),G=this.getStage(),Y=h.x!==void 0?h.x:Math.floor(_.x),X=h.y!==void 0?h.y:Math.floor(_.y),K=h.pixelRatio||1,Z=new t4({width:h.width||Math.ceil(_.width)||(G?G.width():0),height:h.height||Math.ceil(_.height)||(G?G.height():0),pixelRatio:K}),Q=Z.getContext(),D=new t4({width:Z.width/Z.pixelRatio+Math.abs(Y),height:Z.height/Z.pixelRatio+Math.abs(X),pixelRatio:Z.pixelRatio});if(h.imageSmoothingEnabled===!1)Q._context.imageSmoothingEnabled=!1;if(Q.save(),Y||X)Q.translate(-1*Y,-1*X);return this.drawScene(Z,void 0,D),Q.restore(),Z}toCanvas(h){return this._toKonvaCanvas(h)._canvas}toDataURL(h){h=h||{};let _=h.mimeType||null,G=h.quality||null,Y=this._toKonvaCanvas(h).toDataURL(_,G);if(h.callback)h.callback(Y);return Y}toImage(h){return new Promise((_,G)=>{try{let Y=h===null||h===void 0?void 0:h.callback;if(Y)delete h.callback;n._urlToImage(this.toDataURL(h),function(X){_(X),Y===null||Y===void 0||Y(X)})}catch(Y){G(Y)}})}toBlob(h){return new Promise((_,G)=>{try{let Y=h===null||h===void 0?void 0:h.callback;if(Y)delete h.callback;this.toCanvas(h).toBlob((X)=>{_(X),Y===null||Y===void 0||Y(X)},h===null||h===void 0?void 0:h.mimeType,h===null||h===void 0?void 0:h.quality)}catch(Y){G(Y)}})}setSize(h){return this.width(h.width),this.height(h.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){if(this.attrs.dragDistance!==void 0)return this.attrs.dragDistance;else if(this.parent)return this.parent.getDragDistance();else return $0.dragDistance}_off(h,_,G){let Y=this.eventListeners[h],X,K,Z;for(X=0;X<Y.length;X++)if(K=Y[X].name,Z=Y[X].handler,(K!=="konva"||_==="konva")&&(!_||K===_)&&(!G||G===Z)){if(Y.splice(X,1),Y.length===0){delete this.eventListeners[h];break}X--}}_fireChangeEvent(h,_,G){this._fire(h+gb,{oldVal:_,newVal:G})}addName(h){if(!this.hasName(h)){let _=this.name(),G=_?_+" "+h:h;this.name(G)}return this}hasName(h){if(!h)return!1;let _=this.name();if(!_)return!1;return(_||"").split(/\s/g).indexOf(h)!==-1}removeName(h){let _=(this.name()||"").split(/\s/g),G=_.indexOf(h);if(G!==-1)_.splice(G,1),this.name(_.join(" "));return this}setAttr(h,_){let G=this[k$+n._capitalize(h)];if(n._isFunction(G))G.call(this,_);else this._setAttr(h,_);return this}_requestDraw(){if($0.autoDrawEnabled){let h=this.getLayer()||this.getStage();h===null||h===void 0||h.batchDraw()}}_setAttr(h,_){let G=this.attrs[h];if(G===_&&!n.isObject(_))return;if(_===void 0||_===null)delete this.attrs[h];else this.attrs[h]=_;if(this._shouldFireChangeEvents)this._fireChangeEvent(h,G,_);this._requestDraw()}_setComponentAttr(h,_,G){let Y;if(G!==void 0){if(Y=this.attrs[h],!Y)this.attrs[h]=this.getAttr(h);this.attrs[h][_]=G,this._fireChangeEvent(h,Y,G)}}_fireAndBubble(h,_,G){if(_&&this.nodeType===u$)_.target=this;let Y=[yb,bb,mb,fb,kb,ub];if(!(Y.indexOf(h)!==-1&&(G&&(this===G||this.isAncestorOf&&this.isAncestorOf(G))||this.nodeType==="Stage"&&!G))){this._fire(h,_);let K=Y.indexOf(h)!==-1&&G&&G.isAncestorOf&&G.isAncestorOf(this)&&!G.isAncestorOf(this.parent);if((_&&!_.cancelBubble||!_)&&this.parent&&this.parent.isListening()&&!K)if(G&&G.parent)this._fireAndBubble.call(this.parent,h,_,G);else this._fireAndBubble.call(this.parent,h,_)}}_getProtoListeners(h){var _,G;let{nodeType:Y}=this,X=C0.protoListenerMap.get(Y)||{},K=X===null||X===void 0?void 0:X[h];if(K===void 0){K=[];let Z=Object.getPrototypeOf(this);while(Z){let Q=(G=(_=Z.eventListeners)===null||_===void 0?void 0:_[h])!==null&&G!==void 0?G:[];K.push(...Q),Z=Object.getPrototypeOf(Z)}X[h]=K,C0.protoListenerMap.set(Y,X)}return K}_fire(h,_){_=_||{},_.currentTarget=this,_.type=h;let G=this._getProtoListeners(h);if(G){let X=G.slice();for(let K=0;K<X.length;K++)X[K].handler.call(this,_)}let Y=this.eventListeners[h];if(Y){let X=Y.slice(),K=X.length;for(let Q=0;Q<X.length;Q++)X[Q].handler.call(this,_);let Z=this.eventListeners[h];if(Z)for(let Q=K;Q<Z.length;Q++)Z[Q].handler.call(this,_)}}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(h){let _=h?h.pointerId:void 0,G=this.getStage(),Y=this.getAbsolutePosition();if(!G)return;let X=G._getPointerById(_)||G._changedPointerPositions[0]||Y;W1._dragElements.set(this._id,{node:this,startPointerPos:X,offset:{x:X.x-Y.x,y:X.y-Y.y},dragStatus:"ready",pointerId:_,startEvent:h})}startDrag(h,_=!0){if(!W1._dragElements.has(this._id))this._createDragElement(h);let G=W1._dragElements.get(this._id);G.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:G.startEvent&&G.startEvent.evt||h&&h.evt},_)}_setDragPosition(h,_){let G=this.getStage()._getPointerById(_.pointerId);if(!G)return;let Y={x:G.x-_.offset.x,y:G.y-_.offset.y},X=this.dragBoundFunc();if(X!==void 0){let K=X.call(this,Y,h);if(!K)n.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.");else Y=K}if(!this._lastPos||this._lastPos.x!==Y.x||this._lastPos.y!==Y.y)this.setAbsolutePosition(Y),this._requestDraw();this._lastPos=Y}stopDrag(h){let _=W1._dragElements.get(this._id);if(_)_.dragStatus="stopped";W1._endDragBefore(h),W1._endDragAfter(h)}setDraggable(h){this._setAttr("draggable",h),this._dragChange()}isDragging(){let h=W1._dragElements.get(this._id);return h?h.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(h){if(!(h.evt.button===void 0||$0.dragButtons.indexOf(h.evt.button)>=0))return;if(this.isDragging())return;let Y=!1;if(W1._dragElements.forEach((X)=>{if(this.isAncestorOf(X.node))Y=!0}),!Y)this._createDragElement(h)})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;let _=W1._dragElements.get(this._id),G=_&&_.dragStatus==="dragging",Y=_&&_.dragStatus==="ready";if(G)this.stopDrag();else if(Y)W1._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(h={x:0,y:0}){let _=this.getStage();if(!_)return!1;let G={x:-h.x,y:-h.y,width:_.width()+2*h.x,height:_.height()+2*h.y};return n.haveIntersection(G,this.getClientRect())}static create(h,_){if(n._isString(h))h=JSON.parse(h);return this._createNode(h,_)}static _createNode(h,_){let G=C0.prototype.getClassName.call(h),Y=h.children,X,K,Z;if(_)h.attrs.container=_;if(!$0[G])n.warn('Can not find a node with class name "'+G+'". Fallback to "Shape".'),G="Shape";if(X=new $0[G](h.attrs),Y){K=Y.length;for(Z=0;Z<K;Z++)X.add(C0._createNode(Y[Z]))}return X}}C0.protoListenerMap=new Map;C0.prototype.nodeType="Node";C0.prototype._attrsAffectingSize=[];C0.prototype.eventListeners={};C0.prototype.on(lb,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(w8),this._clearSelfAndDescendantCache(F6)});C0.prototype.on("visibleChange.konva",function(){this._clearSelfAndDescendantCache(mB)});C0.prototype.on("listeningChange.konva",function(){this._clearSelfAndDescendantCache(bB)});C0.prototype.on("opacityChange.konva",function(){this._clearSelfAndDescendantCache(SJ)});var Y2=u.addGetterSetter;Y2(C0,"zIndex");Y2(C0,"absolutePosition");Y2(C0,"position");Y2(C0,"x",0,V0());Y2(C0,"y",0,V0());Y2(C0,"globalCompositeOperation","source-over",m3());Y2(C0,"opacity",1,V0());Y2(C0,"name","",m3());Y2(C0,"id","",m3());Y2(C0,"rotation",0,V0());u.addComponentsGetterSetter(C0,"scale",["x","y"]);Y2(C0,"scaleX",1,V0());Y2(C0,"scaleY",1,V0());u.addComponentsGetterSetter(C0,"skew",["x","y"]);Y2(C0,"skewX",0,V0());Y2(C0,"skewY",0,V0());u.addComponentsGetterSetter(C0,"offset",["x","y"]);Y2(C0,"offsetX",0,V0());Y2(C0,"offsetY",0,V0());Y2(C0,"dragDistance",void 0,V0());Y2(C0,"width",0,V0());Y2(C0,"height",0,V0());Y2(C0,"listening",!0,j5());Y2(C0,"preventDefault",!0,j5());Y2(C0,"filters",void 0,function(h){return this._filterUpToDate=!1,h});Y2(C0,"visible",!0,j5());Y2(C0,"transformsEnabled","all",m3());Y2(C0,"size");Y2(C0,"dragBoundFunc");Y2(C0,"draggable",!1,j5());u.backCompat(C0,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});class M5 extends C0{constructor(){super(...arguments);this.children=[]}getChildren(h){let _=this.children||[];if(h)return _.filter(h);return _}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach((h)=>{h.parent=null,h.index=0,h.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach((h)=>{h.parent=null,h.index=0,h.destroy()}),this.children=[],this._requestDraw(),this}add(...h){if(h.length===0)return this;if(h.length>1){for(let G=0;G<h.length;G++)this.add(h[G]);return this}let _=h[0];if(_.getParent())return _.moveTo(this),this;return this._validateAdd(_),_.index=this.getChildren().length,_.parent=this,_._clearCaches(),this.getChildren().push(_),this._fire("add",{child:_}),this._requestDraw(),this}destroy(){if(this.hasChildren())this.destroyChildren();return super.destroy(),this}find(h){return this._generalFind(h,!1)}findOne(h){let _=this._generalFind(h,!0);return _.length>0?_[0]:void 0}_generalFind(h,_){let G=[];return this._descendants((Y)=>{let X=Y._isMatch(h);if(X)G.push(Y);if(X&&_)return!0;return!1}),G}_descendants(h){let _=!1,G=this.getChildren();for(let Y of G){if(_=h(Y),_)return!0;if(!Y.hasChildren())continue;if(_=Y._descendants(h),_)return!0}return!1}toObject(){let h=C0.prototype.toObject.call(this);return h.children=[],this.getChildren().forEach((_)=>{h.children.push(_.toObject())}),h}isAncestorOf(h){let _=h.getParent();while(_){if(_._id===this._id)return!0;_=_.getParent()}return!1}clone(h){let _=C0.prototype.clone.call(this,h);return this.getChildren().forEach(function(G){_.add(G.clone())}),_}getAllIntersections(h){let _=[];return this.find("Shape").forEach((G)=>{if(G.isVisible()&&G.intersects(h))_.push(G)}),_}_clearSelfAndDescendantCache(h){var _;if(super._clearSelfAndDescendantCache(h),this.isCached())return;(_=this.children)===null||_===void 0||_.forEach(function(G){G._clearSelfAndDescendantCache(h)})}_setChildrenIndices(){var h;(h=this.children)===null||h===void 0||h.forEach(function(_,G){_.index=G}),this._requestDraw()}drawScene(h,_,G){let Y=this.getLayer(),X=h||Y&&Y.getCanvas(),K=X&&X.getContext(),Z=this._getCanvasCache(),Q=Z&&Z.scene,D=X&&X.isCache;if(!this.isVisible()&&!D)return this;if(Q){K.save();let O=this.getAbsoluteTransform(_).getMatrix();K.transform(O[0],O[1],O[2],O[3],O[4],O[5]),this._drawCachedSceneCanvas(K),K.restore()}else this._drawChildren("drawScene",X,_,G);return this}drawHit(h,_){if(!this.shouldDrawHit(_))return this;let G=this.getLayer(),Y=h||G&&G.hitCanvas,X=Y&&Y.getContext(),K=this._getCanvasCache();if(K&&K.hit){X.save();let Q=this.getAbsoluteTransform(_).getMatrix();X.transform(Q[0],Q[1],Q[2],Q[3],Q[4],Q[5]),this._drawCachedHitCanvas(X),X.restore()}else this._drawChildren("drawHit",Y,_);return this}_drawChildren(h,_,G,Y){var X;let K=_&&_.getContext(),Z=this.clipWidth(),Q=this.clipHeight(),D=this.clipFunc(),O=typeof Z==="number"&&typeof Q==="number"||D,A=G===this;if(O){K.save();let C=this.getAbsoluteTransform(G),N=C.getMatrix();K.transform(N[0],N[1],N[2],N[3],N[4],N[5]),K.beginPath();let j;if(D)j=D.call(this,K,this);else{let W=this.clipX(),S=this.clipY();K.rect(W||0,S||0,Z,Q)}K.clip.apply(K,j),N=C.copy().invert().getMatrix(),K.transform(N[0],N[1],N[2],N[3],N[4],N[5])}let H=!A&&this.globalCompositeOperation()!=="source-over"&&h==="drawScene";if(H)K.save(),K._applyGlobalCompositeOperation(this);if((X=this.children)===null||X===void 0||X.forEach(function(C){C[h](_,G,Y)}),H)K.restore();if(O)K.restore()}getClientRect(h={}){var _;let{skipTransform:G,relativeTo:Y}=h,X,K,Z,Q,D={x:1/0,y:1/0,width:0,height:0},O=this;(_=this.children)===null||_===void 0||_.forEach(function(C){if(!C.visible())return;let N=C.getClientRect({relativeTo:O,skipShadow:h.skipShadow,skipStroke:h.skipStroke});if(N.width===0&&N.height===0)return;if(X===void 0)X=N.x,K=N.y,Z=N.x+N.width,Q=N.y+N.height;else X=Math.min(X,N.x),K=Math.min(K,N.y),Z=Math.max(Z,N.x+N.width),Q=Math.max(Q,N.y+N.height)});let A=this.find("Shape"),H=!1;for(let C=0;C<A.length;C++)if(A[C]._isVisible(this)){H=!0;break}if(H&&X!==void 0)D={x:X,y:K,width:Z-X,height:Q-K};else D={x:0,y:0,width:0,height:0};if(!G)return this._transformedRect(D,Y);return D}}u.addComponentsGetterSetter(M5,"clip",["x","y","width","height"]);u.addGetterSetter(M5,"clipX",void 0,V0());u.addGetterSetter(M5,"clipY",void 0,V0());u.addGetterSetter(M5,"clipWidth",void 0,V0());u.addGetterSetter(M5,"clipHeight",void 0,V0());u.addGetterSetter(M5,"clipFunc");var TY=new Map,l$=$0._global.PointerEvent!==void 0;function xJ(h){return TY.get(h)}function wJ(h){return{evt:h,pointerId:h.pointerId}}function gJ(h,_){return TY.get(h)===_}function IJ(h,_){if(o7(h),!_.getStage())return;if(TY.set(h,_),l$)_._fire("gotpointercapture",wJ(new PointerEvent("gotpointercapture")))}function o7(h,_){let G=TY.get(h);if(!G)return;let Y=G.getStage();if(Y&&Y.content);if(TY.delete(h),l$)G._fire("lostpointercapture",wJ(new PointerEvent("lostpointercapture")))}var cb="Stage",db="string",c$="px",ab="mouseout",a$="mouseleave",t$="mouseover",s$="mouseenter",n$="mousemove",o$="mousedown",r$="mouseup",WY="pointermove",RY="pointerdown",h_="pointerup",SY="pointercancel",tb="lostpointercapture",PJ="pointerout",vY="pointerleave",yJ="pointerover",bJ="pointerenter",kB="contextmenu",e$="touchstart",hL="touchend",_L="touchmove",GL="touchcancel",uB="wheel",sb=5,nb=[[s$,"_pointerenter"],[o$,"_pointerdown"],[n$,"_pointermove"],[r$,"_pointerup"],[a$,"_pointerleave"],[e$,"_pointerdown"],[_L,"_pointermove"],[hL,"_pointerup"],[GL,"_pointercancel"],[t$,"_pointerover"],[uB,"_wheel"],[kB,"_contextmenu"],[RY,"_pointerdown"],[WY,"_pointermove"],[h_,"_pointerup"],[SY,"_pointercancel"],[vY,"_pointerleave"],[tb,"_lostpointercapture"]],fB={mouse:{[PJ]:ab,[vY]:a$,[yJ]:t$,[bJ]:s$,[WY]:n$,[RY]:o$,[h_]:r$,[SY]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[PJ]:"touchout",[vY]:"touchleave",[yJ]:"touchover",[bJ]:"touchenter",[WY]:_L,[RY]:e$,[h_]:hL,[SY]:GL,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[PJ]:PJ,[vY]:vY,[yJ]:yJ,[bJ]:bJ,[WY]:WY,[RY]:RY,[h_]:h_,[SY]:SY,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},xY=(h)=>{if(h.indexOf("pointer")>=0)return"pointer";if(h.indexOf("touch")>=0)return"touch";return"mouse"},eh=(h)=>{let _=xY(h);if(_==="pointer")return $0.pointerEventsEnabled&&fB.pointer;if(_==="touch")return fB.touch;if(_==="mouse")return fB.mouse};function d$(h={}){if(h.clipFunc||h.clipWidth||h.clipHeight)n.warn("Stage does not support clipping. Please use clip for Layers or Groups.");return h}var ob="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);",__=[];class G_ extends M5{constructor(h){super(d$(h));this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),__.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{d$(this.attrs)}),this._checkVisibility()}_validateAdd(h){let _=h.getType()==="Layer",G=h.getType()==="FastLayer";if(!(_||G))n.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;let h=this.visible()?"":"none";this.content.style.display=h}setContainer(h){if(typeof h===db){let _;if(h.charAt(0)==="."){let G=h.slice(1);h=document.getElementsByClassName(G)[0]}else{if(h.charAt(0)!=="#")_=h;else _=h.slice(1);h=document.getElementById(_)}if(!h)throw"Can not find container in document with id "+_}if(this._setAttr("container",h),this.content){if(this.content.parentElement)this.content.parentElement.removeChild(this.content);h.appendChild(this.content)}return this}shouldDrawHit(){return!0}clear(){let h=this.children,_=h.length;for(let G=0;G<_;G++)h[G].clear();return this}clone(h){if(!h)h={};return h.container=typeof document<"u"&&document.createElement("div"),M5.prototype.clone.call(this,h)}destroy(){super.destroy();let h=this.content;if(h&&n._isInDocument(h))this.container().removeChild(h);let _=__.indexOf(this);if(_>-1)__.splice(_,1);return n.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){let h=this._pointerPositions[0]||this._changedPointerPositions[0];if(!h)return n.warn(ob),null;return{x:h.x,y:h.y}}_getPointerById(h){return this._pointerPositions.find((_)=>_.id===h)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(h){h={...h},h.x=h.x||0,h.y=h.y||0,h.width=h.width||this.width(),h.height=h.height||this.height();let _=new t4({width:h.width,height:h.height,pixelRatio:h.pixelRatio||1}),G=_.getContext()._context,Y=this.children;if(h.x||h.y)G.translate(-1*h.x,-1*h.y);return Y.forEach(function(X){if(!X.isVisible())return;let K=X._toKonvaCanvas(h);G.drawImage(K._canvas,h.x,h.y,K.getWidth()/K.getPixelRatio(),K.getHeight()/K.getPixelRatio())}),_}getIntersection(h){if(!h)return null;let _=this.children,G=_.length,Y=G-1;for(let X=Y;X>=0;X--){let K=_[X].getIntersection(h);if(K)return K}return null}_resizeDOM(){let h=this.width(),_=this.height();if(this.content)this.content.style.width=h+c$,this.content.style.height=_+c$;this.bufferCanvas.setSize(h,_),this.bufferHitCanvas.setSize(h,_),this.children.forEach((G)=>{G.setSize({width:h,height:_}),G.draw()})}add(h,..._){if(arguments.length>1){for(let Y=0;Y<arguments.length;Y++)this.add(arguments[Y]);return this}super.add(h);let G=this.children.length;if(G>sb)n.warn("The stage has "+G+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group.");if(h.setSize({width:this.width(),height:this.height()}),h.draw(),$0.isBrowser)this.content.appendChild(h.canvas._canvas);return this}getParent(){return null}getLayer(){return null}hasPointerCapture(h){return gJ(h,this)}setPointerCapture(h){IJ(h,this)}releaseCapture(h){o7(h,this)}getLayers(){return this.children}_bindContentEvents(){if(!$0.isBrowser)return;nb.forEach(([h,_])=>{this.content.addEventListener(h,(G)=>{this[_](G)},{passive:!1})})}_pointerenter(h){this.setPointersPositions(h);let _=eh(h.type);if(_)this._fire(_.pointerenter,{evt:h,target:this,currentTarget:this})}_pointerover(h){this.setPointersPositions(h);let _=eh(h.type);if(_)this._fire(_.pointerover,{evt:h,target:this,currentTarget:this})}_getTargetShape(h){let _=this[h+"targetShape"];if(_&&!_.getStage())_=null;return _}_pointerleave(h){let _=eh(h.type),G=xY(h.type);if(!_)return;this.setPointersPositions(h);let Y=this._getTargetShape(G),X=!($0.isDragging()||$0.isTransforming())||$0.hitOnDragEnabled;if(Y&&X)Y._fireAndBubble(_.pointerout,{evt:h}),Y._fireAndBubble(_.pointerleave,{evt:h}),this._fire(_.pointerleave,{evt:h,target:this,currentTarget:this}),this[G+"targetShape"]=null;else if(X)this._fire(_.pointerleave,{evt:h,target:this,currentTarget:this}),this._fire(_.pointerout,{evt:h,target:this,currentTarget:this});this.pointerPos=null,this._pointerPositions=[]}_pointerdown(h){let _=eh(h.type),G=xY(h.type);if(!_)return;this.setPointersPositions(h);let Y=!1;if(this._changedPointerPositions.forEach((X)=>{let K=this.getIntersection(X);if(W1.justDragged=!1,$0["_"+G+"ListenClick"]=!0,!K||!K.isListening()){this[G+"ClickStartShape"]=void 0;return}if($0.capturePointerEventsEnabled)K.setPointerCapture(X.id);this[G+"ClickStartShape"]=K,K._fireAndBubble(_.pointerdown,{evt:h,pointerId:X.id}),Y=!0;let Z=h.type.indexOf("touch")>=0;if(K.preventDefault()&&h.cancelable&&Z)h.preventDefault()}),!Y)this._fire(_.pointerdown,{evt:h,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}_pointermove(h){let _=eh(h.type),G=xY(h.type);if(!_)return;let Y=h.type.indexOf("touch")>=0||h.pointerType==="touch";if($0.isDragging()&&W1.node.preventDefault()&&h.cancelable&&Y)h.preventDefault();if(this.setPointersPositions(h),!(!($0.isDragging()||$0.isTransforming())||$0.hitOnDragEnabled))return;let K={},Z=!1,Q=this._getTargetShape(G);if(this._changedPointerPositions.forEach((D)=>{let O=xJ(D.id)||this.getIntersection(D),A=D.id,H={evt:h,pointerId:A},C=Q!==O;if(C&&Q)Q._fireAndBubble(_.pointerout,{...H},O),Q._fireAndBubble(_.pointerleave,{...H},O);if(O){if(K[O._id])return;K[O._id]=!0}if(O&&O.isListening()){if(Z=!0,C)O._fireAndBubble(_.pointerover,{...H},Q),O._fireAndBubble(_.pointerenter,{...H},Q),this[G+"targetShape"]=O;O._fireAndBubble(_.pointermove,{...H})}else if(Q)this._fire(_.pointerover,{evt:h,target:this,currentTarget:this,pointerId:A}),this[G+"targetShape"]=null}),!Z)this._fire(_.pointermove,{evt:h,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(h){let _=eh(h.type),G=xY(h.type);if(!_)return;this.setPointersPositions(h);let Y=this[G+"ClickStartShape"],X=this[G+"ClickEndShape"],K={},Z=!1;if(this._changedPointerPositions.forEach((Q)=>{let D=xJ(Q.id)||this.getIntersection(Q);if(D){if(D.releaseCapture(Q.id),K[D._id])return;K[D._id]=!0}let O=Q.id,A={evt:h,pointerId:O},H=!1;if($0["_"+G+"InDblClickWindow"])H=!0,clearTimeout(this[G+"DblTimeout"]);else if(!W1.justDragged)$0["_"+G+"InDblClickWindow"]=!0,clearTimeout(this[G+"DblTimeout"]);if(this[G+"DblTimeout"]=setTimeout(function(){$0["_"+G+"InDblClickWindow"]=!1},$0.dblClickWindow),D&&D.isListening()){if(Z=!0,this[G+"ClickEndShape"]=D,D._fireAndBubble(_.pointerup,{...A}),$0["_"+G+"ListenClick"]&&Y&&Y===D){if(D._fireAndBubble(_.pointerclick,{...A}),H&&X&&X===D)D._fireAndBubble(_.pointerdblclick,{...A})}}else{if(this[G+"ClickEndShape"]=null,!Z)this._fire(_.pointerup,{evt:h,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),Z=!0;if($0["_"+G+"ListenClick"])this._fire(_.pointerclick,{evt:h,target:this,currentTarget:this,pointerId:O});if(H)this._fire(_.pointerdblclick,{evt:h,target:this,currentTarget:this,pointerId:O})}}),!Z)this._fire(_.pointerup,{evt:h,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id});if($0["_"+G+"ListenClick"]=!1,h.cancelable&&G!=="touch"&&G!=="pointer")h.preventDefault()}_contextmenu(h){this.setPointersPositions(h);let _=this.getIntersection(this.getPointerPosition());if(_&&_.isListening())_._fireAndBubble(kB,{evt:h});else this._fire(kB,{evt:h,target:this,currentTarget:this})}_wheel(h){this.setPointersPositions(h);let _=this.getIntersection(this.getPointerPosition());if(_&&_.isListening())_._fireAndBubble(uB,{evt:h});else this._fire(uB,{evt:h,target:this,currentTarget:this})}_pointercancel(h){this.setPointersPositions(h);let _=xJ(h.pointerId)||this.getIntersection(this.getPointerPosition());if(_)_._fireAndBubble(h_,wJ(h));o7(h.pointerId)}_lostpointercapture(h){o7(h.pointerId)}setPointersPositions(h){let _=this._getContentPosition(),G=null,Y=null;if(h=h?h:window.event,h.touches!==void 0)this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(h.touches,(X)=>{this._pointerPositions.push({id:X.identifier,x:(X.clientX-_.left)/_.scaleX,y:(X.clientY-_.top)/_.scaleY})}),Array.prototype.forEach.call(h.changedTouches||h.touches,(X)=>{this._changedPointerPositions.push({id:X.identifier,x:(X.clientX-_.left)/_.scaleX,y:(X.clientY-_.top)/_.scaleY})});else G=(h.clientX-_.left)/_.scaleX,Y=(h.clientY-_.top)/_.scaleY,this.pointerPos={x:G,y:Y},this._pointerPositions=[{x:G,y:Y,id:n._getFirstPointerId(h)}],this._changedPointerPositions=[{x:G,y:Y,id:n._getFirstPointerId(h)}]}_setPointerPosition(h){n.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(h)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};let h=this.content.getBoundingClientRect();return{top:h.top,left:h.left,scaleX:h.width/this.content.clientWidth||1,scaleY:h.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new t4({width:this.width(),height:this.height()}),this.bufferHitCanvas=new s7({pixelRatio:1,width:this.width(),height:this.height()}),!$0.isBrowser)return;let h=this.container();if(!h)throw"Stage has no container. A container is required.";h.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),h.appendChild(this.content),this._resizeDOM()}cache(){return n.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(h){h.batchDraw()}),this}}G_.prototype.nodeType=cb;q1(G_);u.addGetterSetter(G_,"container");if($0.isBrowser)document.addEventListener("visibilitychange",()=>{__.forEach((h)=>{h.batchDraw()})});var YL="hasShadow",XL="shadowRGBA",KL="patternImage",ZL="linearGradient",JL="radialGradient",mJ;function pB(){if(mJ)return mJ;return mJ=n.createCanvasElement().getContext("2d"),mJ}var r7={};function rb(h){let _=this.attrs.fillRule;if(_)h.fill(_);else h.fill()}function eb(h){h.stroke()}function hm(h){let _=this.attrs.fillRule;if(_)h.fill(_);else h.fill()}function _m(h){h.stroke()}function Gm(){this._clearCache(YL)}function Ym(){this._clearCache(XL)}function Xm(){this._clearCache(KL)}function Km(){this._clearCache(ZL)}function Zm(){this._clearCache(JL)}class U0 extends C0{constructor(h){super(h);let _,G=0;while(!0){if(_=n.getHitColor(),_&&!(_ in r7))break;if(G++,G>=1e4){n.warn("Failed to find a unique color key for a shape. Konva may work incorrectly. Most likely your browser is using canvas farbling. Consider disabling it."),_=n.getRandomColor();break}}this.colorKey=_,r7[_]=this}getContext(){return n.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return n.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(YL,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(KL,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){let _=pB().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(_&&_.setTransform){let G=new L5;G.translate(this.fillPatternX(),this.fillPatternY()),G.rotate($0.getAngle(this.fillPatternRotation())),G.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),G.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());let Y=G.getMatrix(),X=typeof DOMMatrix>"u"?{a:Y[0],b:Y[1],c:Y[2],d:Y[3],e:Y[4],f:Y[5]}:new DOMMatrix(Y);_.setTransform(X)}return _}}_getLinearGradient(){return this._getCache(ZL,this.__getLinearGradient)}__getLinearGradient(){let h=this.fillLinearGradientColorStops();if(h){let _=pB(),G=this.fillLinearGradientStartPoint(),Y=this.fillLinearGradientEndPoint(),X=_.createLinearGradient(G.x,G.y,Y.x,Y.y);for(let K=0;K<h.length;K+=2)X.addColorStop(h[K],h[K+1]);return X}}_getRadialGradient(){return this._getCache(JL,this.__getRadialGradient)}__getRadialGradient(){let h=this.fillRadialGradientColorStops();if(h){let _=pB(),G=this.fillRadialGradientStartPoint(),Y=this.fillRadialGradientEndPoint(),X=_.createRadialGradient(G.x,G.y,this.fillRadialGradientStartRadius(),Y.x,Y.y,this.fillRadialGradientEndRadius());for(let K=0;K<h.length;K+=2)X.addColorStop(h[K],h[K+1]);return X}}getShadowRGBA(){return this._getCache(XL,this._getShadowRGBA)}_getShadowRGBA(){if(!this.hasShadow())return;let h=n.colorToRGBA(this.shadowColor());if(h)return"rgba("+h.r+","+h.g+","+h.b+","+h.a*(this.shadowOpacity()||1)+")"}hasFill(){return this._calculate("hasFill",["fillEnabled","fill","fillPatternImage","fillLinearGradientColorStops","fillRadialGradientColorStops"],()=>{return this.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops())})}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>{return this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops())})}hasHitStroke(){let h=this.hitStrokeWidth();if(h==="auto")return this.hasStroke();return this.strokeEnabled()&&!!h}intersects(h){let _=this.getStage();if(!_)return!1;let G=_.bufferHitCanvas;return G.getContext().clear(),this.drawHit(G,void 0,!0),G.context.getImageData(Math.round(h.x),Math.round(h.y),1,1).data[3]>0}destroy(){return C0.prototype.destroy.call(this),delete r7[this.colorKey],delete this.colorKey,this}_useBufferCanvas(h){var _;if(!((_=this.attrs.perfectDrawEnabled)!==null&&_!==void 0?_:!0))return!1;let Y=h||this.hasFill(),X=this.hasStroke(),K=this.getAbsoluteOpacity()!==1;if(Y&&X&&K)return!0;let Z=this.hasShadow(),Q=this.shadowForStrokeEnabled();if(Y&&X&&Z&&Q)return!0;return!1}setStrokeHitEnabled(h){if(n.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),h)this.hitStrokeWidth("auto");else this.hitStrokeWidth(0)}getStrokeHitEnabled(){if(this.hitStrokeWidth()===0)return!1;else return!0}getSelfRect(){let h=this.size();return{x:this._centroid?-h.width/2:0,y:this._centroid?-h.height/2:0,width:h.width,height:h.height}}getClientRect(h={}){let _=!1,G=this.getParent();while(G){if(G.isCached()){_=!0;break}G=G.getParent()}let Y=h.skipTransform,X=h.relativeTo||_&&this.getStage()||void 0,K=this.getSelfRect(),Q=!h.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,D=K.width+Q,O=K.height+Q,A=!h.skipShadow&&this.hasShadow(),H=A?this.shadowOffsetX():0,C=A?this.shadowOffsetY():0,N=D+Math.abs(H),j=O+Math.abs(C),W=A&&this.shadowBlur()||0,S=N+W*2,R=j+W*2,v={width:S,height:R,x:-(Q/2+W)+Math.min(H,0)+K.x,y:-(Q/2+W)+Math.min(C,0)+K.y};if(!Y)return this._transformedRect(v,X);return v}drawScene(h,_,G){let Y=this.getLayer(),X=h||Y.getCanvas(),K=X.getContext(),Z=this._getCanvasCache(),Q=this.getSceneFunc(),D=this.hasShadow(),O,A=!1,H=_===this;if(!this.isVisible()&&!H)return this;if(Z){K.save();let C=this.getAbsoluteTransform(_).getMatrix();return K.transform(C[0],C[1],C[2],C[3],C[4],C[5]),this._drawCachedSceneCanvas(K),K.restore(),this}if(!Q)return this;if(K.save(),this._useBufferCanvas()){O=this.getStage();let C=G||O.bufferCanvas,N=C.getContext();if(G)N.save(),N.setTransform(1,0,0,1,0,0),N.clearRect(0,0,C.width,C.height),N.restore();else N.clear();N.save(),N._applyLineJoin(this),N._applyMiterLimit(this);let j=this.getAbsoluteTransform(_).getMatrix();N.transform(j[0],j[1],j[2],j[3],j[4],j[5]),Q.call(this,N,this),N.restore();let W=C.pixelRatio;if(D)K._applyShadow(this);if(!H)K._applyOpacity(this),K._applyGlobalCompositeOperation(this);K.drawImage(C._canvas,C.x||0,C.y||0,C.width/W,C.height/W)}else{if(K._applyLineJoin(this),K._applyMiterLimit(this),!H){let C=this.getAbsoluteTransform(_).getMatrix();K.transform(C[0],C[1],C[2],C[3],C[4],C[5]),K._applyOpacity(this),K._applyGlobalCompositeOperation(this)}if(D)K._applyShadow(this);Q.call(this,K,this)}return K.restore(),this}drawHit(h,_,G=!1){if(!this.shouldDrawHit(_,G))return this;let Y=this.getLayer(),X=h||Y.hitCanvas,K=X&&X.getContext(),Z=this.hitFunc()||this.sceneFunc(),Q=this._getCanvasCache(),D=Q&&Q.hit;if(!this.colorKey)n.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()");if(D){K.save();let A=this.getAbsoluteTransform(_).getMatrix();return K.transform(A[0],A[1],A[2],A[3],A[4],A[5]),this._drawCachedHitCanvas(K),K.restore(),this}if(!Z)return this;if(K.save(),K._applyLineJoin(this),K._applyMiterLimit(this),this!==_){let A=this.getAbsoluteTransform(_).getMatrix();K.transform(A[0],A[1],A[2],A[3],A[4],A[5])}return Z.call(this,K,this),K.restore(),this}drawHitFromCache(h=0){let _=this._getCanvasCache(),G=this._getCachedSceneCanvas(),Y=_.hit,X=Y.getContext(),K=Y.getWidth(),Z=Y.getHeight();X.clear(),X.drawImage(G._canvas,0,0,K,Z);try{let Q=X.getImageData(0,0,K,Z),D=Q.data,O=D.length,A=n._hexToRgb(this.colorKey);for(let H=0;H<O;H+=4)if(D[H+3]>h)D[H]=A.r,D[H+1]=A.g,D[H+2]=A.b,D[H+3]=255;else D[H+3]=0;X.putImageData(Q,0,0)}catch(Q){n.error("Unable to draw hit graph from cached scene canvas. "+Q.message)}return this}hasPointerCapture(h){return gJ(h,this)}setPointerCapture(h){IJ(h,this)}releaseCapture(h){o7(h,this)}}U0.prototype._fillFunc=rb;U0.prototype._strokeFunc=eb;U0.prototype._fillFuncHit=hm;U0.prototype._strokeFuncHit=_m;U0.prototype._centroid=!1;U0.prototype.nodeType="Shape";q1(U0);U0.prototype.eventListeners={};U0.prototype.on("shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",Gm);U0.prototype.on("shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",Ym);U0.prototype.on("fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",Xm);U0.prototype.on("fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",Km);U0.prototype.on("fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",Zm);u.addGetterSetter(U0,"stroke",void 0,yB());u.addGetterSetter(U0,"strokeWidth",2,V0());u.addGetterSetter(U0,"fillAfterStrokeEnabled",!1);u.addGetterSetter(U0,"hitStrokeWidth","auto",LY());u.addGetterSetter(U0,"strokeHitEnabled",!0,j5());u.addGetterSetter(U0,"perfectDrawEnabled",!0,j5());u.addGetterSetter(U0,"shadowForStrokeEnabled",!0,j5());u.addGetterSetter(U0,"lineJoin");u.addGetterSetter(U0,"lineCap");u.addGetterSetter(U0,"miterLimit");u.addGetterSetter(U0,"sceneFunc");u.addGetterSetter(U0,"hitFunc");u.addGetterSetter(U0,"dash");u.addGetterSetter(U0,"dashOffset",0,V0());u.addGetterSetter(U0,"shadowColor",void 0,m3());u.addGetterSetter(U0,"shadowBlur",0,V0());u.addGetterSetter(U0,"shadowOpacity",1,V0());u.addComponentsGetterSetter(U0,"shadowOffset",["x","y"]);u.addGetterSetter(U0,"shadowOffsetX",0,V0());u.addGetterSetter(U0,"shadowOffsetY",0,V0());u.addGetterSetter(U0,"fillPatternImage");u.addGetterSetter(U0,"fill",void 0,yB());u.addGetterSetter(U0,"fillPatternX",0,V0());u.addGetterSetter(U0,"fillPatternY",0,V0());u.addGetterSetter(U0,"fillLinearGradientColorStops");u.addGetterSetter(U0,"strokeLinearGradientColorStops");u.addGetterSetter(U0,"fillRadialGradientStartRadius",0);u.addGetterSetter(U0,"fillRadialGradientEndRadius",0);u.addGetterSetter(U0,"fillRadialGradientColorStops");u.addGetterSetter(U0,"fillPatternRepeat","repeat");u.addGetterSetter(U0,"fillEnabled",!0);u.addGetterSetter(U0,"strokeEnabled",!0);u.addGetterSetter(U0,"shadowEnabled",!0);u.addGetterSetter(U0,"dashEnabled",!0);u.addGetterSetter(U0,"strokeScaleEnabled",!0);u.addGetterSetter(U0,"fillPriority","color");u.addComponentsGetterSetter(U0,"fillPatternOffset",["x","y"]);u.addGetterSetter(U0,"fillPatternOffsetX",0,V0());u.addGetterSetter(U0,"fillPatternOffsetY",0,V0());u.addComponentsGetterSetter(U0,"fillPatternScale",["x","y"]);u.addGetterSetter(U0,"fillPatternScaleX",1,V0());u.addGetterSetter(U0,"fillPatternScaleY",1,V0());u.addComponentsGetterSetter(U0,"fillLinearGradientStartPoint",["x","y"]);u.addComponentsGetterSetter(U0,"strokeLinearGradientStartPoint",["x","y"]);u.addGetterSetter(U0,"fillLinearGradientStartPointX",0);u.addGetterSetter(U0,"strokeLinearGradientStartPointX",0);u.addGetterSetter(U0,"fillLinearGradientStartPointY",0);u.addGetterSetter(U0,"strokeLinearGradientStartPointY",0);u.addComponentsGetterSetter(U0,"fillLinearGradientEndPoint",["x","y"]);u.addComponentsGetterSetter(U0,"strokeLinearGradientEndPoint",["x","y"]);u.addGetterSetter(U0,"fillLinearGradientEndPointX",0);u.addGetterSetter(U0,"strokeLinearGradientEndPointX",0);u.addGetterSetter(U0,"fillLinearGradientEndPointY",0);u.addGetterSetter(U0,"strokeLinearGradientEndPointY",0);u.addComponentsGetterSetter(U0,"fillRadialGradientStartPoint",["x","y"]);u.addGetterSetter(U0,"fillRadialGradientStartPointX",0);u.addGetterSetter(U0,"fillRadialGradientStartPointY",0);u.addComponentsGetterSetter(U0,"fillRadialGradientEndPoint",["x","y"]);u.addGetterSetter(U0,"fillRadialGradientEndPointX",0);u.addGetterSetter(U0,"fillRadialGradientEndPointY",0);u.addGetterSetter(U0,"fillPatternRotation",0);u.addGetterSetter(U0,"fillRule",void 0,m3());u.backCompat(U0,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});var Jm="beforeDraw",qm="draw",qL=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],Qm=qL.length;class f3 extends M5{constructor(h){super(h);this.canvas=new t4,this.hitCanvas=new s7({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(h){return this.getContext().clear(h),this.getHitCanvas().getContext().clear(h),this}setZIndex(h){super.setZIndex(h);let _=this.getStage();if(_&&_.content)if(_.content.removeChild(this.getNativeCanvasElement()),h<_.children.length-1)_.content.insertBefore(this.getNativeCanvasElement(),_.children[h+1].getCanvas()._canvas);else _.content.appendChild(this.getNativeCanvasElement());return this}moveToTop(){C0.prototype.moveToTop.call(this);let h=this.getStage();if(h&&h.content)h.content.removeChild(this.getNativeCanvasElement()),h.content.appendChild(this.getNativeCanvasElement());return!0}moveUp(){if(!C0.prototype.moveUp.call(this))return!1;let _=this.getStage();if(!_||!_.content)return!1;if(_.content.removeChild(this.getNativeCanvasElement()),this.index<_.children.length-1)_.content.insertBefore(this.getNativeCanvasElement(),_.children[this.index+1].getCanvas()._canvas);else _.content.appendChild(this.getNativeCanvasElement());return!0}moveDown(){if(C0.prototype.moveDown.call(this)){let h=this.getStage();if(h){let _=h.children;if(h.content)h.content.removeChild(this.getNativeCanvasElement()),h.content.insertBefore(this.getNativeCanvasElement(),_[this.index+1].getCanvas()._canvas)}return!0}return!1}moveToBottom(){if(C0.prototype.moveToBottom.call(this)){let h=this.getStage();if(h){let _=h.children;if(h.content)h.content.removeChild(this.getNativeCanvasElement()),h.content.insertBefore(this.getNativeCanvasElement(),_[1].getCanvas()._canvas)}return!0}return!1}getLayer(){return this}remove(){let h=this.getNativeCanvasElement();if(C0.prototype.remove.call(this),h&&h.parentNode&&n._isInDocument(h))h.parentNode.removeChild(h);return this}getStage(){return this.parent}setSize({width:h,height:_}){return this.canvas.setSize(h,_),this.hitCanvas.setSize(h,_),this._setSmoothEnabled(),this}_validateAdd(h){let _=h.getType();if(_!=="Group"&&_!=="Shape")n.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(h){return h={...h},h.width=h.width||this.getWidth(),h.height=h.height||this.getHeight(),h.x=h.x!==void 0?h.x:this.x(),h.y=h.y!==void 0?h.y:this.y(),C0.prototype._toKonvaCanvas.call(this,h)}_checkVisibility(){if(this.visible())this.canvas._canvas.style.display="block";else this.canvas._canvas.style.display="none"}_setSmoothEnabled(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()}getWidth(){if(this.parent)return this.parent.width()}setWidth(){n.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){n.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){if(!this._waitingForDraw)this._waitingForDraw=!0,n.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1});return this}getIntersection(h){if(!this.isListening()||!this.isVisible())return null;let _=1,G=!1;while(!0){for(let Y=0;Y<Qm;Y++){let X=qL[Y],K=this._getIntersection({x:h.x+X.x*_,y:h.y+X.y*_}),Z=K.shape;if(Z)return Z;if(G=!!K.antialiased,!K.antialiased)break}if(G)_+=1;else return null}}_getIntersection(h){let _=this.hitCanvas.pixelRatio,G=this.hitCanvas.context.getImageData(Math.round(h.x*_),Math.round(h.y*_),1,1).data,Y=G[3];if(Y===255){let X=n.getHitColorKey(G[0],G[1],G[2]),K=r7[X];if(K)return{shape:K};return{antialiased:!0}}else if(Y>0)return{antialiased:!0};return{}}drawScene(h,_,G){let Y=this.getLayer(),X=h||Y&&Y.getCanvas();if(this._fire(Jm,{node:this}),this.clearBeforeDraw())X.getContext().clear();return M5.prototype.drawScene.call(this,X,_,G),this._fire(qm,{node:this}),this}drawHit(h,_){let G=this.getLayer(),Y=h||G&&G.hitCanvas;if(G&&G.clearBeforeDraw())G.getHitCanvas().getContext().clear();return M5.prototype.drawHit.call(this,Y,_),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(h){n.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(h)}getHitGraphEnabled(h){return n.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!this.parent||!this.parent.content)return;let h=this.parent;if(!!this.hitCanvas._canvas.parentNode)h.content.removeChild(this.hitCanvas._canvas);else h.content.appendChild(this.hitCanvas._canvas)}destroy(){return n.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}}f3.prototype.nodeType="Layer";q1(f3);u.addGetterSetter(f3,"imageSmoothingEnabled",!0);u.addGetterSetter(f3,"clearBeforeDraw",!0);u.addGetterSetter(f3,"hitGraphEnabled",!0,j5());class wY extends f3{constructor(h){super(h);this.listening(!1),n.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}wY.prototype.nodeType="FastLayer";q1(wY);class k3 extends M5{_validateAdd(h){let _=h.getType();if(_!=="Group"&&_!=="Shape")n.throw("You may only add groups and shapes to groups.")}}k3.prototype.nodeType="Group";q1(k3);var lB=function(){if(S8.performance&&S8.performance.now)return function(){return S8.performance.now()};return function(){return new Date().getTime()}}();class d5{constructor(h,_){this.id=d5.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:lB(),frameRate:0},this.func=h,this.setLayers(_)}setLayers(h){let _=[];if(h)_=Array.isArray(h)?h:[h];return this.layers=_,this}getLayers(){return this.layers}addLayer(h){let _=this.layers,G=_.length;for(let Y=0;Y<G;Y++)if(_[Y]._id===h._id)return!1;return this.layers.push(h),!0}isRunning(){let _=d5.animations,G=_.length;for(let Y=0;Y<G;Y++)if(_[Y].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=lB(),d5._addAnimation(this),this}stop(){return d5._removeAnimation(this),this}_updateFrameObject(h){this.frame.timeDiff=h-this.frame.lastTime,this.frame.lastTime=h,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1000/this.frame.timeDiff}static _addAnimation(h){this.animations.push(h),this._handleAnimation()}static _removeAnimation(h){let _=h.id,G=this.animations,Y=G.length;for(let X=0;X<Y;X++)if(G[X].id===_){this.animations.splice(X,1);break}}static _runFrames(){let h={},_=this.animations;for(let G=0;G<_.length;G++){let Y=_[G],X=Y.layers,K=Y.func;Y._updateFrameObject(lB());let Z=X.length,Q;if(K)Q=K.call(Y,Y.frame)!==!1;else Q=!0;if(!Q)continue;for(let D=0;D<Z;D++){let O=X[D];if(O._id!==void 0)h[O._id]=O}}for(let G in h){if(!h.hasOwnProperty(G))continue;h[G].batchDraw()}}static _animationLoop(){let h=d5;if(h.animations.length)h._runFrames(),n.requestAnimFrame(h._animationLoop);else h.animRunning=!1}static _handleAnimation(){if(!this.animRunning)this.animRunning=!0,n.requestAnimFrame(this._animationLoop)}}d5.animations=[];d5.animIdCounter=0;d5.animRunning=!1;var Dm={node:1,duration:1,easing:1,onFinish:1,yoyo:1},Mm=1,QL=2,DL=3,ML=["fill","stroke","shadowColor"],Bm=0;class BL{constructor(h,_,G,Y,X,K,Z){this.prop=h,this.propFunc=_,this.begin=Y,this._pos=Y,this.duration=K,this._change=0,this.prevPos=0,this.yoyo=Z,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=G,this._change=X-this.begin,this.pause()}fire(h){let _=this[h];if(_)_()}setTime(h){if(h>this.duration)if(this.yoyo)this._time=this.duration,this.reverse();else this.finish();else if(h<0)if(this.yoyo)this._time=0,this.play();else this.reset();else this._time=h,this.update()}getTime(){return this._time}setPosition(h){this.prevPos=this._pos,this.propFunc(h),this._pos=h}getPosition(h){if(h===void 0)h=this._time;return this.func(h,this.begin,this._change,this.duration)}play(){this.state=QL,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=DL,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(h){this.pause(),this._time=h,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){let h=this.getTimer()-this._startTime;if(this.state===QL)this.setTime(h);else if(this.state===DL)this.setTime(this.duration-h)}pause(){this.state=Mm,this.fire("onPause")}getTimer(){return new Date().getTime()}}class X2{constructor(h){let _=this,G=h.node,Y=G._id,X=h.easing||Y_.Linear,K=!!h.yoyo,Z,Q;if(typeof h.duration>"u")Z=0.3;else if(h.duration===0)Z=0.001;else Z=h.duration;this.node=G,this._id=Bm++;let D=G.getLayer()||(G instanceof $0.Stage?G.getLayers():null);if(!D)n.error("Tween constructor have `node` that is not in a layer. Please add node into layer first.");if(this.anim=new d5(function(){_.tween.onEnterFrame()},D),this.tween=new BL(Q,function(O){_._tweenFunc(O)},X,0,1,Z*1000,K),this._addListeners(),!X2.attrs[Y])X2.attrs[Y]={};if(!X2.attrs[Y][this._id])X2.attrs[Y][this._id]={};if(!X2.tweens[Y])X2.tweens[Y]={};for(Q in h)if(Dm[Q]===void 0)this._addAttr(Q,h[Q]);this.reset(),this.onFinish=h.onFinish,this.onReset=h.onReset,this.onUpdate=h.onUpdate}_addAttr(h,_){let G=this.node,Y=G._id,X,K,Z,Q,D,O=X2.tweens[Y][h];if(O)delete X2.attrs[Y][O][h];let A=G.getAttr(h);if(n._isArray(_)){if(X=[],K=Math.max(_.length,A.length),h==="points"&&_.length!==A.length)if(_.length>A.length)Q=A,A=n._prepareArrayForTween(A,_,G.closed());else Z=_,_=n._prepareArrayForTween(_,A,G.closed());if(h.indexOf("fill")===0)for(let H=0;H<K;H++)if(H%2===0)X.push(_[H]-A[H]);else{let C=n.colorToRGBA(A[H]);D=n.colorToRGBA(_[H]),A[H]=C,X.push({r:D.r-C.r,g:D.g-C.g,b:D.b-C.b,a:D.a-C.a})}else for(let H=0;H<K;H++)X.push(_[H]-A[H])}else if(ML.indexOf(h)!==-1)A=n.colorToRGBA(A),D=n.colorToRGBA(_),X={r:D.r-A.r,g:D.g-A.g,b:D.b-A.b,a:D.a-A.a};else X=_-A;X2.attrs[Y][this._id][h]={start:A,diff:X,end:_,trueEnd:Z,trueStart:Q},X2.tweens[Y][h]=this._id}_tweenFunc(h){let _=this.node,G=X2.attrs[_._id][this._id],Y,X,K,Z,Q,D,O,A;for(Y in G){if(X=G[Y],K=X.start,Z=X.diff,A=X.end,n._isArray(K))if(Q=[],O=Math.max(K.length,A.length),Y.indexOf("fill")===0)for(D=0;D<O;D++)if(D%2===0)Q.push((K[D]||0)+Z[D]*h);else Q.push("rgba("+Math.round(K[D].r+Z[D].r*h)+","+Math.round(K[D].g+Z[D].g*h)+","+Math.round(K[D].b+Z[D].b*h)+","+(K[D].a+Z[D].a*h)+")");else for(D=0;D<O;D++)Q.push((K[D]||0)+Z[D]*h);else if(ML.indexOf(Y)!==-1)Q="rgba("+Math.round(K.r+Z.r*h)+","+Math.round(K.g+Z.g*h)+","+Math.round(K.b+Z.b*h)+","+(K.a+Z.a*h)+")";else Q=K+Z*h;_.setAttr(Y,Q)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{let h=this.node,_=X2.attrs[h._id][this._id];if(_.points&&_.points.trueEnd)h.setAttr("points",_.points.trueEnd);if(this.onFinish)this.onFinish.call(this)},this.tween.onReset=()=>{let h=this.node,_=X2.attrs[h._id][this._id];if(_.points&&_.points.trueStart)h.points(_.points.trueStart);if(this.onReset)this.onReset()},this.tween.onUpdate=()=>{if(this.onUpdate)this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(h){return this.tween.seek(h*1000),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){let h=this.node._id,_=this._id,G=X2.tweens[h];if(this.pause(),this.anim)this.anim.stop();for(let Y in G)delete X2.tweens[h][Y];if(delete X2.attrs[h][_],X2.tweens[h]){if(Object.keys(X2.tweens[h]).length===0)delete X2.tweens[h];if(Object.keys(X2.attrs[h]).length===0)delete X2.attrs[h]}}}X2.attrs={};X2.tweens={};C0.prototype.to=function(h){let _=h.onFinish;h.node=this,h.onFinish=function(){if(this.destroy(),_)_()},new X2(h).play()};var Y_={BackEaseIn(h,_,G,Y){return G*(h/=Y)*h*(2.70158*h-1.70158)+_},BackEaseOut(h,_,G,Y){return G*((h=h/Y-1)*h*(2.70158*h+1.70158)+1)+_},BackEaseInOut(h,_,G,Y){let X=1.70158;if((h/=Y/2)<1)return G/2*(h*h*(((X*=1.525)+1)*h-X))+_;return G/2*((h-=2)*h*(((X*=1.525)+1)*h+X)+2)+_},ElasticEaseIn(h,_,G,Y,X,K){let Z=0;if(h===0)return _;if((h/=Y)===1)return _+G;if(!K)K=Y*0.3;if(!X||X<Math.abs(G))X=G,Z=K/4;else Z=K/(2*Math.PI)*Math.asin(G/X);return-(X*Math.pow(2,10*(h-=1))*Math.sin((h*Y-Z)*(2*Math.PI)/K))+_},ElasticEaseOut(h,_,G,Y,X,K){let Z=0;if(h===0)return _;if((h/=Y)===1)return _+G;if(!K)K=Y*0.3;if(!X||X<Math.abs(G))X=G,Z=K/4;else Z=K/(2*Math.PI)*Math.asin(G/X);return X*Math.pow(2,-10*h)*Math.sin((h*Y-Z)*(2*Math.PI)/K)+G+_},ElasticEaseInOut(h,_,G,Y,X,K){let Z=0;if(h===0)return _;if((h/=Y/2)===2)return _+G;if(!K)K=Y*0.44999999999999996;if(!X||X<Math.abs(G))X=G,Z=K/4;else Z=K/(2*Math.PI)*Math.asin(G/X);if(h<1)return-0.5*(X*Math.pow(2,10*(h-=1))*Math.sin((h*Y-Z)*(2*Math.PI)/K))+_;return X*Math.pow(2,-10*(h-=1))*Math.sin((h*Y-Z)*(2*Math.PI)/K)*0.5+G+_},BounceEaseOut(h,_,G,Y){if((h/=Y)<0.36363636363636365)return G*(7.5625*h*h)+_;else if(h<0.7272727272727273)return G*(7.5625*(h-=0.5454545454545454)*h+0.75)+_;else if(h<0.9090909090909091)return G*(7.5625*(h-=0.8181818181818182)*h+0.9375)+_;else return G*(7.5625*(h-=0.9545454545454546)*h+0.984375)+_},BounceEaseIn(h,_,G,Y){return G-Y_.BounceEaseOut(Y-h,0,G,Y)+_},BounceEaseInOut(h,_,G,Y){if(h<Y/2)return Y_.BounceEaseIn(h*2,0,G,Y)*0.5+_;else return Y_.BounceEaseOut(h*2-Y,0,G,Y)*0.5+G*0.5+_},EaseIn(h,_,G,Y){return G*(h/=Y)*h+_},EaseOut(h,_,G,Y){return-G*(h/=Y)*(h-2)+_},EaseInOut(h,_,G,Y){if((h/=Y/2)<1)return G/2*h*h+_;return-G/2*(--h*(h-2)-1)+_},StrongEaseIn(h,_,G,Y){return G*(h/=Y)*h*h*h*h+_},StrongEaseOut(h,_,G,Y){return G*((h=h/Y-1)*h*h*h*h+1)+_},StrongEaseInOut(h,_,G,Y){if((h/=Y/2)<1)return G/2*h*h*h*h*h+_;return G/2*((h-=2)*h*h*h*h+2)+_},Linear(h,_,G,Y){return G*h/Y+_}};var X_=n._assign($0,{Util:n,Transform:L5,Node:C0,Container:M5,Stage:G_,stages:__,Layer:f3,FastLayer:wY,Group:k3,DD:W1,Shape:U0,shapes:r7,Animation:d5,Tween:X2,Easings:Y_,Context:rh,Canvas:$Y});class M3 extends U0{_sceneFunc(h){let _=$0.getAngle(this.angle()),G=this.clockwise();h.beginPath(),h.arc(0,0,this.outerRadius(),0,_,G),h.arc(0,0,this.innerRadius(),_,0,!G),h.closePath(),h.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(h){this.outerRadius(h/2)}setHeight(h){this.outerRadius(h/2)}getSelfRect(){let h=this.innerRadius(),_=this.outerRadius(),G=this.clockwise(),Y=$0.getAngle(G?360-this.angle():this.angle()),X=Math.cos(Math.min(Y,Math.PI)),K=1,Z=Math.sin(Math.min(Math.max(Math.PI,Y),3*Math.PI/2)),Q=Math.sin(Math.min(Y,Math.PI/2)),D=X*(X>0?h:_),O=1*_,A=Z*(Z>0?h:_),H=Q*(Q>0?_:h);return{x:D,y:G?-1*H:A,width:O-D,height:H-A}}}M3.prototype._centroid=!0;M3.prototype.className="Arc";M3.prototype._attrsAffectingSize=["innerRadius","outerRadius","angle","clockwise"];q1(M3);u.addGetterSetter(M3,"innerRadius",0,V0());u.addGetterSetter(M3,"outerRadius",0,V0());u.addGetterSetter(M3,"angle",0,V0());u.addGetterSetter(M3,"clockwise",!1,j5());function iB(h,_,G,Y,X,K,Z){let Q=Math.sqrt(Math.pow(G-h,2)+Math.pow(Y-_,2)),D=Math.sqrt(Math.pow(X-G,2)+Math.pow(K-Y,2)),O=Z*Q/(Q+D),A=Z*D/(Q+D),H=G-O*(X-h),C=Y-O*(K-_),N=G+A*(X-h),j=Y+A*(K-_);return[H,C,N,j]}function OL(h,_){let G=h.length,Y=[];for(let X=2;X<G-2;X+=2){let K=iB(h[X-2],h[X-1],h[X],h[X+1],h[X+2],h[X+3],_);if(isNaN(K[0]))continue;Y.push(K[0]),Y.push(K[1]),Y.push(h[X]),Y.push(h[X+1]),Y.push(K[2]),Y.push(K[3])}return Y}function Om(h){let _=[[h[0],h[2],h[4],h[6]],[h[1],h[3],h[5],h[7]]],G=[];for(let Y of _){let X=-3*Y[0]+9*Y[1]-9*Y[2]+3*Y[3];if(X!==0){let K=6*Y[0]-12*Y[1]+6*Y[2],Z=-3*Y[0]+3*Y[1],Q=K*K-4*X*Z;if(Q>=0){let D=Math.sqrt(Q);G.push((-K+D)/(2*X)),G.push((-K-D)/(2*X))}}}return G.filter((Y)=>Y>0&&Y<1).flatMap((Y)=>_.map((X)=>{let K=1-Y;return K*K*K*X[0]+3*K*K*Y*X[1]+3*K*Y*Y*X[2]+Y*Y*Y*X[3]}))}class s4 extends U0{constructor(h){super(h);this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(h){let _=this.points(),G=_.length,Y=this.tension(),X=this.closed(),K=this.bezier();if(!G)return;let Z=0;if(h.beginPath(),h.moveTo(_[0],_[1]),Y!==0&&G>4){let Q=this.getTensionPoints(),D=Q.length;if(Z=X?0:4,!X)h.quadraticCurveTo(Q[0],Q[1],Q[2],Q[3]);while(Z<D-2)h.bezierCurveTo(Q[Z++],Q[Z++],Q[Z++],Q[Z++],Q[Z++],Q[Z++]);if(!X)h.quadraticCurveTo(Q[D-2],Q[D-1],_[G-2],_[G-1])}else if(K){Z=2;while(Z<G)h.bezierCurveTo(_[Z++],_[Z++],_[Z++],_[Z++],_[Z++],_[Z++])}else for(Z=2;Z<G;Z+=2)h.lineTo(_[Z],_[Z+1]);if(X)h.closePath(),h.fillStrokeShape(this);else h.strokeShape(this)}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){if(this.closed())return this._getTensionPointsClosed();else return OL(this.points(),this.tension())}_getTensionPointsClosed(){let h=this.points(),_=h.length,G=this.tension(),Y=iB(h[_-2],h[_-1],h[0],h[1],h[2],h[3],G),X=iB(h[_-4],h[_-3],h[_-2],h[_-1],h[0],h[1],G),K=OL(h,G);return[Y[2],Y[3]].concat(K).concat([X[0],X[1],h[_-2],h[_-1],X[2],X[3],Y[0],Y[1],h[0],h[1]])}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){let h=this.points();if(h.length<4)return{x:h[0]||0,y:h[1]||0,width:0,height:0};if(this.tension()!==0)h=[h[0],h[1],...this._getTensionPoints(),h[h.length-2],h[h.length-1]];else if(this.bezier())h=[h[0],h[1],...Om(this.points()),h[h.length-2],h[h.length-1]];else h=this.points();let _=h[0],G=h[0],Y=h[1],X=h[1],K,Z;for(let Q=0;Q<h.length/2;Q++)K=h[Q*2],Z=h[Q*2+1],_=Math.min(_,K),G=Math.max(G,K),Y=Math.min(Y,Z),X=Math.max(X,Z);return{x:_,y:Y,width:G-_,height:X-Y}}}s4.prototype.className="Line";s4.prototype._attrsAffectingSize=["points","bezier","tension"];q1(s4);u.addGetterSetter(s4,"closed",!1);u.addGetterSetter(s4,"bezier",!1);u.addGetterSetter(s4,"tension",0,V0());u.addGetterSetter(s4,"points",[],y$());var Am=[[],[],[-0.5773502691896257,0.5773502691896257],[0,-0.7745966692414834,0.7745966692414834],[-0.33998104358485626,0.33998104358485626,-0.8611363115940526,0.8611363115940526],[0,-0.5384693101056831,0.5384693101056831,-0.906179845938664,0.906179845938664],[0.6612093864662645,-0.6612093864662645,-0.2386191860831969,0.2386191860831969,-0.932469514203152,0.932469514203152],[0,0.4058451513773972,-0.4058451513773972,-0.7415311855993945,0.7415311855993945,-0.9491079123427585,0.9491079123427585],[-0.1834346424956498,0.1834346424956498,-0.525532409916329,0.525532409916329,-0.7966664774136267,0.7966664774136267,-0.9602898564975363,0.9602898564975363],[0,-0.8360311073266358,0.8360311073266358,-0.9681602395076261,0.9681602395076261,-0.3242534234038089,0.3242534234038089,-0.6133714327005904,0.6133714327005904],[-0.14887433898163122,0.14887433898163122,-0.4333953941292472,0.4333953941292472,-0.6794095682990244,0.6794095682990244,-0.8650633666889845,0.8650633666889845,-0.9739065285171717,0.9739065285171717],[0,-0.26954315595234496,0.26954315595234496,-0.5190961292068118,0.5190961292068118,-0.7301520055740494,0.7301520055740494,-0.8870625997680953,0.8870625997680953,-0.978228658146057,0.978228658146057],[-0.1252334085114689,0.1252334085114689,-0.3678314989981802,0.3678314989981802,-0.5873179542866175,0.5873179542866175,-0.7699026741943047,0.7699026741943047,-0.9041172563704749,0.9041172563704749,-0.9815606342467192,0.9815606342467192],[0,-0.2304583159551348,0.2304583159551348,-0.44849275103644687,0.44849275103644687,-0.6423493394403402,0.6423493394403402,-0.8015780907333099,0.8015780907333099,-0.9175983992229779,0.9175983992229779,-0.9841830547185881,0.9841830547185881],[-0.10805494870734367,0.10805494870734367,-0.31911236892788974,0.31911236892788974,-0.5152486363581541,0.5152486363581541,-0.6872929048116855,0.6872929048116855,-0.827201315069765,0.827201315069765,-0.9284348836635735,0.9284348836635735,-0.9862838086968123,0.9862838086968123],[0,-0.20119409399743451,0.20119409399743451,-0.3941513470775634,0.3941513470775634,-0.5709721726085388,0.5709721726085388,-0.7244177313601701,0.7244177313601701,-0.8482065834104272,0.8482065834104272,-0.937273392400706,0.937273392400706,-0.9879925180204854,0.9879925180204854],[-0.09501250983763744,0.09501250983763744,-0.2816035507792589,0.2816035507792589,-0.45801677765722737,0.45801677765722737,-0.6178762444026438,0.6178762444026438,-0.755404408355003,0.755404408355003,-0.8656312023878318,0.8656312023878318,-0.9445750230732326,0.9445750230732326,-0.9894009349916499,0.9894009349916499],[0,-0.17848418149584785,0.17848418149584785,-0.3512317634538763,0.3512317634538763,-0.5126905370864769,0.5126905370864769,-0.6576711592166907,0.6576711592166907,-0.7815140038968014,0.7815140038968014,-0.8802391537269859,0.8802391537269859,-0.9506755217687678,0.9506755217687678,-0.9905754753144174,0.9905754753144174],[-0.0847750130417353,0.0847750130417353,-0.2518862256915055,0.2518862256915055,-0.41175116146284263,0.41175116146284263,-0.5597708310739475,0.5597708310739475,-0.6916870430603532,0.6916870430603532,-0.8037049589725231,0.8037049589725231,-0.8926024664975557,0.8926024664975557,-0.9558239495713977,0.9558239495713977,-0.9915651684209309,0.9915651684209309],[0,-0.16035864564022537,0.16035864564022537,-0.31656409996362983,0.31656409996362983,-0.46457074137596094,0.46457074137596094,-0.600545304661681,0.600545304661681,-0.7209661773352294,0.7209661773352294,-0.8227146565371428,0.8227146565371428,-0.9031559036148179,0.9031559036148179,-0.96020815213483,0.96020815213483,-0.9924068438435844,0.9924068438435844],[-0.07652652113349734,0.07652652113349734,-0.22778585114164507,0.22778585114164507,-0.37370608871541955,0.37370608871541955,-0.5108670019508271,0.5108670019508271,-0.636053680726515,0.636053680726515,-0.7463319064601508,0.7463319064601508,-0.8391169718222188,0.8391169718222188,-0.912234428251326,0.912234428251326,-0.9639719272779138,0.9639719272779138,-0.9931285991850949,0.9931285991850949],[0,-0.1455618541608951,0.1455618541608951,-0.2880213168024011,0.2880213168024011,-0.4243421202074388,0.4243421202074388,-0.5516188358872198,0.5516188358872198,-0.6671388041974123,0.6671388041974123,-0.7684399634756779,0.7684399634756779,-0.8533633645833173,0.8533633645833173,-0.9200993341504008,0.9200993341504008,-0.9672268385663063,0.9672268385663063,-0.9937521706203895,0.9937521706203895],[-0.06973927331972223,0.06973927331972223,-0.20786042668822127,0.20786042668822127,-0.34193582089208424,0.34193582089208424,-0.469355837986757,0.469355837986757,-0.5876404035069116,0.5876404035069116,-0.6944872631866827,0.6944872631866827,-0.7878168059792081,0.7878168059792081,-0.8658125777203002,0.8658125777203002,-0.926956772187174,0.926956772187174,-0.9700604978354287,0.9700604978354287,-0.9942945854823992,0.9942945854823992],[0,-0.1332568242984661,0.1332568242984661,-0.26413568097034495,0.26413568097034495,-0.3903010380302908,0.3903010380302908,-0.5095014778460075,0.5095014778460075,-0.6196098757636461,0.6196098757636461,-0.7186613631319502,0.7186613631319502,-0.8048884016188399,0.8048884016188399,-0.8767523582704416,0.8767523582704416,-0.9329710868260161,0.9329710868260161,-0.9725424712181152,0.9725424712181152,-0.9947693349975522,0.9947693349975522],[-0.06405689286260563,0.06405689286260563,-0.1911188674736163,0.1911188674736163,-0.3150426796961634,0.3150426796961634,-0.4337935076260451,0.4337935076260451,-0.5454214713888396,0.5454214713888396,-0.6480936519369755,0.6480936519369755,-0.7401241915785544,0.7401241915785544,-0.820001985973903,0.820001985973903,-0.8864155270044011,0.8864155270044011,-0.9382745520027328,0.9382745520027328,-0.9747285559713095,0.9747285559713095,-0.9951872199970213,0.9951872199970213]],zm=[[],[],[1,1],[0.8888888888888888,0.5555555555555556,0.5555555555555556],[0.6521451548625461,0.6521451548625461,0.34785484513745385,0.34785484513745385],[0.5688888888888889,0.47862867049936647,0.47862867049936647,0.23692688505618908,0.23692688505618908],[0.3607615730481386,0.3607615730481386,0.46791393457269104,0.46791393457269104,0.17132449237917036,0.17132449237917036],[0.4179591836734694,0.3818300505051189,0.3818300505051189,0.27970539148927664,0.27970539148927664,0.1294849661688697,0.1294849661688697],[0.362683783378362,0.362683783378362,0.31370664587788727,0.31370664587788727,0.22238103445337448,0.22238103445337448,0.10122853629037626,0.10122853629037626],[0.3302393550012598,0.1806481606948574,0.1806481606948574,0.08127438836157441,0.08127438836157441,0.31234707704000286,0.31234707704000286,0.26061069640293544,0.26061069640293544],[0.29552422471475287,0.29552422471475287,0.26926671930999635,0.26926671930999635,0.21908636251598204,0.21908636251598204,0.1494513491505806,0.1494513491505806,0.06667134430868814,0.06667134430868814],[0.2729250867779006,0.26280454451024665,0.26280454451024665,0.23319376459199048,0.23319376459199048,0.18629021092773426,0.18629021092773426,0.1255803694649046,0.1255803694649046,0.05566856711617366,0.05566856711617366],[0.24914704581340277,0.24914704581340277,0.2334925365383548,0.2334925365383548,0.20316742672306592,0.20316742672306592,0.16007832854334622,0.16007832854334622,0.10693932599531843,0.10693932599531843,0.04717533638651183,0.04717533638651183],[0.2325515532308739,0.22628318026289723,0.22628318026289723,0.2078160475368885,0.2078160475368885,0.17814598076194574,0.17814598076194574,0.13887351021978725,0.13887351021978725,0.09212149983772845,0.09212149983772845,0.04048400476531588,0.04048400476531588],[0.2152638534631578,0.2152638534631578,0.2051984637212956,0.2051984637212956,0.18553839747793782,0.18553839747793782,0.15720316715819355,0.15720316715819355,0.12151857068790319,0.12151857068790319,0.08015808715976021,0.08015808715976021,0.03511946033175186,0.03511946033175186],[0.2025782419255613,0.19843148532711158,0.19843148532711158,0.1861610000155622,0.1861610000155622,0.16626920581699392,0.16626920581699392,0.13957067792615432,0.13957067792615432,0.10715922046717194,0.10715922046717194,0.07036604748810812,0.07036604748810812,0.03075324199611727,0.03075324199611727],[0.1894506104550685,0.1894506104550685,0.18260341504492358,0.18260341504492358,0.16915651939500254,0.16915651939500254,0.14959598881657674,0.14959598881657674,0.12462897125553388,0.12462897125553388,0.09515851168249279,0.09515851168249279,0.062253523938647894,0.062253523938647894,0.027152459411754096,0.027152459411754096],[0.17944647035620653,0.17656270536699264,0.17656270536699264,0.16800410215645004,0.16800410215645004,0.15404576107681028,0.15404576107681028,0.13513636846852548,0.13513636846852548,0.11188384719340397,0.11188384719340397,0.08503614831717918,0.08503614831717918,0.0554595293739872,0.0554595293739872,0.02414830286854793,0.02414830286854793],[0.1691423829631436,0.1691423829631436,0.16427648374583273,0.16427648374583273,0.15468467512626524,0.15468467512626524,0.14064291467065065,0.14064291467065065,0.12255520671147846,0.12255520671147846,0.10094204410628717,0.10094204410628717,0.07642573025488905,0.07642573025488905,0.0497145488949698,0.0497145488949698,0.02161601352648331,0.02161601352648331],[0.1610544498487837,0.15896884339395434,0.15896884339395434,0.15276604206585967,0.15276604206585967,0.1426067021736066,0.1426067021736066,0.12875396253933621,0.12875396253933621,0.11156664554733399,0.11156664554733399,0.09149002162245,0.09149002162245,0.06904454273764123,0.06904454273764123,0.0448142267656996,0.0448142267656996,0.019461788229726478,0.019461788229726478],[0.15275338713072584,0.15275338713072584,0.14917298647260374,0.14917298647260374,0.14209610931838204,0.14209610931838204,0.13168863844917664,0.13168863844917664,0.11819453196151841,0.11819453196151841,0.10193011981724044,0.10193011981724044,0.08327674157670475,0.08327674157670475,0.06267204833410907,0.06267204833410907,0.04060142980038694,0.04060142980038694,0.017614007139152118,0.017614007139152118],[0.14608113364969041,0.14452440398997005,0.14452440398997005,0.13988739479107315,0.13988739479107315,0.13226893863333747,0.13226893863333747,0.12183141605372853,0.12183141605372853,0.10879729916714838,0.10879729916714838,0.09344442345603386,0.09344442345603386,0.0761001136283793,0.0761001136283793,0.057134425426857205,0.057134425426857205,0.036953789770852494,0.036953789770852494,0.016017228257774335,0.016017228257774335],[0.13925187285563198,0.13925187285563198,0.13654149834601517,0.13654149834601517,0.13117350478706238,0.13117350478706238,0.12325237681051242,0.12325237681051242,0.11293229608053922,0.11293229608053922,0.10041414444288096,0.10041414444288096,0.08594160621706773,0.08594160621706773,0.06979646842452049,0.06979646842452049,0.052293335152683286,0.052293335152683286,0.03377490158481415,0.03377490158481415,0.0146279952982722,0.0146279952982722],[0.13365457218610619,0.1324620394046966,0.1324620394046966,0.12890572218808216,0.12890572218808216,0.12304908430672953,0.12304908430672953,0.11499664022241136,0.11499664022241136,0.10489209146454141,0.10489209146454141,0.09291576606003515,0.09291576606003515,0.07928141177671895,0.07928141177671895,0.06423242140852585,0.06423242140852585,0.04803767173108467,0.04803767173108467,0.030988005856979445,0.030988005856979445,0.013411859487141771,0.013411859487141771],[0.12793819534675216,0.12793819534675216,0.1258374563468283,0.1258374563468283,0.12167047292780339,0.12167047292780339,0.1155056680537256,0.1155056680537256,0.10744427011596563,0.10744427011596563,0.09761865210411388,0.09761865210411388,0.08619016153195327,0.08619016153195327,0.0733464814110803,0.0733464814110803,0.05929858491543678,0.05929858491543678,0.04427743881741981,0.04427743881741981,0.028531388628933663,0.028531388628933663,0.0123412297999872,0.0123412297999872]],Hm=[[1],[1,1],[1,2,1],[1,3,3,1]],dB=(h,_,G)=>{let Y,X,K=20,Z=G/2;Y=0;for(let Q=0;Q<20;Q++)X=Z*Am[20][Q]+Z,Y+=zm[20][Q]*Vm(h,_,X);return Z*Y},aB=(h,_,G)=>{if(G===void 0)G=1;let Y=h[0]-2*h[1]+h[2],X=_[0]-2*_[1]+_[2],K=2*h[1]-2*h[0],Z=2*_[1]-2*_[0],Q=4*(Y*Y+X*X),D=4*(Y*K+X*Z),O=K*K+Z*Z;if(Q===0)return G*Math.sqrt(Math.pow(h[2]-h[0],2)+Math.pow(_[2]-_[0],2));let A=D/(2*Q),H=O/Q,C=G+A,N=H-A*A,j=C*C+N>0?Math.sqrt(C*C+N):0,W=A*A+N>0?Math.sqrt(A*A+N):0,S=A+Math.sqrt(A*A+N)!==0?N*Math.log(Math.abs((C+j)/(A+W))):0;return Math.sqrt(Q)/2*(C*j-A*W+S)};function Vm(h,_,G){let Y=cB(1,G,h),X=cB(1,G,_),K=Y*Y+X*X;return Math.sqrt(K)}var cB=(h,_,G)=>{let Y=G.length-1,X,K;if(Y===0)return 0;if(h===0){K=0;for(let Z=0;Z<=Y;Z++)K+=Hm[Y][Z]*Math.pow(1-_,Y-Z)*Math.pow(_,Z)*G[Z];return K}else{X=Array(Y);for(let Z=0;Z<Y;Z++)X[Z]=Y*(G[Z+1]-G[Z]);return cB(h-1,_,X)}},tB=(h,_,G)=>{let Y=1,X=h/_,K=(h-G(X))/_,Z=0;while(Y>0.001){let Q=G(X+K),D=Math.abs(h-Q)/_;if(D<Y)Y=D,X+=K;else{let O=G(X-K),A=Math.abs(h-O)/_;if(A<Y)Y=A,X-=K;else K/=2}if(Z++,Z>500)break}return X};class t1 extends U0{constructor(h){super(h);this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=t1.parsePathData(this.data()),this.pathLength=t1.getPathLength(this.dataArray)}_sceneFunc(h){let _=this.dataArray;h.beginPath();let G=!1;for(let Y=0;Y<_.length;Y++){let X=_[Y].command,K=_[Y].points;switch(X){case"L":h.lineTo(K[0],K[1]);break;case"M":h.moveTo(K[0],K[1]);break;case"C":h.bezierCurveTo(K[0],K[1],K[2],K[3],K[4],K[5]);break;case"Q":h.quadraticCurveTo(K[0],K[1],K[2],K[3]);break;case"A":let Z=K[0],Q=K[1],D=K[2],O=K[3],A=K[4],H=K[5],C=K[6],N=K[7],j=D>O?D:O,W=D>O?1:D/O,S=D>O?O/D:1;h.translate(Z,Q),h.rotate(C),h.scale(W,S),h.arc(0,0,j,A,A+H,1-N),h.scale(1/W,1/S),h.rotate(-C),h.translate(-Z,-Q);break;case"z":G=!0,h.closePath();break}}if(!G&&!this.hasFill())h.strokeShape(this);else h.fillStrokeShape(this)}getSelfRect(){let h=[];this.dataArray.forEach(function(Q){if(Q.command==="A"){let D=Q.points[4],O=Q.points[5],A=Q.points[4]+O,H=Math.PI/180;if(Math.abs(D-A)<H)H=Math.abs(D-A);if(O<0)for(let C=D-H;C>A;C-=H){let N=t1.getPointOnEllipticalArc(Q.points[0],Q.points[1],Q.points[2],Q.points[3],C,0);h.push(N.x,N.y)}else for(let C=D+H;C<A;C+=H){let N=t1.getPointOnEllipticalArc(Q.points[0],Q.points[1],Q.points[2],Q.points[3],C,0);h.push(N.x,N.y)}}else if(Q.command==="C")for(let D=0;D<=1;D+=0.01){let O=t1.getPointOnCubicBezier(D,Q.start.x,Q.start.y,Q.points[0],Q.points[1],Q.points[2],Q.points[3],Q.points[4],Q.points[5]);h.push(O.x,O.y)}else h=h.concat(Q.points)});let _=h[0],G=h[0],Y=h[1],X=h[1],K,Z;for(let Q=0;Q<h.length/2;Q++){if(K=h[Q*2],Z=h[Q*2+1],!isNaN(K))_=Math.min(_,K),G=Math.max(G,K);if(!isNaN(Z))Y=Math.min(Y,Z),X=Math.max(X,Z)}return{x:_,y:Y,width:G-_,height:X-Y}}getLength(){return this.pathLength}getPointAtLength(h){return t1.getPointAtLengthOfDataArray(h,this.dataArray)}static getLineLength(h,_,G,Y){return Math.sqrt((G-h)*(G-h)+(Y-_)*(Y-_))}static getPathLength(h){let _=0;for(let G=0;G<h.length;++G)_+=h[G].pathLength;return _}static getPointAtLengthOfDataArray(h,_){let G,Y=0,X=_.length;if(!X)return null;while(Y<X&&h>_[Y].pathLength)h-=_[Y].pathLength,++Y;if(Y===X)return G=_[Y-1].points.slice(-2),{x:G[0],y:G[1]};if(h<0.01)if(_[Y].command==="M")return G=_[Y].points.slice(0,2),{x:G[0],y:G[1]};else return{x:_[Y].start.x,y:_[Y].start.y};let K=_[Y],Z=K.points;switch(K.command){case"L":return t1.getPointOnLine(h,K.start.x,K.start.y,Z[0],Z[1]);case"C":return t1.getPointOnCubicBezier(tB(h,t1.getPathLength(_),(j)=>{return dB([K.start.x,Z[0],Z[2],Z[4]],[K.start.y,Z[1],Z[3],Z[5]],j)}),K.start.x,K.start.y,Z[0],Z[1],Z[2],Z[3],Z[4],Z[5]);case"Q":return t1.getPointOnQuadraticBezier(tB(h,t1.getPathLength(_),(j)=>{return aB([K.start.x,Z[0],Z[2]],[K.start.y,Z[1],Z[3]],j)}),K.start.x,K.start.y,Z[0],Z[1],Z[2],Z[3]);case"A":let Q=Z[0],D=Z[1],O=Z[2],A=Z[3],H=Z[5],C=Z[6],N=Z[4];return N+=H*h/K.pathLength,t1.getPointOnEllipticalArc(Q,D,O,A,N,C)}return null}static getPointOnLine(h,_,G,Y,X,K,Z){K=K!==null&&K!==void 0?K:_,Z=Z!==null&&Z!==void 0?Z:G;let Q=this.getLineLength(_,G,Y,X);if(Q<0.0000000001)return{x:_,y:G};if(Y===_)return{x:K,y:Z+(X>G?h:-h)};let D=(X-G)/(Y-_),O=Math.sqrt(h*h/(1+D*D))*(Y<_?-1:1),A=D*O;if(Math.abs(Z-G-D*(K-_))<0.0000000001)return{x:K+O,y:Z+A};let H=((K-_)*(Y-_)+(Z-G)*(X-G))/(Q*Q),C=_+H*(Y-_),N=G+H*(X-G),j=this.getLineLength(K,Z,C,N),W=Math.sqrt(h*h-j*j),S=Math.sqrt(W*W/(1+D*D))*(Y<_?-1:1),R=D*S;return{x:C+S,y:N+R}}static getPointOnCubicBezier(h,_,G,Y,X,K,Z,Q,D){function O(W){return W*W*W}function A(W){return 3*W*W*(1-W)}function H(W){return 3*W*(1-W)*(1-W)}function C(W){return(1-W)*(1-W)*(1-W)}let N=Q*O(h)+K*A(h)+Y*H(h)+_*C(h),j=D*O(h)+Z*A(h)+X*H(h)+G*C(h);return{x:N,y:j}}static getPointOnQuadraticBezier(h,_,G,Y,X,K,Z){function Q(C){return C*C}function D(C){return 2*C*(1-C)}function O(C){return(1-C)*(1-C)}let A=K*Q(h)+Y*D(h)+_*O(h),H=Z*Q(h)+X*D(h)+G*O(h);return{x:A,y:H}}static getPointOnEllipticalArc(h,_,G,Y,X,K){let Z=Math.cos(K),Q=Math.sin(K),D={x:G*Math.cos(X),y:Y*Math.sin(X)};return{x:h+(D.x*Z-D.y*Q),y:_+(D.x*Q+D.y*Z)}}static parsePathData(h){if(!h)return[];let _=h,G=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];_=_.replace(new RegExp(" ","g"),",");for(let A=0;A<G.length;A++)_=_.replace(new RegExp(G[A],"g"),"|"+G[A]);let Y=_.split("|"),X=[],K=[],Z=0,Q=0,D=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi,O;for(let A=1;A<Y.length;A++){let H=Y[A],C=H.charAt(0);H=H.slice(1),K.length=0;while(O=D.exec(H))K.push(O[0]);let N=[],j=C==="A"||C==="a"?0:-1;for(let W=0,S=K.length;W<S;W++){let R=K[W];if(R==="00"){if(N.push(0,0),j>=0){if(j+=2,j>=7)j-=7}continue}if(j>=0){if(j===3){if(/^[01]{2}\d+(?:\.\d+)?$/.test(R)){if(N.push(parseInt(R[0],10)),N.push(parseInt(R[1],10)),N.push(parseFloat(R.slice(2))),j+=3,j>=7)j-=7;continue}if(R==="11"||R==="10"||R==="01"){if(N.push(parseInt(R[0],10)),N.push(parseInt(R[1],10)),j+=2,j>=7)j-=7;continue}if(R==="0"||R==="1"){if(N.push(parseInt(R,10)),j+=1,j>=7)j-=7;continue}}else if(j===4){if(/^[01]\d+(?:\.\d+)?$/.test(R)){if(N.push(parseInt(R[0],10)),N.push(parseFloat(R.slice(1))),j+=2,j>=7)j-=7;continue}if(R==="0"||R==="1"){if(N.push(parseInt(R,10)),j+=1,j>=7)j-=7;continue}}let v=parseFloat(R);if(!isNaN(v))N.push(v);else N.push(0);if(j+=1,j>=7)j-=7}else{let v=parseFloat(R);if(!isNaN(v))N.push(v);else N.push(0)}}while(N.length>0){if(isNaN(N[0]))break;let W="",S=[],R=Z,v=Q,x,P,I,b,l,i,h0,q0,Q0,o;switch(C){case"l":Z+=N.shift(),Q+=N.shift(),W="L",S.push(Z,Q);break;case"L":Z=N.shift(),Q=N.shift(),S.push(Z,Q);break;case"m":let r=N.shift(),d=N.shift();if(Z+=r,Q+=d,W="M",X.length>2&&X[X.length-1].command==="z"){for(let s=X.length-2;s>=0;s--)if(X[s].command==="M"){Z=X[s].points[0]+r,Q=X[s].points[1]+d;break}}S.push(Z,Q),C="l";break;case"M":Z=N.shift(),Q=N.shift(),W="M",S.push(Z,Q),C="L";break;case"h":Z+=N.shift(),W="L",S.push(Z,Q);break;case"H":Z=N.shift(),W="L",S.push(Z,Q);break;case"v":Q+=N.shift(),W="L",S.push(Z,Q);break;case"V":Q=N.shift(),W="L",S.push(Z,Q);break;case"C":S.push(N.shift(),N.shift(),N.shift(),N.shift()),Z=N.shift(),Q=N.shift(),S.push(Z,Q);break;case"c":S.push(Z+N.shift(),Q+N.shift(),Z+N.shift(),Q+N.shift()),Z+=N.shift(),Q+=N.shift(),W="C",S.push(Z,Q);break;case"S":if(P=Z,I=Q,x=X[X.length-1],x.command==="C")P=Z+(Z-x.points[2]),I=Q+(Q-x.points[3]);S.push(P,I,N.shift(),N.shift()),Z=N.shift(),Q=N.shift(),W="C",S.push(Z,Q);break;case"s":if(P=Z,I=Q,x=X[X.length-1],x.command==="C")P=Z+(Z-x.points[2]),I=Q+(Q-x.points[3]);S.push(P,I,Z+N.shift(),Q+N.shift()),Z+=N.shift(),Q+=N.shift(),W="C",S.push(Z,Q);break;case"Q":S.push(N.shift(),N.shift()),Z=N.shift(),Q=N.shift(),S.push(Z,Q);break;case"q":S.push(Z+N.shift(),Q+N.shift()),Z+=N.shift(),Q+=N.shift(),W="Q",S.push(Z,Q);break;case"T":if(P=Z,I=Q,x=X[X.length-1],x.command==="Q")P=Z+(Z-x.points[0]),I=Q+(Q-x.points[1]);Z=N.shift(),Q=N.shift(),W="Q",S.push(P,I,Z,Q);break;case"t":if(P=Z,I=Q,x=X[X.length-1],x.command==="Q")P=Z+(Z-x.points[0]),I=Q+(Q-x.points[1]);Z+=N.shift(),Q+=N.shift(),W="Q",S.push(P,I,Z,Q);break;case"A":b=N.shift(),l=N.shift(),i=N.shift(),h0=N.shift(),q0=N.shift(),Q0=Z,o=Q,Z=N.shift(),Q=N.shift(),W="A",S=this.convertEndpointToCenterParameterization(Q0,o,Z,Q,h0,q0,b,l,i);break;case"a":b=N.shift(),l=N.shift(),i=N.shift(),h0=N.shift(),q0=N.shift(),Q0=Z,o=Q,Z+=N.shift(),Q+=N.shift(),W="A",S=this.convertEndpointToCenterParameterization(Q0,o,Z,Q,h0,q0,b,l,i);break}X.push({command:W||C,points:S,start:{x:R,y:v},pathLength:this.calcLength(R,v,W||C,S)})}if(C==="z"||C==="Z")X.push({command:"z",points:[],start:void 0,pathLength:0})}return X}static calcLength(h,_,G,Y){let X,K,Z,Q,D=t1;switch(G){case"L":return D.getLineLength(h,_,Y[0],Y[1]);case"C":return dB([h,Y[0],Y[2],Y[4]],[_,Y[1],Y[3],Y[5]],1);case"Q":return aB([h,Y[0],Y[2]],[_,Y[1],Y[3]],1);case"A":X=0;let O=Y[4],A=Y[5],H=Y[4]+A,C=Math.PI/180;if(Math.abs(O-H)<C)C=Math.abs(O-H);if(K=D.getPointOnEllipticalArc(Y[0],Y[1],Y[2],Y[3],O,0),A<0)for(Q=O-C;Q>H;Q-=C)Z=D.getPointOnEllipticalArc(Y[0],Y[1],Y[2],Y[3],Q,0),X+=D.getLineLength(K.x,K.y,Z.x,Z.y),K=Z;else for(Q=O+C;Q<H;Q+=C)Z=D.getPointOnEllipticalArc(Y[0],Y[1],Y[2],Y[3],Q,0),X+=D.getLineLength(K.x,K.y,Z.x,Z.y),K=Z;return Z=D.getPointOnEllipticalArc(Y[0],Y[1],Y[2],Y[3],H,0),X+=D.getLineLength(K.x,K.y,Z.x,Z.y),X}return 0}static convertEndpointToCenterParameterization(h,_,G,Y,X,K,Z,Q,D){let O=D*(Math.PI/180),A=Math.cos(O)*(h-G)/2+Math.sin(O)*(_-Y)/2,H=-1*Math.sin(O)*(h-G)/2+Math.cos(O)*(_-Y)/2,C=A*A/(Z*Z)+H*H/(Q*Q);if(C>1)Z*=Math.sqrt(C),Q*=Math.sqrt(C);let N=Math.sqrt((Z*Z*(Q*Q)-Z*Z*(H*H)-Q*Q*(A*A))/(Z*Z*(H*H)+Q*Q*(A*A)));if(X===K)N*=-1;if(isNaN(N))N=0;let j=N*Z*H/Q,W=N*-Q*A/Z,S=(h+G)/2+Math.cos(O)*j-Math.sin(O)*W,R=(_+Y)/2+Math.sin(O)*j+Math.cos(O)*W,v=function(h0){return Math.sqrt(h0[0]*h0[0]+h0[1]*h0[1])},x=function(h0,q0){return(h0[0]*q0[0]+h0[1]*q0[1])/(v(h0)*v(q0))},P=function(h0,q0){return(h0[0]*q0[1]<h0[1]*q0[0]?-1:1)*Math.acos(x(h0,q0))},I=P([1,0],[(A-j)/Z,(H-W)/Q]),b=[(A-j)/Z,(H-W)/Q],l=[(-1*A-j)/Z,(-1*H-W)/Q],i=P(b,l);if(x(b,l)<=-1)i=Math.PI;if(x(b,l)>=1)i=0;if(K===0&&i>0)i=i-2*Math.PI;if(K===1&&i<0)i=i+2*Math.PI;return[S,R,Z,Q,I,i,O,K]}}t1.prototype.className="Path";t1.prototype._attrsAffectingSize=["data"];q1(t1);u.addGetterSetter(t1,"data");class T6 extends s4{_sceneFunc(h){super._sceneFunc(h);let _=Math.PI*2,G=this.points(),Y=G,X=this.tension()!==0&&G.length>4;if(X)Y=this.getTensionPoints();let K=this.pointerLength(),Z=G.length,Q,D;if(X){let H=[Y[Y.length-4],Y[Y.length-3],Y[Y.length-2],Y[Y.length-1],G[Z-2],G[Z-1]],C=t1.calcLength(Y[Y.length-4],Y[Y.length-3],"C",H),N=t1.getPointOnQuadraticBezier(Math.min(1,1-K/C),H[0],H[1],H[2],H[3],H[4],H[5]);Q=G[Z-2]-N.x,D=G[Z-1]-N.y}else Q=G[Z-2]-G[Z-4],D=G[Z-1]-G[Z-3];let O=(Math.atan2(D,Q)+_)%_,A=this.pointerWidth();if(this.pointerAtEnding())h.save(),h.beginPath(),h.translate(G[Z-2],G[Z-1]),h.rotate(O),h.moveTo(0,0),h.lineTo(-K,A/2),h.lineTo(-K,-A/2),h.closePath(),h.restore(),this.__fillStroke(h);if(this.pointerAtBeginning()){if(h.save(),h.beginPath(),h.translate(G[0],G[1]),X)Q=(Y[0]+Y[2])/2-G[0],D=(Y[1]+Y[3])/2-G[1];else Q=G[2]-G[0],D=G[3]-G[1];h.rotate((Math.atan2(-D,-Q)+_)%_),h.moveTo(0,0),h.lineTo(-K,A/2),h.lineTo(-K,-A/2),h.closePath(),h.restore(),this.__fillStroke(h)}}__fillStroke(h){let _=this.dashEnabled();if(_)this.attrs.dashEnabled=!1,h.setLineDash([]);if(h.fillStrokeShape(this),_)this.attrs.dashEnabled=!0}getSelfRect(){let h=super.getSelfRect(),_=this.pointerWidth()/2;return{x:h.x,y:h.y-_,width:h.width,height:h.height+_*2}}}T6.prototype.className="Arrow";q1(T6);u.addGetterSetter(T6,"pointerLength",10,V0());u.addGetterSetter(T6,"pointerWidth",10,V0());u.addGetterSetter(T6,"pointerAtBeginning",!1);u.addGetterSetter(T6,"pointerAtEnding",!0);class g8 extends U0{_sceneFunc(h){h.beginPath(),h.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),h.closePath(),h.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(h){if(this.radius()!==h/2)this.radius(h/2)}setHeight(h){if(this.radius()!==h/2)this.radius(h/2)}}g8.prototype._centroid=!0;g8.prototype.className="Circle";g8.prototype._attrsAffectingSize=["radius"];q1(g8);u.addGetterSetter(g8,"radius",0,V0());class u3 extends U0{_sceneFunc(h){let _=this.radiusX(),G=this.radiusY();if(h.beginPath(),h.save(),_!==G)h.scale(1,G/_);h.arc(0,0,_,0,Math.PI*2,!1),h.restore(),h.closePath(),h.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(h){this.radiusX(h/2)}setHeight(h){this.radiusY(h/2)}}u3.prototype.className="Ellipse";u3.prototype._centroid=!0;u3.prototype._attrsAffectingSize=["radiusX","radiusY"];q1(u3);u.addComponentsGetterSetter(u3,"radius",["x","y"]);u.addGetterSetter(u3,"radiusX",0,V0());u.addGetterSetter(u3,"radiusY",0,V0());class M4 extends U0{constructor(h){super(h);this._loadListener=()=>{this._requestDraw()},this.on("imageChange.konva",(_)=>{this._removeImageLoad(_.oldVal),this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){let h=this.image();if(h&&h.complete)return;if(h&&h.readyState===4)return;if(h&&h.addEventListener)h.addEventListener("load",this._loadListener)}_removeImageLoad(h){if(h&&h.removeEventListener)h.removeEventListener("load",this._loadListener)}destroy(){return this._removeImageLoad(this.image()),super.destroy(),this}_useBufferCanvas(){let h=!!this.cornerRadius(),_=this.hasShadow();if(h&&_)return!0;return super._useBufferCanvas(!0)}_sceneFunc(h){let _=this.getWidth(),G=this.getHeight(),Y=this.cornerRadius(),X=this.attrs.image,K;if(X){let Z=this.attrs.cropWidth,Q=this.attrs.cropHeight;if(Z&&Q)K=[X,this.cropX(),this.cropY(),Z,Q,0,0,_,G];else K=[X,0,0,_,G]}if(this.hasFill()||this.hasStroke()||Y)h.beginPath(),Y?n.drawRoundedRectPath(h,_,G,Y):h.rect(0,0,_,G),h.closePath(),h.fillStrokeShape(this);if(X){if(Y)h.clip();h.drawImage.apply(h,K)}}_hitFunc(h){let _=this.width(),G=this.height(),Y=this.cornerRadius();if(h.beginPath(),!Y)h.rect(0,0,_,G);else n.drawRoundedRectPath(h,_,G,Y);h.closePath(),h.fillStrokeShape(this)}getWidth(){var h,_,G;return(G=(h=this.attrs.width)!==null&&h!==void 0?h:(_=this.image())===null||_===void 0?void 0:_.width)!==null&&G!==void 0?G:0}getHeight(){var h,_,G;return(G=(h=this.attrs.height)!==null&&h!==void 0?h:(_=this.image())===null||_===void 0?void 0:_.height)!==null&&G!==void 0?G:0}static fromURL(h,_,G=null){let Y=n.createImageElement();Y.onload=function(){let X=new M4({image:Y});_(X)},Y.onerror=G,Y.crossOrigin="Anonymous",Y.src=h}}M4.prototype.className="Image";M4.prototype._attrsAffectingSize=["image"];q1(M4);u.addGetterSetter(M4,"cornerRadius",0,x8(4));u.addGetterSetter(M4,"image");u.addComponentsGetterSetter(M4,"crop",["x","y","width","height"]);u.addGetterSetter(M4,"cropX",0,V0());u.addGetterSetter(M4,"cropY",0,V0());u.addGetterSetter(M4,"cropWidth",0,V0());u.addGetterSetter(M4,"cropHeight",0,V0());var AL=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],Um="Change.konva",Em="none",sB="up",nB="right",oB="down",rB="left",Cm=AL.length;class gY extends k3{constructor(h){super(h);this.on("add.konva",function(_){this._addListeners(_.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(h){let _=this,G,Y=function(){_._sync()};for(G=0;G<Cm;G++)h.on(AL[G]+Um,Y)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){let h=this.getText(),_=this.getTag(),G,Y,X,K,Z,Q,D;if(h&&_){switch(G=h.width(),Y=h.height(),X=_.pointerDirection(),K=_.pointerWidth(),D=_.pointerHeight(),Z=0,Q=0,X){case sB:Z=G/2,Q=-1*D;break;case nB:Z=G+K,Q=Y/2;break;case oB:Z=G/2,Q=Y+D;break;case rB:Z=-1*K,Q=Y/2;break}_.setAttrs({x:-1*Z,y:-1*Q,width:G,height:Y}),h.setAttrs({x:-1*Z,y:-1*Q})}}}gY.prototype.className="Label";q1(gY);class W6 extends U0{_sceneFunc(h){let _=this.width(),G=this.height(),Y=this.pointerDirection(),X=this.pointerWidth(),K=this.pointerHeight(),Z=this.cornerRadius(),Q=0,D=0,O=0,A=0;if(typeof Z==="number")Q=D=O=A=Math.min(Z,_/2,G/2);else Q=Math.min(Z[0]||0,_/2,G/2),D=Math.min(Z[1]||0,_/2,G/2),A=Math.min(Z[2]||0,_/2,G/2),O=Math.min(Z[3]||0,_/2,G/2);if(h.beginPath(),h.moveTo(Q,0),Y===sB)h.lineTo((_-X)/2,0),h.lineTo(_/2,-1*K),h.lineTo((_+X)/2,0);if(h.lineTo(_-D,0),h.arc(_-D,D,D,Math.PI*3/2,0,!1),Y===nB)h.lineTo(_,(G-K)/2),h.lineTo(_+X,G/2),h.lineTo(_,(G+K)/2);if(h.lineTo(_,G-A),h.arc(_-A,G-A,A,0,Math.PI/2,!1),Y===oB)h.lineTo((_+X)/2,G),h.lineTo(_/2,G+K),h.lineTo((_-X)/2,G);if(h.lineTo(O,G),h.arc(O,G-O,O,Math.PI/2,Math.PI,!1),Y===rB)h.lineTo(0,(G+K)/2),h.lineTo(-1*X,G/2),h.lineTo(0,(G-K)/2);h.lineTo(0,Q),h.arc(Q,Q,Q,Math.PI,Math.PI*3/2,!1),h.closePath(),h.fillStrokeShape(this)}getSelfRect(){let h=0,_=0,G=this.pointerWidth(),Y=this.pointerHeight(),X=this.pointerDirection(),K=this.width(),Z=this.height();if(X===sB)_-=Y,Z+=Y;else if(X===oB)Z+=Y;else if(X===rB)h-=G*1.5,K+=G;else if(X===nB)K+=G*1.5;return{x:h,y:_,width:K,height:Z}}}W6.prototype.className="Tag";q1(W6);u.addGetterSetter(W6,"pointerDirection",Em);u.addGetterSetter(W6,"pointerWidth",0,V0());u.addGetterSetter(W6,"pointerHeight",0,V0());u.addGetterSetter(W6,"cornerRadius",0,x8(4));class I8 extends U0{_sceneFunc(h){let _=this.cornerRadius(),G=this.width(),Y=this.height();if(h.beginPath(),!_)h.rect(0,0,G,Y);else n.drawRoundedRectPath(h,G,Y,_);h.closePath(),h.fillStrokeShape(this)}}I8.prototype.className="Rect";q1(I8);u.addGetterSetter(I8,"cornerRadius",0,x8(4));class p3 extends U0{_sceneFunc(h){let _=this._getPoints(),G=this.radius(),Y=this.sides(),X=this.cornerRadius();if(h.beginPath(),!X){h.moveTo(_[0].x,_[0].y);for(let K=1;K<_.length;K++)h.lineTo(_[K].x,_[K].y)}else n.drawRoundedPolygonPath(h,_,Y,G,X);h.closePath(),h.fillStrokeShape(this)}_getPoints(){let h=this.attrs.sides,_=this.attrs.radius||0,G=[];for(let Y=0;Y<h;Y++)G.push({x:_*Math.sin(Y*2*Math.PI/h),y:-1*_*Math.cos(Y*2*Math.PI/h)});return G}getSelfRect(){let h=this._getPoints(),_=h[0].x,G=h[0].x,Y=h[0].y,X=h[0].y;return h.forEach((K)=>{_=Math.min(_,K.x),G=Math.max(G,K.x),Y=Math.min(Y,K.y),X=Math.max(X,K.y)}),{x:_,y:Y,width:G-_,height:X-Y}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(h){this.radius(h/2)}setHeight(h){this.radius(h/2)}}p3.prototype.className="RegularPolygon";p3.prototype._centroid=!0;p3.prototype._attrsAffectingSize=["radius"];q1(p3);u.addGetterSetter(p3,"radius",0,V0());u.addGetterSetter(p3,"sides",0,V0());u.addGetterSetter(p3,"cornerRadius",0,x8(4));var zL=Math.PI*2;class R6 extends U0{_sceneFunc(h){h.beginPath(),h.arc(0,0,this.innerRadius(),0,zL,!1),h.moveTo(this.outerRadius(),0),h.arc(0,0,this.outerRadius(),zL,0,!0),h.closePath(),h.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(h){this.outerRadius(h/2)}setHeight(h){this.outerRadius(h/2)}}R6.prototype.className="Ring";R6.prototype._centroid=!0;R6.prototype._attrsAffectingSize=["innerRadius","outerRadius"];q1(R6);u.addGetterSetter(R6,"innerRadius",0,V0());u.addGetterSetter(R6,"outerRadius",0,V0());class n4 extends U0{constructor(h){super(h);this._updated=!0,this.anim=new d5(()=>{let _=this._updated;return this._updated=!1,_}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){if(!this.anim.isRunning())return;clearInterval(this.interval),this._setInterval()})}_sceneFunc(h){let _=this.animation(),G=this.frameIndex(),Y=G*4,X=this.animations()[_],K=this.frameOffsets(),Z=X[Y+0],Q=X[Y+1],D=X[Y+2],O=X[Y+3],A=this.image();if(this.hasFill()||this.hasStroke())h.beginPath(),h.rect(0,0,D,O),h.closePath(),h.fillStrokeShape(this);if(A)if(K){let H=K[_],C=G*2;h.drawImage(A,Z,Q,D,O,H[C+0],H[C+1],D,O)}else h.drawImage(A,Z,Q,D,O,0,0,D,O)}_hitFunc(h){let _=this.animation(),G=this.frameIndex(),Y=G*4,X=this.animations()[_],K=this.frameOffsets(),Z=X[Y+2],Q=X[Y+3];if(h.beginPath(),K){let D=K[_],O=G*2;h.rect(D[O+0],D[O+1],Z,Q)}else h.rect(0,0,Z,Q);h.closePath(),h.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){let h=this;this.interval=setInterval(function(){h._updateIndex()},1000/this.frameRate())}start(){if(this.isRunning())return;let h=this.getLayer();this.anim.setLayers(h),this._setInterval(),this.anim.start()}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){let h=this.frameIndex(),_=this.animation(),G=this.animations(),Y=G[_],X=Y.length/4;if(h<X-1)this.frameIndex(h+1);else this.frameIndex(0)}}n4.prototype.className="Sprite";q1(n4);u.addGetterSetter(n4,"animation");u.addGetterSetter(n4,"animations");u.addGetterSetter(n4,"frameOffsets");u.addGetterSetter(n4,"image");u.addGetterSetter(n4,"frameIndex",0,V0());u.addGetterSetter(n4,"frameRate",17,V0());u.backCompat(n4,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});class l3 extends U0{_sceneFunc(h){let _=this.innerRadius(),G=this.outerRadius(),Y=this.numPoints();h.beginPath(),h.moveTo(0,0-G);for(let X=1;X<Y*2;X++){let K=X%2===0?G:_,Z=K*Math.sin(X*Math.PI/Y),Q=-1*K*Math.cos(X*Math.PI/Y);h.lineTo(Z,Q)}h.closePath(),h.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(h){this.outerRadius(h/2)}setHeight(h){this.outerRadius(h/2)}}l3.prototype.className="Star";l3.prototype._centroid=!0;l3.prototype._attrsAffectingSize=["innerRadius","outerRadius"];q1(l3);u.addGetterSetter(l3,"numPoints",5,V0());u.addGetterSetter(l3,"innerRadius",0,V0());u.addGetterSetter(l3,"outerRadius",0,V0());function S6(h){return[...h].reduce((_,G,Y,X)=>{if(/\p{Emoji}/u.test(G)){let K=X[Y+1];if(K&&/\p{Emoji_Modifier}|\u200D/u.test(K))_.push(G+K),X[Y+1]="";else _.push(G)}else if(/\p{Regional_Indicator}{2}/u.test(G+(X[Y+1]||"")))_.push(G+X[Y+1]);else if(Y>0&&/\p{Mn}|\p{Me}|\p{Mc}/u.test(G))_[_.length-1]+=G;else if(G)_.push(G);return _},[])}var K_="auto",Nm="center",CL="inherit",IY="justify",$m="Change.konva",NL="2d",HL="-",$L="left",Lm="text",jm="Text",Fm="top",Tm="bottom",VL="middle",LL="normal",Wm="px ",fJ=" ",Rm="right",UL="rtl",Sm="word",vm="char",EL="none",eB="…",jL=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],xm=jL.length,PY=null;function wm(){if(PY!==null)return PY;PY=!1;try{let h=document.createElement("canvas");h.width=10,h.height=10;let _=h.getContext(NL);if(_){_.globalAlpha=0,_.shadowColor="black",_.shadowBlur=5,_.shadowOffsetX=5,_.shadowOffsetY=5,_.fillStyle="black",_.font="10px Arial",_.fillText("X",0,10);let G=_.getImageData(0,0,10,10).data;for(let Y=3;Y<G.length;Y+=4)if(G[Y]>0){PY=!0;break}}}catch(h){}return PY}function gm(h){return h.split(",").map((_)=>{_=_.trim();let G=_.indexOf(" ")>=0,Y=_.indexOf('"')>=0||_.indexOf("'")>=0;if(G&&!Y)_=`"${_}"`;return _}).join(", ")}var kJ;function hO(){if(kJ)return kJ;return kJ=n.createCanvasElement().getContext(NL),kJ}function Im(h){h.fillText(this._partialText,this._partialTextX,this._partialTextY)}function Pm(h){h.setAttr("miterLimit",2),h.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function ym(h){if(h=h||{},!h.fillLinearGradientColorStops&&!h.fillRadialGradientColorStops&&!h.fillPatternImage)h.fill=h.fill||"black";return h}class s1 extends U0{constructor(h){super(ym(h));this._partialTextX=0,this._partialTextY=0;for(let _=0;_<xm;_++)this.on(jL[_]+$m,this._setTextData);this._setTextData()}_sceneFunc(h){var _,G;let Y=this.textArr,X=Y.length;if(!this.text())return;let K=this.padding(),Z=this.fontSize(),Q=this.lineHeight()*Z,D=this.verticalAlign(),O=this.direction(),A=0,H=this.align(),C=this.getWidth(),N=this.letterSpacing(),j=this.charRenderFunc(),W=this.fill(),S=this.textDecoration(),R=this.underlineOffset(),v=S.indexOf("underline")!==-1,x=S.indexOf("line-through")!==-1,P;O=O===CL?h.direction:O;let I=Q/2,b=VL;if(!$0.legacyTextRendering){let l=this.measureSize("M");b="alphabetic";let i=(_=l.fontBoundingBoxAscent)!==null&&_!==void 0?_:l.actualBoundingBoxAscent,h0=(G=l.fontBoundingBoxDescent)!==null&&G!==void 0?G:l.actualBoundingBoxDescent;I=(i-h0)/2+Q/2}if(O===UL)h.setAttr("direction",O);if(h.setAttr("font",this._getContextFont()),h.setAttr("textBaseline",b),h.setAttr("textAlign",$L),D===VL)A=(this.getHeight()-X*Q-K*2)/2;else if(D===Tm)A=this.getHeight()-X*Q-K*2;h.translate(K,A+K);for(P=0;P<X;P++){let l=0,i=0,h0=Y[P],q0=h0.text,Q0=h0.width,o=h0.lastInParagraph;if(h.save(),H===Rm)l+=C-Q0-K*2;else if(H===Nm)l+=(C-Q0-K*2)/2;if(v){h.save(),h.beginPath();let d=R!==null&&R!==void 0?R:!$0.legacyTextRendering?Math.round(Z/4):Math.round(Z/2),s=l,_0=I+i+d;h.moveTo(s,_0);let Z0=H===IY&&!o?C-K*2:Q0;h.lineTo(s+Math.round(Z0),_0),h.lineWidth=Z/15;let X0=this._getLinearGradient();h.strokeStyle=X0||W,h.stroke(),h.restore()}let r=l;if(O!==UL&&(N!==0||H===IY||j)){let d=q0.split(" ").length-1,s=S6(q0);for(let _0=0;_0<s.length;_0++){let Z0=s[_0];if(Z0===" "&&!o&&H===IY)l+=(C-K*2-Q0)/d;if(this._partialTextX=l,this._partialTextY=I+i,this._partialText=Z0,j){h.save();let E0=Y.slice(0,P).reduce((N0,x0)=>N0+S6(x0.text).length,0),m=_0+E0;j({char:Z0,index:m,x:l,y:I+i,lineIndex:P,column:_0,isLastInLine:o,width:this.measureSize(Z0).width,context:h})}if(h.fillStrokeShape(this),j)h.restore();l+=this.measureSize(Z0).width+N}}else{if(N!==0)h.setAttr("letterSpacing",`${N}px`);this._partialTextX=l,this._partialTextY=I+i,this._partialText=q0,h.fillStrokeShape(this)}if(x){h.save(),h.beginPath();let d=!$0.legacyTextRendering?-Math.round(Z/4):0,s=r;h.moveTo(s,I+i+d);let _0=H===IY&&!o?C-K*2:Q0;h.lineTo(s+Math.round(_0),I+i+d),h.lineWidth=Z/15;let Z0=this._getLinearGradient();h.strokeStyle=Z0||W,h.stroke(),h.restore()}if(h.restore(),X>1)I+=Q}}_hitFunc(h){let _=this.getWidth(),G=this.getHeight();h.beginPath(),h.rect(0,0,_,G),h.closePath(),h.fillStrokeShape(this)}setText(h){let _=n._isString(h)?h:h===null||h===void 0?"":h+"";return this._setAttr(Lm,_),this}getWidth(){return this.attrs.width===K_||this.attrs.width===void 0?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){return this.attrs.height===K_||this.attrs.height===void 0?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return n.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(h){var _,G,Y,X,K,Z,Q,D,O,A,H;let C=hO(),N=this.fontSize(),j;C.save(),C.font=this._getContextFont(),j=C.measureText(h),C.restore();let W=N/100;return{actualBoundingBoxAscent:(_=j.actualBoundingBoxAscent)!==null&&_!==void 0?_:71.58203125*W,actualBoundingBoxDescent:(G=j.actualBoundingBoxDescent)!==null&&G!==void 0?G:0,actualBoundingBoxLeft:(Y=j.actualBoundingBoxLeft)!==null&&Y!==void 0?Y:-7.421875*W,actualBoundingBoxRight:(X=j.actualBoundingBoxRight)!==null&&X!==void 0?X:75.732421875*W,alphabeticBaseline:(K=j.alphabeticBaseline)!==null&&K!==void 0?K:0,emHeightAscent:(Z=j.emHeightAscent)!==null&&Z!==void 0?Z:100*W,emHeightDescent:(Q=j.emHeightDescent)!==null&&Q!==void 0?Q:-20*W,fontBoundingBoxAscent:(D=j.fontBoundingBoxAscent)!==null&&D!==void 0?D:91*W,fontBoundingBoxDescent:(O=j.fontBoundingBoxDescent)!==null&&O!==void 0?O:21*W,hangingBaseline:(A=j.hangingBaseline)!==null&&A!==void 0?A:72.80000305175781*W,ideographicBaseline:(H=j.ideographicBaseline)!==null&&H!==void 0?H:-21*W,width:j.width,height:N}}_getContextFont(){return this.fontStyle()+fJ+this.fontVariant()+fJ+(this.fontSize()+Wm)+gm(this.fontFamily())}_addTextLine(h){if(this.align()===IY)h=h.trim();let G=this._getTextWidth(h);return this.textArr.push({text:h,width:G,lastInParagraph:!1})}_getTextWidth(h){let _=this.letterSpacing(),G=h.length;return hO().measureText(h).width+_*G}_setTextData(){let h=this.text().split(`
|
|
258
|
-
`),_=+this.fontSize(),G=0,Y=this.lineHeight()*_,X=this.attrs.width,K=this.attrs.height,Z=X!==K_&&X!==void 0,Q=K!==K_&&K!==void 0,D=this.padding(),O=X-D*2,A=K-D*2,H=0,C=this.wrap(),N=C!==EL,j=C!==vm&&N,W=this.ellipsis();this.textArr=[],hO().font=this._getContextFont();let S=W?this._getTextWidth(eB):0;for(let R=0,v=h.length;R<v;++R){let x=h[R],P=this._getTextWidth(x);if(Z&&P>O)while(x.length>0){let I=0,b=S6(x).length,l="",i=0;while(I<b){let h0=I+b>>>1,q0=S6(x),Q0=q0.slice(0,h0+1).join(""),o=this._getTextWidth(Q0);if((W&&Q&&H+Y>A?o+S:o)<=O)I=h0+1,l=Q0,i=o;else b=h0}if(l){if(j){let Q0=S6(x),o=S6(l),r=Q0[o.length],d=r===fJ||r===HL,s;if(d&&i<=O)s=o.length;else{let _0=o.lastIndexOf(fJ),Z0=o.lastIndexOf(HL);s=Math.max(_0,Z0)+1}if(s>0)I=s,l=Q0.slice(0,I).join(""),i=this._getTextWidth(l)}if(l=l.trimRight(),this._addTextLine(l),G=Math.max(G,i),H+=Y,this._shouldHandleEllipsis(H)){this._tryToAddEllipsisToLastLine();break}if(x=S6(x).slice(I).join("").trimLeft(),x.length>0){if(P=this._getTextWidth(x),P<=O){this._addTextLine(x),H+=Y,G=Math.max(G,P);break}}}else break}else if(this._addTextLine(x),H+=Y,G=Math.max(G,P),this._shouldHandleEllipsis(H)&&R<v-1)this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1])this.textArr[this.textArr.length-1].lastInParagraph=!0;if(Q&&H+Y>A)break}this.textHeight=_,this.textWidth=G}_shouldHandleEllipsis(h){let _=+this.fontSize(),G=this.lineHeight()*_,Y=this.attrs.height,X=Y!==K_&&Y!==void 0,K=this.padding(),Z=Y-K*2;return this.wrap()===EL||X&&h+G>Z}_tryToAddEllipsisToLastLine(){let h=this.attrs.width,_=h!==K_&&h!==void 0,G=this.padding(),Y=h-G*2,X=this.ellipsis(),K=this.textArr[this.textArr.length-1];if(!K||!X)return;if(_){if(!(this._getTextWidth(K.text+eB)<Y))K.text=K.text.slice(0,K.text.length-3)}this.textArr.splice(this.textArr.length-1,1),this._addTextLine(K.text+eB)}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){let h=this.textDecoration().indexOf("underline")!==-1||this.textDecoration().indexOf("line-through")!==-1,_=this.hasShadow();if(h&&_)return!0;if(_&&this.getAbsoluteOpacity()!==1&&wm())return!0;return super._useBufferCanvas()}}s1.prototype._fillFunc=Im;s1.prototype._strokeFunc=Pm;s1.prototype.className=jm;s1.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"];q1(s1);u.overWriteSetter(s1,"width",LY());u.overWriteSetter(s1,"height",LY());u.addGetterSetter(s1,"direction",CL);u.addGetterSetter(s1,"fontFamily","Arial");u.addGetterSetter(s1,"fontSize",12,V0());u.addGetterSetter(s1,"fontStyle",LL);u.addGetterSetter(s1,"fontVariant",LL);u.addGetterSetter(s1,"padding",0,V0());u.addGetterSetter(s1,"align",$L);u.addGetterSetter(s1,"verticalAlign",Fm);u.addGetterSetter(s1,"lineHeight",1,V0());u.addGetterSetter(s1,"wrap",Sm);u.addGetterSetter(s1,"ellipsis",!1,j5());u.addGetterSetter(s1,"letterSpacing",0,V0());u.addGetterSetter(s1,"text","",m3());u.addGetterSetter(s1,"textDecoration","");u.addGetterSetter(s1,"underlineOffset",void 0,V0());u.addGetterSetter(s1,"charRenderFunc",void 0);var bm="",FL="normal";function TL(h){h.fillText(this.partialText,0,0)}function WL(h){h.strokeText(this.partialText,0,0)}class T2 extends U0{constructor(h){super(h);this.dummyCanvas=n.createCanvasElement(),this.dataArray=[],this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute(),this._setTextData()}),this.on("textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva fontSizeChange.konva fontFamilyChange.konva directionChange.konva",this._setTextData),this._setTextData()}_getTextPathLength(){return t1.getPathLength(this.dataArray)}_getPointAtLength(h){if(!this.attrs.data)return null;let _=this.pathLength;if(h>_)return null;return t1.getPointAtLengthOfDataArray(h,this.dataArray)}_readDataAttribute(){this.dataArray=t1.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(h){h.setAttr("font",this._getContextFont()),h.setAttr("textBaseline",this.textBaseline()),h.setAttr("textAlign","left"),h.save();let _=this.textDecoration(),G=this.fill(),Y=this.fontSize(),X=this.glyphInfo,K=_.indexOf("underline")!==-1,Z=_.indexOf("line-through")!==-1;if(K)h.beginPath();for(let Q=0;Q<X.length;Q++){h.save();let D=X[Q].p0;if(h.translate(D.x,D.y),h.rotate(X[Q].rotation),this.partialText=X[Q].text,h.fillStrokeShape(this),K){if(Q===0)h.moveTo(0,Y/2+1);h.lineTo(X[Q].width,Y/2+1)}h.restore()}if(K)h.strokeStyle=G,h.lineWidth=Y/20,h.stroke();if(Z){h.beginPath();for(let Q=0;Q<X.length;Q++){h.save();let D=X[Q].p0;if(h.translate(D.x,D.y),h.rotate(X[Q].rotation),Q===0)h.moveTo(0,0);h.lineTo(X[Q].width,0),h.restore()}h.strokeStyle=G,h.lineWidth=Y/20,h.stroke()}h.restore()}_hitFunc(h){h.beginPath();let _=this.glyphInfo;if(_.length>=1){let G=_[0].p0;h.moveTo(G.x,G.y)}for(let G=0;G<_.length;G++){let Y=_[G].p1;h.lineTo(Y.x,Y.y)}h.setAttr("lineWidth",this.fontSize()),h.setAttr("strokeStyle",this.colorKey),h.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return n.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(h){return s1.prototype.setText.call(this,h)}_getContextFont(){return s1.prototype._getContextFont.call(this)}_getTextSize(h){let G=this.dummyCanvas.getContext("2d");G.save(),G.font=this._getContextFont();let Y=G.measureText(h);return G.restore(),{width:Y.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){let h=S6(this.text());if(this.direction()==="rtl")h.reverse();let _=[],G=0;for(let C=0;C<h.length;C++)_.push({char:h[C],width:this._getTextSize(h[C]).width}),G+=_[C].width;let{width:Y,height:X}=this._getTextSize(this.attrs.text);if(this.textWidth=G,this.textHeight=X,this.glyphInfo=[],!this.attrs.data)return null;let K=this.letterSpacing(),Z=this.align(),Q=this.kerningFunc(),D=Math.max(0,G-Y),O=Math.max(this.textWidth+((this.attrs.text||"").length-1)*K,0),A=0;if(Z==="center")A=Math.max(0,this.pathLength/2-O/2);if(Z==="right")A=Math.max(0,this.pathLength-O);let H=A;for(let C=0;C<_.length;C++){let N=this._getPointAtLength(H);if(!N)return;let j=_[C].char,W=_[C].width+K;if(j===" "&&Z==="justify"){let b=this.text().split(" ").length-1;W+=(this.pathLength-O)/b}let S=H+W,R=this._getPointAtLength(S>this.pathLength&&S-this.pathLength<=D?this.pathLength:S);if(!R)return;let v=t1.getLineLength(N.x,N.y,R.x,R.y),x=0;if(Q)try{x=Q(_[C-1].char,j)*this.fontSize()}catch(b){x=0}N.x+=x,R.x+=x,this.textWidth+=x;let P=t1.getPointOnLine(x+v/2,N.x,N.y,R.x,R.y),I=Math.atan2(R.y-N.y,R.x-N.x);this.glyphInfo.push({transposeX:P.x,transposeY:P.y,text:h[C],rotation:I,p0:N,p1:R,width:v}),H+=W}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};let h=[];this.glyphInfo.forEach(function(D){h.push(D.p0.x),h.push(D.p0.y),h.push(D.p1.x),h.push(D.p1.y)});let _=h[0]||0,G=h[0]||0,Y=h[1]||0,X=h[1]||0,K,Z;for(let D=0;D<h.length/2;D++)K=h[D*2],Z=h[D*2+1],_=Math.min(_,K),G=Math.max(G,K),Y=Math.min(Y,Z),X=Math.max(X,Z);let Q=this.fontSize();return{x:_-Q/2,y:Y-Q/2,width:G-_+Q,height:X-Y+Q}}destroy(){return n.releaseCanvas(this.dummyCanvas),super.destroy()}}T2.prototype._fillFunc=TL;T2.prototype._strokeFunc=WL;T2.prototype._fillFuncHit=TL;T2.prototype._strokeFuncHit=WL;T2.prototype.className="TextPath";T2.prototype._attrsAffectingSize=["text","fontSize","data"];q1(T2);u.addGetterSetter(T2,"data");u.addGetterSetter(T2,"fontFamily","Arial");u.addGetterSetter(T2,"fontSize",12,V0());u.addGetterSetter(T2,"fontStyle",FL);u.addGetterSetter(T2,"align","left");u.addGetterSetter(T2,"letterSpacing",0,V0());u.addGetterSetter(T2,"textBaseline","middle");u.addGetterSetter(T2,"fontVariant",FL);u.addGetterSetter(T2,"text",bm);u.addGetterSetter(T2,"textDecoration","");u.addGetterSetter(T2,"kerningFunc",void 0);u.addGetterSetter(T2,"direction","inherit");var vL="tr-konva",mm=["resizeEnabledChange","rotateAnchorOffsetChange","rotateAnchorAngleChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map((h)=>h+`.${vL}`).join(" "),RL="nodesRect",fm=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange","draggableChange"],km={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135},um="ontouchstart"in $0._global;function pm(h,_,G){if(h==="rotater")return G;_+=n.degToRad(km[h]||0);let Y=(n.radToDeg(_)%360+360)%360;if(n._inRange(Y,337.5,360)||n._inRange(Y,0,22.5))return"ns-resize";else if(n._inRange(Y,22.5,67.5))return"nesw-resize";else if(n._inRange(Y,67.5,112.5))return"ew-resize";else if(n._inRange(Y,112.5,157.5))return"nwse-resize";else if(n._inRange(Y,157.5,202.5))return"ns-resize";else if(n._inRange(Y,202.5,247.5))return"nesw-resize";else if(n._inRange(Y,247.5,292.5))return"ew-resize";else if(n._inRange(Y,292.5,337.5))return"nwse-resize";else return n.error("Transformer has unknown angle for cursor detection: "+Y),"pointer"}var uJ=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"],SL=1e8;function lm(h){return{x:h.x+h.width/2*Math.cos(h.rotation)+h.height/2*Math.sin(-h.rotation),y:h.y+h.height/2*Math.cos(h.rotation)+h.width/2*Math.sin(h.rotation)}}function xL(h,_,G){let Y=G.x+(h.x-G.x)*Math.cos(_)-(h.y-G.y)*Math.sin(_),X=G.y+(h.x-G.x)*Math.sin(_)+(h.y-G.y)*Math.cos(_);return{...h,rotation:h.rotation+_,x:Y,y:X}}function im(h,_){let G=lm(h);return xL(h,_,G)}function cm(h,_,G){let Y=_;for(let X=0;X<h.length;X++){let K=$0.getAngle(h[X]),Z=Math.abs(K-_)%(Math.PI*2);if(Math.min(Z,Math.PI*2-Z)<G)Y=K}return Y}var _O=0;class $1 extends k3{constructor(h){super(h);if(this._movingAnchorName=null,this._transforming=!1,this._elementsCreated=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(mm,this.update),this.getNode())this.update()}attachTo(h){return this.setNode(h),this}setNode(h){return n.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([h])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return vL+this._id}setNodes(h=[]){if(this._nodes&&this._nodes.length)this.detach();let _=h.filter((Y)=>{if(Y.isAncestorOf(this))return n.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1;return!0});if(this._nodes=h=_,h.length===1&&this.useSingleNodeRotation())this.rotation(h[0].getAbsoluteRotation());else this.rotation(0);if(this._nodes.forEach((Y)=>{let X=()=>{if(this.nodes().length===1&&this.useSingleNodeRotation())this.rotation(this.nodes()[0].getAbsoluteRotation());if(this._resetTransformCache(),!this._transforming&&!this.isDragging())this.update()};if(Y._attrsAffectingSize.length){let K=Y._attrsAffectingSize.map((Z)=>Z+"Change."+this._getEventNamespace()).join(" ");Y.on(K,X)}Y.on(fm.map((K)=>K+`.${this._getEventNamespace()}`).join(" "),X),Y.on(`absoluteTransformChange.${this._getEventNamespace()}`,X),this._proxyDrag(Y)}),this._resetTransformCache(),!!this.findOne(".top-left"))this.update();return this}_proxyDrag(h){let _;h.on(`dragstart.${this._getEventNamespace()}`,(G)=>{if(_=h.getAbsolutePosition(),!this.isDragging()&&h!==this.findOne(".back"))this.startDrag(G,!1)}),h.on(`dragmove.${this._getEventNamespace()}`,(G)=>{if(!_)return;let Y=h.getAbsolutePosition(),X=Y.x-_.x,K=Y.y-_.y;this.nodes().forEach((Z)=>{if(Z===h)return;if(Z.isDragging())return;let Q=Z.getAbsolutePosition();Z.setAbsolutePosition({x:Q.x+X,y:Q.y+K}),Z.startDrag(G)}),_=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){if(this._nodes)this._nodes.forEach((h)=>{h.off("."+this._getEventNamespace())});this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(RL),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(RL,this.__getNodeRect)}__getNodeShape(h,_=this.rotation(),G){let Y=h.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),X=h.getAbsoluteScale(G),K=h.getAbsolutePosition(G),Z=Y.x*X.x-h.offsetX()*X.x,Q=Y.y*X.y-h.offsetY()*X.y,D=($0.getAngle(h.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),O={x:K.x+Z*Math.cos(D)+Q*Math.sin(-D),y:K.y+Q*Math.cos(D)+Z*Math.sin(D),width:Y.width*X.x,height:Y.height*X.y,rotation:D};return xL(O,-$0.getAngle(_),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-SL,y:-SL,width:0,height:0,rotation:0};let _=[];this.nodes().map((D)=>{let O=D.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),A=[{x:O.x,y:O.y},{x:O.x+O.width,y:O.y},{x:O.x+O.width,y:O.y+O.height},{x:O.x,y:O.y+O.height}],H=D.getAbsoluteTransform();A.forEach(function(C){let N=H.point(C);_.push(N)})});let G=new L5;G.rotate(-$0.getAngle(this.rotation()));let Y=1/0,X=1/0,K=-1/0,Z=-1/0;_.forEach(function(D){let O=G.point(D);if(Y===void 0)Y=K=O.x,X=Z=O.y;Y=Math.min(Y,O.x),X=Math.min(X,O.y),K=Math.max(K,O.x),Z=Math.max(Z,O.y)}),G.invert();let Q=G.point({x:Y,y:X});return{x:Q.x,y:Q.y,width:K-Y,height:Z-X,rotation:$0.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),uJ.forEach((h)=>{this._createAnchor(h)}),this._createAnchor("rotater"),this._elementsCreated=!0}_createAnchor(h){let _=new I8({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:h+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:um?10:"auto"}),G=this;_.on("mousedown touchstart",function(Y){G._handleMouseDown(Y)}),_.on("dragstart",(Y)=>{_.stopDrag(),Y.cancelBubble=!0}),_.on("dragend",(Y)=>{Y.cancelBubble=!0}),_.on("mouseenter",()=>{let Y=$0.getAngle(this.rotation()),X=this.rotateAnchorCursor(),K=pm(h,Y,X);_.getStage().content&&(_.getStage().content.style.cursor=K),this._cursorChange=!0}),_.on("mouseout",()=>{_.getStage().content&&(_.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(_)}_createBack(){let h=new U0({name:"back",width:0,height:0,sceneFunc(_,G){let Y=G.getParent(),X=Y.padding(),K=G.width(),Z=G.height();if(_.beginPath(),_.rect(-X,-X,K+X*2,Z+X*2),Y.rotateEnabled()&&Y.rotateLineVisible()){let Q=Y.rotateAnchorAngle(),D=Y.rotateAnchorOffset(),O=n.degToRad(Q),A=Math.sin(O),H=-Math.cos(O),C=K/2,N=Z/2,j=1/0;if(H<0)j=Math.min(j,-N/H);else if(H>0)j=Math.min(j,(Z-N)/H);if(A<0)j=Math.min(j,-C/A);else if(A>0)j=Math.min(j,(K-C)/A);let W=C+A*j,S=N+H*j,R=n._sign(Z),v=W+A*D*R,x=S+H*D*R;_.moveTo(W,S),_.lineTo(v,x)}_.fillStrokeShape(G)},hitFunc:(_,G)=>{if(!this.shouldOverdrawWholeArea())return;let Y=this.padding();_.beginPath(),_.rect(-Y,-Y,G.width()+Y*2,G.height()+Y*2),_.fillStrokeShape(G)}});this.add(h),this._proxyDrag(h),h.on("dragstart",(_)=>{_.cancelBubble=!0}),h.on("dragmove",(_)=>{_.cancelBubble=!0}),h.on("dragend",(_)=>{_.cancelBubble=!0}),this.on("dragmove",(_)=>{this.update()})}_handleMouseDown(h){if(this._transforming)return;this._movingAnchorName=h.target.name().split(" ")[0];let _=this._getNodeRect(),G=_.width,Y=_.height,X=Math.sqrt(Math.pow(G,2)+Math.pow(Y,2));if(this.sin=Math.abs(Y/X),this.cos=Math.abs(G/X),typeof window<"u")window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0);this._transforming=!0;let K=h.target.getAbsolutePosition(),Z=h.target.getStage().getPointerPosition();this._anchorDragOffset={x:Z.x-K.x,y:Z.y-K.y},_O++,this._fire("transformstart",{evt:h.evt,target:this.getNode()}),this._nodes.forEach((Q)=>{Q._fire("transformstart",{evt:h.evt,target:Q})})}_handleMouseMove(h){let _,G,Y,X=this.findOne("."+this._movingAnchorName),K=X.getStage();K.setPointersPositions(h);let Z=K.getPointerPosition(),Q={x:Z.x-this._anchorDragOffset.x,y:Z.y-this._anchorDragOffset.y},D=X.getAbsolutePosition();if(this.anchorDragBoundFunc())Q=this.anchorDragBoundFunc()(D,Q,h);X.setAbsolutePosition(Q);let O=X.getAbsolutePosition();if(D.x===O.x&&D.y===O.y)return;if(this._movingAnchorName==="rotater"){let R=this._getNodeRect();_=X.x()-R.width/2,G=-X.y()+R.height/2;let v=$0.getAngle(this.rotateAnchorAngle()),x=Math.atan2(-G,_)+Math.PI/2-v;if(R.height<0)x-=Math.PI;let I=$0.getAngle(this.rotation())+x,b=$0.getAngle(this.rotationSnapTolerance()),i=cm(this.rotationSnaps(),I,b)-R.rotation,h0=im(R,i);this._fitNodesInto(h0,h);return}let A=this.shiftBehavior(),H;if(A==="inverted")H=this.keepRatio()&&!h.shiftKey;else if(A==="none")H=this.keepRatio();else H=this.keepRatio()||h.shiftKey;let C=this.centeredScaling()||h.altKey;if(this._movingAnchorName==="top-left"){if(H){let R=C?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};Y=Math.sqrt(Math.pow(R.x-X.x(),2)+Math.pow(R.y-X.y(),2));let v=this.findOne(".top-left").x()>R.x?-1:1,x=this.findOne(".top-left").y()>R.y?-1:1;_=Y*this.cos*v,G=Y*this.sin*x,this.findOne(".top-left").x(R.x-_),this.findOne(".top-left").y(R.y-G)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(X.y());else if(this._movingAnchorName==="top-right"){if(H){let R=C?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};Y=Math.sqrt(Math.pow(X.x()-R.x,2)+Math.pow(R.y-X.y(),2));let v=this.findOne(".top-right").x()<R.x?-1:1,x=this.findOne(".top-right").y()>R.y?-1:1;_=Y*this.cos*v,G=Y*this.sin*x,this.findOne(".top-right").x(R.x+_),this.findOne(".top-right").y(R.y-G)}var N=X.position();this.findOne(".top-left").y(N.y),this.findOne(".bottom-right").x(N.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(X.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(X.x());else if(this._movingAnchorName==="bottom-left"){if(H){let R=C?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};Y=Math.sqrt(Math.pow(R.x-X.x(),2)+Math.pow(X.y()-R.y,2));let v=R.x<X.x()?-1:1,x=X.y()<R.y?-1:1;_=Y*this.cos*v,G=Y*this.sin*x,X.x(R.x-_),X.y(R.y+G)}N=X.position(),this.findOne(".top-left").x(N.x),this.findOne(".bottom-right").y(N.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(X.y());else if(this._movingAnchorName==="bottom-right"){if(H){let R=C?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};Y=Math.sqrt(Math.pow(X.x()-R.x,2)+Math.pow(X.y()-R.y,2));let v=this.findOne(".bottom-right").x()<R.x?-1:1,x=this.findOne(".bottom-right").y()<R.y?-1:1;_=Y*this.cos*v,G=Y*this.sin*x,this.findOne(".bottom-right").x(R.x+_),this.findOne(".bottom-right").y(R.y+G)}}else console.error(Error("Wrong position argument of selection resizer: "+this._movingAnchorName));if(C=this.centeredScaling()||h.altKey,C){let R=this.findOne(".top-left"),v=this.findOne(".bottom-right"),x=R.x(),P=R.y(),I=this.getWidth()-v.x(),b=this.getHeight()-v.y();v.move({x:-x,y:-P}),R.move({x:I,y:b})}let j=this.findOne(".top-left").getAbsolutePosition();_=j.x,G=j.y;let W=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),S=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:_,y:G,width:W,height:S,rotation:$0.getAngle(this.rotation())},h)}_handleMouseUp(h){this._removeEvents(h)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(h){var _;if(this._transforming){if(this._transforming=!1,typeof window<"u")window.removeEventListener("mousemove",this._handleMouseMove),window.removeEventListener("touchmove",this._handleMouseMove),window.removeEventListener("mouseup",this._handleMouseUp,!0),window.removeEventListener("touchend",this._handleMouseUp,!0);let G=this.getNode();if(_O--,this._fire("transformend",{evt:h,target:G}),(_=this.getLayer())===null||_===void 0||_.batchDraw(),G)this._nodes.forEach((Y)=>{var X;Y._fire("transformend",{evt:h,target:Y}),(X=Y.getLayer())===null||X===void 0||X.batchDraw()});this._movingAnchorName=null}}_fitNodesInto(h,_){let G=this._getNodeRect(),Y=1;if(n._inRange(h.width,-this.padding()*2-1,1)){this.update();return}if(n._inRange(h.height,-this.padding()*2-1,1)){this.update();return}let X=new L5;if(X.rotate($0.getAngle(this.rotation())),this._movingAnchorName&&h.width<0&&this._movingAnchorName.indexOf("left")>=0){let H=X.point({x:-this.padding()*2,y:0});h.x+=H.x,h.y+=H.y,h.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=H.x,this._anchorDragOffset.y-=H.y}else if(this._movingAnchorName&&h.width<0&&this._movingAnchorName.indexOf("right")>=0){let H=X.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=H.x,this._anchorDragOffset.y-=H.y,h.width+=this.padding()*2}if(this._movingAnchorName&&h.height<0&&this._movingAnchorName.indexOf("top")>=0){let H=X.point({x:0,y:-this.padding()*2});h.x+=H.x,h.y+=H.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=H.x,this._anchorDragOffset.y-=H.y,h.height+=this.padding()*2}else if(this._movingAnchorName&&h.height<0&&this._movingAnchorName.indexOf("bottom")>=0){let H=X.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=H.x,this._anchorDragOffset.y-=H.y,h.height+=this.padding()*2}if(this.boundBoxFunc()){let H=this.boundBoxFunc()(G,h);if(H)h=H;else n.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}let K=1e7,Z=new L5;Z.translate(G.x,G.y),Z.rotate(G.rotation),Z.scale(G.width/K,G.height/K);let Q=new L5,D=h.width/K,O=h.height/K;if(this.flipEnabled()===!1)Q.translate(h.x,h.y),Q.rotate(h.rotation),Q.translate(h.width<0?h.width:0,h.height<0?h.height:0),Q.scale(Math.abs(D),Math.abs(O));else Q.translate(h.x,h.y),Q.rotate(h.rotation),Q.scale(D,O);let A=Q.multiply(Z.invert());this._nodes.forEach((H)=>{var C;if(!H.getStage())return;let N=H.getParent().getAbsoluteTransform(),j=H.getTransform().copy();j.translate(H.offsetX(),H.offsetY());let W=new L5;W.multiply(N.copy().invert()).multiply(A).multiply(N).multiply(j);let S=W.decompose();H.setAttrs(S),(C=H.getLayer())===null||C===void 0||C.batchDraw()}),this.rotation(n._getRotation(h.rotation)),this._nodes.forEach((H)=>{this._fire("transform",{evt:_,target:H}),H._fire("transform",{evt:_,target:H})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(h,_){this.findOne(h).setAttrs(_)}update(){var h;let _=this._getNodeRect();this.rotation(n._getRotation(_.rotation));let{width:G,height:Y}=_,X=this.enabledAnchors(),K=this.resizeEnabled(),Z=this.padding(),Q=this.anchorSize(),D=this.find("._anchor");D.forEach((I)=>{I.setAttrs({width:Q,height:Q,offsetX:Q/2,offsetY:Q/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:Q/2+Z,offsetY:Q/2+Z,visible:K&&X.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:G/2,y:0,offsetY:Q/2+Z,visible:K&&X.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:G,y:0,offsetX:Q/2-Z,offsetY:Q/2+Z,visible:K&&X.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:Y/2,offsetX:Q/2+Z,visible:K&&X.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:G,y:Y/2,offsetX:Q/2-Z,visible:K&&X.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:Y,offsetX:Q/2+Z,offsetY:Q/2-Z,visible:K&&X.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:G/2,y:Y,offsetY:Q/2-Z,visible:K&&X.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:G,y:Y,offsetX:Q/2-Z,offsetY:Q/2-Z,visible:K&&X.indexOf("bottom-right")>=0});let O=this.rotateAnchorAngle(),A=this.rotateAnchorOffset(),H=n.degToRad(O),C=Math.sin(H),N=-Math.cos(H),j=G/2,W=Y/2,S=1/0;if(N<0)S=Math.min(S,-W/N);else if(N>0)S=Math.min(S,(Y-W)/N);if(C<0)S=Math.min(S,-j/C);else if(C>0)S=Math.min(S,(G-j)/C);let R=j+C*S,v=W+N*S,x=n._sign(Y);this._batchChangeChild(".rotater",{x:R+C*A*x,y:v+N*A*x-Z*N,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:G,height:Y,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),draggable:this.nodes().some((I)=>I.draggable()),x:0,y:0});let P=this.anchorStyleFunc();if(P)D.forEach((I)=>{P(I)});(h=this.getLayer())===null||h===void 0||h.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();let h=this.findOne("."+this._movingAnchorName);if(h)h.stopDrag()}}destroy(){if(this.getStage()&&this._cursorChange)this.getStage().content&&(this.getStage().content.style.cursor="");return k3.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}add(...h){if(this._elementsCreated)return n.error("You cannot add external nodes to the Transformer. Use tr.nodes([node]) instead."),this;return super.add(...h)}toObject(){return C0.prototype.toObject.call(this)}clone(h){return C0.prototype.clone.call(this,h)}getClientRect(){if(this.nodes().length>0)return super.getClientRect();else return{x:0,y:0,width:0,height:0}}}$1.isTransforming=()=>{return _O>0};function dm(h){if(!(h instanceof Array))n.warn("enabledAnchors value should be an array");if(h instanceof Array)h.forEach(function(_){if(uJ.indexOf(_)===-1)n.warn("Unknown anchor name: "+_+". Available names are: "+uJ.join(", "))});return h||[]}$1.prototype.className="Transformer";q1($1);u.addGetterSetter($1,"enabledAnchors",uJ,dm);u.addGetterSetter($1,"flipEnabled",!0,j5());u.addGetterSetter($1,"resizeEnabled",!0);u.addGetterSetter($1,"anchorSize",10,V0());u.addGetterSetter($1,"rotateEnabled",!0);u.addGetterSetter($1,"rotateLineVisible",!0);u.addGetterSetter($1,"rotationSnaps",[]);u.addGetterSetter($1,"rotateAnchorOffset",50,V0());u.addGetterSetter($1,"rotateAnchorAngle",0,V0());u.addGetterSetter($1,"rotateAnchorCursor","crosshair");u.addGetterSetter($1,"rotationSnapTolerance",5,V0());u.addGetterSetter($1,"borderEnabled",!0);u.addGetterSetter($1,"anchorStroke","rgb(0, 161, 255)");u.addGetterSetter($1,"anchorStrokeWidth",1,V0());u.addGetterSetter($1,"anchorFill","white");u.addGetterSetter($1,"anchorCornerRadius",0,V0());u.addGetterSetter($1,"borderStroke","rgb(0, 161, 255)");u.addGetterSetter($1,"borderStrokeWidth",1,V0());u.addGetterSetter($1,"borderDash");u.addGetterSetter($1,"keepRatio",!0);u.addGetterSetter($1,"shiftBehavior","default");u.addGetterSetter($1,"centeredScaling",!1);u.addGetterSetter($1,"ignoreStroke",!1);u.addGetterSetter($1,"padding",0,V0());u.addGetterSetter($1,"nodes");u.addGetterSetter($1,"node");u.addGetterSetter($1,"boundBoxFunc");u.addGetterSetter($1,"anchorDragBoundFunc");u.addGetterSetter($1,"anchorStyleFunc");u.addGetterSetter($1,"shouldOverdrawWholeArea",!1);u.addGetterSetter($1,"useSingleNodeRotation",!0);u.backCompat($1,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});class B3 extends U0{_sceneFunc(h){h.beginPath(),h.arc(0,0,this.radius(),0,$0.getAngle(this.angle()),this.clockwise()),h.lineTo(0,0),h.closePath(),h.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(h){this.radius(h/2)}setHeight(h){this.radius(h/2)}}B3.prototype.className="Wedge";B3.prototype._centroid=!0;B3.prototype._attrsAffectingSize=["radius"];q1(B3);u.addGetterSetter(B3,"radius",0,V0());u.addGetterSetter(B3,"angle",0,V0());u.addGetterSetter(B3,"clockwise",!1);u.backCompat(B3,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});function wL(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var am=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],tm=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function sm(h,_){let{data:G,width:Y,height:X}=h,K,Z,Q,D,O,A,H,C,N,j,W,S,R,v,x,P,I,b,l,i,h0=_+_+1,q0=Y-1,Q0=X-1,o=_+1,r=o*(o+1)/2,d=new wL,s=am[_],_0=tm[_],Z0=null,X0=d,E0=null,m=null;for(let N0=1;N0<h0;N0++)if(X0=X0.next=new wL,N0===o)Z0=X0;X0.next=d,Q=Z=0;for(let N0=0;N0<X;N0++){S=R=v=x=D=O=A=H=0,C=o*(P=G[Z]),N=o*(I=G[Z+1]),j=o*(b=G[Z+2]),W=o*(l=G[Z+3]),D+=r*P,O+=r*I,A+=r*b,H+=r*l,X0=d;for(let x0=0;x0<o;x0++)X0.r=P,X0.g=I,X0.b=b,X0.a=l,X0=X0.next;for(let x0=1;x0<o;x0++)K=Z+((q0<x0?q0:x0)<<2),D+=(X0.r=P=G[K])*(i=o-x0),O+=(X0.g=I=G[K+1])*i,A+=(X0.b=b=G[K+2])*i,H+=(X0.a=l=G[K+3])*i,S+=P,R+=I,v+=b,x+=l,X0=X0.next;E0=d,m=Z0;for(let x0=0;x0<Y;x0++){if(G[Z+3]=l=H*s>>_0,l!==0)l=255/l,G[Z]=(D*s>>_0)*l,G[Z+1]=(O*s>>_0)*l,G[Z+2]=(A*s>>_0)*l;else G[Z]=G[Z+1]=G[Z+2]=0;D-=C,O-=N,A-=j,H-=W,C-=E0.r,N-=E0.g,j-=E0.b,W-=E0.a,K=Q+((K=x0+_+1)<q0?K:q0)<<2,S+=E0.r=G[K],R+=E0.g=G[K+1],v+=E0.b=G[K+2],x+=E0.a=G[K+3],D+=S,O+=R,A+=v,H+=x,E0=E0.next,C+=P=m.r,N+=I=m.g,j+=b=m.b,W+=l=m.a,S-=P,R-=I,v-=b,x-=l,m=m.next,Z+=4}Q+=Y}for(let N0=0;N0<Y;N0++){R=v=x=S=O=A=H=D=0,Z=N0<<2,C=o*(P=G[Z]),N=o*(I=G[Z+1]),j=o*(b=G[Z+2]),W=o*(l=G[Z+3]),D+=r*P,O+=r*I,A+=r*b,H+=r*l,X0=d;for(let k=0;k<o;k++)X0.r=P,X0.g=I,X0.b=b,X0.a=l,X0=X0.next;let x0=Y;for(let k=1;k<=_;k++)if(Z=x0+N0<<2,D+=(X0.r=P=G[Z])*(i=o-k),O+=(X0.g=I=G[Z+1])*i,A+=(X0.b=b=G[Z+2])*i,H+=(X0.a=l=G[Z+3])*i,S+=P,R+=I,v+=b,x+=l,X0=X0.next,k<Q0)x0+=Y;Z=N0,E0=d,m=Z0;for(let k=0;k<X;k++){if(K=Z<<2,G[K+3]=l=H*s>>_0,l>0)l=255/l,G[K]=(D*s>>_0)*l,G[K+1]=(O*s>>_0)*l,G[K+2]=(A*s>>_0)*l;else G[K]=G[K+1]=G[K+2]=0;D-=C,O-=N,A-=j,H-=W,C-=E0.r,N-=E0.g,j-=E0.b,W-=E0.a,K=N0+((K=k+o)<Q0?K:Q0)*Y<<2,D+=S+=E0.r=G[K],O+=R+=E0.g=G[K+1],A+=v+=E0.b=G[K+2],H+=x+=E0.a=G[K+3],E0=E0.next,C+=P=m.r,N+=I=m.g,j+=b=m.b,W+=l=m.a,S-=P,R-=I,v-=b,x-=l,m=m.next,Z+=Y}}}var gL=function(_){let G=Math.round(this.blurRadius());if(G>0)sm(_,G)};u.addGetterSetter(C0,"blurRadius",0,V0(),u.afterSetFilter);var IL=function(h){let _=this.brightness()*255,G=h.data,Y=G.length;for(let X=0;X<Y;X+=4)G[X]+=_,G[X+1]+=_,G[X+2]+=_};u.addGetterSetter(C0,"brightness",0,V0(),u.afterSetFilter);var PL=function(h){let _=this.brightness(),G=h.data,Y=G.length;for(let X=0;X<Y;X+=4)G[X]=Math.min(255,G[X]*_),G[X+1]=Math.min(255,G[X+1]*_),G[X+2]=Math.min(255,G[X+2]*_)};var yL=function(h){let _=Math.pow((this.contrast()+100)/100,2),G=h.data,Y=G.length,X=150,K=150,Z=150;for(let Q=0;Q<Y;Q+=4)X=G[Q],K=G[Q+1],Z=G[Q+2],X/=255,X-=0.5,X*=_,X+=0.5,X*=255,K/=255,K-=0.5,K*=_,K+=0.5,K*=255,Z/=255,Z-=0.5,Z*=_,Z+=0.5,Z*=255,X=X<0?0:X>255?255:X,K=K<0?0:K>255?255:K,Z=Z<0?0:Z>255?255:Z,G[Q]=X,G[Q+1]=K,G[Q+2]=Z};u.addGetterSetter(C0,"contrast",0,V0(),u.afterSetFilter);var bL=function(h){var _,G,Y,X,K,Z,Q,D,O;let{data:A,width:H,height:C}=h,N=Math.min(1,Math.max(0,(G=(_=this.embossStrength)===null||_===void 0?void 0:_.call(this))!==null&&G!==void 0?G:0.5)),j=Math.min(1,Math.max(0,(X=(Y=this.embossWhiteLevel)===null||Y===void 0?void 0:Y.call(this))!==null&&X!==void 0?X:0.5)),S=(Q={"top-left":315,top:270,"top-right":225,right:180,"bottom-right":135,bottom:90,"bottom-left":45,left:0}[(Z=(K=this.embossDirection)===null||K===void 0?void 0:K.call(this))!==null&&Z!==void 0?Z:"top-left"])!==null&&Q!==void 0?Q:315,R=!!((O=(D=this.embossBlend)===null||D===void 0?void 0:D.call(this))!==null&&O!==void 0?O:!1),v=N*10,x=j*255,P=S*Math.PI/180,I=Math.cos(P),b=Math.sin(P),l=0.12549019607843137*v,i=new Uint8ClampedArray(A),h0=new Float32Array(H*C);for(let d=0,s=0;s<A.length;s+=4,d++)h0[d]=0.2126*i[s]+0.7152*i[s+1]+0.0722*i[s+2];let q0=[-1,0,1,-2,0,2,-1,0,1],Q0=[-1,-2,-1,0,0,0,1,2,1],o=[-H-1,-H,-H+1,-1,0,1,H-1,H,H+1],r=(d)=>d<0?0:d>255?255:d;for(let d=1;d<C-1;d++)for(let s=1;s<H-1;s++){let _0=d*H+s,Z0=0,X0=0;Z0+=h0[_0+o[0]]*q0[0],X0+=h0[_0+o[0]]*Q0[0],Z0+=h0[_0+o[1]]*q0[1],X0+=h0[_0+o[1]]*Q0[1],Z0+=h0[_0+o[2]]*q0[2],X0+=h0[_0+o[2]]*Q0[2],Z0+=h0[_0+o[3]]*q0[3],X0+=h0[_0+o[3]]*Q0[3],Z0+=h0[_0+o[5]]*q0[5],X0+=h0[_0+o[5]]*Q0[5],Z0+=h0[_0+o[6]]*q0[6],X0+=h0[_0+o[6]]*Q0[6],Z0+=h0[_0+o[7]]*q0[7],X0+=h0[_0+o[7]]*Q0[7],Z0+=h0[_0+o[8]]*q0[8],X0+=h0[_0+o[8]]*Q0[8];let E0=I*Z0+b*X0,m=r(x+E0*l),N0=_0*4;if(R){let x0=m-x;A[N0]=r(i[N0]+x0),A[N0+1]=r(i[N0+1]+x0),A[N0+2]=r(i[N0+2]+x0),A[N0+3]=i[N0+3]}else A[N0]=A[N0+1]=A[N0+2]=m,A[N0+3]=i[N0+3]}for(let d=0;d<H;d++){let s=d*4,_0=((C-1)*H+d)*4;A[s]=i[s],A[s+1]=i[s+1],A[s+2]=i[s+2],A[s+3]=i[s+3],A[_0]=i[_0],A[_0+1]=i[_0+1],A[_0+2]=i[_0+2],A[_0+3]=i[_0+3]}for(let d=1;d<C-1;d++){let s=d*H*4,_0=(d*H+(H-1))*4;A[s]=i[s],A[s+1]=i[s+1],A[s+2]=i[s+2],A[s+3]=i[s+3],A[_0]=i[_0],A[_0+1]=i[_0+1],A[_0+2]=i[_0+2],A[_0+3]=i[_0+3]}return h};u.addGetterSetter(C0,"embossStrength",0.5,V0(),u.afterSetFilter);u.addGetterSetter(C0,"embossWhiteLevel",0.5,V0(),u.afterSetFilter);u.addGetterSetter(C0,"embossDirection","top-left",void 0,u.afterSetFilter);u.addGetterSetter(C0,"embossBlend",!1,void 0,u.afterSetFilter);function GO(h,_,G,Y,X){let K=G-_,Z=X-Y;if(K===0)return Y+Z/2;if(Z===0)return Y;let Q=(h-_)/K;return Q=Z*Q+Y,Q}var mL=function(h){let _=h.data,G=_.length,Y=_[0],X=Y,K,Z=_[1],Q=Z,D,O=_[2],A=O,H,C=this.enhance();if(C===0)return;for(let x=0;x<G;x+=4){if(K=_[x+0],K<Y)Y=K;else if(K>X)X=K;if(D=_[x+1],D<Z)Z=D;else if(D>Q)Q=D;if(H=_[x+2],H<O)O=H;else if(H>A)A=H}if(X===Y)X=255,Y=0;if(Q===Z)Q=255,Z=0;if(A===O)A=255,O=0;let N,j,W,S,R,v;if(C>0)N=X+C*(255-X),j=Y-C*(Y-0),W=Q+C*(255-Q),S=Z-C*(Z-0),R=A+C*(255-A),v=O-C*(O-0);else{let x=(X+Y)*0.5;N=X+C*(X-x),j=Y+C*(Y-x);let P=(Q+Z)*0.5;W=Q+C*(Q-P),S=Z+C*(Z-P);let I=(A+O)*0.5;R=A+C*(A-I),v=O+C*(O-I)}for(let x=0;x<G;x+=4)_[x+0]=GO(_[x+0],Y,X,j,N),_[x+1]=GO(_[x+1],Z,Q,S,W),_[x+2]=GO(_[x+2],O,A,v,R)};u.addGetterSetter(C0,"enhance",0,V0(),u.afterSetFilter);var fL=function(h){let _=h.data,G=_.length;for(let Y=0;Y<G;Y+=4){let X=0.34*_[Y]+0.5*_[Y+1]+0.16*_[Y+2];_[Y]=X,_[Y+1]=X,_[Y+2]=X}};u.addGetterSetter(C0,"hue",0,V0(),u.afterSetFilter);u.addGetterSetter(C0,"saturation",0,V0(),u.afterSetFilter);u.addGetterSetter(C0,"luminance",0,V0(),u.afterSetFilter);var kL=function(h){let _=h.data,G=_.length,X=Math.pow(2,this.saturation()),K=Math.abs(this.hue()+360)%360,Z=this.luminance()*127,Q=1*X*Math.cos(K*Math.PI/180),D=1*X*Math.sin(K*Math.PI/180),O=0.299+0.701*Q+0.167*D,A=0.587-0.587*Q+0.33*D,H=0.114-0.114*Q-0.497*D,C=0.299-0.299*Q-0.328*D,N=0.587+0.413*Q+0.035*D,j=0.114-0.114*Q+0.293*D,W=0.299-0.3*Q+1.25*D,S=0.587-0.586*Q-1.05*D,R=0.114+0.886*Q-0.2*D,v,x,P,I;for(let b=0;b<G;b+=4)v=_[b+0],x=_[b+1],P=_[b+2],I=_[b+3],_[b+0]=O*v+A*x+H*P+Z,_[b+1]=C*v+N*x+j*P+Z,_[b+2]=W*v+S*x+R*P+Z,_[b+3]=I};var uL=function(h){let _=h.data,G=_.length,Y=Math.pow(2,this.value()),X=Math.pow(2,this.saturation()),K=Math.abs(this.hue()+360)%360,Z=Y*X*Math.cos(K*Math.PI/180),Q=Y*X*Math.sin(K*Math.PI/180),D=0.299*Y+0.701*Z+0.167*Q,O=0.587*Y-0.587*Z+0.33*Q,A=0.114*Y-0.114*Z-0.497*Q,H=0.299*Y-0.299*Z-0.328*Q,C=0.587*Y+0.413*Z+0.035*Q,N=0.114*Y-0.114*Z+0.293*Q,j=0.299*Y-0.3*Z+1.25*Q,W=0.587*Y-0.586*Z-1.05*Q,S=0.114*Y+0.886*Z-0.2*Q;for(let R=0;R<G;R+=4){let v=_[R+0],x=_[R+1],P=_[R+2],I=_[R+3];_[R+0]=D*v+O*x+A*P,_[R+1]=H*v+C*x+N*P,_[R+2]=j*v+W*x+S*P,_[R+3]=I}};u.addGetterSetter(C0,"hue",0,V0(),u.afterSetFilter);u.addGetterSetter(C0,"saturation",0,V0(),u.afterSetFilter);u.addGetterSetter(C0,"value",0,V0(),u.afterSetFilter);var pL=function(h){let _=h.data,G=_.length;for(let Y=0;Y<G;Y+=4)_[Y]=255-_[Y],_[Y+1]=255-_[Y+1],_[Y+2]=255-_[Y+2]};var nm=function(h,_,G){let Y=h.data,X=_.data,K=h.width,Z=h.height,Q=G.polarCenterX||K/2,D=G.polarCenterY||Z/2,O=Math.sqrt(Q*Q+D*D),A=K-Q,H=Z-D,C=Math.sqrt(A*A+H*H);O=C>O?C:O;let N=Z,j=K,W=360/j*Math.PI/180;for(let S=0;S<j;S+=1){let R=Math.sin(S*W),v=Math.cos(S*W);for(let x=0;x<N;x+=1){A=Math.floor(Q+O*x/N*v),H=Math.floor(D+O*x/N*R);let P=(H*K+A)*4,I=Y[P+0],b=Y[P+1],l=Y[P+2],i=Y[P+3];P=(S+x*K)*4,X[P+0]=I,X[P+1]=b,X[P+2]=l,X[P+3]=i}}},om=function(h,_,G){let Y=h.data,X=_.data,K=h.width,Z=h.height,Q=G.polarCenterX||K/2,D=G.polarCenterY||Z/2,O=Math.sqrt(Q*Q+D*D),A=K-Q,H=Z-D,C=Math.sqrt(A*A+H*H);O=C>O?C:O;let N=Z,j=K,W=G.polarRotation||0,S,R;for(A=0;A<K;A+=1)for(H=0;H<Z;H+=1){let v=A-Q,x=H-D,P=Math.sqrt(v*v+x*x)*N/O,I=(Math.atan2(x,v)*180/Math.PI+360+W)%360;I=I*j/360,S=Math.floor(I),R=Math.floor(P);let b=(R*K+S)*4,l=Y[b+0],i=Y[b+1],h0=Y[b+2],q0=Y[b+3];b=(H*K+A)*4,X[b+0]=l,X[b+1]=i,X[b+2]=h0,X[b+3]=q0}},lL=function(h){let{width:_,height:G}=h,Y,X,K,Z,Q,D,O,A,H,C,N=Math.round(this.kaleidoscopePower()),j=Math.round(this.kaleidoscopeAngle()),W=Math.floor(_*(j%360)/360);if(N<1)return;let S=n.createCanvasElement();S.width=_,S.height=G;let R=S.getContext("2d").getImageData(0,0,_,G);n.releaseCanvas(S),nm(h,R,{polarCenterX:_/2,polarCenterY:G/2});let v=_/Math.pow(2,N);while(v<=8)v=v*2,N-=1;v=Math.ceil(v);let x=v,P=0,I=x,b=1;if(W+v>_)P=x,I=0,b=-1;for(X=0;X<G;X+=1)for(Y=P;Y!==I;Y+=b)K=Math.round(Y+W)%_,H=(_*X+K)*4,Q=R.data[H+0],D=R.data[H+1],O=R.data[H+2],A=R.data[H+3],C=(_*X+Y)*4,R.data[C+0]=Q,R.data[C+1]=D,R.data[C+2]=O,R.data[C+3]=A;for(X=0;X<G;X+=1){x=Math.floor(v);for(Z=0;Z<N;Z+=1){for(Y=0;Y<x+1;Y+=1)H=(_*X+Y)*4,Q=R.data[H+0],D=R.data[H+1],O=R.data[H+2],A=R.data[H+3],C=(_*X+x*2-Y-1)*4,R.data[C+0]=Q,R.data[C+1]=D,R.data[C+2]=O,R.data[C+3]=A;x*=2}}om(R,h,{polarRotation:0})};u.addGetterSetter(C0,"kaleidoscopePower",2,V0(),u.afterSetFilter);u.addGetterSetter(C0,"kaleidoscopeAngle",0,V0(),u.afterSetFilter);function pJ(h,_,G){let Y=(G*h.width+_)*4,X=[];return X.push(h.data[Y++],h.data[Y++],h.data[Y++],h.data[Y++]),X}function yY(h,_){return Math.sqrt(Math.pow(h[0]-_[0],2)+Math.pow(h[1]-_[1],2)+Math.pow(h[2]-_[2],2))}function rm(h){let _=[0,0,0];for(let G=0;G<h.length;G++)_[0]+=h[G][0],_[1]+=h[G][1],_[2]+=h[G][2];return _[0]/=h.length,_[1]/=h.length,_[2]/=h.length,_}function em(h,_){let G=pJ(h,0,0),Y=pJ(h,h.width-1,0),X=pJ(h,0,h.height-1),K=pJ(h,h.width-1,h.height-1),Z=_||10;if(yY(G,Y)<Z&&yY(Y,K)<Z&&yY(K,X)<Z&&yY(X,G)<Z){let Q=rm([Y,G,K,X]),D=[];for(let O=0;O<h.width*h.height;O++){let A=yY(Q,[h.data[O*4],h.data[O*4+1],h.data[O*4+2]]);D[O]=A<Z?0:255}return D}}function hf(h,_){for(let G=0;G<h.width*h.height;G++)h.data[4*G+3]=_[G]}function _f(h,_,G){let Y=[1,1,1,1,0,1,1,1,1],X=Math.round(Math.sqrt(Y.length)),K=Math.floor(X/2),Z=[];for(let Q=0;Q<G;Q++)for(let D=0;D<_;D++){let O=Q*_+D,A=0;for(let H=0;H<X;H++)for(let C=0;C<X;C++){let N=Q+H-K,j=D+C-K;if(N>=0&&N<G&&j>=0&&j<_){let W=N*_+j,S=Y[H*X+C];A+=h[W]*S}}Z[O]=A===2040?255:0}return Z}function Gf(h,_,G){let Y=[1,1,1,1,1,1,1,1,1],X=Math.round(Math.sqrt(Y.length)),K=Math.floor(X/2),Z=[];for(let Q=0;Q<G;Q++)for(let D=0;D<_;D++){let O=Q*_+D,A=0;for(let H=0;H<X;H++)for(let C=0;C<X;C++){let N=Q+H-K,j=D+C-K;if(N>=0&&N<G&&j>=0&&j<_){let W=N*_+j,S=Y[H*X+C];A+=h[W]*S}}Z[O]=A>=1020?255:0}return Z}function Yf(h,_,G){let Y=[0.1111111111111111,0.1111111111111111,0.1111111111111111,0.1111111111111111,0.1111111111111111,0.1111111111111111,0.1111111111111111,0.1111111111111111,0.1111111111111111],X=Math.round(Math.sqrt(Y.length)),K=Math.floor(X/2),Z=[];for(let Q=0;Q<G;Q++)for(let D=0;D<_;D++){let O=Q*_+D,A=0;for(let H=0;H<X;H++)for(let C=0;C<X;C++){let N=Q+H-K,j=D+C-K;if(N>=0&&N<G&&j>=0&&j<_){let W=N*_+j,S=Y[H*X+C];A+=h[W]*S}}Z[O]=A}return Z}var iL=function(h){let _=this.threshold(),G=em(h,_);if(G)G=_f(G,h.width,h.height),G=Gf(G,h.width,h.height),G=Yf(G,h.width,h.height),hf(h,G);return h};u.addGetterSetter(C0,"threshold",0,V0(),u.afterSetFilter);var cL=function(h){let _=this.noise()*255,G=h.data,Y=G.length,X=_/2;for(let K=0;K<Y;K+=4)G[K+0]+=X-2*X*Math.random(),G[K+1]+=X-2*X*Math.random(),G[K+2]+=X-2*X*Math.random()};u.addGetterSetter(C0,"noise",0.2,V0(),u.afterSetFilter);var dL=function(h){let _=Math.ceil(this.pixelSize()),G=h.width,Y=h.height,X=Math.ceil(G/_),K=Math.ceil(Y/_),Z=h.data;if(_<=0){n.error("pixelSize value can not be <= 0");return}for(let Q=0;Q<X;Q+=1)for(let D=0;D<K;D+=1){let O=0,A=0,H=0,C=0,N=Q*_,j=N+_,W=D*_,S=W+_,R=0;for(let v=N;v<j;v+=1){if(v>=G)continue;for(let x=W;x<S;x+=1){if(x>=Y)continue;let P=(G*x+v)*4;O+=Z[P+0],A+=Z[P+1],H+=Z[P+2],C+=Z[P+3],R+=1}}O=O/R,A=A/R,H=H/R,C=C/R;for(let v=N;v<j;v+=1){if(v>=G)continue;for(let x=W;x<S;x+=1){if(x>=Y)continue;let P=(G*x+v)*4;Z[P+0]=O,Z[P+1]=A,Z[P+2]=H,Z[P+3]=C}}}};u.addGetterSetter(C0,"pixelSize",8,V0(),u.afterSetFilter);var aL=function(h){let _=Math.round(this.levels()*254)+1,G=h.data,Y=G.length,X=255/_;for(let K=0;K<Y;K+=1)G[K]=Math.floor(G[K]/X)*X};u.addGetterSetter(C0,"levels",0.5,V0(),u.afterSetFilter);var tL=function(h){let _=h.data,G=_.length,Y=this.red(),X=this.green(),K=this.blue();for(let Z=0;Z<G;Z+=4){let Q=(0.34*_[Z]+0.5*_[Z+1]+0.16*_[Z+2])/255;_[Z]=Q*Y,_[Z+1]=Q*X,_[Z+2]=Q*K,_[Z+3]=_[Z+3]}};u.addGetterSetter(C0,"red",0,function(h){if(this._filterUpToDate=!1,h>255)return 255;else if(h<0)return 0;else return Math.round(h)});u.addGetterSetter(C0,"green",0,function(h){if(this._filterUpToDate=!1,h>255)return 255;else if(h<0)return 0;else return Math.round(h)});u.addGetterSetter(C0,"blue",0,RJ,u.afterSetFilter);var sL=function(h){let _=h.data,G=_.length,Y=this.red(),X=this.green(),K=this.blue(),Z=this.alpha();for(let Q=0;Q<G;Q+=4){let D=1-Z;_[Q]=Y*Z+_[Q]*D,_[Q+1]=X*Z+_[Q+1]*D,_[Q+2]=K*Z+_[Q+2]*D}};u.addGetterSetter(C0,"red",0,function(h){if(this._filterUpToDate=!1,h>255)return 255;else if(h<0)return 0;else return Math.round(h)});u.addGetterSetter(C0,"green",0,function(h){if(this._filterUpToDate=!1,h>255)return 255;else if(h<0)return 0;else return Math.round(h)});u.addGetterSetter(C0,"blue",0,RJ,u.afterSetFilter);u.addGetterSetter(C0,"alpha",1,function(h){if(this._filterUpToDate=!1,h>1)return 1;else if(h<0)return 0;else return h});var nL=function(h){let _=h.data,G=_.length;for(let Y=0;Y<G;Y+=4){let X=_[Y+0],K=_[Y+1],Z=_[Y+2];_[Y+0]=Math.min(255,X*0.393+K*0.769+Z*0.189),_[Y+1]=Math.min(255,X*0.349+K*0.686+Z*0.168),_[Y+2]=Math.min(255,X*0.272+K*0.534+Z*0.131)}};var oL=function(h){let G=h.data;for(let Y=0;Y<G.length;Y+=4){let X=G[Y],K=G[Y+1],Z=G[Y+2];if(0.2126*X+0.7152*K+0.0722*Z>=128)G[Y]=255-X,G[Y+1]=255-K,G[Y+2]=255-Z}return h};var rL=function(h){let _=this.threshold()*255,G=h.data,Y=G.length;for(let X=0;X<Y;X+=1)G[X]=G[X]<_?0:255};u.addGetterSetter(C0,"threshold",0.5,V0(),u.afterSetFilter);var eL=X_.Util._assign(X_,{Arc:M3,Arrow:T6,Circle:g8,Ellipse:u3,Image:M4,Label:gY,Tag:W6,Line:s4,Path:t1,Rect:I8,RegularPolygon:p3,Ring:R6,Sprite:n4,Star:l3,Text:s1,TextPath:T2,Transformer:$1,Wedge:B3,Filters:{Blur:gL,Brightness:PL,Brighten:IL,Contrast:yL,Emboss:bL,Enhance:mL,Grayscale:fL,HSL:kL,HSV:uL,Invert:pL,Kaleidoscope:lL,Mask:iL,Noise:cL,Pixelate:dL,Posterize:aL,RGB:tL,RGBA:sL,Sepia:nL,Solarize:oL,Threshold:rL}});var hj=eL;var o4=S1(l2(),1);var n2=S1(l2(),1);var Z_=X_;var Ej=S1(Jj(),1);var ZO=1;var cJ=32,JO=2;var qO={};uq(qO,{warnsIfNotActing:()=>wf,waitForCommitToBeReady:()=>zk,unhideTextInstance:()=>tf,unhideInstance:()=>af,trackSchedulerEvent:()=>Jk,suspendInstance:()=>Ak,supportsPersistence:()=>If,supportsMutation:()=>gf,supportsMicrotasks:()=>Wf,supportsHydration:()=>Pf,startSuspendingCommit:()=>Ok,shouldSetTextContent:()=>vf,shouldDeprioritizeSubtree:()=>$f,shouldAttemptEagerTransition:()=>Zk,setCurrentUpdatePriority:()=>Yk,scheduleTimeout:()=>Ff,scheduleMicrotask:()=>Rf,run:()=>Mj,resolveUpdatePriority:()=>Kk,resolveEventType:()=>qk,resolveEventTimeStamp:()=>Qk,resetTextContent:()=>Nf,resetFormInstance:()=>Uk,resetAfterCommit:()=>Cf,requestPostPaintCallback:()=>Dk,removeChildFromContainer:()=>kf,removeChild:()=>ff,prepareUpdate:()=>Ef,prepareScopeUpdate:()=>_k,preparePortalMount:()=>Uf,prepareForCommit:()=>Vf,preloadInstance:()=>Bk,now:()=>lJ,noTimeout:()=>Sf,maySuspendCommit:()=>Mk,isPrimaryRenderer:()=>xf,insertInContainerBefore:()=>mf,insertBefore:()=>zj,idlePriority:()=>iJ,hideTextInstance:()=>df,hideInstance:()=>cf,getRootHostContext:()=>Lf,getPublicInstance:()=>Hf,getInstanceFromScope:()=>Gk,getInstanceFromNode:()=>of,getCurrentUpdatePriority:()=>Xk,getCurrentEventPriority:()=>hk,getChildHostContext:()=>jf,finalizeInitialChildren:()=>zf,detachDeletedInstance:()=>nf,createTextInstance:()=>Af,createInstance:()=>Of,commitUpdate:()=>lf,commitTextUpdate:()=>uf,commitMount:()=>pf,clearContainer:()=>sf,cancelTimeout:()=>Tf,beforeActiveInstanceBlur:()=>rf,appendInitialChild:()=>Bf,appendChildToContainer:()=>bf,appendChild:()=>yf,afterActiveInstanceBlur:()=>ef,NotPendingTransition:()=>Hk,HostTransitionContext:()=>Vk});var Bj=S1(l2(),1);var qj={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0},Qj=!1,Dj=!1,mY=".react-konva-event",Jf=!1;var qf=`ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.
|
|
259
|
-
Position of a node will be changed during drag&drop, so you should update state of the react app as well.
|
|
260
|
-
Consider to add onDragMove or onDragEnd events.
|
|
261
|
-
For more info see: https://github.com/konvajs/react-konva/issues/256
|
|
262
|
-
`,Qf=`ReactKonva: You are using "zIndex" attribute for a Konva node.
|
|
263
|
-
react-konva may get confused with ordering. Just define correct order of elements in your render function of a component.
|
|
264
|
-
For more info see: https://github.com/konvajs/react-konva/issues/194
|
|
265
|
-
`,Df={};function J_(h,_,G=Df){if(!Qj&&"zIndex"in _)console.warn(Qf),Qj=!0;if(!Dj&&_.draggable){var Y=_.x!==void 0||_.y!==void 0,X=_.onDragEnd||_.onDragMove;if(Y&&!X)console.warn(qf),Dj=!0}for(var K in G){if(qj[K])continue;var Z=K.slice(0,2)==="on",Q=G[K]!==_[K];if(Z&&Q){var D=K.substr(2).toLowerCase();if(D.substr(0,7)==="content")D="content"+D.substr(7,1).toUpperCase()+D.substr(8);h.off(D,G[K])}var O=!_.hasOwnProperty(K);if(O)h.setAttr(K,void 0)}var A=Jf||_._useStrictMode,H={},C=!1;let N={};for(var K in _){if(qj[K])continue;var Z=K.slice(0,2)==="on",j=G[K]!==_[K];if(Z&&j){var D=K.substr(2).toLowerCase();if(D.substr(0,7)==="content")D="content"+D.substr(7,1).toUpperCase()+D.substr(8);if(_[K])N[D]=_[K]}if(!Z&&(_[K]!==G[K]||A&&_[K]!==h.getAttr(K)))C=!0,H[K]=_[K]}if(C)h.setAttrs(H),v6(h);for(var D in N)h.off(D+mY),h.on(D+mY,N[D])}function v6(h){if(!$0.autoDrawEnabled){var _=h.getLayer()||h.getStage();_&&_.batchDraw()}}Zj();var Oj={},Mf={};Z_.Node.prototype._applyProps=J_;var Aj=cJ;function Bf(h,_){if(typeof _==="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${_}`);return}h.add(_),v6(h)}function Of(h,_,G){let Y=Z_[h];if(!Y)console.error(`Konva has no node with the type ${h}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${h}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),Y=Z_.Group;let X={},K={};for(var Z in _){if(Z==="ref")continue;var Q=Z.slice(0,2)==="on";if(Q)K[Z]=_[Z];else X[Z]=_[Z]}let D=new Y(X);return J_(D,K),D}function Af(h,_,G){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${h}"`)}function zf(h,_,G){return!1}function Hf(h){return h}function Vf(){return null}function Uf(){return null}function Ef(h,_,G,Y){return Mf}function Cf(){}function Nf(h){}function $f(h,_){return!1}function Lf(){return Oj}function jf(){return Oj}var Ff=setTimeout,Tf=clearTimeout,Wf=!0,Rf=typeof queueMicrotask==="function"?queueMicrotask:(h)=>Promise.resolve(null).then(h),Sf=-1;function vf(h,_){return!1}var xf=!1,wf=!1,gf=!0,If=!1,Pf=!1;function yf(h,_){if(_.parent===h)_.moveToTop();else h.add(_);v6(h)}function bf(h,_){if(_.parent===h)_.moveToTop();else h.add(_);v6(h)}function zj(h,_,G){_._remove(),h.add(_),_.setZIndex(G.getZIndex()),v6(h)}function mf(h,_,G){zj(h,_,G)}function ff(h,_){_.destroy(),_.off(mY),v6(h)}function kf(h,_){_.destroy(),_.off(mY),v6(h)}function uf(h,_,G){console.error(`Text components are not yet supported in ReactKonva. You text is: "${G}"`)}function pf(h,_,G){}function lf(h,_,G,Y){J_(h,Y,G)}function cf(h){h.hide(),v6(h)}function df(h){}function af(h,_){if(_.visible==null||_.visible)h.show()}function tf(h,_){}function sf(h){}function nf(){}function of(){return null}function rf(){}function ef(){}function hk(){return cJ}function _k(){}function Gk(){return null}function Yk(h){Aj=h}function Xk(){return Aj}function Kk(){return JO}function Zk(){return!1}function Jk(){}function qk(){return null}function Qk(){return-1.1}function Dk(){}function Mk(){return!1}function Bk(){return!0}function Ok(){}function Ak(){}function zk(){return null}var Hk=null,Vk=Bj.default.createContext(null);function Uk(){}var N2=S1(l2(),1);function Hj(h,_,G){if(!h)return;if(G(h)===!0)return h;let Y=_?h.return:h.child;for(;Y;){let X=Hj(Y,_,G);if(X)return X;Y=_?null:Y.sibling}}function Vj(h){try{return Object.defineProperties(h,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch(_){return h}}var QO=Vj(N2.createContext(null));class dJ extends N2.Component{render(){return N2.createElement(QO.Provider,{value:this._reactInternals},this.props.children)}}function Ek(){let h=N2.useContext(QO);if(h===null)throw Error("its-fine: useFiber must be called within a <FiberProvider />!");let _=N2.useId();return N2.useMemo(()=>{for(let G of[h,h==null?void 0:h.alternate]){if(!G)continue;let Y=Hj(G,!1,(X)=>{let K=X.memoizedState;for(;K;){if(K.memoizedState===_)return!0;K=K.next}});if(Y)return Y}},[h,_])}var Ck=Symbol.for("react.context"),Nk=(h)=>h!==null&&typeof h=="object"&&("$$typeof"in h)&&h.$$typeof===Ck;function $k(){let h=Ek(),[_]=N2.useState(()=>new Map);_.clear();let G=h;for(;G;){let Y=G.type;Nk(Y)&&Y!==QO&&!_.has(Y)&&_.set(Y,N2.use(Vj(Y))),G=G.return}return _}function Uj(){let h=$k();return N2.useMemo(()=>Array.from(h.keys()).reduce((_,G)=>(Y)=>N2.createElement(_,null,N2.createElement(G.Provider,{...Y,value:h.get(G)})),(_)=>N2.createElement(dJ,{..._})),[h])}if(n2.default.version.indexOf("19")===-1)throw Error("react-konva version 19 is only compatible with React 19. Make sure to have the last version of react-konva and react or downgrade react-konva to version 18.");function Lk(h){let _=n2.default.useRef({});return n2.default.useLayoutEffect(()=>{_.current=h}),n2.default.useLayoutEffect(()=>{return()=>{_.current={}}},[]),_.current}var jk=()=>{let h=n2.default.useRef(0);return n2.default.useMemo(()=>{h.current++},[]),h.current>1},Fk=(h)=>{let _=n2.default.useRef(null),G=n2.default.useRef(null),Y=n2.default.useRef(null),X=Lk(h),K=Uj(),Z=n2.default.useRef(null),Q=(A)=>{let{forwardedRef:H}=h;if(!H)return;if(typeof H==="function")H(A);else H.current=A},D=jk(),O=()=>{Q(null),q_.flushSyncFromReconciler(()=>{q_.updateContainer(null,Y.current,null)}),G.current?.destroy(),G.current=null};return n2.default.useLayoutEffect(()=>{if(Z.current)clearTimeout(Z.current),Z.current=null;if(G.current)Q(G.current);else G.current=new Z_.Stage({width:h.width,height:h.height,container:_.current}),Q(G.current),Y.current=q_.createContainer(G.current,ZO,null,!1,null,"",console.error,console.error,console.error,null),q_.updateContainer(n2.default.createElement(K,{},h.children),Y.current,null,()=>{});return()=>{if(D)Z.current=setTimeout(O,0);else O()}},[]),n2.default.useLayoutEffect(()=>{Q(G.current),J_(G.current,h,X),q_.updateContainer(n2.default.createElement(K,{},h.children),Y.current,null),q_.flushSyncWork()}),n2.default.createElement("div",{ref:_,id:h.id,accessKey:h.accessKey,className:h.className,role:h.role,style:h.style,tabIndex:h.tabIndex,title:h.title})},Cj="Layer";var Nj="Group";var DO="Rect";var MO="Line";var $j="Image";var BO="Arrow";var q_=Ej.default(qO),Lj=n2.default.forwardRef((h,_)=>{return n2.default.createElement(dJ,{},n2.default.createElement(Fk,{...h,forwardedRef:_}))});var Tj=S1(Fj(),1);var Tk=({width:h,height:_,mediaDimensions:G,imageUrl:Y,videoElement:X,annotations:K,scale:Z,offset:Q,onPan:D,onClick:O,className:A,isDrawing:H=!1,currentTool:C="arrow",currentColor:N="#ef4444",onAddAnnotation:j})=>{let[W]=Tj.default(Y||"","anonymous"),S=o4.useRef(null),R=o4.useRef(!1),v=o4.useRef({x:0,y:0}),x=o4.useRef(null),P=o4.useRef(null),I=o4.useRef(null),b=o4.useRef(null);o4.useEffect(()=>{if(X&&S.current){let o=S.current.getLayer();if(!o)return;let r=new hj.Animation(()=>{},o);return r.start(),()=>{r.stop()}}},[X]);let l=(o,r=!1,d)=>{let s=o.getAbsoluteTransform().copy();s.invert();let _0=d||o.getStage()?.getPointerPosition();if(_0){let Z0=s.point(_0);if(r)return{x:Math.max(0,Math.min(G.width,Z0.x)),y:Math.max(0,Math.min(G.height,Z0.y))};return Z0}return null},i=o4.useRef({isDrawing:H,currentTool:C,currentColor:N,onPan:D,offset:Q,scale:Z,mediaDimensions:G,onAddAnnotation:j});i.current={isDrawing:H,currentTool:C,currentColor:N,onPan:D,offset:Q,scale:Z,mediaDimensions:G,onAddAnnotation:j};let h0=()=>{if(!R.current)return;R.current=!1;let{isDrawing:o,onAddAnnotation:r,mediaDimensions:d,currentTool:s,currentColor:_0}=i.current;if(o&&r){let{width:Z0,height:X0}=d,E0=(m,N0)=>m/N0;if(s==="freehand"&&P.current){P.current.visible(!1);let m=P.current.points(),N0=[];for(let x0=0;x0<m.length;x0+=2)N0.push([E0(m[x0],Z0),E0(m[x0+1],X0)]);if(N0.length>1)r({type:"freehand",color:_0,points:N0})}else if(s==="line"&&P.current){P.current.visible(!1);let m=P.current.points(),N0={type:"line",color:_0,points:[[E0(m[0],Z0),E0(m[1],X0)],[E0(m[2],Z0),E0(m[3],X0)]]};r(N0)}else if(s==="box"&&I.current){I.current.visible(!1);let m=I.current.x(),N0=I.current.y(),x0=I.current.width(),k=I.current.height(),y0=[E0(m,Z0),E0(N0,X0)],a0=[E0(m+x0,Z0),E0(N0+k,X0)];r({type:"box",color:_0,points:[y0,a0]})}else if(s==="arrow"&&b.current){b.current.visible(!1);let m=b.current.points(),N0={type:"arrow",color:_0,points:[[E0(m[0],Z0),E0(m[1],X0)],[E0(m[2],Z0),E0(m[3],X0)]]};r(N0)}}};o4.useEffect(()=>{let o=(d)=>{if(!R.current)return;let s=S.current?.getStage();if(!s)return;let Z0=s.container().getBoundingClientRect(),X0,E0;if("clientX"in d)X0=d.clientX,E0=d.clientY;else X0=d.touches[0].clientX,E0=d.touches[0].clientY;let m={x:X0-Z0.left,y:E0-Z0.top},{isDrawing:N0,currentTool:x0,onPan:k,offset:y0}=i.current;if(N0){if(x0==="select")return;let a0=l(S.current,!0,m);if(!a0||!x.current)return;let n0=x.current,w0=S.current?.getLayer();if(x0==="freehand"&&P.current){let g0=P.current.points().concat([a0.x,a0.y]);P.current.points(g0)}else if(x0==="line"&&P.current)P.current.points([n0.x,n0.y,a0.x,a0.y]);else if(x0==="box"&&I.current)I.current.width(a0.x-n0.x),I.current.height(a0.y-n0.y);else if(x0==="arrow"&&b.current)b.current.points([n0.x,n0.y,a0.x,a0.y]);w0?.batchDraw()}else{if(!k)return;let a0=m.x-v.current.x,n0=m.y-v.current.y;v.current=m,k({x:y0.x+a0,y:y0.y+n0})}},r=()=>{h0()};return window.addEventListener("mousemove",o),window.addEventListener("mouseup",r),window.addEventListener("touchmove",o),window.addEventListener("touchend",r),()=>{window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",r),window.removeEventListener("touchmove",o),window.removeEventListener("touchend",r)}},[]);let q0=(o)=>{if(H){if(C==="select")return;if(!o.target.getStage())return;let d=l(S.current);if(!d)return;if(d.x<0||d.x>G.width||d.y<0||d.y>G.height)return;R.current=!0,x.current=d;let s=S.current?.getLayer();if(!s)return;if(C==="freehand"&&P.current)P.current.points([d.x,d.y]),P.current.stroke(N),P.current.visible(!0);else if(C==="line"&&P.current)P.current.points([d.x,d.y,d.x,d.y]),P.current.stroke(N),P.current.visible(!0);else if(C==="box"&&I.current)I.current.position(d),I.current.width(0),I.current.height(0),I.current.stroke(N),I.current.visible(!0);else if(C==="arrow"&&b.current)b.current.points([d.x,d.y,d.x,d.y]),b.current.stroke(N),b.current.fill(N),b.current.visible(!0);s.batchDraw()}else{if(!D)return;R.current=!0;let r=o.target.getStage();if(r){let d=r.getPointerPosition();if(d)v.current=d}}},Q0=(o,r)=>{let{width:d,height:s}=G;switch(o.type){case"box":{let[_0,Z0]=o.points,X0=Math.min(_0[0],Z0[0])*d,E0=Math.min(_0[1],Z0[1])*s,m=Math.abs(Z0[0]-_0[0])*d,N0=Math.abs(Z0[1]-_0[1])*s;return f(DO,{x:X0,y:E0,width:m,height:N0,stroke:o.color,strokeWidth:2.6/Z,listening:!1},r)}case"arrow":{let _0=o.points.flat().map((Z0,X0)=>X0%2===0?Z0*d:Z0*s);return f(BO,{points:_0,stroke:o.color,strokeWidth:2.6/Z,fill:o.color,pointerLength:10/Z,pointerWidth:10/Z,listening:!1},r)}case"line":case"freehand":{let _0=o.points.flat().map((Z0,X0)=>X0%2===0?Z0*d:Z0*s);return f(MO,{points:_0,stroke:o.color,strokeWidth:2.6/Z,tension:0.5,lineCap:"round",lineJoin:"round",listening:!1},r)}default:return null}};return f("div",{className:A,style:{width:h,height:_,overflow:"hidden",pointerEvents:!H&&!D?"none":"auto",cursor:H&&C!=="select"?"crosshair":D?R.current?"grabbing":"grab":"default"},children:f(Lj,{width:h,height:_,scaleX:Z,scaleY:Z,x:Q.x,y:Q.y,onMouseDown:q0,onClick:!H?O:void 0,onTap:!H?O:void 0,onTouchStart:q0,children:O0(Cj,{children:[f($j,{ref:S,image:X||W,width:G.width,height:G.height}),K.map(Q0),O0(Nj,{listening:!1,children:[f(MO,{ref:P,strokeWidth:2.6/Z,lineCap:"round",lineJoin:"round",visible:!1}),f(DO,{ref:I,strokeWidth:2.6/Z,visible:!1}),f(BO,{ref:b,points:[],strokeWidth:2.6/Z,pointerLength:10/Z,pointerWidth:10/Z,visible:!1})]})]})})})},P8=Tk;var Wk=C1.default.forwardRef(({file:h,onPlay:_,onPause:G,onTimeUpdate:Y,annotations:X,startTime:K,shareId:Z,children:Q},D)=>{let O=C1.useRef(null),A=O,H=!!h.media?.original?.downloadUrl&&!!h.media?.metadata,C=C1.useRef(null),N=C1.useRef(null),j=C1.useRef(null),W=C1.useRef(null);C1.useImperativeHandle(D,()=>({play:()=>{if(O.current)O.current.play()},pause:()=>{if(O.current)O.current.pause()},seekTo:(W0)=>{if(O.current)O.current.currentTime(W0)},getCurrentTime:()=>{return(O.current?O.current.currentTime():0)??0},getDuration:()=>{return(O.current?O.current.duration():0)??0}}));let S=C1.useRef(!1),[R,v]=C1.useState(void 0),x=C1.useRef(null),[P,I]=C1.useState(1),[b,l]=C1.useState(!1),[i,h0]=C1.useState({width:0,height:0}),q0=(W0)=>{I(W0),l(!0)},Q0=()=>{l(!1)},{isDrawing:o,currentTool:r,currentColor:d,addAnnotation:s,annotations:_0}=u4(),Z0=[...X||[],..._0];C1.useEffect(()=>{if(!N.current)return;let W0=new ResizeObserver((v0)=>{let X1=v0[0];if(X1)h0({width:X1.contentRect.width,height:X1.contentRect.height})});return W0.observe(N.current),()=>W0.disconnect()},[]),C1.useEffect(()=>{if(i.width>0&&i.height>0){let W0=h.media?.metadata?.originalWidth||1920,v0=h.media?.metadata?.originalHeight||1080,X1=Math.min(i.width/W0,i.height/v0);if(!b)I(X1)}},[i.width,i.height,h.media?.metadata,b]),C1.useEffect(()=>{return()=>{x.current=null}},[]);let X0={id:"original",url:h.media?.original?.downloadUrl||"",key:h.media?.original?.key??"",width:h.media?.metadata?.originalWidth??0,height:h.media?.metadata?.originalHeight??0,size:0,isRaw:!0,resolution:"Original"},E0=(h.media?.videoTranscodes??[]).map((W0)=>{let v0=Math.max(W0.width,W0.height),X1=`${W0.height}p`;if(v0>=3840)X1="2160p";else if(v0>=1920)X1="1080p";else if(v0>=1280)X1="720p";else if(v0>=960)X1="540p";else if(v0>=640)X1="360p";else if(v0>=320)X1="180p";return{...W0,resolution:W0.isRaw?"Original":X1}}),m=E0.filter((W0)=>!W0.isRaw),x0=(()=>{if(m.length===0)return X0;if(typeof window>"u")return m[0];let W0=window.innerWidth*(window.devicePixelRatio||1),v0=[...m].sort((N1,S2)=>{let h3=N1.width??0,e7=S2.width??0;return h3-e7});return v0.find((N1)=>(N1.width??0)>=W0)||v0[v0.length-1]})(),[k,y0]=C1.useState({isPlaying:!1,progress:0,currentTime:0,duration:h.media?.metadata?.duration||0,volume:1,isMuted:!1,isLooping:!1,playbackRate:1,isFullScreen:!1,showFrames:!1,currentResolution:x0?.resolution||"Original",currentSrc:x0?.url||""}),[a0,n0]=C1.useState(0),[w0,g0]=C1.useState(!0),[Q1,Y1]=C1.useState(!1),D1=C1.useRef(null),b1=h.media?.metadata,_1=b1?.frameRate||30,l1=b1?.totalFrames||0,n1=b1?.duration||0,y2=h.mediaType?.startsWith("audio/"),O2=tJ({dbTotalFrames:l1,containerDuration:n1,frameRate:_1}),{currentFrame:h2,seekToFrame:Z2}=CJ(x,_1,O2,y2),Z1=h2/_1,W2=O2/_1,v1=W2>0?Z1/W2*100:0,B5={...k,currentTime:Z1,duration:W2,progress:v1};C1.useEffect(()=>{if(Y)Y(h2/_1)},[h2,_1,Y]),C1.useEffect(()=>{if(!C.current)return;let W0=document.createElement("video-js");W0.classList.add("vjs-big-play-centered","!h-full","!w-full"),W0.style.opacity="0",W0.style.pointerEvents="none",C.current.appendChild(W0);let v0=A.current=Y0(W0,{controls:!1,autoplay:!1,preload:"auto",playsinline:!0,sources:[{src:k.currentSrc,type:"video/mp4"}]}),X1=W0.querySelector("video");if(X1)v(X1),x.current=X1;else v0.ready(()=>{let N1=v0.tech({iWillNotUseThisInPlugins:!0})?.el();if(N1)v(N1),x.current=N1});return v0.on("play",()=>{y0((N1)=>({...N1,isPlaying:!0})),_?.()}),v0.on("pause",()=>{y0((N1)=>({...N1,isPlaying:!1})),G?.()}),v0.on("ended",()=>y0((N1)=>({...N1,isPlaying:!1}))),v0.on("loadedmetadata",()=>{Y1(!0)}),v0.on("loadstart",()=>{Y1(!1)}),v0.on("timeupdate",()=>{let N1=v0.duration()||h.media?.metadata?.duration||0,S2=v0.bufferedEnd();if(N1>0)n0(S2/N1*100)}),v0.on("volumechange",()=>{let N1=v0.volume(),S2=v0.muted();y0((h3)=>({...h3,volume:N1||0,isMuted:S2||!1}))}),v0.on("ratechange",()=>{y0((N1)=>({...N1,playbackRate:v0.playbackRate()||1}))}),v0.on("error",()=>{console.error("VideoJS Error:",v0.error())}),v0.volume(k.volume),()=>{if(v0&&!v0.isDisposed())v0.dispose(),A.current=null,x.current=null}},[h]),C1.useEffect(()=>{if(!Q1)return;if(K!==void 0&&K!==null&&K>0){if(K!==D1.current){D1.current=K;let W0=Math.floor(K*_1+0.45);Z2(W0)}}},[K,_1,Z2,Q1]);let d2=C1.useCallback(()=>{if(W.current)clearTimeout(W.current);if(k.isFullScreen&&!S.current)W.current=setTimeout(()=>{g0(!1)},1200)},[k.isFullScreen]),a2=C1.useCallback(()=>{g0(!0),d2()},[d2]),M0=C1.useCallback(()=>{if(S.current=!0,W.current)clearTimeout(W.current);g0(!0)},[]),j0=C1.useCallback(()=>{S.current=!1,d2()},[d2]),u0=C1.useCallback(()=>{if(k.isFullScreen){if(W.current)clearTimeout(W.current);g0(!1)}},[k.isFullScreen]);C1.useEffect(()=>{return()=>{if(W.current)clearTimeout(W.current)}},[]),C1.useEffect(()=>{if(!k.isFullScreen){if(g0(!0),W.current)clearTimeout(W.current)}else a2()},[k.isPlaying,k.isFullScreen,a2]);let s0=C1.useCallback(()=>{if(u4.getState().isDrawing)return;let W0=A.current;if(!W0)return;if(W0.paused()||W0.ended()){let v0=W0.play();if(v0!==void 0)v0.catch((X1)=>{if(X1.name==="AbortError")return;console.error("Play failed:",X1)})}else W0.pause()},[]),A0=()=>{let W0=A.current;if(!W0)return;let v0=!k.isLooping;W0.loop(v0),y0((X1)=>({...X1,isLooping:v0}))},t0=(W0)=>{y0((X1)=>({...X1,volume:W0,isMuted:W0===0}));let v0=A.current;if(!v0)return;if(v0.volume(W0),W0>0&&v0.muted())v0.muted(!1);else if(W0===0&&!v0.muted())v0.muted(!0)},I0=()=>{let W0=A.current;if(!W0)return;if(W0.muted()){if(W0.muted(!1),W0.volume()===0)W0.volume(0.5)}else W0.muted(!0)},V1=(W0)=>{let v0=A.current;if(!v0)return;v0.playbackRate(W0)},x1=(W0)=>{let v0=A.current;if(!v0)return;let X1=!v0.paused(),N1=v0.currentTime();y0((S2)=>({...S2,currentResolution:W0.resolution,currentSrc:W0.url})),v0.src({type:"video/mp4",src:W0.url}),v0.one("loadedmetadata",()=>{if(v0.currentTime(N1),X1){let S2=v0.play();if(S2!==void 0)S2.catch((h3)=>{if(h3.name==="AbortError")return;console.error("Play after seek failed:",h3)})}v0.playbackRate(k.playbackRate)})},m1=()=>{if(!j.current)return;if(!document.fullscreenElement)j.current.requestFullscreen(),y0((W0)=>({...W0,isFullScreen:!0}));else document.exitFullscreen(),y0((W0)=>({...W0,isFullScreen:!1}))},w1=async(W0)=>{try{let v0=Z?await y1.api.shares[":shareId"].files[":fileId"]["download-url"].$post({param:{shareId:Z,fileId:h.id},json:{key:W0}}):await y1.api.files["download-url"].$post({json:{key:W0,assetId:h.id}});if(!v0.ok)return;let{url:X1}=await v0.json(),N1=document.createElement("a");N1.href=X1,N1.download="",document.body.appendChild(N1),N1.click(),document.body.removeChild(N1)}catch{}};C1.useEffect(()=>{let W0=()=>{y0((v0)=>({...v0,isFullScreen:!!document.fullscreenElement}))};return document.addEventListener("fullscreenchange",W0),()=>document.removeEventListener("fullscreenchange",W0)},[]);let J2=h.media?.metadata?.originalWidth||1920,R2=h.media?.metadata?.originalHeight||1080,e4=P,f0=(i.width-J2*e4)/2,l0=(i.height-R2*e4)/2;if(!H)return f("div",{className:"flex h-full w-full items-center justify-center",children:f("p",{className:"text-muted-foreground",children:"Media is not available."})});return O0("div",{ref:j,className:D5("group shadow-2xl font-sans select-none flex flex-col mx-auto transition-all duration-300 relative",k.isFullScreen?"h-full w-full rounded-none bg-black":"w-full h-full",!w0&&k.isFullScreen?"cursor-none":""),onMouseMove:a2,onMouseLeave:u0,children:[O0("div",{className:"flex-1 flex flex-col-reverse md:flex-row min-h-0 relative",children:[!k.isFullScreen&&Q,O0("div",{ref:N,className:D5("flex-1 bg-black cursor-pointer relative flex items-center justify-center overflow-hidden min-h-0"),onClick:s0,"data-vjs-player":!0,"data-testid":"video-area",children:[f("div",{ref:C,className:"absolute inset-0 z-[-1]"}),h.mediaType?.startsWith("audio/")?f("div",{className:"flex flex-col items-center justify-center text-muted-foreground w-full h-full pointer-events-none select-none",children:f(aJ,{className:D5("w-16 h-16 text-foreground/75 transition-transform duration-500",k.isPlaying?"animate-pulse scale-110 text-primary":"")})}):R&&i.width>0&&f(P8,{width:i.width,height:i.height,mediaDimensions:{width:J2,height:R2},videoElement:R,annotations:Z0,scale:e4,offset:{x:f0,y:l0},className:"absolute inset-0",onClick:s0,isDrawing:o,currentTool:r,currentColor:d,onAddAnnotation:s}),!k.isPlaying&&!o&&f("div",{className:"absolute inset-0 flex items-center justify-center bg-black/20 pointer-events-none z-10",children:f("div",{className:"w-20 h-20 bg-white/10 backdrop-blur-sm rounded-full flex items-center justify-center border-2 border-white/30 animate-pulse",children:f(oh,{className:"w-10 h-10 text-white ml-1 fill-white"})})})]})]}),f(x$,{state:B5,zoom:P,isControlsVisible:w0,buffered:a0,data:h,resolutions:E0,togglePlay:s0,toggleLoop:A0,toggleMute:I0,handleVolumeChange:t0,changePlaybackRate:V1,changeResolution:x1,handleDownload:w1,toggleFullScreen:m1,onZoomChange:q0,onZoomReset:Q0,frameRate:_1,totalFrames:O2,currentFrame:h2,seekToFrame:Z2,onMouseEnter:M0,onMouseLeave:j0})]})}),Wj=Wk;var H1=S1(l2(),1);function Rk(h){let _=h.media?.original?.downloadUrl?{id:"original",url:h.media.original.downloadUrl,key:h.media.original.key??"",width:h.media?.metadata?.originalWidth??0,height:h.media?.metadata?.originalHeight??0,size:0,isRaw:!0,resolution:"Original"}:null,G=(h.media?.videoTranscodes??[]).map((X)=>{let K=Math.max(X.width,X.height),Z=`${X.height}p`;if(K>=3840)Z="2160p";else if(K>=1920)Z="1080p";else if(K>=1280)Z="720p";else if(K>=960)Z="540p";else if(K>=640)Z="360p";else if(K>=320)Z="180p";return{...X,resolution:X.isRaw?"Original":Z}});if(!G.some((X)=>X.isRaw)&&_)return[...G,_];return G}var Rj=H1.forwardRef(function({file:_,shareId:G,isActive:Y,muted:X=!0,volume:K=1,annotations:Z,onStateChange:Q,onActivate:D,onRequestTogglePlay:O,onTimeUpdate:A,onPlay:H},C){let N=H1.useRef(null),j=H1.useRef(null),W=H1.useRef(null),S=H1.useRef(null),[R,v]=H1.useState(void 0),{isDrawing:x,currentTool:P,currentColor:I,addAnnotation:b,annotations:l}=u4(),[i,h0]=H1.useState({width:0,height:0}),[q0,Q0]=H1.useState(1),[o,r]=H1.useState(!1),[d,s]=H1.useState(null),[_0,Z0]=H1.useState(!1),[X0,E0]=H1.useState(!1),[m,N0]=H1.useState(1),[x0,k]=H1.useState(0),[y0,a0]=H1.useState(K),[n0,w0]=H1.useState(X),[g0,Q1]=H1.useState(!1),Y1=_.media?.metadata,D1=Y1?.frameRate||30,b1=Y1?.totalFrames||0,_1=Y1?.duration||0,l1=tJ({dbTotalFrames:b1,containerDuration:_1,frameRate:D1}),n1=Rk(_),O2=n1.filter((f0)=>!f0.isRaw)[0]??n1[0],[h2,Z2]=H1.useState(O2?.resolution??"Original"),Z1=H1.useRef(O2?.url),W2=_.mediaType?.startsWith("audio/"),{currentFrame:v1,seekToFrame:B5}=CJ(S,D1,l1,W2),d2=H1.useRef(q0);d2.current=q0;let a2=H1.useRef(v1);a2.current=v1,H1.useEffect(()=>{if(!W.current)return;let f0=new ResizeObserver((l0)=>{let W0=l0[0];if(W0)h0({width:W0.contentRect.width,height:W0.contentRect.height})});return f0.observe(W.current),()=>f0.disconnect()},[]);let M0=Y1?.originalWidth||1920,j0=Y1?.originalHeight||1080;H1.useEffect(()=>{if(i.width>0&&i.height>0&&!o){let f0=Math.min(i.width/M0,i.height/j0);Q0(f0)}},[i.width,i.height,M0,j0,o]),H1.useEffect(()=>{Z2(O2?.resolution??"Original"),Z1.current=O2?.url},[_.id]),H1.useEffect(()=>{if(!j.current)return;let f0=document.createElement("video-js");f0.classList.add("vjs-big-play-centered","!h-full","!w-full"),f0.style.opacity="0",f0.style.pointerEvents="none",j.current.appendChild(f0);let l0=N.current=Y0(f0,{controls:!1,autoplay:!1,preload:"auto",playsinline:!0,sources:[{src:Z1.current??"",type:"video/mp4"}]}),W0=f0.querySelector("video");if(W0)v(W0),S.current=W0;else l0.ready(()=>{let v0=l0.tech({iWillNotUseThisInPlugins:!0})?.el();if(v0)v(v0),S.current=v0});return l0.on("play",()=>{Z0(!0),H?.()}),l0.on("pause",()=>Z0(!1)),l0.on("ended",()=>Z0(!1)),l0.on("loadedmetadata",()=>Q1(!0)),l0.on("loadstart",()=>Q1(!1)),l0.on("timeupdate",()=>{let v0=l0.duration()||_1||0,X1=l0.bufferedEnd();if(v0>0)k(X1/v0*100)}),l0.on("volumechange",()=>{a0(l0.volume()||0),w0(l0.muted()||!1)}),l0.on("ratechange",()=>N0(l0.playbackRate()||1)),()=>{if(l0&&!l0.isDisposed())l0.dispose(),N.current=null,S.current=null}},[_.id]),H1.useEffect(()=>{let f0=N.current;if(!f0||!g0)return;f0.muted(X),f0.volume(K)},[X,K,g0]),H1.useEffect(()=>{Q({kind:"video",zoom:q0,video:{frameRate:D1,totalFrames:l1,currentFrame:v1,isPlaying:_0,volume:y0,isMuted:n0,playbackRate:m,isLooping:X0,currentResolution:h2,resolutions:n1,buffered:x0}})},[q0,D1,l1,v1,_0,y0,n0,m,X0,h2,x0]),H1.useEffect(()=>{if(Y)A?.(v1/D1)},[v1,D1,Y,A]);let u0=H1.useCallback((f0)=>{let W0=d2.current*f0;if(W0<0.01||W0>50)return;Q0(W0),r(!0)},[]),s0=H1.useCallback(()=>{r(!1),s(null)},[]),A0=H1.useCallback((f0)=>hA(f0,l1),[l1]),t0=H1.useCallback(async(f0)=>{let l0=f0??_.media?.original?.key;if(!l0||!_.id)return;try{let W0=G?await y1.api.shares[":shareId"].files[":fileId"]["download-url"].$post({param:{shareId:G,fileId:_.id},json:{key:l0}}):await y1.api.files["download-url"].$post({json:{key:l0,assetId:_.id}});if(!W0.ok)return;let{url:v0}=await W0.json(),X1=document.createElement("a");X1.href=v0,X1.download="",document.body.appendChild(X1),X1.click(),document.body.removeChild(X1)}catch{}},[_.id,_.media?.original?.key,G]),I0=H1.useCallback((f0)=>{let l0=N.current;if(!l0)return;let W0=n1.find((N1)=>N1.resolution===f0);if(!W0)return;let v0=!l0.paused(),X1=l0.currentTime();Z2(f0),Z1.current=W0.url,l0.src({type:"video/mp4",src:W0.url}),l0.one("loadedmetadata",()=>{if(l0.currentTime(X1),v0){let N1=l0.play();if(N1!==void 0)N1.catch(()=>{})}})},[n1]);H1.useImperativeHandle(C,()=>({getKind:()=>"video",play:()=>{let f0=N.current?.play();if(f0!==void 0)f0.catch(()=>{})},pause:()=>N.current?.pause(),togglePlay:()=>{let f0=N.current;if(!f0)return;if(f0.paused()||f0.ended()){let l0=f0.play();if(l0!==void 0)l0.catch(()=>{})}else f0.pause()},seekToFrame:(f0)=>B5(A0(f0)),seekToSecond:(f0)=>{let l0=Math.floor(f0*D1+0.45);B5(A0(l0))},stepFrame:(f0)=>B5(A0(a2.current+f0)),setMuted:(f0)=>N.current?.muted(f0),setVolume:(f0)=>{let l0=N.current;if(!l0)return;if(l0.volume(f0),f0>0&&l0.muted())l0.muted(!1);else if(f0===0&&!l0.muted())l0.muted(!0)},setPlaybackRate:(f0)=>N.current?.playbackRate(f0),toggleLoop:()=>{let f0=N.current;if(!f0)return;let l0=!f0.loop();f0.loop(l0),E0(l0)},changeResolution:I0,zoomBy:u0,fit:s0,panBy:(f0,l0)=>s((W0)=>{let v0=d2.current,X1=W0??{x:(i.width-M0*v0)/2,y:(i.height-j0*v0)/2};return{x:X1.x+f0,y:X1.y+l0}}),download:(f0)=>t0(f0)}),[B5,A0,D1,u0,s0,I0,t0,i.width,i.height,M0,j0]);let V1=[...Z,...Y?l:[]],x1=q0,m1=(i.width-M0*x1)/2,w1=(i.height-j0*x1)/2,J2=d?.x??m1,R2=d?.y??w1,e4=H1.useCallback(()=>{if(u4.getState().isDrawing)return;if(!Y){D?.();return}O?.()},[Y,D,O]);if(!_.media?.original?.downloadUrl||!Y1)return f("div",{className:"flex h-full w-full items-center justify-center bg-black",children:f("p",{className:"text-muted-foreground",children:"Media is not available."})});return O0("div",{ref:W,className:D5("relative flex flex-1 cursor-pointer items-center justify-center overflow-hidden bg-black"),onClick:e4,"data-testid":"compare-video-area",children:[f("div",{ref:j,className:"absolute inset-0 z-[-1]"}),_.mediaType?.startsWith("audio/")?f("div",{className:"flex flex-col items-center justify-center text-muted-foreground w-full h-full pointer-events-none select-none",children:f(aJ,{className:D5("w-16 h-16 text-foreground/75 transition-transform duration-500",_0?"animate-pulse scale-110 text-primary":"")})}):R&&i.width>0&&f(P8,{width:i.width,height:i.height,mediaDimensions:{width:M0,height:j0},videoElement:R,annotations:V1,scale:x1,offset:{x:J2,y:R2},className:"absolute inset-0",onClick:e4,isDrawing:Y&&x,currentTool:P,currentColor:I,onAddAnnotation:Y?b:void 0}),!_0&&!x&&f("div",{className:"pointer-events-none absolute inset-0 z-10 flex items-center justify-center bg-black/20",children:f("div",{className:"flex h-16 w-16 items-center justify-center rounded-full border-2 border-white/30 bg-white/10 backdrop-blur-sm",children:f(oh,{className:"ml-1 h-8 w-8 fill-white text-white"})})})]})});var Sj={id:"video",name:"Video",match:(h)=>!!h.mediaType?.startsWith("video/")||!!h.mediaType?.startsWith("audio/"),viewer:Wj,comparePane:Rj,commentsConfig:{hasTimestamp:!0,hasAnnotations:!0,hasAiBots:!0}};var sJ=S1(l2(),1);function nJ(){let[h,_]=sJ.useState({width:window.innerWidth,height:window.innerHeight});return sJ.useLayoutEffect(()=>{function G(){_({width:window.innerWidth,height:window.innerHeight})}return window.addEventListener("resize",G),()=>window.removeEventListener("resize",G)},[]),h}function oJ(h,_){if(!h||h.length===0)return null;let G=h.filter((Z)=>!Z.isRaw),X=[...G.length>0?G:h].sort((Z,Q)=>{let D=Z.width??0,O=Q.width??0;if(D!==O)return O-D;return(Z.isRaw?1:0)-(Q.isRaw?1:0)}),K=X.filter((Z)=>(Z.width??0)>=_);if(K.length>0)return K.sort((Z,Q)=>{let D=Z.width??0,O=Q.width??0;if(D!==O)return D-O;return(Z.isRaw?1:0)-(Q.isRaw?1:0)}),K[0];return X[0]}var a5=S1(l2(),1);function xj({zoom:h,onZoomIn:_,onZoomOut:G,onFit:Y,onDownload:X,canDownload:K,onCopy:Z,copied:Q=!1,canCopy:D=!0,fullscreen:O}){return O0("div",{className:"relative px-4 py-3 bg-card border-t border-gray-200 dark:border-gray-700 z-10 flex items-center justify-end gap-2 transition-colors duration-200",children:[O0("div",{className:"flex items-center gap-1 bg-gray-200/50 dark:bg-white/10 rounded-md p-0.5 mr-auto",children:[f("button",{onClick:G,className:"p-1.5 rounded hover:bg-gray-300 dark:hover:bg-gray-600 text-gray-700 dark:text-gray-200 transition-colors",title:c0.zoom_out(),children:f(Jh,{size:16})}),O0("span",{className:"w-12 text-center text-xs font-mono font-medium text-gray-900 dark:text-gray-100 select-none",children:[Math.round(h*100),"%"]}),f("button",{onClick:_,className:"p-1.5 rounded hover:bg-gray-300 dark:hover:bg-gray-600 text-gray-700 dark:text-gray-200 transition-colors",title:c0.zoom_in(),children:f(jJ,{size:16})})]}),f("button",{onClick:Y,className:"text-xs font-medium px-3 py-1.5 rounded bg-gray-200/50 dark:bg-white/10 hover:bg-gray-300 dark:hover:bg-gray-600 text-gray-700 dark:text-gray-200 transition-colors border border-transparent animate-in fade-in zoom-in-95 duration-200",children:c0.fit()}),Z&&O0("button",{onClick:Z,disabled:!D,className:"flex items-center gap-1.5 text-xs font-medium px-3 py-1.5 rounded bg-gray-200/50 dark:bg-white/10 hover:bg-gray-300 dark:hover:bg-gray-600 text-gray-700 dark:text-gray-200 transition-colors border border-transparent disabled:opacity-50 animate-in fade-in zoom-in-95 duration-200",title:c0.copy_image_to_clipboard(),children:[Q?f(nh,{size:14,className:"text-green-500"}):f(vj,{size:14}),Q?c0.copied():c0.copy()]}),O0("button",{onClick:X,disabled:!K,className:"flex items-center gap-1.5 text-xs font-medium px-3 py-1.5 rounded bg-gray-200/50 dark:bg-white/10 hover:bg-gray-300 dark:hover:bg-gray-600 text-gray-700 dark:text-gray-200 transition-colors border border-transparent disabled:opacity-50 animate-in fade-in zoom-in-95 duration-200",title:c0.download_original_image(),children:[f(A6,{size:14}),c0.download()]}),O&&f("button",{onClick:O.onToggle,className:"p-1.5 rounded hover:bg-gray-300 dark:hover:bg-gray-600 text-gray-700 dark:text-gray-200 transition-colors",title:c0.fullscreen(),children:O.isFullScreen?f(LJ,{size:16}):f($J,{size:16})})]})}var Sk=a5.default.forwardRef(({file:h,annotations:_,shareId:G,children:Y},X)=>{a5.useImperativeHandle(X,()=>({play:()=>{},pause:()=>{},seekTo:()=>{}}));let{width:K}=nJ(),{isDrawing:Z,currentTool:Q,currentColor:D,addAnnotation:O,annotations:A}=u4(),[H,C]=a5.useState({width:0,height:0}),[N,j]=a5.useState(1),[W,S]=a5.useState({x:0,y:0}),[R,v]=a5.useState(!1),x=a5.useRef(null),P=a5.useCallback((Z0)=>{if(x.current)x.current.disconnect(),x.current=null;if(Z0!==null){let X0=new ResizeObserver((E0)=>{let m=E0[0];if(m)C({width:m.contentRect.width,height:m.contentRect.height})});X0.observe(Z0),x.current=X0}},[]),I=h.media?.metadata?.originalWidth??1920,b=h.media?.metadata?.originalHeight??1080,l=H.width,i=H.height,h0=1;if(l>0&&i>0)h0=Math.min(l/I,i/b);a5.useEffect(()=>{if(l>0&&i>0){j(h0);let Z0=(l-I*h0)/2,X0=(i-b*h0)/2;S({x:Z0,y:X0})}},[h.id,l,i,h0,I,b]);let q0=(Z0)=>{let X0=l/2,E0=i/2,m=N*Z0;if(m<0.01||m>50)return;let N0=X0-(X0-W.x)*(m/N),x0=E0-(E0-W.y)*(m/N);j(m),S({x:N0,y:x0})},Q0=()=>{j(h0);let Z0=(l-I*h0)/2,X0=(i-b*h0)/2;S({x:Z0,y:X0})},o=h.media?.original?.downloadUrl,r=oJ(h.media?.imageTranscodes,K);if(r?.url)o=r.url;let d=async()=>{let Z0=h.media?.original?.key;if(!Z0||!h.id)return;try{let X0=G?await y1.api.shares[":shareId"].files[":fileId"]["download-url"].$post({param:{shareId:G,fileId:h.id},json:{key:Z0}}):await y1.api.files["download-url"].$post({json:{key:Z0,assetId:h.id}});if(!X0.ok)return;let{url:E0}=await X0.json(),m=document.createElement("a");m.href=E0,m.download="",document.body.appendChild(m),m.click(),document.body.removeChild(m)}catch{}},s=async()=>{let Z0=o;if(!Z0)return;try{let X0=(async()=>{let m=await(await fetch(Z0)).blob(),N0=new Image;N0.crossOrigin="anonymous";let x0=URL.createObjectURL(m);N0.src=x0;try{await new Promise((n0,w0)=>{N0.onload=n0,N0.onerror=(g0)=>w0(Error("Failed to load image: "+String(g0)))});let k=document.createElement("canvas");k.width=N0.width,k.height=N0.height;let y0=k.getContext("2d");if(!y0)throw Error("Could not get canvas context");y0.drawImage(N0,0,0);let a0=await new Promise((n0)=>{k.toBlob(n0,"image/png")});if(!a0)throw Error("Failed to convert image to PNG");return a0}finally{URL.revokeObjectURL(x0)}})();await navigator.clipboard.write([new ClipboardItem({"image/png":X0})]),v(!0),setTimeout(()=>v(!1),2000)}catch(X0){console.error("Failed to copy image to clipboard:",X0)}},_0=[..._||[],...A];return O0("div",{className:"flex flex-col flex-1 h-full overflow-hidden bg-gray-100 dark:bg-gray-950 relative",children:[O0("div",{className:"flex-1 flex flex-col-reverse md:flex-row min-h-0 relative",children:[Y,f("div",{ref:P,className:"flex-1 relative overflow-hidden",children:f(P8,{width:l,height:i,mediaDimensions:{width:I,height:b},imageUrl:o,annotations:_0,scale:N,offset:W,onPan:S,className:"absolute inset-0 z-0",isDrawing:Z,currentTool:Q,currentColor:D,onAddAnnotation:O})})]}),f(xj,{zoom:N,onZoomIn:()=>q0(1.2),onZoomOut:()=>q0(0.8),onFit:Q0,onDownload:d,canDownload:!!h.media?.original?.key,onCopy:s,copied:R,canCopy:!!o})]})}),wj=Sk;var P2=S1(l2(),1);var vk=0.01,xk=50,gj=P2.forwardRef(function({file:_,shareId:G,isActive:Y,annotations:X,onStateChange:K,onUserPan:Z,onActivate:Q},D){let{width:O}=nJ(),{isDrawing:A,currentTool:H,currentColor:C,addAnnotation:N,annotations:j}=u4(),[W,S]=P2.useState({width:0,height:0}),[R,v]=P2.useState(1),[x,P]=P2.useState({x:0,y:0}),I=P2.useRef(null),b=P2.useRef(R);b.current=R;let l=P2.useRef(x);l.current=x;let i=P2.useCallback((N0)=>{if(I.current)I.current.disconnect(),I.current=null;if(N0!==null){let x0=new ResizeObserver((k)=>{let y0=k[0];if(y0)S({width:y0.contentRect.width,height:y0.contentRect.height})});x0.observe(N0),I.current=x0}},[]),h0=_.media?.metadata?.originalWidth??1920,q0=_.media?.metadata?.originalHeight??1080,Q0=W.width,o=W.height,r=1;if(Q0>0&&o>0)r=Math.min(Q0/h0,o/q0);P2.useEffect(()=>{if(Q0>0&&o>0)v(r),P({x:(Q0-h0*r)/2,y:(o-q0*r)/2})},[_.id,Q0,o,r,h0,q0]);let d=P2.useCallback((N0)=>{let x0=Q0/2,k=o/2,y0=b.current,a0=y0*N0;if(a0<vk||a0>xk)return;let n0=l.current;P({x:x0-(x0-n0.x)*(a0/y0),y:k-(k-n0.y)*(a0/y0)}),v(a0)},[Q0,o]),s=P2.useCallback(()=>{v(r),P({x:(Q0-h0*r)/2,y:(o-q0*r)/2})},[r,Q0,o,h0,q0]),_0=_.media?.original?.downloadUrl,Z0=oJ(_.media?.imageTranscodes,O);if(Z0?.url)_0=Z0.url;let X0=P2.useCallback(async()=>{let N0=_.media?.original?.key;if(!N0||!_.id)return;try{let x0=G?await y1.api.shares[":shareId"].files[":fileId"]["download-url"].$post({param:{shareId:G,fileId:_.id},json:{key:N0}}):await y1.api.files["download-url"].$post({json:{key:N0,assetId:_.id}});if(!x0.ok)return;let{url:k}=await x0.json(),y0=document.createElement("a");y0.href=k,y0.download="",document.body.appendChild(y0),y0.click(),document.body.removeChild(y0)}catch{}},[_.id,_.media?.original?.key,G]);P2.useImperativeHandle(D,()=>({getKind:()=>"image",play:()=>{},pause:()=>{},togglePlay:()=>{},seekToFrame:()=>{},seekToSecond:()=>{},stepFrame:()=>{},setMuted:()=>{},setVolume:()=>{},setPlaybackRate:()=>{},toggleLoop:()=>{},changeResolution:()=>{},zoomBy:(N0)=>d(N0),fit:s,panBy:(N0,x0)=>P((k)=>({x:k.x+N0,y:k.y+x0})),download:X0}),[d,s,X0]),P2.useEffect(()=>{K({kind:"image",zoom:R})},[R,K]);let E0=[...X,...Y?j:[]],m=P2.useCallback((N0)=>{let x0=l.current,k=N0.x-x0.x,y0=N0.y-x0.y;if(P(N0),k!==0||y0!==0)Z?.(k,y0)},[Z]);if(!_0)return f("div",{className:"flex flex-1 items-center justify-center bg-gray-100 dark:bg-gray-950",children:f("p",{className:"text-muted-foreground",children:"Preview unavailable"})});return f("div",{ref:i,className:"relative flex-1 overflow-hidden bg-gray-100 dark:bg-gray-950",onMouseDown:Q,children:f(P8,{width:Q0,height:o,mediaDimensions:{width:h0,height:q0},imageUrl:_0,annotations:E0,scale:R,offset:x,onPan:m,className:"absolute inset-0 z-0",isDrawing:Y&&A,currentTool:H,currentColor:C,onAddAnnotation:Y?N:void 0})})});var Ij={id:"image",name:"Image",match:(h)=>!!h.mediaType?.startsWith("image/"),viewer:wj,comparePane:gj,commentsConfig:{hasTimestamp:!1,hasAnnotations:!0,hasAiBots:!0}};var rJ=S1(l2(),1);var wk=rJ.default.forwardRef(({file:h,shareId:_,children:G},Y)=>{return rJ.useImperativeHandle(Y,()=>({play:()=>{},pause:()=>{},seekTo:()=>{}})),O0("div",{className:"flex flex-col flex-1 h-full overflow-hidden bg-gray-100 dark:bg-gray-950 relative",children:[O0("div",{className:"flex-1 flex flex-col-reverse md:flex-row min-h-0 relative",children:[G,f("div",{className:"flex-1 flex items-center justify-center",children:f("p",{className:"text-muted-foreground",children:"Preview unavailable"})})]}),f("div",{className:"relative px-4 py-3 bg-card border-t border-gray-200 dark:border-gray-700 z-10 flex items-center justify-end gap-2 transition-colors duration-200",children:O0("button",{onClick:async()=>{let K=h.media?.original?.key;if(!K||!h.id)return;try{let Z=_?await y1.api.shares[":shareId"].files[":fileId"]["download-url"].$post({param:{shareId:_,fileId:h.id},json:{key:K}}):await y1.api.files["download-url"].$post({json:{key:K,assetId:h.id}});if(!Z.ok)return;let{url:Q}=await Z.json(),D=document.createElement("a");D.href=Q,D.download="",document.body.appendChild(D),D.click(),document.body.removeChild(D)}catch{}},disabled:!h.media?.original?.key,className:"flex items-center gap-1.5 text-xs font-medium px-3 py-1.5 rounded bg-gray-200/50 dark:bg-white/10 hover:bg-gray-300 dark:hover:bg-gray-600 text-gray-700 dark:text-gray-200 transition-colors border border-transparent disabled:opacity-50 animate-in fade-in zoom-in-95 duration-200",title:"Download original file",children:[f(A6,{size:14}),"Download"]})})]})}),Pj=wk;var OO={id:"default",name:"Default",match:()=>!0,viewer:Pj,commentsConfig:{hasTimestamp:!1,hasAnnotations:!1,hasAiBots:!1}};var gk=[Sj,Ij];function yj(h){if(!h)return OO;return gk.find((G)=>G.match(h))||OO}function f40({teamId:h,projectId:_,file:G,onSaveField:Y,members:X,onCommentSelect:K,hideAnnotationControl:Z=!1,readOnly:Q=!1,publicFields:D,isPublic:O=!1,shareId:A,currentTime:H,onTyping:C,selectedCommentId:N}){let{canEdit:j}=uj(_),{fields:W,setFields:S}=pj(),R=uK(),{ref:v,inView:x}=kj(),[P,I]=r4.useState(null),[b,l]=r4.useState(null),[i,h0]=r4.useState(!1),[q0,Q0]=r4.useState(null),{data:o}=Gh({queryKey:["fields",_],queryFn:async()=>{let w0=await y1.api.projects[":projectId"].fields.$get({param:{projectId:_}});if(!w0.ok)throw Error("Failed to fetch fields");return await w0.json()},enabled:!!_&&!D}),{data:r}=Gh({queryKey:["projects",_,"bots"],queryFn:async()=>{let w0=await y1.api.projects[":projectId"].bots.$get({param:{projectId:_}});if(!w0.ok)throw Error("Failed to fetch bots");return await w0.json()},enabled:!!_&&!Q}),d=yj(G),_0=d?.commentsConfig?.hasAiBots?r||[]:[];r4.useEffect(()=>{if(D)S(D,_);else if(o)S(o,_)},[o,D,_,S]);let{data:Z0,fetchNextPage:X0,hasNextPage:E0}=bj({queryKey:O?["shares",A,"files",G?.id,"comments"]:["files",G?.id,"comments"],queryFn:async({pageParam:w0})=>{if(O){let g0=localStorage.getItem(`share_pwd_${A}`)||"",Q1=await y1.api.shares[":shareId"].files[":fileId"].comments.$get({param:{shareId:A,fileId:G.id},query:{after:w0}},{headers:{"x-share-password":g0}});if(!Q1.ok)throw Error("Failed to fetch comments");return await Q1.json()}else{let g0=await y1.api.files[":fileId"].comments.$get({param:{fileId:G.id},query:{after:w0}});if(!g0.ok)throw Error("Failed to fetch comments");return await g0.json()}},enabled:!!G?.id&&(!O||!!A),initialPageParam:"",refetchInterval:2000,getNextPageParam:(w0)=>w0.pageInfo?.cursor||void 0}),{mutate:m}=Yh({mutationFn:async({text:w0,attachmentIds:g0,annotations:Q1,replyToId:Y1,guestUserId:D1,second:b1})=>{if(O){let _1=localStorage.getItem(`share_pwd_${A}`)||"",l1=await y1.api.shares[":shareId"].files[":fileId"].comments.$post({param:{shareId:A,fileId:G.id},json:{message:w0,attachmentIds:g0,replyToId:Y1??void 0,annotations:Q1,second:b1??void 0}},{headers:{"x-share-password":_1,...D1?{"x-guest-user-id":D1}:{}}});if(!l1.ok)throw Error("Failed to create comment");return await l1.json()}else{let _1=await y1.api.files[":fileId"].comments.$post({param:{fileId:G.id},json:{message:w0,attachmentIds:g0,replyToId:Y1??void 0,annotations:Q1,second:b1??void 0}});if(!_1.ok)throw Error("Failed to create comment");return await _1.json()}},onSuccess:()=>{R.invalidateQueries({queryKey:O?["shares",A,"files",G?.id,"comments"]:["files",G?.id,"comments"]})}});r4.default.useEffect(()=>{if(x&&E0)X0()},[x,X0,E0]);let N0=r4.useMemo(()=>{return(G?.fieldValues||[]).reduce((w0,g0)=>{return w0[g0.fieldId]=g0,w0},{})},[G?.fieldValues]),x0=r4.useMemo(()=>{return[...W].sort((w0,g0)=>{let Q1=w0.config?.name?.toLowerCase()||"",Y1=g0.config?.name?.toLowerCase()||"";if(Q1<Y1)return-1;if(Q1>Y1)return 1;return 0})},[W]),k=Z0?.pages.flatMap((w0)=>w0.data??[])??[],y0=async(w0,g0,Q1,Y1,D1)=>{if(!G?.id)return;if(O){console.log("[handleSendMessage] checking auth status");let b1=await y1.api.me.$get(),{id:_1}=await b1.json();if(console.log("[handleSendMessage] loggedInUserId:",_1),!_1){let l1=localStorage.getItem("guest_user_id");if(console.log("[handleSendMessage] guestUserId from storage:",l1),!l1){console.log("[handleSendMessage] no guest ID, opening popup"),Q0({text:w0,attachmentIds:g0,annotations:Q1,replyToId:Y1,second:D1}),h0(!0);return}m({text:w0,attachmentIds:g0,annotations:Q1,replyToId:Y1,guestUserId:l1,second:D1})}else m({text:w0,attachmentIds:g0,annotations:Q1,replyToId:Y1,second:D1})}else m({text:w0,attachmentIds:g0,annotations:Q1,replyToId:Y1,second:D1});I(null)},a0=(w0)=>{if(console.log("[handleGuestSuccess] guestUserId:",w0),q0)m({...q0,guestUserId:w0}),Q0(null),I(null)},n0=(w0)=>{let g0=X.find((Q1)=>Q1.id===w0);if(g0)return g0;if(r){let Q1=r.find((Y1)=>Y1.id===w0);if(Q1)return{id:Q1.id,name:Q1.name,role:"bot"}}return{id:"unknown",name:"Unknown",role:"unknown"}};if(!G)return f("div",{className:"flex h-full items-center justify-center p-8 text-center bg-background",children:O0("div",{className:"space-y-2",children:[f("p",{className:"text-sm font-medium text-foreground",children:c0.no_item_selected()}),f("p",{className:"text-xs text-muted-foreground",children:c0.select_file_to_view_details()})]})});return O0("div",{className:"bg-background h-full flex flex-col overflow-hidden",children:[b&&b.mediaType?.startsWith("image/")&&O0("div",{className:"fixed inset-0 z-[100] bg-black/95 flex flex-col items-center justify-center p-4 animate-in fade-in duration-200",onClick:()=>l(null),children:[f("button",{className:"absolute top-4 right-4 text-white/70 hover:text-white bg-white/10 hover:bg-white/20 rounded-full p-2 transition-colors z-50",children:f(Zh,{className:"w-8 h-8"})}),f("div",{className:"w-full h-full flex items-center justify-center p-2",children:f("img",{src:b.url,alt:"Enlarged view",className:"max-w-full max-h-[85vh] object-contain rounded shadow-2xl cursor-zoom-out",onClick:()=>l(null)})})]}),O0(mj,{defaultValue:"comments",className:"p-1 flex-1 flex flex-col px-2 min-h-0",children:[O0(fj,{className:"w-full shrink-0",children:[f(AO,{value:"comments",className:"flex-1",children:c0.comments()}),f(AO,{value:"fields",className:"flex-1",children:c0.fields()})]}),O0(zO,{value:"comments",className:"flex-1 flex flex-col overflow-hidden min-h-0 mt-0",children:[f(HO,{className:"flex-1 min-h-0 [&>div>div]:block!",children:O0("div",{className:"space-y-4",children:[k.map((w0)=>O0("div",{children:[f(fQ,{teamId:h,message:w0,getUser:n0,onReply:I,onViewAttachment:l,hasReplies:!!w0.replies?.length,frameRate:d?.commentsConfig?.hasTimestamp?G?.media?.metadata?.frameRate||30:void 0,startTimecode:d?.commentsConfig?.hasTimestamp?G?.media?.metadata?.startTimecode:void 0,isSelected:N===w0.id,onSelect:()=>{K?.(w0)}}),w0.replies?.map((g0,Q1)=>f("div",{children:f(fQ,{teamId:h,isReply:!0,message:g0,getUser:n0,onReply:I,onViewAttachment:l,hasReplies:!1,isLastReply:Q1===(w0.replies?.length??0)-1,frameRate:d?.commentsConfig?.hasTimestamp?G?.media?.metadata?.frameRate||30:void 0,startTimecode:d?.commentsConfig?.hasTimestamp?G?.media?.metadata?.startTimecode:void 0,isSelected:N===g0.id,onSelect:()=>{K?.(g0)}})},g0.id))]},w0.id)),f("div",{ref:v})]})}),(!Q||O)&&f("div",{className:"mt-4 shrink-0",children:f(vH,{isOpen:i,onClose:()=>h0(!1),onSuccess:a0,children:f(uQ,{projectId:_,onSendMessage:y0,replyingTo:P,onCancelReply:()=>I(null),bots:_0,hideAnnotationControl:Z,disableMentions:O,currentTime:d?.commentsConfig?.hasTimestamp?H:void 0,frameRate:d?.commentsConfig?.hasTimestamp?G?.media?.metadata?.frameRate||30:void 0,startTimecode:d?.commentsConfig?.hasTimestamp?G?.media?.metadata?.startTimecode:void 0,onTyping:C})})})]}),f(zO,{value:"fields",className:"flex-1 flex flex-col overflow-hidden min-h-0 mt-4",children:f(HO,{className:"flex-1 px-4 min-h-0 [&>div>div]:block!",children:x0&&x0.length>0&&f("div",{className:"space-y-4 pb-4",children:x0.map((w0)=>O0("div",{className:"space-y-1",children:[f("label",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:w0.config?.name}),f("div",{className:"min-h-[28px]",children:f(lj,{config:w0.config,value:N0[w0.id]?.value,onSave:j?(g0)=>Y(w0.id,g0):void 0,readOnly:Q||w0.readOnly||!j})})]},w0.id))})})})]})]})}
|
|
266
|
-
export{_h as i,x$ as j,Ik as k,xj as l,yj as m,f40 as n};
|