From a70ab9ccdde98bbed16eb20e30d103b98d7529e5 Mon Sep 17 00:00:00 2001 From: sachin Date: Mon, 9 Sep 2024 23:36:30 +0530 Subject: [PATCH] Updates --- assets/index-C1YKXClg.js | 642 ++++++++++++++++++++++++++++++++++++++ assets/index-s4pI0_vQ.css | 1 + index.html | 22 ++ logo.png | Bin 0 -> 46329 bytes 4 files changed, 665 insertions(+) create mode 100644 assets/index-C1YKXClg.js create mode 100644 assets/index-s4pI0_vQ.css create mode 100644 index.html create mode 100644 logo.png diff --git a/assets/index-C1YKXClg.js b/assets/index-C1YKXClg.js new file mode 100644 index 0000000..04b2b03 --- /dev/null +++ b/assets/index-C1YKXClg.js @@ -0,0 +1,642 @@ +(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function t(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=t(i);fetch(i.href,s)}})();var So=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ua(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var dp={exports:{}},ca={},hp={exports:{}},re={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var ms=Symbol.for("react.element"),Cy=Symbol.for("react.portal"),Dy=Symbol.for("react.fragment"),_y=Symbol.for("react.strict_mode"),Py=Symbol.for("react.profiler"),Oy=Symbol.for("react.provider"),Fy=Symbol.for("react.context"),My=Symbol.for("react.forward_ref"),Ny=Symbol.for("react.suspense"),By=Symbol.for("react.memo"),Uy=Symbol.for("react.lazy"),Rf=Symbol.iterator;function $y(r){return r===null||typeof r!="object"?null:(r=Rf&&r[Rf]||r["@@iterator"],typeof r=="function"?r:null)}var pp={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},mp=Object.assign,gp={};function ai(r,e,t){this.props=r,this.context=e,this.refs=gp,this.updater=t||pp}ai.prototype.isReactComponent={};ai.prototype.setState=function(r,e){if(typeof r!="object"&&typeof r!="function"&&r!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,r,e,"setState")};ai.prototype.forceUpdate=function(r){this.updater.enqueueForceUpdate(this,r,"forceUpdate")};function yp(){}yp.prototype=ai.prototype;function nc(r,e,t){this.props=r,this.context=e,this.refs=gp,this.updater=t||pp}var ic=nc.prototype=new yp;ic.constructor=nc;mp(ic,ai.prototype);ic.isPureReactComponent=!0;var If=Array.isArray,vp=Object.prototype.hasOwnProperty,sc={current:null},xp={key:!0,ref:!0,__self:!0,__source:!0};function Ep(r,e,t){var n,i={},s=null,o=null;if(e!=null)for(n in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)vp.call(e,n)&&!xp.hasOwnProperty(n)&&(i[n]=e[n]);var l=arguments.length-2;if(l===1)i.children=t;else if(1>>1,V=B[K];if(0>>1;Ki(ce,N))aei(xe,ce)?(B[K]=xe,B[ae]=N,K=ae):(B[K]=ce,B[ie]=N,K=ie);else if(aei(xe,N))B[K]=xe,B[ae]=N,K=ae;else break e}}return F}function i(B,F){var N=B.sortIndex-F.sortIndex;return N!==0?N:B.id-F.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;r.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();r.unstable_now=function(){return o.now()-l}}var a=[],u=[],c=1,f=null,d=3,h=!1,p=!1,m=!1,y=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(B){for(var F=t(u);F!==null;){if(F.callback===null)n(u);else if(F.startTime<=B)n(u),F.sortIndex=F.expirationTime,e(a,F);else break;F=t(u)}}function S(B){if(m=!1,x(B),!p)if(t(a)!==null)p=!0,U(E);else{var F=t(u);F!==null&&G(S,F.startTime-B)}}function E(B,F){p=!1,m&&(m=!1,g(A),A=-1),h=!0;var N=d;try{for(x(F),f=t(a);f!==null&&(!(f.expirationTime>F)||B&&!C());){var K=f.callback;if(typeof K=="function"){f.callback=null,d=f.priorityLevel;var V=K(f.expirationTime<=F);F=r.unstable_now(),typeof V=="function"?f.callback=V:f===t(a)&&n(a),x(F)}else n(a);f=t(a)}if(f!==null)var J=!0;else{var ie=t(u);ie!==null&&G(S,ie.startTime-F),J=!1}return J}finally{f=null,d=N,h=!1}}var b=!1,w=null,A=-1,R=5,L=-1;function C(){return!(r.unstable_now()-LB||125K?(B.sortIndex=N,e(u,B),t(a)===null&&B===t(u)&&(m?(g(A),A=-1):m=!0,G(S,N-K))):(B.sortIndex=V,e(a,B),p||h||(p=!0,U(E))),B},r.unstable_shouldYield=C,r.unstable_wrapCallback=function(B){var F=d;return function(){var N=d;d=F;try{return B.apply(this,arguments)}finally{d=N}}}})(Lp);Ap.exports=Lp;var Zy=Ap.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Qy=ht,at=Zy;function j(r){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+r,t=1;t"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Pl=Object.prototype.hasOwnProperty,Jy=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Cf={},Df={};function ev(r){return Pl.call(Df,r)?!0:Pl.call(Cf,r)?!1:Jy.test(r)?Df[r]=!0:(Cf[r]=!0,!1)}function tv(r,e,t,n){if(t!==null&&t.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return n?!1:t!==null?!t.acceptsBooleans:(r=r.toLowerCase().slice(0,5),r!=="data-"&&r!=="aria-");default:return!1}}function rv(r,e,t,n){if(e===null||typeof e>"u"||tv(r,e,t,n))return!0;if(n)return!1;if(t!==null)switch(t.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Ye(r,e,t,n,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=t,this.propertyName=r,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var Ue={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){Ue[r]=new Ye(r,0,!1,r,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(r){var e=r[0];Ue[e]=new Ye(e,1,!1,r[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(r){Ue[r]=new Ye(r,2,!1,r.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){Ue[r]=new Ye(r,2,!1,r,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(r){Ue[r]=new Ye(r,3,!1,r.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(r){Ue[r]=new Ye(r,3,!0,r,null,!1,!1)});["capture","download"].forEach(function(r){Ue[r]=new Ye(r,4,!1,r,null,!1,!1)});["cols","rows","size","span"].forEach(function(r){Ue[r]=new Ye(r,6,!1,r,null,!1,!1)});["rowSpan","start"].forEach(function(r){Ue[r]=new Ye(r,5,!1,r.toLowerCase(),null,!1,!1)});var ac=/[\-:]([a-z])/g;function lc(r){return r[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(r){var e=r.replace(ac,lc);Ue[e]=new Ye(e,1,!1,r,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(r){var e=r.replace(ac,lc);Ue[e]=new Ye(e,1,!1,r,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(r){var e=r.replace(ac,lc);Ue[e]=new Ye(e,1,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(r){Ue[r]=new Ye(r,1,!1,r.toLowerCase(),null,!1,!1)});Ue.xlinkHref=new Ye("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(r){Ue[r]=new Ye(r,1,!1,r.toLowerCase(),null,!0,!0)});function uc(r,e,t,n){var i=Ue.hasOwnProperty(e)?Ue[e]:null;(i!==null?i.type!==0:n||!(2l||i[o]!==s[l]){var a=` +`+i[o].replace(" at new "," at ");return r.displayName&&a.includes("")&&(a=a.replace("",r.displayName)),a}while(1<=o&&0<=l);break}}}finally{Ma=!1,Error.prepareStackTrace=t}return(r=r?r.displayName||r.name:"")?Ii(r):""}function nv(r){switch(r.tag){case 5:return Ii(r.type);case 16:return Ii("Lazy");case 13:return Ii("Suspense");case 19:return Ii("SuspenseList");case 0:case 2:case 15:return r=Na(r.type,!1),r;case 11:return r=Na(r.type.render,!1),r;case 1:return r=Na(r.type,!0),r;default:return""}}function Nl(r){if(r==null)return null;if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case bn:return"Fragment";case wn:return"Portal";case Ol:return"Profiler";case cc:return"StrictMode";case Fl:return"Suspense";case Ml:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case kp:return(r.displayName||"Context")+".Consumer";case Ip:return(r._context.displayName||"Context")+".Provider";case fc:var e=r.render;return r=r.displayName,r||(r=e.displayName||e.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case dc:return e=r.displayName||null,e!==null?e:Nl(r.type)||"Memo";case xr:e=r._payload,r=r._init;try{return Nl(r(e))}catch{}}return null}function iv(r){var e=r.type;switch(r.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return r=e.render,r=r.displayName||r.name||"",e.displayName||(r!==""?"ForwardRef("+r+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Nl(e);case 8:return e===cc?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Mr(r){switch(typeof r){case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Dp(r){var e=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function sv(r){var e=Dp(r)?"checked":"value",t=Object.getOwnPropertyDescriptor(r.constructor.prototype,e),n=""+r[e];if(!r.hasOwnProperty(e)&&typeof t<"u"&&typeof t.get=="function"&&typeof t.set=="function"){var i=t.get,s=t.set;return Object.defineProperty(r,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,s.call(this,o)}}),Object.defineProperty(r,e,{enumerable:t.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){r._valueTracker=null,delete r[e]}}}}function As(r){r._valueTracker||(r._valueTracker=sv(r))}function _p(r){if(!r)return!1;var e=r._valueTracker;if(!e)return!0;var t=e.getValue(),n="";return r&&(n=Dp(r)?r.checked?"true":"false":r.value),r=n,r!==t?(e.setValue(r),!0):!1}function To(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}function Bl(r,e){var t=e.checked;return we({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??r._wrapperState.initialChecked})}function Pf(r,e){var t=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;t=Mr(e.value!=null?e.value:t),r._wrapperState={initialChecked:n,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function Pp(r,e){e=e.checked,e!=null&&uc(r,"checked",e,!1)}function Ul(r,e){Pp(r,e);var t=Mr(e.value),n=e.type;if(t!=null)n==="number"?(t===0&&r.value===""||r.value!=t)&&(r.value=""+t):r.value!==""+t&&(r.value=""+t);else if(n==="submit"||n==="reset"){r.removeAttribute("value");return}e.hasOwnProperty("value")?$l(r,e.type,t):e.hasOwnProperty("defaultValue")&&$l(r,e.type,Mr(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(r.defaultChecked=!!e.defaultChecked)}function Of(r,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+r._wrapperState.initialValue,t||e===r.value||(r.value=e),r.defaultValue=e}t=r.name,t!==""&&(r.name=""),r.defaultChecked=!!r._wrapperState.initialChecked,t!==""&&(r.name=t)}function $l(r,e,t){(e!=="number"||To(r.ownerDocument)!==r)&&(t==null?r.defaultValue=""+r._wrapperState.initialValue:r.defaultValue!==""+t&&(r.defaultValue=""+t))}var ki=Array.isArray;function Bn(r,e,t,n){if(r=r.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=Ls.firstChild;r.firstChild;)r.removeChild(r.firstChild);for(;e.firstChild;)r.appendChild(e.firstChild)}});function Yi(r,e){if(e){var t=r.firstChild;if(t&&t===r.lastChild&&t.nodeType===3){t.nodeValue=e;return}}r.textContent=e}var Fi={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ov=["Webkit","ms","Moz","O"];Object.keys(Fi).forEach(function(r){ov.forEach(function(e){e=e+r.charAt(0).toUpperCase()+r.substring(1),Fi[e]=Fi[r]})});function Np(r,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||Fi.hasOwnProperty(r)&&Fi[r]?(""+e).trim():e+"px"}function Bp(r,e){r=r.style;for(var t in e)if(e.hasOwnProperty(t)){var n=t.indexOf("--")===0,i=Np(t,e[t],n);t==="float"&&(t="cssFloat"),n?r.setProperty(t,i):r[t]=i}}var av=we({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Hl(r,e){if(e){if(av[r]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(j(137,r));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(j(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(j(61))}if(e.style!=null&&typeof e.style!="object")throw Error(j(62))}}function zl(r,e){if(r.indexOf("-")===-1)return typeof e.is=="string";switch(r){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Vl=null;function hc(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Kl=null,Un=null,$n=null;function Nf(r){if(r=vs(r)){if(typeof Kl!="function")throw Error(j(280));var e=r.stateNode;e&&(e=ma(e),Kl(r.stateNode,r.type,e))}}function Up(r){Un?$n?$n.push(r):$n=[r]:Un=r}function $p(){if(Un){var r=Un,e=$n;if($n=Un=null,Nf(r),e)for(r=0;r>>=0,r===0?32:31-(vv(r)/xv|0)|0}var Rs=64,Is=4194304;function Ci(r){switch(r&-r){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: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 r&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return r&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return r}}function Lo(r,e){var t=r.pendingLanes;if(t===0)return 0;var n=0,i=r.suspendedLanes,s=r.pingedLanes,o=t&268435455;if(o!==0){var l=o&~i;l!==0?n=Ci(l):(s&=o,s!==0&&(n=Ci(s)))}else o=t&~i,o!==0?n=Ci(o):s!==0&&(n=Ci(s));if(n===0)return 0;if(e!==0&&e!==n&&!(e&i)&&(i=n&-n,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(n&4&&(n|=t&16),e=r.entangledLanes,e!==0)for(r=r.entanglements,e&=n;0t;t++)e.push(r);return e}function gs(r,e,t){r.pendingLanes|=e,e!==536870912&&(r.suspendedLanes=0,r.pingedLanes=0),r=r.eventTimes,e=31-kt(e),r[e]=t}function wv(r,e){var t=r.pendingLanes&~e;r.pendingLanes=e,r.suspendedLanes=0,r.pingedLanes=0,r.expiredLanes&=e,r.mutableReadLanes&=e,r.entangledLanes&=e,e=r.entanglements;var n=r.eventTimes;for(r=r.expirationTimes;0=Ni),Kf=" ",Wf=!1;function o0(r,e){switch(r){case"keyup":return Zv.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function a0(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var An=!1;function Jv(r,e){switch(r){case"compositionend":return a0(e);case"keypress":return e.which!==32?null:(Wf=!0,Kf);case"textInput":return r=e.data,r===Kf&&Wf?null:r;default:return null}}function e1(r,e){if(An)return r==="compositionend"||!Sc&&o0(r,e)?(r=i0(),to=vc=br=null,An=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:t,offset:e-r};r=n}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=Zf(t)}}function f0(r,e){return r&&e?r===e?!0:r&&r.nodeType===3?!1:e&&e.nodeType===3?f0(r,e.parentNode):"contains"in r?r.contains(e):r.compareDocumentPosition?!!(r.compareDocumentPosition(e)&16):!1:!1}function d0(){for(var r=window,e=To();e instanceof r.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)r=e.contentWindow;else break;e=To(r.document)}return e}function Tc(r){var e=r&&r.nodeName&&r.nodeName.toLowerCase();return e&&(e==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||e==="textarea"||r.contentEditable==="true")}function u1(r){var e=d0(),t=r.focusedElem,n=r.selectionRange;if(e!==t&&t&&t.ownerDocument&&f0(t.ownerDocument.documentElement,t)){if(n!==null&&Tc(t)){if(e=n.start,r=n.end,r===void 0&&(r=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(r,t.value.length);else if(r=(e=t.ownerDocument||document)&&e.defaultView||window,r.getSelection){r=r.getSelection();var i=t.textContent.length,s=Math.min(n.start,i);n=n.end===void 0?s:Math.min(n.end,i),!r.extend&&s>n&&(i=n,n=s,s=i),i=Qf(t,s);var o=Qf(t,n);i&&o&&(r.rangeCount!==1||r.anchorNode!==i.node||r.anchorOffset!==i.offset||r.focusNode!==o.node||r.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),r.removeAllRanges(),s>n?(r.addRange(e),r.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),r.addRange(e)))}}for(e=[],r=t;r=r.parentNode;)r.nodeType===1&&e.push({element:r,left:r.scrollLeft,top:r.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t=document.documentMode,Ln=null,Ql=null,Ui=null,Jl=!1;function Jf(r,e,t){var n=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;Jl||Ln==null||Ln!==To(n)||(n=Ln,"selectionStart"in n&&Tc(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Ui&&es(Ui,n)||(Ui=n,n=ko(Ql,"onSelect"),0kn||(r.current=su[kn],su[kn]=null,kn--)}function he(r,e){kn++,su[kn]=r.current,r.current=e}var Nr={},ze=Gr(Nr),Je=Gr(!1),sn=Nr;function Yn(r,e){var t=r.type.contextTypes;if(!t)return Nr;var n=r.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in t)i[s]=e[s];return n&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=e,r.__reactInternalMemoizedMaskedChildContext=i),i}function et(r){return r=r.childContextTypes,r!=null}function Do(){me(Je),me(ze)}function od(r,e,t){if(ze.current!==Nr)throw Error(j(168));he(ze,e),he(Je,t)}function S0(r,e,t){var n=r.stateNode;if(e=e.childContextTypes,typeof n.getChildContext!="function")return t;n=n.getChildContext();for(var i in n)if(!(i in e))throw Error(j(108,iv(r)||"Unknown",i));return we({},t,n)}function _o(r){return r=(r=r.stateNode)&&r.__reactInternalMemoizedMergedChildContext||Nr,sn=ze.current,he(ze,r),he(Je,Je.current),!0}function ad(r,e,t){var n=r.stateNode;if(!n)throw Error(j(169));t?(r=S0(r,e,sn),n.__reactInternalMemoizedMergedChildContext=r,me(Je),me(ze),he(ze,r)):me(Je),he(Je,t)}var rr=null,ga=!1,Za=!1;function T0(r){rr===null?rr=[r]:rr.push(r)}function S1(r){ga=!0,T0(r)}function Hr(){if(!Za&&rr!==null){Za=!0;var r=0,e=ue;try{var t=rr;for(ue=1;r>=o,i-=o,nr=1<<32-kt(e)+i|t<A?(R=w,w=null):R=w.sibling;var L=d(g,w,x[A],S);if(L===null){w===null&&(w=R);break}r&&w&&L.alternate===null&&e(g,w),v=s(L,v,A),b===null?E=L:b.sibling=L,b=L,w=R}if(A===x.length)return t(g,w),ye&&Vr(g,A),E;if(w===null){for(;AA?(R=w,w=null):R=w.sibling;var C=d(g,w,L.value,S);if(C===null){w===null&&(w=R);break}r&&w&&C.alternate===null&&e(g,w),v=s(C,v,A),b===null?E=C:b.sibling=C,b=C,w=R}if(L.done)return t(g,w),ye&&Vr(g,A),E;if(w===null){for(;!L.done;A++,L=x.next())L=f(g,L.value,S),L!==null&&(v=s(L,v,A),b===null?E=L:b.sibling=L,b=L);return ye&&Vr(g,A),E}for(w=n(g,w);!L.done;A++,L=x.next())L=h(w,g,A,L.value,S),L!==null&&(r&&L.alternate!==null&&w.delete(L.key===null?A:L.key),v=s(L,v,A),b===null?E=L:b.sibling=L,b=L);return r&&w.forEach(function(_){return e(g,_)}),ye&&Vr(g,A),E}function y(g,v,x,S){if(typeof x=="object"&&x!==null&&x.type===bn&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case bs:e:{for(var E=x.key,b=v;b!==null;){if(b.key===E){if(E=x.type,E===bn){if(b.tag===7){t(g,b.sibling),v=i(b,x.props.children),v.return=g,g=v;break e}}else if(b.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===xr&&cd(E)===b.type){t(g,b.sibling),v=i(b,x.props),v.ref=bi(g,b,x),v.return=g,g=v;break e}t(g,b);break}else e(g,b);b=b.sibling}x.type===bn?(v=en(x.props.children,g.mode,S,x.key),v.return=g,g=v):(S=uo(x.type,x.key,x.props,null,g.mode,S),S.ref=bi(g,v,x),S.return=g,g=S)}return o(g);case wn:e:{for(b=x.key;v!==null;){if(v.key===b)if(v.tag===4&&v.stateNode.containerInfo===x.containerInfo&&v.stateNode.implementation===x.implementation){t(g,v.sibling),v=i(v,x.children||[]),v.return=g,g=v;break e}else{t(g,v);break}else e(g,v);v=v.sibling}v=sl(x,g.mode,S),v.return=g,g=v}return o(g);case xr:return b=x._init,y(g,v,b(x._payload),S)}if(ki(x))return p(g,v,x,S);if(xi(x))return m(g,v,x,S);Fs(g,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,v!==null&&v.tag===6?(t(g,v.sibling),v=i(v,x),v.return=g,g=v):(t(g,v),v=il(x,g.mode,S),v.return=g,g=v),o(g)):t(g,v)}return y}var Xn=L0(!0),R0=L0(!1),Fo=Gr(null),Mo=null,_n=null,Lc=null;function Rc(){Lc=_n=Mo=null}function Ic(r){var e=Fo.current;me(Fo),r._currentValue=e}function lu(r,e,t){for(;r!==null;){var n=r.alternate;if((r.childLanes&e)!==e?(r.childLanes|=e,n!==null&&(n.childLanes|=e)):n!==null&&(n.childLanes&e)!==e&&(n.childLanes|=e),r===t)break;r=r.return}}function Gn(r,e){Mo=r,Lc=_n=null,r=r.dependencies,r!==null&&r.firstContext!==null&&(r.lanes&e&&(Qe=!0),r.firstContext=null)}function vt(r){var e=r._currentValue;if(Lc!==r)if(r={context:r,memoizedValue:e,next:null},_n===null){if(Mo===null)throw Error(j(308));_n=r,Mo.dependencies={lanes:0,firstContext:r}}else _n=_n.next=r;return e}var Xr=null;function kc(r){Xr===null?Xr=[r]:Xr.push(r)}function I0(r,e,t,n){var i=e.interleaved;return i===null?(t.next=t,kc(e)):(t.next=i.next,i.next=t),e.interleaved=t,lr(r,n)}function lr(r,e){r.lanes|=e;var t=r.alternate;for(t!==null&&(t.lanes|=e),t=r,r=r.return;r!==null;)r.childLanes|=e,t=r.alternate,t!==null&&(t.childLanes|=e),t=r,r=r.return;return t.tag===3?t.stateNode:null}var Er=!1;function Cc(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function k0(r,e){r=r.updateQueue,e.updateQueue===r&&(e.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,effects:r.effects})}function sr(r,e){return{eventTime:r,lane:e,tag:0,payload:null,callback:null,next:null}}function _r(r,e,t){var n=r.updateQueue;if(n===null)return null;if(n=n.shared,oe&2){var i=n.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),n.pending=e,lr(r,t)}return i=n.interleaved,i===null?(e.next=e,kc(n)):(e.next=i.next,i.next=e),n.interleaved=e,lr(r,t)}function no(r,e,t){if(e=e.updateQueue,e!==null&&(e=e.shared,(t&4194240)!==0)){var n=e.lanes;n&=r.pendingLanes,t|=n,e.lanes=t,mc(r,t)}}function fd(r,e){var t=r.updateQueue,n=r.alternate;if(n!==null&&(n=n.updateQueue,t===n)){var i=null,s=null;if(t=t.firstBaseUpdate,t!==null){do{var o={eventTime:t.eventTime,lane:t.lane,tag:t.tag,payload:t.payload,callback:t.callback,next:null};s===null?i=s=o:s=s.next=o,t=t.next}while(t!==null);s===null?i=s=e:s=s.next=e}else i=s=e;t={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:n.shared,effects:n.effects},r.updateQueue=t;return}r=t.lastBaseUpdate,r===null?t.firstBaseUpdate=e:r.next=e,t.lastBaseUpdate=e}function No(r,e,t,n){var i=r.updateQueue;Er=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var a=l,u=a.next;a.next=null,o===null?s=u:o.next=u,o=a;var c=r.alternate;c!==null&&(c=c.updateQueue,l=c.lastBaseUpdate,l!==o&&(l===null?c.firstBaseUpdate=u:l.next=u,c.lastBaseUpdate=a))}if(s!==null){var f=i.baseState;o=0,c=u=a=null,l=s;do{var d=l.lane,h=l.eventTime;if((n&d)===d){c!==null&&(c=c.next={eventTime:h,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var p=r,m=l;switch(d=e,h=t,m.tag){case 1:if(p=m.payload,typeof p=="function"){f=p.call(h,f,d);break e}f=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=m.payload,d=typeof p=="function"?p.call(h,f,d):p,d==null)break e;f=we({},f,d);break e;case 2:Er=!0}}l.callback!==null&&l.lane!==0&&(r.flags|=64,d=i.effects,d===null?i.effects=[l]:d.push(l))}else h={eventTime:h,lane:d,tag:l.tag,payload:l.payload,callback:l.callback,next:null},c===null?(u=c=h,a=f):c=c.next=h,o|=d;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;d=l,l=d.next,d.next=null,i.lastBaseUpdate=d,i.shared.pending=null}}while(!0);if(c===null&&(a=f),i.baseState=a,i.firstBaseUpdate=u,i.lastBaseUpdate=c,e=i.shared.interleaved,e!==null){i=e;do o|=i.lane,i=i.next;while(i!==e)}else s===null&&(i.shared.lanes=0);ln|=o,r.lanes=o,r.memoizedState=f}}function dd(r,e,t){if(r=e.effects,e.effects=null,r!==null)for(e=0;et?t:4,r(!0);var n=Ja.transition;Ja.transition={};try{r(!1),e()}finally{ue=t,Ja.transition=n}}function K0(){return xt().memoizedState}function A1(r,e,t){var n=Or(r);if(t={lane:n,action:t,hasEagerState:!1,eagerState:null,next:null},W0(r))Y0(e,t);else if(t=I0(r,e,t,n),t!==null){var i=Ke();Ct(t,r,n,i),q0(t,e,n)}}function L1(r,e,t){var n=Or(r),i={lane:n,action:t,hasEagerState:!1,eagerState:null,next:null};if(W0(r))Y0(e,i);else{var s=r.alternate;if(r.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,l=s(o,t);if(i.hasEagerState=!0,i.eagerState=l,Dt(l,o)){var a=e.interleaved;a===null?(i.next=i,kc(e)):(i.next=a.next,a.next=i),e.interleaved=i;return}}catch{}finally{}t=I0(r,e,i,n),t!==null&&(i=Ke(),Ct(t,r,n,i),q0(t,e,n))}}function W0(r){var e=r.alternate;return r===Te||e!==null&&e===Te}function Y0(r,e){$i=Uo=!0;var t=r.pending;t===null?e.next=e:(e.next=t.next,t.next=e),r.pending=e}function q0(r,e,t){if(t&4194240){var n=e.lanes;n&=r.pendingLanes,t|=n,e.lanes=t,mc(r,t)}}var $o={readContext:vt,useCallback:$e,useContext:$e,useEffect:$e,useImperativeHandle:$e,useInsertionEffect:$e,useLayoutEffect:$e,useMemo:$e,useReducer:$e,useRef:$e,useState:$e,useDebugValue:$e,useDeferredValue:$e,useTransition:$e,useMutableSource:$e,useSyncExternalStore:$e,useId:$e,unstable_isNewReconciler:!1},R1={readContext:vt,useCallback:function(r,e){return Ft().memoizedState=[r,e===void 0?null:e],r},useContext:vt,useEffect:pd,useImperativeHandle:function(r,e,t){return t=t!=null?t.concat([r]):null,so(4194308,4,j0.bind(null,e,r),t)},useLayoutEffect:function(r,e){return so(4194308,4,r,e)},useInsertionEffect:function(r,e){return so(4,2,r,e)},useMemo:function(r,e){var t=Ft();return e=e===void 0?null:e,r=r(),t.memoizedState=[r,e],r},useReducer:function(r,e,t){var n=Ft();return e=t!==void 0?t(e):e,n.memoizedState=n.baseState=e,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:e},n.queue=r,r=r.dispatch=A1.bind(null,Te,r),[n.memoizedState,r]},useRef:function(r){var e=Ft();return r={current:r},e.memoizedState=r},useState:hd,useDebugValue:Bc,useDeferredValue:function(r){return Ft().memoizedState=r},useTransition:function(){var r=hd(!1),e=r[0];return r=b1.bind(null,r[1]),Ft().memoizedState=r,[e,r]},useMutableSource:function(){},useSyncExternalStore:function(r,e,t){var n=Te,i=Ft();if(ye){if(t===void 0)throw Error(j(407));t=t()}else{if(t=e(),Oe===null)throw Error(j(349));an&30||P0(n,e,t)}i.memoizedState=t;var s={value:t,getSnapshot:e};return i.queue=s,pd(F0.bind(null,n,s,r),[r]),n.flags|=2048,ls(9,O0.bind(null,n,s,t,e),void 0,null),t},useId:function(){var r=Ft(),e=Oe.identifierPrefix;if(ye){var t=ir,n=nr;t=(n&~(1<<32-kt(n)-1)).toString(32)+t,e=":"+e+"R"+t,t=os++,0<\/script>",r=r.removeChild(r.firstChild)):typeof n.is=="string"?r=o.createElement(t,{is:n.is}):(r=o.createElement(t),t==="select"&&(o=r,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):r=o.createElementNS(r,t),r[Ut]=e,r[ns]=n,sm(r,e,!1,!1),e.stateNode=r;e:{switch(o=zl(t,n),t){case"dialog":pe("cancel",r),pe("close",r),i=n;break;case"iframe":case"object":case"embed":pe("load",r),i=n;break;case"video":case"audio":for(i=0;iJn&&(e.flags|=128,n=!0,Ai(s,!1),e.lanes=4194304)}else{if(!n)if(r=Bo(o),r!==null){if(e.flags|=128,n=!0,t=r.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),Ai(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!ye)return je(e),null}else 2*Ae()-s.renderingStartTime>Jn&&t!==1073741824&&(e.flags|=128,n=!0,Ai(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(t=s.last,t!==null?t.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Ae(),e.sibling=null,t=Se.current,he(Se,n?t&1|2:t&1),e):(je(e),null);case 22:case 23:return zc(),n=e.memoizedState!==null,r!==null&&r.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?rt&1073741824&&(je(e),e.subtreeFlags&6&&(e.flags|=8192)):je(e),null;case 24:return null;case 25:return null}throw Error(j(156,e.tag))}function F1(r,e){switch(bc(e),e.tag){case 1:return et(e.type)&&Do(),r=e.flags,r&65536?(e.flags=r&-65537|128,e):null;case 3:return Zn(),me(Je),me(ze),Pc(),r=e.flags,r&65536&&!(r&128)?(e.flags=r&-65537|128,e):null;case 5:return _c(e),null;case 13:if(me(Se),r=e.memoizedState,r!==null&&r.dehydrated!==null){if(e.alternate===null)throw Error(j(340));qn()}return r=e.flags,r&65536?(e.flags=r&-65537|128,e):null;case 19:return me(Se),null;case 4:return Zn(),null;case 10:return Ic(e.type._context),null;case 22:case 23:return zc(),null;case 24:return null;default:return null}}var Ns=!1,He=!1,M1=typeof WeakSet=="function"?WeakSet:Set,H=null;function Pn(r,e){var t=r.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(n){be(r,e,n)}else t.current=null}function yu(r,e,t){try{t()}catch(n){be(r,e,n)}}var Ad=!1;function N1(r,e){if(eu=Ro,r=d0(),Tc(r)){if("selectionStart"in r)var t={start:r.selectionStart,end:r.selectionEnd};else e:{t=(t=r.ownerDocument)&&t.defaultView||window;var n=t.getSelection&&t.getSelection();if(n&&n.rangeCount!==0){t=n.anchorNode;var i=n.anchorOffset,s=n.focusNode;n=n.focusOffset;try{t.nodeType,s.nodeType}catch{t=null;break e}var o=0,l=-1,a=-1,u=0,c=0,f=r,d=null;t:for(;;){for(var h;f!==t||i!==0&&f.nodeType!==3||(l=o+i),f!==s||n!==0&&f.nodeType!==3||(a=o+n),f.nodeType===3&&(o+=f.nodeValue.length),(h=f.firstChild)!==null;)d=f,f=h;for(;;){if(f===r)break t;if(d===t&&++u===i&&(l=o),d===s&&++c===n&&(a=o),(h=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=h}t=l===-1||a===-1?null:{start:l,end:a}}else t=null}t=t||{start:0,end:0}}else t=null;for(tu={focusedElem:r,selectionRange:t},Ro=!1,H=e;H!==null;)if(e=H,r=e.child,(e.subtreeFlags&1028)!==0&&r!==null)r.return=e,H=r;else for(;H!==null;){e=H;try{var p=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var m=p.memoizedProps,y=p.memoizedState,g=e.stateNode,v=g.getSnapshotBeforeUpdate(e.elementType===e.type?m:At(e.type,m),y);g.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var x=e.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(j(163))}}catch(S){be(e,e.return,S)}if(r=e.sibling,r!==null){r.return=e.return,H=r;break}H=e.return}return p=Ad,Ad=!1,p}function ji(r,e,t){var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&r)===r){var s=i.destroy;i.destroy=void 0,s!==void 0&&yu(e,t,s)}i=i.next}while(i!==n)}}function xa(r,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var t=e=e.next;do{if((t.tag&r)===r){var n=t.create;t.destroy=n()}t=t.next}while(t!==e)}}function vu(r){var e=r.ref;if(e!==null){var t=r.stateNode;switch(r.tag){case 5:r=t;break;default:r=t}typeof e=="function"?e(r):e.current=r}}function lm(r){var e=r.alternate;e!==null&&(r.alternate=null,lm(e)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(e=r.stateNode,e!==null&&(delete e[Ut],delete e[ns],delete e[iu],delete e[x1],delete e[E1])),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}function um(r){return r.tag===5||r.tag===3||r.tag===4}function Ld(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||um(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function xu(r,e,t){var n=r.tag;if(n===5||n===6)r=r.stateNode,e?t.nodeType===8?t.parentNode.insertBefore(r,e):t.insertBefore(r,e):(t.nodeType===8?(e=t.parentNode,e.insertBefore(r,t)):(e=t,e.appendChild(r)),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=Co));else if(n!==4&&(r=r.child,r!==null))for(xu(r,e,t),r=r.sibling;r!==null;)xu(r,e,t),r=r.sibling}function Eu(r,e,t){var n=r.tag;if(n===5||n===6)r=r.stateNode,e?t.insertBefore(r,e):t.appendChild(r);else if(n!==4&&(r=r.child,r!==null))for(Eu(r,e,t),r=r.sibling;r!==null;)Eu(r,e,t),r=r.sibling}var Me=null,Lt=!1;function gr(r,e,t){for(t=t.child;t!==null;)cm(r,e,t),t=t.sibling}function cm(r,e,t){if(zt&&typeof zt.onCommitFiberUnmount=="function")try{zt.onCommitFiberUnmount(fa,t)}catch{}switch(t.tag){case 5:He||Pn(t,e);case 6:var n=Me,i=Lt;Me=null,gr(r,e,t),Me=n,Lt=i,Me!==null&&(Lt?(r=Me,t=t.stateNode,r.nodeType===8?r.parentNode.removeChild(t):r.removeChild(t)):Me.removeChild(t.stateNode));break;case 18:Me!==null&&(Lt?(r=Me,t=t.stateNode,r.nodeType===8?Xa(r.parentNode,t):r.nodeType===1&&Xa(r,t),Qi(r)):Xa(Me,t.stateNode));break;case 4:n=Me,i=Lt,Me=t.stateNode.containerInfo,Lt=!0,gr(r,e,t),Me=n,Lt=i;break;case 0:case 11:case 14:case 15:if(!He&&(n=t.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&yu(t,e,o),i=i.next}while(i!==n)}gr(r,e,t);break;case 1:if(!He&&(Pn(t,e),n=t.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=t.memoizedProps,n.state=t.memoizedState,n.componentWillUnmount()}catch(l){be(t,e,l)}gr(r,e,t);break;case 21:gr(r,e,t);break;case 22:t.mode&1?(He=(n=He)||t.memoizedState!==null,gr(r,e,t),He=n):gr(r,e,t);break;default:gr(r,e,t)}}function Rd(r){var e=r.updateQueue;if(e!==null){r.updateQueue=null;var t=r.stateNode;t===null&&(t=r.stateNode=new M1),e.forEach(function(n){var i=K1.bind(null,r,n);t.has(n)||(t.add(n),n.then(i,i))})}}function Tt(r,e){var t=e.deletions;if(t!==null)for(var n=0;ni&&(i=o),n&=~s}if(n=i,n=Ae()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*U1(n/1960))-n,10r?16:r,Ar===null)var n=!1;else{if(r=Ar,Ar=null,Ho=0,oe&6)throw Error(j(331));var i=oe;for(oe|=4,H=r.current;H!==null;){var s=H,o=s.child;if(H.flags&16){var l=s.deletions;if(l!==null){for(var a=0;aAe()-Gc?Jr(r,0):jc|=t),tt(r,e)}function vm(r,e){e===0&&(r.mode&1?(e=Is,Is<<=1,!(Is&130023424)&&(Is=4194304)):e=1);var t=Ke();r=lr(r,e),r!==null&&(gs(r,e,t),tt(r,t))}function V1(r){var e=r.memoizedState,t=0;e!==null&&(t=e.retryLane),vm(r,t)}function K1(r,e){var t=0;switch(r.tag){case 13:var n=r.stateNode,i=r.memoizedState;i!==null&&(t=i.retryLane);break;case 19:n=r.stateNode;break;default:throw Error(j(314))}n!==null&&n.delete(e),vm(r,t)}var xm;xm=function(r,e,t){if(r!==null)if(r.memoizedProps!==e.pendingProps||Je.current)Qe=!0;else{if(!(r.lanes&t)&&!(e.flags&128))return Qe=!1,P1(r,e,t);Qe=!!(r.flags&131072)}else Qe=!1,ye&&e.flags&1048576&&w0(e,Oo,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;oo(r,e),r=e.pendingProps;var i=Yn(e,ze.current);Gn(e,t),i=Fc(null,e,n,r,i,t);var s=Mc();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,et(n)?(s=!0,_o(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Cc(e),i.updater=va,e.stateNode=i,i._reactInternals=e,cu(e,n,r,t),e=hu(null,e,n,!0,s,t)):(e.tag=0,ye&&s&&wc(e),Ve(null,e,i,t),e=e.child),e;case 16:n=e.elementType;e:{switch(oo(r,e),r=e.pendingProps,i=n._init,n=i(n._payload),e.type=n,i=e.tag=Y1(n),r=At(n,r),i){case 0:e=du(null,e,n,r,t);break e;case 1:e=Td(null,e,n,r,t);break e;case 11:e=Ed(null,e,n,r,t);break e;case 14:e=Sd(null,e,n,At(n.type,r),t);break e}throw Error(j(306,n,""))}return e;case 0:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:At(n,i),du(r,e,n,i,t);case 1:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:At(n,i),Td(r,e,n,i,t);case 3:e:{if(rm(e),r===null)throw Error(j(387));n=e.pendingProps,s=e.memoizedState,i=s.element,k0(r,e),No(e,n,null,t);var o=e.memoizedState;if(n=o.element,s.isDehydrated)if(s={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=Qn(Error(j(423)),e),e=wd(r,e,n,t,i);break e}else if(n!==i){i=Qn(Error(j(424)),e),e=wd(r,e,n,t,i);break e}else for(nt=Dr(e.stateNode.containerInfo.firstChild),it=e,ye=!0,Rt=null,t=R0(e,null,n,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(qn(),n===i){e=ur(r,e,t);break e}Ve(r,e,n,t)}e=e.child}return e;case 5:return C0(e),r===null&&au(e),n=e.type,i=e.pendingProps,s=r!==null?r.memoizedProps:null,o=i.children,ru(n,i)?o=null:s!==null&&ru(n,s)&&(e.flags|=32),tm(r,e),Ve(r,e,o,t),e.child;case 6:return r===null&&au(e),null;case 13:return nm(r,e,t);case 4:return Dc(e,e.stateNode.containerInfo),n=e.pendingProps,r===null?e.child=Xn(e,null,n,t):Ve(r,e,n,t),e.child;case 11:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:At(n,i),Ed(r,e,n,i,t);case 7:return Ve(r,e,e.pendingProps,t),e.child;case 8:return Ve(r,e,e.pendingProps.children,t),e.child;case 12:return Ve(r,e,e.pendingProps.children,t),e.child;case 10:e:{if(n=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,he(Fo,n._currentValue),n._currentValue=o,s!==null)if(Dt(s.value,o)){if(s.children===i.children&&!Je.current){e=ur(r,e,t);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var l=s.dependencies;if(l!==null){o=s.child;for(var a=l.firstContext;a!==null;){if(a.context===n){if(s.tag===1){a=sr(-1,t&-t),a.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?a.next=a:(a.next=c.next,c.next=a),u.pending=a}}s.lanes|=t,a=s.alternate,a!==null&&(a.lanes|=t),lu(s.return,t,e),l.lanes|=t;break}a=a.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(j(341));o.lanes|=t,l=o.alternate,l!==null&&(l.lanes|=t),lu(o,t,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Ve(r,e,i.children,t),e=e.child}return e;case 9:return i=e.type,n=e.pendingProps.children,Gn(e,t),i=vt(i),n=n(i),e.flags|=1,Ve(r,e,n,t),e.child;case 14:return n=e.type,i=At(n,e.pendingProps),i=At(n.type,i),Sd(r,e,n,i,t);case 15:return J0(r,e,e.type,e.pendingProps,t);case 17:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:At(n,i),oo(r,e),e.tag=1,et(n)?(r=!0,_o(e)):r=!1,Gn(e,t),X0(e,n,i),cu(e,n,i,t),hu(null,e,n,!0,r,t);case 19:return im(r,e,t);case 22:return em(r,e,t)}throw Error(j(156,e.tag))};function Em(r,e){return Wp(r,e)}function W1(r,e,t,n){this.tag=r,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function gt(r,e,t,n){return new W1(r,e,t,n)}function Kc(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Y1(r){if(typeof r=="function")return Kc(r)?1:0;if(r!=null){if(r=r.$$typeof,r===fc)return 11;if(r===dc)return 14}return 2}function Fr(r,e){var t=r.alternate;return t===null?(t=gt(r.tag,e,r.key,r.mode),t.elementType=r.elementType,t.type=r.type,t.stateNode=r.stateNode,t.alternate=r,r.alternate=t):(t.pendingProps=e,t.type=r.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=r.flags&14680064,t.childLanes=r.childLanes,t.lanes=r.lanes,t.child=r.child,t.memoizedProps=r.memoizedProps,t.memoizedState=r.memoizedState,t.updateQueue=r.updateQueue,e=r.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},t.sibling=r.sibling,t.index=r.index,t.ref=r.ref,t}function uo(r,e,t,n,i,s){var o=2;if(n=r,typeof r=="function")Kc(r)&&(o=1);else if(typeof r=="string")o=5;else e:switch(r){case bn:return en(t.children,i,s,e);case cc:o=8,i|=8;break;case Ol:return r=gt(12,t,e,i|2),r.elementType=Ol,r.lanes=s,r;case Fl:return r=gt(13,t,e,i),r.elementType=Fl,r.lanes=s,r;case Ml:return r=gt(19,t,e,i),r.elementType=Ml,r.lanes=s,r;case Cp:return Sa(t,i,s,e);default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case Ip:o=10;break e;case kp:o=9;break e;case fc:o=11;break e;case dc:o=14;break e;case xr:o=16,n=null;break e}throw Error(j(130,r==null?r:typeof r,""))}return e=gt(o,t,e,i),e.elementType=r,e.type=n,e.lanes=s,e}function en(r,e,t,n){return r=gt(7,r,n,e),r.lanes=t,r}function Sa(r,e,t,n){return r=gt(22,r,n,e),r.elementType=Cp,r.lanes=t,r.stateNode={isHidden:!1},r}function il(r,e,t){return r=gt(6,r,null,e),r.lanes=t,r}function sl(r,e,t){return e=gt(4,r.children!==null?r.children:[],r.key,e),e.lanes=t,e.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},e}function q1(r,e,t,n,i){this.tag=e,this.containerInfo=r,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ua(0),this.expirationTimes=Ua(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ua(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Wc(r,e,t,n,i,s,o,l,a){return r=new q1(r,e,t,l,a),e===1?(e=1,s===!0&&(e|=8)):e=0,s=gt(3,null,null,e),r.current=s,s.stateNode=r,s.memoizedState={element:n,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},Cc(s),r}function X1(r,e,t){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(bm)}catch(r){console.error(r)}}bm(),bp.exports=lt;var tx=bp.exports,Am,Fd=tx;Am=Fd.createRoot,Fd.hydrateRoot;const Md=()=>{};let Zc={},Lm={},Rm=null,Im={mark:Md,measure:Md};try{typeof window<"u"&&(Zc=window),typeof document<"u"&&(Lm=document),typeof MutationObserver<"u"&&(Rm=MutationObserver),typeof performance<"u"&&(Im=performance)}catch{}const{userAgent:Nd=""}=Zc.navigator||{},Br=Zc,ge=Lm,Bd=Rm,$s=Im;Br.document;const hr=!!ge.documentElement&&!!ge.head&&typeof ge.addEventListener=="function"&&typeof ge.createElement=="function",km=~Nd.indexOf("MSIE")||~Nd.indexOf("Trident/");var ve="classic",Cm="duotone",st="sharp",ot="sharp-duotone",rx=[ve,Cm,st,ot],nx={classic:{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},sharp:{900:"fass",400:"fasr",300:"fasl",100:"fast"},"sharp-duotone":{900:"fasds"}},Ud={kit:{fak:"kit","fa-kit":"kit"},"kit-duotone":{fakd:"kit-duotone","fa-kit-duotone":"kit-duotone"}},ix=["kit"],sx=/fa(s|r|l|t|d|b|k|kd|ss|sr|sl|st|sds)?[\-\ ]/,ox=/Font ?Awesome ?([56 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp Duotone|Sharp|Kit)?.*/i,ax={"Font Awesome 5 Free":{900:"fas",400:"far"},"Font Awesome 5 Pro":{900:"fas",400:"far",normal:"far",300:"fal"},"Font Awesome 5 Brands":{400:"fab",normal:"fab"},"Font Awesome 5 Duotone":{900:"fad"}},lx={"Font Awesome 6 Free":{900:"fas",400:"far"},"Font Awesome 6 Pro":{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},"Font Awesome 6 Brands":{400:"fab",normal:"fab"},"Font Awesome 6 Duotone":{900:"fad"},"Font Awesome 6 Sharp":{900:"fass",400:"fasr",normal:"fasr",300:"fasl",100:"fast"},"Font Awesome 6 Sharp Duotone":{900:"fasds"}},ux={classic:{"fa-brands":"fab","fa-duotone":"fad","fa-light":"fal","fa-regular":"far","fa-solid":"fas","fa-thin":"fat"},sharp:{"fa-solid":"fass","fa-regular":"fasr","fa-light":"fasl","fa-thin":"fast"},"sharp-duotone":{"fa-solid":"fasds"}},cx={classic:["fas","far","fal","fat"],sharp:["fass","fasr","fasl","fast"],"sharp-duotone":["fasds"]},fx={classic:{fab:"fa-brands",fad:"fa-duotone",fal:"fa-light",far:"fa-regular",fas:"fa-solid",fat:"fa-thin"},sharp:{fass:"fa-solid",fasr:"fa-regular",fasl:"fa-light",fast:"fa-thin"},"sharp-duotone":{fasds:"fa-solid"}},dx={classic:{solid:"fas",regular:"far",light:"fal",thin:"fat",duotone:"fad",brands:"fab"},sharp:{solid:"fass",regular:"fasr",light:"fasl",thin:"fast"},"sharp-duotone":{solid:"fasds"}},Dm={classic:{fa:"solid",fas:"solid","fa-solid":"solid",far:"regular","fa-regular":"regular",fal:"light","fa-light":"light",fat:"thin","fa-thin":"thin",fad:"duotone","fa-duotone":"duotone",fab:"brands","fa-brands":"brands"},sharp:{fa:"solid",fass:"solid","fa-solid":"solid",fasr:"regular","fa-regular":"regular",fasl:"light","fa-light":"light",fast:"thin","fa-thin":"thin"},"sharp-duotone":{fa:"solid",fasds:"solid","fa-solid":"solid"}},hx=["solid","regular","light","thin","duotone","brands"],_m=[1,2,3,4,5,6,7,8,9,10],px=_m.concat([11,12,13,14,15,16,17,18,19,20]),_i={GROUP:"duotone-group",SWAP_OPACITY:"swap-opacity",PRIMARY:"primary",SECONDARY:"secondary"},mx=[...Object.keys(cx),...hx,"2xs","xs","sm","lg","xl","2xl","beat","border","fade","beat-fade","bounce","flip-both","flip-horizontal","flip-vertical","flip","fw","inverse","layers-counter","layers-text","layers","li","pull-left","pull-right","pulse","rotate-180","rotate-270","rotate-90","rotate-by","shake","spin-pulse","spin-reverse","spin","stack-1x","stack-2x","stack","ul",_i.GROUP,_i.SWAP_OPACITY,_i.PRIMARY,_i.SECONDARY].concat(_m.map(r=>"".concat(r,"x"))).concat(px.map(r=>"w-".concat(r))),gx={"Font Awesome Kit":{400:"fak",normal:"fak"},"Font Awesome Kit Duotone":{400:"fakd",normal:"fakd"}},yx={kit:{"fa-kit":"fak"},"kit-duotone":{"fa-kit-duotone":"fakd"}},vx={kit:{fak:"fa-kit"},"kit-duotone":{fakd:"fa-kit-duotone"}},$d={kit:{kit:"fak"},"kit-duotone":{"kit-duotone":"fakd"}};const cr="___FONT_AWESOME___",Au=16,Pm="fa",Om="svg-inline--fa",cn="data-fa-i2svg",Lu="data-fa-pseudo-element",xx="data-fa-pseudo-element-pending",Qc="data-prefix",Jc="data-icon",jd="fontawesome-i2svg",Ex="async",Sx=["HTML","HEAD","STYLE","SCRIPT"],Fm=(()=>{try{return!0}catch{return!1}})(),Mm=[ve,st,ot];function Es(r){return new Proxy(r,{get(e,t){return t in e?e[t]:e[ve]}})}const Nm={...Dm};Nm[ve]={...Dm[ve],...Ud.kit,...Ud["kit-duotone"]};const tn=Es(Nm),Ru={...dx};Ru[ve]={...Ru[ve],...$d.kit,...$d["kit-duotone"]};const cs=Es(Ru),Iu={...fx};Iu[ve]={...Iu[ve],...vx.kit};const rn=Es(Iu),ku={...ux};ku[ve]={...ku[ve],...yx.kit};const Tx=Es(ku),wx=sx,Bm="fa-layers-text",bx=ox,Ax={...nx};Es(Ax);const Lx=["class","data-prefix","data-icon","data-fa-transform","data-fa-mask"],ol=_i,ei=new Set;Object.keys(cs[ve]).map(ei.add.bind(ei));Object.keys(cs[st]).map(ei.add.bind(ei));Object.keys(cs[ot]).map(ei.add.bind(ei));const Rx=[...ix,...mx],zi=Br.FontAwesomeConfig||{};function Ix(r){var e=ge.querySelector("script["+r+"]");if(e)return e.getAttribute(r)}function kx(r){return r===""?!0:r==="false"?!1:r==="true"?!0:r}ge&&typeof ge.querySelector=="function"&&[["data-family-prefix","familyPrefix"],["data-css-prefix","cssPrefix"],["data-family-default","familyDefault"],["data-style-default","styleDefault"],["data-replacement-class","replacementClass"],["data-auto-replace-svg","autoReplaceSvg"],["data-auto-add-css","autoAddCss"],["data-auto-a11y","autoA11y"],["data-search-pseudo-elements","searchPseudoElements"],["data-observe-mutations","observeMutations"],["data-mutate-approach","mutateApproach"],["data-keep-original-source","keepOriginalSource"],["data-measure-performance","measurePerformance"],["data-show-missing-icons","showMissingIcons"]].forEach(e=>{let[t,n]=e;const i=kx(Ix(t));i!=null&&(zi[n]=i)});const Um={styleDefault:"solid",familyDefault:"classic",cssPrefix:Pm,replacementClass:Om,autoReplaceSvg:!0,autoAddCss:!0,autoA11y:!0,searchPseudoElements:!1,observeMutations:!0,mutateApproach:"async",keepOriginalSource:!0,measurePerformance:!1,showMissingIcons:!0};zi.familyPrefix&&(zi.cssPrefix=zi.familyPrefix);const ti={...Um,...zi};ti.autoReplaceSvg||(ti.observeMutations=!1);const W={};Object.keys(Um).forEach(r=>{Object.defineProperty(W,r,{enumerable:!0,set:function(e){ti[r]=e,Vi.forEach(t=>t(W))},get:function(){return ti[r]}})});Object.defineProperty(W,"familyPrefix",{enumerable:!0,set:function(r){ti.cssPrefix=r,Vi.forEach(e=>e(W))},get:function(){return ti.cssPrefix}});Br.FontAwesomeConfig=W;const Vi=[];function Cx(r){return Vi.push(r),()=>{Vi.splice(Vi.indexOf(r),1)}}const yr=Au,$t={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};function Dx(r){if(!r||!hr)return;const e=ge.createElement("style");e.setAttribute("type","text/css"),e.innerHTML=r;const t=ge.head.childNodes;let n=null;for(let i=t.length-1;i>-1;i--){const s=t[i],o=(s.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(o)>-1&&(n=s)}return ge.head.insertBefore(e,n),r}const _x="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function fs(){let r=12,e="";for(;r-- >0;)e+=_x[Math.random()*62|0];return e}function ci(r){const e=[];for(let t=(r||[]).length>>>0;t--;)e[t]=r[t];return e}function ef(r){return r.classList?ci(r.classList):(r.getAttribute("class")||"").split(" ").filter(e=>e)}function $m(r){return"".concat(r).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function Px(r){return Object.keys(r||{}).reduce((e,t)=>e+"".concat(t,'="').concat($m(r[t]),'" '),"").trim()}function La(r){return Object.keys(r||{}).reduce((e,t)=>e+"".concat(t,": ").concat(r[t].trim(),";"),"")}function tf(r){return r.size!==$t.size||r.x!==$t.x||r.y!==$t.y||r.rotate!==$t.rotate||r.flipX||r.flipY}function Ox(r){let{transform:e,containerWidth:t,iconWidth:n}=r;const i={transform:"translate(".concat(t/2," 256)")},s="translate(".concat(e.x*32,", ").concat(e.y*32,") "),o="scale(".concat(e.size/16*(e.flipX?-1:1),", ").concat(e.size/16*(e.flipY?-1:1),") "),l="rotate(".concat(e.rotate," 0 0)"),a={transform:"".concat(s," ").concat(o," ").concat(l)},u={transform:"translate(".concat(n/2*-1," -256)")};return{outer:i,inner:a,path:u}}function Fx(r){let{transform:e,width:t=Au,height:n=Au,startCentered:i=!1}=r,s="";return i&&km?s+="translate(".concat(e.x/yr-t/2,"em, ").concat(e.y/yr-n/2,"em) "):i?s+="translate(calc(-50% + ".concat(e.x/yr,"em), calc(-50% + ").concat(e.y/yr,"em)) "):s+="translate(".concat(e.x/yr,"em, ").concat(e.y/yr,"em) "),s+="scale(".concat(e.size/yr*(e.flipX?-1:1),", ").concat(e.size/yr*(e.flipY?-1:1),") "),s+="rotate(".concat(e.rotate,"deg) "),s}var Mx=`:root, :host { + --fa-font-solid: normal 900 1em/1 "Font Awesome 6 Free"; + --fa-font-regular: normal 400 1em/1 "Font Awesome 6 Free"; + --fa-font-light: normal 300 1em/1 "Font Awesome 6 Pro"; + --fa-font-thin: normal 100 1em/1 "Font Awesome 6 Pro"; + --fa-font-duotone: normal 900 1em/1 "Font Awesome 6 Duotone"; + --fa-font-brands: normal 400 1em/1 "Font Awesome 6 Brands"; + --fa-font-sharp-solid: normal 900 1em/1 "Font Awesome 6 Sharp"; + --fa-font-sharp-regular: normal 400 1em/1 "Font Awesome 6 Sharp"; + --fa-font-sharp-light: normal 300 1em/1 "Font Awesome 6 Sharp"; + --fa-font-sharp-thin: normal 100 1em/1 "Font Awesome 6 Sharp"; + --fa-font-sharp-duotone-solid: normal 900 1em/1 "Font Awesome 6 Sharp Duotone"; +} + +svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa { + overflow: visible; + box-sizing: content-box; +} + +.svg-inline--fa { + display: var(--fa-display, inline-block); + height: 1em; + overflow: visible; + vertical-align: -0.125em; +} +.svg-inline--fa.fa-2xs { + vertical-align: 0.1em; +} +.svg-inline--fa.fa-xs { + vertical-align: 0em; +} +.svg-inline--fa.fa-sm { + vertical-align: -0.0714285705em; +} +.svg-inline--fa.fa-lg { + vertical-align: -0.2em; +} +.svg-inline--fa.fa-xl { + vertical-align: -0.25em; +} +.svg-inline--fa.fa-2xl { + vertical-align: -0.3125em; +} +.svg-inline--fa.fa-pull-left { + margin-right: var(--fa-pull-margin, 0.3em); + width: auto; +} +.svg-inline--fa.fa-pull-right { + margin-left: var(--fa-pull-margin, 0.3em); + width: auto; +} +.svg-inline--fa.fa-li { + width: var(--fa-li-width, 2em); + top: 0.25em; +} +.svg-inline--fa.fa-fw { + width: var(--fa-fw-width, 1.25em); +} + +.fa-layers svg.svg-inline--fa { + bottom: 0; + left: 0; + margin: auto; + position: absolute; + right: 0; + top: 0; +} + +.fa-layers-counter, .fa-layers-text { + display: inline-block; + position: absolute; + text-align: center; +} + +.fa-layers { + display: inline-block; + height: 1em; + position: relative; + text-align: center; + vertical-align: -0.125em; + width: 1em; +} +.fa-layers svg.svg-inline--fa { + transform-origin: center center; +} + +.fa-layers-text { + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + transform-origin: center center; +} + +.fa-layers-counter { + background-color: var(--fa-counter-background-color, #ff253a); + border-radius: var(--fa-counter-border-radius, 1em); + box-sizing: border-box; + color: var(--fa-inverse, #fff); + line-height: var(--fa-counter-line-height, 1); + max-width: var(--fa-counter-max-width, 5em); + min-width: var(--fa-counter-min-width, 1.5em); + overflow: hidden; + padding: var(--fa-counter-padding, 0.25em 0.5em); + right: var(--fa-right, 0); + text-overflow: ellipsis; + top: var(--fa-top, 0); + transform: scale(var(--fa-counter-scale, 0.25)); + transform-origin: top right; +} + +.fa-layers-bottom-right { + bottom: var(--fa-bottom, 0); + right: var(--fa-right, 0); + top: auto; + transform: scale(var(--fa-layers-scale, 0.25)); + transform-origin: bottom right; +} + +.fa-layers-bottom-left { + bottom: var(--fa-bottom, 0); + left: var(--fa-left, 0); + right: auto; + top: auto; + transform: scale(var(--fa-layers-scale, 0.25)); + transform-origin: bottom left; +} + +.fa-layers-top-right { + top: var(--fa-top, 0); + right: var(--fa-right, 0); + transform: scale(var(--fa-layers-scale, 0.25)); + transform-origin: top right; +} + +.fa-layers-top-left { + left: var(--fa-left, 0); + right: auto; + top: var(--fa-top, 0); + transform: scale(var(--fa-layers-scale, 0.25)); + transform-origin: top left; +} + +.fa-1x { + font-size: 1em; +} + +.fa-2x { + font-size: 2em; +} + +.fa-3x { + font-size: 3em; +} + +.fa-4x { + font-size: 4em; +} + +.fa-5x { + font-size: 5em; +} + +.fa-6x { + font-size: 6em; +} + +.fa-7x { + font-size: 7em; +} + +.fa-8x { + font-size: 8em; +} + +.fa-9x { + font-size: 9em; +} + +.fa-10x { + font-size: 10em; +} + +.fa-2xs { + font-size: 0.625em; + line-height: 0.1em; + vertical-align: 0.225em; +} + +.fa-xs { + font-size: 0.75em; + line-height: 0.0833333337em; + vertical-align: 0.125em; +} + +.fa-sm { + font-size: 0.875em; + line-height: 0.0714285718em; + vertical-align: 0.0535714295em; +} + +.fa-lg { + font-size: 1.25em; + line-height: 0.05em; + vertical-align: -0.075em; +} + +.fa-xl { + font-size: 1.5em; + line-height: 0.0416666682em; + vertical-align: -0.125em; +} + +.fa-2xl { + font-size: 2em; + line-height: 0.03125em; + vertical-align: -0.1875em; +} + +.fa-fw { + text-align: center; + width: 1.25em; +} + +.fa-ul { + list-style-type: none; + margin-left: var(--fa-li-margin, 2.5em); + padding-left: 0; +} +.fa-ul > li { + position: relative; +} + +.fa-li { + left: calc(-1 * var(--fa-li-width, 2em)); + position: absolute; + text-align: center; + width: var(--fa-li-width, 2em); + line-height: inherit; +} + +.fa-border { + border-color: var(--fa-border-color, #eee); + border-radius: var(--fa-border-radius, 0.1em); + border-style: var(--fa-border-style, solid); + border-width: var(--fa-border-width, 0.08em); + padding: var(--fa-border-padding, 0.2em 0.25em 0.15em); +} + +.fa-pull-left { + float: left; + margin-right: var(--fa-pull-margin, 0.3em); +} + +.fa-pull-right { + float: right; + margin-left: var(--fa-pull-margin, 0.3em); +} + +.fa-beat { + animation-name: fa-beat; + animation-delay: var(--fa-animation-delay, 0s); + animation-direction: var(--fa-animation-direction, normal); + animation-duration: var(--fa-animation-duration, 1s); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-timing-function: var(--fa-animation-timing, ease-in-out); +} + +.fa-bounce { + animation-name: fa-bounce; + animation-delay: var(--fa-animation-delay, 0s); + animation-direction: var(--fa-animation-direction, normal); + animation-duration: var(--fa-animation-duration, 1s); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1)); +} + +.fa-fade { + animation-name: fa-fade; + animation-delay: var(--fa-animation-delay, 0s); + animation-direction: var(--fa-animation-direction, normal); + animation-duration: var(--fa-animation-duration, 1s); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); +} + +.fa-beat-fade { + animation-name: fa-beat-fade; + animation-delay: var(--fa-animation-delay, 0s); + animation-direction: var(--fa-animation-direction, normal); + animation-duration: var(--fa-animation-duration, 1s); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); +} + +.fa-flip { + animation-name: fa-flip; + animation-delay: var(--fa-animation-delay, 0s); + animation-direction: var(--fa-animation-direction, normal); + animation-duration: var(--fa-animation-duration, 1s); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-timing-function: var(--fa-animation-timing, ease-in-out); +} + +.fa-shake { + animation-name: fa-shake; + animation-delay: var(--fa-animation-delay, 0s); + animation-direction: var(--fa-animation-direction, normal); + animation-duration: var(--fa-animation-duration, 1s); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-timing-function: var(--fa-animation-timing, linear); +} + +.fa-spin { + animation-name: fa-spin; + animation-delay: var(--fa-animation-delay, 0s); + animation-direction: var(--fa-animation-direction, normal); + animation-duration: var(--fa-animation-duration, 2s); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-timing-function: var(--fa-animation-timing, linear); +} + +.fa-spin-reverse { + --fa-animation-direction: reverse; +} + +.fa-pulse, +.fa-spin-pulse { + animation-name: fa-spin; + animation-direction: var(--fa-animation-direction, normal); + animation-duration: var(--fa-animation-duration, 1s); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-timing-function: var(--fa-animation-timing, steps(8)); +} + +@media (prefers-reduced-motion: reduce) { + .fa-beat, +.fa-bounce, +.fa-fade, +.fa-beat-fade, +.fa-flip, +.fa-pulse, +.fa-shake, +.fa-spin, +.fa-spin-pulse { + animation-delay: -1ms; + animation-duration: 1ms; + animation-iteration-count: 1; + transition-delay: 0s; + transition-duration: 0s; + } +} +@keyframes fa-beat { + 0%, 90% { + transform: scale(1); + } + 45% { + transform: scale(var(--fa-beat-scale, 1.25)); + } +} +@keyframes fa-bounce { + 0% { + transform: scale(1, 1) translateY(0); + } + 10% { + transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0); + } + 30% { + transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em)); + } + 50% { + transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0); + } + 57% { + transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em)); + } + 64% { + transform: scale(1, 1) translateY(0); + } + 100% { + transform: scale(1, 1) translateY(0); + } +} +@keyframes fa-fade { + 50% { + opacity: var(--fa-fade-opacity, 0.4); + } +} +@keyframes fa-beat-fade { + 0%, 100% { + opacity: var(--fa-beat-fade-opacity, 0.4); + transform: scale(1); + } + 50% { + opacity: 1; + transform: scale(var(--fa-beat-fade-scale, 1.125)); + } +} +@keyframes fa-flip { + 50% { + transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg)); + } +} +@keyframes fa-shake { + 0% { + transform: rotate(-15deg); + } + 4% { + transform: rotate(15deg); + } + 8%, 24% { + transform: rotate(-18deg); + } + 12%, 28% { + transform: rotate(18deg); + } + 16% { + transform: rotate(-22deg); + } + 20% { + transform: rotate(22deg); + } + 32% { + transform: rotate(-12deg); + } + 36% { + transform: rotate(12deg); + } + 40%, 100% { + transform: rotate(0deg); + } +} +@keyframes fa-spin { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } +} +.fa-rotate-90 { + transform: rotate(90deg); +} + +.fa-rotate-180 { + transform: rotate(180deg); +} + +.fa-rotate-270 { + transform: rotate(270deg); +} + +.fa-flip-horizontal { + transform: scale(-1, 1); +} + +.fa-flip-vertical { + transform: scale(1, -1); +} + +.fa-flip-both, +.fa-flip-horizontal.fa-flip-vertical { + transform: scale(-1, -1); +} + +.fa-rotate-by { + transform: rotate(var(--fa-rotate-angle, 0)); +} + +.fa-stack { + display: inline-block; + vertical-align: middle; + height: 2em; + position: relative; + width: 2.5em; +} + +.fa-stack-1x, +.fa-stack-2x { + bottom: 0; + left: 0; + margin: auto; + position: absolute; + right: 0; + top: 0; + z-index: var(--fa-stack-z-index, auto); +} + +.svg-inline--fa.fa-stack-1x { + height: 1em; + width: 1.25em; +} +.svg-inline--fa.fa-stack-2x { + height: 2em; + width: 2.5em; +} + +.fa-inverse { + color: var(--fa-inverse, #fff); +} + +.sr-only, +.fa-sr-only { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; + border-width: 0; +} + +.sr-only-focusable:not(:focus), +.fa-sr-only-focusable:not(:focus) { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; + border-width: 0; +} + +.svg-inline--fa .fa-primary { + fill: var(--fa-primary-color, currentColor); + opacity: var(--fa-primary-opacity, 1); +} + +.svg-inline--fa .fa-secondary { + fill: var(--fa-secondary-color, currentColor); + opacity: var(--fa-secondary-opacity, 0.4); +} + +.svg-inline--fa.fa-swap-opacity .fa-primary { + opacity: var(--fa-secondary-opacity, 0.4); +} + +.svg-inline--fa.fa-swap-opacity .fa-secondary { + opacity: var(--fa-primary-opacity, 1); +} + +.svg-inline--fa mask .fa-primary, +.svg-inline--fa mask .fa-secondary { + fill: black; +} + +.fad.fa-inverse, +.fa-duotone.fa-inverse { + color: var(--fa-inverse, #fff); +}`;function jm(){const r=Pm,e=Om,t=W.cssPrefix,n=W.replacementClass;let i=Mx;if(t!==r||n!==e){const s=new RegExp("\\.".concat(r,"\\-"),"g"),o=new RegExp("\\--".concat(r,"\\-"),"g"),l=new RegExp("\\.".concat(e),"g");i=i.replace(s,".".concat(t,"-")).replace(o,"--".concat(t,"-")).replace(l,".".concat(n))}return i}let Gd=!1;function al(){W.autoAddCss&&!Gd&&(Dx(jm()),Gd=!0)}var Nx={mixout(){return{dom:{css:jm,insertCss:al}}},hooks(){return{beforeDOMElementCreation(){al()},beforeI2svg(){al()}}}};const fr=Br||{};fr[cr]||(fr[cr]={});fr[cr].styles||(fr[cr].styles={});fr[cr].hooks||(fr[cr].hooks={});fr[cr].shims||(fr[cr].shims=[]);var jt=fr[cr];const Gm=[],Hm=function(){ge.removeEventListener("DOMContentLoaded",Hm),Ko=1,Gm.map(r=>r())};let Ko=!1;hr&&(Ko=(ge.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(ge.readyState),Ko||ge.addEventListener("DOMContentLoaded",Hm));function Bx(r){hr&&(Ko?setTimeout(r,0):Gm.push(r))}function Ss(r){const{tag:e,attributes:t={},children:n=[]}=r;return typeof r=="string"?$m(r):"<".concat(e," ").concat(Px(t),">").concat(n.map(Ss).join(""),"")}function Hd(r,e,t){if(r&&r[e]&&r[e][t])return{prefix:e,iconName:t,icon:r[e][t]}}var ll=function(e,t,n,i){var s=Object.keys(e),o=s.length,l=t,a,u,c;for(n===void 0?(a=1,c=e[s[0]]):(a=0,c=n);a=55296&&i<=56319&&t=55296&&n<=56319&&t>e+1&&(i=r.charCodeAt(e+1),i>=56320&&i<=57343)?(n-55296)*1024+i-56320+65536:n}function zd(r){return Object.keys(r).reduce((e,t)=>{const n=r[t];return!!n.icon?e[n.iconName]=n.icon:e[t]=n,e},{})}function Du(r,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{skipHooks:n=!1}=t,i=zd(e);typeof jt.hooks.addPack=="function"&&!n?jt.hooks.addPack(r,zd(e)):jt.styles[r]={...jt.styles[r]||{},...i},r==="fas"&&Du("fa",e)}const{styles:Yr,shims:jx}=jt,Gx={[ve]:Object.values(rn[ve]),[st]:Object.values(rn[st]),[ot]:Object.values(rn[ot])};let rf=null,zm={},Vm={},Km={},Wm={},Ym={};const Hx={[ve]:Object.keys(tn[ve]),[st]:Object.keys(tn[st]),[ot]:Object.keys(tn[ot])};function zx(r){return~Rx.indexOf(r)}function Vx(r,e){const t=e.split("-"),n=t[0],i=t.slice(1).join("-");return n===r&&i!==""&&!zx(i)?i:null}const qm=()=>{const r=n=>ll(Yr,(i,s,o)=>(i[o]=ll(s,n,{}),i),{});zm=r((n,i,s)=>(i[3]&&(n[i[3]]=s),i[2]&&i[2].filter(l=>typeof l=="number").forEach(l=>{n[l.toString(16)]=s}),n)),Vm=r((n,i,s)=>(n[s]=s,i[2]&&i[2].filter(l=>typeof l=="string").forEach(l=>{n[l]=s}),n)),Ym=r((n,i,s)=>{const o=i[2];return n[s]=s,o.forEach(l=>{n[l]=s}),n});const e="far"in Yr||W.autoFetchSvg,t=ll(jx,(n,i)=>{const s=i[0];let o=i[1];const l=i[2];return o==="far"&&!e&&(o="fas"),typeof s=="string"&&(n.names[s]={prefix:o,iconName:l}),typeof s=="number"&&(n.unicodes[s.toString(16)]={prefix:o,iconName:l}),n},{names:{},unicodes:{}});Km=t.names,Wm=t.unicodes,rf=Ra(W.styleDefault,{family:W.familyDefault})};Cx(r=>{rf=Ra(r.styleDefault,{family:W.familyDefault})});qm();function nf(r,e){return(zm[r]||{})[e]}function Kx(r,e){return(Vm[r]||{})[e]}function Lr(r,e){return(Ym[r]||{})[e]}function Xm(r){return Km[r]||{prefix:null,iconName:null}}function Wx(r){const e=Wm[r],t=nf("fas",r);return e||(t?{prefix:"fas",iconName:t}:null)||{prefix:null,iconName:null}}function Ur(){return rf}const sf=()=>({prefix:null,iconName:null,rest:[]});function Ra(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{family:t=ve}=e,n=tn[t][r],i=cs[t][r]||cs[t][n],s=r in jt.styles?r:null;return i||s||null}const Yx={[ve]:Object.keys(rn[ve]),[st]:Object.keys(rn[st]),[ot]:Object.keys(rn[ot])};function Ia(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{skipLookups:t=!1}=e,n={[ve]:"".concat(W.cssPrefix,"-").concat(ve),[st]:"".concat(W.cssPrefix,"-").concat(st),[ot]:"".concat(W.cssPrefix,"-").concat(ot)};let i=null,s=ve;const o=rx.filter(a=>a!==Cm);o.forEach(a=>{(r.includes(n[a])||r.some(u=>Yx[a].includes(u)))&&(s=a)});const l=r.reduce((a,u)=>{const c=Vx(W.cssPrefix,u);if(Yr[u]?(u=Gx[s].includes(u)?Tx[s][u]:u,i=u,a.prefix=u):Hx[s].indexOf(u)>-1?(i=u,a.prefix=Ra(u,{family:s})):c?a.iconName=c:u!==W.replacementClass&&!o.some(f=>u===n[f])&&a.rest.push(u),!t&&a.prefix&&a.iconName){const f=i==="fa"?Xm(a.iconName):{},d=Lr(a.prefix,a.iconName);f.prefix&&(i=null),a.iconName=f.iconName||d||a.iconName,a.prefix=f.prefix||a.prefix,a.prefix==="far"&&!Yr.far&&Yr.fas&&!W.autoFetchSvg&&(a.prefix="fas")}return a},sf());return(r.includes("fa-brands")||r.includes("fab"))&&(l.prefix="fab"),(r.includes("fa-duotone")||r.includes("fad"))&&(l.prefix="fad"),!l.prefix&&s===st&&(Yr.fass||W.autoFetchSvg)&&(l.prefix="fass",l.iconName=Lr(l.prefix,l.iconName)||l.iconName),!l.prefix&&s===ot&&(Yr.fasds||W.autoFetchSvg)&&(l.prefix="fasds",l.iconName=Lr(l.prefix,l.iconName)||l.iconName),(l.prefix==="fa"||i==="fa")&&(l.prefix=Ur()||"fas"),l}class qx{constructor(){this.definitions={}}add(){for(var e=arguments.length,t=new Array(e),n=0;n{this.definitions[s]={...this.definitions[s]||{},...i[s]},Du(s,i[s]);const o=rn[ve][s];o&&Du(o,i[s]),qm()})}reset(){this.definitions={}}_pullDefinitions(e,t){const n=t.prefix&&t.iconName&&t.icon?{0:t}:t;return Object.keys(n).map(i=>{const{prefix:s,iconName:o,icon:l}=n[i],a=l[2];e[s]||(e[s]={}),a.length>0&&a.forEach(u=>{typeof u=="string"&&(e[s][u]=l)}),e[s][o]=l}),e}}let Vd=[],Fn={};const zn={},Xx=Object.keys(zn);function Zx(r,e){let{mixoutsTo:t}=e;return Vd=r,Fn={},Object.keys(zn).forEach(n=>{Xx.indexOf(n)===-1&&delete zn[n]}),Vd.forEach(n=>{const i=n.mixout?n.mixout():{};if(Object.keys(i).forEach(s=>{typeof i[s]=="function"&&(t[s]=i[s]),typeof i[s]=="object"&&Object.keys(i[s]).forEach(o=>{t[s]||(t[s]={}),t[s][o]=i[s][o]})}),n.hooks){const s=n.hooks();Object.keys(s).forEach(o=>{Fn[o]||(Fn[o]=[]),Fn[o].push(s[o])})}n.provides&&n.provides(zn)}),t}function _u(r,e){for(var t=arguments.length,n=new Array(t>2?t-2:0),i=2;i{e=o.apply(null,[e,...n])}),e}function fn(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n{s.apply(null,t)})}function $r(){const r=arguments[0],e=Array.prototype.slice.call(arguments,1);return zn[r]?zn[r].apply(null,e):void 0}function Pu(r){r.prefix==="fa"&&(r.prefix="fas");let{iconName:e}=r;const t=r.prefix||Ur();if(e)return e=Lr(t,e)||e,Hd(Zm.definitions,t,e)||Hd(jt.styles,t,e)}const Zm=new qx,Qx=()=>{W.autoReplaceSvg=!1,W.observeMutations=!1,fn("noAuto")},Jx={i2svg:function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return hr?(fn("beforeI2svg",r),$r("pseudoElements2svg",r),$r("i2svg",r)):Promise.reject(new Error("Operation requires a DOM of some kind."))},watch:function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{autoReplaceSvgRoot:e}=r;W.autoReplaceSvg===!1&&(W.autoReplaceSvg=!0),W.observeMutations=!0,Bx(()=>{tE({autoReplaceSvgRoot:e}),fn("watch",r)})}},eE={icon:r=>{if(r===null)return null;if(typeof r=="object"&&r.prefix&&r.iconName)return{prefix:r.prefix,iconName:Lr(r.prefix,r.iconName)||r.iconName};if(Array.isArray(r)&&r.length===2){const e=r[1].indexOf("fa-")===0?r[1].slice(3):r[1],t=Ra(r[0]);return{prefix:t,iconName:Lr(t,e)||e}}if(typeof r=="string"&&(r.indexOf("".concat(W.cssPrefix,"-"))>-1||r.match(wx))){const e=Ia(r.split(" "),{skipLookups:!0});return{prefix:e.prefix||Ur(),iconName:Lr(e.prefix,e.iconName)||e.iconName}}if(typeof r=="string"){const e=Ur();return{prefix:e,iconName:Lr(e,r)||r}}}},ct={noAuto:Qx,config:W,dom:Jx,parse:eE,library:Zm,findIconDefinition:Pu,toHtml:Ss},tE=function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{autoReplaceSvgRoot:e=ge}=r;(Object.keys(jt.styles).length>0||W.autoFetchSvg)&&hr&&W.autoReplaceSvg&&ct.dom.i2svg({node:e})};function ka(r,e){return Object.defineProperty(r,"abstract",{get:e}),Object.defineProperty(r,"html",{get:function(){return r.abstract.map(t=>Ss(t))}}),Object.defineProperty(r,"node",{get:function(){if(!hr)return;const t=ge.createElement("div");return t.innerHTML=r.html,t.children}}),r}function rE(r){let{children:e,main:t,mask:n,attributes:i,styles:s,transform:o}=r;if(tf(o)&&t.found&&!n.found){const{width:l,height:a}=t,u={x:l/a/2,y:.5};i.style=La({...s,"transform-origin":"".concat(u.x+o.x/16,"em ").concat(u.y+o.y/16,"em")})}return[{tag:"svg",attributes:i,children:e}]}function nE(r){let{prefix:e,iconName:t,children:n,attributes:i,symbol:s}=r;const o=s===!0?"".concat(e,"-").concat(W.cssPrefix,"-").concat(t):s;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:{...i,id:o},children:n}]}]}function of(r){const{icons:{main:e,mask:t},prefix:n,iconName:i,transform:s,symbol:o,title:l,maskId:a,titleId:u,extra:c,watchable:f=!1}=r,{width:d,height:h}=t.found?t:e,p=n==="fak",m=[W.replacementClass,i?"".concat(W.cssPrefix,"-").concat(i):""].filter(E=>c.classes.indexOf(E)===-1).filter(E=>E!==""||!!E).concat(c.classes).join(" ");let y={children:[],attributes:{...c.attributes,"data-prefix":n,"data-icon":i,class:m,role:c.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(d," ").concat(h)}};const g=p&&!~c.classes.indexOf("fa-fw")?{width:"".concat(d/h*16*.0625,"em")}:{};f&&(y.attributes[cn]=""),l&&(y.children.push({tag:"title",attributes:{id:y.attributes["aria-labelledby"]||"title-".concat(u||fs())},children:[l]}),delete y.attributes.title);const v={...y,prefix:n,iconName:i,main:e,mask:t,maskId:a,transform:s,symbol:o,styles:{...g,...c.styles}},{children:x,attributes:S}=t.found&&e.found?$r("generateAbstractMask",v)||{children:[],attributes:{}}:$r("generateAbstractIcon",v)||{children:[],attributes:{}};return v.children=x,v.attributes=S,o?nE(v):rE(v)}function Kd(r){const{content:e,width:t,height:n,transform:i,title:s,extra:o,watchable:l=!1}=r,a={...o.attributes,...s?{title:s}:{},class:o.classes.join(" ")};l&&(a[cn]="");const u={...o.styles};tf(i)&&(u.transform=Fx({transform:i,startCentered:!0,width:t,height:n}),u["-webkit-transform"]=u.transform);const c=La(u);c.length>0&&(a.style=c);const f=[];return f.push({tag:"span",attributes:a,children:[e]}),s&&f.push({tag:"span",attributes:{class:"sr-only"},children:[s]}),f}function iE(r){const{content:e,title:t,extra:n}=r,i={...n.attributes,...t?{title:t}:{},class:n.classes.join(" ")},s=La(n.styles);s.length>0&&(i.style=s);const o=[];return o.push({tag:"span",attributes:i,children:[e]}),t&&o.push({tag:"span",attributes:{class:"sr-only"},children:[t]}),o}const{styles:ul}=jt;function Ou(r){const e=r[0],t=r[1],[n]=r.slice(4);let i=null;return Array.isArray(n)?i={tag:"g",attributes:{class:"".concat(W.cssPrefix,"-").concat(ol.GROUP)},children:[{tag:"path",attributes:{class:"".concat(W.cssPrefix,"-").concat(ol.SECONDARY),fill:"currentColor",d:n[0]}},{tag:"path",attributes:{class:"".concat(W.cssPrefix,"-").concat(ol.PRIMARY),fill:"currentColor",d:n[1]}}]}:i={tag:"path",attributes:{fill:"currentColor",d:n}},{found:!0,width:e,height:t,icon:i}}const sE={found:!1,width:512,height:512};function oE(r,e){!Fm&&!W.showMissingIcons&&r&&console.error('Icon with name "'.concat(r,'" and prefix "').concat(e,'" is missing.'))}function Fu(r,e){let t=e;return e==="fa"&&W.styleDefault!==null&&(e=Ur()),new Promise((n,i)=>{if(t==="fa"){const s=Xm(r)||{};r=s.iconName||r,e=s.prefix||e}if(r&&e&&ul[e]&&ul[e][r]){const s=ul[e][r];return n(Ou(s))}oE(r,e),n({...sE,icon:W.showMissingIcons&&r?$r("missingIconAbstract")||{}:{}})})}const Wd=()=>{},Mu=W.measurePerformance&&$s&&$s.mark&&$s.measure?$s:{mark:Wd,measure:Wd},Pi='FA "6.6.0"',aE=r=>(Mu.mark("".concat(Pi," ").concat(r," begins")),()=>Qm(r)),Qm=r=>{Mu.mark("".concat(Pi," ").concat(r," ends")),Mu.measure("".concat(Pi," ").concat(r),"".concat(Pi," ").concat(r," begins"),"".concat(Pi," ").concat(r," ends"))};var af={begin:aE,end:Qm};const co=()=>{};function Yd(r){return typeof(r.getAttribute?r.getAttribute(cn):null)=="string"}function lE(r){const e=r.getAttribute?r.getAttribute(Qc):null,t=r.getAttribute?r.getAttribute(Jc):null;return e&&t}function uE(r){return r&&r.classList&&r.classList.contains&&r.classList.contains(W.replacementClass)}function cE(){return W.autoReplaceSvg===!0?fo.replace:fo[W.autoReplaceSvg]||fo.replace}function fE(r){return ge.createElementNS("http://www.w3.org/2000/svg",r)}function dE(r){return ge.createElement(r)}function Jm(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{ceFn:t=r.tag==="svg"?fE:dE}=e;if(typeof r=="string")return ge.createTextNode(r);const n=t(r.tag);return Object.keys(r.attributes||[]).forEach(function(s){n.setAttribute(s,r.attributes[s])}),(r.children||[]).forEach(function(s){n.appendChild(Jm(s,{ceFn:t}))}),n}function hE(r){let e=" ".concat(r.outerHTML," ");return e="".concat(e,"Font Awesome fontawesome.com "),e}const fo={replace:function(r){const e=r[0];if(e.parentNode)if(r[1].forEach(t=>{e.parentNode.insertBefore(Jm(t),e)}),e.getAttribute(cn)===null&&W.keepOriginalSource){let t=ge.createComment(hE(e));e.parentNode.replaceChild(t,e)}else e.remove()},nest:function(r){const e=r[0],t=r[1];if(~ef(e).indexOf(W.replacementClass))return fo.replace(r);const n=new RegExp("".concat(W.cssPrefix,"-.*"));if(delete t[0].attributes.id,t[0].attributes.class){const s=t[0].attributes.class.split(" ").reduce((o,l)=>(l===W.replacementClass||l.match(n)?o.toSvg.push(l):o.toNode.push(l),o),{toNode:[],toSvg:[]});t[0].attributes.class=s.toSvg.join(" "),s.toNode.length===0?e.removeAttribute("class"):e.setAttribute("class",s.toNode.join(" "))}const i=t.map(s=>Ss(s)).join(` +`);e.setAttribute(cn,""),e.innerHTML=i}};function qd(r){r()}function eg(r,e){const t=typeof e=="function"?e:co;if(r.length===0)t();else{let n=qd;W.mutateApproach===Ex&&(n=Br.requestAnimationFrame||qd),n(()=>{const i=cE(),s=af.begin("mutate");r.map(i),s(),t()})}}let lf=!1;function tg(){lf=!0}function Nu(){lf=!1}let Wo=null;function Xd(r){if(!Bd||!W.observeMutations)return;const{treeCallback:e=co,nodeCallback:t=co,pseudoElementsCallback:n=co,observeMutationsRoot:i=ge}=r;Wo=new Bd(s=>{if(lf)return;const o=Ur();ci(s).forEach(l=>{if(l.type==="childList"&&l.addedNodes.length>0&&!Yd(l.addedNodes[0])&&(W.searchPseudoElements&&n(l.target),e(l.target)),l.type==="attributes"&&l.target.parentNode&&W.searchPseudoElements&&n(l.target.parentNode),l.type==="attributes"&&Yd(l.target)&&~Lx.indexOf(l.attributeName))if(l.attributeName==="class"&&lE(l.target)){const{prefix:a,iconName:u}=Ia(ef(l.target));l.target.setAttribute(Qc,a||o),u&&l.target.setAttribute(Jc,u)}else uE(l.target)&&t(l.target)})}),hr&&Wo.observe(i,{childList:!0,attributes:!0,characterData:!0,subtree:!0})}function pE(){Wo&&Wo.disconnect()}function mE(r){const e=r.getAttribute("style");let t=[];return e&&(t=e.split(";").reduce((n,i)=>{const s=i.split(":"),o=s[0],l=s.slice(1);return o&&l.length>0&&(n[o]=l.join(":").trim()),n},{})),t}function gE(r){const e=r.getAttribute("data-prefix"),t=r.getAttribute("data-icon"),n=r.innerText!==void 0?r.innerText.trim():"";let i=Ia(ef(r));return i.prefix||(i.prefix=Ur()),e&&t&&(i.prefix=e,i.iconName=t),i.iconName&&i.prefix||(i.prefix&&n.length>0&&(i.iconName=Kx(i.prefix,r.innerText)||nf(i.prefix,Cu(r.innerText))),!i.iconName&&W.autoFetchSvg&&r.firstChild&&r.firstChild.nodeType===Node.TEXT_NODE&&(i.iconName=r.firstChild.data)),i}function yE(r){const e=ci(r.attributes).reduce((i,s)=>(i.name!=="class"&&i.name!=="style"&&(i[s.name]=s.value),i),{}),t=r.getAttribute("title"),n=r.getAttribute("data-fa-title-id");return W.autoA11y&&(t?e["aria-labelledby"]="".concat(W.replacementClass,"-title-").concat(n||fs()):(e["aria-hidden"]="true",e.focusable="false")),e}function vE(){return{iconName:null,title:null,titleId:null,prefix:null,transform:$t,symbol:!1,mask:{iconName:null,prefix:null,rest:[]},maskId:null,extra:{classes:[],styles:{},attributes:{}}}}function Zd(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{styleParser:!0};const{iconName:t,prefix:n,rest:i}=gE(r),s=yE(r),o=_u("parseNodeAttributes",{},r);let l=e.styleParser?mE(r):[];return{iconName:t,title:r.getAttribute("title"),titleId:r.getAttribute("data-fa-title-id"),prefix:n,transform:$t,mask:{iconName:null,prefix:null,rest:[]},maskId:null,symbol:!1,extra:{classes:i,styles:l,attributes:s},...o}}const{styles:xE}=jt;function rg(r){const e=W.autoReplaceSvg==="nest"?Zd(r,{styleParser:!1}):Zd(r);return~e.extra.classes.indexOf(Bm)?$r("generateLayersText",r,e):$r("generateSvgReplacementMutation",r,e)}let Wt=new Set;Mm.map(r=>{Wt.add("fa-".concat(r))});Object.keys(tn[ve]).map(Wt.add.bind(Wt));Object.keys(tn[st]).map(Wt.add.bind(Wt));Object.keys(tn[ot]).map(Wt.add.bind(Wt));Wt=[...Wt];function Qd(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!hr)return Promise.resolve();const t=ge.documentElement.classList,n=c=>t.add("".concat(jd,"-").concat(c)),i=c=>t.remove("".concat(jd,"-").concat(c)),s=W.autoFetchSvg?Wt:Mm.map(c=>"fa-".concat(c)).concat(Object.keys(xE));s.includes("fa")||s.push("fa");const o=[".".concat(Bm,":not([").concat(cn,"])")].concat(s.map(c=>".".concat(c,":not([").concat(cn,"])"))).join(", ");if(o.length===0)return Promise.resolve();let l=[];try{l=ci(r.querySelectorAll(o))}catch{}if(l.length>0)n("pending"),i("complete");else return Promise.resolve();const a=af.begin("onTree"),u=l.reduce((c,f)=>{try{const d=rg(f);d&&c.push(d)}catch(d){Fm||d.name==="MissingIcon"&&console.error(d)}return c},[]);return new Promise((c,f)=>{Promise.all(u).then(d=>{eg(d,()=>{n("active"),n("complete"),i("pending"),typeof e=="function"&&e(),a(),c()})}).catch(d=>{a(),f(d)})})}function EE(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;rg(r).then(t=>{t&&eg([t],e)})}function SE(r){return function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=(e||{}).icon?e:Pu(e||{});let{mask:i}=t;return i&&(i=(i||{}).icon?i:Pu(i||{})),r(n,{...t,mask:i})}}const TE=function(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{transform:t=$t,symbol:n=!1,mask:i=null,maskId:s=null,title:o=null,titleId:l=null,classes:a=[],attributes:u={},styles:c={}}=e;if(!r)return;const{prefix:f,iconName:d,icon:h}=r;return ka({type:"icon",...r},()=>(fn("beforeDOMElementCreation",{iconDefinition:r,params:e}),W.autoA11y&&(o?u["aria-labelledby"]="".concat(W.replacementClass,"-title-").concat(l||fs()):(u["aria-hidden"]="true",u.focusable="false")),of({icons:{main:Ou(h),mask:i?Ou(i.icon):{found:!1,width:null,height:null,icon:{}}},prefix:f,iconName:d,transform:{...$t,...t},symbol:n,title:o,maskId:s,titleId:l,extra:{attributes:u,styles:c,classes:a}})))};var wE={mixout(){return{icon:SE(TE)}},hooks(){return{mutationObserverCallbacks(r){return r.treeCallback=Qd,r.nodeCallback=EE,r}}},provides(r){r.i2svg=function(e){const{node:t=ge,callback:n=()=>{}}=e;return Qd(t,n)},r.generateSvgReplacementMutation=function(e,t){const{iconName:n,title:i,titleId:s,prefix:o,transform:l,symbol:a,mask:u,maskId:c,extra:f}=t;return new Promise((d,h)=>{Promise.all([Fu(n,o),u.iconName?Fu(u.iconName,u.prefix):Promise.resolve({found:!1,width:512,height:512,icon:{}})]).then(p=>{let[m,y]=p;d([e,of({icons:{main:m,mask:y},prefix:o,iconName:n,transform:l,symbol:a,maskId:c,title:i,titleId:s,extra:f,watchable:!0})])}).catch(h)})},r.generateAbstractIcon=function(e){let{children:t,attributes:n,main:i,transform:s,styles:o}=e;const l=La(o);l.length>0&&(n.style=l);let a;return tf(s)&&(a=$r("generateAbstractTransformGrouping",{main:i,transform:s,containerWidth:i.width,iconWidth:i.width})),t.push(a||i.icon),{children:t,attributes:n}}}},bE={mixout(){return{layer(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{classes:t=[]}=e;return ka({type:"layer"},()=>{fn("beforeDOMElementCreation",{assembler:r,params:e});let n=[];return r(i=>{Array.isArray(i)?i.map(s=>{n=n.concat(s.abstract)}):n=n.concat(i.abstract)}),[{tag:"span",attributes:{class:["".concat(W.cssPrefix,"-layers"),...t].join(" ")},children:n}]})}}}},AE={mixout(){return{counter(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{title:t=null,classes:n=[],attributes:i={},styles:s={}}=e;return ka({type:"counter",content:r},()=>(fn("beforeDOMElementCreation",{content:r,params:e}),iE({content:r.toString(),title:t,extra:{attributes:i,styles:s,classes:["".concat(W.cssPrefix,"-layers-counter"),...n]}})))}}}},LE={mixout(){return{text(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{transform:t=$t,title:n=null,classes:i=[],attributes:s={},styles:o={}}=e;return ka({type:"text",content:r},()=>(fn("beforeDOMElementCreation",{content:r,params:e}),Kd({content:r,transform:{...$t,...t},title:n,extra:{attributes:s,styles:o,classes:["".concat(W.cssPrefix,"-layers-text"),...i]}})))}}},provides(r){r.generateLayersText=function(e,t){const{title:n,transform:i,extra:s}=t;let o=null,l=null;if(km){const a=parseInt(getComputedStyle(e).fontSize,10),u=e.getBoundingClientRect();o=u.width/a,l=u.height/a}return W.autoA11y&&!n&&(s.attributes["aria-hidden"]="true"),Promise.resolve([e,Kd({content:e.innerHTML,width:o,height:l,transform:i,title:n,extra:s,watchable:!0})])}}};const RE=new RegExp('"',"ug"),Jd=[1105920,1112319],eh={FontAwesome:{normal:"fas",400:"fas"},...lx,...ax,...gx},Bu=Object.keys(eh).reduce((r,e)=>(r[e.toLowerCase()]=eh[e],r),{}),IE=Object.keys(Bu).reduce((r,e)=>{const t=Bu[e];return r[e]=t[900]||[...Object.entries(t)][0][1],r},{});function kE(r){const e=r.replace(RE,""),t=$x(e,0),n=t>=Jd[0]&&t<=Jd[1],i=e.length===2?e[0]===e[1]:!1;return{value:Cu(i?e[0]:e),isSecondary:n||i}}function CE(r,e){const t=r.replace(/^['"]|['"]$/g,"").toLowerCase(),n=parseInt(e),i=isNaN(n)?"normal":n;return(Bu[t]||{})[i]||IE[t]}function th(r,e){const t="".concat(xx).concat(e.replace(":","-"));return new Promise((n,i)=>{if(r.getAttribute(t)!==null)return n();const o=ci(r.children).filter(d=>d.getAttribute(Lu)===e)[0],l=Br.getComputedStyle(r,e),a=l.getPropertyValue("font-family"),u=a.match(bx),c=l.getPropertyValue("font-weight"),f=l.getPropertyValue("content");if(o&&!u)return r.removeChild(o),n();if(u&&f!=="none"&&f!==""){const d=l.getPropertyValue("content");let h=CE(a,c);const{value:p,isSecondary:m}=kE(d),y=u[0].startsWith("FontAwesome");let g=nf(h,p),v=g;if(y){const x=Wx(p);x.iconName&&x.prefix&&(g=x.iconName,h=x.prefix)}if(g&&!m&&(!o||o.getAttribute(Qc)!==h||o.getAttribute(Jc)!==v)){r.setAttribute(t,v),o&&r.removeChild(o);const x=vE(),{extra:S}=x;S.attributes[Lu]=e,Fu(g,h).then(E=>{const b=of({...x,icons:{main:E,mask:sf()},prefix:h,iconName:v,extra:S,watchable:!0}),w=ge.createElementNS("http://www.w3.org/2000/svg","svg");e==="::before"?r.insertBefore(w,r.firstChild):r.appendChild(w),w.outerHTML=b.map(A=>Ss(A)).join(` +`),r.removeAttribute(t),n()}).catch(i)}else n()}else n()})}function DE(r){return Promise.all([th(r,"::before"),th(r,"::after")])}function _E(r){return r.parentNode!==document.head&&!~Sx.indexOf(r.tagName.toUpperCase())&&!r.getAttribute(Lu)&&(!r.parentNode||r.parentNode.tagName!=="svg")}function rh(r){if(hr)return new Promise((e,t)=>{const n=ci(r.querySelectorAll("*")).filter(_E).map(DE),i=af.begin("searchPseudoElements");tg(),Promise.all(n).then(()=>{i(),Nu(),e()}).catch(()=>{i(),Nu(),t()})})}var PE={hooks(){return{mutationObserverCallbacks(r){return r.pseudoElementsCallback=rh,r}}},provides(r){r.pseudoElements2svg=function(e){const{node:t=ge}=e;W.searchPseudoElements&&rh(t)}}};let nh=!1;var OE={mixout(){return{dom:{unwatch(){tg(),nh=!0}}}},hooks(){return{bootstrap(){Xd(_u("mutationObserverCallbacks",{}))},noAuto(){pE()},watch(r){const{observeMutationsRoot:e}=r;nh?Nu():Xd(_u("mutationObserverCallbacks",{observeMutationsRoot:e}))}}}};const ih=r=>{let e={size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0};return r.toLowerCase().split(" ").reduce((t,n)=>{const i=n.toLowerCase().split("-"),s=i[0];let o=i.slice(1).join("-");if(s&&o==="h")return t.flipX=!0,t;if(s&&o==="v")return t.flipY=!0,t;if(o=parseFloat(o),isNaN(o))return t;switch(s){case"grow":t.size=t.size+o;break;case"shrink":t.size=t.size-o;break;case"left":t.x=t.x-o;break;case"right":t.x=t.x+o;break;case"up":t.y=t.y-o;break;case"down":t.y=t.y+o;break;case"rotate":t.rotate=t.rotate+o;break}return t},e)};var FE={mixout(){return{parse:{transform:r=>ih(r)}}},hooks(){return{parseNodeAttributes(r,e){const t=e.getAttribute("data-fa-transform");return t&&(r.transform=ih(t)),r}}},provides(r){r.generateAbstractTransformGrouping=function(e){let{main:t,transform:n,containerWidth:i,iconWidth:s}=e;const o={transform:"translate(".concat(i/2," 256)")},l="translate(".concat(n.x*32,", ").concat(n.y*32,") "),a="scale(".concat(n.size/16*(n.flipX?-1:1),", ").concat(n.size/16*(n.flipY?-1:1),") "),u="rotate(".concat(n.rotate," 0 0)"),c={transform:"".concat(l," ").concat(a," ").concat(u)},f={transform:"translate(".concat(s/2*-1," -256)")},d={outer:o,inner:c,path:f};return{tag:"g",attributes:{...d.outer},children:[{tag:"g",attributes:{...d.inner},children:[{tag:t.icon.tag,children:t.icon.children,attributes:{...t.icon.attributes,...d.path}}]}]}}}};const cl={x:0,y:0,width:"100%",height:"100%"};function sh(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return r.attributes&&(r.attributes.fill||e)&&(r.attributes.fill="black"),r}function ME(r){return r.tag==="g"?r.children:[r]}var NE={hooks(){return{parseNodeAttributes(r,e){const t=e.getAttribute("data-fa-mask"),n=t?Ia(t.split(" ").map(i=>i.trim())):sf();return n.prefix||(n.prefix=Ur()),r.mask=n,r.maskId=e.getAttribute("data-fa-mask-id"),r}}},provides(r){r.generateAbstractMask=function(e){let{children:t,attributes:n,main:i,mask:s,maskId:o,transform:l}=e;const{width:a,icon:u}=i,{width:c,icon:f}=s,d=Ox({transform:l,containerWidth:c,iconWidth:a}),h={tag:"rect",attributes:{...cl,fill:"white"}},p=u.children?{children:u.children.map(sh)}:{},m={tag:"g",attributes:{...d.inner},children:[sh({tag:u.tag,attributes:{...u.attributes,...d.path},...p})]},y={tag:"g",attributes:{...d.outer},children:[m]},g="mask-".concat(o||fs()),v="clip-".concat(o||fs()),x={tag:"mask",attributes:{...cl,id:g,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"},children:[h,y]},S={tag:"defs",children:[{tag:"clipPath",attributes:{id:v},children:ME(f)},x]};return t.push(S,{tag:"rect",attributes:{fill:"currentColor","clip-path":"url(#".concat(v,")"),mask:"url(#".concat(g,")"),...cl}}),{children:t,attributes:n}}}},BE={provides(r){let e=!1;Br.matchMedia&&(e=Br.matchMedia("(prefers-reduced-motion: reduce)").matches),r.missingIconAbstract=function(){const t=[],n={fill:"currentColor"},i={attributeType:"XML",repeatCount:"indefinite",dur:"2s"};t.push({tag:"path",attributes:{...n,d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"}});const s={...i,attributeName:"opacity"},o={tag:"circle",attributes:{...n,cx:"256",cy:"364",r:"28"},children:[]};return e||o.children.push({tag:"animate",attributes:{...i,attributeName:"r",values:"28;14;28;28;14;28;"}},{tag:"animate",attributes:{...s,values:"1;0;1;1;0;1;"}}),t.push(o),t.push({tag:"path",attributes:{...n,opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"},children:e?[]:[{tag:"animate",attributes:{...s,values:"1;0;0;0;0;1;"}}]}),e||t.push({tag:"path",attributes:{...n,opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"},children:[{tag:"animate",attributes:{...s,values:"0;0;1;1;0;0;"}}]}),{tag:"g",attributes:{class:"missing"},children:t}}}},UE={hooks(){return{parseNodeAttributes(r,e){const t=e.getAttribute("data-fa-symbol"),n=t===null?!1:t===""?!0:t;return r.symbol=n,r}}}},$E=[Nx,wE,bE,AE,LE,PE,OE,FE,NE,BE,UE];Zx($E,{mixoutsTo:ct});ct.noAuto;ct.config;ct.library;ct.dom;const Uu=ct.parse;ct.findIconDefinition;ct.toHtml;const jE=ct.icon;ct.layer;ct.text;ct.counter;var ng={exports:{}},GE="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",HE=GE,zE=HE;function ig(){}function sg(){}sg.resetWarningCache=ig;var VE=function(){function r(n,i,s,o,l,a){if(a!==zE){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}r.isRequired=r;function e(){return r}var t={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:e,element:r,elementType:r,instanceOf:e,node:r,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:sg,resetWarningCache:ig};return t.PropTypes=t,t};ng.exports=VE();var KE=ng.exports;const ee=ua(KE);function oh(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Nt(r){for(var e=1;e=0)&&(t[i]=r[i]);return t}function YE(r,e){if(r==null)return{};var t=WE(r,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(r);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}function $u(r){return qE(r)||XE(r)||ZE(r)||QE()}function qE(r){if(Array.isArray(r))return ju(r)}function XE(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function ZE(r,e){if(r){if(typeof r=="string")return ju(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return ju(r,e)}}function ju(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t2&&arguments[2]!==void 0?arguments[2]:{};if(typeof e=="string")return e;var n=(e.children||[]).map(function(a){return ag(r,a)}),i=Object.keys(e.attributes||{}).reduce(function(a,u){var c=e.attributes[u];switch(u){case"class":a.attrs.className=c,delete e.attributes.class;break;case"style":a.attrs.style=nS(c);break;default:u.indexOf("aria-")===0||u.indexOf("data-")===0?a.attrs[u.toLowerCase()]=c:a.attrs[og(u)]=c}return a},{attrs:{}}),s=t.style,o=s===void 0?{}:s,l=YE(t,tS);return i.attrs.style=Nt(Nt({},i.attrs.style),o),r.apply(void 0,[e.tag,Nt(Nt({},i.attrs),l)].concat($u(n)))}var lg=!1;try{lg=!0}catch{}function iS(){if(!lg&&console&&typeof console.error=="function"){var r;(r=console).error.apply(r,arguments)}}function ah(r){if(r&&Yo(r)==="object"&&r.prefix&&r.iconName&&r.icon)return r;if(Uu.icon)return Uu.icon(r);if(r===null)return null;if(r&&Yo(r)==="object"&&r.prefix&&r.iconName)return r;if(Array.isArray(r)&&r.length===2)return{prefix:r[0],iconName:r[1]};if(typeof r=="string")return{prefix:"fas",iconName:r}}function fl(r,e){return Array.isArray(e)&&e.length>0||!Array.isArray(e)&&e?Mn({},r,e):{}}var lh={border:!1,className:"",mask:null,maskId:null,fixedWidth:!1,inverse:!1,flip:!1,icon:null,listItem:!1,pull:null,pulse:!1,rotation:null,size:null,spin:!1,spinPulse:!1,spinReverse:!1,beat:!1,fade:!1,beatFade:!1,bounce:!1,shake:!1,symbol:!1,title:"",titleId:null,transform:null,swapOpacity:!1},ri=Tp.forwardRef(function(r,e){var t=Nt(Nt({},lh),r),n=t.icon,i=t.mask,s=t.symbol,o=t.className,l=t.title,a=t.titleId,u=t.maskId,c=ah(n),f=fl("classes",[].concat($u(JE(t)),$u((o||"").split(" ")))),d=fl("transform",typeof t.transform=="string"?Uu.transform(t.transform):t.transform),h=fl("mask",ah(i)),p=jE(c,Nt(Nt(Nt(Nt({},f),d),h),{},{symbol:s,title:l,titleId:a,maskId:u}));if(!p)return iS("Could not find icon",c),null;var m=p.abstract,y={ref:e};return Object.keys(t).forEach(function(g){lh.hasOwnProperty(g)||(y[g]=t[g])}),sS(m[0],y)});ri.displayName="FontAwesomeIcon";ri.propTypes={beat:ee.bool,border:ee.bool,beatFade:ee.bool,bounce:ee.bool,className:ee.string,fade:ee.bool,flash:ee.bool,mask:ee.oneOfType([ee.object,ee.array,ee.string]),maskId:ee.string,fixedWidth:ee.bool,inverse:ee.bool,flip:ee.oneOf([!0,!1,"horizontal","vertical","both"]),icon:ee.oneOfType([ee.object,ee.array,ee.string]),listItem:ee.bool,pull:ee.oneOf(["right","left"]),pulse:ee.bool,rotation:ee.oneOf([0,90,180,270]),shake:ee.bool,size:ee.oneOf(["2xs","xs","sm","lg","xl","2xl","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x"]),spin:ee.bool,spinPulse:ee.bool,spinReverse:ee.bool,symbol:ee.oneOfType([ee.bool,ee.string]),title:ee.string,titleId:ee.string,transform:ee.oneOfType([ee.string,ee.object]),swapOpacity:ee.bool};var sS=ag.bind(null,Tp.createElement);const oS={prefix:"fas",iconName:"upload",icon:[512,512,[],"f093","M288 109.3L288 352c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-242.7-73.4 73.4c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l128-128c12.5-12.5 32.8-12.5 45.3 0l128 128c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L288 109.3zM64 352l128 0c0 35.3 28.7 64 64 64s64-28.7 64-64l128 0c35.3 0 64 28.7 64 64l0 32c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64l0-32c0-35.3 28.7-64 64-64zM432 456a24 24 0 1 0 0-48 24 24 0 1 0 0 48z"]},aS={prefix:"fas",iconName:"sun",icon:[512,512,[9728],"f185","M361.5 1.2c5 2.1 8.6 6.6 9.6 11.9L391 121l107.9 19.8c5.3 1 9.8 4.6 11.9 9.6s1.5 10.7-1.6 15.2L446.9 256l62.3 90.3c3.1 4.5 3.7 10.2 1.6 15.2s-6.6 8.6-11.9 9.6L391 391 371.1 498.9c-1 5.3-4.6 9.8-9.6 11.9s-10.7 1.5-15.2-1.6L256 446.9l-90.3 62.3c-4.5 3.1-10.2 3.7-15.2 1.6s-8.6-6.6-9.6-11.9L121 391 13.1 371.1c-5.3-1-9.8-4.6-11.9-9.6s-1.5-10.7 1.6-15.2L65.1 256 2.8 165.7c-3.1-4.5-3.7-10.2-1.6-15.2s6.6-8.6 11.9-9.6L121 121 140.9 13.1c1-5.3 4.6-9.8 9.6-11.9s10.7-1.5 15.2 1.6L256 65.1 346.3 2.8c4.5-3.1 10.2-3.7 15.2-1.6zM160 256a96 96 0 1 1 192 0 96 96 0 1 1 -192 0zm224 0a128 128 0 1 0 -256 0 128 128 0 1 0 256 0z"]},ug={prefix:"fas",iconName:"play",icon:[384,512,[9654],"f04b","M73 39c-14.8-9.1-33.4-9.4-48.5-.9S0 62.6 0 80L0 432c0 17.4 9.4 33.4 24.5 41.9s33.7 8.1 48.5-.9L361 297c14.3-8.7 23-24.2 23-41s-8.7-32.2-23-41L73 39z"]},lS={prefix:"fas",iconName:"moon",icon:[384,512,[127769,9214],"f186","M223.5 32C100 32 0 132.3 0 256S100 480 223.5 480c60.6 0 115.5-24.2 155.8-63.4c5-4.9 6.3-12.5 3.1-18.7s-10.1-9.7-17-8.5c-9.8 1.7-19.8 2.6-30.1 2.6c-96.9 0-175.5-78.8-175.5-176c0-65.8 36-123.1 89.3-153.3c6.1-3.5 9.2-10.5 7.7-17.3s-7.3-11.9-14.3-12.5c-6.3-.5-12.6-.8-19-.8z"]},uS=({darkMode:r,toggleDarkMode:e})=>te.jsx("header",{className:`${r?"bg-gray-800":"bg-white"} p-6 shadow-lg rounded-lg mb-8 transition-colors duration-300`,children:te.jsxs("div",{className:"container mx-auto flex justify-between items-center",children:[te.jsxs("div",{className:"flex items-center",children:[te.jsx("div",{className:`${r?"bg-purple-600":"bg-purple-500"} p-3 rounded-full mr-4`,children:te.jsx(ri,{icon:ug,className:"text-white text-2xl"})}),te.jsxs("div",{children:[te.jsx("h1",{className:`text-3xl font-bold ${r?"text-purple-400":"text-purple-600"}`,children:"Ani-Player"}),te.jsx("p",{className:`text-sm ${r?"text-gray-400":"text-gray-600"}`,children:"Your Ultimate Video Experience"})]})]}),te.jsx("button",{onClick:e,className:`p-3 ${r?"bg-gray-800 hover:bg-gray-700":"bg-gray-200 hover:bg-gray-300"} rounded-full transition-colors duration-300 focus:outline-none focus:ring-2 focus:ring-purple-500`,"aria-label":r?"Switch to light mode":"Switch to dark mode",children:te.jsx(ri,{icon:r?aS:lS,className:`text-xl ${r?"text-yellow-400":"text-gray-800"}`})})]})}),cS=({inputUrl:r,handleInputChange:e,handlePlay:t,handleFileUpload:n,darkMode:i})=>te.jsx("div",{className:"flex flex-col gap-4 mb-6",children:te.jsxs("div",{className:"flex p-4 flex-col gap-4 sm:flex-row",children:[te.jsx("input",{type:"text",placeholder:"Enter video URL",value:r,onChange:e,onKeyDown:s=>s.key==="Enter"&&t(),className:`flex-grow p-3 border-2 ${i?"border-purple-500 bg-gray-700":"border-purple-300 bg-white"} rounded-lg text-base focus:outline-none focus:ring-2 focus:ring-purple-400 transition-colors duration-300`}),te.jsxs("div",{className:"flex justify-center gap-3",children:[te.jsxs("button",{onClick:t,className:`flex items-center justify-center gap-2 p-3 ${i?"bg-purple-600 hover:bg-purple-700":"bg-purple-500 hover:bg-purple-600"} text-white rounded-lg text-base font-medium transition-colors duration-300 shadow-lg`,children:[te.jsx(ri,{icon:ug}),"Play"]}),te.jsx("input",{type:"file",id:"file-upload",accept:"video/*",onChange:n,className:"hidden"}),te.jsxs("label",{htmlFor:"file-upload",className:`flex items-center justify-center gap-2 p-3 ${i?"bg-blue-600 hover:bg-blue-700":"bg-blue-500 hover:bg-blue-600"} text-white rounded-lg text-base font-medium transition-colors duration-300 shadow-lg cursor-pointer`,children:[te.jsx(ri,{icon:oS}),"Upload Video"]})]})]})}),fS=({darkMode:r})=>te.jsx("footer",{className:`${r?"bg-gray-800 text-gray-400":"bg-white text-gray-600"} p-4 text-center mt-8 text-sm absolute bottom-0 w-full`,children:te.jsxs("p",{children:["Made with ❤️ by"," ",te.jsx("a",{href:"https://github.com/chinxcode",className:"text-blue-400",children:"Sachin Sharma"})]})});function qo(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Xo={exports:{}};Xo.exports;(function(r,e){/*! + * artplayer.js v5.1.7 + * Github: https://github.com/zhw2590582/ArtPlayer + * (c) 2017-2024 Harvey Zack + * Released under the MIT License. + */(function(t,n,i,s,o){var l=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof So<"u"?So:{},a=typeof l[s]=="function"&&l[s],u=a.cache||{},c=typeof qo=="function"&&qo.bind(r);function f(p,m){if(!u[p]){if(!t[p]){var y=typeof l[s]=="function"&&l[s];if(!m&&y)return y(p,!0);if(a)return a(p,!0);if(c&&typeof p=="string")return c(p);var g=Error("Cannot find module '"+p+"'");throw g.code="MODULE_NOT_FOUND",g}x.resolve=function(S){var E=t[p][1][S];return E??S},x.cache={};var v=u[p]=new f.Module(p);t[p][0].call(v.exports,x,v,v.exports,this)}return u[p].exports;function x(S){var E=x.resolve(S);return E===!1?{}:f(E)}}f.isParcelRequire=!0,f.Module=function(p){this.id=p,this.bundle=f,this.exports={}},f.modules=t,f.cache=u,f.parent=a,f.register=function(p,m){t[p]=[function(y,g){g.exports=m},{}]},Object.defineProperty(f,"root",{get:function(){return l[s]}}),l[s]=f;for(var d=0;dmn.call(this,this)),Z.DEBUG){let mr=Xt=>console.log(`[ART.${this.id}] -> ${Xt}`);mr("Version@"+Z.version),mr("Env@"+Z.env),mr("Build@"+Z.build);for(let Xt=0;Xtmr("Event@"+yi.type))}pr.push(this)}static get instances(){return pr}static get version(){return"5.1.7"}static get env(){return"production"}static get build(){return"2024-08-15 23:27:07"}static get config(){return y.default}static get utils(){return d}static get scheme(){return p.default}static get Emitter(){return f.default}static get validator(){return u.default}static get kindOf(){return u.default.kindOf}static get html(){return v.default.html}static get option(){return{id:"",container:"#artplayer",url:"",poster:"",type:"",theme:"#f00",volume:.7,isLive:!1,muted:!1,autoplay:!1,autoSize:!1,autoMini:!1,loop:!1,flip:!1,playbackRate:!1,aspectRatio:!1,screenshot:!1,setting:!1,hotkey:!0,pip:!1,mutex:!0,backdrop:!0,fullscreen:!1,fullscreenWeb:!1,subtitleOffset:!1,miniProgressBar:!1,useSSR:!1,playsInline:!0,lock:!1,fastForward:!1,autoPlayback:!1,autoOrientation:!1,airplay:!1,layers:[],contextmenu:[],controls:[],settings:[],quality:[],highlight:[],plugins:[],thumbnails:{url:"",number:60,column:10,width:0,height:0},subtitle:{url:"",type:"",style:{},name:"",escape:!0,encoding:"utf-8",onVttLoad:_t=>_t},moreVideoAttr:{controls:!1,preload:d.isSafari?"auto":"metadata"},i18n:{},icons:{},cssVar:{},customType:{},lang:navigator.language.toLowerCase()}}get proxy(){return this.events.proxy}get query(){return this.template.query}get video(){return this.template.$video}destroy(_t=!0){this.events.destroy(),this.template.destroy(_t),pr.splice(pr.indexOf(this),1),this.isDestroy=!0,this.emit("destroy")}}i.default=Z,Z.STYLE=l.default,Z.DEBUG=!1,Z.CONTEXTMENU=!0,Z.NOTICE_TIME=2e3,Z.SETTING_WIDTH=250,Z.SETTING_ITEM_WIDTH=200,Z.SETTING_ITEM_HEIGHT=35,Z.RESIZE_TIME=200,Z.SCROLL_TIME=200,Z.SCROLL_GAP=50,Z.AUTO_PLAYBACK_MAX=10,Z.AUTO_PLAYBACK_MIN=5,Z.AUTO_PLAYBACK_TIMEOUT=3e3,Z.RECONNECT_TIME_MAX=5,Z.RECONNECT_SLEEP_TIME=1e3,Z.CONTROL_HIDE_TIME=3e3,Z.DBCLICK_TIME=300,Z.DBCLICK_FULLSCREEN=!0,Z.MOBILE_DBCLICK_PLAY=!0,Z.MOBILE_CLICK_PLAY=!1,Z.AUTO_ORIENTATION_TIME=200,Z.INFO_LOOP_TIME=1e3,Z.FAST_FORWARD_VALUE=3,Z.FAST_FORWARD_TIME=1e3,Z.TOUCH_MOVE_RATIO=.5,Z.VOLUME_STEP=.1,Z.SEEK_STEP=5,Z.PLAYBACK_RATE=[.5,.75,1,1.25,1.5,2],Z.ASPECT_RATIO=["default","4:3","16:9"],Z.FLIP=["normal","horizontal","vertical"],Z.FULLSCREEN_WEB_IN_BODY=!1,Z.LOG_VERSION=!0,Z.USE_RAF=!1,d.isBrowser&&(window.Artplayer=Z,d.setStyleText("artplayer-style",l.default),setTimeout(()=>{Z.LOG_VERSION&&console.log(`%c ArtPlayer %c ${Z.version} %c https://artplayer.org`,"color: #fff; background: #5f5f5f","color: #fff; background: #4bc729","")},100))},{"bundle-text:./style/index.less":"kfOe8","option-validator":"9I0i9","./utils/emitter":"2bGVu","./utils":"h3rH9","./scheme":"AdvwB","./config":"9Xmqu","./template":"2gKYH","./i18n":"1AdeF","./player":"556MW","./control":"14IBq","./contextmenu":"7iUum","./info":"hD2Lg","./subtitle":"lum0D","./events":"1Epl5","./hotkey":"eTow4","./layer":"4fDoD","./loading":"fE0Sp","./notice":"9PuGy","./mask":"2etr0","./icons":"6dYSr","./setting":"bRHiA","./storage":"f2Thp","./plugins":"96ThS","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],kfOe8:[function(t,n,i){n.exports='.art-video-player{--art-theme:red;--art-font-color:#fff;--art-background-color:#000;--art-text-shadow-color:#00000080;--art-transition-duration:.2s;--art-padding:10px;--art-border-radius:3px;--art-progress-height:6px;--art-progress-color:#ffffff40;--art-hover-color:#ffffff40;--art-loaded-color:#ffffff40;--art-state-size:80px;--art-state-opacity:.8;--art-bottom-height:100px;--art-bottom-offset:20px;--art-bottom-gap:5px;--art-highlight-width:8px;--art-highlight-color:#ffffff80;--art-control-height:46px;--art-control-opacity:.75;--art-control-icon-size:36px;--art-control-icon-scale:1.1;--art-volume-height:120px;--art-volume-handle-size:14px;--art-lock-size:36px;--art-indicator-scale:0;--art-indicator-size:16px;--art-fullscreen-web-index:9999;--art-settings-icon-size:24px;--art-settings-max-height:300px;--art-selector-max-height:300px;--art-contextmenus-min-width:250px;--art-subtitle-font-size:20px;--art-subtitle-gap:5px;--art-subtitle-bottom:15px;--art-subtitle-border:#000;--art-widget-background:#000000d9;--art-tip-background:#000000b3;--art-scrollbar-size:4px;--art-scrollbar-background:#ffffff40;--art-scrollbar-background-hover:#ffffff80;--art-mini-progress-height:2px}.art-bg-cover{background-position:50%;background-repeat:no-repeat;background-size:cover}.art-bottom-gradient{background-image:linear-gradient(#0000,#0006,#000);background-position:bottom;background-repeat:repeat-x}.art-backdrop-filter{backdrop-filter:saturate(180%)blur(20px);background-color:#000000bf!important}.art-truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.art-video-player{zoom:1;text-align:left;user-select:none;box-sizing:border-box;color:var(--art-font-color);background-color:var(--art-background-color);text-shadow:0 0 2px var(--art-text-shadow-color);-webkit-tap-highlight-color:#0000;-ms-touch-action:manipulation;touch-action:manipulation;-ms-high-contrast-adjust:none;direction:ltr;outline:0;width:100%;height:100%;margin:0 auto;padding:0;font-family:PingFang SC,Helvetica Neue,Microsoft YaHei,Roboto,Arial,sans-serif;font-size:14px;line-height:1.3;position:relative}.art-video-player *,.art-video-player :before,.art-video-player :after{box-sizing:border-box}.art-video-player ::-webkit-scrollbar{width:var(--art-scrollbar-size);height:var(--art-scrollbar-size)}.art-video-player ::-webkit-scrollbar-thumb{background-color:var(--art-scrollbar-background)}.art-video-player ::-webkit-scrollbar-thumb:hover{background-color:var(--art-scrollbar-background-hover)}.art-video-player img{vertical-align:top;max-width:100%}.art-video-player svg{fill:var(--art-font-color)}.art-video-player a{color:var(--art-font-color);text-decoration:none}.art-icon{justify-content:center;align-items:center;line-height:1;display:flex}.art-video-player.art-backdrop .art-contextmenus,.art-video-player.art-backdrop .art-info,.art-video-player.art-backdrop .art-settings,.art-video-player.art-backdrop .art-layer-auto-playback,.art-video-player.art-backdrop .art-selector-list,.art-video-player.art-backdrop .art-volume-inner{backdrop-filter:saturate(180%)blur(20px);background-color:#000000bf!important}.art-video{z-index:10;cursor:pointer;width:100%;height:100%;position:absolute;inset:0}.art-poster{z-index:11;pointer-events:none;background-position:50%;background-repeat:no-repeat;background-size:cover;width:100%;height:100%;position:absolute;inset:0}.art-video-player .art-subtitle{z-index:20;text-align:center;pointer-events:none;justify-content:center;align-items:center;gap:var(--art-subtitle-gap);bottom:var(--art-subtitle-bottom);font-size:var(--art-subtitle-font-size);transition:bottom var(--art-transition-duration)ease;text-shadow:var(--art-subtitle-border)1px 0 1px,var(--art-subtitle-border)0 1px 1px,var(--art-subtitle-border)-1px 0 1px,var(--art-subtitle-border)0 -1px 1px,var(--art-subtitle-border)1px 1px 1px,var(--art-subtitle-border)-1px -1px 1px,var(--art-subtitle-border)1px -1px 1px,var(--art-subtitle-border)-1px 1px 1px;flex-direction:column;width:100%;padding:0 5%;display:none;position:absolute}.art-video-player.art-subtitle-show .art-subtitle{display:flex}.art-video-player.art-control-show .art-subtitle{bottom:calc(var(--art-control-height) + var(--art-subtitle-bottom))}.art-danmuku{z-index:30;pointer-events:none;width:100%;height:100%;position:absolute;inset:0;overflow:hidden}.art-video-player .art-layers{z-index:40;pointer-events:none;width:100%;height:100%;display:none;position:absolute;inset:0}.art-video-player .art-layers .art-layer{pointer-events:auto}.art-video-player.art-layer-show .art-layers{display:flex}.art-video-player .art-mask{z-index:50;pointer-events:none;justify-content:center;align-items:center;width:100%;height:100%;display:flex;position:absolute;inset:0}.art-video-player .art-mask .art-state{opacity:0;width:var(--art-state-size);height:var(--art-state-size);transition:all var(--art-transition-duration)ease;justify-content:center;align-items:center;display:flex;transform:scale(2)}.art-video-player.art-mask-show .art-state{cursor:pointer;pointer-events:auto;opacity:var(--art-state-opacity);transform:scale(1)}.art-video-player.art-loading-show .art-state{display:none}.art-video-player .art-loading{z-index:70;pointer-events:none;justify-content:center;align-items:center;width:100%;height:100%;display:none;position:absolute;inset:0}.art-video-player.art-loading-show .art-loading{display:flex}.art-video-player .art-bottom{z-index:60;opacity:0;pointer-events:none;padding:0 var(--art-padding);transition:all var(--art-transition-duration)ease;background-size:100% var(--art-bottom-height);background-image:linear-gradient(#0000,#0006,#000);background-position:bottom;background-repeat:repeat-x;flex-direction:column;justify-content:flex-end;width:100%;height:100%;display:flex;position:absolute;inset:0;overflow:hidden}.art-video-player .art-bottom .art-controls,.art-video-player .art-bottom .art-progress{transform:translateY(var(--art-bottom-offset));transition:transform var(--art-transition-duration)ease}.art-video-player.art-control-show .art-bottom,.art-video-player.art-hover .art-bottom{opacity:1}.art-video-player.art-control-show .art-bottom .art-controls,.art-video-player.art-hover .art-bottom .art-controls,.art-video-player.art-control-show .art-bottom .art-progress,.art-video-player.art-hover .art-bottom .art-progress{transform:translateY(0)}.art-bottom .art-progress{z-index:0;pointer-events:auto;padding-bottom:var(--art-bottom-gap);position:relative}.art-bottom .art-progress .art-control-progress{cursor:pointer;height:var(--art-progress-height);justify-content:center;align-items:center;display:flex;position:relative}.art-bottom .art-progress .art-control-progress .art-control-progress-inner{transition:height var(--art-transition-duration)ease;background-color:var(--art-progress-color);align-items:center;width:100%;height:50%;display:flex;position:relative}.art-bottom .art-progress .art-control-progress .art-control-progress-inner .art-progress-hover{z-index:0;background-color:var(--art-hover-color);width:0%;height:100%;position:absolute;inset:0}.art-bottom .art-progress .art-control-progress .art-control-progress-inner .art-progress-loaded{z-index:10;background-color:var(--art-loaded-color);width:0%;height:100%;position:absolute;inset:0}.art-bottom .art-progress .art-control-progress .art-control-progress-inner .art-progress-played{z-index:20;background-color:var(--art-theme);width:0%;height:100%;position:absolute;inset:0}.art-bottom .art-progress .art-control-progress .art-control-progress-inner .art-progress-highlight{z-index:30;pointer-events:none;width:100%;height:100%;position:absolute;inset:0}.art-bottom .art-progress .art-control-progress .art-control-progress-inner .art-progress-highlight span{z-index:0;pointer-events:auto;transform:translateX(calc(var(--art-highlight-width)/-2));background-color:var(--art-highlight-color);width:100%;height:100%;position:absolute;inset:0 auto 0 0;width:var(--art-highlight-width)!important}.art-bottom .art-progress .art-control-progress .art-control-progress-inner .art-progress-indicator{z-index:40;width:var(--art-indicator-size);height:var(--art-indicator-size);transform:scale(var(--art-indicator-scale));margin-left:calc(var(--art-indicator-size)/-2);transition:transform var(--art-transition-duration)ease;border-radius:50%;justify-content:center;align-items:center;display:flex;position:absolute;left:0}.art-bottom .art-progress .art-control-progress .art-control-progress-inner .art-progress-indicator .art-icon{pointer-events:none;width:100%;height:100%}.art-bottom .art-progress .art-control-progress .art-control-progress-inner .art-progress-indicator:hover{transform:scale(1.2)!important}.art-bottom .art-progress .art-control-progress .art-control-progress-inner .art-progress-indicator:active{transform:scale(1)!important}.art-bottom .art-progress .art-control-progress .art-control-progress-inner .art-progress-tip{z-index:50;border-radius:var(--art-border-radius);white-space:nowrap;background-color:var(--art-tip-background);padding:3px 5px;font-size:12px;line-height:1;display:none;position:absolute;top:-25px;left:0}.art-bottom .art-progress .art-control-progress:hover .art-control-progress-inner{height:100%}.art-bottom .art-progress .art-control-thumbnails{bottom:calc(var(--art-bottom-gap) + 10px);border-radius:var(--art-border-radius);pointer-events:none;background-color:var(--art-widget-background);display:none;position:absolute;left:0;box-shadow:0 1px 3px #0003,0 1px 2px -1px #0003}.art-bottom:hover .art-progress .art-control-progress .art-control-progress-inner .art-progress-indicator{transform:scale(1)}.art-controls{z-index:10;pointer-events:auto;height:var(--art-control-height);justify-content:space-between;align-items:center;display:flex;position:relative}.art-controls .art-controls-left,.art-controls .art-controls-right{height:100%;display:flex}.art-controls .art-controls-center{flex:1;justify-content:center;align-items:center;height:100%;padding:0 10px;display:none}.art-controls .art-controls-right{justify-content:flex-end}.art-controls .art-control{cursor:pointer;white-space:nowrap;opacity:var(--art-control-opacity);min-height:var(--art-control-height);min-width:var(--art-control-height);transition:opacity var(--art-transition-duration)ease;flex-shrink:0;justify-content:center;align-items:center;display:flex}.art-controls .art-control .art-icon{height:var(--art-control-icon-size);width:var(--art-control-icon-size);transform:scale(var(--art-control-icon-scale));transition:transform var(--art-transition-duration)ease}.art-controls .art-control .art-icon:active{transform:scale(calc(var(--art-control-icon-scale)*.8))}.art-controls .art-control:hover{opacity:1}.art-control-volume{position:relative}.art-control-volume .art-volume-panel{text-align:center;cursor:default;opacity:0;pointer-events:none;left:0;right:0;bottom:var(--art-control-height);width:var(--art-control-height);height:var(--art-volume-height);transition:all var(--art-transition-duration)ease;justify-content:center;align-items:center;padding:0 5px;font-size:12px;display:flex;position:absolute;transform:translateY(10px)}.art-control-volume .art-volume-panel .art-volume-inner{border-radius:var(--art-border-radius);background-color:var(--art-widget-background);flex-direction:column;align-items:center;gap:10px;width:100%;height:100%;padding:10px 0 12px;display:flex}.art-control-volume .art-volume-panel .art-volume-inner .art-volume-slider{cursor:pointer;flex:1;justify-content:center;width:100%;display:flex;position:relative}.art-control-volume .art-volume-panel .art-volume-inner .art-volume-slider .art-volume-handle{border-radius:var(--art-border-radius);background-color:#ffffff40;justify-content:center;width:2px;display:flex;position:relative;overflow:hidden}.art-control-volume .art-volume-panel .art-volume-inner .art-volume-slider .art-volume-handle .art-volume-loaded{z-index:0;background-color:var(--art-theme);width:100%;height:100%;position:absolute;inset:0}.art-control-volume .art-volume-panel .art-volume-inner .art-volume-slider .art-volume-indicator{width:var(--art-volume-handle-size);height:var(--art-volume-handle-size);margin-top:calc(var(--art-volume-handle-size)/-2);background-color:var(--art-theme);transition:transform var(--art-transition-duration)ease;border-radius:100%;flex-shrink:0;position:absolute;transform:scale(1)}.art-control-volume .art-volume-panel .art-volume-inner .art-volume-slider:active .art-volume-indicator{transform:scale(.9)}.art-control-volume:hover .art-volume-panel{opacity:1;pointer-events:auto;transform:translateY(0)}.art-video-player .art-notice{z-index:80;padding:var(--art-padding);pointer-events:none;width:100%;height:auto;display:none;position:absolute;inset:0 0 auto}.art-video-player .art-notice .art-notice-inner{border-radius:var(--art-border-radius);background-color:var(--art-tip-background);padding:5px;line-height:1;display:inline-flex}.art-video-player.art-notice-show .art-notice{display:flex}.art-video-player .art-contextmenus{z-index:120;border-radius:var(--art-border-radius);background-color:var(--art-widget-background);min-width:var(--art-contextmenus-min-width);flex-direction:column;padding:5px 0;font-size:12px;display:none;position:absolute}.art-video-player .art-contextmenus .art-contextmenu{cursor:pointer;border-bottom:1px solid #ffffff1a;padding:10px 15px;display:flex}.art-video-player .art-contextmenus .art-contextmenu span{padding:0 8px}.art-video-player .art-contextmenus .art-contextmenu span:hover,.art-video-player .art-contextmenus .art-contextmenu span.art-current{color:var(--art-theme)}.art-video-player .art-contextmenus .art-contextmenu:hover{background-color:#ffffff1a}.art-video-player .art-contextmenus .art-contextmenu:last-child{border-bottom:none}.art-video-player.art-contextmenu-show .art-contextmenus{display:flex}.art-video-player .art-settings{z-index:90;border-radius:var(--art-border-radius);transform-origin:100% 100%;max-height:var(--art-settings-max-height);left:auto;right:var(--art-padding);bottom:var(--art-control-height);transform:scale(var(--art-settings-scale));transition:all var(--art-transition-duration)ease;background-color:var(--art-widget-background);flex-direction:column;display:none;position:absolute;overflow:hidden auto}.art-video-player .art-settings .art-setting-panel{flex-direction:column;display:none}.art-video-player .art-settings .art-setting-panel.art-current{display:flex}.art-video-player .art-settings .art-setting-panel .art-setting-item{cursor:pointer;transition:background-color var(--art-transition-duration)ease;justify-content:space-between;align-items:center;padding:0 5px;display:flex;overflow:hidden}.art-video-player .art-settings .art-setting-panel .art-setting-item:hover{background-color:#ffffff1a}.art-video-player .art-settings .art-setting-panel .art-setting-item.art-current{color:var(--art-theme)}.art-video-player .art-settings .art-setting-panel .art-setting-item .art-icon-check{visibility:hidden;height:15px}.art-video-player .art-settings .art-setting-panel .art-setting-item.art-current .art-icon-check{visibility:visible}.art-video-player .art-settings .art-setting-panel .art-setting-item .art-setting-item-left{justify-content:center;align-items:center;gap:5px;display:flex}.art-video-player .art-settings .art-setting-panel .art-setting-item .art-setting-item-left .art-setting-item-left-icon{height:var(--art-settings-icon-size);width:var(--art-settings-icon-size);justify-content:center;align-items:center;display:flex}.art-video-player .art-settings .art-setting-panel .art-setting-item .art-setting-item-right{justify-content:center;align-items:center;gap:5px;font-size:12px;display:flex}.art-video-player .art-settings .art-setting-panel .art-setting-item .art-setting-item-right .art-setting-item-right-tooltip{white-space:nowrap;color:#ffffff80}.art-video-player .art-settings .art-setting-panel .art-setting-item .art-setting-item-right .art-setting-item-right-icon{justify-content:center;align-items:center;min-width:32px;height:24px;display:flex}.art-video-player .art-settings .art-setting-panel .art-setting-item .art-setting-item-right .art-setting-range{appearance:none;background-color:#fff3;outline:none;width:80px;height:3px}.art-video-player .art-settings .art-setting-panel .art-setting-item-back{border-bottom:1px solid #ffffff1a}.art-video-player.art-setting-show .art-settings{display:flex}.art-video-player .art-info{left:var(--art-padding);top:var(--art-padding);z-index:100;border-radius:var(--art-border-radius);background-color:var(--art-widget-background);padding:10px;font-size:12px;display:none;position:absolute}.art-video-player .art-info .art-info-panel{flex-direction:column;gap:5px;display:flex}.art-video-player .art-info .art-info-panel .art-info-item{align-items:center;gap:5px;display:flex}.art-video-player .art-info .art-info-panel .art-info-item .art-info-title{text-align:right;width:100px}.art-video-player .art-info .art-info-panel .art-info-item .art-info-content{text-overflow:ellipsis;white-space:nowrap;user-select:all;width:250px;overflow:hidden}.art-video-player .art-info .art-info-close{cursor:pointer;position:absolute;top:5px;right:5px}.art-video-player.art-info-show .art-info{display:flex}.art-hide-cursor *{cursor:none!important}.art-video-player[data-aspect-ratio]{overflow:hidden}.art-video-player[data-aspect-ratio] .art-video{object-fit:fill;box-sizing:content-box}.art-fullscreen{--art-progress-height:8px;--art-indicator-size:20px;--art-control-height:60px;--art-control-icon-scale:1.3}.art-fullscreen-web{--art-progress-height:8px;--art-indicator-size:20px;--art-control-height:60px;--art-control-icon-scale:1.3;z-index:var(--art-fullscreen-web-index);width:100%;height:100%;position:fixed;inset:0}.art-mini-popup{z-index:9999;border-radius:var(--art-border-radius);cursor:move;user-select:none;background:#000;width:320px;height:180px;transition:opacity .2s;position:fixed;overflow:hidden;box-shadow:0 0 5px #00000080}.art-mini-popup svg{fill:#fff}.art-mini-popup .art-video{pointer-events:none}.art-mini-popup .art-mini-close{z-index:20;cursor:pointer;opacity:0;transition:opacity .2s;position:absolute;top:10px;right:10px}.art-mini-popup .art-mini-state{z-index:30;pointer-events:none;opacity:0;background-color:#00000040;justify-content:center;align-items:center;width:100%;height:100%;transition:opacity .2s;display:flex;position:absolute;inset:0}.art-mini-popup .art-mini-state .art-icon{opacity:.75;cursor:pointer;pointer-events:auto;transition:transform .2s;transform:scale(3)}.art-mini-popup .art-mini-state .art-icon:active{transform:scale(2.5)}.art-mini-popup.art-mini-droging{opacity:.9}.art-mini-popup:hover .art-mini-close,.art-mini-popup:hover .art-mini-state{opacity:1}.art-video-player[data-flip=horizontal] .art-video{transform:scaleX(-1)}.art-video-player[data-flip=vertical] .art-video{transform:scaleY(-1)}.art-video-player .art-layer-lock{height:var(--art-lock-size);width:var(--art-lock-size);top:50%;left:var(--art-padding);background-color:var(--art-tip-background);border-radius:50%;justify-content:center;align-items:center;display:none;position:absolute;transform:translateY(-50%)}.art-video-player .art-layer-auto-playback{border-radius:var(--art-border-radius);left:var(--art-padding);bottom:calc(var(--art-control-height) + var(--art-bottom-gap) + 10px);background-color:var(--art-widget-background);align-items:center;gap:10px;padding:10px;line-height:1;display:none;position:absolute}.art-video-player .art-layer-auto-playback .art-auto-playback-close{cursor:pointer;justify-content:center;align-items:center;display:flex}.art-video-player .art-layer-auto-playback .art-auto-playback-close svg{fill:var(--art-theme);width:15px;height:15px}.art-video-player .art-layer-auto-playback .art-auto-playback-jump{color:var(--art-theme);cursor:pointer}.art-video-player.art-lock .art-subtitle{bottom:var(--art-subtitle-bottom)!important}.art-video-player.art-mini-progress-bar .art-bottom,.art-video-player.art-lock .art-bottom{opacity:1;background-image:none;padding:0}.art-video-player.art-mini-progress-bar .art-bottom .art-controls,.art-video-player.art-lock .art-bottom .art-controls,.art-video-player.art-mini-progress-bar .art-bottom .art-progress,.art-video-player.art-lock .art-bottom .art-progress{transform:translateY(calc(var(--art-control-height) + var(--art-bottom-gap) + var(--art-progress-height)/4))}.art-video-player.art-mini-progress-bar .art-bottom .art-progress-indicator,.art-video-player.art-lock .art-bottom .art-progress-indicator{display:none!important}.art-video-player.art-control-show .art-layer-lock{display:flex}.art-control-selector{position:relative}.art-control-selector .art-selector-list{text-align:center;border-radius:var(--art-border-radius);opacity:0;pointer-events:none;bottom:var(--art-control-height);max-height:var(--art-selector-max-height);background-color:var(--art-widget-background);transition:all var(--art-transition-duration)ease;flex-direction:column;align-items:center;display:flex;position:absolute;overflow:hidden auto;transform:translateY(10px)}.art-control-selector .art-selector-list .art-selector-item{flex-shrink:0;justify-content:center;align-items:center;width:100%;padding:10px 15px;line-height:1;display:flex}.art-control-selector .art-selector-list .art-selector-item:hover{background-color:#ffffff1a}.art-control-selector .art-selector-list .art-selector-item:hover,.art-control-selector .art-selector-list .art-selector-item.art-current{color:var(--art-theme)}.art-control-selector:hover .art-selector-list{opacity:1;pointer-events:auto;transform:translateY(0)}[class*=hint--]{font-style:normal;display:inline-block;position:relative}[class*=hint--]:before,[class*=hint--]:after{visibility:hidden;opacity:0;z-index:1000000;pointer-events:none;transition:all .3s;position:absolute;transform:translate(0,0)}[class*=hint--]:hover:before,[class*=hint--]:hover:after{visibility:visible;opacity:1;transition-delay:.1s}[class*=hint--]:before{content:"";z-index:1000001;background:0 0;border:6px solid #0000;position:absolute}[class*=hint--]:after{color:#fff;white-space:nowrap;background:#000;padding:8px 10px;font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:12px;line-height:12px}[class*=hint--][aria-label]:after{content:attr(aria-label)}[class*=hint--][data-hint]:after{content:attr(data-hint)}[aria-label=""]:before,[aria-label=""]:after,[data-hint=""]:before,[data-hint=""]:after{display:none!important}.hint--top-left:before,.hint--top-right:before,.hint--top:before{border-top-color:#000}.hint--bottom-left:before,.hint--bottom-right:before,.hint--bottom:before{border-bottom-color:#000}.hint--left:before{border-left-color:#000}.hint--right:before{border-right-color:#000}.hint--top:before{margin-bottom:-11px}.hint--top:before,.hint--top:after{bottom:100%;left:50%}.hint--top:before{left:calc(50% - 6px)}.hint--top:after{transform:translate(-50%)}.hint--top:hover:before{transform:translateY(-8px)}.hint--top:hover:after{transform:translate(-50%)translateY(-8px)}.hint--bottom:before{margin-top:-11px}.hint--bottom:before,.hint--bottom:after{top:100%;left:50%}.hint--bottom:before{left:calc(50% - 6px)}.hint--bottom:after{transform:translate(-50%)}.hint--bottom:hover:before{transform:translateY(8px)}.hint--bottom:hover:after{transform:translate(-50%)translateY(8px)}.hint--right:before{margin-bottom:-6px;margin-left:-11px}.hint--right:after{margin-bottom:-14px}.hint--right:before,.hint--right:after{bottom:50%;left:100%}.hint--right:hover:before,.hint--right:hover:after{transform:translate(8px)}.hint--left:before{margin-bottom:-6px;margin-right:-11px}.hint--left:after{margin-bottom:-14px}.hint--left:before,.hint--left:after{bottom:50%;right:100%}.hint--left:hover:before,.hint--left:hover:after{transform:translate(-8px)}.hint--top-left:before{margin-bottom:-11px}.hint--top-left:before,.hint--top-left:after{bottom:100%;left:50%}.hint--top-left:before{left:calc(50% - 6px)}.hint--top-left:after{margin-left:12px;transform:translate(-100%)}.hint--top-left:hover:before{transform:translateY(-8px)}.hint--top-left:hover:after{transform:translate(-100%)translateY(-8px)}.hint--top-right:before{margin-bottom:-11px}.hint--top-right:before,.hint--top-right:after{bottom:100%;left:50%}.hint--top-right:before{left:calc(50% - 6px)}.hint--top-right:after{margin-left:-12px;transform:translate(0)}.hint--top-right:hover:before,.hint--top-right:hover:after{transform:translateY(-8px)}.hint--bottom-left:before{margin-top:-11px}.hint--bottom-left:before,.hint--bottom-left:after{top:100%;left:50%}.hint--bottom-left:before{left:calc(50% - 6px)}.hint--bottom-left:after{margin-left:12px;transform:translate(-100%)}.hint--bottom-left:hover:before{transform:translateY(8px)}.hint--bottom-left:hover:after{transform:translate(-100%)translateY(8px)}.hint--bottom-right:before{margin-top:-11px}.hint--bottom-right:before,.hint--bottom-right:after{top:100%;left:50%}.hint--bottom-right:before{left:calc(50% - 6px)}.hint--bottom-right:after{margin-left:-12px;transform:translate(0)}.hint--bottom-right:hover:before,.hint--bottom-right:hover:after{transform:translateY(8px)}.hint--small:after,.hint--medium:after,.hint--large:after{white-space:normal;word-wrap:break-word;line-height:1.4em}.hint--small:after{width:80px}.hint--medium:after{width:150px}.hint--large:after{width:300px}[class*=hint--]:after{text-shadow:0 -1px #000;box-shadow:4px 4px 8px #0000004d}.hint--error:after{text-shadow:0 -1px #592726;background-color:#b34e4d}.hint--error.hint--top-left:before,.hint--error.hint--top-right:before,.hint--error.hint--top:before{border-top-color:#b34e4d}.hint--error.hint--bottom-left:before,.hint--error.hint--bottom-right:before,.hint--error.hint--bottom:before{border-bottom-color:#b34e4d}.hint--error.hint--left:before{border-left-color:#b34e4d}.hint--error.hint--right:before{border-right-color:#b34e4d}.hint--warning:after{text-shadow:0 -1px #6c5328;background-color:#c09854}.hint--warning.hint--top-left:before,.hint--warning.hint--top-right:before,.hint--warning.hint--top:before{border-top-color:#c09854}.hint--warning.hint--bottom-left:before,.hint--warning.hint--bottom-right:before,.hint--warning.hint--bottom:before{border-bottom-color:#c09854}.hint--warning.hint--left:before{border-left-color:#c09854}.hint--warning.hint--right:before{border-right-color:#c09854}.hint--info:after{text-shadow:0 -1px #1a3c4d;background-color:#3986ac}.hint--info.hint--top-left:before,.hint--info.hint--top-right:before,.hint--info.hint--top:before{border-top-color:#3986ac}.hint--info.hint--bottom-left:before,.hint--info.hint--bottom-right:before,.hint--info.hint--bottom:before{border-bottom-color:#3986ac}.hint--info.hint--left:before{border-left-color:#3986ac}.hint--info.hint--right:before{border-right-color:#3986ac}.hint--success:after{text-shadow:0 -1px #1a321a;background-color:#458746}.hint--success.hint--top-left:before,.hint--success.hint--top-right:before,.hint--success.hint--top:before{border-top-color:#458746}.hint--success.hint--bottom-left:before,.hint--success.hint--bottom-right:before,.hint--success.hint--bottom:before{border-bottom-color:#458746}.hint--success.hint--left:before{border-left-color:#458746}.hint--success.hint--right:before{border-right-color:#458746}.hint--always:after,.hint--always:before{opacity:1;visibility:visible}.hint--always.hint--top:before{transform:translateY(-8px)}.hint--always.hint--top:after{transform:translate(-50%)translateY(-8px)}.hint--always.hint--top-left:before{transform:translateY(-8px)}.hint--always.hint--top-left:after{transform:translate(-100%)translateY(-8px)}.hint--always.hint--top-right:before,.hint--always.hint--top-right:after{transform:translateY(-8px)}.hint--always.hint--bottom:before{transform:translateY(8px)}.hint--always.hint--bottom:after{transform:translate(-50%)translateY(8px)}.hint--always.hint--bottom-left:before{transform:translateY(8px)}.hint--always.hint--bottom-left:after{transform:translate(-100%)translateY(8px)}.hint--always.hint--bottom-right:before,.hint--always.hint--bottom-right:after{transform:translateY(8px)}.hint--always.hint--left:before,.hint--always.hint--left:after{transform:translate(-8px)}.hint--always.hint--right:before,.hint--always.hint--right:after{transform:translate(8px)}.hint--rounded:after{border-radius:4px}.hint--no-animate:before,.hint--no-animate:after{transition-duration:0s}.hint--bounce:before,.hint--bounce:after{-webkit-transition:opacity .3s,visibility .3s,-webkit-transform .3s cubic-bezier(.71,1.7,.77,1.24);-moz-transition:opacity .3s,visibility .3s,-moz-transform .3s cubic-bezier(.71,1.7,.77,1.24);transition:opacity .3s,visibility .3s,transform .3s cubic-bezier(.71,1.7,.77,1.24)}.hint--no-shadow:before,.hint--no-shadow:after{text-shadow:initial;box-shadow:initial}.hint--no-arrow:before{display:none}.art-video-player.art-mobile{--art-bottom-gap:10px;--art-control-height:38px;--art-control-icon-scale:1;--art-state-size:60px;--art-settings-max-height:180px;--art-selector-max-height:180px;--art-indicator-scale:1;--art-control-opacity:1}.art-video-player.art-mobile .art-controls-left{margin-left:calc(var(--art-padding)/-1)}.art-video-player.art-mobile .art-controls-right{margin-right:calc(var(--art-padding)/-1)}'},{}],"9I0i9":[function(t,n,i){var s;s=function(){function o(h){return(o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p})(h)}var l=Object.prototype.toString,a=function(h){if(h===void 0)return"undefined";if(h===null)return"null";var p=o(h);if(p==="boolean")return"boolean";if(p==="string")return"string";if(p==="number")return"number";if(p==="symbol")return"symbol";if(p==="function")return u(h)==="GeneratorFunction"?"generatorfunction":"function";if(Array.isArray?Array.isArray(h):h instanceof Array)return"array";if(h.constructor&&typeof h.constructor.isBuffer=="function"&&h.constructor.isBuffer(h))return"buffer";if(function(m){try{if(typeof m.length=="number"&&typeof m.callee=="function")return!0}catch(y){if(y.message.indexOf("callee")!==-1)return!0}return!1}(h))return"arguments";if(h instanceof Date||typeof h.toDateString=="function"&&typeof h.getDate=="function"&&typeof h.setDate=="function")return"date";if(h instanceof Error||typeof h.message=="string"&&h.constructor&&typeof h.constructor.stackTraceLimit=="number")return"error";if(h instanceof RegExp||typeof h.flags=="string"&&typeof h.ignoreCase=="boolean"&&typeof h.multiline=="boolean"&&typeof h.global=="boolean")return"regexp";switch(u(h)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(typeof h.throw=="function"&&typeof h.return=="function"&&typeof h.next=="function")return"generator";switch(p=l.call(h)){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return p.slice(8,-1).toLowerCase().replace(/\s/g,"")};function u(h){return h.constructor?h.constructor.name:null}function c(h,p){var m=2l),s.export(i,"queryAll",()=>a),s.export(i,"addClass",()=>u),s.export(i,"removeClass",()=>c),s.export(i,"hasClass",()=>f),s.export(i,"append",()=>d),s.export(i,"remove",()=>h),s.export(i,"setStyle",()=>p),s.export(i,"setStyles",()=>m),s.export(i,"getStyle",()=>y),s.export(i,"sublings",()=>g),s.export(i,"inverseClass",()=>v),s.export(i,"tooltip",()=>x),s.export(i,"isInViewport",()=>S),s.export(i,"includeFromEvent",()=>E),s.export(i,"replaceElement",()=>b),s.export(i,"createElement",()=>w),s.export(i,"getIcon",()=>A),s.export(i,"setStyleText",()=>R),s.export(i,"supportsFlex",()=>L),s.export(i,"getRect",()=>C);var o=t("./compatibility");function l(_,k=document){return k.querySelector(_)}function a(_,k=document){return Array.from(k.querySelectorAll(_))}function u(_,k){return _.classList.add(k)}function c(_,k){return _.classList.remove(k)}function f(_,k){return _.classList.contains(k)}function d(_,k){return k instanceof Element?_.appendChild(k):_.insertAdjacentHTML("beforeend",String(k)),_.lastElementChild||_.lastChild}function h(_){return _.parentNode.removeChild(_)}function p(_,k,M){return _.style[k]=M,_}function m(_,k){for(let M in k)p(_,M,k[M]);return _}function y(_,k,M=!0){let O=window.getComputedStyle(_,null).getPropertyValue(k);return M?parseFloat(O):O}function g(_){return Array.from(_.parentElement.children).filter(k=>k!==_)}function v(_,k){g(_).forEach(M=>c(M,k)),u(_,k)}function x(_,k,M="top"){o.isMobile||(_.setAttribute("aria-label",k),u(_,"hint--rounded"),u(_,`hint--${M}`))}function S(_,k=0){let M=_.getBoundingClientRect(),O=window.innerHeight||document.documentElement.clientHeight,U=window.innerWidth||document.documentElement.clientWidth,G=M.top-k<=O&&M.top+M.height+k>=0,B=M.left-k<=U+k&&M.left+M.width+k>=0;return G&&B}function E(_,k){return _.composedPath&&_.composedPath().indexOf(k)>-1}function b(_,k){return k.parentNode.replaceChild(_,k),_}function w(_){return document.createElement(_)}function A(_="",k=""){let M=w("i");return u(M,"art-icon"),u(M,`art-icon-${_}`),d(M,k),M}function R(_,k){let M=document.getElementById(_);if(M)M.textContent=k;else{let O=w("style");O.id=_,O.textContent=k,document.head.appendChild(O)}}function L(){let _=document.createElement("div");return _.style.display="flex",_.style.display==="flex"}function C(_){return _.getBoundingClientRect()}},{"./compatibility":"luXC1","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],luXC1:[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"userAgent",()=>o),s.export(i,"isSafari",()=>l),s.export(i,"isWechat",()=>a),s.export(i,"isIE",()=>u),s.export(i,"isAndroid",()=>c),s.export(i,"isIOS",()=>f),s.export(i,"isIOS13",()=>d),s.export(i,"isMobile",()=>h),s.export(i,"isBrowser",()=>p);let o=typeof navigator<"u"?navigator.userAgent:"",l=/^((?!chrome|android).)*safari/i.test(o),a=/MicroMessenger/i.test(o),u=/MSIE|Trident/i.test(o),c=/android/i.test(o),f=/iPad|iPhone|iPod/i.test(o)&&!window.MSStream,d=f||o.includes("Macintosh")&&navigator.maxTouchPoints>=1,h=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(o)||d,p=typeof window<"u"},{"@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],"2nFlF":[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"ArtPlayerError",()=>o),s.export(i,"errorHandle",()=>l);class o extends Error{constructor(u,c){super(u),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,c||this.constructor),this.name="ArtPlayerError"}}function l(a,u){if(!a)throw new o(u);return a}},{"@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],yqFoT:[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");function o(u){return`WEBVTT \r +\r +`.concat(u.replace(/(\d\d:\d\d:\d\d)[,.](\d+)/g,(c,f,d)=>{let h=d.slice(0,3);return d.length===1&&(h=d+"00"),d.length===2&&(h=d+"0"),`${f},${h}`}).replace(/\{\\([ibu])\}/g,"").replace(/\{\\([ibu])1\}/g,"<$1>").replace(/\{([ibu])\}/g,"<$1>").replace(/\{\/([ibu])\}/g,"").replace(/(\d\d:\d\d:\d\d),(\d\d\d)/g,"$1.$2").replace(/{[\s\S]*?}/g,"").concat(`\r +\r +`))}function l(u){return URL.createObjectURL(new Blob([u],{type:"text/vtt"}))}function a(u){let c=RegExp("Dialogue:\\s\\d,(\\d+:\\d\\d:\\d\\d.\\d\\d),(\\d+:\\d\\d:\\d\\d.\\d\\d),([^,]*),([^,]*),(?:[^,]*,){4}([\\s\\S]*)$","i");function f(d=""){return d.split(/[:.]/).map((h,p,m)=>{if(p===m.length-1){if(h.length===1)return`.${h}00`;if(h.length===2)return`.${h}0`}else if(h.length===1)return(p===0?"0":":0")+h;return p===0?h:p===m.length-1?`.${h}`:`:${h}`}).join("")}return`WEBVTT + +`+u.split(/\r?\n/).map(d=>{let h=d.match(c);return h?{start:f(h[1].trim()),end:f(h[2].trim()),text:h[5].replace(/{[\s\S]*?}/g,"").replace(/(\\N)/g,` +`).trim().split(/\r?\n/).map(p=>p.trim()).join(` +`)}:null}).filter(d=>d).map((d,h)=>d?h+1+` +${d.start} --> ${d.end} +${d.text}`:"").filter(d=>d.trim()).join(` + +`)}s.defineInteropFlag(i),s.export(i,"srtToVtt",()=>o),s.export(i,"vttToBlob",()=>l),s.export(i,"assToVtt",()=>a)},{"@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],"1VRQn":[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");function o(l,a){let u=document.createElement("a");u.style.display="none",u.href=l,u.download=a,document.body.appendChild(u),u.click(),document.body.removeChild(u)}s.defineInteropFlag(i),s.export(i,"getExt",()=>function l(a){return a.includes("?")?l(a.split("?")[0]):a.includes("#")?l(a.split("#")[0]):a.trim().toLowerCase().split(".").pop()}),s.export(i,"download",()=>o)},{"@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],"3weX2":[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"def",()=>o),s.export(i,"has",()=>a),s.export(i,"get",()=>u),s.export(i,"mergeDeep",()=>function c(...f){let d=h=>h&&typeof h=="object"&&!Array.isArray(h);return f.reduce((h,p)=>(Object.keys(p).forEach(m=>{let y=h[m],g=p[m];Array.isArray(y)&&Array.isArray(g)?h[m]=y.concat(...g):d(y)&&d(g)?h[m]=c(y,g):h[m]=g}),h),{})});let o=Object.defineProperty,{hasOwnProperty:l}=Object.prototype;function a(c,f){return l.call(c,f)}function u(c,f){return Object.getOwnPropertyDescriptor(c,f)}},{"@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],"7kBIx":[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");function o(u=0){return new Promise(c=>setTimeout(c,u))}function l(u,c){let f;return function(...d){clearTimeout(f),f=setTimeout(()=>(f=null,u.apply(this,d)),c)}}function a(u,c){let f=!1;return function(...d){f||(u.apply(this,d),f=!0,setTimeout(function(){f=!1},c))}}s.defineInteropFlag(i),s.export(i,"sleep",()=>o),s.export(i,"debounce",()=>l),s.export(i,"throttle",()=>a)},{"@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],"13atT":[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");function o(d,h,p){return Math.max(Math.min(d,Math.max(h,p)),Math.min(h,p))}function l(d){return d.charAt(0).toUpperCase()+d.slice(1)}function a(d){return["string","number"].includes(typeof d)}function u(d){if(!d)return"00:00";let h=Math.floor(d/3600),p=Math.floor((d-3600*h)/60),m=Math.floor(d-3600*h-60*p);return(h>0?[h,p,m]:[p,m]).map(y=>y<10?`0${y}`:String(y)).join(":")}function c(d){return d.replace(/[&<>'"]/g,h=>({"&":"&","<":"<",">":">","'":"'",'"':"""})[h]||h)}function f(d){let h={"&":"&","<":"<",">":">","'":"'",""":'"'},p=RegExp(`(${Object.keys(h).join("|")})`,"g");return d.replace(p,m=>h[m]||m)}s.defineInteropFlag(i),s.export(i,"clamp",()=>o),s.export(i,"capitalize",()=>l),s.export(i,"isStringOrNumber",()=>a),s.export(i,"secondToTime",()=>u),s.export(i,"escape",()=>c),s.export(i,"unescape",()=>f)},{"@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],AdvwB:[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"ComponentOption",()=>p);var o=t("../utils");let l="array",a="boolean",u="string",c="number",f="object",d="function";function h(m,y,g){return(0,o.errorHandle)(y===u||y===c||m instanceof Element,`${g.join(".")} require '${u}' or 'Element' type`)}let p={html:h,disable:`?${a}`,name:`?${u}`,index:`?${c}`,style:`?${f}`,click:`?${d}`,mounted:`?${d}`,tooltip:`?${u}|${c}`,width:`?${c}`,selector:`?${l}`,onSelect:`?${d}`,switch:`?${a}`,onSwitch:`?${d}`,range:`?${l}`,onRange:`?${d}`,onChange:`?${d}`};i.default={id:u,container:h,url:u,poster:u,type:u,theme:u,lang:u,volume:c,isLive:a,muted:a,autoplay:a,autoSize:a,autoMini:a,loop:a,flip:a,playbackRate:a,aspectRatio:a,screenshot:a,setting:a,hotkey:a,pip:a,mutex:a,backdrop:a,fullscreen:a,fullscreenWeb:a,subtitleOffset:a,miniProgressBar:a,useSSR:a,playsInline:a,lock:a,fastForward:a,autoPlayback:a,autoOrientation:a,airplay:a,plugins:[d],layers:[p],contextmenu:[p],settings:[p],controls:[{...p,position:(m,y,g)=>{let v=["top","left","right"];return(0,o.errorHandle)(v.includes(m),`${g.join(".")} only accept ${v.toString()} as parameters`)}}],quality:[{default:`?${a}`,html:u,url:u}],highlight:[{time:c,text:u}],thumbnails:{url:u,number:c,column:c,width:c,height:c},subtitle:{url:u,name:u,type:u,style:f,escape:a,encoding:u,onVttLoad:d},moreVideoAttr:f,i18n:f,icons:f,cssVar:f,customType:f}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],"9Xmqu":[function(t,n,i){t("@parcel/transformer-js/src/esmodule-helpers.js").defineInteropFlag(i),i.default={propertys:["audioTracks","autoplay","buffered","controller","controls","crossOrigin","currentSrc","currentTime","defaultMuted","defaultPlaybackRate","duration","ended","error","loop","mediaGroup","muted","networkState","paused","playbackRate","played","preload","readyState","seekable","seeking","src","startDate","textTracks","videoTracks","volume"],methods:["addTextTrack","canPlayType","load","play","pause"],events:["abort","canplay","canplaythrough","durationchange","emptied","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting"],prototypes:["width","height","videoWidth","videoHeight","poster","webkitDecodedFrameCount","webkitDroppedFrameCount","playsInline","webkitSupportsFullscreen","webkitDisplayingFullscreen","onenterpictureinpicture","onleavepictureinpicture","disablePictureInPicture","cancelVideoFrameCallback","requestVideoFrameCallback","getVideoPlaybackQuality","requestPictureInPicture","webkitEnterFullScreen","webkitEnterFullscreen","webkitExitFullScreen","webkitExitFullscreen"]}},{"@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],"2gKYH":[function(t,n,i){t("@parcel/transformer-js/src/esmodule-helpers.js").defineInteropFlag(i);var s=t("./utils");class o{constructor(a){this.art=a;let{option:u,constructor:c}=a;u.container instanceof Element?this.$container=u.container:(this.$container=(0,s.query)(u.container),(0,s.errorHandle)(this.$container,`No container element found by ${u.container}`)),(0,s.errorHandle)((0,s.supportsFlex)(),"The current browser does not support flex layout");let f=this.$container.tagName.toLowerCase();(0,s.errorHandle)(f==="div",`Unsupported container element type, only support 'div' but got '${f}'`),(0,s.errorHandle)(c.instances.every(d=>d.template.$container!==this.$container),"Cannot mount multiple instances on the same dom element"),this.query=this.query.bind(this),this.$container.dataset.artId=a.id,this.init()}static get html(){return'
Player version:
5.1.7
Video url:
Video volume:
Video time:
Video duration:
Video resolution:
x
[x]
'}query(a){return(0,s.query)(a,this.$container)}init(){let{option:a}=this.art;a.useSSR||(this.$container.innerHTML=o.html),this.$player=this.query(".art-video-player"),this.$video=this.query(".art-video"),this.$track=this.query("track"),this.$poster=this.query(".art-poster"),this.$subtitle=this.query(".art-subtitle"),this.$danmuku=this.query(".art-danmuku"),this.$bottom=this.query(".art-bottom"),this.$progress=this.query(".art-progress"),this.$controls=this.query(".art-controls"),this.$controlsLeft=this.query(".art-controls-left"),this.$controlsCenter=this.query(".art-controls-center"),this.$controlsRight=this.query(".art-controls-right"),this.$layer=this.query(".art-layers"),this.$loading=this.query(".art-loading"),this.$notice=this.query(".art-notice"),this.$noticeInner=this.query(".art-notice-inner"),this.$mask=this.query(".art-mask"),this.$state=this.query(".art-state"),this.$setting=this.query(".art-settings"),this.$info=this.query(".art-info"),this.$infoPanel=this.query(".art-info-panel"),this.$infoClose=this.query(".art-info-close"),this.$contextmenu=this.query(".art-contextmenus"),a.backdrop&&(0,s.addClass)(this.$player,"art-backdrop"),s.isMobile&&(0,s.addClass)(this.$player,"art-mobile")}destroy(a){a?this.$container.innerHTML="":(0,s.addClass)(this.$player,"art-destroy")}}i.default=o},{"./utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],"1AdeF":[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i);var o=t("../utils"),l=t("./zh-cn"),a=s.interopDefault(l);i.default=class{constructor(u){this.art=u,this.languages={"zh-cn":a.default},this.language={},this.update(u.option.i18n)}init(){let u=this.art.option.lang.toLowerCase();this.language=this.languages[u]||{}}get(u){return this.language[u]||u}update(u){this.languages=(0,o.mergeDeep)(this.languages,u),this.init()}}},{"../utils":"h3rH9","./zh-cn":"3ZSKq","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],"3ZSKq":[function(t,n,i){t("@parcel/transformer-js/src/esmodule-helpers.js").defineInteropFlag(i);let s={"Video Info":"统计信息",Close:"关闭","Video Load Failed":"加载失败",Volume:"音量",Play:"播放",Pause:"暂停",Rate:"速度",Mute:"静音","Video Flip":"画面翻转",Horizontal:"水平",Vertical:"垂直",Reconnect:"重新连接","Show Setting":"显示设置","Hide Setting":"隐藏设置",Screenshot:"截图","Play Speed":"播放速度","Aspect Ratio":"画面比例",Default:"默认",Normal:"正常",Open:"打开","Switch Video":"切换","Switch Subtitle":"切换字幕",Fullscreen:"全屏","Exit Fullscreen":"退出全屏","Web Fullscreen":"网页全屏","Exit Web Fullscreen":"退出网页全屏","Mini Player":"迷你播放器","PIP Mode":"开启画中画","Exit PIP Mode":"退出画中画","PIP Not Supported":"不支持画中画","Fullscreen Not Supported":"不支持全屏","Subtitle Offset":"字幕偏移","Last Seen":"上次看到","Jump Play":"跳转播放",AirPlay:"隔空播放","AirPlay Not Available":"隔空播放不可用"};i.default=s,typeof window<"u"&&(window["artplayer-i18n-zh-cn"]=s)},{"@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],"556MW":[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i);var o=t("./urlMix"),l=s.interopDefault(o),a=t("./attrMix"),u=s.interopDefault(a),c=t("./playMix"),f=s.interopDefault(c),d=t("./pauseMix"),h=s.interopDefault(d),p=t("./toggleMix"),m=s.interopDefault(p),y=t("./seekMix"),g=s.interopDefault(y),v=t("./volumeMix"),x=s.interopDefault(v),S=t("./currentTimeMix"),E=s.interopDefault(S),b=t("./durationMix"),w=s.interopDefault(b),A=t("./switchMix"),R=s.interopDefault(A),L=t("./playbackRateMix"),C=s.interopDefault(L),_=t("./aspectRatioMix"),k=s.interopDefault(_),M=t("./screenshotMix"),O=s.interopDefault(M),U=t("./fullscreenMix"),G=s.interopDefault(U),B=t("./fullscreenWebMix"),F=s.interopDefault(B),N=t("./pipMix"),K=s.interopDefault(N),V=t("./loadedMix"),J=s.interopDefault(V),ie=t("./playedMix"),ce=s.interopDefault(ie),ae=t("./playingMix"),xe=s.interopDefault(ae),St=t("./autoSizeMix"),qt=s.interopDefault(St),fi=t("./rectMix"),di=s.interopDefault(fi),hi=t("./flipMix"),pi=s.interopDefault(hi),mi=t("./miniMix"),gi=s.interopDefault(mi),pr=t("./posterMix"),Z=s.interopDefault(pr),_a=t("./autoHeightMix"),_t=s.interopDefault(_a),mn=t("./cssVarMix"),gn=s.interopDefault(mn),mr=t("./themeMix"),Xt=s.interopDefault(mr),yi=t("./typeMix"),Pa=s.interopDefault(yi),Ts=t("./stateMix"),vi=s.interopDefault(Ts),vy=t("./subtitleOffsetMix"),xy=s.interopDefault(vy),Ey=t("./airplayMix"),Sy=s.interopDefault(Ey),Ty=t("./qualityMix"),wy=s.interopDefault(Ty),by=t("./thumbnailsMix"),Ay=s.interopDefault(by),Ly=t("./optionInit"),Ry=s.interopDefault(Ly),Iy=t("./eventInit"),ky=s.interopDefault(Iy);i.default=class{constructor(ne){(0,l.default)(ne),(0,u.default)(ne),(0,f.default)(ne),(0,h.default)(ne),(0,m.default)(ne),(0,g.default)(ne),(0,x.default)(ne),(0,E.default)(ne),(0,w.default)(ne),(0,R.default)(ne),(0,C.default)(ne),(0,k.default)(ne),(0,O.default)(ne),(0,G.default)(ne),(0,F.default)(ne),(0,K.default)(ne),(0,J.default)(ne),(0,ce.default)(ne),(0,xe.default)(ne),(0,qt.default)(ne),(0,di.default)(ne),(0,pi.default)(ne),(0,gi.default)(ne),(0,Z.default)(ne),(0,_t.default)(ne),(0,gn.default)(ne),(0,Xt.default)(ne),(0,Pa.default)(ne),(0,vi.default)(ne),(0,xy.default)(ne),(0,Sy.default)(ne),(0,wy.default)(ne),(0,Ay.default)(ne),(0,ky.default)(ne),(0,Ry.default)(ne)}}},{"./urlMix":"2mRAc","./attrMix":"2EA19","./playMix":"fD2Tc","./pauseMix":"c3LGJ","./toggleMix":"fVsAa","./seekMix":"dmROF","./volumeMix":"9jtfB","./currentTimeMix":"7NCDR","./durationMix":"YS7JL","./switchMix":"dzUqN","./playbackRateMix":"5I2mT","./aspectRatioMix":"7m6R8","./screenshotMix":"2dgtR","./fullscreenMix":"fKDW8","./fullscreenWebMix":"lNvYI","./pipMix":"8j7oC","./loadedMix":"dwVOT","./playedMix":"dDeLx","./playingMix":"ceoBp","./autoSizeMix":"lcWXX","./rectMix":"f7y88","./flipMix":"l4qt5","./miniMix":"9ZPBQ","./posterMix":"5K8hA","./autoHeightMix":"3T5ls","./cssVarMix":"6KfHs","./themeMix":"7lcSc","./typeMix":"8JgTw","./stateMix":"cebt1","./subtitleOffsetMix":"hJvIy","./airplayMix":"4Tp0U","./qualityMix":"3wZgN","./thumbnailsMix":"k56Iy","./optionInit":"iPdgW","./eventInit":"3mj0J","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],"2mRAc":[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){let{option:u,template:{$video:c}}=a;(0,o.def)(a,"url",{get:()=>c.src,async set(f){if(f){let d=a.url,h=u.type||(0,o.getExt)(f),p=u.customType[h];h&&p?(await(0,o.sleep)(),a.loading.show=!0,p.call(a,c,f,a)):(URL.revokeObjectURL(d),c.src=f),d!==a.url&&(a.option.url=f,a.isReady&&d&&a.once("video:canplay",()=>{a.emit("restart",f)}))}else await(0,o.sleep)(),a.loading.show=!0}})}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],"2EA19":[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){let{template:{$video:u}}=a;(0,o.def)(a,"attr",{value(c,f){if(f===void 0)return u[c];u[c]=f}})}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],fD2Tc:[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){let{i18n:u,notice:c,option:f,constructor:{instances:d},template:{$video:h}}=a;(0,o.def)(a,"play",{value:async function(){let p=await h.play();if(c.show=u.get("Play"),a.emit("play"),f.mutex)for(let m=0;ml);var o=t("../utils");function l(a){let{template:{$video:u},i18n:c,notice:f}=a;(0,o.def)(a,"pause",{value(){let d=u.pause();return f.show=c.get("Pause"),a.emit("pause"),d}})}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],fVsAa:[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){(0,o.def)(a,"toggle",{value:()=>a.playing?a.pause():a.play()})}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],dmROF:[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){let{notice:u}=a;(0,o.def)(a,"seek",{set(c){a.currentTime=c,a.emit("seek",a.currentTime),a.duration&&(u.show=`${(0,o.secondToTime)(a.currentTime)} / ${(0,o.secondToTime)(a.duration)}`)}}),(0,o.def)(a,"forward",{set(c){a.seek=a.currentTime+c}}),(0,o.def)(a,"backward",{set(c){a.seek=a.currentTime-c}})}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],"9jtfB":[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){let{template:{$video:u},i18n:c,notice:f,storage:d}=a;(0,o.def)(a,"volume",{get:()=>u.volume||0,set:h=>{u.volume=(0,o.clamp)(h,0,1),f.show=`${c.get("Volume")}: ${parseInt(100*u.volume,10)}`,u.volume!==0&&d.set("volume",u.volume)}}),(0,o.def)(a,"muted",{get:()=>u.muted,set:h=>{u.muted=h,a.emit("muted",h)}})}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],"7NCDR":[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){let{$video:u}=a.template;(0,o.def)(a,"currentTime",{get:()=>u.currentTime||0,set:c=>{Number.isNaN(c=parseFloat(c))||(u.currentTime=(0,o.clamp)(c,0,a.duration))}})}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],YS7JL:[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){(0,o.def)(a,"duration",{get:()=>{let{duration:u}=a.template.$video;return u===1/0?0:u||0}})}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],dzUqN:[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){function u(c,f){return new Promise((d,h)=>{if(c===a.url)return;let{playing:p,aspectRatio:m,playbackRate:y}=a;a.pause(),a.url=c,a.notice.show="",a.once("video:error",h),a.once("video:loadedmetadata",()=>{a.currentTime=f}),a.once("video:canplay",async()=>{a.playbackRate=y,a.aspectRatio=m,p&&await a.play(),a.notice.show="",d()})})}(0,o.def)(a,"switchQuality",{value:c=>u(c,a.currentTime)}),(0,o.def)(a,"switchUrl",{value:c=>u(c,0)}),(0,o.def)(a,"switch",{set:a.switchUrl})}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],"5I2mT":[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){let{template:{$video:u},i18n:c,notice:f}=a;(0,o.def)(a,"playbackRate",{get:()=>u.playbackRate,set(d){d?d!==u.playbackRate&&(u.playbackRate=d,f.show=`${c.get("Rate")}: ${d===1?c.get("Normal"):`${d}x`}`):a.playbackRate=1}})}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],"7m6R8":[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){let{i18n:u,notice:c,template:{$video:f,$player:d}}=a;(0,o.def)(a,"aspectRatio",{get:()=>d.dataset.aspectRatio||"default",set(h){if(h||(h="default"),h==="default")(0,o.setStyle)(f,"width",null),(0,o.setStyle)(f,"height",null),(0,o.setStyle)(f,"margin",null),delete d.dataset.aspectRatio;else{let p=h.split(":").map(Number),{clientWidth:m,clientHeight:y}=d,g=p[0]/p[1];m/y>g?((0,o.setStyle)(f,"width",`${g*y}px`),(0,o.setStyle)(f,"height","100%"),(0,o.setStyle)(f,"margin","0 auto")):((0,o.setStyle)(f,"width","100%"),(0,o.setStyle)(f,"height",`${m/g}px`),(0,o.setStyle)(f,"margin","auto 0")),d.dataset.aspectRatio=h}c.show=`${u.get("Aspect Ratio")}: ${h==="default"?u.get("Default"):h}`,a.emit("aspectRatio",h)}})}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],"2dgtR":[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){let{notice:u,template:{$video:c}}=a,f=(0,o.createElement)("canvas");(0,o.def)(a,"getDataURL",{value:()=>new Promise((d,h)=>{try{f.width=c.videoWidth,f.height=c.videoHeight,f.getContext("2d").drawImage(c,0,0),d(f.toDataURL("image/png"))}catch(p){u.show=p,h(p)}})}),(0,o.def)(a,"getBlobUrl",{value:()=>new Promise((d,h)=>{try{f.width=c.videoWidth,f.height=c.videoHeight,f.getContext("2d").drawImage(c,0,0),f.toBlob(p=>{d(URL.createObjectURL(p))})}catch(p){u.show=p,h(p)}})}),(0,o.def)(a,"screenshot",{value:async d=>{let h=await a.getDataURL(),p=d||`artplayer_${(0,o.secondToTime)(c.currentTime)}`;return(0,o.download)(h,`${p}.png`),a.emit("screenshot",h),h}})}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],fKDW8:[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>u);var o=t("../libs/screenfull"),l=s.interopDefault(o),a=t("../utils");function u(c){let{i18n:f,notice:d,template:{$video:h,$player:p}}=c,m=g=>{l.default.on("change",()=>{g.emit("fullscreen",l.default.isFullscreen)}),l.default.on("error",v=>{g.emit("fullscreenError",v)}),(0,a.def)(g,"fullscreen",{get:()=>l.default.isFullscreen,async set(v){v?(g.state="fullscreen",await l.default.request(p),(0,a.addClass)(p,"art-fullscreen")):(await l.default.exit(),(0,a.removeClass)(p,"art-fullscreen")),g.emit("resize")}})},y=g=>{g.proxy(document,"webkitfullscreenchange",()=>{g.emit("fullscreen",g.fullscreen),g.emit("resize")}),(0,a.def)(g,"fullscreen",{get:()=>document.fullscreenElement===h,set(v){v?(g.state="fullscreen",h.webkitEnterFullscreen()):h.webkitExitFullscreen()}})};c.once("video:loadedmetadata",()=>{l.default.isEnabled?m(c):h.webkitSupportsFullscreen?y(c):(0,a.def)(c,"fullscreen",{get:()=>!1,set(){d.show=f.get("Fullscreen Not Supported")}}),(0,a.def)(c,"fullscreen",(0,a.get)(c,"fullscreen"))})}},{"../libs/screenfull":"lUahW","../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],lUahW:[function(t,n,i){t("@parcel/transformer-js/src/esmodule-helpers.js").defineInteropFlag(i);let s=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],o=(()=>{if(typeof document>"u")return!1;let u=s[0],c={};for(let f of s)if(f[1]in document){for(let[d,h]of f.entries())c[u[d]]=h;return c}return!1})(),l={change:o.fullscreenchange,error:o.fullscreenerror},a={request:(u=document.documentElement,c)=>new Promise((f,d)=>{let h=()=>{a.off("change",h),f()};a.on("change",h);let p=u[o.requestFullscreen](c);p instanceof Promise&&p.then(h).catch(d)}),exit:()=>new Promise((u,c)=>{if(!a.isFullscreen){u();return}let f=()=>{a.off("change",f),u()};a.on("change",f);let d=document[o.exitFullscreen]();d instanceof Promise&&d.then(f).catch(c)}),toggle:(u,c)=>a.isFullscreen?a.exit():a.request(u,c),onchange(u){a.on("change",u)},onerror(u){a.on("error",u)},on(u,c){let f=l[u];f&&document.addEventListener(f,c,!1)},off(u,c){let f=l[u];f&&document.removeEventListener(f,c,!1)},raw:o};Object.defineProperties(a,{isFullscreen:{get:()=>!!document[o.fullscreenElement]},element:{enumerable:!0,get:()=>document[o.fullscreenElement]},isEnabled:{enumerable:!0,get:()=>!!document[o.fullscreenEnabled]}}),o||(a={isEnabled:!1}),i.default=a},{"@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],lNvYI:[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){let{constructor:u,template:{$container:c,$player:f}}=a,d="";(0,o.def)(a,"fullscreenWeb",{get:()=>(0,o.hasClass)(f,"art-fullscreen-web"),set(h){h?(d=f.style.cssText,u.FULLSCREEN_WEB_IN_BODY&&(0,o.append)(document.body,f),a.state="fullscreenWeb",(0,o.setStyle)(f,"width","100%"),(0,o.setStyle)(f,"height","100%"),(0,o.addClass)(f,"art-fullscreen-web"),a.emit("fullscreenWeb",!0)):(u.FULLSCREEN_WEB_IN_BODY&&(0,o.append)(c,f),d&&(f.style.cssText=d,d=""),(0,o.removeClass)(f,"art-fullscreen-web"),a.emit("fullscreenWeb",!1)),a.emit("resize")}})}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],"8j7oC":[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){let{i18n:u,notice:c,template:{$video:f}}=a;document.pictureInPictureEnabled?function(d){let{template:{$video:h},proxy:p,notice:m}=d;h.disablePictureInPicture=!1,(0,o.def)(d,"pip",{get:()=>document.pictureInPictureElement,set(y){y?(d.state="pip",h.requestPictureInPicture().catch(g=>{throw m.show=g,g})):document.exitPictureInPicture().catch(g=>{throw m.show=g,g})}}),p(h,"enterpictureinpicture",()=>{d.emit("pip",!0)}),p(h,"leavepictureinpicture",()=>{d.emit("pip",!1)})}(a):f.webkitSupportsPresentationMode?function(d){let{$video:h}=d.template;h.webkitSetPresentationMode("inline"),(0,o.def)(d,"pip",{get:()=>h.webkitPresentationMode==="picture-in-picture",set(p){p?(d.state="pip",h.webkitSetPresentationMode("picture-in-picture"),d.emit("pip",!0)):(h.webkitSetPresentationMode("inline"),d.emit("pip",!1))}})}(a):(0,o.def)(a,"pip",{get:()=>!1,set(){c.show=u.get("PIP Not Supported")}})}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],dwVOT:[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){let{$video:u}=a.template;(0,o.def)(a,"loaded",{get:()=>a.loadedTime/u.duration}),(0,o.def)(a,"loadedTime",{get:()=>u.buffered.length?u.buffered.end(u.buffered.length-1):0})}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],dDeLx:[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){(0,o.def)(a,"played",{get:()=>a.currentTime/a.duration})}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],ceoBp:[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){let{$video:u}=a.template;(0,o.def)(a,"playing",{get:()=>u.currentTime>0&&!u.paused&&!u.ended&&u.readyState>2})}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],lcWXX:[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){let{$container:u,$player:c,$video:f}=a.template;(0,o.def)(a,"autoSize",{value(){let{videoWidth:d,videoHeight:h}=f,{width:p,height:m}=(0,o.getRect)(u),y=d/h;p/m>y?((0,o.setStyle)(c,"width",`${m*y/p*100}%`),(0,o.setStyle)(c,"height","100%")):((0,o.setStyle)(c,"width","100%"),(0,o.setStyle)(c,"height",`${p/y/m*100}%`)),a.emit("autoSize",{width:a.width,height:a.height})}})}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],f7y88:[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){(0,o.def)(a,"rect",{get:()=>(0,o.getRect)(a.template.$player)});let u=["bottom","height","left","right","top","width"];for(let c=0;ca.rect[f]})}(0,o.def)(a,"x",{get:()=>a.left+window.pageXOffset}),(0,o.def)(a,"y",{get:()=>a.top+window.pageYOffset})}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],l4qt5:[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){let{template:{$player:u},i18n:c,notice:f}=a;(0,o.def)(a,"flip",{get:()=>u.dataset.flip||"normal",set(d){d||(d="normal"),d==="normal"?delete u.dataset.flip:u.dataset.flip=d,f.show=`${c.get("Video Flip")}: ${c.get((0,o.capitalize)(d))}`,a.emit("flip",d)}})}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],"9ZPBQ":[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){let{icons:u,proxy:c,storage:f,template:{$player:d,$video:h}}=a,p=!1,m=0,y=0;function g(){let{$mini:S}=a.template;S&&((0,o.removeClass)(d,"art-mini"),(0,o.setStyle)(S,"display","none"),d.prepend(h),a.emit("mini",!1))}function v(S,E){a.playing?((0,o.setStyle)(S,"display","none"),(0,o.setStyle)(E,"display","flex")):((0,o.setStyle)(S,"display","flex"),(0,o.setStyle)(E,"display","none"))}function x(){let{$mini:S}=a.template,E=(0,o.getRect)(S),b=window.innerHeight-E.height-50,w=window.innerWidth-E.width-50;f.set("top",b),f.set("left",w),(0,o.setStyle)(S,"top",`${b}px`),(0,o.setStyle)(S,"left",`${w}px`)}(0,o.def)(a,"mini",{get:()=>(0,o.hasClass)(d,"art-mini"),set(S){if(S){a.state="mini",(0,o.addClass)(d,"art-mini");let E=function(){let{$mini:A}=a.template;if(A)return(0,o.append)(A,h),(0,o.setStyle)(A,"display","flex");{let R=(0,o.createElement)("div");(0,o.addClass)(R,"art-mini-popup"),(0,o.append)(document.body,R),a.template.$mini=R,(0,o.append)(R,h);let L=(0,o.append)(R,'
');(0,o.append)(L,u.close),c(L,"click",g);let C=(0,o.append)(R,'
'),_=(0,o.append)(C,u.play),k=(0,o.append)(C,u.pause);return c(_,"click",()=>a.play()),c(k,"click",()=>a.pause()),v(_,k),a.on("video:playing",()=>v(_,k)),a.on("video:pause",()=>v(_,k)),a.on("video:timeupdate",()=>v(_,k)),c(R,"mousedown",M=>{p=M.button===0,m=M.pageX,y=M.pageY}),a.on("document:mousemove",M=>{if(p){(0,o.addClass)(R,"art-mini-droging");let O=M.pageX-m,U=M.pageY-y;(0,o.setStyle)(R,"transform",`translate(${O}px, ${U}px)`)}}),a.on("document:mouseup",()=>{if(p){p=!1,(0,o.removeClass)(R,"art-mini-droging");let M=(0,o.getRect)(R);f.set("left",M.left),f.set("top",M.top),(0,o.setStyle)(R,"left",`${M.left}px`),(0,o.setStyle)(R,"top",`${M.top}px`),(0,o.setStyle)(R,"transform",null)}}),R}}(),b=f.get("top"),w=f.get("left");b&&w?((0,o.setStyle)(E,"top",`${b}px`),(0,o.setStyle)(E,"left",`${w}px`),(0,o.isInViewport)(E)||x()):x(),a.emit("mini",!0)}else g()}})}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],"5K8hA":[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){let{template:{$poster:u}}=a;(0,o.def)(a,"poster",{get:()=>{try{return u.style.backgroundImage.match(/"(.*)"/)[1]}catch{return""}},set(c){(0,o.setStyle)(u,"backgroundImage",`url(${c})`)}})}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],"3T5ls":[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){let{template:{$container:u,$video:c}}=a;(0,o.def)(a,"autoHeight",{value(){let{clientWidth:f}=u,{videoHeight:d,videoWidth:h}=c,p=f/h*d;(0,o.setStyle)(u,"height",p+"px"),a.emit("autoHeight",p)}})}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],"6KfHs":[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){let{$player:u}=a.template;(0,o.def)(a,"cssVar",{value:(c,f)=>f?u.style.setProperty(c,f):getComputedStyle(u).getPropertyValue(c)})}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],"7lcSc":[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){(0,o.def)(a,"theme",{get:()=>a.cssVar("--art-theme"),set(u){a.cssVar("--art-theme",u)}})}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],"8JgTw":[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){(0,o.def)(a,"type",{get:()=>a.option.type,set(u){a.option.type=u}})}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],cebt1:[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){let u=["mini","pip","fullscreen","fullscreenWeb"];(0,o.def)(a,"state",{get:()=>u.find(c=>a[c])||"standard",set(c){for(let f=0;fl);var o=t("../utils");function l(a){let{clamp:u}=a.constructor.utils,{notice:c,template:f,i18n:d}=a,h=0,p=[];a.on("subtitle:switch",()=>{p=[]}),(0,o.def)(a,"subtitleOffset",{get:()=>h,set(m){if(f.$track&&f.$track.track){let y=Array.from(f.$track.track.cues);h=u(m,-5,5);for(let g=0;gl);var o=t("../utils");function l(a){let{i18n:u,notice:c,proxy:f,template:{$video:d}}=a,h=!0;window.WebKitPlaybackTargetAvailabilityEvent&&d.webkitShowPlaybackTargetPicker?f(d,"webkitplaybacktargetavailabilitychanged",p=>{switch(p.availability){case"available":h=!0;break;case"not-available":h=!1}}):h=!1,(0,o.def)(a,"airplay",{value(){h?(d.webkitShowPlaybackTargetPicker(),a.emit("airplay")):c.show=u.get("AirPlay Not Available")}})}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],"3wZgN":[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){(0,o.def)(a,"quality",{set(u){let{controls:c,notice:f,i18n:d}=a,h=u.find(p=>p.default)||u[0];c.update({name:"quality",position:"right",index:10,style:{marginRight:"10px"},html:h?h.html:"",selector:u,async onSelect(p){await a.switchQuality(p.url),f.show=`${d.get("Switch Video")}: ${p.html}`}})}})}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],k56Iy:[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){let{option:u,events:{loadImg:c},template:{$progress:f,$video:d}}=a,h=null,p=null,m=!1,y=!1;a.on("setBar",async(g,v,x)=>{var w;let S=(w=a.controls)==null?void 0:w.thumbnails,{url:E}=u.thumbnails;if(!S||!E)return;let b=g==="played"&&x&&o.isMobile;if(g==="hover"||b){if(m||(m=!0,p=await c(E),y=!0),!y)return;let A=f.clientWidth*v;(0,o.setStyle)(S,"display","flex"),A>0&&Af.clientWidth-U/2?(0,o.setStyle)(L,"left",`${f.clientWidth-U}px`):(0,o.setStyle)(L,"left",`${R-U/2}px`)}(A):o.isMobile||(0,o.setStyle)(S,"display","none"),b&&(clearTimeout(h),h=setTimeout(()=>{(0,o.setStyle)(S,"display","none")},500))}}),(0,o.def)(a,"thumbnails",{get:()=>a.option.thumbnails,set(g){g.url&&!a.option.isLive&&(a.option.thumbnails=g,clearTimeout(h),h=null,p=null,m=!1,y=!1)}})}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],iPdgW:[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){let{option:u,storage:c,template:{$video:f,$poster:d}}=a;for(let p in u.moreVideoAttr)a.attr(p,u.moreVideoAttr[p]);u.muted&&(a.muted=u.muted),u.volume&&(f.volume=(0,o.clamp)(u.volume,0,1));let h=c.get("volume");for(let p in typeof h=="number"&&(f.volume=(0,o.clamp)(h,0,1)),u.poster&&(0,o.setStyle)(d,"backgroundImage",`url(${u.poster})`),u.autoplay&&(f.autoplay=u.autoplay),u.playsInline&&(f.playsInline=!0,f["webkit-playsinline"]=!0),u.theme&&(u.cssVar["--art-theme"]=u.theme),u.cssVar)a.cssVar(p,u.cssVar[p]);a.url=u.url}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],"3mj0J":[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>u);var o=t("../config"),l=s.interopDefault(o),a=t("../utils");function u(c){let{i18n:f,notice:d,option:h,constructor:p,proxy:m,template:{$player:y,$video:g,$poster:v}}=c,x=0;for(let S=0;S{c.emit(`video:${E.type}`,E)});c.on("video:canplay",()=>{x=0,c.loading.show=!1}),c.once("video:canplay",()=>{c.loading.show=!1,c.controls.show=!0,c.mask.show=!0,c.isReady=!0,c.emit("ready")}),c.on("video:ended",()=>{h.loop?(c.seek=0,c.play(),c.controls.show=!1,c.mask.show=!1):(c.controls.show=!0,c.mask.show=!0)}),c.on("video:error",async S=>{x{c.emit("resize"),a.isMobile&&(c.loading.show=!1,c.controls.show=!0,c.mask.show=!0)}),c.on("video:loadstart",()=>{c.loading.show=!0,c.mask.show=!1,c.controls.show=!0}),c.on("video:pause",()=>{c.controls.show=!0,c.mask.show=!0}),c.on("video:play",()=>{c.mask.show=!1,(0,a.setStyle)(v,"display","none")}),c.on("video:playing",()=>{c.mask.show=!1}),c.on("video:progress",()=>{c.playing&&(c.loading.show=!1)}),c.on("video:seeked",()=>{c.loading.show=!1,c.mask.show=!0}),c.on("video:seeking",()=>{c.loading.show=!0,c.mask.show=!1}),c.on("video:timeupdate",()=>{c.mask.show=!1}),c.on("video:waiting",()=>{c.loading.show=!0,c.mask.show=!1})}},{"../config":"9Xmqu","../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],"14IBq":[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i);var o=t("../utils"),l=t("../utils/component"),a=s.interopDefault(l),u=t("./fullscreen"),c=s.interopDefault(u),f=t("./fullscreenWeb"),d=s.interopDefault(f),h=t("./pip"),p=s.interopDefault(h),m=t("./playAndPause"),y=s.interopDefault(m),g=t("./progress"),v=s.interopDefault(g),x=t("./time"),S=s.interopDefault(x),E=t("./volume"),b=s.interopDefault(E),w=t("./setting"),A=s.interopDefault(w),R=t("./screenshot"),L=s.interopDefault(R),C=t("./airplay"),_=s.interopDefault(C);class k extends a.default{constructor(O){super(O),this.isHover=!1,this.name="control",this.timer=Date.now();let{constructor:U}=O,{$player:G,$bottom:B}=this.art.template;O.on("mousemove",()=>{o.isMobile||(this.show=!0)}),O.on("click",()=>{o.isMobile?this.toggle():this.show=!0}),O.on("document:mousemove",F=>{this.isHover=(0,o.includeFromEvent)(F,B)}),O.on("video:timeupdate",()=>{!O.setting.show&&!this.isHover&&!O.isInput&&O.playing&&this.show&&Date.now()-this.timer>=U.CONTROL_HIDE_TIME&&(this.show=!1)}),O.on("control",F=>{F?((0,o.removeClass)(G,"art-hide-cursor"),(0,o.addClass)(G,"art-hover"),this.timer=Date.now()):((0,o.addClass)(G,"art-hide-cursor"),(0,o.removeClass)(G,"art-hover"))}),this.init()}init(){let{option:O}=this.art;O.isLive||this.add((0,v.default)({name:"progress",position:"top",index:10})),this.add({name:"thumbnails",position:"top",index:20}),this.add((0,y.default)({name:"playAndPause",position:"left",index:10})),this.add((0,b.default)({name:"volume",position:"left",index:20})),O.isLive||this.add((0,S.default)({name:"time",position:"left",index:30})),O.quality.length&&(0,o.sleep)().then(()=>{this.art.quality=O.quality}),O.screenshot&&!o.isMobile&&this.add((0,L.default)({name:"screenshot",position:"right",index:20})),O.setting&&this.add((0,A.default)({name:"setting",position:"right",index:30})),O.pip&&this.add((0,p.default)({name:"pip",position:"right",index:40})),O.airplay&&window.WebKitPlaybackTargetAvailabilityEvent&&this.add((0,_.default)({name:"airplay",position:"right",index:50})),O.fullscreenWeb&&this.add((0,d.default)({name:"fullscreenWeb",position:"right",index:60})),O.fullscreen&&this.add((0,c.default)({name:"fullscreen",position:"right",index:70}));for(let U=0;UNumber(S.dataset.index)>=Number(y.dataset.index));v?v.insertAdjacentElement("beforebegin",y):(0,o.append)(this.$parent,y),h.html&&(0,o.append)(y,h.html),h.style&&(0,o.setStyles)(y,h.style),h.tooltip&&(0,o.tooltip)(y,h.tooltip);let x=[];if(h.click){let S=this.art.events.proxy(y,"click",E=>{E.preventDefault(),h.click.call(this.art,this,E)});x.push(S)}return h.selector&&["left","right"].includes(h.position)&&this.addSelector(h,y,x),this[p]=y,this.cache.set(p,{$ref:y,events:x,option:h}),h.mounted&&h.mounted.call(this.art,y),y}addSelector(d,h,p){let{hover:m,proxy:y}=this.art.events;(0,o.addClass)(h,"art-control-selector");let g=(0,o.createElement)("div");(0,o.addClass)(g,"art-selector-value"),(0,o.append)(g,d.html),h.innerText="",(0,o.append)(h,g);let v=d.selector.map((b,w)=>`
${b.html}
`).join(""),x=(0,o.createElement)("div");(0,o.addClass)(x,"art-selector-list"),(0,o.append)(x,v),(0,o.append)(h,x);let S=()=>{let b=(0,o.getStyle)(h,"width"),w=(0,o.getStyle)(x,"width");x.style.left=`${b/2-w/2}px`};m(h,S);let E=y(x,"click",async b=>{let w=(b.composedPath()||[]).find(L=>(0,o.hasClass)(L,"art-selector-item"));if(!w)return;(0,o.inverseClass)(w,"art-current");let A=Number(w.dataset.index),R=d.selector[A]||{};if(g.innerText=w.innerText,d.onSelect){let L=await d.onSelect.call(this.art,R,w,b);(0,l.isStringOrNumber)(L)&&(g.innerHTML=L)}S()});p.push(E)}remove(d){let h=this.cache.get(d);(0,a.errorHandle)(h,`Can't find [${d}] from the [${this.name}]`),h.option.beforeUnmount&&h.option.beforeUnmount.call(this.art,h.$ref);for(let p=0;pl);var o=t("../utils");function l(a){return u=>({...a,tooltip:u.i18n.get("Fullscreen"),mounted:c=>{let{proxy:f,icons:d,i18n:h}=u,p=(0,o.append)(c,d.fullscreenOn),m=(0,o.append)(c,d.fullscreenOff);(0,o.setStyle)(m,"display","none"),f(c,"click",()=>{u.fullscreen=!u.fullscreen}),u.on("fullscreen",y=>{y?((0,o.tooltip)(c,h.get("Exit Fullscreen")),(0,o.setStyle)(p,"display","none"),(0,o.setStyle)(m,"display","inline-flex")):((0,o.tooltip)(c,h.get("Fullscreen")),(0,o.setStyle)(p,"display","inline-flex"),(0,o.setStyle)(m,"display","none"))})}})}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],"66eEC":[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){return u=>({...a,tooltip:u.i18n.get("Web Fullscreen"),mounted:c=>{let{proxy:f,icons:d,i18n:h}=u,p=(0,o.append)(c,d.fullscreenWebOn),m=(0,o.append)(c,d.fullscreenWebOff);(0,o.setStyle)(m,"display","none"),f(c,"click",()=>{u.fullscreenWeb=!u.fullscreenWeb}),u.on("fullscreenWeb",y=>{y?((0,o.tooltip)(c,h.get("Exit Web Fullscreen")),(0,o.setStyle)(p,"display","none"),(0,o.setStyle)(m,"display","inline-flex")):((0,o.tooltip)(c,h.get("Web Fullscreen")),(0,o.setStyle)(p,"display","inline-flex"),(0,o.setStyle)(m,"display","none"))})}})}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],kCFkA:[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){return u=>({...a,tooltip:u.i18n.get("PIP Mode"),mounted:c=>{let{proxy:f,icons:d,i18n:h}=u;(0,o.append)(c,d.pip),f(c,"click",()=>{u.pip=!u.pip}),u.on("pip",p=>{(0,o.tooltip)(c,h.get(p?"Exit PIP Mode":"PIP Mode"))})}})}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],iRhgD:[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){return u=>({...a,mounted:c=>{let{proxy:f,icons:d,i18n:h}=u,p=(0,o.append)(c,d.play),m=(0,o.append)(c,d.pause);function y(){(0,o.setStyle)(p,"display","flex"),(0,o.setStyle)(m,"display","none")}function g(){(0,o.setStyle)(p,"display","none"),(0,o.setStyle)(m,"display","flex")}(0,o.tooltip)(p,h.get("Play")),(0,o.tooltip)(m,h.get("Pause")),f(p,"click",()=>{u.play()}),f(m,"click",()=>{u.pause()}),u.playing?g():y(),u.on("video:playing",()=>{g()}),u.on("video:pause",()=>{y()})}})}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],aBBSH:[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"getPosFromEvent",()=>l),s.export(i,"setCurrentTime",()=>a),s.export(i,"default",()=>u);var o=t("../utils");function l(c,f){let{$progress:d}=c.template,{left:h}=(0,o.getRect)(d),p=o.isMobile?f.touches[0].clientX:f.clientX,m=(0,o.clamp)(p-h,0,d.clientWidth),y=m/d.clientWidth*c.duration,g=(0,o.secondToTime)(y),v=(0,o.clamp)(m/d.clientWidth,0,1);return{second:y,time:g,width:m,percentage:v}}function a(c,f){if(c.isRotate){let d=f.touches[0].clientY/c.height,h=d*c.duration;c.emit("setBar","played",d,f),c.seek=h}else{let{second:d,percentage:h}=l(c,f);c.emit("setBar","played",h,f),c.seek=d}}function u(c){return f=>{let{icons:d,option:h,proxy:p}=f;return{...c,html:'
',mounted:m=>{let y=null,g=!1,v=(0,o.query)(".art-progress-hover",m),x=(0,o.query)(".art-progress-loaded",m),S=(0,o.query)(".art-progress-played",m),E=(0,o.query)(".art-progress-highlight",m),b=(0,o.query)(".art-progress-indicator",m),w=(0,o.query)(".art-progress-tip",m);function A(R,L){let{width:C,time:_}=L||l(f,R);w.innerText=_;let k=w.clientWidth;C<=k/2?(0,o.setStyle)(w,"left",0):C>m.clientWidth-k/2?(0,o.setStyle)(w,"left",`${m.clientWidth-k}px`):(0,o.setStyle)(w,"left",`${C-k/2}px`)}d.indicator?(0,o.append)(b,d.indicator):(0,o.setStyle)(b,"backgroundColor","var(--art-theme)"),f.on("setBar",function(R,L,C){let _=R==="played"&&C&&o.isMobile;R==="loaded"&&(0,o.setStyle)(x,"width",`${100*L}%`),R==="hover"&&(0,o.setStyle)(v,"width",`${100*L}%`),R==="played"&&((0,o.setStyle)(S,"width",`${100*L}%`),(0,o.setStyle)(b,"left",`${100*L}%`)),_&&((0,o.setStyle)(w,"display","flex"),A(C,{width:m.clientWidth*L,time:(0,o.secondToTime)(L*f.duration)}),clearTimeout(y),y=setTimeout(()=>{(0,o.setStyle)(w,"display","none")},500))}),f.on("video:loadedmetadata",function(){E.innerText="";for(let R=0;R`;(0,o.append)(E,_)}}),f.on("video:progress",()=>{f.emit("setBar","loaded",f.loaded)}),f.constructor.USE_RAF?f.on("raf",()=>{f.emit("setBar","played",f.played)}):f.on("video:timeupdate",()=>{f.emit("setBar","played",f.played)}),f.on("video:ended",()=>{f.emit("setBar","played",1)}),f.emit("setBar","loaded",f.loaded||0),o.isMobile||(p(m,"click",R=>{R.target!==b&&a(f,R)}),p(m,"mousemove",R=>{let{percentage:L}=l(f,R);f.emit("setBar","hover",L,R),(0,o.setStyle)(w,"display","flex"),(0,o.includeFromEvent)(R,E)?function(C){let{width:_}=l(f,C),{text:k}=C.target.dataset;w.innerText=k;let M=w.clientWidth;_<=M/2?(0,o.setStyle)(w,"left",0):_>m.clientWidth-M/2?(0,o.setStyle)(w,"left",`${m.clientWidth-M}px`):(0,o.setStyle)(w,"left",`${_-M/2}px`)}(R):A(R)}),p(m,"mouseleave",R=>{(0,o.setStyle)(w,"display","none"),f.emit("setBar","hover",0,R)}),p(m,"mousedown",R=>{g=R.button===0}),f.on("document:mousemove",R=>{if(g){let{second:L,percentage:C}=l(f,R);f.emit("setBar","played",C,R),f.seek=L}}),f.on("document:mouseup",()=>{g&&(g=!1)}))}}}}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],"7H0CE":[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){return u=>({...a,style:o.isMobile?{fontSize:"12px",padding:"0 5px"}:{cursor:"auto",padding:"0 10px"},mounted:c=>{function f(){let h=`${(0,o.secondToTime)(u.currentTime)} / ${(0,o.secondToTime)(u.duration)}`;h!==c.innerText&&(c.innerText=h)}f();let d=["video:loadedmetadata","video:timeupdate","video:progress"];for(let h=0;hl);var o=t("../utils");function l(a){return u=>({...a,mounted:c=>{let{proxy:f,icons:d}=u,h=(0,o.append)(c,d.volume),p=(0,o.append)(c,d.volumeClose),m=(0,o.append)(c,'
'),y=(0,o.append)(m,'
'),g=(0,o.append)(y,'
'),v=(0,o.append)(y,'
'),x=(0,o.append)(v,'
'),S=(0,o.append)(x,'
'),E=(0,o.append)(v,'
');function b(A){let{top:R,height:L}=(0,o.getRect)(v);return 1-(A.clientY-R)/L}function w(){if(u.muted||u.volume===0)(0,o.setStyle)(h,"display","none"),(0,o.setStyle)(p,"display","flex"),(0,o.setStyle)(E,"top","100%"),(0,o.setStyle)(S,"top","100%"),g.innerText=0;else{let A=100*u.volume;(0,o.setStyle)(h,"display","flex"),(0,o.setStyle)(p,"display","none"),(0,o.setStyle)(E,"top",`${100-A}%`),(0,o.setStyle)(S,"top",`${100-A}%`),g.innerText=Math.floor(A)}}if(w(),u.on("video:volumechange",w),f(h,"click",()=>{u.muted=!0}),f(p,"click",()=>{u.muted=!1}),o.isMobile)(0,o.setStyle)(m,"display","none");else{let A=!1;f(v,"mousedown",R=>{A=R.button===0,u.volume=b(R)}),u.on("document:mousemove",R=>{A&&(u.muted=!1,u.volume=b(R))}),u.on("document:mouseup",()=>{A&&(A=!1)})}}})}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],"8BrCu":[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){return u=>({...a,tooltip:u.i18n.get("Show Setting"),mounted:c=>{let{proxy:f,icons:d,i18n:h}=u;(0,o.append)(c,d.setting),f(c,"click",()=>{u.setting.toggle(),u.setting.updateStyle()}),u.on("setting",p=>{(0,o.tooltip)(c,h.get(p?"Hide Setting":"Show Setting"))})}})}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],c1GeG:[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){return u=>({...a,tooltip:u.i18n.get("Screenshot"),mounted:c=>{let{proxy:f,icons:d}=u;(0,o.append)(c,d.screenshot),f(c,"click",()=>{u.screenshot()})}})}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],"6GRju":[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){return u=>({...a,tooltip:u.i18n.get("AirPlay"),mounted:c=>{let{proxy:f,icons:d}=u;(0,o.append)(c,d.airplay),f(c,"click",()=>u.airplay())}})}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],"7iUum":[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i);var o=t("../utils"),l=t("../utils/component"),a=s.interopDefault(l),u=t("./playbackRate"),c=s.interopDefault(u),f=t("./aspectRatio"),d=s.interopDefault(f),h=t("./flip"),p=s.interopDefault(h),m=t("./info"),y=s.interopDefault(m),g=t("./version"),v=s.interopDefault(g),x=t("./close"),S=s.interopDefault(x);class E extends a.default{constructor(w){super(w),this.name="contextmenu",this.$parent=w.template.$contextmenu,o.isMobile||this.init()}init(){let{option:w,proxy:A,template:{$player:R,$contextmenu:L}}=this.art;w.playbackRate&&this.add((0,c.default)({name:"playbackRate",index:10})),w.aspectRatio&&this.add((0,d.default)({name:"aspectRatio",index:20})),w.flip&&this.add((0,p.default)({name:"flip",index:30})),this.add((0,y.default)({name:"info",index:40})),this.add((0,v.default)({name:"version",index:50})),this.add((0,S.default)({name:"close",index:60}));for(let C=0;C{if(!this.art.constructor.CONTEXTMENU)return;C.preventDefault(),this.show=!0;let _=C.clientX,k=C.clientY,{height:M,width:O,left:U,top:G}=(0,o.getRect)(R),{height:B,width:F}=(0,o.getRect)(L),N=_-U,K=k-G;_+F>U+O&&(N=O-F),k+B>G+M&&(K=M-B),(0,o.setStyles)(L,{top:`${K}px`,left:`${N}px`})}),A(R,"click",C=>{(0,o.includeFromEvent)(C,L)||(this.show=!1)}),this.art.on("blur",()=>{this.show=!1})}}i.default=E},{"../utils":"h3rH9","../utils/component":"guki8","./playbackRate":"f1W36","./aspectRatio":"afxZC","./flip":"9jCuX","./info":"k8wIZ","./version":"bb0TU","./close":"9zTkI","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],f1W36:[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){return u=>{let{i18n:c,constructor:{PLAYBACK_RATE:f}}=u,d=f.map(h=>`${h===1?c.get("Normal"):h.toFixed(1)}`).join("");return{...a,html:`${c.get("Play Speed")}: ${d}`,click:(h,p)=>{let{value:m}=p.target.dataset;m&&(u.playbackRate=Number(m),h.show=!1)},mounted:h=>{let p=(0,o.query)('[data-value="1"]',h);p&&(0,o.inverseClass)(p,"art-current"),u.on("video:ratechange",()=>{let m=(0,o.queryAll)("span",h).find(y=>Number(y.dataset.value)===u.playbackRate);m&&(0,o.inverseClass)(m,"art-current")})}}}}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],afxZC:[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){return u=>{let{i18n:c,constructor:{ASPECT_RATIO:f}}=u,d=f.map(h=>`${h==="default"?c.get("Default"):h}`).join("");return{...a,html:`${c.get("Aspect Ratio")}: ${d}`,click:(h,p)=>{let{value:m}=p.target.dataset;m&&(u.aspectRatio=m,h.show=!1)},mounted:h=>{let p=(0,o.query)('[data-value="default"]',h);p&&(0,o.inverseClass)(p,"art-current"),u.on("aspectRatio",m=>{let y=(0,o.queryAll)("span",h).find(g=>g.dataset.value===m);y&&(0,o.inverseClass)(y,"art-current")})}}}}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],"9jCuX":[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){return u=>{let{i18n:c,constructor:{FLIP:f}}=u,d=f.map(h=>`${c.get((0,o.capitalize)(h))}`).join("");return{...a,html:`${c.get("Video Flip")}: ${d}`,click:(h,p)=>{let{value:m}=p.target.dataset;m&&(u.flip=m.toLowerCase(),h.show=!1)},mounted:h=>{let p=(0,o.query)('[data-value="normal"]',h);p&&(0,o.inverseClass)(p,"art-current"),u.on("flip",m=>{let y=(0,o.queryAll)("span",h).find(g=>g.dataset.value===m);y&&(0,o.inverseClass)(y,"art-current")})}}}}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],k8wIZ:[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");function o(l){return a=>({...l,html:a.i18n.get("Video Info"),click:u=>{a.info.show=!0,u.show=!1}})}s.defineInteropFlag(i),s.export(i,"default",()=>o)},{"@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],bb0TU:[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");function o(l){return{...l,html:'ArtPlayer 5.1.7'}}s.defineInteropFlag(i),s.export(i,"default",()=>o)},{"@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],"9zTkI":[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");function o(l){return a=>({...l,html:a.i18n.get("Close"),click:u=>{u.show=!1}})}s.defineInteropFlag(i),s.export(i,"default",()=>o)},{"@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],hD2Lg:[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i);var o=t("./utils"),l=t("./utils/component"),a=s.interopDefault(l);class u extends a.default{constructor(f){super(f),this.name="info",o.isMobile||this.init()}init(){let{proxy:f,constructor:d,template:{$infoPanel:h,$infoClose:p,$video:m}}=this.art;f(p,"click",()=>{this.show=!1});let y=null,g=(0,o.queryAll)("[data-video]",h)||[];this.art.on("destroy",()=>clearTimeout(y)),function v(){for(let x=0;xnull,this.init(m.option.subtitle);let y=!1;m.on("video:timeupdate",()=>{if(!this.url)return;let g=this.art.template.$video.webkitDisplayingFullscreen;typeof g=="boolean"&&g!==y&&(y=g,this.createTrack(g?"subtitles":"metadata",this.url))})}get url(){return this.art.template.$track.src}set url(m){this.switch(m)}get textTrack(){return this.art.template.$video.textTracks[0]}get activeCue(){return this.textTrack.activeCues[0]}style(m,y){let{$subtitle:g}=this.art.template;return typeof m=="object"?(0,o.setStyles)(g,m):(0,o.setStyle)(g,m,y)}update(){let{$subtitle:m}=this.art.template;m.innerHTML="",this.activeCue&&(this.art.option.subtitle.escape?m.innerHTML=this.activeCue.text.split(/\r?\n/).map(y=>`
${(0,o.escape)(y)}
`).join(""):m.innerHTML=this.activeCue.text,this.art.emit("subtitleUpdate",this.activeCue.text))}async switch(m,y={}){let{i18n:g,notice:v,option:x}=this.art,S={...x.subtitle,...y,url:m},E=await this.init(S);return y.name&&(v.show=`${g.get("Switch Subtitle")}: ${y.name}`),E}createTrack(m,y){let{template:g,proxy:v,option:x}=this.art,{$video:S,$track:E}=g,b=(0,o.createElement)("track");b.default=!0,b.kind=m,b.src=y,b.label=x.subtitle.name||"Artplayer",b.track.mode="hidden",this.eventDestroy(),(0,o.remove)(E),(0,o.append)(S,b),g.$track=b,this.eventDestroy=v(this.textTrack,"cuechange",()=>this.update())}async init(m){let{notice:y,template:{$subtitle:g}}=this.art;if((0,c.default)(m,d.default.subtitle),m.url)return this.style(m.style),fetch(m.url).then(v=>v.arrayBuffer()).then(v=>{let x=new TextDecoder(m.encoding).decode(v);switch(this.art.emit("subtitleLoad",m.url),m.type||(0,o.getExt)(m.url)){case"srt":{let S=(0,o.srtToVtt)(x),E=m.onVttLoad(S);return(0,o.vttToBlob)(E)}case"ass":{let S=(0,o.assToVtt)(x),E=m.onVttLoad(S);return(0,o.vttToBlob)(E)}case"vtt":{let S=m.onVttLoad(x);return(0,o.vttToBlob)(S)}default:return m.url}}).then(v=>(g.innerHTML="",this.url===v||(URL.revokeObjectURL(this.url),this.createTrack("metadata",v),this.art.emit("subtitleSwitch",v)),v)).catch(v=>{throw g.innerHTML="",y.show=v,v})}}i.default=h},{"./utils":"h3rH9","./utils/component":"guki8","option-validator":"9I0i9","./scheme":"AdvwB","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],"1Epl5":[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i);var o=t("../utils/error"),l=t("./clickInit"),a=s.interopDefault(l),u=t("./hoverInit"),c=s.interopDefault(u),f=t("./moveInit"),d=s.interopDefault(f),h=t("./resizeInit"),p=s.interopDefault(h),m=t("./gestureInit"),y=s.interopDefault(m),g=t("./viewInit"),v=s.interopDefault(g),x=t("./documentInit"),S=s.interopDefault(x),E=t("./updateInit"),b=s.interopDefault(E);i.default=class{constructor(w){this.destroyEvents=[],this.proxy=this.proxy.bind(this),this.hover=this.hover.bind(this),this.loadImg=this.loadImg.bind(this),(0,a.default)(w,this),(0,c.default)(w,this),(0,d.default)(w,this),(0,p.default)(w,this),(0,y.default)(w,this),(0,v.default)(w,this),(0,S.default)(w,this),(0,b.default)(w,this)}proxy(w,A,R,L={}){if(Array.isArray(A))return A.map(_=>this.proxy(w,_,R,L));w.addEventListener(A,R,L);let C=()=>w.removeEventListener(A,R,L);return this.destroyEvents.push(C),C}hover(w,A,R){A&&this.proxy(w,"mouseenter",A),R&&this.proxy(w,"mouseleave",R)}loadImg(w){return new Promise((A,R)=>{let L;if(w instanceof HTMLImageElement)L=w;else{if(typeof w!="string")return R(new o.ArtPlayerError("Unable to get Image"));(L=new Image).src=w}if(L.complete)return A(L);this.proxy(L,"load",()=>A(L)),this.proxy(L,"error",()=>R(new o.ArtPlayerError(`Failed to load Image: ${L.src}`)))})}remove(w){let A=this.destroyEvents.indexOf(w);A>-1&&(w(),this.destroyEvents.splice(A,1))}destroy(){for(let w=0;wl);var o=t("../utils");function l(a,u){let{constructor:c,template:{$player:f,$video:d}}=a;u.proxy(document,["click","contextmenu"],p=>{(0,o.includeFromEvent)(p,f)?(a.isInput=p.target.tagName==="INPUT",a.isFocus=!0,a.emit("focus",p)):(a.isInput=!1,a.isFocus=!1,a.emit("blur",p))});let h=[];u.proxy(d,"click",p=>{let m=Date.now();h.push(m);let{MOBILE_CLICK_PLAY:y,DBCLICK_TIME:g,MOBILE_DBCLICK_PLAY:v,DBCLICK_FULLSCREEN:x}=c,S=h.filter(E=>m-E<=g);switch(S.length){case 1:a.emit("click",p),o.isMobile?!a.isLock&&y&&a.toggle():a.toggle(),h=S;break;case 2:a.emit("dblclick",p),o.isMobile?!a.isLock&&v&&a.toggle():x&&(a.fullscreen=!a.fullscreen),h=[];break;default:h=[]}})}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],kpTJf:[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a,u){let{$player:c}=a.template;u.hover(c,f=>{(0,o.addClass)(c,"art-hover"),a.emit("hover",!0,f)},f=>{(0,o.removeClass)(c,"art-hover"),a.emit("hover",!1,f)})}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],ef6qz:[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");function o(l,a){let{$player:u}=l.template;a.proxy(u,"mousemove",c=>{l.emit("mousemove",c)})}s.defineInteropFlag(i),s.export(i,"default",()=>o)},{"@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],"9TXOX":[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a,u){let{option:c,constructor:f}=a;a.on("resize",()=>{let{aspectRatio:h,notice:p}=a;a.state==="standard"&&c.autoSize&&a.autoSize(),a.aspectRatio=h,p.show=""});let d=(0,o.debounce)(()=>a.emit("resize"),f.RESIZE_TIME);u.proxy(window,["orientationchange","resize"],()=>d()),screen&&screen.orientation&&screen.orientation.onchange&&u.proxy(screen.orientation,"change",()=>d())}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],dePMU:[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>a);var o=t("../utils"),l=t("../control/progress");function a(u,c){if(o.isMobile&&!u.option.isLive){let{$video:f,$progress:d}=u.template,h=null,p=!1,m=0,y=0,g=0,v=S=>{if(S.touches.length===1&&!u.isLock){h===d&&(0,l.setCurrentTime)(u,S),p=!0;let{pageX:E,pageY:b}=S.touches[0];m=E,y=b,g=u.currentTime}},x=S=>{if(S.touches.length===1&&p&&u.duration){let{pageX:E,pageY:b}=S.touches[0],w=function(L,C,_,k){var M=C-k,O=_-L,U=0;if(2>Math.abs(O)&&2>Math.abs(M))return U;var G=180*Math.atan2(M,O)/Math.PI;return G>=-45&&G<45?U=4:G>=45&&G<135?U=1:G>=-135&&G<-45?U=2:(G>=135&&G<=180||G>=-180&&G<-135)&&(U=3),U}(m,y,E,b),A=[3,4].includes(w),R=[1,2].includes(w);if(A&&!u.isRotate||R&&u.isRotate){let L=(0,o.clamp)((E-m)/u.width,-1,1),C=(0,o.clamp)((b-y)/u.height,-1,1),_=u.isRotate?C:L,k=h===f?u.constructor.TOUCH_MOVE_RATIO:1,M=(0,o.clamp)(g+u.duration*_*k,0,u.duration);u.seek=M,u.emit("setBar","played",(0,o.clamp)(M/u.duration,0,1),S),u.notice.show=`${(0,o.secondToTime)(M)} / ${(0,o.secondToTime)(u.duration)}`}}};c.proxy(d,"touchstart",S=>{h=d,v(S)}),c.proxy(f,"touchstart",S=>{h=f,v(S)}),c.proxy(f,"touchmove",x),c.proxy(d,"touchmove",x),c.proxy(document,"touchend",()=>{p&&(m=0,y=0,g=0,p=!1,h=null)})}}},{"../utils":"h3rH9","../control/progress":"aBBSH","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],hDyWF:[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a,u){let{option:c,constructor:f,template:{$container:d}}=a,h=(0,o.throttle)(()=>{a.emit("view",(0,o.isInViewport)(d,f.SCROLL_GAP))},f.SCROLL_TIME);u.proxy(window,"scroll",()=>h()),a.on("view",p=>{c.autoMini&&(a.mini=!p)})}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],"7RjDP":[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");function o(l,a){a.proxy(document,"mousemove",u=>{l.emit("document:mousemove",u)}),a.proxy(document,"mouseup",u=>{l.emit("document:mouseup",u)})}s.defineInteropFlag(i),s.export(i,"default",()=>o)},{"@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],"8SmBT":[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");function o(l){if(l.constructor.USE_RAF){let a=null;(function u(){l.playing&&l.emit("raf"),l.isDestroy||(a=requestAnimationFrame(u))})(),l.on("destroy",()=>{cancelAnimationFrame(a)})}}s.defineInteropFlag(i),s.export(i,"default",()=>o)},{"@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],eTow4:[function(t,n,i){t("@parcel/transformer-js/src/esmodule-helpers.js").defineInteropFlag(i);var s=t("./utils");i.default=class{constructor(o){this.art=o,this.keys={},o.option.hotkey&&!s.isMobile&&this.init()}init(){let{proxy:o,constructor:l}=this.art;this.add(27,()=>{this.art.fullscreenWeb&&(this.art.fullscreenWeb=!1)}),this.add(32,()=>{this.art.toggle()}),this.add(37,()=>{this.art.backward=l.SEEK_STEP}),this.add(38,()=>{this.art.volume+=l.VOLUME_STEP}),this.add(39,()=>{this.art.forward=l.SEEK_STEP}),this.add(40,()=>{this.art.volume-=l.VOLUME_STEP}),o(window,"keydown",a=>{if(this.art.isFocus){let u=document.activeElement.tagName.toUpperCase(),c=document.activeElement.getAttribute("contenteditable");if(u!=="INPUT"&&u!=="TEXTAREA"&&c!==""&&c!=="true"&&!a.altKey&&!a.ctrlKey&&!a.metaKey&&!a.shiftKey){let f=this.keys[a.keyCode];if(f){a.preventDefault();for(let d=0;d{u.innerText="",(0,s.removeClass)(a,"art-notice-show")},l.NOTICE_TIME)):(0,s.removeClass)(a,"art-notice-show")}}},{"./utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],"2etr0":[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i);var o=t("./utils"),l=t("./utils/component"),a=s.interopDefault(l);class u extends a.default{constructor(f){super(f),this.name="mask";let{template:d,icons:h,events:p}=f,m=(0,o.append)(d.$state,h.state),y=(0,o.append)(d.$state,h.error);(0,o.setStyle)(y,"display","none"),f.on("destroy",()=>{(0,o.setStyle)(m,"display","none"),(0,o.setStyle)(y,"display",null)}),p.proxy(d.$state,"click",()=>f.play())}}i.default=u},{"./utils":"h3rH9","./utils/component":"guki8","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],"6dYSr":[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i);var o=t("../utils"),l=t("bundle-text:./loading.svg"),a=s.interopDefault(l),u=t("bundle-text:./state.svg"),c=s.interopDefault(u),f=t("bundle-text:./check.svg"),d=s.interopDefault(f),h=t("bundle-text:./play.svg"),p=s.interopDefault(h),m=t("bundle-text:./pause.svg"),y=s.interopDefault(m),g=t("bundle-text:./volume.svg"),v=s.interopDefault(g),x=t("bundle-text:./volume-close.svg"),S=s.interopDefault(x),E=t("bundle-text:./screenshot.svg"),b=s.interopDefault(E),w=t("bundle-text:./setting.svg"),A=s.interopDefault(w),R=t("bundle-text:./arrow-left.svg"),L=s.interopDefault(R),C=t("bundle-text:./arrow-right.svg"),_=s.interopDefault(C),k=t("bundle-text:./playback-rate.svg"),M=s.interopDefault(k),O=t("bundle-text:./aspect-ratio.svg"),U=s.interopDefault(O),G=t("bundle-text:./config.svg"),B=s.interopDefault(G),F=t("bundle-text:./pip.svg"),N=s.interopDefault(F),K=t("bundle-text:./lock.svg"),V=s.interopDefault(K),J=t("bundle-text:./unlock.svg"),ie=s.interopDefault(J),ce=t("bundle-text:./fullscreen-off.svg"),ae=s.interopDefault(ce),xe=t("bundle-text:./fullscreen-on.svg"),St=s.interopDefault(xe),qt=t("bundle-text:./fullscreen-web-off.svg"),fi=s.interopDefault(qt),di=t("bundle-text:./fullscreen-web-on.svg"),hi=s.interopDefault(di),pi=t("bundle-text:./switch-on.svg"),mi=s.interopDefault(pi),gi=t("bundle-text:./switch-off.svg"),pr=s.interopDefault(gi),Z=t("bundle-text:./flip.svg"),_a=s.interopDefault(Z),_t=t("bundle-text:./error.svg"),mn=s.interopDefault(_t),gn=t("bundle-text:./close.svg"),mr=s.interopDefault(gn),Xt=t("bundle-text:./airplay.svg"),yi=s.interopDefault(Xt);i.default=class{constructor(Pa){let Ts={loading:a.default,state:c.default,play:p.default,pause:y.default,check:d.default,volume:v.default,volumeClose:S.default,screenshot:b.default,setting:A.default,pip:N.default,arrowLeft:L.default,arrowRight:_.default,playbackRate:M.default,aspectRatio:U.default,config:B.default,lock:V.default,flip:_a.default,unlock:ie.default,fullscreenOff:ae.default,fullscreenOn:St.default,fullscreenWebOff:fi.default,fullscreenWebOn:hi.default,switchOn:mi.default,switchOff:pr.default,error:mn.default,close:mr.default,airplay:yi.default,...Pa.option.icons};for(let vi in Ts)(0,o.def)(this,vi,{get:()=>(0,o.getIcon)(vi,Ts[vi])})}}},{"../utils":"h3rH9","bundle-text:./loading.svg":"fY5Gt","bundle-text:./state.svg":"iNfLt","bundle-text:./check.svg":"jtE9u","bundle-text:./play.svg":"elgfY","bundle-text:./pause.svg":"eKokJ","bundle-text:./volume.svg":"hNB4y","bundle-text:./volume-close.svg":"i9vta","bundle-text:./screenshot.svg":"kB3Mf","bundle-text:./setting.svg":"3MONs","bundle-text:./arrow-left.svg":"iMCpk","bundle-text:./arrow-right.svg":"3oe4L","bundle-text:./playback-rate.svg":"liE22","bundle-text:./aspect-ratio.svg":"8HqYc","bundle-text:./config.svg":"hYAAH","bundle-text:./pip.svg":"jmNrH","bundle-text:./lock.svg":"cIqko","bundle-text:./unlock.svg":"65zy4","bundle-text:./fullscreen-off.svg":"jaJRT","bundle-text:./fullscreen-on.svg":"cRY1X","bundle-text:./fullscreen-web-off.svg":"3aVGL","bundle-text:./fullscreen-web-on.svg":"4DiVn","bundle-text:./switch-on.svg":"kwdKE","bundle-text:./switch-off.svg":"bWfXZ","bundle-text:./flip.svg":"h3zZ9","bundle-text:./error.svg":"7Oyth","bundle-text:./close.svg":"U5Jcy","bundle-text:./airplay.svg":"jK5Fx","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],fY5Gt:[function(t,n,i){n.exports=''},{}],iNfLt:[function(t,n,i){n.exports=''},{}],jtE9u:[function(t,n,i){n.exports=''},{}],elgfY:[function(t,n,i){n.exports=''},{}],eKokJ:[function(t,n,i){n.exports=''},{}],hNB4y:[function(t,n,i){n.exports=''},{}],i9vta:[function(t,n,i){n.exports=''},{}],kB3Mf:[function(t,n,i){n.exports=''},{}],"3MONs":[function(t,n,i){n.exports=''},{}],iMCpk:[function(t,n,i){n.exports=''},{}],"3oe4L":[function(t,n,i){n.exports=''},{}],liE22:[function(t,n,i){n.exports=''},{}],"8HqYc":[function(t,n,i){n.exports=``},{}],hYAAH:[function(t,n,i){n.exports=''},{}],jmNrH:[function(t,n,i){n.exports=''},{}],cIqko:[function(t,n,i){n.exports=''},{}],"65zy4":[function(t,n,i){n.exports=''},{}],jaJRT:[function(t,n,i){n.exports=''},{}],cRY1X:[function(t,n,i){n.exports=''},{}],"3aVGL":[function(t,n,i){n.exports=''},{}],"4DiVn":[function(t,n,i){n.exports=''},{}],kwdKE:[function(t,n,i){n.exports=''},{}],bWfXZ:[function(t,n,i){n.exports=''},{}],h3zZ9:[function(t,n,i){n.exports=''},{}],"7Oyth":[function(t,n,i){n.exports=''},{}],U5Jcy:[function(t,n,i){n.exports=''},{}],jK5Fx:[function(t,n,i){n.exports=''},{}],bRHiA:[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i);var o=t("./flip"),l=s.interopDefault(o),a=t("./aspectRatio"),u=s.interopDefault(a),c=t("./playbackRate"),f=s.interopDefault(c),d=t("./subtitleOffset"),h=s.interopDefault(d),p=t("../utils/component"),m=s.interopDefault(p),y=t("../utils/error"),g=t("../utils");class v extends m.default{constructor(S){super(S);let{option:E,controls:b,template:{$setting:w}}=S;this.name="setting",this.$parent=w,this.option=[],this.events=[],this.cache=new Map,E.setting&&(this.init(),S.on("blur",()=>{this.show&&(this.show=!1,this.render(this.option))}),S.on("focus",A=>{let R=(0,g.includeFromEvent)(A,b.setting),L=(0,g.includeFromEvent)(A,this.$parent);!this.show||R||L||(this.show=!1,this.render(this.option))}))}static makeRecursion(S,E,b){for(let w=0;w'),L=(0,g.createElement)("div");(0,g.addClass)(L,"art-setting-item-left-icon"),(0,g.append)(L,E.arrowLeft),(0,g.append)(R,L),(0,g.append)(R,S.$parentItem.html);let C=b(A,"click",()=>this.render(S.$parentList));return this.events.push(C),A}creatItem(S,E){let{icons:b,proxy:w,constructor:A}=this.art,R=(0,g.createElement)("div");(0,g.addClass)(R,"art-setting-item"),(0,g.setStyle)(R,"height",`${A.SETTING_ITEM_HEIGHT}px`),(0,g.isStringOrNumber)(E.name)&&(R.dataset.name=E.name),(0,g.isStringOrNumber)(E.value)&&(R.dataset.value=E.value);let L=(0,g.append)(R,'
'),C=(0,g.append)(R,'
'),_=(0,g.createElement)("div");switch((0,g.addClass)(_,"art-setting-item-left-icon"),S){case"switch":case"range":(0,g.append)(_,(0,g.isStringOrNumber)(E.icon)||E.icon instanceof Element?E.icon:b.config);break;case"selector":E.selector&&E.selector.length?(0,g.append)(_,(0,g.isStringOrNumber)(E.icon)||E.icon instanceof Element?E.icon:b.config):(0,g.append)(_,b.check)}(0,g.append)(L,_),E.$icon=_,(0,g.def)(E,"icon",{configurable:!0,get:()=>_.innerHTML,set(O){(0,g.isStringOrNumber)(O)&&(_.innerHTML=O)}});let k=(0,g.createElement)("div");(0,g.addClass)(k,"art-setting-item-left-text"),(0,g.append)(k,E.html||""),(0,g.append)(L,k),E.$html=k,(0,g.def)(E,"html",{configurable:!0,get:()=>k.innerHTML,set(O){(0,g.isStringOrNumber)(O)&&(k.innerHTML=O)}});let M=(0,g.createElement)("div");switch((0,g.addClass)(M,"art-setting-item-right-tooltip"),(0,g.append)(M,E.tooltip||""),(0,g.append)(C,M),E.$tooltip=M,(0,g.def)(E,"tooltip",{configurable:!0,get:()=>M.innerHTML,set(O){(0,g.isStringOrNumber)(O)&&(M.innerHTML=O)}}),S){case"switch":{let O=(0,g.createElement)("div");(0,g.addClass)(O,"art-setting-item-right-icon");let U=(0,g.append)(O,b.switchOn),G=(0,g.append)(O,b.switchOff);(0,g.setStyle)(E.switch?G:U,"display","none"),(0,g.append)(C,O),E.$switch=E.switch,(0,g.def)(E,"switch",{configurable:!0,get:()=>E.$switch,set(B){E.$switch=B,B?((0,g.setStyle)(G,"display","none"),(0,g.setStyle)(U,"display",null)):((0,g.setStyle)(G,"display",null),(0,g.setStyle)(U,"display","none"))}});break}case"range":{let O=(0,g.createElement)("div");(0,g.addClass)(O,"art-setting-item-right-icon");let U=(0,g.append)(O,'');U.value=E.range[0]||0,U.min=E.range[1]||0,U.max=E.range[2]||10,U.step=E.range[3]||1,(0,g.addClass)(U,"art-setting-range"),(0,g.append)(C,O),E.$range=U,(0,g.def)(E,"range",{configurable:!0,get:()=>U.valueAsNumber,set(G){U.value=Number(G)}})}break;case"selector":if(E.selector&&E.selector.length){let O=(0,g.createElement)("div");(0,g.addClass)(O,"art-setting-item-right-icon"),(0,g.append)(O,b.arrowRight),(0,g.append)(C,O)}}switch(S){case"switch":if(E.onSwitch){let O=w(R,"click",async U=>{E.switch=await E.onSwitch.call(this.art,E,R,U)});this.events.push(O)}break;case"range":if(E.$range){if(E.onRange){let O=w(E.$range,"change",async U=>{E.tooltip=await E.onRange.call(this.art,E,R,U)});this.events.push(O)}if(E.onChange){let O=w(E.$range,"input",async U=>{E.tooltip=await E.onChange.call(this.art,E,R,U)});this.events.push(O)}}break;case"selector":{let O=w(R,"click",async U=>{if(E.selector&&E.selector.length)this.render(E.selector,E.width);else{(0,g.inverseClass)(R,"art-current");for(let G=0;Gk?((0,g.setStyle)(A,"left",null),(0,g.setStyle)(A,"right",null)):((0,g.setStyle)(A,"left",`${M}px`),(0,g.setStyle)(A,"right","auto"))}}render(S,E){let{constructor:b}=this.art;if(this.cache.has(S)){let w=this.cache.get(S);(0,g.inverseClass)(w,"art-current"),(0,g.setStyle)(this.$parent,"width",`${w.dataset.width}px`),(0,g.setStyle)(this.$parent,"height",`${w.dataset.height}px`),this.updateStyle(Number(w.dataset.width))}else{let w=(0,g.createElement)("div");(0,g.addClass)(w,"art-setting-panel"),w.dataset.width=E||b.SETTING_WIDTH,w.dataset.height=S.length*b.SETTING_ITEM_HEIGHT,S[0]&&S[0].$parentItem&&((0,g.append)(w,this.creatHeader(S[0])),w.dataset.height=Number(w.dataset.height)+b.SETTING_ITEM_HEIGHT);for(let A=0;Al);var o=t("../utils");function l(a){let{i18n:u,icons:c,constructor:{SETTING_ITEM_WIDTH:f,FLIP:d}}=a;function h(p,m,y){m&&(m.innerText=u.get((0,o.capitalize)(y)));let g=(0,o.queryAll)(".art-setting-item",p).find(v=>v.dataset.value===y);g&&(0,o.inverseClass)(g,"art-current")}return{width:f,name:"flip",html:u.get("Video Flip"),tooltip:u.get((0,o.capitalize)(a.flip)),icon:c.flip,selector:d.map(p=>({value:p,name:`aspect-ratio-${p}`,default:p===a.flip,html:u.get((0,o.capitalize)(p))})),onSelect:p=>(a.flip=p.value,p.html),mounted:(p,m)=>{h(p,m.$tooltip,a.flip),a.on("flip",()=>{h(p,m.$tooltip,a.flip)})}}}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],"5lAsp":[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){let{i18n:u,icons:c,constructor:{SETTING_ITEM_WIDTH:f,ASPECT_RATIO:d}}=a;function h(m){return m==="default"?u.get("Default"):m}function p(m,y,g){y&&(y.innerText=h(g));let v=(0,o.queryAll)(".art-setting-item",m).find(x=>x.dataset.value===g);v&&(0,o.inverseClass)(v,"art-current")}return{width:f,name:"aspect-ratio",html:u.get("Aspect Ratio"),icon:c.aspectRatio,tooltip:h(a.aspectRatio),selector:d.map(m=>({value:m,name:`aspect-ratio-${m}`,default:m===a.aspectRatio,html:h(m)})),onSelect:m=>(a.aspectRatio=m.value,m.html),mounted:(m,y)=>{p(m,y.$tooltip,a.aspectRatio),a.on("aspectRatio",()=>{p(m,y.$tooltip,a.aspectRatio)})}}}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],e6hsR:[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){let{i18n:u,icons:c,constructor:{SETTING_ITEM_WIDTH:f,PLAYBACK_RATE:d}}=a;function h(m){return m===1?u.get("Normal"):m.toFixed(1)}function p(m,y,g){y&&(y.innerText=h(g));let v=(0,o.queryAll)(".art-setting-item",m).find(x=>Number(x.dataset.value)===g);v&&(0,o.inverseClass)(v,"art-current")}return{width:f,name:"playback-rate",html:u.get("Play Speed"),tooltip:h(a.playbackRate),icon:c.playbackRate,selector:d.map(m=>({value:m,name:`aspect-ratio-${m}`,default:m===a.playbackRate,html:h(m)})),onSelect:m=>(a.playbackRate=m.value,m.html),mounted:(m,y)=>{p(m,y.$tooltip,a.playbackRate),a.on("video:ratechange",()=>{p(m,y.$tooltip,a.playbackRate)})}}}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],fFNEr:[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");function o(l){let{i18n:a,icons:u,constructor:c}=l;return{width:c.SETTING_ITEM_WIDTH,name:"subtitle-offset",html:a.get("Subtitle Offset"),icon:u.subtitle,tooltip:"0s",range:[0,-5,5,.1],onChange:f=>(l.subtitleOffset=f.range,f.range+"s")}}s.defineInteropFlag(i),s.export(i,"default",()=>o)},{"@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],f2Thp:[function(t,n,i){t("@parcel/transformer-js/src/esmodule-helpers.js").defineInteropFlag(i),i.default=class{constructor(){this.name="artplayer_settings",this.settings={}}get(s){try{let o=JSON.parse(window.localStorage.getItem(this.name))||{};return s?o[s]:o}catch{return s?this.settings[s]:this.settings}}set(s,o){try{let l=Object.assign({},this.get(),{[s]:o});window.localStorage.setItem(this.name,JSON.stringify(l))}catch{this.settings[s]=o}}del(s){try{let o=this.get();delete o[s],window.localStorage.setItem(this.name,JSON.stringify(o))}catch{delete this.settings[s]}}clear(){try{window.localStorage.removeItem(this.name)}catch{this.settings={}}}}},{"@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],"96ThS":[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i);var o=t("../utils"),l=t("./miniProgressBar"),a=s.interopDefault(l),u=t("./autoOrientation"),c=s.interopDefault(u),f=t("./autoPlayback"),d=s.interopDefault(f),h=t("./fastForward"),p=s.interopDefault(h),m=t("./lock"),y=s.interopDefault(m);i.default=class{constructor(g){this.art=g,this.id=0;let{option:v}=g;v.miniProgressBar&&!v.isLive&&this.add(a.default),v.lock&&o.isMobile&&this.add(y.default),v.autoPlayback&&!v.isLive&&this.add(d.default),v.autoOrientation&&o.isMobile&&this.add(c.default),v.fastForward&&o.isMobile&&!v.isLive&&this.add(p.default);for(let x=0;xthis.next(g,x)):this.next(g,v)}next(g,v){let x=v&&v.name||g.name||`plugin${this.id}`;return(0,o.errorHandle)(!(0,o.has)(this,x),`Cannot add a plugin that already has the same name: ${x}`),(0,o.def)(this,x,{value:v}),this}}},{"../utils":"h3rH9","./miniProgressBar":"iBx4M","./autoOrientation":"2O9qO","./autoPlayback":"iiOc1","./fastForward":"d9NUE","./lock":"5dnKh","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],iBx4M:[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){return a.on("control",u=>{u?(0,o.removeClass)(a.template.$player,"art-mini-progress-bar"):(0,o.addClass)(a.template.$player,"art-mini-progress-bar")}),{name:"mini-progress-bar"}}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],"2O9qO":[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){let{constructor:u,template:{$player:c,$video:f}}=a;return a.on("fullscreenWeb",d=>{if(d){let{videoWidth:h,videoHeight:p}=f,{clientWidth:m,clientHeight:y}=document.documentElement;(h>p&&my)&&setTimeout(()=>{(0,o.setStyle)(c,"width",`${y}px`),(0,o.setStyle)(c,"height",`${m}px`),(0,o.setStyle)(c,"transform-origin","0 0"),(0,o.setStyle)(c,"transform",`rotate(90deg) translate(0, -${m}px)`),(0,o.addClass)(c,"art-auto-orientation"),a.isRotate=!0,a.emit("resize")},u.AUTO_ORIENTATION_TIME)}else(0,o.hasClass)(c,"art-auto-orientation")&&((0,o.removeClass)(c,"art-auto-orientation"),a.isRotate=!1,a.emit("resize"))}),a.on("fullscreen",async d=>{var p;if(!((p=screen==null?void 0:screen.orientation)!=null&&p.lock))return;let h=screen.orientation.type;if(d){let{videoWidth:m,videoHeight:y}=f,{clientWidth:g,clientHeight:v}=document.documentElement;if(m>y&&gv){let x=h.startsWith("portrait")?"landscape":"portrait";await screen.orientation.lock(x),(0,o.addClass)(c,"art-auto-orientation-fullscreen")}}else(0,o.hasClass)(c,"art-auto-orientation-fullscreen")&&(await screen.orientation.lock(h),(0,o.removeClass)(c,"art-auto-orientation-fullscreen"))}),{name:"autoOrientation",get state(){return(0,o.hasClass)(c,"art-auto-orientation")}}}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],iiOc1:[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){let{i18n:u,icons:c,storage:f,constructor:d,proxy:h,template:{$poster:p}}=a,m=a.layers.add({name:"auto-playback",html:'
'}),y=(0,o.query)(".art-auto-playback-last",m),g=(0,o.query)(".art-auto-playback-jump",m),v=(0,o.query)(".art-auto-playback-close",m);return a.on("video:timeupdate",()=>{if(a.playing){let x=f.get("times")||{},S=Object.keys(x);S.length>d.AUTO_PLAYBACK_MAX&&delete x[S[0]],x[a.option.id||a.option.url]=a.currentTime,f.set("times",x)}}),a.on("ready",()=>{let x=(f.get("times")||{})[a.option.id||a.option.url];x&&x>=d.AUTO_PLAYBACK_MIN&&((0,o.append)(v,c.close),(0,o.setStyle)(m,"display","flex"),y.innerText=`${u.get("Last Seen")} ${(0,o.secondToTime)(x)}`,g.innerText=u.get("Jump Play"),h(v,"click",()=>{(0,o.setStyle)(m,"display","none")}),h(g,"click",()=>{a.seek=x,a.play(),(0,o.setStyle)(p,"display","none"),(0,o.setStyle)(m,"display","none")}),a.once("video:timeupdate",()=>{setTimeout(()=>{(0,o.setStyle)(m,"display","none")},d.AUTO_PLAYBACK_TIMEOUT)}))}),{name:"auto-playback",get times(){return f.get("times")||{}},clear:()=>f.del("times"),delete(x){let S=f.get("times")||{};return delete S[x],f.set("times",S),S}}}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],d9NUE:[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){let{constructor:u,proxy:c,template:{$player:f,$video:d}}=a,h=null,p=!1,m=1,y=()=>{clearTimeout(h),p&&(p=!1,a.playbackRate=m,(0,o.removeClass)(f,"art-fast-forward"))};return c(d,"touchstart",g=>{g.touches.length===1&&a.playing&&!a.isLock&&(h=setTimeout(()=>{p=!0,m=a.playbackRate,a.playbackRate=u.FAST_FORWARD_VALUE,(0,o.addClass)(f,"art-fast-forward")},u.FAST_FORWARD_TIME))}),c(document,"touchmove",y),c(document,"touchend",y),{name:"fastForward",get state(){return(0,o.hasClass)(f,"art-fast-forward")}}}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}],"5dnKh":[function(t,n,i){var s=t("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(i),s.export(i,"default",()=>l);var o=t("../utils");function l(a){let{layers:u,icons:c,template:{$player:f}}=a;function d(){return(0,o.hasClass)(f,"art-lock")}function h(){(0,o.addClass)(f,"art-lock"),a.isLock=!0,a.emit("lock",!0)}function p(){(0,o.removeClass)(f,"art-lock"),a.isLock=!1,a.emit("lock",!1)}return u.add({name:"lock",mounted(m){let y=(0,o.append)(m,c.lock),g=(0,o.append)(m,c.unlock);(0,o.setStyle)(y,"display","none"),a.on("lock",v=>{v?((0,o.setStyle)(y,"display","inline-flex"),(0,o.setStyle)(g,"display","none")):((0,o.setStyle)(y,"display","none"),(0,o.setStyle)(g,"display","inline-flex"))})},click(){d()?p():h()}}),{name:"lock",get state(){return d()},set state(m){m?h():p()}}}},{"../utils":"h3rH9","@parcel/transformer-js/src/esmodule-helpers.js":"guZOB"}]},["abjMI"],"abjMI","parcelRequireb749")})(Xo,Xo.exports);var dS=Xo.exports;const hS=ua(dS);function pS(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var cg={exports:{}};(function(r,e){(function(t){var n=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,i=/^(?=([^\/?#]*))\1([^]*)$/,s=/(?:\/|^)\.(?=\/)/g,o=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,l={buildAbsoluteURL:function(a,u,c){if(c=c||{},a=a.trim(),u=u.trim(),!u){if(!c.alwaysNormalize)return a;var f=l.parseURL(a);if(!f)throw new Error("Error trying to parse base URL.");return f.path=l.normalizePath(f.path),l.buildURLFromParts(f)}var d=l.parseURL(u);if(!d)throw new Error("Error trying to parse relative URL.");if(d.scheme)return c.alwaysNormalize?(d.path=l.normalizePath(d.path),l.buildURLFromParts(d)):u;var h=l.parseURL(a);if(!h)throw new Error("Error trying to parse base URL.");if(!h.netLoc&&h.path&&h.path[0]!=="/"){var p=i.exec(h.path);h.netLoc=p[1],h.path=p[2]}h.netLoc&&!h.path&&(h.path="/");var m={scheme:h.scheme,netLoc:d.netLoc,path:null,params:d.params,query:d.query,fragment:d.fragment};if(!d.netLoc&&(m.netLoc=h.netLoc,d.path[0]!=="/"))if(!d.path)m.path=h.path,d.params||(m.params=h.params,d.query||(m.query=h.query));else{var y=h.path,g=y.substring(0,y.lastIndexOf("/")+1)+d.path;m.path=l.normalizePath(g)}return m.path===null&&(m.path=c.alwaysNormalize?l.normalizePath(d.path):d.path),l.buildURLFromParts(m)},parseURL:function(a){var u=n.exec(a);return u?{scheme:u[1]||"",netLoc:u[2]||"",path:u[3]||"",params:u[4]||"",query:u[5]||"",fragment:u[6]||""}:null},normalizePath:function(a){for(a=a.split("").reverse().join("").replace(s,"");a.length!==(a=a.replace(o,"")).length;);return a.split("").reverse().join("")},buildURLFromParts:function(a){return a.scheme+a.netLoc+a.path+a.params+a.query+a.fragment}};r.exports=l})()})(cg);var uf=cg.exports;function uh(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Fe(r){for(var e=1;e`):Wr}function SS(r,...e){e.forEach(function(t){Ki[t]=r[t]?r[t].bind(r):ES(t)})}function TS(r,e){if(typeof console=="object"&&r===!0||typeof r=="object"){SS(r,"debug","log","info","warn","error");try{Ki.log(`Debug logs enabled for "${e}" in hls.js version 1.5.15`)}catch{Ki=Gu}}else Ki=Gu}const I=Ki,wS=/^(\d+)x(\d+)$/,ch=/(.+?)=(".*?"|.*?)(?:,|$)/g;class Ee{constructor(e){typeof e=="string"&&(e=Ee.parseAttrList(e)),Re(this,e)}get clientAttrs(){return Object.keys(this).filter(e=>e.substring(0,2)==="X-")}decimalInteger(e){const t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t}hexadecimalInteger(e){if(this[e]){let t=(this[e]||"0x").slice(2);t=(t.length&1?"0":"")+t;const n=new Uint8Array(t.length/2);for(let i=0;iNumber.MAX_SAFE_INTEGER?1/0:t}decimalFloatingPoint(e){return parseFloat(this[e])}optionalFloat(e,t){const n=this[e];return n?parseFloat(n):t}enumeratedString(e){return this[e]}bool(e){return this[e]==="YES"}decimalResolution(e){const t=wS.exec(this[e]);if(t!==null)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e){let t;const n={},i='"';for(ch.lastIndex=0;(t=ch.exec(e))!==null;){let s=t[2];s.indexOf(i)===0&&s.lastIndexOf(i)===s.length-1&&(s=s.slice(1,-1));const o=t[1].trim();n[o]=s}return n}}function bS(r){return r!=="ID"&&r!=="CLASS"&&r!=="START-DATE"&&r!=="DURATION"&&r!=="END-DATE"&&r!=="END-ON-NEXT"}function AS(r){return r==="SCTE35-OUT"||r==="SCTE35-IN"}class fg{constructor(e,t){if(this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,t){const n=t.attr;for(const i in n)if(Object.prototype.hasOwnProperty.call(e,i)&&e[i]!==n[i]){I.warn(`DATERANGE tag attribute: "${i}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=i;break}e=Re(new Ee({}),n,e)}if(this.attr=e,this._startDate=new Date(e["START-DATE"]),"END-DATE"in this.attr){const n=new Date(this.attr["END-DATE"]);z(n.getTime())&&(this._endDate=n)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get startDate(){return this._startDate}get endDate(){if(this._endDate)return this._endDate;const e=this.duration;return e!==null?new Date(this._startDate.getTime()+e*1e3):null}get duration(){if("DURATION"in this.attr){const e=this.attr.decimalFloatingPoint("DURATION");if(z(e))return e}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}get plannedDuration(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}get endOnNext(){return this.attr.bool("END-ON-NEXT")}get isValid(){return!!this.id&&!this._badValueForSameId&&z(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)}}class Ca{constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}}var le={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class dg{constructor(e){this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams={[le.AUDIO]:null,[le.VIDEO]:null,[le.AUDIOVIDEO]:null},this.baseurl=e}setByteRange(e,t){const n=e.split("@",2);let i;n.length===1?i=(t==null?void 0:t.byteRangeEndOffset)||0:i=parseInt(n[1]),this._byteRange=[i,parseInt(n[0])+i]}get byteRange(){return this._byteRange?this._byteRange:[]}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=uf.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}}class dl extends dg{constructor(e,t){super(t),this._decryptdata=null,this.rawProgramDateTime=null,this.programDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.stats=new Ca,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=0,this.type=e}get decryptdata(){const{levelkeys:e}=this;if(!e&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){const t=this.levelkeys.identity;if(t)this._decryptdata=t.getDecryptData(this.sn);else{const n=Object.keys(this.levelkeys);if(n.length===1)return this._decryptdata=this.levelkeys[n[0]].getDecryptData(this.sn)}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null||!z(this.programDateTime))return null;const e=z(this.duration)?this.duration:0;return this.programDateTime+e*1e3}get encrypted(){var e;if((e=this._decryptdata)!=null&&e.encrypted)return!0;if(this.levelkeys){const t=Object.keys(this.levelkeys),n=t.length;if(n>1||n===1&&this.levelkeys[t[0]].encrypted)return!0}return!1}setKeyFormat(e){if(this.levelkeys){const t=this.levelkeys[e];t&&!this._decryptdata&&(this._decryptdata=t.getDecryptData(this.sn))}}abortRequests(){var e,t;(e=this.loader)==null||e.abort(),(t=this.keyLoader)==null||t.abort()}setElementaryStreamInfo(e,t,n,i,s,o=!1){const{elementaryStreams:l}=this,a=l[e];if(!a){l[e]={startPTS:t,endPTS:n,startDTS:i,endDTS:s,partial:o};return}a.startPTS=Math.min(a.startPTS,t),a.endPTS=Math.max(a.endPTS,n),a.startDTS=Math.min(a.startDTS,i),a.endDTS=Math.max(a.endDTS,s)}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[le.AUDIO]=null,e[le.VIDEO]=null,e[le.AUDIOVIDEO]=null}}class LS extends dg{constructor(e,t,n,i,s){super(n),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.stats=new Ca,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=t,this.index=i;const o=e.enumeratedString("BYTERANGE");o&&this.setByteRange(o,s),s&&(this.fragOffset=s.fragOffset+s.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}}const RS=10;class IS{constructor(e){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=e}reloaded(e){if(!e){this.advanced=!0,this.updated=!0;return}const t=this.lastPartSn-e.lastPartSn,n=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!n||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||t===0&&n>0,this.updated||this.advanced?this.misses=Math.floor(e.misses*.6):this.misses=e.misses+1,this.availabilityDelay=e.availabilityDelay}get hasProgramDateTime(){return this.fragments.length?z(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||RS}get drift(){const e=this.driftEndTime-this.driftStartTime;return e>0?(this.driftEnd-this.driftStart)*1e3/e:1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){var e;return(e=this.fragments)!=null&&e.length?this.fragments[this.fragments.length-1].end:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].index:-1}get lastPartSn(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}function cf(r){return Uint8Array.from(atob(r),e=>e.charCodeAt(0))}function kS(r){const e=Hu(r).subarray(0,16),t=new Uint8Array(16);return t.set(e,16-e.length),t}function CS(r){const e=function(n,i,s){const o=n[i];n[i]=n[s],n[s]=o};e(r,0,3),e(r,1,2),e(r,4,5),e(r,6,7)}function DS(r){const e=r.split(":");let t=null;if(e[0]==="data"&&e.length===2){const n=e[1].split(";"),i=n[n.length-1].split(",");if(i.length===2){const s=i[0]==="base64",o=i[1];s?(n.splice(-1,1),t=cf(o)):t=kS(o)}}return t}function Hu(r){return Uint8Array.from(unescape(encodeURIComponent(r)),e=>e.charCodeAt(0))}const ni=typeof self<"u"?self:void 0;var de={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},Ze={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function fh(r){switch(r){case Ze.FAIRPLAY:return de.FAIRPLAY;case Ze.PLAYREADY:return de.PLAYREADY;case Ze.WIDEVINE:return de.WIDEVINE;case Ze.CLEARKEY:return de.CLEARKEY}}var Oi={CENC:"1077efecc0b24d02ace33c1e52e2fb4b",CLEARKEY:"e2719d58a985b3c9781ab030af78d30e",FAIRPLAY:"94ce86fb07ff4f43adb893d2fa968ca2",PLAYREADY:"9a04f07998404286ab92e65be0885f95",WIDEVINE:"edef8ba979d64acea3c827dcd51d21ed"};function dh(r){if(r===Oi.WIDEVINE)return de.WIDEVINE;if(r===Oi.PLAYREADY)return de.PLAYREADY;if(r===Oi.CENC||r===Oi.CLEARKEY)return de.CLEARKEY}function hh(r){switch(r){case de.FAIRPLAY:return Ze.FAIRPLAY;case de.PLAYREADY:return Ze.PLAYREADY;case de.WIDEVINE:return Ze.WIDEVINE;case de.CLEARKEY:return Ze.CLEARKEY}}function hl(r){const{drmSystems:e,widevineLicenseUrl:t}=r,n=e?[de.FAIRPLAY,de.WIDEVINE,de.PLAYREADY,de.CLEARKEY].filter(i=>!!e[i]):[];return!n[de.WIDEVINE]&&t&&n.push(de.WIDEVINE),n}const hg=function(r){return ni!=null&&(r=ni.navigator)!=null&&r.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function _S(r,e,t,n){let i;switch(r){case de.FAIRPLAY:i=["cenc","sinf"];break;case de.WIDEVINE:case de.PLAYREADY:i=["cenc"];break;case de.CLEARKEY:i=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${r}`)}return PS(i,e,t,n)}function PS(r,e,t,n){return[{initDataTypes:r,persistentState:n.persistentState||"optional",distinctiveIdentifier:n.distinctiveIdentifier||"optional",sessionTypes:n.sessionTypes||[n.sessionType||"temporary"],audioCapabilities:e.map(s=>({contentType:`audio/mp4; codecs="${s}"`,robustness:n.audioRobustness||"",encryptionScheme:n.audioEncryptionScheme||null})),videoCapabilities:t.map(s=>({contentType:`video/mp4; codecs="${s}"`,robustness:n.videoRobustness||"",encryptionScheme:n.videoEncryptionScheme||null}))}]}function nn(r,e,t){return Uint8Array.prototype.slice?r.slice(e,t):new Uint8Array(Array.prototype.slice.call(r,e,t))}const ff=(r,e)=>e+10<=r.length&&r[e]===73&&r[e+1]===68&&r[e+2]===51&&r[e+3]<255&&r[e+4]<255&&r[e+6]<128&&r[e+7]<128&&r[e+8]<128&&r[e+9]<128,pg=(r,e)=>e+10<=r.length&&r[e]===51&&r[e+1]===68&&r[e+2]===73&&r[e+3]<255&&r[e+4]<255&&r[e+6]<128&&r[e+7]<128&&r[e+8]<128&&r[e+9]<128,ds=(r,e)=>{const t=e;let n=0;for(;ff(r,e);){n+=10;const i=Da(r,e+6);n+=i,pg(r,e+10)&&(n+=10),e+=n}if(n>0)return r.subarray(t,t+n)},Da=(r,e)=>{let t=0;return t=(r[e]&127)<<21,t|=(r[e+1]&127)<<14,t|=(r[e+2]&127)<<7,t|=r[e+3]&127,t},OS=(r,e)=>ff(r,e)&&Da(r,e+6)+10<=r.length-e,df=r=>{const e=gg(r);for(let t=0;tr&&r.key==="PRIV"&&r.info==="com.apple.streaming.transportStreamTimestamp",FS=r=>{const e=String.fromCharCode(r[0],r[1],r[2],r[3]),t=Da(r,4),n=10;return{type:e,size:t,data:r.subarray(n,n+t)}},gg=r=>{let e=0;const t=[];for(;ff(r,e);){const n=Da(r,e+6);e+=10;const i=e+n;for(;e+8r.type==="PRIV"?NS(r):r.type[0]==="W"?US(r):BS(r),NS=r=>{if(r.size<2)return;const e=Kt(r.data,!0),t=new Uint8Array(r.data.subarray(e.length+1));return{key:r.type,info:e,data:t.buffer}},BS=r=>{if(r.size<2)return;if(r.type==="TXXX"){let t=1;const n=Kt(r.data.subarray(t),!0);t+=n.length+1;const i=Kt(r.data.subarray(t));return{key:r.type,info:n,data:i}}const e=Kt(r.data.subarray(1));return{key:r.type,data:e}},US=r=>{if(r.type==="WXXX"){if(r.size<2)return;let t=1;const n=Kt(r.data.subarray(t),!0);t+=n.length+1;const i=Kt(r.data.subarray(t));return{key:r.type,info:n,data:i}}const e=Kt(r.data);return{key:r.type,data:e}},$S=r=>{if(r.data.byteLength===8){const e=new Uint8Array(r.data),t=e[3]&1;let n=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return n/=45,t&&(n+=4772185884e-2),Math.round(n)}},Kt=(r,e=!1)=>{const t=jS();if(t){const u=t.decode(r);if(e){const c=u.indexOf("\0");return c!==-1?u.substring(0,c):u}return u.replace(/\0/g,"")}const n=r.length;let i,s,o,l="",a=0;for(;a>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:l+=String.fromCharCode(i);break;case 12:case 13:s=r[a++],l+=String.fromCharCode((i&31)<<6|s&63);break;case 14:s=r[a++],o=r[a++],l+=String.fromCharCode((i&15)<<12|(s&63)<<6|(o&63)<<0);break}}return l};let pl;function jS(){if(!navigator.userAgent.includes("PlayStation 4"))return!pl&&typeof self.TextDecoder<"u"&&(pl=new self.TextDecoder("utf-8")),pl}const Mt={hexDump:function(r){let e="";for(let t=0;t>24,r[e+1]=t>>16&255,r[e+2]=t>>8&255,r[e+3]=t&255}function HS(r){const e=r.byteLength;for(let t=0;t8&&r[t+4]===109&&r[t+5]===111&&r[t+6]===111&&r[t+7]===102)return!0;t=n>1?t+n:e}return!1}function Q(r,e){const t=[];if(!e.length)return t;const n=r.byteLength;for(let i=0;i1?i+s:n;if(o===e[0])if(e.length===1)t.push(r.subarray(i+8,l));else{const a=Q(r.subarray(i+8,l),e.slice(1));a.length&&GS.apply(t,a)}i=l}return t}function zS(r){const e=[],t=r[0];let n=8;const i=Y(r,n);n+=4;let s=0,o=0;t===0?(s=Y(r,n),o=Y(r,n+4),n+=8):(s=ph(r,n),o=ph(r,n+8),n+=16),n+=2;let l=r.length+o;const a=vg(r,n);n+=2;for(let u=0;u>>31===1)return I.warn("SIDX has hierarchical references (not supported)"),null;const p=Y(r,c);c+=4,e.push({referenceSize:d,subsegmentDuration:p,info:{duration:p/i,start:l,end:l+d-1}}),l+=d,c+=4,n=c}return{earliestPresentationTime:s,timescale:i,version:t,referencesCount:a,references:e}}function Eg(r){const e=[],t=Q(r,["moov","trak"]);for(let i=0;i{const s=Y(i,4),o=e[s];o&&(o.default={duration:Y(i,12),flags:Y(i,20)})}),e}function VS(r){const e=r.subarray(8),t=e.subarray(86),n=Ie(e.subarray(4,8));let i=n;const s=n==="enca"||n==="encv";if(s){const l=Q(e,[n])[0].subarray(n==="enca"?28:78);Q(l,["sinf"]).forEach(u=>{const c=Q(u,["schm"])[0];if(c){const f=Ie(c.subarray(4,8));if(f==="cbcs"||f==="cenc"){const d=Q(u,["frma"])[0];d&&(i=Ie(d))}}})}switch(i){case"avc1":case"avc2":case"avc3":case"avc4":{const o=Q(t,["avcC"])[0];i+="."+js(o[1])+js(o[2])+js(o[3]);break}case"mp4a":{const o=Q(e,[n])[0],l=Q(o.subarray(28),["esds"])[0];if(l&&l.length>12){let a=4;if(l[a++]!==3)break;a=gl(l,a),a+=2;const u=l[a++];if(u&128&&(a+=2),u&64&&(a+=l[a++]),l[a++]!==4)break;a=gl(l,a);const c=l[a++];if(c===64)i+="."+js(c);else break;if(a+=12,l[a++]!==5)break;a=gl(l,a);const f=l[a++];let d=(f&248)>>3;d===31&&(d+=1+((f&7)<<3)+((l[a]&224)>>5)),i+="."+d}break}case"hvc1":case"hev1":{const o=Q(t,["hvcC"])[0],l=o[1],a=["","A","B","C"][l>>6],u=l&31,c=Y(o,2),f=(l&32)>>5?"H":"L",d=o[12],h=o.subarray(6,12);i+="."+a+u,i+="."+c.toString(16).toUpperCase(),i+="."+f+d;let p="";for(let m=h.length;m--;){const y=h[m];(y||p)&&(p="."+y.toString(16).toUpperCase()+p)}i+=p;break}case"dvh1":case"dvhe":{const o=Q(t,["dvcC"])[0],l=o[2]>>1&127,a=o[2]<<5&32|o[3]>>3&31;i+="."+Ot(l)+"."+Ot(a);break}case"vp09":{const o=Q(t,["vpcC"])[0],l=o[4],a=o[5],u=o[6]>>4&15;i+="."+Ot(l)+"."+Ot(a)+"."+Ot(u);break}case"av01":{const o=Q(t,["av1C"])[0],l=o[1]>>>5,a=o[1]&31,u=o[2]>>>7?"H":"M",c=(o[2]&64)>>6,f=(o[2]&32)>>5,d=l===2&&c?f?12:10:c?10:8,h=(o[2]&16)>>4,p=(o[2]&8)>>3,m=(o[2]&4)>>2,y=o[2]&3;i+="."+l+"."+Ot(a)+u+"."+Ot(d)+"."+h+"."+p+m+y+"."+Ot(1)+"."+Ot(1)+"."+Ot(1)+"."+0;break}}return{codec:i,encrypted:s}}function gl(r,e){const t=e+5;for(;r[e++]&128&&e{const o=Q(i,["mdia","minf","stbl","stsd"])[0].subarray(8);let l=Q(o,["enca"]);const a=l.length>0;a||(l=Q(o,["encv"])),l.forEach(u=>{const c=a?u.subarray(28):u.subarray(78);Q(c,["sinf"]).forEach(d=>{const h=Sg(d);if(h){const p=h.subarray(8,24);p.some(m=>m!==0)||(I.log(`[eme] Patching keyId in 'enc${a?"a":"v"}>sinf>>tenc' box: ${Mt.hexDump(p)} -> ${Mt.hexDump(t)}`),h.set(t,8))}})})}),r}function Sg(r){const e=Q(r,["schm"])[0];if(e){const t=Ie(e.subarray(4,8));if(t==="cbcs"||t==="cenc")return Q(r,["schi","tenc"])[0]}return null}function WS(r,e){return Q(e,["moof","traf"]).reduce((t,n)=>{const i=Q(n,["tfdt"])[0],s=i[0],o=Q(n,["tfhd"]).reduce((l,a)=>{const u=Y(a,4),c=r[u];if(c){let f=Y(i,4);if(s===1){if(f===Zo)return I.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"),l;f*=Zo+1,f+=Y(i,8)}const d=c.timescale||9e4,h=f/d;if(z(h)&&(l===null||hh+p.info.duration||0,0);l=Math.max(l,d+f.earliestPresentationTime/f.timescale),a=l-o}}if(a&&z(a))return a}return n||i}function qS(r){const e=Y(r,0);let t=8;e&1&&(t+=4),e&4&&(t+=4);let n=0;const i=Y(r,4);for(let s=0;s{Q(n,["tfhd"]).forEach(i=>{const s=Y(i,4),o=r[s];if(!o)return;const l=o.timescale||9e4;Q(n,["tfdt"]).forEach(a=>{const u=a[0],c=t*l;if(c){let f=Y(a,4);if(u===0)f-=c,f=Math.max(f,0),ml(a,4,f);else{f*=Math.pow(2,32),f+=Y(a,8),f-=c,f=Math.max(f,0);const d=Math.floor(f/(Zo+1)),h=Math.floor(f%(Zo+1));ml(a,4,d),ml(a,8,h)}}})})})}function ZS(r){const e={valid:null,remainder:null},t=Q(r,["moof"]);if(t.length<2)return e.remainder=r,e;const n=t[t.length-1];return e.valid=nn(r,0,n.byteOffset-8),e.remainder=nn(r,n.byteOffset-8),e}function Et(r,e){const t=new Uint8Array(r.length+e.length);return t.set(r),t.set(e,r.length),t}function mh(r,e){const t=[],n=e.samples,i=e.timescale,s=e.id;let o=!1;return Q(n,["moof"]).map(a=>{const u=a.byteOffset-8;Q(a,["traf"]).map(f=>{const d=Q(f,["tfdt"]).map(h=>{const p=h[0];let m=Y(h,4);return p===1&&(m*=Math.pow(2,32),m+=Y(h,8)),m/i})[0];return d!==void 0&&(r=d),Q(f,["tfhd"]).map(h=>{const p=Y(h,4),m=Y(h,0)&16777215,y=(m&1)!==0,g=(m&2)!==0,v=(m&8)!==0;let x=0;const S=(m&16)!==0;let E=0;const b=(m&32)!==0;let w=8;p===s&&(y&&(w+=8),g&&(w+=4),v&&(x=Y(h,w),w+=4),S&&(E=Y(h,w),w+=4),b&&(w+=4),e.type==="video"&&(o=QS(e.codec)),Q(f,["trun"]).map(A=>{const R=A[0],L=Y(A,0)&16777215,C=(L&1)!==0;let _=0;const k=(L&4)!==0,M=(L&256)!==0;let O=0;const U=(L&512)!==0;let G=0;const B=(L&1024)!==0,F=(L&2048)!==0;let N=0;const K=Y(A,4);let V=8;C&&(_=Y(A,V),V+=4),k&&(V+=4);let J=_+u;for(let ie=0;ie>1&63;return t===39||t===40}else return(e&31)===6}function Tg(r,e,t,n){const i=wg(r);let s=0;s+=e;let o=0,l=0,a=0;for(;s=i.length)break;a=i[s++],o+=a}while(a===255);l=0;do{if(s>=i.length)break;a=i[s++],l+=a}while(a===255);const u=i.length-s;let c=s;if(lu){I.error(`Malformed SEI payload. ${l} is too small, only ${u} bytes left to parse.`);break}if(o===4){if(i[c++]===181){const d=vg(i,c);if(c+=2,d===49){const h=Y(i,c);if(c+=4,h===1195456820){const p=i[c++];if(p===3){const m=i[c++],y=31&m,g=64&m,v=g?2+y*3:0,x=new Uint8Array(v);if(g){x[0]=m;for(let S=1;S16){const f=[];for(let p=0;p<16;p++){const m=i[c++].toString(16);f.push(m.length==1?"0"+m:m),(p===3||p===5||p===7||p===9)&&f.push("-")}const d=l-16,h=new Uint8Array(d);for(let p=0;p>24&255,s[1]=n>>16&255,s[2]=n>>8&255,s[3]=n&255,s.set(r,4),i=0,n=8;i0?(s=new Uint8Array(4),e.length>0&&new DataView(s.buffer).setUint32(0,e.length,!1)):s=new Uint8Array;const o=new Uint8Array(4);return t&&t.byteLength>0&&new DataView(o.buffer).setUint32(0,t.byteLength,!1),tT([112,115,115,104],new Uint8Array([n,0,0,0]),r,s,i,o,t||new Uint8Array)}function nT(r){const e=[];if(r instanceof ArrayBuffer){const t=r.byteLength;let n=0;for(;n+32>>24;if(s!==0&&s!==1)return{offset:t,size:e};const o=r.buffer,l=Mt.hexDump(new Uint8Array(o,t+12,16)),a=r.getUint32(28);let u=null,c=null;if(s===0){if(e-32=22&&(this.keyId=t.subarray(t.length-22,t.length-6));break;case Ze.PLAYREADY:{const n=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=rT(n,null,t);const i=new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2),s=String.fromCharCode.apply(null,Array.from(i)),o=s.substring(s.indexOf("<"),s.length),u=new DOMParser().parseFromString(o,"text/xml").getElementsByTagName("KID")[0];if(u){const c=u.childNodes[0]?u.childNodes[0].nodeValue:u.getAttribute("VALUE");if(c){const f=cf(c).subarray(0,16);CS(f),this.keyId=f}}break}default:{let n=t.subarray(0,16);if(n.length!==16){const i=new Uint8Array(16);i.set(n,16-n.length),n=i}this.keyId=n;break}}if(!this.keyId||this.keyId.byteLength!==16){let n=Gs[this.uri];if(!n){const i=Object.keys(Gs).length%Number.MAX_SAFE_INTEGER;n=new Uint8Array(16),new DataView(n.buffer,12,4).setUint32(0,i),Gs[this.uri]=n}this.keyId=n}return this}}function sT(r){const e=new Uint8Array(16);for(let t=12;t<16;t++)e[t]=r>>8*(15-t)&255;return e}const bg=/\{\$([a-zA-Z0-9-_]+)\}/g;function gh(r){return bg.test(r)}function qe(r,e,t){if(r.variableList!==null||r.hasVariableRefs)for(let n=t.length;n--;){const i=t[n],s=e[i];s&&(e[i]=zu(r,s))}}function zu(r,e){if(r.variableList!==null||r.hasVariableRefs){const t=r.variableList;return e.replace(bg,n=>{const i=n.substring(2,n.length-1),s=t==null?void 0:t[i];return s===void 0?(r.playlistParsingError||(r.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${i}"`)),n):s})}return e}function yh(r,e,t){let n=r.variableList;n||(r.variableList=n={});let i,s;if("QUERYPARAM"in e){i=e.QUERYPARAM;try{const o=new self.URL(t).searchParams;if(o.has(i))s=o.get(i);else throw new Error(`"${i}" does not match any query parameter in URI: "${t}"`)}catch(o){r.playlistParsingError||(r.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${o.message}`))}}else i=e.NAME,s=e.VALUE;i in n?r.playlistParsingError||(r.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${i}"`)):n[i]=s||""}function oT(r,e,t){const n=e.IMPORT;if(t&&n in t){let i=r.variableList;i||(r.variableList=i={}),i[n]=t[n]}else r.playlistParsingError||(r.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${n}"`))}function dn(r=!0){return typeof self>"u"?void 0:(r||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function aT(r){return typeof self<"u"&&r===self.ManagedMediaSource}const Qo={audio:{a3ds:1,"ac-3":.95,"ac-4":1,alac:.9,alaw:1,dra1:1,"dts+":1,"dts-":1,dtsc:1,dtse:1,dtsh:1,"ec-3":.9,enca:1,fLaC:.9,flac:.9,FLAC:.9,g719:1,g726:1,m4ae:1,mha1:1,mha2:1,mhm1:1,mhm2:1,mlpa:1,mp4a:1,"raw ":1,Opus:1,opus:1,samr:1,sawb:1,sawp:1,sevc:1,sqcp:1,ssmv:1,twos:1,ulaw:1},video:{avc1:1,avc2:1,avc3:1,avc4:1,avcp:1,av01:.8,drac:1,dva1:1,dvav:1,dvh1:.7,dvhe:.7,encv:1,hev1:.75,hvc1:.75,mjp2:1,mp4v:1,mvc1:1,mvc2:1,mvc3:1,mvc4:1,resv:1,rv60:1,s263:1,svc1:1,svc2:1,"vc-1":1,vp08:1,vp09:.9},text:{stpp:1,wvtt:1}};function lT(r,e){const t=Qo[e];return!!t&&!!t[r.slice(0,4)]}function yl(r,e,t=!0){return!r.split(",").some(n=>!Ag(n,e,t))}function Ag(r,e,t=!0){var n;const i=dn(t);return(n=i==null?void 0:i.isTypeSupported(ps(r,e)))!=null?n:!1}function ps(r,e){return`${e}/mp4;codecs="${r}"`}function vh(r){if(r){const e=r.substring(0,4);return Qo.video[e]}return 2}function Jo(r){return r.split(",").reduce((e,t)=>{const n=Qo.video[t];return n?(n*2+e)/(e?3:2):(Qo.audio[t]+e)/(e?2:1)},0)}const vl={};function uT(r,e=!0){if(vl[r])return vl[r];const t={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"]}[r];for(let n=0;nuT(t.toLowerCase(),e))}function xh(r,e){return r&&r!=="mp4a"?r:e&&e.split(",")[0]}function fT(r){const e=r.split(",");for(let t=0;t2){let i=n.shift()+".";i+=parseInt(n.shift()).toString(16),i+=("000"+parseInt(n.shift()).toString(16)).slice(-4),e[t]=i}}return e.join(",")}const Eh=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g,Sh=/#EXT-X-MEDIA:(.*)/g,dT=/^#EXT(?:INF|-X-TARGETDURATION):/m,Th=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),hT=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(DATERANGE|DEFINE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP|INDEPENDENT-SEGMENTS)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|"));class Gt{static findGroup(e,t){for(let n=0;n0&&s.length({id:u.attrs.AUDIO,audioCodec:u.audioCodec})),SUBTITLES:o.map(u=>({id:u.attrs.SUBTITLES,textCodec:u.textCodec})),"CLOSED-CAPTIONS":[]};let a=0;for(Sh.lastIndex=0;(i=Sh.exec(e))!==null;){const u=new Ee(i[1]),c=u.TYPE;if(c){const f=l[c],d=s[c]||[];s[c]=d,qe(n,u,["URI","GROUP-ID","LANGUAGE","ASSOC-LANGUAGE","STABLE-RENDITION-ID","NAME","INSTREAM-ID","CHARACTERISTICS","CHANNELS"]);const h=u.LANGUAGE,p=u["ASSOC-LANGUAGE"],m=u.CHANNELS,y=u.CHARACTERISTICS,g=u["INSTREAM-ID"],v={attrs:u,bitrate:0,id:a++,groupId:u["GROUP-ID"]||"",name:u.NAME||h||"",type:c,default:u.bool("DEFAULT"),autoselect:u.bool("AUTOSELECT"),forced:u.bool("FORCED"),lang:h,url:u.URI?Gt.resolve(u.URI,t):""};if(p&&(v.assocLang=p),m&&(v.channels=m),y&&(v.characteristics=y),g&&(v.instreamId=g),f!=null&&f.length){const x=Gt.findGroup(f,v.groupId)||f[0];Ah(v,x,"audioCodec"),Ah(v,x,"textCodec")}d.push(v)}}return s}static parseLevelPlaylist(e,t,n,i,s,o){const l=new IS(t),a=l.fragments;let u=null,c=0,f=0,d=0,h=0,p=null,m=new dl(i,t),y,g,v,x=-1,S=!1,E=null;for(Th.lastIndex=0,l.m3u8=e,l.hasVariableRefs=gh(e);(y=Th.exec(e))!==null;){S&&(S=!1,m=new dl(i,t),m.start=d,m.sn=c,m.cc=h,m.level=n,u&&(m.initSegment=u,m.rawProgramDateTime=u.rawProgramDateTime,u.rawProgramDateTime=null,E&&(m.setByteRange(E),E=null)));const R=y[1];if(R){m.duration=parseFloat(R);const L=(" "+y[2]).slice(1);m.title=L||null,m.tagList.push(L?["INF",R,L]:["INF",R])}else if(y[3]){if(z(m.duration)){m.start=d,v&&Ih(m,v,l),m.sn=c,m.level=n,m.cc=h,a.push(m);const L=(" "+y[3]).slice(1);m.relurl=zu(l,L),Lh(m,p),p=m,d+=m.duration,c++,f=0,S=!0}}else if(y[4]){const L=(" "+y[4]).slice(1);p?m.setByteRange(L,p):m.setByteRange(L)}else if(y[5])m.rawProgramDateTime=(" "+y[5]).slice(1),m.tagList.push(["PROGRAM-DATE-TIME",m.rawProgramDateTime]),x===-1&&(x=a.length);else{if(y=y[0].match(hT),!y){I.warn("No matches on slow regex match for level playlist!");continue}for(g=1;g0&&k.bool("CAN-SKIP-DATERANGES"),l.partHoldBack=k.optionalFloat("PART-HOLD-BACK",0),l.holdBack=k.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{const k=new Ee(C);l.partTarget=k.decimalFloatingPoint("PART-TARGET");break}case"PART":{let k=l.partList;k||(k=l.partList=[]);const M=f>0?k[k.length-1]:void 0,O=f++,U=new Ee(C);qe(l,U,["BYTERANGE","URI"]);const G=new LS(U,m,t,O,M);k.push(G),m.duration+=G.duration;break}case"PRELOAD-HINT":{const k=new Ee(C);qe(l,k,["URI"]),l.preloadHint=k;break}case"RENDITION-REPORT":{const k=new Ee(C);qe(l,k,["URI"]),l.renditionReports=l.renditionReports||[],l.renditionReports.push(k);break}default:I.warn(`line parsed but not handled: ${y}`);break}}}p&&!p.relurl?(a.pop(),d-=p.duration,l.partList&&(l.fragmentHint=p)):l.partList&&(Lh(m,p),m.cc=h,l.fragmentHint=m,v&&Ih(m,v,l));const b=a.length,w=a[0],A=a[b-1];if(d+=l.skippedSegments*l.targetduration,d>0&&b&&A){l.averagetargetduration=d/b;const R=A.sn;l.endSN=R!=="initSegment"?R:0,l.live||(A.endList=!0),w&&(l.startCC=w.cc)}else l.endSN=0,l.startCC=0;return l.fragmentHint&&(d+=l.fragmentHint.duration),l.totalduration=d,l.endCC=h,x>0&&mT(a,x),l}}function wh(r,e,t){var n,i;const s=new Ee(r);qe(t,s,["KEYFORMAT","KEYFORMATVERSIONS","URI","IV","URI"]);const o=(n=s.METHOD)!=null?n:"",l=s.URI,a=s.hexadecimalInteger("IV"),u=s.KEYFORMATVERSIONS,c=(i=s.KEYFORMAT)!=null?i:"identity";l&&s.IV&&!a&&I.error(`Invalid IV: ${s.IV}`);const f=l?Gt.resolve(l,e):"",d=(u||"1").split("/").map(Number).filter(Number.isFinite);return new hs(o,f,c,d,a)}function bh(r){const t=new Ee(r).decimalFloatingPoint("TIME-OFFSET");return z(t)?t:null}function pT(r,e){let t=(r||"").split(/[ ,]+/).filter(n=>n);["video","audio","text"].forEach(n=>{const i=t.filter(s=>lT(s,n));i.length&&(e[`${n}Codec`]=i.join(","),t=t.filter(s=>i.indexOf(s)===-1))}),e.unknownCodecs=t}function Ah(r,e,t){const n=e[t];n&&(r[t]=n)}function mT(r,e){let t=r[e];for(let n=e;n--;){const i=r[n];if(!i)return;i.programDateTime=t.programDateTime-i.duration*1e3,t=i}}function Lh(r,e){r.rawProgramDateTime?r.programDateTime=Date.parse(r.rawProgramDateTime):e!=null&&e.programDateTime&&(r.programDateTime=e.endProgramDateTime),z(r.programDateTime)||(r.programDateTime=null,r.rawProgramDateTime=null)}function Rh(r,e,t,n){r.relurl=e.URI,e.BYTERANGE&&r.setByteRange(e.BYTERANGE),r.level=t,r.sn="initSegment",n&&(r.levelkeys=n),r.initSegment=null}function Ih(r,e,t){r.levelkeys=e;const{encryptedFragments:n}=t;(!n.length||n[n.length-1].levelkeys!==e)&&Object.keys(e).some(i=>e[i].isCommonEncryption)&&n.push(r)}var se={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},q={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};function kh(r){const{type:e}=r;switch(e){case se.AUDIO_TRACK:return q.AUDIO;case se.SUBTITLE_TRACK:return q.SUBTITLE;default:return q.MAIN}}function xl(r,e){let t=r.url;return(t===void 0||t.indexOf("data:")===0)&&(t=e.url),t}class gT{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:e}=this;e.on(T.MANIFEST_LOADING,this.onManifestLoading,this),e.on(T.LEVEL_LOADING,this.onLevelLoading,this),e.on(T.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(T.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}unregisterListeners(){const{hls:e}=this;e.off(T.MANIFEST_LOADING,this.onManifestLoading,this),e.off(T.LEVEL_LOADING,this.onLevelLoading,this),e.off(T.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(T.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}createInternalLoader(e){const t=this.hls.config,n=t.pLoader,i=t.loader,s=n||i,o=new s(t);return this.loaders[e.type]=o,o}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(const e in this.loaders){const t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,t){const{url:n}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:se.MANIFEST,url:n,deliveryDirectives:null})}onLevelLoading(e,t){const{id:n,level:i,pathwayId:s,url:o,deliveryDirectives:l}=t;this.load({id:n,level:i,pathwayId:s,responseType:"text",type:se.LEVEL,url:o,deliveryDirectives:l})}onAudioTrackLoading(e,t){const{id:n,groupId:i,url:s,deliveryDirectives:o}=t;this.load({id:n,groupId:i,level:null,responseType:"text",type:se.AUDIO_TRACK,url:s,deliveryDirectives:o})}onSubtitleTrackLoading(e,t){const{id:n,groupId:i,url:s,deliveryDirectives:o}=t;this.load({id:n,groupId:i,level:null,responseType:"text",type:se.SUBTITLE_TRACK,url:s,deliveryDirectives:o})}load(e){var t;const n=this.hls.config;let i=this.getInternalLoader(e);if(i){const u=i.context;if(u&&u.url===e.url&&u.level===e.level){I.trace("[playlist-loader]: playlist request ongoing");return}I.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),i.abort()}let s;if(e.type===se.MANIFEST?s=n.manifestLoadPolicy.default:s=Re({},n.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),i=this.createInternalLoader(e),z((t=e.deliveryDirectives)==null?void 0:t.part)){let u;if(e.type===se.LEVEL&&e.level!==null?u=this.hls.levels[e.level].details:e.type===se.AUDIO_TRACK&&e.id!==null?u=this.hls.audioTracks[e.id].details:e.type===se.SUBTITLE_TRACK&&e.id!==null&&(u=this.hls.subtitleTracks[e.id].details),u){const c=u.partTarget,f=u.targetduration;if(c&&f){const d=Math.max(c*3,f*.8)*1e3;s=Re({},s,{maxTimeToFirstByteMs:Math.min(d,s.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(d,s.maxTimeToFirstByteMs)})}}}const o=s.errorRetry||s.timeoutRetry||{},l={loadPolicy:s,timeout:s.maxLoadTimeMs,maxRetry:o.maxNumRetry||0,retryDelay:o.retryDelayMs||0,maxRetryDelay:o.maxRetryDelayMs||0},a={onSuccess:(u,c,f,d)=>{const h=this.getInternalLoader(f);this.resetInternalLoader(f.type);const p=u.data;if(p.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(u,f,new Error("no EXTM3U delimiter"),d||null,c);return}c.parsing.start=performance.now(),Gt.isMediaPlaylist(p)?this.handleTrackOrLevelPlaylist(u,c,f,d||null,h):this.handleMasterPlaylist(u,c,f,d)},onError:(u,c,f,d)=>{this.handleNetworkError(c,f,!1,u,d)},onTimeout:(u,c,f)=>{this.handleNetworkError(c,f,!0,void 0,u)}};i.load(e,l,a)}handleMasterPlaylist(e,t,n,i){const s=this.hls,o=e.data,l=xl(e,n),a=Gt.parseMasterPlaylist(o,l);if(a.playlistParsingError){this.handleManifestParsingError(e,n,a.playlistParsingError,i,t);return}const{contentSteering:u,levels:c,sessionData:f,sessionKeys:d,startTimeOffset:h,variableList:p}=a;this.variableList=p;const{AUDIO:m=[],SUBTITLES:y,"CLOSED-CAPTIONS":g}=Gt.parseMasterPlaylistMedia(o,l,a);m.length&&!m.some(x=>!x.url)&&c[0].audioCodec&&!c[0].attrs.AUDIO&&(I.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),m.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new Ee({}),bitrate:0,url:""})),s.trigger(T.MANIFEST_LOADED,{levels:c,audioTracks:m,subtitles:y,captions:g,contentSteering:u,url:l,stats:t,networkDetails:i,sessionData:f,sessionKeys:d,startTimeOffset:h,variableList:p})}handleTrackOrLevelPlaylist(e,t,n,i,s){const o=this.hls,{id:l,level:a,type:u}=n,c=xl(e,n),f=0,d=z(a)?a:z(l)?l:0,h=kh(n),p=Gt.parseLevelPlaylist(e.data,c,d,h,f,this.variableList);if(u===se.MANIFEST){const m={attrs:new Ee({}),bitrate:0,details:p,name:"",url:c};o.trigger(T.MANIFEST_LOADED,{levels:[m],audioTracks:[],url:c,stats:t,networkDetails:i,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),n.levelDetails=p,this.handlePlaylistLoaded(p,e,t,n,i,s)}handleManifestParsingError(e,t,n,i,s){this.hls.trigger(T.ERROR,{type:X.NETWORK_ERROR,details:P.MANIFEST_PARSING_ERROR,fatal:t.type===se.MANIFEST,url:e.url,err:n,error:n,reason:n.message,response:e,context:t,networkDetails:i,stats:s})}handleNetworkError(e,t,n=!1,i,s){let o=`A network ${n?"timeout":"error"+(i?" (status "+i.code+")":"")} occurred while loading ${e.type}`;e.type===se.LEVEL?o+=`: ${e.level} id: ${e.id}`:(e.type===se.AUDIO_TRACK||e.type===se.SUBTITLE_TRACK)&&(o+=` id: ${e.id} group-id: "${e.groupId}"`);const l=new Error(o);I.warn(`[playlist-loader]: ${o}`);let a=P.UNKNOWN,u=!1;const c=this.getInternalLoader(e);switch(e.type){case se.MANIFEST:a=n?P.MANIFEST_LOAD_TIMEOUT:P.MANIFEST_LOAD_ERROR,u=!0;break;case se.LEVEL:a=n?P.LEVEL_LOAD_TIMEOUT:P.LEVEL_LOAD_ERROR,u=!1;break;case se.AUDIO_TRACK:a=n?P.AUDIO_TRACK_LOAD_TIMEOUT:P.AUDIO_TRACK_LOAD_ERROR,u=!1;break;case se.SUBTITLE_TRACK:a=n?P.SUBTITLE_TRACK_LOAD_TIMEOUT:P.SUBTITLE_LOAD_ERROR,u=!1;break}c&&this.resetInternalLoader(e.type);const f={type:X.NETWORK_ERROR,details:a,fatal:u,url:e.url,loader:c,context:e,error:l,networkDetails:t,stats:s};if(i){const d=(t==null?void 0:t.url)||e.url;f.response=Fe({url:d,data:void 0},i)}this.hls.trigger(T.ERROR,f)}handlePlaylistLoaded(e,t,n,i,s,o){const l=this.hls,{type:a,level:u,id:c,groupId:f,deliveryDirectives:d}=i,h=xl(t,i),p=kh(i),m=typeof i.level=="number"&&p===q.MAIN?u:void 0;if(!e.fragments.length){const g=new Error("No Segments found in Playlist");l.trigger(T.ERROR,{type:X.NETWORK_ERROR,details:P.LEVEL_EMPTY_ERROR,fatal:!1,url:h,error:g,reason:g.message,response:t,context:i,level:m,parent:p,networkDetails:s,stats:n});return}e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));const y=e.playlistParsingError;if(y){l.trigger(T.ERROR,{type:X.NETWORK_ERROR,details:P.LEVEL_PARSING_ERROR,fatal:!1,url:h,error:y,reason:y.message,response:t,context:i,level:m,parent:p,networkDetails:s,stats:n});return}switch(e.live&&o&&(o.getCacheAge&&(e.ageHeader=o.getCacheAge()||0),(!o.getCacheAge||isNaN(e.ageHeader))&&(e.ageHeader=0)),a){case se.MANIFEST:case se.LEVEL:l.trigger(T.LEVEL_LOADED,{details:e,level:m||0,id:c||0,stats:n,networkDetails:s,deliveryDirectives:d});break;case se.AUDIO_TRACK:l.trigger(T.AUDIO_TRACK_LOADED,{details:e,id:c||0,groupId:f||"",stats:n,networkDetails:s,deliveryDirectives:d});break;case se.SUBTITLE_TRACK:l.trigger(T.SUBTITLE_TRACK_LOADED,{details:e,id:c||0,groupId:f||"",stats:n,networkDetails:s,deliveryDirectives:d});break}}}function Lg(r,e){let t;try{t=new Event("addtrack")}catch{t=document.createEvent("Event"),t.initEvent("addtrack",!1,!1)}t.track=r,e.dispatchEvent(t)}function Rg(r,e){const t=r.mode;if(t==="disabled"&&(r.mode="hidden"),r.cues&&!r.cues.getCueById(e.id))try{if(r.addCue(e),!r.cues.getCueById(e.id))throw new Error(`addCue is failed for: ${e}`)}catch(n){I.debug(`[texttrack-utils]: ${n}`);try{const i=new self.TextTrackCue(e.startTime,e.endTime,e.text);i.id=e.id,r.addCue(i)}catch(i){I.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${i}`)}}t==="disabled"&&(r.mode=t)}function Nn(r){const e=r.mode;if(e==="disabled"&&(r.mode="hidden"),r.cues)for(let t=r.cues.length;t--;)r.removeCue(r.cues[t]);e==="disabled"&&(r.mode=e)}function Vu(r,e,t,n){const i=r.mode;if(i==="disabled"&&(r.mode="hidden"),r.cues&&r.cues.length>0){const s=vT(r.cues,e,t);for(let o=0;or[t].endTime)return-1;let n=0,i=t;for(;n<=i;){const s=Math.floor((i+n)/2);if(er[s].startTime&&n-1)for(let s=i,o=r.length;s=e&&l.endTime<=t)n.push(l);else if(l.startTime>t)return n}return n}function ho(r){const e=[];for(let t=0;t"u"))return self.VTTCue||self.TextTrackCue}function Ch(r,e,t,n,i){let s=new r(e,t,"");try{s.value=n,i&&(s.type=i)}catch{s=new r(e,t,JSON.stringify(i?Fe({type:i},n):n))}return s}const Hs=(()=>{const r=Ku();try{r&&new r(0,Number.POSITIVE_INFINITY,"")}catch{return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function El(r,e){return r.getTime()/1e3-e}function ET(r){return Uint8Array.from(r.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}class ST{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=null}_registerListeners(){const{hls:e}=this;e.on(T.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(T.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(T.MANIFEST_LOADING,this.onManifestLoading,this),e.on(T.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(T.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(T.LEVEL_UPDATED,this.onLevelUpdated,this)}_unregisterListeners(){const{hls:e}=this;e.off(T.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(T.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(T.MANIFEST_LOADING,this.onManifestLoading,this),e.off(T.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(T.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(T.LEVEL_UPDATED,this.onLevelUpdated,this)}onMediaAttached(e,t){this.media=t.media}onMediaDetaching(){this.id3Track&&(Nn(this.id3Track),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(e){const t=this.getID3Track(e.textTracks);return t.mode="hidden",t}getID3Track(e){if(this.media){for(let t=0;tHs&&(f=Hs),f-c<=0&&(f=c+xT);for(let h=0;hc.type===It.audioId3&&a:i==="video"?u=c=>c.type===It.emsg&&l:u=c=>c.type===It.audioId3&&a||c.type===It.emsg&&l,Vu(s,t,n,u)}}onLevelUpdated(e,{details:t}){if(!this.media||!t.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)return;const{dateRangeCuesAppended:n,id3Track:i}=this,{dateRanges:s}=t,o=Object.keys(s);if(i){const c=Object.keys(n).filter(f=>!o.includes(f));for(let f=c.length;f--;){const d=c[f];Object.keys(n[d].cues).forEach(h=>{i.removeCue(n[d].cues[h])}),delete n[d]}}const l=t.fragments[t.fragments.length-1];if(o.length===0||!z(l==null?void 0:l.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const a=l.programDateTime/1e3-l.start,u=Ku();for(let c=0;c{if(b!==d.id){const w=s[b];if(w.class===d.class&&w.startDate>d.startDate&&(!E||d.startDatethis.timeupdate(),this.hls=e,this.config=e.config,this.registerListeners()}get latency(){return this._latency||0}get maxLatency(){const{config:e,levelDetails:t}=this;return e.liveMaxLatencyDuration!==void 0?e.liveMaxLatencyDuration:t?e.liveMaxLatencyDurationCount*t.targetduration:0}get targetLatency(){const{levelDetails:e}=this;if(e===null)return null;const{holdBack:t,partHoldBack:n,targetduration:i}=e,{liveSyncDuration:s,liveSyncDurationCount:o,lowLatencyMode:l}=this.config,a=this.hls.userConfig;let u=l&&n||t;(a.liveSyncDuration||a.liveSyncDurationCount||u===0)&&(u=s!==void 0?s:o*i);const c=i;return u+Math.min(this.stallCount*1,c)}get liveSyncPosition(){const e=this.estimateLiveEdge(),t=this.targetLatency,n=this.levelDetails;if(e===null||t===null||n===null)return null;const i=n.edge,s=e-t-this.edgeStalled,o=i-n.totalduration,l=i-(this.config.lowLatencyMode&&n.partTarget||n.targetduration);return Math.min(Math.max(o,s),l)}get drift(){const{levelDetails:e}=this;return e===null?1:e.drift}get edgeStalled(){const{levelDetails:e}=this;if(e===null)return 0;const t=(this.config.lowLatencyMode&&e.partTarget||e.targetduration)*3;return Math.max(e.age-t,0)}get forwardBufferLength(){const{media:e,levelDetails:t}=this;if(!e||!t)return 0;const n=e.buffered.length;return(n?e.buffered.end(n-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null}registerListeners(){this.hls.on(T.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(T.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(T.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(T.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(T.ERROR,this.onError,this)}unregisterListeners(){this.hls.off(T.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(T.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.off(T.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(T.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.off(T.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)}onManifestLoading(){this.levelDetails=null,this._latency=null,this.stallCount=0}onLevelUpdated(e,{details:t}){this.levelDetails=t,t.advanced&&this.timeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)}onError(e,t){var n;t.details===P.BUFFER_STALLED_ERROR&&(this.stallCount++,(n=this.levelDetails)!=null&&n.live&&I.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))}timeupdate(){const{media:e,levelDetails:t}=this;if(!e||!t)return;this.currentTime=e.currentTime;const n=this.computeLatency();if(n===null)return;this._latency=n;const{lowLatencyMode:i,maxLiveSyncPlaybackRate:s}=this.config;if(!i||s===1||!t.live)return;const o=this.targetLatency;if(o===null)return;const l=n-o,a=Math.min(this.maxLatency,o+t.targetduration);if(l.05&&this.forwardBufferLength>1){const c=Math.min(2,Math.max(1,s)),f=Math.round(2/(1+Math.exp(-.75*l-this.edgeStalled))*20)/20;e.playbackRate=Math.min(c,Math.max(1,f))}else e.playbackRate!==1&&e.playbackRate!==0&&(e.playbackRate=1)}estimateLiveEdge(){const{levelDetails:e}=this;return e===null?null:e.edge+e.age}computeLatency(){const e=this.estimateLiveEdge();return e===null?null:e-this.currentTime}}const Wu=["NONE","TYPE-0","TYPE-1",null];function wT(r){return Wu.indexOf(r)>-1}const ta=["SDR","PQ","HLG"];function bT(r){return!!r&&ta.indexOf(r)>-1}var po={No:"",Yes:"YES",v2:"v2"};function Dh(r){const{canSkipUntil:e,canSkipDateRanges:t,age:n}=r,i=n!!t).map(t=>t.substring(0,4)).join(","),this.addGroupId("audio",e.attrs.AUDIO),this.addGroupId("text",e.attrs.SUBTITLES)}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get averageBitrate(){return this._avgBitrate||this.realBitrate||this.bitrate}get attrs(){return this._attrs[0]}get codecs(){return this.attrs.CODECS||""}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get videoRange(){return this.attrs["VIDEO-RANGE"]||"SDR"}get score(){return this.attrs.optionalFloat("SCORE",0)}get uri(){return this.url[0]||""}hasAudioGroup(e){return Ph(this._audioGroups,e)}hasSubtitleGroup(e){return Ph(this._subtitleGroups,e)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(e,t){if(t){if(e==="audio"){let n=this._audioGroups;n||(n=this._audioGroups=[]),n.indexOf(t)===-1&&n.push(t)}else if(e==="text"){let n=this._subtitleGroups;n||(n=this._subtitleGroups=[]),n.indexOf(t)===-1&&n.push(t)}}}get urlId(){return 0}set urlId(e){}get audioGroupIds(){return this.audioGroups?[this.audioGroupId]:void 0}get textGroupIds(){return this.subtitleGroups?[this.textGroupId]:void 0}get audioGroupId(){var e;return(e=this.audioGroups)==null?void 0:e[0]}get textGroupId(){var e;return(e=this.subtitleGroups)==null?void 0:e[0]}addFallback(){}}function Ph(r,e){return!e||!r?!1:r.indexOf(e)!==-1}function Sl(r,e){const t=e.startPTS;if(z(t)){let n=0,i;e.sn>r.sn?(n=t-r.start,i=r):(n=r.start-t,i=e),i.duration!==n&&(i.duration=n)}else e.sn>r.sn?r.cc===e.cc&&r.minEndPTS?e.start=r.start+(r.minEndPTS-r.start):e.start=r.start+r.duration:e.start=Math.max(r.start-e.duration,0)}function Ig(r,e,t,n,i,s){n-t<=0&&(I.warn("Fragment should have a positive duration",e),n=t+e.duration,s=i+e.duration);let l=t,a=n;const u=e.startPTS,c=e.endPTS;if(z(u)){const y=Math.abs(u-t);z(e.deltaPTS)?e.deltaPTS=Math.max(y,e.deltaPTS):e.deltaPTS=y,l=Math.max(t,u),t=Math.min(t,u),i=Math.min(i,e.startDTS),a=Math.min(n,c),n=Math.max(n,c),s=Math.max(s,e.endDTS)}const f=t-e.start;e.start!==0&&(e.start=t),e.duration=n-e.start,e.startPTS=t,e.maxStartPTS=l,e.startDTS=i,e.endPTS=n,e.minEndPTS=a,e.endDTS=s;const d=e.sn;if(!r||dr.endSN)return 0;let h;const p=d-r.startSN,m=r.fragments;for(m[p]=e,h=p;h>0;h--)Sl(m[h],m[h-1]);for(h=p;h=0;a--){const u=n[a].initSegment;if(u){t=u;break}}r.fragmentHint&&delete r.fragmentHint.endPTS;let i=0,s;if(IT(r,e,(a,u)=>{a.relurl&&(i=a.cc-u.cc),z(a.startPTS)&&z(a.endPTS)&&(u.start=u.startPTS=a.startPTS,u.startDTS=a.startDTS,u.maxStartPTS=a.maxStartPTS,u.endPTS=a.endPTS,u.endDTS=a.endDTS,u.minEndPTS=a.minEndPTS,u.duration=a.endPTS-a.startPTS,u.duration&&(s=u),e.PTSKnown=e.alignedSliding=!0),u.elementaryStreams=a.elementaryStreams,u.loader=a.loader,u.stats=a.stats,a.initSegment&&(u.initSegment=a.initSegment,t=a.initSegment)}),t&&(e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments).forEach(u=>{var c;u&&(!u.initSegment||u.initSegment.relurl===((c=t)==null?void 0:c.relurl))&&(u.initSegment=t)}),e.skippedSegments)if(e.deltaUpdateFailed=e.fragments.some(a=>!a),e.deltaUpdateFailed){I.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let a=e.skippedSegments;a--;)e.fragments.shift();e.startSN=e.fragments[0].sn,e.startCC=e.fragments[0].cc}else e.canSkipDateRanges&&(e.dateRanges=LT(r.dateRanges,e.dateRanges,e.recentlyRemovedDateranges));const o=e.fragments;if(i){I.warn("discontinuity sliding from playlist, take drift into account");for(let a=0;a{u.elementaryStreams=a.elementaryStreams,u.stats=a.stats}),s?Ig(e,s,s.startPTS,s.endPTS,s.startDTS,s.endDTS):kg(r,e),o.length&&(e.totalduration=e.edge-o[0].start),e.driftStartTime=r.driftStartTime,e.driftStart=r.driftStart;const l=e.advancedDateTime;if(e.advanced&&l){const a=e.edge;e.driftStart||(e.driftStartTime=l,e.driftStart=a),e.driftEndTime=l,e.driftEnd=a}else e.driftEndTime=r.driftEndTime,e.driftEnd=r.driftEnd,e.advancedDateTime=r.advancedDateTime}function LT(r,e,t){const n=Re({},r);return t&&t.forEach(i=>{delete n[i]}),Object.keys(e).forEach(i=>{const s=new fg(e[i].attr,n[i]);s.isValid?n[i]=s:I.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${JSON.stringify(e[i].attr)}"`)}),n}function RT(r,e,t){if(r&&e){let n=0;for(let i=0,s=r.length;i<=s;i++){const o=r[i],l=e[i+n];o&&l&&o.index===l.index&&o.fragment.sn===l.fragment.sn?t(o,l):n--}}}function IT(r,e,t){const n=e.skippedSegments,i=Math.max(r.startSN,e.startSN)-e.startSN,s=(r.fragmentHint?1:0)+(n?e.endSN:Math.min(r.endSN,e.endSN))-e.startSN,o=e.startSN-r.startSN,l=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,a=r.fragmentHint?r.fragments.concat(r.fragmentHint):r.fragments;for(let u=i;u<=s;u++){const c=a[o+u];let f=l[u];n&&!f&&u=n.length||Yu(e,n[t].start)}function Yu(r,e){if(e){const t=r.fragments;for(let n=r.skippedSegments;ne){const s=n[n.length-1].duration*1e3;s{const{details:n}=e;n!=null&&n.fragments&&n.fragments.forEach(i=>{i.level=t})})}function ra(r){switch(r.details){case P.FRAG_LOAD_TIMEOUT:case P.KEY_LOAD_TIMEOUT:case P.LEVEL_LOAD_TIMEOUT:case P.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function Fh(r,e){const t=ra(e);return r.default[`${t?"timeout":"error"}Retry`]}function hf(r,e){const t=r.backoff==="linear"?1:Math.pow(2,e);return Math.min(t*r.retryDelayMs,r.maxRetryDelayMs)}function Mh(r){return Fe(Fe({},r),{errorRetry:null,timeoutRetry:null})}function na(r,e,t,n){if(!r)return!1;const i=n==null?void 0:n.code,s=e499)}const _g={search:function(r,e){let t=0,n=r.length-1,i=null,s=null;for(;t<=n;){i=(t+n)/2|0,s=r[i];const o=e(s);if(o>0)t=i+1;else if(o<0)n=i-1;else return s}return null}};function _T(r,e,t){if(e===null||!Array.isArray(r)||!r.length||!z(e))return null;const n=r[0].programDateTime;if(e<(n||0))return null;const i=r[r.length-1].endProgramDateTime;if(e>=(i||0))return null;t=t||0;for(let s=0;s0&&l<15e-7&&(t+=15e-7)}else t===0&&e[0].start===0&&(s=e[0]);if(s&&((!r||r.level===s.level)&&qu(t,n,s)===0||PT(s,r,Math.min(i,n))))return s;const o=_g.search(e,qu.bind(null,t,n));return o&&(o!==r||!s)?o:s}function PT(r,e,t){if(e&&e.start===0&&e.level0){const n=e.tagList.reduce((i,s)=>(s[0]==="INF"&&(i+=parseFloat(s[1])),i),t);return r.start<=n}return!1}function qu(r=0,e=0,t){if(t.start<=r&&t.start+t.duration>r)return 0;const n=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0));return t.start+t.duration-n<=r?1:t.start-n>r&&t.start?-1:0}function OT(r,e,t){const n=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0))*1e3;return(t.endProgramDateTime||0)-n>r}function FT(r,e){return _g.search(r,t=>t.cce?-1:0)}var Ne={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},wt={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,SwitchToSDR:4};class MT{constructor(e){this.hls=void 0,this.playlistError=0,this.penalizedRenditions={},this.log=void 0,this.warn=void 0,this.error=void 0,this.hls=e,this.log=I.log.bind(I,"[info]:"),this.warn=I.warn.bind(I,"[warning]:"),this.error=I.error.bind(I,"[error]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(T.ERROR,this.onError,this),e.on(T.MANIFEST_LOADING,this.onManifestLoading,this),e.on(T.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(T.ERROR,this.onError,this),e.off(T.ERROR,this.onErrorOut,this),e.off(T.MANIFEST_LOADING,this.onManifestLoading,this),e.off(T.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null,this.penalizedRenditions={}}startLoad(e){}stopLoad(){this.playlistError=0}getVariantLevelIndex(e){return(e==null?void 0:e.type)===q.MAIN?e.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onLevelUpdated(){this.playlistError=0}onError(e,t){var n,i;if(t.fatal)return;const s=this.hls,o=t.context;switch(t.details){case P.FRAG_LOAD_ERROR:case P.FRAG_LOAD_TIMEOUT:case P.KEY_LOAD_ERROR:case P.KEY_LOAD_TIMEOUT:t.errorAction=this.getFragRetryOrSwitchAction(t);return;case P.FRAG_PARSING_ERROR:if((n=t.frag)!=null&&n.gap){t.errorAction={action:Ne.DoNothing,flags:wt.None};return}case P.FRAG_GAP:case P.FRAG_DECRYPT_ERROR:{t.errorAction=this.getFragRetryOrSwitchAction(t),t.errorAction.action=Ne.SendAlternateToPenaltyBox;return}case P.LEVEL_EMPTY_ERROR:case P.LEVEL_PARSING_ERROR:{var l,a;const u=t.parent===q.MAIN?t.level:s.loadLevel;t.details===P.LEVEL_EMPTY_ERROR&&((l=t.context)!=null&&(a=l.levelDetails)!=null&&a.live)?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,u):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,u))}return;case P.LEVEL_LOAD_ERROR:case P.LEVEL_LOAD_TIMEOUT:typeof(o==null?void 0:o.level)=="number"&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,o.level));return;case P.AUDIO_TRACK_LOAD_ERROR:case P.AUDIO_TRACK_LOAD_TIMEOUT:case P.SUBTITLE_LOAD_ERROR:case P.SUBTITLE_TRACK_LOAD_TIMEOUT:if(o){const u=s.levels[s.loadLevel];if(u&&(o.type===se.AUDIO_TRACK&&u.hasAudioGroup(o.groupId)||o.type===se.SUBTITLE_TRACK&&u.hasSubtitleGroup(o.groupId))){t.errorAction=this.getPlaylistRetryOrSwitchAction(t,s.loadLevel),t.errorAction.action=Ne.SendAlternateToPenaltyBox,t.errorAction.flags=wt.MoveAllAlternatesMatchingHost;return}}return;case P.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const u=s.levels[s.loadLevel],c=u==null?void 0:u.attrs["HDCP-LEVEL"];c?t.errorAction={action:Ne.SendAlternateToPenaltyBox,flags:wt.MoveAllAlternatesMatchingHDCP,hdcpLevel:c}:this.keySystemError(t)}return;case P.BUFFER_ADD_CODEC_ERROR:case P.REMUX_ALLOC_ERROR:case P.BUFFER_APPEND_ERROR:t.errorAction=this.getLevelSwitchAction(t,(i=t.level)!=null?i:s.loadLevel);return;case P.INTERNAL_EXCEPTION:case P.BUFFER_APPENDING_ERROR:case P.BUFFER_FULL_ERROR:case P.LEVEL_SWITCH_ERROR:case P.BUFFER_STALLED_ERROR:case P.BUFFER_SEEK_OVER_HOLE:case P.BUFFER_NUDGE_ON_STALL:t.errorAction={action:Ne.DoNothing,flags:wt.None};return}t.type===X.KEY_SYSTEM_ERROR&&this.keySystemError(t)}keySystemError(e){const t=this.getVariantLevelIndex(e.frag);e.levelRetry=!1,e.errorAction=this.getLevelSwitchAction(e,t)}getPlaylistRetryOrSwitchAction(e,t){const n=this.hls,i=Fh(n.config.playlistLoadPolicy,e),s=this.playlistError++;if(na(i,s,ra(e),e.response))return{action:Ne.RetryRequest,flags:wt.None,retryConfig:i,retryCount:s};const l=this.getLevelSwitchAction(e,t);return i&&(l.retryConfig=i,l.retryCount=s),l}getFragRetryOrSwitchAction(e){const t=this.hls,n=this.getVariantLevelIndex(e.frag),i=t.levels[n],{fragLoadPolicy:s,keyLoadPolicy:o}=t.config,l=Fh(e.details.startsWith("key")?o:s,e),a=t.levels.reduce((c,f)=>c+f.fragmentError,0);if(i&&(e.details!==P.FRAG_GAP&&i.fragmentError++,na(l,a,ra(e),e.response)))return{action:Ne.RetryRequest,flags:wt.None,retryConfig:l,retryCount:a};const u=this.getLevelSwitchAction(e,n);return l&&(u.retryConfig=l,u.retryCount=a),u}getLevelSwitchAction(e,t){const n=this.hls;t==null&&(t=n.loadLevel);const i=this.hls.levels[t];if(i){var s,o;const u=e.details;i.loadError++,u===P.BUFFER_APPEND_ERROR&&i.fragmentError++;let c=-1;const{levels:f,loadLevel:d,minAutoLevel:h,maxAutoLevel:p}=n;n.autoLevelEnabled||(n.loadLevel=-1);const m=(s=e.frag)==null?void 0:s.type,g=(m===q.AUDIO&&u===P.FRAG_PARSING_ERROR||e.sourceBufferName==="audio"&&(u===P.BUFFER_ADD_CODEC_ERROR||u===P.BUFFER_APPEND_ERROR))&&f.some(({audioCodec:b})=>i.audioCodec!==b),x=e.sourceBufferName==="video"&&(u===P.BUFFER_ADD_CODEC_ERROR||u===P.BUFFER_APPEND_ERROR)&&f.some(({codecSet:b,audioCodec:w})=>i.codecSet!==b&&i.audioCodec===w),{type:S,groupId:E}=(o=e.context)!=null?o:{};for(let b=f.length;b--;){const w=(b+d)%f.length;if(w!==d&&w>=h&&w<=p&&f[w].loadError===0){var l,a;const A=f[w];if(u===P.FRAG_GAP&&m===q.MAIN&&e.frag){const R=f[w].details;if(R){const L=ia(e.frag,R.fragments,e.frag.start);if(L!=null&&L.gap)continue}}else{if(S===se.AUDIO_TRACK&&A.hasAudioGroup(E)||S===se.SUBTITLE_TRACK&&A.hasSubtitleGroup(E))continue;if(m===q.AUDIO&&(l=i.audioGroups)!=null&&l.some(R=>A.hasAudioGroup(R))||m===q.SUBTITLE&&(a=i.subtitleGroups)!=null&&a.some(R=>A.hasSubtitleGroup(R))||g&&i.audioCodec===A.audioCodec||!g&&i.audioCodec!==A.audioCodec||x&&i.codecSet===A.codecSet)continue}c=w;break}}if(c>-1&&n.loadLevel!==c)return e.levelRetry=!0,this.playlistError=0,{action:Ne.SendAlternateToPenaltyBox,flags:wt.None,nextAutoLevel:c}}return{action:Ne.SendAlternateToPenaltyBox,flags:wt.MoveAllAlternatesMatchingHost}}onErrorOut(e,t){var n;switch((n=t.errorAction)==null?void 0:n.action){case Ne.DoNothing:break;case Ne.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(t),!t.errorAction.resolved&&t.details!==P.FRAG_GAP?t.fatal=!0:/MediaSource readyState: ended/.test(t.error.message)&&(this.warn(`MediaSource ended after "${t.sourceBufferName}" sourceBuffer append error. Attempting to recover from media error.`),this.hls.recoverMediaError());break}if(t.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(e){const t=this.hls,n=e.errorAction;if(!n)return;const{flags:i,hdcpLevel:s,nextAutoLevel:o}=n;switch(i){case wt.None:this.switchLevel(e,o);break;case wt.MoveAllAlternatesMatchingHDCP:s&&(t.maxHdcpLevel=Wu[Wu.indexOf(s)-1],n.resolved=!0),this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}n.resolved||this.switchLevel(e,o)}switchLevel(e,t){t!==void 0&&e.errorAction&&(this.warn(`switching to level ${t} after ${e.details}`),this.hls.nextAutoLevel=t,e.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel)}}class pf{constructor(e,t){this.hls=void 0,this.timer=-1,this.requestScheduled=-1,this.canLoad=!1,this.log=void 0,this.warn=void 0,this.log=I.log.bind(I,`${t}:`),this.warn=I.warn.bind(I,`${t}:`),this.hls=e}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){this.timer!==-1&&(self.clearTimeout(this.timer),this.timer=-1)}startLoad(){this.canLoad=!0,this.requestScheduled=-1,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(e,t,n){const i=t==null?void 0:t.renditionReports;if(i){let s=-1;for(let o=0;o=0&&c>t.partTarget&&(a+=1)}const u=n&&Dh(n);return new _h(l,a>=0?a:void 0,u)}}}loadPlaylist(e){this.requestScheduled===-1&&(this.requestScheduled=self.performance.now())}shouldLoadPlaylist(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)}shouldReloadPlaylist(e){return this.timer===-1&&this.requestScheduled===-1&&this.shouldLoadPlaylist(e)}playlistLoaded(e,t,n){const{details:i,stats:s}=t,o=self.performance.now(),l=s.loading.first?Math.max(0,o-s.loading.first):0;if(i.advancedDateTime=Date.now()-l,i.live||n!=null&&n.live){if(i.reloaded(n),n&&this.log(`live playlist ${e} ${i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:i.updated?"UPDATED":"MISSED"}`),n&&i.fragments.length>0&&AT(n,i),!this.canLoad||!i.live)return;let a,u,c;if(i.canBlockReload&&i.endSN&&i.advanced){const y=this.hls.config.lowLatencyMode,g=i.lastPartSn,v=i.endSN,x=i.lastPartIndex,S=x!==-1,E=g===v,b=y?0:x;S?(u=E?v+1:g,c=E?b:x+1):u=v+1;const w=i.age,A=w+i.ageHeader;let R=Math.min(A-i.partTarget,i.targetduration*1.5);if(R>0){if(n&&R>n.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${n.tuneInGoal} to: ${R} with playlist age: ${i.age}`),R=0;else{const L=Math.floor(R/i.targetduration);if(u+=L,c!==void 0){const C=Math.round(R%i.targetduration/i.partTarget);c+=C}this.log(`CDN Tune-in age: ${i.ageHeader}s last advanced ${w.toFixed(2)}s goal: ${R} skip sn ${L} to part ${c}`)}i.tuneInGoal=R}if(a=this.getDeliveryDirectives(i,t.deliveryDirectives,u,c),y||!E){this.loadPlaylist(a);return}}else(i.canBlockReload||i.canSkipUntil)&&(a=this.getDeliveryDirectives(i,t.deliveryDirectives,u,c));const f=this.hls.mainForwardBufferInfo,d=f?f.end-f.len:0,h=(i.edge-d)*1e3,p=kT(i,h);i.updated&&o>this.requestScheduled+p&&(this.requestScheduled=s.loading.start),u!==void 0&&i.canBlockReload?this.requestScheduled=s.loading.first+p-(i.partTarget*1e3||1e3):this.requestScheduled===-1||this.requestScheduled+pthis.loadPlaylist(a),m)}else this.clearTimer()}getDeliveryDirectives(e,t,n,i){let s=Dh(e);return t!=null&&t.skip&&e.deltaUpdateFailed&&(n=t.msn,i=t.part,s=po.No),new _h(n,i,s)}checkRetry(e){const t=e.details,n=ra(e),i=e.errorAction,{action:s,retryCount:o=0,retryConfig:l}=i||{},a=!!i&&!!l&&(s===Ne.RetryRequest||!i.resolved&&s===Ne.SendAlternateToPenaltyBox);if(a){var u;if(this.requestScheduled=-1,o>=l.maxNumRetry)return!1;if(n&&(u=e.context)!=null&&u.deliveryDirectives)this.warn(`Retrying playlist loading ${o+1}/${l.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const c=hf(l,o);this.timer=self.setTimeout(()=>this.loadPlaylist(),c),this.warn(`Retrying playlist loading ${o+1}/${l.maxNumRetry} after "${t}" in ${c}ms`)}e.levelRetry=!0,i.resolved=!0}return a}}class vn{constructor(e,t=0,n=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=n}sample(e,t){const n=Math.pow(this.alpha_,e);this.estimate_=t*(1-n)+n*this.estimate_,this.totalWeight_+=e}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_}}class NT{constructor(e,t,n,i=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=n,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new vn(e),this.fast_=new vn(t),this.defaultTTFB_=i,this.ttfb_=new vn(e)}update(e,t){const{slow_:n,fast_:i,ttfb_:s}=this;n.halfLife!==e&&(this.slow_=new vn(e,n.getEstimate(),n.getTotalWeight())),i.halfLife!==t&&(this.fast_=new vn(t,i.getEstimate(),i.getTotalWeight())),s.halfLife!==e&&(this.ttfb_=new vn(e,s.getEstimate(),s.getTotalWeight()))}sample(e,t){e=Math.max(e,this.minDelayMs_);const n=8*t,i=e/1e3,s=n/i;this.fast_.sample(i,s),this.slow_.sample(i,s)}sampleTTFB(e){const t=e/1e3,n=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(n,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}destroy(){}}const Pg={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]},Nh={};function BT(r,e,t,n,i,s){const o=r.audioCodec?r.audioGroups:null,l=s==null?void 0:s.audioCodec,a=s==null?void 0:s.channels,u=a?parseInt(a):l?1/0:2;let c=null;if(o!=null&&o.length)try{o.length===1&&o[0]?c=e.groups[o[0]].channels:c=o.reduce((f,d)=>{if(d){const h=e.groups[d];if(!h)throw new Error(`Audio track group ${d} not found`);Object.keys(h.channels).forEach(p=>{f[p]=(f[p]||0)+h.channels[p]})}return f},{2:0})}catch{return!0}return r.videoCodec!==void 0&&(r.width>1920&&r.height>1088||r.height>1920&&r.width>1088||r.frameRate>Math.max(n,30)||r.videoRange!=="SDR"&&r.videoRange!==t||r.bitrate>Math.max(i,8e6))||!!c&&z(u)&&Object.keys(c).some(f=>parseInt(f)>u)}function UT(r,e,t){const n=r.videoCodec,i=r.audioCodec;if(!n||!i||!t)return Promise.resolve(Pg);const s={width:r.width,height:r.height,bitrate:Math.ceil(Math.max(r.bitrate*.9,r.averageBitrate)),framerate:r.frameRate||30},o=r.videoRange;o!=="SDR"&&(s.transferFunction=o.toLowerCase());const l=n.split(",").map(a=>({type:"media-source",video:Fe(Fe({},s),{},{contentType:ps(a,"video")})}));return i&&r.audioGroups&&r.audioGroups.forEach(a=>{var u;a&&((u=e.groups[a])==null||u.tracks.forEach(c=>{if(c.groupId===a){const f=c.channels||"",d=parseFloat(f);z(d)&&d>2&&l.push.apply(l,i.split(",").map(h=>({type:"media-source",audio:{contentType:ps(h,"audio"),channels:""+d}})))}}))}),Promise.all(l.map(a=>{const u=$T(a);return Nh[u]||(Nh[u]=t.decodingInfo(a))})).then(a=>({supported:!a.some(u=>!u.supported),configurations:l,decodingInfoResults:a})).catch(a=>({supported:!1,configurations:l,decodingInfoResults:[],error:a}))}function $T(r){const{audio:e,video:t}=r,n=t||e;if(n){const i=n.contentType.split('"')[1];if(t)return`r${t.height}x${t.width}f${Math.ceil(t.framerate)}${t.transferFunction||"sd"}_${i}_${Math.ceil(t.bitrate/1e5)}`;if(e)return`c${e.channels}${e.spatialRendering?"s":"n"}_${i}`}return""}function jT(){if(typeof matchMedia=="function"){const r=matchMedia("(dynamic-range: high)"),e=matchMedia("bad query");if(r.media!==e.media)return r.matches===!0}return!1}function GT(r,e){let t=!1,n=[];return r&&(t=r!=="SDR",n=[r]),e&&(n=e.allowedVideoRanges||ta.slice(0),t=e.preferHDR!==void 0?e.preferHDR:jT(),t?n=n.filter(i=>i!=="SDR"):n=["SDR"]),{preferHDR:t,allowedVideoRanges:n}}function HT(r,e,t,n,i){const s=Object.keys(r),o=n==null?void 0:n.channels,l=n==null?void 0:n.audioCodec,a=o&&parseInt(o)===2;let u=!0,c=!1,f=1/0,d=1/0,h=1/0,p=0,m=[];const{preferHDR:y,allowedVideoRanges:g}=GT(e,i);for(let E=s.length;E--;){const b=r[s[E]];u=b.channels[2]>0,f=Math.min(f,b.minHeight),d=Math.min(d,b.minFramerate),h=Math.min(h,b.minBitrate);const w=g.filter(A=>b.videoRanges[A]>0);w.length>0&&(c=!0,m=w)}f=z(f)?f:0,d=z(d)?d:0;const v=Math.max(1080,f),x=Math.max(30,d);return h=z(h)?h:t,t=Math.max(h,t),c||(e=void 0,m=[]),{codecSet:s.reduce((E,b)=>{const w=r[b];if(b===E)return E;if(w.minBitrate>t)return Zt(b,`min bitrate of ${w.minBitrate} > current estimate of ${t}`),E;if(!w.hasDefaultAudio)return Zt(b,"no renditions with default or auto-select sound found"),E;if(l&&b.indexOf(l.substring(0,4))%5!==0)return Zt(b,`audio codec preference "${l}" not found`),E;if(o&&!a){if(!w.channels[o])return Zt(b,`no renditions with ${o} channel sound found (channels options: ${Object.keys(w.channels)})`),E}else if((!l||a)&&u&&w.channels[2]===0)return Zt(b,"no renditions with stereo sound found"),E;return w.minHeight>v?(Zt(b,`min resolution of ${w.minHeight} > maximum of ${v}`),E):w.minFramerate>x?(Zt(b,`min framerate of ${w.minFramerate} > maximum of ${x}`),E):m.some(A=>w.videoRanges[A]>0)?w.maxScore=Jo(E)||w.fragmentError>r[E].fragmentError)?E:(p=w.maxScore,b):(Zt(b,`no variants with VIDEO-RANGE of ${JSON.stringify(m)} found`),E)},void 0),videoRanges:m,preferHDR:y,minFramerate:d,minBitrate:h}}function Zt(r,e){I.log(`[abr] start candidates with "${r}" ignored because ${e}`)}function zT(r){return r.reduce((e,t)=>{let n=e.groups[t.groupId];n||(n=e.groups[t.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),n.tracks.push(t);const i=t.channels||"2";return n.channels[i]=(n.channels[i]||0)+1,n.hasDefault=n.hasDefault||t.default,n.hasAutoSelect=n.hasAutoSelect||t.autoselect,n.hasDefault&&(e.hasDefaultAudio=!0),n.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function VT(r,e,t,n){return r.slice(t,n+1).reduce((i,s)=>{if(!s.codecSet)return i;const o=s.audioGroups;let l=i[s.codecSet];l||(i[s.codecSet]=l={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!o,fragmentError:0}),l.minBitrate=Math.min(l.minBitrate,s.bitrate);const a=Math.min(s.height,s.width);return l.minHeight=Math.min(l.minHeight,a),l.minFramerate=Math.min(l.minFramerate,s.frameRate),l.maxScore=Math.max(l.maxScore,s.score),l.fragmentError+=s.fragmentError,l.videoRanges[s.videoRange]=(l.videoRanges[s.videoRange]||0)+1,o&&o.forEach(u=>{if(!u)return;const c=e.groups[u];c&&(l.hasDefaultAudio=l.hasDefaultAudio||e.hasDefaultAudio?c.hasDefault:c.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(c.channels).forEach(f=>{l.channels[f]=(l.channels[f]||0)+c.channels[f]}))}),i},{})}function Ht(r,e,t){if("attrs"in r){const n=e.indexOf(r);if(n!==-1)return n}for(let n=0;nn.indexOf(i)===-1)}function xn(r,e){const{audioCodec:t,channels:n}=r;return(t===void 0||(e.audioCodec||"").substring(0,4)===t.substring(0,4))&&(n===void 0||n===(e.channels||"2"))}function WT(r,e,t,n,i){const s=e[n],l=e.reduce((d,h,p)=>{const m=h.uri;return(d[m]||(d[m]=[])).push(p),d},{})[s.uri];l.length>1&&(n=Math.max.apply(Math,l));const a=s.videoRange,u=s.frameRate,c=s.codecSet.substring(0,4),f=Bh(e,n,d=>{if(d.videoRange!==a||d.frameRate!==u||d.codecSet.substring(0,4)!==c)return!1;const h=d.audioGroups,p=t.filter(m=>!h||h.indexOf(m.groupId)!==-1);return Ht(r,p,i)>-1});return f>-1?f:Bh(e,n,d=>{const h=d.audioGroups,p=t.filter(m=>!h||h.indexOf(m.groupId)!==-1);return Ht(r,p,i)>-1})}function Bh(r,e,t){for(let n=e;n;n--)if(t(r[n]))return n;for(let n=e+1;n{const{fragCurrent:t,partCurrent:n,hls:i}=this,{autoLevelEnabled:s,media:o}=i;if(!t||!o)return;const l=performance.now(),a=n?n.stats:t.stats,u=n?n.duration:t.duration,c=l-a.loading.start,f=i.minAutoLevel;if(a.aborted||a.loaded&&a.loaded===a.total||t.level<=f){this.clearTimer(),this._nextAutoLevel=-1;return}if(!s||o.paused||!o.playbackRate||!o.readyState)return;const d=i.mainForwardBufferInfo;if(d===null)return;const h=this.bwEstimator.getEstimateTTFB(),p=Math.abs(o.playbackRate);if(c<=Math.max(h,1e3*(u/(p*2))))return;const m=d.len/p,y=a.loading.first?a.loading.first-a.loading.start:-1,g=a.loaded&&y>-1,v=this.getBwEstimate(),x=i.levels,S=x[t.level],E=a.total||Math.max(a.loaded,Math.round(u*S.averageBitrate/8));let b=g?c-y:c;b<1&&g&&(b=Math.min(c,a.loaded*8/v));const w=g?a.loaded*1e3/b:0,A=w?(E-a.loaded)/w:E*8/v+h/1e3;if(A<=m)return;const R=w?w*8:v;let L=Number.POSITIVE_INFINITY,C;for(C=t.level-1;C>f;C--){const k=x[C].maxBitrate;if(L=this.getTimeToLoadFrag(h/1e3,R,u*k,!x[C].details),L=A||L>u*10)return;i.nextLoadLevel=i.nextAutoLevel=C,g?this.bwEstimator.sample(c-Math.min(h,y),a.loaded):this.bwEstimator.sampleTTFB(c);const _=x[C].maxBitrate;this.getBwEstimate()*this.hls.config.abrBandWidthUpFactor>_&&this.resetEstimator(_),this.clearTimer(),I.warn(`[abr] Fragment ${t.sn}${n?" part "+n.index:""} of level ${t.level} is loading too slowly; + Time to underbuffer: ${m.toFixed(3)} s + Estimated load time for current fragment: ${A.toFixed(3)} s + Estimated load time for down switch fragment: ${L.toFixed(3)} s + TTFB estimate: ${y|0} ms + Current BW estimate: ${z(v)?v|0:"Unknown"} bps + New BW estimate: ${this.getBwEstimate()|0} bps + Switching to level ${C} @ ${_|0} bps`),i.trigger(T.FRAG_LOAD_EMERGENCY_ABORTED,{frag:t,part:n,stats:a})},this.hls=e,this.bwEstimator=this.initEstimator(),this.registerListeners()}resetEstimator(e){e&&(I.log(`setting initial bwe to ${e}`),this.hls.config.abrEwmaDefaultEstimate=e),this.firstSelection=-1,this.bwEstimator=this.initEstimator()}initEstimator(){const e=this.hls.config;return new NT(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}registerListeners(){const{hls:e}=this;e.on(T.MANIFEST_LOADING,this.onManifestLoading,this),e.on(T.FRAG_LOADING,this.onFragLoading,this),e.on(T.FRAG_LOADED,this.onFragLoaded,this),e.on(T.FRAG_BUFFERED,this.onFragBuffered,this),e.on(T.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(T.LEVEL_LOADED,this.onLevelLoaded,this),e.on(T.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(T.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(T.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e&&(e.off(T.MANIFEST_LOADING,this.onManifestLoading,this),e.off(T.FRAG_LOADING,this.onFragLoading,this),e.off(T.FRAG_LOADED,this.onFragLoaded,this),e.off(T.FRAG_BUFFERED,this.onFragBuffered,this),e.off(T.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(T.LEVEL_LOADED,this.onLevelLoaded,this),e.off(T.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(T.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(T.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(e,t){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}onLevelsUpdated(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}onMaxAutoLevelUpdated(){this.firstSelection=-1,this.nextAutoLevelKey=""}onFragLoading(e,t){const n=t.frag;if(!this.ignoreFragment(n)){if(!n.bitrateTest){var i;this.fragCurrent=n,this.partCurrent=(i=t.part)!=null?i:null}this.clearTimer(),this.timer=self.setInterval(this._abandonRulesCheck,100)}}onLevelSwitching(e,t){this.clearTimer()}onError(e,t){if(!t.fatal)switch(t.details){case P.BUFFER_ADD_CODEC_ERROR:case P.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case P.FRAG_LOAD_TIMEOUT:{const n=t.frag,{fragCurrent:i,partCurrent:s}=this;if(n&&i&&n.sn===i.sn&&n.level===i.level){const o=performance.now(),l=s?s.stats:n.stats,a=o-l.loading.start,u=l.loading.first?l.loading.first-l.loading.start:-1;if(l.loaded&&u>-1){const f=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(a-Math.min(f,u),l.loaded)}else this.bwEstimator.sampleTTFB(a)}break}}}getTimeToLoadFrag(e,t,n,i){const s=e+n/t,o=i?this.lastLevelLoadSec:0;return s+o}onLevelLoaded(e,t){const n=this.hls.config,{loading:i}=t.stats,s=i.end-i.start;z(s)&&(this.lastLevelLoadSec=s/1e3),t.details.live?this.bwEstimator.update(n.abrEwmaSlowLive,n.abrEwmaFastLive):this.bwEstimator.update(n.abrEwmaSlowVoD,n.abrEwmaFastVoD)}onFragLoaded(e,{frag:t,part:n}){const i=n?n.stats:t.stats;if(t.type===q.MAIN&&this.bwEstimator.sampleTTFB(i.loading.first-i.loading.start),!this.ignoreFragment(t)){if(this.clearTimer(),t.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const s=n?n.duration:t.duration,o=this.hls.levels[t.level],l=(o.loaded?o.loaded.bytes:0)+i.loaded,a=(o.loaded?o.loaded.duration:0)+s;o.loaded={bytes:l,duration:a},o.realBitrate=Math.round(8*l/a)}if(t.bitrateTest){const s={stats:i,frag:t,part:n,id:t.type};this.onFragBuffered(T.FRAG_BUFFERED,s),t.bitrateTest=!1}else this.lastLoadedFragLevel=t.level}}onFragBuffered(e,t){const{frag:n,part:i}=t,s=i!=null&&i.stats.loaded?i.stats:n.stats;if(s.aborted||this.ignoreFragment(n))return;const o=s.parsing.end-s.loading.start-Math.min(s.loading.first-s.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(o,s.loaded),s.bwEstimate=this.getBwEstimate(),n.bitrateTest?this.bitrateTestDelay=o/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==q.MAIN||e.sn==="initSegment"}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:e,minAutoLevel:t}=this.hls,n=this.getBwEstimate(),i=this.hls.config.maxStarvationDelay,s=this.findBestLevel(n,t,e,0,i,1,1);if(s>-1)return s;const o=this.hls.firstLevel,l=Math.min(Math.max(o,t),e);return I.warn(`[abr] Could not find best starting auto level. Defaulting to first in playlist ${o} clamped to ${l}`),l}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const e=this.forcedAutoLevel,n=this.bwEstimator.canEstimate(),i=this.lastLoadedFragLevel>-1;if(e!==-1&&(!n||!i||this.nextAutoLevelKey===this.getAutoLevelKey()))return e;const s=n&&i?this.getNextABRAutoLevel():this.firstAutoLevel;if(e!==-1){const o=this.hls.levels;if(o.length>Math.max(e,s)&&o[e].loadError<=o[s].loadError)return e}return this._nextAutoLevel=s,this.nextAutoLevelKey=this.getAutoLevelKey(),s}getAutoLevelKey(){return`${this.getBwEstimate()}_${this.getStarvationDelay().toFixed(2)}`}getNextABRAutoLevel(){const{fragCurrent:e,partCurrent:t,hls:n}=this,{maxAutoLevel:i,config:s,minAutoLevel:o}=n,l=t?t.duration:e?e.duration:0,a=this.getBwEstimate(),u=this.getStarvationDelay();let c=s.abrBandWidthFactor,f=s.abrBandWidthUpFactor;if(u){const y=this.findBestLevel(a,o,i,u,0,c,f);if(y>=0)return y}let d=l?Math.min(l,s.maxStarvationDelay):s.maxStarvationDelay;if(!u){const y=this.bitrateTestDelay;y&&(d=(l?Math.min(l,s.maxLoadingDelay):s.maxLoadingDelay)-y,I.info(`[abr] bitrate test took ${Math.round(1e3*y)}ms, set first fragment max fetchDuration to ${Math.round(1e3*d)} ms`),c=f=1)}const h=this.findBestLevel(a,o,i,u,d,c,f);if(I.info(`[abr] ${u?"rebuffering expected":"buffer is empty"}, optimal quality level ${h}`),h>-1)return h;const p=n.levels[o],m=n.levels[n.loadLevel];return(p==null?void 0:p.bitrate)<(m==null?void 0:m.bitrate)?o:n.loadLevel}getStarvationDelay(){const e=this.hls,t=e.media;if(!t)return 1/0;const n=t&&t.playbackRate!==0?Math.abs(t.playbackRate):1,i=e.mainForwardBufferInfo;return(i?i.len:0)/n}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(e,t,n,i,s,o,l){var a;const u=i+s,c=this.lastLoadedFragLevel,f=c===-1?this.hls.firstLevel:c,{fragCurrent:d,partCurrent:h}=this,{levels:p,allAudioTracks:m,loadLevel:y,config:g}=this.hls;if(p.length===1)return 0;const v=p[f],x=!!(v!=null&&(a=v.details)!=null&&a.live),S=y===-1||c===-1;let E,b="SDR",w=(v==null?void 0:v.frameRate)||0;const{audioPreference:A,videoPreference:R}=g,L=this.audioTracksByGroup||(this.audioTracksByGroup=zT(m));if(S){if(this.firstSelection!==-1)return this.firstSelection;const O=this.codecTiers||(this.codecTiers=VT(p,L,t,n)),U=HT(O,b,e,A,R),{codecSet:G,videoRanges:B,minFramerate:F,minBitrate:N,preferHDR:K}=U;E=G,b=K?B[B.length-1]:B[0],w=F,e=Math.max(e,N),I.log(`[abr] picked start tier ${JSON.stringify(U)}`)}else E=v==null?void 0:v.codecSet,b=v==null?void 0:v.videoRange;const C=h?h.duration:d?d.duration:0,_=this.bwEstimator.getEstimateTTFB()/1e3,k=[];for(let O=n;O>=t;O--){var M;const U=p[O],G=O>f;if(!U)continue;if(g.useMediaCapabilities&&!U.supportedResult&&!U.supportedPromise){const ie=navigator.mediaCapabilities;typeof(ie==null?void 0:ie.decodingInfo)=="function"&&BT(U,L,b,w,e,A)?(U.supportedPromise=UT(U,L,ie),U.supportedPromise.then(ce=>{if(!this.hls)return;U.supportedResult=ce;const ae=this.hls.levels,xe=ae.indexOf(U);ce.error?I.warn(`[abr] MediaCapabilities decodingInfo error: "${ce.error}" for level ${xe} ${JSON.stringify(ce)}`):ce.supported||(I.warn(`[abr] Unsupported MediaCapabilities decodingInfo result for level ${xe} ${JSON.stringify(ce)}`),xe>-1&&ae.length>1&&(I.log(`[abr] Removing unsupported level ${xe}`),this.hls.removeLevel(xe)))})):U.supportedResult=Pg}if(E&&U.codecSet!==E||b&&U.videoRange!==b||G&&w>U.frameRate||!G&&w>0&&w=C*2&&s===0?p[O].averageBitrate:p[O].maxBitrate,V=this.getTimeToLoadFrag(_,N,K*F,B===void 0);if(N>=K&&(O===c||U.loadError===0&&U.fragmentError===0)&&(V<=_||!z(V)||x&&!this.bitrateTestDelay||V${O} adjustedbw(${Math.round(N)})-bitrate=${Math.round(N-K)} ttfb:${_.toFixed(1)} avgDuration:${F.toFixed(1)} maxFetchDuration:${u.toFixed(1)} fetchDuration:${V.toFixed(1)} firstSelection:${S} codecSet:${E} videoRange:${b} hls.loadLevel:${y}`)),S&&(this.firstSelection=O),O}}return-1}set nextAutoLevel(e){const{maxAutoLevel:t,minAutoLevel:n}=this.hls,i=Math.min(Math.max(e,n),t);this._nextAutoLevel!==i&&(this.nextAutoLevelKey="",this._nextAutoLevel=i)}}class qT{constructor(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}destroy(){this.onHandlerDestroying(),this.onHandlerDestroyed()}onHandlerDestroying(){this.clearNextTick(),this.clearInterval()}onHandlerDestroyed(){}hasInterval(){return!!this._tickInterval}hasNextTick(){return!!this._tickTimer}setInterval(e){return this._tickInterval?!1:(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,e),!0)}clearInterval(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1}clearNextTick(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1}tick(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}var Pe={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class XT{constructor(e){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=e,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(T.BUFFER_APPENDED,this.onBufferAppended,this),e.on(T.FRAG_BUFFERED,this.onFragBuffered,this),e.on(T.FRAG_LOADED,this.onFragLoaded,this)}_unregisterListeners(){const{hls:e}=this;e.off(T.BUFFER_APPENDED,this.onBufferAppended,this),e.off(T.FRAG_BUFFERED,this.onFragBuffered,this),e.off(T.FRAG_LOADED,this.onFragLoaded,this)}destroy(){this._unregisterListeners(),this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(e,t){const n=this.activePartLists[t];if(n)for(let i=n.length;i--;){const s=n[i];if(!s)break;const o=s.end;if(s.start<=e&&o!==null&&e<=o)return s}return this.getBufferedFrag(e,t)}getBufferedFrag(e,t){const{fragments:n}=this,i=Object.keys(n);for(let s=i.length;s--;){const o=n[i[s]];if((o==null?void 0:o.body.type)===t&&o.buffered){const l=o.body;if(l.start<=e&&e<=l.end)return l}}return null}detectEvictedFragments(e,t,n,i){this.timeRanges&&(this.timeRanges[e]=t);const s=(i==null?void 0:i.fragment.sn)||-1;Object.keys(this.fragments).forEach(o=>{const l=this.fragments[o];if(!l||s>=l.body.sn)return;if(!l.buffered&&!l.loaded){l.body.type===n&&this.removeFragment(l.body);return}const a=l.range[e];a&&a.time.some(u=>{const c=!this.isTimeBuffered(u.startPTS,u.endPTS,t);return c&&this.removeFragment(l.body),c})})}detectPartialFragments(e){const t=this.timeRanges,{frag:n,part:i}=e;if(!t||n.sn==="initSegment")return;const s=En(n),o=this.fragments[s];if(!o||o.buffered&&n.gap)return;const l=!n.relurl;Object.keys(t).forEach(a=>{const u=n.elementaryStreams[a];if(!u)return;const c=t[a],f=l||u.partial===!0;o.range[a]=this.getBufferedTimes(n,i,f,c)}),o.loaded=null,Object.keys(o.range).length?(o.buffered=!0,(o.body.endList=n.endList||o.body.endList)&&(this.endListFragments[o.body.type]=o),zs(o)||this.removeParts(n.sn-1,n.type)):this.removeFragment(o.body)}removeParts(e,t){const n=this.activePartLists[t];n&&(this.activePartLists[t]=n.filter(i=>i.fragment.sn>=e))}fragBuffered(e,t){const n=En(e);let i=this.fragments[n];!i&&t&&(i=this.fragments[n]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),i&&(i.loaded=null,i.buffered=!0)}getBufferedTimes(e,t,n,i){const s={time:[],partial:n},o=e.start,l=e.end,a=e.minEndPTS||l,u=e.maxStartPTS||o;for(let c=0;c=f&&a<=d){s.time.push({startPTS:Math.max(o,i.start(c)),endPTS:Math.min(l,i.end(c))});break}else if(of){const h=Math.max(o,i.start(c)),p=Math.min(l,i.end(c));p>h&&(s.partial=!0,s.time.push({startPTS:h,endPTS:p}))}else if(l<=f)break}return s}getPartialFragment(e){let t=null,n,i,s,o=0;const{bufferPadding:l,fragments:a}=this;return Object.keys(a).forEach(u=>{const c=a[u];c&&zs(c)&&(i=c.body.start-l,s=c.body.end+l,e>=i&&e<=s&&(n=Math.min(e-i,s-e),o<=n&&(t=c.body,o=n)))}),t}isEndListAppended(e){const t=this.endListFragments[e];return t!==void 0&&(t.buffered||zs(t))}getState(e){const t=En(e),n=this.fragments[t];return n?n.buffered?zs(n)?Pe.PARTIAL:Pe.OK:Pe.APPENDING:Pe.NOT_LOADED}isTimeBuffered(e,t,n){let i,s;for(let o=0;o=i&&t<=s)return!0;if(t<=i)return!1}return!1}onFragLoaded(e,t){const{frag:n,part:i}=t;if(n.sn==="initSegment"||n.bitrateTest)return;const s=i?null:t,o=En(n);this.fragments[o]={body:n,appendedPTS:null,loaded:s,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:n,part:i,timeRanges:s}=t;if(n.sn==="initSegment")return;const o=n.type;if(i){let l=this.activePartLists[o];l||(this.activePartLists[o]=l=[]),l.push(i)}this.timeRanges=s,Object.keys(s).forEach(l=>{const a=s[l];this.detectEvictedFragments(l,a,o,i)})}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=En(e);return!!this.fragments[t]}hasParts(e){var t;return!!((t=this.activePartLists[e])!=null&&t.length)}removeFragmentsInRange(e,t,n,i,s){i&&!this.hasGaps||Object.keys(this.fragments).forEach(o=>{const l=this.fragments[o];if(!l)return;const a=l.body;a.type!==n||i&&!a.gap||a.starte&&(l.buffered||s)&&this.removeFragment(a)})}removeFragment(e){const t=En(e);e.stats.loaded=0,e.clearElementaryStreamInfo();const n=this.activePartLists[e.type];if(n){const i=e.sn;this.activePartLists[e.type]=n.filter(s=>s.fragment.sn!==i)}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1}}function zs(r){var e,t,n;return r.buffered&&(r.body.gap||((e=r.range.video)==null?void 0:e.partial)||((t=r.range.audio)==null?void 0:t.partial)||((n=r.range.audiovideo)==null?void 0:n.partial))}function En(r){return`${r.type}_${r.level}_${r.sn}`}const ZT={length:0,start:()=>0,end:()=>0};class fe{static isBuffered(e,t){try{if(e){const n=fe.getBuffered(e);for(let i=0;i=n.start(i)&&t<=n.end(i))return!0}}catch{}return!1}static bufferInfo(e,t,n){try{if(e){const i=fe.getBuffered(e),s=[];let o;for(o=0;of&&(i[c-1].end=e[u].end):i.push(e[u])}else i.push(e[u])}else i=e;let s=0,o,l=t,a=t;for(let u=0;u=c&&tt.startCC||r&&r.cc{if(this.loader&&this.loader.destroy(),e.gap)if(e.tagList.some(h=>h[0]==="GAP")){a(Gh(e));return}else e.gap=!1;const u=this.loader=e.loader=s?new s(i):new o(i),c=jh(e),f=Mh(i.fragLoadPolicy.default),d={loadPolicy:f,timeout:f.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:e.sn==="initSegment"?1/0:$h};e.stats=u.stats,u.load(c,d,{onSuccess:(h,p,m,y)=>{this.resetLoader(e,u);let g=h.data;m.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(g.slice(0,16)),g=g.slice(16)),l({frag:e,part:null,payload:g,networkDetails:y})},onError:(h,p,m,y)=>{this.resetLoader(e,u),a(new er({type:X.NETWORK_ERROR,details:P.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:Fe({url:n,data:void 0},h),error:new Error(`HTTP Error ${h.code} ${h.text}`),networkDetails:m,stats:y}))},onAbort:(h,p,m)=>{this.resetLoader(e,u),a(new er({type:X.NETWORK_ERROR,details:P.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:m,stats:h}))},onTimeout:(h,p,m)=>{this.resetLoader(e,u),a(new er({type:X.NETWORK_ERROR,details:P.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${d.timeout}ms`),networkDetails:m,stats:h}))},onProgress:(h,p,m,y)=>{t&&t({frag:e,part:null,payload:m,networkDetails:y})}})})}loadPart(e,t,n){this.abort();const i=this.config,s=i.fLoader,o=i.loader;return new Promise((l,a)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap){a(Gh(e,t));return}const u=this.loader=e.loader=s?new s(i):new o(i),c=jh(e,t),f=Mh(i.fragLoadPolicy.default),d={loadPolicy:f,timeout:f.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:$h};t.stats=u.stats,u.load(c,d,{onSuccess:(h,p,m,y)=>{this.resetLoader(e,u),this.updateStatsFromPart(e,t);const g={frag:e,part:t,payload:h.data,networkDetails:y};n(g),l(g)},onError:(h,p,m,y)=>{this.resetLoader(e,u),a(new er({type:X.NETWORK_ERROR,details:P.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:Fe({url:c.url,data:void 0},h),error:new Error(`HTTP Error ${h.code} ${h.text}`),networkDetails:m,stats:y}))},onAbort:(h,p,m)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,u),a(new er({type:X.NETWORK_ERROR,details:P.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:m,stats:h}))},onTimeout:(h,p,m)=>{this.resetLoader(e,u),a(new er({type:X.NETWORK_ERROR,details:P.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${d.timeout}ms`),networkDetails:m,stats:h}))}})})}updateStatsFromPart(e,t){const n=e.stats,i=t.stats,s=i.total;if(n.loaded+=i.loaded,s){const a=Math.round(e.duration/t.duration),u=Math.min(Math.round(n.loaded/s),a),f=(a-u)*Math.round(n.loaded/u);n.total=n.loaded+f}else n.total=Math.max(n.loaded,n.total);const o=n.loading,l=i.loading;o.start?o.first+=l.first-l.start:(o.start=l.start,o.first=l.first),o.end=l.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function jh(r,e=null){const t=e||r,n={frag:r,part:e,responseType:"arraybuffer",url:t.url,headers:{},rangeStart:0,rangeEnd:0},i=t.byteRangeStartOffset,s=t.byteRangeEndOffset;if(z(i)&&z(s)){var o;let l=i,a=s;if(r.sn==="initSegment"&&((o=r.decryptdata)==null?void 0:o.method)==="AES-128"){const u=s-i;u%16&&(a=s+(16-u%16)),i!==0&&(n.resetIV=!0,l=i-16)}n.rangeStart=l,n.rangeEnd=a}return n}function Gh(r,e){const t=new Error(`GAP ${r.gap?"tag":"attribute"} found`),n={type:X.MEDIA_ERROR,details:P.FRAG_GAP,fatal:!1,frag:r,error:t,networkDetails:null};return e&&(n.part=e),(e||r).stats.aborted=!0,new er(n)}class er extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class nw{constructor(e,t){this.subtle=void 0,this.aesIV=void 0,this.subtle=e,this.aesIV=t}decrypt(e,t){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e)}}class iw{constructor(e,t){this.subtle=void 0,this.key=void 0,this.subtle=e,this.key=t}expandKey(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])}}function sw(r){const e=r.byteLength,t=e&&new DataView(r.buffer).getUint8(e-1);return t?nn(r,0,e-t):r}class ow{constructor(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}uint8ArrayToUint32Array_(e){const t=new DataView(e),n=new Uint32Array(4);for(let i=0;i<4;i++)n[i]=t.getUint32(i*4);return n}initTable(){const e=this.sBox,t=this.invSBox,n=this.subMix,i=n[0],s=n[1],o=n[2],l=n[3],a=this.invSubMix,u=a[0],c=a[1],f=a[2],d=a[3],h=new Uint32Array(256);let p=0,m=0,y=0;for(y=0;y<256;y++)y<128?h[y]=y<<1:h[y]=y<<1^283;for(y=0;y<256;y++){let g=m^m<<1^m<<2^m<<3^m<<4;g=g>>>8^g&255^99,e[p]=g,t[g]=p;const v=h[p],x=h[v],S=h[x];let E=h[g]*257^g*16843008;i[p]=E<<24|E>>>8,s[p]=E<<16|E>>>16,o[p]=E<<8|E>>>24,l[p]=E,E=S*16843009^x*65537^v*257^p*16843008,u[g]=E<<24|E>>>8,c[g]=E<<16|E>>>16,f[g]=E<<8|E>>>24,d[g]=E,p?(p=v^h[h[h[S^v]]],m^=h[h[m]]):p=m=1}}expandKey(e){const t=this.uint8ArrayToUint32Array_(e);let n=!0,i=0;for(;ithis.subtle?(this.logOnce("WebCrypto AES decrypt"),new nw(this.subtle,new Uint8Array(n)).decrypt(e.buffer,i)):Promise.reject(new Error("web crypto not initialized"))).catch(i=>(I.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${i.name}: ${i.message}`),this.onWebCryptoError(e,t,n)))}onWebCryptoError(e,t,n){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,n);const i=this.flush();if(i)return i.buffer;throw new Error("WebCrypto and softwareDecrypt: failed to decrypt data")}getValidChunk(e){let t=e;const n=e.length-e.length%aw;return n!==e.length&&(t=nn(e,0,n),this.remainderData=nn(e,n)),t}logOnce(e){this.logEnabled&&(I.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const lw={toString:function(r){let e="";const t=r.length;for(let n=0;nl.end){const f=o>c;(o{if(this.fragContextChanged(e)){this.warn(`Fragment ${e.sn}${s.part?" p: "+s.part.index:""} of level ${e.level} was dropped during download.`),this.fragmentTracker.removeFragment(e);return}e.stats.chunkCount++,this._handleFragmentLoadProgress(s)};this._doFragLoad(e,t,n,i).then(s=>{if(!s)return;const o=this.state;if(this.fragContextChanged(e)){(o===$.FRAG_LOADING||!this.fragCurrent&&o===$.PARSING)&&(this.fragmentTracker.removeFragment(e),this.state=$.IDLE);return}"payload"in s&&(this.log(`Loaded fragment ${e.sn} of level ${e.level}`),this.hls.trigger(T.FRAG_LOADED,s)),this._handleFragmentLoadComplete(s)}).catch(s=>{this.state===$.STOPPED||this.state===$.ERROR||(this.warn(`Frag error: ${(s==null?void 0:s.message)||s}`),this.resetFragmentLoading(e))})}clearTrackerIfNeeded(e){var t;const{fragmentTracker:n}=this;if(n.getState(e)===Pe.APPENDING){const s=e.type,o=this.getFwdBufferInfo(this.mediaBuffer,s),l=Math.max(e.duration,o?o.len:this.config.maxBufferLength),a=this.backtrackFragment;((a?e.sn-a.sn:0)===1||this.reduceMaxBufferLength(l,e.duration))&&n.removeFragment(e)}else((t=this.mediaBuffer)==null?void 0:t.buffered.length)===0?n.removeAllFragments():n.hasParts(e.type)&&(n.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),n.getState(e)===Pe.PARTIAL&&n.removeFragment(e))}checkLiveUpdate(e){if(e.updated&&!e.live){const t=e.fragments[e.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:t,part:null,stats:t.stats,id:t.type})}e.fragments[0]||(e.deltaUpdateFailed=!0)}flushMainBuffer(e,t,n=null){if(!(e-t))return;const i={startOffset:e,endOffset:t,type:n};this.hls.trigger(T.BUFFER_FLUSHING,i)}_loadInitSegment(e,t){this._doFragLoad(e,t).then(n=>{if(!n||this.fragContextChanged(e)||!this.levels)throw new Error("init load aborted");return n}).then(n=>{const{hls:i}=this,{payload:s}=n,o=e.decryptdata;if(s&&s.byteLength>0&&o!=null&&o.key&&o.iv&&o.method==="AES-128"){const l=self.performance.now();return this.decrypter.decrypt(new Uint8Array(s),o.key.buffer,o.iv.buffer).catch(a=>{throw i.trigger(T.ERROR,{type:X.MEDIA_ERROR,details:P.FRAG_DECRYPT_ERROR,fatal:!1,error:a,reason:a.message,frag:e}),a}).then(a=>{const u=self.performance.now();return i.trigger(T.FRAG_DECRYPTED,{frag:e,payload:a,stats:{tstart:l,tdecrypt:u}}),n.payload=a,this.completeInitSegmentLoad(n)})}return this.completeInitSegmentLoad(n)}).catch(n=>{this.state===$.STOPPED||this.state===$.ERROR||(this.warn(n),this.resetFragmentLoading(e))})}completeInitSegmentLoad(e){const{levels:t}=this;if(!t)throw new Error("init load aborted, missing levels");const n=e.frag.stats;this.state=$.IDLE,e.frag.data=new Uint8Array(e.payload),n.parsing.start=n.buffering.start=self.performance.now(),n.parsing.end=n.buffering.end=self.performance.now(),this.tick()}fragContextChanged(e){const{fragCurrent:t}=this;return!e||!t||e.sn!==t.sn||e.level!==t.level}fragBufferedComplete(e,t){var n,i,s,o;const l=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log(`Buffered ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.playlistType===q.MAIN?"level":"track"} ${e.level} (frag:[${((n=e.startPTS)!=null?n:NaN).toFixed(3)}-${((i=e.endPTS)!=null?i:NaN).toFixed(3)}] > buffer:${l?lw.toString(fe.getBuffered(l)):"(detached)"})`),e.sn!=="initSegment"){var a;if(e.type!==q.SUBTITLE){const c=e.elementaryStreams;if(!Object.keys(c).some(f=>!!c[f])){this.state=$.IDLE;return}}const u=(a=this.levels)==null?void 0:a[e.level];u!=null&&u.fragmentError&&(this.log(`Resetting level fragment error count of ${u.fragmentError} on frag buffered`),u.fragmentError=0)}this.state=$.IDLE,l&&(!this.loadedmetadata&&e.type==q.MAIN&&l.buffered.length&&((s=this.fragCurrent)==null?void 0:s.sn)===((o=this.fragPrevious)==null?void 0:o.sn)&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick())}seekToStartPos(){}_handleFragmentLoadComplete(e){const{transmuxer:t}=this;if(!t)return;const{frag:n,part:i,partsLoaded:s}=e,o=!s||s.length===0||s.some(a=>!a),l=new mf(n.level,n.sn,n.stats.chunkCount+1,0,i?i.index:-1,!o);t.flush(l)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,n=null,i){var s;const o=t==null?void 0:t.details;if(!this.levels||!o)throw new Error(`frag load aborted, missing level${o?"":" detail"}s`);let l=null;if(e.encrypted&&!((s=e.decryptdata)!=null&&s.key)?(this.log(`Loading key for ${e.sn} of [${o.startSN}-${o.endSN}], ${this.logPrefix==="[stream-controller]"?"level":"track"} ${e.level}`),this.state=$.KEY_LOADING,this.fragCurrent=e,l=this.keyLoader.load(e).then(c=>{if(!this.fragContextChanged(c.frag))return this.hls.trigger(T.KEY_LOADED,c),this.state===$.KEY_LOADING&&(this.state=$.IDLE),c}),this.hls.trigger(T.KEY_LOADING,{frag:e}),this.fragCurrent===null&&(l=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))):!e.encrypted&&o.encryptedFragments.length&&this.keyLoader.loadClear(e,o.encryptedFragments),n=Math.max(e.start,n||0),this.config.lowLatencyMode&&e.sn!=="initSegment"){const c=o.partList;if(c&&i){n>e.end&&o.fragmentHint&&(e=o.fragmentHint);const f=this.getNextPart(c,e,n);if(f>-1){const d=c[f];this.log(`Loading part sn: ${e.sn} p: ${d.index} cc: ${e.cc} of playlist [${o.startSN}-${o.endSN}] parts [0-${f}-${c.length-1}] ${this.logPrefix==="[stream-controller]"?"level":"track"}: ${e.level}, target: ${parseFloat(n.toFixed(3))}`),this.nextLoadPosition=d.start+d.duration,this.state=$.FRAG_LOADING;let h;return l?h=l.then(p=>!p||this.fragContextChanged(p.frag)?null:this.doFragPartsLoad(e,d,t,i)).catch(p=>this.handleFragLoadError(p)):h=this.doFragPartsLoad(e,d,t,i).catch(p=>this.handleFragLoadError(p)),this.hls.trigger(T.FRAG_LOADING,{frag:e,part:d,targetBufferTime:n}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):h}else if(!e.url||this.loadedEndOfParts(c,n))return Promise.resolve(null)}}this.log(`Loading fragment ${e.sn} cc: ${e.cc} ${o?"of ["+o.startSN+"-"+o.endSN+"] ":""}${this.logPrefix==="[stream-controller]"?"level":"track"}: ${e.level}, target: ${parseFloat(n.toFixed(3))}`),z(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=$.FRAG_LOADING;const a=this.config.progressive;let u;return a&&l?u=l.then(c=>!c||this.fragContextChanged(c==null?void 0:c.frag)?null:this.fragmentLoader.load(e,i)).catch(c=>this.handleFragLoadError(c)):u=Promise.all([this.fragmentLoader.load(e,a?i:void 0),l]).then(([c])=>(!a&&c&&i&&i(c),c)).catch(c=>this.handleFragLoadError(c)),this.hls.trigger(T.FRAG_LOADING,{frag:e,targetBufferTime:n}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):u}doFragPartsLoad(e,t,n,i){return new Promise((s,o)=>{var l;const a=[],u=(l=n.details)==null?void 0:l.partList,c=f=>{this.fragmentLoader.loadPart(e,f,i).then(d=>{a[f.index]=d;const h=d.part;this.hls.trigger(T.FRAG_LOADED,d);const p=Oh(n,e.sn,f.index+1)||Cg(u,e.sn,f.index+1);if(p)c(p);else return s({frag:e,part:h,partsLoaded:a})}).catch(o)};c(t)})}handleFragLoadError(e){if("data"in e){const t=e.data;e.data&&t.details===P.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(T.ERROR,t)}else this.hls.trigger(T.ERROR,{type:X.OTHER_ERROR,details:P.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==$.PARSING){!this.fragCurrent&&this.state!==$.STOPPED&&this.state!==$.ERROR&&(this.state=$.IDLE);return}const{frag:n,part:i,level:s}=t,o=self.performance.now();n.stats.parsing.end=o,i&&(i.stats.parsing.end=o),this.updateLevelTiming(n,i,s,e.partial)}getCurrentContext(e){const{levels:t,fragCurrent:n}=this,{level:i,sn:s,part:o}=e;if(!(t!=null&&t[i]))return this.warn(`Levels object was unset while buffering fragment ${s} of level ${i}. The current chunk will not be buffered.`),null;const l=t[i],a=o>-1?Oh(l,s,o):null,u=a?a.fragment:CT(l,s,n);return u?(n&&n!==u&&(u.stats=n.stats),{frag:u,part:a,level:l}):null}bufferFragmentData(e,t,n,i,s){var o;if(!e||this.state!==$.PARSING)return;const{data1:l,data2:a}=e;let u=l;if(l&&a&&(u=Et(l,a)),!((o=u)!=null&&o.length))return;const c={type:e.type,frag:t,part:n,chunkMeta:i,parent:t.type,data:u};if(this.hls.trigger(T.BUFFER_APPENDING,c),e.dropped&&e.independent&&!n){if(s)return;this.flushBufferGap(t)}}flushBufferGap(e){const t=this.media;if(!t)return;if(!fe.isBuffered(t,t.currentTime)){this.flushMainBuffer(0,e.start);return}const n=t.currentTime,i=fe.bufferInfo(t,n,0),s=e.duration,o=Math.min(this.config.maxFragLookUpTolerance*2,s*.25),l=Math.max(Math.min(e.start-o,i.end-o),n+o);e.start-l>o&&this.flushMainBuffer(l,e.start)}getFwdBufferInfo(e,t){const n=this.getLoadPosition();return z(n)?this.getFwdBufferInfoAtPos(e,n,t):null}getFwdBufferInfoAtPos(e,t,n){const{config:{maxBufferHole:i}}=this,s=fe.bufferInfo(e,t,i);if(s.len===0&&s.nextStart!==void 0){const o=this.fragmentTracker.getBufferedFrag(t,n);if(o&&s.nextStart=i?(n.maxMaxBufferLength=s,this.warn(`Reduce max buffer length to ${s}s`),!0):!1}getAppendedFrag(e,t=q.MAIN){const n=this.fragmentTracker.getAppendedFrag(e,q.MAIN);return n&&"fragment"in n?n.fragment:n}getNextFragment(e,t){const n=t.fragments,i=n.length;if(!i)return null;const{config:s}=this,o=n[0].start;let l;if(t.live){const a=s.initialLiveManifestSize;if(it}getNextFragmentLoopLoading(e,t,n,i,s){const o=e.gap,l=this.getNextFragment(this.nextLoadPosition,t);if(l===null)return l;if(e=l,o&&e&&!e.gap&&n.nextStart){const a=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,n.nextStart,i);if(a!==null&&n.len+a.len>=s)return this.log(`buffer full after gaps in "${i}" playlist starting at sn: ${e.sn}`),null}return e}mapToInitFragWhenRequired(e){return e!=null&&e.initSegment&&!(e!=null&&e.initSegment.data)&&!this.bitrateTest?e.initSegment:e}getNextPart(e,t,n){let i=-1,s=!1,o=!0;for(let l=0,a=e.length;l-1&&nn.start&&n.loaded}getInitialLiveFragment(e,t){const n=this.fragPrevious;let i=null;if(n){if(e.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${n.programDateTime}`),i=_T(t,n.endProgramDateTime,this.config.maxFragLookUpTolerance)),!i){const s=n.sn+1;if(s>=e.startSN&&s<=e.endSN){const o=t[s-e.startSN];n.cc===o.cc&&(i=o,this.log(`Live playlist, switching playlist, load frag with next SN: ${i.sn}`))}i||(i=FT(t,n.cc),i&&this.log(`Live playlist, switching playlist, load frag with same CC: ${i.sn}`))}}else{const s=this.hls.liveSyncPosition;s!==null&&(i=this.getFragmentAtPosition(s,this.bitrateTest?e.fragmentEnd:e.edge,e))}return i}getFragmentAtPosition(e,t,n){const{config:i}=this;let{fragPrevious:s}=this,{fragments:o,endSN:l}=n;const{fragmentHint:a}=n,{maxFragLookUpTolerance:u}=i,c=n.partList,f=!!(i.lowLatencyMode&&c!=null&&c.length&&a);f&&a&&!this.bitrateTest&&(o=o.concat(a),l=a.sn);let d;if(et-u?0:u;d=ia(s,o,e,h)}else d=o[o.length-1];if(d){const h=d.sn-n.startSN,p=this.fragmentTracker.getState(d);if((p===Pe.OK||p===Pe.PARTIAL&&d.gap)&&(s=d),s&&d.sn===s.sn&&(!f||c[0].fragment.sn>d.sn)&&s&&d.level===s.level){const y=o[h+1];d.sn=o-t.maxFragLookUpTolerance&&s<=l;if(i!==null&&n.duration>i&&(s${e.startSN} prev-sn: ${a?a.sn:"na"} fragments: ${i}`),u}return s}waitForCdnTuneIn(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,e.partTarget*3)}setStartPosition(e,t){let n=this.startPosition;if(n ${(i=this.fragCurrent)==null?void 0:i.url}`);return}const s=t.details===P.FRAG_GAP;s&&this.fragmentTracker.fragBuffered(n,!0);const o=t.errorAction,{action:l,retryCount:a=0,retryConfig:u}=o||{};if(o&&l===Ne.RetryRequest&&u){this.resetStartWhenNotLoaded(this.levelLastLoaded);const c=hf(u,a);this.warn(`Fragment ${n.sn} of ${e} ${n.level} errored with ${t.details}, retrying loading ${a+1}/${u.maxNumRetry} in ${c}ms`),o.resolved=!0,this.retryDate=self.performance.now()+c,this.state=$.FRAG_LOADING_WAITING_RETRY}else if(u&&o)if(this.resetFragmentErrors(e),a.5;s&&this.reduceMaxBufferLength(i.len,(t==null?void 0:t.duration)||10);const o=!s;return o&&this.warn(`Buffer full error while media.currentTime is not buffered, flush ${n} buffer`),t&&(this.fragmentTracker.removeFragment(t),this.nextLoadPosition=t.start),this.resetLoadingState(),o}return!1}resetFragmentErrors(e){e===q.AUDIO&&(this.fragCurrent=null),this.loadedmetadata||(this.startFragRequested=!1),this.state!==$.STOPPED&&(this.state=$.IDLE)}afterBufferFlushed(e,t,n){if(!e)return;const i=fe.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,i,n),this.state===$.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state=$.IDLE}resetStartWhenNotLoaded(e){if(!this.loadedmetadata){this.startFragRequested=!1;const t=e?e.details:null;t!=null&&t.live?(this.startPosition=-1,this.setStartPosition(t,0),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(e){this.warn(`The loading context changed while buffering fragment ${e.sn} of level ${e.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState()}removeUnbufferedFrags(e=0){this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}updateLevelTiming(e,t,n,i){var s;const o=n.details;if(!o){this.warn("level.details undefined");return}if(!Object.keys(e.elementaryStreams).reduce((a,u)=>{const c=e.elementaryStreams[u];if(c){const f=c.endPTS-c.startPTS;if(f<=0)return this.warn(`Could not parse fragment ${e.sn} ${u} duration reliably (${f})`),a||!1;const d=i?0:Ig(o,e,c.startPTS,c.endPTS,c.startDTS,c.endDTS);return this.hls.trigger(T.LEVEL_PTS_UPDATED,{details:o,level:n,drift:d,type:u,frag:e,start:c.startPTS,end:c.endPTS}),!0}return a},!1)&&((s=this.transmuxer)==null?void 0:s.error)===null){const a=new Error(`Found no media in fragment ${e.sn} of level ${e.level} resetting transmuxer to fallback to playlist timing`);if(n.fragmentError===0&&(n.fragmentError++,e.gap=!0,this.fragmentTracker.removeFragment(e),this.fragmentTracker.fragBuffered(e,!0)),this.warn(a.message),this.hls.trigger(T.ERROR,{type:X.MEDIA_ERROR,details:P.FRAG_PARSING_ERROR,fatal:!1,error:a,frag:e,reason:`Found no media in msn ${e.sn} of level "${n.url}"`}),!this.hls)return;this.resetTransmuxer()}this.state=$.PARSED,this.hls.trigger(T.FRAG_PARSED,{frag:e,part:t})}resetTransmuxer(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)}recoverWorkerError(e){e.event==="demuxerWorker"&&(this.fragmentTracker.removeAllFragments(),this.resetTransmuxer(),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState())}set state(e){const t=this._state;t!==e&&(this._state=e,this.log(`${t}->${e}`))}get state(){return this._state}}class Fg{constructor(){this.chunks=[],this.dataLength=0}push(e){this.chunks.push(e),this.dataLength+=e.length}flush(){const{chunks:e,dataLength:t}=this;let n;if(e.length)e.length===1?n=e[0]:n=uw(e,t);else return new Uint8Array(0);return this.reset(),n}reset(){this.chunks.length=0,this.dataLength=0}}function uw(r,e){const t=new Uint8Array(e);let n=0;for(let i=0;i0&&l.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:It.audioId3,duration:Number.POSITIVE_INFINITY});i{if(z(r))return r*90;const n=t?t.baseTime*9e4/t.timescale:0;return e*9e4+n};function pw(r,e,t,n){let i,s,o,l;const a=navigator.userAgent.toLowerCase(),u=n,c=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];i=((e[t+2]&192)>>>6)+1;const f=(e[t+2]&60)>>>2;if(f>c.length-1){const d=new Error(`invalid ADTS sampling index:${f}`);r.emit(T.ERROR,T.ERROR,{type:X.MEDIA_ERROR,details:P.FRAG_PARSING_ERROR,fatal:!0,error:d,reason:d.message});return}return o=(e[t+2]&1)<<2,o|=(e[t+3]&192)>>>6,I.log(`manifest codec:${n}, ADTS type:${i}, samplingIndex:${f}`),/firefox/i.test(a)?f>=6?(i=5,l=new Array(4),s=f-3):(i=2,l=new Array(2),s=f):a.indexOf("android")!==-1?(i=2,l=new Array(2),s=f):(i=5,l=new Array(4),n&&(n.indexOf("mp4a.40.29")!==-1||n.indexOf("mp4a.40.5")!==-1)||!n&&f>=6?s=f-3:((n&&n.indexOf("mp4a.40.2")!==-1&&(f>=6&&o===1||/vivaldi/i.test(a))||!n&&o===1)&&(i=2,l=new Array(2)),s=f)),l[0]=i<<3,l[0]|=(f&14)>>1,l[1]|=(f&1)<<7,l[1]|=o<<3,i===5&&(l[1]|=(s&14)>>1,l[2]=(s&1)<<7,l[2]|=8,l[3]=0),{config:l,samplerate:c[f],channelCount:o,codec:"mp4a.40."+i,manifestCodec:u}}function Mg(r,e){return r[e]===255&&(r[e+1]&246)===240}function Ng(r,e){return r[e+1]&1?7:9}function xf(r,e){return(r[e+3]&3)<<11|r[e+4]<<3|(r[e+5]&224)>>>5}function mw(r,e){return e+5=r.length)return!1;const n=xf(r,e);if(n<=t)return!1;const i=e+n;return i===r.length||oa(r,i)}return!1}function Bg(r,e,t,n,i){if(!r.samplerate){const s=pw(e,t,n,i);if(!s)return;r.config=s.config,r.samplerate=s.samplerate,r.channelCount=s.channelCount,r.codec=s.codec,r.manifestCodec=s.manifestCodec,I.log(`parsed codec:${r.codec}, rate:${s.samplerate}, channels:${s.channelCount}`)}}function Ug(r){return 1024*9e4/r}function vw(r,e){const t=Ng(r,e);if(e+t<=r.length){const n=xf(r,e)-t;if(n>0)return{headerLength:t,frameLength:n}}}function $g(r,e,t,n,i){const s=Ug(r.samplerate),o=n+i*s,l=vw(e,t);let a;if(l){const{frameLength:f,headerLength:d}=l,h=d+f,p=Math.max(0,t+h-e.length);p?(a=new Uint8Array(h-d),a.set(e.subarray(t+d,e.length),0)):a=e.subarray(t+d,t+h);const m={unit:a,pts:o};return p||r.samples.push(m),{sample:m,length:h,missing:p}}const u=e.length-t;return a=new Uint8Array(u),a.set(e.subarray(t,e.length),0),{sample:{unit:a,pts:o},length:u,missing:-1}}let Ks=null;const xw=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],Ew=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],Sw=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],Tw=[0,1,1,4];function jg(r,e,t,n,i){if(t+24>e.length)return;const s=Gg(e,t);if(s&&t+s.frameLength<=e.length){const o=s.samplesPerFrame*9e4/s.sampleRate,l=n+i*o,a={unit:e.subarray(t,t+s.frameLength),pts:l,dts:l};return r.config=[],r.channelCount=s.channelCount,r.samplerate=s.sampleRate,r.samples.push(a),{sample:a,length:s.frameLength,missing:0}}}function Gg(r,e){const t=r[e+1]>>3&3,n=r[e+1]>>1&3,i=r[e+2]>>4&15,s=r[e+2]>>2&3;if(t!==1&&i!==0&&i!==15&&s!==3){const o=r[e+2]>>1&1,l=r[e+3]>>6,a=t===3?3-n:n===3?3:4,u=xw[a*14+i-1]*1e3,f=Ew[(t===3?0:t===2?1:2)*3+s],d=l===3?1:2,h=Sw[t][n],p=Tw[n],m=h*8*p,y=Math.floor(h*u/f+o)*p;if(Ks===null){const x=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Ks=x?parseInt(x[1]):0}return!!Ks&&Ks<=87&&n===2&&u>=224e3&&l===0&&(r[e+3]=r[e+3]|128),{sampleRate:f,channelCount:d,frameLength:y,samplesPerFrame:m}}}function Ef(r,e){return r[e]===255&&(r[e+1]&224)===224&&(r[e+1]&6)!==0}function Hg(r,e){return e+1{const o=eT(s);if(Aw.test(o.schemeIdUri)){const l=z(o.presentationTime)?o.presentationTime/o.timeScale:t+o.presentationTimeDelta/o.timeScale;let a=o.eventDuration===4294967295?Number.POSITIVE_INFINITY:o.eventDuration/o.timeScale;a<=.001&&(a=Number.POSITIVE_INFINITY);const u=o.payload;n.samples.push({data:u,len:u.byteLength,dts:l,pts:l,type:It.emsg,duration:a})}})}return n}demuxSampleAes(e,t,n){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){}}const Vg=(r,e)=>{let t=0,n=5;e+=n;const i=new Uint32Array(1),s=new Uint32Array(1),o=new Uint8Array(1);for(;n>0;){o[0]=r[e];const l=Math.min(n,8),a=8-l;s[0]=4278190080>>>24+a<>a,t=t?t<e.length||e[t]!==11||e[t+1]!==119)return-1;const s=e[t+4]>>6;if(s>=3)return-1;const l=[48e3,44100,32e3][s],a=e[t+4]&63,c=[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][a*3+s]*2;if(t+c>e.length)return-1;const f=e[t+6]>>5;let d=0;f===2?d+=2:(f&1&&f!==1&&(d+=2),f&4&&(d+=2));const h=(e[t+6]<<8|e[t+7])>>12-d&1,m=[2,1,2,3,3,4,4,5][f]+h,y=e[t+5]>>3,g=e[t+5]&7,v=new Uint8Array([s<<6|y<<1|g>>2,(g&3)<<6|f<<3|h<<2|a>>4,a<<4&224]),x=1536/l*9e4,S=n+i*x,E=e.subarray(t,t+c);return r.config=v,r.channelCount=m,r.samplerate=l,r.samples.push({unit:E,pts:S}),c}class Iw{constructor(){this.VideoSample=null}createVideoSample(e,t,n,i){return{key:e,frame:!1,pts:t,dts:n,units:[],debug:i,length:0}}getLastNalUnit(e){var t;let n=this.VideoSample,i;if((!n||n.units.length===0)&&(n=e[e.length-1]),(t=n)!=null&&t.units){const s=n.units;i=s[s.length-1]}return i}pushAccessUnit(e,t){if(e.units.length&&e.frame){if(e.pts===void 0){const n=t.samples,i=n.length;if(i){const s=n[i-1];e.pts=s.pts,e.dts=s.dts}else{t.dropped++;return}}t.samples.push(e)}e.debug.length&&I.log(e.pts+"/"+e.dts+":"+e.debug)}}class Hh{constructor(e){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}loadWord(){const e=this.data,t=this.bytesAvailable,n=e.byteLength-t,i=new Uint8Array(4),s=Math.min(4,t);if(s===0)throw new Error("no bytes available");i.set(e.subarray(n,n+s)),this.word=new DataView(i.buffer).getUint32(0),this.bitsAvailable=s*8,this.bytesAvailable-=s}skipBits(e){let t;e=Math.min(e,this.bytesAvailable*8+this.bitsAvailable),this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,t=e>>3,e-=t<<3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}readBits(e){let t=Math.min(this.bitsAvailable,e);const n=this.word>>>32-t;if(e>32&&I.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0)this.word<<=t;else if(this.bytesAvailable>0)this.loadWord();else throw new Error("no bits available");return t=e-t,t>0&&this.bitsAvailable?n<>>e)return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){const e=this.skipLZ();return this.readBits(e+1)-1}readEG(){const e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}readBoolean(){return this.readBits(1)===1}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}skipScalingList(e){let t=8,n=8,i;for(let s=0;s{var f;switch(c.type){case 1:{let m=!1;a=!0;const y=c.data;if(u&&y.length>4){const g=new Hh(y).readSliceType();(g===2||g===4||g===7||g===9)&&(m=!0)}if(m){var d;(d=l)!=null&&d.frame&&!l.key&&(this.pushAccessUnit(l,e),l=this.VideoSample=null)}l||(l=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts,"")),l.frame=!0,l.key=m;break}case 5:a=!0,(f=l)!=null&&f.frame&&!l.key&&(this.pushAccessUnit(l,e),l=this.VideoSample=null),l||(l=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts,"")),l.key=!0,l.frame=!0;break;case 6:{a=!0,Tg(c.data,1,n.pts,t.samples);break}case 7:{var h,p;a=!0,u=!0;const m=c.data,g=new Hh(m).readSPS();if(!e.sps||e.width!==g.width||e.height!==g.height||((h=e.pixelRatio)==null?void 0:h[0])!==g.pixelRatio[0]||((p=e.pixelRatio)==null?void 0:p[1])!==g.pixelRatio[1]){e.width=g.width,e.height=g.height,e.pixelRatio=g.pixelRatio,e.sps=[m],e.duration=s;const v=m.subarray(1,4);let x="avc1.";for(let S=0;S<3;S++){let E=v[S].toString(16);E.length<2&&(E="0"+E),x+=E}e.codec=x}break}case 8:a=!0,e.pps=[c.data];break;case 9:a=!0,e.audFound=!0,l&&this.pushAccessUnit(l,e),l=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts,"");break;case 12:a=!0;break;default:a=!1,l&&(l.debug+="unknown NAL "+c.type+" ");break}l&&a&&l.units.push(c)}),i&&l&&(this.pushAccessUnit(l,e),this.VideoSample=null)}parseAVCNALu(e,t){const n=t.byteLength;let i=e.naluState||0;const s=i,o=[];let l=0,a,u,c,f=-1,d=0;for(i===-1&&(f=0,d=t[0]&31,i=0,l=1);l=0){const h={data:t.subarray(f,u),type:d};o.push(h)}else{const h=this.getLastNalUnit(e.samples);h&&(s&&l<=4-s&&h.state&&(h.data=h.data.subarray(0,h.data.byteLength-s)),u>0&&(h.data=Et(h.data,t.subarray(0,u)),h.state=0))}l=0&&i>=0){const h={data:t.subarray(f,n),type:d,state:i};o.push(h)}if(o.length===0){const h=this.getLastNalUnit(e.samples);h&&(h.data=Et(h.data,t))}return e.naluState=i,o}}class Cw{constructor(e,t,n){this.keyData=void 0,this.decrypter=void 0,this.keyData=n,this.decrypter=new gf(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer)}decryptAacSample(e,t,n){const i=e[t].unit;if(i.length<=16)return;const s=i.subarray(16,i.length-i.length%16),o=s.buffer.slice(s.byteOffset,s.byteOffset+s.length);this.decryptBuffer(o).then(l=>{const a=new Uint8Array(l);i.set(a,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,n)})}decryptAacSamples(e,t,n){for(;;t++){if(t>=e.length){n();return}if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,n),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const t=Math.floor((e.length-48)/160)*16+16,n=new Int8Array(t);let i=0;for(let s=32;s{s.data=this.getAvcDecryptedUnit(o,a),this.decrypter.isSync()||this.decryptAvcSamples(e,t,n+1,i)})}decryptAvcSamples(e,t,n,i){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,n=0){if(t>=e.length){i();return}const s=e[t].units;for(;!(n>=s.length);n++){const o=s[n];if(!(o.data.length<=48||o.type!==1&&o.type!==5)&&(this.decryptAvcSample(e,t,n,i,o),!this.decrypter.isSync()))return}}}}const De=188;class Sr{constructor(e,t,n){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this._pmtId=-1,this._videoTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.remainderData=null,this.videoParser=void 0,this.observer=e,this.config=t,this.typeSupported=n,this.videoParser=new kw}static probe(e){const t=Sr.syncOffset(e);return t>0&&I.warn(`MPEG2-TS detected but first sync word found @ offset ${t}`),t!==-1}static syncOffset(e){const t=e.length;let n=Math.min(De*5,t-De)+1,i=0;for(;i1&&(o===0&&l>2||a+De>n))return o}else{if(l)return-1;break}i++}return-1}static createTrack(e,t){return{container:e==="video"||e==="audio"?"video/mp2t":void 0,type:e,id:yg[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:e==="audio"?t:void 0}}resetInitSegment(e,t,n,i){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=Sr.createTrack("video"),this._audioTrack=Sr.createTrack("audio",i),this._id3Track=Sr.createTrack("id3"),this._txtTrack=Sr.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=n,this._duration=i}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_videoTrack:t,_id3Track:n}=this;e&&(e.pesData=null),t&&(t.pesData=null),n&&(n.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(e,t,n=!1,i=!1){n||(this.sampleAes=null);let s;const o=this._videoTrack,l=this._audioTrack,a=this._id3Track,u=this._txtTrack;let c=o.pid,f=o.pesData,d=l.pid,h=a.pid,p=l.pesData,m=a.pesData,y=null,g=this.pmtParsed,v=this._pmtId,x=e.length;if(this.remainderData&&(e=Et(this.remainderData,e),x=e.length,this.remainderData=null),x>4;let C;if(L>1){if(C=w+5+e[w+4],C===w+De)continue}else C=w+4;switch(R){case c:A&&(f&&(s=Sn(f))&&this.videoParser.parseAVCPES(o,u,s,!1,this._duration),f={data:[],size:0}),f&&(f.data.push(e.subarray(C,w+De)),f.size+=w+De-C);break;case d:if(A){if(p&&(s=Sn(p)))switch(l.segmentCodec){case"aac":this.parseAACPES(l,s);break;case"mp3":this.parseMPEGPES(l,s);break;case"ac3":this.parseAC3PES(l,s);break}p={data:[],size:0}}p&&(p.data.push(e.subarray(C,w+De)),p.size+=w+De-C);break;case h:A&&(m&&(s=Sn(m))&&this.parseID3PES(a,s),m={data:[],size:0}),m&&(m.data.push(e.subarray(C,w+De)),m.size+=w+De-C);break;case 0:A&&(C+=e[C]+1),v=this._pmtId=Dw(e,C);break;case v:{A&&(C+=e[C]+1);const _=_w(e,C,this.typeSupported,n,this.observer);c=_.videoPid,c>0&&(o.pid=c,o.segmentCodec=_.segmentVideoCodec),d=_.audioPid,d>0&&(l.pid=d,l.segmentCodec=_.segmentAudioCodec),h=_.id3Pid,h>0&&(a.pid=h),y!==null&&!g&&(I.warn(`MPEG-TS PMT found at ${w} after unknown PID '${y}'. Backtracking to sync byte @${S} to parse all TS packets.`),y=null,w=S-188),g=this.pmtParsed=!0;break}case 17:case 8191:break;default:y=R;break}}else E++;E>0&&aa(this.observer,new Error(`Found ${E} TS packet/s that do not start with 0x47`)),o.pesData=f,l.pesData=p,a.pesData=m;const b={audioTrack:l,videoTrack:o,id3Track:a,textTrack:u};return i&&this.extractRemainingSamples(b),b}flush(){const{remainderData:e}=this;this.remainderData=null;let t;return e?t=this.demux(e,-1,!1,!0):t={videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t}extractRemainingSamples(e){const{audioTrack:t,videoTrack:n,id3Track:i,textTrack:s}=e,o=n.pesData,l=t.pesData,a=i.pesData;let u;if(o&&(u=Sn(o))?(this.videoParser.parseAVCPES(n,s,u,!0,this._duration),n.pesData=null):n.pesData=o,l&&(u=Sn(l))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,u);break;case"mp3":this.parseMPEGPES(t,u);break;case"ac3":this.parseAC3PES(t,u);break}t.pesData=null}else l!=null&&l.size&&I.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=l;a&&(u=Sn(a))?(this.parseID3PES(i,u),i.pesData=null):i.pesData=a}demuxSampleAes(e,t,n){const i=this.demux(e,n,!0,!this.config.progressive),s=this.sampleAes=new Cw(this.observer,this.config,t);return this.decrypt(i,s)}decrypt(e,t){return new Promise(n=>{const{audioTrack:i,videoTrack:s}=e;i.samples&&i.segmentCodec==="aac"?t.decryptAacSamples(i.samples,0,()=>{s.samples?t.decryptAvcSamples(s.samples,0,0,()=>{n(e)}):n(e)}):s.samples&&t.decryptAvcSamples(s.samples,0,0,()=>{n(e)})})}destroy(){this._duration=0}parseAACPES(e,t){let n=0;const i=this.aacOverFlow;let s=t.data;if(i){this.aacOverFlow=null;const f=i.missing,d=i.sample.unit.byteLength;if(f===-1)s=Et(i.sample.unit,s);else{const h=d-f;i.sample.unit.set(s.subarray(0,f),h),e.samples.push(i.sample),n=i.missing}}let o,l;for(o=n,l=s.length;o0;)l+=a}}parseID3PES(e,t){if(t.pts===void 0){I.warn("[tsdemuxer]: ID3 PES unknown PTS");return}const n=Re({},t,{type:this._videoTrack?It.emsg:It.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(n)}}function Xu(r,e){return((r[e+1]&31)<<8)+r[e+2]}function Dw(r,e){return(r[e+10]&31)<<8|r[e+11]}function _w(r,e,t,n,i){const s={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},o=(r[e+1]&15)<<8|r[e+2],l=e+3+o-4,a=(r[e+10]&15)<<8|r[e+11];for(e+=12+a;e0){let f=e+5,d=c;for(;d>2;){switch(r[f]){case 106:t.ac3!==!0?I.log("AC-3 audio found, not supported in this browser for now"):(s.audioPid=u,s.segmentAudioCodec="ac3");break}const p=r[f+1]+2;f+=p,d-=p}}break;case 194:case 135:return aa(i,new Error("Unsupported EC-3 in M2TS found")),s;case 36:return aa(i,new Error("Unsupported HEVC in M2TS found")),s}e+=c+5}return s}function aa(r,e,t){I.warn(`parsing error: ${e.message}`),r.emit(T.ERROR,T.ERROR,{type:X.MEDIA_ERROR,details:P.FRAG_PARSING_ERROR,fatal:!1,levelRetry:t,error:e,reason:e.message})}function Tl(r){I.log(`${r} with AES-128-CBC encryption found in unencrypted stream`)}function Sn(r){let e=0,t,n,i,s,o;const l=r.data;if(!r||r.size===0)return null;for(;l[0].length<19&&l.length>1;)l[0]=Et(l[0],l[1]),l.splice(1,1);if(t=l[0],(t[0]<<16)+(t[1]<<8)+t[2]===1){if(n=(t[4]<<8)+t[5],n&&n>r.size-6)return null;const u=t[7];u&192&&(s=(t[9]&14)*536870912+(t[10]&255)*4194304+(t[11]&254)*16384+(t[12]&255)*128+(t[13]&254)/2,u&64?(o=(t[14]&14)*536870912+(t[15]&255)*4194304+(t[16]&254)*16384+(t[17]&255)*128+(t[18]&254)/2,s-o>60*9e4&&(I.warn(`${Math.round((s-o)/9e4)}s delta between PTS and DTS, align them`),s=o)):o=s),i=t[8];let c=i+9;if(r.size<=c)return null;r.size-=c;const f=new Uint8Array(r.size);for(let d=0,h=l.length;dp){c-=p;continue}else t=t.subarray(c),p-=c,c=0;f.set(t,e),e+=p}return n&&(n-=i+3),{data:f,pts:s,dts:o,len:n}}return null}class Pw extends vf{resetInitSegment(e,t,n,i){super.resetInitSegment(e,t,n,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const t=ds(e,0);let n=(t==null?void 0:t.length)||0;if(t&&e[n]===11&&e[n+1]===119&&df(t)!==void 0&&Vg(e,n)<=16)return!1;for(let i=e.length;n>24&255,o[1]=n>>16&255,o[2]=n>>8&255,o[3]=n&255,o.set(e,4),i=0,n=8;i>24&255,e>>16&255,e>>8&255,e&255,n>>24,n>>16&255,n>>8&255,n&255,i>>24,i>>16&255,i>>8&255,i&255,85,196,0,0]))}static mdia(e){return D.box(D.types.mdia,D.mdhd(e.timescale,e.duration),D.hdlr(e.type),D.minf(e))}static mfhd(e){return D.box(D.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,e&255]))}static minf(e){return e.type==="audio"?D.box(D.types.minf,D.box(D.types.smhd,D.SMHD),D.DINF,D.stbl(e)):D.box(D.types.minf,D.box(D.types.vmhd,D.VMHD),D.DINF,D.stbl(e))}static moof(e,t,n){return D.box(D.types.moof,D.mfhd(e),D.traf(n,t))}static moov(e){let t=e.length;const n=[];for(;t--;)n[t]=D.trak(e[t]);return D.box.apply(null,[D.types.moov,D.mvhd(e[0].timescale,e[0].duration)].concat(n).concat(D.mvex(e)))}static mvex(e){let t=e.length;const n=[];for(;t--;)n[t]=D.trex(e[t]);return D.box.apply(null,[D.types.mvex,...n])}static mvhd(e,t){t*=e;const n=Math.floor(t/(vr+1)),i=Math.floor(t%(vr+1)),s=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,n>>24,n>>16&255,n>>8&255,n&255,i>>24,i>>16&255,i>>8&255,i&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return D.box(D.types.mvhd,s)}static sdtp(e){const t=e.samples||[],n=new Uint8Array(4+t.length);let i,s;for(i=0;i>>8&255),t.push(o&255),t=t.concat(Array.prototype.slice.call(s));for(i=0;i>>8&255),n.push(o&255),n=n.concat(Array.prototype.slice.call(s));const l=D.box(D.types.avcC,new Uint8Array([1,t[3],t[4],t[5],255,224|e.sps.length].concat(t).concat([e.pps.length]).concat(n))),a=e.width,u=e.height,c=e.pixelRatio[0],f=e.pixelRatio[1];return D.box(D.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,a>>8&255,a&255,u>>8&255,u&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),l,D.box(D.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),D.box(D.types.pasp,new Uint8Array([c>>24,c>>16&255,c>>8&255,c&255,f>>24,f>>16&255,f>>8&255,f&255])))}static esds(e){const t=e.config.length;return new Uint8Array([0,0,0,0,3,23+t,0,1,0,4,15+t,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([t]).concat(e.config).concat([6,1,2]))}static audioStsd(e){const t=e.samplerate;return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,t>>8&255,t&255,0,0])}static mp4a(e){return D.box(D.types.mp4a,D.audioStsd(e),D.box(D.types.esds,D.esds(e)))}static mp3(e){return D.box(D.types[".mp3"],D.audioStsd(e))}static ac3(e){return D.box(D.types["ac-3"],D.audioStsd(e),D.box(D.types.dac3,e.config))}static stsd(e){return e.type==="audio"?e.segmentCodec==="mp3"&&e.codec==="mp3"?D.box(D.types.stsd,D.STSD,D.mp3(e)):e.segmentCodec==="ac3"?D.box(D.types.stsd,D.STSD,D.ac3(e)):D.box(D.types.stsd,D.STSD,D.mp4a(e)):D.box(D.types.stsd,D.STSD,D.avc1(e))}static tkhd(e){const t=e.id,n=e.duration*e.timescale,i=e.width,s=e.height,o=Math.floor(n/(vr+1)),l=Math.floor(n%(vr+1));return D.box(D.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,t&255,0,0,0,0,o>>24,o>>16&255,o>>8&255,o&255,l>>24,l>>16&255,l>>8&255,l&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,i>>8&255,i&255,0,0,s>>8&255,s&255,0,0]))}static traf(e,t){const n=D.sdtp(e),i=e.id,s=Math.floor(t/(vr+1)),o=Math.floor(t%(vr+1));return D.box(D.types.traf,D.box(D.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,i&255])),D.box(D.types.tfdt,new Uint8Array([1,0,0,0,s>>24,s>>16&255,s>>8&255,s&255,o>>24,o>>16&255,o>>8&255,o&255])),D.trun(e,n.length+16+20+8+16+8+8),n)}static trak(e){return e.duration=e.duration||4294967295,D.box(D.types.trak,D.tkhd(e),D.mdia(e))}static trex(e){const t=e.id;return D.box(D.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,t&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(e,t){const n=e.samples||[],i=n.length,s=12+16*i,o=new Uint8Array(s);let l,a,u,c,f,d;for(t+=8+s,o.set([e.type==="video"?1:0,0,15,1,i>>>24&255,i>>>16&255,i>>>8&255,i&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255],0),l=0;l>>24&255,u>>>16&255,u>>>8&255,u&255,c>>>24&255,c>>>16&255,c>>>8&255,c&255,f.isLeading<<2|f.dependsOn,f.isDependedOn<<6|f.hasRedundancy<<4|f.paddingValue<<1|f.isNonSync,f.degradPrio&61440,f.degradPrio&15,d>>>24&255,d>>>16&255,d>>>8&255,d&255],12+16*l);return D.box(D.types.trun,o)}static initSegment(e){D.types||D.init();const t=D.moov(e);return Et(D.FTYP,t)}}D.types=void 0;D.HDLR_TYPES=void 0;D.STTS=void 0;D.STSC=void 0;D.STCO=void 0;D.STSZ=void 0;D.VMHD=void 0;D.SMHD=void 0;D.STSD=void 0;D.FTYP=void 0;D.DINF=void 0;const Wg=9e4;function Sf(r,e,t=1,n=!1){const i=r*e*t;return n?Math.round(i):i}function Ow(r,e,t=1,n=!1){return Sf(r,e,1/t,n)}function Ri(r,e=!1){return Sf(r,1e3,1/Wg,e)}function Fw(r,e=1){return Sf(r,Wg,1/e)}const Mw=10*1e3,Vh=1024,Nw=1152,Bw=1536;let Tn=null,wl=null;class go{constructor(e,t,n,i=""){if(this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=e,this.config=t,this.typeSupported=n,this.ISGenerated=!1,Tn===null){const o=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Tn=o?parseInt(o[1]):0}if(wl===null){const s=navigator.userAgent.match(/Safari\/(\d+)/i);wl=s?parseInt(s[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(e){I.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=e}resetNextTimestamp(){I.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){I.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(e){let t=!1;const n=e.reduce((i,s)=>{const o=s.pts-i;return o<-4294967296?(t=!0,dt(i,s.pts)):o>0?i:s.pts},e[0].pts);return t&&I.debug("PTS rollover detected"),n}remux(e,t,n,i,s,o,l,a){let u,c,f,d,h,p,m=s,y=s;const g=e.pid>-1,v=t.pid>-1,x=t.samples.length,S=e.samples.length>0,E=l&&x>0||x>1;if((!g||S)&&(!v||E)||this.ISGenerated||l){if(this.ISGenerated){var w,A,R,L;const M=this.videoTrackConfig;M&&(t.width!==M.width||t.height!==M.height||((w=t.pixelRatio)==null?void 0:w[0])!==((A=M.pixelRatio)==null?void 0:A[0])||((R=t.pixelRatio)==null?void 0:R[1])!==((L=M.pixelRatio)==null?void 0:L[1]))&&this.resetInitSegment()}else f=this.generateIS(e,t,s,o);const C=this.isVideoContiguous;let _=-1,k;if(E&&(_=Uw(t.samples),!C&&this.config.forceKeyFrameOnDiscontinuity))if(p=!0,_>0){I.warn(`[mp4-remuxer]: Dropped ${_} out of ${x} video samples due to a missing keyframe`);const M=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(_),t.dropped+=_,y+=(t.samples[0].pts-M)/t.inputTimeScale,k=y}else _===-1&&(I.warn(`[mp4-remuxer]: No keyframe found out of ${x} video samples`),p=!1);if(this.ISGenerated){if(S&&E){const M=this.getVideoStartPts(t.samples),U=(dt(e.samples[0].pts,M)-M)/t.inputTimeScale;m+=Math.max(0,U),y+=Math.max(0,-U)}if(S){if(e.samplerate||(I.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),f=this.generateIS(e,t,s,o)),c=this.remuxAudio(e,m,this.isAudioContiguous,o,v||E||a===q.AUDIO?y:void 0),E){const M=c?c.endPTS-c.startPTS:0;t.inputTimeScale||(I.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),f=this.generateIS(e,t,s,o)),u=this.remuxVideo(t,y,C,M)}}else E&&(u=this.remuxVideo(t,y,C,0));u&&(u.firstKeyFrame=_,u.independent=_!==-1,u.firstKeyFramePTS=k)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(n.samples.length&&(h=Yg(n,s,this._initPTS,this._initDTS)),i.samples.length&&(d=qg(i,s,this._initPTS))),{audio:c,video:u,initSegment:f,independent:p,text:d,id3:h}}generateIS(e,t,n,i){const s=e.samples,o=t.samples,l=this.typeSupported,a={},u=this._initPTS;let c=!u||i,f="audio/mp4",d,h,p;if(c&&(d=h=1/0),e.config&&s.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":l.mpeg?(f="audio/mpeg",e.codec=""):l.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3";break}a.audio={id:"audio",container:f,codec:e.codec,initSegment:e.segmentCodec==="mp3"&&l.mpeg?new Uint8Array(0):D.initSegment([e]),metadata:{channelCount:e.channelCount}},c&&(p=e.inputTimeScale,!u||p!==u.timescale?d=h=s[0].pts-Math.round(p*n):c=!1)}if(t.sps&&t.pps&&o.length){if(t.timescale=t.inputTimeScale,a.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:D.initSegment([t]),metadata:{width:t.width,height:t.height}},c)if(p=t.inputTimeScale,!u||p!==u.timescale){const m=this.getVideoStartPts(o),y=Math.round(p*n);h=Math.min(h,dt(o[0].dts,m)-y),d=Math.min(d,m-y)}else c=!1;this.videoTrackConfig={width:t.width,height:t.height,pixelRatio:t.pixelRatio}}if(Object.keys(a).length)return this.ISGenerated=!0,c?(this._initPTS={baseTime:d,timescale:p},this._initDTS={baseTime:h,timescale:p}):d=p=void 0,{tracks:a,initPTS:d,timescale:p}}remuxVideo(e,t,n,i){const s=e.inputTimeScale,o=e.samples,l=[],a=o.length,u=this._initPTS;let c=this.nextAvcDts,f=8,d=this.videoSampleDuration,h,p,m=Number.POSITIVE_INFINITY,y=Number.NEGATIVE_INFINITY,g=!1;if(!n||c===null){const F=t*s,N=o[0].pts-dt(o[0].dts,o[0].pts);Tn&&c!==null&&Math.abs(F-N-c)<15e3?n=!0:c=F-N}const v=u.baseTime*s/u.timescale;for(let F=0;F0?F-1:F].dts&&(g=!0)}g&&o.sort(function(F,N){const K=F.dts-N.dts,V=F.pts-N.pts;return K||V}),h=o[0].dts,p=o[o.length-1].dts;const x=p-h,S=x?Math.round(x/(a-1)):d||e.inputTimeScale/30;if(n){const F=h-c,N=F>S,K=F<-1;if((N||K)&&(N?I.warn(`AVC: ${Ri(F,!0)} ms (${F}dts) hole between fragments detected at ${t.toFixed(3)}`):I.warn(`AVC: ${Ri(-F,!0)} ms (${F}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!K||c>=o[0].pts||Tn)){h=c;const V=o[0].pts-F;if(N)o[0].dts=h,o[0].pts=V;else for(let J=0;JV);J++)o[J].dts-=F,o[J].pts-=F;I.log(`Video: Initial PTS/DTS adjusted: ${Ri(V,!0)}/${Ri(h,!0)}, delta: ${Ri(F,!0)} ms`)}}h=Math.max(0,h);let E=0,b=0,w=h;for(let F=0;F0?N.dts-o[F-1].dts:S;if(J=F>0?N.pts-o[F-1].pts:S,ce.stretchShortVideoTrack&&this.nextAudioPts!==null){const xe=Math.floor(ce.maxBufferHole*s),St=(i?m+i*s:this.nextAudioPts)-N.pts;St>xe?(d=St-ae,d<0?d=ae:C=!0,I.log(`[mp4-remuxer]: It is approximately ${St/90} ms to the next segment; using duration ${d/90} ms for the last video frame.`)):d=ae}else d=ae}const ie=Math.round(N.pts-N.dts);_=Math.min(_,d),M=Math.max(M,d),k=Math.min(k,J),O=Math.max(O,J),l.push(new Kh(N.key,d,V,ie))}if(l.length){if(Tn){if(Tn<70){const F=l[0].flags;F.dependsOn=2,F.isNonSync=0}}else if(wl&&O-k0&&(i&&Math.abs(v-g)<9e3||Math.abs(dt(m[0].pts-x,v)-g)<20*c),m.forEach(function(U){U.pts=dt(U.pts-x,v)}),!n||g<0){if(m=m.filter(U=>U.pts>=0),!m.length)return;s===0?g=0:i&&!p?g=Math.max(0,v):g=m[0].pts}if(e.segmentCodec==="aac"){const U=this.config.maxAudioFramesDrift;for(let G=0,B=g;G=U*c&&V0){w+=y;try{b=new Uint8Array(w)}catch(V){this.observer.emit(T.ERROR,T.ERROR,{type:X.MUX_ERROR,details:P.REMUX_ALLOC_ERROR,fatal:!1,error:V,bytes:w,reason:`fail allocating audio mdat ${w}`});return}d||(new DataView(b.buffer).setUint32(0,w),b.set(D.types.mdat,4))}else return;b.set(F,y);const K=F.byteLength;y+=K,h.push(new Kh(!0,u,K,0)),E=N}const R=h.length;if(!R)return;const L=h[h.length-1];this.nextAudioPts=g=E+a*L.duration;const C=d?new Uint8Array(0):D.moof(e.sequenceNumber++,S/a,Re({},e,{samples:h}));e.samples=[];const _=S/o,k=g/o,O={data1:C,data2:b,startPTS:_,endPTS:k,startDTS:_,endDTS:k,type:"audio",hasAudio:!0,hasVideo:!1,nb:R};return this.isAudioContiguous=!0,O}remuxEmptyAudio(e,t,n,i){const s=e.inputTimeScale,o=e.samplerate?e.samplerate:s,l=s/o,a=this.nextAudioPts,u=this._initDTS,c=u.baseTime*9e4/u.timescale,f=(a!==null?a:i.startDTS*s)+c,d=i.endDTS*s+c,h=l*Vh,p=Math.ceil((d-f)/h),m=zh.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(I.warn("[mp4-remuxer]: remux empty Audio"),!m){I.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}const y=[];for(let g=0;g4294967296;)r+=t;return r}function Uw(r){for(let e=0;eo.pts-l.pts);const s=r.samples;return r.samples=[],{samples:s}}class Kh{constructor(e,t,n,i){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=t,this.size=n,this.cts=i,this.flags={isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:e?2:1,isNonSync:e?0:1}}}class $w{constructor(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null}destroy(){}resetTimeStamp(e){this.initPTS=e,this.lastEndTime=null}resetNextTimestamp(){this.lastEndTime=null}resetInitSegment(e,t,n,i){this.audioCodec=t,this.videoCodec=n,this.generateInitSegment(KS(e,i)),this.emitInitSegment=!0}generateInitSegment(e){let{audioCodec:t,videoCodec:n}=this;if(!(e!=null&&e.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const i=this.initData=Eg(e);i.audio&&(t=Wh(i.audio,le.AUDIO)),i.video&&(n=Wh(i.video,le.VIDEO));const s={};i.audio&&i.video?s.audiovideo={container:"video/mp4",codec:t+","+n,initSegment:e,id:"main"}:i.audio?s.audio={container:"audio/mp4",codec:t,initSegment:e,id:"audio"}:i.video?s.video={container:"video/mp4",codec:n,initSegment:e,id:"main"}:I.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=s}remux(e,t,n,i,s,o){var l,a;let{initPTS:u,lastEndTime:c}=this;const f={audio:void 0,video:void 0,text:i,id3:n,initSegment:void 0};z(c)||(c=this.lastEndTime=s||0);const d=t.samples;if(!(d!=null&&d.length))return f;const h={initPTS:void 0,timescale:1};let p=this.initData;if((l=p)!=null&&l.length||(this.generateInitSegment(d),p=this.initData),!((a=p)!=null&&a.length))return I.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),f;this.emitInitSegment&&(h.tracks=this.initTracks,this.emitInitSegment=!1);const m=YS(d,p),y=WS(p,d),g=y===null?s:y;(jw(u,g,s,m)||h.timescale!==u.timescale&&o)&&(h.initPTS=g-s,u&&u.timescale===1&&I.warn(`Adjusting initPTS by ${h.initPTS-u.baseTime}`),this.initPTS=u={baseTime:h.initPTS,timescale:1});const v=e?g-u.baseTime/u.timescale:c,x=v+m;XS(p,d,u.baseTime/u.timescale),m>0?this.lastEndTime=x:(I.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const S=!!p.audio,E=!!p.video;let b="";S&&(b+="audio"),E&&(b+="video");const w={data1:d,startPTS:v,startDTS:v,endPTS:x,endDTS:x,type:b,hasAudio:S,hasVideo:E,nb:1,dropped:0};return f.audio=w.type==="audio"?w:void 0,f.video=w.type!=="audio"?w:void 0,f.initSegment=h,f.id3=Yg(n,s,u,u),i.samples.length&&(f.text=qg(i,s,u)),f}}function jw(r,e,t,n){if(r===null)return!0;const i=Math.max(n,1),s=e-r.baseTime/r.timescale;return Math.abs(s-t)>i}function Wh(r,e){const t=r==null?void 0:r.codec;if(t&&t.length>4)return t;if(e===le.AUDIO){if(t==="ec-3"||t==="ac-3"||t==="alac")return t;if(t==="fLaC"||t==="Opus")return ea(t,!1);const n="mp4a.40.5";return I.info(`Parsed audio codec "${t}" or audio object type not handled. Using "${n}"`),n}return I.warn(`Unhandled video codec "${t}"`),t==="hvc1"||t==="hev1"?"hvc1.1.6.L120.90":t==="av01"?"av01.0.04M.08":"avc1.42e01e"}let tr;try{tr=self.performance.now.bind(self.performance)}catch{I.debug("Unable to use Performance API on this environment"),tr=ni==null?void 0:ni.Date.now}const yo=[{demux:Lw,remux:$w},{demux:Sr,remux:go},{demux:bw,remux:go},{demux:Pw,remux:go}];yo.splice(2,0,{demux:Rw,remux:go});class Yh{constructor(e,t,n,i,s){this.async=!1,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=e,this.typeSupported=t,this.config=n,this.vendor=i,this.id=s}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,t,n,i){const s=n.transmuxing;s.executeStart=tr();let o=new Uint8Array(e);const{currentTransmuxState:l,transmuxConfig:a}=this;i&&(this.currentTransmuxState=i);const{contiguous:u,discontinuity:c,trackSwitch:f,accurateTimeOffset:d,timeOffset:h,initSegmentChange:p}=i||l,{audioCodec:m,videoCodec:y,defaultInitPts:g,duration:v,initSegmentData:x}=a,S=Gw(o,t);if(S&&S.method==="AES-128"){const A=this.getDecrypter();if(A.isSync()){let R=A.softwareDecrypt(o,S.key.buffer,S.iv.buffer);if(n.part>-1&&(R=A.flush()),!R)return s.executeEnd=tr(),bl(n);o=new Uint8Array(R)}else return this.decryptionPromise=A.webCryptoDecrypt(o,S.key.buffer,S.iv.buffer).then(R=>{const L=this.push(R,null,n);return this.decryptionPromise=null,L}),this.decryptionPromise}const E=this.needsProbing(c,f);if(E){const A=this.configureTransmuxer(o);if(A)return I.warn(`[transmuxer] ${A.message}`),this.observer.emit(T.ERROR,T.ERROR,{type:X.MEDIA_ERROR,details:P.FRAG_PARSING_ERROR,fatal:!1,error:A,reason:A.message}),s.executeEnd=tr(),bl(n)}(c||f||p||E)&&this.resetInitSegment(x,m,y,v,t),(c||p||E)&&this.resetInitialTimestamp(g),u||this.resetContiguity();const b=this.transmux(o,S,h,d,n),w=this.currentTransmuxState;return w.contiguous=!0,w.discontinuity=!1,w.trackSwitch=!1,s.executeEnd=tr(),b}flush(e){const t=e.transmuxing;t.executeStart=tr();const{decrypter:n,currentTransmuxState:i,decryptionPromise:s}=this;if(s)return s.then(()=>this.flush(e));const o=[],{timeOffset:l}=i;if(n){const f=n.flush();f&&o.push(this.push(f,null,e))}const{demuxer:a,remuxer:u}=this;if(!a||!u)return t.executeEnd=tr(),[bl(e)];const c=a.flush(l);return vo(c)?c.then(f=>(this.flushRemux(o,f,e),o)):(this.flushRemux(o,c,e),o)}flushRemux(e,t,n){const{audioTrack:i,videoTrack:s,id3Track:o,textTrack:l}=t,{accurateTimeOffset:a,timeOffset:u}=this.currentTransmuxState;I.log(`[transmuxer.ts]: Flushed fragment ${n.sn}${n.part>-1?" p: "+n.part:""} of level ${n.level}`);const c=this.remuxer.remux(i,s,o,l,u,a,!0,this.id);e.push({remuxResult:c,chunkMeta:n}),n.transmuxing.executeEnd=tr()}resetInitialTimestamp(e){const{demuxer:t,remuxer:n}=this;!t||!n||(t.resetTimeStamp(e),n.resetTimeStamp(e))}resetContiguity(){const{demuxer:e,remuxer:t}=this;!e||!t||(e.resetContiguity(),t.resetNextTimestamp())}resetInitSegment(e,t,n,i,s){const{demuxer:o,remuxer:l}=this;!o||!l||(o.resetInitSegment(e,t,n,i),l.resetInitSegment(e,t,n,s))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,t,n,i,s){let o;return t&&t.method==="SAMPLE-AES"?o=this.transmuxSampleAes(e,t,n,i,s):o=this.transmuxUnencrypted(e,n,i,s),o}transmuxUnencrypted(e,t,n,i){const{audioTrack:s,videoTrack:o,id3Track:l,textTrack:a}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(s,o,l,a,t,n,!1,this.id),chunkMeta:i}}transmuxSampleAes(e,t,n,i,s){return this.demuxer.demuxSampleAes(e,t,n).then(o=>({remuxResult:this.remuxer.remux(o.audioTrack,o.videoTrack,o.id3Track,o.textTrack,n,i,!1,this.id),chunkMeta:s}))}configureTransmuxer(e){const{config:t,observer:n,typeSupported:i,vendor:s}=this;let o;for(let d=0,h=yo.length;d0&&(e==null?void 0:e.key)!=null&&e.iv!==null&&e.method!=null&&(t=e),t}const bl=r=>({remuxResult:{},chunkMeta:r});function vo(r){return"then"in r&&r.then instanceof Function}class Hw{constructor(e,t,n,i,s){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=e,this.videoCodec=t,this.initSegmentData=n,this.duration=i,this.defaultInitPts=s||null}}class zw{constructor(e,t,n,i,s,o){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=e,this.contiguous=t,this.accurateTimeOffset=n,this.trackSwitch=i,this.timeOffset=s,this.initSegmentChange=o}}var Xg={exports:{}};(function(r){var e=Object.prototype.hasOwnProperty,t="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(t=!1));function i(a,u,c){this.fn=a,this.context=u,this.once=c||!1}function s(a,u,c,f,d){if(typeof c!="function")throw new TypeError("The listener must be a function");var h=new i(c,f||a,d),p=t?t+u:u;return a._events[p]?a._events[p].fn?a._events[p]=[a._events[p],h]:a._events[p].push(h):(a._events[p]=h,a._eventsCount++),a}function o(a,u){--a._eventsCount===0?a._events=new n:delete a._events[u]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],c,f;if(this._eventsCount===0)return u;for(f in c=this._events)e.call(c,f)&&u.push(t?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(c)):u},l.prototype.listeners=function(u){var c=t?t+u:u,f=this._events[c];if(!f)return[];if(f.fn)return[f.fn];for(var d=0,h=f.length,p=new Array(h);d{c=c||{},c.frag=this.frag,c.id=this.id,u===T.ERROR&&(this.error=c.error),this.hls.trigger(u,c)};this.observer=new Tf,this.observer.on(T.FRAG_DECRYPTED,o),this.observer.on(T.ERROR,o);const l=dn(s.preferManagedMediaSource)||{isTypeSupported:()=>!1},a={mpeg:l.isTypeSupported("audio/mpeg"),mp3:l.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:l.isTypeSupported('audio/mp4; codecs="ac-3"')};if(this.useWorker&&typeof Worker<"u"&&(s.workerPath||cw())){try{s.workerPath?(I.log(`loading Web Worker ${s.workerPath} for "${t}"`),this.workerContext=dw(s.workerPath)):(I.log(`injecting Web Worker for "${t}"`),this.workerContext=fw()),this.onwmsg=f=>this.onWorkerMessage(f);const{worker:c}=this.workerContext;c.addEventListener("message",this.onwmsg),c.onerror=f=>{const d=new Error(`${f.message} (${f.filename}:${f.lineno})`);s.enableWorker=!1,I.warn(`Error in "${t}" Web Worker, fallback to inline`),this.hls.trigger(T.ERROR,{type:X.OTHER_ERROR,details:P.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:d})},c.postMessage({cmd:"init",typeSupported:a,vendor:"",id:t,config:JSON.stringify(s)})}catch(c){I.warn(`Error setting up "${t}" Web Worker, fallback to inline`,c),this.resetWorker(),this.error=null,this.transmuxer=new Yh(this.observer,a,s,"",t)}return}this.transmuxer=new Yh(this.observer,a,s,"",t)}resetWorker(){if(this.workerContext){const{worker:e,objectURL:t}=this.workerContext;t&&self.URL.revokeObjectURL(t),e.removeEventListener("message",this.onwmsg),e.onerror=null,e.terminate(),this.workerContext=null}}destroy(){if(this.workerContext)this.resetWorker(),this.onwmsg=void 0;else{const t=this.transmuxer;t&&(t.destroy(),this.transmuxer=null)}const e=this.observer;e&&e.removeAllListeners(),this.frag=null,this.observer=null,this.hls=null}push(e,t,n,i,s,o,l,a,u,c){var f,d;u.transmuxing.start=self.performance.now();const{transmuxer:h}=this,p=o?o.start:s.start,m=s.decryptdata,y=this.frag,g=!(y&&s.cc===y.cc),v=!(y&&u.level===y.level),x=y?u.sn-y.sn:-1,S=this.part?u.part-this.part.index:-1,E=x===0&&u.id>1&&u.id===(y==null?void 0:y.stats.chunkCount),b=!v&&(x===1||x===0&&(S===1||E&&S<=0)),w=self.performance.now();(v||x||s.stats.parsing.start===0)&&(s.stats.parsing.start=w),o&&(S||!b)&&(o.stats.parsing.start=w);const A=!(y&&((f=s.initSegment)==null?void 0:f.url)===((d=y.initSegment)==null?void 0:d.url)),R=new zw(g,b,a,v,p,A);if(!b||g||A){I.log(`[transmuxer-interface, ${s.type}]: Starting new transmux session for sn: ${u.sn} p: ${u.part} level: ${u.level} id: ${u.id} + discontinuity: ${g} + trackSwitch: ${v} + contiguous: ${b} + accurateTimeOffset: ${a} + timeOffset: ${p} + initSegmentChange: ${A}`);const L=new Hw(n,i,t,l,c);this.configureTransmuxer(L)}if(this.frag=s,this.part=o,this.workerContext)this.workerContext.worker.postMessage({cmd:"demux",data:e,decryptdata:m,chunkMeta:u,state:R},e instanceof ArrayBuffer?[e]:[]);else if(h){const L=h.push(e,m,u,R);vo(L)?(h.async=!0,L.then(C=>{this.handleTransmuxComplete(C)}).catch(C=>{this.transmuxerError(C,u,"transmuxer-interface push error")})):(h.async=!1,this.handleTransmuxComplete(L))}}flush(e){e.transmuxing.start=self.performance.now();const{transmuxer:t}=this;if(this.workerContext)this.workerContext.worker.postMessage({cmd:"flush",chunkMeta:e});else if(t){let n=t.flush(e);vo(n)||t.async?(vo(n)||(n=Promise.resolve(n)),n.then(s=>{this.handleFlushResult(s,e)}).catch(s=>{this.transmuxerError(s,e,"transmuxer-interface flush error")})):this.handleFlushResult(n,e)}}transmuxerError(e,t,n){this.hls&&(this.error=e,this.hls.trigger(T.ERROR,{type:X.MEDIA_ERROR,details:P.FRAG_PARSING_ERROR,chunkMeta:t,frag:this.frag||void 0,fatal:!1,error:e,err:e,reason:n}))}handleFlushResult(e,t){e.forEach(n=>{this.handleTransmuxComplete(n)}),this.onFlush(t)}onWorkerMessage(e){const t=e.data;if(!(t!=null&&t.event)){I.warn(`worker message received with no ${t?"event name":"data"}`);return}const n=this.hls;if(this.hls)switch(t.event){case"init":{var i;const s=(i=this.workerContext)==null?void 0:i.objectURL;s&&self.URL.revokeObjectURL(s);break}case"transmuxComplete":{this.handleTransmuxComplete(t.data);break}case"flush":{this.onFlush(t.data);break}case"workerLog":I[t.data.logType]&&I[t.data.logType](t.data.message);break;default:{t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,n.trigger(t.event,t.data);break}}}configureTransmuxer(e){const{transmuxer:t}=this;this.workerContext?this.workerContext.worker.postMessage({cmd:"configure",config:e}):t&&t.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}function Qg(r,e){if(r.length!==e.length)return!1;for(let t=0;tr[i]!==e[i])}function Zu(r,e){return e.label.toLowerCase()===r.name.toLowerCase()&&(!e.language||e.language.toLowerCase()===(r.lang||"").toLowerCase())}const qh=100;class Kw extends yf{constructor(e,t,n){super(e,t,n,"[audio-stream-controller]",q.AUDIO),this.videoBuffer=null,this.videoTrackCC=-1,this.waitingVideoCC=-1,this.bufferedTrack=null,this.switchingTrack=null,this.trackId=-1,this.waitingData=null,this.mainDetails=null,this.flushing=!1,this.bufferFlushed=!1,this.cachedTrackLoadedData=null,this._registerListeners()}onHandlerDestroying(){this._unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=null,this.bufferedTrack=null,this.switchingTrack=null}_registerListeners(){const{hls:e}=this;e.on(T.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(T.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(T.MANIFEST_LOADING,this.onManifestLoading,this),e.on(T.LEVEL_LOADED,this.onLevelLoaded,this),e.on(T.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(T.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(T.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(T.ERROR,this.onError,this),e.on(T.BUFFER_RESET,this.onBufferReset,this),e.on(T.BUFFER_CREATED,this.onBufferCreated,this),e.on(T.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(T.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(T.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(T.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(T.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(T.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(T.MANIFEST_LOADING,this.onManifestLoading,this),e.off(T.LEVEL_LOADED,this.onLevelLoaded,this),e.off(T.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(T.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(T.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(T.ERROR,this.onError,this),e.off(T.BUFFER_RESET,this.onBufferReset,this),e.off(T.BUFFER_CREATED,this.onBufferCreated,this),e.off(T.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(T.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(T.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(T.FRAG_BUFFERED,this.onFragBuffered,this)}onInitPtsFound(e,{frag:t,id:n,initPTS:i,timescale:s}){if(n==="main"){const o=t.cc;this.initPTS[t.cc]={baseTime:i,timescale:s},this.log(`InitPTS for cc: ${o} found from main: ${i}`),this.videoTrackCC=o,this.state===$.WAITING_INIT_PTS&&this.tick()}}startLoad(e){if(!this.levels){this.startPosition=e,this.state=$.STOPPED;return}const t=this.lastCurrentTime;this.stopLoad(),this.setInterval(qh),t>0&&e===-1?(this.log(`Override startPosition with lastCurrentTime @${t.toFixed(3)}`),e=t,this.state=$.IDLE):(this.loadedmetadata=!1,this.state=$.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}doTick(){switch(this.state){case $.IDLE:this.doTickIdle();break;case $.WAITING_TRACK:{var e;const{levels:n,trackId:i}=this,s=n==null||(e=n[i])==null?void 0:e.details;if(s){if(this.waitForCdnTuneIn(s))break;this.state=$.WAITING_INIT_PTS}break}case $.FRAG_LOADING_WAITING_RETRY:{var t;const n=performance.now(),i=this.retryDate;if(!i||n>=i||(t=this.media)!=null&&t.seeking){const{levels:s,trackId:o}=this;this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded((s==null?void 0:s[o])||null),this.state=$.IDLE}break}case $.WAITING_INIT_PTS:{const n=this.waitingData;if(n){const{frag:i,part:s,cache:o,complete:l}=n;if(this.initPTS[i.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=$.FRAG_LOADING;const a=o.flush(),u={frag:i,part:s,payload:a,networkDetails:null};this._handleFragmentLoadProgress(u),l&&super._handleFragmentLoadComplete(u)}else if(this.videoTrackCC!==this.waitingVideoCC)this.log(`Waiting fragment cc (${i.cc}) cancelled because video is at cc ${this.videoTrackCC}`),this.clearWaitingFragment();else{const a=this.getLoadPosition(),u=fe.bufferInfo(this.mediaBuffer,a,this.config.maxBufferHole);qu(u.end,this.config.maxFragLookUpTolerance,i)<0&&(this.log(`Waiting fragment cc (${i.cc}) @ ${i.start} cancelled because another fragment at ${u.end} is needed`),this.clearWaitingFragment())}}else this.state=$.IDLE}}this.onTickEnd()}clearWaitingFragment(){const e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=$.IDLE)}resetLoadingState(){this.clearWaitingFragment(),super.resetLoadingState()}onTickEnd(){const{media:e}=this;e!=null&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){const{hls:e,levels:t,media:n,trackId:i}=this,s=e.config;if(!n&&(this.startFragRequested||!s.startFragPrefetch)||!(t!=null&&t[i]))return;const o=t[i],l=o.details;if(!l||l.live&&this.levelLastLoaded!==o||this.waitForCdnTuneIn(l)){this.state=$.WAITING_TRACK;return}const a=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&a&&(this.bufferFlushed=!1,this.afterBufferFlushed(a,le.AUDIO,q.AUDIO));const u=this.getFwdBufferInfo(a,q.AUDIO);if(u===null)return;const{bufferedTrack:c,switchingTrack:f}=this;if(!f&&this._streamEnded(u,l)){e.trigger(T.BUFFER_EOS,{type:"audio"}),this.state=$.ENDED;return}const d=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,q.MAIN),h=u.len,p=this.getMaxBufferLength(d==null?void 0:d.len),m=l.fragments,y=m[0].start;let g=this.flushing?this.getLoadPosition():u.end;if(f&&n){const E=this.getLoadPosition();c&&!si(f.attrs,c.attrs)&&(g=E),l.PTSKnown&&Ey||u.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),n.currentTime=y+.05)}if(h>=p&&!f&&gd.end+l.targetduration;if(S||!(d!=null&&d.len)&&u.len){const E=this.getAppendedFrag(v.start,q.MAIN);if(E===null||(x||(x=!!E.gap||!!S&&d.len===0),S&&!x||x&&u.nextStart&&u.nextStartnew ii(n))}onAudioTrackSwitching(e,t){const n=!!t.url;this.trackId=t.id;const{fragCurrent:i}=this;i&&(i.abortRequests(),this.removeUnbufferedFrags(i.start)),this.resetLoadingState(),n?this.setInterval(qh):this.resetTransmuxer(),n?(this.switchingTrack=t,this.state=$.IDLE,this.flushAudioIfNeeded(t)):(this.switchingTrack=null,this.bufferedTrack=t,this.state=$.STOPPED),this.tick()}onManifestLoading(){this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=this.flushing=!1,this.levels=this.mainDetails=this.waitingData=this.bufferedTrack=this.cachedTrackLoadedData=this.switchingTrack=null,this.startFragRequested=!1,this.trackId=this.videoTrackCC=this.waitingVideoCC=-1}onLevelLoaded(e,t){this.mainDetails=t.details,this.cachedTrackLoadedData!==null&&(this.hls.trigger(T.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData),this.cachedTrackLoadedData=null)}onAudioTrackLoaded(e,t){var n;if(this.mainDetails==null){this.cachedTrackLoadedData=t;return}const{levels:i}=this,{details:s,id:o}=t;if(!i){this.warn(`Audio tracks were reset while loading level ${o}`);return}this.log(`Audio track ${o} loaded [${s.startSN},${s.endSN}]${s.lastPartSn?`[part-${s.lastPartSn}-${s.lastPartIndex}]`:""},duration:${s.totalduration}`);const l=i[o];let a=0;if(s.live||(n=l.details)!=null&&n.live){this.checkLiveUpdate(s);const c=this.mainDetails;if(s.deltaUpdateFailed||!c)return;if(!l.details&&s.hasProgramDateTime&&c.hasProgramDateTime)sa(s,c),a=s.fragments[0].start;else{var u;a=this.alignPlaylists(s,l.details,(u=this.levelLastLoaded)==null?void 0:u.details)}}l.details=s,this.levelLastLoaded=l,!this.startFragRequested&&(this.mainDetails||!s.live)&&this.setStartPosition(this.mainDetails||s,a),this.state===$.WAITING_TRACK&&!this.waitForCdnTuneIn(s)&&(this.state=$.IDLE),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:n,part:i,payload:s}=e,{config:o,trackId:l,levels:a}=this;if(!a){this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${n.sn} of level ${n.level} will not be buffered`);return}const u=a[l];if(!u){this.warn("Audio track is undefined on fragment load progress");return}const c=u.details;if(!c){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(n.start);return}const f=o.defaultAudioCodec||u.audioCodec||"mp4a.40.2";let d=this.transmuxer;d||(d=this.transmuxer=new Zg(this.hls,q.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const h=this.initPTS[n.cc],p=(t=n.initSegment)==null?void 0:t.data;if(h!==void 0){const y=i?i.index:-1,g=y!==-1,v=new mf(n.level,n.sn,n.stats.chunkCount,s.byteLength,y,g);d.push(s,p,f,"",n,i,c.totalduration,!1,v,h)}else{this.log(`Unknown video PTS for cc ${n.cc}, waiting for video PTS before demuxing audio frag ${n.sn} of [${c.startSN} ,${c.endSN}],track ${l}`);const{cache:m}=this.waitingData=this.waitingData||{frag:n,part:i,cache:new Fg,complete:!1};m.push(new Uint8Array(s)),this.waitingVideoCC=this.videoTrackCC,this.state=$.WAITING_INIT_PTS}}_handleFragmentLoadComplete(e){if(this.waitingData){this.waitingData.complete=!0;return}super._handleFragmentLoadComplete(e)}onBufferReset(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1}onBufferCreated(e,t){const n=t.tracks.audio;n&&(this.mediaBuffer=n.buffer||null),t.tracks.video&&(this.videoBuffer=t.tracks.video.buffer||null)}onFragBuffered(e,t){const{frag:n,part:i}=t;if(n.type!==q.AUDIO){if(!this.loadedmetadata&&n.type===q.MAIN){const s=this.videoBuffer||this.media;s&&fe.getBuffered(s).length&&(this.loadedmetadata=!0)}return}if(this.fragContextChanged(n)){this.warn(`Fragment ${n.sn}${i?" p: "+i.index:""} of level ${n.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);return}if(n.sn!=="initSegment"){this.fragPrevious=n;const s=this.switchingTrack;s&&(this.bufferedTrack=s,this.switchingTrack=null,this.hls.trigger(T.AUDIO_TRACK_SWITCHED,Fe({},s)))}this.fragBufferedComplete(n,i)}onError(e,t){var n;if(t.fatal){this.state=$.ERROR;return}switch(t.details){case P.FRAG_GAP:case P.FRAG_PARSING_ERROR:case P.FRAG_DECRYPT_ERROR:case P.FRAG_LOAD_ERROR:case P.FRAG_LOAD_TIMEOUT:case P.KEY_LOAD_ERROR:case P.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(q.AUDIO,t);break;case P.AUDIO_TRACK_LOAD_ERROR:case P.AUDIO_TRACK_LOAD_TIMEOUT:case P.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===$.WAITING_TRACK&&((n=t.context)==null?void 0:n.type)===se.AUDIO_TRACK&&(this.state=$.IDLE);break;case P.BUFFER_APPEND_ERROR:case P.BUFFER_FULL_ERROR:if(!t.parent||t.parent!=="audio")return;if(t.details===P.BUFFER_APPEND_ERROR){this.resetLoadingState();return}this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case P.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onBufferFlushing(e,{type:t}){t!==le.VIDEO&&(this.flushing=!0)}onBufferFlushed(e,{type:t}){if(t!==le.VIDEO){this.flushing=!1,this.bufferFlushed=!0,this.state===$.ENDED&&(this.state=$.IDLE);const n=this.mediaBuffer||this.media;n&&(this.afterBufferFlushed(n,t,q.AUDIO),this.tick())}}_handleTransmuxComplete(e){var t;const n="audio",{hls:i}=this,{remuxResult:s,chunkMeta:o}=e,l=this.getCurrentContext(o);if(!l){this.resetWhenMissingContext(o);return}const{frag:a,part:u,level:c}=l,{details:f}=c,{audio:d,text:h,id3:p,initSegment:m}=s;if(this.fragContextChanged(a)||!f){this.fragmentTracker.removeFragment(a);return}if(this.state=$.PARSING,this.switchingTrack&&d&&this.completeAudioSwitch(this.switchingTrack),m!=null&&m.tracks){const y=a.initSegment||a;this._bufferInitSegment(c,m.tracks,y,o),i.trigger(T.FRAG_PARSING_INIT_SEGMENT,{frag:y,id:n,tracks:m.tracks})}if(d){const{startPTS:y,endPTS:g,startDTS:v,endDTS:x}=d;u&&(u.elementaryStreams[le.AUDIO]={startPTS:y,endPTS:g,startDTS:v,endDTS:x}),a.setElementaryStreamInfo(le.AUDIO,y,g,v,x),this.bufferFragmentData(d,a,u,o)}if(p!=null&&(t=p.samples)!=null&&t.length){const y=Re({id:n,frag:a,details:f},p);i.trigger(T.FRAG_PARSING_METADATA,y)}if(h){const y=Re({id:n,frag:a,details:f},h);i.trigger(T.FRAG_PARSING_USERDATA,y)}}_bufferInitSegment(e,t,n,i){if(this.state!==$.PARSING)return;t.video&&delete t.video;const s=t.audio;if(!s)return;s.id="audio";const o=e.audioCodec;this.log(`Init audio buffer, container:${s.container}, codecs[level/parsed]=[${o}/${s.codec}]`),o&&o.split(",").length===1&&(s.levelCodec=o),this.hls.trigger(T.BUFFER_CODECS,t);const l=s.initSegment;if(l!=null&&l.byteLength){const a={type:"audio",frag:n,part:null,chunkMeta:i,parent:n.type,data:l};this.hls.trigger(T.BUFFER_APPENDING,a)}this.tickImmediate()}loadFragment(e,t,n){const i=this.fragmentTracker.getState(e);if(this.fragCurrent=e,this.switchingTrack||i===Pe.NOT_LOADED||i===Pe.PARTIAL){var s;if(e.sn==="initSegment")this._loadInitSegment(e,t);else if((s=t.details)!=null&&s.live&&!this.initPTS[e.cc]){this.log(`Waiting for video PTS in continuity counter ${e.cc} of live stream before loading audio fragment ${e.sn} of level ${this.trackId}`),this.state=$.WAITING_INIT_PTS;const o=this.mainDetails;o&&o.fragments[0].start!==t.details.fragments[0].start&&sa(t.details,o)}else this.startFragRequested=!0,super.loadFragment(e,t,n)}else this.clearTrackerIfNeeded(e)}flushAudioIfNeeded(e){const{media:t,bufferedTrack:n}=this,i=n==null?void 0:n.attrs,s=e.attrs;t&&i&&(i.CHANNELS!==s.CHANNELS||n.name!==e.name||n.lang!==e.lang)&&(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"),this.bufferedTrack=null)}completeAudioSwitch(e){const{hls:t}=this;this.flushAudioIfNeeded(e),this.bufferedTrack=e,this.switchingTrack=null,t.trigger(T.AUDIO_TRACK_SWITCHED,Fe({},e))}}class Ww extends pf{constructor(e){super(e,"[audio-track-controller]"),this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:e}=this;e.on(T.MANIFEST_LOADING,this.onManifestLoading,this),e.on(T.MANIFEST_PARSED,this.onManifestParsed,this),e.on(T.LEVEL_LOADING,this.onLevelLoading,this),e.on(T.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(T.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(T.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(T.MANIFEST_LOADING,this.onManifestLoading,this),e.off(T.MANIFEST_PARSED,this.onManifestParsed,this),e.off(T.LEVEL_LOADING,this.onLevelLoading,this),e.off(T.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(T.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(T.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.tracksInGroup=[],this.groupIds=null,this.currentTrack=null,this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.audioTracks||[]}onAudioTrackLoaded(e,t){const{id:n,groupId:i,details:s}=t,o=this.tracksInGroup[n];if(!o||o.groupId!==i){this.warn(`Audio track with id:${n} and group:${i} not found in active group ${o==null?void 0:o.groupId}`);return}const l=o.details;o.details=t.details,this.log(`Audio track ${n} "${o.name}" lang:${o.lang} group:${i} loaded [${s.startSN}-${s.endSN}]`),n===this.trackId&&this.playlistLoaded(n,t,l)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const n=t.audioGroups||null,i=this.groupIds;let s=this.currentTrack;if(!n||(i==null?void 0:i.length)!==(n==null?void 0:n.length)||n!=null&&n.some(l=>(i==null?void 0:i.indexOf(l))===-1)){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const l=this.tracks.filter(d=>!n||n.indexOf(d.groupId)!==-1);if(l.length)this.selectDefaultTrack&&!l.some(d=>d.default)&&(this.selectDefaultTrack=!1),l.forEach((d,h)=>{d.id=h});else if(!s&&!this.tracksInGroup.length)return;this.tracksInGroup=l;const a=this.hls.config.audioPreference;if(!s&&a){const d=Ht(a,l,xn);if(d>-1)s=l[d];else{const h=Ht(a,this.tracks);s=this.tracks[h]}}let u=this.findTrackId(s);u===-1&&s&&(u=this.findTrackId(null));const c={audioTracks:l};this.log(`Updating audio tracks, ${l.length} track(s) found in group(s): ${n==null?void 0:n.join(",")}`),this.hls.trigger(T.AUDIO_TRACKS_UPDATED,c);const f=this.trackId;if(u!==-1&&f===-1)this.setAudioTrack(u);else if(l.length&&f===-1){var o;const d=new Error(`No audio track selected for current audio group-ID(s): ${(o=this.groupIds)==null?void 0:o.join(",")} track count: ${l.length}`);this.warn(d.message),this.hls.trigger(T.ERROR,{type:X.MEDIA_ERROR,details:P.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:d})}}else this.shouldReloadPlaylist(s)&&this.setAudioTrack(this.trackId)}onError(e,t){t.fatal||!t.context||t.context.type===se.AUDIO_TRACK&&t.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(t.context.groupId)!==-1)&&(this.requestScheduled=-1,this.checkRetry(t))}get allAudioTracks(){return this.tracks}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}setAudioOption(e){const t=this.hls;if(t.config.audioPreference=e,e){const n=this.allAudioTracks;if(this.selectDefaultTrack=!1,n.length){const i=this.currentTrack;if(i&&Vn(e,i,xn))return i;const s=Ht(e,this.tracksInGroup,xn);if(s>-1){const o=this.tracksInGroup[s];return this.setAudioTrack(s),o}else if(i){let o=t.loadLevel;o===-1&&(o=t.firstAutoLevel);const l=WT(e,t.levels,n,o,xn);if(l===-1)return null;t.nextLoadLevel=l}if(e.channels||e.audioCodec){const o=Ht(e,n);if(o>-1)return n[o]}}}return null}setAudioTrack(e){const t=this.tracksInGroup;if(e<0||e>=t.length){this.warn(`Invalid audio track id: ${e}`);return}this.clearTimer(),this.selectDefaultTrack=!1;const n=this.currentTrack,i=t[e],s=i.details&&!i.details.live;if(e===this.trackId&&i===n&&s||(this.log(`Switching to audio-track ${e} "${i.name}" lang:${i.lang} group:${i.groupId} channels:${i.channels}`),this.trackId=e,this.currentTrack=i,this.hls.trigger(T.AUDIO_TRACK_SWITCHING,Fe({},i)),s))return;const o=this.switchParams(i.url,n==null?void 0:n.details,i.details);this.loadPlaylist(o)}findTrackId(e){const t=this.tracksInGroup;for(let n=0;n=s[u].start&&l<=s[u].end){o=s[u];break}const a=n.start+n.duration;o?o.end=a:(o={start:l,end:a},s.push(o)),this.fragmentTracker.fragBuffered(n),this.fragBufferedComplete(n,null)}onBufferFlushing(e,t){const{startOffset:n,endOffset:i}=t;if(n===0&&i!==Number.POSITIVE_INFINITY){const s=i-1;if(s<=0)return;t.endOffsetSubtitles=Math.max(0,s),this.tracksBuffered.forEach(o=>{for(let l=0;lnew ii(n));return}this.tracksBuffered=[],this.levels=t.map(n=>{const i=new ii(n);return this.tracksBuffered[i.id]=[],i}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,q.SUBTITLE),this.fragPrevious=null,this.mediaBuffer=null}onSubtitleTrackSwitch(e,t){var n;if(this.currentTrackId=t.id,!((n=this.levels)!=null&&n.length)||this.currentTrackId===-1){this.clearInterval();return}const i=this.levels[this.currentTrackId];i!=null&&i.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,i&&this.setInterval(Xh)}onSubtitleTrackLoaded(e,t){var n;const{currentTrackId:i,levels:s}=this,{details:o,id:l}=t;if(!s){this.warn(`Subtitle tracks were reset while loading level ${l}`);return}const a=s[l];if(l>=s.length||!a)return;this.log(`Subtitle track ${l} loaded [${o.startSN},${o.endSN}]${o.lastPartSn?`[part-${o.lastPartSn}-${o.lastPartIndex}]`:""},duration:${o.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let u=0;if(o.live||(n=a.details)!=null&&n.live){const f=this.mainDetails;if(o.deltaUpdateFailed||!f)return;const d=f.fragments[0];if(!a.details)o.hasProgramDateTime&&f.hasProgramDateTime?(sa(o,f),u=o.fragments[0].start):d&&(u=d.start,Yu(o,u));else{var c;u=this.alignPlaylists(o,a.details,(c=this.levelLastLoaded)==null?void 0:c.details),u===0&&d&&(u=d.start,Yu(o,u))}}a.details=o,this.levelLastLoaded=a,l===i&&(!this.startFragRequested&&(this.mainDetails||!o.live)&&this.setStartPosition(this.mainDetails||o,u),this.tick(),o.live&&!this.fragCurrent&&this.media&&this.state===$.IDLE&&(ia(null,o.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),a.details=void 0)))}_handleFragmentLoadComplete(e){const{frag:t,payload:n}=e,i=t.decryptdata,s=this.hls;if(!this.fragContextChanged(t)&&n&&n.byteLength>0&&i!=null&&i.key&&i.iv&&i.method==="AES-128"){const o=performance.now();this.decrypter.decrypt(new Uint8Array(n),i.key.buffer,i.iv.buffer).catch(l=>{throw s.trigger(T.ERROR,{type:X.MEDIA_ERROR,details:P.FRAG_DECRYPT_ERROR,fatal:!1,error:l,reason:l.message,frag:t}),l}).then(l=>{const a=performance.now();s.trigger(T.FRAG_DECRYPTED,{frag:t,payload:l,stats:{tstart:o,tdecrypt:a}})}).catch(l=>{this.warn(`${l.name}: ${l.message}`),this.state=$.IDLE})}}doTick(){if(!this.media){this.state=$.IDLE;return}if(this.state===$.IDLE){const{currentTrackId:e,levels:t}=this,n=t==null?void 0:t[e];if(!n||!t.length||!n.details)return;const{config:i}=this,s=this.getLoadPosition(),o=fe.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],s,i.maxBufferHole),{end:l,len:a}=o,u=this.getFwdBufferInfo(this.media,q.MAIN),c=n.details,f=this.getMaxBufferLength(u==null?void 0:u.len)+c.levelTargetDuration;if(a>f)return;const d=c.fragments,h=d.length,p=c.edge;let m=null;const y=this.fragPrevious;if(lp-g?0:g;m=ia(y,d,Math.max(d[0].start,l),v),!m&&y&&y.start{if(i=i>>>0,i>s-1)throw new DOMException(`Failed to execute '${n}' on 'TimeRanges': The index provided (${i}) is greater than the maximum bound (${s})`);return e[i][n]};this.buffered={get length(){return e.length},end(n){return t("end",n,e.length)},start(n){return t("start",n,e.length)}}}}class Xw extends pf{constructor(e){super(e,"[subtitle-track-controller]"),this.media=null,this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.queuedDefaultTrack=-1,this.asyncPollTrackChange=()=>this.pollTrackChange(0),this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.onTextTracksChanged=()=>{if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let t=null;const n=ho(this.media.textTracks);for(let s=0;s-1&&this.toggleTrackModes()}registerListeners(){const{hls:e}=this;e.on(T.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(T.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(T.MANIFEST_LOADING,this.onManifestLoading,this),e.on(T.MANIFEST_PARSED,this.onManifestParsed,this),e.on(T.LEVEL_LOADING,this.onLevelLoading,this),e.on(T.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(T.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(T.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(T.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(T.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(T.MANIFEST_LOADING,this.onManifestLoading,this),e.off(T.MANIFEST_PARSED,this.onManifestParsed,this),e.off(T.LEVEL_LOADING,this.onLevelLoading,this),e.off(T.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(T.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(T.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))}pollTrackChange(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.onTextTracksChanged,e)}onMediaDetaching(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),ho(this.media.textTracks).forEach(t=>{Nn(t)}),this.subtitleTrack=-1,this.media=null}onManifestLoading(){this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.subtitleTracks}onSubtitleTrackLoaded(e,t){const{id:n,groupId:i,details:s}=t,o=this.tracksInGroup[n];if(!o||o.groupId!==i){this.warn(`Subtitle track with id:${n} and group:${i} not found in active group ${o==null?void 0:o.groupId}`);return}const l=o.details;o.details=t.details,this.log(`Subtitle track ${n} "${o.name}" lang:${o.lang} group:${i} loaded [${s.startSN}-${s.endSN}]`),n===this.trackId&&this.playlistLoaded(n,t,l)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const n=t.subtitleGroups||null,i=this.groupIds;let s=this.currentTrack;if(!n||(i==null?void 0:i.length)!==(n==null?void 0:n.length)||n!=null&&n.some(o=>(i==null?void 0:i.indexOf(o))===-1)){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const o=this.tracks.filter(c=>!n||n.indexOf(c.groupId)!==-1);if(o.length)this.selectDefaultTrack&&!o.some(c=>c.default)&&(this.selectDefaultTrack=!1),o.forEach((c,f)=>{c.id=f});else if(!s&&!this.tracksInGroup.length)return;this.tracksInGroup=o;const l=this.hls.config.subtitlePreference;if(!s&&l){this.selectDefaultTrack=!1;const c=Ht(l,o);if(c>-1)s=o[c];else{const f=Ht(l,this.tracks);s=this.tracks[f]}}let a=this.findTrackId(s);a===-1&&s&&(a=this.findTrackId(null));const u={subtitleTracks:o};this.log(`Updating subtitle tracks, ${o.length} track(s) found in "${n==null?void 0:n.join(",")}" group-id`),this.hls.trigger(T.SUBTITLE_TRACKS_UPDATED,u),a!==-1&&this.trackId===-1&&this.setSubtitleTrack(a)}else this.shouldReloadPlaylist(s)&&this.setSubtitleTrack(this.trackId)}findTrackId(e){const t=this.tracksInGroup,n=this.selectDefaultTrack;for(let i=0;i-1){const s=this.tracksInGroup[i];return this.setSubtitleTrack(i),s}else{if(n)return null;{const s=Ht(e,t);if(s>-1)return t[s]}}}}return null}loadPlaylist(e){super.loadPlaylist();const t=this.currentTrack;if(this.shouldLoadPlaylist(t)&&t){const n=t.id,i=t.groupId;let s=t.url;if(e)try{s=e.addDirectives(s)}catch(o){this.warn(`Could not construct new URL with HLS Delivery Directives: ${o}`)}this.log(`Loading subtitle playlist for id ${n}`),this.hls.trigger(T.SUBTITLE_TRACK_LOADING,{url:s,id:n,groupId:i,deliveryDirectives:e||null})}}toggleTrackModes(){const{media:e}=this;if(!e)return;const t=ho(e.textTracks),n=this.currentTrack;let i;if(n&&(i=t.filter(s=>Zu(n,s))[0],i||this.warn(`Unable to find subtitle TextTrack with name "${n.name}" and language "${n.lang}"`)),[].slice.call(t).forEach(s=>{s.mode!=="disabled"&&s!==i&&(s.mode="disabled")}),i){const s=this.subtitleDisplay?"showing":"hidden";i.mode!==s&&(i.mode=s)}}setSubtitleTrack(e){const t=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=e;return}if(e<-1||e>=t.length||!z(e)){this.warn(`Invalid subtitle track id: ${e}`);return}this.clearTimer(),this.selectDefaultTrack=!1;const n=this.currentTrack,i=t[e]||null;if(this.trackId=e,this.currentTrack=i,this.toggleTrackModes(),!i){this.hls.trigger(T.SUBTITLE_TRACK_SWITCH,{id:e});return}const s=!!i.details&&!i.details.live;if(e===this.trackId&&i===n&&s)return;this.log(`Switching to subtitle-track ${e}`+(i?` "${i.name}" lang:${i.lang} group:${i.groupId}`:""));const{id:o,groupId:l="",name:a,type:u,url:c}=i;this.hls.trigger(T.SUBTITLE_TRACK_SWITCH,{id:o,groupId:l,name:a,type:u,url:c});const f=this.switchParams(i.url,n==null?void 0:n.details,i.details);this.loadPlaylist(f)}}class Zw{constructor(e){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=e}append(e,t,n){const i=this.queues[t];i.push(e),i.length===1&&!n&&this.executeNext(t)}insertAbort(e,t){this.queues[t].unshift(e),this.executeNext(t)}appendBlocker(e){let t;const n=new Promise(s=>{t=s}),i={execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};return this.append(i,e),n}executeNext(e){const t=this.queues[e];if(t.length){const n=t[0];try{n.execute()}catch(i){I.warn(`[buffer-operation-queue]: Exception executing "${e}" SourceBuffer operation: ${i}`),n.onError(i);const s=this.buffers[e];s!=null&&s.updating||this.shiftAndExecuteNext(e)}}}shiftAndExecuteNext(e){this.queues[e].shift(),this.executeNext(e)}current(e){return this.queues[e][0]}}const Zh=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/;class Qw{constructor(e){this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.appendSource=void 0,this.appendErrors={audio:0,video:0,audiovideo:0},this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this.log=void 0,this.warn=void 0,this.error=void 0,this._onEndStreaming=n=>{this.hls&&this.hls.pauseBuffering()},this._onStartStreaming=n=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=()=>{const{media:n,mediaSource:i}=this;this.log("Media source opened"),n&&(n.removeEventListener("emptied",this._onMediaEmptied),this.updateMediaElementDuration(),this.hls.trigger(T.MEDIA_ATTACHED,{media:n,mediaSource:i})),i&&i.removeEventListener("sourceopen",this._onMediaSourceOpen),this.checkPendingTracks()},this._onMediaSourceClose=()=>{this.log("Media source closed")},this._onMediaSourceEnded=()=>{this.log("Media source ended")},this._onMediaEmptied=()=>{const{mediaSrc:n,_objectUrl:i}=this;n!==i&&I.error(`Media element src was set while attaching MediaSource (${i} > ${n})`)},this.hls=e;const t="[buffer-controller]";this.appendSource=aT(dn(e.config.preferManagedMediaSource)),this.log=I.log.bind(I,t),this.warn=I.warn.bind(I,t),this.error=I.error.bind(I,t),this._initSourceBuffer(),this.registerListeners()}hasSourceTypes(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=null,this.hls=null}registerListeners(){const{hls:e}=this;e.on(T.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(T.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(T.MANIFEST_LOADING,this.onManifestLoading,this),e.on(T.MANIFEST_PARSED,this.onManifestParsed,this),e.on(T.BUFFER_RESET,this.onBufferReset,this),e.on(T.BUFFER_APPENDING,this.onBufferAppending,this),e.on(T.BUFFER_CODECS,this.onBufferCodecs,this),e.on(T.BUFFER_EOS,this.onBufferEos,this),e.on(T.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(T.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(T.FRAG_PARSED,this.onFragParsed,this),e.on(T.FRAG_CHANGED,this.onFragChanged,this)}unregisterListeners(){const{hls:e}=this;e.off(T.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(T.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(T.MANIFEST_LOADING,this.onManifestLoading,this),e.off(T.MANIFEST_PARSED,this.onManifestParsed,this),e.off(T.BUFFER_RESET,this.onBufferReset,this),e.off(T.BUFFER_APPENDING,this.onBufferAppending,this),e.off(T.BUFFER_CODECS,this.onBufferCodecs,this),e.off(T.BUFFER_EOS,this.onBufferEos,this),e.off(T.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(T.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(T.FRAG_PARSED,this.onFragParsed,this),e.off(T.FRAG_CHANGED,this.onFragChanged,this)}_initSourceBuffer(){this.sourceBuffer={},this.operationQueue=new Zw(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]},this.appendErrors={audio:0,video:0,audiovideo:0},this.lastMpegAudioChunk=null}onManifestLoading(){this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=0,this.details=null}onManifestParsed(e,t){let n=2;(t.audio&&!t.video||!t.altAudio)&&(n=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=n,this.log(`${this.bufferCodecEventsExpected} bufferCodec event(s) expected`)}onMediaAttaching(e,t){const n=this.media=t.media,i=dn(this.appendSource);if(n&&i){var s;const o=this.mediaSource=new i;this.log(`created media source: ${(s=o.constructor)==null?void 0:s.name}`),o.addEventListener("sourceopen",this._onMediaSourceOpen),o.addEventListener("sourceended",this._onMediaSourceEnded),o.addEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(o.addEventListener("startstreaming",this._onStartStreaming),o.addEventListener("endstreaming",this._onEndStreaming));const l=this._objectUrl=self.URL.createObjectURL(o);if(this.appendSource)try{n.removeAttribute("src");const a=self.ManagedMediaSource;n.disableRemotePlayback=n.disableRemotePlayback||a&&o instanceof a,Qh(n),Jw(n,l),n.load()}catch{n.src=l}else n.src=l;n.addEventListener("emptied",this._onMediaEmptied)}}onMediaDetaching(){const{media:e,mediaSource:t,_objectUrl:n}=this;if(t){if(this.log("media source detaching"),t.readyState==="open")try{t.endOfStream()}catch(i){this.warn(`onMediaDetaching: ${i.message} while calling endOfStream`)}this.onBufferReset(),t.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("sourceended",this._onMediaSourceEnded),t.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(t.removeEventListener("startstreaming",this._onStartStreaming),t.removeEventListener("endstreaming",this._onEndStreaming)),e&&(e.removeEventListener("emptied",this._onMediaEmptied),n&&self.URL.revokeObjectURL(n),this.mediaSrc===n?(e.removeAttribute("src"),this.appendSource&&Qh(e),e.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(T.MEDIA_DETACHED,void 0)}onBufferReset(){this.getSourceBufferTypes().forEach(e=>{this.resetBuffer(e)}),this._initSourceBuffer()}resetBuffer(e){const t=this.sourceBuffer[e];try{if(t){var n;this.removeBufferListeners(e),this.sourceBuffer[e]=void 0,(n=this.mediaSource)!=null&&n.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(t)}}catch(i){this.warn(`onBufferReset ${e}`,i)}}onBufferCodecs(e,t){const n=this.getSourceBufferTypes().length,i=Object.keys(t);if(i.forEach(o=>{if(n){const a=this.tracks[o];if(a&&typeof a.buffer.changeType=="function"){var l;const{id:u,codec:c,levelCodec:f,container:d,metadata:h}=t[o],p=xh(a.codec,a.levelCodec),m=p==null?void 0:p.replace(Zh,"$1");let y=xh(c,f);const g=(l=y)==null?void 0:l.replace(Zh,"$1");if(y&&m!==g){o.slice(0,5)==="audio"&&(y=ea(y,this.appendSource));const v=`${d};codecs=${y}`;this.appendChangeType(o,v),this.log(`switching codec ${p} to ${y}`),this.tracks[o]={buffer:a.buffer,codec:c,container:d,levelCodec:f,metadata:h,id:u}}}}else this.pendingTracks[o]=t[o]}),n)return;const s=Math.max(this.bufferCodecEventsExpected-1,0);this.bufferCodecEventsExpected!==s&&(this.log(`${s} bufferCodec event(s) expected ${i.join(",")}`),this.bufferCodecEventsExpected=s),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()}appendChangeType(e,t){const{operationQueue:n}=this,i={execute:()=>{const s=this.sourceBuffer[e];s&&(this.log(`changing ${e} sourceBuffer type to ${t}`),s.changeType(t)),n.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:s=>{this.warn(`Failed to change ${e} SourceBuffer type`,s)}};n.append(i,e,!!this.pendingTracks[e])}onBufferAppending(e,t){const{hls:n,operationQueue:i,tracks:s}=this,{data:o,type:l,frag:a,part:u,chunkMeta:c}=t,f=c.buffering[l],d=self.performance.now();f.start=d;const h=a.stats.buffering,p=u?u.stats.buffering:null;h.start===0&&(h.start=d),p&&p.start===0&&(p.start=d);const m=s.audio;let y=!1;l==="audio"&&(m==null?void 0:m.container)==="audio/mpeg"&&(y=!this.lastMpegAudioChunk||c.id===1||this.lastMpegAudioChunk.sn!==c.sn,this.lastMpegAudioChunk=c);const g=a.start,v={execute:()=>{if(f.executeStart=self.performance.now(),y){const x=this.sourceBuffer[l];if(x){const S=g-x.timestampOffset;Math.abs(S)>=.1&&(this.log(`Updating audio SourceBuffer timestampOffset to ${g} (delta: ${S}) sn: ${a.sn})`),x.timestampOffset=g)}}this.appendExecutor(o,l)},onStart:()=>{},onComplete:()=>{const x=self.performance.now();f.executeEnd=f.end=x,h.first===0&&(h.first=x),p&&p.first===0&&(p.first=x);const{sourceBuffer:S}=this,E={};for(const b in S)E[b]=fe.getBuffered(S[b]);this.appendErrors[l]=0,l==="audio"||l==="video"?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(T.BUFFER_APPENDED,{type:l,frag:a,part:u,chunkMeta:c,parent:a.type,timeRanges:E})},onError:x=>{const S={type:X.MEDIA_ERROR,parent:a.type,details:P.BUFFER_APPEND_ERROR,sourceBufferName:l,frag:a,part:u,chunkMeta:c,error:x,err:x,fatal:!1};if(x.code===DOMException.QUOTA_EXCEEDED_ERR)S.details=P.BUFFER_FULL_ERROR;else{const E=++this.appendErrors[l];S.details=P.BUFFER_APPEND_ERROR,this.warn(`Failed ${E}/${n.config.appendErrorMaxRetry} times to append segment in "${l}" sourceBuffer`),E>=n.config.appendErrorMaxRetry&&(S.fatal=!0)}n.trigger(T.ERROR,S)}};i.append(v,l,!!this.pendingTracks[l])}onBufferFlushing(e,t){const{operationQueue:n}=this,i=s=>({execute:this.removeExecutor.bind(this,s,t.startOffset,t.endOffset),onStart:()=>{},onComplete:()=>{this.hls.trigger(T.BUFFER_FLUSHED,{type:s})},onError:o=>{this.warn(`Failed to remove from ${s} SourceBuffer`,o)}});t.type?n.append(i(t.type),t.type):this.getSourceBufferTypes().forEach(s=>{n.append(i(s),s)})}onFragParsed(e,t){const{frag:n,part:i}=t,s=[],o=i?i.elementaryStreams:n.elementaryStreams;o[le.AUDIOVIDEO]?s.push("audiovideo"):(o[le.AUDIO]&&s.push("audio"),o[le.VIDEO]&&s.push("video"));const l=()=>{const a=self.performance.now();n.stats.buffering.end=a,i&&(i.stats.buffering.end=a);const u=i?i.stats:n.stats;this.hls.trigger(T.FRAG_BUFFERED,{frag:n,part:i,stats:u,id:n.type})};s.length===0&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${n.type} level: ${n.level} sn: ${n.sn}`),this.blockBuffers(l,s)}onFragChanged(e,t){this.trimBuffers()}onBufferEos(e,t){this.getSourceBufferTypes().reduce((i,s)=>{const o=this.sourceBuffer[s];return o&&(!t.type||t.type===s)&&(o.ending=!0,o.ended||(o.ended=!0,this.log(`${s} sourceBuffer now EOS`))),i&&!!(!o||o.ended)},!0)&&(this.log("Queueing mediaSource.endOfStream()"),this.blockBuffers(()=>{this.getSourceBufferTypes().forEach(s=>{const o=this.sourceBuffer[s];o&&(o.ending=!1)});const{mediaSource:i}=this;if(!i||i.readyState!=="open"){i&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${i.readyState}`);return}this.log("Calling mediaSource.endOfStream()"),i.endOfStream()}))}onLevelUpdated(e,{details:t}){t.fragments.length&&(this.details=t,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())}trimBuffers(){const{hls:e,details:t,media:n}=this;if(!n||t===null||!this.getSourceBufferTypes().length)return;const s=e.config,o=n.currentTime,l=t.levelTargetDuration,a=t.live&&s.liveBackBufferLength!==null?s.liveBackBufferLength:s.backBufferLength;if(z(a)&&a>0){const u=Math.max(a,l),c=Math.floor(o/l)*l-u;this.flushBackBuffer(o,l,c)}if(z(s.frontBufferFlushThreshold)&&s.frontBufferFlushThreshold>0){const u=Math.max(s.maxBufferLength,s.frontBufferFlushThreshold),c=Math.max(u,l),f=Math.floor(o/l)*l+c;this.flushFrontBuffer(o,l,f)}}flushBackBuffer(e,t,n){const{details:i,sourceBuffer:s}=this;this.getSourceBufferTypes().forEach(l=>{const a=s[l];if(a){const u=fe.getBuffered(a);if(u.length>0&&n>u.start(0)){if(this.hls.trigger(T.BACK_BUFFER_REACHED,{bufferEnd:n}),i!=null&&i.live)this.hls.trigger(T.LIVE_BACK_BUFFER_REACHED,{bufferEnd:n});else if(a.ended&&u.end(u.length-1)-e{const l=i[o];if(l){const a=fe.getBuffered(l),u=a.length;if(u<2)return;const c=a.start(u-1),f=a.end(u-1);if(n>c||e>=c&&e<=f)return;if(l.ended&&e-f<2*t){this.log(`Cannot flush ${o} front buffer while SourceBuffer is in ended state`);return}this.hls.trigger(T.BUFFER_FLUSHING,{startOffset:c,endOffset:1/0,type:o})}})}updateMediaElementDuration(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;const{details:e,hls:t,media:n,mediaSource:i}=this,s=e.fragments[0].start+e.totalduration,o=n.duration,l=z(i.duration)?i.duration:0;e.live&&t.config.liveDurationInfinity?(i.duration=1/0,this.updateSeekableRange(e)):(s>l&&s>o||!z(o))&&(this.log(`Updating Media Source duration to ${s.toFixed(3)}`),i.duration=s)}updateSeekableRange(e){const t=this.mediaSource,n=e.fragments;if(n.length&&e.live&&t!=null&&t.setLiveSeekableRange){const s=Math.max(0,n[0].start),o=Math.max(s,s+e.totalduration);this.log(`Media Source duration is set to ${t.duration}. Setting seekable range to ${s}-${o}.`),t.setLiveSeekableRange(s,o)}}checkPendingTracks(){const{bufferCodecEventsExpected:e,operationQueue:t,pendingTracks:n}=this,i=Object.keys(n).length;if(i&&(!e||i===2||"audiovideo"in n)){this.createSourceBuffers(n),this.pendingTracks={};const s=this.getSourceBufferTypes();if(s.length)this.hls.trigger(T.BUFFER_CREATED,{tracks:this.tracks}),s.forEach(o=>{t.executeNext(o)});else{const o=new Error("could not create source buffer for media codec(s)");this.hls.trigger(T.ERROR,{type:X.MEDIA_ERROR,details:P.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:o,reason:o.message})}}}createSourceBuffers(e){const{sourceBuffer:t,mediaSource:n}=this;if(!n)throw Error("createSourceBuffers called when mediaSource was null");for(const s in e)if(!t[s]){var i;const o=e[s];if(!o)throw Error(`source buffer exists for track ${s}, however track does not`);let l=((i=o.levelCodec)==null?void 0:i.indexOf(","))===-1?o.levelCodec:o.codec;l&&s.slice(0,5)==="audio"&&(l=ea(l,this.appendSource));const a=`${o.container};codecs=${l}`;this.log(`creating sourceBuffer(${a})`);try{const u=t[s]=n.addSourceBuffer(a),c=s;this.addBufferListener(c,"updatestart",this._onSBUpdateStart),this.addBufferListener(c,"updateend",this._onSBUpdateEnd),this.addBufferListener(c,"error",this._onSBUpdateError),this.appendSource&&this.addBufferListener(c,"bufferedchange",(f,d)=>{const h=d.removedRanges;h!=null&&h.length&&this.hls.trigger(T.BUFFER_FLUSHED,{type:s})}),this.tracks[s]={buffer:u,codec:l,container:o.container,levelCodec:o.levelCodec,metadata:o.metadata,id:o.id}}catch(u){this.error(`error while trying to add sourceBuffer: ${u.message}`),this.hls.trigger(T.ERROR,{type:X.MEDIA_ERROR,details:P.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:u,sourceBufferName:s,mimeType:a})}}}get mediaSrc(){var e,t;const n=((e=this.media)==null||(t=e.querySelector)==null?void 0:t.call(e,"source"))||this.media;return n==null?void 0:n.src}_onSBUpdateStart(e){const{operationQueue:t}=this;t.current(e).onStart()}_onSBUpdateEnd(e){var t;if(((t=this.mediaSource)==null?void 0:t.readyState)==="closed"){this.resetBuffer(e);return}const{operationQueue:n}=this;n.current(e).onComplete(),n.shiftAndExecuteNext(e)}_onSBUpdateError(e,t){var n;const i=new Error(`${e} SourceBuffer error. MediaSource readyState: ${(n=this.mediaSource)==null?void 0:n.readyState}`);this.error(`${i}`,t),this.hls.trigger(T.ERROR,{type:X.MEDIA_ERROR,details:P.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:i,fatal:!1});const s=this.operationQueue.current(e);s&&s.onError(i)}removeExecutor(e,t,n){const{media:i,mediaSource:s,operationQueue:o,sourceBuffer:l}=this,a=l[e];if(!i||!s||!a){this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`),o.shiftAndExecuteNext(e);return}const u=z(i.duration)?i.duration:1/0,c=z(s.duration)?s.duration:1/0,f=Math.max(0,t),d=Math.min(n,u,c);d>f&&(!a.ending||a.ended)?(a.ended=!1,this.log(`Removing [${f},${d}] from the ${e} SourceBuffer`),a.remove(f,d)):o.shiftAndExecuteNext(e)}appendExecutor(e,t){const n=this.sourceBuffer[t];if(!n){if(!this.pendingTracks[t])throw new Error(`Attempting to append to the ${t} SourceBuffer, but it does not exist`);return}n.ended=!1,n.appendBuffer(e)}blockBuffers(e,t=this.getSourceBufferTypes()){if(!t.length){this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(e);return}const{operationQueue:n}=this,i=t.map(s=>n.appendBlocker(s));Promise.all(i).then(()=>{e(),t.forEach(s=>{const o=this.sourceBuffer[s];o!=null&&o.updating||n.shiftAndExecuteNext(s)})})}getSourceBufferTypes(){return Object.keys(this.sourceBuffer)}addBufferListener(e,t,n){const i=this.sourceBuffer[e];if(!i)return;const s=n.bind(this,e);this.listeners[e].push({event:t,listener:s}),i.addEventListener(t,s)}removeBufferListeners(e){const t=this.sourceBuffer[e];t&&this.listeners[e].forEach(n=>{t.removeEventListener(n.event,n.listener)})}}function Qh(r){const e=r.querySelectorAll("source");[].slice.call(e).forEach(t=>{r.removeChild(t)})}function Jw(r,e){const t=self.document.createElement("source");t.type="video/mp4",t.src=e,r.appendChild(t)}const eb={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},Jg=r=>String.fromCharCode(eb[r]||r),bt=15,Qt=100,tb={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},rb={17:2,18:4,21:6,22:8,23:10,19:13,20:15},nb={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},ib={25:2,26:4,29:6,30:8,31:10,27:13,28:15},sb=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class ob{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const n=typeof t=="function"?t():t;I.log(`${this.time} [${e}] ${n}`)}}}const zr=function(e){const t=[];for(let n=0;nQt&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=Qt)}moveCursor(e){const t=this.pos+e;if(e>1)for(let n=this.pos+1;n=144&&this.backSpace();const t=Jg(e);if(this.pos>=Qt){this.logger.log(0,()=>"Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1)}clearFromPos(e){let t;for(t=e;t"pacData = "+JSON.stringify(e));let t=e.row-1;if(this.nrRollUpRows&&t"bkgData = "+JSON.stringify(e)),this.backSpace(),this.setPen(e),this.insertChar(32)}setRollUpRows(e){this.nrRollUpRows=e}rollUp(){if(this.nrRollUpRows===null){this.logger.log(3,"roll_up but nrRollUpRows not set yet");return}this.logger.log(1,()=>this.getDisplayText());const e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),this.logger.log(2,"Rolling up")}getDisplayText(e){e=e||!1;const t=[];let n="",i=-1;for(let s=0;s0&&(e?n="["+t.join(" | ")+"]":n=t.join(` +`)),n}getTextAndFormat(){return this.rows}}class Jh{constructor(e,t,n){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new Al(n),this.nonDisplayedMemory=new Al(n),this.lastOutputScreen=new Al(n),this.currRollUpRow=this.displayedMemory.rows[bt-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=n}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[bt-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(e){this.outputFilter=e}setPAC(e){this.writeScreen.setPAC(e)}setBkgData(e){this.writeScreen.setBkgData(e)}setMode(e){e!==this.mode&&(this.mode=e,this.logger.log(2,()=>"MODE="+e),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)}insertChars(e){for(let n=0;nt+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(1,()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),this.mode!=="MODE_TEXT"&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(e){this.logger.log(2,"RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){const e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,()=>"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)}ccTO(e){this.logger.log(2,"TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)}ccMIDROW(e){const t={flash:!1};if(t.underline=e%2===1,t.italics=e>=46,t.italics)t.foreground="white";else{const n=Math.floor(e/2)-16,i=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=i[n]}this.logger.log(2,"MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)}outputDataUpdate(e=!1){const t=this.logger.time;t!==null&&this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=t:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t),this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}}class ep{constructor(e,t,n){this.channels=void 0,this.currentChannel=0,this.cmdHistory=cb(),this.logger=void 0;const i=this.logger=new ob;this.channels=[null,new Jh(e,t,i),new Jh(e+1,n,i)]}getHandler(e){return this.channels[e].getHandler()}setHandler(e,t){this.channels[e].setHandler(t)}addData(e,t){this.logger.time=e;for(let n=0;n"["+zr([t[n],t[n+1]])+"] -> ("+zr([i,s])+")");const a=this.cmdHistory;if(i>=16&&i<=31){if(ub(i,s,a)){Ws(null,null,a),this.logger.log(3,()=>"Repeated command ("+zr([i,s])+") is dropped");continue}Ws(i,s,this.cmdHistory),o=this.parseCmd(i,s),o||(o=this.parseMidrow(i,s)),o||(o=this.parsePAC(i,s)),o||(o=this.parseBackgroundAttributes(i,s))}else Ws(null,null,a);if(!o&&(l=this.parseChars(i,s),l)){const c=this.currentChannel;c&&c>0?this.channels[c].insertChars(l):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!o&&!l&&this.logger.log(2,()=>"Couldn't parse cleaned data "+zr([i,s])+" orig: "+zr([t[n],t[n+1]]))}}parseCmd(e,t){const n=(e===20||e===28||e===21||e===29)&&t>=32&&t<=47,i=(e===23||e===31)&&t>=33&&t<=35;if(!(n||i))return!1;const s=e===20||e===21||e===23?1:2,o=this.channels[s];return e===20||e===21||e===28||e===29?t===32?o.ccRCL():t===33?o.ccBS():t===34?o.ccAOF():t===35?o.ccAON():t===36?o.ccDER():t===37?o.ccRU(2):t===38?o.ccRU(3):t===39?o.ccRU(4):t===40?o.ccFON():t===41?o.ccRDC():t===42?o.ccTR():t===43?o.ccRTD():t===44?o.ccEDM():t===45?o.ccCR():t===46?o.ccENM():t===47&&o.ccEOC():o.ccTO(t-32),this.currentChannel=s,!0}parseMidrow(e,t){let n=0;if((e===17||e===25)&&t>=32&&t<=47){if(e===17?n=1:n=2,n!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const i=this.channels[n];return i?(i.ccMIDROW(t),this.logger.log(3,()=>"MIDROW ("+zr([e,t])+")"),!0):!1}return!1}parsePAC(e,t){let n;const i=(e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127,s=(e===16||e===24)&&t>=64&&t<=95;if(!(i||s))return!1;const o=e<=23?1:2;t>=64&&t<=95?n=o===1?tb[e]:nb[e]:n=o===1?rb[e]:ib[e];const l=this.channels[o];return l?(l.setPAC(this.interpretPAC(n,t)),this.currentChannel=o,!0):!1}interpretPAC(e,t){let n;const i={color:null,italics:!1,indent:null,underline:!1,row:e};return t>95?n=t-96:n=t-64,i.underline=(n&1)===1,n<=13?i.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(n/2)]:n<=15?(i.italics=!0,i.color="white"):i.indent=Math.floor((n-16)/2)*4,i}parseChars(e,t){let n,i=null,s=null;if(e>=25?(n=2,s=e-8):(n=1,s=e),s>=17&&s<=19){let o;s===17?o=t+80:s===18?o=t+112:o=t+144,this.logger.log(2,()=>"Special char '"+Jg(o)+"' in channel "+n),i=[o]}else e>=32&&e<=127&&(i=t===0?[e]:[e,t]);return i&&this.logger.log(3,()=>"Char codes = "+zr(i).join(",")),i}parseBackgroundAttributes(e,t){const n=(e===16||e===24)&&t>=32&&t<=47,i=(e===23||e===31)&&t>=45&&t<=47;if(!(n||i))return!1;let s;const o={};e===16||e===24?(s=Math.floor((t-32)/2),o.background=sb[s],t%2===1&&(o.background=o.background+"_semi")):t===45?o.background="transparent":(o.foreground="black",t===47&&(o.underline=!0));const l=e<=23?1:2;return this.channels[l].setBkgData(o),!0}reset(){for(let e=0;ee)&&(this.startTime=e),this.endTime=t,this.screen=n,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}var wf=function(){if(ni!=null&&ni.VTTCue)return self.VTTCue;const r=["","lr","rl"],e=["start","middle","end","left","right"];function t(l,a){if(typeof a!="string"||!Array.isArray(l))return!1;const u=a.toLowerCase();return~l.indexOf(u)?u:!1}function n(l){return t(r,l)}function i(l){return t(e,l)}function s(l,...a){let u=1;for(;u100)throw new Error("Position must be between 0 and 100.");b=L,this.hasBeenReset=!0}})),Object.defineProperty(c,"positionAlign",s({},f,{get:function(){return w},set:function(L){const C=i(L);if(!C)throw new SyntaxError("An invalid or illegal string was specified.");w=C,this.hasBeenReset=!0}})),Object.defineProperty(c,"size",s({},f,{get:function(){return A},set:function(L){if(L<0||L>100)throw new Error("Size must be between 0 and 100.");A=L,this.hasBeenReset=!0}})),Object.defineProperty(c,"align",s({},f,{get:function(){return R},set:function(L){const C=i(L);if(!C)throw new SyntaxError("An invalid or illegal string was specified.");R=C,this.hasBeenReset=!0}})),c.displayState=void 0}return o.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},o}();class fb{decode(e,t){if(!e)return"";if(typeof e!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function ty(r){function e(n,i,s,o){return(n|0)*3600+(i|0)*60+(s|0)+parseFloat(o||0)}const t=r.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return t?parseFloat(t[2])>59?e(t[2],t[3],0,t[4]):e(t[1],t[2],t[3],t[4]):null}class db{constructor(){this.values=Object.create(null)}set(e,t){!this.get(e)&&t!==""&&(this.values[e]=t)}get(e,t,n){return n?this.has(e)?this.values[e]:t[n]:this.has(e)?this.values[e]:t}has(e){return e in this.values}alt(e,t,n){for(let i=0;i=0&&n<=100)return this.set(e,n),!0}return!1}}function ry(r,e,t,n){const i=n?r.split(n):[r];for(const s in i){if(typeof i[s]!="string")continue;const o=i[s].split(t);if(o.length!==2)continue;const l=o[0],a=o[1];e(l,a)}}const Qu=new wf(0,0,""),qs=Qu.align==="middle"?"middle":"center";function hb(r,e,t){const n=r;function i(){const l=ty(r);if(l===null)throw new Error("Malformed timestamp: "+n);return r=r.replace(/^[^\sa-zA-Z-]+/,""),l}function s(l,a){const u=new db;ry(l,function(d,h){let p;switch(d){case"region":for(let m=t.length-1;m>=0;m--)if(t[m].id===h){u.set(d,t[m].region);break}break;case"vertical":u.alt(d,h,["rl","lr"]);break;case"line":p=h.split(","),u.integer(d,p[0]),u.percent(d,p[0])&&u.set("snapToLines",!1),u.alt(d,p[0],["auto"]),p.length===2&&u.alt("lineAlign",p[1],["start",qs,"end"]);break;case"position":p=h.split(","),u.percent(d,p[0]),p.length===2&&u.alt("positionAlign",p[1],["start",qs,"end","line-left","line-right","auto"]);break;case"size":u.percent(d,h);break;case"align":u.alt(d,h,["start",qs,"end","left","right"]);break}},/:/,/\s/),a.region=u.get("region",null),a.vertical=u.get("vertical","");let c=u.get("line","auto");c==="auto"&&Qu.line===-1&&(c=-1),a.line=c,a.lineAlign=u.get("lineAlign","start"),a.snapToLines=u.get("snapToLines",!0),a.size=u.get("size",100),a.align=u.get("align",qs);let f=u.get("position","auto");f==="auto"&&Qu.position===50&&(f=a.align==="start"||a.align==="left"?0:a.align==="end"||a.align==="right"?100:50),a.position=f}function o(){r=r.replace(/^\s+/,"")}if(o(),e.startTime=i(),o(),r.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+n);r=r.slice(3),o(),e.endTime=i(),o(),s(r,e)}function ny(r){return r.replace(//gi,` +`)}class pb{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new fb,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(e){const t=this;e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));function n(){let s=t.buffer,o=0;for(s=ny(s);o")===-1){t.cue.id=s;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{hb(s,t.cue,t.regionList)}catch{t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{const l=s.indexOf("-->")!==-1;if(!s||l&&(o=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(t.cue===null)continue;t.cue.text&&(t.cue.text+=` +`),t.cue.text+=s}continue;case"BADCUE":s||(t.state="ID")}}}catch{t.state==="CUETEXT"&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state=t.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this}flush(){const e=this;try{if((e.cue||e.state==="HEADER")&&(e.buffer+=` + +`,e.parse()),e.state==="INITIAL"||e.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(t){e.onparsingerror&&e.onparsingerror(t)}return e.onflush&&e.onflush(),this}}const mb=/\r\n|\n\r|\n|\r/g,Ll=function(e,t,n=0){return e.slice(n,n+t.length)===t},gb=function(e){let t=parseInt(e.slice(-3));const n=parseInt(e.slice(-6,-4)),i=parseInt(e.slice(-9,-7)),s=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!z(t)||!z(n)||!z(i)||!z(s))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*n,t+=60*1e3*i,t+=60*60*1e3*s,t},Rl=function(e){let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return(t>>>0).toString()};function bf(r,e,t){return Rl(r.toString())+Rl(e.toString())+Rl(t)}const yb=function(e,t,n){let i=e[t],s=e[i.prevCC];if(!s||!s.new&&i.new){e.ccOffset=e.presentationOffset=i.start,i.new=!1;return}for(;(o=s)!=null&&o.new;){var o;e.ccOffset+=i.start-s.start,i.new=!1,i=s,s=e[i.prevCC]}e.presentationOffset=n};function vb(r,e,t,n,i,s,o){const l=new pb,a=Kt(new Uint8Array(r)).trim().replace(mb,` +`).split(` +`),u=[],c=e?Fw(e.baseTime,e.timescale):0;let f="00:00.000",d=0,h=0,p,m=!0;l.oncue=function(y){const g=t[n];let v=t.ccOffset;const x=(d-c)/9e4;if(g!=null&&g.new&&(h!==void 0?v=t.ccOffset=g.start:yb(t,n,x)),x){if(!e){p=new Error("Missing initPTS for VTT MPEGTS");return}v=x-t.presentationOffset}const S=y.endTime-y.startTime,E=dt((y.startTime+v-h)*9e4,i*9e4)/9e4;y.startTime=Math.max(E,0),y.endTime=Math.max(E+S,0);const b=y.text.trim();y.text=decodeURIComponent(encodeURIComponent(b)),y.id||(y.id=bf(y.startTime,y.endTime,b)),y.endTime>0&&u.push(y)},l.onparsingerror=function(y){p=y},l.onflush=function(){if(p){o(p);return}s(u)},a.forEach(y=>{if(m)if(Ll(y,"X-TIMESTAMP-MAP=")){m=!1,y.slice(16).split(",").forEach(g=>{Ll(g,"LOCAL:")?f=g.slice(6):Ll(g,"MPEGTS:")&&(d=parseInt(g.slice(7)))});try{h=gb(f)/1e3}catch(g){p=g}return}else y===""&&(m=!1);l.parse(y+` +`)}),l.flush()}const Il="stpp.ttml.im1t",iy=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,sy=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,xb={left:"start",center:"center",right:"end",start:"start",end:"end"};function tp(r,e,t,n){const i=Q(new Uint8Array(r),["mdat"]);if(i.length===0){n(new Error("Could not parse IMSC1 mdat"));return}const s=i.map(l=>Kt(l)),o=Ow(e.baseTime,1,e.timescale);try{s.forEach(l=>t(Eb(l,o)))}catch(l){n(l)}}function Eb(r,e){const i=new DOMParser().parseFromString(r,"text/xml").getElementsByTagName("tt")[0];if(!i)throw new Error("Invalid ttml");const s={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},o=Object.keys(s).reduce((f,d)=>(f[d]=i.getAttribute(`ttp:${d}`)||s[d],f),{}),l=i.getAttribute("xml:space")!=="preserve",a=rp(kl(i,"styling","style")),u=rp(kl(i,"layout","region")),c=kl(i,"body","[begin]");return[].map.call(c,f=>{const d=oy(f,l);if(!d||!f.hasAttribute("begin"))return null;const h=Dl(f.getAttribute("begin"),o),p=Dl(f.getAttribute("dur"),o);let m=Dl(f.getAttribute("end"),o);if(h===null)throw np(f);if(m===null){if(p===null)throw np(f);m=h+p}const y=new wf(h-e,m-e,d);y.id=bf(y.startTime,y.endTime,y.text);const g=u[f.getAttribute("region")],v=a[f.getAttribute("style")],x=Sb(g,v,a),{textAlign:S}=x;if(S){const E=xb[S];E&&(y.lineAlign=E),y.align=S}return Re(y,x),y}).filter(f=>f!==null)}function kl(r,e,t){const n=r.getElementsByTagName(e)[0];return n?[].slice.call(n.querySelectorAll(t)):[]}function rp(r){return r.reduce((e,t)=>{const n=t.getAttribute("xml:id");return n&&(e[n]=t),e},{})}function oy(r,e){return[].slice.call(r.childNodes).reduce((t,n,i)=>{var s;return n.nodeName==="br"&&i?t+` +`:(s=n.childNodes)!=null&&s.length?oy(n,e):e?t+n.textContent.trim().replace(/\s+/g," "):t+n.textContent},"")}function Sb(r,e,t){const n="http://www.w3.org/ns/ttml#styling";let i=null;const s=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],o=r!=null&&r.hasAttribute("style")?r.getAttribute("style"):null;return o&&t.hasOwnProperty(o)&&(i=t[o]),s.reduce((l,a)=>{const u=Cl(e,n,a)||Cl(r,n,a)||Cl(i,n,a);return u&&(l[a]=u),l},{})}function Cl(r,e,t){return r&&r.hasAttributeNS(e,t)?r.getAttributeNS(e,t):null}function np(r){return new Error(`Could not parse ttml timestamp ${r}`)}function Dl(r,e){if(!r)return null;let t=ty(r);return t===null&&(iy.test(r)?t=Tb(r,e):sy.test(r)&&(t=wb(r,e))),t}function Tb(r,e){const t=iy.exec(r),n=(t[4]|0)+(t[5]|0)/e.subFrameRate;return(t[1]|0)*3600+(t[2]|0)*60+(t[3]|0)+n/e.frameRate}function wb(r,e){const t=sy.exec(r),n=Number(t[1]);switch(t[2]){case"h":return n*3600;case"m":return n*60;case"ms":return n*1e3;case"f":return n/e.frameRate;case"t":return n/e.tickRate}return n}class bb{constructor(e){this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=sp(),this.captionsProperties=void 0,this.hls=e,this.config=e.config,this.Cues=e.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},e.on(T.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(T.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(T.MANIFEST_LOADING,this.onManifestLoading,this),e.on(T.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(T.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(T.FRAG_LOADING,this.onFragLoading,this),e.on(T.FRAG_LOADED,this.onFragLoaded,this),e.on(T.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(T.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(T.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(T.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(T.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(T.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(T.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(T.MANIFEST_LOADING,this.onManifestLoading,this),e.off(T.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(T.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(T.FRAG_LOADING,this.onFragLoading,this),e.off(T.FRAG_LOADED,this.onFragLoaded,this),e.off(T.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(T.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(T.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(T.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(T.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){if(this.config.enableCEA708Captions&&(!this.cea608Parser1||!this.cea608Parser2)){const e=new Ys(this,"textTrack1"),t=new Ys(this,"textTrack2"),n=new Ys(this,"textTrack3"),i=new Ys(this,"textTrack4");this.cea608Parser1=new ep(1,e,t),this.cea608Parser2=new ep(3,n,i)}}addCues(e,t,n,i,s){let o=!1;for(let l=s.length;l--;){const a=s[l],u=Ab(a[0],a[1],t,n);if(u>=0&&(a[0]=Math.min(a[0],t),a[1]=Math.max(a[1],n),o=!0,u/(n-t)>.5))return}if(o||s.push([t,n]),this.config.renderTextTracksNatively){const l=this.captionsTracks[e];this.Cues.newCue(l,t,n,i)}else{const l=this.Cues.newCue(null,t,n,i);this.hls.trigger(T.CUES_PARSED,{type:"captions",cues:l,track:e})}}onInitPtsFound(e,{frag:t,id:n,initPTS:i,timescale:s}){const{unparsedVttFrags:o}=this;n==="main"&&(this.initPTS[t.cc]={baseTime:i,timescale:s}),o.length&&(this.unparsedVttFrags=[],o.forEach(l=>{this.onFragLoaded(T.FRAG_LOADED,l)}))}getExistingTrack(e,t){const{media:n}=this;if(n)for(let i=0;i{Nn(e[t]),delete e[t]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=sp(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){const{media:e}=this;if(!e)return;const t=e.textTracks;if(t)for(let n=0;ns.textCodec===Il);if(this.config.enableWebVTT||i&&this.config.enableIMSC1){if(Qg(this.tracks,n)){this.tracks=n;return}if(this.textTracks=[],this.tracks=n,this.config.renderTextTracksNatively){const o=this.media,l=o?ho(o.textTracks):null;if(this.tracks.forEach((a,u)=>{let c;if(l){let f=null;for(let d=0;du!==null).map(u=>u.label);a.length&&I.warn(`Media element contains unused subtitle tracks: ${a.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const o=this.tracks.map(l=>({label:l.name,kind:l.type.toLowerCase(),default:l.default,subtitleTrack:l}));this.hls.trigger(T.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:o})}}}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach(n=>{const i=/(?:CC|SERVICE)([1-4])/.exec(n.instreamId);if(!i)return;const s=`textTrack${i[1]}`,o=this.captionsProperties[s];o&&(o.label=n.name,n.lang&&(o.languageCode=n.lang),o.media=n)})}closedCaptionsForLevel(e){const t=this.hls.levels[e.level];return t==null?void 0:t.attrs["CLOSED-CAPTIONS"]}onFragLoading(e,t){if(this.enabled&&t.frag.type===q.MAIN){var n,i;const{cea608Parser1:s,cea608Parser2:o,lastSn:l}=this,{cc:a,sn:u}=t.frag,c=(n=(i=t.part)==null?void 0:i.index)!=null?n:-1;s&&o&&(u!==l+1||u===l&&c!==this.lastPartIndex+1||a!==this.lastCc)&&(s.reset(),o.reset()),this.lastCc=a,this.lastSn=u,this.lastPartIndex=c}}onFragLoaded(e,t){const{frag:n,payload:i}=t;if(n.type===q.SUBTITLE)if(i.byteLength){const s=n.decryptdata,o="stats"in t;if(s==null||!s.encrypted||o){const l=this.tracks[n.level],a=this.vttCCs;a[n.cc]||(a[n.cc]={start:n.start,prevCC:this.prevCC,new:!0},this.prevCC=n.cc),l&&l.textCodec===Il?this._parseIMSC1(n,i):this._parseVTTs(t)}}else this.hls.trigger(T.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const n=this.hls;tp(t,this.initPTS[e.cc],i=>{this._appendCues(i,e.level),n.trigger(T.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},i=>{I.log(`Failed to parse IMSC1: ${i}`),n.trigger(T.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:i})})}_parseVTTs(e){var t;const{frag:n,payload:i}=e,{initPTS:s,unparsedVttFrags:o}=this,l=s.length-1;if(!s[n.cc]&&l===-1){o.push(e);return}const a=this.hls,u=(t=n.initSegment)!=null&&t.data?Et(n.initSegment.data,new Uint8Array(i)):i;vb(u,this.initPTS[n.cc],this.vttCCs,n.cc,n.start,c=>{this._appendCues(c,n.level),a.trigger(T.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})},c=>{const f=c.message==="Missing initPTS for VTT MPEGTS";f?o.push(e):this._fallbackToIMSC1(n,i),I.log(`Failed to parse VTT cue: ${c}`),!(f&&l>n.cc)&&a.trigger(T.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:c})})}_fallbackToIMSC1(e,t){const n=this.tracks[e.level];n.textCodec||tp(t,this.initPTS[e.cc],()=>{n.textCodec=Il,this._parseIMSC1(e,t)},()=>{n.textCodec="wvtt"})}_appendCues(e,t){const n=this.hls;if(this.config.renderTextTracksNatively){const i=this.textTracks[t];if(!i||i.mode==="disabled")return;e.forEach(s=>Rg(i,s))}else{const i=this.tracks[t];if(!i)return;const s=i.default?"default":"subtitles"+t;n.trigger(T.CUES_PARSED,{type:"subtitles",cues:e,track:s})}}onFragDecrypted(e,t){const{frag:n}=t;n.type===q.SUBTITLE&&this.onFragLoaded(T.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){this.initCea608Parsers();const{cea608Parser1:n,cea608Parser2:i}=this;if(!this.enabled||!n||!i)return;const{frag:s,samples:o}=t;if(!(s.type===q.MAIN&&this.closedCaptionsForLevel(s)==="NONE"))for(let l=0;lVu(l[a],t,n))}if(this.config.renderTextTracksNatively&&t===0&&i!==void 0){const{textTracks:l}=this;Object.keys(l).forEach(a=>Vu(l[a],t,i))}}}extractCea608Data(e){const t=[[],[]],n=e[0]&31;let i=2;for(let s=0;sthis.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}getMaxLevel(e){const t=this.hls.levels;if(!t.length)return-1;const n=t.filter((i,s)=>this.isLevelAllowed(i)&&s<=e);return this.clientRect=null,Af.getMaxLevelByMediaSize(n,this.mediaWidth,this.mediaHeight)}startCapping(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}stopCapping(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)}getDimensions(){if(this.clientRect)return this.clientRect;const e=this.media,t={width:0,height:0};if(e){const n=e.getBoundingClientRect();t.width=n.width,t.height=n.height,!t.width&&!t.height&&(t.width=n.right-n.left||e.width||0,t.height=n.bottom-n.top||e.height||0)}return this.clientRect=t,t}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let e=1;if(!this.hls.config.ignoreDevicePixelRatio)try{e=self.devicePixelRatio}catch{}return e}isLevelAllowed(e){return!this.restrictedLevels.some(n=>e.bitrate===n.bitrate&&e.width===n.width&&e.height===n.height)}static getMaxLevelByMediaSize(e,t,n){if(!(e!=null&&e.length))return-1;const i=(l,a)=>a?l.width!==a.width||l.height!==a.height:!0;let s=e.length-1;const o=Math.max(t,n);for(let l=0;l=o||a.height>=o)&&i(a,e[l+1])){s=l;break}}return s}}class Lb{constructor(e){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=e,this.registerListeners()}setStreamController(e){this.streamController=e}registerListeners(){this.hls.on(T.MEDIA_ATTACHING,this.onMediaAttaching,this)}unregisterListeners(){this.hls.off(T.MEDIA_ATTACHING,this.onMediaAttaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,t){const n=this.hls.config;if(n.capLevelOnFPSDrop){const i=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=i,i&&typeof i.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),n.fpsDroppedMonitoringPeriod)}}checkFPS(e,t,n){const i=performance.now();if(t){if(this.lastTime){const s=i-this.lastTime,o=n-this.lastDroppedFrames,l=t-this.lastDecodedFrames,a=1e3*o/s,u=this.hls;if(u.trigger(T.FPS_DROP,{currentDropped:o,currentDecoded:l,totalDroppedFrames:n}),a>0&&o>u.config.fpsDroppedMonitoringThreshold*l){let c=u.currentLevel;I.warn("drop FPS ratio greater than max allowed value for currentLevel: "+c),c>0&&(u.autoLevelCapping===-1||u.autoLevelCapping>=c)&&(c=c-1,u.trigger(T.FPS_DROP_LEVEL_CAPPING,{level:c,droppedLevel:u.currentLevel}),u.autoLevelCapping=c,this.streamController.nextLevelSwitch())}}this.lastTime=i,this.lastDroppedFrames=n,this.lastDecodedFrames=t}}checkFPSInterval(){const e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){const t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}}const Xs="[eme]";class Kn{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.setMediaKeysQueue=Kn.CDMCleanupPromise?[Kn.CDMCleanupPromise]:[],this.onMediaEncrypted=this._onMediaEncrypted.bind(this),this.onWaitingForKey=this._onWaitingForKey.bind(this),this.debug=I.debug.bind(I,Xs),this.log=I.log.bind(I,Xs),this.warn=I.warn.bind(I,Xs),this.error=I.error.bind(I,Xs),this.hls=e,this.config=e.config,this.registerListeners()}destroy(){this.unregisterListeners(),this.onMediaDetached();const e=this.config;e.requestMediaKeySystemAccessFunc=null,e.licenseXhrSetup=e.licenseResponseCallback=void 0,e.drmSystems=e.drmSystemOptions={},this.hls=this.onMediaEncrypted=this.onWaitingForKey=this.keyIdToKeySessionPromise=null,this.config=null}registerListeners(){this.hls.on(T.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(T.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(T.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(T.MANIFEST_LOADED,this.onManifestLoaded,this)}unregisterListeners(){this.hls.off(T.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(T.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(T.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(T.MANIFEST_LOADED,this.onManifestLoaded,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:n}=this.config,i=t[e];if(i)return i.licenseUrl;if(e===de.WIDEVINE&&n)return n;throw new Error(`no license server URL configured for key-system "${e}"`)}getServerCertificateUrl(e){const{drmSystems:t}=this.config,n=t[e];if(n)return n.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const t=this.hls.levels,n=(o,l,a)=>!!o&&a.indexOf(o)===l,i=t.map(o=>o.audioCodec).filter(n),s=t.map(o=>o.videoCodec).filter(n);return i.length+s.length===0&&s.push("avc1.42e01e"),new Promise((o,l)=>{const a=u=>{const c=u.shift();this.getMediaKeysPromise(c,i,s).then(f=>o({keySystem:c,mediaKeys:f})).catch(f=>{u.length?a(u):f instanceof ft?l(f):l(new ft({type:X.KEY_SYSTEM_ERROR,details:P.KEY_SYSTEM_NO_ACCESS,error:f,fatal:!0},f.message))})};a(e)})}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:n}=this.config;if(typeof n!="function"){let i=`Configured requestMediaKeySystemAccess is not a function ${n}`;return hg===null&&self.location.protocol==="http:"&&(i=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(i))}return n(e,t)}getMediaKeysPromise(e,t,n){const i=_S(e,t,n,this.config.drmSystemOptions),s=this.keySystemAccessPromises[e];let o=s==null?void 0:s.keySystemAccess;if(!o){this.log(`Requesting encrypted media "${e}" key-system access with config: ${JSON.stringify(i)}`),o=this.requestMediaKeySystemAccess(e,i);const l=this.keySystemAccessPromises[e]={keySystemAccess:o};return o.catch(a=>{this.log(`Failed to obtain access to key-system "${e}": ${a}`)}),o.then(a=>{this.log(`Access for key-system "${a.keySystem}" obtained`);const u=this.fetchServerCertificate(e);return this.log(`Create media-keys for "${e}"`),l.mediaKeys=a.createMediaKeys().then(c=>(this.log(`Media-keys created for "${e}"`),u.then(f=>f?this.setMediaKeysServerCertificate(c,e,f):c))),l.mediaKeys.catch(c=>{this.error(`Failed to create media-keys for "${e}"}: ${c}`)}),l.mediaKeys})}return o.then(()=>s.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:n}){this.log(`Creating key-system session "${t}" keyId: ${Mt.hexDump(e.keyId||[])}`);const i=n.createSession(),s={decryptdata:e,keySystem:t,mediaKeys:n,mediaKeysSession:i,keyStatus:"status-pending"};return this.mediaKeySessions.push(s),s}renewKeySession(e){const t=e.decryptdata;if(t.pssh){const n=this.createMediaKeySessionContext(e),i=this.getKeyIdString(t),s="cenc";this.keyIdToKeySessionPromise[i]=this.generateRequestWithPreferredKeySession(n,s,t.pssh,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(e)}getKeyIdString(e){if(!e)throw new Error("Could not read keyId of undefined decryptdata");if(e.keyId===null)throw new Error("keyId is null");return Mt.hexDump(e.keyId)}updateKeySession(e,t){var n;const i=e.mediaKeysSession;return this.log(`Updating key-session "${i.sessionId}" for keyID ${Mt.hexDump(((n=e.decryptdata)==null?void 0:n.keyId)||[])} + } (data length: ${t&&t.byteLength})`),i.update(t)}selectKeySystemFormat(e){const t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise}getKeyFormatPromise(e){return new Promise((t,n)=>{const i=hl(this.config),s=e.map(fh).filter(o=>!!o&&i.indexOf(o)!==-1);return this.getKeySystemSelectionPromise(s).then(({keySystem:o})=>{const l=hh(o);l?t(l):n(new Error(`Unable to find format for key-system "${o}"`))}).catch(n)})}loadKey(e){const t=e.keyInfo.decryptdata,n=this.getKeyIdString(t),i=`(keyId: ${n} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${i}`);let s=this.keyIdToKeySessionPromise[n];return s||(s=this.keyIdToKeySessionPromise[n]=this.getKeySystemForKeyPromise(t).then(({keySystem:o,mediaKeys:l})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${i}`),this.attemptSetMediaKeys(o,l).then(()=>{this.throwIfDestroyed();const a=this.createMediaKeySessionContext({keySystem:o,mediaKeys:l,decryptdata:t});return this.generateRequestWithPreferredKeySession(a,"cenc",t.pssh,"playlist-key")}))),s.catch(o=>this.handleError(o))),s}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e){this.hls&&(this.error(e.message),e instanceof ft?this.hls.trigger(T.ERROR,e.data):this.hls.trigger(T.ERROR,{type:X.KEY_SYSTEM_ERROR,details:P.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}getKeySystemForKeyPromise(e){const t=this.getKeyIdString(e),n=this.keyIdToKeySessionPromise[t];if(!n){const i=fh(e.keyFormat),s=i?[i]:hl(this.config);return this.attemptKeySystemAccess(s)}return n}getKeySystemSelectionPromise(e){if(e.length||(e=hl(this.config)),e.length===0)throw new ft({type:X.KEY_SYSTEM_ERROR,details:P.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${JSON.stringify({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}_onMediaEncrypted(e){const{initDataType:t,initData:n}=e,i=`"${e.type}" event: init data type: "${t}"`;if(this.debug(i),n===null)return;let s,o;if(t==="sinf"&&this.config.drmSystems[de.FAIRPLAY]){const f=Ie(new Uint8Array(n));try{const d=cf(JSON.parse(f).sinf),h=Sg(new Uint8Array(d));if(!h)throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");s=h.subarray(8,24),o=de.FAIRPLAY}catch(d){this.warn(`${i} Failed to parse sinf: ${d}`);return}}else{const f=nT(n),d=f.filter(h=>h.systemId===Oi.WIDEVINE)[0];if(!d){f.length===0||f.some(h=>!h.systemId)?this.warn(`${i} contains incomplete or invalid pssh data`):this.log(`ignoring ${i} for ${f.map(h=>dh(h.systemId)).join(",")} pssh data in favor of playlist keys`);return}if(o=dh(d.systemId),d.version===0&&d.data){const h=d.data.length-22;s=d.data.subarray(h,h+16)}}if(!o||!s)return;const l=Mt.hexDump(s),{keyIdToKeySessionPromise:a,mediaKeySessions:u}=this;let c=a[l];for(let f=0;fthis.generateRequestWithPreferredKeySession(d,t,n,"encrypted-event-key-match"));break}}c||(c=a[l]=this.getKeySystemSelectionPromise([o]).then(({keySystem:f,mediaKeys:d})=>{var h;this.throwIfDestroyed();const p=new hs("ISO-23001-7",l,(h=hh(f))!=null?h:"");return p.pssh=new Uint8Array(n),p.keyId=s,this.attemptSetMediaKeys(f,d).then(()=>{this.throwIfDestroyed();const m=this.createMediaKeySessionContext({decryptdata:p,keySystem:f,mediaKeys:d});return this.generateRequestWithPreferredKeySession(m,t,n,"encrypted-event-no-match")})})),c.catch(f=>this.handleError(f))}_onWaitingForKey(e){this.log(`"${e.type}" event`)}attemptSetMediaKeys(e,t){const n=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const i=Promise.all(n).then(()=>{if(!this.media)throw new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(t)});return this.setMediaKeysQueue.push(i),i.then(()=>{this.log(`Media-keys set for "${e}"`),n.push(i),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(s=>n.indexOf(s)===-1)})}generateRequestWithPreferredKeySession(e,t,n,i){var s,o;const l=(s=this.config.drmSystems)==null||(o=s[e.keySystem])==null?void 0:o.generateRequest;if(l)try{const p=l.call(this.hls,t,n,e);if(!p)throw new Error("Invalid response from configured generateRequest filter");t=p.initDataType,n=e.decryptdata.pssh=p.initData?new Uint8Array(p.initData):null}catch(p){var a;if(this.warn(p.message),(a=this.hls)!=null&&a.config.debug)throw p}if(n===null)return this.log(`Skipping key-session request for "${i}" (no initData)`),Promise.resolve(e);const u=this.getKeyIdString(e.decryptdata);this.log(`Generating key-session request for "${i}": ${u} (init data type: ${t} length: ${n?n.byteLength:null})`);const c=new Tf,f=e._onmessage=p=>{const m=e.mediaKeysSession;if(!m){c.emit("error",new Error("invalid state"));return}const{messageType:y,message:g}=p;this.log(`"${y}" message event for session "${m.sessionId}" message size: ${g.byteLength}`),y==="license-request"||y==="license-renewal"?this.renewLicense(e,g).catch(v=>{this.handleError(v),c.emit("error",v)}):y==="license-release"?e.keySystem===de.FAIRPLAY&&(this.updateKeySession(e,Hu("acknowledged")),this.removeSession(e)):this.warn(`unhandled media key message type "${y}"`)},d=e._onkeystatuseschange=p=>{if(!e.mediaKeysSession){c.emit("error",new Error("invalid state"));return}this.onKeyStatusChange(e);const y=e.keyStatus;c.emit("keyStatus",y),y==="expired"&&(this.warn(`${e.keySystem} expired for key ${u}`),this.renewKeySession(e))};e.mediaKeysSession.addEventListener("message",f),e.mediaKeysSession.addEventListener("keystatuseschange",d);const h=new Promise((p,m)=>{c.on("error",m),c.on("keyStatus",y=>{y.startsWith("usable")?p():y==="output-restricted"?m(new ft({type:X.KEY_SYSTEM_ERROR,details:P.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):y==="internal-error"?m(new ft({type:X.KEY_SYSTEM_ERROR,details:P.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${y}"`)):y==="expired"?m(new Error("key expired while generating request")):this.warn(`unhandled key status change "${y}"`)})});return e.mediaKeysSession.generateRequest(t,n).then(()=>{var p;this.log(`Request generated for key-session "${(p=e.mediaKeysSession)==null?void 0:p.sessionId}" keyId: ${u}`)}).catch(p=>{throw new ft({type:X.KEY_SYSTEM_ERROR,details:P.KEY_SYSTEM_NO_SESSION,error:p,fatal:!1},`Error generating key-session request: ${p}`)}).then(()=>h).catch(p=>{throw c.removeAllListeners(),this.removeSession(e),p}).then(()=>(c.removeAllListeners(),e))}onKeyStatusChange(e){e.mediaKeysSession.keyStatuses.forEach((t,n)=>{this.log(`key status change "${t}" for keyStatuses keyId: ${Mt.hexDump("buffer"in n?new Uint8Array(n.buffer,n.byteOffset,n.byteLength):new Uint8Array(n))} session keyId: ${Mt.hexDump(new Uint8Array(e.decryptdata.keyId||[]))} uri: ${e.decryptdata.uri}`),e.keyStatus=t})}fetchServerCertificate(e){const t=this.config,n=t.loader,i=new n(t),s=this.getServerCertificateUrl(e);return s?(this.log(`Fetching server certificate for "${e}"`),new Promise((o,l)=>{const a={responseType:"arraybuffer",url:s},u=t.certLoadPolicy.default,c={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},f={onSuccess:(d,h,p,m)=>{o(d.data)},onError:(d,h,p,m)=>{l(new ft({type:X.KEY_SYSTEM_ERROR,details:P.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:p,response:Fe({url:a.url,data:void 0},d)},`"${e}" certificate request failed (${s}). Status: ${d.code} (${d.text})`))},onTimeout:(d,h,p)=>{l(new ft({type:X.KEY_SYSTEM_ERROR,details:P.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:p,response:{url:a.url,data:void 0}},`"${e}" certificate request timed out (${s})`))},onAbort:(d,h,p)=>{l(new Error("aborted"))}};i.load(a,c,f)})):Promise.resolve()}setMediaKeysServerCertificate(e,t,n){return new Promise((i,s)=>{e.setServerCertificate(n).then(o=>{this.log(`setServerCertificate ${o?"success":"not supported by CDM"} (${n==null?void 0:n.byteLength}) on "${t}"`),i(e)}).catch(o=>{s(new ft({type:X.KEY_SYSTEM_ERROR,details:P.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:o,fatal:!0},o.message))})})}renewLicense(e,t){return this.requestLicense(e,new Uint8Array(t)).then(n=>this.updateKeySession(e,new Uint8Array(n)).catch(i=>{throw new ft({type:X.KEY_SYSTEM_ERROR,details:P.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:i,fatal:!0},i.message)}))}unpackPlayReadyKeyMessage(e,t){const n=String.fromCharCode.apply(null,new Uint16Array(t.buffer));if(!n.includes("PlayReadyKeyMessage"))return e.setRequestHeader("Content-Type","text/xml; charset=utf-8"),t;const i=new DOMParser().parseFromString(n,"application/xml"),s=i.querySelectorAll("HttpHeader");if(s.length>0){let c;for(let f=0,d=s.length;f in key message");return Hu(atob(u))}setupLicenseXHR(e,t,n,i){const s=this.config.licenseXhrSetup;return s?Promise.resolve().then(()=>{if(!n.decryptdata)throw new Error("Key removed");return s.call(this.hls,e,t,n,i)}).catch(o=>{if(!n.decryptdata)throw o;return e.open("POST",t,!0),s.call(this.hls,e,t,n,i)}).then(o=>(e.readyState||e.open("POST",t,!0),{xhr:e,licenseChallenge:o||i})):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:i}))}requestLicense(e,t){const n=this.config.keyLoadPolicy.default;return new Promise((i,s)=>{const o=this.getLicenseServerUrl(e.keySystem);this.log(`Sending license request to URL: ${o}`);const l=new XMLHttpRequest;l.responseType="arraybuffer",l.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return s(new Error("invalid state"));if(l.readyState===4)if(l.status===200){this._requestLicenseFailureCount=0;let a=l.response;this.log(`License received ${a instanceof ArrayBuffer?a.byteLength:a}`);const u=this.config.licenseResponseCallback;if(u)try{a=u.call(this.hls,l,o,e)}catch(c){this.error(c)}i(a)}else{const a=n.errorRetry,u=a?a.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>u||l.status>=400&&l.status<500)s(new ft({type:X.KEY_SYSTEM_ERROR,details:P.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:l,response:{url:o,data:void 0,code:l.status,text:l.statusText}},`License Request XHR failed (${o}). Status: ${l.status} (${l.statusText})`));else{const c=u-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${c} attempts left`),this.requestLicense(e,t).then(i,s)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=l,this.setupLicenseXHR(l,o,e,t).then(({xhr:a,licenseChallenge:u})=>{e.keySystem==de.PLAYREADY&&(u=this.unpackPlayReadyKeyMessage(a,u)),a.send(u)})})}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const n=t.media;this.media=n,n.addEventListener("encrypted",this.onMediaEncrypted),n.addEventListener("waitingforkey",this.onWaitingForKey)}onMediaDetached(){const e=this.media,t=this.mediaKeySessions;e&&(e.removeEventListener("encrypted",this.onMediaEncrypted),e.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null),this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},hs.clearKeyUriToKeyIdMap();const n=t.length;Kn.CDMCleanupPromise=Promise.all(t.map(i=>this.removeSession(i)).concat(e==null?void 0:e.setMediaKeys(null).catch(i=>{this.log(`Could not clear media keys: ${i}`)}))).then(()=>{n&&(this.log("finished closing key sessions and clearing media keys"),t.length=0)}).catch(i=>{this.log(`Could not close sessions and clear media keys: ${i}`)})}onManifestLoading(){this.keyFormatPromise=null}onManifestLoaded(e,{sessionKeys:t}){if(!(!t||!this.config.emeEnabled)&&!this.keyFormatPromise){const n=t.reduce((i,s)=>(i.indexOf(s.keyFormat)===-1&&i.push(s.keyFormat),i),[]);this.log(`Selecting key-system from session-keys ${n.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(n)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:n}=e;if(t){this.log(`Remove licenses and keys and close session ${t.sessionId}`),e._onmessage&&(t.removeEventListener("message",e._onmessage),e._onmessage=void 0),e._onkeystatuseschange&&(t.removeEventListener("keystatuseschange",e._onkeystatuseschange),e._onkeystatuseschange=void 0),n&&n.readyState!==XMLHttpRequest.DONE&&n.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const i=this.mediaKeySessions.indexOf(e);return i>-1&&this.mediaKeySessions.splice(i,1),t.remove().catch(s=>{this.log(`Could not remove session: ${s}`)}).then(()=>t.close()).catch(s=>{this.log(`Could not close session: ${s}`)})}}}Kn.CDMCleanupPromise=void 0;class ft extends Error{constructor(e,t){super(t),this.data=void 0,e.error||(e.error=new Error(t)),this.data=e,e.err=e.error}}var Ge;(function(r){r.MANIFEST="m",r.AUDIO="a",r.VIDEO="v",r.MUXED="av",r.INIT="i",r.CAPTION="c",r.TIMED_TEXT="tt",r.KEY="k",r.OTHER="o"})(Ge||(Ge={}));var Ju;(function(r){r.DASH="d",r.HLS="h",r.SMOOTH="s",r.OTHER="o"})(Ju||(Ju={}));var Qr;(function(r){r.OBJECT="CMCD-Object",r.REQUEST="CMCD-Request",r.SESSION="CMCD-Session",r.STATUS="CMCD-Status"})(Qr||(Qr={}));const Rb={[Qr.OBJECT]:["br","d","ot","tb"],[Qr.REQUEST]:["bl","dl","mtp","nor","nrr","su"],[Qr.SESSION]:["cid","pr","sf","sid","st","v"],[Qr.STATUS]:["bs","rtp"]};class oi{constructor(e,t){this.value=void 0,this.params=void 0,Array.isArray(e)&&(e=e.map(n=>n instanceof oi?n:new oi(n))),this.value=e,this.params=t}}class ly{constructor(e){this.description=void 0,this.description=e}}const Ib="Dict";function kb(r){return Array.isArray(r)?JSON.stringify(r):r instanceof Map?"Map{}":r instanceof Set?"Set{}":typeof r=="object"?JSON.stringify(r):String(r)}function Cb(r,e,t,n){return new Error(`failed to ${r} "${kb(e)}" as ${t}`,{cause:n})}const op="Bare Item",Db="Boolean",_b="Byte Sequence",Pb="Decimal",Ob="Integer";function Fb(r){return r<-999999999999999||99999999999999912)throw Yt(r,Pb);const t=e.toString();return t.includes(".")?t:`${t}.0`}const zb="String";function Vb(r){if(Mb.test(r))throw Yt(r,zb);return`"${r.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Kb(r){return r.description||r.toString().slice(7,-1)}function ap(r){const e=Kb(r);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e)===!1)throw Yt(e,Nb);return e}function ec(r){switch(typeof r){case"number":if(!z(r))throw Yt(r,op);return Number.isInteger(r)?uy(r):Hb(r);case"string":return Vb(r);case"symbol":return ap(r);case"boolean":return Ub(r);case"object":if(r instanceof Date)return Gb(r);if(r instanceof Uint8Array)return jb(r);if(r instanceof ly)return ap(r);default:throw Yt(r,op)}}function tc(r){if(/^[a-z*][a-z0-9\-_.*]*$/.test(r)===!1)throw Yt(r,Bb);return r}function Lf(r){return r==null?"":Object.entries(r).map(([e,t])=>t===!0?`;${tc(e)}`:`;${tc(e)}=${ec(t)}`).join("")}function fy(r){return r instanceof oi?`${ec(r.value)}${Lf(r.params)}`:ec(r)}function Wb(r){return`(${r.value.map(fy).join(" ")})${Lf(r.params)}`}function Yb(r,e={whitespace:!0}){if(typeof r!="object")throw Yt(r,Ib);const t=r instanceof Map?r.entries():Object.entries(r),n=e!=null&&e.whitespace?" ":"";return Array.from(t).map(([i,s])=>{s instanceof oi||(s=new oi(s));let o=tc(i);return s.value===!0?o+=Lf(s.params):(o+="=",Array.isArray(s.value)?o+=Wb(s):o+=fy(s)),o}).join(`,${n}`)}function qb(r,e){return Yb(r,e)}const Xb=r=>r==="ot"||r==="sf"||r==="st",Zb=r=>typeof r=="number"?z(r):r!=null&&r!==""&&r!==!1;function Qb(r,e){const t=new URL(r),n=new URL(e);if(t.origin!==n.origin)return r;const i=t.pathname.split("/").slice(1),s=n.pathname.split("/").slice(1,-1);for(;i[0]===s[0];)i.shift(),s.shift();for(;s.length;)s.shift(),i.unshift("..");return i.join("/")}function Jb(){try{return crypto.randomUUID()}catch{try{const e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.slice(t.lastIndexOf("/")+1)}catch{let t=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,i=>{const s=(t+Math.random()*16)%16|0;return t=Math.floor(t/16),(i=="x"?s:s&3|8).toString(16)})}}}const xo=r=>Math.round(r),eA=(r,e)=>(e!=null&&e.baseUrl&&(r=Qb(r,e.baseUrl)),encodeURIComponent(r)),Zs=r=>xo(r/100)*100,tA={br:xo,d:xo,bl:Zs,dl:Zs,mtp:Zs,nor:eA,rtp:Zs,tb:xo};function rA(r,e){const t={};if(r==null||typeof r!="object")return t;const n=Object.keys(r).sort(),i=Re({},tA,e==null?void 0:e.formatters),s=e==null?void 0:e.filter;return n.forEach(o=>{if(s!=null&&s(o))return;let l=r[o];const a=i[o];a&&(l=a(l,e)),!(o==="v"&&l===1)&&(o=="pr"&&l===1||Zb(l)&&(Xb(o)&&typeof l=="string"&&(l=new ly(l)),t[o]=l))}),t}function dy(r,e={}){return r?qb(rA(r,e),Re({whitespace:!1},e)):""}function nA(r,e={}){if(!r)return{};const t=Object.entries(r),n=Object.entries(Rb).concat(Object.entries((e==null?void 0:e.customHeaderMap)||{})),i=t.reduce((s,o)=>{var l,a;const[u,c]=o,f=((l=n.find(d=>d[1].includes(u)))==null?void 0:l[0])||Qr.REQUEST;return(a=s[f])!=null||(s[f]={}),s[f][u]=c,s},{});return Object.entries(i).reduce((s,[o,l])=>(s[o]=dy(l,e),s),{})}function iA(r,e,t){return Re(r,nA(e,t))}const sA="CMCD";function oA(r,e={}){if(!r)return"";const t=dy(r,e);return`${sA}=${encodeURIComponent(t)}`}const lp=/CMCD=[^&#]+/;function aA(r,e,t){const n=oA(e,t);if(!n)return r;if(lp.test(r))return r.replace(lp,n);const i=r.includes("?")?"&":"?";return`${r}${i}${n}`}class lA{constructor(e){this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.includeKeys=void 0,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=()=>{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1},this.applyPlaylistData=i=>{try{this.apply(i,{ot:Ge.MANIFEST,su:!this.initialized})}catch(s){I.warn("Could not generate manifest CMCD data.",s)}},this.applyFragmentData=i=>{try{const s=i.frag,o=this.hls.levels[s.level],l=this.getObjectType(s),a={d:s.duration*1e3,ot:l};(l===Ge.VIDEO||l===Ge.AUDIO||l==Ge.MUXED)&&(a.br=o.bitrate/1e3,a.tb=this.getTopBandwidth(l)/1e3,a.bl=this.getBufferLength(l)),this.apply(i,a)}catch(s){I.warn("Could not generate segment CMCD data.",s)}},this.hls=e;const t=this.config=e.config,{cmcd:n}=t;n!=null&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=n.sessionId||Jb(),this.cid=n.contentId,this.useHeaders=n.useHeaders===!0,this.includeKeys=n.includeKeys,this.registerListeners())}registerListeners(){const e=this.hls;e.on(T.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(T.MEDIA_DETACHED,this.onMediaDetached,this),e.on(T.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(T.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(T.MEDIA_DETACHED,this.onMediaDetached,this),e.off(T.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null,this.onWaiting=this.onPlaying=null}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}onMediaDetached(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}onBufferCreated(e,t){var n,i;this.audioBuffer=(n=t.tracks.audio)==null?void 0:n.buffer,this.videoBuffer=(i=t.tracks.video)==null?void 0:i.buffer}createData(){var e;return{v:1,sf:Ju.HLS,sid:this.sid,cid:this.cid,pr:(e=this.media)==null?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,t={}){Re(t,this.createData());const n=t.ot===Ge.INIT||t.ot===Ge.VIDEO||t.ot===Ge.MUXED;this.starved&&n&&(t.bs=!0,t.su=!0,this.starved=!1),t.su==null&&(t.su=this.buffering);const{includeKeys:i}=this;i&&(t=Object.keys(t).reduce((s,o)=>(i.includes(o)&&(s[o]=t[o]),s),{})),this.useHeaders?(e.headers||(e.headers={}),iA(e.headers,t)):e.url=aA(e.url,t)}getObjectType(e){const{type:t}=e;if(t==="subtitle")return Ge.TIMED_TEXT;if(e.sn==="initSegment")return Ge.INIT;if(t==="audio")return Ge.AUDIO;if(t==="main")return this.hls.audioTracks.length?Ge.VIDEO:Ge.MUXED}getTopBandwidth(e){let t=0,n;const i=this.hls;if(e===Ge.AUDIO)n=i.audioTracks;else{const s=i.maxAutoLevel,o=s>-1?s+1:i.levels.length;n=i.levels.slice(0,o)}for(const s of n)s.bitrate>t&&(t=s.bitrate);return t>0?t:NaN}getBufferLength(e){const t=this.hls.media,n=e===Ge.AUDIO?this.audioBuffer:this.videoBuffer;return!n||!t?NaN:fe.bufferInfo(n,t.currentTime,this.config.maxBufferHole).len*1e3}createPlaylistLoader(){const{pLoader:e}=this.config,t=this.applyPlaylistData,n=e||this.config.loader;return class{constructor(s){this.loader=void 0,this.loader=new n(s)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(s,o,l){t(s),this.loader.load(s,o,l)}}}createFragmentLoader(){const{fLoader:e}=this.config,t=this.applyFragmentData,n=e||this.config.loader;return class{constructor(s){this.loader=void 0,this.loader=new n(s)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(s,o,l){t(s),this.loader.load(s,o,l)}}}}const uA=3e5;class cA{constructor(e){this.hls=void 0,this.log=void 0,this.loader=null,this.uri=null,this.pathwayId=".",this.pathwayPriority=null,this.timeToLoad=300,this.reloadTimer=-1,this.updated=0,this.started=!1,this.enabled=!0,this.levels=null,this.audioTracks=null,this.subtitleTracks=null,this.penalizedPathways={},this.hls=e,this.log=I.log.bind(I,"[content-steering]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(T.MANIFEST_LOADING,this.onManifestLoading,this),e.on(T.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(T.MANIFEST_PARSED,this.onManifestParsed,this),e.on(T.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(T.MANIFEST_LOADING,this.onManifestLoading,this),e.off(T.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(T.MANIFEST_PARSED,this.onManifestParsed,this),e.off(T.ERROR,this.onError,this))}startLoad(){if(this.started=!0,this.clearTimeout(),this.enabled&&this.uri){if(this.updated){const e=this.timeToLoad*1e3-(performance.now()-this.updated);if(e>0){this.scheduleRefresh(this.uri,e);return}}this.loadSteeringManifest(this.uri)}}stopLoad(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),this.clearTimeout()}clearTimeout(){this.reloadTimer!==-1&&(self.clearTimeout(this.reloadTimer),this.reloadTimer=-1)}destroy(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null}removeLevel(e){const t=this.levels;t&&(this.levels=t.filter(n=>n!==e))}onManifestLoading(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}onManifestLoaded(e,t){const{contentSteering:n}=t;n!==null&&(this.pathwayId=n.pathwayId,this.uri=n.uri,this.started&&this.startLoad())}onManifestParsed(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks}onError(e,t){const{errorAction:n}=t;if((n==null?void 0:n.action)===Ne.SendAlternateToPenaltyBox&&n.flags===wt.MoveAllAlternatesMatchingHost){const i=this.levels;let s=this.pathwayPriority,o=this.pathwayId;if(t.context){const{groupId:l,pathwayId:a,type:u}=t.context;l&&i?o=this.getPathwayForGroupId(l,u,o):a&&(o=a)}o in this.penalizedPathways||(this.penalizedPathways[o]=performance.now()),!s&&i&&(s=i.reduce((l,a)=>(l.indexOf(a.pathwayId)===-1&&l.push(a.pathwayId),l),[])),s&&s.length>1&&(this.updatePathwayPriority(s),n.resolved=this.pathwayId!==o),n.resolved||I.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${o} levels: ${i&&i.length} priorities: ${JSON.stringify(s)} penalized: ${JSON.stringify(this.penalizedPathways)}`)}}filterParsedLevels(e){this.levels=e;let t=this.getLevelsForPathway(this.pathwayId);if(t.length===0){const n=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${n}"`),t=this.getLevelsForPathway(n),this.pathwayId=n}return t.length!==e.length?(this.log(`Found ${t.length}/${e.length} levels in Pathway "${this.pathwayId}"`),t):e}getLevelsForPathway(e){return this.levels===null?[]:this.levels.filter(t=>e===t.pathwayId)}updatePathwayPriority(e){this.pathwayPriority=e;let t;const n=this.penalizedPathways,i=performance.now();Object.keys(n).forEach(s=>{i-n[s]>uA&&delete n[s]});for(let s=0;s0){this.log(`Setting Pathway to "${o}"`),this.pathwayId=o,Dg(t),this.hls.trigger(T.LEVELS_UPDATED,{levels:t});const u=this.hls.levels[l];a&&u&&this.levels&&(u.attrs["STABLE-VARIANT-ID"]!==a.attrs["STABLE-VARIANT-ID"]&&u.bitrate!==a.bitrate&&this.log(`Unstable Pathways change from bitrate ${a.bitrate} to ${u.bitrate}`),this.hls.nextLoadLevel=l);break}}}getPathwayForGroupId(e,t,n){const i=this.getLevelsForPathway(n).concat(this.levels||[]);for(let s=0;s{const{ID:o,"BASE-ID":l,"URI-REPLACEMENT":a}=s;if(t.some(c=>c.pathwayId===o))return;const u=this.getLevelsForPathway(l).map(c=>{const f=new Ee(c.attrs);f["PATHWAY-ID"]=o;const d=f.AUDIO&&`${f.AUDIO}_clone_${o}`,h=f.SUBTITLES&&`${f.SUBTITLES}_clone_${o}`;d&&(n[f.AUDIO]=d,f.AUDIO=d),h&&(i[f.SUBTITLES]=h,f.SUBTITLES=h);const p=hy(c.uri,f["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",a),m=new ii({attrs:f,audioCodec:c.audioCodec,bitrate:c.bitrate,height:c.height,name:c.name,url:p,videoCodec:c.videoCodec,width:c.width});if(c.audioGroups)for(let y=1;y{this.log(`Loaded steering manifest: "${i}"`);const p=c.data;if(p.VERSION!==1){this.log(`Steering VERSION ${p.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=p.TTL;const{"RELOAD-URI":m,"PATHWAY-CLONES":y,"PATHWAY-PRIORITY":g}=p;if(m)try{this.uri=new self.URL(m,i).href}catch{this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${m}`);return}this.scheduleRefresh(this.uri||d.url),y&&this.clonePathways(y);const v={steeringManifest:p,url:i.toString()};this.hls.trigger(T.STEERING_MANIFEST_LOADED,v),g&&this.updatePathwayPriority(g)},onError:(c,f,d,h)=>{if(this.log(`Error loading steering manifest: ${c.code} ${c.text} (${f.url})`),this.stopLoad(),c.code===410){this.enabled=!1,this.log(`Steering manifest ${f.url} no longer available`);return}let p=this.timeToLoad*1e3;if(c.code===429){const m=this.loader;if(typeof(m==null?void 0:m.getResponseHeader)=="function"){const y=m.getResponseHeader("Retry-After");y&&(p=parseFloat(y)*1e3)}this.log(`Steering manifest ${f.url} rate limited`);return}this.scheduleRefresh(this.uri||f.url,p)},onTimeout:(c,f,d)=>{this.log(`Timeout loading steering manifest (${f.url})`),this.scheduleRefresh(this.uri||f.url)}};this.log(`Requesting steering manifest: ${i}`),this.loader.load(s,a,u)}scheduleRefresh(e,t=this.timeToLoad*1e3){this.clearTimeout(),this.reloadTimer=self.setTimeout(()=>{var n;const i=(n=this.hls)==null?void 0:n.media;if(i&&!i.ended){this.loadSteeringManifest(e);return}this.scheduleRefresh(e,this.timeToLoad*1e3)},t)}}function up(r,e,t,n){r&&Object.keys(e).forEach(i=>{const s=r.filter(o=>o.groupId===i).map(o=>{const l=Re({},o);return l.details=void 0,l.attrs=new Ee(l.attrs),l.url=l.attrs.URI=hy(o.url,o.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",t),l.groupId=l.attrs["GROUP-ID"]=e[i],l.attrs["PATHWAY-ID"]=n,l});r.push(...s)})}function hy(r,e,t,n){const{HOST:i,PARAMS:s,[t]:o}=n;let l;e&&(l=o==null?void 0:o[e],l&&(r=l));const a=new self.URL(r);return i&&!l&&(a.host=i),s&&Object.keys(s).sort().forEach(u=>{u&&a.searchParams.set(u,s[u])}),a.href}const fA=/^age:\s*[\d.]+\s*$/im;class py{constructor(e){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=null,this.loader=null,this.stats=void 0,this.xhrSetup=e&&e.xhrSetup||null,this.stats=new Ca,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null}abortInternal(){const e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,e.readyState!==4&&(this.stats.aborted=!0,e.abort()))}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(e,t,n){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=n,this.loadInternal()}loadInternal(){const{config:e,context:t}=this;if(!e||!t)return;const n=this.loader=new self.XMLHttpRequest,i=this.stats;i.loading.first=0,i.loaded=0,i.aborted=!1;const s=this.xhrSetup;s?Promise.resolve().then(()=>{if(!(this.loader!==n||this.stats.aborted))return s(n,t.url)}).catch(o=>{if(!(this.loader!==n||this.stats.aborted))return n.open("GET",t.url,!0),s(n,t.url)}).then(()=>{this.loader!==n||this.stats.aborted||this.openAndSendXhr(n,t,e)}).catch(o=>{this.callbacks.onError({code:n.status,text:o.message},t,n,i)}):this.openAndSendXhr(n,t,e)}openAndSendXhr(e,t,n){e.readyState||e.open("GET",t.url,!0);const i=t.headers,{maxTimeToFirstByteMs:s,maxLoadTimeMs:o}=n.loadPolicy;if(i)for(const l in i)e.setRequestHeader(l,i[l]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),n.timeout=s&&z(s)?s:o,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),n.timeout),e.send()}readystatechange(){const{context:e,loader:t,stats:n}=this;if(!e||!t)return;const i=t.readyState,s=this.config;if(!n.aborted&&i>=2&&(n.loading.first===0&&(n.loading.first=Math.max(self.performance.now(),n.loading.start),s.timeout!==s.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),s.timeout=s.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),s.loadPolicy.maxLoadTimeMs-(n.loading.first-n.loading.start)))),i===4)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const o=t.status,l=t.responseType!=="text";if(o>=200&&o<300&&(l&&t.response||t.responseText!==null)){n.loading.end=Math.max(self.performance.now(),n.loading.first);const a=l?t.response:t.responseText,u=t.responseType==="arraybuffer"?a.byteLength:a.length;if(n.loaded=n.total=u,n.bwEstimate=n.total*8e3/(n.loading.end-n.loading.first),!this.callbacks)return;const c=this.callbacks.onProgress;if(c&&c(n,e,a,t),!this.callbacks)return;const f={url:t.responseURL,data:a,code:o};this.callbacks.onSuccess(f,n,e,t)}else{const a=s.loadPolicy.errorRetry,u=n.retry,c={url:e.url,data:void 0,code:o};na(a,u,!1,c)?this.retry(a):(I.error(`${o} while loading ${e.url}`),this.callbacks.onError({code:o,text:t.statusText},e,t,n))}}}loadtimeout(){if(!this.config)return;const e=this.config.loadPolicy.timeoutRetry,t=this.stats.retry;if(na(e,t,!0))this.retry(e);else{var n;I.warn(`timeout while loading ${(n=this.context)==null?void 0:n.url}`);const i=this.callbacks;i&&(this.abortInternal(),i.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:n}=this;this.retryDelay=hf(e,n.retry),n.retry++,I.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${t==null?void 0:t.url}, retrying ${n.retry}/${e.maxNumRetry} in ${this.retryDelay}ms`),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(e){const t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)}getCacheAge(){let e=null;if(this.loader&&fA.test(this.loader.getAllResponseHeaders())){const t=this.loader.getResponseHeader("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.loader&&new RegExp(`^${e}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null}}function dA(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch{}return!1}const hA=/(\d+)-(\d+)\/(\d+)/;class cp{constructor(e){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=null,this.response=null,this.controller=void 0,this.context=null,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=e.fetchSetup||yA,this.controller=new self.AbortController,this.stats=new Ca}destroy(){this.loader=this.callbacks=this.context=this.config=this.request=null,this.abortInternal(),this.response=null,this.fetchSetup=this.controller=this.stats=null}abortInternal(){this.controller&&!this.stats.loading.end&&(this.stats.aborted=!0,this.controller.abort())}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(e,t,n){const i=this.stats;if(i.loading.start)throw new Error("Loader can only be used once.");i.loading.start=self.performance.now();const s=pA(e,this.controller.signal),o=n.onProgress,l=e.responseType==="arraybuffer",a=l?"byteLength":"length",{maxTimeToFirstByteMs:u,maxLoadTimeMs:c}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=n,this.request=this.fetchSetup(e,s),self.clearTimeout(this.requestTimeout),t.timeout=u&&z(u)?u:c,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),n.onTimeout(i,e,this.response)},t.timeout),self.fetch(this.request).then(f=>{this.response=this.loader=f;const d=Math.max(self.performance.now(),i.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=c,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),n.onTimeout(i,e,this.response)},c-(d-i.loading.start)),!f.ok){const{status:h,statusText:p}=f;throw new vA(p||"fetch, bad network response",h,f)}return i.loading.first=d,i.total=gA(f.headers)||i.total,o&&z(t.highWaterMark)?this.loadProgressively(f,i,e,t.highWaterMark,o):l?f.arrayBuffer():e.responseType==="json"?f.json():f.text()}).then(f=>{const d=this.response;if(!d)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),i.loading.end=Math.max(self.performance.now(),i.loading.first);const h=f[a];h&&(i.loaded=i.total=h);const p={url:d.url,data:f,code:d.status};o&&!z(t.highWaterMark)&&o(i,e,f,d),n.onSuccess(p,i,e,d)}).catch(f=>{if(self.clearTimeout(this.requestTimeout),i.aborted)return;const d=f&&f.code||0,h=f?f.message:null;n.onError({code:d,text:h},e,f?f.details:null,i)})}getCacheAge(){let e=null;if(this.response){const t=this.response.headers.get("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,t,n,i=0,s){const o=new Fg,l=e.body.getReader(),a=()=>l.read().then(u=>{if(u.done)return o.dataLength&&s(t,n,o.flush(),e),Promise.resolve(new ArrayBuffer(0));const c=u.value,f=c.length;return t.loaded+=f,f=i&&s(t,n,o.flush(),e)):s(t,n,c,e),a()}).catch(()=>Promise.reject());return a()}}function pA(r,e){const t={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(Re({},r.headers))};return r.rangeEnd&&t.headers.set("Range","bytes="+r.rangeStart+"-"+String(r.rangeEnd-1)),t}function mA(r){const e=hA.exec(r);if(e)return parseInt(e[2])-parseInt(e[1])+1}function gA(r){const e=r.get("Content-Range");if(e){const n=mA(e);if(z(n))return n}const t=r.get("Content-Length");if(t)return parseInt(t)}function yA(r,e){return new self.Request(r.url,e)}class vA extends Error{constructor(e,t,n){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=n}}const xA=/\s/,EA={newCue(r,e,t,n){const i=[];let s,o,l,a,u;const c=self.VTTCue||self.TextTrackCue;for(let d=0;d=16?a--:a++;const h=ny(u.trim()),p=bf(e,t,h);r!=null&&(f=r.cues)!=null&&f.getCueById(p)||(o=new c(e,t,h),o.id=p,o.line=d+1,o.align="left",o.position=10+Math.min(80,Math.floor(a*8/32)*10),i.push(o))}return r&&i.length&&(i.sort((d,h)=>d.line==="auto"||h.line==="auto"?0:d.line>8&&h.line>8?h.line-d.line:d.line-h.line),i.forEach(d=>Rg(r,d))),i}},SA={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},my=Fe(Fe({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:py,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:YT,bufferController:Qw,capLevelController:Af,errorController:MT,fpsController:Lb,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrEwmaDefaultEstimateMax:5e6,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:hg,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0,useMediaCapabilities:!0,certLoadPolicy:{default:SA},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},TA()),{},{subtitleStreamController:Yw,subtitleTrackController:Xw,timelineController:bb,audioStreamController:Kw,audioTrackController:Ww,emeController:Kn,cmcdController:lA,contentSteeringController:cA});function TA(){return{cueHandler:EA,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function wA(r,e){if((e.liveSyncDurationCount||e.liveMaxLatencyDurationCount)&&(e.liveSyncDuration||e.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(e.liveMaxLatencyDurationCount!==void 0&&(e.liveSyncDurationCount===void 0||e.liveMaxLatencyDurationCount<=e.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(e.liveMaxLatencyDuration!==void 0&&(e.liveSyncDuration===void 0||e.liveMaxLatencyDuration<=e.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const t=rc(r),n=["manifest","level","frag"],i=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return n.forEach(s=>{const o=`${s==="level"?"playlist":s}LoadPolicy`,l=e[o]===void 0,a=[];i.forEach(u=>{const c=`${s}Loading${u}`,f=e[c];if(f!==void 0&&l){a.push(c);const d=t[o].default;switch(e[o]={default:d},u){case"TimeOut":d.maxLoadTimeMs=f,d.maxTimeToFirstByteMs=f;break;case"MaxRetry":d.errorRetry.maxNumRetry=f,d.timeoutRetry.maxNumRetry=f;break;case"RetryDelay":d.errorRetry.retryDelayMs=f,d.timeoutRetry.retryDelayMs=f;break;case"MaxRetryTimeout":d.errorRetry.maxRetryDelayMs=f,d.timeoutRetry.maxRetryDelayMs=f;break}}}),a.length&&I.warn(`hls.js config: "${a.join('", "')}" setting(s) are deprecated, use "${o}": ${JSON.stringify(e[o])}`)}),Fe(Fe({},t),e)}function rc(r){return r&&typeof r=="object"?Array.isArray(r)?r.map(rc):Object.keys(r).reduce((e,t)=>(e[t]=rc(r[t]),e),{}):r}function bA(r){const e=r.loader;e!==cp&&e!==py?(I.log("[config]: Custom loader detected, cannot enable progressive streaming"),r.progressive=!1):dA()&&(r.loader=cp,r.progressive=!0,r.enableSoftwareAES=!0,I.log("[config]: Progressive streaming enabled, using FetchLoader"))}let _l;class AA extends pf{constructor(e,t){super(e,"[level-controller]"),this._levels=[],this._firstLevel=-1,this._maxAutoLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=t,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(T.MANIFEST_LOADING,this.onManifestLoading,this),e.on(T.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(T.LEVEL_LOADED,this.onLevelLoaded,this),e.on(T.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(T.FRAG_BUFFERED,this.onFragBuffered,this),e.on(T.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(T.MANIFEST_LOADING,this.onManifestLoading,this),e.off(T.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(T.LEVEL_LOADED,this.onLevelLoaded,this),e.off(T.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(T.FRAG_BUFFERED,this.onFragBuffered,this),e.off(T.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}stopLoad(){this._levels.forEach(t=>{t.loadError=0,t.fragmentError=0}),super.stopLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[],this._maxAutoLevel=-1}onManifestLoading(e,t){this.resetLevels()}onManifestLoaded(e,t){const n=this.hls.config.preferManagedMediaSource,i=[],s={},o={};let l=!1,a=!1,u=!1;t.levels.forEach(c=>{var f,d;const h=c.attrs;let{audioCodec:p,videoCodec:m}=c;((f=p)==null?void 0:f.indexOf("mp4a.40.34"))!==-1&&(_l||(_l=/chrome|firefox/i.test(navigator.userAgent)),_l&&(c.audioCodec=p=void 0)),p&&(c.audioCodec=p=ea(p,n)),((d=m)==null?void 0:d.indexOf("avc1"))===0&&(m=c.videoCodec=fT(m));const{width:y,height:g,unknownCodecs:v}=c;if(l||(l=!!(y&&g)),a||(a=!!m),u||(u=!!p),v!=null&&v.length||p&&!yl(p,"audio",n)||m&&!yl(m,"video",n))return;const{CODECS:x,"FRAME-RATE":S,"HDCP-LEVEL":E,"PATHWAY-ID":b,RESOLUTION:w,"VIDEO-RANGE":A}=h,L=`${`${b||"."}-`}${c.bitrate}-${w}-${S}-${x}-${A}-${E}`;if(s[L])if(s[L].uri!==c.url&&!c.attrs["PATHWAY-ID"]){const C=o[L]+=1;c.attrs["PATHWAY-ID"]=new Array(C+1).join(".");const _=new ii(c);s[L]=_,i.push(_)}else s[L].addGroupId("audio",h.AUDIO),s[L].addGroupId("text",h.SUBTITLES);else{const C=new ii(c);s[L]=C,o[L]=1,i.push(C)}}),this.filterAndSortMediaOptions(i,t,l,a,u)}filterAndSortMediaOptions(e,t,n,i,s){let o=[],l=[],a=e;if((n||i)&&s&&(a=a.filter(({videoCodec:p,videoRange:m,width:y,height:g})=>(!!p||!!(y&&g))&&bT(m))),a.length===0){Promise.resolve().then(()=>{if(this.hls){t.levels.length&&this.warn(`One or more CODECS in variant not supported: ${JSON.stringify(t.levels[0].attrs)}`);const p=new Error("no level with compatible codecs found in manifest");this.hls.trigger(T.ERROR,{type:X.MEDIA_ERROR,details:P.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:p,reason:p.message})}});return}if(t.audioTracks){const{preferManagedMediaSource:p}=this.hls.config;o=t.audioTracks.filter(m=>!m.audioCodec||yl(m.audioCodec,"audio",p)),fp(o)}t.subtitles&&(l=t.subtitles,fp(l));const u=a.slice(0);a.sort((p,m)=>{if(p.attrs["HDCP-LEVEL"]!==m.attrs["HDCP-LEVEL"])return(p.attrs["HDCP-LEVEL"]||"")>(m.attrs["HDCP-LEVEL"]||"")?1:-1;if(n&&p.height!==m.height)return p.height-m.height;if(p.frameRate!==m.frameRate)return p.frameRate-m.frameRate;if(p.videoRange!==m.videoRange)return ta.indexOf(p.videoRange)-ta.indexOf(m.videoRange);if(p.videoCodec!==m.videoCodec){const y=vh(p.videoCodec),g=vh(m.videoCodec);if(y!==g)return g-y}if(p.uri===m.uri&&p.codecSet!==m.codecSet){const y=Jo(p.codecSet),g=Jo(m.codecSet);if(y!==g)return g-y}return p.averageBitrate!==m.averageBitrate?p.averageBitrate-m.averageBitrate:0});let c=u[0];if(this.steering&&(a=this.steering.filterParsedLevels(a),a.length!==u.length)){for(let p=0;py&&y===my.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=g)}break}const d=s&&!i,h={levels:a,audioTracks:o,subtitleTracks:l,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:s,video:i,altAudio:!d&&o.some(p=>!!p.url)};this.hls.trigger(T.MANIFEST_PARSED,h),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}get levels(){return this._levels.length===0?null:this._levels}get level(){return this.currentLevelIndex}set level(e){const t=this._levels;if(t.length===0)return;if(e<0||e>=t.length){const c=new Error("invalid level idx"),f=e<0;if(this.hls.trigger(T.ERROR,{type:X.OTHER_ERROR,details:P.LEVEL_SWITCH_ERROR,level:e,fatal:f,error:c,reason:c.message}),f)return;e=Math.min(e,t.length-1)}const n=this.currentLevelIndex,i=this.currentLevel,s=i?i.attrs["PATHWAY-ID"]:void 0,o=t[e],l=o.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=o,n===e&&o.details&&i&&s===l)return;this.log(`Switching to level ${e} (${o.height?o.height+"p ":""}${o.videoRange?o.videoRange+" ":""}${o.codecSet?o.codecSet+" ":""}@${o.bitrate})${l?" with Pathway "+l:""} from level ${n}${s?" with Pathway "+s:""}`);const a={level:e,attrs:o.attrs,details:o.details,bitrate:o.bitrate,averageBitrate:o.averageBitrate,maxBitrate:o.maxBitrate,realBitrate:o.realBitrate,width:o.width,height:o.height,codecSet:o.codecSet,audioCodec:o.audioCodec,videoCodec:o.videoCodec,audioGroups:o.audioGroups,subtitleGroups:o.subtitleGroups,loaded:o.loaded,loadError:o.loadError,fragmentError:o.fragmentError,name:o.name,id:o.id,uri:o.uri,url:o.url,urlId:0,audioGroupIds:o.audioGroupIds,textGroupIds:o.textGroupIds};this.hls.trigger(T.LEVEL_SWITCHING,a);const u=o.details;if(!u||u.live){const c=this.switchParams(o.uri,i==null?void 0:i.details,u);this.loadPlaylist(c)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(e){this.manualLevelIndex=e,this._startLevel===void 0&&(this._startLevel=e),e!==-1&&(this.level=e)}get firstLevel(){return this._firstLevel}set firstLevel(e){this._firstLevel=e}get startLevel(){if(this._startLevel===void 0){const e=this.hls.config.startLevel;return e!==void 0?e:this.hls.firstAutoLevel}return this._startLevel}set startLevel(e){this._startLevel=e}onError(e,t){t.fatal||!t.context||t.context.type===se.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(t!==void 0&&t.type===q.MAIN){const n=t.elementaryStreams;if(!Object.keys(n).some(s=>!!n[s]))return;const i=this._levels[t.level];i!=null&&i.loadError&&(this.log(`Resetting level error count of ${i.loadError} on frag buffered`),i.loadError=0)}}onLevelLoaded(e,t){var n;const{level:i,details:s}=t,o=this._levels[i];if(!o){var l;this.warn(`Invalid level index ${i}`),(l=t.deliveryDirectives)!=null&&l.skip&&(s.deltaUpdateFailed=!0);return}i===this.currentLevelIndex?(o.fragmentError===0&&(o.loadError=0),this.playlistLoaded(i,t,o.details)):(n=t.deliveryDirectives)!=null&&n.skip&&(s.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist();const t=this.currentLevelIndex,n=this.currentLevel;if(n&&this.shouldLoadPlaylist(n)){let i=n.uri;if(e)try{i=e.addDirectives(i)}catch(o){this.warn(`Could not construct new URL with HLS Delivery Directives: ${o}`)}const s=n.attrs["PATHWAY-ID"];this.log(`Loading level index ${t}${(e==null?void 0:e.msn)!==void 0?" at sn "+e.msn+" part "+e.part:""} with${s?" Pathway "+s:""} ${i}`),this.clearTimer(),this.hls.trigger(T.LEVEL_LOADING,{url:i,level:t,pathwayId:n.attrs["PATHWAY-ID"],id:0,deliveryDirectives:e||null})}}get nextLoadLevel(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(e){this.level=e,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=e)}removeLevel(e){var t;const n=this._levels.filter((i,s)=>s!==e?!0:(this.steering&&this.steering.removeLevel(i),i===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,i.details&&i.details.fragments.forEach(o=>o.level=-1)),!1));Dg(n),this._levels=n,this.currentLevelIndex>-1&&(t=this.currentLevel)!=null&&t.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.hls.trigger(T.LEVELS_UPDATED,{levels:n})}onLevelsUpdated(e,{levels:t}){this._levels=t}checkMaxAutoUpdated(){const{autoLevelCapping:e,maxAutoLevel:t,maxHdcpLevel:n}=this.hls;this._maxAutoLevel!==t&&(this._maxAutoLevel=t,this.hls.trigger(T.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:n}))}}function fp(r){const e={};r.forEach(t=>{const n=t.groupId||"";t.id=e[n]=e[n]||0,e[n]++})}class LA{constructor(e){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const n in this.keyUriToKeyInfo){const i=this.keyUriToKeyInfo[n].loader;if(i){var t;if(e&&e!==((t=i.context)==null?void 0:t.frag.type))return;i.abort()}}}detach(){for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e].loader;t&&t.destroy()}this.keyUriToKeyInfo={}}createKeyLoadError(e,t=P.KEY_LOAD_ERROR,n,i,s){return new er({type:X.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:s,error:n,networkDetails:i})}loadClear(e,t){if(this.emeController&&this.config.emeEnabled){const{sn:n,cc:i}=e;for(let s=0;s{o.setKeyFormat(l)});break}}}}load(e){return!e.decryptdata&&e.encrypted&&this.emeController?this.emeController.selectKeySystemFormat(e).then(t=>this.loadInternal(e,t)):this.loadInternal(e)}loadInternal(e,t){var n,i;t&&e.setKeyFormat(t);const s=e.decryptdata;if(!s){const u=new Error(t?`Expected frag.decryptdata to be defined after setting format ${t}`:"Missing decryption data on fragment in onKeyLoading");return Promise.reject(this.createKeyLoadError(e,P.KEY_LOAD_ERROR,u))}const o=s.uri;if(!o)return Promise.reject(this.createKeyLoadError(e,P.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${o}"`)));let l=this.keyUriToKeyInfo[o];if((n=l)!=null&&n.decryptdata.key)return s.key=l.decryptdata.key,Promise.resolve({frag:e,keyInfo:l});if((i=l)!=null&&i.keyLoadPromise){var a;switch((a=l.mediaKeySessionContext)==null?void 0:a.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return l.keyLoadPromise.then(u=>(s.key=u.keyInfo.decryptdata.key,{frag:e,keyInfo:l}))}}switch(l=this.keyUriToKeyInfo[o]={decryptdata:s,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},s.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return s.keyFormat==="identity"?this.loadKeyHTTP(l,e):this.loadKeyEME(l,e);case"AES-128":return this.loadKeyHTTP(l,e);default:return Promise.reject(this.createKeyLoadError(e,P.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${s.method}"`)))}}loadKeyEME(e,t){const n={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){const i=this.emeController.loadKey(n);if(i)return(e.keyLoadPromise=i.then(s=>(e.mediaKeySessionContext=s,n))).catch(s=>{throw e.keyLoadPromise=null,s})}return Promise.resolve(n)}loadKeyHTTP(e,t){const n=this.config,i=n.loader,s=new i(n);return t.keyLoader=e.loader=s,e.keyLoadPromise=new Promise((o,l)=>{const a={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},u=n.keyLoadPolicy.default,c={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},f={onSuccess:(d,h,p,m)=>{const{frag:y,keyInfo:g,url:v}=p;if(!y.decryptdata||g!==this.keyUriToKeyInfo[v])return l(this.createKeyLoadError(y,P.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),m));g.decryptdata.key=y.decryptdata.key=new Uint8Array(d.data),y.keyLoader=null,g.loader=null,o({frag:y,keyInfo:g})},onError:(d,h,p,m)=>{this.resetLoader(h),l(this.createKeyLoadError(t,P.KEY_LOAD_ERROR,new Error(`HTTP Error ${d.code} loading key ${d.text}`),p,Fe({url:a.url,data:void 0},d)))},onTimeout:(d,h,p)=>{this.resetLoader(h),l(this.createKeyLoadError(t,P.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),p))},onAbort:(d,h,p)=>{this.resetLoader(h),l(this.createKeyLoadError(t,P.INTERNAL_ABORTED,new Error("key loading aborted"),p))}};s.load(a,c,f)})}resetLoader(e){const{frag:t,keyInfo:n,url:i}=e,s=n.loader;t.keyLoader===s&&(t.keyLoader=null,n.loader=null),delete this.keyUriToKeyInfo[i],s&&s.destroy()}}function gy(){return self.SourceBuffer||self.WebKitSourceBuffer}function yy(){if(!dn())return!1;const e=gy();return!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function"}function RA(){if(!yy())return!1;const r=dn();return typeof(r==null?void 0:r.isTypeSupported)=="function"&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some(e=>r.isTypeSupported(ps(e,"video")))||["mp4a.40.2","fLaC"].some(e=>r.isTypeSupported(ps(e,"audio"))))}function IA(){var r;const e=gy();return typeof(e==null||(r=e.prototype)==null?void 0:r.changeType)=="function"}const kA=250,Eo=2,CA=.1,DA=.05;class _A{constructor(e,t,n,i){this.config=void 0,this.media=null,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=e,this.media=t,this.fragmentTracker=n,this.hls=i}destroy(){this.media=null,this.hls=this.fragmentTracker=null}poll(e,t){const{config:n,media:i,stalled:s}=this;if(i===null)return;const{currentTime:o,seeking:l}=i,a=this.seeking&&!l,u=!this.seeking&&l;if(this.seeking=l,o!==e){if(this.moved=!0,l||(this.nudgeRetry=0),s!==null){if(this.stallReported){const y=self.performance.now()-s;I.warn(`playback not stuck anymore @${o}, after ${Math.round(y)}ms`),this.stallReported=!1}this.stalled=null}return}if(u||a){this.stalled=null;return}if(i.paused&&!l||i.ended||i.playbackRate===0||!fe.getBuffered(i).length){this.nudgeRetry=0;return}const c=fe.bufferInfo(i,o,0),f=c.nextStart||0;if(l){const y=c.len>Eo,g=!f||t&&t.start<=o||f-o>Eo&&!this.fragmentTracker.getPartialFragment(o);if(y||g)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var d;if(!(c.len>0)&&!f)return;const g=Math.max(f,c.start||0)-o,v=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,S=(v==null||(d=v.details)==null?void 0:d.live)?v.details.targetduration*2:Eo,E=this.fragmentTracker.getPartialFragment(o);if(g>0&&(g<=S||E)){i.paused||this._trySkipBufferHole(E);return}}const h=self.performance.now();if(s===null){this.stalled=h;return}const p=h-s;if(!l&&p>=kA&&(this._reportStall(c),!this.media))return;const m=fe.bufferInfo(i,o,n.maxBufferHole);this._tryFixBufferStall(m,p)}_tryFixBufferStall(e,t){const{config:n,fragmentTracker:i,media:s}=this;if(s===null)return;const o=s.currentTime,l=i.getPartialFragment(o);l&&(this._trySkipBufferHole(l)||!this.media)||(e.len>n.maxBufferHole||e.nextStart&&e.nextStart-on.highBufferWatchdogPeriod*1e3&&(I.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}_reportStall(e){const{hls:t,media:n,stallReported:i}=this;if(!i&&n){this.stallReported=!0;const s=new Error(`Playback stalling at @${n.currentTime} due to low buffer (${JSON.stringify(e)})`);I.warn(s.message),t.trigger(T.ERROR,{type:X.MEDIA_ERROR,details:P.BUFFER_STALLED_ERROR,fatal:!1,error:s,buffer:e.len})}}_trySkipBufferHole(e){const{config:t,hls:n,media:i}=this;if(i===null)return 0;const s=i.currentTime,o=fe.bufferInfo(i,s,0),l=s0&&o.len<1&&i.readyState<3,c=l-s;if(c>0&&(a||u)){if(c>t.maxBufferHole){const{fragmentTracker:d}=this;let h=!1;if(s===0){const p=d.getAppendedFrag(0,q.MAIN);p&&l1?(i=0,this.bitrateTest=!0):i=n.firstAutoLevel),n.nextLoadLevel=i,this.level=n.loadLevel,this.loadedmetadata=!1}t>0&&e===-1&&(this.log(`Override startPosition with lastCurrentTime @${t.toFixed(3)}`),e=t),this.state=$.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this._forceStartLoad=!0,this.state=$.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case $.WAITING_LEVEL:{const{levels:t,level:n}=this,i=t==null?void 0:t[n],s=i==null?void 0:i.details;if(s&&(!s.live||this.levelLastLoaded===i)){if(this.waitForCdnTuneIn(s))break;this.state=$.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=$.IDLE;break}break}case $.FRAG_LOADING_WAITING_RETRY:{var e;const t=self.performance.now(),n=this.retryDate;if(!n||t>=n||(e=this.media)!=null&&e.seeking){const{levels:i,level:s}=this,o=i==null?void 0:i[s];this.resetStartWhenNotLoaded(o||null),this.state=$.IDLE}}break}this.state===$.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){super.onTickEnd(),this.checkBuffer(),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:t,levels:n,media:i}=this;if(t===null||!i&&(this.startFragRequested||!e.config.startFragPrefetch)||this.altAudio&&this.audioOnly)return;const s=e.nextLoadLevel;if(!(n!=null&&n[s]))return;const o=n[s],l=this.getMainFwdBufferInfo();if(l===null)return;const a=this.getLevelDetails();if(a&&this._streamEnded(l,a)){const m={};this.altAudio&&(m.type="video"),this.hls.trigger(T.BUFFER_EOS,m),this.state=$.ENDED;return}e.loadLevel!==s&&e.manualLevel===-1&&this.log(`Adapting to level ${s} from level ${this.level}`),this.level=e.nextLoadLevel=s;const u=o.details;if(!u||this.state===$.WAITING_LEVEL||u.live&&this.levelLastLoaded!==o){this.level=s,this.state=$.WAITING_LEVEL;return}const c=l.len,f=this.getMaxBufferLength(o.maxBitrate);if(c>=f)return;this.backtrackFragment&&this.backtrackFragment.start>l.end&&(this.backtrackFragment=null);const d=this.backtrackFragment?this.backtrackFragment.start:l.end;let h=this.getNextFragment(d,u);if(this.couldBacktrack&&!this.fragPrevious&&h&&h.sn!=="initSegment"&&this.fragmentTracker.getState(h)!==Pe.OK){var p;const y=((p=this.backtrackFragment)!=null?p:h).sn-u.startSN,g=u.fragments[y-1];g&&h.cc===g.cc&&(h=g,this.fragmentTracker.removeFragment(g))}else this.backtrackFragment&&l.len&&(this.backtrackFragment=null);if(h&&this.isLoopLoading(h,d)){if(!h.gap){const y=this.audioOnly&&!this.altAudio?le.AUDIO:le.VIDEO,g=(y===le.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;g&&this.afterBufferFlushed(g,y,q.MAIN)}h=this.getNextFragmentLoopLoading(h,u,l,q.MAIN,f)}h&&(h.initSegment&&!h.initSegment.data&&!this.bitrateTest&&(h=h.initSegment),this.loadFragment(h,o,d))}loadFragment(e,t,n){const i=this.fragmentTracker.getState(e);this.fragCurrent=e,i===Pe.NOT_LOADED||i===Pe.PARTIAL?e.sn==="initSegment"?this._loadInitSegment(e,t):this.bitrateTest?(this.log(`Fragment ${e.sn} of level ${e.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(e,t)):(this.startFragRequested=!0,super.loadFragment(e,t,n)):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,q.MAIN)}followingBufferedFrag(e){return e?this.getBufferedFrag(e.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:e,media:t}=this;if(t!=null&&t.readyState){let n;const i=this.getAppendedFrag(t.currentTime);i&&i.start>1&&this.flushMainBuffer(0,i.start-1);const s=this.getLevelDetails();if(s!=null&&s.live){const l=this.getMainFwdBufferInfo();if(!l||l.len{const o=s.audioCodec;o&&(n=n||o.indexOf("mp4a.40.2")!==-1,i=i||o.indexOf("mp4a.40.5")!==-1)}),this.audioCodecSwitch=n&&i&&!IA(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1}onLevelLoading(e,t){const{levels:n}=this;if(!n||this.state!==$.IDLE)return;const i=n[t.level];(!i.details||i.details.live&&this.levelLastLoaded!==i||this.waitForCdnTuneIn(i.details))&&(this.state=$.WAITING_LEVEL)}onLevelLoaded(e,t){var n;const{levels:i}=this,s=t.level,o=t.details,l=o.totalduration;if(!i){this.warn(`Levels were reset while loading level ${s}`);return}this.log(`Level ${s} loaded [${o.startSN},${o.endSN}]${o.lastPartSn?`[part-${o.lastPartSn}-${o.lastPartIndex}]`:""}, cc [${o.startCC}, ${o.endCC}] duration:${l}`);const a=i[s],u=this.fragCurrent;u&&(this.state===$.FRAG_LOADING||this.state===$.FRAG_LOADING_WAITING_RETRY)&&u.level!==t.level&&u.loader&&this.abortCurrentFrag();let c=0;if(o.live||(n=a.details)!=null&&n.live){var f;if(this.checkLiveUpdate(o),o.deltaUpdateFailed)return;c=this.alignPlaylists(o,a.details,(f=this.levelLastLoaded)==null?void 0:f.details)}if(a.details=o,this.levelLastLoaded=a,this.hls.trigger(T.LEVEL_UPDATED,{details:o,level:s}),this.state===$.WAITING_LEVEL){if(this.waitForCdnTuneIn(o))return;this.state=$.IDLE}this.startFragRequested?o.live&&this.synchronizeToLiveEdge(o):this.setStartPosition(o,c),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:n,part:i,payload:s}=e,{levels:o}=this;if(!o){this.warn(`Levels were reset while fragment load was in progress. Fragment ${n.sn} of level ${n.level} will not be buffered`);return}const l=o[n.level],a=l.details;if(!a){this.warn(`Dropping fragment ${n.sn} of level ${n.level} after level details were reset`),this.fragmentTracker.removeFragment(n);return}const u=l.videoCodec,c=a.PTSKnown||!a.live,f=(t=n.initSegment)==null?void 0:t.data,d=this._getAudioCodec(l),h=this.transmuxer=this.transmuxer||new Zg(this.hls,q.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),p=i?i.index:-1,m=p!==-1,y=new mf(n.level,n.sn,n.stats.chunkCount,s.byteLength,p,m),g=this.initPTS[n.cc];h.push(s,f,d,u,n,i,a.totalduration,c,y,g)}onAudioTrackSwitching(e,t){const n=this.altAudio;if(!!!t.url){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const o=this.fragCurrent;o&&(this.log("Switching to main audio track, cancel main fragment load"),o.abortRequests(),this.fragmentTracker.removeFragment(o)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();const s=this.hls;n&&(s.trigger(T.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null}),this.fragmentTracker.removeAllFragments()),s.trigger(T.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const n=t.id,i=!!this.hls.audioTracks[n].url;if(i){const s=this.videoBuffer;s&&this.mediaBuffer!==s&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=s)}this.altAudio=i,this.tick()}onBufferCreated(e,t){const n=t.tracks;let i,s,o=!1;for(const l in n){const a=n[l];if(a.id==="main"){if(s=l,i=a,l==="video"){const u=n[l];u&&(this.videoBuffer=u.buffer)}}else o=!0}o&&i?(this.log(`Alternate track found, use ${s}.buffered to schedule main fragment loading`),this.mediaBuffer=i.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:n,part:i}=t;if(n&&n.type!==q.MAIN)return;if(this.fragContextChanged(n)){this.warn(`Fragment ${n.sn}${i?" p: "+i.index:""} of level ${n.level} finished buffering, but was aborted. state: ${this.state}`),this.state===$.PARSED&&(this.state=$.IDLE);return}const s=i?i.stats:n.stats;this.fragLastKbps=Math.round(8*s.total/(s.buffering.end-s.loading.first)),n.sn!=="initSegment"&&(this.fragPrevious=n),this.fragBufferedComplete(n,i)}onError(e,t){var n;if(t.fatal){this.state=$.ERROR;return}switch(t.details){case P.FRAG_GAP:case P.FRAG_PARSING_ERROR:case P.FRAG_DECRYPT_ERROR:case P.FRAG_LOAD_ERROR:case P.FRAG_LOAD_TIMEOUT:case P.KEY_LOAD_ERROR:case P.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(q.MAIN,t);break;case P.LEVEL_LOAD_ERROR:case P.LEVEL_LOAD_TIMEOUT:case P.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===$.WAITING_LEVEL&&((n=t.context)==null?void 0:n.type)===se.LEVEL&&(this.state=$.IDLE);break;case P.BUFFER_APPEND_ERROR:case P.BUFFER_FULL_ERROR:if(!t.parent||t.parent!=="main")return;if(t.details===P.BUFFER_APPEND_ERROR){this.resetLoadingState();return}this.reduceLengthAndFlushBuffer(t)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case P.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}checkBuffer(){const{media:e,gapController:t}=this;if(!(!e||!t||!e.readyState)){if(this.loadedmetadata||!fe.getBuffered(e).length){const n=this.state!==$.IDLE?this.fragCurrent:null;t.poll(this.lastCurrentTime,n)}this.lastCurrentTime=e.currentTime}}onFragLoadEmergencyAborted(){this.state=$.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==le.AUDIO||this.audioOnly&&!this.altAudio){const n=(t===le.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(n,t,q.MAIN),this.tick()}}onLevelsUpdated(e,t){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level),this.levels=t.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:e}=this;if(!e)return;const t=e.currentTime;let n=this.startPosition;if(n>=0&&t0&&(o{const{hls:i}=this;if(!n||this.fragContextChanged(e))return;t.fragmentError=0,this.state=$.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const s=e.stats;s.parsing.start=s.parsing.end=s.buffering.start=s.buffering.end=self.performance.now(),i.trigger(T.FRAG_LOADED,n),e.bitrateTest=!1})}_handleTransmuxComplete(e){var t;const n="main",{hls:i}=this,{remuxResult:s,chunkMeta:o}=e,l=this.getCurrentContext(o);if(!l){this.resetWhenMissingContext(o);return}const{frag:a,part:u,level:c}=l,{video:f,text:d,id3:h,initSegment:p}=s,{details:m}=c,y=this.altAudio?void 0:s.audio;if(this.fragContextChanged(a)){this.fragmentTracker.removeFragment(a);return}if(this.state=$.PARSING,p){if(p!=null&&p.tracks){const x=a.initSegment||a;this._bufferInitSegment(c,p.tracks,x,o),i.trigger(T.FRAG_PARSING_INIT_SEGMENT,{frag:x,id:n,tracks:p.tracks})}const g=p.initPTS,v=p.timescale;z(g)&&(this.initPTS[a.cc]={baseTime:g,timescale:v},i.trigger(T.INIT_PTS_FOUND,{frag:a,id:n,initPTS:g,timescale:v}))}if(f&&m&&a.sn!=="initSegment"){const g=m.fragments[a.sn-1-m.startSN],v=a.sn===m.startSN,x=!g||a.cc>g.cc;if(s.independent!==!1){const{startPTS:S,endPTS:E,startDTS:b,endDTS:w}=f;if(u)u.elementaryStreams[f.type]={startPTS:S,endPTS:E,startDTS:b,endDTS:w};else if(f.firstKeyFrame&&f.independent&&o.id===1&&!x&&(this.couldBacktrack=!0),f.dropped&&f.independent){const A=this.getMainFwdBufferInfo(),R=(A?A.end:this.getLoadPosition())+this.config.maxBufferHole,L=f.firstKeyFramePTS?f.firstKeyFramePTS:S;if(!v&&REo&&(a.gap=!0);a.setElementaryStreamInfo(f.type,S,E,b,w),this.backtrackFragment&&(this.backtrackFragment=a),this.bufferFragmentData(f,a,u,o,v||x)}else if(v||x)a.gap=!0;else{this.backtrack(a);return}}if(y){const{startPTS:g,endPTS:v,startDTS:x,endDTS:S}=y;u&&(u.elementaryStreams[le.AUDIO]={startPTS:g,endPTS:v,startDTS:x,endDTS:S}),a.setElementaryStreamInfo(le.AUDIO,g,v,x,S),this.bufferFragmentData(y,a,u,o)}if(m&&h!=null&&(t=h.samples)!=null&&t.length){const g={id:n,frag:a,details:m,samples:h.samples};i.trigger(T.FRAG_PARSING_METADATA,g)}if(m&&d){const g={id:n,frag:a,details:m,samples:d.samples};i.trigger(T.FRAG_PARSING_USERDATA,g)}}_bufferInitSegment(e,t,n,i){if(this.state!==$.PARSING)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&delete t.audio;const{audio:s,video:o,audiovideo:l}=t;if(s){let a=e.audioCodec;const u=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){a&&(a.indexOf("mp4a.40.5")!==-1?a="mp4a.40.2":a="mp4a.40.5");const c=s.metadata;c&&"channelCount"in c&&(c.channelCount||1)!==1&&u.indexOf("firefox")===-1&&(a="mp4a.40.5")}a&&a.indexOf("mp4a.40.5")!==-1&&u.indexOf("android")!==-1&&s.container!=="audio/mpeg"&&(a="mp4a.40.2",this.log(`Android: force audio codec to ${a}`)),e.audioCodec&&e.audioCodec!==a&&this.log(`Swapping manifest audio codec "${e.audioCodec}" for "${a}"`),s.levelCodec=a,s.id="main",this.log(`Init audio buffer, container:${s.container}, codecs[selected/level/parsed]=[${a||""}/${e.audioCodec||""}/${s.codec}]`)}o&&(o.levelCodec=e.videoCodec,o.id="main",this.log(`Init video buffer, container:${o.container}, codecs[level/parsed]=[${e.videoCodec||""}/${o.codec}]`)),l&&this.log(`Init audiovideo buffer, container:${l.container}, codecs[level/parsed]=[${e.codecs}/${l.codec}]`),this.hls.trigger(T.BUFFER_CODECS,t),Object.keys(t).forEach(a=>{const c=t[a].initSegment;c!=null&&c.byteLength&&this.hls.trigger(T.BUFFER_APPENDING,{type:a,data:c,frag:n,part:null,chunkMeta:i,parent:n.type})}),this.tickImmediate()}getMainFwdBufferInfo(){return this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,q.MAIN)}backtrack(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=$.IDLE}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&e.seeking===!1){const n=e.currentTime;if(fe.isBuffered(e,n)?t=this.getAppendedFrag(n):fe.isBuffered(e,n+.1)&&(t=this.getAppendedFrag(n+.1)),t){this.backtrackFragment=null;const i=this.fragPlaying,s=t.level;(!i||t.sn!==i.sn||i.level!==s)&&(this.fragPlaying=t,this.hls.trigger(T.FRAG_CHANGED,{frag:t}),(!i||i.level!==s)&&this.hls.trigger(T.LEVEL_SWITCHED,{level:s}))}}}get nextLevel(){const e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){const e=this.media;return e?this.fragPlaying||this.getAppendedFrag(e.currentTime):null}get currentProgramDateTime(){const e=this.media;if(e){const t=e.currentTime,n=this.currentFrag;if(n&&z(t)&&z(n.programDateTime)){const i=n.programDateTime+(t-n.start)*1e3;return new Date(i)}}return null}get currentLevel(){const e=this.currentFrag;return e?e.level:-1}get nextBufferedFrag(){const e=this.currentFrag;return e?this.followingBufferedFrag(e):null}get forceStartLoad(){return this._forceStartLoad}}class Rr{static get version(){return"1.5.15"}static isMSESupported(){return yy()}static isSupported(){return RA()}static getMediaSource(){return dn()}static get Events(){return T}static get ErrorTypes(){return X}static get ErrorDetails(){return P}static get DefaultConfig(){return Rr.defaultConfig?Rr.defaultConfig:my}static set DefaultConfig(e){Rr.defaultConfig=e}constructor(e={}){this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this.started=!1,this._emitter=new Tf,this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null,this.triggeringException=void 0,TS(e.debug||!1,"Hls instance");const t=this.config=wA(Rr.DefaultConfig,e);this.userConfig=e,t.progressive&&bA(t);const{abrController:n,bufferController:i,capLevelController:s,errorController:o,fpsController:l}=t,a=new o(this),u=this.abrController=new n(this),c=this.bufferController=new i(this),f=this.capLevelController=new s(this),d=new l(this),h=new gT(this),p=new ST(this),m=t.contentSteeringController,y=m?new m(this):null,g=this.levelController=new AA(this,y),v=new XT(this),x=new LA(this.config),S=this.streamController=new OA(this,v,x);f.setStreamController(S),d.setStreamController(S);const E=[h,g,S];y&&E.splice(1,0,y),this.networkControllers=E;const b=[u,c,f,d,p,v];this.audioTrackController=this.createController(t.audioTrackController,E);const w=t.audioStreamController;w&&E.push(new w(this,v,x)),this.subtitleTrackController=this.createController(t.subtitleTrackController,E);const A=t.subtitleStreamController;A&&E.push(new A(this,v,x)),this.createController(t.timelineController,b),x.emeController=this.emeController=this.createController(t.emeController,b),this.cmcdController=this.createController(t.cmcdController,b),this.latencyController=this.createController(TT,b),this.coreComponents=b,E.push(a);const R=a.onErrorOut;typeof R=="function"&&this.on(T.ERROR,R,a)}createController(e,t){if(e){const n=new e(this);return t&&t.push(n),n}return null}on(e,t,n=this){this._emitter.on(e,t,n)}once(e,t,n=this){this._emitter.once(e,t,n)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,n=this,i){this._emitter.off(e,t,n,i)}listeners(e){return this._emitter.listeners(e)}emit(e,t,n){return this._emitter.emit(e,t,n)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(n){if(I.error("An internal error happened while handling event "+e+'. Error message: "'+n.message+'". Here is a stacktrace:',n),!this.triggeringException){this.triggeringException=!0;const i=e===T.ERROR;this.trigger(T.ERROR,{type:X.OTHER_ERROR,details:P.INTERNAL_EXCEPTION,fatal:i,event:e,error:n}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){I.log("destroy"),this.trigger(T.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(t=>t.destroy()),this.networkControllers.length=0,this.coreComponents.forEach(t=>t.destroy()),this.coreComponents.length=0;const e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}attachMedia(e){I.log("attachMedia"),this._media=e,this.trigger(T.MEDIA_ATTACHING,{media:e})}detachMedia(){I.log("detachMedia"),this.trigger(T.MEDIA_DETACHING,void 0),this._media=null}loadSource(e){this.stopLoad();const t=this.media,n=this.url,i=this.url=uf.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,I.log(`loadSource:${i}`),t&&n&&(n!==i||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(T.MANIFEST_LOADING,{url:e})}startLoad(e=-1){I.log(`startLoad(${e})`),this.started=!0,this.networkControllers.forEach(t=>{t.startLoad(e)})}stopLoad(){I.log("stopLoad"),this.started=!1,this.networkControllers.forEach(e=>{e.stopLoad()})}resumeBuffering(){this.started&&this.networkControllers.forEach(e=>{"fragmentLoader"in e&&e.startLoad(-1)})}pauseBuffering(){this.networkControllers.forEach(e=>{"fragmentLoader"in e&&e.stopLoad()})}swapAudioCodec(){I.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){I.log("recoverMediaError");const e=this._media;this.detachMedia(),e&&this.attachMedia(e)}removeLevel(e){this.levelController.removeLevel(e)}get levels(){const e=this.levelController.levels;return e||[]}get currentLevel(){return this.streamController.currentLevel}set currentLevel(e){I.log(`set currentLevel:${e}`),this.levelController.manualLevel=e,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){I.log(`set nextLevel:${e}`),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){I.log(`set loadLevel:${e}`),this.levelController.manualLevel=e}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(e){this.levelController.nextLoadLevel=e}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(e){I.log(`set firstLevel:${e}`),this.levelController.firstLevel=e}get startLevel(){const e=this.levelController.startLevel;return e===-1&&this.abrController.forcedAutoLevel>-1?this.abrController.forcedAutoLevel:e}set startLevel(e){I.log(`set startLevel:${e}`),e!==-1&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(e){const t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimate():NaN}set bandwidthEstimate(e){this.abrController.resetEstimator(e)}get ttfbEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimateTTFB():NaN}set autoLevelCapping(e){this._autoLevelCapping!==e&&(I.log(`set autoLevelCapping:${e}`),this._autoLevelCapping=e,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){wT(e)&&this._maxHdcpLevel!==e&&(this._maxHdcpLevel=e,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return this.levelController.manualLevel===-1}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:e,config:{minAutoBitrate:t}}=this;if(!e)return 0;const n=e.length;for(let i=0;i=t)return i;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:n}=this;let i;if(t===-1&&e!=null&&e.length?i=e.length-1:i=t,n)for(let s=i;s--;){const o=e[s].attrs["HDCP-LEVEL"];if(o&&o<=n)return s}return i}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(e){this.abrController.nextAutoLevel=e}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}setAudioOption(e){var t;return(t=this.audioTrackController)==null?void 0:t.setAudioOption(e)}setSubtitleOption(e){var t;return(t=this.subtitleTrackController)==null||t.setSubtitleOption(e),null}get allAudioTracks(){const e=this.audioTrackController;return e?e.allAudioTracks:[]}get audioTracks(){const e=this.audioTrackController;return e?e.audioTracks:[]}get audioTrack(){const e=this.audioTrackController;return e?e.audioTrack:-1}set audioTrack(e){const t=this.audioTrackController;t&&(t.audioTrack=e)}get allSubtitleTracks(){const e=this.subtitleTrackController;return e?e.allSubtitleTracks:[]}get subtitleTracks(){const e=this.subtitleTrackController;return e?e.subtitleTracks:[]}get subtitleTrack(){const e=this.subtitleTrackController;return e?e.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(e){const t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}get subtitleDisplay(){const e=this.subtitleTrackController;return e?e.subtitleDisplay:!1}set subtitleDisplay(e){const t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(e){this.config.lowLatencyMode=e}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}}Rr.defaultConfig=void 0;var la={exports:{}};/*! + * artplayer-plugin-hls-quality.js v2.0.0 + * Github: https://github.com/zhw2590582/ArtPlayer + * (c) 2017-2023 Harvey Zack + * Released under the MIT License. + */la.exports;(function(r,e){(function(t,n,i,s,o){var l=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof So<"u"?So:{},a=typeof l[s]=="function"&&l[s],u=a.cache||{},c=typeof qo=="function"&&qo.bind(r);function f(p,m){if(!u[p]){if(!t[p]){var y=typeof l[s]=="function"&&l[s];if(!m&&y)return y(p,!0);if(a)return a(p,!0);if(c&&typeof p=="string")return c(p);var g=new Error("Cannot find module '"+p+"'");throw g.code="MODULE_NOT_FOUND",g}x.resolve=function(S){var E=t[p][1][S];return E??S},x.cache={};var v=u[p]=new f.Module(p);t[p][0].call(v.exports,x,v,v.exports,this)}return u[p].exports;function x(S){var E=x.resolve(S);return E===!1?{}:f(E)}}f.isParcelRequire=!0,f.Module=function(p){this.id=p,this.bundle=f,this.exports={}},f.modules=t,f.cache=u,f.parent=a,f.register=function(p,m){t[p]=[function(y,g){g.exports=m},{}]},Object.defineProperty(f,"root",{get:function(){return l[s]}}),l[s]=f;for(var d=0;d{(function(p){const{version:m,utils:{errorHandle:y}}=p.constructor,g=m.split(".").map(Number);y(g[0]+g[1]/100>=5,`Artplayer.js@${m} is not compatible the artplayerPluginHlsQuality@${a.version}. Please update it to version Artplayer.js@5.x.x`)})(c);const{$video:f}=c.template,{errorHandle:d}=c.constructor.utils;function h(){const p=c.hls||window.hls;d(p&&p.media===f,'Cannot find instance of HLS from "art.hls" or "window.hls"');const m=u.auto||"Auto",y=u.title||"Quality",g=u.getResolution||(S=>(S.height||"Unknown ")+"P"),v=p.levels[p.currentLevel],x=v?g(v):m;u.control&&c.controls.update({name:"hls-quality",position:"right",html:x,style:{padding:"0 10px"},selector:p.levels.map((S,E)=>({html:g(S),level:S.level||E,default:v===S})),onSelect:S=>(p.currentLevel=S.level,c.loading.show=!0,S.html)}),u.setting&&c.setting.update({name:"hls-quality",tooltip:x,html:y,icon:l.default,width:200,selector:p.levels.map((S,E)=>({html:g(S),level:S.level||E,default:v===S})),onSelect:function(S){return p.currentLevel=S.level,c.loading.show=!0,S.html}})}return c.on("ready",h),c.on("restart",h),{name:"artplayerPluginHlsQuality"}}}i.default=a,a.env="production",a.version="2.0.0",a.build="2023-04-23 18:13:04",typeof window<"u"&&(window.artplayerPluginHlsQuality=a)},{"bundle-text:./image.svg":"5VXix","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"5VXix":[function(t,n,i){n.exports=''},{}],"9pCYc":[function(t,n,i){i.interopDefault=function(s){return s&&s.__esModule?s:{default:s}},i.defineInteropFlag=function(s){Object.defineProperty(s,"__esModule",{value:!0})},i.exportAll=function(s,o){return Object.keys(s).forEach(function(l){l==="default"||l==="__esModule"||o.hasOwnProperty(l)||Object.defineProperty(o,l,{enumerable:!0,get:function(){return s[l]}})}),o},i.export=function(s,o,l){Object.defineProperty(s,o,{enumerable:!0,get:l})}},{}]},["eEHR6"],"eEHR6","parcelRequire4dc0")})(la,la.exports);var FA=la.exports;const MA=ua(FA),NA=({videoUrl:r,localFile:e,getInstance:t,...n})=>{const i=ht.useRef(null);ht.useEffect(()=>{const o=new hS({url:r,autoplay:!1,autoSize:!1,autoMini:!0,loop:!1,playbackRate:!0,fullscreen:!0,autoOrientation:!0,aspectRatio:!0,autoPlayback:!0,setting:!0,screenshot:!0,miniProgressBar:!0,hotkey:!0,pip:!0,airplay:!0,lock:!0,isLive:!1,container:i.current,customType:{m3u8:s,flv:s,mp4:s},controls:[{name:"skip-85",position:"right",html:'+85s',click:function(){o.seek=o.currentTime+85}}],plugins:[MA({setting:!0,getResolution:l=>`${l.height!==0?l.height+"p":"Default"}`,title:"Quality",auto:"Auto"})]});return e&&o.switchUrl(URL.createObjectURL(e)),t&&typeof t=="function"&&t(o),()=>{o&&o.destroy&&o.destroy(!1)}},[r,e,t]);function s(o,l,a){if(l.includes(".m3u8"))if(Rr.isSupported()){a.hls&&a.hls.destroy();const u=new Rr;u.loadSource(l),u.attachMedia(o),a.hls=u,a.on("destroy",()=>u.destroy())}else o.canPlayType("application/vnd.apple.mpegurl")?o.src=l:a.notice.show="Unsupported playback format: m3u8";else o.src=l}return te.jsx("div",{ref:i,...n})},BA=()=>{const[r,e]=ht.useState(""),[t,n]=ht.useState(""),[i,s]=ht.useState(!0),[o,l]=ht.useState(!1),[a,u]=ht.useState(null);ht.useEffect(()=>{document.body.classList.toggle("dark-mode",i)},[i]);const c=p=>{e(p.target.value)},f=()=>{r&&(n(r),u(null),l(!0))},d=p=>{const m=p.target.files[0];m&&(u(m),n(""),l(!0))},h=()=>{s(!i)};return te.jsxs("div",{className:`min-h-screen ${i?"bg-gradient-to-br from-gray-900 to-gray-800":"bg-gradient-to-br from-blue-100 to-purple-200"} text-gray-200 font-['Roboto'] transition-colors duration-300`,children:[te.jsxs("div",{className:"container mx-auto px-4",children:[te.jsx(uS,{darkMode:i,toggleDarkMode:h}),te.jsxs("main",{className:"mx-auto",children:[te.jsx(cS,{inputUrl:r,handleInputChange:c,handlePlay:f,handleFileUpload:d,darkMode:i}),o&&te.jsx("div",{className:`${i?"bg-gray-800":"bg-white"} rounded-lg p-4 shadow-lg transition-colors duration-300 flex justify-center items-center`,children:te.jsxs("div",{className:"sm:w-[80%] sm:h-[50%]",children:[te.jsx(NA,{videoUrl:t,localFile:a,className:"w-full aspect-video rounded-lg overflow-hidden"}),te.jsx("p",{className:"mt-1 text-sm text-red-500",children:"⚠️ If the player keeps loading, try changing the link and try again."})]})})]})]}),te.jsx(fS,{darkMode:i})]})};function UA(){return te.jsx("div",{className:"App",children:te.jsx(BA,{})})}Am(document.getElementById("root")).render(te.jsx(ht.StrictMode,{children:te.jsx(UA,{})})); diff --git a/assets/index-s4pI0_vQ.css b/assets/index-s4pI0_vQ.css new file mode 100644 index 0000000..54e54ef --- /dev/null +++ b/assets/index-s4pI0_vQ.css @@ -0,0 +1 @@ +*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.absolute{position:absolute}.bottom-0{bottom:0}.mx-auto{margin-left:auto;margin-right:auto}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.mr-4{margin-right:1rem}.mt-1{margin-top:.25rem}.mt-8{margin-top:2rem}.flex{display:flex}.hidden{display:none}.aspect-video{aspect-ratio:16 / 9}.min-h-screen{min-height:100vh}.w-full{width:100%}.flex-grow{flex-grow:1}.cursor-pointer{cursor:pointer}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.overflow-hidden{overflow:hidden}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.border-2{border-width:2px}.border-purple-300{--tw-border-opacity: 1;border-color:rgb(216 180 254 / var(--tw-border-opacity))}.border-purple-500{--tw-border-opacity: 1;border-color:rgb(168 85 247 / var(--tw-border-opacity))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity))}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity))}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}.bg-gray-700{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity))}.bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.bg-purple-500{--tw-bg-opacity: 1;background-color:rgb(168 85 247 / var(--tw-bg-opacity))}.bg-purple-600{--tw-bg-opacity: 1;background-color:rgb(147 51 234 / var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.from-blue-100{--tw-gradient-from: #dbeafe var(--tw-gradient-from-position);--tw-gradient-to: rgb(219 234 254 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-gray-900{--tw-gradient-from: #111827 var(--tw-gradient-from-position);--tw-gradient-to: rgb(17 24 39 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-gray-800{--tw-gradient-to: #1f2937 var(--tw-gradient-to-position)}.to-purple-200{--tw-gradient-to: #e9d5ff var(--tw-gradient-to-position)}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-4{padding-left:1rem;padding-right:1rem}.text-center{text-align:center}.font-\[\'Roboto\'\]{font-family:Roboto}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-base{font-size:1rem;line-height:1.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity))}.text-gray-200{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity))}.text-purple-400{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity))}.text-purple-600{--tw-text-opacity: 1;color:rgb(147 51 234 / var(--tw-text-opacity))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.text-yellow-400{--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity))}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-300{transition-duration:.3s}.hover\:bg-blue-600:hover{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity))}.hover\:bg-blue-700:hover{--tw-bg-opacity: 1;background-color:rgb(29 78 216 / var(--tw-bg-opacity))}.hover\:bg-gray-300:hover{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity))}.hover\:bg-gray-700:hover{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity))}.hover\:bg-purple-600:hover{--tw-bg-opacity: 1;background-color:rgb(147 51 234 / var(--tw-bg-opacity))}.hover\:bg-purple-700:hover{--tw-bg-opacity: 1;background-color:rgb(126 34 206 / var(--tw-bg-opacity))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-purple-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(192 132 252 / var(--tw-ring-opacity))}.focus\:ring-purple-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(168 85 247 / var(--tw-ring-opacity))}@media (min-width: 640px){.sm\:h-\[50\%\]{height:50%}.sm\:w-\[80\%\]{width:80%}.sm\:flex-row{flex-direction:row}} diff --git a/index.html b/index.html new file mode 100644 index 0000000..b1e09d7 --- /dev/null +++ b/index.html @@ -0,0 +1,22 @@ + + + + + + + Ani-player: Your Ultimate Video Playback Experience + + + + + + + + + +
+ + diff --git a/logo.png b/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..fd3578bf2c8d451f945854346292f20d42100c4c GIT binary patch literal 46329 zcmYIu1CV4*7wnF0+qP}**tTtZc5K@_c8@*Z*xs>i+pqt4@!~~fXIDp5-&>t=@|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