@gientech/modual 2.3.32 → 2.3.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/README.md +761 -761
  2. package/assets/DrawerVideo-Da3LzJAm.js +272 -0
  3. package/assets/PlusOutlined-039_HuLB.js +2 -0
  4. package/assets/QuestionCircleOutlined-BsYIcMyN.js +1 -0
  5. package/assets/ReviewSetting-puxjJGzg.js +289 -0
  6. package/assets/database.svg +11 -11
  7. package/assets/database_add.svg +53 -53
  8. package/assets/database_connect.svg +66 -66
  9. package/assets/database_upload.svg +29 -29
  10. package/assets/databse.svg +6 -6
  11. package/assets/defaultWeLogo.svg +14 -14
  12. package/assets/graph.svg +4 -4
  13. package/assets/index-CfwfrZFA.js +170 -0
  14. package/assets/{PlusOutlined-Di4ORSd7.js → index-DPzKige0.js} +37 -38
  15. package/assets/index-DgJUOTLq.js +72 -0
  16. package/assets/{index-CqVjnw4y.js → index-cNdkGmTA.js} +6 -6
  17. package/assets/knowledge.svg +4 -4
  18. package/assets/mysql.svg +14 -14
  19. package/assets/sensitive.svg +5 -5
  20. package/assets/{style-DPnATCAX.js → style-BGXcGFbs.js} +8 -8
  21. package/assets/style10.css +1 -1
  22. package/assets/style11.css +1 -0
  23. package/assets/style4.css +1 -1
  24. package/assets/style5.css +1 -1
  25. package/assets/style6.css +1 -1
  26. package/assets/style7.css +1 -1
  27. package/assets/style8.css +1 -1
  28. package/assets/style9.css +1 -1
  29. package/assistantConfig.js +1 -1
  30. package/chat.js +1 -1
  31. package/chatCompare.js +1 -1
  32. package/database.js +2 -2
  33. package/graphBase.js +1 -1
  34. package/index.d.ts +1 -0
  35. package/index.js +1 -1
  36. package/package.json +8 -8
  37. package/reviewManage.js +9 -9
  38. package/reviewSetting.d.ts +1 -0
  39. package/reviewSetting.js +1 -1
  40. package/worker/pdf.worker.min.js +21 -21
  41. package/assets/ReviewSetting-B1woOKkD.js +0 -454
  42. package/assets/index-CTZ4NZKD.js +0 -343
  43. package/assets/index-CxKRvyc8.js +0 -157
@@ -0,0 +1,272 @@
1
+ import{jsx as Ti,Fragment as hg,jsxs as Yu}from"react/jsx-runtime";import Oc,{useMemo as Va,forwardRef as To,createElement as za,useImperativeHandle as dg,useRef as Wa,useState as Nc,useEffect as Rc,useCallback as Rt}from"react";import{G as pg}from"./GientechStreamReader-CnAI3q38.js";import"dayjs";import mg from"axios";import{u as gg}from"./index-CpW6Dhpp.js";const fg="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACqSURBVHgBzZFNDoQgDIX5uQ3hOMDam8gcxS2nmDkEbL0JDDViiJay9SVNatv3RZ+MvUbOud0Ys87u4MZau7dn0e02zrmnILCDm1pbm8nWxBi/WmteW6+UYiml38D8CSH4B4CCjMwgjr1qzcOXUtZax/HIPAT0kBOAmkFiBMg5F6y/S2LD/ptrQQ5osCjgHtjs70jK3OYURM7MM8gVohBiodIGwe7MZWGv0R+Uy3dwBYPzyQAAAABJRU5ErkJggg==",yg=r=>r||"",_g=["txt","pdf","jpeg","jpg","png"],Z1=r=>[""].includes(r),bg=`http://${location.hostname}:9000/`,eb=()=>"/proxy",vg=r=>{var i;let e=r==null?void 0:r.file_type;const t=(i=r==null?void 0:r.metadata)==null?void 0:i.source;if(t)e=t.split(".").slice(-1)[0];else return(r==null?void 0:r.file_source)||"";return _g.includes(e)?t.includes("http")?t:`${bg}${t}`:(r==null?void 0:r.file_source)||""},tb=r=>{if(!r)return"";const e=r.split("/"),t=e.length,i=e[t-3];if(!i)return"";const s=i.split(".");return s[s.length-1]},Tg=r=>{try{if(!r)return"";const e=r.split("/"),t=e.length;return e[t-3]||""}catch{return""}},Sg=r=>{var t;if(r!=null&&r.sourceFileName)return r.sourceFileName;if(!r)return"";const e=(t=r==null?void 0:r.metadata)==null?void 0:t.source;return e?Tg(e):""},Eg=(r,e)=>{var i;if(!r)return"";const t=(i=r==null?void 0:r.metadata)==null?void 0:i.source;if(t){const s=t.split(".");if(!s.length)return"";const n=s[s.length-1],a=(e||"").split(".");if(!a.length)return"";const u=a[a.length-1];switch(n.toLocaleLowerCase()){case"ppt":case"pub":case"pptx":return"pdf_slides";case"xls":case"xlsx":case"csv":return u==="pdf"?"pdf":"markdown_table";case"md":return"pdf";case"png":case"jpg":case"jpeg":return"image";case"html":case"htm":return"html";case"txt":return"text";default:return u==="ppt"||u==="pub"||u==="pptx"?"pdf_slides":"pdf"}}else return""},ib=async({filePath:r,fileName:e,token:t})=>{if(r&&e)try{const i=await mg.post("/proxy/index/knowledgeBase/file/stream",{convertedFilePath:r},{headers:{"Content-Type":"application/json",Authorization:t},responseType:"arraybuffer"});console.log("response",i);const s=new Blob([i.data]),n=window.URL.createObjectURL(s),a=document.createElement("a"),u=document.body;a.href=n,a.download=e,a.style.display="none",u.appendChild(a);const c=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0});a.dispatchEvent(c),setTimeout(()=>{u.removeChild(a),window.URL.revokeObjectURL(n)},100)}catch(i){console.error("\u4E0B\u8F7D\u6587\u4EF6\u5931\u8D25\uFF1A",i)}else console.error("\u7F3A\u5C11\u6587\u4EF6\u540D\u6216\u6587\u4EF6\u5730\u5740\uFF1A")},rb=({curFileInfo:r,onClose:e,token:t})=>{const i=Va(()=>{var n;if(r&&t){console.log("content999",r);const a={file_source:r.parse_url||r.parsedFilePath||r.url,file_type:r.file_type,metadata:{source:((n=r==null?void 0:r.metadata)==null?void 0:n.source)||r.filePath||r.url||""},pdfPages:r.pdfPages},u=yg(vg(a));return{filePath:u,fileName:Sg(a),fileType:Eg(a,u),totalPages:a.pdfPages||0,token:t}}else return{}},[r]),s=Va(()=>(console.log("curData",i),i.filePath?Ti(pg,{convertedFilePath:i.filePath,fileName:i.fileName,fileType:i.fileType,initialPage:1,totalPages:i.totalPages,authorization:i.token,streamApiUrl:"/proxy/index/knowledgeBase/file/stream",eventsEmit:n=>{switch(n){case"viewer:close":e();break}},tools:{close:!0}}):Ti(hg,{})),[i]);return Ti("div",{id:"pdfBox",className:"h-full overflow-y-auto",children:s})};var on=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ps(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Cg(r){if(Object.prototype.hasOwnProperty.call(r,"__esModule"))return r;var e=r.default;if(typeof e=="function"){var t=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(i){var s=Object.getOwnPropertyDescriptor(r,i);Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:function(){return r[i]}})}),t}var Qu={exports:{}},Gr={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Ju;function wg(){if(Ju)return Gr;Ju=1;var r=Oc,e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,n={key:!0,ref:!0,__self:!0,__source:!0};function a(u,c,m){var f,_={},P=null,S=null;m!==void 0&&(P=""+m),c.key!==void 0&&(P=""+c.key),c.ref!==void 0&&(S=c.ref);for(f in c)i.call(c,f)&&!n.hasOwnProperty(f)&&(_[f]=c[f]);if(u&&u.defaultProps)for(f in c=u.defaultProps,c)_[f]===void 0&&(_[f]=c[f]);return{$$typeof:e,type:u,key:P,ref:S,props:_,_owner:s.current}}return Gr.Fragment=t,Gr.jsx=a,Gr.jsxs=a,Gr}var Zu;function kg(){return Zu||(Zu=1,Qu.exports=wg()),Qu.exports}var le=kg(),ha,el;function xn(){if(el)return ha;el=1;var r;return typeof window<"u"?r=window:typeof on<"u"?r=on:typeof self<"u"?r=self:r={},ha=r,ha}var Ag=xn();const A=ps(Ag),xg={},Dg=Object.freeze(Object.defineProperty({__proto__:null,default:xg},Symbol.toStringTag,{value:"Module"})),Ig=Cg(Dg);var da,tl;function Mc(){if(tl)return da;tl=1;var r=typeof on<"u"?on:typeof window<"u"?window:{},e=Ig,t;return typeof document<"u"?t=document:(t=r["__GLOBAL_DOCUMENT_CACHE@4"],t||(t=r["__GLOBAL_DOCUMENT_CACHE@4"]=e)),da=t,da}var Pg=Mc();const re=ps(Pg);var Ys={exports:{}},il={exports:{}},rl;function Lg(){return rl||(rl=1,(function(r){function e(){return r.exports=e=Object.assign?Object.assign.bind():function(t){for(var i=1;i<arguments.length;i++){var s=arguments[i];for(var n in s)({}).hasOwnProperty.call(s,n)&&(t[n]=s[n])}return t},r.exports.__esModule=!0,r.exports.default=r.exports,e.apply(null,arguments)}r.exports=e,r.exports.__esModule=!0,r.exports.default=r.exports})(il)),il.exports}var pa,sl;function Og(){if(sl)return pa;sl=1,pa=e;var r=Object.prototype.toString;function e(t){if(!t)return!1;var i=r.call(t);return i==="[object Function]"||typeof t=="function"&&i!=="[object RegExp]"||typeof window<"u"&&(t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt)}return pa}var ma,nl;function Ng(){if(nl)return ma;nl=1;function r(s,n){var a=typeof Symbol<"u"&&s[Symbol.iterator]||s["@@iterator"];if(a)return(a=a.call(s)).next.bind(a);if(Array.isArray(s)||(a=e(s))||n){a&&(s=a);var u=0;return function(){return u>=s.length?{done:!0}:{done:!1,value:s[u++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
10
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function e(s,n){if(s){if(typeof s=="string")return t(s,n);var a=Object.prototype.toString.call(s).slice(8,-1);if(a==="Object"&&s.constructor&&(a=s.constructor.name),a==="Map"||a==="Set")return Array.from(s);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return t(s,n)}}function t(s,n){(n==null||n>s.length)&&(n=s.length);for(var a=0,u=new Array(n);a<n;a++)u[a]=s[a];return u}var i=(function(){function s(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1}var n=s.prototype;return n.getIsEnabled=function(){return this.enabled_},n.enable=function(){this.enabled_=!0},n.disable=function(){this.enabled_=!1},n.reset=function(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1},n.addInterceptor=function(a,u){this.typeToInterceptorsMap_.has(a)||this.typeToInterceptorsMap_.set(a,new Set);var c=this.typeToInterceptorsMap_.get(a);return c.has(u)?!1:(c.add(u),!0)},n.removeInterceptor=function(a,u){var c=this.typeToInterceptorsMap_.get(a);return c&&c.has(u)?(c.delete(u),!0):!1},n.clearInterceptorsByType=function(a){var u=this.typeToInterceptorsMap_.get(a);return u?(this.typeToInterceptorsMap_.delete(a),this.typeToInterceptorsMap_.set(a,new Set),!0):!1},n.clear=function(){return this.typeToInterceptorsMap_.size?(this.typeToInterceptorsMap_=new Map,!0):!1},n.getForType=function(a){return this.typeToInterceptorsMap_.get(a)||new Set},n.execute=function(a,u){for(var c=this.getForType(a),m=r(c),f;!(f=m()).done;){var _=f.value;try{u=_(u)}catch{}}return u},s})();return ma=i,ma}var ga,al;function Rg(){if(al)return ga;al=1;var r=(function(){function t(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1}var i=t.prototype;return i.getIsEnabled=function(){return this.enabled_},i.enable=function(){this.enabled_=!0},i.disable=function(){this.enabled_=!1},i.reset=function(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1},i.getMaxAttempts=function(){return this.maxAttempts_},i.setMaxAttempts=function(s){this.maxAttempts_=s},i.getDelayFactor=function(){return this.delayFactor_},i.setDelayFactor=function(s){this.delayFactor_=s},i.getFuzzFactor=function(){return this.fuzzFactor_},i.setFuzzFactor=function(s){this.fuzzFactor_=s},i.getInitialDelay=function(){return this.initialDelay_},i.setInitialDelay=function(s){this.initialDelay_=s},i.createRetry=function(s){var n=s===void 0?{}:s,a=n.maxAttempts,u=n.delayFactor,c=n.fuzzFactor,m=n.initialDelay;return new e({maxAttempts:a||this.maxAttempts_,delayFactor:u||this.delayFactor_,fuzzFactor:c||this.fuzzFactor_,initialDelay:m||this.initialDelay_})},t})(),e=(function(){function t(s){this.maxAttempts_=s.maxAttempts,this.delayFactor_=s.delayFactor,this.fuzzFactor_=s.fuzzFactor,this.currentDelay_=s.initialDelay,this.currentAttempt_=1}var i=t.prototype;return i.moveToNextAttempt=function(){this.currentAttempt_++;var s=this.currentDelay_*this.delayFactor_;this.currentDelay_=this.currentDelay_+s},i.shouldRetry=function(){return this.currentAttempt_<this.maxAttempts_},i.getCurrentDelay=function(){return this.currentDelay_},i.getCurrentMinPossibleDelay=function(){return(1-this.fuzzFactor_)*this.currentDelay_},i.getCurrentMaxPossibleDelay=function(){return(1+this.fuzzFactor_)*this.currentDelay_},i.getCurrentFuzzedDelay=function(){var s=this.getCurrentMinPossibleDelay(),n=this.getCurrentMaxPossibleDelay();return s+Math.random()*(n-s)},t})();return ga=r,ga}var fa,ol;function Mg(){if(ol)return fa;ol=1;var r=xn(),e=function(i,s){return s===void 0&&(s=!1),function(n,a,u){if(n){i(n);return}if(a.statusCode>=400&&a.statusCode<=599){var c=u;if(s)if(r.TextDecoder){var m=t(a.headers&&a.headers["content-type"]);try{c=new TextDecoder(m).decode(u)}catch{}}else c=String.fromCharCode.apply(null,new Uint8Array(u));i({cause:c});return}i(null,u)}};function t(i){return i===void 0&&(i=""),i.toLowerCase().split(";").reduce(function(s,n){var a=n.split("="),u=a[0],c=a[1];return u.trim()==="charset"?c.trim():s},"utf-8")}return fa=e,fa}var ul;function Bg(){if(ul)return Ys.exports;ul=1;var r=xn(),e=Lg(),t=Og(),i=Ng(),s=Rg();m.httpHandler=Mg(),m.requestInterceptorsStorage=new i,m.responseInterceptorsStorage=new i,m.retryManager=new s;/**
11
+ * @license
12
+ * slighly modified parse-headers 2.0.2 <https://github.com/kesla/parse-headers/>
13
+ * Copyright (c) 2014 David Björklund
14
+ * Available under the MIT license
15
+ * <https://github.com/kesla/parse-headers/blob/master/LICENCE>
16
+ */var n=function(S){var R={};return S&&S.trim().split(`
17
+ `).forEach(function(b){var I=b.indexOf(":"),M=b.slice(0,I).trim().toLowerCase(),N=b.slice(I+1).trim();typeof R[M]>"u"?R[M]=N:Array.isArray(R[M])?R[M].push(N):R[M]=[R[M],N]}),R};Ys.exports=m,Ys.exports.default=m,m.XMLHttpRequest=r.XMLHttpRequest||P,m.XDomainRequest="withCredentials"in new m.XMLHttpRequest?m.XMLHttpRequest:r.XDomainRequest,a(["get","put","post","patch","head","delete"],function(S){m[S==="delete"?"del":S]=function(R,b,I){return b=c(R,b,I),b.method=S.toUpperCase(),f(b)}});function a(S,R){for(var b=0;b<S.length;b++)R(S[b])}function u(S){for(var R in S)if(S.hasOwnProperty(R))return!1;return!0}function c(S,R,b){var I=S;return t(R)?(b=R,typeof S=="string"&&(I={uri:S})):I=e({},R,{uri:S}),I.callback=b,I}function m(S,R,b){return R=c(S,R,b),f(R)}function f(S){if(typeof S.callback>"u")throw new Error("callback argument missing");if(S.requestType&&m.requestInterceptorsStorage.getIsEnabled()){var R={uri:S.uri||S.url,headers:S.headers||{},body:S.body,metadata:S.metadata||{},retry:S.retry,timeout:S.timeout},b=m.requestInterceptorsStorage.execute(S.requestType,R);S.uri=b.uri,S.headers=b.headers,S.body=b.body,S.metadata=b.metadata,S.retry=b.retry,S.timeout=b.timeout}var I=!1,M=function(Q,J,Z){I||(I=!0,S.callback(Q,J,Z))};function N(){$.readyState===4&&!m.responseInterceptorsStorage.getIsEnabled()&&setTimeout(q,0)}function O(){var Q=void 0;if($.response?Q=$.response:Q=$.responseText||_($),K)try{Q=JSON.parse(Q)}catch{}return Q}function z(Q){if(clearTimeout(ee),clearTimeout(S.retryTimeout),Q instanceof Error||(Q=new Error(""+(Q||"Unknown XMLHttpRequest Error"))),Q.statusCode=0,!H&&m.retryManager.getIsEnabled()&&S.retry&&S.retry.shouldRetry()){S.retryTimeout=setTimeout(function(){S.retry.moveToNextAttempt(),S.xhr=$,f(S)},S.retry.getCurrentFuzzedDelay());return}if(S.requestType&&m.responseInterceptorsStorage.getIsEnabled()){var J={headers:se.headers||{},body:se.body,responseUrl:$.responseURL,responseType:$.responseType},Z=m.responseInterceptorsStorage.execute(S.requestType,J);se.body=Z.body,se.headers=Z.headers}return M(Q,se)}function q(){if(!H){var Q;clearTimeout(ee),clearTimeout(S.retryTimeout),S.useXDR&&$.status===void 0?Q=200:Q=$.status===1223?204:$.status;var J=se,Z=null;if(Q!==0?(J={body:O(),statusCode:Q,method:C,headers:{},url:v,rawRequest:$},$.getAllResponseHeaders&&(J.headers=n($.getAllResponseHeaders()))):Z=new Error("Internal XMLHttpRequest Error"),S.requestType&&m.responseInterceptorsStorage.getIsEnabled()){var ie={headers:J.headers||{},body:J.body,responseUrl:$.responseURL,responseType:$.responseType},te=m.responseInterceptorsStorage.execute(S.requestType,ie);J.body=te.body,J.headers=te.headers}return M(Z,J,J.body)}}var $=S.xhr||null;$||(S.cors||S.useXDR?$=new m.XDomainRequest:$=new m.XMLHttpRequest);var L,H,v=$.url=S.uri||S.url,C=$.method=S.method||"GET",V=S.body||S.data,U=$.headers=S.headers||{},F=!!S.sync,K=!1,ee,se={body:void 0,headers:{},statusCode:0,method:C,url:v,rawRequest:$};if("json"in S&&S.json!==!1&&(K=!0,U.accept||U.Accept||(U.Accept="application/json"),C!=="GET"&&C!=="HEAD"&&(U["content-type"]||U["Content-Type"]||(U["Content-Type"]="application/json"),V=JSON.stringify(S.json===!0?V:S.json))),$.onreadystatechange=N,$.onload=q,$.onerror=z,$.onprogress=function(){},$.onabort=function(){H=!0,clearTimeout(S.retryTimeout)},$.ontimeout=z,$.open(C,v,!F,S.username,S.password),F||($.withCredentials=!!S.withCredentials),!F&&S.timeout>0&&(ee=setTimeout(function(){if(!H){H=!0,$.abort("timeout");var Q=new Error("XMLHttpRequest timeout");Q.code="ETIMEDOUT",z(Q)}},S.timeout)),$.setRequestHeader)for(L in U)U.hasOwnProperty(L)&&$.setRequestHeader(L,U[L]);else if(S.headers&&!u(S.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in S&&($.responseType=S.responseType),"beforeSend"in S&&typeof S.beforeSend=="function"&&S.beforeSend($),$.send(V||null),$}function _(S){try{if(S.responseType==="document")return S.responseXML;var R=S.responseXML&&S.responseXML.documentElement.nodeName==="parsererror";if(S.responseType===""&&!R)return S.responseXML}catch{}return null}function P(){}return Ys.exports}var Ug=Bg();const Bc=ps(Ug);var ya={exports:{}},_a,ll;function Fg(){if(ll)return _a;ll=1;var r=Mc(),e=Object.create||(function(){function v(){}return function(C){if(arguments.length!==1)throw new Error("Object.create shim only accepts one parameter.");return v.prototype=C,new v}})();function t(v,C){this.name="ParsingError",this.code=v.code,this.message=C||v.message}t.prototype=e(Error.prototype),t.prototype.constructor=t,t.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}};function i(v){function C(U,F,K,ee){return(U|0)*3600+(F|0)*60+(K|0)+(ee|0)/1e3}var V=v.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return V?V[3]?C(V[1],V[2],V[3].replace(":",""),V[4]):V[1]>59?C(V[1],V[2],0,V[4]):C(0,V[1],V[2],V[4]):null}function s(){this.values=e(null)}s.prototype={set:function(v,C){!this.get(v)&&C!==""&&(this.values[v]=C)},get:function(v,C,V){return V?this.has(v)?this.values[v]:C[V]:this.has(v)?this.values[v]:C},has:function(v){return v in this.values},alt:function(v,C,V){for(var U=0;U<V.length;++U)if(C===V[U]){this.set(v,C);break}},integer:function(v,C){/^-?\d+$/.test(C)&&this.set(v,parseInt(C,10))},percent:function(v,C){return C.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(C=parseFloat(C),C>=0&&C<=100)?(this.set(v,C),!0):!1}};function n(v,C,V,U){var F=U?v.split(U):[v];for(var K in F)if(typeof F[K]=="string"){var ee=F[K].split(V);if(ee.length===2){var se=ee[0].trim(),Q=ee[1].trim();C(se,Q)}}}function a(v,C,V){var U=v;function F(){var se=i(v);if(se===null)throw new t(t.Errors.BadTimeStamp,"Malformed timestamp: "+U);return v=v.replace(/^[^\sa-zA-Z-]+/,""),se}function K(se,Q){var J=new s;n(se,function(Z,ie){switch(Z){case"region":for(var te=V.length-1;te>=0;te--)if(V[te].id===ie){J.set(Z,V[te].region);break}break;case"vertical":J.alt(Z,ie,["rl","lr"]);break;case"line":var me=ie.split(","),fe=me[0];J.integer(Z,fe),J.percent(Z,fe)&&J.set("snapToLines",!1),J.alt(Z,fe,["auto"]),me.length===2&&J.alt("lineAlign",me[1],["start","center","end"]);break;case"position":me=ie.split(","),J.percent(Z,me[0]),me.length===2&&J.alt("positionAlign",me[1],["start","center","end"]);break;case"size":J.percent(Z,ie);break;case"align":J.alt(Z,ie,["start","center","end","left","right"]);break}},/:/,/\s/),Q.region=J.get("region",null),Q.vertical=J.get("vertical","");try{Q.line=J.get("line","auto")}catch{}Q.lineAlign=J.get("lineAlign","start"),Q.snapToLines=J.get("snapToLines",!0),Q.size=J.get("size",100);try{Q.align=J.get("align","center")}catch{Q.align=J.get("align","middle")}try{Q.position=J.get("position","auto")}catch{Q.position=J.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},Q.align)}Q.positionAlign=J.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},Q.align)}function ee(){v=v.replace(/^\s+/,"")}if(ee(),C.startTime=F(),ee(),v.substr(0,3)!=="-->")throw new t(t.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+U);v=v.substr(3),ee(),C.endTime=F(),ee(),K(v,C)}var u=r.createElement&&r.createElement("textarea"),c={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},m={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},f={v:"title",lang:"lang"},_={rt:"ruby"};function P(v,C){function V(){if(!C)return null;function fe(pe){return C=C.substr(pe.length),pe}var _e=C.match(/^([^<]*)(<[^>]*>?)?/);return fe(_e[1]?_e[1]:_e[2])}function U(fe){return u.innerHTML=fe,fe=u.textContent,u.textContent="",fe}function F(fe,_e){return!_[_e.localName]||_[_e.localName]===fe.localName}function K(fe,_e){var pe=c[fe];if(!pe)return null;var Ke=v.document.createElement(pe),Je=f[fe];return Je&&_e&&(Ke[Je]=_e.trim()),Ke}for(var ee=v.document.createElement("div"),se=ee,Q,J=[];(Q=V())!==null;){if(Q[0]==="<"){if(Q[1]==="/"){J.length&&J[J.length-1]===Q.substr(2).replace(">","")&&(J.pop(),se=se.parentNode);continue}var Z=i(Q.substr(1,Q.length-2)),ie;if(Z){ie=v.document.createProcessingInstruction("timestamp",Z),se.appendChild(ie);continue}var te=Q.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!te||(ie=K(te[1],te[3]),!ie)||!F(se,ie))continue;if(te[2]){var me=te[2].split(".");me.forEach(function(fe){var _e=/^bg_/.test(fe),pe=_e?fe.slice(3):fe;if(m.hasOwnProperty(pe)){var Ke=_e?"background-color":"color",Je=m[pe];ie.style[Ke]=Je}}),ie.className=me.join(" ")}J.push(te[1]),se.appendChild(ie),se=ie;continue}se.appendChild(v.document.createTextNode(U(Q)))}return ee}var S=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function R(v){for(var C=0;C<S.length;C++){var V=S[C];if(v>=V[0]&&v<=V[1])return!0}return!1}function b(v){var C=[],V="",U;if(!v||!v.childNodes)return"ltr";function F(se,Q){for(var J=Q.childNodes.length-1;J>=0;J--)se.push(Q.childNodes[J])}function K(se){if(!se||!se.length)return null;var Q=se.pop(),J=Q.textContent||Q.innerText;if(J){var Z=J.match(/^.*(\n|\r)/);return Z?(se.length=0,Z[0]):J}if(Q.tagName==="ruby")return K(se);if(Q.childNodes)return F(se,Q),K(se)}for(F(C,v);V=K(C);)for(var ee=0;ee<V.length;ee++)if(U=V.charCodeAt(ee),R(U))return"rtl";return"ltr"}function I(v){if(typeof v.line=="number"&&(v.snapToLines||v.line>=0&&v.line<=100))return v.line;if(!v.track||!v.track.textTrackList||!v.track.textTrackList.mediaElement)return-1;for(var C=v.track,V=C.textTrackList,U=0,F=0;F<V.length&&V[F]!==C;F++)V[F].mode==="showing"&&U++;return++U*-1}function M(){}M.prototype.applyStyles=function(v,C){C=C||this.div;for(var V in v)v.hasOwnProperty(V)&&(C.style[V]=v[V])},M.prototype.formatStyle=function(v,C){return v===0?0:v+C};function N(v,C,V){M.call(this),this.cue=C,this.cueDiv=P(v,C.text);var U={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:C.vertical===""?"horizontal-tb":C.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(U,this.cueDiv),this.div=v.document.createElement("div"),U={direction:b(this.cueDiv),writingMode:C.vertical===""?"horizontal-tb":C.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:C.align==="middle"?"center":C.align,font:V.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(U),this.div.appendChild(this.cueDiv);var F=0;switch(C.positionAlign){case"start":case"line-left":F=C.position;break;case"center":F=C.position-C.size/2;break;case"end":case"line-right":F=C.position-C.size;break}C.vertical===""?this.applyStyles({left:this.formatStyle(F,"%"),width:this.formatStyle(C.size,"%")}):this.applyStyles({top:this.formatStyle(F,"%"),height:this.formatStyle(C.size,"%")}),this.move=function(K){this.applyStyles({top:this.formatStyle(K.top,"px"),bottom:this.formatStyle(K.bottom,"px"),left:this.formatStyle(K.left,"px"),right:this.formatStyle(K.right,"px"),height:this.formatStyle(K.height,"px"),width:this.formatStyle(K.width,"px")})}}N.prototype=e(M.prototype),N.prototype.constructor=N;function O(v){var C,V,U,F;if(v.div){V=v.div.offsetHeight,U=v.div.offsetWidth,F=v.div.offsetTop;var K=(K=v.div.childNodes)&&(K=K[0])&&K.getClientRects&&K.getClientRects();v=v.div.getBoundingClientRect(),C=K?Math.max(K[0]&&K[0].height||0,v.height/K.length):0}this.left=v.left,this.right=v.right,this.top=v.top||F,this.height=v.height||V,this.bottom=v.bottom||F+(v.height||V),this.width=v.width||U,this.lineHeight=C!==void 0?C:v.lineHeight}O.prototype.move=function(v,C){switch(C=C!==void 0?C:this.lineHeight,v){case"+x":this.left+=C,this.right+=C;break;case"-x":this.left-=C,this.right-=C;break;case"+y":this.top+=C,this.bottom+=C;break;case"-y":this.top-=C,this.bottom-=C;break}},O.prototype.overlaps=function(v){return this.left<v.right&&this.right>v.left&&this.top<v.bottom&&this.bottom>v.top},O.prototype.overlapsAny=function(v){for(var C=0;C<v.length;C++)if(this.overlaps(v[C]))return!0;return!1},O.prototype.within=function(v){return this.top>=v.top&&this.bottom<=v.bottom&&this.left>=v.left&&this.right<=v.right},O.prototype.overlapsOppositeAxis=function(v,C){switch(C){case"+x":return this.left<v.left;case"-x":return this.right>v.right;case"+y":return this.top<v.top;case"-y":return this.bottom>v.bottom}},O.prototype.intersectPercentage=function(v){var C=Math.max(0,Math.min(this.right,v.right)-Math.max(this.left,v.left)),V=Math.max(0,Math.min(this.bottom,v.bottom)-Math.max(this.top,v.top)),U=C*V;return U/(this.height*this.width)},O.prototype.toCSSCompatValues=function(v){return{top:this.top-v.top,bottom:v.bottom-this.bottom,left:this.left-v.left,right:v.right-this.right,height:this.height,width:this.width}},O.getSimpleBoxPosition=function(v){var C=v.div?v.div.offsetHeight:v.tagName?v.offsetHeight:0,V=v.div?v.div.offsetWidth:v.tagName?v.offsetWidth:0,U=v.div?v.div.offsetTop:v.tagName?v.offsetTop:0;v=v.div?v.div.getBoundingClientRect():v.tagName?v.getBoundingClientRect():v;var F={left:v.left,right:v.right,top:v.top||U,height:v.height||C,bottom:v.bottom||U+(v.height||C),width:v.width||V};return F};function z(v,C,V,U){function F(pe,Ke){for(var Je,$e=new O(pe),Ze=1,Tt=0;Tt<Ke.length;Tt++){for(;pe.overlapsOppositeAxis(V,Ke[Tt])||pe.within(V)&&pe.overlapsAny(U);)pe.move(Ke[Tt]);if(pe.within(V))return pe;var Ye=pe.intersectPercentage(V);Ze>Ye&&(Je=new O(pe),Ze=Ye),pe=new O($e)}return Je||$e}var K=new O(C),ee=C.cue,se=I(ee),Q=[];if(ee.snapToLines){var J;switch(ee.vertical){case"":Q=["+y","-y"],J="height";break;case"rl":Q=["+x","-x"],J="width";break;case"lr":Q=["-x","+x"],J="width";break}var Z=K.lineHeight,ie=Z*Math.round(se),te=V[J]+Z,me=Q[0];Math.abs(ie)>te&&(ie=ie<0?-1:1,ie*=Math.ceil(te/Z)*Z),se<0&&(ie+=ee.vertical===""?V.height:V.width,Q=Q.reverse()),K.move(me,ie)}else{var fe=K.lineHeight/V.height*100;switch(ee.lineAlign){case"center":se-=fe/2;break;case"end":se-=fe;break}switch(ee.vertical){case"":C.applyStyles({top:C.formatStyle(se,"%")});break;case"rl":C.applyStyles({left:C.formatStyle(se,"%")});break;case"lr":C.applyStyles({right:C.formatStyle(se,"%")});break}Q=["+y","-x","+x","-y"],K=new O(C)}var _e=F(K,Q);C.move(_e.toCSSCompatValues(V))}function q(){}q.StringDecoder=function(){return{decode:function(v){if(!v)return"";if(typeof v!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(v))}}},q.convertCueToDOMTree=function(v,C){return!v||!C?null:P(v,C)};var $=.05,L="sans-serif",H="1.5%";return q.processCues=function(v,C,V){if(!v||!C||!V)return null;for(;V.firstChild;)V.removeChild(V.firstChild);var U=v.document.createElement("div");U.style.position="absolute",U.style.left="0",U.style.right="0",U.style.top="0",U.style.bottom="0",U.style.margin=H,V.appendChild(U);function F(Z){for(var ie=0;ie<Z.length;ie++)if(Z[ie].hasBeenReset||!Z[ie].displayState)return!0;return!1}if(!F(C)){for(var K=0;K<C.length;K++)U.appendChild(C[K].displayState);return}var ee=[],se=O.getSimpleBoxPosition(U),Q=Math.round(se.height*$*100)/100,J={font:Q+"px "+L};(function(){for(var Z,ie,te=0;te<C.length;te++)ie=C[te],Z=new N(v,ie,J),U.appendChild(Z.div),z(v,Z,se,ee),ie.displayState=Z.div,ee.push(O.getSimpleBoxPosition(Z))})()},q.Parser=function(v,C,V){V||(V=C,C={}),C||(C={}),this.window=v,this.vttjs=C,this.state="INITIAL",this.buffer="",this.decoder=V||new TextDecoder("utf8"),this.regionList=[]},q.Parser.prototype={reportOrThrowError:function(v){if(v instanceof t)this.onparsingerror&&this.onparsingerror(v);else throw v},parse:function(v){var C=this;v&&(C.buffer+=C.decoder.decode(v,{stream:!0}));function V(){for(var Z=C.buffer,ie=0;ie<Z.length&&Z[ie]!=="\r"&&Z[ie]!==`
18
+ `;)++ie;var te=Z.substr(0,ie);return Z[ie]==="\r"&&++ie,Z[ie]===`
19
+ `&&++ie,C.buffer=Z.substr(ie),te}function U(Z){var ie=new s;if(n(Z,function(me,fe){switch(me){case"id":ie.set(me,fe);break;case"width":ie.percent(me,fe);break;case"lines":ie.integer(me,fe);break;case"regionanchor":case"viewportanchor":var _e=fe.split(",");if(_e.length!==2)break;var pe=new s;if(pe.percent("x",_e[0]),pe.percent("y",_e[1]),!pe.has("x")||!pe.has("y"))break;ie.set(me+"X",pe.get("x")),ie.set(me+"Y",pe.get("y"));break;case"scroll":ie.alt(me,fe,["up"]);break}},/=/,/\s/),ie.has("id")){var te=new(C.vttjs.VTTRegion||C.window.VTTRegion);te.width=ie.get("width",100),te.lines=ie.get("lines",3),te.regionAnchorX=ie.get("regionanchorX",0),te.regionAnchorY=ie.get("regionanchorY",100),te.viewportAnchorX=ie.get("viewportanchorX",0),te.viewportAnchorY=ie.get("viewportanchorY",100),te.scroll=ie.get("scroll",""),C.onregion&&C.onregion(te),C.regionList.push({id:ie.get("id"),region:te})}}function F(Z){var ie=new s;n(Z,function(te,me){switch(te){case"MPEGT":ie.integer(te+"S",me);break;case"LOCA":ie.set(te+"L",i(me));break}},/[^\d]:/,/,/),C.ontimestampmap&&C.ontimestampmap({MPEGTS:ie.get("MPEGTS"),LOCAL:ie.get("LOCAL")})}function K(Z){Z.match(/X-TIMESTAMP-MAP/)?n(Z,function(ie,te){switch(ie){case"X-TIMESTAMP-MAP":F(te);break}},/=/):n(Z,function(ie,te){switch(ie){case"Region":U(te);break}},/:/)}try{var ee;if(C.state==="INITIAL"){if(!/\r\n|\n/.test(C.buffer))return this;ee=V();var se=ee.match(/^WEBVTT([ \t].*)?$/);if(!se||!se[0])throw new t(t.Errors.BadSignature);C.state="HEADER"}for(var Q=!1;C.buffer;){if(!/\r\n|\n/.test(C.buffer))return this;switch(Q?Q=!1:ee=V(),C.state){case"HEADER":/:/.test(ee)?K(ee):ee||(C.state="ID");continue;case"NOTE":ee||(C.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(ee)){C.state="NOTE";break}if(!ee)continue;C.cue=new(C.vttjs.VTTCue||C.window.VTTCue)(0,0,"");try{C.cue.align="center"}catch{C.cue.align="middle"}if(C.state="CUE",ee.indexOf("-->")===-1){C.cue.id=ee;continue}case"CUE":try{a(ee,C.cue,C.regionList)}catch(Z){C.reportOrThrowError(Z),C.cue=null,C.state="BADCUE";continue}C.state="CUETEXT";continue;case"CUETEXT":var J=ee.indexOf("-->")!==-1;if(!ee||J&&(Q=!0)){C.oncue&&C.oncue(C.cue),C.cue=null,C.state="ID";continue}C.cue.text&&(C.cue.text+=`
20
+ `),C.cue.text+=ee.replace(/\u2028/g,`
21
+ `).replace(/u2029/g,`
22
+ `);continue;case"BADCUE":ee||(C.state="ID");continue}}}catch(Z){C.reportOrThrowError(Z),C.state==="CUETEXT"&&C.cue&&C.oncue&&C.oncue(C.cue),C.cue=null,C.state=C.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var v=this;try{if(v.buffer+=v.decoder.decode(),(v.cue||v.state==="HEADER")&&(v.buffer+=`
23
+
24
+ `,v.parse()),v.state==="INITIAL")throw new t(t.Errors.BadSignature)}catch(C){v.reportOrThrowError(C)}return v.onflush&&v.onflush(),this}},_a=q,_a}var ba,cl;function jg(){if(cl)return ba;cl=1;var r="auto",e={"":1,lr:1,rl:1},t={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function i(a){if(typeof a!="string")return!1;var u=e[a.toLowerCase()];return u?a.toLowerCase():!1}function s(a){if(typeof a!="string")return!1;var u=t[a.toLowerCase()];return u?a.toLowerCase():!1}function n(a,u,c){this.hasBeenReset=!1;var m="",f=!1,_=a,P=u,S=c,R=null,b="",I=!0,M="auto",N="start",O="auto",z="auto",q=100,$="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return m},set:function(L){m=""+L}},pauseOnExit:{enumerable:!0,get:function(){return f},set:function(L){f=!!L}},startTime:{enumerable:!0,get:function(){return _},set:function(L){if(typeof L!="number")throw new TypeError("Start time must be set to a number.");_=L,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return P},set:function(L){if(typeof L!="number")throw new TypeError("End time must be set to a number.");P=L,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return S},set:function(L){S=""+L,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return R},set:function(L){R=L,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return b},set:function(L){var H=i(L);if(H===!1)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");b=H,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return I},set:function(L){I=!!L,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return M},set:function(L){if(typeof L!="number"&&L!==r)throw new SyntaxError("Line: an invalid number or illegal string was specified.");M=L,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return N},set:function(L){var H=s(L);H?(N=H,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return O},set:function(L){if(L<0||L>100)throw new Error("Position must be between 0 and 100.");O=L,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return z},set:function(L){var H=s(L);H?(z=H,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return q},set:function(L){if(L<0||L>100)throw new Error("Size must be between 0 and 100.");q=L,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return $},set:function(L){var H=s(L);if(!H)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");$=H,this.hasBeenReset=!0}}}),this.displayState=void 0}return n.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},ba=n,ba}var va,hl;function qg(){if(hl)return va;hl=1;var r={"":!0,up:!0};function e(s){if(typeof s!="string")return!1;var n=r[s.toLowerCase()];return n?s.toLowerCase():!1}function t(s){return typeof s=="number"&&s>=0&&s<=100}function i(){var s=100,n=3,a=0,u=100,c=0,m=100,f="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return s},set:function(_){if(!t(_))throw new Error("Width must be between 0 and 100.");s=_}},lines:{enumerable:!0,get:function(){return n},set:function(_){if(typeof _!="number")throw new TypeError("Lines must be set to a number.");n=_}},regionAnchorY:{enumerable:!0,get:function(){return u},set:function(_){if(!t(_))throw new Error("RegionAnchorX must be between 0 and 100.");u=_}},regionAnchorX:{enumerable:!0,get:function(){return a},set:function(_){if(!t(_))throw new Error("RegionAnchorY must be between 0 and 100.");a=_}},viewportAnchorY:{enumerable:!0,get:function(){return m},set:function(_){if(!t(_))throw new Error("ViewportAnchorY must be between 0 and 100.");m=_}},viewportAnchorX:{enumerable:!0,get:function(){return c},set:function(_){if(!t(_))throw new Error("ViewportAnchorX must be between 0 and 100.");c=_}},scroll:{enumerable:!0,get:function(){return f},set:function(_){var P=e(_);P===!1?console.warn("Scroll: an invalid or illegal string was specified."):f=P}}})}return va=i,va}var dl;function $g(){if(dl)return ya.exports;dl=1;var r=xn(),e=ya.exports={WebVTT:Fg(),VTTCue:jg(),VTTRegion:qg()};r.vttjs=e,r.WebVTT=e.WebVTT;var t=e.VTTCue,i=e.VTTRegion,s=r.VTTCue,n=r.VTTRegion;return e.shim=function(){r.VTTCue=t,r.VTTRegion=i},e.restore=function(){r.VTTCue=s,r.VTTRegion=n},r.VTTCue||e.shim(),ya.exports}var Hg=$g();const pl=ps(Hg);function qe(){return qe=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(r[i]=t[i])}return r},qe.apply(null,arguments)}var ml="https://example.com",Dn=function(r,e){if(/^[a-z]+:/i.test(e))return e;/^data:/.test(r)&&(r=A.location&&A.location.href||"");var t=/^\/\//.test(r),i=!A.location&&!/\/\//i.test(r);r=new A.URL(r,A.location||ml);var s=new URL(e,r);return i?s.href.slice(ml.length):t?s.href.slice(s.protocol.length):s.href},So=(function(){function r(){this.listeners={}}var e=r.prototype;return e.on=function(t,i){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(i)},e.off=function(t,i){if(!this.listeners[t])return!1;var s=this.listeners[t].indexOf(i);return this.listeners[t]=this.listeners[t].slice(0),this.listeners[t].splice(s,1),s>-1},e.trigger=function(t){var i=this.listeners[t];if(i)if(arguments.length===2)for(var s=i.length,n=0;n<s;++n)i[n].call(this,arguments[1]);else for(var a=Array.prototype.slice.call(arguments,1),u=i.length,c=0;c<u;++c)i[c].apply(this,a)},e.dispose=function(){this.listeners={}},e.pipe=function(t){this.on("data",function(i){t.push(i)})},r})(),Vg=function(r){return A.atob?A.atob(r):Buffer.from(r,"base64").toString("binary")};function Uc(r){for(var e=Vg(r),t=new Uint8Array(e.length),i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t}/*! @name m3u8-parser @version 7.2.0 @license Apache-2.0 */class zg extends So{constructor(){super(),this.buffer=""}push(e){let t;for(this.buffer+=e,t=this.buffer.indexOf(`
25
+ `);t>-1;t=this.buffer.indexOf(`
26
+ `))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}}const Wg=" ",Ta=function(r){const e=/([0-9.]*)?@?([0-9.]*)?/.exec(r||""),t={};return e[1]&&(t.length=parseInt(e[1],10)),e[2]&&(t.offset=parseInt(e[2],10)),t},Gg=function(){const r='(?:[^=]*)=(?:"[^"]*"|[^,]*)';return new RegExp("(?:^|,)("+r+")")},ut=function(r){const e={};if(!r)return e;const t=r.split(Gg());let i=t.length,s;for(;i--;)t[i]!==""&&(s=/([^=]*)=(.*)/.exec(t[i]).slice(1),s[0]=s[0].replace(/^\s+|\s+$/g,""),s[1]=s[1].replace(/^\s+|\s+$/g,""),s[1]=s[1].replace(/^['"](.*)['"]$/g,"$1"),e[s[0]]=s[1]);return e},gl=r=>{const e=r.split("x"),t={};return e[0]&&(t.width=parseInt(e[0],10)),e[1]&&(t.height=parseInt(e[1],10)),t};class Xg extends So{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let t,i;if(e=e.trim(),e.length!==0){if(e[0]!=="#"){this.trigger("data",{type:"uri",uri:e});return}this.tagMappers.reduce((s,n)=>{const a=n(e);return a===e?s:s.concat([a])},[e]).forEach(s=>{for(let n=0;n<this.customParsers.length;n++)if(this.customParsers[n].call(this,s))return;if(s.indexOf("#EXT")!==0){this.trigger("data",{type:"comment",text:s.slice(1)});return}if(s=s.replace("\r",""),t=/^#EXTM3U/.exec(s),t){this.trigger("data",{type:"tag",tagType:"m3u"});return}if(t=/^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(s),t){i={type:"tag",tagType:"inf"},t[1]&&(i.duration=parseFloat(t[1])),t[2]&&(i.title=t[2]),this.trigger("data",i);return}if(t=/^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(s),t){i={type:"tag",tagType:"targetduration"},t[1]&&(i.duration=parseInt(t[1],10)),this.trigger("data",i);return}if(t=/^#EXT-X-VERSION:([0-9.]*)?/.exec(s),t){i={type:"tag",tagType:"version"},t[1]&&(i.version=parseInt(t[1],10)),this.trigger("data",i);return}if(t=/^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(s),t){i={type:"tag",tagType:"media-sequence"},t[1]&&(i.number=parseInt(t[1],10)),this.trigger("data",i);return}if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(s),t){i={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(i.number=parseInt(t[1],10)),this.trigger("data",i);return}if(t=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(s),t){i={type:"tag",tagType:"playlist-type"},t[1]&&(i.playlistType=t[1]),this.trigger("data",i);return}if(t=/^#EXT-X-BYTERANGE:(.*)?$/.exec(s),t){i=qe(Ta(t[1]),{type:"tag",tagType:"byterange"}),this.trigger("data",i);return}if(t=/^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(s),t){i={type:"tag",tagType:"allow-cache"},t[1]&&(i.allowed=!/NO/.test(t[1])),this.trigger("data",i);return}if(t=/^#EXT-X-MAP:(.*)$/.exec(s),t){if(i={type:"tag",tagType:"map"},t[1]){const n=ut(t[1]);n.URI&&(i.uri=n.URI),n.BYTERANGE&&(i.byterange=Ta(n.BYTERANGE))}this.trigger("data",i);return}if(t=/^#EXT-X-STREAM-INF:(.*)$/.exec(s),t){i={type:"tag",tagType:"stream-inf"},t[1]&&(i.attributes=ut(t[1]),i.attributes.RESOLUTION&&(i.attributes.RESOLUTION=gl(i.attributes.RESOLUTION)),i.attributes.BANDWIDTH&&(i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)),i.attributes["FRAME-RATE"]&&(i.attributes["FRAME-RATE"]=parseFloat(i.attributes["FRAME-RATE"])),i.attributes["PROGRAM-ID"]&&(i.attributes["PROGRAM-ID"]=parseInt(i.attributes["PROGRAM-ID"],10))),this.trigger("data",i);return}if(t=/^#EXT-X-MEDIA:(.*)$/.exec(s),t){i={type:"tag",tagType:"media"},t[1]&&(i.attributes=ut(t[1])),this.trigger("data",i);return}if(t=/^#EXT-X-ENDLIST/.exec(s),t){this.trigger("data",{type:"tag",tagType:"endlist"});return}if(t=/^#EXT-X-DISCONTINUITY/.exec(s),t){this.trigger("data",{type:"tag",tagType:"discontinuity"});return}if(t=/^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(s),t){i={type:"tag",tagType:"program-date-time"},t[1]&&(i.dateTimeString=t[1],i.dateTimeObject=new Date(t[1])),this.trigger("data",i);return}if(t=/^#EXT-X-KEY:(.*)$/.exec(s),t){i={type:"tag",tagType:"key"},t[1]&&(i.attributes=ut(t[1]),i.attributes.IV&&(i.attributes.IV.substring(0,2).toLowerCase()==="0x"&&(i.attributes.IV=i.attributes.IV.substring(2)),i.attributes.IV=i.attributes.IV.match(/.{8}/g),i.attributes.IV[0]=parseInt(i.attributes.IV[0],16),i.attributes.IV[1]=parseInt(i.attributes.IV[1],16),i.attributes.IV[2]=parseInt(i.attributes.IV[2],16),i.attributes.IV[3]=parseInt(i.attributes.IV[3],16),i.attributes.IV=new Uint32Array(i.attributes.IV))),this.trigger("data",i);return}if(t=/^#EXT-X-START:(.*)$/.exec(s),t){i={type:"tag",tagType:"start"},t[1]&&(i.attributes=ut(t[1]),i.attributes["TIME-OFFSET"]=parseFloat(i.attributes["TIME-OFFSET"]),i.attributes.PRECISE=/YES/.test(i.attributes.PRECISE)),this.trigger("data",i);return}if(t=/^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(s),t){i={type:"tag",tagType:"cue-out-cont"},t[1]?i.data=t[1]:i.data="",this.trigger("data",i);return}if(t=/^#EXT-X-CUE-OUT:(.*)?$/.exec(s),t){i={type:"tag",tagType:"cue-out"},t[1]?i.data=t[1]:i.data="",this.trigger("data",i);return}if(t=/^#EXT-X-CUE-IN:?(.*)?$/.exec(s),t){i={type:"tag",tagType:"cue-in"},t[1]?i.data=t[1]:i.data="",this.trigger("data",i);return}if(t=/^#EXT-X-SKIP:(.*)$/.exec(s),t&&t[1]){i={type:"tag",tagType:"skip"},i.attributes=ut(t[1]),i.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(i.attributes["SKIPPED-SEGMENTS"]=parseInt(i.attributes["SKIPPED-SEGMENTS"],10)),i.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(i.attributes["RECENTLY-REMOVED-DATERANGES"]=i.attributes["RECENTLY-REMOVED-DATERANGES"].split(Wg)),this.trigger("data",i);return}if(t=/^#EXT-X-PART:(.*)$/.exec(s),t&&t[1]){i={type:"tag",tagType:"part"},i.attributes=ut(t[1]),["DURATION"].forEach(function(n){i.attributes.hasOwnProperty(n)&&(i.attributes[n]=parseFloat(i.attributes[n]))}),["INDEPENDENT","GAP"].forEach(function(n){i.attributes.hasOwnProperty(n)&&(i.attributes[n]=/YES/.test(i.attributes[n]))}),i.attributes.hasOwnProperty("BYTERANGE")&&(i.attributes.byterange=Ta(i.attributes.BYTERANGE)),this.trigger("data",i);return}if(t=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(s),t&&t[1]){i={type:"tag",tagType:"server-control"},i.attributes=ut(t[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach(function(n){i.attributes.hasOwnProperty(n)&&(i.attributes[n]=parseFloat(i.attributes[n]))}),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach(function(n){i.attributes.hasOwnProperty(n)&&(i.attributes[n]=/YES/.test(i.attributes[n]))}),this.trigger("data",i);return}if(t=/^#EXT-X-PART-INF:(.*)$/.exec(s),t&&t[1]){i={type:"tag",tagType:"part-inf"},i.attributes=ut(t[1]),["PART-TARGET"].forEach(function(n){i.attributes.hasOwnProperty(n)&&(i.attributes[n]=parseFloat(i.attributes[n]))}),this.trigger("data",i);return}if(t=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(s),t&&t[1]){i={type:"tag",tagType:"preload-hint"},i.attributes=ut(t[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach(function(n){if(i.attributes.hasOwnProperty(n)){i.attributes[n]=parseInt(i.attributes[n],10);const a=n==="BYTERANGE-LENGTH"?"length":"offset";i.attributes.byterange=i.attributes.byterange||{},i.attributes.byterange[a]=i.attributes[n],delete i.attributes[n]}}),this.trigger("data",i);return}if(t=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(s),t&&t[1]){i={type:"tag",tagType:"rendition-report"},i.attributes=ut(t[1]),["LAST-MSN","LAST-PART"].forEach(function(n){i.attributes.hasOwnProperty(n)&&(i.attributes[n]=parseInt(i.attributes[n],10))}),this.trigger("data",i);return}if(t=/^#EXT-X-DATERANGE:(.*)$/.exec(s),t&&t[1]){i={type:"tag",tagType:"daterange"},i.attributes=ut(t[1]),["ID","CLASS"].forEach(function(a){i.attributes.hasOwnProperty(a)&&(i.attributes[a]=String(i.attributes[a]))}),["START-DATE","END-DATE"].forEach(function(a){i.attributes.hasOwnProperty(a)&&(i.attributes[a]=new Date(i.attributes[a]))}),["DURATION","PLANNED-DURATION"].forEach(function(a){i.attributes.hasOwnProperty(a)&&(i.attributes[a]=parseFloat(i.attributes[a]))}),["END-ON-NEXT"].forEach(function(a){i.attributes.hasOwnProperty(a)&&(i.attributes[a]=/YES/i.test(i.attributes[a]))}),["SCTE35-CMD"," SCTE35-OUT","SCTE35-IN"].forEach(function(a){i.attributes.hasOwnProperty(a)&&(i.attributes[a]=i.attributes[a].toString(16))});const n=/^X-([A-Z]+-)+[A-Z]+$/;for(const a in i.attributes){if(!n.test(a))continue;const u=/[0-9A-Fa-f]{6}/g.test(i.attributes[a]),c=/^\d+(\.\d+)?$/.test(i.attributes[a]);i.attributes[a]=u?i.attributes[a].toString(16):c?parseFloat(i.attributes[a]):String(i.attributes[a])}this.trigger("data",i);return}if(t=/^#EXT-X-INDEPENDENT-SEGMENTS/.exec(s),t){this.trigger("data",{type:"tag",tagType:"independent-segments"});return}if(t=/^#EXT-X-I-FRAMES-ONLY/.exec(s),t){this.trigger("data",{type:"tag",tagType:"i-frames-only"});return}if(t=/^#EXT-X-CONTENT-STEERING:(.*)$/.exec(s),t){i={type:"tag",tagType:"content-steering"},i.attributes=ut(t[1]),this.trigger("data",i);return}if(t=/^#EXT-X-I-FRAME-STREAM-INF:(.*)$/.exec(s),t){i={type:"tag",tagType:"i-frame-playlist"},i.attributes=ut(t[1]),i.attributes.URI&&(i.uri=i.attributes.URI),i.attributes.BANDWIDTH&&(i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)),i.attributes.RESOLUTION&&(i.attributes.RESOLUTION=gl(i.attributes.RESOLUTION)),i.attributes["AVERAGE-BANDWIDTH"]&&(i.attributes["AVERAGE-BANDWIDTH"]=parseInt(i.attributes["AVERAGE-BANDWIDTH"],10)),i.attributes["FRAME-RATE"]&&(i.attributes["FRAME-RATE"]=parseFloat(i.attributes["FRAME-RATE"])),this.trigger("data",i);return}if(t=/^#EXT-X-DEFINE:(.*)$/.exec(s),t){i={type:"tag",tagType:"define"},i.attributes=ut(t[1]),this.trigger("data",i);return}this.trigger("data",{type:"tag",data:s.slice(4)})})}}addParser({expression:e,customType:t,dataParser:i,segment:s}){typeof i!="function"&&(i=n=>n),this.customParsers.push(n=>{if(e.exec(n))return this.trigger("data",{type:"custom",data:i(n),customType:t,segment:s}),!0})}addTagMapper({expression:e,map:t}){const i=s=>e.test(s)?t(s):s;this.tagMappers.push(i)}}const Kg=r=>r.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase()),gi=function(r){const e={};return Object.keys(r).forEach(function(t){e[Kg(t)]=r[t]}),e},Sa=function(r){const{serverControl:e,targetDuration:t,partTargetDuration:i}=r;if(!e)return;const s="#EXT-X-SERVER-CONTROL",n="holdBack",a="partHoldBack",u=t&&t*3,c=i&&i*2;t&&!e.hasOwnProperty(n)&&(e[n]=u,this.trigger("info",{message:`${s} defaulting HOLD-BACK to targetDuration * 3 (${u}).`})),u&&e[n]<u&&(this.trigger("warn",{message:`${s} clamping HOLD-BACK (${e[n]}) to targetDuration * 3 (${u})`}),e[n]=u),i&&!e.hasOwnProperty(a)&&(e[a]=i*3,this.trigger("info",{message:`${s} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${e[a]}).`})),i&&e[a]<c&&(this.trigger("warn",{message:`${s} clamping PART-HOLD-BACK (${e[a]}) to partTargetDuration * 2 (${c}).`}),e[a]=c)};class Yg extends So{constructor(e={}){super(),this.lineStream=new zg,this.parseStream=new Xg,this.lineStream.pipe(this.parseStream),this.mainDefinitions=e.mainDefinitions||{},this.params=new URL(e.uri,"https://a.com").searchParams,this.lastProgramDateTime=null;const t=this,i=[];let s={},n,a,u=!1;const c=function(){},m={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},f="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";let _=0;this.manifest={allowCache:!0,discontinuityStarts:[],dateRanges:[],iFramePlaylists:[],segments:[]};let P=0,S=0;const R={};this.on("end",()=>{s.uri||!s.parts&&!s.preloadHints||(!s.map&&n&&(s.map=n),!s.key&&a&&(s.key=a),!s.timeline&&typeof _=="number"&&(s.timeline=_),this.manifest.preloadSegment=s)}),this.parseStream.on("data",function(b){let I,M;if(t.manifest.definitions){for(const N in t.manifest.definitions)if(b.uri&&(b.uri=b.uri.replace(`{$${N}}`,t.manifest.definitions[N])),b.attributes)for(const O in b.attributes)typeof b.attributes[O]=="string"&&(b.attributes[O]=b.attributes[O].replace(`{$${N}}`,t.manifest.definitions[N]))}({tag(){({version(){b.version&&(this.manifest.version=b.version)},"allow-cache"(){this.manifest.allowCache=b.allowed,"allowed"in b||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){const N={};"length"in b&&(s.byterange=N,N.length=b.length,"offset"in b||(b.offset=P)),"offset"in b&&(s.byterange=N,N.offset=b.offset),P=N.offset+N.length},endlist(){this.manifest.endList=!0},inf(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),b.title&&(s.title=b.title),b.duration>0&&(s.duration=b.duration),b.duration===0&&(s.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=i},key(){if(!b.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(b.attributes.METHOD==="NONE"){a=null;return}if(!b.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(b.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:b.attributes};return}if(b.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.microsoft.playready"]={uri:b.attributes.URI};return}if(b.attributes.KEYFORMAT===f){if(["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(b.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(b.attributes.METHOD==="SAMPLE-AES-CENC"&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),b.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(b.attributes.KEYID&&b.attributes.KEYID.substring(0,2)==="0x")){this.trigger("warn",{message:"invalid key ID provided for Widevine"});return}this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:b.attributes.KEYFORMAT,keyId:b.attributes.KEYID.substring(2)},pssh:Uc(b.attributes.URI.split(",")[1])};return}b.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),a={method:b.attributes.METHOD||"AES-128",uri:b.attributes.URI},typeof b.attributes.IV<"u"&&(a.iv=b.attributes.IV)},"media-sequence"(){if(!isFinite(b.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+b.number});return}this.manifest.mediaSequence=b.number},"discontinuity-sequence"(){if(!isFinite(b.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+b.number});return}this.manifest.discontinuitySequence=b.number,_=b.number},"playlist-type"(){if(!/VOD|EVENT/.test(b.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+b.playlist});return}this.manifest.playlistType=b.playlistType},map(){n={},b.uri&&(n.uri=b.uri),b.byterange&&(n.byterange=b.byterange),a&&(n.key=a)},"stream-inf"(){if(this.manifest.playlists=i,this.manifest.mediaGroups=this.manifest.mediaGroups||m,!b.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}s.attributes||(s.attributes={}),qe(s.attributes,b.attributes)},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||m,!(b.attributes&&b.attributes.TYPE&&b.attributes["GROUP-ID"]&&b.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}const N=this.manifest.mediaGroups[b.attributes.TYPE];N[b.attributes["GROUP-ID"]]=N[b.attributes["GROUP-ID"]]||{},I=N[b.attributes["GROUP-ID"]],M={default:/yes/i.test(b.attributes.DEFAULT)},M.default?M.autoselect=!0:M.autoselect=/yes/i.test(b.attributes.AUTOSELECT),b.attributes.LANGUAGE&&(M.language=b.attributes.LANGUAGE),b.attributes.URI&&(M.uri=b.attributes.URI),b.attributes["INSTREAM-ID"]&&(M.instreamId=b.attributes["INSTREAM-ID"]),b.attributes.CHARACTERISTICS&&(M.characteristics=b.attributes.CHARACTERISTICS),b.attributes.FORCED&&(M.forced=/yes/i.test(b.attributes.FORCED)),I[b.attributes.NAME]=M},discontinuity(){_+=1,s.discontinuity=!0,this.manifest.discontinuityStarts.push(i.length)},"program-date-time"(){typeof this.manifest.dateTimeString>"u"&&(this.manifest.dateTimeString=b.dateTimeString,this.manifest.dateTimeObject=b.dateTimeObject),s.dateTimeString=b.dateTimeString,s.dateTimeObject=b.dateTimeObject;const{lastProgramDateTime:N}=this;this.lastProgramDateTime=new Date(b.dateTimeString).getTime(),N===null&&this.manifest.segments.reduceRight((O,z)=>(z.programDateTime=O-z.duration*1e3,z.programDateTime),this.lastProgramDateTime)},targetduration(){if(!isFinite(b.duration)||b.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+b.duration});return}this.manifest.targetDuration=b.duration,Sa.call(this,this.manifest)},start(){if(!b.attributes||isNaN(b.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:b.attributes["TIME-OFFSET"],precise:b.attributes.PRECISE}},"cue-out"(){s.cueOut=b.data},"cue-out-cont"(){s.cueOutCont=b.data},"cue-in"(){s.cueIn=b.data},skip(){this.manifest.skip=gi(b.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",b.attributes,["SKIPPED-SEGMENTS"])},part(){u=!0;const N=this.manifest.segments.length,O=gi(b.attributes);s.parts=s.parts||[],s.parts.push(O),O.byterange&&(O.byterange.hasOwnProperty("offset")||(O.byterange.offset=S),S=O.byterange.offset+O.byterange.length);const z=s.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${z} for segment #${N}`,b.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((q,$)=>{q.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${$} lacks required attribute(s): LAST-PART`})})},"server-control"(){const N=this.manifest.serverControl=gi(b.attributes);N.hasOwnProperty("canBlockReload")||(N.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),Sa.call(this,this.manifest),N.canSkipDateranges&&!N.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint"(){const N=this.manifest.segments.length,O=gi(b.attributes),z=O.type&&O.type==="PART";s.preloadHints=s.preloadHints||[],s.preloadHints.push(O),O.byterange&&(O.byterange.hasOwnProperty("offset")||(O.byterange.offset=z?S:0,z&&(S=O.byterange.offset+O.byterange.length)));const q=s.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${q} for segment #${N}`,b.attributes,["TYPE","URI"]),!!O.type)for(let $=0;$<s.preloadHints.length-1;$++){const L=s.preloadHints[$];L.type&&L.type===O.type&&this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${q} for segment #${N} has the same TYPE ${O.type} as preload hint #${$}`})}},"rendition-report"(){const N=gi(b.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(N);const O=this.manifest.renditionReports.length-1,z=["LAST-MSN","URI"];u&&z.push("LAST-PART"),this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${O}`,b.attributes,z)},"part-inf"(){this.manifest.partInf=gi(b.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",b.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),Sa.call(this,this.manifest)},daterange(){this.manifest.dateRanges.push(gi(b.attributes));const N=this.manifest.dateRanges.length-1;this.warnOnMissingAttributes_(`#EXT-X-DATERANGE #${N}`,b.attributes,["ID","START-DATE"]);const O=this.manifest.dateRanges[N];O.endDate&&O.startDate&&new Date(O.endDate)<new Date(O.startDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE"}),O.duration&&O.duration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE DURATION must not be negative"}),O.plannedDuration&&O.plannedDuration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE PLANNED-DURATION must not be negative"});const z=!!O.endOnNext;if(z&&!O.class&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must have a CLASS attribute"}),z&&(O.duration||O.endDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes"}),O.duration&&O.endDate){const q=O.startDate.getTime()+O.duration*1e3;this.manifest.dateRanges[N].endDate=new Date(q)}if(!R[O.id])R[O.id]=O;else{for(const $ in R[O.id])if(O[$]&&JSON.stringify(R[O.id][$])!==JSON.stringify(O[$])){this.trigger("warn",{message:"EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes values"});break}const q=this.manifest.dateRanges.findIndex($=>$.id===O.id);this.manifest.dateRanges[q]=qe(this.manifest.dateRanges[q],O),R[O.id]=qe(R[O.id],O),this.manifest.dateRanges.pop()}},"independent-segments"(){this.manifest.independentSegments=!0},"i-frames-only"(){this.manifest.iFramesOnly=!0,this.requiredCompatibilityversion(this.manifest.version,4)},"content-steering"(){this.manifest.contentSteering=gi(b.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",b.attributes,["SERVER-URI"])},define(){this.manifest.definitions=this.manifest.definitions||{};const N=(O,z)=>{if(O in this.manifest.definitions){this.trigger("error",{message:`EXT-X-DEFINE: Duplicate name ${O}`});return}this.manifest.definitions[O]=z};if("QUERYPARAM"in b.attributes){if("NAME"in b.attributes||"IMPORT"in b.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}const O=this.params.get(b.attributes.QUERYPARAM);if(!O){this.trigger("error",{message:`EXT-X-DEFINE: No query param ${b.attributes.QUERYPARAM}`});return}N(b.attributes.QUERYPARAM,decodeURIComponent(O));return}if("NAME"in b.attributes){if("IMPORT"in b.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}if(!("VALUE"in b.attributes)||typeof b.attributes.VALUE!="string"){this.trigger("error",{message:`EXT-X-DEFINE: No value for ${b.attributes.NAME}`});return}N(b.attributes.NAME,b.attributes.VALUE);return}if("IMPORT"in b.attributes){if(!this.mainDefinitions[b.attributes.IMPORT]){this.trigger("error",{message:`EXT-X-DEFINE: No value ${b.attributes.IMPORT} to import, or IMPORT used on main playlist`});return}N(b.attributes.IMPORT,this.mainDefinitions[b.attributes.IMPORT]);return}this.trigger("error",{message:"EXT-X-DEFINE: No attribute"})},"i-frame-playlist"(){this.manifest.iFramePlaylists.push({attributes:b.attributes,uri:b.uri,timeline:_}),this.warnOnMissingAttributes_("#EXT-X-I-FRAME-STREAM-INF",b.attributes,["BANDWIDTH","URI"])}}[b.tagType]||c).call(t)},uri(){s.uri=b.uri,i.push(s),this.manifest.targetDuration&&!("duration"in s)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),s.duration=this.manifest.targetDuration),a&&(s.key=a),s.timeline=_,n&&(s.map=n),S=0,this.lastProgramDateTime!==null&&(s.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=s.duration*1e3),s={}},comment(){},custom(){b.segment?(s.custom=s.custom||{},s.custom[b.customType]=b.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[b.customType]=b.data)}})[b.type].call(t)})}requiredCompatibilityversion(e,t){(e<t||!e)&&this.trigger("warn",{message:`manifest must be at least version ${t}`})}warnOnMissingAttributes_(e,t,i){const s=[];i.forEach(function(n){t.hasOwnProperty(n)||s.push(n)}),s.length&&this.trigger("warn",{message:`${e} lacks required attribute(s): ${s.join(", ")}`})}push(e){this.lineStream.push(e)}end(){this.lineStream.push(`
27
+ `),this.manifest.dateRanges.length&&this.lastProgramDateTime===null&&this.trigger("warn",{message:"A playlist with EXT-X-DATERANGE tag must contain atleast one EXT-X-PROGRAM-DATE-TIME tag"}),this.lastProgramDateTime=null,this.trigger("end")}addParser(e){this.parseStream.addParser(e)}addTagMapper(e){this.parseStream.addTagMapper(e)}}var ji={mp4:/^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,webm:/^(vp0?[89]|av0?1|opus|vorbis)/,ogg:/^(vp0?[89]|theora|flac|opus|vorbis)/,video:/^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,audio:/^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,text:/^(stpp.ttml.im1t)/,muxerVideo:/^(avc0?1)/,muxerAudio:/^(mp4a)/,muxerText:/a^/},Qg=["video","audio","text"],fl=["Video","Audio","Text"],Fc=function(r){return r&&r.replace(/avc1\.(\d+)\.(\d+)/i,function(e,t,i){var s=("00"+Number(t).toString(16)).slice(-2),n=("00"+Number(i).toString(16)).slice(-2);return"avc1."+s+"00"+n})},Ht=function(r){r===void 0&&(r="");var e=r.split(","),t=[];return e.forEach(function(i){i=i.trim();var s;Qg.forEach(function(n){var a=ji[n].exec(i.toLowerCase());if(!(!a||a.length<=1)){s=n;var u=i.substring(0,a[1].length),c=i.replace(u,"");t.push({type:u,details:c,mediaType:n})}}),s||t.push({type:i,details:"",mediaType:"unknown"})}),t},Jg=function(r,e){if(!r.mediaGroups.AUDIO||!e)return null;var t=r.mediaGroups.AUDIO[e];if(!t)return null;for(var i in t){var s=t[i];if(s.default&&s.playlists)return Ht(s.playlists[0].attributes.CODECS)}return null},jc=function(r){return r===void 0&&(r=""),ji.audio.test(r.trim().toLowerCase())},Zg=function(r){return r===void 0&&(r=""),ji.text.test(r.trim().toLowerCase())},pr=function(r){if(!(!r||typeof r!="string")){var e=r.toLowerCase().split(",").map(function(s){return Fc(s.trim())}),t="video";e.length===1&&jc(e[0])?t="audio":e.length===1&&Zg(e[0])&&(t="application");var i="mp4";return e.every(function(s){return ji.mp4.test(s)})?i="mp4":e.every(function(s){return ji.webm.test(s)})?i="webm":e.every(function(s){return ji.ogg.test(s)})&&(i="ogg"),t+"/"+i+';codecs="'+r+'"'}},is=function(r,e){return r===void 0&&(r=""),e===void 0&&(e=!1),A.MediaSource&&A.MediaSource.isTypeSupported&&A.MediaSource.isTypeSupported(pr(r))||e&&A.ManagedMediaSource&&A.ManagedMediaSource.isTypeSupported&&A.ManagedMediaSource.isTypeSupported(pr(r))||!1},Ea=function(r){return r===void 0&&(r=""),r.toLowerCase().split(",").every(function(e){e=e.trim();for(var t=0;t<fl.length;t++){var i=fl[t];if(ji["muxer"+i].test(e))return!0}return!1})},yl="mp4a.40.2",ef="avc1.4d400d",tf=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,rf=/^application\/dash\+xml/i,qc=function(r){return tf.test(r)?"hls":rf.test(r)?"dash":r==="application/vnd.videojs.vhs+json"?"vhs-json":null},sf=function(r){return r.toString(2).length},nf=function(r){return Math.ceil(sf(r)/8)},$c=function(r){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(r):r&&r.buffer instanceof ArrayBuffer},af=function(r){return $c(r)},ce=function(r){return r instanceof Uint8Array?r:(!Array.isArray(r)&&!af(r)&&!(r instanceof ArrayBuffer)&&(typeof r!="number"||typeof r=="number"&&r!==r?r=0:r=[r]),new Uint8Array(r&&r.buffer||r,r&&r.byteOffset||0,r&&r.byteLength||0))},Qe=A.BigInt||Number,Ga=[Qe("0x1"),Qe("0x100"),Qe("0x10000"),Qe("0x1000000"),Qe("0x100000000"),Qe("0x10000000000"),Qe("0x1000000000000"),Qe("0x100000000000000"),Qe("0x10000000000000000")];(function(){var r=new Uint16Array([65484]),e=new Uint8Array(r.buffer,r.byteOffset,r.byteLength);return e[0]===255?"big":e[0]===204?"little":"unknown"})();var of=function(r,e){var t=e===void 0?{}:e,i=t.signed,s=i===void 0?!1:i,n=t.le,a=n===void 0?!1:n;r=ce(r);var u=a?"reduce":"reduceRight",c=r[u]?r[u]:Array.prototype[u],m=c.call(r,function(_,P,S){var R=a?S:Math.abs(S+1-r.length);return _+Qe(P)*Ga[R]},Qe(0));if(s){var f=Ga[r.length]/Qe(2)-Qe(1);m=Qe(m),m>f&&(m-=f,m-=f,m-=Qe(2))}return Number(m)},uf=function(r,e){var t={},i=t.le,s=i===void 0?!1:i;(typeof r!="bigint"&&typeof r!="number"||typeof r=="number"&&r!==r)&&(r=0),r=Qe(r);for(var n=nf(r),a=new Uint8Array(new ArrayBuffer(n)),u=0;u<n;u++){var c=s?u:Math.abs(u+1-a.length);a[c]=Number(r/Ga[u]&Qe(255)),r<0&&(a[c]=Math.abs(~a[c]),a[c]-=u===0?1:2)}return a},Hc=function(r,e){if(typeof r!="string"&&r&&typeof r.toString=="function"&&(r=r.toString()),typeof r!="string")return new Uint8Array;e||(r=unescape(encodeURIComponent(r)));for(var t=new Uint8Array(r.length),i=0;i<r.length;i++)t[i]=r.charCodeAt(i);return t},lf=function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];if(e=e.filter(function(a){return a&&(a.byteLength||a.length)&&typeof a!="string"}),e.length<=1)return ce(e[0]);var i=e.reduce(function(a,u,c){return a+(u.byteLength||u.length)},0),s=new Uint8Array(i),n=0;return e.forEach(function(a){a=ce(a),s.set(a,n),n+=a.byteLength}),s},Ne=function(r,e,t){var i=t===void 0?{}:t,s=i.offset,n=s===void 0?0:s,a=i.mask,u=a===void 0?[]:a;r=ce(r),e=ce(e);var c=e.every?e.every:Array.prototype.every;return e.length&&r.length-n>=e.length&&c.call(e,function(m,f){var _=u[f]?u[f]&r[n+f]:r[n+f];return m===_})},cf=function(r,e,t){e.forEach(function(i){for(var s in r.mediaGroups[i])for(var n in r.mediaGroups[i][s]){var a=r.mediaGroups[i][s][n];t(a,i,s,n)}})},Xr={},ti={},Ni={},_l;function In(){if(_l)return Ni;_l=1;function r(n,a,u){if(u===void 0&&(u=Array.prototype),n&&typeof u.find=="function")return u.find.call(n,a);for(var c=0;c<n.length;c++)if(Object.prototype.hasOwnProperty.call(n,c)){var m=n[c];if(a.call(void 0,m,c,n))return m}}function e(n,a){return a===void 0&&(a=Object),a&&typeof a.freeze=="function"?a.freeze(n):n}function t(n,a){if(n===null||typeof n!="object")throw new TypeError("target is not an object");for(var u in a)Object.prototype.hasOwnProperty.call(a,u)&&(n[u]=a[u]);return n}var i=e({HTML:"text/html",isHTML:function(n){return n===i.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),s=e({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(n){return n===s.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});return Ni.assign=t,Ni.find=r,Ni.freeze=e,Ni.MIME_TYPE=i,Ni.NAMESPACE=s,Ni}var bl;function Vc(){if(bl)return ti;bl=1;var r=In(),e=r.find,t=r.NAMESPACE;function i(y){return y!==""}function s(y){return y?y.split(/[\t\n\f\r ]+/).filter(i):[]}function n(y,T){return y.hasOwnProperty(T)||(y[T]=!0),y}function a(y){if(!y)return[];var T=s(y);return Object.keys(T.reduce(n,{}))}function u(y){return function(T){return y&&y.indexOf(T)!==-1}}function c(y,T){for(var D in y)Object.prototype.hasOwnProperty.call(y,D)&&(T[D]=y[D])}function m(y,T){var D=y.prototype;if(!(D instanceof T)){let W=function(){};W.prototype=T.prototype,W=new W,c(D,W),y.prototype=D=W}D.constructor!=y&&(typeof y!="function"&&console.error("unknown Class:"+y),D.constructor=y)}var f={},_=f.ELEMENT_NODE=1,P=f.ATTRIBUTE_NODE=2,S=f.TEXT_NODE=3,R=f.CDATA_SECTION_NODE=4,b=f.ENTITY_REFERENCE_NODE=5,I=f.ENTITY_NODE=6,M=f.PROCESSING_INSTRUCTION_NODE=7,N=f.COMMENT_NODE=8,O=f.DOCUMENT_NODE=9,z=f.DOCUMENT_TYPE_NODE=10,q=f.DOCUMENT_FRAGMENT_NODE=11,$=f.NOTATION_NODE=12,L={},H={};L.INDEX_SIZE_ERR=(H[1]="Index size error",1),L.DOMSTRING_SIZE_ERR=(H[2]="DOMString size error",2);var v=L.HIERARCHY_REQUEST_ERR=(H[3]="Hierarchy request error",3);L.WRONG_DOCUMENT_ERR=(H[4]="Wrong document",4),L.INVALID_CHARACTER_ERR=(H[5]="Invalid character",5),L.NO_DATA_ALLOWED_ERR=(H[6]="No data allowed",6),L.NO_MODIFICATION_ALLOWED_ERR=(H[7]="No modification allowed",7);var C=L.NOT_FOUND_ERR=(H[8]="Not found",8);L.NOT_SUPPORTED_ERR=(H[9]="Not supported",9);var V=L.INUSE_ATTRIBUTE_ERR=(H[10]="Attribute in use",10);L.INVALID_STATE_ERR=(H[11]="Invalid state",11),L.SYNTAX_ERR=(H[12]="Syntax error",12),L.INVALID_MODIFICATION_ERR=(H[13]="Invalid modification",13),L.NAMESPACE_ERR=(H[14]="Invalid namespace",14),L.INVALID_ACCESS_ERR=(H[15]="Invalid access",15);function U(y,T){if(T instanceof Error)var D=T;else D=this,Error.call(this,H[y]),this.message=H[y],Error.captureStackTrace&&Error.captureStackTrace(this,U);return D.code=y,T&&(this.message=this.message+": "+T),D}U.prototype=Error.prototype,c(L,U);function F(){}F.prototype={length:0,item:function(y){return y>=0&&y<this.length?this[y]:null},toString:function(y,T){for(var D=[],W=0;W<this.length;W++)hi(this[W],D,y,T);return D.join("")},filter:function(y){return Array.prototype.filter.call(this,y)},indexOf:function(y){return Array.prototype.indexOf.call(this,y)}};function K(y,T){this._node=y,this._refresh=T,ee(this)}function ee(y){var T=y._node._inc||y._node.ownerDocument._inc;if(y._inc!==T){var D=y._refresh(y._node);if(Cs(y,"length",D.length),!y.$$length||D.length<y.$$length)for(var W=D.length;W in y;W++)Object.prototype.hasOwnProperty.call(y,W)&&delete y[W];c(D,y),y._inc=T}}K.prototype.item=function(y){return ee(this),this[y]||null},m(K,F);function se(){}function Q(y,T){for(var D=y.length;D--;)if(y[D]===T)return D}function J(y,T,D,W){if(W?T[Q(T,W)]=D:T[T.length++]=D,y){D.ownerElement=y;var ne=y.ownerDocument;ne&&(W&&Ke(ne,y,W),pe(ne,y,D))}}function Z(y,T,D){var W=Q(T,D);if(W>=0){for(var ne=T.length-1;W<ne;)T[W]=T[++W];if(T.length=ne,y){var de=y.ownerDocument;de&&(Ke(de,y,D),D.ownerElement=null)}}else throw new U(C,new Error(y.tagName+"@"+D))}se.prototype={length:0,item:F.prototype.item,getNamedItem:function(y){for(var T=this.length;T--;){var D=this[T];if(D.nodeName==y)return D}},setNamedItem:function(y){var T=y.ownerElement;if(T&&T!=this._ownerElement)throw new U(V);var D=this.getNamedItem(y.nodeName);return J(this._ownerElement,this,y,D),D},setNamedItemNS:function(y){var T=y.ownerElement,D;if(T&&T!=this._ownerElement)throw new U(V);return D=this.getNamedItemNS(y.namespaceURI,y.localName),J(this._ownerElement,this,y,D),D},removeNamedItem:function(y){var T=this.getNamedItem(y);return Z(this._ownerElement,this,T),T},removeNamedItemNS:function(y,T){var D=this.getNamedItemNS(y,T);return Z(this._ownerElement,this,D),D},getNamedItemNS:function(y,T){for(var D=this.length;D--;){var W=this[D];if(W.localName==T&&W.namespaceURI==y)return W}return null}};function ie(){}ie.prototype={hasFeature:function(y,T){return!0},createDocument:function(y,T,D){var W=new _e;if(W.implementation=this,W.childNodes=new F,W.doctype=D||null,D&&W.appendChild(D),T){var ne=W.createElementNS(y,T);W.appendChild(ne)}return W},createDocumentType:function(y,T,D){var W=new ci;return W.name=y,W.nodeName=y,W.publicId=T||"",W.systemId=D||"",W}};function te(){}te.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(y,T){return St(this,y,T)},replaceChild:function(y,T){St(this,y,T,ft),T&&this.removeChild(T)},removeChild:function(y){return $e(this,y)},appendChild:function(y){return this.insertBefore(y,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(y){return Or(this.ownerDocument||this,this,y)},normalize:function(){for(var y=this.firstChild;y;){var T=y.nextSibling;T&&T.nodeType==S&&y.nodeType==S?(this.removeChild(T),y.appendData(T.data)):(y.normalize(),y=T)}},isSupported:function(y,T){return this.ownerDocument.implementation.hasFeature(y,T)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(y){for(var T=this;T;){var D=T._nsMap;if(D){for(var W in D)if(Object.prototype.hasOwnProperty.call(D,W)&&D[W]===y)return W}T=T.nodeType==P?T.ownerDocument:T.parentNode}return null},lookupNamespaceURI:function(y){for(var T=this;T;){var D=T._nsMap;if(D&&Object.prototype.hasOwnProperty.call(D,y))return D[y];T=T.nodeType==P?T.ownerDocument:T.parentNode}return null},isDefaultNamespace:function(y){var T=this.lookupPrefix(y);return T==null}};function me(y){return y=="<"&&"&lt;"||y==">"&&"&gt;"||y=="&"&&"&amp;"||y=='"'&&"&quot;"||"&#"+y.charCodeAt()+";"}c(f,te),c(f,te.prototype);function fe(y,T){if(T(y))return!0;if(y=y.firstChild)do if(fe(y,T))return!0;while(y=y.nextSibling)}function _e(){this.ownerDocument=this}function pe(y,T,D){y&&y._inc++;var W=D.namespaceURI;W===t.XMLNS&&(T._nsMap[D.prefix?D.localName:""]=D.value)}function Ke(y,T,D,W){y&&y._inc++;var ne=D.namespaceURI;ne===t.XMLNS&&delete T._nsMap[D.prefix?D.localName:""]}function Je(y,T,D){if(y&&y._inc){y._inc++;var W=T.childNodes;if(D)W[W.length++]=D;else{for(var ne=T.firstChild,de=0;ne;)W[de++]=ne,ne=ne.nextSibling;W.length=de,delete W[W.length]}}}function $e(y,T){var D=T.previousSibling,W=T.nextSibling;return D?D.nextSibling=W:y.firstChild=W,W?W.previousSibling=D:y.lastChild=D,T.parentNode=null,T.previousSibling=null,T.nextSibling=null,Je(y.ownerDocument,y),T}function Ze(y){return y&&(y.nodeType===te.DOCUMENT_NODE||y.nodeType===te.DOCUMENT_FRAGMENT_NODE||y.nodeType===te.ELEMENT_NODE)}function Tt(y){return y&&(st(y)||ai(y)||Ye(y)||y.nodeType===te.DOCUMENT_FRAGMENT_NODE||y.nodeType===te.COMMENT_NODE||y.nodeType===te.PROCESSING_INSTRUCTION_NODE)}function Ye(y){return y&&y.nodeType===te.DOCUMENT_TYPE_NODE}function st(y){return y&&y.nodeType===te.ELEMENT_NODE}function ai(y){return y&&y.nodeType===te.TEXT_NODE}function ze(y,T){var D=y.childNodes||[];if(e(D,st)||Ye(T))return!1;var W=e(D,Ye);return!(T&&W&&D.indexOf(W)>D.indexOf(T))}function oi(y,T){var D=y.childNodes||[];function W(de){return st(de)&&de!==T}if(e(D,W))return!1;var ne=e(D,Ye);return!(T&&ne&&D.indexOf(ne)>D.indexOf(T))}function Ve(y,T,D){if(!Ze(y))throw new U(v,"Unexpected parent node type "+y.nodeType);if(D&&D.parentNode!==y)throw new U(C,"child not in parent");if(!Tt(T)||Ye(T)&&y.nodeType!==te.DOCUMENT_NODE)throw new U(v,"Unexpected node type "+T.nodeType+" for parent node type "+y.nodeType)}function Gi(y,T,D){var W=y.childNodes||[],ne=T.childNodes||[];if(T.nodeType===te.DOCUMENT_FRAGMENT_NODE){var de=ne.filter(st);if(de.length>1||e(ne,ai))throw new U(v,"More than one element or text in fragment");if(de.length===1&&!ze(y,D))throw new U(v,"Element in fragment can not be inserted before doctype")}if(st(T)&&!ze(y,D))throw new U(v,"Only one element can be added and only after doctype");if(Ye(T)){if(e(W,Ye))throw new U(v,"Only one doctype is allowed");var xe=e(W,st);if(D&&W.indexOf(xe)<W.indexOf(D))throw new U(v,"Doctype can only be inserted before an element");if(!D&&xe)throw new U(v,"Doctype can not be appended since element is present")}}function ft(y,T,D){var W=y.childNodes||[],ne=T.childNodes||[];if(T.nodeType===te.DOCUMENT_FRAGMENT_NODE){var de=ne.filter(st);if(de.length>1||e(ne,ai))throw new U(v,"More than one element or text in fragment");if(de.length===1&&!oi(y,D))throw new U(v,"Element in fragment can not be inserted before doctype")}if(st(T)&&!oi(y,D))throw new U(v,"Only one element can be added and only after doctype");if(Ye(T)){if(e(W,function(we){return Ye(we)&&we!==D}))throw new U(v,"Only one doctype is allowed");var xe=e(W,st);if(D&&W.indexOf(xe)<W.indexOf(D))throw new U(v,"Doctype can only be inserted before an element")}}function St(y,T,D,W){Ve(y,T,D),y.nodeType===te.DOCUMENT_NODE&&(W||Gi)(y,T,D);var ne=T.parentNode;if(ne&&ne.removeChild(T),T.nodeType===q){var de=T.firstChild;if(de==null)return T;var xe=T.lastChild}else de=xe=T;var we=D?D.previousSibling:y.lastChild;de.previousSibling=we,xe.nextSibling=D,we?we.nextSibling=de:y.firstChild=de,D==null?y.lastChild=xe:D.previousSibling=xe;do{de.parentNode=y;var Lt=y.ownerDocument||y;ve(de,Lt)}while(de!==xe&&(de=de.nextSibling));return Je(y.ownerDocument||y,y),T.nodeType==q&&(T.firstChild=T.lastChild=null),T}function ve(y,T){if(y.ownerDocument!==T){if(y.ownerDocument=T,y.nodeType===_&&y.attributes)for(var D=0;D<y.attributes.length;D++){var W=y.attributes.item(D);W&&(W.ownerDocument=T)}for(var ne=y.firstChild;ne;)ve(ne,T),ne=ne.nextSibling}}function Ie(y,T){T.parentNode&&T.parentNode.removeChild(T),T.parentNode=y,T.previousSibling=y.lastChild,T.nextSibling=null,T.previousSibling?T.previousSibling.nextSibling=T:y.firstChild=T,y.lastChild=T,Je(y.ownerDocument,y,T);var D=y.ownerDocument||y;return ve(T,D),T}_e.prototype={nodeName:"#document",nodeType:O,doctype:null,documentElement:null,_inc:1,insertBefore:function(y,T){if(y.nodeType==q){for(var D=y.firstChild;D;){var W=D.nextSibling;this.insertBefore(D,T),D=W}return y}return St(this,y,T),ve(y,this),this.documentElement===null&&y.nodeType===_&&(this.documentElement=y),y},removeChild:function(y){return this.documentElement==y&&(this.documentElement=null),$e(this,y)},replaceChild:function(y,T){St(this,y,T,ft),ve(y,this),T&&this.removeChild(T),st(y)&&(this.documentElement=y)},importNode:function(y,T){return Es(this,y,T)},getElementById:function(y){var T=null;return fe(this.documentElement,function(D){if(D.nodeType==_&&D.getAttribute("id")==y)return T=D,!0}),T},getElementsByClassName:function(y){var T=a(y);return new K(this,function(D){var W=[];return T.length>0&&fe(D.documentElement,function(ne){if(ne!==D&&ne.nodeType===_){var de=ne.getAttribute("class");if(de){var xe=y===de;if(!xe){var we=a(de);xe=T.every(u(we))}xe&&W.push(ne)}}}),W})},createElement:function(y){var T=new Le;T.ownerDocument=this,T.nodeName=y,T.tagName=y,T.localName=y,T.childNodes=new F;var D=T.attributes=new se;return D._ownerElement=T,T},createDocumentFragment:function(){var y=new Se;return y.ownerDocument=this,y.childNodes=new F,y},createTextNode:function(y){var T=new wi;return T.ownerDocument=this,T.appendData(y),T},createComment:function(y){var T=new ki;return T.ownerDocument=this,T.appendData(y),T},createCDATASection:function(y){var T=new li;return T.ownerDocument=this,T.appendData(y),T},createProcessingInstruction:function(y,T){var D=new Pr;return D.ownerDocument=this,D.tagName=D.nodeName=D.target=y,D.nodeValue=D.data=T,D},createAttribute:function(y){var T=new ui;return T.ownerDocument=this,T.name=y,T.nodeName=y,T.localName=y,T.specified=!0,T},createEntityReference:function(y){var T=new Xi;return T.ownerDocument=this,T.nodeName=y,T},createElementNS:function(y,T){var D=new Le,W=T.split(":"),ne=D.attributes=new se;return D.childNodes=new F,D.ownerDocument=this,D.nodeName=T,D.tagName=T,D.namespaceURI=y,W.length==2?(D.prefix=W[0],D.localName=W[1]):D.localName=T,ne._ownerElement=D,D},createAttributeNS:function(y,T){var D=new ui,W=T.split(":");return D.ownerDocument=this,D.nodeName=T,D.name=T,D.namespaceURI=y,D.specified=!0,W.length==2?(D.prefix=W[0],D.localName=W[1]):D.localName=T,D}},m(_e,te);function Le(){this._nsMap={}}Le.prototype={nodeType:_,hasAttribute:function(y){return this.getAttributeNode(y)!=null},getAttribute:function(y){var T=this.getAttributeNode(y);return T&&T.value||""},getAttributeNode:function(y){return this.attributes.getNamedItem(y)},setAttribute:function(y,T){var D=this.ownerDocument.createAttribute(y);D.value=D.nodeValue=""+T,this.setAttributeNode(D)},removeAttribute:function(y){var T=this.getAttributeNode(y);T&&this.removeAttributeNode(T)},appendChild:function(y){return y.nodeType===q?this.insertBefore(y,null):Ie(this,y)},setAttributeNode:function(y){return this.attributes.setNamedItem(y)},setAttributeNodeNS:function(y){return this.attributes.setNamedItemNS(y)},removeAttributeNode:function(y){return this.attributes.removeNamedItem(y.nodeName)},removeAttributeNS:function(y,T){var D=this.getAttributeNodeNS(y,T);D&&this.removeAttributeNode(D)},hasAttributeNS:function(y,T){return this.getAttributeNodeNS(y,T)!=null},getAttributeNS:function(y,T){var D=this.getAttributeNodeNS(y,T);return D&&D.value||""},setAttributeNS:function(y,T,D){var W=this.ownerDocument.createAttributeNS(y,T);W.value=W.nodeValue=""+D,this.setAttributeNode(W)},getAttributeNodeNS:function(y,T){return this.attributes.getNamedItemNS(y,T)},getElementsByTagName:function(y){return new K(this,function(T){var D=[];return fe(T,function(W){W!==T&&W.nodeType==_&&(y==="*"||W.tagName==y)&&D.push(W)}),D})},getElementsByTagNameNS:function(y,T){return new K(this,function(D){var W=[];return fe(D,function(ne){ne!==D&&ne.nodeType===_&&(y==="*"||ne.namespaceURI===y)&&(T==="*"||ne.localName==T)&&W.push(ne)}),W})}},_e.prototype.getElementsByTagName=Le.prototype.getElementsByTagName,_e.prototype.getElementsByTagNameNS=Le.prototype.getElementsByTagNameNS,m(Le,te);function ui(){}ui.prototype.nodeType=P,m(ui,te);function Jt(){}Jt.prototype={data:"",substringData:function(y,T){return this.data.substring(y,y+T)},appendData:function(y){y=this.data+y,this.nodeValue=this.data=y,this.length=y.length},insertData:function(y,T){this.replaceData(y,0,T)},appendChild:function(y){throw new Error(H[v])},deleteData:function(y,T){this.replaceData(y,T,"")},replaceData:function(y,T,D){var W=this.data.substring(0,y),ne=this.data.substring(y+T);D=W+D+ne,this.nodeValue=this.data=D,this.length=D.length}},m(Jt,te);function wi(){}wi.prototype={nodeName:"#text",nodeType:S,splitText:function(y){var T=this.data,D=T.substring(y);T=T.substring(0,y),this.data=this.nodeValue=T,this.length=T.length;var W=this.ownerDocument.createTextNode(D);return this.parentNode&&this.parentNode.insertBefore(W,this.nextSibling),W}},m(wi,Jt);function ki(){}ki.prototype={nodeName:"#comment",nodeType:N},m(ki,Jt);function li(){}li.prototype={nodeName:"#cdata-section",nodeType:R},m(li,Jt);function ci(){}ci.prototype.nodeType=z,m(ci,te);function Dr(){}Dr.prototype.nodeType=$,m(Dr,te);function Ir(){}Ir.prototype.nodeType=I,m(Ir,te);function Xi(){}Xi.prototype.nodeType=b,m(Xi,te);function Se(){}Se.prototype.nodeName="#document-fragment",Se.prototype.nodeType=q,m(Se,te);function Pr(){}Pr.prototype.nodeType=M,m(Pr,te);function Ai(){}Ai.prototype.serializeToString=function(y,T,D){return Ts.call(y,T,D)},te.prototype.toString=Ts;function Ts(y,T){var D=[],W=this.nodeType==9&&this.documentElement||this,ne=W.prefix,de=W.namespaceURI;if(de&&ne==null){var ne=W.lookupPrefix(de);if(ne==null)var xe=[{namespace:de,prefix:null}]}return hi(this,D,y,T,xe),D.join("")}function Ss(y,T,D){var W=y.prefix||"",ne=y.namespaceURI;if(!ne||W==="xml"&&ne===t.XML||ne===t.XMLNS)return!1;for(var de=D.length;de--;){var xe=D[de];if(xe.prefix===W)return xe.namespace!==ne}return!0}function Lr(y,T,D){y.push(" ",T,'="',D.replace(/[<>&"\t\n\r]/g,me),'"')}function hi(y,T,D,W,ne){if(ne||(ne=[]),W)if(y=W(y),y){if(typeof y=="string"){T.push(y);return}}else return;switch(y.nodeType){case _:var de=y.attributes,xe=de.length,we=y.firstChild,Lt=y.tagName;D=t.isHTML(y.namespaceURI)||D;var Ft=Lt;if(!D&&!y.prefix&&y.namespaceURI){for(var Et,di=0;di<de.length;di++)if(de.item(di).name==="xmlns"){Et=de.item(di).value;break}if(!Et)for(var Ct=ne.length-1;Ct>=0;Ct--){var Ue=ne[Ct];if(Ue.prefix===""&&Ue.namespace===y.namespaceURI){Et=Ue.namespace;break}}if(Et!==y.namespaceURI)for(var Ct=ne.length-1;Ct>=0;Ct--){var Ue=ne[Ct];if(Ue.namespace===y.namespaceURI){Ue.prefix&&(Ft=Ue.prefix+":"+Lt);break}}}T.push("<",Ft);for(var Zt=0;Zt<xe;Zt++){var wt=de.item(Zt);wt.prefix=="xmlns"?ne.push({prefix:wt.localName,namespace:wt.value}):wt.nodeName=="xmlns"&&ne.push({prefix:"",namespace:wt.value})}for(var Zt=0;Zt<xe;Zt++){var wt=de.item(Zt);if(Ss(wt,D,ne)){var kt=wt.prefix||"",nt=wt.namespaceURI;Lr(T,kt?"xmlns:"+kt:"xmlns",nt),ne.push({prefix:kt,namespace:nt})}hi(wt,T,D,W,ne)}if(Lt===Ft&&Ss(y,D,ne)){var kt=y.prefix||"",nt=y.namespaceURI;Lr(T,kt?"xmlns:"+kt:"xmlns",nt),ne.push({prefix:kt,namespace:nt})}if(we||D&&!/^(?:meta|link|img|br|hr|input)$/i.test(Lt)){if(T.push(">"),D&&/^script$/i.test(Lt))for(;we;)we.data?T.push(we.data):hi(we,T,D,W,ne.slice()),we=we.nextSibling;else for(;we;)hi(we,T,D,W,ne.slice()),we=we.nextSibling;T.push("</",Ft,">")}else T.push("/>");return;case O:case q:for(var we=y.firstChild;we;)hi(we,T,D,W,ne.slice()),we=we.nextSibling;return;case P:return Lr(T,y.name,y.value);case S:return T.push(y.data.replace(/[<&>]/g,me));case R:return T.push("<![CDATA[",y.data,"]]>");case N:return T.push("<!--",y.data,"-->");case z:var xi=y.publicId,Te=y.systemId;if(T.push("<!DOCTYPE ",y.name),xi)T.push(" PUBLIC ",xi),Te&&Te!="."&&T.push(" ",Te),T.push(">");else if(Te&&Te!=".")T.push(" SYSTEM ",Te,">");else{var ws=y.internalSubset;ws&&T.push(" [",ws,"]"),T.push(">")}return;case M:return T.push("<?",y.target," ",y.data,"?>");case b:return T.push("&",y.nodeName,";");default:T.push("??",y.nodeName)}}function Es(y,T,D){var W;switch(T.nodeType){case _:W=T.cloneNode(!1),W.ownerDocument=y;case q:break;case P:D=!0;break}if(W||(W=T.cloneNode(!1)),W.ownerDocument=y,W.parentNode=null,D)for(var ne=T.firstChild;ne;)W.appendChild(Es(y,ne,D)),ne=ne.nextSibling;return W}function Or(y,T,D){var W=new T.constructor;for(var ne in T)if(Object.prototype.hasOwnProperty.call(T,ne)){var de=T[ne];typeof de!="object"&&de!=W[ne]&&(W[ne]=de)}switch(T.childNodes&&(W.childNodes=new F),W.ownerDocument=y,W.nodeType){case _:var xe=T.attributes,we=W.attributes=new se,Lt=xe.length;we._ownerElement=W;for(var Ft=0;Ft<Lt;Ft++)W.setAttributeNode(Or(y,xe.item(Ft),!0));break;case P:D=!0}if(D)for(var Et=T.firstChild;Et;)W.appendChild(Or(y,Et,D)),Et=Et.nextSibling;return W}function Cs(y,T,D){y[T]=D}try{if(Object.defineProperty){let y=function(T){switch(T.nodeType){case _:case q:var D=[];for(T=T.firstChild;T;)T.nodeType!==7&&T.nodeType!==8&&D.push(y(T)),T=T.nextSibling;return D.join("");default:return T.nodeValue}};Object.defineProperty(K.prototype,"length",{get:function(){return ee(this),this.$$length}}),Object.defineProperty(te.prototype,"textContent",{get:function(){return y(this)},set:function(T){switch(this.nodeType){case _:case q:for(;this.firstChild;)this.removeChild(this.firstChild);(T||String(T))&&this.appendChild(this.ownerDocument.createTextNode(T));break;default:this.data=T,this.value=T,this.nodeValue=T}}}),Cs=function(T,D,W){T["$$"+D]=W}}}catch{}return ti.DocumentType=ci,ti.DOMException=U,ti.DOMImplementation=ie,ti.Element=Le,ti.Node=te,ti.NodeList=F,ti.XMLSerializer=Ai,ti}var Kr={},vl={},Tl;function hf(){return Tl||(Tl=1,(function(r){var e=In().freeze;r.XML_ENTITIES=e({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),r.HTML_ENTITIES=e({Aacute:"\xC1",aacute:"\xE1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",Acirc:"\xC2",acirc:"\xE2",acute:"\xB4",Acy:"\u0410",acy:"\u0430",AElig:"\xC6",aelig:"\xE6",af:"\u2061",Afr:"\u{1D504}",afr:"\u{1D51E}",Agrave:"\xC0",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03B1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2A3F",AMP:"&",amp:"&",And:"\u2A53",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",Aogon:"\u0104",aogon:"\u0105",Aopf:"\u{1D538}",aopf:"\u{1D552}",ap:"\u2248",apacir:"\u2A6F",apE:"\u2A70",ape:"\u224A",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",Aring:"\xC5",aring:"\xE5",Ascr:"\u{1D49C}",ascr:"\u{1D4B6}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",Atilde:"\xC3",atilde:"\xE3",Auml:"\xC4",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",Barwed:"\u2306",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",Because:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",Beta:"\u0392",beta:"\u03B2",beth:"\u2136",between:"\u226C",Bfr:"\u{1D505}",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bNot:"\u2AED",bnot:"\u2310",Bopf:"\u{1D539}",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxDL:"\u2557",boxDl:"\u2556",boxdL:"\u2555",boxdl:"\u2510",boxDR:"\u2554",boxDr:"\u2553",boxdR:"\u2552",boxdr:"\u250C",boxH:"\u2550",boxh:"\u2500",boxHD:"\u2566",boxHd:"\u2564",boxhD:"\u2565",boxhd:"\u252C",boxHU:"\u2569",boxHu:"\u2567",boxhU:"\u2568",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxUL:"\u255D",boxUl:"\u255C",boxuL:"\u255B",boxul:"\u2518",boxUR:"\u255A",boxUr:"\u2559",boxuR:"\u2558",boxur:"\u2514",boxV:"\u2551",boxv:"\u2502",boxVH:"\u256C",boxVh:"\u256B",boxvH:"\u256A",boxvh:"\u253C",boxVL:"\u2563",boxVl:"\u2562",boxvL:"\u2561",boxvl:"\u2524",boxVR:"\u2560",boxVr:"\u255F",boxvR:"\u255E",boxvr:"\u251C",bprime:"\u2035",Breve:"\u02D8",breve:"\u02D8",brvbar:"\xA6",Bscr:"\u212C",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",Bumpeq:"\u224E",bumpeq:"\u224F",Cacute:"\u0106",cacute:"\u0107",Cap:"\u22D2",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",Ccaron:"\u010C",ccaron:"\u010D",Ccedil:"\xC7",ccedil:"\xE7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",Cdot:"\u010A",cdot:"\u010B",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",CenterDot:"\xB7",centerdot:"\xB7",Cfr:"\u212D",cfr:"\u{1D520}",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03A7",chi:"\u03C7",cir:"\u25CB",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cirE:"\u29C3",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",Colon:"\u2237",colon:":",Colone:"\u2A74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",Conint:"\u222F",conint:"\u222E",ContourIntegral:"\u222E",Copf:"\u2102",copf:"\u{1D554}",coprod:"\u2210",Coproduct:"\u2210",COPY:"\xA9",copy:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",Cross:"\u2A2F",cross:"\u2717",Cscr:"\u{1D49E}",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",Cup:"\u22D3",cup:"\u222A",cupbrcap:"\u2A48",CupCap:"\u224D",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",Dagger:"\u2021",dagger:"\u2020",daleth:"\u2138",Darr:"\u21A1",dArr:"\u21D3",darr:"\u2193",dash:"\u2010",Dashv:"\u2AE4",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",Dcaron:"\u010E",dcaron:"\u010F",Dcy:"\u0414",dcy:"\u0434",DD:"\u2145",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",Delta:"\u0394",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",Dfr:"\u{1D507}",dfr:"\u{1D521}",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",Diamond:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",Dopf:"\u{1D53B}",dopf:"\u{1D555}",Dot:"\xA8",dot:"\u02D9",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",Downarrow:"\u21D3",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",Dscr:"\u{1D49F}",dscr:"\u{1D4B9}",DScy:"\u0405",dscy:"\u0455",dsol:"\u29F6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",DZcy:"\u040F",dzcy:"\u045F",dzigrarr:"\u27FF",Eacute:"\xC9",eacute:"\xE9",easter:"\u2A6E",Ecaron:"\u011A",ecaron:"\u011B",ecir:"\u2256",Ecirc:"\xCA",ecirc:"\xEA",ecolon:"\u2255",Ecy:"\u042D",ecy:"\u044D",eDDot:"\u2A77",Edot:"\u0116",eDot:"\u2251",edot:"\u0117",ee:"\u2147",efDot:"\u2252",Efr:"\u{1D508}",efr:"\u{1D522}",eg:"\u2A9A",Egrave:"\xC8",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",ENG:"\u014A",eng:"\u014B",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\u{1D53C}",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",Epsilon:"\u0395",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",Escr:"\u2130",escr:"\u212F",esdot:"\u2250",Esim:"\u2A73",esim:"\u2242",Eta:"\u0397",eta:"\u03B7",ETH:"\xD0",eth:"\xF0",Euml:"\xCB",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",ExponentialE:"\u2147",exponentiale:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",Ffr:"\u{1D509}",ffr:"\u{1D523}",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",Fopf:"\u{1D53D}",fopf:"\u{1D557}",ForAll:"\u2200",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",Fscr:"\u2131",fscr:"\u{1D4BB}",gacute:"\u01F5",Gamma:"\u0393",gamma:"\u03B3",Gammad:"\u03DC",gammad:"\u03DD",gap:"\u2A86",Gbreve:"\u011E",gbreve:"\u011F",Gcedil:"\u0122",Gcirc:"\u011C",gcirc:"\u011D",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",gE:"\u2267",ge:"\u2265",gEl:"\u2A8C",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",Gfr:"\u{1D50A}",gfr:"\u{1D524}",Gg:"\u22D9",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gl:"\u2277",gla:"\u2AA5",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gnE:"\u2269",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",Gopf:"\u{1D53E}",gopf:"\u{1D558}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",Gt:"\u226B",GT:">",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",HARDcy:"\u042A",hardcy:"\u044A",hArr:"\u21D4",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",Hat:"^",hbar:"\u210F",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",Hfr:"\u210C",hfr:"\u{1D525}",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",Hopf:"\u210D",hopf:"\u{1D559}",horbar:"\u2015",HorizontalLine:"\u2500",Hscr:"\u210B",hscr:"\u{1D4BD}",hslash:"\u210F",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xCD",iacute:"\xED",ic:"\u2063",Icirc:"\xCE",icirc:"\xEE",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",Ifr:"\u2111",ifr:"\u{1D526}",Igrave:"\xCC",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Im:"\u2111",Imacr:"\u012A",imacr:"\u012B",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",Int:"\u222C",int:"\u222B",intcal:"\u22BA",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012E",iogon:"\u012F",Iopf:"\u{1D540}",iopf:"\u{1D55A}",Iota:"\u0399",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",Iscr:"\u2110",iscr:"\u{1D4BE}",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xCF",iuml:"\xEF",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\u{1D50D}",jfr:"\u{1D527}",jmath:"\u0237",Jopf:"\u{1D541}",jopf:"\u{1D55B}",Jscr:"\u{1D4A5}",jscr:"\u{1D4BF}",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039A",kappa:"\u03BA",kappav:"\u03F0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041A",kcy:"\u043A",Kfr:"\u{1D50E}",kfr:"\u{1D528}",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040C",kjcy:"\u045C",Kopf:"\u{1D542}",kopf:"\u{1D55C}",Kscr:"\u{1D4A6}",kscr:"\u{1D4C0}",lAarr:"\u21DA",Lacute:"\u0139",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",Lambda:"\u039B",lambda:"\u03BB",Lang:"\u27EA",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",Larr:"\u219E",lArr:"\u21D0",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",lAtail:"\u291B",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lBarr:"\u290E",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",Lcaron:"\u013D",lcaron:"\u013E",Lcedil:"\u013B",lcedil:"\u013C",lceil:"\u2308",lcub:"{",Lcy:"\u041B",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",lE:"\u2266",le:"\u2264",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",Leftarrow:"\u21D0",leftarrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",LeftRightArrow:"\u2194",Leftrightarrow:"\u21D4",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",lEg:"\u2A8B",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",Lfr:"\u{1D50F}",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",Ll:"\u22D8",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",Lmidot:"\u013F",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lnE:"\u2268",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",LongLeftArrow:"\u27F5",Longleftarrow:"\u27F8",longleftarrow:"\u27F5",LongLeftRightArrow:"\u27F7",Longleftrightarrow:"\u27FA",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",LongRightArrow:"\u27F6",Longrightarrow:"\u27F9",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",Lopf:"\u{1D543}",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",Lscr:"\u2112",lscr:"\u{1D4C1}",Lsh:"\u21B0",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",Lstrok:"\u0141",lstrok:"\u0142",Lt:"\u226A",LT:"<",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",Mcy:"\u041C",mcy:"\u043C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",Mopf:"\u{1D544}",mopf:"\u{1D55E}",mp:"\u2213",Mscr:"\u2133",mscr:"\u{1D4C2}",mstpos:"\u223E",Mu:"\u039C",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",Ncy:"\u041D",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",neArr:"\u21D7",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
28
+ `,nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1D511}",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",nGt:"\u226B\u20D2",ngt:"\u226F",ngtr:"\u226F",nGtv:"\u226B\u0338",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",NJcy:"\u040A",njcy:"\u045A",nlArr:"\u21CD",nlarr:"\u219A",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nLeftarrow:"\u21CD",nleftarrow:"\u219A",nLeftrightarrow:"\u21CE",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nLt:"\u226A\u20D2",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",nopf:"\u{1D55F}",Not:"\u2AEC",not:"\xAC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nRightarrow:"\u21CF",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",Nscr:"\u{1D4A9}",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",Ntilde:"\xD1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",Nu:"\u039D",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nVDash:"\u22AF",nVdash:"\u22AE",nvDash:"\u22AD",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwArr:"\u21D6",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xD3",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",Ocirc:"\xD4",ocirc:"\xF4",Ocy:"\u041E",ocy:"\u043E",odash:"\u229D",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29BF",Ofr:"\u{1D512}",ofr:"\u{1D52C}",ogon:"\u02DB",Ograve:"\xD2",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",Omacr:"\u014C",omacr:"\u014D",Omega:"\u03A9",omega:"\u03C9",Omicron:"\u039F",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",Oopf:"\u{1D546}",oopf:"\u{1D560}",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",Or:"\u2A54",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",Oscr:"\u{1D4AA}",oscr:"\u2134",Oslash:"\xD8",oslash:"\xF8",osol:"\u2298",Otilde:"\xD5",otilde:"\xF5",Otimes:"\u2A37",otimes:"\u2297",otimesas:"\u2A36",Ouml:"\xD6",ouml:"\xF6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",Pcy:"\u041F",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",Pfr:"\u{1D513}",pfr:"\u{1D52D}",Phi:"\u03A6",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",Pi:"\u03A0",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",Popf:"\u2119",popf:"\u{1D561}",pound:"\xA3",Pr:"\u2ABB",pr:"\u227A",prap:"\u2AB7",prcue:"\u227C",prE:"\u2AB3",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",Prime:"\u2033",prime:"\u2032",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportion:"\u2237",Proportional:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",Pscr:"\u{1D4AB}",pscr:"\u{1D4C5}",Psi:"\u03A8",psi:"\u03C8",puncsp:"\u2008",Qfr:"\u{1D514}",qfr:"\u{1D52E}",qint:"\u2A0C",Qopf:"\u211A",qopf:"\u{1D562}",qprime:"\u2057",Qscr:"\u{1D4AC}",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",QUOT:'"',quot:'"',rAarr:"\u21DB",race:"\u223D\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",Rang:"\u27EB",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",Rarr:"\u21A0",rArr:"\u21D2",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21A3",rarrw:"\u219D",rAtail:"\u291C",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",RBarr:"\u2910",rBarr:"\u290F",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",Re:"\u211C",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",REG:"\xAE",reg:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",Rfr:"\u211C",rfr:"\u{1D52F}",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",Rho:"\u03A1",rho:"\u03C1",rhov:"\u03F1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",Rightarrow:"\u21D2",rightarrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",Ropf:"\u211D",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",Rscr:"\u211B",rscr:"\u{1D4C7}",Rsh:"\u21B1",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",Sacute:"\u015A",sacute:"\u015B",sbquo:"\u201A",Sc:"\u2ABC",sc:"\u227B",scap:"\u2AB8",Scaron:"\u0160",scaron:"\u0161",sccue:"\u227D",scE:"\u2AB4",sce:"\u2AB0",Scedil:"\u015E",scedil:"\u015F",Scirc:"\u015C",scirc:"\u015D",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",Scy:"\u0421",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",searhk:"\u2925",seArr:"\u21D8",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\u{1D516}",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",Sigma:"\u03A3",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",SOFTcy:"\u042C",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",Sopf:"\u{1D54A}",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",Square:"\u25A1",square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",Sscr:"\u{1D4AE}",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",Star:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",Sub:"\u22D0",sub:"\u2282",subdot:"\u2ABD",subE:"\u2AC5",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",Subset:"\u22D0",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",Sum:"\u2211",sum:"\u2211",sung:"\u266A",Sup:"\u22D1",sup:"\u2283",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supdot:"\u2ABE",supdsub:"\u2AD8",supE:"\u2AC6",supe:"\u2287",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",Supset:"\u22D1",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swArr:"\u21D9",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:" ",target:"\u2316",Tau:"\u03A4",tau:"\u03C4",tbrk:"\u23B4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",Tfr:"\u{1D517}",tfr:"\u{1D531}",there4:"\u2234",Therefore:"\u2234",therefore:"\u2234",Theta:"\u0398",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223C",THORN:"\xDE",thorn:"\xFE",Tilde:"\u223C",tilde:"\u02DC",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",Topf:"\u{1D54B}",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",TRADE:"\u2122",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",Tscr:"\u{1D4AF}",tscr:"\u{1D4C9}",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040B",tshcy:"\u045B",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",Uacute:"\xDA",uacute:"\xFA",Uarr:"\u219F",uArr:"\u21D1",uarr:"\u2191",Uarrocir:"\u2949",Ubrcy:"\u040E",ubrcy:"\u045E",Ubreve:"\u016C",ubreve:"\u016D",Ucirc:"\xDB",ucirc:"\xFB",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21C5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",Ufr:"\u{1D518}",ufr:"\u{1D532}",Ugrave:"\xD9",ugrave:"\xF9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",Umacr:"\u016A",umacr:"\u016B",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",uogon:"\u0173",Uopf:"\u{1D54C}",uopf:"\u{1D566}",UpArrow:"\u2191",Uparrow:"\u21D1",uparrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",Updownarrow:"\u21D5",updownarrow:"\u2195",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",upsi:"\u03C5",upsih:"\u03D2",Upsilon:"\u03A5",upsilon:"\u03C5",UpTee:"\u22A5",UpTeeArrow:"\u21A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",Uring:"\u016E",uring:"\u016F",urtri:"\u25F9",Uscr:"\u{1D4B0}",uscr:"\u{1D4CA}",utdot:"\u22F0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",Uuml:"\xDC",uuml:"\xFC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",vArr:"\u21D5",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",Vbar:"\u2AEB",vBar:"\u2AE8",vBarv:"\u2AE9",Vcy:"\u0412",vcy:"\u0432",VDash:"\u22AB",Vdash:"\u22A9",vDash:"\u22A8",vdash:"\u22A2",Vdashl:"\u2AE6",Vee:"\u22C1",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",Verbar:"\u2016",verbar:"|",Vert:"\u2016",vert:"|",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",Vopf:"\u{1D54D}",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",Vscr:"\u{1D4B1}",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2A5F",Wedge:"\u22C0",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\u{1D51A}",wfr:"\u{1D534}",Wopf:"\u{1D54E}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\u{1D4B2}",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",Xfr:"\u{1D51B}",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",Xi:"\u039E",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",Xopf:"\u{1D54F}",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",Xscr:"\u{1D4B3}",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",Yacute:"\xDD",yacute:"\xFD",YAcy:"\u042F",yacy:"\u044F",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042B",ycy:"\u044B",yen:"\xA5",Yfr:"\u{1D51C}",yfr:"\u{1D536}",YIcy:"\u0407",yicy:"\u0457",Yopf:"\u{1D550}",yopf:"\u{1D56A}",Yscr:"\u{1D4B4}",yscr:"\u{1D4CE}",YUcy:"\u042E",yucy:"\u044E",Yuml:"\u0178",yuml:"\xFF",Zacute:"\u0179",zacute:"\u017A",Zcaron:"\u017D",zcaron:"\u017E",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017B",zdot:"\u017C",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",Zeta:"\u0396",zeta:"\u03B6",Zfr:"\u2128",zfr:"\u{1D537}",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21DD",Zopf:"\u2124",zopf:"\u{1D56B}",Zscr:"\u{1D4B5}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"}),r.entityMap=r.HTML_ENTITIES})(vl)),vl}var Qs={},Sl;function df(){if(Sl)return Qs;Sl=1;var r=In().NAMESPACE,e=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,t=new RegExp("[\\-\\.0-9"+e.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),i=new RegExp("^"+e.source+t.source+"*(?::"+e.source+t.source+"*)?$"),s=0,n=1,a=2,u=3,c=4,m=5,f=6,_=7;function P(v,C){this.message=v,this.locator=C,Error.captureStackTrace&&Error.captureStackTrace(this,P)}P.prototype=new Error,P.prototype.name=P.name;function S(){}S.prototype={parse:function(v,C,V){var U=this.domBuilder;U.startDocument(),z(C,C={}),R(v,C,V,U,this.errorHandler),U.endDocument()}};function R(v,C,V,U,F){function K(Ie){if(Ie>65535){Ie-=65536;var Le=55296+(Ie>>10),ui=56320+(Ie&1023);return String.fromCharCode(Le,ui)}else return String.fromCharCode(Ie)}function ee(Ie){var Le=Ie.slice(1,-1);return Object.hasOwnProperty.call(V,Le)?V[Le]:Le.charAt(0)==="#"?K(parseInt(Le.substr(1).replace("x","0x"))):(F.error("entity not found:"+Ie),Ie)}function se(Ie){if(Ie>_e){var Le=v.substring(_e,Ie).replace(/&#?\w+;/g,ee);te&&Q(_e),U.characters(Le,0,Ie-_e),_e=Ie}}function Q(Ie,Le){for(;Ie>=Z&&(Le=ie.exec(v));)J=Le.index,Z=J+Le[0].length,te.lineNumber++;te.columnNumber=Ie-J+1}for(var J=0,Z=0,ie=/.*(?:\r\n?|\n)|.*$/g,te=U.locator,me=[{currentNSMap:C}],fe={},_e=0;;){try{var pe=v.indexOf("<",_e);if(pe<0){if(!v.substr(_e).match(/^\s*$/)){var Ke=U.doc,Je=Ke.createTextNode(v.substr(_e));Ke.appendChild(Je),U.currentElement=Je}return}switch(pe>_e&&se(pe),v.charAt(pe+1)){case"/":var Ve=v.indexOf(">",pe+3),$e=v.substring(pe+2,Ve).replace(/[ \t\n\r]+$/g,""),Ze=me.pop();Ve<0?($e=v.substring(pe+2).replace(/[\s<].*/,""),F.error("end tag name: "+$e+" is not complete:"+Ze.tagName),Ve=pe+1+$e.length):$e.match(/\s</)&&($e=$e.replace(/[\s<].*/,""),F.error("end tag name: "+$e+" maybe not complete"),Ve=pe+1+$e.length);var Tt=Ze.localNSMap,Ye=Ze.tagName==$e,st=Ye||Ze.tagName&&Ze.tagName.toLowerCase()==$e.toLowerCase();if(st){if(U.endElement(Ze.uri,Ze.localName,$e),Tt)for(var ai in Tt)Object.prototype.hasOwnProperty.call(Tt,ai)&&U.endPrefixMapping(ai);Ye||F.fatalError("end tag name: "+$e+" is not match the current start tagName:"+Ze.tagName)}else me.push(Ze);Ve++;break;case"?":te&&Q(pe),Ve=$(v,pe,U);break;case"!":te&&Q(pe),Ve=q(v,pe,U,F);break;default:te&&Q(pe);var ze=new L,oi=me[me.length-1].currentNSMap,Ve=I(v,pe,ze,oi,ee,F),Gi=ze.length;if(!ze.closed&&O(v,Ve,ze.tagName,fe)&&(ze.closed=!0,V.nbsp||F.warning("unclosed xml attribute")),te&&Gi){for(var ft=b(te,{}),St=0;St<Gi;St++){var ve=ze[St];Q(ve.offset),ve.locator=b(te,{})}U.locator=ft,M(ze,U,oi)&&me.push(ze),U.locator=te}else M(ze,U,oi)&&me.push(ze);r.isHTML(ze.uri)&&!ze.closed?Ve=N(v,Ve,ze.tagName,ee,U):Ve++}}catch(Ie){if(Ie instanceof P)throw Ie;F.error("element parse error: "+Ie),Ve=-1}Ve>_e?_e=Ve:se(Math.max(pe,_e)+1)}}function b(v,C){return C.lineNumber=v.lineNumber,C.columnNumber=v.columnNumber,C}function I(v,C,V,U,F,K){function ee(te,me,fe){V.attributeNames.hasOwnProperty(te)&&K.fatalError("Attribute "+te+" redefined"),V.addValue(te,me.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,F),fe)}for(var se,Q,J=++C,Z=s;;){var ie=v.charAt(J);switch(ie){case"=":if(Z===n)se=v.slice(C,J),Z=u;else if(Z===a)Z=u;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(Z===u||Z===n)if(Z===n&&(K.warning('attribute value must after "="'),se=v.slice(C,J)),C=J+1,J=v.indexOf(ie,C),J>0)Q=v.slice(C,J),ee(se,Q,C-1),Z=m;else throw new Error("attribute value no end '"+ie+"' match");else if(Z==c)Q=v.slice(C,J),ee(se,Q,C),K.warning('attribute "'+se+'" missed start quot('+ie+")!!"),C=J+1,Z=m;else throw new Error('attribute value must after "="');break;case"/":switch(Z){case s:V.setTagName(v.slice(C,J));case m:case f:case _:Z=_,V.closed=!0;case c:case n:break;case a:V.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return K.error("unexpected end of input"),Z==s&&V.setTagName(v.slice(C,J)),J;case">":switch(Z){case s:V.setTagName(v.slice(C,J));case m:case f:case _:break;case c:case n:Q=v.slice(C,J),Q.slice(-1)==="/"&&(V.closed=!0,Q=Q.slice(0,-1));case a:Z===a&&(Q=se),Z==c?(K.warning('attribute "'+Q+'" missed quot(")!'),ee(se,Q,C)):((!r.isHTML(U[""])||!Q.match(/^(?:disabled|checked|selected)$/i))&&K.warning('attribute "'+Q+'" missed value!! "'+Q+'" instead!!'),ee(Q,Q,C));break;case u:throw new Error("attribute value missed!!")}return J;case"\x80":ie=" ";default:if(ie<=" ")switch(Z){case s:V.setTagName(v.slice(C,J)),Z=f;break;case n:se=v.slice(C,J),Z=a;break;case c:var Q=v.slice(C,J);K.warning('attribute "'+Q+'" missed quot(")!!'),ee(se,Q,C);case m:Z=f;break}else switch(Z){case a:V.tagName,(!r.isHTML(U[""])||!se.match(/^(?:disabled|checked|selected)$/i))&&K.warning('attribute "'+se+'" missed value!! "'+se+'" instead2!!'),ee(se,se,C),C=J,Z=n;break;case m:K.warning('attribute space is required"'+se+'"!!');case f:Z=n,C=J;break;case u:Z=c,C=J;break;case _:throw new Error("elements closed character '/' and '>' must be connected to")}}J++}}function M(v,C,V){for(var U=v.tagName,F=null,K=v.length;K--;){var ee=v[K],se=ee.qName,Q=ee.value,te=se.indexOf(":");if(te>0)var J=ee.prefix=se.slice(0,te),Z=se.slice(te+1),ie=J==="xmlns"&&Z;else Z=se,J=null,ie=se==="xmlns"&&"";ee.localName=Z,ie!==!1&&(F==null&&(F={},z(V,V={})),V[ie]=F[ie]=Q,ee.uri=r.XMLNS,C.startPrefixMapping(ie,Q))}for(var K=v.length;K--;){ee=v[K];var J=ee.prefix;J&&(J==="xml"&&(ee.uri=r.XML),J!=="xmlns"&&(ee.uri=V[J||""]))}var te=U.indexOf(":");te>0?(J=v.prefix=U.slice(0,te),Z=v.localName=U.slice(te+1)):(J=null,Z=v.localName=U);var me=v.uri=V[J||""];if(C.startElement(me,Z,U,v),v.closed){if(C.endElement(me,Z,U),F)for(J in F)Object.prototype.hasOwnProperty.call(F,J)&&C.endPrefixMapping(J)}else return v.currentNSMap=V,v.localNSMap=F,!0}function N(v,C,V,U,F){if(/^(?:script|textarea)$/i.test(V)){var K=v.indexOf("</"+V+">",C),ee=v.substring(C+1,K);if(/[&<]/.test(ee))return/^script$/i.test(V)?(F.characters(ee,0,ee.length),K):(ee=ee.replace(/&#?\w+;/g,U),F.characters(ee,0,ee.length),K)}return C+1}function O(v,C,V,U){var F=U[V];return F==null&&(F=v.lastIndexOf("</"+V+">"),F<C&&(F=v.lastIndexOf("</"+V)),U[V]=F),F<C}function z(v,C){for(var V in v)Object.prototype.hasOwnProperty.call(v,V)&&(C[V]=v[V])}function q(v,C,V,U){var F=v.charAt(C+2);switch(F){case"-":if(v.charAt(C+3)==="-"){var K=v.indexOf("-->",C+4);return K>C?(V.comment(v,C+4,K-C-4),K+3):(U.error("Unclosed comment"),-1)}else return-1;default:if(v.substr(C+3,6)=="CDATA["){var K=v.indexOf("]]>",C+9);return V.startCDATA(),V.characters(v,C+9,K-C-9),V.endCDATA(),K+3}var ee=H(v,C),se=ee.length;if(se>1&&/!doctype/i.test(ee[0][0])){var Q=ee[1][0],J=!1,Z=!1;se>3&&(/^public$/i.test(ee[2][0])?(J=ee[3][0],Z=se>4&&ee[4][0]):/^system$/i.test(ee[2][0])&&(Z=ee[3][0]));var ie=ee[se-1];return V.startDTD(Q,J,Z),V.endDTD(),ie.index+ie[0].length}}return-1}function $(v,C,V){var U=v.indexOf("?>",C);if(U){var F=v.substring(C,U).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return F?(F[0].length,V.processingInstruction(F[1],F[2]),U+2):-1}return-1}function L(){this.attributeNames={}}L.prototype={setTagName:function(v){if(!i.test(v))throw new Error("invalid tagName:"+v);this.tagName=v},addValue:function(v,C,V){if(!i.test(v))throw new Error("invalid attribute:"+v);this.attributeNames[v]=this.length,this[this.length++]={qName:v,value:C,offset:V}},length:0,getLocalName:function(v){return this[v].localName},getLocator:function(v){return this[v].locator},getQName:function(v){return this[v].qName},getURI:function(v){return this[v].uri},getValue:function(v){return this[v].value}};function H(v,C){var V,U=[],F=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(F.lastIndex=C,F.exec(v);V=F.exec(v);)if(U.push(V),V[1])return U}return Qs.XMLReader=S,Qs.ParseError=P,Qs}var El;function pf(){if(El)return Kr;El=1;var r=In(),e=Vc(),t=hf(),i=df(),s=e.DOMImplementation,n=r.NAMESPACE,a=i.ParseError,u=i.XMLReader;function c(I){return I.replace(/\r[\n\u0085]/g,`
29
+ `).replace(/[\r\u0085\u2028]/g,`
30
+ `)}function m(I){this.options=I||{locator:{}}}m.prototype.parseFromString=function(I,M){var N=this.options,O=new u,z=N.domBuilder||new _,q=N.errorHandler,$=N.locator,L=N.xmlns||{},H=/\/x?html?$/.test(M),v=H?t.HTML_ENTITIES:t.XML_ENTITIES;$&&z.setDocumentLocator($),O.errorHandler=f(q,z,$),O.domBuilder=N.domBuilder||z,H&&(L[""]=n.HTML),L.xml=L.xml||n.XML;var C=N.normalizeLineEndings||c;return I&&typeof I=="string"?O.parse(C(I),L,v):O.errorHandler.error("invalid doc source"),z.doc};function f(I,M,N){if(!I){if(M instanceof _)return M;I=M}var O={},z=I instanceof Function;N=N||{};function q($){var L=I[$];!L&&z&&(L=I.length==2?function(H){I($,H)}:I),O[$]=L&&function(H){L("[xmldom "+$+"] "+H+S(N))}||function(){}}return q("warning"),q("error"),q("fatalError"),O}function _(){this.cdata=!1}function P(I,M){M.lineNumber=I.lineNumber,M.columnNumber=I.columnNumber}_.prototype={startDocument:function(){this.doc=new s().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(I,M,N,O){var z=this.doc,q=z.createElementNS(I,N||M),$=O.length;b(this,q),this.currentElement=q,this.locator&&P(this.locator,q);for(var L=0;L<$;L++){var I=O.getURI(L),H=O.getValue(L),N=O.getQName(L),v=z.createAttributeNS(I,N);this.locator&&P(O.getLocator(L),v),v.value=v.nodeValue=H,q.setAttributeNode(v)}},endElement:function(I,M,N){var O=this.currentElement;O.tagName,this.currentElement=O.parentNode},startPrefixMapping:function(I,M){},endPrefixMapping:function(I){},processingInstruction:function(I,M){var N=this.doc.createProcessingInstruction(I,M);this.locator&&P(this.locator,N),b(this,N)},ignorableWhitespace:function(I,M,N){},characters:function(I,M,N){if(I=R.apply(this,arguments),I){if(this.cdata)var O=this.doc.createCDATASection(I);else var O=this.doc.createTextNode(I);this.currentElement?this.currentElement.appendChild(O):/^\s*$/.test(I)&&this.doc.appendChild(O),this.locator&&P(this.locator,O)}},skippedEntity:function(I){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(I){(this.locator=I)&&(I.lineNumber=0)},comment:function(I,M,N){I=R.apply(this,arguments);var O=this.doc.createComment(I);this.locator&&P(this.locator,O),b(this,O)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(I,M,N){var O=this.doc.implementation;if(O&&O.createDocumentType){var z=O.createDocumentType(I,M,N);this.locator&&P(this.locator,z),b(this,z),this.doc.doctype=z}},warning:function(I){console.warn("[xmldom warning] "+I,S(this.locator))},error:function(I){console.error("[xmldom error] "+I,S(this.locator))},fatalError:function(I){throw new a(I,this.locator)}};function S(I){if(I)return`
31
+ @`+(I.systemId||"")+"#[line:"+I.lineNumber+",col:"+I.columnNumber+"]"}function R(I,M,N){return typeof I=="string"?I.substr(M,N):I.length>=M+N||M?new java.lang.String(I,M,N)+"":I}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(I){_.prototype[I]=function(){return null}});function b(I,M){I.currentElement?I.currentElement.appendChild(M):I.doc.appendChild(M)}return Kr.__DOMHandler=_,Kr.normalizeLineEndings=c,Kr.DOMParser=m,Kr}var Cl;function mf(){if(Cl)return Xr;Cl=1;var r=Vc();return Xr.DOMImplementation=r.DOMImplementation,Xr.XMLSerializer=r.XMLSerializer,Xr.DOMParser=pf().DOMParser,Xr}var gf=mf();/*! @name mpd-parser @version 1.3.1 @license Apache-2.0 */const wl=r=>!!r&&typeof r=="object",Xe=(...r)=>r.reduce((e,t)=>(typeof t!="object"||Object.keys(t).forEach(i=>{Array.isArray(e[i])&&Array.isArray(t[i])?e[i]=e[i].concat(t[i]):wl(e[i])&&wl(t[i])?e[i]=Xe(e[i],t[i]):e[i]=t[i]}),e),{}),zc=r=>Object.keys(r).map(e=>r[e]),ff=(r,e)=>{const t=[];for(let i=r;i<e;i++)t.push(i);return t},mr=r=>r.reduce((e,t)=>e.concat(t),[]),Wc=r=>{if(!r.length)return[];const e=[];for(let t=0;t<r.length;t++)e.push(r[t]);return e},yf=(r,e)=>r.reduce((t,i,s)=>(i[e]&&t.push(s),t),[]),_f=(r,e)=>zc(r.reduce((t,i)=>(i.forEach(s=>{t[e(s)]=s}),t),{}));var gr={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"};const us=({baseUrl:r="",source:e="",range:t="",indexRange:i=""})=>{const s={uri:e,resolvedUri:Dn(r||"",e)};if(t||i){const n=(t||i).split("-");let a=A.BigInt?A.BigInt(n[0]):parseInt(n[0],10),u=A.BigInt?A.BigInt(n[1]):parseInt(n[1],10);a<Number.MAX_SAFE_INTEGER&&typeof a=="bigint"&&(a=Number(a)),u<Number.MAX_SAFE_INTEGER&&typeof u=="bigint"&&(u=Number(u));let c;typeof u=="bigint"||typeof a=="bigint"?c=A.BigInt(u)-A.BigInt(a)+A.BigInt(1):c=u-a+1,typeof c=="bigint"&&c<Number.MAX_SAFE_INTEGER&&(c=Number(c)),s.byterange={length:c,offset:a}}return s},bf=r=>{let e;return typeof r.offset=="bigint"||typeof r.length=="bigint"?e=A.BigInt(r.offset)+A.BigInt(r.length)-A.BigInt(1):e=r.offset+r.length-1,`${r.offset}-${e}`},kl=r=>(r&&typeof r!="number"&&(r=parseInt(r,10)),isNaN(r)?null:r),vf={static(r){const{duration:e,timescale:t=1,sourceDuration:i,periodDuration:s}=r,n=kl(r.endNumber),a=e/t;return typeof n=="number"?{start:0,end:n}:typeof s=="number"?{start:0,end:s/a}:{start:0,end:i/a}},dynamic(r){const{NOW:e,clientOffset:t,availabilityStartTime:i,timescale:s=1,duration:n,periodStart:a=0,minimumUpdatePeriod:u=0,timeShiftBufferDepth:c=1/0}=r,m=kl(r.endNumber),f=(e+t)/1e3,_=i+a,P=f+u-_,S=Math.ceil(P*s/n),R=Math.floor((f-_-c)*s/n),b=Math.floor((f-_)*s/n);return{start:Math.max(0,R),end:typeof m=="number"?m:Math.min(S,b)}}},Tf=r=>e=>{const{duration:t,timescale:i=1,periodStart:s,startNumber:n=1}=r;return{number:n+e,duration:t/i,timeline:s,time:e*t}},Eo=r=>{const{type:e,duration:t,timescale:i=1,periodDuration:s,sourceDuration:n}=r,{start:a,end:u}=vf[e](r),c=ff(a,u).map(Tf(r));if(e==="static"){const m=c.length-1,f=typeof s=="number"?s:n;c[m].duration=f-t/i*m}return c},Gc=r=>{const{baseUrl:e,initialization:t={},sourceDuration:i,indexRange:s="",periodStart:n,presentationTime:a,number:u=0,duration:c}=r;if(!e)throw new Error(gr.NO_BASE_URL);const m=us({baseUrl:e,source:t.sourceURL,range:t.range}),f=us({baseUrl:e,source:e,indexRange:s});if(f.map=m,c){const _=Eo(r);_.length&&(f.duration=_[0].duration,f.timeline=_[0].timeline)}else i&&(f.duration=i,f.timeline=n);return f.presentationTime=a||n,f.number=u,[f]},Co=(r,e,t)=>{const i=r.sidx.map?r.sidx.map:null,s=r.sidx.duration,n=r.timeline||0,a=r.sidx.byterange,u=a.offset+a.length,c=e.timescale,m=e.references.filter(I=>I.referenceType!==1),f=[],_=r.endList?"static":"dynamic",P=r.sidx.timeline;let S=P,R=r.mediaSequence||0,b;typeof e.firstOffset=="bigint"?b=A.BigInt(u)+e.firstOffset:b=u+e.firstOffset;for(let I=0;I<m.length;I++){const M=e.references[I],N=M.referencedSize,O=M.subsegmentDuration;let z;typeof b=="bigint"?z=b+A.BigInt(N)-A.BigInt(1):z=b+N-1;const q=`${b}-${z}`,$=Gc({baseUrl:t,timescale:c,timeline:n,periodStart:P,presentationTime:S,number:R,duration:O,sourceDuration:s,indexRange:q,type:_})[0];i&&($.map=i),f.push($),typeof b=="bigint"?b+=A.BigInt(N):b+=N,S+=O/c,R++}return r.segments=f,r},Sf=["AUDIO","SUBTITLES"],Ef=1/60,Xc=r=>_f(r,({timeline:e})=>e).sort((e,t)=>e.timeline>t.timeline?1:-1),Cf=(r,e)=>{for(let t=0;t<r.length;t++)if(r[t].attributes.NAME===e)return r[t];return null},Al=r=>{let e=[];return cf(r,Sf,(t,i,s,n)=>{e=e.concat(t.playlists||[])}),e},xl=({playlist:r,mediaSequence:e})=>{r.mediaSequence=e,r.segments.forEach((t,i)=>{t.number=r.mediaSequence+i})},wf=({oldPlaylists:r,newPlaylists:e,timelineStarts:t})=>{e.forEach(i=>{i.discontinuitySequence=t.findIndex(function({timeline:u}){return u===i.timeline});const s=Cf(r,i.attributes.NAME);if(!s||i.sidx)return;const n=i.segments[0],a=s.segments.findIndex(function(u){return Math.abs(u.presentationTime-n.presentationTime)<Ef});if(a===-1){xl({playlist:i,mediaSequence:s.mediaSequence+s.segments.length}),i.segments[0].discontinuity=!0,i.discontinuityStarts.unshift(0),(!s.segments.length&&i.timeline>s.timeline||s.segments.length&&i.timeline>s.segments[s.segments.length-1].timeline)&&i.discontinuitySequence--;return}s.segments[a].discontinuity&&!n.discontinuity&&(n.discontinuity=!0,i.discontinuityStarts.unshift(0),i.discontinuitySequence--),xl({playlist:i,mediaSequence:s.segments[a].number})})},kf=({oldManifest:r,newManifest:e})=>{const t=r.playlists.concat(Al(r)),i=e.playlists.concat(Al(e));return e.timelineStarts=Xc([r.timelineStarts,e.timelineStarts]),wf({oldPlaylists:t,newPlaylists:i,timelineStarts:e.timelineStarts}),e},Pn=r=>r&&r.uri+"-"+bf(r.byterange),Ca=r=>{const e=r.reduce(function(i,s){return i[s.attributes.baseUrl]||(i[s.attributes.baseUrl]=[]),i[s.attributes.baseUrl].push(s),i},{});let t=[];return Object.values(e).forEach(i=>{const s=zc(i.reduce((n,a)=>{const u=a.attributes.id+(a.attributes.lang||"");return n[u]?(a.segments&&(a.segments[0]&&(a.segments[0].discontinuity=!0),n[u].segments.push(...a.segments)),a.attributes.contentProtection&&(n[u].attributes.contentProtection=a.attributes.contentProtection)):(n[u]=a,n[u].attributes.timelineStarts=[]),n[u].attributes.timelineStarts.push({start:a.attributes.periodStart,timeline:a.attributes.periodStart}),n},{}));t=t.concat(s)}),t.map(i=>(i.discontinuityStarts=yf(i.segments||[],"discontinuity"),i))},wo=(r,e)=>{const t=Pn(r.sidx),i=t&&e[t]&&e[t].sidx;return i&&Co(r,i,r.sidx.resolvedUri),r},Af=(r,e={})=>{if(!Object.keys(e).length)return r;for(const t in r)r[t]=wo(r[t],e);return r},xf=({attributes:r,segments:e,sidx:t,mediaSequence:i,discontinuitySequence:s,discontinuityStarts:n},a)=>{const u={attributes:{NAME:r.id,BANDWIDTH:r.bandwidth,CODECS:r.codecs,"PROGRAM-ID":1},uri:"",endList:r.type==="static",timeline:r.periodStart,resolvedUri:r.baseUrl||"",targetDuration:r.duration,discontinuitySequence:s,discontinuityStarts:n,timelineStarts:r.timelineStarts,mediaSequence:i,segments:e};return r.contentProtection&&(u.contentProtection=r.contentProtection),r.serviceLocation&&(u.attributes.serviceLocation=r.serviceLocation),t&&(u.sidx=t),a&&(u.attributes.AUDIO="audio",u.attributes.SUBTITLES="subs"),u},Df=({attributes:r,segments:e,mediaSequence:t,discontinuityStarts:i,discontinuitySequence:s})=>{typeof e>"u"&&(e=[{uri:r.baseUrl,timeline:r.periodStart,resolvedUri:r.baseUrl||"",duration:r.sourceDuration,number:0}],r.duration=r.sourceDuration);const n={NAME:r.id,BANDWIDTH:r.bandwidth,"PROGRAM-ID":1};r.codecs&&(n.CODECS=r.codecs);const a={attributes:n,uri:"",endList:r.type==="static",timeline:r.periodStart,resolvedUri:r.baseUrl||"",targetDuration:r.duration,timelineStarts:r.timelineStarts,discontinuityStarts:i,discontinuitySequence:s,mediaSequence:t,segments:e};return r.serviceLocation&&(a.attributes.serviceLocation=r.serviceLocation),a},If=(r,e={},t=!1)=>{let i;const s=r.reduce((n,a)=>{const u=a.attributes.role&&a.attributes.role.value||"",c=a.attributes.lang||"";let m=a.attributes.label||"main";if(c&&!a.attributes.label){const _=u?` (${u})`:"";m=`${a.attributes.lang}${_}`}n[m]||(n[m]={language:c,autoselect:!0,default:u==="main",playlists:[],uri:""});const f=wo(xf(a,t),e);return n[m].playlists.push(f),typeof i>"u"&&u==="main"&&(i=a,i.default=!0),n},{});if(!i){const n=Object.keys(s)[0];s[n].default=!0}return s},Pf=(r,e={})=>r.reduce((t,i)=>{const s=i.attributes.label||i.attributes.lang||"text",n=i.attributes.lang||"und";return t[s]||(t[s]={language:n,default:!1,autoselect:!1,playlists:[],uri:""}),t[s].playlists.push(wo(Df(i),e)),t},{}),Lf=r=>r.reduce((e,t)=>(t&&t.forEach(i=>{const{channel:s,language:n}=i;e[n]={autoselect:!1,default:!1,instreamId:s,language:n},i.hasOwnProperty("aspectRatio")&&(e[n].aspectRatio=i.aspectRatio),i.hasOwnProperty("easyReader")&&(e[n].easyReader=i.easyReader),i.hasOwnProperty("3D")&&(e[n]["3D"]=i["3D"])}),e),{}),Of=({attributes:r,segments:e,sidx:t,discontinuityStarts:i})=>{const s={attributes:{NAME:r.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:r.width,height:r.height},CODECS:r.codecs,BANDWIDTH:r.bandwidth,"PROGRAM-ID":1},uri:"",endList:r.type==="static",timeline:r.periodStart,resolvedUri:r.baseUrl||"",targetDuration:r.duration,discontinuityStarts:i,timelineStarts:r.timelineStarts,segments:e};return r.frameRate&&(s.attributes["FRAME-RATE"]=r.frameRate),r.contentProtection&&(s.contentProtection=r.contentProtection),r.serviceLocation&&(s.attributes.serviceLocation=r.serviceLocation),t&&(s.sidx=t),s},Nf=({attributes:r})=>r.mimeType==="video/mp4"||r.mimeType==="video/webm"||r.contentType==="video",Rf=({attributes:r})=>r.mimeType==="audio/mp4"||r.mimeType==="audio/webm"||r.contentType==="audio",Mf=({attributes:r})=>r.mimeType==="text/vtt"||r.contentType==="text",Bf=(r,e)=>{r.forEach(t=>{t.mediaSequence=0,t.discontinuitySequence=e.findIndex(function({timeline:i}){return i===t.timeline}),t.segments&&t.segments.forEach((i,s)=>{i.number=s})})},Dl=r=>r?Object.keys(r).reduce((e,t)=>{const i=r[t];return e.concat(i.playlists)},[]):[],Uf=({dashPlaylists:r,locations:e,contentSteering:t,sidxMapping:i={},previousManifest:s,eventStream:n})=>{if(!r.length)return{};const{sourceDuration:a,type:u,suggestedPresentationDelay:c,minimumUpdatePeriod:m}=r[0].attributes,f=Ca(r.filter(Nf)).map(Of),_=Ca(r.filter(Rf)),P=Ca(r.filter(Mf)),S=r.map(z=>z.attributes.captionServices).filter(Boolean),R={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:a,playlists:Af(f,i)};m>=0&&(R.minimumUpdatePeriod=m*1e3),e&&(R.locations=e),t&&(R.contentSteering=t),u==="dynamic"&&(R.suggestedPresentationDelay=c),n&&n.length>0&&(R.eventStream=n);const b=R.playlists.length===0,I=_.length?If(_,i,b):null,M=P.length?Pf(P,i):null,N=f.concat(Dl(I),Dl(M)),O=N.map(({timelineStarts:z})=>z);return R.timelineStarts=Xc(O),Bf(N,R.timelineStarts),I&&(R.mediaGroups.AUDIO.audio=I),M&&(R.mediaGroups.SUBTITLES.subs=M),S.length&&(R.mediaGroups["CLOSED-CAPTIONS"].cc=Lf(S)),s?kf({oldManifest:s,newManifest:R}):R},Ff=(r,e,t)=>{const{NOW:i,clientOffset:s,availabilityStartTime:n,timescale:a=1,periodStart:u=0,minimumUpdatePeriod:c=0}=r,m=(i+s)/1e3,f=n+u,_=m+c-f;return Math.ceil((_*a-e)/t)},Kc=(r,e)=>{const{type:t,minimumUpdatePeriod:i=0,media:s="",sourceDuration:n,timescale:a=1,startNumber:u=1,periodStart:c}=r,m=[];let f=-1;for(let _=0;_<e.length;_++){const P=e[_],S=P.d,R=P.r||0,b=P.t||0;f<0&&(f=b),b&&b>f&&(f=b);let I;if(R<0){const O=_+1;O===e.length?t==="dynamic"&&i>0&&s.indexOf("$Number$")>0?I=Ff(r,f,S):I=(n*a-f)/S:I=(e[O].t-f)/S}else I=R+1;const M=u+m.length+I;let N=u+m.length;for(;N<M;)m.push({number:N,duration:S/a,time:f,timeline:c}),f+=S,N++}return m},jf=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,qf=r=>(e,t,i,s)=>{if(e==="$$")return"$";if(typeof r[t]>"u")return e;const n=""+r[t];return t==="RepresentationID"||(i?s=parseInt(s,10):s=1,n.length>=s)?n:`${new Array(s-n.length+1).join("0")}${n}`},Il=(r,e)=>r.replace(jf,qf(e)),$f=(r,e)=>!r.duration&&!e?[{number:r.startNumber||1,duration:r.sourceDuration,time:0,timeline:r.periodStart}]:r.duration?Eo(r):Kc(r,e),Hf=(r,e)=>{const t={RepresentationID:r.id,Bandwidth:r.bandwidth||0},{initialization:i={sourceURL:"",range:""}}=r,s=us({baseUrl:r.baseUrl,source:Il(i.sourceURL,t),range:i.range});return $f(r,e).map(n=>{t.Number=n.number,t.Time=n.time;const a=Il(r.media||"",t),u=r.timescale||1,c=r.presentationTimeOffset||0,m=r.periodStart+(n.time-c)/u;return{uri:a,timeline:n.timeline,duration:n.duration,resolvedUri:Dn(r.baseUrl||"",a),map:s,number:n.number,presentationTime:m}})},Vf=(r,e)=>{const{baseUrl:t,initialization:i={}}=r,s=us({baseUrl:t,source:i.sourceURL,range:i.range}),n=us({baseUrl:t,source:e.media,range:e.mediaRange});return n.map=s,n},zf=(r,e)=>{const{duration:t,segmentUrls:i=[],periodStart:s}=r;if(!t&&!e||t&&e)throw new Error(gr.SEGMENT_TIME_UNSPECIFIED);const n=i.map(u=>Vf(r,u));let a;return t&&(a=Eo(r)),e&&(a=Kc(r,e)),a.map((u,c)=>{if(n[c]){const m=n[c],f=r.timescale||1,_=r.presentationTimeOffset||0;return m.timeline=u.timeline,m.duration=u.duration,m.number=u.number,m.presentationTime=s+(u.time-_)/f,m}}).filter(u=>u)},Wf=({attributes:r,segmentInfo:e})=>{let t,i;e.template?(i=Hf,t=Xe(r,e.template)):e.base?(i=Gc,t=Xe(r,e.base)):e.list&&(i=zf,t=Xe(r,e.list));const s={attributes:r};if(!i)return s;const n=i(t,e.segmentTimeline);if(t.duration){const{duration:a,timescale:u=1}=t;t.duration=a/u}else n.length?t.duration=n.reduce((a,u)=>Math.max(a,Math.ceil(u.duration)),0):t.duration=0;return s.attributes=t,s.segments=n,e.base&&t.indexRange&&(s.sidx=n[0],s.segments=[]),s},Gf=r=>r.map(Wf),Re=(r,e)=>Wc(r.childNodes).filter(({tagName:t})=>t===e),ms=r=>r.textContent.trim(),Xf=r=>parseFloat(r.split("/").reduce((e,t)=>e/t)),Ji=r=>{const e=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(r);if(!e)return 0;const[t,i,s,n,a,u]=e.slice(1);return parseFloat(t||0)*31536e3+parseFloat(i||0)*2592e3+parseFloat(s||0)*86400+parseFloat(n||0)*3600+parseFloat(a||0)*60+parseFloat(u||0)},Kf=r=>(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(r)&&(r+="Z"),Date.parse(r)),Pl={mediaPresentationDuration(r){return Ji(r)},availabilityStartTime(r){return Kf(r)/1e3},minimumUpdatePeriod(r){return Ji(r)},suggestedPresentationDelay(r){return Ji(r)},type(r){return r},timeShiftBufferDepth(r){return Ji(r)},start(r){return Ji(r)},width(r){return parseInt(r,10)},height(r){return parseInt(r,10)},bandwidth(r){return parseInt(r,10)},frameRate(r){return Xf(r)},startNumber(r){return parseInt(r,10)},timescale(r){return parseInt(r,10)},presentationTimeOffset(r){return parseInt(r,10)},duration(r){const e=parseInt(r,10);return isNaN(e)?Ji(r):e},d(r){return parseInt(r,10)},t(r){return parseInt(r,10)},r(r){return parseInt(r,10)},presentationTime(r){return parseInt(r,10)},DEFAULT(r){return r}},He=r=>r&&r.attributes?Wc(r.attributes).reduce((e,t)=>{const i=Pl[t.name]||Pl.DEFAULT;return e[t.name]=i(t.value),e},{}):{},Yf={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime","urn:mpeg:dash:mp4protection:2011":"mp4protection"},Ln=(r,e)=>e.length?mr(r.map(function(t){return e.map(function(i){const s=ms(i),n=Dn(t.baseUrl,s),a=Xe(He(i),{baseUrl:n});return n!==s&&!a.serviceLocation&&t.serviceLocation&&(a.serviceLocation=t.serviceLocation),a})})):r,ko=r=>{const e=Re(r,"SegmentTemplate")[0],t=Re(r,"SegmentList")[0],i=t&&Re(t,"SegmentURL").map(_=>Xe({tag:"SegmentURL"},He(_))),s=Re(r,"SegmentBase")[0],n=t||e,a=n&&Re(n,"SegmentTimeline")[0],u=t||s||e,c=u&&Re(u,"Initialization")[0],m=e&&He(e);m&&c?m.initialization=c&&He(c):m&&m.initialization&&(m.initialization={sourceURL:m.initialization});const f={template:m,segmentTimeline:a&&Re(a,"S").map(_=>He(_)),list:t&&Xe(He(t),{segmentUrls:i,initialization:He(c)}),base:s&&Xe(He(s),{initialization:He(c)})};return Object.keys(f).forEach(_=>{f[_]||delete f[_]}),f},Qf=(r,e,t)=>i=>{const s=Re(i,"BaseURL"),n=Ln(e,s),a=Xe(r,He(i)),u=ko(i);return n.map(c=>({segmentInfo:Xe(t,u),attributes:Xe(a,c)}))},Jf=r=>r.reduce((e,t)=>{const i=He(t);i.schemeIdUri&&(i.schemeIdUri=i.schemeIdUri.toLowerCase());const s=Yf[i.schemeIdUri];if(s){e[s]={attributes:i};const n=Re(t,"cenc:pssh")[0];if(n){const a=ms(n);e[s].pssh=a&&Uc(a)}}return e},{}),Zf=r=>{if(r.schemeIdUri==="urn:scte:dash:cc:cea-608:2015")return(typeof r.value!="string"?[]:r.value.split(";")).map(e=>{let t,i;return i=e,/^CC\d=/.test(e)?[t,i]=e.split("="):/^CC\d$/.test(e)&&(t=e),{channel:t,language:i}});if(r.schemeIdUri==="urn:scte:dash:cc:cea-708:2015")return(typeof r.value!="string"?[]:r.value.split(";")).map(e=>{const t={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){const[i,s=""]=e.split("=");t.channel=i,t.language=e,s.split(",").forEach(n=>{const[a,u]=n.split(":");a==="lang"?t.language=u:a==="er"?t.easyReader=Number(u):a==="war"?t.aspectRatio=Number(u):a==="3D"&&(t["3D"]=Number(u))})}else t.language=e;return t.channel&&(t.channel="SERVICE"+t.channel),t})},ey=r=>mr(Re(r.node,"EventStream").map(e=>{const t=He(e),i=t.schemeIdUri;return Re(e,"Event").map(s=>{const n=He(s),a=n.presentationTime||0,u=t.timescale||1,c=n.duration||0,m=a/u+r.attributes.start;return{schemeIdUri:i,value:t.value,id:n.id,start:m,end:m+c/u,messageData:ms(s)||n.messageData,contentEncoding:t.contentEncoding,presentationTimeOffset:t.presentationTimeOffset||0}})})),ty=(r,e,t)=>i=>{const s=He(i),n=Ln(e,Re(i,"BaseURL")),a=Re(i,"Role")[0],u={role:He(a)};let c=Xe(r,s,u);const m=Re(i,"Accessibility")[0],f=Zf(He(m));f&&(c=Xe(c,{captionServices:f}));const _=Re(i,"Label")[0];if(_&&_.childNodes.length){const I=_.childNodes[0].nodeValue.trim();c=Xe(c,{label:I})}const P=Jf(Re(i,"ContentProtection"));Object.keys(P).length&&(c=Xe(c,{contentProtection:P}));const S=ko(i),R=Re(i,"Representation"),b=Xe(t,S);return mr(R.map(Qf(c,n,b)))},iy=(r,e)=>(t,i)=>{const s=Ln(e,Re(t.node,"BaseURL")),n=Xe(r,{periodStart:t.attributes.start});typeof t.attributes.duration=="number"&&(n.periodDuration=t.attributes.duration);const a=Re(t.node,"AdaptationSet"),u=ko(t.node);return mr(a.map(ty(n,s,u)))},ry=(r,e)=>{if(r.length>1&&e({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),!r.length)return null;const t=Xe({serverURL:ms(r[0])},He(r[0]));return t.queryBeforeStart=t.queryBeforeStart==="true",t},sy=({attributes:r,priorPeriodAttributes:e,mpdType:t})=>typeof r.start=="number"?r.start:e&&typeof e.start=="number"&&typeof e.duration=="number"?e.start+e.duration:!e&&t==="static"?0:null,ny=(r,e={})=>{const{manifestUri:t="",NOW:i=Date.now(),clientOffset:s=0,eventHandler:n=function(){}}=e,a=Re(r,"Period");if(!a.length)throw new Error(gr.INVALID_NUMBER_OF_PERIOD);const u=Re(r,"Location"),c=He(r),m=Ln([{baseUrl:t}],Re(r,"BaseURL")),f=Re(r,"ContentSteering");c.type=c.type||"static",c.sourceDuration=c.mediaPresentationDuration||0,c.NOW=i,c.clientOffset=s,u.length&&(c.locations=u.map(ms));const _=[];return a.forEach((P,S)=>{const R=He(P),b=_[S-1];R.start=sy({attributes:R,priorPeriodAttributes:b?b.attributes:null,mpdType:c.type}),_.push({node:P,attributes:R})}),{locations:c.locations,contentSteeringInfo:ry(f,n),representationInfo:mr(_.map(iy(c,m))),eventStream:mr(_.map(ey))}},Yc=r=>{if(r==="")throw new Error(gr.DASH_EMPTY_MANIFEST);const e=new gf.DOMParser;let t,i;try{t=e.parseFromString(r,"application/xml"),i=t&&t.documentElement.tagName==="MPD"?t.documentElement:null}catch{}if(!i||i&&i.getElementsByTagName("parsererror").length>0)throw new Error(gr.DASH_INVALID_XML);return i},ay=r=>{const e=Re(r,"UTCTiming")[0];if(!e)return null;const t=He(e);switch(t.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":t.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":t.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":t.method="DIRECT",t.value=Date.parse(t.value);break;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error(gr.UNSUPPORTED_UTC_TIMING_SCHEME)}return t},oy=(r,e={})=>{const t=ny(Yc(r),e),i=Gf(t.representationInfo);return Uf({dashPlaylists:i,locations:t.locations,contentSteering:t.contentSteeringInfo,sidxMapping:e.sidxMapping,previousManifest:e.previousManifest,eventStream:t.eventStream})},uy=r=>ay(Yc(r));var wa,Ll;function ly(){if(Ll)return wa;Ll=1;var r=Math.pow(2,32),e=function(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),s;return i.getBigUint64?(s=i.getBigUint64(0),s<Number.MAX_SAFE_INTEGER?Number(s):s):i.getUint32(0)*r+i.getUint32(4)};return wa={getUint64:e,MAX_UINT32:r},wa}var ka,Ol;function cy(){if(Ol)return ka;Ol=1;var r=ly().getUint64,e=function(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),s={version:t[0],flags:new Uint8Array(t.subarray(1,4)),references:[],referenceId:i.getUint32(4),timescale:i.getUint32(8)},n=12;s.version===0?(s.earliestPresentationTime=i.getUint32(n),s.firstOffset=i.getUint32(n+4),n+=8):(s.earliestPresentationTime=r(t.subarray(n)),s.firstOffset=r(t.subarray(n+8)),n+=16),n+=2;var a=i.getUint16(n);for(n+=2;a>0;n+=12,a--)s.references.push({referenceType:(t[n]&128)>>>7,referencedSize:i.getUint32(n)&2147483647,subsegmentDuration:i.getUint32(n+4),startsWithSap:!!(t[n+8]&128),sapType:(t[n+8]&112)>>>4,sapDeltaTime:i.getUint32(n+8)&268435455});return s};return ka=e,ka}var hy=cy();const dy=ps(hy);var py=ce([73,68,51]),my=function(r,e){e===void 0&&(e=0),r=ce(r);var t=r[e+5],i=r[e+6]<<21|r[e+7]<<14|r[e+8]<<7|r[e+9],s=(t&16)>>4;return s?i+20:i+10},Zr=function r(e,t){return t===void 0&&(t=0),e=ce(e),e.length-t<10||!Ne(e,py,{offset:t})?t:(t+=my(e,t),r(e,t))},Nl=function(r){return typeof r=="string"?Hc(r):r},gy=function(r){return Array.isArray(r)?r.map(function(e){return Nl(e)}):[Nl(r)]},fy=function r(e,t,i){i===void 0&&(i=!1),t=gy(t),e=ce(e);var s=[];if(!t.length)return s;for(var n=0;n<e.length;){var a=(e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3])>>>0,u=e.subarray(n+4,n+8);if(a===0)break;var c=n+a;if(c>e.length){if(i)break;c=e.length}var m=e.subarray(n+8,c);Ne(u,t[0])&&(t.length===1?s.push(m):s.push.apply(s,r(m,t.slice(1),i))),n=c}return s},Js={EBML:ce([26,69,223,163]),DocType:ce([66,130]),Segment:ce([24,83,128,103]),SegmentInfo:ce([21,73,169,102]),Tracks:ce([22,84,174,107]),Track:ce([174]),TrackNumber:ce([215]),DefaultDuration:ce([35,227,131]),TrackEntry:ce([174]),TrackType:ce([131]),FlagDefault:ce([136]),CodecID:ce([134]),CodecPrivate:ce([99,162]),VideoTrack:ce([224]),AudioTrack:ce([225]),Cluster:ce([31,67,182,117]),Timestamp:ce([231]),TimestampScale:ce([42,215,177]),BlockGroup:ce([160]),BlockDuration:ce([155]),Block:ce([161]),SimpleBlock:ce([163])},Xa=[128,64,32,16,8,4,2,1],yy=function(r){for(var e=1,t=0;t<Xa.length&&!(r&Xa[t]);t++)e++;return e},un=function(r,e,t,i){t===void 0&&(t=!0),i===void 0&&(i=!1);var s=yy(r[e]),n=r.subarray(e,e+s);return t&&(n=Array.prototype.slice.call(r,e,e+s),n[0]^=Xa[s-1]),{length:s,value:of(n,{signed:i}),bytes:n}},Rl=function r(e){return typeof e=="string"?e.match(/.{1,2}/g).map(function(t){return r(t)}):typeof e=="number"?uf(e):e},_y=function(r){return Array.isArray(r)?r.map(function(e){return Rl(e)}):[Rl(r)]},by=function r(e,t,i){if(i>=t.length)return t.length;var s=un(t,i,!1);if(Ne(e.bytes,s.bytes))return i;var n=un(t,i+s.length);return r(e,t,i+n.length+n.value+s.length)},Ml=function r(e,t){t=_y(t),e=ce(e);var i=[];if(!t.length)return i;for(var s=0;s<e.length;){var n=un(e,s,!1),a=un(e,s+n.length),u=s+n.length+a.length;a.value===127&&(a.value=by(n,e,u),a.value!==e.length&&(a.value-=u));var c=u+a.value>e.length?e.length:u+a.value,m=e.subarray(u,c);Ne(t[0],n.bytes)&&(t.length===1?i.push(m):i=i.concat(r(m,t.slice(1))));var f=n.length+a.length+m.length;s+=f}return i},vy=ce([0,0,0,1]),Ty=ce([0,0,1]),Sy=ce([0,0,3]),Ey=function(r){for(var e=[],t=1;t<r.length-2;)Ne(r.subarray(t,t+3),Sy)&&(e.push(t+2),t++),t++;if(e.length===0)return r;var i=r.length-e.length,s=new Uint8Array(i),n=0;for(t=0;t<i;n++,t++)n===e[0]&&(n++,e.shift()),s[t]=r[n];return s},Qc=function(r,e,t,i){r=ce(r),t=[].concat(t);for(var s=0,n,a=0;s<r.length&&(a<i||n);){var u=void 0;if(Ne(r.subarray(s),vy)?u=4:Ne(r.subarray(s),Ty)&&(u=3),!u){s++;continue}if(a++,n)return Ey(r.subarray(n,s));var c=void 0;e==="h264"?c=r[s+u]&31:e==="h265"&&(c=r[s+u]>>1&63),t.indexOf(c)!==-1&&(n=s+u),s+=u+(e==="h264"?1:2)}return r.subarray(0,0)},Cy=function(r,e,t){return Qc(r,"h264",e,t)},wy=function(r,e,t){return Qc(r,"h265",e,t)},lt={webm:ce([119,101,98,109]),matroska:ce([109,97,116,114,111,115,107,97]),flac:ce([102,76,97,67]),ogg:ce([79,103,103,83]),ac3:ce([11,119]),riff:ce([82,73,70,70]),avi:ce([65,86,73]),wav:ce([87,65,86,69]),"3gp":ce([102,116,121,112,51,103]),mp4:ce([102,116,121,112]),fmp4:ce([115,116,121,112]),mov:ce([102,116,121,112,113,116]),moov:ce([109,111,111,118]),moof:ce([109,111,111,102])},fr={aac:function(r){var e=Zr(r);return Ne(r,[255,16],{offset:e,mask:[255,22]})},mp3:function(r){var e=Zr(r);return Ne(r,[255,2],{offset:e,mask:[255,6]})},webm:function(r){var e=Ml(r,[Js.EBML,Js.DocType])[0];return Ne(e,lt.webm)},mkv:function(r){var e=Ml(r,[Js.EBML,Js.DocType])[0];return Ne(e,lt.matroska)},mp4:function(r){if(fr["3gp"](r)||fr.mov(r))return!1;if(Ne(r,lt.mp4,{offset:4})||Ne(r,lt.fmp4,{offset:4})||Ne(r,lt.moof,{offset:4})||Ne(r,lt.moov,{offset:4}))return!0},mov:function(r){return Ne(r,lt.mov,{offset:4})},"3gp":function(r){return Ne(r,lt["3gp"],{offset:4})},ac3:function(r){var e=Zr(r);return Ne(r,lt.ac3,{offset:e})},ts:function(r){if(r.length<189&&r.length>=1)return r[0]===71;for(var e=0;e+188<r.length&&e<188;){if(r[e]===71&&r[e+188]===71)return!0;e+=1}return!1},flac:function(r){var e=Zr(r);return Ne(r,lt.flac,{offset:e})},ogg:function(r){return Ne(r,lt.ogg)},avi:function(r){return Ne(r,lt.riff)&&Ne(r,lt.avi,{offset:8})},wav:function(r){return Ne(r,lt.riff)&&Ne(r,lt.wav,{offset:8})},h264:function(r){return Cy(r,7,3).length},h265:function(r){return wy(r,[32,33],3).length}},Ka=Object.keys(fr).filter(function(r){return r!=="ts"&&r!=="h264"&&r!=="h265"}).concat(["ts","h264","h265"]);Ka.forEach(function(r){var e=fr[r];fr[r]=function(t){return e(ce(t))}});var ky=fr,Ao=function(r){r=ce(r);for(var e=0;e<Ka.length;e++){var t=Ka[e];if(ky[t](r))return t}return""},Ay=function(r){return fy(r,["moof"]).length>0},Aa,Bl;function xy(){if(Bl)return Aa;Bl=1;var r=9e4,e,t,i,s,n,a,u;return e=function(c){return c*r},t=function(c,m){return c*m},i=function(c){return c/r},s=function(c,m){return c/m},n=function(c,m){return e(s(c,m))},a=function(c,m){return t(i(c),m)},u=function(c,m,f){return i(f?c:c-m)},Aa={ONE_SECOND_IN_TS:r,secondsToVideoTs:e,secondsToAudioTs:t,videoTsToSeconds:i,audioTsToSeconds:s,audioTsToVideoTs:n,videoTsToAudioTs:a,metadataTsToSeconds:u},Aa}var Ui=xy();/**
32
+ * @license
33
+ * Video.js 8.23.4 <http://videojs.com/>
34
+ * Copyright Brightcove, Inc. <https://www.brightcove.com/>
35
+ * Available under Apache License Version 2.0
36
+ * <https://github.com/videojs/video.js/blob/main/LICENSE>
37
+ *
38
+ * Includes vtt.js <https://github.com/mozilla/vtt.js>
39
+ * Available under Apache License Version 2.0
40
+ * <https://github.com/mozilla/vtt.js/blob/main/LICENSE>
41
+ */var Ya="8.23.4";const ii={},Si=function(r,e){return ii[r]=ii[r]||[],e&&(ii[r]=ii[r].concat(e)),ii[r]},Dy=function(r,e){Si(r,e)},Jc=function(r,e){const t=Si(r).indexOf(e);return t<=-1?!1:(ii[r]=ii[r].slice(),ii[r].splice(t,1),!0)},Iy=function(r,e){Si(r,[].concat(e).map(t=>{const i=(...s)=>(Jc(r,i),t(...s));return i}))},ln={prefixed:!0},sn=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],Ul=sn[0];let es;for(let r=0;r<sn.length;r++)if(sn[r][1]in re){es=sn[r];break}if(es){for(let r=0;r<es.length;r++)ln[Ul[r]]=es[r];ln.prefixed=es[0]!==Ul[0]}let dt=[];const Py=(r,e,t)=>(i,s,n)=>{const a=e.levels[s],u=new RegExp(`^(${a})$`);let c=r;if(i!=="log"&&n.unshift(i.toUpperCase()+":"),t&&(c=`%c${r}`,n.unshift(t)),n.unshift(c+":"),dt){dt.push([].concat(n));const f=dt.length-1e3;dt.splice(0,f>0?f:0)}if(!A.console)return;let m=A.console[i];!m&&i==="debug"&&(m=A.console.info||A.console.log),!(!m||!a||!u.test(i))&&m[Array.isArray(n)?"apply":"call"](A.console,n)};function Qa(r,e=":",t=""){let i="info",s;function n(...a){s("log",i,a)}return s=Py(r,n,t),n.createLogger=(a,u,c)=>{const m=u!==void 0?u:e,f=c!==void 0?c:t,_=`${r} ${m} ${a}`;return Qa(_,m,f)},n.createNewLogger=(a,u,c)=>Qa(a,u,c),n.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:i},n.level=a=>{if(typeof a=="string"){if(!n.levels.hasOwnProperty(a))throw new Error(`"${a}" in not a valid log level`);i=a}return i},n.history=()=>dt?[].concat(dt):[],n.history.filter=a=>(dt||[]).filter(u=>new RegExp(`.*${a}.*`).test(u[0])),n.history.clear=()=>{dt&&(dt.length=0)},n.history.disable=()=>{dt!==null&&(dt.length=0,dt=null)},n.history.enable=()=>{dt===null&&(dt=[])},n.error=(...a)=>s("error",i,a),n.warn=(...a)=>s("warn",i,a),n.debug=(...a)=>s("debug",i,a),n}const be=Qa("VIDEOJS"),Zc=be.createLogger,Ly=Object.prototype.toString,eh=function(r){return Kt(r)?Object.keys(r):[]};function sr(r,e){eh(r).forEach(t=>e(r[t],t))}function th(r,e,t=0){return eh(r).reduce((i,s)=>e(i,r[s],s),t)}function Kt(r){return!!r&&typeof r=="object"}function yr(r){return Kt(r)&&Ly.call(r)==="[object Object]"&&r.constructor===Object}function Ae(...r){const e={};return r.forEach(t=>{t&&sr(t,(i,s)=>{if(!yr(i)){e[s]=i;return}yr(e[s])||(e[s]={}),e[s]=Ae(e[s],i)})}),e}function ih(r={}){const e=[];for(const t in r)if(r.hasOwnProperty(t)){const i=r[t];e.push(i)}return e}function On(r,e,t,i=!0){const s=a=>Object.defineProperty(r,e,{value:a,enumerable:!0,writable:!0}),n={configurable:!0,enumerable:!0,get(){const a=t();return s(a),a}};return i&&(n.set=s),Object.defineProperty(r,e,n)}var Oy=Object.freeze({__proto__:null,each:sr,reduce:th,isObject:Kt,isPlain:yr,merge:Ae,values:ih,defineLazyProperty:On});let xo=!1,rh=null,Bt=!1,sh,nh=!1,nr=!1,ar=!1,Yt=!1,Do=null,Nn=null;const Ny=!!(A.cast&&A.cast.framework&&A.cast.framework.CastReceiverContext);let ah=null,cn=!1,Rn=!1,hn=!1,Mn=!1,dn=!1,pn=!1,mn=!1;const ls=!!(Sr()&&("ontouchstart"in A||A.navigator.maxTouchPoints||A.DocumentTouch&&A.document instanceof A.DocumentTouch)),fi=A.navigator&&A.navigator.userAgentData;fi&&fi.platform&&fi.brands&&(Bt=fi.platform==="Android",nr=!!fi.brands.find(r=>r.brand==="Microsoft Edge"),ar=!!fi.brands.find(r=>r.brand==="Chromium"),Yt=!nr&&ar,Do=Nn=(fi.brands.find(r=>r.brand==="Chromium")||{}).version||null,Rn=fi.platform==="Windows");if(!ar){const r=A.navigator&&A.navigator.userAgent||"";xo=/iPod/i.test(r),rh=(function(){const e=r.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null})(),Bt=/Android/i.test(r),sh=(function(){const e=r.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;const t=e[1]&&parseFloat(e[1]),i=e[2]&&parseFloat(e[2]);return t&&i?parseFloat(e[1]+"."+e[2]):t||null})(),nh=/Firefox/i.test(r),nr=/Edg/i.test(r),ar=/Chrome/i.test(r)||/CriOS/i.test(r),Yt=!nr&&ar,Do=Nn=(function(){const e=r.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null})(),ah=(function(){const e=/MSIE\s(\d+)\.\d/.exec(r);let t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(r)&&/rv:11.0/.test(r)&&(t=11),t})(),dn=/Tizen/i.test(r),pn=/Web0S/i.test(r),mn=dn||pn,cn=/Safari/i.test(r)&&!Yt&&!Bt&&!nr&&!mn,Rn=/Windows/i.test(r),hn=/iPad/i.test(r)||cn&&ls&&!/iPhone/i.test(r),Mn=/iPhone/i.test(r)&&!hn}const et=Mn||hn||xo,Bn=(cn||et)&&!Yt;var oh=Object.freeze({__proto__:null,get IS_IPOD(){return xo},get IOS_VERSION(){return rh},get IS_ANDROID(){return Bt},get ANDROID_VERSION(){return sh},get IS_FIREFOX(){return nh},get IS_EDGE(){return nr},get IS_CHROMIUM(){return ar},get IS_CHROME(){return Yt},get CHROMIUM_VERSION(){return Do},get CHROME_VERSION(){return Nn},IS_CHROMECAST_RECEIVER:Ny,get IE_VERSION(){return ah},get IS_SAFARI(){return cn},get IS_WINDOWS(){return Rn},get IS_IPAD(){return hn},get IS_IPHONE(){return Mn},get IS_TIZEN(){return dn},get IS_WEBOS(){return pn},get IS_SMART_TV(){return mn},TOUCH_ENABLED:ls,IS_IOS:et,IS_ANY_SAFARI:Bn});function Fl(r){return typeof r=="string"&&!!r.trim()}function Ry(r){if(r.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function Sr(){return re===A.document}function Er(r){return Kt(r)&&r.nodeType===1}function uh(){try{return A.parent!==A.self}catch{return!0}}function lh(r){return function(e,t){if(!Fl(e))return re[r](null);Fl(t)&&(t=re.querySelector(t));const i=Er(t)?t:re;return i[r]&&i[r](e)}}function he(r="div",e={},t={},i){const s=re.createElement(r);return Object.getOwnPropertyNames(e).forEach(function(n){const a=e[n];n==="textContent"?Ci(s,a):(s[n]!==a||n==="tabIndex")&&(s[n]=a)}),Object.getOwnPropertyNames(t).forEach(function(n){s.setAttribute(n,t[n])}),i&&Io(s,i),s}function Ci(r,e){return typeof r.textContent>"u"?r.innerText=e:r.textContent=e,r}function Ja(r,e){e.firstChild?e.insertBefore(r,e.firstChild):e.appendChild(r)}function rs(r,e){return Ry(e),r.classList.contains(e)}function qi(r,...e){return r.classList.add(...e.reduce((t,i)=>t.concat(i.split(/\s+/)),[])),r}function Un(r,...e){return r?(r.classList.remove(...e.reduce((t,i)=>t.concat(i.split(/\s+/)),[])),r):(be.warn("removeClass was called with an element that doesn't exist"),null)}function ch(r,e,t){return typeof t=="function"&&(t=t(r,e)),typeof t!="boolean"&&(t=void 0),e.split(/\s+/).forEach(i=>r.classList.toggle(i,t)),r}function hh(r,e){Object.getOwnPropertyNames(e).forEach(function(t){const i=e[t];i===null||typeof i>"u"||i===!1?r.removeAttribute(t):r.setAttribute(t,i===!0?"":i)})}function bi(r){const e={},t=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(r&&r.attributes&&r.attributes.length>0){const i=r.attributes;for(let s=i.length-1;s>=0;s--){const n=i[s].name;let a=i[s].value;t.includes(n)&&(a=a!==null),e[n]=a}}return e}function dh(r,e){return r.getAttribute(e)}function _r(r,e,t){r.setAttribute(e,t)}function Fn(r,e){r.removeAttribute(e)}function ph(){re.body.focus(),re.onselectstart=function(){return!1}}function mh(){re.onselectstart=function(){return!0}}function br(r){if(r&&r.getBoundingClientRect&&r.parentNode){const e=r.getBoundingClientRect(),t={};return["bottom","height","left","right","top","width"].forEach(i=>{e[i]!==void 0&&(t[i]=e[i])}),t.height||(t.height=parseFloat(vr(r,"height"))),t.width||(t.width=parseFloat(vr(r,"width"))),t}}function cs(r){if(!r||r&&!r.offsetParent)return{left:0,top:0,width:0,height:0};const e=r.offsetWidth,t=r.offsetHeight;let i=0,s=0;for(;r.offsetParent&&r!==re[ln.fullscreenElement];)i+=r.offsetLeft,s+=r.offsetTop,r=r.offsetParent;return{left:i,top:s,width:e,height:t}}function jn(r,e){const t={x:0,y:0};if(et){let f=r;for(;f&&f.nodeName.toLowerCase()!=="html";){const _=vr(f,"transform");if(/^matrix/.test(_)){const P=_.slice(7,-1).split(/,\s/).map(Number);t.x+=P[4],t.y+=P[5]}else if(/^matrix3d/.test(_)){const P=_.slice(9,-1).split(/,\s/).map(Number);t.x+=P[12],t.y+=P[13]}if(f.assignedSlot&&f.assignedSlot.parentElement&&A.WebKitCSSMatrix){const P=A.getComputedStyle(f.assignedSlot.parentElement).transform,S=new A.WebKitCSSMatrix(P);t.x+=S.m41,t.y+=S.m42}f=f.parentNode||f.host}}const i={},s=cs(e.target),n=cs(r),a=n.width,u=n.height;let c=e.offsetY-(n.top-s.top),m=e.offsetX-(n.left-s.left);return e.changedTouches&&(m=e.changedTouches[0].pageX-n.left,c=e.changedTouches[0].pageY+n.top,et&&(m-=t.x,c-=t.y)),i.y=1-Math.max(0,Math.min(1,c/u)),i.x=Math.max(0,Math.min(1,m/a)),i}function gh(r){return Kt(r)&&r.nodeType===3}function qn(r){for(;r.firstChild;)r.removeChild(r.firstChild);return r}function fh(r){return typeof r=="function"&&(r=r()),(Array.isArray(r)?r:[r]).map(e=>{if(typeof e=="function"&&(e=e()),Er(e)||gh(e))return e;if(typeof e=="string"&&/\S/.test(e))return re.createTextNode(e)}).filter(e=>e)}function Io(r,e){return fh(e).forEach(t=>r.appendChild(t)),r}function yh(r,e){return Io(qn(r),e)}function hs(r){return r.button===void 0&&r.buttons===void 0||r.button===0&&r.buttons===void 0||r.type==="mouseup"&&r.button===0&&r.buttons===0||r.type==="mousedown"&&r.button===0&&r.buttons===0?!0:!(r.button!==0||r.buttons!==1)}const Ei=lh("querySelector"),_h=lh("querySelectorAll");function vr(r,e){if(!r||!e)return"";if(typeof A.getComputedStyle=="function"){let t;try{t=A.getComputedStyle(r)}catch{return""}return t?t.getPropertyValue(e)||t[e]:""}return""}function bh(r){[...re.styleSheets].forEach(e=>{try{const t=[...e.cssRules].map(s=>s.cssText).join(""),i=re.createElement("style");i.textContent=t,r.document.head.appendChild(i)}catch{const t=re.createElement("link");t.rel="stylesheet",t.type=e.type,t.media=e.media.mediaText,t.href=e.href,r.document.head.appendChild(t)}})}var vh=Object.freeze({__proto__:null,isReal:Sr,isEl:Er,isInFrame:uh,createEl:he,textContent:Ci,prependTo:Ja,hasClass:rs,addClass:qi,removeClass:Un,toggleClass:ch,setAttributes:hh,getAttributes:bi,getAttribute:dh,setAttribute:_r,removeAttribute:Fn,blockTextSelection:ph,unblockTextSelection:mh,getBoundingClientRect:br,findPosition:cs,getPointerPosition:jn,isTextNode:gh,emptyEl:qn,normalizeContent:fh,appendContent:Io,insertContent:yh,isSingleLeftClick:hs,$:Ei,$$:_h,computedStyle:vr,copyStyleSheetsToWindow:bh});let Th=!1,Za;const My=function(){if(Za.options.autoSetup===!1)return;const r=Array.prototype.slice.call(re.getElementsByTagName("video")),e=Array.prototype.slice.call(re.getElementsByTagName("audio")),t=Array.prototype.slice.call(re.getElementsByTagName("video-js")),i=r.concat(e,t);if(i&&i.length>0)for(let s=0,n=i.length;s<n;s++){const a=i[s];if(a&&a.getAttribute)a.player===void 0&&a.getAttribute("data-setup")!==null&&Za(a);else{eo(1);break}}else Th||eo(1)};function eo(r,e){Sr()&&(e&&(Za=e),A.setTimeout(My,r))}function to(){Th=!0,A.removeEventListener("load",to)}Sr()&&(re.readyState==="complete"?to():A.addEventListener("load",to));const Sh=function(r){const e=re.createElement("style");return e.className=r,e},Eh=function(r,e){r.styleSheet?r.styleSheet.cssText=e:r.textContent=e};var ht=new WeakMap;const By=3;let Uy=By;function Dt(){return Uy++}function jl(r,e){if(!ht.has(r))return;const t=ht.get(r);t.handlers[e].length===0&&(delete t.handlers[e],r.removeEventListener?r.removeEventListener(e,t.dispatcher,!1):r.detachEvent&&r.detachEvent("on"+e,t.dispatcher)),Object.getOwnPropertyNames(t.handlers).length<=0&&(delete t.handlers,delete t.dispatcher,delete t.disabled),Object.getOwnPropertyNames(t).length===0&&ht.delete(r)}function Po(r,e,t,i){t.forEach(function(s){r(e,s,i)})}function $n(r){if(r.fixed_)return r;function e(){return!0}function t(){return!1}if(!r||!r.isPropagationStopped||!r.isImmediatePropagationStopped){const i=r||A.event;r={};const s=["layerX","layerY","keyLocation","path","webkitMovementX","webkitMovementY","mozPressure","mozInputSource"];for(const n in i)s.includes(n)||n==="returnValue"&&i.preventDefault||(r[n]=i[n]);if(r.target||(r.target=r.srcElement||re),r.relatedTarget||(r.relatedTarget=r.fromElement===r.target?r.toElement:r.fromElement),r.preventDefault=function(){i.preventDefault&&i.preventDefault(),r.returnValue=!1,i.returnValue=!1,r.defaultPrevented=!0},r.defaultPrevented=!1,r.stopPropagation=function(){i.stopPropagation&&i.stopPropagation(),r.cancelBubble=!0,i.cancelBubble=!0,r.isPropagationStopped=e},r.isPropagationStopped=t,r.stopImmediatePropagation=function(){i.stopImmediatePropagation&&i.stopImmediatePropagation(),r.isImmediatePropagationStopped=e,r.stopPropagation()},r.isImmediatePropagationStopped=t,r.clientX!==null&&r.clientX!==void 0){const n=re.documentElement,a=re.body;r.pageX=r.clientX+(n&&n.scrollLeft||a&&a.scrollLeft||0)-(n&&n.clientLeft||a&&a.clientLeft||0),r.pageY=r.clientY+(n&&n.scrollTop||a&&a.scrollTop||0)-(n&&n.clientTop||a&&a.clientTop||0)}r.which=r.charCode||r.keyCode,r.button!==null&&r.button!==void 0&&(r.button=r.button&1?0:r.button&4?1:r.button&2?2:0)}return r.fixed_=!0,r}let Zs;const Fy=function(){if(typeof Zs!="boolean"){Zs=!1;try{const r=Object.defineProperty({},"passive",{get(){Zs=!0}});A.addEventListener("test",null,r),A.removeEventListener("test",null,r)}catch{}}return Zs},jy=["touchstart","touchmove"];function bt(r,e,t){if(Array.isArray(e))return Po(bt,r,e,t);ht.has(r)||ht.set(r,{});const i=ht.get(r);if(i.handlers||(i.handlers={}),i.handlers[e]||(i.handlers[e]=[]),t.guid||(t.guid=Dt()),i.handlers[e].push(t),i.dispatcher||(i.disabled=!1,i.dispatcher=function(s,n){if(i.disabled)return;s=$n(s);const a=i.handlers[s.type];if(a){const u=a.slice(0);for(let c=0,m=u.length;c<m&&!s.isImmediatePropagationStopped();c++)try{u[c].call(r,s,n)}catch(f){be.error(f)}}}),i.handlers[e].length===1)if(r.addEventListener){let s=!1;Fy()&&jy.indexOf(e)>-1&&(s={passive:!0}),r.addEventListener(e,i.dispatcher,s)}else r.attachEvent&&r.attachEvent("on"+e,i.dispatcher)}function tt(r,e,t){if(!ht.has(r))return;const i=ht.get(r);if(!i.handlers)return;if(Array.isArray(e))return Po(tt,r,e,t);const s=function(a,u){i.handlers[u]=[],jl(a,u)};if(e===void 0){for(const a in i.handlers)Object.prototype.hasOwnProperty.call(i.handlers||{},a)&&s(r,a);return}const n=i.handlers[e];if(n){if(!t){s(r,e);return}if(t.guid)for(let a=0;a<n.length;a++)n[a].guid===t.guid&&n.splice(a--,1);jl(r,e)}}function Cr(r,e,t){const i=ht.has(r)?ht.get(r):{},s=r.parentNode||r.ownerDocument;if(typeof e=="string"?e={type:e,target:r}:e.target||(e.target=r),e=$n(e),i.dispatcher&&i.dispatcher.call(r,e,t),s&&!e.isPropagationStopped()&&e.bubbles===!0)Cr.call(null,s,e,t);else if(!s&&!e.defaultPrevented&&e.target&&e.target[e.type]){ht.has(e.target)||ht.set(e.target,{});const n=ht.get(e.target);e.target[e.type]&&(n.disabled=!0,typeof e.target[e.type]=="function"&&e.target[e.type](),n.disabled=!1)}return!e.defaultPrevented}function Hn(r,e,t){if(Array.isArray(e))return Po(Hn,r,e,t);const i=function(){tt(r,e,i),t.apply(this,arguments)};i.guid=t.guid=t.guid||Dt(),bt(r,e,i)}function Lo(r,e,t){const i=function(){tt(r,e,i),t.apply(this,arguments)};i.guid=t.guid=t.guid||Dt(),bt(r,e,i)}var qy=Object.freeze({__proto__:null,fixEvent:$n,on:bt,off:tt,trigger:Cr,one:Hn,any:Lo});const It=30,De=function(r,e,t){e.guid||(e.guid=Dt());const i=e.bind(r);return i.guid=t?t+"_"+e.guid:e.guid,i},Qt=function(r,e){let t=A.performance.now();return function(...i){const s=A.performance.now();s-t>=e&&(r(...i),t=s)}},Ch=function(r,e,t,i=A){let s;const n=()=>{i.clearTimeout(s),s=null},a=function(){const u=this,c=arguments;let m=function(){s=null,m=null,t||r.apply(u,c)};!s&&t&&r.apply(u,c),i.clearTimeout(s),s=i.setTimeout(m,e)};return a.cancel=n,a};var $y=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:It,bind_:De,throttle:Qt,debounce:Ch});let Yr;class vt{on(e,t){const i=this.addEventListener;this.addEventListener=()=>{},bt(this,e,t),this.addEventListener=i}off(e,t){tt(this,e,t)}one(e,t){const i=this.addEventListener;this.addEventListener=()=>{},Hn(this,e,t),this.addEventListener=i}any(e,t){const i=this.addEventListener;this.addEventListener=()=>{},Lo(this,e,t),this.addEventListener=i}trigger(e){const t=e.type||e;typeof e=="string"&&(e={type:t}),e=$n(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),Cr(this,e)}queueTrigger(e){Yr||(Yr=new Map);const t=e.type||e;let i=Yr.get(this);i||(i=new Map,Yr.set(this,i));const s=i.get(t);i.delete(t),A.clearTimeout(s);const n=A.setTimeout(()=>{i.delete(t),i.size===0&&(i=null,Yr.delete(this)),this.trigger(e)},0);i.set(t,n)}}vt.prototype.allowedEvents_={};vt.prototype.addEventListener=vt.prototype.on;vt.prototype.removeEventListener=vt.prototype.off;vt.prototype.dispatchEvent=vt.prototype.trigger;const Vn=r=>typeof r.name=="function"?r.name():typeof r.name=="string"?r.name:r.name_?r.name_:r.constructor&&r.constructor.name?r.constructor.name:typeof r,si=r=>r instanceof vt||!!r.eventBusEl_&&["on","one","off","trigger"].every(e=>typeof r[e]=="function"),Hy=(r,e)=>{si(r)?e():(r.eventedCallbacks||(r.eventedCallbacks=[]),r.eventedCallbacks.push(e))},io=r=>typeof r=="string"&&/\S/.test(r)||Array.isArray(r)&&!!r.length,gn=(r,e,t)=>{if(!r||!r.nodeName&&!si(r))throw new Error(`Invalid target for ${Vn(e)}#${t}; must be a DOM node or evented object.`)},wh=(r,e,t)=>{if(!io(r))throw new Error(`Invalid event type for ${Vn(e)}#${t}; must be a non-empty string or array.`)},kh=(r,e,t)=>{if(typeof r!="function")throw new Error(`Invalid listener for ${Vn(e)}#${t}; must be a function.`)},xa=(r,e,t)=>{const i=e.length<3||e[0]===r||e[0]===r.eventBusEl_;let s,n,a;return i?(s=r.eventBusEl_,e.length>=3&&e.shift(),[n,a]=e):(s=e[0],n=e[1],a=e[2]),gn(s,r,t),wh(n,r,t),kh(a,r,t),a=De(r,a),{isTargetingSelf:i,target:s,type:n,listener:a}},Ri=(r,e,t,i)=>{gn(r,r,e),r.nodeName?qy[e](r,t,i):r[e](t,i)},Vy={on(...r){const{isTargetingSelf:e,target:t,type:i,listener:s}=xa(this,r,"on");if(Ri(t,"on",i,s),!e){const n=()=>this.off(t,i,s);n.guid=s.guid;const a=()=>this.off("dispose",n);a.guid=s.guid,Ri(this,"on","dispose",n),Ri(t,"on","dispose",a)}},one(...r){const{isTargetingSelf:e,target:t,type:i,listener:s}=xa(this,r,"one");if(e)Ri(t,"one",i,s);else{const n=(...a)=>{this.off(t,i,n),s.apply(null,a)};n.guid=s.guid,Ri(t,"one",i,n)}},any(...r){const{isTargetingSelf:e,target:t,type:i,listener:s}=xa(this,r,"any");if(e)Ri(t,"any",i,s);else{const n=(...a)=>{this.off(t,i,n),s.apply(null,a)};n.guid=s.guid,Ri(t,"any",i,n)}},off(r,e,t){if(!r||io(r))tt(this.eventBusEl_,r,e);else{const i=r,s=e;gn(i,this,"off"),wh(s,this,"off"),kh(t,this,"off"),t=De(this,t),this.off("dispose",t),i.nodeName?(tt(i,s,t),tt(i,"dispose",t)):si(i)&&(i.off(s,t),i.off("dispose",t))}},trigger(r,e){gn(this.eventBusEl_,this,"trigger");const t=r&&typeof r!="string"?r.type:r;if(!io(t))throw new Error(`Invalid event type for ${Vn(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return Cr(this.eventBusEl_,r,e)}};function Oo(r,e={}){const{eventBusKey:t}=e;if(t){if(!r[t].nodeName)throw new Error(`The eventBusKey "${t}" does not refer to an element.`);r.eventBusEl_=r[t]}else r.eventBusEl_=he("span",{className:"vjs-event-bus"});return Object.assign(r,Vy),r.eventedCallbacks&&r.eventedCallbacks.forEach(i=>{i()}),r.on("dispose",()=>{r.off(),[r,r.el_,r.eventBusEl_].forEach(function(i){i&&ht.has(i)&&ht.delete(i)}),A.setTimeout(()=>{r.eventBusEl_=null},0)}),r}const zy={state:{},setState(r){typeof r=="function"&&(r=r());let e;return sr(r,(t,i)=>{this.state[i]!==t&&(e=e||{},e[i]={from:this.state[i],to:t}),this.state[i]=t}),e&&si(this)&&this.trigger({changes:e,type:"statechanged"}),e}};function Ah(r,e){return Object.assign(r,zy),r.state=Object.assign({},r.state,e),typeof r.handleStateChanged=="function"&&si(r)&&r.on("statechanged",r.handleStateChanged),r}const ss=function(r){return typeof r!="string"?r:r.replace(/./,e=>e.toLowerCase())},Fe=function(r){return typeof r!="string"?r:r.replace(/./,e=>e.toUpperCase())},xh=function(r,e){return Fe(r)===Fe(e)};var Wy=Object.freeze({__proto__:null,toLowerCase:ss,toTitleCase:Fe,titleCaseEquals:xh});class X{constructor(e,t,i){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=Ae({},this.options_),t=this.options_=Ae(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){const s=e&&e.id&&e.id()||"no_player";this.id_=`${s}_component_${Dt()}`}this.name_=t.name||null,t.el?this.el_=t.el:t.createEl!==!1&&(this.el_=this.createEl()),t.className&&this.el_&&t.className.split(" ").forEach(s=>this.addClass(s)),["on","off","one","any","trigger"].forEach(s=>{this[s]=void 0}),t.evented!==!1&&(Oo(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),Ah(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map,this.clearingTimersOnDispose_=!1,t.initChildren!==!1&&this.initChildren(),this.ready(i),t.reportTouchActivity!==!1&&this.enableTouchActivity()}dispose(e={}){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(let t=this.children_.length-1;t>=0;t--)this.children_[t].dispose&&this.children_[t].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}}isDisposed(){return!!this.isDisposed_}player(){return this.player_}options(e){return e?(this.options_=Ae(this.options_,e),this.options_):this.options_}el(){return this.el_}createEl(e,t,i){return he(e,t,i)}localize(e,t,i=e){const s=this.player_.language&&this.player_.language(),n=this.player_.languages&&this.player_.languages(),a=n&&n[s],u=s&&s.split("-")[0],c=n&&n[u];let m=i;return a&&a[e]?m=a[e]:c&&c[e]&&(m=c[e]),t&&(m=m.replace(/\{(\d+)\}/g,function(f,_){const P=t[_-1];let S=P;return typeof P>"u"&&(S=f),S})),m}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(e)return this.childNameIndex_[e]}getDescendant(...e){e=e.reduce((i,s)=>i.concat(s),[]);let t=this;for(let i=0;i<e.length;i++)if(t=t.getChild(e[i]),!t||!t.getChild)return;return t}setIcon(e,t=this.el()){if(!this.player_.options_.experimentalSvgIcons)return;const i="http://www.w3.org/2000/svg",s=he("span",{className:"vjs-icon-placeholder vjs-svg-icon"},{"aria-hidden":"true"}),n=re.createElementNS(i,"svg");n.setAttributeNS(null,"viewBox","0 0 512 512");const a=re.createElementNS(i,"use");return n.appendChild(a),a.setAttributeNS(null,"href",`#vjs-icon-${e}`),s.appendChild(n),this.iconIsSet_?t.replaceChild(s,t.querySelector(".vjs-icon-placeholder")):t.appendChild(s),this.iconIsSet_=!0,s}addChild(e,t={},i=this.children_.length){let s,n;if(typeof e=="string"){n=Fe(e);const a=t.componentClass||n;t.name=n;const u=X.getComponent(a);if(!u)throw new Error(`Component ${a} does not exist`);if(typeof u!="function")return null;s=new u(this.player_||this,t)}else s=e;if(s.parentComponent_&&s.parentComponent_.removeChild(s),this.children_.splice(i,0,s),s.parentComponent_=this,typeof s.id=="function"&&(this.childIndex_[s.id()]=s),n=n||s.name&&Fe(s.name()),n&&(this.childNameIndex_[n]=s,this.childNameIndex_[ss(n)]=s),typeof s.el=="function"&&s.el()){let a=null;this.children_[i+1]&&(this.children_[i+1].el_?a=this.children_[i+1].el_:Er(this.children_[i+1])&&(a=this.children_[i+1])),this.contentEl().insertBefore(s.el(),a)}return s}removeChild(e){if(typeof e=="string"&&(e=this.getChild(e)),!e||!this.children_)return;let t=!1;for(let s=this.children_.length-1;s>=0;s--)if(this.children_[s]===e){t=!0,this.children_.splice(s,1);break}if(!t)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[Fe(e.name())]=null,this.childNameIndex_[ss(e.name())]=null;const i=e.el();i&&i.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){const e=this.options_.children;if(e){const t=this.options_,i=a=>{const u=a.name;let c=a.opts;if(t[u]!==void 0&&(c=t[u]),c===!1)return;c===!0&&(c={}),c.playerOptions=this.options_.playerOptions;const m=this.addChild(u,c);m&&(this[u]=m)};let s;const n=X.getComponent("Tech");Array.isArray(e)?s=e:s=Object.keys(e),s.concat(Object.keys(this.options_).filter(function(a){return!s.some(function(u){return typeof u=="string"?a===u:a===u.name})})).map(a=>{let u,c;return typeof a=="string"?(u=a,c=e[u]||this.options_[u]||{}):(u=a.name,c=a),{name:u,opts:c}}).filter(a=>{const u=X.getComponent(a.opts.componentClass||Fe(a.name));return u&&!n.isTech(u)}).forEach(i)}}buildCSSClass(){return""}ready(e,t=!1){if(e){if(!this.isReady_){this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(e);return}t?e.call(this):this.setTimeout(e,1)}}triggerReady(){this.isReady_=!0,this.setTimeout(function(){const e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(t){t.call(this)},this),this.trigger("ready")},1)}$(e,t){return Ei(e,t||this.contentEl())}$$(e,t){return _h(e,t||this.contentEl())}hasClass(e){return rs(this.el_,e)}addClass(...e){qi(this.el_,...e)}removeClass(...e){Un(this.el_,...e)}toggleClass(e,t){ch(this.el_,e,t)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(e){return dh(this.el_,e)}setAttribute(e,t){_r(this.el_,e,t)}removeAttribute(e){Fn(this.el_,e)}width(e,t){return this.dimension("width",e,t)}height(e,t){return this.dimension("height",e,t)}dimensions(e,t){this.width(e,!0),this.height(t)}dimension(e,t,i){if(t!==void 0){(t===null||t!==t)&&(t=0),(""+t).indexOf("%")!==-1||(""+t).indexOf("px")!==-1?this.el_.style[e]=t:t==="auto"?this.el_.style[e]="":this.el_.style[e]=t+"px",i||this.trigger("componentresize");return}if(!this.el_)return 0;const s=this.el_.style[e],n=s.indexOf("px");return parseInt(n!==-1?s.slice(0,n):this.el_["offset"+Fe(e)],10)}currentDimension(e){let t=0;if(e!=="width"&&e!=="height")throw new Error("currentDimension only accepts width or height value");if(t=vr(this.el_,e),t=parseFloat(t),t===0||isNaN(t)){const i=`offset${Fe(e)}`;t=this.el_[i]}return t}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}getPositions(){const e=this.el_.getBoundingClientRect(),t={x:e.x,y:e.y,width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left},i={x:e.left+e.width/2,y:e.top+e.height/2,width:0,height:0,top:e.top+e.height/2,right:e.left+e.width/2,bottom:e.top+e.height/2,left:e.left+e.width/2};return{boundingClientRect:t,center:i}}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){this.player_&&(e.key!=="Tab"&&!(this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled)&&e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e=0,t=null;const i=10,s=200;let n;this.on("touchstart",function(u){u.touches.length===1&&(t={pageX:u.touches[0].pageX,pageY:u.touches[0].pageY},e=A.performance.now(),n=!0)}),this.on("touchmove",function(u){if(u.touches.length>1)n=!1;else if(t){const c=u.touches[0].pageX-t.pageX,m=u.touches[0].pageY-t.pageY;Math.sqrt(c*c+m*m)>i&&(n=!1)}});const a=function(){n=!1};this.on("touchleave",a),this.on("touchcancel",a),this.on("touchend",function(u){t=null,n===!0&&A.performance.now()-e<s&&(u.preventDefault(),this.trigger("tap"))})}enableTouchActivity(){if(!this.player()||!this.player().reportUserActivity)return;const e=De(this.player(),this.player().reportUserActivity);let t;this.on("touchstart",function(){e(),this.clearInterval(t),t=this.setInterval(e,250)});const i=function(s){e(),this.clearInterval(t)};this.on("touchmove",e),this.on("touchend",i),this.on("touchcancel",i)}setTimeout(e,t){var i;return e=De(this,e),this.clearTimersOnDispose_(),i=A.setTimeout(()=>{this.setTimeoutIds_.has(i)&&this.setTimeoutIds_.delete(i),e()},t),this.setTimeoutIds_.add(i),i}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),A.clearTimeout(e)),e}setInterval(e,t){e=De(this,e),this.clearTimersOnDispose_();const i=A.setInterval(e,t);return this.setIntervalIds_.add(i),i}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),A.clearInterval(e)),e}requestAnimationFrame(e){this.clearTimersOnDispose_();var t;return e=De(this,e),t=A.requestAnimationFrame(()=>{this.rafIds_.has(t)&&this.rafIds_.delete(t),e()}),this.rafIds_.add(t),t}requestNamedAnimationFrame(e,t){this.namedRafs_.has(e)&&this.cancelNamedAnimationFrame(e),this.clearTimersOnDispose_(),t=De(this,t);const i=this.requestAnimationFrame(()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)});return this.namedRafs_.set(e,i),e}cancelNamedAnimationFrame(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))}cancelAnimationFrame(e){return this.rafIds_.has(e)&&(this.rafIds_.delete(e),A.cancelAnimationFrame(e)),e}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(([e,t])=>{this[e].forEach((i,s)=>this[t](s))}),this.clearingTimersOnDispose_=!1}))}getIsDisabled(){return!!this.el_.disabled}getIsExpresslyInert(){return this.el_.inert&&!this.el_.ownerDocument.documentElement.inert}getIsFocusable(e){return(e||this.el_).tabIndex>=0&&!(this.getIsDisabled()||this.getIsExpresslyInert())}getIsAvailableToBeFocused(e){function t(n){const a=A.getComputedStyle(n,null),u=a.getPropertyValue("visibility");return a.getPropertyValue("display")!=="none"&&!["hidden","collapse"].includes(u)}function i(n){return!(!t(n.parentElement)||!t(n)||n.style.opacity==="0"||A.getComputedStyle(n).height==="0px"||A.getComputedStyle(n).width==="0px")}function s(n){if(n.offsetWidth+n.offsetHeight+n.getBoundingClientRect().height+n.getBoundingClientRect().width===0)return!1;const a={x:n.getBoundingClientRect().left+n.offsetWidth/2,y:n.getBoundingClientRect().top+n.offsetHeight/2};if(a.x<0||a.x>(re.documentElement.clientWidth||A.innerWidth)||a.y<0||a.y>(re.documentElement.clientHeight||A.innerHeight))return!1;let u=re.elementFromPoint(a.x,a.y);for(;u;){if(u===n)return!0;if(u.parentNode)u=u.parentNode;else return!1}}return e||(e=this.el()),!!(s(e)&&i(e)&&(!e.parentElement||e.tabIndex>=0))}static registerComponent(e,t){if(typeof e!="string"||!e)throw new Error(`Illegal component name, "${e}"; must be a non-empty string.`);const i=X.getComponent("Tech"),s=i&&i.isTech(t),n=X===t||X.prototype.isPrototypeOf(t.prototype);if(s||!n){let u;throw s?u="techs must be registered using Tech.registerTech()":u="must be a Component subclass",new Error(`Illegal component, "${e}"; ${u}.`)}e=Fe(e),X.components_||(X.components_={});const a=X.getComponent("Player");if(e==="Player"&&a&&a.players){const u=a.players,c=Object.keys(u);if(u&&c.length>0){for(let m=0;m<c.length;m++)if(u[c[m]]!==null)throw new Error("Can not register Player component after player has been created.")}}return X.components_[e]=t,X.components_[ss(e)]=t,t}static getComponent(e){if(!(!e||!X.components_))return X.components_[e]}}X.registerComponent("Component",X);function Gy(r,e,t){if(typeof e!="number"||e<0||e>t)throw new Error(`Failed to execute '${r}' on 'TimeRanges': The index provided (${e}) is non-numeric or out of bounds (0-${t}).`)}function ql(r,e,t,i){return Gy(r,i,t.length-1),t[i][e]}function Da(r){let e;return r===void 0||r.length===0?e={length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}:e={length:r.length,start:ql.bind(null,"start",0,r),end:ql.bind(null,"end",1,r)},A.Symbol&&A.Symbol.iterator&&(e[A.Symbol.iterator]=()=>(r||[]).values()),e}function Mt(r,e){return Array.isArray(r)?Da(r):r===void 0||e===void 0?Da():Da([[r,e]])}const Dh=function(r,e){r=r<0?0:r;let t=Math.floor(r%60),i=Math.floor(r/60%60),s=Math.floor(r/3600);const n=Math.floor(e/60%60),a=Math.floor(e/3600);return(isNaN(r)||r===1/0)&&(s=i=t="-"),s=s>0||a>0?s+":":"",i=((s||n>=10)&&i<10?"0"+i:i)+":",t=t<10?"0"+t:t,s+i+t};let No=Dh;function Ih(r){No=r}function Ph(){No=Dh}function zi(r,e=r){return No(r,e)}var Xy=Object.freeze({__proto__:null,createTimeRanges:Mt,createTimeRange:Mt,setFormatTime:Ih,resetFormatTime:Ph,formatTime:zi});function Lh(r,e){let t=0,i,s;if(!e)return 0;(!r||!r.length)&&(r=Mt(0,0));for(let n=0;n<r.length;n++)i=r.start(n),s=r.end(n),s>e&&(s=e),t+=s-i;return t/e}function Be(r){if(r instanceof Be)return r;typeof r=="number"?this.code=r:typeof r=="string"?this.message=r:Kt(r)&&(typeof r.code=="number"&&(this.code=r.code),Object.assign(this,r)),this.message||(this.message=Be.defaultMessages[this.code]||"")}Be.prototype.code=0;Be.prototype.message="";Be.prototype.status=null;Be.prototype.metadata=null;Be.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"];Be.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};Be.MEDIA_ERR_CUSTOM=0;Be.prototype.MEDIA_ERR_CUSTOM=0;Be.MEDIA_ERR_ABORTED=1;Be.prototype.MEDIA_ERR_ABORTED=1;Be.MEDIA_ERR_NETWORK=2;Be.prototype.MEDIA_ERR_NETWORK=2;Be.MEDIA_ERR_DECODE=3;Be.prototype.MEDIA_ERR_DECODE=3;Be.MEDIA_ERR_SRC_NOT_SUPPORTED=4;Be.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4;Be.MEDIA_ERR_ENCRYPTED=5;Be.prototype.MEDIA_ERR_ENCRYPTED=5;function ns(r){return r!=null&&typeof r.then=="function"}function zt(r){ns(r)&&r.then(null,e=>{})}const ro=function(r){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((e,t,i)=>(r[t]&&(e[t]=r[t]),e),{cues:r.cues&&Array.prototype.map.call(r.cues,function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}})})},Ky=function(r){const e=r.$$("track"),t=Array.prototype.map.call(e,i=>i.track);return Array.prototype.map.call(e,function(i){const s=ro(i.track);return i.src&&(s.src=i.src),s}).concat(Array.prototype.filter.call(r.textTracks(),function(i){return t.indexOf(i)===-1}).map(ro))},Yy=function(r,e){return r.forEach(function(t){const i=e.addRemoteTextTrack(t).track;!t.src&&t.cues&&t.cues.forEach(s=>i.addCue(s))}),e.textTracks()};var so={textTracksToJson:Ky,jsonToTextTracks:Yy,trackToJson:ro};const Ia="vjs-modal-dialog";class wr extends X{constructor(e,t){super(e,t),this.handleKeyDown_=i=>this.handleKeyDown(i),this.close_=i=>this.close(i),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=he("div",{className:`${Ia}-content`},{role:"document"}),this.descEl_=he("p",{className:`${Ia}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),Ci(this.descEl_,this.description()),this.el_.appendChild(this.descEl_),this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl("div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":`${this.id()}_description`,"aria-hidden":"true","aria-label":this.label(),role:"dialog","aria-live":"polite"})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return`${Ia} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e}open(){if(this.opened_){this.options_.fillAlways&&this.fill();return}const e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}opened(e){return typeof e=="boolean"&&this[e?"open":"close"](),this.opened_}close(){if(!this.opened_)return;const e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger({type:"modalclose",bubbles:!0}),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(e){if(typeof e=="boolean"){const t=this.closeable_=!!e;let i=this.getChild("closeButton");if(t&&!i){const s=this.contentEl_;this.contentEl_=this.el_,i=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=s,this.on(i,"close",this.close_)}!t&&i&&(this.off(i,"close",this.close_),this.removeChild(i),i.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){const t=this.contentEl(),i=t.parentNode,s=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,i.removeChild(t),this.empty(),yh(t,e),this.trigger("modalfill"),s?i.insertBefore(t,s):i.appendChild(t);const n=this.getChild("closeButton");n&&i.appendChild(n.el_),this.trigger("aftermodalfill")}empty(){this.trigger("beforemodalempty"),qn(this.contentEl()),this.trigger("modalempty")}content(e){return typeof e<"u"&&(this.content_=e),this.content_}conditionalFocus_(){const e=re.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)}handleKeyDown(e){if(this.trigger({type:"modalKeydown",originalEvent:e,target:this,bubbles:!0}),e.stopPropagation(),e.key==="Escape"&&this.closeable()){e.preventDefault(),this.close();return}if(e.key!=="Tab")return;const t=this.focusableEls_(),i=this.el_.querySelector(":focus");let s;for(let n=0;n<t.length;n++)if(i===t[n]){s=n;break}re.activeElement===this.el_&&(s=0),e.shiftKey&&s===0?(t[t.length-1].focus(),e.preventDefault()):!e.shiftKey&&s===t.length-1&&(t[0].focus(),e.preventDefault())}focusableEls_(){const e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,t=>(t instanceof A.HTMLAnchorElement||t instanceof A.HTMLAreaElement)&&t.hasAttribute("href")||(t instanceof A.HTMLInputElement||t instanceof A.HTMLSelectElement||t instanceof A.HTMLTextAreaElement||t instanceof A.HTMLButtonElement)&&!t.hasAttribute("disabled")||t instanceof A.HTMLIFrameElement||t instanceof A.HTMLObjectElement||t instanceof A.HTMLEmbedElement||t.hasAttribute("tabindex")&&t.getAttribute("tabindex")!==-1||t.hasAttribute("contenteditable"))}}wr.prototype.options_={pauseOnOpen:!0,temporary:!0};X.registerComponent("ModalDialog",wr);class Wi extends vt{constructor(e=[]){super(),this.tracks_=[],Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let t=0;t<e.length;t++)this.addTrack(e[t])}addTrack(e){const t=this.tracks_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.tracks_[t]}}),this.tracks_.indexOf(e)===-1&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack",target:this})),e.labelchange_=()=>{this.trigger({track:e,type:"labelchange",target:this})},si(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let t;for(let i=0,s=this.length;i<s;i++)if(this[i]===e){t=this[i],t.off&&t.off(),this.tracks_.splice(i,1);break}t&&this.trigger({track:t,type:"removetrack",target:this})}getTrackById(e){let t=null;for(let i=0,s=this.length;i<s;i++){const n=this[i];if(n.id===e){t=n;break}}return t}}Wi.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(const r in Wi.prototype.allowedEvents_)Wi.prototype["on"+r]=null;const Pa=function(r,e){for(let t=0;t<r.length;t++)!Object.keys(r[t]).length||e.id===r[t].id||(r[t].enabled=!1)};class Oh extends Wi{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].enabled){Pa(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&Pa(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,Pa(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)}}const La=function(r,e){for(let t=0;t<r.length;t++)!Object.keys(r[t]).length||e.id===r[t].id||(r[t].selected=!1)};class Nh extends Wi{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].selected){La(e,e[t]);break}super(e),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let t=0;t<this.length;t++)if(this[t].selected)return t;return-1},set(){}})}addTrack(e){e.selected&&La(this,e),super.addTrack(e),e.addEventListener&&(e.selectedChange_=()=>{this.changing_||(this.changing_=!0,La(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)}}class Ro extends Wi{addTrack(e){super.addTrack(e),this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),e.addEventListener("modechange",this.queueChange_),["metadata","chapters"].indexOf(e.kind)===-1&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}toJSON(){return this.tracks_.map(e=>e.toJSON())}}class Qy{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let t=0,i=e.length;t<i;t++)this.addTrackElement_(e[t])}addTrackElement_(e){const t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.trackElements_[t]}}),this.trackElements_.indexOf(e)===-1&&this.trackElements_.push(e)}getTrackElementByTrack_(e){let t;for(let i=0,s=this.trackElements_.length;i<s;i++)if(e===this.trackElements_[i].track){t=this.trackElements_[i];break}return t}removeTrackElement_(e){for(let t=0,i=this.trackElements_.length;t<i;t++)if(e===this.trackElements_[t]){this.trackElements_[t].track&&typeof this.trackElements_[t].track.off=="function"&&this.trackElements_[t].track.off(),typeof this.trackElements_[t].off=="function"&&this.trackElements_[t].off(),this.trackElements_.splice(t,1);break}}}class fn{constructor(e){fn.prototype.setCues_.call(this,e),Object.defineProperty(this,"length",{get(){return this.length_}})}setCues_(e){const t=this.length||0;let i=0;const s=e.length;this.cues_=e,this.length_=e.length;const n=function(a){""+a in this||Object.defineProperty(this,""+a,{get(){return this.cues_[a]}})};if(t<s)for(i=t;i<s;i++)n.call(this,i)}getCueById(e){let t=null;for(let i=0,s=this.length;i<s;i++){const n=this[i];if(n.id===e){t=n;break}}return t}}const Jy={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},Zy={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},e_={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},$l={disabled:"disabled",hidden:"hidden",showing:"showing"};class Mo extends vt{constructor(e={}){super();const t={id:e.id||"vjs_track_"+Dt(),kind:e.kind||"",language:e.language||""};let i=e.label||"";for(const s in t)Object.defineProperty(this,s,{get(){return t[s]},set(){}});Object.defineProperty(this,"label",{get(){return i},set(s){s!==i&&(i=s,this.trigger("labelchange"))}})}}const Bo=function(r){return new URL(r,re.baseURI)},Rh=function(r){return new URL(r,re.baseURI).href},Uo=function(r){if(typeof r=="string"){const e=r.split("?")[0].replace(/\/+$/,"").match(/\.([^.\/]+)$/);return e?e[1].toLowerCase():""}return""},zn=function(r,e=A.location){return Bo(r).origin!==e.origin};var t_=Object.freeze({__proto__:null,parseUrl:Bo,getAbsoluteURL:Rh,getFileExtension:Uo,isCrossOrigin:zn});const Hl=function(r,e){const t=new A.WebVTT.Parser(A,A.vttjs,A.WebVTT.StringDecoder()),i=[];t.oncue=function(s){e.addCue(s)},t.onparsingerror=function(s){i.push(s)},t.onflush=function(){e.trigger({type:"loadeddata",target:e})},t.parse(r),i.length>0&&(A.console&&A.console.groupCollapsed&&A.console.groupCollapsed(`Text Track parsing errors for ${e.src}`),i.forEach(s=>be.error(s)),A.console&&A.console.groupEnd&&A.console.groupEnd()),t.flush()},Vl=function(r,e){const t={uri:r},i=zn(r);i&&(t.cors=i);const s=e.tech_.crossOrigin()==="use-credentials";s&&(t.withCredentials=s),Bc(t,De(this,function(n,a,u){if(n)return be.error(n,a);e.loaded_=!0,typeof A.WebVTT!="function"?e.tech_&&e.tech_.any(["vttjsloaded","vttjserror"],c=>{if(c.type==="vttjserror"){be.error(`vttjs failed to load, stopping trying to process ${e.src}`);return}return Hl(u,e)}):Hl(u,e)}))};class gs extends Mo{constructor(e={}){if(!e.tech)throw new Error("A tech was not provided.");const t=Ae(e,{kind:e_[e.kind]||"subtitles",language:e.language||e.srclang||""});let i=$l[t.mode]||"disabled";const s=t.default;(t.kind==="metadata"||t.kind==="chapters")&&(i="hidden"),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=this.tech_.preloadTextTracks!==!1;const n=new fn(this.cues_),a=new fn(this.activeCues_);let u=!1;this.timeupdateHandler=De(this,function(m={}){if(!this.tech_.isDisposed()){if(!this.tech_.isReady_){m.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler));return}this.activeCues=this.activeCues,u&&(this.trigger("cuechange"),u=!1),m.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))}});const c=()=>{this.stopTracking()};this.tech_.one("dispose",c),i!=="disabled"&&this.startTracking(),Object.defineProperties(this,{default:{get(){return s},set(){}},mode:{get(){return i},set(m){$l[m]&&i!==m&&(i=m,!this.preload_&&i!=="disabled"&&this.cues.length===0&&Vl(this.src,this),this.stopTracking(),i!=="disabled"&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?n:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(this.cues.length===0)return a;const m=this.tech_.currentTime(),f=[];for(let _=0,P=this.cues.length;_<P;_++){const S=this.cues[_];S.startTime<=m&&S.endTime>=m&&f.push(S)}if(u=!1,f.length!==this.activeCues_.length)u=!0;else for(let _=0;_<f.length;_++)this.activeCues_.indexOf(f[_])===-1&&(u=!0);return this.activeCues_=f,a.setCues_(this.activeCues_),a},set(){}}}),t.src?(this.src=t.src,this.preload_||(this.loaded_=!0),(this.preload_||t.kind!=="subtitles"&&t.kind!=="captions")&&Vl(this.src,this)):this.loaded_=!0}startTracking(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler),this.tech_.on("timeupdate",this.timeupdateHandler)}stopTracking(){this.rvf_&&(this.tech_.cancelVideoFrameCallback(this.rvf_),this.rvf_=void 0),this.tech_.off("timeupdate",this.timeupdateHandler)}addCue(e){let t=e;if(!("getCueAsHTML"in t)){t=new A.vttjs.VTTCue(e.startTime,e.endTime,e.text);for(const s in e)s in t||(t[s]=e[s]);t.id=e.id,t.originalCue_=e}const i=this.tech_.textTracks();for(let s=0;s<i.length;s++)i[s]!==this&&i[s].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)}toJSON(){return so.trackToJson(this)}removeCue(e){let t=this.cues_.length;for(;t--;){const i=this.cues_[t];if(i===e||i.originalCue_&&i.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}}}gs.prototype.allowedEvents_={cuechange:"cuechange"};class Mh extends Mo{constructor(e={}){const t=Ae(e,{kind:Zy[e.kind]||""});super(t);let i=!1;Object.defineProperty(this,"enabled",{get(){return i},set(s){typeof s!="boolean"||s===i||(i=s,this.trigger("enabledchange"))}}),t.enabled&&(this.enabled=t.enabled),this.loaded_=!0}}class Bh extends Mo{constructor(e={}){const t=Ae(e,{kind:Jy[e.kind]||""});super(t);let i=!1;Object.defineProperty(this,"selected",{get(){return i},set(s){typeof s!="boolean"||s===i||(i=s,this.trigger("selectedchange"))}}),t.selected&&(this.selected=t.selected)}}class ni extends vt{constructor(e={}){super();let t;const i=new gs(e);this.kind=i.kind,this.src=i.src,this.srclang=i.language,this.label=i.label,this.default=i.default,Object.defineProperties(this,{readyState:{get(){return t}},track:{get(){return i}}}),t=ni.NONE,i.addEventListener("loadeddata",()=>{t=ni.LOADED,this.trigger({type:"load",target:this})})}}ni.prototype.allowedEvents_={load:"load"};ni.NONE=0;ni.LOADING=1;ni.LOADED=2;ni.ERROR=3;const xt={audio:{ListClass:Oh,TrackClass:Mh,capitalName:"Audio"},video:{ListClass:Nh,TrackClass:Bh,capitalName:"Video"},text:{ListClass:Ro,TrackClass:gs,capitalName:"Text"}};Object.keys(xt).forEach(function(r){xt[r].getterName=`${r}Tracks`,xt[r].privateName=`${r}Tracks_`});const Tr={remoteText:{ListClass:Ro,TrackClass:gs,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:Qy,TrackClass:ni,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},ct=Object.assign({},xt,Tr);Tr.names=Object.keys(Tr);xt.names=Object.keys(xt);ct.names=[].concat(Tr.names).concat(xt.names);function i_(r,e,t,i,s={}){const n=r.textTracks();s.kind=e,t&&(s.label=t),i&&(s.language=i),s.tech=r;const a=new ct.text.TrackClass(s);return n.addTrack(a),a}class ge extends X{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=i=>this.onDurationChange(i),this.trackProgress_=i=>this.trackProgress(i),this.trackCurrentTime_=i=>this.trackCurrentTime(i),this.stopTrackingCurrentTime_=i=>this.stopTrackingCurrentTime(i),this.disposeSourceHandler_=i=>this.disposeSourceHandler(i),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",function(){this.hasStarted_=!0}),this.on("loadstart",function(){this.hasStarted_=!1}),ct.names.forEach(i=>{const s=ct[i];e&&e[s.getterName]&&(this[s.privateName]=e[s.getterName])}),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(i=>{e[`native${i}Tracks`]===!1&&(this[`featuresNative${i}Tracks`]=!1)}),e.nativeCaptions===!1||e.nativeTextTracks===!1?this.featuresNativeTextTracks=!1:(e.nativeCaptions===!0||e.nativeTextTracks===!0)&&(this.featuresNativeTextTracks=!0),this.featuresNativeTextTracks||this.emulateTextTracks(),this.preloadTextTracks=e.preloadTextTracks!==!1,this.autoRemoteTextTracks_=new ct.text.ListClass,this.initTrackListeners(),e.nativeControlsForTouch||this.emitTapEvents(),this.constructor&&(this.name_=this.constructor.name||"Unknown Tech")}triggerSourceset(e){this.isReady_||this.one("ready",()=>this.setTimeout(()=>this.triggerSourceset(e),1)),this.trigger({src:e,type:"sourceset"})}manualProgressOn(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)}manualProgressOff(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)}trackProgress(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(De(this,function(){const t=this.bufferedPercent();this.bufferedPercent_!==t&&this.trigger("progress"),this.bufferedPercent_=t,t===1&&this.stopTrackingProgress()}),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return Mt(0,0)}bufferedPercent(){return Lh(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)}trackCurrentTime(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}dispose(){this.clearTracks(xt.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){e=[].concat(e),e.forEach(t=>{const i=this[`${t}Tracks`]()||[];let s=i.length;for(;s--;){const n=i[s];t==="text"&&this.removeRemoteTextTrack(n),i.removeTrack(n)}})}cleanupAutoTextTracks(){const e=this.autoRemoteTextTracks_||[];let t=e.length;for(;t--;){const i=e[t];this.removeRemoteTextTrack(i)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return e!==void 0&&(this.error_=new Be(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?Mt(0,0):Mt()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){xt.names.forEach(e=>{const t=xt[e],i=()=>{this.trigger(`${e}trackchange`)},s=this[t.getterName]();s.addEventListener("removetrack",i),s.addEventListener("addtrack",i),this.on("dispose",()=>{s.removeEventListener("removetrack",i),s.removeEventListener("addtrack",i)})})}addWebVttScript_(){if(!A.WebVTT)if(re.body.contains(this.el())){if(!this.options_["vtt.js"]&&yr(pl)&&Object.keys(pl).length>0){this.trigger("vttjsloaded");return}const e=re.createElement("script");e.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",e.onload=()=>{this.trigger("vttjsloaded")},e.onerror=()=>{this.trigger("vttjserror")},this.on("dispose",()=>{e.onload=null,e.onerror=null}),A.WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){const e=this.textTracks(),t=this.remoteTextTracks(),i=u=>e.addTrack(u.track),s=u=>e.removeTrack(u.track);t.on("addtrack",i),t.on("removetrack",s),this.addWebVttScript_();const n=()=>this.trigger("texttrackchange"),a=()=>{n();for(let u=0;u<e.length;u++){const c=e[u];c.removeEventListener("cuechange",n),c.mode==="showing"&&c.addEventListener("cuechange",n)}};a(),e.addEventListener("change",a),e.addEventListener("addtrack",a),e.addEventListener("removetrack",a),this.on("dispose",function(){t.off("addtrack",i),t.off("removetrack",s),e.removeEventListener("change",a),e.removeEventListener("addtrack",a),e.removeEventListener("removetrack",a);for(let u=0;u<e.length;u++)e[u].removeEventListener("cuechange",n)})}addTextTrack(e,t,i){if(!e)throw new Error("TextTrack kind is required but was not provided");return i_(this,e,t,i)}createRemoteTextTrack(e){const t=Ae(e,{tech:this});return new Tr.remoteTextEl.TrackClass(t)}addRemoteTextTrack(e={},t){const i=this.createRemoteTextTrack(e);return typeof t!="boolean"&&(t=!1),this.remoteTextTrackEls().addTrackElement_(i),this.remoteTextTracks().addTrack(i.track),t===!1&&this.ready(()=>this.autoRemoteTextTracks_.addTrack(i.track)),i}removeRemoteTextTrack(e){const t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return!0}setDisablePictureInPicture(){}requestVideoFrameCallback(e){const t=Dt();return!this.isReady_||this.paused()?(this.queuedHanders_.add(t),this.one("playing",()=>{this.queuedHanders_.has(t)&&(this.queuedHanders_.delete(t),e())})):this.requestNamedAnimationFrame(t,e),t}cancelVideoFrameCallback(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(e){}overrideNativeVideoTracks(e){}canPlayType(e){return""}static canPlayType(e){return""}static canPlaySource(e,t){return ge.canPlayType(e.type)}static isTech(e){return e.prototype instanceof ge||e instanceof ge||e===ge}static registerTech(e,t){if(ge.techs_||(ge.techs_={}),!ge.isTech(t))throw new Error(`Tech ${e} must be a Tech`);if(!ge.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!ge.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=Fe(e),ge.techs_[e]=t,ge.techs_[ss(e)]=t,e!=="Tech"&&ge.defaultTechOrder_.push(e),t}static getTech(e){if(e){if(ge.techs_&&ge.techs_[e])return ge.techs_[e];if(e=Fe(e),A&&A.videojs&&A.videojs[e])return be.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),A.videojs[e]}}}ct.names.forEach(function(r){const e=ct[r];ge.prototype[e.getterName]=function(){return this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName]}});ge.prototype.featuresVolumeControl=!0;ge.prototype.featuresMuteControl=!0;ge.prototype.featuresFullscreenResize=!1;ge.prototype.featuresPlaybackRate=!1;ge.prototype.featuresProgressEvents=!1;ge.prototype.featuresSourceset=!1;ge.prototype.featuresTimeupdateEvents=!1;ge.prototype.featuresNativeTextTracks=!1;ge.prototype.featuresVideoFrameCallback=!1;ge.withSourceHandlers=function(r){r.registerSourceHandler=function(e,t){let i=r.sourceHandlers;i||(i=r.sourceHandlers=[]),t===void 0&&(t=i.length),i.splice(t,0,e)},r.canPlayType=function(e){const t=r.sourceHandlers||[];let i;for(let s=0;s<t.length;s++)if(i=t[s].canPlayType(e),i)return i;return""},r.selectSourceHandler=function(e,t){const i=r.sourceHandlers||[];let s;for(let n=0;n<i.length;n++)if(s=i[n].canHandleSource(e,t),s)return i[n];return null},r.canPlaySource=function(e,t){const i=r.selectSourceHandler(e,t);return i?i.canHandleSource(e,t):""},["seekable","seeking","duration"].forEach(function(e){const t=this[e];typeof t=="function"&&(this[e]=function(){return this.sourceHandler_&&this.sourceHandler_[e]?this.sourceHandler_[e].apply(this.sourceHandler_,arguments):t.apply(this,arguments)})},r.prototype),r.prototype.setSource=function(e){let t=r.selectSourceHandler(e,this.options_);t||(r.nativeSourceHandler?t=r.nativeSourceHandler:be.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),t!==r.nativeSourceHandler&&(this.currentSource_=e),this.sourceHandler_=t.handleSource(e,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},r.prototype.disposeSourceHandler=function(){this.currentSource_&&(this.clearTracks(["audio","video"]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&&(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),this.sourceHandler_=null)}};X.registerComponent("Tech",ge);ge.registerTech("Tech",ge);ge.defaultTechOrder_=[];const $i={},yn={},_n={};function r_(r,e){$i[r]=$i[r]||[],$i[r].push(e)}function s_(r,e,t){r.setTimeout(()=>Mi(e,$i[e.type],t,r),1)}function n_(r,e){r.forEach(t=>t.setTech&&t.setTech(e))}function a_(r,e,t){return r.reduceRight(Fo(t),e[t]())}function o_(r,e,t,i){return e[t](r.reduce(Fo(t),i))}function zl(r,e,t,i=null){const s="call"+Fe(t),n=r.reduce(Fo(s),i),a=n===_n,u=a?null:e[t](n);return c_(r,t,u,a),u}const u_={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},l_={setCurrentTime:1,setMuted:1,setVolume:1},Wl={play:1,pause:1};function Fo(r){return(e,t)=>e===_n?_n:t[r]?t[r](e):e}function c_(r,e,t,i){for(let s=r.length-1;s>=0;s--){const n=r[s];n[e]&&n[e](i,t)}}function h_(r){yn.hasOwnProperty(r.id())&&delete yn[r.id()]}function d_(r,e){const t=yn[r.id()];let i=null;if(t==null)return i=e(r),yn[r.id()]=[[e,i]],i;for(let s=0;s<t.length;s++){const[n,a]=t[s];n===e&&(i=a)}return i===null&&(i=e(r),t.push([e,i])),i}function Mi(r={},e=[],t,i,s=[],n=!1){const[a,...u]=e;if(typeof a=="string")Mi(r,$i[a],t,i,s,n);else if(a){const c=d_(i,a);if(!c.setSource)return s.push(c),Mi(r,u,t,i,s,n);c.setSource(Object.assign({},r),function(m,f){if(m)return Mi(r,u,t,i,s,n);s.push(c),Mi(f,r.type===f.type?u:$i[f.type],t,i,s,n)})}else u.length?Mi(r,u,t,i,s,n):n?t(r,s):Mi(r,$i["*"],t,i,s,!0)}const p_={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",caf:"audio/x-caf",flac:"audio/flac",oga:"audio/ogg",wav:"audio/wav",m3u8:"application/x-mpegURL",mpd:"application/dash+xml",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},bn=function(r=""){const e=Uo(r);return p_[e.toLowerCase()]||""},m_=(r,e)=>{if(!e)return"";if(r.cache_.source.src===e&&r.cache_.source.type)return r.cache_.source.type;const t=r.cache_.sources.filter(s=>s.src===e);if(t.length)return t[0].type;const i=r.$$("source");for(let s=0;s<i.length;s++){const n=i[s];if(n.type&&n.src&&n.src===e)return n.type}return bn(e)},Uh=function(r){if(Array.isArray(r)){let e=[];r.forEach(function(t){t=Uh(t),Array.isArray(t)?e=e.concat(t):Kt(t)&&e.push(t)}),r=e}else typeof r=="string"&&r.trim()?r=[Gl({src:r})]:Kt(r)&&typeof r.src=="string"&&r.src&&r.src.trim()?r=[Gl(r)]:r=[];return r};function Gl(r){if(!r.type){const e=bn(r.src);e&&(r.type=e)}return r}var g_=`<svg xmlns="http://www.w3.org/2000/svg">
42
+ <defs>
43
+ <symbol viewBox="0 0 48 48" id="vjs-icon-play">
44
+ <path d="M16 10v28l22-14z"></path>
45
+ </symbol>
46
+ <symbol viewBox="0 0 48 48" id="vjs-icon-pause">
47
+ <path d="M12 38h8V10h-8v28zm16-28v28h8V10h-8z"></path>
48
+ </symbol>
49
+ <symbol viewBox="0 0 48 48" id="vjs-icon-audio">
50
+ <path d="M24 2C14.06 2 6 10.06 6 20v14c0 3.31 2.69 6 6 6h6V24h-8v-4c0-7.73 6.27-14 14-14s14 6.27 14 14v4h-8v16h6c3.31 0 6-2.69 6-6V20c0-9.94-8.06-18-18-18z"></path>
51
+ </symbol>
52
+ <symbol viewBox="0 0 48 48" id="vjs-icon-captions">
53
+ <path d="M38 8H10c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h28c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM22 22h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2zm14 0h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2z"></path>
54
+ </symbol>
55
+ <symbol viewBox="0 0 48 48" id="vjs-icon-subtitles">
56
+ <path d="M40 8H8c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h32c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM8 24h8v4H8v-4zm20 12H8v-4h20v4zm12 0h-8v-4h8v4zm0-8H20v-4h20v4z"></path>
57
+ </symbol>
58
+ <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-enter">
59
+ <path d="M14 28h-4v10h10v-4h-6v-6zm-4-8h4v-6h6v-4H10v10zm24 14h-6v4h10V28h-4v6zm-6-24v4h6v6h4V10H28z"></path>
60
+ </symbol>
61
+ <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-exit">
62
+ <path d="M10 32h6v6h4V28H10v4zm6-16h-6v4h10V10h-4v6zm12 22h4v-6h6v-4H28v10zm4-22v-6h-4v10h10v-4h-6z"></path>
63
+ </symbol>
64
+ <symbol viewBox="0 0 48 48" id="vjs-icon-play-circle">
65
+ <path d="M20 33l12-9-12-9v18zm4-29C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>
66
+ </symbol>
67
+ <symbol viewBox="0 0 48 48" id="vjs-icon-volume-mute">
68
+ <path d="M33 24c0-3.53-2.04-6.58-5-8.05v4.42l4.91 4.91c.06-.42.09-.85.09-1.28zm5 0c0 1.88-.41 3.65-1.08 5.28l3.03 3.03C41.25 29.82 42 27 42 24c0-8.56-5.99-15.72-14-17.54v4.13c5.78 1.72 10 7.07 10 13.41zM8.55 6L6 8.55 15.45 18H6v12h8l10 10V26.55l8.51 8.51c-1.34 1.03-2.85 1.86-4.51 2.36v4.13a17.94 17.94 0 0 0 7.37-3.62L39.45 42 42 39.45l-18-18L8.55 6zM24 8l-4.18 4.18L24 16.36V8z"></path>
69
+ </symbol>
70
+ <symbol viewBox="0 0 48 48" id="vjs-icon-volume-low">
71
+ <path d="M14 18v12h8l10 10V8L22 18h-8z"></path>
72
+ </symbol>
73
+ <symbol viewBox="0 0 48 48" id="vjs-icon-volume-medium">
74
+ <path d="M37 24c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zm-27-6v12h8l10 10V8L18 18h-8z"></path>
75
+ </symbol>
76
+ <symbol viewBox="0 0 48 48" id="vjs-icon-volume-high">
77
+ <path d="M6 18v12h8l10 10V8L14 18H6zm27 6c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zM28 6.46v4.13c5.78 1.72 10 7.07 10 13.41s-4.22 11.69-10 13.41v4.13c8.01-1.82 14-8.97 14-17.54S36.01 8.28 28 6.46z"></path>
78
+ </symbol>
79
+ <symbol viewBox="0 0 48 48" id="vjs-icon-spinner">
80
+ <path d="M18.8 21l9.53-16.51C26.94 4.18 25.49 4 24 4c-4.8 0-9.19 1.69-12.64 4.51l7.33 12.69.11-.2zm24.28-3c-1.84-5.85-6.3-10.52-11.99-12.68L23.77 18h19.31zm.52 2H28.62l.58 1 9.53 16.5C41.99 33.94 44 29.21 44 24c0-1.37-.14-2.71-.4-4zm-26.53 4l-7.8-13.5C6.01 14.06 4 18.79 4 24c0 1.37.14 2.71.4 4h14.98l-2.31-4zM4.92 30c1.84 5.85 6.3 10.52 11.99 12.68L24.23 30H4.92zm22.54 0l-7.8 13.51c1.4.31 2.85.49 4.34.49 4.8 0 9.19-1.69 12.64-4.51L29.31 26.8 27.46 30z"></path>
81
+ </symbol>
82
+ <symbol viewBox="0 0 24 24" id="vjs-icon-hd">
83
+ <path d="M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-8 12H9.5v-2h-2v2H6V9h1.5v2.5h2V9H11v6zm2-6h4c.55 0 1 .45 1 1v4c0 .55-.45 1-1 1h-4V9zm1.5 4.5h2v-3h-2v3z"></path>
84
+ </symbol>
85
+ <symbol viewBox="0 0 48 48" id="vjs-icon-chapters">
86
+ <path d="M6 26h4v-4H6v4zm0 8h4v-4H6v4zm0-16h4v-4H6v4zm8 8h28v-4H14v4zm0 8h28v-4H14v4zm0-20v4h28v-4H14z"></path>
87
+ </symbol>
88
+ <symbol viewBox="0 0 40 40" id="vjs-icon-downloading">
89
+ <path d="M18.208 36.875q-3.208-.292-5.979-1.729-2.771-1.438-4.812-3.729-2.042-2.292-3.188-5.229-1.146-2.938-1.146-6.23 0-6.583 4.334-11.416 4.333-4.834 10.833-5.5v3.166q-5.167.75-8.583 4.646Q6.25 14.75 6.25 19.958q0 5.209 3.396 9.104 3.396 3.896 8.562 4.646zM20 28.417L11.542 20l2.083-2.083 4.917 4.916v-11.25h2.916v11.25l4.875-4.916L28.417 20zm1.792 8.458v-3.167q1.833-.25 3.541-.958 1.709-.708 3.167-1.875l2.333 2.292q-1.958 1.583-4.25 2.541-2.291.959-4.791 1.167zm6.791-27.792q-1.541-1.125-3.25-1.854-1.708-.729-3.541-1.021V3.042q2.5.25 4.77 1.208 2.271.958 4.271 2.5zm4.584 21.584l-2.25-2.25q1.166-1.5 1.854-3.209.687-1.708.937-3.541h3.209q-.292 2.5-1.229 4.791-.938 2.292-2.521 4.209zm.541-12.417q-.291-1.833-.958-3.562-.667-1.73-1.833-3.188l2.375-2.208q1.541 1.916 2.458 4.208.917 2.292 1.167 4.75z"></path>
90
+ </symbol>
91
+ <symbol viewBox="0 0 48 48" id="vjs-icon-file-download">
92
+ <path d="M10.8 40.55q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h26.35v-7.7h3.4v7.7q0 1.4-1 2.4t-2.4 1zM24 32.1L13.9 22.05l2.45-2.45 5.95 5.95V7.15h3.4v18.4l5.95-5.95 2.45 2.45z"></path>
93
+ </symbol>
94
+ <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-done">
95
+ <path d="M9.8 40.5v-3.45h28.4v3.45zm9.2-9.05L7.4 19.85l2.45-2.35L19 26.65l19.2-19.2 2.4 2.4z"></path>
96
+ </symbol>
97
+ <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-off">
98
+ <path d="M4.9 4.75L43.25 43.1 41 45.3l-4.75-4.75q-.05.05-.075.025-.025-.025-.075-.025H10.8q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h22.05l-7-7-1.85 1.8L13.9 21.9l1.85-1.85L2.7 7zm26.75 14.7l2.45 2.45-3.75 3.8-2.45-2.5zM25.7 7.15V21.1l-3.4-3.45V7.15z"></path>
99
+ </symbol>
100
+ <symbol viewBox="0 0 48 48" id="vjs-icon-share">
101
+ <path d="M36 32.17c-1.52 0-2.89.59-3.93 1.54L17.82 25.4c.11-.45.18-.92.18-1.4s-.07-.95-.18-1.4l14.1-8.23c1.07 1 2.5 1.62 4.08 1.62 3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6c0 .48.07.95.18 1.4l-14.1 8.23c-1.07-1-2.5-1.62-4.08-1.62-3.31 0-6 2.69-6 6s2.69 6 6 6c1.58 0 3.01-.62 4.08-1.62l14.25 8.31c-.1.42-.16.86-.16 1.31A5.83 5.83 0 1 0 36 32.17z"></path>
102
+ </symbol>
103
+ <symbol viewBox="0 0 48 48" id="vjs-icon-cog">
104
+ <path d="M38.86 25.95c.08-.64.14-1.29.14-1.95s-.06-1.31-.14-1.95l4.23-3.31c.38-.3.49-.84.24-1.28l-4-6.93c-.25-.43-.77-.61-1.22-.43l-4.98 2.01c-1.03-.79-2.16-1.46-3.38-1.97L29 4.84c-.09-.47-.5-.84-1-.84h-8c-.5 0-.91.37-.99.84l-.75 5.3a14.8 14.8 0 0 0-3.38 1.97L9.9 10.1a1 1 0 0 0-1.22.43l-4 6.93c-.25.43-.14.97.24 1.28l4.22 3.31C9.06 22.69 9 23.34 9 24s.06 1.31.14 1.95l-4.22 3.31c-.38.3-.49.84-.24 1.28l4 6.93c.25.43.77.61 1.22.43l4.98-2.01c1.03.79 2.16 1.46 3.38 1.97l.75 5.3c.08.47.49.84.99.84h8c.5 0 .91-.37.99-.84l.75-5.3a14.8 14.8 0 0 0 3.38-1.97l4.98 2.01a1 1 0 0 0 1.22-.43l4-6.93c.25-.43.14-.97-.24-1.28l-4.22-3.31zM24 31c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"></path>
105
+ </symbol>
106
+ <symbol viewBox="0 0 48 48" id="vjs-icon-square">
107
+ <path d="M36 8H12c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h24c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zm0 28H12V12h24v24z"></path>
108
+ </symbol>
109
+ <symbol viewBox="0 0 48 48" id="vjs-icon-circle">
110
+ <circle cx="24" cy="24" r="20"></circle>
111
+ </symbol>
112
+ <symbol viewBox="0 0 48 48" id="vjs-icon-circle-outline">
113
+ <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>
114
+ </symbol>
115
+ <symbol viewBox="0 0 48 48" id="vjs-icon-circle-inner-circle">
116
+ <path d="M24 4C12.97 4 4 12.97 4 24s8.97 20 20 20 20-8.97 20-20S35.03 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16zm6-16c0 3.31-2.69 6-6 6s-6-2.69-6-6 2.69-6 6-6 6 2.69 6 6z"></path>
117
+ </symbol>
118
+ <symbol viewBox="0 0 48 48" id="vjs-icon-cancel">
119
+ <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm10 27.17L31.17 34 24 26.83 16.83 34 14 31.17 21.17 24 14 16.83 16.83 14 24 21.17 31.17 14 34 16.83 26.83 24 34 31.17z"></path>
120
+ </symbol>
121
+ <symbol viewBox="0 0 48 48" id="vjs-icon-replay">
122
+ <path d="M24 10V2L14 12l10 10v-8c6.63 0 12 5.37 12 12s-5.37 12-12 12-12-5.37-12-12H8c0 8.84 7.16 16 16 16s16-7.16 16-16-7.16-16-16-16z"></path>
123
+ </symbol>
124
+ <symbol viewBox="0 0 48 48" id="vjs-icon-repeat">
125
+ <path d="M14 14h20v6l8-8-8-8v6H10v12h4v-8zm20 20H14v-6l-8 8 8 8v-6h24V26h-4v8z"></path>
126
+ </symbol>
127
+ <symbol viewBox="0 96 48 48" id="vjs-icon-replay-5">
128
+ <path d="M17.689 98l-8.697 8.696 8.697 8.697 2.486-2.485-4.32-4.319h1.302c4.93 0 9.071 1.722 12.424 5.165 3.352 3.443 5.029 7.638 5.029 12.584h3.55c0-2.958-.553-5.73-1.658-8.313-1.104-2.583-2.622-4.841-4.555-6.774-1.932-1.932-4.19-3.45-6.773-4.555-2.584-1.104-5.355-1.657-8.313-1.657H15.5l4.615-4.615zm-8.08 21.659v13.861h11.357v5.008H9.609V143h12.7c.834 0 1.55-.298 2.146-.894.596-.597.895-1.31.895-2.145v-7.781c0-.835-.299-1.55-.895-2.147a2.929 2.929 0 0 0-2.147-.894h-8.227v-5.096H25.35v-4.384z"></path>
129
+ </symbol>
130
+ <symbol viewBox="0 96 48 48" id="vjs-icon-replay-10">
131
+ <path d="M42.315 125.63c0-4.997-1.694-9.235-5.08-12.713-3.388-3.479-7.571-5.218-12.552-5.218h-1.315l4.363 4.363-2.51 2.51-8.787-8.786L25.221 97l2.45 2.45-4.662 4.663h1.375c2.988 0 5.788.557 8.397 1.673 2.61 1.116 4.892 2.65 6.844 4.602 1.953 1.953 3.487 4.234 4.602 6.844 1.116 2.61 1.674 5.41 1.674 8.398zM8.183 142v-19.657H3.176V117.8h9.643V142zm13.63 0c-1.156 0-2.127-.393-2.912-1.178-.778-.778-1.168-1.746-1.168-2.902v-16.04c0-1.156.393-2.127 1.178-2.912.779-.779 1.746-1.168 2.902-1.168h7.696c1.156 0 2.126.392 2.911 1.177.779.78 1.168 1.747 1.168 2.903v16.04c0 1.156-.392 2.127-1.177 2.912-.779.779-1.746 1.168-2.902 1.168zm.556-4.636h6.583v-15.02H22.37z"></path>
132
+ </symbol>
133
+ <symbol viewBox="0 96 48 48" id="vjs-icon-replay-30">
134
+ <path d="M26.047 97l-8.733 8.732 8.733 8.733 2.496-2.494-4.336-4.338h1.307c4.95 0 9.108 1.73 12.474 5.187 3.367 3.458 5.051 7.668 5.051 12.635h3.565c0-2.97-.556-5.751-1.665-8.346-1.109-2.594-2.633-4.862-4.574-6.802-1.94-1.941-4.208-3.466-6.803-4.575-2.594-1.109-5.375-1.664-8.345-1.664H23.85l4.634-4.634zM2.555 117.531v4.688h10.297v5.25H5.873v4.687h6.979v5.156H2.555V142H13.36c1.061 0 1.95-.395 2.668-1.186.718-.79 1.076-1.772 1.076-2.94v-16.218c0-1.168-.358-2.149-1.076-2.94-.717-.79-1.607-1.185-2.668-1.185zm22.482.14c-1.149 0-2.11.39-2.885 1.165-.78.78-1.172 1.744-1.172 2.893v15.943c0 1.149.388 2.11 1.163 2.885.78.78 1.745 1.172 2.894 1.172h7.649c1.148 0 2.11-.388 2.884-1.163.78-.78 1.17-1.745 1.17-2.894v-15.943c0-1.15-.386-2.111-1.16-2.885-.78-.78-1.746-1.172-2.894-1.172zm.553 4.518h6.545v14.93H25.59z"></path>
135
+ </symbol>
136
+ <symbol viewBox="0 96 48 48" id="vjs-icon-forward-5">
137
+ <path d="M29.508 97l-2.431 2.43 4.625 4.625h-1.364c-2.965 0-5.742.554-8.332 1.66-2.589 1.107-4.851 2.629-6.788 4.566-1.937 1.937-3.458 4.2-4.565 6.788-1.107 2.59-1.66 5.367-1.66 8.331h3.557c0-4.957 1.68-9.16 5.04-12.611 3.36-3.45 7.51-5.177 12.451-5.177h1.304l-4.326 4.33 2.49 2.49 8.715-8.716zm-9.783 21.61v13.89h11.382v5.018H19.725V142h12.727a2.93 2.93 0 0 0 2.15-.896 2.93 2.93 0 0 0 .896-2.15v-7.798c0-.837-.299-1.554-.896-2.152a2.93 2.93 0 0 0-2.15-.896h-8.245V123h11.29v-4.392z"></path>
138
+ </symbol>
139
+ <symbol viewBox="0 96 48 48" id="vjs-icon-forward-10">
140
+ <path d="M23.119 97l-2.386 2.383 4.538 4.538h-1.339c-2.908 0-5.633.543-8.173 1.63-2.54 1.085-4.76 2.577-6.66 4.478-1.9 1.9-3.392 4.12-4.478 6.66-1.085 2.54-1.629 5.264-1.629 8.172h3.49c0-4.863 1.648-8.986 4.944-12.372 3.297-3.385 7.368-5.078 12.216-5.078h1.279l-4.245 4.247 2.443 2.442 8.55-8.55zm-9.52 21.45v4.42h4.871V142h4.513v-23.55zm18.136 0c-1.125 0-2.066.377-2.824 1.135-.764.764-1.148 1.709-1.148 2.834v15.612c0 1.124.38 2.066 1.139 2.824.764.764 1.708 1.145 2.833 1.145h7.489c1.125 0 2.066-.378 2.824-1.136.764-.764 1.145-1.709 1.145-2.833v-15.612c0-1.125-.378-2.067-1.136-2.825-.764-.764-1.708-1.145-2.833-1.145zm.54 4.42h6.408v14.617h-6.407z"></path>
141
+ </symbol>
142
+ <symbol viewBox="0 96 48 48" id="vjs-icon-forward-30">
143
+ <path d="M25.549 97l-2.437 2.434 4.634 4.635H26.38c-2.97 0-5.753.555-8.347 1.664-2.594 1.109-4.861 2.633-6.802 4.574-1.94 1.94-3.465 4.207-4.574 6.802-1.109 2.594-1.664 5.377-1.664 8.347h3.565c0-4.967 1.683-9.178 5.05-12.636 3.366-3.458 7.525-5.187 12.475-5.187h1.307l-4.335 4.338 2.495 2.494 8.732-8.732zm-11.553 20.53v4.689h10.297v5.249h-6.978v4.688h6.978v5.156H13.996V142h10.808c1.06 0 1.948-.395 2.666-1.186.718-.79 1.077-1.771 1.077-2.94v-16.217c0-1.169-.36-2.15-1.077-2.94-.718-.79-1.605-1.186-2.666-1.186zm21.174.168c-1.149 0-2.11.389-2.884 1.163-.78.78-1.172 1.745-1.172 2.894v15.942c0 1.15.388 2.11 1.162 2.885.78.78 1.745 1.17 2.894 1.17h7.649c1.149 0 2.11-.386 2.885-1.16.78-.78 1.17-1.746 1.17-2.895v-15.942c0-1.15-.387-2.11-1.161-2.885-.78-.78-1.745-1.172-2.894-1.172zm.552 4.516h6.542v14.931h-6.542z"></path>
144
+ </symbol>
145
+ <symbol viewBox="0 0 512 512" id="vjs-icon-audio-description">
146
+ <g fill-rule="evenodd"><path d="M227.29 381.351V162.993c50.38-1.017 89.108-3.028 117.631 17.126 27.374 19.342 48.734 56.965 44.89 105.325-4.067 51.155-41.335 94.139-89.776 98.475-24.085 2.155-71.972 0-71.972 0s-.84-1.352-.773-2.568m48.755-54.804c31.43 1.26 53.208-16.633 56.495-45.386 4.403-38.51-21.188-63.552-58.041-60.796v103.612c-.036 1.466.575 2.22 1.546 2.57"></path><path d="M383.78 381.328c13.336 3.71 17.387-11.06 23.215-21.408 12.722-22.571 22.294-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.226 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M425.154 381.328c13.336 3.71 17.384-11.061 23.215-21.408 12.721-22.571 22.291-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.511c-.586 3.874 2.226 7.315 3.866 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M466.26 381.328c13.337 3.71 17.385-11.061 23.216-21.408 12.722-22.571 22.292-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.225 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894M4.477 383.005H72.58l18.573-28.484 64.169-.135s.065 19.413.065 28.62h48.756V160.307h-58.816c-5.653 9.537-140.85 222.697-140.85 222.697zm152.667-145.282v71.158l-40.453-.27 40.453-70.888z"></path></g>
147
+ </symbol>
148
+ <symbol viewBox="0 0 48 48" id="vjs-icon-next-item">
149
+ <path d="M12 36l17-12-17-12v24zm20-24v24h4V12h-4z"></path>
150
+ </symbol>
151
+ <symbol viewBox="0 0 48 48" id="vjs-icon-previous-item">
152
+ <path d="M12 12h4v24h-4zm7 12l17 12V12z"></path>
153
+ </symbol>
154
+ <symbol viewBox="0 0 48 48" id="vjs-icon-shuffle">
155
+ <path d="M21.17 18.34L10.83 8 8 10.83l10.34 10.34 2.83-2.83zM29 8l4.09 4.09L8 37.17 10.83 40l25.09-25.09L40 19V8H29zm.66 18.83l-2.83 2.83 6.26 6.26L29 40h11V29l-4.09 4.09-6.25-6.26z"></path>
156
+ </symbol>
157
+ <symbol viewBox="0 0 48 48" id="vjs-icon-cast">
158
+ <path d="M42 6H6c-2.21 0-4 1.79-4 4v6h4v-6h36v28H28v4h14c2.21 0 4-1.79 4-4V10c0-2.21-1.79-4-4-4zM2 36v6h6c0-3.31-2.69-6-6-6zm0-8v4c5.52 0 10 4.48 10 10h4c0-7.73-6.27-14-14-14zm0-8v4c9.94 0 18 8.06 18 18h4c0-12.15-9.85-22-22-22z"></path>
159
+ </symbol>
160
+ <symbol viewBox="0 0 48 48" id="vjs-icon-picture-in-picture-enter">
161
+ <path d="M38 22H22v11.99h16V22zm8 16V9.96C46 7.76 44.2 6 42 6H6C3.8 6 2 7.76 2 9.96V38c0 2.2 1.8 4 4 4h36c2.2 0 4-1.8 4-4zm-4 .04H6V9.94h36v28.1z"></path>
162
+ </symbol>
163
+ <symbol viewBox="0 0 22 18" id="vjs-icon-picture-in-picture-exit">
164
+ <path d="M18 4H4v10h14V4zm4 12V1.98C22 .88 21.1 0 20 0H2C.9 0 0 .88 0 1.98V16c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zm-2 .02H2V1.97h18v14.05z"></path>
165
+ <path fill="none" d="M-1-3h24v24H-1z"></path>
166
+ </symbol>
167
+ <symbol viewBox="0 0 1792 1792" id="vjs-icon-facebook">
168
+ <path d="M1343 12v264h-157q-86 0-116 36t-30 108v189h293l-39 296h-254v759H734V905H479V609h255V391q0-186 104-288.5T1115 0q147 0 228 12z"></path>
169
+ </symbol>
170
+ <symbol viewBox="0 0 1792 1792" id="vjs-icon-linkedin">
171
+ <path d="M477 625v991H147V625h330zm21-306q1 73-50.5 122T312 490h-2q-82 0-132-49t-50-122q0-74 51.5-122.5T314 148t133 48.5T498 319zm1166 729v568h-329v-530q0-105-40.5-164.5T1168 862q-63 0-105.5 34.5T999 982q-11 30-11 81v553H659q2-399 2-647t-1-296l-1-48h329v144h-2q20-32 41-56t56.5-52 87-43.5T1285 602q171 0 275 113.5t104 332.5z"></path>
172
+ </symbol>
173
+ <symbol viewBox="0 0 1200 1227" id="vjs-icon-twitter">
174
+ <path d="M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z"/>
175
+ </symbol>
176
+ <symbol viewBox="0 0 1792 1792" id="vjs-icon-tumblr">
177
+ <path d="M1328 1329l80 237q-23 35-111 66t-177 32q-104 2-190.5-26T787 1564t-95-106-55.5-120-16.5-118V676H452V461q72-26 129-69.5t91-90 58-102 34-99T779 12q1-5 4.5-8.5T791 0h244v424h333v252h-334v518q0 30 6.5 56t22.5 52.5 49.5 41.5 81.5 14q78-2 134-29z"></path>
178
+ </symbol>
179
+ <symbol viewBox="0 0 1792 1792" id="vjs-icon-pinterest">
180
+ <path d="M1664 896q0 209-103 385.5T1281.5 1561 896 1664q-111 0-218-32 59-93 78-164 9-34 54-211 20 39 73 67.5t114 28.5q121 0 216-68.5t147-188.5 52-270q0-114-59.5-214T1180 449t-255-63q-105 0-196 29t-154.5 77-109 110.5-67 129.5T377 866q0 104 40 183t117 111q30 12 38-20 2-7 8-31t8-30q6-23-11-43-51-61-51-151 0-151 104.5-259.5T904 517q151 0 235.5 82t84.5 213q0 170-68.5 289T980 1220q-61 0-98-43.5T859 1072q8-35 26.5-93.5t30-103T927 800q0-50-27-83t-77-33q-62 0-105 57t-43 142q0 73 25 122l-99 418q-17 70-13 177-206-91-333-281T128 896q0-209 103-385.5T510.5 231 896 128t385.5 103T1561 510.5 1664 896z"></path>
181
+ </symbol>
182
+ </defs>
183
+ </svg>`;const Xl=dn?10009:pn?461:8,Zi={codes:{play:415,pause:19,ff:417,rw:412,back:Xl},names:{415:"play",19:"pause",417:"ff",412:"rw",[Xl]:"back"},isEventKey(r,e){return e=e.toLowerCase(),!!(this.names[r.keyCode]&&this.names[r.keyCode]===e)},getEventName(r){if(this.names[r.keyCode])return this.names[r.keyCode];if(this.codes[r.code]){const e=this.codes[r.code];return this.names[e]}return null}},Kl=5;class f_ extends vt{constructor(e){super(),this.player_=e,this.focusableComponents=[],this.isListening_=!1,this.isPaused_=!1,this.onKeyDown_=this.onKeyDown_.bind(this),this.lastFocusedComponent_=null}start(){this.isListening_||(this.player_.on("keydown",this.onKeyDown_),this.player_.on("modalKeydown",this.onKeyDown_),this.player_.on("loadedmetadata",()=>{this.focus(this.updateFocusableComponents()[0])}),this.player_.on("modalclose",()=>{this.refocusComponent()}),this.player_.on("focusin",this.handlePlayerFocus_.bind(this)),this.player_.on("focusout",this.handlePlayerBlur_.bind(this)),this.isListening_=!0,this.player_.errorDisplay&&this.player_.errorDisplay.on("aftermodalfill",()=>{this.updateFocusableComponents(),this.focusableComponents.length&&(this.focusableComponents.length>1?this.focusableComponents[1].focus():this.focusableComponents[0].focus())}))}stop(){this.player_.off("keydown",this.onKeyDown_),this.isListening_=!1}onKeyDown_(e){const t=e.originalEvent?e.originalEvent:e;if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(t.key)){if(this.isPaused_)return;t.preventDefault();const i=t.key.substring(5).toLowerCase();this.move(i)}else if(Zi.isEventKey(t,"play")||Zi.isEventKey(t,"pause")||Zi.isEventKey(t,"ff")||Zi.isEventKey(t,"rw")){t.preventDefault();const i=Zi.getEventName(t);this.performMediaAction_(i)}else Zi.isEventKey(t,"Back")&&e.target&&typeof e.target.closeable=="function"&&e.target.closeable()&&(t.preventDefault(),e.target.close())}performMediaAction_(e){if(this.player_)switch(e){case"play":this.player_.paused()&&this.player_.play();break;case"pause":this.player_.paused()||this.player_.pause();break;case"ff":this.userSeek_(this.player_.currentTime()+Kl);break;case"rw":this.userSeek_(this.player_.currentTime()-Kl);break}}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}pause(){this.isPaused_=!0}resume(){this.isPaused_=!1}handlePlayerBlur_(e){const t=e.relatedTarget;let i=null;const s=this.getCurrentComponent(e.target);t&&(i=!!t.closest(".video-js"),t.classList.contains("vjs-text-track-settings")&&!this.isPaused_&&this.searchForTrackSelect_()),(!e.currentTarget.contains(e.relatedTarget)&&!i||!t)&&(s&&s.name()==="CloseButton"?this.refocusComponent():(this.pause(),s&&s.el()&&(this.lastFocusedComponent_=s)))}handlePlayerFocus_(){this.getCurrentComponent()&&this.getCurrentComponent().getIsFocusable()&&this.resume()}updateFocusableComponents(){const e=this.player_,t=[];function i(s){for(const n of s)n.hasOwnProperty("el_")&&n.getIsFocusable()&&n.getIsAvailableToBeFocused(n.el())&&t.push(n),n.hasOwnProperty("children_")&&n.children_.length>0&&i(n.children_)}return e.children_.forEach(s=>{if(s.hasOwnProperty("el_"))if(s.getIsFocusable&&s.getIsAvailableToBeFocused&&s.getIsFocusable()&&s.getIsAvailableToBeFocused(s.el())){t.push(s);return}else s.hasOwnProperty("children_")&&s.children_.length>0?i(s.children_):s.hasOwnProperty("items")&&s.items.length>0?i(s.items):this.findSuitableDOMChild(s)&&t.push(s);if(s.name_==="ErrorDisplay"&&s.opened_){const n=s.el_.querySelector(".vjs-errors-ok-button-container");n&&n.querySelectorAll("button").forEach((a,u)=>{t.push({name:()=>"ModalButton"+(u+1),el:()=>a,getPositions:()=>{const c=a.getBoundingClientRect(),m={x:c.x,y:c.y,width:c.width,height:c.height,top:c.top,right:c.right,bottom:c.bottom,left:c.left},f={x:c.left+c.width/2,y:c.top+c.height/2,width:0,height:0,top:c.top+c.height/2,right:c.left+c.width/2,bottom:c.top+c.height/2,left:c.left+c.width/2};return{boundingClientRect:m,center:f}},getIsAvailableToBeFocused:()=>!0,getIsFocusable:c=>!0,focus:()=>a.focus()})})}}),this.focusableComponents=t,this.focusableComponents}findSuitableDOMChild(e){function t(i){if(e.getIsFocusable(i)&&e.getIsAvailableToBeFocused(i))return i;for(let s=0;s<i.children.length;s++){const n=i.children[s],a=t(n);if(a)return a}return null}return e.el()?t(e.el()):null}getCurrentComponent(e){this.updateFocusableComponents();const t=e||document.activeElement;if(this.focusableComponents.length){for(const i of this.focusableComponents)if(i.el()===t)return i}}add(e){const t=[...this.focusableComponents];e.hasOwnProperty("el_")&&e.getIsFocusable()&&e.getIsAvailableToBeFocused(e.el())&&t.push(e),this.focusableComponents=t,this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents})}remove(e){for(let t=0;t<this.focusableComponents.length;t++)if(this.focusableComponents[t].name()===e.name()){this.focusableComponents.splice(t,1),this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents});return}}clear(){this.focusableComponents.length>0&&(this.focusableComponents=[],this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents}))}move(e){const t=this.getCurrentComponent();if(!t)return;const i=t.getPositions(),s=this.focusableComponents.filter(a=>a!==t&&this.isInDirection_(i.boundingClientRect,a.getPositions().boundingClientRect,e)),n=this.findBestCandidate_(i.center,s,e);n?this.focus(n):this.trigger({type:"endOfFocusableComponents",direction:e,focusedComponent:t})}findBestCandidate_(e,t,i){let s=1/0,n=null;for(const a of t){const u=a.getPositions().center,c=this.calculateDistance_(e,u,i);c<s&&(s=c,n=a)}return n}isInDirection_(e,t,i){switch(i){case"right":return t.left>=e.right;case"left":return t.right<=e.left;case"down":return t.top>=e.bottom;case"up":return t.bottom<=e.top;default:return!1}}refocusComponent(){if(this.lastFocusedComponent_){this.player_.userActive()||this.player_.userActive(!0),this.updateFocusableComponents();for(let e=0;e<this.focusableComponents.length;e++)if(this.focusableComponents[e].name()===this.lastFocusedComponent_.name()){this.focus(this.focusableComponents[e]);return}}else this.focus(this.updateFocusableComponents()[0])}focus(e){typeof e=="object"&&(e.getIsAvailableToBeFocused(e.el())?e.focus():this.findSuitableDOMChild(e)&&this.findSuitableDOMChild(e).focus())}calculateDistance_(e,t,i){const s=Math.abs(e.x-t.x),n=Math.abs(e.y-t.y);let a;switch(i){case"right":case"left":a=s+n*100;break;case"up":a=n*2+s*.5;break;case"down":a=n*5+s;break;default:a=s+n}return a}searchForTrackSelect_(){const e=this;for(const t of e.updateFocusableComponents())if(t.constructor.name==="TextTrackSelect"){e.focus(t);break}}}class y_ extends X{constructor(e,t,i){const s=Ae({createEl:!1},t);if(super(e,s,i),!t.playerOptions.sources||t.playerOptions.sources.length===0)for(let n=0,a=t.playerOptions.techOrder;n<a.length;n++){const u=Fe(a[n]);let c=ge.getTech(u);if(u||(c=X.getComponent(u)),c&&c.isSupported()){e.loadTech_(u);break}}else e.src(t.playerOptions.sources)}}X.registerComponent("MediaLoader",y_);class Wn extends X{constructor(e,t){super(e,t),this.options_.controlText&&this.controlText(this.options_.controlText),this.handleMouseOver_=i=>this.handleMouseOver(i),this.handleMouseOut_=i=>this.handleMouseOut(i),this.handleClick_=i=>this.handleClick(i),this.handleKeyDown_=i=>this.handleKeyDown(i),this.emitTapEvents(),this.enable()}createEl(e="div",t={},i={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),e==="button"&&be.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),i=Object.assign({role:"button"},i),this.tabIndex_=t.tabIndex;const s=he(e,t,i);return this.player_.options_.experimentalSvgIcons||s.appendChild(he("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(s),s}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=he("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_}controlText(e,t=this.el()){if(e===void 0)return this.controlText_||"Need Text";const i=this.localize(e);this.controlText_=e,Ci(this.controlTextEl_,i),!this.nonIconControl&&!this.player_.options_.noUITitleAttributes&&t.setAttribute("title",i)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),typeof this.tabIndex_<"u"&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))}disable(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),typeof this.tabIndex_<"u"&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}handleKeyDown(e){e.key===" "||e.key==="Enter"?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}X.registerComponent("ClickableComponent",Wn);class no extends Wn{constructor(e,t){super(e,t),this.update(),this.update_=i=>this.update(i),e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return he("div",{className:"vjs-poster"})}crossOrigin(e){if(typeof e>"u")return this.$("img")?this.$("img").crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null;if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}this.$("img")&&(this.$("img").crossOrigin=e)}update(e){const t=this.player().poster();this.setSrc(t),t?this.show():this.hide()}setSrc(e){if(!e){this.el_.textContent="";return}this.$("img")||this.el_.appendChild(he("picture",{className:"vjs-poster",tabIndex:-1},{},he("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=e}handleClick(e){this.player_.controls()&&(this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?zt(this.player_.play()):this.player_.pause())}}no.prototype.crossorigin=no.prototype.crossOrigin;X.registerComponent("PosterImage",no);const At="#222",Yl="#ccc",__={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function Oa(r,e){let t;if(r.length===4)t=r[1]+r[1]+r[2]+r[2]+r[3]+r[3];else if(r.length===7)t=r.slice(1);else throw new Error("Invalid color code provided, "+r+"; must be formatted as e.g. #f0e or #f604e2.");return"rgba("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+","+e+")"}function $t(r,e,t){try{r.style[e]=t}catch{return}}function Ql(r){return r?`${r}px`:""}class b_ extends X{constructor(e,t,i){super(e,t,i);const s=a=>this.updateDisplay(a),n=a=>{this.updateDisplayOverlay(),this.updateDisplay(a)};e.on("loadstart",a=>this.toggleDisplay(a)),e.on("useractive",s),e.on("userinactive",s),e.on("texttrackchange",s),e.on("loadedmetadata",a=>{this.updateDisplayOverlay(),this.preselectTrack(a)}),e.ready(De(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks){this.hide();return}e.on("fullscreenchange",n),e.on("playerresize",n);const a=A.screen.orientation||A,u=A.screen.orientation?"change":"orientationchange";a.addEventListener(u,n),e.on("dispose",()=>a.removeEventListener(u,n));const c=this.options_.playerOptions.tracks||[];for(let m=0;m<c.length;m++)this.player_.addRemoteTextTrack(c[m],!0);this.preselectTrack()}))}preselectTrack(){const e={captions:1,subtitles:1},t=this.player_.textTracks(),i=this.player_.cache_.selectedLanguage;let s,n,a;for(let u=0;u<t.length;u++){const c=t[u];i&&i.enabled&&i.language&&i.language===c.language&&c.kind in e?c.kind===i.kind?a=c:a||(a=c):i&&!i.enabled?(a=null,s=null,n=null):c.default&&(c.kind==="descriptions"&&!s?s=c:c.kind in e&&!n&&(n=c))}a?a.mode="showing":n?n.mode="showing":s&&(s.mode="showing")}toggleDisplay(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()}createEl(){return super.createEl("div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"})}clearDisplay(){typeof A.WebVTT=="function"&&A.WebVTT.processCues(A,[],this.el_)}updateDisplay(){const e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){const a=[];for(let u=0;u<e.length;++u){const c=e[u];c.mode==="showing"&&a.push(c)}this.updateForTrack(a);return}let i=null,s=null,n=e.length;for(;n--;){const a=e[n];a.mode==="showing"&&(a.kind==="descriptions"?i=a:s=a)}if(s?(this.getAttribute("aria-live")!=="off"&&this.setAttribute("aria-live","off"),this.updateForTrack(s)):i&&(this.getAttribute("aria-live")!=="assertive"&&this.setAttribute("aria-live","assertive"),this.updateForTrack(i)),!A.CSS.supports("inset","10px")){const a=this.el_,u=a.querySelectorAll(".vjs-text-track-cue"),c=this.player_.controlBar.el_.getBoundingClientRect().height,m=this.player_.el_.getBoundingClientRect().height;a.style="",$t(a,"position","relative"),$t(a,"height",m-c+"px"),$t(a,"top","unset"),mn?$t(a,"bottom",m+"px"):$t(a,"bottom","0px"),u.length>0&&u.forEach(f=>{if(f.style.inset){const _=f.style.inset.split(" ");_.length===3&&Object.assign(f.style,{top:_[0],right:_[1],bottom:_[2],left:"unset"})}})}}updateDisplayOverlay(){if(!this.player_.videoHeight()||!A.CSS.supports("inset-inline: 10px"))return;const e=this.player_.currentWidth(),t=this.player_.currentHeight(),i=e/t,s=this.player_.videoWidth()/this.player_.videoHeight();let n=0,a=0;Math.abs(i-s)>.1&&(i>s?n=Math.round((e-t*s)/2):a=Math.round((t-e/s)/2)),$t(this.el_,"insetInline",Ql(n)),$t(this.el_,"insetBlock",Ql(a))}updateDisplayState(e){const t=this.player_.textTrackSettings.getValues(),i=e.activeCues;let s=i.length;for(;s--;){const n=i[s];if(!n)continue;const a=n.displayState;if(t.color&&(a.firstChild.style.color=t.color),t.textOpacity&&$t(a.firstChild,"color",Oa(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(a.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&$t(a.firstChild,"backgroundColor",Oa(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?$t(a,"backgroundColor",Oa(t.windowColor,t.windowOpacity)):a.style.backgroundColor=t.windowColor),t.edgeStyle&&(t.edgeStyle==="dropshadow"?a.firstChild.style.textShadow=`2px 2px 3px ${At}, 2px 2px 4px ${At}, 2px 2px 5px ${At}`:t.edgeStyle==="raised"?a.firstChild.style.textShadow=`1px 1px ${At}, 2px 2px ${At}, 3px 3px ${At}`:t.edgeStyle==="depressed"?a.firstChild.style.textShadow=`1px 1px ${Yl}, 0 1px ${Yl}, -1px -1px ${At}, 0 -1px ${At}`:t.edgeStyle==="uniform"&&(a.firstChild.style.textShadow=`0 0 4px ${At}, 0 0 4px ${At}, 0 0 4px ${At}, 0 0 4px ${At}`)),t.fontPercent&&t.fontPercent!==1){const u=A.parseFloat(a.style.fontSize);a.style.fontSize=u*t.fontPercent+"px",a.style.height="auto",a.style.top="auto"}t.fontFamily&&t.fontFamily!=="default"&&(t.fontFamily==="small-caps"?a.firstChild.style.fontVariant="small-caps":a.firstChild.style.fontFamily=__[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),typeof A.WebVTT!="function"||e.every(i=>!i.activeCues))return;const t=[];for(let i=0;i<e.length;++i){const s=e[i];for(let n=0;n<s.activeCues.length;++n)t.push(s.activeCues[n])}A.WebVTT.processCues(A,t,this.el_);for(let i=0;i<e.length;++i){const s=e[i];for(let n=0;n<s.activeCues.length;++n){const a=s.activeCues[n].displayState;qi(a,"vjs-text-track-cue","vjs-text-track-cue-"+(s.language?s.language:i)),s.language&&_r(a,"lang",s.language)}this.player_.textTrackSettings&&this.updateDisplayState(s)}}}X.registerComponent("TextTrackDisplay",b_);class v_ extends X{createEl(){const e=this.player_.isAudio(),t=this.localize(e?"Audio Player":"Video Player"),i=he("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[t])}),s=super.createEl("div",{className:"vjs-loading-spinner",dir:"ltr"});return s.appendChild(i),s}handleLanguagechange(){this.$(".vjs-control-text").textContent=this.localize("{1} is loading.",[this.player_.isAudio()?"Audio Player":"Video Player"])}}X.registerComponent("LoadingSpinner",v_);class it extends Wn{createEl(e,t={},i={}){e="button",t=Object.assign({className:this.buildCSSClass()},t),i=Object.assign({type:"button"},i);const s=he(e,t,i);return this.player_.options_.experimentalSvgIcons||s.appendChild(he("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(s),s}addChild(e,t={}){const i=this.constructor.name;return be.warn(`Adding an actionable (user controllable) child to a Button (${i}) is not supported; use a ClickableComponent instead.`),X.prototype.addChild.call(this,e,t)}enable(){super.enable(),this.el_.removeAttribute("disabled")}disable(){super.disable(),this.el_.setAttribute("disabled","disabled")}handleKeyDown(e){if(e.key===" "||e.key==="Enter"){e.stopPropagation();return}super.handleKeyDown(e)}}X.registerComponent("Button",it);class Fh extends it{constructor(e,t){super(e,t),this.mouseused_=!1,this.setIcon("play"),this.on("mousedown",i=>this.handleMouseDown(i))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){const t=this.player_.play();if(e.type==="tap"||this.mouseused_&&"clientX"in e&&"clientY"in e){zt(t),this.player_.tech(!0)&&this.player_.tech(!0).focus();return}const i=this.player_.getChild("controlBar"),s=i&&i.getChild("playToggle");if(!s){this.player_.tech(!0).focus();return}const n=()=>s.focus();ns(t)?t.then(n,()=>{}):this.setTimeout(n,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}Fh.prototype.controlText_="Play Video";X.registerComponent("BigPlayButton",Fh);class T_ extends it{constructor(e,t){super(e,t),this.setIcon("cancel"),this.controlText(t&&t.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:"close",bubbles:!1})}handleKeyDown(e){e.key==="Escape"?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}X.registerComponent("CloseButton",T_);class jh extends it{constructor(e,t={}){super(e,t),t.replay=t.replay===void 0||t.replay,this.setIcon("play"),this.on(e,"play",i=>this.handlePlay(i)),this.on(e,"pause",i=>this.handlePause(i)),t.replay&&this.on(e,"ended",i=>this.handleEnded(i))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?zt(this.player_.play()):this.player_.pause()}handleSeeked(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)}handlePlay(e){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.setIcon("pause"),this.controlText("Pause")}handlePause(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.setIcon("play"),this.controlText("Play")}handleEnded(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.setIcon("replay"),this.controlText("Replay"),this.one(this.player_,"seeked",t=>this.handleSeeked(t))}}jh.prototype.controlText_="Play";X.registerComponent("PlayToggle",jh);class kr extends X{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended","seeking"],i=>this.update(i)),this.updateTextNode_()}createEl(){const e=this.buildCSSClass(),t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`}),i=he("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)}\xA0`},{role:"presentation"});return t.appendChild(i),this.contentEl_=he("span",{className:`${e}-display`},{role:"presentation"}),t.appendChild(this.contentEl_),t}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}update(e){!this.player_.options_.enableSmoothSeeking&&e.type==="seeking"||this.updateContent(e)}updateTextNode_(e=0){e=zi(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",()=>{if(!this.contentEl_)return;let t=this.textNode_;t&&this.contentEl_.firstChild!==t&&(t=null,be.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),this.textNode_=re.createTextNode(this.formattedTime_),this.textNode_&&(t?this.contentEl_.replaceChild(this.textNode_,t):this.contentEl_.appendChild(this.textNode_))}))}updateContent(e){}}kr.prototype.labelText_="Time";kr.prototype.controlText_="Time";X.registerComponent("TimeDisplay",kr);class jo extends kr{buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;this.player_.ended()?t=this.player_.duration():e&&e.target&&typeof e.target.pendingSeekTime=="function"?t=e.target.pendingSeekTime():t=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}}jo.prototype.labelText_="Current Time";jo.prototype.controlText_="Current Time";X.registerComponent("CurrentTimeDisplay",jo);class qo extends kr{constructor(e,t){super(e,t);const i=s=>this.updateContent(s);this.on(e,"durationchange",i),this.on(e,"loadstart",i),this.on(e,"loadedmetadata",i)}buildCSSClass(){return"vjs-duration"}updateContent(e){const t=this.player_.duration();this.updateTextNode_(t)}}qo.prototype.labelText_="Duration";qo.prototype.controlText_="Duration";X.registerComponent("DurationDisplay",qo);class S_ extends X{createEl(){const e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),t=super.createEl("div"),i=super.createEl("span",{textContent:"/"});return t.appendChild(i),e.appendChild(t),e}}X.registerComponent("TimeDivider",S_);class $o extends kr{constructor(e,t){super(e,t),this.on(e,"durationchange",i=>this.updateContent(i))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const e=super.createEl();return this.options_.displayNegative!==!1&&e.insertBefore(he("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e}updateContent(e){if(typeof this.player_.duration()!="number")return;let t;this.player_.ended()?t=0:this.player_.remainingTimeDisplay?t=this.player_.remainingTimeDisplay():t=this.player_.remainingTime(),this.updateTextNode_(t)}}$o.prototype.labelText_="Remaining Time";$o.prototype.controlText_="Remaining Time";X.registerComponent("RemainingTimeDisplay",$o);class E_ extends X{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",i=>this.updateShowing(i))}createEl(){const e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=he("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(he("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")}\xA0`})),this.contentEl_.appendChild(re.createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e}dispose(){this.contentEl_=null,super.dispose()}updateShowing(e){this.player().duration()===1/0?this.show():this.hide()}}X.registerComponent("LiveDisplay",E_);class qh extends it{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=i=>this.updateLiveEdgeStatus(i),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_))}createEl(){const e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.setIcon("circle",e),this.textEl_=he("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e}updateLiveEdgeStatus(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,super.dispose()}}qh.prototype.controlText_="Seek to live, currently playing live";X.registerComponent("SeekToLive",qh);function fs(r,e,t){return r=Number(r),Math.min(t,Math.max(e,isNaN(r)?e:r))}var C_=Object.freeze({__proto__:null,clamp:fs});class Ho extends X{constructor(e,t){super(e,t),this.handleMouseDown_=i=>this.handleMouseDown(i),this.handleMouseUp_=i=>this.handleMouseUp(i),this.handleKeyDown_=i=>this.handleKeyDown(i),this.handleClick_=i=>this.handleClick(i),this.handleMouseMove_=i=>this.handleMouseMove(i),this.update_=i=>this.update(i),this.bar=this.getChild(this.options_.barName),this.vertical(!!this.options_.vertical),this.enable()}enabled(){return this.enabled_}enable(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)}disable(){if(!this.enabled())return;const e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}createEl(e,t={},i={}){return t.className=t.className+" vjs-slider",t=Object.assign({tabIndex:0},t),i=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},i),super.createEl(e,t,i)}handleMouseDown(e){const t=this.bar.el_.ownerDocument;e.type==="mousedown"&&e.preventDefault(),e.type==="touchstart"&&!Yt&&e.preventDefault(),ph(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)}handleMouseMove(e){}handleMouseUp(e){const t=this.bar.el_.ownerDocument;mh(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(t,"mousemove",this.handleMouseMove_),this.off(t,"mouseup",this.handleMouseUp_),this.off(t,"touchmove",this.handleMouseMove_),this.off(t,"touchend",this.handleMouseUp_),this.update()}update(){if(!this.el_||!this.bar)return;const e=this.getProgress();return e===this.progress_||(this.progress_=e,this.requestNamedAnimationFrame("Slider#update",()=>{const t=this.vertical()?"height":"width";this.bar.el().style[t]=(e*100).toFixed(2)+"%"})),e}getProgress(){return Number(fs(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const t=jn(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){const t=this.options_.playerOptions.spatialNavigation,i=t&&t.enabled,s=t&&t.horizontalSeek;i?s&&e.key==="ArrowLeft"||!s&&e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):s&&e.key==="ArrowRight"||!s&&e.key==="ArrowUp"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(this.pendingSeekTime()&&(this.pendingSeekTime(null),this.userSeek_(this.player_.currentTime())),super.handleKeyDown(e)):e.key==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):e.key==="ArrowUp"||e.key==="ArrowRight"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e)}handleClick(e){e.stopPropagation(),e.preventDefault()}vertical(e){if(e===void 0)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")}}X.registerComponent("Slider",Ho);const Na=(r,e)=>fs(r/e*100,0,100).toFixed(2)+"%";class w_ extends X{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",i=>this.update(i))}createEl(){const e=super.createEl("div",{className:"vjs-load-progress"}),t=he("span",{className:"vjs-control-text"}),i=he("span",{textContent:this.localize("Loaded")}),s=re.createTextNode(": ");return this.percentageEl_=he("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(i),t.appendChild(s),t.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",()=>{const t=this.player_.liveTracker,i=this.player_.buffered(),s=t&&t.isLive()?t.seekableEnd():this.player_.duration(),n=this.player_.bufferedEnd(),a=this.partEls_,u=Na(n,s);this.percent_!==u&&(this.el_.style.width=u,Ci(this.percentageEl_,u),this.percent_=u);for(let c=0;c<i.length;c++){const m=i.start(c),f=i.end(c);let _=a[c];_||(_=this.el_.appendChild(he()),a[c]=_),!(_.dataset.start===m&&_.dataset.end===f)&&(_.dataset.start=m,_.dataset.end=f,_.style.left=Na(m,n),_.style.width=Na(f-m,n))}for(let c=a.length;c>i.length;c--)this.el_.removeChild(a[c-1]);a.length=i.length})}}X.registerComponent("LoadProgressBar",w_);class k_ extends X{constructor(e,t){super(e,t),this.update=Qt(De(this,this.update),It)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,i){const s=cs(this.el_),n=br(this.player_.el()),a=e.width*t;if(!n||!s)return;let u=e.left-n.left+a,c=e.width-a+(n.right-e.right);c||(c=e.width-a,u=a);let m=s.width/2;u<m?m+=m-u:c<m&&(m=c),m<0?m=0:m>s.width&&(m=s.width),m=Math.round(m),this.el_.style.right=`-${m}px`,this.write(i)}write(e){Ci(this.el_,e)}updateTime(e,t,i,s){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{let n;const a=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const u=this.player_.liveTracker.liveWindow(),c=u-t*u;n=(c<1?"":"-")+zi(c,u)}else n=zi(i,a);this.update(e,t,n),s&&s()})}}X.registerComponent("TimeTooltip",k_);class Vo extends X{constructor(e,t){super(e,t),this.setIcon("circle"),this.update=Qt(De(this,this.update),It)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t,i){const s=this.getChild("timeTooltip");if(!s)return;const n=i&&i.target&&typeof i.target.pendingSeekTime=="function"?i.target.pendingSeekTime():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();s.updateTime(e,t,n)}}Vo.prototype.options_={children:[]};!et&&!Bt&&Vo.prototype.options_.children.push("timeTooltip");X.registerComponent("PlayProgressBar",Vo);class $h extends X{constructor(e,t){super(e,t),this.update=Qt(De(this,this.update),It)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){const i=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,i,()=>{this.el_.style.left=`${e.width*t}px`})}}$h.prototype.options_={children:["timeTooltip"]};X.registerComponent("MouseTimeDisplay",$h);class Gn extends Ho{constructor(e,t){t=Ae(Gn.prototype.options_,t),t.children=[...t.children];const i=e.options_.disableSeekWhileScrubbingOnMobile&&(et||Bt)||e.options_.disableSeekWhileScrubbingOnSTV;(!et&&!Bt||i)&&t.children.splice(1,0,"mouseTimeDisplay"),super(e,t),this.shouldDisableSeekWhileScrubbing_=i,this.pendingSeekTime_=null,this.setEventHandlers_()}setEventHandlers_(){this.update_=De(this,this.update),this.update=Qt(this.update_,It),this.on(this.player_,["durationchange","timeupdate"],this.update),this.on(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=e=>this.enableInterval_(e),this.disableIntervalHandler_=e=>this.disableInterval_(e),this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in re&&"visibilityState"in re&&this.on(re,"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){re.visibilityState==="hidden"?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(!this.player_.ended()&&!this.player_.paused()&&this.enableInterval_(),this.update())}enableInterval_(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,It))}disableInterval_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&e.type!=="ended"||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(e){if(re.visibilityState==="hidden")return;const t=super.update();return this.requestNamedAnimationFrame("SeekBar#update",()=>{const i=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),s=this.player_.liveTracker;let n=this.player_.duration();s&&s.isLive()&&(n=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute("aria-valuenow",(t*100).toFixed(2)),this.percent_=t),(this.currentTime_!==i||this.duration_!==n)&&(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[zi(i,n),zi(n,n)],"{1} of {2}")),this.currentTime_=i,this.duration_=n),this.bar&&this.bar.update(br(this.el()),this.getProgress(),e)}),t}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}pendingSeekTime(e){if(e!==void 0)if(e!==null){const t=this.player_.duration();this.pendingSeekTime_=Math.max(0,Math.min(e,t))}else this.pendingSeekTime_=null;return this.pendingSeekTime_}getPercent(){if(this.pendingSeekTime()!==null)return this.pendingSeekTime()/this.player_.duration();const e=this.getCurrentTime_();let t;const i=this.player_.liveTracker;return i&&i.isLive()?(t=(e-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t}handleMouseDown(e){hs(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.shouldDisableSeekWhileScrubbing_||this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(!hs(e)||isNaN(this.player_.duration()))return;!t&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);let i;const s=this.calculateDistance(e),n=this.player_.liveTracker;if(!n||!n.isLive())i=s*this.player_.duration(),i===this.player_.duration()&&(i=i-.1);else{if(s>=.99){n.seekToLiveEdge();return}const a=n.seekableStart(),u=n.liveCurrentTime();if(i=a+s*n.liveWindow(),i>=u&&(i=u),i<=a&&(i=a+.1),i===1/0)return}this.shouldDisableSeekWhileScrubbing_?this.pendingSeekTime(i):this.userSeek_(i),this.player_.options_.enableSmoothSeeking&&this.update()}enable(){super.enable();const e=this.getChild("mouseTimeDisplay");e&&e.show()}disable(){super.disable();const e=this.getChild("mouseTimeDisplay");e&&e.hide()}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.pendingSeekTime()!==null&&(this.userSeek_(this.pendingSeekTime()),this.pendingSeekTime(null)),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?zt(this.player_.play()):this.update_()}handlePendingSeek_(e){this.player_.paused()||this.player_.pause();const t=this.pendingSeekTime()!==null?this.pendingSeekTime():this.player_.currentTime();this.pendingSeekTime(t+e),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}stepForward(){this.shouldDisableSeekWhileScrubbing_?this.handlePendingSeek_(this.options().stepSeconds):this.userSeek_(this.player_.currentTime()+this.options().stepSeconds)}stepBack(){this.shouldDisableSeekWhileScrubbing_?this.handlePendingSeek_(-this.options().stepSeconds):this.userSeek_(this.player_.currentTime()-this.options().stepSeconds)}handleAction(e){this.pendingSeekTime()!==null&&(this.userSeek_(this.pendingSeekTime()),this.pendingSeekTime(null)),this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){const t=this.player_.liveTracker;if(e.key===" "||e.key==="Enter")e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(e.key==="Home")e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(e.key==="End")e.preventDefault(),e.stopPropagation(),t&&t.isLive()?this.userSeek_(t.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(e.key)){e.preventDefault(),e.stopPropagation();const i=parseInt(e.key,10)*.1;t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*i):this.userSeek_(this.player_.duration()*i)}else e.key==="PageDown"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-this.options().stepSeconds*this.options().pageMultiplier)):e.key==="PageUp"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+this.options().stepSeconds*this.options().pageMultiplier)):super.handleKeyDown(e)}dispose(){this.disableInterval_(),this.off(this.player_,["durationchange","timeupdate"],this.update),this.off(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in re&&"visibilityState"in re&&this.off(re,"visibilitychange",this.toggleVisibility_),super.dispose()}}Gn.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar",stepSeconds:5,pageMultiplier:12};X.registerComponent("SeekBar",Gn);class Hh extends X{constructor(e,t){super(e,t),this.handleMouseMove=Qt(De(this,this.handleMouseMove),It),this.throttledHandleMouseSeek=Qt(De(this,this.handleMouseSeek),It),this.handleMouseUpHandler_=i=>this.handleMouseUp(i),this.handleMouseDownHandler_=i=>this.handleMouseDown(i),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){const t=this.getChild("seekBar");if(!t)return;const i=t.getChild("playProgressBar"),s=t.getChild("mouseTimeDisplay");if(!i&&!s)return;const n=t.el(),a=cs(n);let u=jn(n,e).x;u=fs(u,0,1),s&&s.update(a,u),i&&i.update(a,t.getProgress())}handleMouseSeek(e){const t=this.getChild("seekBar");t&&t.handleMouseMove(e)}enabled(){return this.enabled_}disable(){if(this.children().forEach(e=>e.disable&&e.disable()),!!this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,["mousemove","touchmove"],this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){const e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&zt(this.player_.play())}}enable(){this.children().forEach(e=>e.enable&&e.enable()),!this.enabled()&&(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,["mousemove","touchmove"],this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)}removeListenersAddedOnMousedownAndTouchstart(){const e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)}handleMouseDown(e){const t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}}Hh.prototype.options_={children:["seekBar"]};X.registerComponent("ProgressControl",Hh);class Vh extends it{constructor(e,t){super(e,t),this.setIcon("picture-in-picture-enter"),this.on(e,["enterpictureinpicture","leavepictureinpicture"],i=>this.handlePictureInPictureChange(i)),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],i=>this.handlePictureInPictureEnabledChange(i)),this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],()=>this.handlePictureInPictureAudioModeChange()),this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){if(!(this.player_.currentType().substring(0,5)==="audio"||this.player_.audioPosterMode()||this.player_.audioOnlyMode())){this.show();return}this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()}handlePictureInPictureEnabledChange(){re.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in A?this.enable():this.disable()}handlePictureInPictureChange(e){this.player_.isInPictureInPicture()?(this.setIcon("picture-in-picture-exit"),this.controlText("Exit Picture-in-Picture")):(this.setIcon("picture-in-picture-enter"),this.controlText("Picture-in-Picture")),this.handlePictureInPictureEnabledChange()}handleClick(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}show(){typeof re.exitPictureInPicture=="function"&&super.show()}}Vh.prototype.controlText_="Picture-in-Picture";X.registerComponent("PictureInPictureToggle",Vh);class zh extends it{constructor(e,t){super(e,t),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",i=>this.handleFullscreenChange(i)),re[e.fsApi_.fullscreenEnabled]===!1&&this.disable()}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){this.player_.isFullscreen()?(this.controlText("Exit Fullscreen"),this.setIcon("fullscreen-exit")):(this.controlText("Fullscreen"),this.setIcon("fullscreen-enter"))}handleClick(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}}zh.prototype.controlText_="Fullscreen";X.registerComponent("FullscreenToggle",zh);const A_=function(r,e){e.tech_&&!e.tech_.featuresVolumeControl&&r.addClass("vjs-hidden"),r.on(e,"loadstart",function(){e.tech_.featuresVolumeControl?r.removeClass("vjs-hidden"):r.addClass("vjs-hidden")})};class x_ extends X{createEl(){const e=super.createEl("div",{className:"vjs-volume-level"});return this.setIcon("circle",e),e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}}X.registerComponent("VolumeLevel",x_);class D_ extends X{constructor(e,t){super(e,t),this.update=Qt(De(this,this.update),It)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,i,s){if(!i){const n=br(this.el_),a=br(this.player_.el()),u=e.width*t;if(!a||!n)return;const c=e.left-a.left+u,m=e.width-u+(a.right-e.right);let f=n.width/2;c<f?f+=f-c:m<f&&(f=m),f<0?f=0:f>n.width&&(f=n.width),this.el_.style.right=`-${f}px`}this.write(`${s}%`)}write(e){Ci(this.el_,e)}updateVolume(e,t,i,s,n){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{this.update(e,t,i,s.toFixed(0)),n&&n()})}}X.registerComponent("VolumeLevelTooltip",D_);class Wh extends X{constructor(e,t){super(e,t),this.update=Qt(De(this,this.update),It)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,i){const s=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,i,s,()=>{i?this.el_.style.bottom=`${e.height*t}px`:this.el_.style.left=`${e.width*t}px`})}}Wh.prototype.options_={children:["volumeLevelTooltip"]};X.registerComponent("MouseVolumeLevelDisplay",Wh);class Xn extends Ho{constructor(e,t){super(e,t),this.on("slideractive",i=>this.updateLastVolume_(i)),this.on(e,"volumechange",i=>this.updateARIAAttributes(i)),e.ready(()=>this.updateARIAAttributes())}createEl(){return super.createEl("div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})}handleMouseDown(e){hs(e)&&super.handleMouseDown(e)}handleMouseMove(e){const t=this.getChild("mouseVolumeLevelDisplay");if(t){const i=this.el(),s=br(i),n=this.vertical();let a=jn(i,e);a=n?a.y:a.x,a=fs(a,0,1),t.update(s,a,n)}hs(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))}checkMuted(){this.player_.muted()&&this.player_.muted(!1)}getPercent(){return this.player_.muted()?0:this.player_.volume()}stepForward(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(e){const t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")}volumeAsPercentage_(){return Math.round(this.player_.volume()*100)}updateLastVolume_(){const e=this.player_.volume();this.one("sliderinactive",()=>{this.player_.volume()===0&&this.player_.lastVolume_(e)})}}Xn.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};!et&&!Bt&&Xn.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay");Xn.prototype.playerEvent="volumechange";X.registerComponent("VolumeBar",Xn);class Gh extends X{constructor(e,t={}){t.vertical=t.vertical||!1,(typeof t.volumeBar>"u"||yr(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),A_(this,e),this.throttledHandleMouseMove=Qt(De(this,this.handleMouseMove),It),this.handleMouseUpHandler_=i=>this.handleMouseUp(i),this.on("mousedown",i=>this.handleMouseDown(i)),this.on("touchstart",i=>this.handleMouseDown(i)),this.on("mousemove",i=>this.handleMouseMove(i)),this.on(this.volumeBar,["focus","slideractive"],()=>{this.volumeBar.addClass("vjs-slider-active"),this.addClass("vjs-slider-active"),this.trigger("slideractive")}),this.on(this.volumeBar,["blur","sliderinactive"],()=>{this.volumeBar.removeClass("vjs-slider-active"),this.removeClass("vjs-slider-active"),this.trigger("sliderinactive")})}createEl(){let e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),super.createEl("div",{className:`vjs-volume-control vjs-control ${e}`})}handleMouseDown(e){const t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)}handleMouseMove(e){this.volumeBar.handleMouseMove(e)}}Gh.prototype.options_={children:["volumeBar"]};X.registerComponent("VolumeControl",Gh);const I_=function(r,e){e.tech_&&!e.tech_.featuresMuteControl&&r.addClass("vjs-hidden"),r.on(e,"loadstart",function(){e.tech_.featuresMuteControl?r.removeClass("vjs-hidden"):r.addClass("vjs-hidden")})};class Xh extends it{constructor(e,t){super(e,t),I_(this,e),this.on(e,["loadstart","volumechange"],i=>this.update(i))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.volume(),i=this.player_.lastVolume_();if(t===0){const s=i<.1?.1:i;this.player_.volume(s),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())}update(e){this.updateIcon_(),this.updateControlText_()}updateIcon_(){const e=this.player_.volume();let t=3;this.setIcon("volume-high"),et&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),e===0||this.player_.muted()?(this.setIcon("volume-mute"),t=0):e<.33?(this.setIcon("volume-low"),t=1):e<.67&&(this.setIcon("volume-medium"),t=2),Un(this.el_,[0,1,2,3].reduce((i,s)=>i+`${s?" ":""}vjs-vol-${s}`,"")),qi(this.el_,`vjs-vol-${t}`)}updateControlText_(){const e=this.player_.muted()||this.player_.volume()===0?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)}}Xh.prototype.controlText_="Mute";X.registerComponent("MuteToggle",Xh);class Kh extends X{constructor(e,t={}){typeof t.inline<"u"?t.inline=t.inline:t.inline=!0,(typeof t.volumeControl>"u"||yr(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=i=>this.handleKeyPress(i),this.on(e,["loadstart"],i=>this.volumePanelState_(i)),this.on(this.muteToggle,"keyup",i=>this.handleKeyPress(i)),this.on(this.volumeControl,"keyup",i=>this.handleVolumeControlKeyUp(i)),this.on("keydown",i=>this.handleKeyPress(i)),this.on("mouseover",i=>this.handleMouseOver(i)),this.on("mouseout",i=>this.handleMouseOut(i)),this.on(this.volumeControl,["slideractive"],this.sliderActive_),this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_)}sliderActive_(){this.addClass("vjs-slider-active")}sliderInactive_(){this.removeClass("vjs-slider-active")}volumePanelState_(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")}createEl(){let e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),super.createEl("div",{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut(),super.dispose()}handleVolumeControlKeyUp(e){e.key==="Escape"&&this.muteToggle.focus()}handleMouseOver(e){this.addClass("vjs-hover"),bt(re,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),tt(re,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){e.key==="Escape"&&this.handleMouseOut()}}Kh.prototype.options_={children:["muteToggle","volumeControl"]};X.registerComponent("VolumePanel",Kh);class Yh extends it{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipForwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`forward-${this.skipTime}`),this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipForwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(e){if(isNaN(this.player_.duration()))return;const t=this.player_.currentTime(),i=this.player_.liveTracker,s=i&&i.isLive()?i.seekableEnd():this.player_.duration();let n;t+this.skipTime<=s?n=t+this.skipTime:n=s,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}Yh.prototype.controlText_="Skip Forward";X.registerComponent("SkipForward",Yh);class Qh extends it{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipBackwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`replay-${this.skipTime}`),this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipBackwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.currentTime(),i=this.player_.liveTracker,s=i&&i.isLive()&&i.seekableStart();let n;s&&t-this.skipTime<=s?n=s:t>=this.skipTime?n=t-this.skipTime:n=0,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}Qh.prototype.controlText_="Skip Backward";X.registerComponent("SkipBackward",Qh);class Jh extends X{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on("keydown",i=>this.handleKeyDown(i)),this.boundHandleBlur_=i=>this.handleBlur(i),this.boundHandleTapClick_=i=>this.handleTapClick(i)}addEventListenerForItem(e){e instanceof X&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof X&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))}removeChild(e){typeof e=="string"&&(e=this.getChild(e)),this.removeEventListenerForItem(e),super.removeChild(e)}addItem(e){const t=this.addChild(e);t&&this.addEventListenerForItem(t)}createEl(){const e=this.options_.contentElType||"ul";this.contentEl_=he(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");const t=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),bt(t,"click",function(i){i.preventDefault(),i.stopImmediatePropagation()}),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){const t=e.relatedTarget||re.activeElement;if(!this.children().some(i=>i.el()===t)){const i=this.menuButton_;i&&i.buttonPressed_&&t!==i.el().firstChild&&i.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();const t=this.children();if(!Array.isArray(t))return;const i=t.filter(s=>s.el()===e.target)[0];if(!i)return;i.name()!=="CaptionSettingsMenuItem"&&this.menuButton_.focus()}}handleKeyDown(e){e.key==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(e.key==="ArrowRight"||e.key==="ArrowUp")&&(e.preventDefault(),e.stopPropagation(),this.stepBack())}stepForward(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_+1),this.focus(e)}stepBack(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_-1),this.focus(e)}focus(e=0){const t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())}}X.registerComponent("Menu",Jh);class zo extends X{constructor(e,t={}){super(e,t),this.menuButton_=new it(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");const i=it.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+i,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;const s=n=>this.handleClick(n);this.handleMenuKeyUp_=n=>this.handleMenuKeyUp(n),this.on(this.menuButton_,"tap",s),this.on(this.menuButton_,"click",s),this.on(this.menuButton_,"keydown",n=>this.handleKeyDown(n)),this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover"),this.menu.show(),bt(re,"keyup",this.handleMenuKeyUp_)}),this.on("mouseleave",n=>this.handleMouseLeave(n)),this.on("keydown",n=>this.handleSubmenuKeyDown(n))}update(){const e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))}createMenu(){const e=new Jh(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const t=he("li",{className:"vjs-menu-title",textContent:Fe(this.options_.title),tabIndex:-1}),i=new X(this.player_,{el:t});e.addItem(i)}if(this.items=this.createItems(),this.items)for(let t=0;t<this.items.length;t++)e.addItem(this.items[t]);return e}createItems(){}createEl(){return super.createEl("div",{className:this.buildWrapperCSSClass()},{})}setIcon(e){super.setIcon(e,this.menuButton_.el_)}buildWrapperCSSClass(){let e="vjs-menu-button";this.options_.inline===!0?e+="-inline":e+="-popup";const t=it.prototype.buildCSSClass();return`vjs-menu-button ${e} ${t} ${super.buildCSSClass()}`}buildCSSClass(){let e="vjs-menu-button";return this.options_.inline===!0?e+="-inline":e+="-popup",`vjs-menu-button ${e} ${super.buildCSSClass()}`}controlText(e,t=this.menuButton_.el()){return this.menuButton_.controlText(e,t)}dispose(){this.handleMouseLeave(),super.dispose()}handleClick(e){this.buttonPressed_?this.unpressButton():this.pressButton()}handleMouseLeave(e){this.removeClass("vjs-hover"),tt(re,"keyup",this.handleMenuKeyUp_)}focus(){this.menuButton_.focus()}blur(){this.menuButton_.blur()}handleKeyDown(e){e.key==="Escape"||e.key==="Tab"?(this.buttonPressed_&&this.unpressButton(),!e.key==="Tab"&&(e.preventDefault(),this.menuButton_.focus())):(e.key==="Up"||e.key==="Down"&&!(this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled))&&(this.buttonPressed_||(e.preventDefault(),this.pressButton()))}handleMenuKeyUp(e){(e.key==="Escape"||e.key==="Tab")&&this.removeClass("vjs-hover")}handleSubmenuKeyPress(e){this.handleSubmenuKeyDown(e)}handleSubmenuKeyDown(e){(e.key==="Escape"||e.key==="Tab")&&(this.buttonPressed_&&this.unpressButton(),!e.key==="Tab"&&(e.preventDefault(),this.menuButton_.focus()))}pressButton(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),et&&uh())return;this.menu.focus()}}unpressButton(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))}disable(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()}enable(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()}}X.registerComponent("MenuButton",zo);class Wo extends zo{constructor(e,t){const i=t.tracks;if(super(e,t),this.items.length<=1&&this.hide(),!i)return;const s=De(this,this.update);i.addEventListener("removetrack",s),i.addEventListener("addtrack",s),i.addEventListener("labelchange",s),this.player_.on("ready",s),this.player_.on("dispose",function(){i.removeEventListener("removetrack",s),i.removeEventListener("addtrack",s),i.removeEventListener("labelchange",s)})}}X.registerComponent("TrackButton",Wo);class ys extends Wn{constructor(e,t){super(e,t),this.selectable=t.selectable,this.isSelected_=t.selected||!1,this.multiSelectable=t.multiSelectable,this.selected(this.isSelected_),this.selectable?this.multiSelectable?this.el_.setAttribute("role","menuitemcheckbox"):this.el_.setAttribute("role","menuitemradio"):this.el_.setAttribute("role","menuitem")}createEl(e,t,i){this.nonIconControl=!0;const s=super.createEl("li",Object.assign({className:"vjs-menu-item",tabIndex:-1},t),i),n=he("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)});return this.player_.options_.experimentalSvgIcons?s.appendChild(n):s.replaceChild(n,s.querySelector(".vjs-icon-placeholder")),s}handleKeyDown(e){["Tab","Escape","ArrowUp","ArrowLeft","ArrowRight","ArrowDown"].includes(e.key)||super.handleKeyDown(e)}handleClick(e){this.selected(!0)}selected(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))}}X.registerComponent("MenuItem",ys);class _s extends ys{constructor(e,t){const i=t.track,s=e.textTracks();t.label=i.label||i.language||"Unknown",t.selected=i.mode==="showing",super(e,t),this.track=i,this.kinds=(t.kinds||[t.kind||this.track.kind]).filter(Boolean);const n=(...u)=>{this.handleTracksChange.apply(this,u)},a=(...u)=>{this.handleSelectedLanguageChange.apply(this,u)};if(e.on(["loadstart","texttrackchange"],n),s.addEventListener("change",n),s.addEventListener("selectedlanguagechange",a),this.on("dispose",function(){e.off(["loadstart","texttrackchange"],n),s.removeEventListener("change",n),s.removeEventListener("selectedlanguagechange",a)}),s.onchange===void 0){let u;this.on(["tap","click"],function(){if(typeof A.Event!="object")try{u=new A.Event("change")}catch{}u||(u=re.createEvent("Event"),u.initEvent("change",!0,!0)),s.dispatchEvent(u)})}this.handleTracksChange()}handleClick(e){const t=this.track,i=this.player_.textTracks();if(super.handleClick(e),!!i)for(let s=0;s<i.length;s++){const n=i[s];this.kinds.indexOf(n.kind)!==-1&&(n===t?n.mode!=="showing"&&(n.mode="showing"):n.mode!=="disabled"&&(n.mode="disabled"))}}handleTracksChange(e){const t=this.track.mode==="showing";t!==this.isSelected_&&this.selected(t)}handleSelectedLanguageChange(e){if(this.track.mode==="showing"){const t=this.player_.cache_.selectedLanguage;if(t&&t.enabled&&t.language===this.track.language&&t.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}}dispose(){this.track=null,super.dispose()}}X.registerComponent("TextTrackMenuItem",_s);class Zh extends _s{constructor(e,t){t.track={player:e,kind:t.kind,kinds:t.kinds,default:!1,mode:"disabled"},t.kinds||(t.kinds=[t.kind]),t.label?t.track.label=t.label:t.track.label=t.kinds.join(" and ")+" off",t.selectable=!0,t.multiSelectable=!1,super(e,t)}handleTracksChange(e){const t=this.player().textTracks();let i=!0;for(let s=0,n=t.length;s<n;s++){const a=t[s];if(this.options_.kinds.indexOf(a.kind)>-1&&a.mode==="showing"){i=!1;break}}i!==this.isSelected_&&this.selected(i)}handleSelectedLanguageChange(e){const t=this.player().textTracks();let i=!0;for(let s=0,n=t.length;s<n;s++){const a=t[s];if(["captions","descriptions","subtitles"].indexOf(a.kind)>-1&&a.mode==="showing"){i=!1;break}}i&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}}X.registerComponent("OffTextTrackMenuItem",Zh);class Ar extends Wo{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=_s){let i;this.label_&&(i=`${this.label_} off`),e.push(new Zh(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;const s=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let n=0;n<s.length;n++){const a=s[n];if(this.kinds_.indexOf(a.kind)>-1){const u=new t(this.player_,{track:a,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});u.addClass(`vjs-${a.kind}-menu-item`),e.push(u)}}return e}}X.registerComponent("TextTrackButton",Ar);class ed extends ys{constructor(e,t){const i=t.track,s=t.cue,n=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=s.text,t.selected=s.startTime<=n&&n<s.endTime,super(e,t),this.track=i,this.cue=s}handleClick(e){super.handleClick(),this.player_.currentTime(this.cue.startTime)}}X.registerComponent("ChaptersTrackMenuItem",ed);class Go extends Ar{constructor(e,t,i){super(e,t,i),this.setIcon("chapters"),this.selectCurrentItem_=()=>{this.items.forEach(s=>{s.selected(this.track_.activeCues[0]===s.cue)})}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(e){if(e&&e.track&&e.track.kind!=="chapters")return;const t=this.findChaptersTrack();t!==this.track_?(this.setTrack(t),super.update()):(!this.items||t&&t.cues&&t.cues.length!==this.items.length)&&super.update()}setTrack(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}}findChaptersTrack(){const e=this.player_.textTracks()||[];for(let t=e.length-1;t>=0;t--){const i=e[t];if(i.kind===this.kind_)return i}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(Fe(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){const e=[];if(!this.track_)return e;const t=this.track_.cues;if(!t)return e;for(let i=0,s=t.length;i<s;i++){const n=t[i],a=new ed(this.player_,{track:this.track_,cue:n});e.push(a)}return e}}Go.prototype.kind_="chapters";Go.prototype.controlText_="Chapters";X.registerComponent("ChaptersButton",Go);class Xo extends Ar{constructor(e,t,i){super(e,t,i),this.setIcon("audio-description");const s=e.textTracks(),n=De(this,this.handleTracksChange);s.addEventListener("change",n),this.on("dispose",function(){s.removeEventListener("change",n)})}handleTracksChange(e){const t=this.player().textTracks();let i=!1;for(let s=0,n=t.length;s<n;s++){const a=t[s];if(a.kind!==this.kind_&&a.mode==="showing"){i=!0;break}}i?this.disable():this.enable()}buildCSSClass(){return`vjs-descriptions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-descriptions-button ${super.buildWrapperCSSClass()}`}}Xo.prototype.kind_="descriptions";Xo.prototype.controlText_="Descriptions";X.registerComponent("DescriptionsButton",Xo);class Ko extends Ar{constructor(e,t,i){super(e,t,i),this.setIcon("subtitles")}buildCSSClass(){return`vjs-subtitles-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subtitles-button ${super.buildWrapperCSSClass()}`}}Ko.prototype.kind_="subtitles";Ko.prototype.controlText_="Subtitles";X.registerComponent("SubtitlesButton",Ko);class Yo extends _s{constructor(e,t){t.track={player:e,kind:t.kind,label:t.kind+" settings",selectable:!1,default:!1,mode:"disabled"},t.selectable=!1,t.name="CaptionSettingsMenuItem",super(e,t),this.addClass("vjs-texttrack-settings"),this.controlText(", opens "+t.kind+" settings dialog")}handleClick(e){this.player().getChild("textTrackSettings").open()}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.kind+" settings"),super.handleLanguagechange()}}X.registerComponent("CaptionSettingsMenuItem",Yo);class Qo extends Ar{constructor(e,t,i){super(e,t,i),this.setIcon("captions")}buildCSSClass(){return`vjs-captions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-captions-button ${super.buildWrapperCSSClass()}`}createItems(){const e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new Yo(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),super.createItems(e)}}Qo.prototype.kind_="captions";Qo.prototype.controlText_="Captions";X.registerComponent("CaptionsButton",Qo);class td extends _s{createEl(e,t,i){const s=super.createEl(e,t,i),n=s.querySelector(".vjs-menu-item-text");return this.options_.track.kind==="captions"&&(this.player_.options_.experimentalSvgIcons?this.setIcon("captions",s):n.appendChild(he("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(he("span",{className:"vjs-control-text",textContent:` ${this.localize("Captions")}`}))),s}}X.registerComponent("SubsCapsMenuItem",td);class Jo extends Ar{constructor(e,t={}){super(e,t),this.label_="subtitles",this.setIcon("subtitles"),["en","en-us","en-ca","fr-ca"].indexOf(this.player_.language_)>-1&&(this.label_="captions",this.setIcon("captions")),this.menuButton_.controlText(Fe(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new Yo(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,td),e}}Jo.prototype.kinds_=["captions","subtitles"];Jo.prototype.controlText_="Subtitles";X.registerComponent("SubsCapsButton",Jo);class id extends ys{constructor(e,t){const i=t.track,s=e.audioTracks();t.label=i.label||i.language||"Unknown",t.selected=i.enabled,super(e,t),this.track=i,this.addClass(`vjs-${i.kind}-menu-item`);const n=(...a)=>{this.handleTracksChange.apply(this,a)};s.addEventListener("change",n),this.on("dispose",()=>{s.removeEventListener("change",n)})}createEl(e,t,i){const s=super.createEl(e,t,i),n=s.querySelector(".vjs-menu-item-text");return["main-desc","descriptions"].indexOf(this.options_.track.kind)>=0&&(n.appendChild(he("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(he("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),s}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){const t=this.player_.audioTracks();for(let i=0;i<t.length;i++){const s=t[i];s!==this.track&&(s.enabled=s===this.track)}}}handleTracksChange(e){this.selected(this.track.enabled)}}X.registerComponent("AudioTrackMenuItem",id);class rd extends Wo{constructor(e,t={}){t.tracks=e.audioTracks(),super(e,t),this.setIcon("audio")}buildCSSClass(){return`vjs-audio-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-audio-button ${super.buildWrapperCSSClass()}`}createItems(e=[]){this.hideThreshold_=1;const t=this.player_.audioTracks();for(let i=0;i<t.length;i++){const s=t[i];e.push(new id(this.player_,{track:s,selectable:!0,multiSelectable:!1}))}return e}}rd.prototype.controlText_="Audio Track";X.registerComponent("AudioTrackButton",rd);class Zo extends ys{constructor(e,t){const i=t.rate,s=parseFloat(i,10);t.label=i,t.selected=s===e.playbackRate(),t.selectable=!0,t.multiSelectable=!1,super(e,t),this.label=i,this.rate=s,this.on(e,"ratechange",n=>this.update(n))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}}Zo.prototype.contentElType="button";X.registerComponent("PlaybackRateMenuItem",Zo);class sd extends zo{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",i=>this.updateVisibility(i)),this.on(e,"ratechange",i=>this.updateLabel(i)),this.on(e,"playbackrateschange",i=>this.handlePlaybackRateschange(i))}createEl(){const e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=he("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e}dispose(){this.labelEl_=null,super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){const e=this.playbackRates(),t=[];for(let i=e.length-1;i>=0;i--)t.push(new Zo(this.player(),{rate:e[i]+"x"}));return t}handlePlaybackRateschange(e){this.update()}playbackRates(){const e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}updateLabel(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")}}sd.prototype.controlText_="Playback Rate";X.registerComponent("PlaybackRateMenuButton",sd);class nd extends X{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",t={},i={}){return t.className||(t.className=this.buildCSSClass()),super.createEl(e,t,i)}}X.registerComponent("Spacer",nd);class P_ extends nd{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:"\xA0"})}}X.registerComponent("CustomControlSpacer",P_);class ad extends X{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}ad.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]};X.registerComponent("ControlBar",ad);class od extends wr{constructor(e,t){super(e,t),this.on(e,"error",i=>{this.open(i)})}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const e=this.player().error();return e?this.localize(e.message):""}}od.prototype.options_=Object.assign({},wr.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0});X.registerComponent("ErrorDisplay",od);class ud extends X{constructor(e,t={}){super(e,t),this.el_.setAttribute("aria-labelledby",this.selectLabelledbyIds)}createEl(){return this.selectLabelledbyIds=[this.options_.legendId,this.options_.labelId].join(" ").trim(),he("select",{id:this.options_.id},{},this.options_.SelectOptions.map(e=>{const t=(this.options_.labelId?this.options_.labelId:`vjs-track-option-${Dt()}`)+"-"+e[1].replace(/\W+/g,""),i=he("option",{id:t,value:this.localize(e[0]),textContent:this.localize(e[1])});return i.setAttribute("aria-labelledby",`${this.selectLabelledbyIds} ${t}`),i}))}}X.registerComponent("TextTrackSelect",ud);class Hi extends X{constructor(e,t={}){super(e,t);const i=he("legend",{textContent:this.localize(this.options_.legendText),id:this.options_.legendId});this.el().appendChild(i);const s=this.options_.selects;for(const n of s){const a=this.options_.selectConfigs[n],u=a.className,c=a.id.replace("%s",this.options_.id_);let m=null;const f=`vjs_select_${Dt()}`;if(this.options_.type==="colors"){m=he("span",{className:u});const P=he("label",{id:c,className:"vjs-label",textContent:this.localize(a.label)});P.setAttribute("for",f),m.appendChild(P)}const _=new ud(e,{SelectOptions:a.options,legendId:this.options_.legendId,id:f,labelId:c});this.addChild(_),this.options_.type==="colors"&&(m.appendChild(_.el()),this.el().appendChild(m))}}createEl(){return he("fieldset",{className:this.options_.className})}}X.registerComponent("TextTrackFieldset",Hi);class ld extends X{constructor(e,t={}){super(e,t);const i=this.options_.textTrackComponentid,s=new Hi(e,{id_:i,legendId:`captions-text-legend-${i}`,legendText:this.localize("Text"),className:"vjs-fg vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(s);const n=new Hi(e,{id_:i,legendId:`captions-background-${i}`,legendText:this.localize("Text Background"),className:"vjs-bg vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(n);const a=new Hi(e,{id_:i,legendId:`captions-window-${i}`,legendText:this.localize("Caption Area Background"),className:"vjs-window vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(a)}createEl(){return he("div",{className:"vjs-track-settings-colors"})}}X.registerComponent("TextTrackSettingsColors",ld);class cd extends X{constructor(e,t={}){super(e,t);const i=this.options_.textTrackComponentid,s=new Hi(e,{id_:i,legendId:`captions-font-size-${i}`,legendText:"Font Size",className:"vjs-font-percent vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(s);const n=new Hi(e,{id_:i,legendId:`captions-edge-style-${i}`,legendText:this.localize("Text Edge Style"),className:"vjs-edge-style vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(n);const a=new Hi(e,{id_:i,legendId:`captions-font-family-${i}`,legendText:this.localize("Font Family"),className:"vjs-font-family vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(a)}createEl(){return he("div",{className:"vjs-track-settings-font"})}}X.registerComponent("TextTrackSettingsFont",cd);class hd extends X{constructor(e,t={}){super(e,t);const i=new it(e,{controlText:this.localize("restore all settings to the default values"),className:"vjs-default-button"});i.el().classList.remove("vjs-control","vjs-button"),i.el().textContent=this.localize("Reset"),this.addChild(i);const s=this.localize("Done"),n=new it(e,{controlText:s,className:"vjs-done-button"});n.el().classList.remove("vjs-control","vjs-button"),n.el().textContent=s,this.addChild(n)}createEl(){return he("div",{className:"vjs-track-settings-controls"})}}X.registerComponent("TrackSettingsControls",hd);const Ra="vjs-text-track-settings",Jl=["#000","Black"],Zl=["#00F","Blue"],ec=["#0FF","Cyan"],tc=["#0F0","Green"],ic=["#F0F","Magenta"],rc=["#F00","Red"],sc=["#FFF","White"],nc=["#FF0","Yellow"],Ma=["1","Opaque"],Ba=["0.5","Semi-Transparent"],ac=["0","Transparent"],vi={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Jl,sc,rc,tc,Zl,nc,ic,ec],className:"vjs-bg-color"},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[Ma,Ba,ac],className:"vjs-bg-opacity vjs-opacity"},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[sc,Jl,rc,tc,Zl,nc,ic,ec],className:"vjs-text-color"},edgeStyle:{selector:".vjs-edge-style > select",id:"",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:r=>r==="1.00"?null:Number(r)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[Ma,Ba],className:"vjs-text-opacity vjs-opacity"},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color",className:"vjs-window-color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[ac,Ba,Ma],className:"vjs-window-opacity vjs-opacity"}};vi.windowColor.options=vi.backgroundColor.options;function dd(r,e){if(e&&(r=e(r)),r&&r!=="none")return r}function L_(r,e){const t=r.options[r.options.selectedIndex].value;return dd(t,e)}function O_(r,e,t){if(e){for(let i=0;i<r.options.length;i++)if(dd(r.options[i].value,t)===e){r.selectedIndex=i;break}}}class N_ extends wr{constructor(e,t){t.temporary=!1,super(e,t),this.updateDisplay=this.updateDisplay.bind(this),this.fill(),this.hasBeenOpened_=this.hasBeenFilled_=!0,this.renderModalComponents(e),this.endDialog=he("p",{className:"vjs-control-text",textContent:this.localize("End of dialog window.")}),this.el().appendChild(this.endDialog),this.setDefaults(),t.persistTextTrackSettings===void 0&&(this.options_.persistTextTrackSettings=this.options_.playerOptions.persistTextTrackSettings),this.bindFunctionsToSelectsAndButtons(),this.options_.persistTextTrackSettings&&this.restoreSettings()}renderModalComponents(e){const t=new ld(e,{textTrackComponentid:this.id_,selectConfigs:vi,fieldSets:[["color","textOpacity"],["backgroundColor","backgroundOpacity"],["windowColor","windowOpacity"]]});this.addChild(t);const i=new cd(e,{textTrackComponentid:this.id_,selectConfigs:vi,fieldSets:[["fontPercent"],["edgeStyle"],["fontFamily"]]});this.addChild(i);const s=new hd(e);this.addChild(s)}bindFunctionsToSelectsAndButtons(){this.on(this.$(".vjs-done-button"),["click","tap"],()=>{this.saveSettings(),this.close()}),this.on(this.$(".vjs-default-button"),["click","tap"],()=>{this.setDefaults(),this.updateDisplay()}),sr(vi,e=>{this.on(this.$(e.selector),"change",this.updateDisplay)})}dispose(){this.endDialog=null,super.dispose()}label(){return this.localize("Caption Settings Dialog")}description(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")}buildCSSClass(){return super.buildCSSClass()+" vjs-text-track-settings"}getValues(){return th(vi,(e,t,i)=>{const s=L_(this.$(t.selector),t.parser);return s!==void 0&&(e[i]=s),e},{})}setValues(e){sr(vi,(t,i)=>{O_(this.$(t.selector),e[i],t.parser)})}setDefaults(){sr(vi,e=>{const t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(A.localStorage.getItem(Ra))}catch(t){be.warn(t)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;const e=this.getValues();try{Object.keys(e).length?A.localStorage.setItem(Ra,JSON.stringify(e)):A.localStorage.removeItem(Ra)}catch(t){be.warn(t)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}handleLanguagechange(){this.fill(),this.renderModalComponents(this.player_),this.bindFunctionsToSelectsAndButtons()}}X.registerComponent("TextTrackSettings",N_);class R_ extends X{constructor(e,t){let i=t.ResizeObserver||A.ResizeObserver;t.ResizeObserver===null&&(i=!1);const s=Ae({createEl:!i,reportTouchActivity:!1},t);super(e,s),this.ResizeObserver=t.ResizeObserver||A.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=Ch(()=>{this.resizeHandler()},100,!1,this),i?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;const n=this.debouncedHandler_;let a=this.unloadListener_=function(){tt(this,"resize",n),tt(this,"unload",a),a=null};bt(this.el_.contentWindow,"unload",a),bt(this.el_.contentWindow,"resize",n)},this.one("load",this.loadListener_))}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){!this.player_||!this.player_.trigger||this.player_.trigger("playerresize")}dispose(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,super.dispose()}}X.registerComponent("ResizeManager",R_);const M_={trackingThreshold:20,liveTolerance:15};class B_ extends X{constructor(e,t){const i=Ae(M_,t,{createEl:!1});super(e,i),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=s=>this.handlePlay(s),this.handleFirstTimeupdate_=s=>this.handleFirstTimeupdate(s),this.handleSeeked_=s=>this.handleSeeked(s),this.seekToLiveEdge_=s=>this.seekToLiveEdge(s),this.reset_(),this.on(this.player_,"durationchange",s=>this.handleDurationchange(s)),this.on(this.player_,"canplay",()=>this.toggleTracking())}trackLive_(){const e=this.player_.seekable();if(!e||!e.length)return;const t=Number(A.performance.now().toFixed(4)),i=this.lastTime_===-1?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+i;const s=this.liveCurrentTime(),n=this.player_.currentTime();let a=this.player_.paused()||this.seekedBehindLive_||Math.abs(s-n)>this.options_.liveTolerance;(!this.timeupdateSeen_||s===1/0)&&(a=!1),a!==this.behindLiveEdge_&&(this.behindLiveEdge_=a,this.trigger("liveedgechange"))}handleDurationchange(){this.toggleTracking()}toggleTracking(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())}startTracking(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,It),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))}handleFirstTimeupdate(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){const e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_=!0}stopTracking(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))}seekableEnd(){const e=this.player_.seekable(),t=[];let i=e?e.length:0;for(;i--;)t.push(e.end(i));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){const e=this.player_.seekable(),t=[];let i=e?e.length:0;for(;i--;)t.push(e.start(i));return t.length?t.sort()[0]:0}liveWindow(){const e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){const e=this.seekableEnd();return this.lastSeekEnd_!==-1&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return typeof this.trackingInterval_=="number"}seekToLiveEdge(){this.seekedBehindLive_=!1,!this.atLiveEdge()&&(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}dispose(){this.stopTracking(),super.dispose()}}X.registerComponent("LiveTracker",B_);class U_ extends X{constructor(e,t){super(e,t),this.on("statechanged",i=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:he("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${Dt()}`}),description:he("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${Dt()}`})},he("div",{className:"vjs-title-bar"},{},ih(this.els))}updateDom_(){const e=this.player_.tech_,t=e&&e.el_,i={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach(s=>{const n=this.state[s],a=this.els[s],u=i[s];qn(a),n&&Ci(a,n),t&&(t.removeAttribute(u),n&&t.setAttribute(u,a.id))}),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){const e=this.player_.tech_,t=e&&e.el_;t&&(t.removeAttribute("aria-labelledby"),t.removeAttribute("aria-describedby")),super.dispose(),this.els=null}}X.registerComponent("TitleBar",U_);const F_={initialDisplay:4e3,position:[],takeFocus:!1};class j_ extends it{constructor(e,t){t=Ae(F_,t),super(e,t),this.controlText(t.controlText),this.hide(),this.on(this.player_,["useractive","userinactive"],i=>{this.removeClass("force-display")})}buildCSSClass(){return`vjs-transient-button focus-visible ${this.options_.position.map(e=>`vjs-${e}`).join(" ")}`}createEl(){const e=he("button",{},{type:"button",class:this.buildCSSClass()},he("span"));return this.controlTextEl_=e.querySelector("span"),e}show(){super.show(),this.addClass("force-display"),this.options_.takeFocus&&this.el().focus({preventScroll:!0}),this.forceDisplayTimeout=this.player_.setTimeout(()=>{this.removeClass("force-display")},this.options_.initialDisplay)}hide(){this.removeClass("force-display"),super.hide()}dispose(){this.player_.clearTimeout(this.forceDisplayTimeout),super.dispose()}}X.registerComponent("TransientButton",j_);const ao=r=>{const e=r.el();if(e.hasAttribute("src"))return r.triggerSourceset(e.src),!0;const t=r.$$("source"),i=[];let s="";if(!t.length)return!1;for(let n=0;n<t.length;n++){const a=t[n].src;a&&i.indexOf(a)===-1&&i.push(a)}return i.length?(i.length===1&&(s=i[0]),r.triggerSourceset(s),!0):!1},q_=Object.defineProperty({},"innerHTML",{get(){return this.cloneNode(!0).innerHTML},set(r){const e=re.createElement(this.nodeName.toLowerCase());e.innerHTML=r;const t=re.createDocumentFragment();for(;e.childNodes.length;)t.appendChild(e.childNodes[0]);return this.innerText="",A.Element.prototype.appendChild.call(this,t),this.innerHTML}}),pd=(r,e)=>{let t={};for(let i=0;i<r.length&&(t=Object.getOwnPropertyDescriptor(r[i],e),!(t&&t.set&&t.get));i++);return t.enumerable=!0,t.configurable=!0,t},$_=r=>pd([r.el(),A.HTMLMediaElement.prototype,A.Element.prototype,q_],"innerHTML"),oc=function(r){const e=r.el();if(e.resetSourceWatch_)return;const t={},i=$_(r),s=n=>(...a)=>{const u=n.apply(e,a);return ao(r),u};["append","appendChild","insertAdjacentHTML"].forEach(n=>{e[n]&&(t[n]=e[n],e[n]=s(t[n]))}),Object.defineProperty(e,"innerHTML",Ae(i,{set:s(i.set)})),e.resetSourceWatch_=()=>{e.resetSourceWatch_=null,Object.keys(t).forEach(n=>{e[n]=t[n]}),Object.defineProperty(e,"innerHTML",i)},r.one("sourceset",e.resetSourceWatch_)},H_=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?Rh(A.Element.prototype.getAttribute.call(this,"src")):""},set(r){return A.Element.prototype.setAttribute.call(this,"src",r),r}}),V_=r=>pd([r.el(),A.HTMLMediaElement.prototype,H_],"src"),z_=function(r){if(!r.featuresSourceset)return;const e=r.el();if(e.resetSourceset_)return;const t=V_(r),i=e.setAttribute,s=e.load;Object.defineProperty(e,"src",Ae(t,{set:n=>{const a=t.set.call(e,n);return r.triggerSourceset(e.src),a}})),e.setAttribute=(n,a)=>{const u=i.call(e,n,a);return/src/i.test(n)&&r.triggerSourceset(e.src),u},e.load=()=>{const n=s.call(e);return ao(r)||(r.triggerSourceset(""),oc(r)),n},e.currentSrc?r.triggerSourceset(e.currentSrc):ao(r)||oc(r),e.resetSourceset_=()=>{e.resetSourceset_=null,e.load=s,e.setAttribute=i,Object.defineProperty(e,"src",t),e.resetSourceWatch_&&e.resetSourceWatch_()}};class oe extends ge{constructor(e,t){super(e,t);const i=e.source;let s=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&this.el_.tagName==="VIDEO",i&&(this.el_.currentSrc!==i.src||e.tag&&e.tag.initNetworkState_===3)?this.setSource(i):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){const n=this.el_.childNodes;let a=n.length;const u=[];for(;a--;){const c=n[a];c.nodeName.toLowerCase()==="track"&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(c),this.remoteTextTracks().addTrack(c.track),this.textTracks().addTrack(c.track),!s&&!this.el_.hasAttribute("crossorigin")&&zn(c.src)&&(s=!0)):u.push(c))}for(let c=0;c<u.length;c++)this.el_.removeChild(u[c])}this.proxyNativeTracks_(),this.featuresNativeTextTracks&&s&&be.warn(`Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.
184
+ This may prevent text tracks from loading.`),this.restoreMetadataTracksInIOSNativePlayer_(),(ls||Mn)&&e.nativeControlsForTouch===!0&&this.setControls(!0),this.proxyWebkitFullscreen_(),this.triggerReady()}dispose(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),oe.disposeMediaElement(this.el_),this.options_=null,super.dispose()}setupSourcesetHandling_(){z_(this)}restoreMetadataTracksInIOSNativePlayer_(){const e=this.textTracks();let t;const i=()=>{t=[];for(let n=0;n<e.length;n++){const a=e[n];a.kind==="metadata"&&t.push({track:a,storedMode:a.mode})}};i(),e.addEventListener("change",i),this.on("dispose",()=>e.removeEventListener("change",i));const s=()=>{for(let n=0;n<t.length;n++){const a=t[n];a.track.mode==="disabled"&&a.track.mode!==a.storedMode&&(a.track.mode=a.storedMode)}e.removeEventListener("change",s)};this.on("webkitbeginfullscreen",()=>{e.removeEventListener("change",i),e.removeEventListener("change",s),e.addEventListener("change",s)}),this.on("webkitendfullscreen",()=>{e.removeEventListener("change",i),e.addEventListener("change",i),e.removeEventListener("change",s)})}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;const i=e.toLowerCase();this[`${i}TracksListeners_`]&&Object.keys(this[`${i}TracksListeners_`]).forEach(s=>{this.el()[`${i}Tracks`].removeEventListener(s,this[`${i}TracksListeners_`][s])}),this[`featuresNative${e}Tracks`]=!t,this[`${i}TracksListeners_`]=null,this.proxyNativeTracksForType_(i)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){const t=xt[e],i=this.el()[t.getterName],s=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!i||!i.addEventListener)return;const n={change:u=>{const c={type:"change",target:s,currentTarget:s,srcElement:s};s.trigger(c),e==="text"&&this[Tr.remoteText.getterName]().trigger(c)},addtrack(u){s.addTrack(u.track)},removetrack(u){s.removeTrack(u.track)}},a=function(){const u=[];for(let c=0;c<s.length;c++){let m=!1;for(let f=0;f<i.length;f++)if(i[f]===s[c]){m=!0;break}m||u.push(s[c])}for(;u.length;)s.removeTrack(u.shift())};this[t.getterName+"Listeners_"]=n,Object.keys(n).forEach(u=>{const c=n[u];i.addEventListener(u,c),this.on("dispose",m=>i.removeEventListener(u,c))}),this.on("loadstart",a),this.on("dispose",u=>this.off("loadstart",a))}proxyNativeTracks_(){xt.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let e=this.options_.tag;if(!e||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(e){const i=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(i,e),oe.disposeMediaElement(e),e=i}else{e=re.createElement("video");const i=this.options_.tag&&bi(this.options_.tag),s=Ae({},i);(!ls||this.options_.nativeControlsForTouch!==!0)&&delete s.controls,hh(e,Object.assign(s,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}typeof this.options_.preload<"u"&&_r(e,"preload",this.options_.preload),this.options_.disablePictureInPicture!==void 0&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);const t=["loop","muted","playsinline","autoplay"];for(let i=0;i<t.length;i++){const s=t[i],n=this.options_[s];typeof n<"u"&&(n?_r(e,s,s):Fn(e,s),e[s]=n)}return e}handleLateInit_(e){if(e.networkState===0||e.networkState===3)return;if(e.readyState===0){let i=!1;const s=function(){i=!0};this.on("loadstart",s);const n=function(){i||this.trigger("loadstart")};this.on("loadedmetadata",n),this.ready(function(){this.off("loadstart",s),this.off("loadedmetadata",n),i||this.trigger("loadstart")});return}const t=["loadstart"];t.push("loadedmetadata"),e.readyState>=2&&t.push("loadeddata"),e.readyState>=3&&t.push("canplay"),e.readyState>=4&&t.push("canplaythrough"),this.ready(function(){t.forEach(function(i){this.trigger(i)},this)})}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&Bn?this.el_.fastSeek(e):this.el_.currentTime=e}catch(t){be(t,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&Bt&&Yt&&this.el_.currentTime===0){const e=()=>{this.el_.currentTime>0&&(this.el_.duration===1/0&&this.trigger("durationchange"),this.off("timeupdate",e))};return this.on("timeupdate",e),NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!("webkitDisplayingFullscreen"in this.el_))return;const e=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},t=function(){"webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",t),this.on("dispose",()=>{this.off("webkitbeginfullscreen",t),this.off("webkitendfullscreen",e)})}supportsFullScreen(){return typeof this.el_.webkitEnterFullScreen=="function"}enterFullScreen(){const e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)zt(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}},0);else try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}}exitFullScreen(){if(!this.el_.webkitDisplayingFullscreen){this.trigger("fullscreenerror",new Error("The video is not fullscreen"));return}this.el_.webkitExitFullScreen()}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):super.cancelVideoFrameCallback(e)}src(e){if(e===void 0)return this.el_.src;this.setSrc(e)}addSourceElement(e,t){if(!e)return be.error("Invalid source URL."),!1;const i={src:e};t&&(i.type=t);const s=he("source",{},i);return this.el_.appendChild(s),!0}removeSourceElement(e){if(!e)return be.error("Source URL is required to remove the source element."),!1;const t=this.el_.querySelectorAll("source");for(const i of t)if(i.src===e)return this.el_.removeChild(i),!0;return be.warn(`No matching source element found with src: ${e}`),!1}reset(){oe.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,i){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,i):super.addTextTrack(e,t,i)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);const t=re.createElement("track");return e.kind&&(t.kind=e.kind),e.label&&(t.label=e.label),(e.language||e.srclang)&&(t.srclang=e.language||e.srclang),e.default&&(t.default=e.default),e.id&&(t.id=e.id),e.src&&(t.src=e.src),t}addRemoteTextTrack(e,t){const i=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(i),i}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){const t=this.$$("track");let i=t.length;for(;i--;)(e===t[i]||e===t[i].track)&&this.el().removeChild(t[i])}}getVideoPlaybackQuality(){if(typeof this.el().getVideoPlaybackQuality=="function")return this.el().getVideoPlaybackQuality();const e={};return typeof this.el().webkitDroppedFrameCount<"u"&&typeof this.el().webkitDecodedFrameCount<"u"&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),A.performance&&(e.creationTime=A.performance.now()),e}}On(oe,"TEST_VID",function(){if(!Sr())return;const r=re.createElement("video"),e=re.createElement("track");return e.kind="captions",e.srclang="en",e.label="English",r.appendChild(e),r});oe.isSupported=function(){try{oe.TEST_VID.volume=.5}catch{return!1}return!!(oe.TEST_VID&&oe.TEST_VID.canPlayType)};oe.canPlayType=function(r){return oe.TEST_VID.canPlayType(r)};oe.canPlaySource=function(r,e){return oe.canPlayType(r.type)};oe.canControlVolume=function(){try{const r=oe.TEST_VID.volume;oe.TEST_VID.volume=r/2+.1;const e=r!==oe.TEST_VID.volume;return e&&et?(A.setTimeout(()=>{oe&&oe.prototype&&(oe.prototype.featuresVolumeControl=r!==oe.TEST_VID.volume)}),!1):e}catch{return!1}};oe.canMuteVolume=function(){try{const r=oe.TEST_VID.muted;return oe.TEST_VID.muted=!r,oe.TEST_VID.muted?_r(oe.TEST_VID,"muted","muted"):Fn(oe.TEST_VID,"muted","muted"),r!==oe.TEST_VID.muted}catch{return!1}};oe.canControlPlaybackRate=function(){if(Bt&&Yt&&Nn<58)return!1;try{const r=oe.TEST_VID.playbackRate;return oe.TEST_VID.playbackRate=r/2+.1,r!==oe.TEST_VID.playbackRate}catch{return!1}};oe.canOverrideAttributes=function(){try{const r=()=>{};Object.defineProperty(re.createElement("video"),"src",{get:r,set:r}),Object.defineProperty(re.createElement("audio"),"src",{get:r,set:r}),Object.defineProperty(re.createElement("video"),"innerHTML",{get:r,set:r}),Object.defineProperty(re.createElement("audio"),"innerHTML",{get:r,set:r})}catch{return!1}return!0};oe.supportsNativeTextTracks=function(){return Bn||et&&Yt};oe.supportsNativeVideoTracks=function(){return!!(oe.TEST_VID&&oe.TEST_VID.videoTracks)};oe.supportsNativeAudioTracks=function(){return!!(oe.TEST_VID&&oe.TEST_VID.audioTracks)};oe.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"];[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function([r,e]){On(oe.prototype,r,()=>oe[e](),!0)});oe.prototype.featuresVolumeControl=oe.canControlVolume();oe.prototype.movingMediaElementInDOM=!et;oe.prototype.featuresFullscreenResize=!0;oe.prototype.featuresProgressEvents=!0;oe.prototype.featuresTimeupdateEvents=!0;oe.prototype.featuresVideoFrameCallback=!!(oe.TEST_VID&&oe.TEST_VID.requestVideoFrameCallback);oe.disposeMediaElement=function(r){if(r){for(r.parentNode&&r.parentNode.removeChild(r);r.hasChildNodes();)r.removeChild(r.firstChild);r.removeAttribute("src"),typeof r.load=="function"&&(function(){try{r.load()}catch{}})()}};oe.resetMediaElement=function(r){if(!r)return;const e=r.querySelectorAll("source");let t=e.length;for(;t--;)r.removeChild(e[t]);r.removeAttribute("src"),typeof r.load=="function"&&(function(){try{r.load()}catch{}})()};["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(r){oe.prototype[r]=function(){return this.el_[r]||this.el_.hasAttribute(r)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(r){oe.prototype["set"+Fe(r)]=function(e){this.el_[r]=e,e?this.el_.setAttribute(r,r):this.el_.removeAttribute(r)}});["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(r){oe.prototype[r]=function(){return this.el_[r]}});["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(r){oe.prototype["set"+Fe(r)]=function(e){this.el_[r]=e}});["pause","load","play"].forEach(function(r){oe.prototype[r]=function(){return this.el_[r]()}});ge.withSourceHandlers(oe);oe.nativeSourceHandler={};oe.nativeSourceHandler.canPlayType=function(r){try{return oe.TEST_VID.canPlayType(r)}catch{return""}};oe.nativeSourceHandler.canHandleSource=function(r,e){if(r.type)return oe.nativeSourceHandler.canPlayType(r.type);if(r.src){const t=Uo(r.src);return oe.nativeSourceHandler.canPlayType(`video/${t}`)}return""};oe.nativeSourceHandler.handleSource=function(r,e,t){e.setSrc(r.src)};oe.nativeSourceHandler.dispose=function(){};oe.registerSourceHandler(oe.nativeSourceHandler);ge.registerTech("Html5",oe);const md=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Ua={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},oo=["tiny","xsmall","small","medium","large","xlarge","huge"],nn={};oo.forEach(r=>{const e=r.charAt(0)==="x"?`x-${r.substring(1)}`:r;nn[r]=`vjs-layout-${e}`});const W_={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};class Ee extends X{constructor(e,t,i){if(e.id=e.id||t.id||`vjs_video_${Dt()}`,t=Object.assign(Ee.getTagSettings(e),t),t.initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language){const a=e.closest("[lang]");a&&(t.language=a.getAttribute("lang"))}if(super(null,t,i),this.boundDocumentFullscreenChange_=a=>this.documentFullscreenChange_(a),this.boundFullWindowOnEscKey_=a=>this.fullWindowOnEscKey(a),this.boundUpdateStyleEl_=a=>this.updateStyleEl_(a),this.boundApplyInitTime_=a=>this.applyInitTime_(a),this.boundUpdateCurrentBreakpoint_=a=>this.updateCurrentBreakpoint_(a),this.boundHandleTechClick_=a=>this.handleTechClick_(a),this.boundHandleTechDoubleClick_=a=>this.handleTechDoubleClick_(a),this.boundHandleTechTouchStart_=a=>this.handleTechTouchStart_(a),this.boundHandleTechTouchMove_=a=>this.handleTechTouchMove_(a),this.boundHandleTechTouchEnd_=a=>this.handleTechTouchEnd_(a),this.boundHandleTechTap_=a=>this.handleTechTap_(a),this.boundUpdatePlayerHeightOnAudioOnlyMode_=a=>this.updatePlayerHeightOnAudioOnlyMode_(a),this.isFullscreen_=!1,this.log=Zc(this.id_),this.fsApi_=ln,this.isPosterFromTech_=!1,this.queuedCallbacks_=[],this.isReady_=!1,this.hasStarted_=!1,this.userActive_=!1,this.debugEnabled_=!1,this.audioOnlyMode_=!1,this.audioPosterMode_=!1,this.audioOnlyCache_={controlBarHeight:null,playerHeight:null,hiddenChildren:[]},!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(this.tag=e,this.tagAttributes=e&&bi(e),this.language(this.options_.language),t.languages){const a={};Object.getOwnPropertyNames(t.languages).forEach(function(u){a[u.toLowerCase()]=t.languages[u]}),this.languages_=a}else this.languages_=Ee.prototype.options_.languages;this.resetCache_(),this.poster_=t.poster||"",this.controls_=!!t.controls,e.controls=!1,e.removeAttribute("controls"),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],e.hasAttribute("autoplay")?this.autoplay(!0):this.autoplay(this.options_.autoplay),t.plugins&&Object.keys(t.plugins).forEach(a=>{if(typeof this[a]!="function")throw new Error(`plugin "${a}" does not exist`)}),this.scrubbing_=!1,this.el_=this.createEl(),Oo(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(bt(re,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);const s=Ae(this.options_);if(t.plugins&&Object.keys(t.plugins).forEach(a=>{this[a](t.plugins[a])}),t.debug&&this.debug(!0),this.options_.playerOptions=s,this.middleware_=[],this.playbackRates(t.playbackRates),t.experimentalSvgIcons){const a=new A.DOMParser().parseFromString(g_,"image/svg+xml");if(a.querySelector("parsererror"))be.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{const u=a.documentElement;u.style.display="none",this.el_.appendChild(u),this.addClass("vjs-svg-icons-enabled")}}this.initChildren(),this.isAudio(e.nodeName.toLowerCase()==="audio"),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.el_.setAttribute("role","region"),this.isAudio()?this.el_.setAttribute("aria-label",this.localize("Audio Player")):this.el_.setAttribute("aria-label",this.localize("Video Player")),this.isAudio()&&this.addClass("vjs-audio"),t.spatialNavigation&&t.spatialNavigation.enabled&&(this.spatialNavigation=new f_(this),this.addClass("vjs-spatial-navigation-enabled")),ls&&this.addClass("vjs-touch-enabled"),et||this.addClass("vjs-workinghover"),Ee.players[this.id_]=this;const n=Ya.split(".")[0];this.addClass(`vjs-v${n}`),this.userActive(!0),this.reportUserActivity(),this.one("play",a=>this.listenForUserActivity_(a)),this.on("keydown",a=>this.handleKeyDown(a)),this.on("languagechange",a=>this.handleLanguagechange(a)),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on("ready",()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode)})}dispose(){this.trigger("dispose"),this.off("dispose"),tt(re,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),tt(re,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),Ee.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),h_(this),ct.names.forEach(e=>{const t=ct[e],i=this[t.getterName]();i&&i.off&&i.off()}),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e=this.tag,t,i=this.playerElIngest_=e.parentNode&&e.parentNode.hasAttribute&&e.parentNode.hasAttribute("data-vjs-player");const s=this.tag.tagName.toLowerCase()==="video-js";i?t=this.el_=e.parentNode:s||(t=this.el_=super.createEl("div"));const n=bi(e);if(s){for(t=this.el_=e,e=this.tag=re.createElement("video");t.children.length;)e.appendChild(t.firstChild);rs(t,"video-js")||qi(t,"video-js"),t.appendChild(e),i=this.playerElIngest_=t,Object.keys(t).forEach(c=>{try{e[c]=t[c]}catch{}})}e.setAttribute("tabindex","-1"),n.tabindex="-1",Yt&&Rn&&(e.setAttribute("role","application"),n.role="application"),e.removeAttribute("width"),e.removeAttribute("height"),"width"in n&&delete n.width,"height"in n&&delete n.height,Object.getOwnPropertyNames(n).forEach(function(c){s&&c==="class"||t.setAttribute(c,n[c]),s&&e.setAttribute(c,n[c])}),e.playerId=e.id,e.id+="_html5_api",e.className="vjs-tech",e.player=t.player=this,this.addClass("vjs-paused");const a=["IS_SMART_TV","IS_TIZEN","IS_WEBOS","IS_ANDROID","IS_IPAD","IS_IPHONE","IS_CHROMECAST_RECEIVER"].filter(c=>oh[c]).map(c=>"vjs-device-"+c.substring(3).toLowerCase().replace(/\_/g,"-"));if(this.addClass(...a),A.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=Sh("vjs-styles-dimensions");const c=Ei(".vjs-styles-defaults"),m=Ei("head");m.insertBefore(this.styleEl_,c?c.nextSibling:m.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);const u=e.getElementsByTagName("a");for(let c=0;c<u.length;c++){const m=u.item(c);qi(m,"vjs-hidden"),m.setAttribute("hidden","hidden")}return e.initNetworkState_=e.networkState,e.parentNode&&!i&&e.parentNode.insertBefore(t,e),Ja(e,t),this.children_.unshift(e),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=t,t}crossOrigin(e){if(typeof e>"u")return this.techGet_("crossOrigin");if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){be.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}this.techCall_("setCrossOrigin",e),this.posterImage&&this.posterImage.crossOrigin(e)}width(e){return this.dimension("width",e)}height(e){return this.dimension("height",e)}dimension(e,t){const i=e+"_";if(t===void 0)return this[i]||0;if(t===""||t==="auto"){this[i]=void 0,this.updateStyleEl_();return}const s=parseFloat(t);if(isNaN(s)){be.error(`Improper value "${t}" supplied for for ${e}`);return}this[i]=s,this.updateStyleEl_()}fluid(e){if(e===void 0)return!!this.fluid_;this.fluid_=!!e,si(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),Hy(this,()=>{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)})):this.removeClass("vjs-fluid"),this.updateStyleEl_()}fill(e){if(e===void 0)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")}aspectRatio(e){if(e===void 0)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()}updateStyleEl_(){if(A.VIDEOJS_NO_DYNAMIC_STYLE===!0){const u=typeof this.width_=="number"?this.width_:this.options_.width,c=typeof this.height_=="number"?this.height_:this.options_.height,m=this.tech_&&this.tech_.el();m&&(u>=0&&(m.width=u),c>=0&&(m.height=c));return}let e,t,i,s;this.aspectRatio_!==void 0&&this.aspectRatio_!=="auto"?i=this.aspectRatio_:this.videoWidth()>0?i=this.videoWidth()+":"+this.videoHeight():i="16:9";const n=i.split(":"),a=n[1]/n[0];this.width_!==void 0?e=this.width_:this.height_!==void 0?e=this.height_/a:e=this.videoWidth()||300,this.height_!==void 0?t=this.height_:t=e*a,/^[^a-zA-Z]/.test(this.id())?s="dimensions-"+this.id():s=this.id()+"-dimensions",this.addClass(s),Eh(this.styleEl_,`
185
+ .${s} {
186
+ width: ${e}px;
187
+ height: ${t}px;
188
+ }
189
+
190
+ .${s}.vjs-fluid:not(.vjs-audio-only-mode) {
191
+ padding-top: ${a*100}%;
192
+ }
193
+ `)}loadTech_(e,t){this.tech_&&this.unloadTech_();const i=Fe(e),s=e.charAt(0).toLowerCase()+e.slice(1);i!=="Html5"&&this.tag&&(ge.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=i,this.isReady_=!1;let n=this.autoplay();(typeof this.autoplay()=="string"||this.autoplay()===!0&&this.options_.normalizeAutoplay)&&(n=!1);const a={source:t,autoplay:n,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${s}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};ct.names.forEach(c=>{const m=ct[c];a[m.getterName]=this[m.privateName]}),Object.assign(a,this.options_[i]),Object.assign(a,this.options_[s]),Object.assign(a,this.options_[e.toLowerCase()]),this.tag&&(a.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(a.startTime=this.cache_.currentTime);const u=ge.getTech(e);if(!u)throw new Error(`No Tech named '${i}' exists! '${i}' should be registered using videojs.registerTech()'`);this.tech_=new u(a),this.tech_.ready(De(this,this.handleTechReady_),!0),so.jsonToTextTracks(this.textTracksJson_||[],this.tech_),md.forEach(c=>{this.on(this.tech_,c,m=>this[`handleTech${Fe(c)}_`](m))}),Object.keys(Ua).forEach(c=>{this.on(this.tech_,c,m=>{if(this.tech_.playbackRate()===0&&this.tech_.seeking()){this.queuedCallbacks_.push({callback:this[`handleTech${Ua[c]}_`].bind(this),event:m});return}this[`handleTech${Ua[c]}_`](m)})}),this.on(this.tech_,"loadstart",c=>this.handleTechLoadStart_(c)),this.on(this.tech_,"sourceset",c=>this.handleTechSourceset_(c)),this.on(this.tech_,"waiting",c=>this.handleTechWaiting_(c)),this.on(this.tech_,"ended",c=>this.handleTechEnded_(c)),this.on(this.tech_,"seeking",c=>this.handleTechSeeking_(c)),this.on(this.tech_,"play",c=>this.handleTechPlay_(c)),this.on(this.tech_,"pause",c=>this.handleTechPause_(c)),this.on(this.tech_,"durationchange",c=>this.handleTechDurationChange_(c)),this.on(this.tech_,"fullscreenchange",(c,m)=>this.handleTechFullscreenChange_(c,m)),this.on(this.tech_,"fullscreenerror",(c,m)=>this.handleTechFullscreenError_(c,m)),this.on(this.tech_,"enterpictureinpicture",c=>this.handleTechEnterPictureInPicture_(c)),this.on(this.tech_,"leavepictureinpicture",c=>this.handleTechLeavePictureInPicture_(c)),this.on(this.tech_,"error",c=>this.handleTechError_(c)),this.on(this.tech_,"posterchange",c=>this.handleTechPosterChange_(c)),this.on(this.tech_,"textdata",c=>this.handleTechTextData_(c)),this.on(this.tech_,"ratechange",c=>this.handleTechRateChange_(c)),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode!==this.el()&&(i!=="Html5"||!this.tag)&&Ja(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){ct.names.forEach(e=>{const t=ct[e];this[t.privateName]=this[t.getterName]()}),this.textTracksJson_=so.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1}tech(e){return e===void 0&&be.warn(`Using the tech directly can be dangerous. I hope you know what you're doing.
194
+ See https://github.com/videojs/video.js/issues/2617 for more info.
195
+ `),this.tech_}version(){return{"video.js":Ya}}addTechControlsListeners_(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass("vjs-ended","vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):this.trigger("loadstart"),this.manualAutoplay_(this.autoplay()===!0&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){if(!this.tech_||typeof e!="string")return;const t=()=>{const s=this.muted();this.muted(!0);const n=()=>{this.muted(s)};this.playTerminatedQueue_.push(n);const a=this.play();if(ns(a))return a.catch(u=>{throw n(),new Error(`Rejection at manualAutoplay. Restoring muted value. ${u||""}`)})};let i;if(e==="any"&&!this.muted()?(i=this.play(),ns(i)&&(i=i.catch(t))):e==="muted"&&!this.muted()?i=t():i=this.play(),!!ns(i))return i.then(()=>{this.trigger({type:"autoplay-success",autoplay:e})}).catch(()=>{this.trigger({type:"autoplay-failure",autoplay:e})})}updateSourceCaches_(e=""){let t=e,i="";typeof t!="string"&&(t=e.src,i=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!i&&(i=m_(this,t)),this.cache_.source=Ae({},e,{src:t,type:i});const s=this.cache_.sources.filter(c=>c.src&&c.src===t),n=[],a=this.$$("source"),u=[];for(let c=0;c<a.length;c++){const m=bi(a[c]);n.push(m),m.src&&m.src===t&&u.push(m.src)}u.length&&!s.length?this.cache_.sources=n:s.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t}handleTechSourceset_(e){if(!this.changingSrc_){let t=n=>this.updateSourceCaches_(n);const i=this.currentSource().src,s=e.src;i&&!/^blob:/.test(i)&&/^blob:/.test(s)&&(!this.lastSource_||this.lastSource_.tech!==s&&this.lastSource_.player!==i)&&(t=()=>{}),t(s),e.src||this.tech_.any(["sourceset","loadstart"],n=>{if(n.type==="sourceset")return;const a=this.techGet_("currentSrc");this.lastSource_.tech=a,this.updateSourceCaches_(a)})}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})}hasStarted(e){if(e===void 0)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?this.addClass("vjs-has-started"):this.removeClass("vjs-has-started"))}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")}handleTechRateChange_(){this.tech_.playbackRate()>0&&this.cache_.lastPlaybackRate===0&&(this.queuedCallbacks_.forEach(e=>e.callback(e.event)),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting"),this.trigger("waiting");const e=this.currentTime(),t=()=>{e!==this.currentTime()&&(this.removeClass("vjs-waiting"),this.off("timeupdate",t))};this.on("timeupdate",t)}handleTechCanPlay_(){this.removeClass("vjs-waiting"),this.trigger("canplay")}handleTechCanPlayThrough_(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")}handleTechPlaying_(){this.removeClass("vjs-waiting"),this.trigger("playing")}handleTechSeeking_(){this.addClass("vjs-seeking"),this.trigger("seeking")}handleTechSeeked_(){this.removeClass("vjs-seeking","vjs-ended"),this.trigger("seeked")}handleTechPause_(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")}handleTechEnded_(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(e){this.controls_&&(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.click===void 0||this.options_.userActions.click!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.click=="function"?this.options_.userActions.click.call(this,e):this.paused()?zt(this.play()):this.pause())}handleTechDoubleClick_(e){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),t=>t.contains(e.target))||(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.doubleClick===void 0||this.options_.userActions.doubleClick!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.doubleClick=="function"?this.options_.userActions.doubleClick.call(this,e):this.isInPictureInPicture()&&!re.pictureInPictureElement?this.exitPictureInPicture():this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){this.userWasActive&&this.reportUserActivity()}handleTechTouchEnd_(e){e.cancelable&&e.preventDefault()}toggleFullscreenClass_(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")}documentFullscreenChange_(e){const t=e.target.player;if(t&&t!==this)return;const i=this.el();let s=re[this.fsApi_.fullscreenElement]===i;!s&&i.matches&&(s=i.matches(":"+this.fsApi_.fullscreen)),this.isFullscreen(s)}handleTechFullscreenChange_(e,t){t&&(t.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",()=>{this.removeClass("vjs-ios-native-fs")})),this.isFullscreen(t.isFullscreen))}handleTechFullscreenError_(e,t){this.trigger("fullscreenerror",t)}togglePictureInPictureClass_(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(!0)}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(!1)}handleTechError_(){const e=this.tech_.error();e&&this.error(e)}handleTechTextData_(){let e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}}techCall_(e,t){this.ready(function(){if(e in l_)return o_(this.middleware_,this.tech_,e,t);if(e in Wl)return zl(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(i){throw be(i),i}},!0)}techGet_(e){if(!(!this.tech_||!this.tech_.isReady_)){if(e in u_)return a_(this.middleware_,this.tech_,e);if(e in Wl)return zl(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){throw this.tech_[e]===void 0?(be(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t):t.name==="TypeError"?(be(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t):(be(t),t)}}}play(){return new Promise(e=>{this.play_(e)})}play_(e=zt){this.playCallbacks_.push(e);const t=!!(!this.changingSrc_&&(this.src()||this.currentSrc())),i=!!(Bn||et);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!t){this.waitToPlay_=n=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),!t&&i&&this.load();return}const s=this.techGet_("play");i&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),s===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(s)}runPlayTerminatedQueue_(){const e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(t){t()})}runPlayCallbacks_(e){const t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach(function(i){i(e)})}pause(){this.techCall_("pause")}paused(){return this.techGet_("paused")!==!1}played(){return this.techGet_("played")||Mt(0,0)}scrubbing(e){if(typeof e>"u")return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")}currentTime(e){if(e===void 0)return this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime;if(e<0&&(e=0),!this.isReady_||this.changingSrc_||!this.tech_||!this.tech_.isReady_){this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),this.one("canplay",this.boundApplyInitTime_);return}this.techCall_("setCurrentTime",e),this.cache_.initTime=0,isFinite(e)&&(this.cache_.currentTime=Number(e))}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(e===void 0)return this.cache_.duration!==void 0?this.cache_.duration:NaN;e=parseFloat(e),e<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let e=this.techGet_("buffered");return(!e||!e.length)&&(e=Mt(0,0)),e}seekable(){let e=this.techGet_("seekable");return(!e||!e.length)&&(e=Mt(0,0)),e}seeking(){return this.techGet_("seeking")}ended(){return this.techGet_("ended")}networkState(){return this.techGet_("networkState")}readyState(){return this.techGet_("readyState")}bufferedPercent(){return Lh(this.buffered(),this.duration())}bufferedEnd(){const e=this.buffered(),t=this.duration();let i=e.end(e.length-1);return i>t&&(i=t),i}volume(e){let t;if(e!==void 0){t=Math.max(0,Math.min(1,e)),this.cache_.volume=t,this.techCall_("setVolume",t),t>0&&this.lastVolume_(t);return}return t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t}muted(e){if(e!==void 0){this.techCall_("setMuted",e);return}return this.techGet_("muted")||!1}defaultMuted(e){return e!==void 0&&this.techCall_("setDefaultMuted",e),this.techGet_("defaultMuted")||!1}lastVolume_(e){if(e!==void 0&&e!==0){this.cache_.lastVolume=e;return}return this.cache_.lastVolume}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(e){if(e!==void 0){const t=this.isFullscreen_;this.isFullscreen_=!!e,this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),this.toggleFullscreenClass_();return}return this.isFullscreen_}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();const t=this;return new Promise((i,s)=>{function n(){t.off("fullscreenerror",u),t.off("fullscreenchange",a)}function a(){n(),i()}function u(m,f){n(),s(f)}t.one("fullscreenchange",a),t.one("fullscreenerror",u);const c=t.requestFullscreenHelper_(e);c&&(c.then(n,n),c.then(i,s))})}requestFullscreenHelper_(e){let t;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},e!==void 0&&(t=e)),this.fsApi_.requestFullscreen){const i=this.el_[this.fsApi_.requestFullscreen](t);return i&&i.then(()=>this.isFullscreen(!0),()=>this.isFullscreen(!1)),i}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){const e=this;return new Promise((t,i)=>{function s(){e.off("fullscreenerror",a),e.off("fullscreenchange",n)}function n(){s(),t()}function a(c,m){s(),i(m)}e.one("fullscreenchange",n),e.one("fullscreenerror",a);const u=e.exitFullscreenHelper_();u&&(u.then(s,s),u.then(t,i))})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=re[this.fsApi_.exitFullscreen]();return e&&zt(e.then(()=>this.isFullscreen(!1))),e}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=re.documentElement.style.overflow,bt(re,"keydown",this.boundFullWindowOnEscKey_),re.documentElement.style.overflow="hidden",qi(re.body,"vjs-full-window"),this.trigger("enterFullWindow")}fullWindowOnEscKey(e){e.key==="Escape"&&this.isFullscreen()===!0&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,tt(re,"keydown",this.boundFullWindowOnEscKey_),re.documentElement.style.overflow=this.docOrigOverflow,Un(re.body,"vjs-full-window"),this.trigger("exitFullWindow")}disablePictureInPicture(e){if(e===void 0)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(e){if(e!==void 0){this.isInPictureInPicture_=!!e,this.togglePictureInPictureClass_();return}return!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&A.documentPictureInPicture){const e=re.createElement(this.el().tagName);return e.classList=this.el().classList,e.classList.add("vjs-pip-container"),this.posterImage&&e.appendChild(this.posterImage.el().cloneNode(!0)),this.titleBar&&e.appendChild(this.titleBar.el().cloneNode(!0)),e.appendChild(he("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),A.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(t=>(bh(t),this.el_.parentNode.insertBefore(e,this.el_),t.document.body.appendChild(this.el_),t.document.body.classList.add("vjs-pip-window"),this.player_.isInPictureInPicture(!0),this.player_.trigger({type:"enterpictureinpicture",pipWindow:t}),t.addEventListener("pagehide",i=>{const s=i.target.querySelector(".video-js");e.parentNode.replaceChild(s,e),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")}),t))}return"pictureInPictureEnabled"in re&&this.disablePictureInPicture()===!1?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){if(A.documentPictureInPicture&&A.documentPictureInPicture.window)return A.documentPictureInPicture.window.close(),Promise.resolve();if("pictureInPictureEnabled"in re)return re.exitPictureInPicture()}handleKeyDown(e){const{userActions:t}=this.options_;!t||!t.hotkeys||(i=>{const s=i.tagName.toLowerCase();return i.isContentEditable?!0:s==="input"?["button","checkbox","hidden","radio","reset","submit"].indexOf(i.type)===-1:["textarea"].indexOf(s)!==-1})(this.el_.ownerDocument.activeElement)||(typeof t.hotkeys=="function"?t.hotkeys.call(this,e):this.handleHotkeys(e))}handleHotkeys(e){const t=this.options_.userActions?this.options_.userActions.hotkeys:{},{fullscreenKey:i=a=>e.key.toLowerCase()==="f",muteKey:s=a=>e.key.toLowerCase()==="m",playPauseKey:n=a=>e.key.toLowerCase()==="k"||e.key.toLowerCase()===" "}=t;if(i.call(this,e)){e.preventDefault(),e.stopPropagation();const a=X.getComponent("FullscreenToggle");re[this.fsApi_.fullscreenEnabled]!==!1&&a.prototype.handleClick.call(this,e)}else s.call(this,e)?(e.preventDefault(),e.stopPropagation(),X.getComponent("MuteToggle").prototype.handleClick.call(this,e)):n.call(this,e)&&(e.preventDefault(),e.stopPropagation(),X.getComponent("PlayToggle").prototype.handleClick.call(this,e))}canPlayType(e){let t;for(let i=0,s=this.options_.techOrder;i<s.length;i++){const n=s[i];let a=ge.getTech(n);if(a||(a=X.getComponent(n)),!a){be.error(`The "${n}" tech is undefined. Skipped browser support check for that tech.`);continue}if(a.isSupported()&&(t=a.canPlayType(e),t))return t}return""}selectSource(e){const t=this.options_.techOrder.map(u=>[u,ge.getTech(u)]).filter(([u,c])=>c?c.isSupported():(be.error(`The "${u}" tech is undefined. Skipped browser support check for that tech.`),!1)),i=function(u,c,m){let f;return u.some(_=>c.some(P=>{if(f=m(_,P),f)return!0})),f};let s;const n=u=>(c,m)=>u(m,c),a=([u,c],m)=>{if(c.canPlaySource(m,this.options_[u.toLowerCase()]))return{source:m,tech:u}};return this.options_.sourceOrder?s=i(e,t,n(a)):s=i(t,e,a),s||!1}handleSrc_(e,t){if(typeof e>"u")return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();const i=Uh(e);if(!i.length){this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);return}if(this.changingSrc_=!0,t||(this.cache_.sources=i),this.updateSourceCaches_(i[0]),s_(this,i[0],(s,n)=>{if(this.middleware_=n,t||(this.cache_.sources=i),this.updateSourceCaches_(s),this.src_(s)){if(i.length>1)return this.handleSrc_(i.slice(1));this.changingSrc_=!1,this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),this.triggerReady();return}n_(n,this.tech_)}),i.length>1){const s=()=>{this.error(null),this.handleSrc_(i.slice(1),!0)},n=()=>{this.off("error",s)};this.one("error",s),this.one("playing",n),this.resetRetryOnError_=()=>{this.off("error",s),this.off("playing",n)}}}src(e){return this.handleSrc_(e,!1)}src_(e){const t=this.selectSource([e]);return t?xh(t.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(t.tech,t.source),this.tech_.ready(()=>{this.changingSrc_=!1}),!1):!0}addSourceElement(e,t){return this.tech_?this.tech_.addSourceElement(e,t):!1}removeSourceElement(e){return this.tech_?this.tech_.removeSourceElement(e):!1}load(){if(this.tech_&&this.tech_.vhs){this.src(this.currentSource());return}this.techCall_("load")}reset(){if(this.paused())this.doReset_();else{const e=this.play();zt(e.then(()=>this.doReset_()))}}doReset_(){this.tech_&&this.tech_.clearTracks("text"),this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),this.error(null),this.titleBar&&this.titleBar.update({title:void 0,description:void 0}),si(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:e,durationDisplay:t,progressControl:i,remainingTimeDisplay:s}=this.controlBar||{},{seekBar:n}=i||{};e&&e.updateContent(),t&&t.updateContent(),s&&s.updateContent(),n&&(n.update(),n.loadProgressBar&&n.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger("volumechange")}currentSources(){const e=this.currentSource(),t=[];return Object.keys(e).length!==0&&t.push(e),this.cache_.sources||t}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(e){if(e!==void 0){this.techCall_("setPreload",e),this.options_.preload=e;return}return this.techGet_("preload")}autoplay(e){if(e===void 0)return this.options_.autoplay||!1;let t;typeof e=="string"&&/(any|play|muted)/.test(e)||e===!0&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_(typeof e=="string"?e:"play"),t=!1):e?this.options_.autoplay=!0:this.options_.autoplay=!1,t=typeof t>"u"?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)}playsinline(e){return e!==void 0&&(this.techCall_("setPlaysinline",e),this.options_.playsinline=e),this.techGet_("playsinline")}loop(e){if(e!==void 0){this.techCall_("setLoop",e),this.options_.loop=e;return}return this.techGet_("loop")}poster(e){if(e===void 0)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){const e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}}controls(e){if(e===void 0)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))}usingNativeControls(e){if(e===void 0)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))}error(e){if(e===void 0)return this.error_||null;if(Si("beforeerror").forEach(t=>{const i=t(this,e);if(!(Kt(i)&&!Array.isArray(i)||typeof i=="string"||typeof i=="number"||i===null)){this.log.error("please return a value that MediaError expects in beforeerror hooks");return}e=i}),this.options_.suppressNotSupportedError&&e&&e.code===4){const t=function(){this.error(e)};this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),this.one("loadstart",function(){this.off(["click","touchstart"],t)});return}if(e===null){this.error_=null,this.removeClass("vjs-error"),this.errorDisplay&&this.errorDisplay.close();return}this.error_=new Be(e),this.addClass("vjs-error"),be.error(`(CODE:${this.error_.code} ${Be.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),Si("error").forEach(t=>t(this,this.error_))}reportUserActivity(e){this.userActivity_=!0}userActive(e){if(e===void 0)return this.userActive_;if(e=!!e,e!==this.userActive_){if(this.userActive_=e,this.userActive_){this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),this.trigger("useractive");return}this.tech_&&this.tech_.one("mousemove",function(t){t.stopPropagation(),t.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}}listenForUserActivity_(){let e,t,i;const s=De(this,this.reportUserActivity),n=function(_){(_.screenX!==t||_.screenY!==i)&&(t=_.screenX,i=_.screenY,s())},a=function(){s(),this.clearInterval(e),e=this.setInterval(s,250)},u=function(_){s(),this.clearInterval(e)};this.on("mousedown",a),this.on("mousemove",n),this.on("mouseup",u),this.on("mouseleave",u);const c=this.getChild("controlBar");c&&!et&&!Bt&&(c.on("mouseenter",function(_){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),c.on("mouseleave",function(_){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",s),this.on("keyup",s);let m;const f=function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(m);const _=this.options_.inactivityTimeout;_<=0||(m=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},_))};this.setInterval(f,250)}playbackRate(e){if(e!==void 0){this.techCall_("setPlaybackRate",e);return}return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1}defaultPlaybackRate(e){return e!==void 0?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1}isAudio(e){if(e!==void 0){this.isAudio_=!!e;return}return!!this.isAudio_}updatePlayerHeightOnAudioOnlyMode_(){const e=this.getChild("ControlBar");!e||this.audioOnlyCache_.controlBarHeight===e.currentHeight()||(this.audioOnlyCache_.controlBarHeight=e.currentHeight(),this.height(this.audioOnlyCache_.controlBarHeight))}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const e=this.children(),t=this.getChild("ControlBar"),i=t&&t.currentHeight();e.forEach(s=>{s!==t&&s.el_&&!s.hasClass("vjs-hidden")&&(s.hide(),this.audioOnlyCache_.hiddenChildren.push(s))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.audioOnlyCache_.controlBarHeight=i,this.on("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.height(i),this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode"),this.off("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.audioOnlyCache_.hiddenChildren.forEach(e=>e.show()),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")}audioOnlyMode(e){if(typeof e!="boolean"||e===this.audioOnlyMode_)return this.audioOnlyMode_;if(this.audioOnlyMode_=e,e){const t=[];return this.isInPictureInPicture()&&t.push(this.exitPictureInPicture()),this.isFullscreen()&&t.push(this.exitFullscreen()),this.audioPosterMode()&&t.push(this.audioPosterMode(!1)),Promise.all(t).then(()=>this.enableAudioOnlyUI_())}return Promise.resolve().then(()=>this.disableAudioOnlyUI_())}enablePosterModeUI_(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}disablePosterModeUI_(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}audioPosterMode(e){return typeof e!="boolean"||e===this.audioPosterMode_?this.audioPosterMode_:(this.audioPosterMode_=e,e?this.audioOnlyMode()?this.audioOnlyMode(!1).then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.disablePosterModeUI_()}))}addTextTrack(e,t,i){if(this.tech_)return this.tech_.addTextTrack(e,t,i)}addRemoteTextTrack(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)}removeRemoteTextTrack(e={}){let{track:t}=e;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)}getVideoPlaybackQuality(){return this.techGet_("getVideoPlaybackQuality")}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(e){if(e===void 0)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),si(this)&&this.trigger("languagechange"))}languages(){return Ae(Ee.prototype.options_.languages,this.languages_)}toJSON(){const e=Ae(this.options_),t=e.tracks;e.tracks=[];for(let i=0;i<t.length;i++){let s=t[i];s=Ae(s),s.player=void 0,e.tracks[i]=s}return e}createModal(e,t){t=t||{},t.content=e||"";const i=new wr(this,t);return this.addChild(i),i.on("dispose",()=>{this.removeChild(i)}),i.open(),i}updateCurrentBreakpoint_(){if(!this.responsive())return;const e=this.currentBreakpoint(),t=this.currentWidth();for(let i=0;i<oo.length;i++){const s=oo[i],n=this.breakpoints_[s];if(t<=n){if(e===s)return;e&&this.removeClass(nn[e]),this.addClass(nn[s]),this.breakpoint_=s;break}}}removeCurrentBreakpoint_(){const e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)}breakpoints(e){return e===void 0?Object.assign(this.breakpoints_):(this.breakpoint_="",this.breakpoints_=Object.assign({},W_,e),this.updateCurrentBreakpoint_(),Object.assign(this.breakpoints_))}responsive(e){if(e===void 0)return this.responsive_;e=!!e;const t=this.responsive_;if(e!==t)return this.responsive_=e,e?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e}currentBreakpoint(){return this.breakpoint_}currentBreakpointClass(){return nn[this.breakpoint_]||""}loadMedia(e,t){if(!e||typeof e!="object")return;const i=this.crossOrigin();this.reset(),this.cache_.media=Ae(e);const{artist:s,artwork:n,description:a,poster:u,src:c,textTracks:m,title:f}=this.cache_.media;!n&&u&&(this.cache_.media.artwork=[{src:u,type:bn(u)}]),i&&this.crossOrigin(i),c&&this.src(c),u&&this.poster(u),Array.isArray(m)&&m.forEach(_=>this.addRemoteTextTrack(_,!1)),this.titleBar&&this.titleBar.update({title:f,description:a||s||""}),this.ready(t)}getMedia(){if(!this.cache_.media){const e=this.poster(),t=this.currentSources(),i=Array.prototype.map.call(this.remoteTextTracks(),n=>({kind:n.kind,label:n.label,language:n.language,src:n.src})),s={src:t,textTracks:i};return e&&(s.poster=e,s.artwork=[{src:s.poster,type:bn(s.poster)}]),s}return Ae(this.cache_.media)}static getTagSettings(e){const t={sources:[],tracks:[]},i=bi(e),s=i["data-setup"];if(rs(e,"vjs-fill")&&(i.fill=!0),rs(e,"vjs-fluid")&&(i.fluid=!0),s!==null)try{Object.assign(i,JSON.parse(s||"{}"))}catch(n){be.error("data-setup",n)}if(Object.assign(t,i),e.hasChildNodes()){const n=e.childNodes;for(let a=0,u=n.length;a<u;a++){const c=n[a],m=c.nodeName.toLowerCase();m==="source"?t.sources.push(bi(c)):m==="track"&&t.tracks.push(bi(c))}}return t}debug(e){if(e===void 0)return this.debugEnabled_;e?(this.trigger("debugon"),this.previousLogLevel_=this.log.level,this.log.level("debug"),this.debugEnabled_=!0):(this.trigger("debugoff"),this.log.level(this.previousLogLevel_),this.previousLogLevel_=void 0,this.debugEnabled_=!1)}playbackRates(e){if(e===void 0)return this.cache_.playbackRates;Array.isArray(e)&&e.every(t=>typeof t=="number")&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))}}Ee.prototype.videoTracks=()=>{};Ee.prototype.audioTracks=()=>{};Ee.prototype.textTracks=()=>{};Ee.prototype.remoteTextTracks=()=>{};Ee.prototype.remoteTextTrackEls=()=>{};ct.names.forEach(function(r){const e=ct[r];Ee.prototype[e.getterName]=function(){return this.tech_?this.tech_[e.getterName]():(this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName])}});Ee.prototype.crossorigin=Ee.prototype.crossOrigin;Ee.players={};const Qr=A.navigator;Ee.prototype.options_={techOrder:ge.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:Qr&&(Qr.languages&&Qr.languages[0]||Qr.userLanguage||Qr.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1,spatialNavigation:{enabled:!1,horizontalSeek:!1},enableSmoothSeeking:!1,disableSeekWhileScrubbingOnMobile:!1,disableSeekWhileScrubbingOnSTV:!1};md.forEach(function(r){Ee.prototype[`handleTech${Fe(r)}_`]=function(){return this.trigger(r)}});X.registerComponent("Player",Ee);const vn="plugin",or="activePlugins_",tr={},Tn=r=>tr.hasOwnProperty(r),an=r=>Tn(r)?tr[r]:void 0,gd=(r,e)=>{r[or]=r[or]||{},r[or][e]=!0},Sn=(r,e,t)=>{const i=(t?"before":"")+"pluginsetup";r.trigger(i,e),r.trigger(i+":"+e.name,e)},G_=function(r,e){const t=function(){Sn(this,{name:r,plugin:e,instance:null},!0);const i=e.apply(this,arguments);return gd(this,r),Sn(this,{name:r,plugin:e,instance:i}),i};return Object.keys(e).forEach(function(i){t[i]=e[i]}),t},uc=(r,e)=>(e.prototype.name=r,function(...t){Sn(this,{name:r,plugin:e,instance:null},!0);const i=new e(this,...t);return this[r]=()=>i,Sn(this,i.getEventHash()),i});class gt{constructor(e){if(this.constructor===gt)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),Oo(this),delete this.trigger,Ah(this,this.constructor.defaultState),gd(e,this.name),this.dispose=this.dispose.bind(this),e.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(e={}){return e.name=this.name,e.plugin=this.constructor,e.instance=this,e}trigger(e,t={}){return Cr(this.eventBusEl_,e,this.getEventHash(t))}handleStateChanged(e){}dispose(){const{name:e,player:t}=this;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[or][e]=!1,this.player=this.state=null,t[e]=uc(e,tr[e])}static isBasic(e){const t=typeof e=="string"?an(e):e;return typeof t=="function"&&!gt.prototype.isPrototypeOf(t.prototype)}static registerPlugin(e,t){if(typeof e!="string")throw new Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`);if(Tn(e))be.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(Ee.prototype.hasOwnProperty(e))throw new Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`);if(typeof t!="function")throw new Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`);return tr[e]=t,e!==vn&&(gt.isBasic(t)?Ee.prototype[e]=G_(e,t):Ee.prototype[e]=uc(e,t)),t}static deregisterPlugin(e){if(e===vn)throw new Error("Cannot de-register base plugin.");Tn(e)&&(delete tr[e],delete Ee.prototype[e])}static getPlugins(e=Object.keys(tr)){let t;return e.forEach(i=>{const s=an(i);s&&(t=t||{},t[i]=s)}),t}static getPluginVersion(e){const t=an(e);return t&&t.VERSION||""}}gt.getPlugin=an;gt.BASE_PLUGIN_NAME=vn;gt.registerPlugin(vn,gt);Ee.prototype.usingPlugin=function(r){return!!this[or]&&this[or][r]===!0};Ee.prototype.hasPlugin=function(r){return!!Tn(r)};function X_(r,e){let t=!1;return function(...i){return t||be.warn(r),t=!0,e.apply(this,i)}}function Ut(r,e,t,i){return X_(`${e} is deprecated and will be removed in ${r}.0; please use ${t} instead.`,i)}var K_={NetworkBadStatus:"networkbadstatus",NetworkRequestFailed:"networkrequestfailed",NetworkRequestAborted:"networkrequestaborted",NetworkRequestTimeout:"networkrequesttimeout",NetworkBodyParserFailed:"networkbodyparserfailed",StreamingHlsPlaylistParserError:"streaminghlsplaylistparsererror",StreamingDashManifestParserError:"streamingdashmanifestparsererror",StreamingContentSteeringParserError:"streamingcontentsteeringparsererror",StreamingVttParserError:"streamingvttparsererror",StreamingFailedToSelectNextSegment:"streamingfailedtoselectnextsegment",StreamingFailedToDecryptSegment:"streamingfailedtodecryptsegment",StreamingFailedToTransmuxSegment:"streamingfailedtotransmuxsegment",StreamingFailedToAppendSegment:"streamingfailedtoappendsegment",StreamingCodecsChangeError:"streamingcodecschangeerror"};const fd=r=>r.indexOf("#")===0?r.slice(1):r;function j(r,e,t){let i=j.getPlayer(r);if(i)return e&&be.warn(`Player "${r}" is already initialised. Options will not be applied.`),t&&i.ready(t),i;const s=typeof r=="string"?Ei("#"+fd(r)):r;if(!Er(s))throw new TypeError("The element or ID supplied is not valid. (videojs)");const n="getRootNode"in s&&s.getRootNode()instanceof A.ShadowRoot?s.getRootNode():s.ownerDocument.body;(!s.ownerDocument.defaultView||!n.contains(s))&&be.warn("The element supplied is not included in the DOM"),e=e||{},e.restoreEl===!0&&(e.restoreEl=(s.parentNode&&s.parentNode.hasAttribute&&s.parentNode.hasAttribute("data-vjs-player")?s.parentNode:s).cloneNode(!0)),Si("beforesetup").forEach(u=>{const c=u(s,Ae(e));if(!Kt(c)||Array.isArray(c)){be.error("please return an object in beforesetup hooks");return}e=Ae(e,c)});const a=X.getComponent("Player");return i=new a(s,e,t),Si("setup").forEach(u=>u(i)),i}j.hooks_=ii;j.hooks=Si;j.hook=Dy;j.hookOnce=Iy;j.removeHook=Jc;if(A.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&Sr()){let r=Ei(".vjs-styles-defaults");if(!r){r=Sh("vjs-styles-defaults");const e=Ei("head");e&&e.insertBefore(r,e.firstChild),Eh(r,`
196
+ .video-js {
197
+ width: 300px;
198
+ height: 150px;
199
+ }
200
+
201
+ .vjs-fluid:not(.vjs-audio-only-mode) {
202
+ padding-top: 56.25%
203
+ }
204
+ `)}}eo(1,j);j.VERSION=Ya;j.options=Ee.prototype.options_;j.getPlayers=()=>Ee.players;j.getPlayer=r=>{const e=Ee.players;let t;if(typeof r=="string"){const i=fd(r),s=e[i];if(s)return s;t=Ei("#"+i)}else t=r;if(Er(t)){const{player:i,playerId:s}=t;if(i||e[s])return i||e[s]}};j.getAllPlayers=()=>Object.keys(Ee.players).map(r=>Ee.players[r]).filter(Boolean);j.players=Ee.players;j.getComponent=X.getComponent;j.registerComponent=(r,e)=>(ge.isTech(e)&&be.warn(`The ${r} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),X.registerComponent.call(X,r,e));j.getTech=ge.getTech;j.registerTech=ge.registerTech;j.use=r_;Object.defineProperty(j,"middleware",{value:{},writeable:!1,enumerable:!0});Object.defineProperty(j.middleware,"TERMINATOR",{value:_n,writeable:!1,enumerable:!0});j.browser=oh;j.obj=Oy;j.mergeOptions=Ut(9,"videojs.mergeOptions","videojs.obj.merge",Ae);j.defineLazyProperty=Ut(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",On);j.bind=Ut(9,"videojs.bind","native Function.prototype.bind",De);j.registerPlugin=gt.registerPlugin;j.deregisterPlugin=gt.deregisterPlugin;j.plugin=(r,e)=>(be.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),gt.registerPlugin(r,e));j.getPlugins=gt.getPlugins;j.getPlugin=gt.getPlugin;j.getPluginVersion=gt.getPluginVersion;j.addLanguage=function(r,e){return r=(""+r).toLowerCase(),j.options.languages=Ae(j.options.languages,{[r]:e}),j.options.languages[r]};j.log=be;j.createLogger=Zc;j.time=Xy;j.createTimeRange=Ut(9,"videojs.createTimeRange","videojs.time.createTimeRanges",Mt);j.createTimeRanges=Ut(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",Mt);j.formatTime=Ut(9,"videojs.formatTime","videojs.time.formatTime",zi);j.setFormatTime=Ut(9,"videojs.setFormatTime","videojs.time.setFormatTime",Ih);j.resetFormatTime=Ut(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",Ph);j.parseUrl=Ut(9,"videojs.parseUrl","videojs.url.parseUrl",Bo);j.isCrossOrigin=Ut(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",zn);j.EventTarget=vt;j.any=Lo;j.on=bt;j.one=Hn;j.off=tt;j.trigger=Cr;j.xhr=Bc;j.TrackList=Wi;j.TextTrack=gs;j.TextTrackList=Ro;j.AudioTrack=Mh;j.AudioTrackList=Oh;j.VideoTrack=Bh;j.VideoTrackList=Nh;["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(r=>{j[r]=function(){return be.warn(`videojs.${r}() is deprecated; use videojs.dom.${r}() instead`),vh[r].apply(null,arguments)}});j.computedStyle=Ut(9,"videojs.computedStyle","videojs.dom.computedStyle",vr);j.dom=vh;j.fn=$y;j.num=C_;j.str=Wy;j.url=t_;j.Error=K_;/*! @name videojs-contrib-quality-levels @version 4.1.0 @license Apache-2.0 */class Y_{constructor(e){let t=this;return t.id=e.id,t.label=t.id,t.width=e.width,t.height=e.height,t.bitrate=e.bandwidth,t.frameRate=e.frameRate,t.enabled_=e.enabled,Object.defineProperty(t,"enabled",{get(){return t.enabled_()},set(i){t.enabled_(i)}}),t}}class En extends j.EventTarget{constructor(){super();let e=this;return e.levels_=[],e.selectedIndex_=-1,Object.defineProperty(e,"selectedIndex",{get(){return e.selectedIndex_}}),Object.defineProperty(e,"length",{get(){return e.levels_.length}}),e[Symbol.iterator]=()=>e.levels_.values(),e}addQualityLevel(e){let t=this.getQualityLevelById(e.id);if(t)return t;const i=this.levels_.length;return t=new Y_(e),""+i in this||Object.defineProperty(this,i,{get(){return this.levels_[i]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t}removeQualityLevel(e){let t=null;for(let i=0,s=this.length;i<s;i++)if(this[i]===e){t=this.levels_.splice(i,1)[0],this.selectedIndex_===i?this.selectedIndex_=-1:this.selectedIndex_>i&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t}getQualityLevelById(e){for(let t=0,i=this.length;t<i;t++){const s=this[t];if(s.id===e)return s}return null}dispose(){this.selectedIndex_=-1,this.levels_.length=0}}En.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"};for(const r in En.prototype.allowedEvents_)En.prototype["on"+r]=null;var yd="4.1.0";const Q_=function(r,e){const t=r.qualityLevels,i=new En,s=function(){i.dispose(),r.qualityLevels=t,r.off("dispose",s)};return r.on("dispose",s),r.qualityLevels=()=>i,r.qualityLevels.VERSION=yd,i},_d=function(r){return Q_(this,j.obj.merge({},r))};j.registerPlugin("qualityLevels",_d);_d.VERSION=yd;/*! @name @videojs/http-streaming @version 3.17.2 @license Apache-2.0 */const pt=Dn,Cn=(r,e)=>e&&e.responseURL&&r!==e.responseURL?e.responseURL:r,Pt=r=>j.log.debug?j.log.debug.bind(j,"VHS:",`${r} >`):function(){};function Ce(...r){const e=j.obj||j;return(e.merge||e.mergeOptions).apply(e,r)}function rt(...r){const e=j.time||j;return(e.createTimeRanges||e.createTimeRanges).apply(e,r)}function J_(r){if(r.length===0)return"Buffered Ranges are empty";let e=`Buffered Ranges:
205
+ `;for(let t=0;t<r.length;t++){const i=r.start(t),s=r.end(t);e+=`${i} --> ${s}. Duration (${s-i})
206
+ `}return e}const Wt=1/30,Gt=Wt*3,bd=function(r,e){const t=[];let i;if(r&&r.length)for(i=0;i<r.length;i++)e(r.start(i),r.end(i))&&t.push([r.start(i),r.end(i)]);return rt(t)},ir=function(r,e){return bd(r,function(t,i){return t-Gt<=e&&i+Gt>=e})},en=function(r,e){return bd(r,function(t){return t-Wt>=e})},Z_=function(r){if(r.length<2)return rt();const e=[];for(let t=1;t<r.length;t++){const i=r.end(t-1),s=r.start(t);e.push([i,s])}return rt(e)},e2=function(r,e){let t=null,i=null,s=0;const n=[],a=[];if(!r||!r.length||!e||!e.length)return rt();let u=r.length;for(;u--;)n.push({time:r.start(u),type:"start"}),n.push({time:r.end(u),type:"end"});for(u=e.length;u--;)n.push({time:e.start(u),type:"start"}),n.push({time:e.end(u),type:"end"});for(n.sort(function(c,m){return c.time-m.time}),u=0;u<n.length;u++)n[u].type==="start"?(s++,s===2&&(t=n[u].time)):n[u].type==="end"&&(s--,s===1&&(i=n[u].time)),t!==null&&i!==null&&(a.push([t,i]),t=null,i=null);return rt(a)},vd=r=>{const e=[];if(!r||!r.length)return"";for(let t=0;t<r.length;t++)e.push(r.start(t)+" => "+r.end(t));return e.join(", ")},t2=function(r,e,t=1){return((r.length?r.end(r.length-1):0)-e)/t},Fi=r=>{const e=[];for(let t=0;t<r.length;t++)e.push({start:r.start(t),end:r.end(t)});return e},i2=function(r,e){if(r===e)return!1;if(!r&&e||!e&&r||r.length!==e.length)return!0;for(let t=0;t<r.length;t++)if(r.start(t)!==e.start(t)||r.end(t)!==e.end(t))return!0;return!1},Fa=function(r){if(!(!r||!r.length||!r.end))return r.end(r.length-1)},eu=function(r,e){let t=0;if(!r||!r.length)return t;for(let i=0;i<r.length;i++){const s=r.start(i),n=r.end(i);if(!(e>n)){if(e>s&&e<=n){t+=n-e;continue}t+=n-s}}return t},tu=(r,e)=>{if(!e.preload)return e.duration;let t=0;return(e.parts||[]).forEach(function(i){t+=i.duration}),(e.preloadHints||[]).forEach(function(i){i.type==="PART"&&(t+=r.partTargetDuration)}),t},uo=r=>(r.segments||[]).reduce((e,t,i)=>(t.parts?t.parts.forEach(function(s,n){e.push({duration:s.duration,segmentIndex:i,partIndex:n,part:s,segment:t})}):e.push({duration:t.duration,segmentIndex:i,partIndex:null,segment:t,part:null}),e),[]),Td=r=>{const e=r.segments&&r.segments.length&&r.segments[r.segments.length-1];return e&&e.parts||[]},Sd=({preloadSegment:r})=>{if(!r)return;const{parts:e,preloadHints:t}=r;let i=(t||[]).reduce((s,n)=>s+(n.type==="PART"?1:0),0);return i+=e&&e.length?e.length:0,i},Ed=(r,e)=>{if(e.endList)return 0;if(r&&r.suggestedPresentationDelay)return r.suggestedPresentationDelay;const t=Td(e).length>0;return t&&e.serverControl&&e.serverControl.partHoldBack?e.serverControl.partHoldBack:t&&e.partTargetDuration?e.partTargetDuration*3:e.serverControl&&e.serverControl.holdBack?e.serverControl.holdBack:e.targetDuration?e.targetDuration*3:0},r2=function(r,e){let t=0,i=e-r.mediaSequence,s=r.segments[i];if(s){if(typeof s.start<"u")return{result:s.start,precise:!0};if(typeof s.end<"u")return{result:s.end-s.duration,precise:!0}}for(;i--;){if(s=r.segments[i],typeof s.end<"u")return{result:t+s.end,precise:!0};if(t+=tu(r,s),typeof s.start<"u")return{result:t+s.start,precise:!0}}return{result:t,precise:!1}},s2=function(r,e){let t=0,i,s=e-r.mediaSequence;for(;s<r.segments.length;s++){if(i=r.segments[s],typeof i.start<"u")return{result:i.start-t,precise:!0};if(t+=tu(r,i),typeof i.end<"u")return{result:i.end-t,precise:!0}}return{result:-1,precise:!1}},Cd=function(r,e,t){if(typeof e>"u"&&(e=r.mediaSequence+r.segments.length),e<r.mediaSequence)return 0;const i=r2(r,e);if(i.precise)return i.result;const s=s2(r,e);return s.precise?s.result:i.result+t},wd=function(r,e,t){if(!r)return 0;if(typeof t!="number"&&(t=0),typeof e>"u"){if(r.totalDuration)return r.totalDuration;if(!r.endList)return A.Infinity}return Cd(r,e,t)},as=function({defaultDuration:r,durationList:e,startIndex:t,endIndex:i}){let s=0;if(t>i&&([t,i]=[i,t]),t<0){for(let n=t;n<Math.min(0,i);n++)s+=r;t=0}for(let n=t;n<i;n++)s+=e[n].duration;return s},kd=function(r,e,t,i){if(!r||!r.segments)return null;if(r.endList)return wd(r);if(e===null)return null;e=e||0;let s=Cd(r,r.mediaSequence+r.segments.length,e);return t&&(i=typeof i=="number"?i:Ed(null,r),s-=i),Math.max(0,s)},n2=function(r,e,t){const i=e||0;let s=kd(r,e,!0,t);return s===null?rt():(s<i&&(s=i),rt(i,s))},a2=function({playlist:r,currentTime:e,startingSegmentIndex:t,startingPartIndex:i,startTime:s,exactManifestTimings:n}){let a=e-s;const u=uo(r);let c=0;for(let m=0;m<u.length;m++){const f=u[m];if(t===f.segmentIndex&&!(typeof i=="number"&&typeof f.partIndex=="number"&&i!==f.partIndex)){c=m;break}}if(a<0){if(c>0)for(let m=c-1;m>=0;m--){const f=u[m];if(a+=f.duration,n){if(a<0)continue}else if(a+Wt<=0)continue;return{partIndex:f.partIndex,segmentIndex:f.segmentIndex,startTime:s-as({defaultDuration:r.targetDuration,durationList:u,startIndex:c,endIndex:m})}}return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:e}}if(c<0){for(let m=c;m<0;m++)if(a-=r.targetDuration,a<0)return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:e};c=0}for(let m=c;m<u.length;m++){const f=u[m];a-=f.duration;const _=f.duration>Wt,P=a===0,S=_&&a+Wt>=0;if(!((P||S)&&m!==u.length-1)){if(n){if(a>0)continue}else if(a-Wt>=0)continue;return{partIndex:f.partIndex,segmentIndex:f.segmentIndex,startTime:s+as({defaultDuration:r.targetDuration,durationList:u,startIndex:c,endIndex:m})}}}return{segmentIndex:u[u.length-1].segmentIndex,partIndex:u[u.length-1].partIndex,startTime:e}},Ad=function(r){return r.excludeUntil&&r.excludeUntil>Date.now()},iu=function(r){return r.excludeUntil&&r.excludeUntil===1/0},Kn=function(r){const e=Ad(r);return!r.disabled&&!e},o2=function(r){return r.disabled},u2=function(r){for(let e=0;e<r.segments.length;e++)if(r.segments[e].key)return!0;return!1},xd=function(r,e){return e.attributes&&e.attributes[r]},l2=function(r,e,t,i=0){return xd("BANDWIDTH",t)?(r*t.attributes.BANDWIDTH-i*8)/e:NaN},lo=(r,e)=>{if(r.playlists.length===1)return!0;const t=e.attributes.BANDWIDTH||Number.MAX_VALUE;return r.playlists.filter(i=>Kn(i)?(i.attributes.BANDWIDTH||0)<t:!1).length===0},ru=(r,e)=>!r&&!e||!r&&e||r&&!e?!1:!!(r===e||r.id&&e.id&&r.id===e.id||r.resolvedUri&&e.resolvedUri&&r.resolvedUri===e.resolvedUri||r.uri&&e.uri&&r.uri===e.uri),lc=function(r,e){const t=r&&r.mediaGroups&&r.mediaGroups.AUDIO||{};let i=!1;for(const s in t){for(const n in t[s])if(i=e(t[s][n]),i)break;if(i)break}return!!i},bs=r=>{if(!r||!r.playlists||!r.playlists.length)return lc(r,e=>e.playlists&&e.playlists.length||e.uri);for(let e=0;e<r.playlists.length;e++){const t=r.playlists[e],i=t.attributes&&t.attributes.CODECS;if(!(i&&i.split(",").every(s=>jc(s))||lc(r,s=>ru(t,s))))return!1}return!0};var mt={liveEdgeDelay:Ed,duration:wd,seekable:n2,getMediaInfoForTime:a2,isEnabled:Kn,isDisabled:o2,isExcluded:Ad,isIncompatible:iu,playlistEnd:kd,isAes:u2,hasAttribute:xd,estimateSegmentRequestTime:l2,isLowestEnabledRendition:lo,isAudioOnly:bs,playlistMatch:ru,segmentDurationWithParts:tu};const{log:Dd}=j,ur=(r,e)=>`${r}-${e}`,Id=(r,e,t)=>`placeholder-uri-${r}-${e}-${t}`,c2=({onwarn:r,oninfo:e,manifestString:t,customTagParsers:i=[],customTagMappers:s=[],llhls:n})=>{const a=new Yg;r&&a.on("warn",r),e&&a.on("info",e),i.forEach(m=>a.addParser(m)),s.forEach(m=>a.addTagMapper(m)),a.push(t),a.end();const u=a.manifest;if(n||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(m){u.hasOwnProperty(m)&&delete u[m]}),u.segments&&u.segments.forEach(function(m){["parts","preloadHints"].forEach(function(f){m.hasOwnProperty(f)&&delete m[f]})})),!u.targetDuration){let m=10;u.segments&&u.segments.length&&(m=u.segments.reduce((f,_)=>Math.max(f,_.duration),0)),r&&r({message:`manifest has no targetDuration defaulting to ${m}`}),u.targetDuration=m}const c=Td(u);if(c.length&&!u.partTargetDuration){const m=c.reduce((f,_)=>Math.max(f,_.duration),0);r&&(r({message:`manifest has no partTargetDuration defaulting to ${m}`}),Dd.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),u.partTargetDuration=m}return u},xr=(r,e)=>{r.mediaGroups&&["AUDIO","SUBTITLES"].forEach(t=>{if(r.mediaGroups[t])for(const i in r.mediaGroups[t])for(const s in r.mediaGroups[t][i]){const n=r.mediaGroups[t][i][s];e(n,t,i,s)}})},Pd=({playlist:r,uri:e,id:t})=>{r.id=t,r.playlistErrors_=0,e&&(r.uri=e),r.attributes=r.attributes||{}},h2=r=>{let e=r.playlists.length;for(;e--;){const t=r.playlists[e];Pd({playlist:t,id:ur(e,t.uri)}),t.resolvedUri=pt(r.uri,t.uri),r.playlists[t.id]=t,r.playlists[t.uri]=t,t.attributes.BANDWIDTH||Dd.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},d2=r=>{xr(r,e=>{e.uri&&(e.resolvedUri=pt(r.uri,e.uri))})},p2=(r,e)=>{const t=ur(0,e),i={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:A.location.href,resolvedUri:A.location.href,playlists:[{uri:e,id:t,resolvedUri:e,attributes:{}}]};return i.playlists[t]=i.playlists[0],i.playlists[e]=i.playlists[0],i},Ld=(r,e,t=Id)=>{r.uri=e;for(let s=0;s<r.playlists.length;s++)if(!r.playlists[s].uri){const n=`placeholder-uri-${s}`;r.playlists[s].uri=n}const i=bs(r);xr(r,(s,n,a,u)=>{if(!s.playlists||!s.playlists.length){if(i&&n==="AUDIO"&&!s.uri)for(let c=0;c<r.playlists.length;c++){const m=r.playlists[c];if(m.attributes&&m.attributes.AUDIO&&m.attributes.AUDIO===a)return}s.playlists=[qe({},s)]}s.playlists.forEach(function(c,m){const f=t(n,a,u,c),_=ur(m,f);c.uri?c.resolvedUri=c.resolvedUri||pt(r.uri,c.uri):(c.uri=m===0?f:_,c.resolvedUri=c.uri),c.id=c.id||_,c.attributes=c.attributes||{},r.playlists[c.id]=c,r.playlists[c.uri]=c})}),h2(r),d2(r)};class cc{constructor(){this.offset_=null,this.pendingDateRanges_=new Map,this.processedDateRanges_=new Map}setOffset(e=[]){if(this.offset_!==null||!e.length)return;const[t]=e;t.programDateTime!==void 0&&(this.offset_=t.programDateTime/1e3)}setPendingDateRanges(e=[]){if(!e.length)return;const[t]=e,i=t.startDate.getTime();this.trimProcessedDateRanges_(i),this.pendingDateRanges_=e.reduce((s,n)=>(s.set(n.id,n),s),new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id),this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(this.offset_===null)return[];const e={},t=[];this.pendingDateRanges_.forEach((i,s)=>{if(!this.processedDateRanges_.has(s)&&(i.startTime=i.startDate.getTime()/1e3-this.offset_,i.processDateRange=()=>this.processDateRange(i),t.push(i),!!i.class))if(e[i.class]){const n=e[i.class].push(i);i.classListIndex=n-1}else e[i.class]=[i],i.classListIndex=0});for(const i of t){const s=e[i.class]||[];i.endDate?i.endTime=i.endDate.getTime()/1e3-this.offset_:i.endOnNext&&s[i.classListIndex+1]?i.endTime=s[i.classListIndex+1].startTime:i.duration?i.endTime=i.startTime+i.duration:i.plannedDuration?i.endTime=i.startTime+i.plannedDuration:i.endTime=i.startTime}return t}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach((t,i)=>{t.startDate.getTime()<e&&this.processedDateRanges_.delete(i)})}}const Od=22,Vi=({requestType:r,request:e,error:t,parseFailure:i})=>{const s=e.status<200||e.status>299,n=e.status>=400&&e.status<=499,a={uri:e.uri,requestType:r},u=s&&!n||i;if(t&&n)a.error=qe({},t),a.errorType=j.Error.NetworkRequestFailed;else if(e.aborted)a.errorType=j.Error.NetworkRequestAborted;else if(e.timedout)a.errorType=j.Error.NetworkRequestTimeout;else if(u){const c=i?j.Error.NetworkBodyParserFailed:j.Error.NetworkBadStatus;a.errorType=c,a.status=e.status,a.headers=e.headers}return a},m2=Pt("CodecUtils"),Nd=function(r){const e=r.attributes||{};if(e.CODECS)return Ht(e.CODECS)},Rd=(r,e)=>{const t=e.attributes||{};return r&&r.mediaGroups&&r.mediaGroups.AUDIO&&t.AUDIO&&r.mediaGroups.AUDIO[t.AUDIO]},g2=(r,e)=>{if(!Rd(r,e))return!0;const t=e.attributes||{},i=r.mediaGroups.AUDIO[t.AUDIO];for(const s in i)if(!i[s].uri&&!i[s].playlists)return!0;return!1},ds=function(r){const e={};return r.forEach(({mediaType:t,type:i,details:s})=>{e[t]=e[t]||[],e[t].push(Fc(`${i}${s}`))}),Object.keys(e).forEach(function(t){if(e[t].length>1){m2(`multiple ${t} codecs found as attributes: ${e[t].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),e[t]=null;return}e[t]=e[t][0]}),e},hc=function(r){let e=0;return r.audio&&e++,r.video&&e++,e},os=function(r,e){const t=e.attributes||{},i=ds(Nd(e)||[]);if(Rd(r,e)&&!i.audio&&!g2(r,e)){const s=ds(Jg(r,t.AUDIO)||[]);s.audio&&(i.audio=s.audio)}return i},{EventTarget:f2}=j,y2=(r,e)=>{if(e.endList||!e.serverControl)return r;const t={};if(e.serverControl.canBlockReload){const{preloadSegment:i}=e;let s=e.mediaSequence+e.segments.length;if(i){const n=i.parts||[],a=Sd(e)-1;a>-1&&a!==n.length-1&&(t._HLS_part=a),(a>-1||n.length)&&s--}t._HLS_msn=s}if(e.serverControl&&e.serverControl.canSkipUntil&&(t._HLS_skip=e.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(t).length){const i=new A.URL(r);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(s){t.hasOwnProperty(s)&&i.searchParams.set(s,t[s])}),r=i.toString()}return r},_2=(r,e)=>{if(!r)return e;const t=Ce(r,e);if(r.preloadHints&&!e.preloadHints&&delete t.preloadHints,r.parts&&!e.parts)delete t.parts;else if(r.parts&&e.parts)for(let i=0;i<e.parts.length;i++)r.parts&&r.parts[i]&&(t.parts[i]=Ce(r.parts[i],e.parts[i]));return!r.skipped&&e.skipped&&(t.skipped=!1),r.preload&&!e.preload&&(t.preload=!1),t},b2=(r,e,t)=>{const i=r.slice(),s=e.slice();t=t||0;const n=[];let a;for(let u=0;u<s.length;u++){const c=i[u+t],m=s[u];c?(a=c.map||a,n.push(_2(c,m))):(a&&!m.map&&(m.map=a),n.push(m))}return n},Md=(r,e)=>{!r.resolvedUri&&r.uri&&(r.resolvedUri=pt(e,r.uri)),r.key&&!r.key.resolvedUri&&(r.key.resolvedUri=pt(e,r.key.uri)),r.map&&!r.map.resolvedUri&&(r.map.resolvedUri=pt(e,r.map.uri)),r.map&&r.map.key&&!r.map.key.resolvedUri&&(r.map.key.resolvedUri=pt(e,r.map.key.uri)),r.parts&&r.parts.length&&r.parts.forEach(t=>{t.resolvedUri||(t.resolvedUri=pt(e,t.uri))}),r.preloadHints&&r.preloadHints.length&&r.preloadHints.forEach(t=>{t.resolvedUri||(t.resolvedUri=pt(e,t.uri))})},Bd=function(r){const e=r.segments||[],t=r.preloadSegment;if(t&&t.parts&&t.parts.length){if(t.preloadHints){for(let i=0;i<t.preloadHints.length;i++)if(t.preloadHints[i].type==="MAP")return e}t.duration=r.targetDuration,t.preload=!0,e.push(t)}return e},Ud=(r,e)=>r===e||r.segments&&e.segments&&r.segments.length===e.segments.length&&r.endList===e.endList&&r.mediaSequence===e.mediaSequence&&r.preloadSegment===e.preloadSegment,co=(r,e,t=Ud)=>{const i=Ce(r,{}),s=i.playlists[e.id];if(!s||t(s,e))return null;e.segments=Bd(e);const n=Ce(s,e);if(n.preloadSegment&&!e.preloadSegment&&delete n.preloadSegment,s.segments){if(e.skip){e.segments=e.segments||[];for(let a=0;a<e.skip.skippedSegments;a++)e.segments.unshift({skipped:!0})}n.segments=b2(s.segments,e.segments,e.mediaSequence-s.mediaSequence)}n.segments.forEach(a=>{Md(a,n.resolvedUri)});for(let a=0;a<i.playlists.length;a++)i.playlists[a].id===e.id&&(i.playlists[a]=n);return i.playlists[e.id]=n,i.playlists[e.uri]=n,xr(r,(a,u,c,m)=>{if(a.playlists)for(let f=0;f<a.playlists.length;f++)e.id===a.playlists[f].id&&(a.playlists[f]=n)}),i},ho=(r,e)=>{const t=r.segments||[],i=t[t.length-1],s=i&&i.parts&&i.parts[i.parts.length-1],n=s&&s.duration||i&&i.duration;return e&&n?n*1e3:(r.partTargetDuration||r.targetDuration||10)*500},dc=(r,e,t)=>{if(!r)return;const i=[];return r.forEach(s=>{if(!s.attributes)return;const{BANDWIDTH:n,RESOLUTION:a,CODECS:u}=s.attributes;i.push({id:s.id,bandwidth:n,resolution:a,codecs:u})}),{type:e,isLive:t,renditions:i}};class rr extends f2{constructor(e,t,i={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=Pt("PlaylistLoader");const{withCredentials:s=!1}=i;this.src=e,this.vhs_=t,this.withCredentials=s,this.addDateRangesToTextTrack_=i.addDateRangesToTextTrack;const n=t.options_;this.customTagParsers=n&&n.customTagParsers||[],this.customTagMappers=n&&n.customTagMappers||[],this.llhls=n&&n.llhls,this.dateRangesStorage_=new cc,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_),this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){const e=this.media();if(!e)return;this.dateRangesStorage_.setOffset(e.segments),this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);const t=this.dateRangesStorage_.getDateRangesToProcess();!t.length||!this.addDateRangesToTextTrack_||this.addDateRangesToTextTrack_(t)}handleMediaupdatetimeout_(){if(this.state!=="HAVE_METADATA")return;const e=this.media();let t=pt(this.main.uri,e.uri);this.llhls&&(t=y2(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials,requestType:"hls-playlist"},(i,s)=>{if(this.request){if(i)return this.playlistRequestError(this.request,this.media(),"HAVE_METADATA");this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})}})}playlistRequestError(e,t,i){const{uri:s,id:n}=t;this.request=null,i&&(this.state=i),this.error={playlist:this.main.playlists[n],status:e.status,message:`HLS playlist request error at URL: ${s}.`,responseText:e.responseText,code:e.status>=500?4:2,metadata:Vi({requestType:e.requestType,request:e,error:e.error})},this.trigger("error")}parseManifest_({url:e,manifestString:t}){try{const i=c2({onwarn:({message:s})=>this.logger_(`m3u8-parser warn for ${e}: ${s}`),oninfo:({message:s})=>this.logger_(`m3u8-parser info for ${e}: ${s}`),manifestString:t,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls});return!i.playlists||!i.playlists.length||this.excludeAudioOnlyVariants(i.playlists),i}catch(i){this.error=i,this.error.metadata={errorType:j.Error.StreamingHlsPlaylistParserError,error:i}}}excludeAudioOnlyVariants(e){const t=i=>{const s=i.attributes||{},{width:n,height:a}=s.RESOLUTION||{};if(n&&a)return!0;const u=Nd(i)||[];return!!ds(u).video};e.some(t)&&e.forEach(i=>{t(i)||(i.excludeUntil=1/0)})}haveMetadata({playlistString:e,playlistObject:t,url:i,id:s}){this.request=null,this.state="HAVE_METADATA";const n={playlistInfo:{type:"media",uri:i}};this.trigger({type:"playlistparsestart",metadata:n});const a=t||this.parseManifest_({url:i,manifestString:e});a.lastRequest=Date.now(),Pd({playlist:a,uri:i,id:s});const u=co(this.main,a);this.targetDuration=a.partTargetDuration||a.targetDuration,this.pendingMedia_=null,u?(this.main=u,this.media_=this.main.playlists[s]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(ho(this.media(),!!u)),n.parsedPlaylist=dc(this.main.playlists,n.playlistInfo.type,!this.media_.endList),this.trigger({type:"playlistparsecomplete",metadata:n}),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),A.clearTimeout(this.mediaUpdateTimeout),A.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new cc,this.off()}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e,t){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);if(typeof e=="string"){if(!this.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.main.playlists[e]}if(A.clearTimeout(this.finalRenditionTimeout),t){const u=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=A.setTimeout(this.media.bind(this,e,!1),u);return}const i=this.state,s=!this.media_||e.id!==this.media_.id,n=this.main.playlists[e.id];if(n&&n.endList||e.endList&&e.segments.length){this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,s&&(this.trigger("mediachanging"),i==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange"));return}if(this.updateMediaUpdateTimeout_(ho(e,!0)),!s)return;if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e;const a={playlistInfo:{type:"media",uri:e.uri}};this.trigger({type:"playlistrequeststart",metadata:a}),this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials,requestType:"hls-playlist"},(u,c)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=Cn(e.resolvedUri,c),u)return this.playlistRequestError(this.request,e,i);this.trigger({type:"playlistrequestcomplete",metadata:a}),this.haveMetadata({playlistString:c.responseText,url:e.uri,id:e.id}),i==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}})}pause(){this.mediaUpdateTimeout&&(A.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),this.state==="HAVE_NOTHING"&&(this.started=!1),this.state==="SWITCHING_MEDIA"?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MAIN_MANIFEST":this.state==="HAVE_CURRENT_METADATA"&&(this.state="HAVE_METADATA")}load(e){this.mediaUpdateTimeout&&(A.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const t=this.media();if(e){const i=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=A.setTimeout(()=>{this.mediaUpdateTimeout=null,this.load()},i);return}if(!this.started){this.start();return}t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist")}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(A.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),!(!this.media()||this.media().endList)&&(this.mediaUpdateTimeout=A.setTimeout(()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(e)},e))}start(){if(this.started=!0,typeof this.src=="object"){this.src.uri||(this.src.uri=A.location.href),this.src.resolvedUri=this.src.uri,setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);return}const e={playlistInfo:{type:"multivariant",uri:this.src}};this.trigger({type:"playlistrequeststart",metadata:e}),this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials,requestType:"hls-playlist"},(t,i)=>{if(!this.request)return;if(this.request=null,t)return this.error={status:i.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:i.responseText,code:2,metadata:Vi({requestType:i.requestType,request:i,error:t})},this.state==="HAVE_NOTHING"&&(this.started=!1),this.trigger("error");this.trigger({type:"playlistrequestcomplete",metadata:e}),this.src=Cn(this.src,i),this.trigger({type:"playlistparsestart",metadata:e});const s=this.parseManifest_({manifestString:i.responseText,url:this.src});e.parsedPlaylist=dc(s.playlists,e.playlistInfo.type,!1),this.trigger({type:"playlistparsecomplete",metadata:e}),this.setupInitialPlaylist(s)})}srcUri(){return typeof this.src=="string"?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists){this.main=e,Ld(this.main,this.srcUri()),e.playlists.forEach(i=>{i.segments=Bd(i),i.segments.forEach(s=>{Md(s,i.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.main.playlists[0]);return}const t=this.srcUri()||A.location.href;this.main=p2(e,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(e,t){const i=this.main,s=e.ID;let n=i.playlists.length;for(;n--;){const a=i.playlists[n];if(a.attributes["PATHWAY-ID"]===s){const u=a.resolvedUri,c=a.id;if(t){const m=this.createCloneURI_(a.resolvedUri,e),f=ur(s,m),_=this.createCloneAttributes_(s,a.attributes),P=this.createClonePlaylist_(a,f,e,_);i.playlists[n]=P,i.playlists[f]=P,i.playlists[m]=P}else i.playlists.splice(n,1);delete i.playlists[c],delete i.playlists[u]}}this.updateOrDeleteCloneMedia(e,t)}updateOrDeleteCloneMedia(e,t){const i=this.main,s=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{if(!(!i.mediaGroups[n]||!i.mediaGroups[n][s])){for(const a in i.mediaGroups[n])if(a===s){for(const u in i.mediaGroups[n][a])i.mediaGroups[n][a][u].playlists.forEach((c,m)=>{const f=i.playlists[c.id],_=f.id,P=f.resolvedUri;delete i.playlists[_],delete i.playlists[P]});delete i.mediaGroups[n][a]}}}),t&&this.createClonedMediaGroups_(e)}addClonePathway(e,t={}){const i=this.main,s=i.playlists.length,n=this.createCloneURI_(t.resolvedUri,e),a=ur(e.ID,n),u=this.createCloneAttributes_(e.ID,t.attributes),c=this.createClonePlaylist_(t,a,e,u);i.playlists[s]=c,i.playlists[a]=c,i.playlists[n]=c,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){const t=e.ID,i=e["BASE-ID"],s=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{if(!(!s.mediaGroups[n]||s.mediaGroups[n][t]))for(const a in s.mediaGroups[n]){if(a===i)s.mediaGroups[n][t]={};else continue;for(const u in s.mediaGroups[n][a]){const c=s.mediaGroups[n][a][u];s.mediaGroups[n][t][u]=qe({},c);const m=s.mediaGroups[n][t][u],f=this.createCloneURI_(c.resolvedUri,e);m.resolvedUri=f,m.uri=f,m.playlists=[],c.playlists.forEach((_,P)=>{const S=s.playlists[_.id],R=Id(n,t,u),b=ur(t,R);if(S&&!s.playlists[b]){const I=this.createClonePlaylist_(S,b,e),M=I.resolvedUri;s.playlists[b]=I,s.playlists[M]=I}m.playlists[P]=this.createClonePlaylist_(_,b,e)})}}})}createClonePlaylist_(e,t,i,s){const n=this.createCloneURI_(e.resolvedUri,i),a={resolvedUri:n,uri:n,id:t};return e.segments&&(a.segments=[]),s&&(a.attributes=s),Ce(e,a)}createCloneURI_(e,t){const i=new URL(e);i.hostname=t["URI-REPLACEMENT"].HOST;const s=t["URI-REPLACEMENT"].PARAMS;for(const n of Object.keys(s))i.searchParams.set(n,s[n]);return i.href}createCloneAttributes_(e,t){const i={"PATHWAY-ID":e};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(s=>{t[s]&&(i[s]=e)}),i}getKeyIdSet(e){const t=new Set;if(!e||!e.contentProtection)return t;for(const i in e.contentProtection)if(e.contentProtection[i]&&e.contentProtection[i].attributes&&e.contentProtection[i].attributes.keyId){const s=e.contentProtection[i].attributes.keyId;t.add(s.toLowerCase())}return t}}const po=function(r,e,t,i){const s=r.responseType==="arraybuffer"?r.response:r.responseText;!e&&s&&(r.responseTime=Date.now(),r.roundTripTime=r.responseTime-r.requestTime,r.bytesReceived=s.byteLength||s.length,r.bandwidth||(r.bandwidth=Math.floor(r.bytesReceived/r.roundTripTime*8*1e3))),t.headers&&(r.responseHeaders=t.headers),e&&e.code==="ETIMEDOUT"&&(r.timedout=!0),!e&&!r.aborted&&t.statusCode!==200&&t.statusCode!==206&&t.statusCode!==0&&(e=new Error("XHR Failed with a response of: "+(r&&(s||r.responseText)))),i(e,r)},v2=(r,e)=>{if(!r||!r.size)return;let t=e;return r.forEach(i=>{t=i(t)}),t},T2=(r,e,t,i)=>{!r||!r.size||r.forEach(s=>{s(e,t,i)})},Fd=function(){const r=function e(t,i){t=Ce({timeout:45e3},t);const s=e.beforeRequest||j.Vhs.xhr.beforeRequest,n=e._requestCallbackSet||j.Vhs.xhr._requestCallbackSet||new Set,a=e._responseCallbackSet||j.Vhs.xhr._responseCallbackSet;s&&typeof s=="function"&&(j.log.warn("beforeRequest is deprecated, use onRequest instead."),n.add(s));const u=j.Vhs.xhr.original===!0?j.xhr:j.Vhs.xhr,c=v2(n,t);n.delete(s);const m=u(c||t,function(_,P){return T2(a,m,_,P),po(m,_,P,i)}),f=m.abort;return m.abort=function(){return m.aborted=!0,f.apply(m,arguments)},m.uri=t.uri,m.requestType=t.requestType,m.requestTime=Date.now(),m};return r.original=!0,r},S2=function(r){let e;const t=r.offset;return typeof r.offset=="bigint"||typeof r.length=="bigint"?e=A.BigInt(r.offset)+A.BigInt(r.length)-A.BigInt(1):e=r.offset+r.length-1,"bytes="+t+"-"+e},mo=function(r){const e={};return r.byterange&&(e.Range=S2(r.byterange)),e},E2=function(r,e){return r.start(e)+"-"+r.end(e)},C2=function(r,e){const t=r.toString(16);return"00".substring(0,2-t.length)+t+(e%2?" ":"")},w2=function(r){return r>=32&&r<126?String.fromCharCode(r):"."},jd=function(r){const e={};return Object.keys(r).forEach(t=>{const i=r[t];$c(i)?e[t]={bytes:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength}:e[t]=i}),e},wn=function(r){const e=r.byterange||{length:1/0,offset:0};return[e.length,e.offset,r.resolvedUri].join(",")},qd=function(r){return r.resolvedUri},$d=r=>{const e=Array.prototype.slice.call(r),t=16;let i="",s,n;for(let a=0;a<e.length/t;a++)s=e.slice(a*t,a*t+t).map(C2).join(""),n=e.slice(a*t,a*t+t).map(w2).join(""),i+=s+" "+n+`
207
+ `;return i},k2=({bytes:r})=>$d(r),A2=r=>{let e="",t;for(t=0;t<r.length;t++)e+=E2(r,t)+" ";return e};var x2=Object.freeze({__proto__:null,createTransferableMessage:jd,initSegmentId:wn,segmentKeyId:qd,hexDump:$d,tagDump:k2,textRanges:A2});const Hd=.25,D2=(r,e)=>{if(!e.dateTimeObject)return null;const t=e.videoTimingInfo.transmuxerPrependedSeconds,i=e.videoTimingInfo.transmuxedPresentationStart+t,s=r-i;return new Date(e.dateTimeObject.getTime()+s*1e3)},I2=r=>r.transmuxedPresentationEnd-r.transmuxedPresentationStart-r.transmuxerPrependedSeconds,P2=(r,e)=>{let t;try{t=new Date(r)}catch{return null}if(!e||!e.segments||e.segments.length===0)return null;let i=e.segments[0];if(t<new Date(i.dateTimeObject))return null;for(let c=0;c<e.segments.length-1;c++){i=e.segments[c];const m=new Date(e.segments[c+1].dateTimeObject);if(t<m)break}const s=e.segments[e.segments.length-1],n=s.dateTimeObject,a=s.videoTimingInfo?I2(s.videoTimingInfo):s.duration+s.duration*Hd,u=new Date(n.getTime()+a*1e3);return t>u?null:(t>new Date(n)&&(i=s),{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:mt.duration(e,e.mediaSequence+e.segments.indexOf(i)),type:i.videoTimingInfo?"accurate":"estimate"})},L2=(r,e)=>{if(!e||!e.segments||e.segments.length===0)return null;let t=0,i;for(let n=0;n<e.segments.length&&(i=e.segments[n],t=i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationEnd:t+i.duration,!(r<=t));n++);const s=e.segments[e.segments.length-1];if(s.videoTimingInfo&&s.videoTimingInfo.transmuxedPresentationEnd<r)return null;if(r>t){if(r>t+s.duration*Hd)return null;i=s}return{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:t-i.duration,type:i.videoTimingInfo?"accurate":"estimate"}},O2=(r,e)=>{let t,i;try{t=new Date(r),i=new Date(e)}catch{}const s=t.getTime();return(i.getTime()-s)/1e3},N2=r=>{if(!r.segments||r.segments.length===0)return!1;for(let e=0;e<r.segments.length;e++)if(!r.segments[e].dateTimeObject)return!1;return!0},R2=({playlist:r,time:e=void 0,callback:t})=>{if(!t)throw new Error("getProgramTime: callback must be provided");if(!r||e===void 0)return t({message:"getProgramTime: playlist and time must be provided"});const i=L2(e,r);if(!i)return t({message:"valid programTime was not found"});if(i.type==="estimate")return t({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:i.estimatedStart});const s={mediaSeconds:e},n=D2(e,i.segment);return n&&(s.programDateTime=n.toISOString()),t(null,s)},Vd=({programTime:r,playlist:e,retryCount:t=2,seekTo:i,pauseAfterSeek:s=!0,tech:n,callback:a})=>{if(!a)throw new Error("seekToProgramTime: callback must be provided");if(typeof r>"u"||!e||!i)return a({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!e.endList&&!n.hasStarted_)return a({message:"player must be playing a live stream to start buffering"});if(!N2(e))return a({message:"programDateTime tags must be provided in the manifest "+e.resolvedUri});const u=P2(r,e);if(!u)return a({message:`${r} was not found in the stream`});const c=u.segment,m=O2(c.dateTimeObject,r);if(u.type==="estimate"){if(t===0)return a({message:`${r} is not buffered yet. Try again`});i(u.estimatedStart+m),n.one("seeked",()=>{Vd({programTime:r,playlist:e,retryCount:t-1,seekTo:i,pauseAfterSeek:s,tech:n,callback:a})});return}const f=c.start+m,_=()=>a(null,n.currentTime());n.one("seeked",_),s&&n.pause(),i(f)},ja=(r,e)=>{if(r.readyState===4)return e()},M2=(r,e,t,i)=>{let s=[],n,a=!1;const u=function(f,_,P,S){return _.abort(),a=!0,t(f,_,P,S)},c=function(f,_){if(a)return;if(f)return f.metadata=Vi({requestType:i,request:_,error:f}),u(f,_,"",s);const P=_.responseText.substring(s&&s.byteLength||0,_.responseText.length);if(s=lf(s,Hc(P,!0)),n=n||Zr(s),s.length<10||n&&s.length<n+2)return ja(_,()=>u(f,_,"",s));const S=Ao(s);return S==="ts"&&s.length<188?ja(_,()=>u(f,_,"",s)):!S&&s.length<376?ja(_,()=>u(f,_,"",s)):u(null,_,S,s)},m=e({uri:r,beforeSend(f){f.overrideMimeType("text/plain; charset=x-user-defined"),f.addEventListener("progress",function({total:_,loaded:P}){return po(f,null,{statusCode:f.status},c)})}},function(f,_){return po(m,f,_,c)});return m},{EventTarget:B2}=j,pc=function(r,e){if(!Ud(r,e)||r.sidx&&e.sidx&&(r.sidx.offset!==e.sidx.offset||r.sidx.length!==e.sidx.length)||!r.sidx&&e.sidx||r.sidx&&!e.sidx||r.segments&&!e.segments||!r.segments&&e.segments)return!1;if(!r.segments&&!e.segments)return!0;for(let t=0;t<r.segments.length;t++){const i=r.segments[t],s=e.segments[t];if(i.uri!==s.uri)return!1;if(!i.byterange&&!s.byterange)continue;const n=i.byterange,a=s.byterange;if(n&&!a||!n&&a||n.offset!==a.offset||n.length!==a.length)return!1}return!0},U2=(r,e,t,i)=>{const s=i.attributes.NAME||t;return`placeholder-uri-${r}-${e}-${s}`},F2=({mainXml:r,srcUrl:e,clientOffset:t,sidxMapping:i,previousManifest:s})=>{const n=oy(r,{manifestUri:e,clientOffset:t,sidxMapping:i,previousManifest:s});return Ld(n,e,U2),n},j2=(r,e)=>{xr(r,(t,i,s,n)=>{(!e.mediaGroups[i][s]||!(n in e.mediaGroups[i][s]))&&delete r.mediaGroups[i][s][n]})},q2=(r,e,t)=>{let i=!0,s=Ce(r,{duration:e.duration,minimumUpdatePeriod:e.minimumUpdatePeriod,timelineStarts:e.timelineStarts});for(let n=0;n<e.playlists.length;n++){const a=e.playlists[n];if(a.sidx){const c=Pn(a.sidx);t&&t[c]&&t[c].sidx&&Co(a,t[c].sidx,a.sidx.resolvedUri)}const u=co(s,a,pc);u&&(s=u,i=!1)}return xr(e,(n,a,u,c)=>{if(n.playlists&&n.playlists.length){const m=n.playlists[0].id,f=co(s,n.playlists[0],pc);f&&(s=f,c in s.mediaGroups[a][u]||(s.mediaGroups[a][u][c]=n),s.mediaGroups[a][u][c].playlists[0]=s.playlists[m],i=!1)}}),j2(s,e),e.minimumUpdatePeriod!==r.minimumUpdatePeriod&&(i=!1),i?null:s},$2=(r,e)=>(!r.map&&!e.map||!!(r.map&&e.map&&r.map.byterange.offset===e.map.byterange.offset&&r.map.byterange.length===e.map.byterange.length))&&r.uri===e.uri&&r.byterange.offset===e.byterange.offset&&r.byterange.length===e.byterange.length,mc=(r,e)=>{const t={};for(const i in r){const s=r[i].sidx;if(s){const n=Pn(s);if(!e[n])break;const a=e[n].sidxInfo;$2(a,s)&&(t[n]=e[n])}}return t},H2=(r,e)=>{let t=mc(r.playlists,e);return xr(r,(i,s,n,a)=>{if(i.playlists&&i.playlists.length){const u=i.playlists;t=Ce(t,mc(u,e))}}),t};class go extends B2{constructor(e,t,i={},s){super(),this.isPaused_=!0,this.mainPlaylistLoader_=s||this,s||(this.isMain_=!0);const{withCredentials:n=!1}=i;if(this.vhs_=t,this.withCredentials=n,this.addMetadataToTextTrack=i.addMetadataToTextTrack,!e)throw new Error("A non-empty playlist URL or object is required");this.on("minimumUpdatePeriod",()=>{this.refreshXml_()}),this.on("mediaupdatetimeout",()=>{this.refreshMedia_(this.media().id)}),this.state="HAVE_NOTHING",this.loadedPlaylists_={},this.logger_=Pt("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}get isPaused(){return this.isPaused_}requestErrored_(e,t,i){if(!this.request)return!0;if(this.request=null,e)return this.error=typeof e=="object"&&!(e instanceof Error)?e:{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2,metadata:e.metadata},i&&(this.state=i),this.trigger("error"),!0}addSidxSegments_(e,t,i){const s=e.sidx&&Pn(e.sidx);if(!e.sidx||!s||this.mainPlaylistLoader_.sidxMapping_[s]){A.clearTimeout(this.mediaRequest_),this.mediaRequest_=A.setTimeout(()=>i(!1),0);return}const n=Cn(e.sidx.resolvedUri),a=(c,m)=>{if(this.requestErrored_(c,m,t))return;const f=this.mainPlaylistLoader_.sidxMapping_,{requestType:_}=m;let P;try{P=dy(ce(m.response).subarray(8))}catch(S){S.metadata=Vi({requestType:_,request:m,parseFailure:!0}),this.requestErrored_(S,m,t);return}return f[s]={sidxInfo:e.sidx,sidx:P},Co(e,P,e.sidx.resolvedUri),i(!0)},u="dash-sidx";this.request=M2(n,this.vhs_.xhr,(c,m,f,_)=>{if(c)return a(c,m);if(!f||f!=="mp4"){const R=f||"unknown";return a({status:m.status,message:`Unsupported ${R} container type for sidx segment at URL: ${n}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},m)}const{offset:P,length:S}=e.sidx.byterange;if(_.length>=S+P)return a(c,{response:_.subarray(P,P+S),status:m.status,uri:m.uri});this.request=this.vhs_.xhr({uri:n,responseType:"arraybuffer",requestType:"dash-sidx",headers:mo({byterange:e.sidx.byterange})},a)},u)}dispose(){this.isPaused_=!0,this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},A.clearTimeout(this.minimumUpdatePeriodTimeout_),A.clearTimeout(this.mediaRequest_),A.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);const t=this.state;if(typeof e=="string"){if(!this.mainPlaylistLoader_.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}const i=!this.media_||e.id!==this.media_.id;if(i&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList){this.state="HAVE_METADATA",this.media_=e,i&&(this.trigger("mediachanging"),this.trigger("mediachange"));return}i&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,t,s=>{this.haveMetadata({startingState:t,playlist:e})}))}haveMetadata({startingState:e,playlist:t}){this.state="HAVE_METADATA",this.loadedPlaylists_[t.id]=t,A.clearTimeout(this.mediaRequest_),this.mediaRequest_=null,this.refreshMedia_(t.id),e==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.isPaused_=!0,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),A.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(A.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)}load(e){this.isPaused_=!1,A.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const t=this.media();if(e){const i=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=A.setTimeout(()=>this.load(),i);return}if(!this.started){this.start();return}t&&!t.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist")}start(){if(this.started=!0,!this.isMain_){A.clearTimeout(this.mediaRequest_),this.mediaRequest_=A.setTimeout(()=>this.haveMain_(),0);return}this.requestMain_((e,t)=>{this.haveMain_(),!this.hasPendingRequest()&&!this.media_&&this.media(this.mainPlaylistLoader_.main.playlists[0])})}requestMain_(e){const t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestrequeststart",metadata:t}),this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials,requestType:"dash-manifest"},(i,s)=>{if(i){const{requestType:a}=s;i.metadata=Vi({requestType:a,request:s,error:i})}if(this.requestErrored_(i,s)){this.state==="HAVE_NOTHING"&&(this.started=!1);return}this.trigger({type:"manifestrequestcomplete",metadata:t});const n=s.responseText!==this.mainPlaylistLoader_.mainXml_;if(this.mainPlaylistLoader_.mainXml_=s.responseText,s.responseHeaders&&s.responseHeaders.date?this.mainLoaded_=Date.parse(s.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=Cn(this.mainPlaylistLoader_.srcUrl,s),n){this.handleMain_(),this.syncClientServerClock_(()=>e(s,n));return}return e(s,n)})}syncClientServerClock_(e){const t=uy(this.mainPlaylistLoader_.mainXml_);if(t===null)return this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e();if(t.method==="DIRECT")return this.mainPlaylistLoader_.clientOffset_=t.value-Date.now(),e();this.request=this.vhs_.xhr({uri:pt(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},(i,s)=>{if(!this.request)return;if(i){const{requestType:a}=s;return this.error.metadata=Vi({requestType:a,request:s,error:i}),this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()}let n;t.method==="HEAD"?!s.responseHeaders||!s.responseHeaders.date?n=this.mainLoaded_:n=Date.parse(s.responseHeaders.date):n=Date.parse(s.responseText),this.mainPlaylistLoader_.clientOffset_=n-Date.now(),e()})}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){A.clearTimeout(this.mediaRequest_),this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main,t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestparsestart",metadata:t});let i;try{i=F2({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e})}catch(n){this.error=n,this.error.metadata={errorType:j.Error.StreamingDashManifestParserError,error:n},this.trigger("error")}e&&(i=q2(e,i,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=i||e;const s=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(s&&s!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=s),(!e||i&&i.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(i),i){const{duration:n,endList:a}=i,u=[];i.playlists.forEach(m=>{u.push({id:m.id,bandwidth:m.attributes.BANDWIDTH,resolution:m.attributes.RESOLUTION,codecs:m.attributes.CODECS})});const c={duration:n,isLive:!a,renditions:u};t.parsedManifest=c,this.trigger({type:"manifestparsecomplete",metadata:t})}return!!i}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(A.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);let t=e.main&&e.main.minimumUpdatePeriod;if(t===0&&(e.media()?t=e.media().targetDuration*1e3:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),typeof t!="number"||t<=0){t<0&&this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`);return}this.createMUPTimeout_(t)}createMUPTimeout_(e){const t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=A.setTimeout(()=>{t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)},e)}refreshXml_(){this.requestMain_((e,t)=>{t&&(this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=H2(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,i=>{this.refreshMedia_(this.media().id)}))})}refreshMedia_(e){if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();const t=this.mainPlaylistLoader_.main.playlists,i=!this.media_||this.media_!==t[e];if(i?this.media_=t[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){const s=()=>{this.media().endList||(this.mediaUpdateTimeout=A.setTimeout(()=>{this.trigger("mediaupdatetimeout"),s()},ho(this.media(),!!i)))};s()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){const t=this.mainPlaylistLoader_.main.eventStream.map(i=>({cueTime:i.start,frames:[{data:i.messageData}]}));this.addMetadataToTextTrack("EventStream",t,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const i in e.contentProtection){const s=e.contentProtection[i].attributes["cenc:default_KID"];s&&t.add(s.replace(/-/g,"").toLowerCase())}return t}}}var Ge={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30};const V2=r=>{const e=new Uint8Array(new ArrayBuffer(r.length));for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e.buffer},zd=function(r){return r.on=r.addEventListener,r.off=r.removeEventListener,r},z2=function(r){try{return URL.createObjectURL(new Blob([r],{type:"application/javascript"}))}catch{const e=new BlobBuilder;return e.append(r),URL.createObjectURL(e.getBlob())}},Wd=function(r){return function(){const e=z2(r),t=zd(new Worker(e));t.objURL=e;const i=t.terminate;return t.on=t.addEventListener,t.off=t.removeEventListener,t.terminate=function(){return URL.revokeObjectURL(e),i.call(this)},t}},Gd=function(r){return`var browserWorkerPolyFill = ${zd.toString()};
208
+ browserWorkerPolyFill(self);
209
+ `+r},Xd=function(r){return r.toString().replace(/^function.+?{/,"").slice(0,-1)},W2=Gd(Xd(function(){var r=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=function(){this.init=function(){var o={};this.on=function(l,d){o[l]||(o[l]=[]),o[l]=o[l].concat(d)},this.off=function(l,d){var h;return o[l]?(h=o[l].indexOf(d),o[l]=o[l].slice(),o[l].splice(h,1),h>-1):!1},this.trigger=function(l){var d,h,p,g;if(d=o[l],!!d)if(arguments.length===2)for(p=d.length,h=0;h<p;++h)d[h].call(this,arguments[1]);else{for(g=[],h=arguments.length,h=1;h<arguments.length;++h)g.push(arguments[h]);for(p=d.length,h=0;h<p;++h)d[h].apply(this,g)}},this.dispose=function(){o={}}}};e.prototype.pipe=function(o){return this.on("data",function(l){o.push(l)}),this.on("done",function(l){o.flush(l)}),this.on("partialdone",function(l){o.partialFlush(l)}),this.on("endedtimeline",function(l){o.endTimeline(l)}),this.on("reset",function(l){o.reset(l)}),o},e.prototype.push=function(o){this.trigger("data",o)},e.prototype.flush=function(o){this.trigger("done",o)},e.prototype.partialFlush=function(o){this.trigger("partialdone",o)},e.prototype.endTimeline=function(o){this.trigger("endedtimeline",o)},e.prototype.reset=function(o){this.trigger("reset",o)};var t=e,i=Math.pow(2,32),s=function(o){var l=new DataView(o.buffer,o.byteOffset,o.byteLength),d;return l.getBigUint64?(d=l.getBigUint64(0),d<Number.MAX_SAFE_INTEGER?Number(d):d):l.getUint32(0)*i+l.getUint32(4)},n={getUint64:s,MAX_UINT32:i},a=n.MAX_UINT32,u,c,m,f,_,P,S,R,b,I,M,N,O,z,q,$,L,H,v,C,V,U,F,K,ee,se,Q,J,Z,ie,te,me,fe,_e,pe,Ke;(function(){var o;if(F={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},!(typeof Uint8Array>"u")){for(o in F)F.hasOwnProperty(o)&&(F[o]=[o.charCodeAt(0),o.charCodeAt(1),o.charCodeAt(2),o.charCodeAt(3)]);K=new Uint8Array([105,115,111,109]),se=new Uint8Array([97,118,99,49]),ee=new Uint8Array([0,0,0,1]),Q=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),J=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),Z={video:Q,audio:J},me=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),te=new Uint8Array([0,0,0,0,0,0,0,0]),fe=new Uint8Array([0,0,0,0,0,0,0,0]),_e=fe,pe=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Ke=fe,ie=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),u=function(o){var l=[],d=0,h,p,g;for(h=1;h<arguments.length;h++)l.push(arguments[h]);for(h=l.length;h--;)d+=l[h].byteLength;for(p=new Uint8Array(d+8),g=new DataView(p.buffer,p.byteOffset,p.byteLength),g.setUint32(0,p.byteLength),p.set(o,4),h=0,d=8;h<l.length;h++)p.set(l[h],d),d+=l[h].byteLength;return p},c=function(){return u(F.dinf,u(F.dref,me))},m=function(o){return u(F.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,o.audioobjecttype<<3|o.samplingfrequencyindex>>>1,o.samplingfrequencyindex<<7|o.channelcount<<3,6,1,2]))},f=function(){return u(F.ftyp,K,ee,K,se)},$=function(o){return u(F.hdlr,Z[o])},_=function(o){return u(F.mdat,o)},q=function(o){var l=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,o.duration>>>24&255,o.duration>>>16&255,o.duration>>>8&255,o.duration&255,85,196,0,0]);return o.samplerate&&(l[12]=o.samplerate>>>24&255,l[13]=o.samplerate>>>16&255,l[14]=o.samplerate>>>8&255,l[15]=o.samplerate&255),u(F.mdhd,l)},z=function(o){return u(F.mdia,q(o),$(o.type),S(o))},P=function(o){return u(F.mfhd,new Uint8Array([0,0,0,0,(o&4278190080)>>24,(o&16711680)>>16,(o&65280)>>8,o&255]))},S=function(o){return u(F.minf,o.type==="video"?u(F.vmhd,ie):u(F.smhd,te),c(),H(o))},R=function(o,l){for(var d=[],h=l.length;h--;)d[h]=C(l[h]);return u.apply(null,[F.moof,P(o)].concat(d))},b=function(o){for(var l=o.length,d=[];l--;)d[l]=N(o[l]);return u.apply(null,[F.moov,M(4294967295)].concat(d).concat(I(o)))},I=function(o){for(var l=o.length,d=[];l--;)d[l]=V(o[l]);return u.apply(null,[F.mvex].concat(d))},M=function(o){var l=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(o&4278190080)>>24,(o&16711680)>>16,(o&65280)>>8,o&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 u(F.mvhd,l)},L=function(o){var l=o.samples||[],d=new Uint8Array(4+l.length),h,p;for(p=0;p<l.length;p++)h=l[p].flags,d[p+4]=h.dependsOn<<4|h.isDependedOn<<2|h.hasRedundancy;return u(F.sdtp,d)},H=function(o){return u(F.stbl,v(o),u(F.stts,Ke),u(F.stsc,_e),u(F.stsz,pe),u(F.stco,fe))},(function(){var o,l;v=function(d){return u(F.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),d.type==="video"?o(d):l(d))},o=function(d){var h=d.sps||[],p=d.pps||[],g=[],E=[],w,k;for(w=0;w<h.length;w++)g.push((h[w].byteLength&65280)>>>8),g.push(h[w].byteLength&255),g=g.concat(Array.prototype.slice.call(h[w]));for(w=0;w<p.length;w++)E.push((p[w].byteLength&65280)>>>8),E.push(p[w].byteLength&255),E=E.concat(Array.prototype.slice.call(p[w]));if(k=[F.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,(d.width&65280)>>8,d.width&255,(d.height&65280)>>8,d.height&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),u(F.avcC,new Uint8Array([1,d.profileIdc,d.profileCompatibility,d.levelIdc,255].concat([h.length],g,[p.length],E))),u(F.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],d.sarRatio){var x=d.sarRatio[0],B=d.sarRatio[1];k.push(u(F.pasp,new Uint8Array([(x&4278190080)>>24,(x&16711680)>>16,(x&65280)>>8,x&255,(B&4278190080)>>24,(B&16711680)>>16,(B&65280)>>8,B&255])))}return u.apply(null,k)},l=function(d){return u(F.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(d.channelcount&65280)>>8,d.channelcount&255,(d.samplesize&65280)>>8,d.samplesize&255,0,0,0,0,(d.samplerate&65280)>>8,d.samplerate&255,0,0]),m(d))}})(),O=function(o){var l=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(o.id&4278190080)>>24,(o.id&16711680)>>16,(o.id&65280)>>8,o.id&255,0,0,0,0,(o.duration&4278190080)>>24,(o.duration&16711680)>>16,(o.duration&65280)>>8,o.duration&255,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(o.width&65280)>>8,o.width&255,0,0,(o.height&65280)>>8,o.height&255,0,0]);return u(F.tkhd,l)},C=function(o){var l,d,h,p,g,E,w;return l=u(F.tfhd,new Uint8Array([0,0,0,58,(o.id&4278190080)>>24,(o.id&16711680)>>16,(o.id&65280)>>8,o.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),E=Math.floor(o.baseMediaDecodeTime/a),w=Math.floor(o.baseMediaDecodeTime%a),d=u(F.tfdt,new Uint8Array([1,0,0,0,E>>>24&255,E>>>16&255,E>>>8&255,E&255,w>>>24&255,w>>>16&255,w>>>8&255,w&255])),g=92,o.type==="audio"?(h=U(o,g),u(F.traf,l,d,h)):(p=L(o),h=U(o,p.length+g),u(F.traf,l,d,h,p))},N=function(o){return o.duration=o.duration||4294967295,u(F.trak,O(o),z(o))},V=function(o){var l=new Uint8Array([0,0,0,0,(o.id&4278190080)>>24,(o.id&16711680)>>16,(o.id&65280)>>8,o.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return o.type!=="video"&&(l[l.length-1]=0),u(F.trex,l)},(function(){var o,l,d;d=function(h,p){var g=0,E=0,w=0,k=0;return h.length&&(h[0].duration!==void 0&&(g=1),h[0].size!==void 0&&(E=2),h[0].flags!==void 0&&(w=4),h[0].compositionTimeOffset!==void 0&&(k=8)),[0,0,g|E|w|k,1,(h.length&4278190080)>>>24,(h.length&16711680)>>>16,(h.length&65280)>>>8,h.length&255,(p&4278190080)>>>24,(p&16711680)>>>16,(p&65280)>>>8,p&255]},l=function(h,p){var g,E,w,k,x,B;for(k=h.samples||[],p+=20+16*k.length,w=d(k,p),E=new Uint8Array(w.length+k.length*16),E.set(w),g=w.length,B=0;B<k.length;B++)x=k[B],E[g++]=(x.duration&4278190080)>>>24,E[g++]=(x.duration&16711680)>>>16,E[g++]=(x.duration&65280)>>>8,E[g++]=x.duration&255,E[g++]=(x.size&4278190080)>>>24,E[g++]=(x.size&16711680)>>>16,E[g++]=(x.size&65280)>>>8,E[g++]=x.size&255,E[g++]=x.flags.isLeading<<2|x.flags.dependsOn,E[g++]=x.flags.isDependedOn<<6|x.flags.hasRedundancy<<4|x.flags.paddingValue<<1|x.flags.isNonSyncSample,E[g++]=x.flags.degradationPriority&61440,E[g++]=x.flags.degradationPriority&15,E[g++]=(x.compositionTimeOffset&4278190080)>>>24,E[g++]=(x.compositionTimeOffset&16711680)>>>16,E[g++]=(x.compositionTimeOffset&65280)>>>8,E[g++]=x.compositionTimeOffset&255;return u(F.trun,E)},o=function(h,p){var g,E,w,k,x,B;for(k=h.samples||[],p+=20+8*k.length,w=d(k,p),g=new Uint8Array(w.length+k.length*8),g.set(w),E=w.length,B=0;B<k.length;B++)x=k[B],g[E++]=(x.duration&4278190080)>>>24,g[E++]=(x.duration&16711680)>>>16,g[E++]=(x.duration&65280)>>>8,g[E++]=x.duration&255,g[E++]=(x.size&4278190080)>>>24,g[E++]=(x.size&16711680)>>>16,g[E++]=(x.size&65280)>>>8,g[E++]=x.size&255;return u(F.trun,g)},U=function(h,p){return h.type==="audio"?o(h,p):l(h,p)}})();var Je={ftyp:f,mdat:_,moof:R,moov:b,initSegment:function(o){var l=f(),d=b(o),h;return h=new Uint8Array(l.byteLength+d.byteLength),h.set(l),h.set(d,l.byteLength),h}},$e=function(o){var l,d,h=[],p=[];for(p.byteLength=0,p.nalCount=0,p.duration=0,h.byteLength=0,l=0;l<o.length;l++)d=o[l],d.nalUnitType==="access_unit_delimiter_rbsp"?(h.length&&(h.duration=d.dts-h.dts,p.byteLength+=h.byteLength,p.nalCount+=h.length,p.duration+=h.duration,p.push(h)),h=[d],h.byteLength=d.data.byteLength,h.pts=d.pts,h.dts=d.dts):(d.nalUnitType==="slice_layer_without_partitioning_rbsp_idr"&&(h.keyFrame=!0),h.duration=d.dts-h.dts,h.byteLength+=d.data.byteLength,h.push(d));return p.length&&(!h.duration||h.duration<=0)&&(h.duration=p[p.length-1].duration),p.byteLength+=h.byteLength,p.nalCount+=h.length,p.duration+=h.duration,p.push(h),p},Ze=function(o){var l,d,h=[],p=[];for(h.byteLength=0,h.nalCount=0,h.duration=0,h.pts=o[0].pts,h.dts=o[0].dts,p.byteLength=0,p.nalCount=0,p.duration=0,p.pts=o[0].pts,p.dts=o[0].dts,l=0;l<o.length;l++)d=o[l],d.keyFrame?(h.length&&(p.push(h),p.byteLength+=h.byteLength,p.nalCount+=h.nalCount,p.duration+=h.duration),h=[d],h.nalCount=d.length,h.byteLength=d.byteLength,h.pts=d.pts,h.dts=d.dts,h.duration=d.duration):(h.duration+=d.duration,h.nalCount+=d.length,h.byteLength+=d.byteLength,h.push(d));return p.length&&h.duration<=0&&(h.duration=p[p.length-1].duration),p.byteLength+=h.byteLength,p.nalCount+=h.nalCount,p.duration+=h.duration,p.push(h),p},Tt=function(o){var l;return!o[0][0].keyFrame&&o.length>1&&(l=o.shift(),o.byteLength-=l.byteLength,o.nalCount-=l.nalCount,o[0][0].dts=l.dts,o[0][0].pts=l.pts,o[0][0].duration+=l.duration),o},Ye=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},st=function(o,l){var d=Ye();return d.dataOffset=l,d.compositionTimeOffset=o.pts-o.dts,d.duration=o.duration,d.size=4*o.length,d.size+=o.byteLength,o.keyFrame&&(d.flags.dependsOn=2,d.flags.isNonSyncSample=0),d},ai=function(o,l){var d,h,p,g,E,w=l||0,k=[];for(d=0;d<o.length;d++)for(g=o[d],h=0;h<g.length;h++)E=g[h],p=st(E,w),w+=p.size,k.push(p);return k},ze=function(o){var l,d,h,p,g,E,w=0,k=o.byteLength,x=o.nalCount,B=k+4*x,G=new Uint8Array(B),ae=new DataView(G.buffer);for(l=0;l<o.length;l++)for(p=o[l],d=0;d<p.length;d++)for(g=p[d],h=0;h<g.length;h++)E=g[h],ae.setUint32(w,E.data.byteLength),w+=4,G.set(E.data,w),w+=E.data.byteLength;return G},oi=function(o,l){var d,h=l||0,p=[];return d=st(o,h),p.push(d),p},Ve=function(o){var l,d,h=0,p=o.byteLength,g=o.length,E=p+4*g,w=new Uint8Array(E),k=new DataView(w.buffer);for(l=0;l<o.length;l++)d=o[l],k.setUint32(h,d.data.byteLength),h+=4,w.set(d.data,h),h+=d.data.byteLength;return w},Gi={groupNalsIntoFrames:$e,groupFramesIntoGops:Ze,extendFirstKeyFrame:Tt,generateSampleTable:ai,concatenateNalData:ze,generateSampleTableForFrame:oi,concatenateNalDataForFrame:Ve},ft=[33,16,5,32,164,27],St=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],ve=function(o){for(var l=[];o--;)l.push(0);return l},Ie=function(o){return Object.keys(o).reduce(function(l,d){return l[d]=new Uint8Array(o[d].reduce(function(h,p){return h.concat(p)},[])),l},{})},Le,ui=function(){if(!Le){var o={96e3:[ft,[227,64],ve(154),[56]],88200:[ft,[231],ve(170),[56]],64e3:[ft,[248,192],ve(240),[56]],48e3:[ft,[255,192],ve(268),[55,148,128],ve(54),[112]],44100:[ft,[255,192],ve(268),[55,163,128],ve(84),[112]],32e3:[ft,[255,192],ve(268),[55,234],ve(226),[112]],24e3:[ft,[255,192],ve(268),[55,255,128],ve(268),[111,112],ve(126),[224]],16e3:[ft,[255,192],ve(268),[55,255,128],ve(268),[111,255],ve(269),[223,108],ve(195),[1,192]],12e3:[St,ve(268),[3,127,248],ve(268),[6,255,240],ve(268),[13,255,224],ve(268),[27,253,128],ve(259),[56]],11025:[St,ve(268),[3,127,248],ve(268),[6,255,240],ve(268),[13,255,224],ve(268),[27,255,192],ve(268),[55,175,128],ve(108),[112]],8e3:[St,ve(268),[3,121,16],ve(47),[7]]};Le=Ie(o)}return Le},Jt=9e4,wi,ki,li,ci,Dr,Ir,Xi;wi=function(o){return o*Jt},ki=function(o,l){return o*l},li=function(o){return o/Jt},ci=function(o,l){return o/l},Dr=function(o,l){return wi(ci(o,l))},Ir=function(o,l){return ki(li(o),l)},Xi=function(o,l,d){return li(d?o:o-l)};var Se={ONE_SECOND_IN_TS:Jt,secondsToVideoTs:wi,secondsToAudioTs:ki,videoTsToSeconds:li,audioTsToSeconds:ci,audioTsToVideoTs:Dr,videoTsToAudioTs:Ir,metadataTsToSeconds:Xi},Pr=ui,Ai=Se,Ts=function(o){var l,d,h=0;for(l=0;l<o.length;l++)d=o[l],h+=d.data.byteLength;return h},Ss=function(o,l,d,h){var p,g=0,E=0,w=0,k=0,x,B,G;if(l.length&&(p=Ai.audioTsToVideoTs(o.baseMediaDecodeTime,o.samplerate),g=Math.ceil(Ai.ONE_SECOND_IN_TS/(o.samplerate/1024)),d&&h&&(E=p-Math.max(d,h),w=Math.floor(E/g),k=w*g),!(w<1||k>Ai.ONE_SECOND_IN_TS/2))){for(x=Pr()[o.samplerate],x||(x=l[0].data),B=0;B<w;B++)G=l[0],l.splice(0,0,{data:x,dts:G.dts-g,pts:G.pts-g});return o.baseMediaDecodeTime-=Math.floor(Ai.videoTsToAudioTs(k,o.samplerate)),k}},Lr=function(o,l,d){return l.minSegmentDts>=d?o:(l.minSegmentDts=1/0,o.filter(function(h){return h.dts>=d?(l.minSegmentDts=Math.min(l.minSegmentDts,h.dts),l.minSegmentPts=l.minSegmentDts,!0):!1}))},hi=function(o){var l,d,h=[];for(l=0;l<o.length;l++)d=o[l],h.push({size:d.data.byteLength,duration:1024});return h},Es=function(o){var l,d,h=0,p=new Uint8Array(Ts(o));for(l=0;l<o.length;l++)d=o[l],p.set(d.data,h),h+=d.data.byteLength;return p},Or={prefixWithSilence:Ss,trimAdtsFramesByEarliestDts:Lr,generateSampleTable:hi,concatenateFrameData:Es},Cs=Se.ONE_SECOND_IN_TS,y=function(o,l){typeof l.pts=="number"&&(o.timelineStartInfo.pts===void 0&&(o.timelineStartInfo.pts=l.pts),o.minSegmentPts===void 0?o.minSegmentPts=l.pts:o.minSegmentPts=Math.min(o.minSegmentPts,l.pts),o.maxSegmentPts===void 0?o.maxSegmentPts=l.pts:o.maxSegmentPts=Math.max(o.maxSegmentPts,l.pts)),typeof l.dts=="number"&&(o.timelineStartInfo.dts===void 0&&(o.timelineStartInfo.dts=l.dts),o.minSegmentDts===void 0?o.minSegmentDts=l.dts:o.minSegmentDts=Math.min(o.minSegmentDts,l.dts),o.maxSegmentDts===void 0?o.maxSegmentDts=l.dts:o.maxSegmentDts=Math.max(o.maxSegmentDts,l.dts))},T=function(o){delete o.minSegmentDts,delete o.maxSegmentDts,delete o.minSegmentPts,delete o.maxSegmentPts},D=function(o,l){var d,h,p=o.minSegmentDts;return l||(p-=o.timelineStartInfo.dts),d=o.timelineStartInfo.baseMediaDecodeTime,d+=p,d=Math.max(0,d),o.type==="audio"&&(h=o.samplerate/Cs,d*=h,d=Math.floor(d)),d},W={clearDtsInfo:T,calculateTrackBaseMediaDecodeTime:D,collectDtsInfo:y},ne=4,de=128,xe=function(o){for(var l=0,d={payloadType:-1,payloadSize:0},h=0,p=0;l<o.byteLength&&o[l]!==de;){for(;o[l]===255;)h+=255,l++;for(h+=o[l++];o[l]===255;)p+=255,l++;if(p+=o[l++],!d.payload&&h===ne){var g=String.fromCharCode(o[l+3],o[l+4],o[l+5],o[l+6]);if(g==="GA94"){d.payloadType=h,d.payloadSize=p,d.payload=o.subarray(l,l+p);break}else d.payload=void 0}l+=p,h=0,p=0}return d},we=function(o){return o.payload[0]!==181||(o.payload[1]<<8|o.payload[2])!==49||String.fromCharCode(o.payload[3],o.payload[4],o.payload[5],o.payload[6])!=="GA94"||o.payload[7]!==3?null:o.payload.subarray(8,o.payload.length-1)},Lt=function(o,l){var d=[],h,p,g,E;if(!(l[0]&64))return d;for(p=l[0]&31,h=0;h<p;h++)g=h*3,E={type:l[g+2]&3,pts:o},l[g+2]&4&&(E.ccData=l[g+3]<<8|l[g+4],d.push(E));return d},Ft=function(o){for(var l=o.byteLength,d=[],h=1,p,g;h<l-2;)o[h]===0&&o[h+1]===0&&o[h+2]===3?(d.push(h+2),h+=2):h++;if(d.length===0)return o;p=l-d.length,g=new Uint8Array(p);var E=0;for(h=0;h<p;E++,h++)E===d[0]&&(E++,d.shift()),g[h]=o[E];return g},Et={parseSei:xe,parseUserData:we,parseCaptionPackets:Lt,discardEmulationPreventionBytes:Ft,USER_DATA_REGISTERED_ITU_T_T35:ne},di=t,Ct=Et,Ue=function(o){o=o||{},Ue.prototype.init.call(this),this.parse708captions_=typeof o.parse708captions=="boolean"?o.parse708captions:!0,this.captionPackets_=[],this.ccStreams_=[new Oe(0,0),new Oe(0,1),new Oe(1,0),new Oe(1,1)],this.parse708captions_&&(this.cc708Stream_=new Te({captionServices:o.captionServices})),this.reset(),this.ccStreams_.forEach(function(l){l.on("data",this.trigger.bind(this,"data")),l.on("partialdone",this.trigger.bind(this,"partialdone")),l.on("done",this.trigger.bind(this,"done"))},this),this.parse708captions_&&(this.cc708Stream_.on("data",this.trigger.bind(this,"data")),this.cc708Stream_.on("partialdone",this.trigger.bind(this,"partialdone")),this.cc708Stream_.on("done",this.trigger.bind(this,"done")))};Ue.prototype=new di,Ue.prototype.push=function(o){var l,d,h;if(o.nalUnitType==="sei_rbsp"&&(l=Ct.parseSei(o.escapedRBSP),!!l.payload&&l.payloadType===Ct.USER_DATA_REGISTERED_ITU_T_T35&&(d=Ct.parseUserData(l),!!d))){if(o.dts<this.latestDts_){this.ignoreNextEqualDts_=!0;return}else if(o.dts===this.latestDts_&&this.ignoreNextEqualDts_){this.numSameDts_--,this.numSameDts_||(this.ignoreNextEqualDts_=!1);return}h=Ct.parseCaptionPackets(o.pts,d),this.captionPackets_=this.captionPackets_.concat(h),this.latestDts_!==o.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=o.dts}},Ue.prototype.flushCCStreams=function(o){this.ccStreams_.forEach(function(l){return o==="flush"?l.flush():l.partialFlush()},this)},Ue.prototype.flushStream=function(o){if(!this.captionPackets_.length){this.flushCCStreams(o);return}this.captionPackets_.forEach(function(l,d){l.presortIndex=d}),this.captionPackets_.sort(function(l,d){return l.pts===d.pts?l.presortIndex-d.presortIndex:l.pts-d.pts}),this.captionPackets_.forEach(function(l){l.type<2?this.dispatchCea608Packet(l):this.dispatchCea708Packet(l)},this),this.captionPackets_.length=0,this.flushCCStreams(o)},Ue.prototype.flush=function(){return this.flushStream("flush")},Ue.prototype.partialFlush=function(){return this.flushStream("partialFlush")},Ue.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(o){o.reset()})},Ue.prototype.dispatchCea608Packet=function(o){this.setsTextOrXDSActive(o)?this.activeCea608Channel_[o.type]=null:this.setsChannel1Active(o)?this.activeCea608Channel_[o.type]=0:this.setsChannel2Active(o)&&(this.activeCea608Channel_[o.type]=1),this.activeCea608Channel_[o.type]!==null&&this.ccStreams_[(o.type<<1)+this.activeCea608Channel_[o.type]].push(o)},Ue.prototype.setsChannel1Active=function(o){return(o.ccData&30720)===4096},Ue.prototype.setsChannel2Active=function(o){return(o.ccData&30720)===6144},Ue.prototype.setsTextOrXDSActive=function(o){return(o.ccData&28928)===256||(o.ccData&30974)===4138||(o.ccData&30974)===6186},Ue.prototype.dispatchCea708Packet=function(o){this.parse708captions_&&this.cc708Stream_.push(o)};var Zt={127:9834,4128:32,4129:160,4133:8230,4138:352,4140:338,4144:9608,4145:8216,4146:8217,4147:8220,4148:8221,4149:8226,4153:8482,4154:353,4156:339,4157:8480,4159:376,4214:8539,4215:8540,4216:8541,4217:8542,4218:9168,4219:9124,4220:9123,4221:9135,4222:9126,4223:9121,4256:12600},wt=function(o){var l=Zt[o]||o;return o&4096&&o===l?"":String.fromCharCode(l)},kt=function(o){return 32<=o&&o<=127||160<=o&&o<=255},nt=function(o){this.windowNum=o,this.reset()};nt.prototype.reset=function(){this.clearText(),this.pendingNewLine=!1,this.winAttr={},this.penAttr={},this.penLoc={},this.penColor={},this.visible=0,this.rowLock=0,this.columnLock=0,this.priority=0,this.relativePositioning=0,this.anchorVertical=0,this.anchorHorizontal=0,this.anchorPoint=0,this.rowCount=1,this.virtualRowCount=this.rowCount+1,this.columnCount=41,this.windowStyle=0,this.penStyle=0},nt.prototype.getText=function(){return this.rows.join(`
210
+ `)},nt.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},nt.prototype.newLine=function(o){for(this.rows.length>=this.virtualRowCount&&typeof this.beforeRowOverflow=="function"&&this.beforeRowOverflow(o),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},nt.prototype.isEmpty=function(){return this.rows.length===0?!0:this.rows.length===1?this.rows[0]==="":!1},nt.prototype.addText=function(o){this.rows[this.rowIdx]+=o},nt.prototype.backspace=function(){if(!this.isEmpty()){var o=this.rows[this.rowIdx];this.rows[this.rowIdx]=o.substr(0,o.length-1)}};var xi=function(o,l,d){this.serviceNum=o,this.text="",this.currentWindow=new nt(-1),this.windows=[],this.stream=d,typeof l=="string"&&this.createTextDecoder(l)};xi.prototype.init=function(o,l){this.startPts=o;for(var d=0;d<8;d++)this.windows[d]=new nt(d),typeof l=="function"&&(this.windows[d].beforeRowOverflow=l)},xi.prototype.setCurrentWindow=function(o){this.currentWindow=this.windows[o]},xi.prototype.createTextDecoder=function(o){if(typeof TextDecoder>"u")this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(o)}catch(l){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+o+" encoding. "+l})}};var Te=function(o){o=o||{},Te.prototype.init.call(this);var l=this,d=o.captionServices||{},h={},p;Object.keys(d).forEach(g=>{p=d[g],/^SERVICE/.test(g)&&(h[g]=p.encoding)}),this.serviceEncodings=h,this.current708Packet=null,this.services={},this.push=function(g){g.type===3?(l.new708Packet(),l.add708Bytes(g)):(l.current708Packet===null&&l.new708Packet(),l.add708Bytes(g))}};Te.prototype=new di,Te.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},Te.prototype.add708Bytes=function(o){var l=o.ccData,d=l>>>8,h=l&255;this.current708Packet.ptsVals.push(o.pts),this.current708Packet.data.push(d),this.current708Packet.data.push(h)},Te.prototype.push708Packet=function(){var o=this.current708Packet,l=o.data,d=null,h=null,p=0,g=l[p++];for(o.seq=g>>6,o.sizeCode=g&63;p<l.length;p++)g=l[p++],d=g>>5,h=g&31,d===7&&h>0&&(g=l[p++],d=g),this.pushServiceBlock(d,p,h),h>0&&(p+=h-1)},Te.prototype.pushServiceBlock=function(o,l,d){var h,p=l,g=this.current708Packet.data,E=this.services[o];for(E||(E=this.initService(o,p));p<l+d&&p<g.length;p++)h=g[p],kt(h)?p=this.handleText(p,E):h===24?p=this.multiByteCharacter(p,E):h===16?p=this.extendedCommands(p,E):128<=h&&h<=135?p=this.setCurrentWindow(p,E):152<=h&&h<=159?p=this.defineWindow(p,E):h===136?p=this.clearWindows(p,E):h===140?p=this.deleteWindows(p,E):h===137?p=this.displayWindows(p,E):h===138?p=this.hideWindows(p,E):h===139?p=this.toggleWindows(p,E):h===151?p=this.setWindowAttributes(p,E):h===144?p=this.setPenAttributes(p,E):h===145?p=this.setPenColor(p,E):h===146?p=this.setPenLocation(p,E):h===143?E=this.reset(p,E):h===8?E.currentWindow.backspace():h===12?E.currentWindow.clearText():h===13?E.currentWindow.pendingNewLine=!0:h===14?E.currentWindow.clearText():h===141&&p++},Te.prototype.extendedCommands=function(o,l){var d=this.current708Packet.data,h=d[++o];return kt(h)&&(o=this.handleText(o,l,{isExtended:!0})),o},Te.prototype.getPts=function(o){return this.current708Packet.ptsVals[Math.floor(o/2)]},Te.prototype.initService=function(o,l){var h="SERVICE"+o,d=this,h,p;return h in this.serviceEncodings&&(p=this.serviceEncodings[h]),this.services[o]=new xi(o,p,d),this.services[o].init(this.getPts(l),function(g){d.flushDisplayed(g,d.services[o])}),this.services[o]},Te.prototype.handleText=function(o,l,d){var h=d&&d.isExtended,p=d&&d.isMultiByte,g=this.current708Packet.data,E=h?4096:0,w=g[o],k=g[o+1],x=l.currentWindow,B,G;function ae(Y){return Y.map(ue=>("0"+(ue&255).toString(16)).slice(-2)).join("")}if(p?(G=[w,k],o++):G=[w],l.textDecoder_&&!h)B=l.textDecoder_.decode(new Uint8Array(G));else if(p){const Y=ae(G);B=String.fromCharCode(parseInt(Y,16))}else B=wt(E|w);return x.pendingNewLine&&!x.isEmpty()&&x.newLine(this.getPts(o)),x.pendingNewLine=!1,x.addText(B),o},Te.prototype.multiByteCharacter=function(o,l){var d=this.current708Packet.data,h=d[o+1],p=d[o+2];return kt(h)&&kt(p)&&(o=this.handleText(++o,l,{isMultiByte:!0})),o},Te.prototype.setCurrentWindow=function(o,l){var d=this.current708Packet.data,h=d[o],p=h&7;return l.setCurrentWindow(p),o},Te.prototype.defineWindow=function(o,l){var d=this.current708Packet.data,h=d[o],p=h&7;l.setCurrentWindow(p);var g=l.currentWindow;return h=d[++o],g.visible=(h&32)>>5,g.rowLock=(h&16)>>4,g.columnLock=(h&8)>>3,g.priority=h&7,h=d[++o],g.relativePositioning=(h&128)>>7,g.anchorVertical=h&127,h=d[++o],g.anchorHorizontal=h,h=d[++o],g.anchorPoint=(h&240)>>4,g.rowCount=h&15,h=d[++o],g.columnCount=h&63,h=d[++o],g.windowStyle=(h&56)>>3,g.penStyle=h&7,g.virtualRowCount=g.rowCount+1,o},Te.prototype.setWindowAttributes=function(o,l){var d=this.current708Packet.data,h=d[o],p=l.currentWindow.winAttr;return h=d[++o],p.fillOpacity=(h&192)>>6,p.fillRed=(h&48)>>4,p.fillGreen=(h&12)>>2,p.fillBlue=h&3,h=d[++o],p.borderType=(h&192)>>6,p.borderRed=(h&48)>>4,p.borderGreen=(h&12)>>2,p.borderBlue=h&3,h=d[++o],p.borderType+=(h&128)>>5,p.wordWrap=(h&64)>>6,p.printDirection=(h&48)>>4,p.scrollDirection=(h&12)>>2,p.justify=h&3,h=d[++o],p.effectSpeed=(h&240)>>4,p.effectDirection=(h&12)>>2,p.displayEffect=h&3,o},Te.prototype.flushDisplayed=function(o,l){for(var d=[],h=0;h<8;h++)l.windows[h].visible&&!l.windows[h].isEmpty()&&d.push(l.windows[h].getText());l.endPts=o,l.text=d.join(`
211
+
212
+ `),this.pushCaption(l),l.startPts=o},Te.prototype.pushCaption=function(o){o.text!==""&&(this.trigger("data",{startPts:o.startPts,endPts:o.endPts,text:o.text,stream:"cc708_"+o.serviceNum}),o.text="",o.startPts=o.endPts)},Te.prototype.displayWindows=function(o,l){var d=this.current708Packet.data,h=d[++o],p=this.getPts(o);this.flushDisplayed(p,l);for(var g=0;g<8;g++)h&1<<g&&(l.windows[g].visible=1);return o},Te.prototype.hideWindows=function(o,l){var d=this.current708Packet.data,h=d[++o],p=this.getPts(o);this.flushDisplayed(p,l);for(var g=0;g<8;g++)h&1<<g&&(l.windows[g].visible=0);return o},Te.prototype.toggleWindows=function(o,l){var d=this.current708Packet.data,h=d[++o],p=this.getPts(o);this.flushDisplayed(p,l);for(var g=0;g<8;g++)h&1<<g&&(l.windows[g].visible^=1);return o},Te.prototype.clearWindows=function(o,l){var d=this.current708Packet.data,h=d[++o],p=this.getPts(o);this.flushDisplayed(p,l);for(var g=0;g<8;g++)h&1<<g&&l.windows[g].clearText();return o},Te.prototype.deleteWindows=function(o,l){var d=this.current708Packet.data,h=d[++o],p=this.getPts(o);this.flushDisplayed(p,l);for(var g=0;g<8;g++)h&1<<g&&l.windows[g].reset();return o},Te.prototype.setPenAttributes=function(o,l){var d=this.current708Packet.data,h=d[o],p=l.currentWindow.penAttr;return h=d[++o],p.textTag=(h&240)>>4,p.offset=(h&12)>>2,p.penSize=h&3,h=d[++o],p.italics=(h&128)>>7,p.underline=(h&64)>>6,p.edgeType=(h&56)>>3,p.fontStyle=h&7,o},Te.prototype.setPenColor=function(o,l){var d=this.current708Packet.data,h=d[o],p=l.currentWindow.penColor;return h=d[++o],p.fgOpacity=(h&192)>>6,p.fgRed=(h&48)>>4,p.fgGreen=(h&12)>>2,p.fgBlue=h&3,h=d[++o],p.bgOpacity=(h&192)>>6,p.bgRed=(h&48)>>4,p.bgGreen=(h&12)>>2,p.bgBlue=h&3,h=d[++o],p.edgeRed=(h&48)>>4,p.edgeGreen=(h&12)>>2,p.edgeBlue=h&3,o},Te.prototype.setPenLocation=function(o,l){var d=this.current708Packet.data,h=d[o],p=l.currentWindow.penLoc;return l.currentWindow.pendingNewLine=!0,h=d[++o],p.row=h&15,h=d[++o],p.column=h&63,o},Te.prototype.reset=function(o,l){var d=this.getPts(o);return this.flushDisplayed(d,l),this.initService(l.serviceNum,o)};var ws={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},ks=function(o){return o===null?"":(o=ws[o]||o,String.fromCharCode(o))},As=14,Ep=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Di=function(){for(var o=[],l=As+1;l--;)o.push({text:"",indent:0,offset:0});return o},Oe=function(o,l){Oe.prototype.init.call(this),this.field_=o||0,this.dataChannel_=l||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(d){var h,p,g,E,w;if(h=d.ccData&32639,h===this.lastControlCode_){this.lastControlCode_=null;return}if((h&61440)===4096?this.lastControlCode_=h:h!==this.PADDING_&&(this.lastControlCode_=null),g=h>>>8,E=h&255,h!==this.PADDING_)if(h===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(h===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(d.pts),this.flushDisplayed(d.pts),p=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=p,this.startPts_=d.pts;else if(h===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(d.pts);else if(h===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(d.pts);else if(h===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(d.pts);else if(h===this.CARRIAGE_RETURN_)this.clearFormatting(d.pts),this.flushDisplayed(d.pts),this.shiftRowsUp_(),this.startPts_=d.pts;else if(h===this.BACKSPACE_)this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1);else if(h===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(d.pts),this.displayed_=Di();else if(h===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Di();else if(h===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(d.pts),this.displayed_=Di()),this.mode_="paintOn",this.startPts_=d.pts;else if(this.isSpecialCharacter(g,E))g=(g&3)<<8,w=ks(g|E),this[this.mode_](d.pts,w),this.column_++;else if(this.isExtCharacter(g,E))this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1),g=(g&3)<<8,w=ks(g|E),this[this.mode_](d.pts,w),this.column_++;else if(this.isMidRowCode(g,E))this.clearFormatting(d.pts),this[this.mode_](d.pts," "),this.column_++,(E&14)===14&&this.addFormatting(d.pts,["i"]),(E&1)===1&&this.addFormatting(d.pts,["u"]);else if(this.isOffsetControlCode(g,E)){const x=E&3;this.nonDisplayed_[this.row_].offset=x,this.column_+=x}else if(this.isPAC(g,E)){var k=Ep.indexOf(h&7968);if(this.mode_==="rollUp"&&(k-this.rollUpRows_+1<0&&(k=this.rollUpRows_-1),this.setRollUp(d.pts,k)),k!==this.row_&&k>=0&&k<=14&&(this.clearFormatting(d.pts),this.row_=k),E&1&&this.formatting_.indexOf("u")===-1&&this.addFormatting(d.pts,["u"]),(h&16)===16){const x=(h&14)>>1;this.column_=x*4,this.nonDisplayed_[this.row_].indent+=x}this.isColorPAC(E)&&(E&14)===14&&this.addFormatting(d.pts,["i"])}else this.isNormalChar(g)&&(E===0&&(E=null),w=ks(g),w+=ks(E),this[this.mode_](d.pts,w),this.column_+=w.length)}};Oe.prototype=new di,Oe.prototype.flushDisplayed=function(o){const l=h=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+h+"."})},d=[];this.displayed_.forEach((h,p)=>{if(h&&h.text&&h.text.length){try{h.text=h.text.trim()}catch{l(p)}h.text.length&&d.push({text:h.text,line:p+1,position:10+Math.min(70,h.indent*10)+h.offset*2.5})}else h==null&&l(p)}),d.length&&this.trigger("data",{startPts:this.startPts_,endPts:o,content:d,stream:this.name_})},Oe.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Di(),this.nonDisplayed_=Di(),this.lastControlCode_=null,this.column_=0,this.row_=As,this.rollUpRows_=2,this.formatting_=[]},Oe.prototype.setConstants=function(){this.dataChannel_===0?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):this.dataChannel_===1&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=this.CONTROL_|32,this.END_OF_CAPTION_=this.CONTROL_|47,this.ROLL_UP_2_ROWS_=this.CONTROL_|37,this.ROLL_UP_3_ROWS_=this.CONTROL_|38,this.ROLL_UP_4_ROWS_=this.CONTROL_|39,this.CARRIAGE_RETURN_=this.CONTROL_|45,this.RESUME_DIRECT_CAPTIONING_=this.CONTROL_|41,this.BACKSPACE_=this.CONTROL_|33,this.ERASE_DISPLAYED_MEMORY_=this.CONTROL_|44,this.ERASE_NON_DISPLAYED_MEMORY_=this.CONTROL_|46},Oe.prototype.isSpecialCharacter=function(o,l){return o===this.EXT_&&l>=48&&l<=63},Oe.prototype.isExtCharacter=function(o,l){return(o===this.EXT_+1||o===this.EXT_+2)&&l>=32&&l<=63},Oe.prototype.isMidRowCode=function(o,l){return o===this.EXT_&&l>=32&&l<=47},Oe.prototype.isOffsetControlCode=function(o,l){return o===this.OFFSET_&&l>=33&&l<=35},Oe.prototype.isPAC=function(o,l){return o>=this.BASE_&&o<this.BASE_+8&&l>=64&&l<=127},Oe.prototype.isColorPAC=function(o){return o>=64&&o<=79||o>=96&&o<=127},Oe.prototype.isNormalChar=function(o){return o>=32&&o<=127},Oe.prototype.setRollUp=function(o,l){if(this.mode_!=="rollUp"&&(this.row_=As,this.mode_="rollUp",this.flushDisplayed(o),this.nonDisplayed_=Di(),this.displayed_=Di()),l!==void 0&&l!==this.row_)for(var d=0;d<this.rollUpRows_;d++)this.displayed_[l-d]=this.displayed_[this.row_-d],this.displayed_[this.row_-d]={text:"",indent:0,offset:0};l===void 0&&(l=this.row_),this.topRow_=l-this.rollUpRows_+1},Oe.prototype.addFormatting=function(o,l){this.formatting_=this.formatting_.concat(l);var d=l.reduce(function(h,p){return h+"<"+p+">"},"");this[this.mode_](o,d)},Oe.prototype.clearFormatting=function(o){if(this.formatting_.length){var l=this.formatting_.reverse().reduce(function(d,h){return d+"</"+h+">"},"");this.formatting_=[],this[this.mode_](o,l)}},Oe.prototype.popOn=function(o,l){var d=this.nonDisplayed_[this.row_].text;d+=l,this.nonDisplayed_[this.row_].text=d},Oe.prototype.rollUp=function(o,l){var d=this.displayed_[this.row_].text;d+=l,this.displayed_[this.row_].text=d},Oe.prototype.shiftRowsUp_=function(){var o;for(o=0;o<this.topRow_;o++)this.displayed_[o]={text:"",indent:0,offset:0};for(o=this.row_+1;o<As+1;o++)this.displayed_[o]={text:"",indent:0,offset:0};for(o=this.topRow_;o<this.row_;o++)this.displayed_[o]=this.displayed_[o+1];this.displayed_[this.row_]={text:"",indent:0,offset:0}},Oe.prototype.paintOn=function(o,l){var d=this.displayed_[this.row_].text;d+=l,this.displayed_[this.row_].text=d};var au={CaptionStream:Ue,Cea608Stream:Oe,Cea708Stream:Te},xs={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},Cp=t,wp=8589934592,kp=4294967296,ou="shared",Yn=function(o,l){var d=1;for(o>l&&(d=-1);Math.abs(l-o)>kp;)o+=d*wp;return o},Qn=function(o){var l,d;Qn.prototype.init.call(this),this.type_=o||ou,this.push=function(h){if(h.type==="metadata"){this.trigger("data",h);return}this.type_!==ou&&h.type!==this.type_||(d===void 0&&(d=h.dts),h.dts=Yn(h.dts,d),h.pts=Yn(h.pts,d),l=h.dts,this.trigger("data",h))},this.flush=function(){d=l,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){d=void 0,l=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};Qn.prototype=new Cp;var uu={TimestampRolloverStream:Qn,handleRollover:Yn},Ap=(o,l,d)=>{if(!o)return-1;for(var h=d;h<o.length;h++)if(o[h]===l)return h;return-1},xp={typedArrayIndexOf:Ap},Ds=xp.typedArrayIndexOf,Is={Utf8:3},lu=function(o,l,d){var h,p="";for(h=l;h<d;h++)p+="%"+("00"+o[h].toString(16)).slice(-2);return p},Nr=function(o,l,d){return decodeURIComponent(lu(o,l,d))},Rr=function(o,l,d){return unescape(lu(o,l,d))},Mr=function(o){return o[0]<<21|o[1]<<14|o[2]<<7|o[3]},Br={APIC:function(o){var l=1,d,h,p="-->";o.data[0]===Is.Utf8&&(d=Ds(o.data,0,l),!(d<0)&&(o.mimeType=Rr(o.data,l,d),l=d+1,o.pictureType=o.data[l],l++,h=Ds(o.data,0,l),!(h<0)&&(o.description=Nr(o.data,l,h),l=h+1,o.mimeType===p?o.url=Rr(o.data,l,o.data.length):o.pictureData=o.data.subarray(l,o.data.length))))},"T*":function(o){o.data[0]===Is.Utf8&&(o.value=Nr(o.data,1,o.data.length).replace(/\0*$/,""),o.values=o.value.split("\0"))},TXXX:function(o){var l;o.data[0]===Is.Utf8&&(l=Ds(o.data,0,1),l!==-1&&(o.description=Nr(o.data,1,l),o.value=Nr(o.data,l+1,o.data.length).replace(/\0*$/,""),o.data=o.value))},"W*":function(o){o.url=Rr(o.data,0,o.data.length).replace(/\0.*$/,"")},WXXX:function(o){var l;o.data[0]===Is.Utf8&&(l=Ds(o.data,0,1),l!==-1&&(o.description=Nr(o.data,1,l),o.url=Rr(o.data,l+1,o.data.length).replace(/\0.*$/,"")))},PRIV:function(o){var l;for(l=0;l<o.data.length;l++)if(o.data[l]===0){o.owner=Rr(o.data,0,l);break}o.privateData=o.data.subarray(l+1),o.data=o.privateData}},Dp=function(o){var l,d,h=10,p=0,g=[];if(!(o.length<10||o[0]!==73||o[1]!==68||o[2]!==51)){p=Mr(o.subarray(6,10)),p+=10;var E=o[5]&64;E&&(h+=4,h+=Mr(o.subarray(10,14)),p-=Mr(o.subarray(16,20)));do{if(l=Mr(o.subarray(h+4,h+8)),l<1)break;d=String.fromCharCode(o[h],o[h+1],o[h+2],o[h+3]);var w={id:d,data:o.subarray(h+10,h+l+10)};w.key=w.id,Br[w.id]?Br[w.id](w):w.id[0]==="T"?Br["T*"](w):w.id[0]==="W"&&Br["W*"](w),g.push(w),h+=10,h+=l}while(h<p);return g}},cu={parseId3Frames:Dp,parseSyncSafeInteger:Mr,frameParsers:Br},Ip=t,Pp=xs,pi=cu,Ps;Ps=function(o){var l={descriptor:o&&o.descriptor},d=0,h=[],p=0,g;if(Ps.prototype.init.call(this),this.dispatchType=Pp.METADATA_STREAM_TYPE.toString(16),l.descriptor)for(g=0;g<l.descriptor.length;g++)this.dispatchType+=("00"+l.descriptor[g].toString(16)).slice(-2);this.push=function(E){var w,k,x,B,G,ae;if(E.type==="timed-metadata"){if(E.dataAlignmentIndicator&&(p=0,h.length=0),h.length===0&&(E.data.length<10||E.data[0]!==73||E.data[1]!==68||E.data[2]!==51)){this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});return}if(h.push(E),p+=E.data.byteLength,h.length===1&&(d=pi.parseSyncSafeInteger(E.data.subarray(6,10)),d+=10),!(p<d)){for(w={data:new Uint8Array(d),frames:[],pts:h[0].pts,dts:h[0].dts},G=0;G<d;)w.data.set(h[0].data.subarray(0,d-G),G),G+=h[0].data.byteLength,p-=h[0].data.byteLength,h.shift();k=10,w.data[5]&64&&(k+=4,k+=pi.parseSyncSafeInteger(w.data.subarray(10,14)),d-=pi.parseSyncSafeInteger(w.data.subarray(16,20)));do{if(x=pi.parseSyncSafeInteger(w.data.subarray(k+4,k+8)),x<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break}if(ae=String.fromCharCode(w.data[k],w.data[k+1],w.data[k+2],w.data[k+3]),B={id:ae,data:w.data.subarray(k+10,k+x+10)},B.key=B.id,pi.frameParsers[B.id]?pi.frameParsers[B.id](B):B.id[0]==="T"?pi.frameParsers["T*"](B):B.id[0]==="W"&&pi.frameParsers["W*"](B),B.owner==="com.apple.streaming.transportStreamTimestamp"){var Y=B.data,ue=(Y[3]&1)<<30|Y[4]<<22|Y[5]<<14|Y[6]<<6|Y[7]>>>2;ue*=4,ue+=Y[7]&3,B.timeStamp=ue,w.pts===void 0&&w.dts===void 0&&(w.pts=B.timeStamp,w.dts=B.timeStamp),this.trigger("timestamp",B)}w.frames.push(B),k+=10,k+=x}while(k<d);this.trigger("data",w)}}}},Ps.prototype=new Ip;var Lp=Ps,Jn=t,Zn=au,Ot=xs,Op=uu.TimestampRolloverStream,Ls,Ur,Os,Ki=188,ea=71;Ls=function(){var o=new Uint8Array(Ki),l=0;Ls.prototype.init.call(this),this.push=function(d){var h=0,p=Ki,g;for(l?(g=new Uint8Array(d.byteLength+l),g.set(o.subarray(0,l)),g.set(d,l),l=0):g=d;p<g.byteLength;){if(g[h]===ea&&g[p]===ea){this.trigger("data",g.subarray(h,p)),h+=Ki,p+=Ki;continue}h++,p++}h<g.byteLength&&(o.set(g.subarray(h),0),l=g.byteLength-h)},this.flush=function(){l===Ki&&o[0]===ea&&(this.trigger("data",o),l=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){l=0,this.trigger("reset")}},Ls.prototype=new Jn,Ur=function(){var o,l,d,h;Ur.prototype.init.call(this),h=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,o=function(p,g){var E=0;g.payloadUnitStartIndicator&&(E+=p[E]+1),g.type==="pat"?l(p.subarray(E),g):d(p.subarray(E),g)},l=function(p,g){g.section_number=p[7],g.last_section_number=p[8],h.pmtPid=(p[10]&31)<<8|p[11],g.pmtPid=h.pmtPid},d=function(p,g){var E,w,k,x;if(p[5]&1){for(h.programMapTable={video:null,audio:null,"timed-metadata":{}},E=(p[1]&15)<<8|p[2],w=3+E-4,k=(p[10]&15)<<8|p[11],x=12+k;x<w;){var B=p[x],G=(p[x+1]&31)<<8|p[x+2];B===Ot.H264_STREAM_TYPE&&h.programMapTable.video===null?h.programMapTable.video=G:B===Ot.ADTS_STREAM_TYPE&&h.programMapTable.audio===null?h.programMapTable.audio=G:B===Ot.METADATA_STREAM_TYPE&&(h.programMapTable["timed-metadata"][G]=B),x+=((p[x+3]&15)<<8|p[x+4])+5}g.programMapTable=h.programMapTable}},this.push=function(p){var g={},E=4;if(g.payloadUnitStartIndicator=!!(p[1]&64),g.pid=p[1]&31,g.pid<<=8,g.pid|=p[2],(p[3]&48)>>>4>1&&(E+=p[E]+1),g.pid===0)g.type="pat",o(p.subarray(E),g),this.trigger("data",g);else if(g.pid===this.pmtPid)for(g.type="pmt",o(p.subarray(E),g),this.trigger("data",g);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([p,E,g]):this.processPes_(p,E,g)},this.processPes_=function(p,g,E){E.pid===this.programMapTable.video?E.streamType=Ot.H264_STREAM_TYPE:E.pid===this.programMapTable.audio?E.streamType=Ot.ADTS_STREAM_TYPE:E.streamType=this.programMapTable["timed-metadata"][E.pid],E.type="pes",E.data=p.subarray(g),this.trigger("data",E)}},Ur.prototype=new Jn,Ur.STREAM_TYPES={h264:27,adts:15},Os=function(){var o=this,l=!1,d={data:[],size:0},h={data:[],size:0},p={data:[],size:0},g,E=function(k,x){var B;const G=k[0]<<16|k[1]<<8|k[2];x.data=new Uint8Array,G===1&&(x.packetLength=6+(k[4]<<8|k[5]),x.dataAlignmentIndicator=(k[6]&4)!==0,B=k[7],B&192&&(x.pts=(k[9]&14)<<27|(k[10]&255)<<20|(k[11]&254)<<12|(k[12]&255)<<5|(k[13]&254)>>>3,x.pts*=4,x.pts+=(k[13]&6)>>>1,x.dts=x.pts,B&64&&(x.dts=(k[14]&14)<<27|(k[15]&255)<<20|(k[16]&254)<<12|(k[17]&255)<<5|(k[18]&254)>>>3,x.dts*=4,x.dts+=(k[18]&6)>>>1)),x.data=k.subarray(9+k[8]))},w=function(k,x,B){var G=new Uint8Array(k.size),ae={type:x},Y=0,ue=0,ye=!1,We;if(!(!k.data.length||k.size<9)){for(ae.trackId=k.data[0].pid,Y=0;Y<k.data.length;Y++)We=k.data[Y],G.set(We.data,ue),ue+=We.data.byteLength;E(G,ae),ye=x==="video"||ae.packetLength<=k.size,(B||ye)&&(k.size=0,k.data.length=0),ye&&o.trigger("data",ae)}};Os.prototype.init.call(this),this.push=function(k){({pat:function(){},pes:function(){var x,B;switch(k.streamType){case Ot.H264_STREAM_TYPE:x=d,B="video";break;case Ot.ADTS_STREAM_TYPE:x=h,B="audio";break;case Ot.METADATA_STREAM_TYPE:x=p,B="timed-metadata";break;default:return}k.payloadUnitStartIndicator&&w(x,B,!0),x.data.push(k),x.size+=k.data.byteLength},pmt:function(){var x={type:"metadata",tracks:[]};g=k.programMapTable,g.video!==null&&x.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+g.video,codec:"avc",type:"video"}),g.audio!==null&&x.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+g.audio,codec:"adts",type:"audio"}),l=!0,o.trigger("data",x)}})[k.type]()},this.reset=function(){d.size=0,d.data.length=0,h.size=0,h.data.length=0,this.trigger("reset")},this.flushStreams_=function(){w(d,"video"),w(h,"audio"),w(p,"timed-metadata")},this.flush=function(){if(!l&&g){var k={type:"metadata",tracks:[]};g.video!==null&&k.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+g.video,codec:"avc",type:"video"}),g.audio!==null&&k.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+g.audio,codec:"adts",type:"audio"}),o.trigger("data",k)}l=!1,this.flushStreams_(),this.trigger("done")}},Os.prototype=new Jn;var hu={PAT_PID:0,MP2T_PACKET_LENGTH:Ki,TransportPacketStream:Ls,TransportParseStream:Ur,ElementaryStream:Os,TimestampRolloverStream:Op,CaptionStream:Zn.CaptionStream,Cea608Stream:Zn.Cea608Stream,Cea708Stream:Zn.Cea708Stream,MetadataStream:Lp};for(var ta in Ot)Ot.hasOwnProperty(ta)&&(hu[ta]=Ot[ta]);var Np=hu,Rp=t,Mp=Se.ONE_SECOND_IN_TS,Ns,du=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];Ns=function(o){var l,d=0;Ns.prototype.init.call(this),this.skipWarn_=function(h,p){this.trigger("log",{level:"warn",message:`adts skiping bytes ${h} to ${p} in frame ${d} outside syncword`})},this.push=function(h){var p=0,g,E,w,k,x;if(o||(d=0),h.type==="audio"){l&&l.length?(w=l,l=new Uint8Array(w.byteLength+h.data.byteLength),l.set(w),l.set(h.data,w.byteLength)):l=h.data;for(var B;p+7<l.length;){if(l[p]!==255||(l[p+1]&246)!==240){typeof B!="number"&&(B=p),p++;continue}if(typeof B=="number"&&(this.skipWarn_(B,p),B=null),E=(~l[p+1]&1)*2,g=(l[p+3]&3)<<11|l[p+4]<<3|(l[p+5]&224)>>5,k=((l[p+6]&3)+1)*1024,x=k*Mp/du[(l[p+2]&60)>>>2],l.byteLength-p<g)break;this.trigger("data",{pts:h.pts+d*x,dts:h.dts+d*x,sampleCount:k,audioobjecttype:(l[p+2]>>>6&3)+1,channelcount:(l[p+2]&1)<<2|(l[p+3]&192)>>>6,samplerate:du[(l[p+2]&60)>>>2],samplingfrequencyindex:(l[p+2]&60)>>>2,samplesize:16,data:l.subarray(p+7+E,p+g)}),d++,p+=g}typeof B=="number"&&(this.skipWarn_(B,p),B=null),l=l.subarray(p)}},this.flush=function(){d=0,this.trigger("done")},this.reset=function(){l=void 0,this.trigger("reset")},this.endTimeline=function(){l=void 0,this.trigger("endedtimeline")}},Ns.prototype=new Rp;var Bp=Ns,pu;pu=function(o){var l=o.byteLength,d=0,h=0;this.length=function(){return 8*l},this.bitsAvailable=function(){return 8*l+h},this.loadWord=function(){var p=o.byteLength-l,g=new Uint8Array(4),E=Math.min(4,l);if(E===0)throw new Error("no bytes available");g.set(o.subarray(p,p+E)),d=new DataView(g.buffer).getUint32(0),h=E*8,l-=E},this.skipBits=function(p){var g;h>p?(d<<=p,h-=p):(p-=h,g=Math.floor(p/8),p-=g*8,l-=g,this.loadWord(),d<<=p,h-=p)},this.readBits=function(p){var g=Math.min(h,p),E=d>>>32-g;return h-=g,h>0?d<<=g:l>0&&this.loadWord(),g=p-g,g>0?E<<g|this.readBits(g):E},this.skipLeadingZeros=function(){var p;for(p=0;p<h;++p)if((d&2147483648>>>p)!==0)return d<<=p,h-=p,p;return this.loadWord(),p+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var p=this.skipLeadingZeros();return this.readBits(p+1)-1},this.readExpGolomb=function(){var p=this.readUnsignedExpGolomb();return 1&p?1+p>>>1:-1*(p>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var Up=pu,mu=t,Fp=Up,Rs,Ms,gu;Ms=function(){var o=0,l,d;Ms.prototype.init.call(this),this.push=function(h){var p;d?(p=new Uint8Array(d.byteLength+h.data.byteLength),p.set(d),p.set(h.data,d.byteLength),d=p):d=h.data;for(var g=d.byteLength;o<g-3;o++)if(d[o+2]===1){l=o+5;break}for(;l<g;)switch(d[l]){case 0:if(d[l-1]!==0){l+=2;break}else if(d[l-2]!==0){l++;break}o+3!==l-2&&this.trigger("data",d.subarray(o+3,l-2));do l++;while(d[l]!==1&&l<g);o=l-2,l+=3;break;case 1:if(d[l-1]!==0||d[l-2]!==0){l+=3;break}this.trigger("data",d.subarray(o+3,l-2)),o=l-2,l+=3;break;default:l+=3;break}d=d.subarray(o),l-=o,o=0},this.reset=function(){d=null,o=0,this.trigger("reset")},this.flush=function(){d&&d.byteLength>3&&this.trigger("data",d.subarray(o+3)),d=null,o=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},Ms.prototype=new mu,gu={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},Rs=function(){var o=new Ms,l,d,h,p,g,E,w;Rs.prototype.init.call(this),l=this,this.push=function(k){k.type==="video"&&(d=k.trackId,h=k.pts,p=k.dts,o.push(k))},o.on("data",function(k){var x={trackId:d,pts:h,dts:p,data:k,nalUnitTypeCode:k[0]&31};switch(x.nalUnitTypeCode){case 5:x.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:x.nalUnitType="sei_rbsp",x.escapedRBSP=g(k.subarray(1));break;case 7:x.nalUnitType="seq_parameter_set_rbsp",x.escapedRBSP=g(k.subarray(1)),x.config=E(x.escapedRBSP);break;case 8:x.nalUnitType="pic_parameter_set_rbsp";break;case 9:x.nalUnitType="access_unit_delimiter_rbsp";break}l.trigger("data",x)}),o.on("done",function(){l.trigger("done")}),o.on("partialdone",function(){l.trigger("partialdone")}),o.on("reset",function(){l.trigger("reset")}),o.on("endedtimeline",function(){l.trigger("endedtimeline")}),this.flush=function(){o.flush()},this.partialFlush=function(){o.partialFlush()},this.reset=function(){o.reset()},this.endTimeline=function(){o.endTimeline()},w=function(k,x){var B=8,G=8,ae,Y;for(ae=0;ae<k;ae++)G!==0&&(Y=x.readExpGolomb(),G=(B+Y+256)%256),B=G===0?B:G},g=function(k){for(var x=k.byteLength,B=[],G=1,ae,Y;G<x-2;)k[G]===0&&k[G+1]===0&&k[G+2]===3?(B.push(G+2),G+=2):G++;if(B.length===0)return k;ae=x-B.length,Y=new Uint8Array(ae);var ue=0;for(G=0;G<ae;ue++,G++)ue===B[0]&&(ue++,B.shift()),Y[G]=k[ue];return Y},E=function(k){var x=0,B=0,G=0,ae=0,Y,ue,ye,We,ot,qt,zr,Xs,Ks,Li,Wr,Pe=[1,1],Ku,Oi;if(Y=new Fp(k),ue=Y.readUnsignedByte(),We=Y.readUnsignedByte(),ye=Y.readUnsignedByte(),Y.skipUnsignedExpGolomb(),gu[ue]&&(ot=Y.readUnsignedExpGolomb(),ot===3&&Y.skipBits(1),Y.skipUnsignedExpGolomb(),Y.skipUnsignedExpGolomb(),Y.skipBits(1),Y.readBoolean()))for(Wr=ot!==3?8:12,Oi=0;Oi<Wr;Oi++)Y.readBoolean()&&(Oi<6?w(16,Y):w(64,Y));if(Y.skipUnsignedExpGolomb(),qt=Y.readUnsignedExpGolomb(),qt===0)Y.readUnsignedExpGolomb();else if(qt===1)for(Y.skipBits(1),Y.skipExpGolomb(),Y.skipExpGolomb(),zr=Y.readUnsignedExpGolomb(),Oi=0;Oi<zr;Oi++)Y.skipExpGolomb();if(Y.skipUnsignedExpGolomb(),Y.skipBits(1),Xs=Y.readUnsignedExpGolomb(),Ks=Y.readUnsignedExpGolomb(),Li=Y.readBits(1),Li===0&&Y.skipBits(1),Y.skipBits(1),Y.readBoolean()&&(x=Y.readUnsignedExpGolomb(),B=Y.readUnsignedExpGolomb(),G=Y.readUnsignedExpGolomb(),ae=Y.readUnsignedExpGolomb()),Y.readBoolean()&&Y.readBoolean()){switch(Ku=Y.readUnsignedByte(),Ku){case 1:Pe=[1,1];break;case 2:Pe=[12,11];break;case 3:Pe=[10,11];break;case 4:Pe=[16,11];break;case 5:Pe=[40,33];break;case 6:Pe=[24,11];break;case 7:Pe=[20,11];break;case 8:Pe=[32,11];break;case 9:Pe=[80,33];break;case 10:Pe=[18,11];break;case 11:Pe=[15,11];break;case 12:Pe=[64,33];break;case 13:Pe=[160,99];break;case 14:Pe=[4,3];break;case 15:Pe=[3,2];break;case 16:Pe=[2,1];break;case 255:{Pe=[Y.readUnsignedByte()<<8|Y.readUnsignedByte(),Y.readUnsignedByte()<<8|Y.readUnsignedByte()];break}}Pe&&Pe[0]/Pe[1]}return{profileIdc:ue,levelIdc:ye,profileCompatibility:We,width:(Xs+1)*16-x*2-B*2,height:(2-Li)*(Ks+1)*16-G*2-ae*2,sarRatio:Pe}}},Rs.prototype=new mu;var jp={H264Stream:Rs},qp=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],fu=function(o,l){var d=o[l+6]<<21|o[l+7]<<14|o[l+8]<<7|o[l+9],h=o[l+5],p=(h&16)>>4;return d=d>=0?d:0,p?d+20:d+10},yu=function(o,l){return o.length-l<10||o[l]!==73||o[l+1]!==68||o[l+2]!==51?l:(l+=fu(o,l),yu(o,l))},$p=function(o){var l=yu(o,0);return o.length>=l+2&&(o[l]&255)===255&&(o[l+1]&240)===240&&(o[l+1]&22)===16},_u=function(o){return o[0]<<21|o[1]<<14|o[2]<<7|o[3]},Hp=function(o,l,d){var h,p="";for(h=l;h<d;h++)p+="%"+("00"+o[h].toString(16)).slice(-2);return p},Vp=function(o,l,d){return unescape(Hp(o,l,d))},zp=function(o,l){var d=(o[l+5]&224)>>5,h=o[l+4]<<3,p=o[l+3]&6144;return p|h|d},Wp=function(o,l){return o[l]===73&&o[l+1]===68&&o[l+2]===51?"timed-metadata":o[l]&!0&&(o[l+1]&240)===240?"audio":null},Gp=function(o){for(var l=0;l+5<o.length;){if(o[l]!==255||(o[l+1]&246)!==240){l++;continue}return qp[(o[l+2]&60)>>>2]}return null},Xp=function(o){var l,d,h,p;l=10,o[5]&64&&(l+=4,l+=_u(o.subarray(10,14)));do{if(d=_u(o.subarray(l+4,l+8)),d<1)return null;if(p=String.fromCharCode(o[l],o[l+1],o[l+2],o[l+3]),p==="PRIV"){h=o.subarray(l+10,l+d+10);for(var g=0;g<h.byteLength;g++)if(h[g]===0){var E=Vp(h,0,g);if(E==="com.apple.streaming.transportStreamTimestamp"){var w=h.subarray(g+1),k=(w[3]&1)<<30|w[4]<<22|w[5]<<14|w[6]<<6|w[7]>>>2;return k*=4,k+=w[7]&3,k}break}}l+=10,l+=d}while(l<o.byteLength);return null},ia={isLikelyAacData:$p,parseId3TagSize:fu,parseAdtsSize:zp,parseType:Wp,parseSampleRate:Gp,parseAacTimestamp:Xp},Kp=t,bu=ia,Bs;Bs=function(){var o=new Uint8Array,l=0;Bs.prototype.init.call(this),this.setTimestamp=function(d){l=d},this.push=function(d){var h=0,p=0,g,E,w,k;for(o.length?(k=o.length,o=new Uint8Array(d.byteLength+k),o.set(o.subarray(0,k)),o.set(d,k)):o=d;o.length-p>=3;){if(o[p]===73&&o[p+1]===68&&o[p+2]===51){if(o.length-p<10||(h=bu.parseId3TagSize(o,p),p+h>o.length))break;E={type:"timed-metadata",data:o.subarray(p,p+h)},this.trigger("data",E),p+=h;continue}else if((o[p]&255)===255&&(o[p+1]&240)===240){if(o.length-p<7||(h=bu.parseAdtsSize(o,p),p+h>o.length))break;w={type:"audio",data:o.subarray(p,p+h),pts:l,dts:l},this.trigger("data",w),p+=h;continue}p++}g=o.length-p,g>0?o=o.subarray(p):o=new Uint8Array},this.reset=function(){o=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){o=new Uint8Array,this.trigger("endedtimeline")}},Bs.prototype=new Kp;var Yp=Bs,Qp=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],Jp=Qp,Zp=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],em=Zp,Us=t,Fr=Je,jr=Gi,Fs=Or,Nt=W,ei=Np,js=Se,vu=Bp,tm=jp.H264Stream,im=Yp,rm=ia.isLikelyAacData,sm=Se.ONE_SECOND_IN_TS,Tu=Jp,Su=em,qs,qr,$s,Ii,nm=function(o,l){l.stream=o,this.trigger("log",l)},Eu=function(o,l){for(var d=Object.keys(l),h=0;h<d.length;h++){var p=d[h];p==="headOfPipeline"||!l[p].on||l[p].on("log",nm.bind(o,p))}},Cu=function(o,l){var d;if(o.length!==l.length)return!1;for(d=0;d<o.length;d++)if(o[d]!==l[d])return!1;return!0},wu=function(o,l,d,h,p,g){var E=d-l,w=h-l,k=p-d;return{start:{dts:o,pts:o+E},end:{dts:o+w,pts:o+k},prependedContentDuration:g,baseMediaDecodeTime:o}};qr=function(o,l){var d=[],h,p=0,g=0,E=1/0;l=l||{},h=l.firstSequenceNumber||0,qr.prototype.init.call(this),this.push=function(w){Nt.collectDtsInfo(o,w),o&&Tu.forEach(function(k){o[k]=w[k]}),d.push(w)},this.setEarliestDts=function(w){p=w},this.setVideoBaseMediaDecodeTime=function(w){E=w},this.setAudioAppendStart=function(w){g=w},this.flush=function(){var w,k,x,B,G,ae,Y;if(d.length===0){this.trigger("done","AudioSegmentStream");return}w=Fs.trimAdtsFramesByEarliestDts(d,o,p),o.baseMediaDecodeTime=Nt.calculateTrackBaseMediaDecodeTime(o,l.keepOriginalTimestamps),Y=Fs.prefixWithSilence(o,w,g,E),o.samples=Fs.generateSampleTable(w),x=Fr.mdat(Fs.concatenateFrameData(w)),d=[],k=Fr.moof(h,[o]),B=new Uint8Array(k.byteLength+x.byteLength),h++,B.set(k),B.set(x,k.byteLength),Nt.clearDtsInfo(o),G=Math.ceil(sm*1024/o.samplerate),w.length&&(ae=w.length*G,this.trigger("segmentTimingInfo",wu(js.audioTsToVideoTs(o.baseMediaDecodeTime,o.samplerate),w[0].dts,w[0].pts,w[0].dts+ae,w[0].pts+ae,Y||0)),this.trigger("timingInfo",{start:w[0].pts,end:w[0].pts+ae})),this.trigger("data",{track:o,boxes:B}),this.trigger("done","AudioSegmentStream")},this.reset=function(){Nt.clearDtsInfo(o),d=[],this.trigger("reset")}},qr.prototype=new Us,qs=function(o,l){var d,h=[],p=[],g,E;l=l||{},d=l.firstSequenceNumber||0,qs.prototype.init.call(this),delete o.minPTS,this.gopCache_=[],this.push=function(w){Nt.collectDtsInfo(o,w),w.nalUnitType==="seq_parameter_set_rbsp"&&!g&&(g=w.config,o.sps=[w.data],Su.forEach(function(k){o[k]=g[k]},this)),w.nalUnitType==="pic_parameter_set_rbsp"&&!E&&(E=w.data,o.pps=[w.data]),h.push(w)},this.flush=function(){for(var w,k,x,B,G,ae,Y=0,ue,ye;h.length&&h[0].nalUnitType!=="access_unit_delimiter_rbsp";)h.shift();if(h.length===0){this.resetStream_(),this.trigger("done","VideoSegmentStream");return}if(w=jr.groupNalsIntoFrames(h),x=jr.groupFramesIntoGops(w),x[0][0].keyFrame||(k=this.getGopForFusion_(h[0],o),k?(Y=k.duration,x.unshift(k),x.byteLength+=k.byteLength,x.nalCount+=k.nalCount,x.pts=k.pts,x.dts=k.dts,x.duration+=k.duration):x=jr.extendFirstKeyFrame(x)),p.length){var We;if(l.alignGopsAtEnd?We=this.alignGopsAtEnd_(x):We=this.alignGopsAtStart_(x),!We){this.gopCache_.unshift({gop:x.pop(),pps:o.pps,sps:o.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),h=[],this.resetStream_(),this.trigger("done","VideoSegmentStream");return}Nt.clearDtsInfo(o),x=We}Nt.collectDtsInfo(o,x),o.samples=jr.generateSampleTable(x),G=Fr.mdat(jr.concatenateNalData(x)),o.baseMediaDecodeTime=Nt.calculateTrackBaseMediaDecodeTime(o,l.keepOriginalTimestamps),this.trigger("processedGopsInfo",x.map(function(ot){return{pts:ot.pts,dts:ot.dts,byteLength:ot.byteLength}})),ue=x[0],ye=x[x.length-1],this.trigger("segmentTimingInfo",wu(o.baseMediaDecodeTime,ue.dts,ue.pts,ye.dts+ye.duration,ye.pts+ye.duration,Y)),this.trigger("timingInfo",{start:x[0].pts,end:x[x.length-1].pts+x[x.length-1].duration}),this.gopCache_.unshift({gop:x.pop(),pps:o.pps,sps:o.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),h=[],this.trigger("baseMediaDecodeTime",o.baseMediaDecodeTime),this.trigger("timelineStartInfo",o.timelineStartInfo),B=Fr.moof(d,[o]),ae=new Uint8Array(B.byteLength+G.byteLength),d++,ae.set(B),ae.set(G,B.byteLength),this.trigger("data",{track:o,boxes:ae}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),h=[],this.gopCache_.length=0,p.length=0,this.trigger("reset")},this.resetStream_=function(){Nt.clearDtsInfo(o),g=void 0,E=void 0},this.getGopForFusion_=function(w){var k=45e3,x=1/0,B,G,ae,Y,ue;for(ue=0;ue<this.gopCache_.length;ue++)Y=this.gopCache_[ue],ae=Y.gop,!(!(o.pps&&Cu(o.pps[0],Y.pps[0]))||!(o.sps&&Cu(o.sps[0],Y.sps[0])))&&(ae.dts<o.timelineStartInfo.dts||(B=w.dts-ae.dts-ae.duration,B>=-1e4&&B<=k&&(!G||x>B)&&(G=Y,x=B)));return G?G.gop:null},this.alignGopsAtStart_=function(w){var k,x,B,G,ae,Y,ue,ye;for(ae=w.byteLength,Y=w.nalCount,ue=w.duration,k=x=0;k<p.length&&x<w.length&&(B=p[k],G=w[x],B.pts!==G.pts);){if(G.pts>B.pts){k++;continue}x++,ae-=G.byteLength,Y-=G.nalCount,ue-=G.duration}return x===0?w:x===w.length?null:(ye=w.slice(x),ye.byteLength=ae,ye.duration=ue,ye.nalCount=Y,ye.pts=ye[0].pts,ye.dts=ye[0].dts,ye)},this.alignGopsAtEnd_=function(w){var k,x,B,G,ae,Y;for(k=p.length-1,x=w.length-1,ae=null,Y=!1;k>=0&&x>=0;){if(B=p[k],G=w[x],B.pts===G.pts){Y=!0;break}if(B.pts>G.pts){k--;continue}k===p.length-1&&(ae=x),x--}if(!Y&&ae===null)return null;var ue;if(Y?ue=x:ue=ae,ue===0)return w;var ye=w.slice(ue),We=ye.reduce(function(ot,qt){return ot.byteLength+=qt.byteLength,ot.duration+=qt.duration,ot.nalCount+=qt.nalCount,ot},{byteLength:0,duration:0,nalCount:0});return ye.byteLength=We.byteLength,ye.duration=We.duration,ye.nalCount=We.nalCount,ye.pts=ye[0].pts,ye.dts=ye[0].dts,ye},this.alignGopsWith=function(w){p=w}},qs.prototype=new Us,Ii=function(o,l){this.numberOfTracks=0,this.metadataStream=l,o=o||{},typeof o.remux<"u"?this.remuxTracks=!!o.remux:this.remuxTracks=!0,typeof o.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=o.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,Ii.prototype.init.call(this),this.push=function(d){if(d.content||d.text)return this.pendingCaptions.push(d);if(d.frames)return this.pendingMetadata.push(d);this.pendingTracks.push(d.track),this.pendingBytes+=d.boxes.byteLength,d.track.type==="video"&&(this.videoTrack=d.track,this.pendingBoxes.push(d.boxes)),d.track.type==="audio"&&(this.audioTrack=d.track,this.pendingBoxes.unshift(d.boxes))}},Ii.prototype=new Us,Ii.prototype.flush=function(o){var l=0,d={captions:[],captionStreams:{},metadata:[],info:{}},h,p,g,E=0,w;if(this.pendingTracks.length<this.numberOfTracks){if(o!=="VideoSegmentStream"&&o!=="AudioSegmentStream"||this.remuxTracks)return;if(this.pendingTracks.length===0){this.emittedTracks++,this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);return}}if(this.videoTrack?(E=this.videoTrack.timelineStartInfo.pts,Su.forEach(function(k){d.info[k]=this.videoTrack[k]},this)):this.audioTrack&&(E=this.audioTrack.timelineStartInfo.pts,Tu.forEach(function(k){d.info[k]=this.audioTrack[k]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?d.type=this.pendingTracks[0].type:d.type="combined",this.emittedTracks+=this.pendingTracks.length,g=Fr.initSegment(this.pendingTracks),d.initSegment=new Uint8Array(g.byteLength),d.initSegment.set(g),d.data=new Uint8Array(this.pendingBytes),w=0;w<this.pendingBoxes.length;w++)d.data.set(this.pendingBoxes[w],l),l+=this.pendingBoxes[w].byteLength;for(w=0;w<this.pendingCaptions.length;w++)h=this.pendingCaptions[w],h.startTime=js.metadataTsToSeconds(h.startPts,E,this.keepOriginalTimestamps),h.endTime=js.metadataTsToSeconds(h.endPts,E,this.keepOriginalTimestamps),d.captionStreams[h.stream]=!0,d.captions.push(h);for(w=0;w<this.pendingMetadata.length;w++)p=this.pendingMetadata[w],p.cueTime=js.metadataTsToSeconds(p.pts,E,this.keepOriginalTimestamps),d.metadata.push(p);for(d.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",d),w=0;w<d.captions.length;w++)h=d.captions[w],this.trigger("caption",h);for(w=0;w<d.metadata.length;w++)p=d.metadata[w],this.trigger("id3Frame",p)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},Ii.prototype.setRemux=function(o){this.remuxTracks=o},$s=function(o){var l=this,d=!0,h,p;$s.prototype.init.call(this),o=o||{},this.baseMediaDecodeTime=o.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var g={};this.transmuxPipeline_=g,g.type="aac",g.metadataStream=new ei.MetadataStream,g.aacStream=new im,g.audioTimestampRolloverStream=new ei.TimestampRolloverStream("audio"),g.timedMetadataTimestampRolloverStream=new ei.TimestampRolloverStream("timed-metadata"),g.adtsStream=new vu,g.coalesceStream=new Ii(o,g.metadataStream),g.headOfPipeline=g.aacStream,g.aacStream.pipe(g.audioTimestampRolloverStream).pipe(g.adtsStream),g.aacStream.pipe(g.timedMetadataTimestampRolloverStream).pipe(g.metadataStream).pipe(g.coalesceStream),g.metadataStream.on("timestamp",function(E){g.aacStream.setTimestamp(E.timeStamp)}),g.aacStream.on("data",function(E){E.type!=="timed-metadata"&&E.type!=="audio"||g.audioSegmentStream||(p=p||{timelineStartInfo:{baseMediaDecodeTime:l.baseMediaDecodeTime},codec:"adts",type:"audio"},g.coalesceStream.numberOfTracks++,g.audioSegmentStream=new qr(p,o),g.audioSegmentStream.on("log",l.getLogTrigger_("audioSegmentStream")),g.audioSegmentStream.on("timingInfo",l.trigger.bind(l,"audioTimingInfo")),g.adtsStream.pipe(g.audioSegmentStream).pipe(g.coalesceStream),l.trigger("trackinfo",{hasAudio:!!p,hasVideo:!!h}))}),g.coalesceStream.on("data",this.trigger.bind(this,"data")),g.coalesceStream.on("done",this.trigger.bind(this,"done")),Eu(this,g)},this.setupTsPipeline=function(){var g={};this.transmuxPipeline_=g,g.type="ts",g.metadataStream=new ei.MetadataStream,g.packetStream=new ei.TransportPacketStream,g.parseStream=new ei.TransportParseStream,g.elementaryStream=new ei.ElementaryStream,g.timestampRolloverStream=new ei.TimestampRolloverStream,g.adtsStream=new vu,g.h264Stream=new tm,g.captionStream=new ei.CaptionStream(o),g.coalesceStream=new Ii(o,g.metadataStream),g.headOfPipeline=g.packetStream,g.packetStream.pipe(g.parseStream).pipe(g.elementaryStream).pipe(g.timestampRolloverStream),g.timestampRolloverStream.pipe(g.h264Stream),g.timestampRolloverStream.pipe(g.adtsStream),g.timestampRolloverStream.pipe(g.metadataStream).pipe(g.coalesceStream),g.h264Stream.pipe(g.captionStream).pipe(g.coalesceStream),g.elementaryStream.on("data",function(E){var w;if(E.type==="metadata"){for(w=E.tracks.length;w--;)!h&&E.tracks[w].type==="video"?(h=E.tracks[w],h.timelineStartInfo.baseMediaDecodeTime=l.baseMediaDecodeTime):!p&&E.tracks[w].type==="audio"&&(p=E.tracks[w],p.timelineStartInfo.baseMediaDecodeTime=l.baseMediaDecodeTime);h&&!g.videoSegmentStream&&(g.coalesceStream.numberOfTracks++,g.videoSegmentStream=new qs(h,o),g.videoSegmentStream.on("log",l.getLogTrigger_("videoSegmentStream")),g.videoSegmentStream.on("timelineStartInfo",function(k){p&&!o.keepOriginalTimestamps&&(p.timelineStartInfo=k,g.audioSegmentStream.setEarliestDts(k.dts-l.baseMediaDecodeTime))}),g.videoSegmentStream.on("processedGopsInfo",l.trigger.bind(l,"gopInfo")),g.videoSegmentStream.on("segmentTimingInfo",l.trigger.bind(l,"videoSegmentTimingInfo")),g.videoSegmentStream.on("baseMediaDecodeTime",function(k){p&&g.audioSegmentStream.setVideoBaseMediaDecodeTime(k)}),g.videoSegmentStream.on("timingInfo",l.trigger.bind(l,"videoTimingInfo")),g.h264Stream.pipe(g.videoSegmentStream).pipe(g.coalesceStream)),p&&!g.audioSegmentStream&&(g.coalesceStream.numberOfTracks++,g.audioSegmentStream=new qr(p,o),g.audioSegmentStream.on("log",l.getLogTrigger_("audioSegmentStream")),g.audioSegmentStream.on("timingInfo",l.trigger.bind(l,"audioTimingInfo")),g.audioSegmentStream.on("segmentTimingInfo",l.trigger.bind(l,"audioSegmentTimingInfo")),g.adtsStream.pipe(g.audioSegmentStream).pipe(g.coalesceStream)),l.trigger("trackinfo",{hasAudio:!!p,hasVideo:!!h})}}),g.coalesceStream.on("data",this.trigger.bind(this,"data")),g.coalesceStream.on("id3Frame",function(E){E.dispatchType=g.metadataStream.dispatchType,l.trigger("id3Frame",E)}),g.coalesceStream.on("caption",this.trigger.bind(this,"caption")),g.coalesceStream.on("done",this.trigger.bind(this,"done")),Eu(this,g)},this.setBaseMediaDecodeTime=function(g){var E=this.transmuxPipeline_;o.keepOriginalTimestamps||(this.baseMediaDecodeTime=g),p&&(p.timelineStartInfo.dts=void 0,p.timelineStartInfo.pts=void 0,Nt.clearDtsInfo(p),E.audioTimestampRolloverStream&&E.audioTimestampRolloverStream.discontinuity()),h&&(E.videoSegmentStream&&(E.videoSegmentStream.gopCache_=[]),h.timelineStartInfo.dts=void 0,h.timelineStartInfo.pts=void 0,Nt.clearDtsInfo(h),E.captionStream.reset()),E.timestampRolloverStream&&E.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(g){p&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(g)},this.setRemux=function(g){var E=this.transmuxPipeline_;o.remux=g,E&&E.coalesceStream&&E.coalesceStream.setRemux(g)},this.alignGopsWith=function(g){h&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(g)},this.getLogTrigger_=function(g){var E=this;return function(w){w.stream=g,E.trigger("log",w)}},this.push=function(g){if(d){var E=rm(g);E&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!E&&this.transmuxPipeline_.type!=="ts"&&this.setupTsPipeline(),d=!1}this.transmuxPipeline_.headOfPipeline.push(g)},this.flush=function(){d=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},$s.prototype=new Us;var am={Transmuxer:$s},om=function(o){return o>>>0},um=function(o){return("00"+o.toString(16)).slice(-2)},Hs={toUnsigned:om,toHexString:um},lm=function(o){var l="";return l+=String.fromCharCode(o[0]),l+=String.fromCharCode(o[1]),l+=String.fromCharCode(o[2]),l+=String.fromCharCode(o[3]),l},ku=lm,cm=Hs.toUnsigned,hm=ku,Au=function(o,l){var d=[],h,p,g,E,w;if(!l.length)return null;for(h=0;h<o.byteLength;)p=cm(o[h]<<24|o[h+1]<<16|o[h+2]<<8|o[h+3]),g=hm(o.subarray(h+4,h+8)),E=p>1?h+p:o.byteLength,g===l[0]&&(l.length===1?d.push(o.subarray(h+8,E)):(w=Au(o.subarray(h+8,E),l.slice(1)),w.length&&(d=d.concat(w)))),h=E;return d},ra=Au,dm=Hs.toUnsigned,pm=n.getUint64,mm=function(o){var l={version:o[0],flags:new Uint8Array(o.subarray(1,4))};return l.version===1?l.baseMediaDecodeTime=pm(o.subarray(4)):l.baseMediaDecodeTime=dm(o[4]<<24|o[5]<<16|o[6]<<8|o[7]),l},sa=mm,gm=function(o){var l=new DataView(o.buffer,o.byteOffset,o.byteLength),d={version:o[0],flags:new Uint8Array(o.subarray(1,4)),trackId:l.getUint32(4)},h=d.flags[2]&1,p=d.flags[2]&2,g=d.flags[2]&8,E=d.flags[2]&16,w=d.flags[2]&32,k=d.flags[0]&65536,x=d.flags[0]&131072,B;return B=8,h&&(B+=4,d.baseDataOffset=l.getUint32(12),B+=4),p&&(d.sampleDescriptionIndex=l.getUint32(B),B+=4),g&&(d.defaultSampleDuration=l.getUint32(B),B+=4),E&&(d.defaultSampleSize=l.getUint32(B),B+=4),w&&(d.defaultSampleFlags=l.getUint32(B)),k&&(d.durationIsEmpty=!0),!h&&x&&(d.baseDataOffsetIsMoof=!0),d},xu=gm,fm=function(o){return{isLeading:(o[0]&12)>>>2,dependsOn:o[0]&3,isDependedOn:(o[1]&192)>>>6,hasRedundancy:(o[1]&48)>>>4,paddingValue:(o[1]&14)>>>1,isNonSyncSample:o[1]&1,degradationPriority:o[2]<<8|o[3]}},ym=fm,Du=ym,_m=function(o){var l={version:o[0],flags:new Uint8Array(o.subarray(1,4)),samples:[]},d=new DataView(o.buffer,o.byteOffset,o.byteLength),h=l.flags[2]&1,p=l.flags[2]&4,g=l.flags[1]&1,E=l.flags[1]&2,w=l.flags[1]&4,k=l.flags[1]&8,x=d.getUint32(4),B=8,G;for(h&&(l.dataOffset=d.getInt32(B),B+=4),p&&x&&(G={flags:Du(o.subarray(B,B+4))},B+=4,g&&(G.duration=d.getUint32(B),B+=4),E&&(G.size=d.getUint32(B),B+=4),k&&(l.version===1?G.compositionTimeOffset=d.getInt32(B):G.compositionTimeOffset=d.getUint32(B),B+=4),l.samples.push(G),x--);x--;)G={},g&&(G.duration=d.getUint32(B),B+=4),E&&(G.size=d.getUint32(B),B+=4),w&&(G.flags=Du(o.subarray(B,B+4)),B+=4),k&&(l.version===1?G.compositionTimeOffset=d.getInt32(B):G.compositionTimeOffset=d.getUint32(B),B+=4),l.samples.push(G);return l},Iu=_m,Pu={tfdt:sa,trun:Iu},Lu={parseTfdt:Pu.tfdt,parseTrun:Pu.trun},bm=function(o){for(var l=0,d=String.fromCharCode(o[l]),h="";d!=="\0";)h+=d,l++,d=String.fromCharCode(o[l]);return h+=d,h},vm={uint8ToCString:bm},Vs=vm.uint8ToCString,Tm=n.getUint64,Sm=function(o){var l=4,d=o[0],h,p,g,E,w,k,x,B;if(d===0){h=Vs(o.subarray(l)),l+=h.length,p=Vs(o.subarray(l)),l+=p.length;var G=new DataView(o.buffer);g=G.getUint32(l),l+=4,w=G.getUint32(l),l+=4,k=G.getUint32(l),l+=4,x=G.getUint32(l),l+=4}else if(d===1){var G=new DataView(o.buffer);g=G.getUint32(l),l+=4,E=Tm(o.subarray(l)),l+=8,k=G.getUint32(l),l+=4,x=G.getUint32(l),l+=4,h=Vs(o.subarray(l)),l+=h.length,p=Vs(o.subarray(l)),l+=p.length}B=new Uint8Array(o.subarray(l,o.byteLength));var ae={scheme_id_uri:h,value:p,timescale:g||1,presentation_time:E,presentation_time_delta:w,event_duration:k,id:x,message_data:B};return Cm(d,ae)?ae:void 0},Em=function(o,l,d,h){return o||o===0?o/l:h+d/l},Cm=function(o,l){var d=l.scheme_id_uri!=="\0",h=o===0&&Ou(l.presentation_time_delta)&&d,p=o===1&&Ou(l.presentation_time)&&d;return!(o>1)&&h||p},Ou=function(o){return o!==void 0||o!==null},wm={parseEmsgBox:Sm,scaleTime:Em},$r;typeof window<"u"?$r=window:typeof r<"u"?$r=r:typeof self<"u"?$r=self:$r={};var Nu=$r,zs=Hs.toUnsigned,Hr=Hs.toHexString,je=ra,Yi=ku,na=wm,km=xu,Am=Iu,xm=sa,Dm=n.getUint64,Ru,Mu,Bu,Uu,Fu,aa,ju,oa=Nu,Im=cu.parseId3Frames;Ru=function(o){var l={},d=je(o,["moov","trak"]);return d.reduce(function(h,p){var g,E,w,k,x;return g=je(p,["tkhd"])[0],!g||(E=g[0],w=E===0?12:20,k=zs(g[w]<<24|g[w+1]<<16|g[w+2]<<8|g[w+3]),x=je(p,["mdia","mdhd"])[0],!x)?null:(E=x[0],w=E===0?12:20,h[k]=zs(x[w]<<24|x[w+1]<<16|x[w+2]<<8|x[w+3]),h)},l)},Mu=function(o,l){var d;d=je(l,["moof","traf"]);var h=d.reduce(function(p,g){var E=je(g,["tfhd"])[0],w=zs(E[4]<<24|E[5]<<16|E[6]<<8|E[7]),k=o[w]||9e4,x=je(g,["tfdt"])[0],B=new DataView(x.buffer,x.byteOffset,x.byteLength),G;x[0]===1?G=Dm(x.subarray(4,12)):G=B.getUint32(4);let ae;return typeof G=="bigint"?ae=G/oa.BigInt(k):typeof G=="number"&&!isNaN(G)&&(ae=G/k),ae<Number.MAX_SAFE_INTEGER&&(ae=Number(ae)),ae<p&&(p=ae),p},1/0);return typeof h=="bigint"||isFinite(h)?h:0},Bu=function(o,l){var d=je(l,["moof","traf"]),h=0,p=0,g;if(d&&d.length){var E=je(d[0],["tfhd"])[0],w=je(d[0],["trun"])[0],k=je(d[0],["tfdt"])[0];if(E){var x=km(E);g=x.trackId}if(k){var B=xm(k);h=B.baseMediaDecodeTime}if(w){var G=Am(w);G.samples&&G.samples.length&&(p=G.samples[0].compositionTimeOffset||0)}}var ae=o[g]||9e4;typeof h=="bigint"&&(p=oa.BigInt(p),ae=oa.BigInt(ae));var Y=(h+p)/ae;return typeof Y=="bigint"&&Y<Number.MAX_SAFE_INTEGER&&(Y=Number(Y)),Y},Uu=function(o){var l=je(o,["moov","trak"]),d=[];return l.forEach(function(h){var p=je(h,["mdia","hdlr"]),g=je(h,["tkhd"]);p.forEach(function(E,w){var k=Yi(E.subarray(8,12)),x=g[w],B,G,ae;k==="vide"&&(B=new DataView(x.buffer,x.byteOffset,x.byteLength),G=B.getUint8(0),ae=G===0?B.getUint32(12):B.getUint32(20),d.push(ae))})}),d},aa=function(o){var l=o[0],d=l===0?12:20;return zs(o[d]<<24|o[d+1]<<16|o[d+2]<<8|o[d+3])},Fu=function(o){var l=je(o,["moov","trak"]),d=[];return l.forEach(function(h){var p={},g=je(h,["tkhd"])[0],E,w;g&&(E=new DataView(g.buffer,g.byteOffset,g.byteLength),w=E.getUint8(0),p.id=w===0?E.getUint32(12):E.getUint32(20));var k=je(h,["mdia","hdlr"])[0];if(k){var x=Yi(k.subarray(8,12));x==="vide"?p.type="video":x==="soun"?p.type="audio":p.type=x}var B=je(h,["mdia","minf","stbl","stsd"])[0];if(B){var G=B.subarray(8);p.codec=Yi(G.subarray(4,8));var ae=je(G,[p.codec])[0],Y,ue;ae&&(/^[asm]vc[1-9]$/i.test(p.codec)?(Y=ae.subarray(78),ue=Yi(Y.subarray(4,8)),ue==="avcC"&&Y.length>11?(p.codec+=".",p.codec+=Hr(Y[9]),p.codec+=Hr(Y[10]),p.codec+=Hr(Y[11])):p.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(p.codec)?(Y=ae.subarray(28),ue=Yi(Y.subarray(4,8)),ue==="esds"&&Y.length>20&&Y[19]!==0?(p.codec+="."+Hr(Y[19]),p.codec+="."+Hr(Y[20]>>>2&63).replace(/^0/,"")):p.codec="mp4a.40.2"):p.codec=p.codec.toLowerCase())}var ye=je(h,["mdia","mdhd"])[0];ye&&(p.timescale=aa(ye)),d.push(p)}),d},ju=function(o,l=0){var d=je(o,["emsg"]);return d.map(h=>{var p=na.parseEmsgBox(new Uint8Array(h)),g=Im(p.message_data);return{cueTime:na.scaleTime(p.presentation_time,p.timescale,p.presentation_time_delta,l),duration:na.scaleTime(p.event_duration,p.timescale),frames:g}})};var Vr={findBox:je,parseType:Yi,timescale:Ru,startTime:Mu,compositionStartTime:Bu,videoTrackIds:Uu,tracks:Fu,getTimescaleFromMediaHeader:aa,getEmsgID3:ju};const{parseTrun:Pm}=Lu,{findBox:qu}=Vr;var $u=Nu,Lm=function(o){var l=qu(o,["moof","traf"]),d=qu(o,["mdat"]),h=[];return d.forEach(function(p,g){var E=l[g];h.push({mdat:p,traf:E})}),h},Om=function(o,l,d){var h=l,p=d.defaultSampleDuration||0,g=d.defaultSampleSize||0,E=d.trackId,w=[];return o.forEach(function(k){var x=Pm(k),B=x.samples;B.forEach(function(G){G.duration===void 0&&(G.duration=p),G.size===void 0&&(G.size=g),G.trackId=E,G.dts=h,G.compositionTimeOffset===void 0&&(G.compositionTimeOffset=0),typeof h=="bigint"?(G.pts=h+$u.BigInt(G.compositionTimeOffset),h+=$u.BigInt(G.duration)):(G.pts=h+G.compositionTimeOffset,h+=G.duration)}),w=w.concat(B)}),w},Hu={getMdatTrafPairs:Lm,parseSamples:Om},Nm=Et.discardEmulationPreventionBytes,Rm=au.CaptionStream,ua=ra,Mm=sa,Bm=xu,{getMdatTrafPairs:Um,parseSamples:Fm}=Hu,jm=function(o,l){for(var d=o,h=0;h<l.length;h++){var p=l[h];if(d<p.size)return p;d-=p.size}return null},qm=function(o,l,d){var h=new DataView(o.buffer,o.byteOffset,o.byteLength),p={logs:[],seiNals:[]},g,E,w,k;for(E=0;E+4<o.length;E+=w)if(w=h.getUint32(E),E+=4,!(w<=0))switch(o[E]&31){case 6:var x=o.subarray(E+1,E+1+w),B=jm(E,l);if(g={nalUnitType:"sei_rbsp",size:w,data:x,escapedRBSP:Nm(x),trackId:d},B)g.pts=B.pts,g.dts=B.dts,k=B;else if(k)g.pts=k.pts,g.dts=k.dts;else{p.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+E+" for trackId "+d+". See mux.js#223."});break}p.seiNals.push(g);break}return p},$m=function(o,l){var d={},h=Um(o);return h.forEach(function(p){var g=p.mdat,E=p.traf,w=ua(E,["tfhd"]),k=Bm(w[0]),x=k.trackId,B=ua(E,["tfdt"]),G=B.length>0?Mm(B[0]).baseMediaDecodeTime:0,ae=ua(E,["trun"]),Y,ue;l===x&&ae.length>0&&(Y=Fm(ae,G,k),ue=qm(g,Y,x),d[x]||(d[x]={seiNals:[],logs:[]}),d[x].seiNals=d[x].seiNals.concat(ue.seiNals),d[x].logs=d[x].logs.concat(ue.logs))}),d},Hm=function(o,l,d){var h;if(l===null)return null;h=$m(o,l);var p=h[l]||{};return{seiNals:p.seiNals,logs:p.logs,timescale:d}},Vm=function(){var o=!1,l,d,h,p,g,E;this.isInitialized=function(){return o},this.init=function(w){l=new Rm,o=!0,E=w?w.isPartial:!1,l.on("data",function(k){k.startTime=k.startPts/p,k.endTime=k.endPts/p,g.captions.push(k),g.captionStreams[k.stream]=!0}),l.on("log",function(k){g.logs.push(k)})},this.isNewInit=function(w,k){return w&&w.length===0||k&&typeof k=="object"&&Object.keys(k).length===0?!1:h!==w[0]||p!==k[h]},this.parse=function(w,k,x){var B;if(this.isInitialized()){if(!k||!x)return null;if(this.isNewInit(k,x))h=k[0],p=x[h];else if(h===null||!p)return d.push(w),null}else return null;for(;d.length>0;){var G=d.shift();this.parse(G,k,x)}return B=Hm(w,h,p),B&&B.logs&&(g.logs=g.logs.concat(B.logs)),B===null||!B.seiNals?g.logs.length?{logs:g.logs,captions:[],captionStreams:[]}:null:(this.pushNals(B.seiNals),this.flushStream(),g)},this.pushNals=function(w){if(!this.isInitialized()||!w||w.length===0)return null;w.forEach(function(k){l.push(k)})},this.flushStream=function(){if(!this.isInitialized())return null;E?l.partialFlush():l.flush()},this.clearParsedCaptions=function(){g.captions=[],g.captionStreams={},g.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;l.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){d=[],h=null,p=null,g?this.clearParsedCaptions():g={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},zm=Vm;const{parseTfdt:Wm}=Lu,mi=ra,{getTimescaleFromMediaHeader:Gm}=Vr,{parseSamples:Xm,getMdatTrafPairs:Km}=Hu;var Vu=function(){let o=9e4;this.init=function(l){const d=mi(l,["moov","trak","mdia","mdhd"])[0];d&&(o=Gm(d))},this.parseSegment=function(l){const d=[],h=Km(l);let p=0;return h.forEach(function(g){const E=g.mdat,w=g.traf,k=mi(w,["tfdt"])[0],x=mi(w,["tfhd"])[0],B=mi(w,["trun"]);if(k&&(p=Wm(k).baseMediaDecodeTime),B.length&&x){const G=Xm(B,p,x);let ae=0;G.forEach(function(Y){const ue="utf-8",ye=new TextDecoder(ue),We=E.slice(ae,ae+Y.size);if(mi(We,["vtte"])[0]){ae+=Y.size;return}mi(We,["vttc"]).forEach(function(ot){const qt=mi(ot,["payl"])[0],zr=mi(ot,["sttg"])[0],Xs=Y.pts/o,Ks=(Y.pts+Y.duration)/o;let Li,Wr;if(qt)try{Li=ye.decode(qt)}catch(Pe){console.error(Pe)}if(zr)try{Wr=ye.decode(zr)}catch(Pe){console.error(Pe)}Y.duration&&Li&&d.push({cueText:Li,start:Xs,end:Ks,settings:Wr})}),ae+=Y.size})}}),d}},la=xs,zu=function(o){var l=o[1]&31;return l<<=8,l|=o[2],l},Ws=function(o){return!!(o[1]&64)},Gs=function(o){var l=0;return(o[3]&48)>>>4>1&&(l+=o[4]+1),l},Ym=function(o,l){var d=zu(o);return d===0?"pat":d===l?"pmt":l?"pes":null},Qm=function(o){var l=Ws(o),d=4+Gs(o);return l&&(d+=o[d]+1),(o[d+10]&31)<<8|o[d+11]},Jm=function(o){var l={},d=Ws(o),h=4+Gs(o);if(d&&(h+=o[h]+1),!!(o[h+5]&1)){var p,g,E;p=(o[h+1]&15)<<8|o[h+2],g=3+p-4,E=(o[h+10]&15)<<8|o[h+11];for(var w=12+E;w<g;){var k=h+w;l[(o[k+1]&31)<<8|o[k+2]]=o[k],w+=((o[k+3]&15)<<8|o[k+4])+5}return l}},Zm=function(o,l){var d=zu(o),h=l[d];switch(h){case la.H264_STREAM_TYPE:return"video";case la.ADTS_STREAM_TYPE:return"audio";case la.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},eg=function(o){var l=Ws(o);if(!l)return null;var d=4+Gs(o);if(d>=o.byteLength)return null;var h=null,p;return p=o[d+7],p&192&&(h={},h.pts=(o[d+9]&14)<<27|(o[d+10]&255)<<20|(o[d+11]&254)<<12|(o[d+12]&255)<<5|(o[d+13]&254)>>>3,h.pts*=4,h.pts+=(o[d+13]&6)>>>1,h.dts=h.pts,p&64&&(h.dts=(o[d+14]&14)<<27|(o[d+15]&255)<<20|(o[d+16]&254)<<12|(o[d+17]&255)<<5|(o[d+18]&254)>>>3,h.dts*=4,h.dts+=(o[d+18]&6)>>>1)),h},ca=function(o){switch(o){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},tg=function(o){for(var l=4+Gs(o),d=o.subarray(l),h=0,p=0,g=!1,E;p<d.byteLength-3;p++)if(d[p+2]===1){h=p+5;break}for(;h<d.byteLength;)switch(d[h]){case 0:if(d[h-1]!==0){h+=2;break}else if(d[h-2]!==0){h++;break}p+3!==h-2&&(E=ca(d[p+3]&31),E==="slice_layer_without_partitioning_rbsp_idr"&&(g=!0));do h++;while(d[h]!==1&&h<d.length);p=h-2,h+=3;break;case 1:if(d[h-1]!==0||d[h-2]!==0){h+=3;break}E=ca(d[p+3]&31),E==="slice_layer_without_partitioning_rbsp_idr"&&(g=!0),p=h-2,h+=3;break;default:h+=3;break}return d=d.subarray(p),h-=p,p=0,d&&d.byteLength>3&&(E=ca(d[p+3]&31),E==="slice_layer_without_partitioning_rbsp_idr"&&(g=!0)),g},ig={parseType:Ym,parsePat:Qm,parsePmt:Jm,parsePayloadUnitStartIndicator:Ws,parsePesType:Zm,parsePesTime:eg,videoPacketContainsKeyFrame:tg},Wu=xs,Qi=uu.handleRollover,ke={};ke.ts=ig,ke.aac=ia;var Pi=Se.ONE_SECOND_IN_TS,at=188,jt=71,rg=function(o,l){for(var d=0,h=at,p,g;h<o.byteLength;){if(o[d]===jt&&o[h]===jt){switch(p=o.subarray(d,h),g=ke.ts.parseType(p,l.pid),g){case"pat":l.pid=ke.ts.parsePat(p);break;case"pmt":var E=ke.ts.parsePmt(p);l.table=l.table||{},Object.keys(E).forEach(function(w){l.table[w]=E[w]});break}d+=at,h+=at;continue}d++,h++}},Gu=function(o,l,d){for(var h=0,p=at,g,E,w,k,x,B=!1;p<=o.byteLength;){if(o[h]===jt&&(o[p]===jt||p===o.byteLength)){switch(g=o.subarray(h,p),E=ke.ts.parseType(g,l.pid),E){case"pes":w=ke.ts.parsePesType(g,l.table),k=ke.ts.parsePayloadUnitStartIndicator(g),w==="audio"&&k&&(x=ke.ts.parsePesTime(g),x&&(x.type="audio",d.audio.push(x),B=!0));break}if(B)break;h+=at,p+=at;continue}h++,p++}for(p=o.byteLength,h=p-at,B=!1;h>=0;){if(o[h]===jt&&(o[p]===jt||p===o.byteLength)){switch(g=o.subarray(h,p),E=ke.ts.parseType(g,l.pid),E){case"pes":w=ke.ts.parsePesType(g,l.table),k=ke.ts.parsePayloadUnitStartIndicator(g),w==="audio"&&k&&(x=ke.ts.parsePesTime(g),x&&(x.type="audio",d.audio.push(x),B=!0));break}if(B)break;h-=at,p-=at;continue}h--,p--}},sg=function(o,l,d){for(var h=0,p=at,g,E,w,k,x,B,G,ae,Y=!1,ue={data:[],size:0};p<o.byteLength;){if(o[h]===jt&&o[p]===jt){switch(g=o.subarray(h,p),E=ke.ts.parseType(g,l.pid),E){case"pes":if(w=ke.ts.parsePesType(g,l.table),k=ke.ts.parsePayloadUnitStartIndicator(g),w==="video"&&(k&&!Y&&(x=ke.ts.parsePesTime(g),x&&(x.type="video",d.video.push(x),Y=!0)),!d.firstKeyFrame)){if(k&&ue.size!==0){for(B=new Uint8Array(ue.size),G=0;ue.data.length;)ae=ue.data.shift(),B.set(ae,G),G+=ae.byteLength;if(ke.ts.videoPacketContainsKeyFrame(B)){var ye=ke.ts.parsePesTime(B);ye?(d.firstKeyFrame=ye,d.firstKeyFrame.type="video"):console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.")}ue.size=0}ue.data.push(g),ue.size+=g.byteLength}break}if(Y&&d.firstKeyFrame)break;h+=at,p+=at;continue}h++,p++}for(p=o.byteLength,h=p-at,Y=!1;h>=0;){if(o[h]===jt&&o[p]===jt){switch(g=o.subarray(h,p),E=ke.ts.parseType(g,l.pid),E){case"pes":w=ke.ts.parsePesType(g,l.table),k=ke.ts.parsePayloadUnitStartIndicator(g),w==="video"&&k&&(x=ke.ts.parsePesTime(g),x&&(x.type="video",d.video.push(x),Y=!0));break}if(Y)break;h-=at,p-=at;continue}h--,p--}},ng=function(o,l){if(o.audio&&o.audio.length){var d=l;(typeof d>"u"||isNaN(d))&&(d=o.audio[0].dts),o.audio.forEach(function(g){g.dts=Qi(g.dts,d),g.pts=Qi(g.pts,d),g.dtsTime=g.dts/Pi,g.ptsTime=g.pts/Pi})}if(o.video&&o.video.length){var h=l;if((typeof h>"u"||isNaN(h))&&(h=o.video[0].dts),o.video.forEach(function(g){g.dts=Qi(g.dts,h),g.pts=Qi(g.pts,h),g.dtsTime=g.dts/Pi,g.ptsTime=g.pts/Pi}),o.firstKeyFrame){var p=o.firstKeyFrame;p.dts=Qi(p.dts,h),p.pts=Qi(p.pts,h),p.dtsTime=p.dts/Pi,p.ptsTime=p.pts/Pi}}},ag=function(o){for(var l=!1,d=0,h=null,p=null,g=0,E=0,w;o.length-E>=3;){var k=ke.aac.parseType(o,E);switch(k){case"timed-metadata":if(o.length-E<10){l=!0;break}if(g=ke.aac.parseId3TagSize(o,E),g>o.length){l=!0;break}p===null&&(w=o.subarray(E,E+g),p=ke.aac.parseAacTimestamp(w)),E+=g;break;case"audio":if(o.length-E<7){l=!0;break}if(g=ke.aac.parseAdtsSize(o,E),g>o.length){l=!0;break}h===null&&(w=o.subarray(E,E+g),h=ke.aac.parseSampleRate(w)),d++,E+=g;break;default:E++;break}if(l)return null}if(h===null||p===null)return null;var x=Pi/h,B={audio:[{type:"audio",dts:p,pts:p},{type:"audio",dts:p+d*1024*x,pts:p+d*1024*x}]};return B},og=function(o){var l={pid:null,table:null},d={};rg(o,l);for(var h in l.table)if(l.table.hasOwnProperty(h)){var p=l.table[h];switch(p){case Wu.H264_STREAM_TYPE:d.video=[],sg(o,l,d),d.video.length===0&&delete d.video;break;case Wu.ADTS_STREAM_TYPE:d.audio=[],Gu(o,l,d),d.audio.length===0&&delete d.audio;break}}return d},ug=function(o,l){var d=ke.aac.isLikelyAacData(o),h;return d?h=ag(o):h=og(o),!h||!h.audio&&!h.video?null:(ng(h,l),h)},lg={inspect:ug,parseAudioPes_:Gu};const cg=function(o,l){l.on("data",function(d){const h=d.initSegment;d.initSegment={data:h.buffer,byteOffset:h.byteOffset,byteLength:h.byteLength};const p=d.data;d.data=p.buffer,o.postMessage({action:"data",segment:d,byteOffset:p.byteOffset,byteLength:p.byteLength},[d.data])}),l.on("done",function(d){o.postMessage({action:"done"})}),l.on("gopInfo",function(d){o.postMessage({action:"gopInfo",gopInfo:d})}),l.on("videoSegmentTimingInfo",function(d){const h={start:{decode:Se.videoTsToSeconds(d.start.dts),presentation:Se.videoTsToSeconds(d.start.pts)},end:{decode:Se.videoTsToSeconds(d.end.dts),presentation:Se.videoTsToSeconds(d.end.pts)},baseMediaDecodeTime:Se.videoTsToSeconds(d.baseMediaDecodeTime)};d.prependedContentDuration&&(h.prependedContentDuration=Se.videoTsToSeconds(d.prependedContentDuration)),o.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:h})}),l.on("audioSegmentTimingInfo",function(d){const h={start:{decode:Se.videoTsToSeconds(d.start.dts),presentation:Se.videoTsToSeconds(d.start.pts)},end:{decode:Se.videoTsToSeconds(d.end.dts),presentation:Se.videoTsToSeconds(d.end.pts)},baseMediaDecodeTime:Se.videoTsToSeconds(d.baseMediaDecodeTime)};d.prependedContentDuration&&(h.prependedContentDuration=Se.videoTsToSeconds(d.prependedContentDuration)),o.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:h})}),l.on("id3Frame",function(d){o.postMessage({action:"id3Frame",id3Frame:d})}),l.on("caption",function(d){o.postMessage({action:"caption",caption:d})}),l.on("trackinfo",function(d){o.postMessage({action:"trackinfo",trackInfo:d})}),l.on("audioTimingInfo",function(d){o.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:Se.videoTsToSeconds(d.start),end:Se.videoTsToSeconds(d.end)}})}),l.on("videoTimingInfo",function(d){o.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:Se.videoTsToSeconds(d.start),end:Se.videoTsToSeconds(d.end)}})}),l.on("log",function(d){o.postMessage({action:"log",log:d})})};class Xu{constructor(l,d){this.options=d||{},this.self=l,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new am.Transmuxer(this.options),cg(this.self,this.transmuxer)}pushMp4Captions(l){this.captionParser||(this.captionParser=new zm,this.captionParser.init());const d=new Uint8Array(l.data,l.byteOffset,l.byteLength),h=this.captionParser.parse(d,l.trackIds,l.timescales);this.self.postMessage({action:"mp4Captions",captions:h&&h.captions||[],logs:h&&h.logs||[],data:d.buffer},[d.buffer])}initMp4WebVttParser(l){this.webVttParser||(this.webVttParser=new Vu);const d=new Uint8Array(l.data,l.byteOffset,l.byteLength);this.webVttParser.init(d)}getMp4WebVttText(l){this.webVttParser||(this.webVttParser=new Vu);const d=new Uint8Array(l.data,l.byteOffset,l.byteLength),h=this.webVttParser.parseSegment(d);this.self.postMessage({action:"getMp4WebVttText",mp4VttCues:h||[],data:d.buffer},[d.buffer])}probeMp4StartTime({timescales:l,data:d}){const h=Vr.startTime(l,d);this.self.postMessage({action:"probeMp4StartTime",startTime:h,data:d},[d.buffer])}probeMp4Tracks({data:l}){const d=Vr.tracks(l);this.self.postMessage({action:"probeMp4Tracks",tracks:d,data:l},[l.buffer])}probeEmsgID3({data:l,offset:d}){const h=Vr.getEmsgID3(l,d);this.self.postMessage({action:"probeEmsgID3",id3Frames:h,emsgData:l},[l.buffer])}probeTs({data:l,baseStartTime:d}){const h=typeof d=="number"&&!isNaN(d)?d*Se.ONE_SECOND_IN_TS:void 0,p=lg.inspect(l,h);let g=null;p&&(g={hasVideo:p.video&&p.video.length===2||!1,hasAudio:p.audio&&p.audio.length===2||!1},g.hasVideo&&(g.videoStart=p.video[0].ptsTime),g.hasAudio&&(g.audioStart=p.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:g,data:l},[l.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(l){const d=new Uint8Array(l.data,l.byteOffset,l.byteLength);this.transmuxer.push(d)}reset(){this.transmuxer.reset()}setTimestampOffset(l){const d=l.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(Se.secondsToVideoTs(d)))}setAudioAppendStart(l){this.transmuxer.setAudioAppendStart(Math.ceil(Se.secondsToVideoTs(l.appendStart)))}setRemux(l){this.transmuxer.setRemux(l.remux)}flush(l){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(l){this.transmuxer.alignGopsWith(l.gopsToAlignWith.slice())}}self.onmessage=function(o){if(o.data.action==="init"&&o.data.options){this.messageHandlers=new Xu(self,o.data.options);return}this.messageHandlers||(this.messageHandlers=new Xu(self)),o.data&&o.data.action&&o.data.action!=="init"&&this.messageHandlers[o.data.action]&&this.messageHandlers[o.data.action](o.data)}}));var G2=Wd(W2);const X2=(r,e,t)=>{const{type:i,initSegment:s,captions:n,captionStreams:a,metadata:u,videoFrameDtsTime:c,videoFramePtsTime:m}=r.data.segment;e.buffer.push({captions:n,captionStreams:a,metadata:u});const f=r.data.segment.boxes||{data:r.data.segment.data},_={type:i,data:new Uint8Array(f.data,f.data.byteOffset,f.data.byteLength),initSegment:new Uint8Array(s.data,s.byteOffset,s.byteLength)};typeof c<"u"&&(_.videoFrameDtsTime=c),typeof m<"u"&&(_.videoFramePtsTime=m),t(_)},K2=({transmuxedData:r,callback:e})=>{r.buffer=[],e(r)},Y2=(r,e)=>{e.gopInfo=r.data.gopInfo},Kd=r=>{const{transmuxer:e,bytes:t,audioAppendStart:i,gopsToAlignWith:s,remux:n,onData:a,onTrackInfo:u,onAudioTimingInfo:c,onVideoTimingInfo:m,onVideoSegmentTimingInfo:f,onAudioSegmentTimingInfo:_,onId3:P,onCaptions:S,onDone:R,onEndedTimeline:b,onTransmuxerLog:I,isEndOfTimeline:M,segment:N,triggerSegmentEventFn:O}=r,z={buffer:[]};let q=M;const $=H=>{e.currentTransmux===r&&(H.data.action==="data"&&X2(H,z,a),H.data.action==="trackinfo"&&u(H.data.trackInfo),H.data.action==="gopInfo"&&Y2(H,z),H.data.action==="audioTimingInfo"&&c(H.data.audioTimingInfo),H.data.action==="videoTimingInfo"&&m(H.data.videoTimingInfo),H.data.action==="videoSegmentTimingInfo"&&f(H.data.videoSegmentTimingInfo),H.data.action==="audioSegmentTimingInfo"&&_(H.data.audioSegmentTimingInfo),H.data.action==="id3Frame"&&P([H.data.id3Frame],H.data.id3Frame.dispatchType),H.data.action==="caption"&&S(H.data.caption),H.data.action==="endedtimeline"&&(q=!1,b()),H.data.action==="log"&&I(H.data.log),H.data.type==="transmuxed"&&(q||(e.onmessage=null,K2({transmuxedData:z,callback:R}),Yd(e))))},L=()=>{const H={message:"Received an error message from the transmuxer worker",metadata:{errorType:j.Error.StreamingFailedToTransmuxSegment,segmentInfo:Bi({segment:N})}};R(null,H)};if(e.onmessage=$,e.onerror=L,i&&e.postMessage({action:"setAudioAppendStart",appendStart:i}),Array.isArray(s)&&e.postMessage({action:"alignGopsWith",gopsToAlignWith:s}),typeof n<"u"&&e.postMessage({action:"setRemux",remux:n}),t.byteLength){const H=t instanceof ArrayBuffer?t:t.buffer,v=t instanceof ArrayBuffer?0:t.byteOffset;O({type:"segmenttransmuxingstart",segment:N}),e.postMessage({action:"push",data:H,byteOffset:v,byteLength:t.byteLength},[H])}M&&e.postMessage({action:"endTimeline"}),e.postMessage({action:"flush"})},Yd=r=>{r.currentTransmux=null,r.transmuxQueue.length&&(r.currentTransmux=r.transmuxQueue.shift(),typeof r.currentTransmux=="function"?r.currentTransmux():Kd(r.currentTransmux))},gc=(r,e)=>{r.postMessage({action:e}),Yd(r)},Qd=(r,e)=>{if(!e.currentTransmux){e.currentTransmux=r,gc(e,r);return}e.transmuxQueue.push(gc.bind(null,e,r))},Q2=r=>{Qd("reset",r)},J2=r=>{Qd("endTimeline",r)},Jd=r=>{if(!r.transmuxer.currentTransmux){r.transmuxer.currentTransmux=r,Kd(r);return}r.transmuxer.transmuxQueue.push(r)},Z2=r=>{const e=new G2;e.currentTransmux=null,e.transmuxQueue=[];const t=e.terminate;return e.terminate=()=>(e.currentTransmux=null,e.transmuxQueue.length=0,t.call(e)),e.postMessage({action:"init",options:r}),e};var qa={reset:Q2,endTimeline:J2,transmux:Jd,createTransmuxer:Z2};const lr=function(r){const e=r.transmuxer,t=r.endAction||r.action,i=r.callback,s=qe({},r,{endAction:null,transmuxer:null,callback:null}),n=a=>{a.data.action===t&&(e.removeEventListener("message",n),a.data.data&&(a.data.data=new Uint8Array(a.data.data,r.byteOffset||0,r.byteLength||a.data.data.byteLength),r.data&&(r.data=a.data.data)),i(a.data))};if(e.addEventListener("message",n),r.data){const a=r.data instanceof ArrayBuffer;s.byteOffset=a?0:r.data.byteOffset,s.byteLength=r.data.byteLength;const u=[a?r.data:r.data.buffer];e.postMessage(s,u)}else e.postMessage(s)},Xt={FAILURE:2,TIMEOUT:-101,ABORTED:-102},Zd="wvtt",fo=r=>{r.forEach(e=>{e.abort()})},e0=r=>({bandwidth:r.bandwidth,bytesReceived:r.bytesReceived||0,roundTripTime:r.roundTripTime||0}),t0=r=>{const e=r.target,t={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-e.requestTime||0};return t.bytesReceived=r.loaded,t.bandwidth=Math.floor(t.bytesReceived/t.roundTripTime*8*1e3),t},su=(r,e)=>{const{requestType:t}=e,i=Vi({requestType:t,request:e,error:r});return e.timedout?{status:e.status,message:"HLS request timed-out at URL: "+e.uri,code:Xt.TIMEOUT,xhr:e,metadata:i}:e.aborted?{status:e.status,message:"HLS request aborted at URL: "+e.uri,code:Xt.ABORTED,xhr:e,metadata:i}:r?{status:e.status,message:"HLS request errored at URL: "+e.uri,code:Xt.FAILURE,xhr:e,metadata:i}:e.responseType==="arraybuffer"&&e.response.byteLength===0?{status:e.status,message:"Empty HLS response at URL: "+e.uri,code:Xt.FAILURE,xhr:e,metadata:i}:null},fc=(r,e,t,i)=>(s,n)=>{const a=n.response,u=su(s,n);if(u)return t(u,r);if(a.byteLength!==16)return t({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:Xt.FAILURE,xhr:n},r);const c=new DataView(a),m=new Uint32Array([c.getUint32(0),c.getUint32(4),c.getUint32(8),c.getUint32(12)]);for(let _=0;_<e.length;_++)e[_].bytes=m;const f={uri:n.uri};return i({type:"segmentkeyloadcomplete",segment:r,keyInfo:f}),t(null,r)},i0=(r,e)=>{e===Zd&&r.transmuxer.postMessage({action:"initMp4WebVttParser",data:r.map.bytes})},r0=(r,e,t)=>{e===Zd&&lr({action:"getMp4WebVttText",data:r.bytes,transmuxer:r.transmuxer,callback:({data:i,mp4VttCues:s})=>{r.bytes=i,t(null,r,{mp4VttCues:s})}})},ep=(r,e)=>{const t=Ao(r.map.bytes);if(t!=="mp4"){const i=r.map.resolvedUri||r.map.uri,s=t||"unknown";return e({internal:!0,message:`Found unsupported ${s} container for initialization segment at URL: ${i}`,code:Xt.FAILURE,metadata:{mediaType:s}})}lr({action:"probeMp4Tracks",data:r.map.bytes,transmuxer:r.transmuxer,callback:({tracks:i,data:s})=>(r.map.bytes=s,i.forEach(function(n){r.map.tracks=r.map.tracks||{},!r.map.tracks[n.type]&&(r.map.tracks[n.type]=n,typeof n.id=="number"&&n.timescale&&(r.map.timescales=r.map.timescales||{},r.map.timescales[n.id]=n.timescale),n.type==="text"&&i0(r,n.codec))}),e(null))})},s0=({segment:r,finishProcessingFn:e,triggerSegmentEventFn:t})=>(i,s)=>{const n=su(i,s);if(n)return e(n,r);const a=new Uint8Array(s.response);if(t({type:"segmentloaded",segment:r}),r.map.key)return r.map.encryptedBytes=a,e(null,r);r.map.bytes=a,ep(r,function(u){if(u)return u.xhr=s,u.status=s.status,e(u,r);e(null,r)})},n0=({segment:r,finishProcessingFn:e,responseType:t,triggerSegmentEventFn:i})=>(s,n)=>{const a=su(s,n);if(a)return e(a,r);i({type:"segmentloaded",segment:r});const u=t==="arraybuffer"||!n.responseText?n.response:V2(n.responseText.substring(r.lastReachedChar||0));return r.stats=e0(n),r.key?r.encryptedBytes=new Uint8Array(u):r.bytes=new Uint8Array(u),e(null,r)},a0=({segment:r,bytes:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:m,dataFn:f,doneFn:_,onTransmuxerLog:P,triggerSegmentEventFn:S})=>{const R=r.map&&r.map.tracks||{},b=!!(R.audio&&R.video);let I=i.bind(null,r,"audio","start");const M=i.bind(null,r,"audio","end");let N=i.bind(null,r,"video","start");const O=i.bind(null,r,"video","end"),z=()=>Jd({bytes:e,transmuxer:r.transmuxer,audioAppendStart:r.audioAppendStart,gopsToAlignWith:r.gopsToAlignWith,remux:b,onData:q=>{q.type=q.type==="combined"?"video":q.type,f(r,q)},onTrackInfo:q=>{t&&(b&&(q.isMuxed=!0),t(r,q))},onAudioTimingInfo:q=>{I&&typeof q.start<"u"&&(I(q.start),I=null),M&&typeof q.end<"u"&&M(q.end)},onVideoTimingInfo:q=>{N&&typeof q.start<"u"&&(N(q.start),N=null),O&&typeof q.end<"u"&&O(q.end)},onVideoSegmentTimingInfo:q=>{const $={pts:{start:q.start.presentation,end:q.end.presentation},dts:{start:q.start.decode,end:q.end.decode}};S({type:"segmenttransmuxingtiminginfoavailable",segment:r,timingInfo:$}),s(q)},onAudioSegmentTimingInfo:q=>{const $={pts:{start:q.start.pts,end:q.end.pts},dts:{start:q.start.dts,end:q.end.dts}};S({type:"segmenttransmuxingtiminginfoavailable",segment:r,timingInfo:$}),n(q)},onId3:(q,$)=>{a(r,q,$)},onCaptions:q=>{u(r,[q])},isEndOfTimeline:c,onEndedTimeline:()=>{m()},onTransmuxerLog:P,onDone:(q,$)=>{_&&(q.type=q.type==="combined"?"video":q.type,S({type:"segmenttransmuxingcomplete",segment:r}),_($,r,q))},segment:r,triggerSegmentEventFn:S});lr({action:"probeTs",transmuxer:r.transmuxer,data:e,baseStartTime:r.baseStartTime,callback:q=>{r.bytes=e=q.data;const $=q.result;$&&(t(r,{hasAudio:$.hasAudio,hasVideo:$.hasVideo,isMuxed:b}),t=null),z()}})},tp=({segment:r,bytes:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:m,dataFn:f,doneFn:_,onTransmuxerLog:P,triggerSegmentEventFn:S})=>{let R=new Uint8Array(e);if(Ay(R)){r.isFmp4=!0;const{tracks:b}=r.map;if(b.text&&(!b.audio||!b.video)){f(r,{data:R,type:"text"}),r0(r,b.text.codec,_);return}const I={isFmp4:!0,hasVideo:!!b.video,hasAudio:!!b.audio};b.audio&&b.audio.codec&&b.audio.codec!=="enca"&&(I.audioCodec=b.audio.codec),b.video&&b.video.codec&&b.video.codec!=="encv"&&(I.videoCodec=b.video.codec),b.video&&b.audio&&(I.isMuxed=!0),t(r,I);const M=(N,O)=>{f(r,{data:R,type:I.hasAudio&&!I.isMuxed?"audio":"video"}),O&&O.length&&a(r,O),N&&N.length&&u(r,N),_(null,r,{})};lr({action:"probeMp4StartTime",timescales:r.map.timescales,data:R,transmuxer:r.transmuxer,callback:({data:N,startTime:O})=>{e=N.buffer,r.bytes=R=N,I.hasAudio&&!I.isMuxed&&i(r,"audio","start",O),I.hasVideo&&i(r,"video","start",O),lr({action:"probeEmsgID3",data:R,transmuxer:r.transmuxer,offset:O,callback:({emsgData:z,id3Frames:q})=>{if(e=z.buffer,r.bytes=R=z,!b.video||!z.byteLength||!r.transmuxer){M(void 0,q);return}lr({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:r.transmuxer,data:R,timescales:r.map.timescales,trackIds:[b.video.id],callback:$=>{e=$.data.buffer,r.bytes=R=$.data,$.logs.forEach(function(L){P(Ce(L,{stream:"mp4CaptionParser"}))}),M($.captions,q)}})}})}});return}if(!r.transmuxer){_(null,r,{});return}if(typeof r.container>"u"&&(r.container=Ao(R)),r.container!=="ts"&&r.container!=="aac"){t(r,{hasAudio:!1,hasVideo:!1}),_(null,r,{});return}a0({segment:r,bytes:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:m,dataFn:f,doneFn:_,onTransmuxerLog:P,triggerSegmentEventFn:S})},ip=function({id:r,key:e,encryptedBytes:t,decryptionWorker:i,segment:s,doneFn:n},a){const u=m=>{if(m.data.source===r){i.removeEventListener("message",u);const f=m.data.decrypted;a(new Uint8Array(f.bytes,f.byteOffset,f.byteLength))}};i.onerror=()=>{const m="An error occurred in the decryption worker",f=Bi({segment:s}),_={message:m,metadata:{error:new Error(m),errorType:j.Error.StreamingFailedToDecryptSegment,segmentInfo:f,keyInfo:{uri:s.key.resolvedUri||s.map.key.resolvedUri}}};n(_,s)},i.addEventListener("message",u);let c;e.bytes.slice?c=e.bytes.slice():c=new Uint32Array(Array.prototype.slice.call(e.bytes)),i.postMessage(jd({source:r,encrypted:t,key:c,iv:e.iv}),[t.buffer,c.buffer])},o0=({decryptionWorker:r,segment:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:m,dataFn:f,doneFn:_,onTransmuxerLog:P,triggerSegmentEventFn:S})=>{S({type:"segmentdecryptionstart"}),ip({id:e.requestId,key:e.key,encryptedBytes:e.encryptedBytes,decryptionWorker:r,segment:e,doneFn:_},R=>{e.bytes=R,S({type:"segmentdecryptioncomplete",segment:e}),tp({segment:e,bytes:e.bytes,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:m,dataFn:f,doneFn:_,onTransmuxerLog:P,triggerSegmentEventFn:S})})},u0=({activeXhrs:r,decryptionWorker:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:m,dataFn:f,doneFn:_,onTransmuxerLog:P,triggerSegmentEventFn:S})=>{let R=0,b=!1;return(I,M)=>{if(!b){if(I)return b=!0,fo(r),_(I,M);if(R+=1,R===r.length){const N=function(){if(M.encryptedBytes)return o0({decryptionWorker:e,segment:M,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:m,dataFn:f,doneFn:_,onTransmuxerLog:P,triggerSegmentEventFn:S});tp({segment:M,bytes:M.bytes,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:m,dataFn:f,doneFn:_,onTransmuxerLog:P,triggerSegmentEventFn:S})};if(M.endOfAllRequests=Date.now(),M.map&&M.map.encryptedBytes&&!M.map.bytes)return S({type:"segmentdecryptionstart",segment:M}),ip({decryptionWorker:e,id:M.requestId+"-init",encryptedBytes:M.map.encryptedBytes,key:M.map.key,segment:M,doneFn:_},O=>{M.map.bytes=O,S({type:"segmentdecryptioncomplete",segment:M}),ep(M,z=>{if(z)return fo(r),_(z,M);N()})});N()}}}},l0=({loadendState:r,abortFn:e})=>t=>{t.target.aborted&&e&&!r.calledAbortFn&&(e(),r.calledAbortFn=!0)},c0=({segment:r,progressFn:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:m,dataFn:f})=>_=>{if(!_.target.aborted)return r.stats=Ce(r.stats,t0(_)),!r.stats.firstBytesReceivedAt&&r.stats.bytesReceived&&(r.stats.firstBytesReceivedAt=Date.now()),e(_,r)},h0=({xhr:r,xhrOptions:e,decryptionWorker:t,segment:i,abortFn:s,progressFn:n,trackInfoFn:a,timingInfoFn:u,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:m,id3Fn:f,captionsFn:_,isEndOfTimeline:P,endedTimelineFn:S,dataFn:R,doneFn:b,onTransmuxerLog:I,triggerSegmentEventFn:M})=>{const N=[],O=u0({activeXhrs:N,decryptionWorker:t,trackInfoFn:a,timingInfoFn:u,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:m,id3Fn:f,captionsFn:_,isEndOfTimeline:P,endedTimelineFn:S,dataFn:R,doneFn:b,onTransmuxerLog:I,triggerSegmentEventFn:M});if(i.key&&!i.key.bytes){const H=[i.key];i.map&&!i.map.bytes&&i.map.key&&i.map.key.resolvedUri===i.key.resolvedUri&&H.push(i.map.key);const v=Ce(e,{uri:i.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),C=fc(i,H,O,M),V={uri:i.key.resolvedUri};M({type:"segmentkeyloadstart",segment:i,keyInfo:V});const U=r(v,C);N.push(U)}if(i.map&&!i.map.bytes){if(i.map.key&&(!i.key||i.key.resolvedUri!==i.map.key.resolvedUri)){const V=Ce(e,{uri:i.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),U=fc(i,[i.map.key],O,M),F={uri:i.map.key.resolvedUri};M({type:"segmentkeyloadstart",segment:i,keyInfo:F});const K=r(V,U);N.push(K)}const H=Ce(e,{uri:i.map.resolvedUri,responseType:"arraybuffer",headers:mo(i.map),requestType:"segment-media-initialization"}),v=s0({segment:i,finishProcessingFn:O,triggerSegmentEventFn:M});M({type:"segmentloadstart",segment:i});const C=r(H,v);N.push(C)}const z=Ce(e,{uri:i.part&&i.part.resolvedUri||i.resolvedUri,responseType:"arraybuffer",headers:mo(i),requestType:"segment"}),q=n0({segment:i,finishProcessingFn:O,responseType:z.responseType,triggerSegmentEventFn:M});M({type:"segmentloadstart",segment:i});const $=r(z,q);$.addEventListener("progress",c0({segment:i,progressFn:n,trackInfoFn:a,timingInfoFn:u,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:m,id3Fn:f,captionsFn:_,isEndOfTimeline:P,endedTimelineFn:S,dataFn:R})),N.push($);const L={};return N.forEach(H=>{H.addEventListener("loadend",l0({loadendState:L,abortFn:s}))}),()=>fo(N)},tn=Pt("PlaylistSelector"),yc=function(r){if(!r||!r.playlist)return;const e=r.playlist;return JSON.stringify({id:e.id,bandwidth:r.bandwidth,width:r.width,height:r.height,codecs:e.attributes&&e.attributes.CODECS||""})},cr=function(r,e){if(!r)return"";const t=A.getComputedStyle(r);return t?t[e]:""},hr=function(r,e){const t=r.slice();r.sort(function(i,s){const n=e(i,s);return n===0?t.indexOf(i)-t.indexOf(s):n})},nu=function(r,e){let t,i;return r.attributes.BANDWIDTH&&(t=r.attributes.BANDWIDTH),t=t||A.Number.MAX_VALUE,e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||A.Number.MAX_VALUE,t-i},d0=function(r,e){let t,i;return r.attributes.RESOLUTION&&r.attributes.RESOLUTION.width&&(t=r.attributes.RESOLUTION.width),t=t||A.Number.MAX_VALUE,e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||A.Number.MAX_VALUE,t===i&&r.attributes.BANDWIDTH&&e.attributes.BANDWIDTH?r.attributes.BANDWIDTH-e.attributes.BANDWIDTH:t-i};let rp=function(r){const{main:e,bandwidth:t,playerWidth:i,playerHeight:s,playerObjectFit:n,limitRenditionByPlayerDimensions:a,playlistController:u}=r;if(!e)return;const c={bandwidth:t,width:i,height:s,limitRenditionByPlayerDimensions:a};let m=e.playlists;mt.isAudioOnly(e)&&(m=u.getAudioTrackPlaylists_(),c.audioOnly=!0);let f=m.map(L=>{let H;const v=L.attributes&&L.attributes.RESOLUTION&&L.attributes.RESOLUTION.width,C=L.attributes&&L.attributes.RESOLUTION&&L.attributes.RESOLUTION.height;return H=L.attributes&&L.attributes.BANDWIDTH,H=H||A.Number.MAX_VALUE,{bandwidth:H,width:v,height:C,playlist:L}});hr(f,(L,H)=>L.bandwidth-H.bandwidth),f=f.filter(L=>!mt.isIncompatible(L.playlist));let _=f.filter(L=>mt.isEnabled(L.playlist));_.length||(_=f.filter(L=>!mt.isDisabled(L.playlist)));const P=_.filter(L=>L.bandwidth*Ge.BANDWIDTH_VARIANCE<t);let S=P[P.length-1];const R=P.filter(L=>L.bandwidth===S.bandwidth)[0];if(a===!1){const L=R||_[0]||f[0];if(L&&L.playlist){let H="sortedPlaylistReps";return R&&(H="bandwidthBestRep"),_[0]&&(H="enabledPlaylistReps"),tn(`choosing ${yc(L)} using ${H} with options`,c),L.playlist}return tn("could not choose a playlist with options",c),null}const b=P.filter(L=>L.width&&L.height);hr(b,(L,H)=>L.width-H.width);const I=b.filter(L=>L.width===i&&L.height===s);S=I[I.length-1];const M=I.filter(L=>L.bandwidth===S.bandwidth)[0];let N,O,z;M||(N=b.filter(L=>n==="cover"?L.width>i&&L.height>s:L.width>i||L.height>s),O=N.filter(L=>L.width===N[0].width&&L.height===N[0].height),S=O[O.length-1],z=O.filter(L=>L.bandwidth===S.bandwidth)[0]);let q;if(u.leastPixelDiffSelector){const L=b.map(H=>(H.pixelDiff=Math.abs(H.width-i)+Math.abs(H.height-s),H));hr(L,(H,v)=>H.pixelDiff===v.pixelDiff?v.bandwidth-H.bandwidth:H.pixelDiff-v.pixelDiff),q=L[0]}const $=q||z||M||R||_[0]||f[0];if($&&$.playlist){let L="sortedPlaylistReps";return q?L="leastPixelDiffRep":z?L="resolutionPlusOneRep":M?L="resolutionBestRep":R?L="bandwidthBestRep":_[0]&&(L="enabledPlaylistReps"),tn(`choosing ${yc($)} using ${L} with options`,c),$.playlist}return tn("could not choose a playlist with options",c),null};const _c=function(){let r=this.useDevicePixelRatio&&A.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(r=this.customPixelRatio),rp({main:this.playlists.main,bandwidth:this.systemBandwidth,playerWidth:parseInt(cr(this.tech_.el(),"width"),10)*r,playerHeight:parseInt(cr(this.tech_.el(),"height"),10)*r,playerObjectFit:this.usePlayerObjectFit?cr(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})},p0=function(r){let e=-1,t=-1;if(r<0||r>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){let i=this.useDevicePixelRatio&&A.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(i=this.customPixelRatio),e<0&&(e=this.systemBandwidth,t=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==t&&(e=r*this.systemBandwidth+(1-r)*e,t=this.systemBandwidth),rp({main:this.playlists.main,bandwidth:e,playerWidth:parseInt(cr(this.tech_.el(),"width"),10)*i,playerHeight:parseInt(cr(this.tech_.el(),"height"),10)*i,playerObjectFit:this.usePlayerObjectFit?cr(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})}},m0=function(r){const{main:e,currentTime:t,bandwidth:i,duration:s,segmentDuration:n,timeUntilRebuffer:a,currentTimeline:u,syncController:c}=r,m=e.playlists.filter(S=>!mt.isIncompatible(S));let f=m.filter(mt.isEnabled);f.length||(f=m.filter(S=>!mt.isDisabled(S)));const _=f.filter(mt.hasAttribute.bind(null,"BANDWIDTH")).map(S=>{const R=c.getSyncPoint(S,s,u,t)?1:2,b=mt.estimateSegmentRequestTime(n,i,S)*R-a;return{playlist:S,rebufferingImpact:b}}),P=_.filter(S=>S.rebufferingImpact<=0);return hr(P,(S,R)=>nu(R.playlist,S.playlist)),P.length?P[0]:(hr(_,(S,R)=>S.rebufferingImpact-R.rebufferingImpact),_[0]||null)},g0=function(){const r=this.playlists.main.playlists.filter(mt.isEnabled);return hr(r,(e,t)=>nu(e,t)),r.filter(e=>!!os(this.playlists.main,e).video)[0]||null},f0=r=>{let e=0,t;return r.bytes&&(t=new Uint8Array(r.bytes),r.segments.forEach(i=>{t.set(i,e),e+=i.byteLength})),t};function sp(r){try{return new URL(r).pathname.split("/").slice(-2).join("/")}catch{return""}}const y0=function(r,e,t){if(!r[t]){e.trigger({type:"usage",name:"vhs-608"});let i=t;/^cc708_/.test(t)&&(i="SERVICE"+t.split("_")[1]);const s=e.textTracks().getTrackById(i);if(s)r[t]=s;else{const n=e.options_.vhs&&e.options_.vhs.captionServices||{};let a=t,u=t,c=!1;const m=n[i];m&&(a=m.label,u=m.language,c=m.default),r[t]=e.addRemoteTextTrack({kind:"captions",id:i,default:c,label:a,language:u},!1).track}}},_0=function({inbandTextTracks:r,captionArray:e,timestampOffset:t}){if(!e)return;const i=A.WebKitDataCue||A.VTTCue;e.forEach(s=>{const n=s.stream;s.content?s.content.forEach(a=>{const u=new i(s.startTime+t,s.endTime+t,a.text);u.line=a.line,u.align="left",u.position=a.position,u.positionAlign="line-left",r[n].addCue(u)}):r[n].addCue(new i(s.startTime+t,s.endTime+t,s.text))})},b0=function(r){Object.defineProperties(r.frame,{id:{get(){return j.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),r.value.key}},value:{get(){return j.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),r.value.data}},privateData:{get(){return j.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),r.value.data}}})},v0=({inbandTextTracks:r,metadataArray:e,timestampOffset:t,videoDuration:i})=>{if(!e)return;const s=A.WebKitDataCue||A.VTTCue,n=r.metadataTrack_;if(!n||(e.forEach(f=>{const _=f.cueTime+t;typeof _!="number"||A.isNaN(_)||_<0||!(_<1/0)||!f.frames||!f.frames.length||f.frames.forEach(P=>{const S=new s(_,_,P.value||P.url||P.data||"");S.frame=P,S.value=P,b0(S),n.addCue(S)})}),!n.cues||!n.cues.length))return;const a=n.cues,u=[];for(let f=0;f<a.length;f++)a[f]&&u.push(a[f]);const c=u.reduce((f,_)=>{const P=f[_.startTime]||[];return P.push(_),f[_.startTime]=P,f},{}),m=Object.keys(c).sort((f,_)=>Number(f)-Number(_));m.forEach((f,_)=>{const P=c[f],S=isFinite(i)?i:f,R=Number(m[_+1])||S;P.forEach(b=>{b.endTime=R})})},T0={id:"ID",class:"CLASS",startDate:"START-DATE",duration:"DURATION",endDate:"END-DATE",endOnNext:"END-ON-NEXT",plannedDuration:"PLANNED-DURATION",scte35Out:"SCTE35-OUT",scte35In:"SCTE35-IN"},S0=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),E0=({inbandTextTracks:r,dateRanges:e})=>{const t=r.metadataTrack_;if(!t)return;const i=A.WebKitDataCue||A.VTTCue;e.forEach(s=>{for(const n of Object.keys(s)){if(S0.has(n))continue;const a=new i(s.startTime,s.endTime,"");a.id=s.id,a.type="com.apple.quicktime.HLS",a.value={key:T0[n],data:s[n]},(n==="scte35Out"||n==="scte35In")&&(a.value.data=new Uint8Array(a.value.data.match(/[\da-f]{2}/gi)).buffer),t.addCue(a)}s.processDateRange()})},bc=(r,e,t)=>{r.metadataTrack_||(r.metadataTrack_=t.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,j.browser.IS_ANY_SAFARI||(r.metadataTrack_.inBandMetadataTrackDispatchType=e))},ts=function(r,e,t){let i,s;if(t&&t.cues)for(i=t.cues.length;i--;)s=t.cues[i],s.startTime>=r&&s.endTime<=e&&t.removeCue(s)},C0=function(r){const e=r.cues;if(!e)return;const t={};for(let i=e.length-1;i>=0;i--){const s=e[i],n=`${s.startTime}-${s.endTime}-${s.text}`;t[n]?r.removeCue(s):t[n]=s}},w0=(r,e,t)=>{if(typeof e>"u"||e===null||!r.length)return[];const i=Math.ceil((e-t+3)*Ui.ONE_SECOND_IN_TS);let s;for(s=0;s<r.length&&!(r[s].pts>i);s++);return r.slice(s)},k0=(r,e,t)=>{if(!e.length)return r;if(t)return e.slice();const i=e[0].pts;let s=0;for(s;s<r.length&&!(r[s].pts>=i);s++);return r.slice(0,s).concat(e)},A0=(r,e,t,i)=>{const s=Math.ceil((e-i)*Ui.ONE_SECOND_IN_TS),n=Math.ceil((t-i)*Ui.ONE_SECOND_IN_TS),a=r.slice();let u=r.length;for(;u--&&!(r[u].pts<=n););if(u===-1)return a;let c=u+1;for(;c--&&!(r[c].pts<=s););return c=Math.max(c,0),a.splice(c,u-c+1),a},x0=function(r,e){if(!r&&!e||!r&&e||r&&!e)return!1;if(r===e)return!0;const t=Object.keys(r).sort(),i=Object.keys(e).sort();if(t.length!==i.length)return!1;for(let s=0;s<t.length;s++){const n=t[s];if(n!==i[s]||r[n]!==e[n])return!1}return!0},D0=function(r,e,t){e=e||[];const i=[];let s=0;for(let n=0;n<e.length;n++){const a=e[n];if(r===a.timeline&&(i.push(n),s+=a.duration,s>t))return n}return i.length===0?0:i[i.length-1]},Jr=1,I0=500,vc=r=>typeof r=="number"&&isFinite(r),rn=1/60,P0=(r,e,t)=>r!=="main"||!e||!t?null:!t.hasAudio&&!t.hasVideo?"Neither audio nor video found in segment.":e.hasVideo&&!t.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!e.hasVideo&&t.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null,L0=(r,e,t)=>{let i=e-Ge.BACK_BUFFER_LENGTH;r.length&&(i=Math.max(i,r.start(0)));const s=e-t;return Math.min(s,i)},er=r=>{const{startOfSegment:e,duration:t,segment:i,part:s,playlist:{mediaSequence:n,id:a,segments:u=[]},mediaIndex:c,partIndex:m,timeline:f}=r,_=u.length-1;let P="mediaIndex/partIndex increment";r.getMediaInfoForTime?P=`getMediaInfoForTime (${r.getMediaInfoForTime})`:r.isSyncRequest&&(P="getSyncSegmentCandidate (isSyncRequest)"),r.independent&&(P+=` with independent ${r.independent}`);const S=typeof m=="number",R=r.segment.uri?"segment":"pre-segment",b=S?Sd({preloadSegment:i})-1:0;return`${R} [${n+c}/${n+_}]`+(S?` part [${m}/${b}]`:"")+` segment start/end [${i.start} => ${i.end}]`+(S?` part start/end [${s.start} => ${s.end}]`:"")+` startOfSegment [${e}] duration [${t}] timeline [${f}] selected by [${P}] playlist [${a}]`},Tc=r=>`${r}TimingInfo`,O0=({segmentTimeline:r,currentTimeline:e,startOfSegment:t,buffered:i,overrideCheck:s})=>!s&&r===e?null:r<e?t:i.length?i.end(i.length-1):t,yo=({timelineChangeController:r,currentTimeline:e,segmentTimeline:t,loaderType:i,audioDisabled:s})=>{if(e===t)return!1;if(i==="audio"){const n=r.lastTimelineChange({type:"main"});return!n||n.to!==t}if(i==="main"&&s){const n=r.pendingTimelineChange({type:"audio"});return!(n&&n.to===t)}return!1},N0=r=>{if(!r)return!1;const e=r.pendingTimelineChange({type:"audio"}),t=r.pendingTimelineChange({type:"main"}),i=e&&t,s=i&&e.to!==t.to;return!!(i&&e.from!==-1&&t.from!==-1&&s)},R0=r=>{const e=r.timelineChangeController_.pendingTimelineChange({type:"audio"}),t=r.timelineChangeController_.pendingTimelineChange({type:"main"});return e&&t&&e.to<t.to},yi=r=>{const e=r.pendingSegment_;if(e&&yo({timelineChangeController:r.timelineChangeController_,currentTimeline:r.currentTimeline_,segmentTimeline:e.timeline,loaderType:r.loaderType_,audioDisabled:r.audioDisabled_})&&N0(r.timelineChangeController_)){if(R0(r)){r.timelineChangeController_.trigger("audioTimelineBehind");return}r.timelineChangeController_.trigger("fixBadTimelineChange")}},M0=r=>{let e=0;return["video","audio"].forEach(function(t){const i=r[`${t}TimingInfo`];if(!i)return;const{start:s,end:n}=i;let a;typeof s=="bigint"||typeof n=="bigint"?a=A.BigInt(n)-A.BigInt(s):typeof s=="number"&&typeof n=="number"&&(a=n-s),typeof a<"u"&&a>e&&(e=a)}),typeof e=="bigint"&&e<Number.MAX_SAFE_INTEGER&&(e=Number(e)),e},Sc=({segmentDuration:r,maxDuration:e})=>r?Math.round(r)>e+Wt:!1,B0=(r,e)=>{if(e!=="hls")return null;const t=M0({audioTimingInfo:r.audioTimingInfo,videoTimingInfo:r.videoTimingInfo});if(!t)return null;const i=r.playlist.targetDuration,s=Sc({segmentDuration:t,maxDuration:i*2}),n=Sc({segmentDuration:t,maxDuration:i}),a=`Segment with index ${r.mediaIndex} from playlist ${r.playlist.id} has a duration of ${t} when the reported duration is ${r.duration} and the target duration is ${i}. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1`;return s||n?{severity:s?"warn":"info",message:a}:null},Bi=({type:r,segment:e})=>{if(!e)return;const t=!!(e.key||e.map&&e.map.ke),i=!!(e.map&&!e.map.bytes),s=e.startOfSegment===void 0?e.start:e.startOfSegment;return{type:r||e.type,uri:e.resolvedUri||e.uri,start:s,duration:e.duration,isEncrypted:t,isMediaInitialization:i}};class _o extends j.EventTarget{constructor(e,t={}){if(super(),!e)throw new TypeError("Initialization settings are required");if(typeof e.currentTime!="function")throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.shouldForceTimestampOffsetAfterResync_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",()=>{this.isEndOfStream_()||(this.ended_=!1)}),this.fetchAtBuffer_=!1,this.logger_=Pt(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(i){i!==this.state_&&(this.logger_(`${this.state_} -> ${i}`),this.state_=i,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():yi(this)}),this.sourceUpdater_.on("codecschange",i=>{this.trigger(qe({type:"codecschange"},i))}),this.loaderType_==="main"&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():yi(this)}),this.loaderType_==="audio"&&this.timelineChangeController_.on("timelinechange",i=>{this.trigger(qe({type:"timelinechange"},i)),this.hasEnoughInfoToLoad_()?this.processLoadQueue_():yi(this),this.hasEnoughInfoToAppend_()?this.processCallQueue_():yi(this)})}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return qa.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&A.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){if(this.state!=="WAITING"){this.pendingSegment_&&(this.pendingSegment_=null),this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_);return}this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,A.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return this.state==="APPENDING"&&!this.pendingSegment_?(this.state="READY",!0):!this.pendingSegment_||this.pendingSegment_.requestId!==e}error(e){return typeof e<"u"&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&qa.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return rt();if(this.loaderType_==="main"){const{hasAudio:t,hasVideo:i,isMuxed:s}=e;if(i&&t&&!this.audioDisabled_&&!s)return this.sourceUpdater_.buffered();if(i)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;const i=wn(e);let s=this.initSegments_[i];return t&&!s&&e.bytes&&(this.initSegments_[i]=s={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),s||e}segmentKey(e,t=!1){if(!e)return null;const i=qd(e);let s=this.keyCache_[i];this.cacheEncryptionKeys_&&t&&!s&&e.bytes&&(this.keyCache_[i]=s={resolvedUri:e.resolvedUri,bytes:e.bytes});const n={resolvedUri:(s||e).resolvedUri};return s&&(n.bytes=s.bytes),n}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),!!this.playlist_){if(this.state==="INIT"&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"||(this.state="READY")}}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,t={}){if(!e||this.playlist_&&this.playlist_.endList&&e.endList&&this.playlist_.uri===e.uri)return;const i=this.playlist_,s=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,this.state==="INIT"&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},this.loaderType_==="main"&&this.syncController_.setDateTimeMappingForStart(e));let n=null;if(i&&(i.id?n=i.id:i.uri&&(n=i.uri)),this.logger_(`playlist update [${n} => ${e.id||e.uri}]`),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(e,this.currentTime_()),this.logger_(`Playlist update:
213
+ currentTime: ${this.currentTime_()}
214
+ bufferedEnd: ${Fa(this.buffered_())}
215
+ `,this.mediaSequenceSync_.diagnostics)),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!i||i.uri!==e.uri){this.mediaIndex!==null&&(!e.endList&&typeof e.partTargetDuration=="number"?this.resetLoader():this.resyncLoader()),this.currentMediaInfo_=void 0,this.trigger("playlistupdate");return}const a=e.mediaSequence-i.mediaSequence;if(this.logger_(`live window shift [${a}]`),this.mediaIndex!==null)if(this.mediaIndex-=a,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{const u=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!u.parts||!u.parts.length||!u.parts[this.partIndex])){const c=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=c}}s&&(s.mediaIndex-=a,s.mediaIndex<0?(s.mediaIndex=null,s.partIndex=null):(s.mediaIndex>=0&&(s.segment=e.segments[s.mediaIndex]),s.partIndex>=0&&s.segment.parts&&(s.part=s.segment.parts[s.partIndex]))),this.syncController_.saveExpiredSegmentInfo(i,e)}pause(){this.checkBufferTimeout_&&(A.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return this.checkBufferTimeout_===null}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1,this.mediaSequenceSync_&&this.mediaSequenceSync_.resetAppendedStatus(),this.resyncLoader()}resyncLoader(){this.transmuxer_&&qa.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1;const e=this.currentMediaInfo_&&this.currentMediaInfo_.isFmp4;this.sourceType_==="hls"&&!e&&(this.shouldForceTimestampOffsetAfterResync_=!0),this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,t,i=()=>{},s=!1){if(t===1/0&&(t=this.duration_()),t<=e){this.logger_("skipping remove because end ${end} is <= start ${start}");return}if(!this.sourceUpdater_||!this.getMediaInfo_()){this.logger_("skipping remove because no source updater or starting media info");return}let n=1;const a=()=>{n--,n===0&&i()};(s||!this.audioDisabled_)&&(n++,this.sourceUpdater_.removeAudio(e,t,a)),(s||this.loaderType_==="main")&&(this.gopBuffer_=A0(this.gopBuffer_,e,t,this.timeMapping_),n++,this.sourceUpdater_.removeVideo(e,t,a));for(const u in this.inbandTextTracks_)ts(e,t,this.inbandTextTracks_[u]);ts(e,t,this.segmentMetadataTrack_),a()}monitorBuffer_(){this.checkBufferTimeout_&&A.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=A.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&A.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=A.setTimeout(this.monitorBufferTick_.bind(this),I0)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();if(!e)return;const t={segmentInfo:Bi({type:this.loaderType_,segment:e})};this.trigger({type:"segmentselected",metadata:t}),typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e)}isEndOfStream_(e=this.mediaIndex,t=this.playlist_,i=this.partIndex){if(!t||!this.mediaSource_)return!1;const s=typeof e=="number"&&t.segments[e],n=e+1===t.segments.length,a=!s||!s.parts||i+1===s.parts.length;return t.endList&&this.mediaSource_.readyState==="open"&&n&&a}chooseNextRequest_(){const e=this.buffered_(),t=Fa(e)||0,i=eu(e,this.currentTime_()),s=!this.hasPlayed_()&&i>=1,n=i>=this.goalBufferLength_(),a=this.playlist_.segments;if(!a.length||s||n)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);const u={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(u.isSyncRequest)u.mediaIndex=D0(this.currentTimeline_,a,t),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${u.mediaIndex}`);else if(this.mediaIndex!==null){const P=a[this.mediaIndex],S=typeof this.partIndex=="number"?this.partIndex:-1;u.startOfSegment=P.end?P.end:t,P.parts&&P.parts[S+1]?(u.mediaIndex=this.mediaIndex,u.partIndex=S+1):u.mediaIndex=this.mediaIndex+1}else{let P,S,R;const b=this.fetchAtBuffer_?t:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch:
216
+ For TargetTime: ${b}.
217
+ CurrentTime: ${this.currentTime_()}
218
+ BufferedEnd: ${t}
219
+ Fetch At Buffer: ${this.fetchAtBuffer_}
220
+ `,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){const I=this.getSyncInfoFromMediaSequenceSync_(b);if(!I){const M="No sync info found while using media sequence sync";return this.error({message:M,metadata:{errorType:j.Error.StreamingFailedToSelectNextSegment,error:new Error(M)}}),this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null}this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${I.start} --> ${I.end})`),P=I.segmentIndex,S=I.partIndex,R=I.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");const I=mt.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:b,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});P=I.segmentIndex,S=I.partIndex,R=I.startTime}u.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${b}`:`currentTime ${b}`,u.mediaIndex=P,u.startOfSegment=R,u.partIndex=S,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${u.mediaIndex} `)}const c=a[u.mediaIndex];let m=c&&typeof u.partIndex=="number"&&c.parts&&c.parts[u.partIndex];if(!c||typeof u.partIndex=="number"&&!m)return null;typeof u.partIndex!="number"&&c.parts&&(u.partIndex=0,m=c.parts[0]);const f=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!i&&m&&!f&&!m.independent)if(u.partIndex===0){const P=a[u.mediaIndex-1],S=P.parts&&P.parts.length&&P.parts[P.parts.length-1];S&&S.independent&&(u.mediaIndex-=1,u.partIndex=P.parts.length-1,u.independent="previous segment")}else c.parts[u.partIndex-1].independent&&(u.partIndex-=1,u.independent="previous part");const _=this.mediaSource_&&this.mediaSource_.readyState==="ended";return u.mediaIndex>=a.length-1&&_&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,u.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(u))}getSyncInfoFromMediaSequenceSync_(e){if(!this.mediaSequenceSync_)return null;const t=Math.max(e,this.mediaSequenceSync_.start);e!==t&&this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ${t}`);const i=this.mediaSequenceSync_.getSyncInfoForTime(t);if(!i)return null;if(!i.isAppended)return i;const s=this.mediaSequenceSync_.getSyncInfoForTime(i.end);return s?(s.isAppended&&this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!"),s):null}generateSegmentInfo_(e){const{independent:t,playlist:i,mediaIndex:s,startOfSegment:n,isSyncRequest:a,partIndex:u,forceTimestampOffset:c,getMediaInfoForTime:m}=e,f=i.segments[s],_=typeof u=="number"&&f.parts[u],P={requestId:"segment-loader-"+Math.random(),uri:_&&_.resolvedUri||f.resolvedUri,mediaIndex:s,partIndex:_?u:null,isSyncRequest:a,startOfSegment:n,playlist:i,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:f.timeline,duration:_&&_.duration||f.duration,segment:f,part:_,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:m,independent:t},S=typeof c<"u"?c:this.isPendingTimestampOffset_;P.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:f.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:S});const R=Fa(this.sourceUpdater_.audioBuffered());return typeof R=="number"&&(P.audioAppendStart=R-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(P.gopsToAlignWith=w0(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),P}timestampOffsetForSegment_(e){return O0(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH||Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;const t=this.currentTime_(),i=e.bandwidth,s=this.pendingSegment_.duration,n=mt.estimateSegmentRequestTime(s,i,this.playlist_,e.bytesReceived),a=t2(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(n<=a)return;const u=m0({main:this.vhs_.playlists.main,currentTime:t,bandwidth:i,duration:this.duration_(),segmentDuration:s,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!u)return;const c=n-a-u.rebufferingImpact;let m=.5;a<=Wt&&(m=1),!(!u.playlist||u.playlist.uri===this.playlist_.uri||c<m)&&(this.bandwidth=u.playlist.attributes.BANDWIDTH*Ge.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}handleAbort_(e){this.logger_(`Aborting ${er(e)}`),this.mediaRequestsAborted+=1}handleProgress_(e,t){this.earlyAbortWhenNeeded_(t.stats),!this.checkForAbort_(t.requestId)&&this.trigger("progress")}handleTrackInfo_(e,t){const{hasAudio:i,hasVideo:s}=t,n={segmentInfo:Bi({type:this.loaderType_,segment:e}),trackInfo:{hasAudio:i,hasVideo:s}};this.trigger({type:"segmenttransmuxingtrackinfoavailable",metadata:n}),this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)&&(this.checkForIllegalMediaSwitch(t)||(t=t||{},x0(this.currentMediaInfo_,t)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=t,this.currentMediaInfo_=t,this.logger_("trackinfo update",t),this.trigger("trackinfo")),!this.checkForAbort_(e.requestId)&&(this.pendingSegment_.trackInfo=t,this.hasEnoughInfoToAppend_()?this.processCallQueue_():yi(this))))}handleTimingInfo_(e,t,i,s){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;const n=this.pendingSegment_,a=Tc(t);n[a]=n[a]||{},n[a][i]=s,this.logger_(`timinginfo: ${t} - ${i} - ${s}`),this.hasEnoughInfoToAppend_()?this.processCallQueue_():yi(this)}handleCaptions_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(t.length===0){this.logger_("SegmentLoader received no captions from a caption event");return}if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t));return}const i=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),s={};t.forEach(n=>{s[n.stream]=s[n.stream]||{startTime:1/0,captions:[],endTime:0};const a=s[n.stream];a.startTime=Math.min(a.startTime,n.startTime+i),a.endTime=Math.max(a.endTime,n.endTime+i),a.captions.push(n)}),Object.keys(s).forEach(n=>{const{startTime:a,endTime:u,captions:c}=s[n],m=this.inbandTextTracks_;this.logger_(`adding cues from ${a} -> ${u} for ${n}`),y0(m,this.vhs_.tech_,n),ts(a,u,m[n]),_0({captionArray:c,inbandTextTracks:m,timestampOffset:i})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,i){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,i));return}this.addMetadataToTextTrack(i,t,this.duration_())}}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e()),this.metadataQueue_.caption.forEach(e=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){const e=this.callQueue_;this.callQueue_=[],e.forEach(t=>t())}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[],e.forEach(t=>t())}hasEnoughInfoToLoad_(){if(this.loaderType_!=="audio")return!0;const e=this.pendingSegment_;return e?this.getCurrentMediaInfo_()?!yo({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}):!0:!1}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;const e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;const{hasAudio:i,hasVideo:s,isMuxed:n}=t;return!(s&&!e.videoTimingInfo||i&&!this.audioDisabled_&&!n&&!e.audioTimingInfo||yo({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}handleData_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){yi(this),this.callQueue_.push(this.handleData_.bind(this,e,t));return}const i=this.pendingSegment_;if(this.setTimeMapping_(i.timeline),this.updateMediaSecondsLoaded_(i.part||i.segment),this.mediaSource_.readyState!=="closed"){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),i.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),i.isFmp4=e.isFmp4,i.timingInfo=i.timingInfo||{},i.isFmp4)this.trigger("fmp4"),i.timingInfo.start=i[Tc(t.type)].start;else{const s=this.getCurrentMediaInfo_(),n=this.loaderType_==="main"&&s&&s.hasVideo;let a;n&&(a=i.videoTimingInfo.start),i.timingInfo.start=this.trueSegmentStart_({currentStart:i.timingInfo.start,playlist:i.playlist,mediaIndex:i.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:n,firstVideoFrameTimeForData:a,videoTimingInfo:i.videoTimingInfo,audioTimingInfo:i.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(i,t.type),this.updateSourceBufferTimestampOffset_(i),i.isSyncRequest){this.updateTimingInfoEnd_(i),this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:this.loaderType_==="main"});const s=this.chooseNextRequest_();if(s.mediaIndex!==i.mediaIndex||s.partIndex!==i.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}i.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(i,t)}}updateAppendInitSegmentStatus(e,t){this.loaderType_==="main"&&typeof e.timestampOffset=="number"&&!e.changedTimestampOffset&&(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:i,playlist:s}){if(i){const n=wn(i);if(this.activeInitSegmentId_===n)return null;t=this.initSegmentForMap(i,!0).bytes,this.activeInitSegmentId_=n}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=s,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i},s){const n=this.sourceUpdater_.audioBuffered(),a=this.sourceUpdater_.videoBuffered();n.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+Fi(n).join(", ")),a.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Fi(a).join(", "));const u=n.length?n.start(0):0,c=n.length?n.end(n.length-1):0,m=a.length?a.start(0):0,f=a.length?a.end(a.length-1):0;if(c-u<=Jr&&f-m<=Jr){this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${i.byteLength}, audio buffer: ${Fi(n).join(", ")}, video buffer: ${Fi(a).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),this.trigger("error");return}this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:i}));const _=this.currentTime_()-Jr;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${_}`),this.remove(0,_,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${Jr}s`),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=A.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},Jr*1e3)},!0)}handleAppendError_({segmentInfo:e,type:t,bytes:i},s){if(s){if(s.code===Od){this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",s),this.error({message:`${t} append of ${i.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:j.Error.StreamingFailedToAppendSegment}}),this.trigger("appenderror")}}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:i,data:s,bytes:n}){if(!n){const u=[s];let c=s.byteLength;i&&(u.unshift(i),c+=i.byteLength),n=f0({bytes:c,segments:u})}const a={segmentInfo:Bi({type:this.loaderType_,segment:e})};this.trigger({type:"segmentappendstart",metadata:a}),this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:n},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:n}))}handleSegmentTimingInfo_(e,t,i){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;const s=this.pendingSegment_.segment,n=`${e}TimingInfo`;s[n]||(s[n]={}),s[n].transmuxerPrependedSeconds=i.prependedContentDuration||0,s[n].transmuxedPresentationStart=i.start.presentation,s[n].transmuxedDecodeStart=i.start.decode,s[n].transmuxedPresentationEnd=i.end.presentation,s[n].transmuxedDecodeEnd=i.end.decode,s[n].baseMediaDecodeTime=i.baseMediaDecodeTime}appendData_(e,t){const{type:i,data:s}=t;if(!s||!s.byteLength||i==="audio"&&this.audioDisabled_)return;const n=this.getInitSegmentAndUpdateState_({type:i,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:n,data:s})}loadSegment_(e){if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),typeof e.timestampOffset=="number"&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_()){yi(this),this.loadQueue_.push(()=>{const t=qe({},e,{forceTimestampOffset:!0});qe(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)});return}this.updateTransmuxerAndRequestSegment_(e)}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));const t=this.createSimplifiedSegmentObj_(e),i=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),s=this.mediaIndex!==null,n=e.timeline!==this.currentTimeline_&&e.timeline>0,a=i||s&&n;this.logger_(`Requesting
221
+ ${sp(e.uri)}
222
+ ${er(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=h0({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:t,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:a,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:u,level:c,stream:m})=>{this.logger_(`${er(e)} logged from transmuxer stream ${m} as a ${c}: ${u}`)},triggerSegmentEventFn:({type:u,segment:c,keyInfo:m,trackInfo:f,timingInfo:_})=>{const P={segmentInfo:Bi({segment:c})};m&&(P.keyInfo=m),f&&(P.trackInfo=f),_&&(P.timingInfo=_),this.trigger({type:u,metadata:P})}})}trimBackBuffer_(e){const t=L0(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){const t=e.segment,i=e.part,s=e.segment.key||e.segment.map&&e.segment.map.key,n=e.segment.map&&!e.segment.map.bytes,a={resolvedUri:i?i.resolvedUri:t.resolvedUri,byterange:i?i.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part,type:this.loaderType_,start:e.startOfSegment,duration:e.duration,isEncrypted:s,isMediaInitialization:n},u=e.playlist.segments[e.mediaIndex-1];if(u&&u.timeline===t.timeline&&(u.videoTimingInfo?a.baseStartTime=u.videoTimingInfo.transmuxedDecodeEnd:u.audioTimingInfo&&(a.baseStartTime=u.audioTimingInfo.transmuxedDecodeEnd)),t.key){const c=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);a.key=this.segmentKey(t.key),a.key.iv=c}return t.map&&(a.map=this.initSegmentForMap(t.map)),a}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,t){if(this.pendingSegment_.byteLength=t.bytesReceived,e<rn){this.logger_(`Ignoring segment's bandwidth because its duration of ${e} is less than the min to record ${rn}`);return}const i={bandwidthInfo:{from:this.bandwidth,to:t.bandwidth}};this.trigger({type:"bandwidthupdated",metadata:i}),this.bandwidth=t.bandwidth,this.roundTrip=t.roundTripTime}handleTimeout_(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate"),this.trigger("timeout")}segmentRequestFinished_(e,t,i){if(this.callQueue_.length){this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,i));return}if(this.saveTransferStats_(t.stats),!this.pendingSegment_||t.requestId!==this.pendingSegment_.requestId)return;if(e){if(this.pendingSegment_=null,this.state="READY",e.code===Xt.ABORTED)return;if(this.pause(),e.code===Xt.TIMEOUT){this.handleTimeout_();return}this.mediaRequestsErrored+=1,this.error(e),this.trigger("error");return}const s=this.pendingSegment_;this.saveBandwidthRelatedStats_(s.duration,t.stats),s.endOfAllRequests=t.endOfAllRequests,i.gopInfo&&(this.gopBuffer_=k0(this.gopBuffer_,i.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(s)}setTimeMapping_(e){const t=this.syncController_.mappingForTimeline(e);t!==null&&(this.timeMapping_=t)}updateMediaSecondsLoaded_(e){typeof e.start=="number"&&typeof e.end=="number"?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration}shouldUpdateTransmuxerTimestampOffset_(e){return e===null?!1:this.loaderType_==="main"&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset()}trueSegmentStart_({currentStart:e,playlist:t,mediaIndex:i,firstVideoFrameTimeForData:s,currentVideoTimestampOffset:n,useVideoTimingInfo:a,videoTimingInfo:u,audioTimingInfo:c}){if(typeof e<"u")return e;if(!a)return c.start;const m=t.segments[i-1];return i===0||!m||typeof m.start>"u"||m.end!==s+n?s:u.start}waitForAppendsToComplete_(e){const t=this.getCurrentMediaInfo_(e);if(!t){this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:1/0}),this.trigger("error");return}const{hasAudio:i,hasVideo:s,isMuxed:n}=t,a=this.loaderType_==="main"&&s,u=!this.audioDisabled_&&i&&!n;if(e.waitingOnAppends=0,!e.hasAppendedData_){!e.timingInfo&&typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),this.checkAppendsDone_(e);return}a&&e.waitingOnAppends++,u&&e.waitingOnAppends++,a&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),u&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,e.waitingOnAppends===0&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){const t=P0(this.loaderType_,this.getCurrentMediaInfo_(),e);return t?(this.error({message:t,playlistExclusionDuration:1/0}),this.trigger("error"),!0):!1}updateSourceBufferTimestampOffset_(e){if(e.timestampOffset===null||typeof e.timingInfo.start!="number"||e.changedTimestampOffset||this.loaderType_!=="main")return;let t=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset")}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e,audioTimingInfo:t,timingInfo:i}){return this.useDtsForTimestampOffset_?e&&typeof e.transmuxedDecodeStart=="number"?e.transmuxedDecodeStart:t&&typeof t.transmuxedDecodeStart=="number"?t.transmuxedDecodeStart:i.start:i.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};const t=this.getMediaInfo_(),i=this.loaderType_==="main"&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;i&&(e.timingInfo.end=typeof i.end=="number"?i.end:i.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_){const u={segmentInfo:Bi({type:this.loaderType_,segment:this.pendingSegment_})};this.trigger({type:"appendsdone",metadata:u})}if(!this.pendingSegment_){this.state="READY",this.paused()||this.monitorBuffer_();return}const e=this.pendingSegment_;e.part&&e.part.syncInfo?e.part.syncInfo.markAppended():e.segment.syncInfo&&e.segment.syncInfo.markAppended(),this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:this.loaderType_==="main"});const t=B0(e,this.sourceType_);if(t&&(t.severity==="warn"?j.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_)){this.logger_(`Throwing away un-appended sync request ${er(e)}`);return}this.logger_(`Appended ${er(e)}`),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),this.loaderType_==="main"&&!this.audioDisabled_&&this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");const i=e.segment,s=e.part,n=i.end&&this.currentTime_()-i.end>e.playlist.targetDuration*3,a=s&&s.end&&this.currentTime_()-s.end>e.playlist.partTargetDuration*3;if(n||a){this.logger_(`bad ${n?"segment":"part"} ${er(e)}`),this.resetEverything();return}this.mediaIndex!==null&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}recordThroughput_(e){if(e.duration<rn){this.logger_(`Ignoring segment's throughput because its duration of ${e.duration} is less than the min to record ${rn}`);return}const t=this.throughput.rate,i=Date.now()-e.endOfAllRequests+1,s=Math.floor(e.byteLength/i*8*1e3);this.throughput.rate+=(s-t)/++this.throughput.count}addSegmentMetadataCue_(e){if(!this.segmentMetadataTrack_)return;const t=e.segment,i=t.start,s=t.end;if(!vc(i)||!vc(s))return;ts(i,s,this.segmentMetadataTrack_);const n=A.WebKitDataCue||A.VTTCue,a={custom:t.custom,dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,programDateTime:t.programDateTime,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.id,start:i,end:s},u=JSON.stringify(a),c=new n(i,s,u);c.value=a,this.segmentMetadataTrack_.addCue(c)}}function ri(){}const np=function(r){return typeof r!="string"?r:r.replace(/./,e=>e.toUpperCase())},U0=["video","audio"],bo=(r,e)=>{const t=e[`${r}Buffer`];return t&&t.updating||e.queuePending[r]},F0=(r,e)=>{for(let t=0;t<e.length;t++){const i=e[t];if(i.type==="mediaSource")return null;if(i.type===r)return t}return null},dr=(r,e)=>{if(e.queue.length===0)return;let t=0,i=e.queue[t];if(i.type==="mediaSource"){!e.updating()&&e.mediaSource.readyState!=="closed"&&(e.queue.shift(),i.action(e),i.doneFn&&i.doneFn(),dr("audio",e),dr("video",e));return}if(r!=="mediaSource"&&!(!e.ready()||e.mediaSource.readyState==="closed"||bo(r,e))){if(i.type!==r){if(t=F0(r,e.queue),t===null)return;i=e.queue[t]}if(e.queue.splice(t,1),e.queuePending[r]=i,i.action(r,e),!i.doneFn){e.queuePending[r]=null,dr(r,e);return}}},ap=(r,e)=>{const t=e[`${r}Buffer`],i=np(r);t&&(t.removeEventListener("updateend",e[`on${i}UpdateEnd_`]),t.removeEventListener("error",e[`on${i}Error_`]),e.codecs[r]=null,e[`${r}Buffer`]=null)},Vt=(r,e)=>r&&e&&Array.prototype.indexOf.call(r.sourceBuffers,e)!==-1,yt={appendBuffer:(r,e,t)=>(i,s)=>{const n=s[`${i}Buffer`];if(Vt(s.mediaSource,n)){s.logger_(`Appending segment ${e.mediaIndex}'s ${r.length} bytes to ${i}Buffer`);try{n.appendBuffer(r)}catch(a){s.logger_(`Error with code ${a.code} `+(a.code===Od?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${e.mediaIndex} to ${i}Buffer`),s.queuePending[i]=null,t(a)}}},remove:(r,e)=>(t,i)=>{const s=i[`${t}Buffer`];if(Vt(i.mediaSource,s)){i.logger_(`Removing ${r} to ${e} from ${t}Buffer`);try{s.remove(r,e)}catch{i.logger_(`Remove ${r} to ${e} from ${t}Buffer failed`)}}},timestampOffset:r=>(e,t)=>{const i=t[`${e}Buffer`];Vt(t.mediaSource,i)&&(t.logger_(`Setting ${e}timestampOffset to ${r}`),i.timestampOffset=r)},callback:r=>(e,t)=>{r()},endOfStream:r=>e=>{if(e.mediaSource.readyState==="open"){e.logger_(`Calling mediaSource endOfStream(${r||""})`);try{e.mediaSource.endOfStream(r)}catch(t){j.log.warn("Failed to call media source endOfStream",t)}}},duration:r=>e=>{e.logger_(`Setting mediaSource duration to ${r}`);try{e.mediaSource.duration=r}catch(t){j.log.warn("Failed to set media source duration",t)}},abort:()=>(r,e)=>{if(e.mediaSource.readyState!=="open")return;const t=e[`${r}Buffer`];if(Vt(e.mediaSource,t)){e.logger_(`calling abort on ${r}Buffer`);try{t.abort()}catch(i){j.log.warn(`Failed to abort on ${r}Buffer`,i)}}},addSourceBuffer:(r,e)=>t=>{const i=np(r),s=pr(e);t.logger_(`Adding ${r}Buffer with codec ${e} to mediaSource`);const n=t.mediaSource.addSourceBuffer(s);n.addEventListener("updateend",t[`on${i}UpdateEnd_`]),n.addEventListener("error",t[`on${i}Error_`]),t.codecs[r]=e,t[`${r}Buffer`]=n},removeSourceBuffer:r=>e=>{const t=e[`${r}Buffer`];if(ap(r,e),!!Vt(e.mediaSource,t)){e.logger_(`Removing ${r}Buffer with codec ${e.codecs[r]} from mediaSource`);try{e.mediaSource.removeSourceBuffer(t)}catch(i){j.log.warn(`Failed to removeSourceBuffer ${r}Buffer`,i)}}},changeType:r=>(e,t)=>{const i=t[`${e}Buffer`],s=pr(r);if(!Vt(t.mediaSource,i))return;const n=r.substring(0,r.indexOf(".")),a=t.codecs[e];if(a.substring(0,a.indexOf("."))===n)return;const u={codecsChangeInfo:{from:a,to:r}};t.trigger({type:"codecschange",metadata:u}),t.logger_(`changing ${e}Buffer codec from ${a} to ${r}`);try{i.changeType(s),t.codecs[e]=r}catch(c){u.errorType=j.Error.StreamingCodecsChangeError,u.error=c,c.metadata=u,t.error_=c,t.trigger("error"),j.log.warn(`Failed to changeType on ${e}Buffer`,c)}}},_t=({type:r,sourceUpdater:e,action:t,doneFn:i,name:s})=>{e.queue.push({type:r,action:t,doneFn:i,name:s}),dr(r,e)},Ec=(r,e)=>t=>{const i=e[`${r}Buffered`](),s=J_(i);if(e.logger_(`received "updateend" event for ${r} Source Buffer: `,s),e.queuePending[r]){const n=e.queuePending[r].doneFn;e.queuePending[r]=null,n&&n(e[`${r}Error_`])}dr(r,e)};class op extends j.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>dr("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=Pt("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=Ec("video",this),this.onAudioUpdateEnd_=Ec("audio",this),this.onVideoError_=t=>{this.videoError_=t},this.onAudioError_=t=>{this.audioError_=t},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,t){_t({type:"mediaSource",sourceUpdater:this,action:yt.addSourceBuffer(e,t),name:"addSourceBuffer"})}abort(e){_t({type:e,sourceUpdater:this,action:yt.abort(e),name:"abort"})}removeSourceBuffer(e){if(!this.canRemoveSourceBuffer()){j.log.error("removeSourceBuffer is not supported!");return}_t({type:"mediaSource",sourceUpdater:this,action:yt.removeSourceBuffer(e),name:"removeSourceBuffer"})}canRemoveSourceBuffer(){return!j.browser.IS_FIREFOX&&A.MediaSource&&A.MediaSource.prototype&&typeof A.MediaSource.prototype.removeSourceBuffer=="function"}static canChangeType(){return A.SourceBuffer&&A.SourceBuffer.prototype&&typeof A.SourceBuffer.prototype.changeType=="function"}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){if(!this.canChangeType()){j.log.error("changeType is not supported!");return}_t({type:e,sourceUpdater:this,action:yt.changeType(t),name:"changeType"})}addOrChangeSourceBuffers(e){if(!e||typeof e!="object"||Object.keys(e).length===0)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(t=>{const i=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,i);this.canChangeType()&&this.changeType(t,i)})}appendBuffer(e,t){const{segmentInfo:i,type:s,bytes:n}=e;if(this.processedAppend_=!0,s==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([e,t]),this.logger_(`delayed audio append of ${n.length} until video append`);return}const a=t;if(_t({type:s,sourceUpdater:this,action:yt.appendBuffer(n,i||{mediaIndex:-1},a),doneFn:t,name:"appendBuffer"}),s==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const u=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${u.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,u.forEach(c=>{this.appendBuffer.apply(this,c)})}}audioBuffered(){return Vt(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:rt()}videoBuffered(){return Vt(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:rt()}buffered(){const e=Vt(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=Vt(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():e2(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=ri){_t({type:"mediaSource",sourceUpdater:this,action:yt.duration(e),name:"duration",doneFn:t})}endOfStream(e=null,t=ri){typeof e!="string"&&(e=void 0),_t({type:"mediaSource",sourceUpdater:this,action:yt.endOfStream(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,i=ri){if(!this.audioBuffered().length||this.audioBuffered().end(0)===0){i();return}_t({type:"audio",sourceUpdater:this,action:yt.remove(e,t),doneFn:i,name:"remove"})}removeVideo(e,t,i=ri){if(!this.videoBuffered().length||this.videoBuffered().end(0)===0){i();return}_t({type:"video",sourceUpdater:this,action:yt.remove(e,t),doneFn:i,name:"remove"})}updating(){return!!(bo("audio",this)||bo("video",this))}audioTimestampOffset(e){return typeof e<"u"&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(_t({type:"audio",sourceUpdater:this,action:yt.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return typeof e<"u"&&this.videoBuffer&&this.videoTimestampOffset_!==e&&(_t({type:"video",sourceUpdater:this,action:yt.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&_t({type:"audio",sourceUpdater:this,action:yt.callback(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&_t({type:"video",sourceUpdater:this,action:yt.callback(e),name:"callback"})}dispose(){this.trigger("dispose"),U0.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>ap(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}const Cc=r=>decodeURIComponent(escape(String.fromCharCode.apply(null,r))),j0=r=>{const e=new Uint8Array(r);return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")},wc=new Uint8Array(`
223
+
224
+ `.split("").map(r=>r.charCodeAt(0)));class q0 extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class $0 extends _o{constructor(e,t={}){super(e,t),this.mediaSource_=null,this.subtitlesTrack_=null,this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return rt();const e=this.subtitlesTrack_.cues,t=e[0].startTime,i=e[e.length-1].startTime;return rt([[t,i]])}initSegmentForMap(e,t=!1){if(!e)return null;const i=wn(e);let s=this.initSegments_[i];if(t&&!s&&e.bytes){const n=wc.byteLength+e.bytes.byteLength,a=new Uint8Array(n);a.set(e.bytes),a.set(wc,e.bytes.byteLength),this.initSegments_[i]=s={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:a}}return s||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return typeof e>"u"?this.subtitlesTrack_:(this.subtitlesTrack_=e,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)}remove(e,t){ts(e,t,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(e){if(this.syncController_.timestampOffsetForTimeline(e.timeline)===null){const t=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};this.syncController_.one("timestampoffset",t),this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(e)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(e,t,i){if(!this.subtitlesTrack_){this.state="READY";return}if(this.saveTransferStats_(t.stats),!this.pendingSegment_){this.state="READY",this.mediaRequestsAborted+=1;return}if(e){e.code===Xt.TIMEOUT&&this.handleTimeout_(),e.code===Xt.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(e);return}const s=this.pendingSegment_,n=i.mp4VttCues&&i.mp4VttCues.length;n&&(s.mp4VttCues=i.mp4VttCues),this.saveBandwidthRelatedStats_(s.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");const a=s.segment;if(a.map&&(a.map.bytes=t.map.bytes),s.bytes=t.bytes,typeof A.WebVTT!="function"&&typeof this.loadVttJs=="function"){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(()=>this.segmentRequestFinished_(e,t,i),()=>this.stopForError({message:"Error loading vtt.js"}));return}a.requested=!0;try{this.parseVTTCues_(s)}catch(u){this.stopForError({message:u.message,metadata:{errorType:j.Error.StreamingVttParserError,error:u}});return}if(n||this.updateTimeMapping_(s,this.syncController_.timelines[s.timeline],this.playlist_),s.cues.length?s.timingInfo={start:s.cues[0].startTime,end:s.cues[s.cues.length-1].endTime}:s.timingInfo={start:s.startOfSegment,end:s.startOfSegment+s.duration},s.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}s.byteLength=s.bytes.byteLength,this.mediaSecondsLoaded+=a.duration,s.cues.forEach(u=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new A.VTTCue(u.startTime,u.endTime,u.text):u)}),C0(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(e,t){const i=e&&e.type==="vtt",s=t&&t.type==="text";i&&s&&super.handleData_(e,t)}updateTimingInfoEnd_(){}parseMp4VttCues_(e){const t=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();e.mp4VttCues.forEach(i=>{const s=i.start+t,n=i.end+t,a=new A.VTTCue(s,n,i.cueText);i.settings&&i.settings.split(" ").forEach(u=>{const c=u.split(":"),m=c[0],f=c[1];a[m]=isNaN(f)?f:Number(f)}),e.cues.push(a)})}parseVTTCues_(e){let t,i=!1;if(typeof A.WebVTT!="function")throw new q0;if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},e.mp4VttCues){this.parseMp4VttCues_(e);return}typeof A.TextDecoder=="function"?t=new A.TextDecoder("utf8"):(t=A.WebVTT.StringDecoder(),i=!0);const s=new A.WebVTT.Parser(A,A.vttjs,t);if(s.oncue=e.cues.push.bind(e.cues),s.ontimestampmap=a=>{e.timestampmap=a},s.onparsingerror=a=>{j.log.warn("Error encountered when parsing cues: "+a.message)},e.segment.map){let a=e.segment.map.bytes;i&&(a=Cc(a)),s.parse(a)}let n=e.bytes;i&&(n=Cc(n)),s.parse(n),s.flush()}updateTimeMapping_(e,t,i){const s=e.segment;if(!t)return;if(!e.cues.length){s.empty=!0;return}const{MPEGTS:n,LOCAL:a}=e.timestampmap,u=n/Ui.ONE_SECOND_IN_TS-a+t.mapping;if(e.cues.forEach(c=>{const m=c.endTime-c.startTime,f=this.handleRollover_(c.startTime+u,t.time);c.startTime=Math.max(f,0),c.endTime=Math.max(f+m,0)}),!i.syncInfo){const c=e.cues[0].startTime,m=e.cues[e.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(c,m-s.duration)}}}handleRollover_(e,t){if(t===null)return e;let i=e*Ui.ONE_SECOND_IN_TS;const s=t*Ui.ONE_SECOND_IN_TS;let n;for(s<i?n=-8589934592:n=8589934592;Math.abs(i-s)>4294967296;)i+=n;return i/Ui.ONE_SECOND_IN_TS}}const H0=function(r,e){const t=r.cues;for(let i=0;i<t.length;i++){const s=t[i];if(e>=s.adStartTime&&e<=s.adEndTime)return s}return null},V0=function(r,e,t=0){if(!r.segments)return;let i=t,s;for(let n=0;n<r.segments.length;n++){const a=r.segments[n];if(s||(s=H0(e,i+a.duration/2)),s){if("cueIn"in a){s.endTime=i,s.adEndTime=i,i+=a.duration,s=null;continue}if(i<s.endTime){i+=a.duration;continue}s.endTime+=a.duration}else if("cueOut"in a&&(s=new A.VTTCue(i,i+a.duration,a.cueOut),s.adStartTime=i,s.adEndTime=i+parseFloat(a.cueOut),e.addCue(s)),"cueOutCont"in a){const[u,c]=a.cueOutCont.split("/").map(parseFloat);s=new A.VTTCue(i,i+a.duration,""),s.adStartTime=i-u,s.adEndTime=s.adStartTime+c,e.addCue(s)}i+=a.duration}};class kc{constructor({start:e,end:t,segmentIndex:i,partIndex:s=null,appended:n=!1}){this.start_=e,this.end_=t,this.segmentIndex_=i,this.partIndex_=s,this.appended_=n}isInRange(e){return e>=this.start&&e<this.end}markAppended(){this.appended_=!0}resetAppendedStatus(){this.appended_=!1}get isAppended(){return this.appended_}get start(){return this.start_}get end(){return this.end_}get segmentIndex(){return this.segmentIndex_}get partIndex(){return this.partIndex_}}class z0{constructor(e,t=[]){this.segmentSyncInfo_=e,this.partsSyncInfo_=t}get segmentSyncInfo(){return this.segmentSyncInfo_}get partsSyncInfo(){return this.partsSyncInfo_}get hasPartsSyncInfo(){return this.partsSyncInfo_.length>0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus(),this.partsSyncInfo_.forEach(e=>e.resetAppendedStatus())}}class up{constructor(){this.storage_=new Map,this.diagnostics_="",this.isReliable_=!1,this.start_=-1/0,this.end_=1/0}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach(e=>e.resetAppendStatus())}update(e,t){const{mediaSequence:i,segments:s}=e;if(this.isReliable_=this.isReliablePlaylist_(i,s),!!this.isReliable_)return this.updateStorage_(s,i,this.calculateBaseTime_(i,s,t))}getSyncInfoForTime(e){for(const{segmentSyncInfo:t,partsSyncInfo:i}of this.storage_.values())if(i.length){for(const s of i)if(s.isInRange(e))return s}else if(t.isInRange(e))return t;return null}getSyncInfoForMediaSequence(e){return this.storage_.get(e)}updateStorage_(e,t,i){const s=new Map;let n=`
225
+ `,a=i,u=t;this.start_=a,e.forEach((c,m)=>{const f=this.storage_.get(u),_=a,P=_+c.duration,S=!!(f&&f.segmentSyncInfo&&f.segmentSyncInfo.isAppended),R=new kc({start:_,end:P,appended:S,segmentIndex:m});c.syncInfo=R;let b=a;const I=(c.parts||[]).map((M,N)=>{const O=b,z=b+M.duration,q=!!(f&&f.partsSyncInfo&&f.partsSyncInfo[N]&&f.partsSyncInfo[N].isAppended),$=new kc({start:O,end:z,appended:q,segmentIndex:m,partIndex:N});return b=z,n+=`Media Sequence: ${u}.${N} | Range: ${O} --> ${z} | Appended: ${q}
226
+ `,M.syncInfo=$,$});s.set(u,new z0(R,I)),n+=`${sp(c.resolvedUri)} | Media Sequence: ${u} | Range: ${_} --> ${P} | Appended: ${S}
227
+ `,u++,a=P}),this.end_=a,this.storage_=s,this.diagnostics_=n}calculateBaseTime_(e,t,i){if(!this.storage_.size)return 0;if(this.storage_.has(e))return this.storage_.get(e).segmentSyncInfo.start;const s=Math.min(...this.storage_.keys());if(e<s){const n=s-e;let a=this.storage_.get(s).segmentSyncInfo.start;for(let u=0;u<n;u++){const c=t[u];a-=c.duration}return a}return i}isReliablePlaylist_(e,t){return e!=null&&Array.isArray(t)&&t.length}}class Ac extends up{constructor(e){super(),this.parent_=e}calculateBaseTime_(e,t,i){if(!this.storage_.size){const s=this.parent_.getSyncInfoForMediaSequence(e);return s?s.segmentSyncInfo.start:0}return super.calculateBaseTime_(e,t,i)}}const W0=86400,$a=[{name:"VOD",run:(r,e,t,i,s)=>t!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(r,e,t,i,s,n)=>{const a=r.getMediaSequenceSync(n);if(!a||!a.isReliable)return null;const u=a.getSyncInfoForTime(s);return u?{time:u.start,partIndex:u.partIndex,segmentIndex:u.segmentIndex}:null}},{name:"ProgramDateTime",run:(r,e,t,i,s)=>{if(!Object.keys(r.timelineToDatetimeMappings).length)return null;let n=null,a=null;const u=uo(e);s=s||0;for(let c=0;c<u.length;c++){const m=e.endList||s===0?c:u.length-(c+1),f=u[m],_=f.segment,P=r.timelineToDatetimeMappings[_.timeline];if(!P||!_.dateTimeObject)continue;let S=_.dateTimeObject.getTime()/1e3+P;if(_.parts&&typeof f.partIndex=="number")for(let b=0;b<f.partIndex;b++)S+=_.parts[b].duration;const R=Math.abs(s-S);if(a!==null&&(R===0||a<R))break;a=R,n={time:S,segmentIndex:f.segmentIndex,partIndex:f.partIndex}}return n}},{name:"Segment",run:(r,e,t,i,s)=>{let n=null,a=null;s=s||0;const u=uo(e);for(let c=0;c<u.length;c++){const m=e.endList||s===0?c:u.length-(c+1),f=u[m],_=f.segment,P=f.part&&f.part.start||_&&_.start;if(_.timeline===i&&typeof P<"u"){const S=Math.abs(s-P);if(a!==null&&a<S)break;(!n||a===null||a>=S)&&(a=S,n={time:P,segmentIndex:f.segmentIndex,partIndex:f.partIndex})}}return n}},{name:"Discontinuity",run:(r,e,t,i,s)=>{let n=null;if(s=s||0,e.discontinuityStarts&&e.discontinuityStarts.length){let a=null;for(let u=0;u<e.discontinuityStarts.length;u++){const c=e.discontinuityStarts[u],m=e.discontinuitySequence+u+1,f=r.discontinuities[m];if(f){const _=Math.abs(s-f.time);if(a!==null&&a<_)break;(!n||a===null||a>=_)&&(a=_,n={time:f.time,segmentIndex:c,partIndex:null})}}}return n}},{name:"Playlist",run:(r,e,t,i,s)=>e.syncInfo?{time:e.syncInfo.time,segmentIndex:e.syncInfo.mediaSequence-e.mediaSequence,partIndex:null}:null}];class G0 extends j.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};const t=new up,i=new Ac(t),s=new Ac(t);this.mediaSequenceStorage_={main:t,audio:i,vtt:s},this.logger_=Pt("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,t,i,s,n){if(t!==1/0)return $a.find(({name:u})=>u==="VOD").run(this,e,t);const a=this.runStrategies_(e,t,i,s,n);if(!a.length)return null;for(const u of a){const{syncPoint:c,strategy:m}=u,{segmentIndex:f,time:_}=c;if(f<0)continue;const P=e.segments[f],S=_,R=S+P.duration;if(this.logger_(`Strategy: ${m}. Current time: ${s}. selected segment: ${f}. Time: [${S} -> ${R}]}`),s>=S&&s<R)return this.logger_("Found sync point with exact match: ",c),c}return this.selectSyncPoint_(a,{key:"time",value:s})}getExpiredTime(e,t){if(!e||!e.segments)return null;const i=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!i.length)return null;const s=this.selectSyncPoint_(i,{key:"segmentIndex",value:0});return s.segmentIndex>0&&(s.time*=-1),Math.abs(s.time+as({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:s.segmentIndex,endIndex:0}))}runStrategies_(e,t,i,s,n){const a=[];for(let u=0;u<$a.length;u++){const c=$a[u],m=c.run(this,e,t,i,s,n);m&&(m.strategy=c.name,a.push({strategy:c.name,syncPoint:m}))}return a}selectSyncPoint_(e,t){let i=e[0].syncPoint,s=Math.abs(e[0].syncPoint[t.key]-t.value),n=e[0].strategy;for(let a=1;a<e.length;a++){const u=Math.abs(e[a].syncPoint[t.key]-t.value);u<s&&(s=u,i=e[a].syncPoint,n=e[a].strategy)}return this.logger_(`syncPoint for [${t.key}: ${t.value}] chosen with strategy [${n}]: [time:${i.time}, segmentIndex:${i.segmentIndex}`+(typeof i.partIndex=="number"?`,partIndex:${i.partIndex}`:"")+"]"),i}saveExpiredSegmentInfo(e,t){const i=t.mediaSequence-e.mediaSequence;if(i>W0){j.log.warn(`Not saving expired segment info. Media sequence gap ${i} is too large.`);return}for(let s=i-1;s>=0;s--){const n=e.segments[s];if(n&&typeof n.start<"u"){t.syncInfo={mediaSequence:e.mediaSequence+s,time:n.start},this.logger_(`playlist refresh sync: [time:${t.syncInfo.time}, mediaSequence: ${t.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const t=e.segments[0],i=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-i}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){const i=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),s=e.segment;i&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:s.start}));const n=s.dateTimeObject;s.discontinuity&&t&&n&&(this.timelineToDatetimeMappings[s.timeline]=-(n.getTime()/1e3))}timestampOffsetForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].time}mappingForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,i){const s=e.segment,n=e.part;let a=this.timelines[e.timeline],u,c;if(typeof e.timestampOffset=="number")a={time:e.startOfSegment,mapping:e.startOfSegment-t.start},i&&(this.timelines[e.timeline]=a,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${a.time}] [mapping: ${a.mapping}]`)),u=e.startOfSegment,c=t.end+a.mapping;else if(a)u=t.start+a.mapping,c=t.end+a.mapping;else return!1;return n&&(n.start=u,n.end=c),(!s.start||u<s.start)&&(s.start=u),s.end=c,!0}saveDiscontinuitySyncInfo_(e){const t=e.playlist,i=e.segment;if(i.discontinuity)this.discontinuities[i.timeline]={time:i.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(let s=0;s<t.discontinuityStarts.length;s++){const n=t.discontinuityStarts[s],a=t.discontinuitySequence+s+1,u=n-e.mediaIndex,c=Math.abs(u);if(!this.discontinuities[a]||this.discontinuities[a].accuracy>c){let m;u<0?m=i.start-as({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:n}):m=i.end+as({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:n}),this.discontinuities[a]={time:m,accuracy:c}}}}dispose(){this.trigger("dispose"),this.off()}}class X0 extends j.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:i}){return typeof t=="number"&&typeof i=="number"&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:i},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:i}){if(typeof t=="number"&&typeof i=="number"){this.lastTimelineChanges_[e]={type:e,from:t,to:i},delete this.pendingTimelineChanges_[e];const s={timelineChangeInfo:{from:t,to:i}};this.trigger({type:"timelinechange",metadata:s})}return this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const K0=Gd(Xd(function(){var r=(function(){function b(){this.listeners={}}var I=b.prototype;return I.on=function(M,N){this.listeners[M]||(this.listeners[M]=[]),this.listeners[M].push(N)},I.off=function(M,N){if(!this.listeners[M])return!1;var O=this.listeners[M].indexOf(N);return this.listeners[M]=this.listeners[M].slice(0),this.listeners[M].splice(O,1),O>-1},I.trigger=function(M){var N=this.listeners[M];if(N)if(arguments.length===2)for(var O=N.length,z=0;z<O;++z)N[z].call(this,arguments[1]);else for(var q=Array.prototype.slice.call(arguments,1),$=N.length,L=0;L<$;++L)N[L].apply(this,q)},I.dispose=function(){this.listeners={}},I.pipe=function(M){this.on("data",function(N){M.push(N)})},b})();/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */function e(b){return b.subarray(0,b.byteLength-b[b.byteLength-1])}/*! @name aes-decrypter @version 4.0.2 @license Apache-2.0 */const t=function(){const b=[[[],[],[],[],[]],[[],[],[],[],[]]],I=b[0],M=b[1],N=I[4],O=M[4];let z,q,$;const L=[],H=[];let v,C,V,U,F,K;for(z=0;z<256;z++)H[(L[z]=z<<1^(z>>7)*283)^z]=z;for(q=$=0;!N[q];q^=v||1,$=H[$]||1)for(U=$^$<<1^$<<2^$<<3^$<<4,U=U>>8^U&255^99,N[q]=U,O[U]=q,V=L[C=L[v=L[q]]],K=V*16843009^C*65537^v*257^q*16843008,F=L[U]*257^U*16843008,z=0;z<4;z++)I[z][q]=F=F<<24^F>>>8,M[z][U]=K=K<<24^K>>>8;for(z=0;z<5;z++)I[z]=I[z].slice(0),M[z]=M[z].slice(0);return b};let i=null;class s{constructor(I){i||(i=t()),this._tables=[[i[0][0].slice(),i[0][1].slice(),i[0][2].slice(),i[0][3].slice(),i[0][4].slice()],[i[1][0].slice(),i[1][1].slice(),i[1][2].slice(),i[1][3].slice(),i[1][4].slice()]];let M,N,O;const z=this._tables[0][4],q=this._tables[1],$=I.length;let L=1;if($!==4&&$!==6&&$!==8)throw new Error("Invalid aes key size");const H=I.slice(0),v=[];for(this._key=[H,v],M=$;M<4*$+28;M++)O=H[M-1],(M%$===0||$===8&&M%$===4)&&(O=z[O>>>24]<<24^z[O>>16&255]<<16^z[O>>8&255]<<8^z[O&255],M%$===0&&(O=O<<8^O>>>24^L<<24,L=L<<1^(L>>7)*283)),H[M]=H[M-$]^O;for(N=0;M;N++,M--)O=H[N&3?M:M-4],M<=4||N<4?v[N]=O:v[N]=q[0][z[O>>>24]]^q[1][z[O>>16&255]]^q[2][z[O>>8&255]]^q[3][z[O&255]]}decrypt(I,M,N,O,z,q){const $=this._key[1];let L=I^$[0],H=O^$[1],v=N^$[2],C=M^$[3],V,U,F;const K=$.length/4-2;let ee,se=4;const Q=this._tables[1],J=Q[0],Z=Q[1],ie=Q[2],te=Q[3],me=Q[4];for(ee=0;ee<K;ee++)V=J[L>>>24]^Z[H>>16&255]^ie[v>>8&255]^te[C&255]^$[se],U=J[H>>>24]^Z[v>>16&255]^ie[C>>8&255]^te[L&255]^$[se+1],F=J[v>>>24]^Z[C>>16&255]^ie[L>>8&255]^te[H&255]^$[se+2],C=J[C>>>24]^Z[L>>16&255]^ie[H>>8&255]^te[v&255]^$[se+3],se+=4,L=V,H=U,v=F;for(ee=0;ee<4;ee++)z[(3&-ee)+q]=me[L>>>24]<<24^me[H>>16&255]<<16^me[v>>8&255]<<8^me[C&255]^$[se++],V=L,L=H,H=v,v=C,C=V}}class n extends r{constructor(){super(r),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(I){this.jobs.push(I),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const a=function(b){return b<<24|(b&65280)<<8|(b&16711680)>>8|b>>>24},u=function(b,I,M){const N=new Int32Array(b.buffer,b.byteOffset,b.byteLength>>2),O=new s(Array.prototype.slice.call(I)),z=new Uint8Array(b.byteLength),q=new Int32Array(z.buffer);let $,L,H,v,C,V,U,F,K;for($=M[0],L=M[1],H=M[2],v=M[3],K=0;K<N.length;K+=4)C=a(N[K]),V=a(N[K+1]),U=a(N[K+2]),F=a(N[K+3]),O.decrypt(C,V,U,F,q,K),q[K]=a(q[K]^$),q[K+1]=a(q[K+1]^L),q[K+2]=a(q[K+2]^H),q[K+3]=a(q[K+3]^v),$=C,L=V,H=U,v=F;return z};class c{constructor(I,M,N,O){const z=c.STEP,q=new Int32Array(I.buffer),$=new Uint8Array(I.byteLength);let L=0;for(this.asyncStream_=new n,this.asyncStream_.push(this.decryptChunk_(q.subarray(L,L+z),M,N,$)),L=z;L<q.length;L+=z)N=new Uint32Array([a(q[L-4]),a(q[L-3]),a(q[L-2]),a(q[L-1])]),this.asyncStream_.push(this.decryptChunk_(q.subarray(L,L+z),M,N,$));this.asyncStream_.push(function(){O(null,e($))})}static get STEP(){return 32e3}decryptChunk_(I,M,N,O){return function(){const z=u(I,M,N);O.set(z,I.byteOffset)}}}var m=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},f;typeof window<"u"?f=window:typeof m<"u"?f=m:typeof self<"u"?f=self:f={};var _=f,P=function(b){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(b):b&&b.buffer instanceof ArrayBuffer},S=_.BigInt||Number;S("0x1"),S("0x100"),S("0x10000"),S("0x1000000"),S("0x100000000"),S("0x10000000000"),S("0x1000000000000"),S("0x100000000000000"),S("0x10000000000000000"),(function(){var b=new Uint16Array([65484]),I=new Uint8Array(b.buffer,b.byteOffset,b.byteLength);return I[0]===255?"big":I[0]===204?"little":"unknown"})();const R=function(b){const I={};return Object.keys(b).forEach(M=>{const N=b[M];P(N)?I[M]={bytes:N.buffer,byteOffset:N.byteOffset,byteLength:N.byteLength}:I[M]=N}),I};self.onmessage=function(b){const I=b.data,M=new Uint8Array(I.encrypted.bytes,I.encrypted.byteOffset,I.encrypted.byteLength),N=new Uint32Array(I.key.bytes,I.key.byteOffset,I.key.byteLength/4),O=new Uint32Array(I.iv.bytes,I.iv.byteOffset,I.iv.byteLength/4);new c(M,N,O,function(z,q){self.postMessage(R({source:I.source,decrypted:q}),[q.buffer])})}}));var Y0=Wd(K0);const Q0=r=>{let e=r.default?"main":"alternative";return r.characteristics&&r.characteristics.indexOf("public.accessibility.describes-video")>=0&&(e="main-desc"),e},lp=(r,e)=>{r.abort(),r.pause(),e&&e.activePlaylistLoader&&(e.activePlaylistLoader.pause(),e.activePlaylistLoader=null)},vo=(r,e)=>{e.activePlaylistLoader=r,r.load()},J0=(r,e)=>()=>{const{segmentLoaders:{[r]:t,main:i},mediaTypes:{[r]:s}}=e,n=s.activeTrack(),a=s.getActiveGroup(),u=s.activePlaylistLoader,c=s.lastGroup_;if(!(a&&c&&a.id===c.id)&&(s.lastGroup_=a,s.lastTrack_=n,lp(t,s),!(!a||a.isMainPlaylist))){if(!a.playlistLoader){u&&i.resetEverything();return}t.resyncLoader(),vo(a.playlistLoader,s)}},Z0=(r,e)=>()=>{const{segmentLoaders:{[r]:t},mediaTypes:{[r]:i}}=e;i.lastGroup_=null,t.abort(),t.pause()},e1=(r,e)=>()=>{const{mainPlaylistLoader:t,segmentLoaders:{[r]:i,main:s},mediaTypes:{[r]:n}}=e,a=n.activeTrack(),u=n.getActiveGroup(),c=n.activePlaylistLoader,m=n.lastTrack_;if(!(m&&a&&m.id===a.id)&&(n.lastGroup_=u,n.lastTrack_=a,lp(i,n),!!u)){if(u.isMainPlaylist){if(!a||!m||a.id===m.id)return;const f=e.vhs.playlistController_,_=f.selectPlaylist();if(f.media()===_)return;n.logger_(`track change. Switching main audio from ${m.id} to ${a.id}`),t.pause(),s.resetEverything(),f.fastQualityChange_(_);return}if(r==="AUDIO"){if(!u.playlistLoader){s.setAudio(!0),s.resetEverything();return}i.setAudio(!0),s.setAudio(!1)}if(c===u.playlistLoader){vo(u.playlistLoader,n);return}i.track&&i.track(a),i.resetEverything(),vo(u.playlistLoader,n)}},kn={AUDIO:(r,e)=>()=>{const{mediaTypes:{[r]:t},excludePlaylist:i}=e,s=t.activeTrack(),n=t.activeGroup(),a=(n.filter(c=>c.default)[0]||n[0]).id,u=t.tracks[a];if(s===u){i({error:{message:"Problem encountered loading the default audio track."}});return}j.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const c in t.tracks)t.tracks[c].enabled=t.tracks[c]===u;t.onTrackChanged()},SUBTITLES:(r,e)=>()=>{const{mediaTypes:{[r]:t}}=e;j.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const i=t.activeTrack();i&&(i.mode="disabled"),t.onTrackChanged()}},xc={AUDIO:(r,e,t)=>{if(!e)return;const{tech:i,requestOptions:s,segmentLoaders:{[r]:n}}=t;e.on("loadedmetadata",()=>{const a=e.media();n.playlist(a,s),(!i.paused()||a.endList&&i.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),s),i.paused()||n.load()}),e.on("error",kn[r](r,t))},SUBTITLES:(r,e,t)=>{const{tech:i,requestOptions:s,segmentLoaders:{[r]:n},mediaTypes:{[r]:a}}=t;e.on("loadedmetadata",()=>{const u=e.media();n.playlist(u,s),n.track(a.activeTrack()),(!i.paused()||u.endList&&i.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),s),i.paused()||n.load()}),e.on("error",kn[r](r,t))}},t1={AUDIO:(r,e)=>{const{vhs:t,sourceType:i,segmentLoaders:{[r]:s},requestOptions:n,main:{mediaGroups:a},mediaTypes:{[r]:{groups:u,tracks:c,logger_:m}},mainPlaylistLoader:f}=e,_=bs(f.main);(!a[r]||Object.keys(a[r]).length===0)&&(a[r]={main:{default:{default:!0}}},_&&(a[r].main.default.playlists=f.main.playlists));for(const P in a[r]){u[P]||(u[P]=[]);for(const S in a[r][P]){let R=a[r][P][S],b;if(_?(m(`AUDIO group '${P}' label '${S}' is a main playlist`),R.isMainPlaylist=!0,b=null):i==="vhs-json"&&R.playlists?b=new rr(R.playlists[0],t,n):R.resolvedUri?b=new rr(R.resolvedUri,t,n):R.playlists&&i==="dash"?b=new go(R.playlists[0],t,n,f):b=null,R=Ce({id:S,playlistLoader:b},R),xc[r](r,R.playlistLoader,e),u[P].push(R),typeof c[S]>"u"){const I=new j.AudioTrack({id:S,kind:Q0(R),enabled:!1,language:R.language,default:R.default,label:S});c[S]=I}}}s.on("error",kn[r](r,e))},SUBTITLES:(r,e)=>{const{tech:t,vhs:i,sourceType:s,segmentLoaders:{[r]:n},requestOptions:a,main:{mediaGroups:u},mediaTypes:{[r]:{groups:c,tracks:m}},mainPlaylistLoader:f}=e;for(const _ in u[r]){c[_]||(c[_]=[]);for(const P in u[r][_]){if(!i.options_.useForcedSubtitles&&u[r][_][P].forced)continue;let S=u[r][_][P],R;if(s==="hls")R=new rr(S.resolvedUri,i,a);else if(s==="dash"){if(!S.playlists.filter(b=>b.excludeUntil!==1/0).length)return;R=new go(S.playlists[0],i,a,f)}else s==="vhs-json"&&(R=new rr(S.playlists?S.playlists[0]:S.resolvedUri,i,a));if(S=Ce({id:P,playlistLoader:R},S),xc[r](r,S.playlistLoader,e),c[_].push(S),typeof m[P]>"u"){const b=t.addRemoteTextTrack({id:P,kind:"subtitles",default:S.default&&S.autoselect,language:S.language,label:P},!1).track;m[P]=b}}}n.on("error",kn[r](r,e))},"CLOSED-CAPTIONS":(r,e)=>{const{tech:t,main:{mediaGroups:i},mediaTypes:{[r]:{groups:s,tracks:n}}}=e;for(const a in i[r]){s[a]||(s[a]=[]);for(const u in i[r][a]){const c=i[r][a][u];if(!/^(?:CC|SERVICE)/.test(c.instreamId))continue;const m=t.options_.vhs&&t.options_.vhs.captionServices||{};let f={label:u,language:c.language,instreamId:c.instreamId,default:c.default&&c.autoselect};if(m[f.instreamId]&&(f=Ce(f,m[f.instreamId])),f.default===void 0&&delete f.default,s[a].push(Ce({id:u},c)),typeof n[u]>"u"){const _=t.addRemoteTextTrack({id:f.instreamId,kind:"captions",default:f.default,language:f.language,label:f.label},!1).track;n[u]=_}}}}},cp=(r,e)=>{for(let t=0;t<r.length;t++)if(ru(e,r[t])||r[t].playlists&&cp(r[t].playlists,e))return!0;return!1},i1=(r,e)=>t=>{const{mainPlaylistLoader:i,mediaTypes:{[r]:{groups:s}}}=e,n=i.media();if(!n)return null;let a=null;n.attributes[r]&&(a=s[n.attributes[r]]);const u=Object.keys(s);if(!a)if(r==="AUDIO"&&u.length>1&&bs(e.main))for(let c=0;c<u.length;c++){const m=s[u[c]];if(cp(m,n)){a=m;break}}else s.main?a=s.main:u.length===1&&(a=s[u[0]]);return typeof t>"u"?a:t===null||!a?null:a.filter(c=>c.id===t.id)[0]||null},r1={AUDIO:(r,e)=>()=>{const{mediaTypes:{[r]:{tracks:t}}}=e;for(const i in t)if(t[i].enabled)return t[i];return null},SUBTITLES:(r,e)=>()=>{const{mediaTypes:{[r]:{tracks:t}}}=e;for(const i in t)if(t[i].mode==="showing"||t[i].mode==="hidden")return t[i];return null}},s1=(r,{mediaTypes:e})=>()=>{const t=e[r].activeTrack();return t?e[r].activeGroup(t):null},n1=r=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(m=>{t1[m](m,r)});const{mediaTypes:e,mainPlaylistLoader:t,tech:i,vhs:s,segmentLoaders:{["AUDIO"]:n,main:a}}=r;["AUDIO","SUBTITLES"].forEach(m=>{e[m].activeGroup=i1(m,r),e[m].activeTrack=r1[m](m,r),e[m].onGroupChanged=J0(m,r),e[m].onGroupChanging=Z0(m,r),e[m].onTrackChanged=e1(m,r),e[m].getActiveGroup=s1(m,r)});const u=e.AUDIO.activeGroup();if(u){const m=(u.filter(f=>f.default)[0]||u[0]).id;e.AUDIO.tracks[m].enabled=!0,e.AUDIO.onGroupChanged(),e.AUDIO.onTrackChanged(),e.AUDIO.getActiveGroup().playlistLoader?(a.setAudio(!1),n.setAudio(!0)):a.setAudio(!0)}t.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(m=>e[m].onGroupChanged())}),t.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(m=>e[m].onGroupChanging())});const c=()=>{e.AUDIO.onTrackChanged(),i.trigger({type:"usage",name:"vhs-audio-change"})};i.audioTracks().addEventListener("change",c),i.remoteTextTracks().addEventListener("change",e.SUBTITLES.onTrackChanged),s.on("dispose",()=>{i.audioTracks().removeEventListener("change",c),i.remoteTextTracks().removeEventListener("change",e.SUBTITLES.onTrackChanged)}),i.clearTracks("audio");for(const m in e.AUDIO.tracks)i.audioTracks().addTrack(e.AUDIO.tracks[m])},a1=()=>{const r={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{r[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:ri,activeTrack:ri,getActiveGroup:ri,onGroupChanged:ri,onTrackChanged:ri,lastTrack_:null,logger_:Pt(`MediaGroups[${e}]`)}}),r};class Dc{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){e===1&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=pt(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map(t=>[t.ID,t])))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class o1 extends j.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new Dc,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=Pt("Content Steering"),this.xhr_=e,this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?"HLS":"DASH";const i=t.serverUri||t.serverURL;if(!i){this.logger_(`steering manifest URL is ${i}, cannot request steering manifest.`),this.trigger("error");return}if(i.startsWith("data:")){this.decodeDataUriManifest_(i.substring(i.indexOf(",")+1));return}this.steeringManifest.reloadUri=pt(e,i),this.defaultPathway=t.pathwayId||t.defaultServiceLocation,this.queryBeforeStart=t.queryBeforeStart,this.proxyServerUrl_=t.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering")}requestSteeringManifest(e){const t=this.steeringManifest.reloadUri;if(!t)return;const i=e?t:this.getRequestURI(t);if(!i){this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),this.dispose();return}const s={contentSteeringInfo:{uri:i}};this.trigger({type:"contentsteeringloadstart",metadata:s}),this.request_=this.xhr_({uri:i,requestType:"content-steering-manifest"},(n,a)=>{if(n){if(a.status===410){this.logger_(`manifest request 410 ${n}.`),this.logger_(`There will be no more content steering requests to ${i} this session.`),this.excludedSteeringManifestURLs.add(i);return}if(a.status===429){const m=a.responseHeaders["retry-after"];this.logger_(`manifest request 429 ${n}.`),this.logger_(`content steering will retry in ${m} seconds.`),this.startTTLTimeout_(parseInt(m,10));return}this.logger_(`manifest failed to load ${n}.`),this.startTTLTimeout_();return}this.trigger({type:"contentsteeringloadcomplete",metadata:s});let u;try{u=JSON.parse(this.request_.responseText)}catch(m){const f={errorType:j.Error.StreamingContentSteeringParserError,error:m};this.trigger({type:"error",metadata:f})}this.assignSteeringProperties_(u);const c={contentSteeringInfo:s.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:c}),this.startTTLTimeout_()})}setProxyServerUrl_(e){const t=new A.URL(e),i=new A.URL(this.proxyServerUrl_);return i.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(i.toString())}decodeDataUriManifest_(e){const t=JSON.parse(A.atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){const t=new A.URL(e),i=this.getPathway(),s=this.getBandwidth_();if(i){const n=`_${this.manifestType_}_pathway`;t.searchParams.set(n,i)}if(s){const n=`_${this.manifestType_}_throughput`;t.searchParams.set(n,s)}return t.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version){this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),this.trigger("error");return}this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e["RELOAD-URI"],this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=e["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose());const t=(i=>{for(const s of i)if(this.availablePathways_.has(s))return s;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==t&&(this.currentPathway=t,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;const t=s=>this.excludedSteeringManifestURLs.has(s);if(this.proxyServerUrl_){const s=this.setProxyServerUrl_(e);if(!t(s))return s}const i=this.setSteeringParams_(e);return t(i)?null:i}startTTLTimeout_(e=this.steeringManifest.ttl){const t=e*1e3;this.ttlTimeout_=A.setTimeout(()=>{this.requestSteeringManifest()},t)}clearTTLTimeout_(){A.clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new Dc}addAvailablePathway(e){e&&this.availablePathways_.add(e)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,t){return!t&&this.steeringManifest.reloadUri||t&&(pt(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const u1=(r,e)=>{let t=null;return(...i)=>{clearTimeout(t),t=setTimeout(()=>{r.apply(null,i)},e)}},l1=10;let _i;const c1=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],h1=function(r){return this.audioSegmentLoader_[r]+this.mainSegmentLoader_[r]},d1=function({currentPlaylist:r,buffered:e,currentTime:t,nextPlaylist:i,bufferLowWaterLine:s,bufferHighWaterLine:n,duration:a,bufferBasedABR:u,log:c}){if(!i)return j.log.warn("We received no playlist to switch to. Please check your stream."),!1;const m=`allowing switch ${r&&r.id||"null"} -> ${i.id}`;if(!r)return c(`${m} as current playlist is not set`),!0;if(i.id===r.id)return!1;const f=!!ir(e,t).length;if(!r.endList)return!f&&typeof r.partTargetDuration=="number"?(c(`not ${m} as current playlist is live llhls, but currentTime isn't in buffered.`),!1):(c(`${m} as current playlist is live`),!0);const _=eu(e,t),P=u?Ge.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Ge.MAX_BUFFER_LOW_WATER_LINE;if(a<P)return c(`${m} as duration < max low water line (${a} < ${P})`),!0;const S=i.attributes.BANDWIDTH,R=r.attributes.BANDWIDTH;if(S<R&&(!u||_<n)){let b=`${m} as next bandwidth < current bandwidth (${S} < ${R})`;return u&&(b+=` and forwardBuffer < bufferHighWaterLine (${_} < ${n})`),c(b),!0}if((!u||S>R)&&_>=s){let b=`${m} as forwardBuffer >= bufferLowWaterLine (${_} >= ${s})`;return u&&(b+=` and next bandwidth > current bandwidth (${S} > ${R})`),c(b),!0}return c(`not ${m} as no switching criteria met`),!1};class p1 extends j.EventTarget{constructor(e){super(),this.fastQualityChange_=u1(this.fastQualityChange_.bind(this),100);const{src:t,withCredentials:i,tech:s,bandwidth:n,externVhs:a,useCueTags:u,playlistExclusionDuration:c,enableLowInitialPlaylist:m,sourceType:f,cacheEncryptionKeys:_,bufferBasedABR:P,leastPixelDiffSelector:S,captionServices:R,experimentalUseMMS:b}=e;if(!t)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:I}=e;(I===null||typeof I>"u")&&(I=1/0),_i=a,this.bufferBasedABR=!!P,this.leastPixelDiffSelector=!!S,this.withCredentials=i,this.tech_=s,this.vhs_=s.vhs,this.player_=e.player_,this.sourceType_=f,this.useCueTags_=u,this.playlistExclusionDuration=c,this.maxPlaylistRetries=I,this.enableLowInitialPlaylist=m,this.usingManagedMediaSource_=!1,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:i,maxPlaylistRetries:I,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=a1(),b&&A.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new A.ManagedMediaSource,this.usingManagedMediaSource_=!0,j.log("Using ManagedMediaSource")):A.MediaSource&&(this.mediaSource=new A.MediaSource),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.load=this.load.bind(this),this.pause=this.pause.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.mediaSource.addEventListener("startstreaming",this.load),this.mediaSource.addEventListener("endstreaming",this.pause),this.seekable_=rt(),this.hasPlayed_=!1,this.syncController_=new G0(e),this.segmentMetadataTrack_=s.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.segmentMetadataTrack_.mode="hidden",this.decrypter_=new Y0,this.sourceUpdater_=new op(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new X0,this.keyStatusMap_=new Map;const M={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:R,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:n,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:_,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new go(t,this.vhs_,Ce(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new rr(t,this.vhs_,Ce(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new _o(Ce(M,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new _o(Ce(M,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new $0(Ce(M,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((z,q)=>{function $(){s.off("vttjserror",L),z()}function L(){s.off("vttjsloaded",$),q()}s.one("vttjsloaded",$),s.one("vttjserror",L),s.addWebVttScript_()})}),e);const N=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new o1(this.vhs_.xhr,N),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),c1.forEach(z=>{this[z+"_"]=h1.bind(this,z)}),this.logger_=Pt("pc"),this.triggeredFmp4Usage=!1,this.tech_.preload()==="none"?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const O=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(O,()=>{const z=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-z,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return e===-1||t===-1?-1:e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}switchMedia_(e,t,i){const s=this.media(),n=s&&(s.id||s.uri),a=e&&(e.id||e.uri);if(n&&n!==a){this.logger_(`switch media ${n} -> ${a} from ${t}`);const u={renditionInfo:{id:a,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS},cause:t};this.trigger({type:"renditionselected",metadata:u}),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})}this.mainPlaylistLoader_.media(e,i)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{const t=this.mediaTypes_[e],i=t?t.activeGroup():null,s=this.contentSteeringController_.getPathway();if(i&&s){const n=(i.length?i[0].playlists:i.playlists).filter(a=>a.attributes.serviceLocation===s);n.length&&this.mediaTypes_[e].activePlaylistLoader.media(n[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=A.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(A.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const e=this.main(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;const i=e.mediaGroups.AUDIO,s=Object.keys(i);let n;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)n=this.mediaTypes_.AUDIO.activeTrack();else{const u=i.main||s.length&&i[s[0]];for(const c in u)if(u[c].default){n={label:c};break}}if(!n)return t;const a=[];for(const u in i)if(i[u][n.label]){const c=i[u][n.label];if(c.playlists&&c.playlists.length)a.push.apply(a,c.playlists);else if(c.uri)a.push(c);else if(e.playlists.length)for(let m=0;m<e.playlists.length;m++){const f=e.playlists[m];f.attributes&&f.attributes.AUDIO&&f.attributes.AUDIO===u&&a.push(f)}}return a.length?a:t}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",()=>{const e=this.mainPlaylistLoader_.media(),t=e.targetDuration*1.5*1e3;lo(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,e.endList&&this.tech_.preload()!=="none"&&(this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.mainSegmentLoader_.load()),n1({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),e),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}),this.mainPlaylistLoader_.on("loadedplaylist",()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let e=this.mainPlaylistLoader_.media();if(!e){this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_();let t;if(this.enableLowInitialPlaylist&&(t=this.selectInitialPlaylist()),t||(t=this.selectPlaylist()),!t||!this.shouldSwitchToMedia_(t)||(this.initialMedia_=t,this.switchMedia_(this.initialMedia_,"initial"),!(this.sourceType_==="vhs-json"&&this.initialMedia_.segments)))return;e=this.initialMedia_}this.handleUpdatedMediaPlaylist(e)}),this.mainPlaylistLoader_.on("error",()=>{const e=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:e.playlist,error:e})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{const e=this.mainPlaylistLoader_.media(),t=e.targetDuration*1.5*1e3;lo(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,this.sourceType_==="dash"&&this.mainPlaylistLoader_.isPaused&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{const e=this.mainPlaylistLoader_.media();e.lastExcludeReason_!=="playlist-unchanged"&&this.stuckAtPlaylistEnd_(e)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))}),this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}),this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})}),["manifestrequeststart","manifestrequestcomplete","manifestparsestart","manifestparsecomplete","playlistrequeststart","playlistrequestcomplete","playlistparsestart","playlistparsecomplete","renditiondisabled","renditionenabled"].forEach(e=>{this.mainPlaylistLoader_.on(e,t=>{this.player_.trigger(qe({},t))})})}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,t){const i=e.mediaGroups||{};let s=!0;const n=Object.keys(i.AUDIO);for(const a in i.AUDIO)for(const u in i.AUDIO[a])i.AUDIO[a][u].uri||(s=!1);s&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(i.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),_i.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),n.length&&Object.keys(i.AUDIO[n[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){const t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,i=this.tech_.currentTime(),s=this.bufferLowWaterLine(),n=this.bufferHighWaterLine(),a=this.tech_.buffered();return d1({buffered:a,currentTime:i,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:s,bufferHighWaterLine:n,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")}),this.mainSegmentLoader_.on("error",()=>{const t=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:t.playlist,error:t})}),this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended"),this.onEndOfStream()}),this.timelineChangeController_.on("audioTimelineBehind",()=>{const t=this.audioSegmentLoader_.pendingSegment_;if(!t||!t.segment||!t.segment.syncInfo)return;const i=t.segment.syncInfo.end+.01;this.tech_.setCurrentTime(i)}),this.timelineChangeController_.on("fixBadTimelineChange",()=>{this.logger_("Fix bad timeline change. Restarting al segment loaders..."),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}),this.mainSegmentLoader_.on("earlyabort",t=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:l1}))});const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const t=this.getCodecsOrExclude_();t&&this.sourceUpdater_.addOrChangeSourceBuffers(t)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()}),["segmentselected","segmentloadstart","segmentloaded","segmentkeyloadstart","segmentkeyloadcomplete","segmentdecryptionstart","segmentdecryptioncomplete","segmenttransmuxingstart","segmenttransmuxingcomplete","segmenttransmuxingtrackinfoavailable","segmenttransmuxingtiminginfoavailable","segmentappendstart","appendsdone","bandwidthupdated","timelinechange","codecschange"].forEach(t=>{this.mainSegmentLoader_.on(t,i=>{this.player_.trigger(qe({},i))}),this.audioSegmentLoader_.on(t,i=>{this.player_.trigger(qe({},i))}),this.subtitleSegmentLoader_.on(t,i=>{this.player_.trigger(qe({},i))})})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}pause(){this.mainSegmentLoader_.pause(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.pause(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.pause()}fastQualityChange_(e=this.selectPlaylist()){if(e&&e===this.mainPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(e,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const e=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0))return this.tech_.setCurrentTime(e.end(e.length-1))}setupFirstPlay(){const e=this.mainPlaylistLoader_.media();if(!e||this.tech_.paused()||this.hasPlayed_)return!1;if(!e.endList||e.start){const t=this.seekable();if(!t.length)return!1;const i=t.end(0);let s=i;if(e.start){const n=e.start.timeOffset;n<0?s=Math.max(i+n,t.start(0)):s=Math.min(i,n)}this.trigger("firstplay"),this.tech_.setCurrentTime(s)}return this.hasPlayed_=!0,this.load(),!0}handleSourceOpen_(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){const e=this.tech_.play();typeof e<"u"&&typeof e.then=="function"&&e.then(null,t=>{})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;const t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const t=this.mainSegmentLoader_.getCurrentMediaInfo_();!t||t.hasVideo?e=e&&this.audioSegmentLoader_.ended_:e=this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;const t=this.syncController_.getExpiredTime(e,this.duration());if(t===null)return!1;const i=_i.Playlist.playlistEnd(e,t),s=this.tech_.currentTime(),n=this.tech_.buffered();if(!n.length)return i-s<=Gt;const a=n.end(n.length-1);return a-s<=Gt&&i-a<=Gt}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:i}){if(e=e||this.mainPlaylistLoader_.media(),i=i||t.playlistExclusionDuration||this.playlistExclusionDuration,!e){this.error=t,this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}e.playlistErrors_++;const s=this.mainPlaylistLoader_.main.playlists,n=s.filter(Kn),a=n.length===1&&n[0]===e;if(s.length===1&&i!==1/0)return j.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(a);if(a){if(this.main().contentSteering){const R=this.pathwayAttribute_(e),b=this.contentSteeringController_.steeringManifest.ttl*1e3;this.contentSteeringController_.excludePathway(R),this.excludeThenChangePathway_(),setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(R)},b);return}let S=!1;s.forEach(R=>{if(R===e)return;const b=R.excludeUntil;typeof b<"u"&&b!==1/0&&(S=!0,delete R.excludeUntil)}),S&&(j.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let u;e.playlistErrors_>this.maxPlaylistRetries?u=1/0:u=Date.now()+i*1e3,e.excludeUntil=u,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const c=this.selectPlaylist();if(!c){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}const m=t.internal?this.logger_:j.log.warn,f=t.message?" "+t.message:"";m(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${f} Switching to playlist ${c.id}.`),c.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),c.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const _=c.targetDuration/2*1e3||5*1e3,P=typeof c.lastRequest=="number"&&Date.now()-c.lastRequest<=_;return this.switchMedia_(c,"exclude",a||P)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,t){const i=[],s=e==="all";(s||e==="main")&&i.push(this.mainPlaylistLoader_);const n=[];(s||e==="audio")&&n.push("AUDIO"),(s||e==="subtitle")&&(n.push("CLOSED-CAPTIONS"),n.push("SUBTITLES")),n.forEach(a=>{const u=this.mediaTypes_[a]&&this.mediaTypes_[a].activePlaylistLoader;u&&i.push(u)}),["main","audio","subtitle"].forEach(a=>{const u=this[`${a}SegmentLoader_`];u&&(e===a||e==="all")&&i.push(u)}),i.forEach(a=>t.forEach(u=>{typeof a[u]=="function"&&a[u]()}))}setCurrentTime(e){const t=ir(this.tech_.buffered(),e);if(!(this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media())||!this.mainPlaylistLoader_.media().segments)return 0;if(t&&t.length)return e;this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}duration(){if(!this.mainPlaylistLoader_)return 0;const e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:_i.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}getSeekableRange_(e,t){const i=e.media();if(!i)return null;const s=this.syncController_.getMediaSequenceSync(t);if(s&&s.isReliable){const u=s.start,c=s.end;if(!isFinite(u)||!isFinite(c))return null;const m=_i.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,i),f=Math.max(u,c-m);return rt([[u,f]])}const n=this.syncController_.getExpiredTime(i,this.duration());if(n===null)return null;const a=_i.Playlist.seekable(i,n,_i.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,i));return a.length?a:null}computeFinalSeekable_(e,t){if(!t)return e;const i=e.start(0),s=e.end(0),n=t.start(0),a=t.end(0);return n>s||i>a?e:rt([[Math.max(i,n),Math.min(s,a)]])}onSyncInfoUpdate_(){if(!this.mainPlaylistLoader_)return;const e=this.getSeekableRange_(this.mainPlaylistLoader_,"main");if(!e)return;let t;if(this.mediaTypes_.AUDIO.activePlaylistLoader&&(t=this.getSeekableRange_(this.mediaTypes_.AUDIO.activePlaylistLoader,"audio"),!t))return;const i=this.seekable_;if(this.seekable_=this.computeFinalSeekable_(e,t),!this.seekable_||i&&i.length&&this.seekable_.length&&i.start(0)===this.seekable_.start(0)&&i.end(0)===this.seekable_.end(0))return;this.logger_(`seekable updated [${vd(this.seekable_)}]`);const s={seekableRanges:this.seekable_};this.trigger({type:"seekablerangeschanged",metadata:s}),this.tech_.trigger("seekablechanged")}updateDuration(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),this.mediaSource.readyState!=="open"){this.updateDuration_=this.updateDuration.bind(this,e),this.mediaSource.addEventListener("sourceopen",this.updateDuration_);return}if(e){const s=this.seekable();if(!s.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration<s.end(s.length-1))&&this.sourceUpdater_.setDuration(s.end(s.length-1));return}const t=this.tech_.buffered();let i=_i.Playlist.duration(this.mainPlaylistLoader_.media());t.length>0&&(i=Math.max(i,t.end(t.length-1))),this.mediaSource.duration!==i&&this.sourceUpdater_.setDuration(i)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(e=>{const t=this.mediaTypes_[e].groups;for(const i in t)t[i].forEach(s=>{s.playlistLoader&&s.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),i=e?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!t||!i)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const i=os(this.main(),t),s={},n=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(s.video=i.video||e.main.videoCodec||ef),e.main.isMuxed&&(s.video+=`,${i.audio||e.main.audioCodec||yl}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||n)&&(s.audio=i.audio||e.main.audioCodec||e.audio.audioCodec||yl,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!s.audio&&!s.video){this.excludePlaylist({playlistToExclude:t,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});return}const a=(m,f)=>m?is(f,this.usingManagedMediaSource_):Ea(f),u={};let c;if(["video","audio"].forEach(function(m){if(s.hasOwnProperty(m)&&!a(e[m].isFmp4,s[m])){const f=e[m].isFmp4?"browser":"muxer";u[f]=u[f]||[],u[f].push(s[m]),m==="audio"&&(c=f)}}),n&&c&&t.attributes.AUDIO){const m=t.attributes.AUDIO;this.main().playlists.forEach(f=>{(f.attributes&&f.attributes.AUDIO)===m&&f!==t&&(f.excludeUntil=1/0)}),this.logger_(`excluding audio group ${m} as ${c} does not support codec(s): "${s.audio}"`)}if(Object.keys(u).length){const m=Object.keys(u).reduce((f,_)=>(f&&(f+=", "),f+=`${_} does not support codec(s): "${u[_].join(",")}"`,f),"")+".";this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:m},playlistExclusionDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const m=[];if(["video","audio"].forEach(f=>{const _=(Ht(this.sourceUpdater_.codecs[f]||"")[0]||{}).type,P=(Ht(s[f]||"")[0]||{}).type;_&&P&&_.toLowerCase()!==P.toLowerCase()&&m.push(`"${this.sourceUpdater_.codecs[f]}" -> "${s[f]}"`)}),m.length){this.excludePlaylist({playlistToExclude:t,error:{message:`Codec switching not supported: ${m.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0});return}}return s}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers()||!this.areMediaTypesKnown_())return;const e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);const t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){const e=this.main().playlists,t=[];Object.keys(e).forEach(i=>{const s=e[i];if(t.indexOf(s.id)!==-1)return;t.push(s.id);const n=os(this.main,s),a=[];n.audio&&!Ea(n.audio)&&!is(n.audio,this.usingManagedMediaSource_)&&a.push(`audio codec ${n.audio}`),n.video&&!Ea(n.video)&&!is(n.video,this.usingManagedMediaSource_)&&a.push(`video codec ${n.video}`),n.text&&n.text==="stpp.ttml.im1t"&&a.push(`text codec ${n.text}`),a.length&&(s.excludeUntil=1/0,this.logger_(`excluding ${s.id} for unsupported: ${a.join(", ")}`))})}excludeIncompatibleVariants_(e){const t=[],i=this.main().playlists,s=ds(Ht(e)),n=hc(s),a=s.video&&Ht(s.video)[0]||null,u=s.audio&&Ht(s.audio)[0]||null;Object.keys(i).forEach(c=>{const m=i[c];if(t.indexOf(m.id)!==-1||m.excludeUntil===1/0)return;t.push(m.id);const f=[],_=os(this.mainPlaylistLoader_.main,m),P=hc(_);if(!(!_.audio&&!_.video)){if(P!==n&&f.push(`codec count "${P}" !== "${n}"`),!this.sourceUpdater_.canChangeType()){const S=_.video&&Ht(_.video)[0]||null,R=_.audio&&Ht(_.audio)[0]||null;S&&a&&S.type.toLowerCase()!==a.type.toLowerCase()&&f.push(`video codec "${S.type}" !== "${a.type}"`),R&&u&&R.type.toLowerCase()!==u.type.toLowerCase()&&f.push(`audio codec "${R.type}" !== "${u.type}"`)}f.length&&(m.excludeUntil=1/0,this.logger_(`excluding ${m.id}: ${f.join(" && ")}`))}})}updateAdCues_(e){let t=0;const i=this.seekable();i.length&&(t=i.start(0)),V0(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime(),t=Ge.GOAL_BUFFER_LENGTH,i=Ge.GOAL_BUFFER_LENGTH_RATE,s=Math.max(t,Ge.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,s)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=Ge.BUFFER_LOW_WATER_LINE,i=Ge.BUFFER_LOW_WATER_LINE_RATE,s=Math.max(t,Ge.MAX_BUFFER_LOW_WATER_LINE),n=Math.max(t,Ge.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,this.bufferBasedABR?n:s)}bufferHighWaterLine(){return Ge.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){bc(this.inbandTextTracks_,"com.apple.streaming",this.tech_),E0({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,i){const s=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();bc(this.inbandTextTracks_,e,this.tech_),v0({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:s,videoDuration:i})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){const e=this.main();if(e.contentSteering){for(const t of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(t));if(this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart){this.contentSteeringController_.requestSteeringManifest(!0);return}this.tech_.one("canplay",()=>{this.contentSteeringController_.requestSteeringManifest()})}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),["contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(e=>{this.contentSteeringController_.on(e,t=>{this.trigger(qe({},t))})}),this.sourceType_==="dash"&&this.mainPlaylistLoader_.on("loadedplaylist",()=>{const e=this.main();(this.contentSteeringController_.didDASHTagChange(e.uri,e.contentSteering)||(()=>{const t=this.contentSteeringController_.getAvailablePathways(),i=[];for(const s of e.playlists){const n=s.attributes.serviceLocation;if(n&&(i.push(n),!t.has(n)))return!0}return!!(!i.length&&t.size)})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){const e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();const t=this.main().playlists,i=new Set;let s=!1;Object.keys(t).forEach(n=>{const a=t[n],u=this.pathwayAttribute_(a),c=u&&e!==u;a.excludeUntil===1/0&&a.lastExcludeReason_==="content-steering"&&!c&&(delete a.excludeUntil,delete a.lastExcludeReason_,s=!0);const m=!a.excludeUntil&&a.excludeUntil!==1/0;!i.has(a.id)&&c&&m&&(i.add(a.id),a.excludeUntil=1/0,a.lastExcludeReason_="content-steering",this.logger_(`excluding ${a.id} for ${a.lastExcludeReason_}`))}),this.contentSteeringController_.manifestType_==="DASH"&&Object.keys(this.mediaTypes_).forEach(n=>{const a=this.mediaTypes_[n];if(a.activePlaylistLoader){const u=a.activePlaylistLoader.media_;u&&u.attributes.serviceLocation!==e&&(s=!0)}}),s&&this.changeSegmentPathway_()}handlePathwayClones_(){const e=this.main().playlists,t=this.contentSteeringController_.currentPathwayClones,i=this.contentSteeringController_.nextPathwayClones;if(t&&t.size||i&&i.size){for(const[s,n]of t.entries())i.get(s)||(this.mainPlaylistLoader_.updateOrDeleteClone(n),this.contentSteeringController_.excludePathway(s));for(const[s,n]of i.entries()){const a=t.get(s);if(!a){e.filter(u=>u.attributes["PATHWAY-ID"]===n["BASE-ID"]).forEach(u=>{this.mainPlaylistLoader_.addClonePathway(n,u)}),this.contentSteeringController_.addAvailablePathway(s);continue}this.equalPathwayClones_(a,n)||(this.mainPlaylistLoader_.updateOrDeleteClone(n,!0),this.contentSteeringController_.addAvailablePathway(s))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...i])))}}equalPathwayClones_(e,t){if(e["BASE-ID"]!==t["BASE-ID"]||e.ID!==t.ID||e["URI-REPLACEMENT"].HOST!==t["URI-REPLACEMENT"].HOST)return!1;const i=e["URI-REPLACEMENT"].PARAMS,s=t["URI-REPLACEMENT"].PARAMS;for(const n in i)if(i[n]!==s[n])return!1;for(const n in s)if(i[n]!==s[n])return!1;return!0}changeSegmentPathway_(){const e=this.selectPlaylist();this.pauseLoading(),this.contentSteeringController_.manifestType_==="DASH"&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let e=0;const t="non-usable";this.mainPlaylistLoader_.main.playlists.forEach(i=>{const s=this.mainPlaylistLoader_.getKeyIdSet(i);!s||!s.size||s.forEach(n=>{const a="usable",u=this.keyStatusMap_.has(n)&&this.keyStatusMap_.get(n)===a,c=i.lastExcludeReason_===t&&i.excludeUntil===1/0;u?u&&c&&(delete i.excludeUntil,delete i.lastExcludeReason_,this.logger_(`enabling playlist ${i.id} because key ID ${n} is ${a}`)):(i.excludeUntil!==1/0&&i.lastExcludeReason_!==t&&(i.excludeUntil=1/0,i.lastExcludeReason_=t,this.logger_(`excluding playlist ${i.id} because the key ID ${n} doesn't exist in the keyStatusMap or is not ${a}`)),e++)})}),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(i=>{const s=i&&i.attributes&&i.attributes.RESOLUTION&&i.attributes.RESOLUTION.height<720,n=i.excludeUntil===1/0&&i.lastExcludeReason_===t;s&&n&&(delete i.excludeUntil,j.log.warn(`enabling non-HD playlist ${i.id} because all playlists were excluded due to ${t} key IDs`))})}addKeyStatus_(e,t){const i=(typeof e=="string"?e:j0(e)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${t}' with key ID ${i} added to the keyStatusMap`),this.keyStatusMap_.set(i,t)}updatePlaylistByKeyStatus(e,t){this.addKeyStatus_(e,t),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}const m1=(r,e,t)=>i=>{const s=r.main.playlists[e],n=iu(s),a=Kn(s);if(typeof i>"u")return a;i?delete s.disabled:s.disabled=!0;const u={renditionInfo:{id:e,bandwidth:s.attributes.BANDWIDTH,resolution:s.attributes.RESOLUTION,codecs:s.attributes.CODECS},cause:"fast-quality"};return i!==a&&!n&&(i?(t(s),r.trigger({type:"renditionenabled",metadata:u})):r.trigger({type:"renditiondisabled",metadata:u})),i};class g1{constructor(e,t,i){const{playlistController_:s}=e,n=s.fastQualityChange_.bind(s);if(t.attributes){const a=t.attributes.RESOLUTION;this.width=a&&a.width,this.height=a&&a.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}this.codecs=os(s.main(),t),this.playlist=t,this.id=i,this.enabled=m1(e.playlists,t.id,n)}}const f1=function(r){r.representations=()=>{const e=r.playlistController_.main(),t=bs(e)?r.playlistController_.getAudioTrackPlaylists_():e.playlists;return t?t.filter(i=>!iu(i)).map((i,s)=>new g1(r,i,i.id)):[]}},Ic=["seeking","seeked","pause","playing","error"];class y1 extends j.EventTarget{constructor(e){super(),this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.playedRanges_=[],this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=Pt("PlaybackWatcher"),this.logger_("initialize");const t=()=>this.monitorCurrentTime_(),i=()=>this.monitorCurrentTime_(),s=()=>this.techWaiting_(),n=()=>this.resetTimeUpdate_(),a=this.playlistController_,u=["main","subtitle","audio"],c={};u.forEach(f=>{c[f]={reset:()=>this.resetSegmentDownloads_(f),updateend:()=>this.checkSegmentDownloads_(f)},a[`${f}SegmentLoader_`].on("appendsdone",c[f].updateend),a[`${f}SegmentLoader_`].on("playlistupdate",c[f].reset),this.tech_.on(["seeked","seeking"],c[f].reset)});const m=f=>{["main","audio"].forEach(_=>{a[`${_}SegmentLoader_`][f]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),m("off"))},this.clearSeekingAppendCheck_=()=>m("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),m("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",s),this.tech_.on(Ic,n),this.tech_.on("canplay",i),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",s),this.tech_.off(Ic,n),this.tech_.off("canplay",i),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),u.forEach(f=>{a[`${f}SegmentLoader_`].off("appendsdone",c[f].updateend),a[`${f}SegmentLoader_`].off("playlistupdate",c[f].reset),this.tech_.off(["seeked","seeking"],c[f].reset)}),this.checkCurrentTimeTimeout_&&A.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&A.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=A.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const t=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=t.buffered_()}checkSegmentDownloads_(e){const t=this.playlistController_,i=t[`${e}SegmentLoader_`],s=i.buffered_(),n=i2(this[`${e}Buffered_`],s);if(this[`${e}Buffered_`]=s,n){const a={bufferedRanges:s};t.trigger({type:"bufferedrangeschanged",metadata:a}),this.resetSegmentDownloads_(e);return}this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:i.playlist_&&i.playlist_.id,buffered:Fi(s)}),!(this[`${e}StalledDownloads_`]<10)&&(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),e!=="subtitle"&&t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0}))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+Gt>=t.end(t.length-1)))return this.techWaiting_();if(this.consecutiveUpdates>=5&&e===this.lastRecordedTime)this.consecutiveUpdates++,this.waiting_();else if(e===this.lastRecordedTime)this.consecutiveUpdates++;else{this.playedRanges_.push(rt([this.lastRecordedTime,e]));const i={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:i}),this.consecutiveUpdates=0,this.lastRecordedTime=e}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const e=this.seekable(),t=this.tech_.currentTime(),i=this.afterSeekableWindow_(e,t,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let s;if(i&&(s=e.end(e.length-1)),this.beforeSeekableWindow_(e,t)){const S=e.start(0);s=S+(S===e.end(0)?0:Gt)}if(typeof s<"u")return this.logger_(`Trying to seek outside of seekable at time ${t} with seekable range ${vd(e)}. Seeking to ${s}.`),this.tech_.setCurrentTime(s),!0;const n=this.playlistController_.sourceUpdater_,a=this.tech_.buffered(),u=n.audioBuffer?n.audioBuffered():null,c=n.videoBuffer?n.videoBuffered():null,m=this.media(),f=m.partTargetDuration?m.partTargetDuration:(m.targetDuration-Wt)*2,_=[u,c];for(let S=0;S<_.length;S++)if(_[S]&&eu(_[S],t)<f)return!1;const P=en(a,t);return P.length===0?!1:(s=P.start(0)+Gt,this.logger_(`Buffered region starts (${P.start(0)}) just beyond seek point (${t}). Seeking to ${s}.`),this.tech_.setCurrentTime(s),!0)}waiting_(){if(this.techWaiting_())return;const e=this.tech_.currentTime(),t=this.tech_.buffered(),i=ir(t,e);if(i.length&&e+3<=i.end(0)){this.resetTimeUpdate_(),this.tech_.setCurrentTime(e),this.logger_(`Stopped at ${e} while inside a buffered region [${i.start(0)} -> ${i.end(0)}]. Attempting to resume playback by seeking to the current time.`),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"});return}}techWaiting_(){const e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,t)){const a=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) ${a}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(a),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const i=this.tech_.vhs.playlistController_.sourceUpdater_,s=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:i.audioBuffered(),videoBuffered:i.videoBuffered(),currentTime:t}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const n=en(s,t);return n.length>0?(this.logger_(`Stopped at ${t} and seeking to ${n.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0):!1}afterSeekableWindow_(e,t,i,s=!1){if(!e.length)return!1;let n=e.end(e.length-1)+Gt;const a=!i.endList,u=typeof i.partTargetDuration=="number";return a&&(u||s)&&(n=e.end(e.length-1)+i.targetDuration*3),t>n}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-this.liveRangeSafeTimeDelta)}videoUnderflow_({videoBuffered:e,audioBuffered:t,currentTime:i}){if(!e)return;let s;if(e.length&&t.length){const n=ir(e,i-3),a=ir(e,i),u=ir(t,i);u.length&&!a.length&&n.length&&(s={start:n.end(0),end:u.end(0)})}else en(e,i).length||(s=this.gapFromVideoUnderflow_(e,i));return s?(this.logger_(`Encountered a gap in video from ${s.start} to ${s.end}. Seeking to current time ${i}`),!0):!1}skipTheGap_(e){const t=this.tech_.buffered(),i=this.tech_.currentTime(),s=en(t,i);if(this.resetTimeUpdate_(),s.length===0||i!==e)return;this.logger_("skipTheGap_:","currentTime:",i,"scheduled currentTime:",e,"nextRange start:",s.start(0)),this.tech_.setCurrentTime(s.start(0)+Wt);const n={gapInfo:{from:i,to:s.start(0)}};this.playlistController_.trigger({type:"gapjumped",metadata:n}),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"})}gapFromVideoUnderflow_(e,t){const i=Z_(e);for(let s=0;s<i.length;s++){const n=i.start(s),a=i.end(s);if(t-n<4&&t-n>2)return{start:n,end:a}}return null}}const _1={errorInterval:30,getSource(r){const e=this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource();return r(e)}},hp=function(r,e){let t=0,i=0;const s=Ce(_1,e);r.ready(()=>{r.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const n=function(){i&&r.currentTime(i)},a=function(f){f!=null&&(i=r.duration()!==1/0&&r.currentTime()||0,r.one("loadedmetadata",n),r.src(f),r.trigger({type:"usage",name:"vhs-error-reload"}),r.play())},u=function(){if(Date.now()-t<s.errorInterval*1e3){r.trigger({type:"usage",name:"vhs-error-reload-canceled"});return}if(!s.getSource||typeof s.getSource!="function"){j.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}return t=Date.now(),s.getSource.call(r,a)},c=function(){r.off("loadedmetadata",n),r.off("error",u),r.off("dispose",c)},m=function(f){c(),hp(r,f)};r.on("error",u),r.on("dispose",c),r.reloadSourceOnError=m},b1=function(r){hp(this,r)};var dp="3.17.2",v1="7.1.0",T1="1.3.1",S1="7.2.0",E1="4.0.2";const Me={PlaylistLoader:rr,Playlist:mt,utils:x2,STANDARD_PLAYLIST_SELECTOR:_c,INITIAL_PLAYLIST_SELECTOR:g0,lastBandwidthSelector:_c,movingAverageBandwidthSelector:p0,comparePlaylistBandwidth:nu,comparePlaylistResolution:d0,xhr:Fd()};Object.keys(Ge).forEach(r=>{Object.defineProperty(Me,r,{get(){return j.log.warn(`using Vhs.${r} is UNSAFE be sure you know what you are doing`),Ge[r]},set(e){if(j.log.warn(`using Vhs.${r} is UNSAFE be sure you know what you are doing`),typeof e!="number"||e<0){j.log.warn(`value of Vhs.${r} must be greater than or equal to 0`);return}Ge[r]=e}})});const pp="videojs-vhs",mp=function(r,e){const t=e.media();let i=-1;for(let s=0;s<r.length;s++)if(r[s].id===t.id){i=s;break}r.selectedIndex_=i,r.trigger({selectedIndex:i,type:"change"})},C1=function(r,e){e.representations().forEach(t=>{r.addQualityLevel(t)}),mp(r,e.playlists)};Me.canPlaySource=function(){return j.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const w1=(r,e,t)=>{if(!r)return r;let i={};e&&e.attributes&&e.attributes.CODECS&&(i=ds(Ht(e.attributes.CODECS))),t&&t.attributes&&t.attributes.CODECS&&(i.audio=t.attributes.CODECS);const s=pr(i.video),n=pr(i.audio),a={};for(const u in r)a[u]={},n&&(a[u].audioContentType=n),s&&(a[u].videoContentType=s),e.contentProtection&&e.contentProtection[u]&&e.contentProtection[u].pssh&&(a[u].pssh=e.contentProtection[u].pssh),typeof r[u]=="string"&&(a[u].url=r[u]);return Ce(r,a)},k1=(r,e)=>r.reduce((t,i)=>{if(!i.contentProtection)return t;const s=e.reduce((n,a)=>{const u=i.contentProtection[a];return u&&u.pssh&&(n[a]={pssh:u.pssh}),n},{});return Object.keys(s).length&&t.push(s),t},[]),A1=({player:r,sourceKeySystems:e,audioMedia:t,mainPlaylists:i})=>{if(!r.eme.initializeMediaKeys)return Promise.resolve();const s=t?i.concat([t]):i,n=k1(s,Object.keys(e)),a=[],u=[];return n.forEach(c=>{u.push(new Promise((m,f)=>{r.tech_.one("keysessioncreated",m)})),a.push(new Promise((m,f)=>{r.eme.initializeMediaKeys({keySystems:c},_=>{if(_){f(_);return}m()})}))}),Promise.race([Promise.all(a),Promise.race(u)])},x1=({player:r,sourceKeySystems:e,media:t,audioMedia:i})=>{const s=w1(e,t,i);return s?(r.currentSource().keySystems=s,s&&!r.eme?(j.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},gp=()=>{if(!A.localStorage)return null;const r=A.localStorage.getItem(pp);if(!r)return null;try{return JSON.parse(r)}catch{return null}},D1=r=>{if(!A.localStorage)return!1;let e=gp();e=e?Ce(e,r):r;try{A.localStorage.setItem(pp,JSON.stringify(e))}catch{return!1}return e},I1=r=>r.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(r.substring(r.indexOf(",")+1)):r,fp=(r,e)=>{r._requestCallbackSet||(r._requestCallbackSet=new Set),r._requestCallbackSet.add(e)},yp=(r,e)=>{r._responseCallbackSet||(r._responseCallbackSet=new Set),r._responseCallbackSet.add(e)},_p=(r,e)=>{r._requestCallbackSet&&(r._requestCallbackSet.delete(e),r._requestCallbackSet.size||delete r._requestCallbackSet)},bp=(r,e)=>{r._responseCallbackSet&&(r._responseCallbackSet.delete(e),r._responseCallbackSet.size||delete r._responseCallbackSet)};Me.supportsNativeHls=(function(){if(!re||!re.createElement)return!1;const r=re.createElement("video");return j.getTech("Html5").isSupported()?["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(e){return/maybe|probably/i.test(r.canPlayType(e))}):!1})();Me.supportsNativeDash=(function(){return!re||!re.createElement||!j.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(re.createElement("video").canPlayType("application/dash+xml"))})();Me.supportsTypeNatively=r=>r==="hls"?Me.supportsNativeHls:r==="dash"?Me.supportsNativeDash:!1;Me.isSupported=function(){return j.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};Me.xhr.onRequest=function(r){fp(Me.xhr,r)};Me.xhr.onResponse=function(r){yp(Me.xhr,r)};Me.xhr.offRequest=function(r){_p(Me.xhr,r)};Me.xhr.offResponse=function(r){bp(Me.xhr,r)};const P1=j.getComponent("Component");class vp extends P1{constructor(e,t,i){if(super(t,i.vhs),typeof i.initialBandwidth=="number"&&(this.options_.bandwidth=i.initialBandwidth),this.logger_=Pt("VhsHandler"),t.options_&&t.options_.playerId){const s=j.getPlayer(t.options_.playerId);this.player_=s}if(this.tech_=t,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&t.overrideNativeAudioTracks&&t.overrideNativeVideoTracks)t.overrideNativeAudioTracks(!0),t.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(t.featuresNativeVideoTracks||t.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(re,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],s=>{const n=re.fullscreenElement||re.webkitFullscreenElement||re.mozFullScreenElement||re.msFullscreenElement;n&&n.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=!1;return}this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,"error",function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}),this.on(this.tech_,"play",this.play)}setOptions_(e={}){if(this.options_=Ce(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.usePlayerObjectFit=this.options_.usePlayerObjectFit||!1,this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage<"u"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=typeof this.options_.useNetworkInformationApi<"u"?this.options_.useNetworkInformationApi:!0,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=this.options_.llhls!==!1,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,typeof this.options_.playlistExclusionDuration!="number"&&(this.options_.playlistExclusionDuration=60),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){const i=gp();i&&i.bandwidth&&(this.options_.bandwidth=i.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),i&&i.throughput&&(this.options_.throughput=i.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=Ge.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Ge.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","usePlayerObjectFit","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(i=>{typeof this.source_[i]<"u"&&(this.options_[i]=this.source_[i])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio,this.usePlayerObjectFit=this.options_.usePlayerObjectFit;const t=this.options_.customPixelRatio;typeof t=="number"&&t>=0&&(this.customPixelRatio=t)}setOptions(e={}){this.setOptions_(e)}src(e,t){if(!e)return;this.setOptions_(),this.options_.src=I1(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=Me,this.options_.sourceType=qc(t),this.options_.seekTo=n=>{this.tech_.setCurrentTime(n)},this.options_.player_=this.player_,this.playlistController_=new p1(this.options_);const i=Ce({liveRangeSafeTimeDelta:Gt},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new y1(i),this.attachStreamingEventListeners_(),this.playlistController_.on("error",()=>{const n=j.players[this.tech_.options_.playerId];let a=this.playlistController_.error;typeof a=="object"&&!a.code?a.code=3:typeof a=="string"&&(a={message:a,code:3}),n.error(a)});const s=this.options_.bufferBasedABR?Me.movingAverageBandwidthSelector(.55):Me.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):s.bind(this),this.playlistController_.selectInitialPlaylist=Me.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(n){this.playlistController_.selectPlaylist=n.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(n){this.playlistController_.mainSegmentLoader_.throughput.rate=n,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let n=this.playlistController_.mainSegmentLoader_.bandwidth;const a=A.navigator.connection||A.navigator.mozConnection||A.navigator.webkitConnection,u=1e7;if(this.options_.useNetworkInformationApi&&a){const c=a.downlink*1e3*1e3;c>=u&&n>=u?n=Math.max(n,c):n=c}return n},set(n){this.playlistController_.mainSegmentLoader_.bandwidth=n,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const n=1/(this.bandwidth||1);let a;return this.throughput>0?a=1/this.throughput:a=0,Math.floor(1/(n+a))},set(){j.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>Fi(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>Fi(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{this.options_.useBandwidthFromLocalStorage&&D1({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{f1(this)}),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()}),this.on(this.playlistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.playlistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=A.URL.createObjectURL(this.playlistController_.mediaSource),(j.browser.IS_ANY_SAFARI||j.browser.IS_IOS)&&this.options_.overrideNative&&this.options_.sourceType==="hls"&&typeof this.tech_.addSourceElement=="function"?(this.tech_.addSourceElement(this.mediaSourceUrl_),this.tech_.addSourceElement(this.source_.src)):this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),A1({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch(t=>{this.logger_("error while creating EME key session",t),this.player_.error({message:"Failed to initialize media keys for EME",code:3})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,t=x1({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});if(this.player_.tech_.on("keystatuschange",i=>{this.playlistController_.updatePlaylistByKeyStatus(i.keyId,i.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),!t){this.playlistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()}setupQualityLevels_(){const e=j.players[this.tech_.options_.playerId];!e||!e.qualityLevels||this.qualityLevels_||(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{C1(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{mp(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":dp,"mux.js":v1,"mpd-parser":T1,"m3u8-parser":S1,"aes-decrypter":E1}}version(){return this.constructor.version()}canChangeType(){return op.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&A.URL.revokeObjectURL&&(A.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return R2({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,i=!0,s=2){return Vd({programTime:e,playlist:this.playlistController_.media(),retryCount:s,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{fp(this.xhr,e)},this.xhr.onResponse=e=>{yp(this.xhr,e)},this.xhr.offRequest=e=>{_p(this.xhr,e)},this.xhr.offResponse=e=>{bp(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){const e=["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"],t=["gapjumped","playedrangeschanged"];e.forEach(i=>{this.playlistController_.on(i,s=>{this.player_.trigger(qe({},s))})}),t.forEach(i=>{this.playbackWatcher_.on(i,s=>{this.player_.trigger(qe({},s))})})}}const An={name:"videojs-http-streaming",VERSION:dp,canHandleSource(r,e={}){const t=Ce(j.options,e);return!t.vhs.experimentalUseMMS&&!is("avc1.4d400d,mp4a.40.2",!1)?!1:An.canPlayType(r.type,t)},handleSource(r,e,t={}){const i=Ce(j.options,t);return e.vhs=new vp(r,e,i),e.vhs.xhr=Fd(),e.vhs.setupXhrHooks_(),e.vhs.src(r.src,r.type),e.vhs},canPlayType(r,e){const t=qc(r);if(!t)return"";const i=An.getOverrideNative(e);return!Me.supportsTypeNatively(t)||i?"maybe":""},getOverrideNative(r={}){const{vhs:e={}}=r,t=!(j.browser.IS_ANY_SAFARI||j.browser.IS_IOS),{overrideNative:i=t}=e;return i}},L1=()=>is("avc1.4d400d,mp4a.40.2",!0);L1()&&j.getTech("Html5").registerSourceHandler(An,0);j.VhsHandler=vp;j.VhsSourceHandler=An;j.Vhs=Me;j.use||j.registerComponent("Vhs",Me);j.options.vhs=j.options.vhs||{};(!j.getPlugin||!j.getPlugin("reloadSourceOnError"))&&j.registerPlugin("reloadSourceOnError",b1);const Pc=r=>{if(typeof r=="number")return r;const e=r.toString().trim(),t=e.split(":").map(i=>parseInt(i,10));if(t.length===3)return t[0]*3600+t[1]*60+t[2];if(t.length===2)return t[0]*60+t[1];{const i=parseFloat(e);return isNaN(i)?0:i}},O1=()=>{const r=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#06b6d4","#84cc16","#f97316","#ec4899","#6366f1","#14b8a6","#f43f5e","#a855f7","#0ea5e9","#22c55e"];return r[Math.floor(Math.random()*r.length)]},Ha=r=>r.map(e=>({...e,start:Pc(e.start),end:Pc(e.end),color:e.color||O1()})),N1=(r,e)=>e.find(t=>r>=t.start&&r<=t.end)||null,R1=r=>{const e=Wa(null),t=Wa(null),i=Ha(r.segments||[]),[s,n]=Nc({isReady:!1,isPlaying:!1,isPaused:!0,currentTime:0,duration:0,volume:1,muted:!1,playbackRate:1,currentSegment:null,segments:i});Rc(()=>{if(!e.current)return;console.log("\u521D\u59CB\u5316\u64AD\u653E\u5668\uFF0C\u89C6\u9891\u6E90:",r.src);let N=0;const O=5,z=()=>{if(!e.current||!e.current.parentNode)if(N<O){N++,console.log(`\u89C6\u9891\u5143\u7D20\u4E0D\u5728 DOM \u4E2D\uFF0C\u7B2C ${N} \u6B21\u91CD\u8BD5...`),setTimeout(z,200*N);return}else{console.error("\u89C6\u9891\u5143\u7D20\u521D\u59CB\u5316\u5931\u8D25\uFF0C\u5DF2\u8FBE\u5230\u6700\u5927\u91CD\u8BD5\u6B21\u6570");return}try{const $=e.current;t.current&&(t.current.dispose(),t.current=null);const L=j($,{controls:!1,fluid:r.fluid??!0,responsive:r.responsive??!0,preload:r.preload??"metadata",playbackRates:r.playbackRates??[.5,1,1.25,1.5,2],poster:r.poster,autoplay:r.autoplay??!1,muted:r.muted??!1,loop:r.loop??!1});L.src(r.src),t.current=L,L.on("error",H=>{console.error("\u89C6\u9891\u64AD\u653E\u9519\u8BEF:",H),console.error("\u9519\u8BEF\u8BE6\u60C5:",L.error())}),L.on("loadstart",()=>{console.log("\u5F00\u59CB\u52A0\u8F7D\u89C6\u9891")}),L.on("canplay",()=>{console.log("\u89C6\u9891\u53EF\u4EE5\u64AD\u653E")}),L.on("loadedmetadata",()=>{console.log("\u89C6\u9891\u5143\u6570\u636E\u52A0\u8F7D\u5B8C\u6210\uFF0C\u65F6\u957F:",L.duration()),n(H=>({...H,duration:L.duration()||0,volume:L.volume()||1,muted:L.muted()||!1,playbackRate:L.playbackRate()||1}))}),L.on("loadeddata",()=>{console.log("\u89C6\u9891\u6570\u636E\u52A0\u8F7D\u5B8C\u6210")}),L.ready(()=>{var H;n(v=>({...v,isReady:!0})),(H=r.onReady)==null||H.call(r,L)}),L.on("play",()=>{var H;n(v=>({...v,isPlaying:!0,isPaused:!1})),(H=r.onPlay)==null||H.call(r)}),L.on("pause",()=>{var H;n(v=>({...v,isPlaying:!1,isPaused:!0})),(H=r.onPause)==null||H.call(r)}),L.on("ended",()=>{var H;n(v=>({...v,isPlaying:!1,isPaused:!0})),(H=r.onEnded)==null||H.call(r)}),L.on("timeupdate",()=>{var C,V,U;const H=L.currentTime()||0;n(F=>({...F,currentTime:H})),(C=r.onTimeUpdate)==null||C.call(r,H);const v=N1(H,s.segments);v&&v.id!==((V=s.currentSegment)==null?void 0:V.id)&&(n(F=>({...F,currentSegment:v})),(U=r.onSegmentChange)==null||U.call(r,v))}),L.on("volumechange",()=>{n(H=>({...H,volume:L.volume()||1,muted:L.muted()||!1}))}),L.on("ratechange",()=>{n(H=>({...H,playbackRate:L.playbackRate()||1}))})}catch($){console.error("\u521D\u59CB\u5316 video.js \u5931\u8D25:",$)}},q=requestAnimationFrame(()=>{z()});return()=>{cancelAnimationFrame(q),t.current&&(t.current.dispose(),t.current=null)}},[r.src,r.poster,r.autoplay,r.muted,r.loop,r.fluid,r.responsive,r.preload,r.playbackRates]);const a=Rt(()=>{console.log("\u64AD\u653E\u6309\u94AE\u88AB\u70B9\u51FB"),t.current&&t.current.play()},[]),u=Rt(()=>{console.log("\u6682\u505C\u6309\u94AE\u88AB\u70B9\u51FB"),t.current&&t.current.pause()},[]),c=Rt(N=>{t.current&&t.current.currentTime(N)},[]),m=Rt(N=>{t.current&&t.current.volume(N)},[]),f=Rt(N=>{t.current&&t.current.muted(N)},[]),_=Rt(N=>{t.current&&t.current.playbackRate(N)},[]),P=Rt(()=>{console.log("\u5207\u6362\u64AD\u653E\u72B6\u6001\uFF0C\u5F53\u524D\u72B6\u6001:",s.isPlaying),t.current&&(s.isPlaying?t.current.pause():t.current.play())},[s.isPlaying]),S=Rt((N,O)=>{if(t.current&&(t.current.currentTime(N.start),t.current.play(),O==null?void 0:O.autostop)){const z=N.end-N.start,q=setTimeout(()=>{t.current&&(t.current.pause(),console.log(`\u6BB5\u843D "${N.label}" \u64AD\u653E\u5B8C\u6210\uFF0C\u81EA\u52A8\u6682\u505C`))},z*1e3);t.current._segmentTimeout&&clearTimeout(t.current._segmentTimeout),t.current._segmentTimeout=q}},[]),R=Rt(N=>{const O=Ha([N])[0];n(z=>({...z,segments:[...z.segments,O]}))},[]),b=Rt(N=>{n(O=>{var z;return{...O,segments:O.segments.filter(q=>q.id!==N),currentSegment:((z=O.currentSegment)==null?void 0:z.id)===N?null:O.currentSegment}})},[]),I=Rt((N,O)=>{n(z=>({...z,segments:z.segments.map(q=>{if(q.id===N){const $={...q,...O};return Ha([$])[0]}return q})}))},[]),M={play:a,pause:u,seekTo:c,setVolume:m,setMuted:f,setPlaybackRate:_,playSegment:S,addSegment:R,removeSegment:b,updateSegment:I,togglePlay:P};return{videoRef:e,player:t.current,state:s,actions:M}};/**
228
+ * @license lucide-react v0.456.0 - ISC
229
+ *
230
+ * This source code is licensed under the ISC license.
231
+ * See the LICENSE file in the root directory of this source tree.
232
+ */const M1=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Tp=(...r)=>r.filter((e,t,i)=>!!e&&e.trim()!==""&&i.indexOf(e)===t).join(" ").trim();/**
233
+ * @license lucide-react v0.456.0 - ISC
234
+ *
235
+ * This source code is licensed under the ISC license.
236
+ * See the LICENSE file in the root directory of this source tree.
237
+ */var B1={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
238
+ * @license lucide-react v0.456.0 - ISC
239
+ *
240
+ * This source code is licensed under the ISC license.
241
+ * See the LICENSE file in the root directory of this source tree.
242
+ */const U1=To(({color:r="currentColor",size:e=24,strokeWidth:t=2,absoluteStrokeWidth:i,className:s="",children:n,iconNode:a,...u},c)=>za("svg",{ref:c,...B1,width:e,height:e,stroke:r,strokeWidth:i?Number(t)*24/Number(e):t,className:Tp("lucide",s),...u},[...a.map(([m,f])=>za(m,f)),...Array.isArray(n)?n:[n]]));/**
243
+ * @license lucide-react v0.456.0 - ISC
244
+ *
245
+ * This source code is licensed under the ISC license.
246
+ * See the LICENSE file in the root directory of this source tree.
247
+ */const vs=(r,e)=>{const t=To(({className:i,...s},n)=>za(U1,{ref:n,iconNode:e,className:Tp(`lucide-${M1(r)}`,i),...s}));return t.displayName=`${r}`,t};/**
248
+ * @license lucide-react v0.456.0 - ISC
249
+ *
250
+ * This source code is licensed under the ISC license.
251
+ * See the LICENSE file in the root directory of this source tree.
252
+ */const F1=vs("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/**
253
+ * @license lucide-react v0.456.0 - ISC
254
+ *
255
+ * This source code is licensed under the ISC license.
256
+ * See the LICENSE file in the root directory of this source tree.
257
+ */const j1=vs("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
258
+ * @license lucide-react v0.456.0 - ISC
259
+ *
260
+ * This source code is licensed under the ISC license.
261
+ * See the LICENSE file in the root directory of this source tree.
262
+ */const q1=vs("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
263
+ * @license lucide-react v0.456.0 - ISC
264
+ *
265
+ * This source code is licensed under the ISC license.
266
+ * See the LICENSE file in the root directory of this source tree.
267
+ */const $1=vs("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/**
268
+ * @license lucide-react v0.456.0 - ISC
269
+ *
270
+ * This source code is licensed under the ISC license.
271
+ * See the LICENSE file in the root directory of this source tree.
272
+ */const H1=vs("VolumeX",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]),V1=[.5,.75,1,1.25,1.5,2],z1=({isPlaying:r,currentTime:e,duration:t,volume:i,muted:s,playbackRate:n,onTogglePlay:a,onSeek:u,onVolumeChange:c,onMuteToggle:m,onPlaybackRateChange:f,segments:_=[],currentSegment:P=null,onSegmentClick:S,showTimeline:R=!0,showTimelineSegments:b=!0,showPlaybackRate:I=!1})=>{const[M,N]=Oc.useState(!1),[O,z]=Nc(null),q=U=>{const F=Math.floor(U/60),K=Math.floor(U%60);return`${F}:${K.toString().padStart(2,"0")}`},$=U=>{const F=U.currentTarget.getBoundingClientRect(),K=(U.clientX-F.left)/F.width*t;u(K)},L=U=>{const F=parseFloat(U.target.value);c(F)},H=U=>{const F=U.currentTarget.getBoundingClientRect(),K=(U.clientX-F.left)/F.width*t;u(K)},v=U=>{S&&S(U)},C=R&&_.length>0,V=(U,F=80)=>{if(U.length<=F)return U;let K=U.substring(0,F);const ee=K[K.length-1];return/[,。!?;:""''()【】]/.test(ee)&&(K=K.substring(0,K.length-1)),K+"..."};return le.jsxs("div",{className:"video-controls",children:[le.jsx("div",{className:"video-controls__progress",onClick:$,children:le.jsx("div",{className:"video-controls__progress-bar",style:{width:`${e/t*100}%`}})}),C&&le.jsxs("div",{className:"video-timeline",children:[le.jsxs("div",{className:"video-timeline__track",onClick:H,children:[le.jsx("div",{className:"video-timeline__progress",style:{width:`${e/t*100}%`}}),b&&_.map(U=>le.jsx("div",{className:`video-timeline__segment ${(P==null?void 0:P.id)===U.id?"active":""}`,style:{left:`${U.start/t*100}%`,width:`${(U.end-U.start)/t*100}%`,background:U.color||"#3b82f6"},onClick:F=>{F.stopPropagation(),v(U)},onMouseEnter:()=>U.label&&z(U),onMouseLeave:()=>U.label&&z(null)},U.id))]}),O&&O.label&&(()=>{const U=O.start/t*100;let F={position:"absolute",bottom:"100%",left:`${Math.max(5,Math.min(95,U))}%`,transform:"translateX(-50%)",zIndex:1e3,pointerEvents:"none",marginBottom:"8px",maxWidth:"180px",minWidth:"60px"};return le.jsx("div",{className:"video-timeline__tooltip",style:F,title:O.label,children:V(O.label,80)})})()]}),le.jsxs("div",{className:"video-controls__buttons",children:[le.jsxs("div",{className:"video-controls__left",children:[le.jsx("button",{className:"video-controls__button video-controls__play-button",onClick:a,"aria-label":r?"\u6682\u505C":"\u64AD\u653E",children:r?le.jsx(F1,{size:20}):le.jsx(j1,{size:20})}),le.jsxs("div",{className:"video-controls__time",children:[le.jsx("span",{children:q(e)}),le.jsx("span",{children:"/"}),le.jsx("span",{children:q(t)})]})]}),le.jsxs("div",{className:"video-controls__right",children:[le.jsxs("div",{className:"video-controls__volume",children:[le.jsx("button",{className:"video-controls__button",onClick:()=>m(!s),"aria-label":s?"\u53D6\u6D88\u9759\u97F3":"\u9759\u97F3",children:s?le.jsx(H1,{size:20}):le.jsx($1,{size:20})}),le.jsx("input",{type:"range",min:"0",max:"1",step:"0.1",value:s?0:i,onChange:L,className:"video-controls__volume-slider"})]}),I&&le.jsxs("div",{className:"video-controls__settings",children:[le.jsx("button",{className:"video-controls__button",onClick:()=>N(!M),"aria-label":"\u8BBE\u7F6E",children:le.jsx(q1,{size:20})}),M&&le.jsx("div",{className:"video-controls__settings-menu",children:le.jsxs("div",{className:"video-controls__settings-item",children:[le.jsx("label",{children:"\u64AD\u653E\u901F\u5EA6"}),le.jsx("select",{value:n,onChange:U=>f(parseFloat(U.target.value)),children:V1.map(U=>le.jsxs("option",{value:U,children:[U,"x"]},U))})]})})]})]})]})]})},W1=({segments:r,currentSegment:e,onSegmentClick:t,onSegmentAdd:i,onSegmentRemove:s,onSegmentUpdate:n})=>le.jsx("div",{className:"video-segments",children:r.map(a=>le.jsx("div",{className:`video-segments__item ${(e==null?void 0:e.id)===a.id?"active":""}`,onClick:()=>t(a),style:{background:a.color||"#3b82f6",color:"white",padding:"4px 8px",margin:"2px",borderRadius:"4px",cursor:"pointer",fontSize:"12px"},children:a.label},a.id))}),Sp=To(({className:r="",showControls:e=!0,showTimeline:t=!0,showTimelineSegments:i=!0,showSegments:s=!0,showPlaybackRate:n=!1,theme:a="default",showDebugInfo:u=!1,showPlayerState:c=!1,aspectRatio:m="16:9",...f},_)=>{const{videoRef:P,player:S,state:R,actions:b}=R1(f);return dg(_,()=>({player:S,state:R,actions:b,segments:{add:I=>{b.addSegment(I)},remove:I=>{b.removeSegment(I)},update:(I,M)=>{b.updateSegment(I,M)},clear:()=>{R.segments.forEach(I=>{b.removeSegment(I.id)})},play:(I,M)=>{b.playSegment(I,M)},getCurrent:()=>R.currentSegment,getAll:()=>R.segments}}),[S,R,b]),le.jsx("div",{className:`video-player video-player--${a} ${r}`,style:{width:"100%",height:"100%",aspectRatio:m,position:"relative",overflow:"hidden"},children:le.jsxs("div",{className:"video-player__container",children:[le.jsx("video",{ref:P,className:"video-js vjs-default-skin",controls:!1,preload:"metadata","data-setup":"{}",src:f.src,poster:f.poster,style:{width:"100%",height:"100%"}}),!R.isPlaying&&le.jsx("div",{className:"video-player__play-button",onClick:()=>b.play(),style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"80px",height:"80px",background:"rgba(0, 0, 0, 0.7)",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",zIndex:10,transition:"all 0.3s ease"},onMouseEnter:I=>{I.currentTarget.style.background="rgba(0, 0, 0, 0.9)",I.currentTarget.style.transform="translate(-50%, -50%) scale(1.1)"},onMouseLeave:I=>{I.currentTarget.style.background="rgba(0, 0, 0, 0.7)",I.currentTarget.style.transform="translate(-50%, -50%) scale(1)"},children:le.jsx("div",{style:{width:0,height:0,borderLeft:"20px solid white",borderTop:"12px solid transparent",borderBottom:"12px solid transparent",marginLeft:"4px"}})}),e&&le.jsx(z1,{isPlaying:R.isPlaying,currentTime:R.currentTime,duration:R.duration,volume:R.volume,muted:R.muted,playbackRate:R.playbackRate,onTogglePlay:b.togglePlay,onSeek:b.seekTo,onVolumeChange:b.setVolume,onMuteToggle:b.setMuted,onPlaybackRateChange:b.setPlaybackRate,segments:R.segments,currentSegment:R.currentSegment,onSegmentClick:b.playSegment,showTimeline:t,showTimelineSegments:i,showPlaybackRate:n}),s&&R.segments.length>0&&le.jsx(W1,{segments:R.segments,currentSegment:R.currentSegment,onSegmentClick:I=>b.playSegment(I),onSegmentAdd:b.addSegment,onSegmentRemove:b.removeSegment,onSegmentUpdate:b.updateSegment}),c&&S&&le.jsxs("div",{style:{position:"absolute",top:"16px",left:"16px",background:"rgba(0, 0, 0, 0.8)",color:"white",padding:"8px 12px",borderRadius:"6px",fontSize:"12px",fontFamily:"monospace",zIndex:20},children:[le.jsxs("div",{children:["\u65F6\u957F: ",Math.round(S.duration()||0),"s"]}),le.jsxs("div",{children:["\u5F53\u524D: ",Math.round(S.currentTime()||0),"s"]}),le.jsxs("div",{children:["\u97F3\u91CF: ",Math.round((S.volume()||0)*100),"%"]}),le.jsxs("div",{children:["\u901F\u5EA6: ",S.playbackRate()||1,"x"]})]}),u&&le.jsxs("div",{style:{position:"absolute",top:"16px",right:"16px",background:"rgba(0, 0, 0, 0.8)",color:"white",padding:"8px 12px",borderRadius:"6px",fontSize:"11px",fontFamily:"monospace",zIndex:20},children:[le.jsxs("div",{children:["\u89C6\u9891\u8DEF\u5F84: ",f.src]}),le.jsxs("div",{children:["\u64AD\u653E\u5668\u72B6\u6001: ",S?"\u5DF2\u52A0\u8F7D":"\u52A0\u8F7D\u4E2D..."]}),le.jsxs("div",{children:["\u6BB5\u843D\u6570\u91CF: ",R.segments.length]}),S&&le.jsxs(le.Fragment,{children:[le.jsxs("div",{children:["\u89C6\u9891\u5C3A\u5BF8: ",S.videoWidth(),"x",S.videoHeight()]}),le.jsxs("div",{children:["\u7F51\u7EDC\u72B6\u6001: ",S.networkState()]}),le.jsxs("div",{children:["\u5C31\u7EEA\u72B6\u6001: ",S.readyState()]})]})]})]})})});Sp.displayName="VideoPlayer";const Lc=r=>{const[e,t,i]=r.split(":");return parseInt(e)*3600+parseInt(t)*60+parseInt(i)},sb=({curFileInfo:r,onClose:e})=>{const t=Va(()=>{if(r!=null&&r.begin_date)return{id:gg(4),start:Lc(r==null?void 0:r.begin_date),end:Lc(r==null?void 0:r.end_date),color:"#ef2345"}},[r]),i=Wa(null);Rc(()=>{r.displayType=="retrive"&&t&&setTimeout(()=>{var n;(n=i.current)==null||n.segments.play(t,{autostop:!0})},1e3)},[t]);const s={aspectRatio:"1:1",theme:"default",showControls:!0,showTimeline:!1,showTimelineSegments:!0,showDebugInfo:!1,showPlayerState:!1};return Yu("div",{children:[Yu("div",{className:"h-[52px] flex justify-between items-center leading-[52px] font-bold text-[16px] px-[15px] overflow-hidden border-t-none border-l-none border-b-[1px] border-solid border-[rgb(222,226,230)]",children:[(r==null?void 0:r.source_name)||"-",Ti("div",{onClick:e,children:Ti("img",{src:fg,className:"cursor-pointer",onClick:()=>e()})})]}),Ti("div",{className:"h-[calc(100vh-60px)] p-[20px] flex items-center justify-center",children:Ti("div",{style:{background:"white",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",overflow:"hidden",position:"relative",width:"100%",height:"400px",margin:"auto"},children:Ti(Sp,{ref:i,src:r.link,segments:t?[t]:[],showControls:s.showControls,showTimeline:s.showTimeline,showTimelineSegments:s.showTimelineSegments,showSegments:!1,theme:s.theme,showDebugInfo:s.showDebugInfo,showPlayerState:s.showPlayerState,aspectRatio:s.aspectRatio})})})]})};export{rb as D,bg as T,sb as a,Eg as b,fg as c,yg as d,Sg as e,eb as f,vg as g,ib as h,Tg as i,tb as j,Z1 as k,_g as l};