mirror of
https://github.com/goodtube4u/goodtube.git
synced 2025-11-22 10:16:11 +00:00
22 lines
676 KiB
JavaScript
22 lines
676 KiB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Sweetalert2=t()}(this,function(){"use strict";function e(e,t,i){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:i;throw TypeError("Private element is not present on this object")}function t(t,i){return t.get(e(t,i))}function i(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(i=function(){return!!e})()}function n(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function a(e,t){for(var i=0;i<t.length;i++){var s=t[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,n(s.key),s)}}function o(e,t,i){return t&&a(e.prototype,t),i&&a(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function d(){return(d="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,i){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=l(e)););return e}(e,t);if(n){var s=Object.getOwnPropertyDescriptor(n,t);return s.get?s.get.call(arguments.length<3?e:i):s.value}}).apply(this,arguments)}function h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,s,r,a,o=[],l=!0,u=!1;try{if(r=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=r.call(i)).done)&&(o.push(n.value),o.length!==t);l=!0);}catch(d){u=!0,s=d}finally{try{if(!l&&null!=i.return&&(a=i.return(),Object(a)!==a))return}finally{if(u)throw s}}return o}}(e,t)||c(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){if(e){if("string"==typeof e)return p(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?p(e,t):void 0}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=Array(t);i<t;i++)n[i]=e[i];return n}var m={},f="swal2-",g=["container","shown","height-auto","iosfix","popup","modal","no-backdrop","no-transition","toast","toast-shown","show","hide","close","title","html-container","actions","confirm","deny","cancel","default-outline","footer","icon","icon-content","image","input","file","range","select","radio","checkbox","label","textarea","inputerror","input-label","validation-message","progress-steps","active-progress-step","progress-step","progress-step-line","loader","loading","styled","top","top-start","top-end","top-left","top-right","center","center-start","center-end","center-left","center-right","bottom","bottom-start","bottom-end","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen","rtl","timer-progress-bar","timer-progress-bar-container","scrollbar-measure","icon-success","icon-warning","icon-info","icon-question","icon-error"].reduce(function(e,t){return e[t]=f+t,e},{}),y=["success","warning","info","question","error"].reduce(function(e,t){return e[t]=f+t,e},{}),v="SweetAlert2:",b=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},$=function(e){console.warn("".concat(v," ").concat("object"===s(e)?e.join(" "):e))},T=function(e){console.error("".concat(v," ").concat(e))},w=[],_=function(e,t){var i;i='"'.concat(e,'" is deprecated and will be removed in the next major release. Please use "').concat(t,'" instead.'),w.includes(i)||(w.push(i),$(i))},S=function(e){return"function"==typeof e?e():e},k=function(e){return e&&"function"==typeof e.toPromise},E=function(e){return k(e)?e.toPromise():Promise.resolve(e)},C=function(e){return e&&Promise.resolve(e)===e},x=function(){return document.body.querySelector(".".concat(g.container))},I=function(e){var t=x();return t?t.querySelector(e):null},P=function(e){return I(".".concat(e))},A=function(){return P(g.popup)},L=function(){return P(g.icon)},D=function(){return P(g.title)},O=function(){return P(g["html-container"])},R=function(){return P(g.image)},N=function(){return P(g["progress-steps"])},M=function(){return P(g["validation-message"])},B=function(){return I(".".concat(g.actions," .").concat(g.confirm))},U=function(){return I(".".concat(g.actions," .").concat(g.cancel))},F=function(){return I(".".concat(g.actions," .").concat(g.deny))},j=function(){return I(".".concat(g.loader))},q=function(){return P(g.actions)},H=function(){return P(g.footer)},V=function(){return P(g["timer-progress-bar"])},W=function(){return P(g.close)},z=function(){var e=A();if(!e)return[];var t,i=Array.from(e.querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])')).sort(function(e,t){var i=parseInt(e.getAttribute("tabindex")||"0"),n=parseInt(t.getAttribute("tabindex")||"0");return i>n?1:i<n?-1:0}),n=Array.from(e.querySelectorAll('\n a[href],\n area[href],\n input:not([disabled]),\n select:not([disabled]),\n textarea:not([disabled]),\n button:not([disabled]),\n iframe,\n object,\n embed,\n [tabindex="0"],\n [contenteditable],\n audio[controls],\n video[controls],\n summary\n')).filter(function(e){return"-1"!==e.getAttribute("tabindex")});return((function(e){if(Array.isArray(e))return p(e)})(t=new Set(i.concat(n)))||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||c(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).filter(function(e){return ed(e)})},G=function(){return Y(document.body,g.shown)&&!Y(document.body,g["toast-shown"])&&!Y(document.body,g["no-backdrop"])},X=function(){var e=A();return!!e&&Y(e,g.toast)},K=function(e,t){if(e.textContent="",t){var i=(new DOMParser).parseFromString(t,"text/html"),n=i.querySelector("head");n&&Array.from(n.childNodes).forEach(function(t){e.appendChild(t)});var s=i.querySelector("body");s&&Array.from(s.childNodes).forEach(function(t){t instanceof HTMLVideoElement||t instanceof HTMLAudioElement?e.appendChild(t.cloneNode(!0)):e.appendChild(t)})}},Y=function(e,t){if(!t)return!1;for(var i=t.split(/\s+/),n=0;n<i.length;n++)if(!e.classList.contains(i[n]))return!1;return!0},Q=function(e,t,i){if(function(e,t){Array.from(e.classList).forEach(function(i){Object.values(g).includes(i)||Object.values(y).includes(i)||Object.values(t.showClass||{}).includes(i)||e.classList.remove(i)})}(e,t),t.customClass&&t.customClass[i]){if("string"!=typeof t.customClass[i]&&!t.customClass[i].forEach)return void $("Invalid type of customClass.".concat(i,'! Expected string or iterable object, got "').concat(s(t.customClass[i]),'"'));et(e,t.customClass[i])}},Z=function(e,t){if(!t)return null;switch(t){case"select":case"textarea":case"file":return e.querySelector(".".concat(g.popup," > .").concat(g[t]));case"checkbox":return e.querySelector(".".concat(g.popup," > .").concat(g.checkbox," input"));case"radio":return e.querySelector(".".concat(g.popup," > .").concat(g.radio," input:checked"))||e.querySelector(".".concat(g.popup," > .").concat(g.radio," input:first-child"));case"range":return e.querySelector(".".concat(g.popup," > .").concat(g.range," input"));default:return e.querySelector(".".concat(g.popup," > .").concat(g.input))}},J=function(e){if(e.focus(),"file"!==e.type){var t=e.value;e.value="",e.value=t}},ee=function(e,t,i){e&&t&&("string"==typeof t&&(t=t.split(/\s+/).filter(Boolean)),t.forEach(function(t){Array.isArray(e)?e.forEach(function(e){i?e.classList.add(t):e.classList.remove(t)}):i?e.classList.add(t):e.classList.remove(t)}))},et=function(e,t){ee(e,t,!0)},ei=function(e,t){ee(e,t,!1)},en=function(e,t){for(var i=Array.from(e.children),n=0;n<i.length;n++){var s=i[n];if(s instanceof HTMLElement&&Y(s,t))return s}},es=function(e,t,i){i==="".concat(parseInt(i))&&(i=parseInt(i)),i||0===parseInt(i)?e.style.setProperty(t,"number"==typeof i?"".concat(i,"px"):i):e.style.removeProperty(t)},er=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"flex";e&&(e.style.display=t)},ea=function(e){e&&(e.style.display="none")},eo=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"block";e&&new MutationObserver(function(){eu(e,e.innerHTML,t)}).observe(e,{childList:!0,subtree:!0})},el=function(e,t,i,n){var s=e.querySelector(t);s&&s.style.setProperty(i,n)},eu=function(e,t){t?er(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"flex"):ea(e)},ed=function(e){return!(!e||!(e.offsetWidth||e.offsetHeight||e.getClientRects().length))},eh=function(e){return e.scrollHeight>e.clientHeight},ec=function(e){var t=window.getComputedStyle(e),i=parseFloat(t.getPropertyValue("animation-duration")||"0"),n=parseFloat(t.getPropertyValue("transition-duration")||"0");return i>0||n>0},ep=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=V();i&&ed(i)&&(t&&(i.style.transition="none",i.style.width="100%"),setTimeout(function(){i.style.transition="width ".concat(e/1e3,"s linear"),i.style.width="0%"},10))},em=function(){return"undefined"==typeof window||"undefined"==typeof document},ef='\n <div aria-labelledby="'.concat(g.title,'" aria-describedby="').concat(g["html-container"],'" class="').concat(g.popup,'" tabindex="-1">\n <button type="button" class="').concat(g.close,'"></button>\n <ul class="').concat(g["progress-steps"],'"></ul>\n <div class="').concat(g.icon,'"></div>\n <img class="').concat(g.image,'" />\n <h2 class="').concat(g.title,'" id="').concat(g.title,'"></h2>\n <div class="').concat(g["html-container"],'" id="').concat(g["html-container"],'"></div>\n <input class="').concat(g.input,'" id="').concat(g.input,'" />\n <input type="file" class="').concat(g.file,'" />\n <div class="').concat(g.range,'">\n <input type="range" />\n <output></output>\n </div>\n <select class="').concat(g.select,'" id="').concat(g.select,'"></select>\n <div class="').concat(g.radio,'"></div>\n <label class="').concat(g.checkbox,'">\n <input type="checkbox" id="').concat(g.checkbox,'" />\n <span class="').concat(g.label,'"></span>\n </label>\n <textarea class="').concat(g.textarea,'" id="').concat(g.textarea,'"></textarea>\n <div class="').concat(g["validation-message"],'" id="').concat(g["validation-message"],'"></div>\n <div class="').concat(g.actions,'">\n <div class="').concat(g.loader,'"></div>\n <button type="button" class="').concat(g.confirm,'"></button>\n <button type="button" class="').concat(g.deny,'"></button>\n <button type="button" class="').concat(g.cancel,'"></button>\n </div>\n <div class="').concat(g.footer,'"></div>\n <div class="').concat(g["timer-progress-bar-container"],'">\n <div class="').concat(g["timer-progress-bar"],'"></div>\n </div>\n </div>\n').replace(/(^|\n)\s*/g,""),eg=function(){m.currentInstance.resetValidationMessage()},ey=function(e){var t,i=!!(t=x())&&(t.remove(),ei([document.documentElement,document.body],[g["no-backdrop"],g["toast-shown"],g["has-column"]]),!0);if(em())T("SweetAlert2 requires document to initialize");else{var n=document.createElement("div");n.className=g.container,i&&et(n,g["no-transition"]),K(n,ef);var s,r,a,o,l,u,d,h,c,p,m,f,y="string"==typeof(s=e.target)?document.querySelector(s):s;y.appendChild(n),p=e,(m=A()).setAttribute("role",p.toast?"alert":"dialog"),m.setAttribute("aria-live",p.toast?"polite":"assertive"),p.toast||m.setAttribute("aria-modal","true"),f=y,"rtl"===window.getComputedStyle(f).direction&&et(x(),g.rtl),r=A(),a=en(r,g.input),o=en(r,g.file),l=r.querySelector(".".concat(g.range," input")),u=r.querySelector(".".concat(g.range," output")),d=en(r,g.select),h=r.querySelector(".".concat(g.checkbox," input")),c=en(r,g.textarea),a.oninput=eg,o.onchange=eg,d.onchange=eg,h.onchange=eg,c.oninput=eg,l.oninput=function(){eg(),u.value=l.value},l.onchange=function(){eg(),u.value=l.value}}},ev=function(e,t){e instanceof HTMLElement?t.appendChild(e):"object"===s(e)?e8(e,t):e&&K(t,e)},e8=function(e,t){e.jquery?eb(t,e):K(t,e.toString())},eb=function(e,t){if(e.textContent="",0 in t)for(var i=0;(i in t);i++)e.appendChild(t[i].cloneNode(!0));else e.appendChild(t.cloneNode(!0))},e$=function(){if(em())return!1;var e=document.createElement("div");return void 0!==e.style.webkitAnimation?"webkitAnimationEnd":void 0!==e.style.animation&&"animationend"}(),eT=function(e,t){var i,n,s,r,a,o,l=q(),u=j();l&&u&&(t.showConfirmButton||t.showDenyButton||t.showCancelButton?er(l):ea(l),Q(l,t,"actions"),i=l,n=u,s=t,r=B(),a=F(),o=U(),r&&a&&o&&(ew(r,"confirm",s),ew(a,"deny",s),ew(o,"cancel",s),function(e,t,i,n){if(!n.buttonsStyling)return void ei([e,t,i],g.styled);et([e,t,i],g.styled),n.confirmButtonColor&&(e.style.backgroundColor=n.confirmButtonColor,et(e,g["default-outline"])),n.denyButtonColor&&(t.style.backgroundColor=n.denyButtonColor,et(t,g["default-outline"])),n.cancelButtonColor&&(i.style.backgroundColor=n.cancelButtonColor,et(i,g["default-outline"]))}(r,a,o,s),s.reverseButtons&&(s.toast?(i.insertBefore(o,r),i.insertBefore(a,r)):(i.insertBefore(o,n),i.insertBefore(a,n),i.insertBefore(r,n)))),K(u,t.loaderHtml||""),Q(u,t,"loader"))};function ew(e,t,i){var n=b(t);eu(e,i["show".concat(n,"Button")],"inline-block"),K(e,i["".concat(t,"ButtonText")]||""),e.setAttribute("aria-label",i["".concat(t,"ButtonAriaLabel")]||""),e.className=g[t],Q(e,i,"".concat(t,"Button"))}var e_=function(e,t){var i,n,s,r,a,o,l=x();l&&(i=l,"string"==typeof(n=t.backdrop)?i.style.background=n:n||et([document.documentElement,document.body],g["no-backdrop"]),s=l,(r=t.position)&&(r in g?et(s,g[r]):($('The "position" parameter is not valid, defaulting to "center"'),et(s,g.center))),a=l,(o=t.grow)&&et(a,g["grow-".concat(o)]),Q(l,t,"container"))},eS={innerParams:new WeakMap,domCache:new WeakMap},ek=["input","file","range","select","radio","checkbox","textarea"],eE=function(e){if(e.input){if(eL[e.input]){var t=eP(e.input),i=eL[e.input](t,e);er(t),e.inputAutoFocus&&setTimeout(function(){J(i)})}else T("Unexpected type of input! Expected ".concat(Object.keys(eL).join(" | "),', got "').concat(e.input,'"'))}},eC=function(e,t){var i=Z(A(),e);if(i)for(var n in function(e){for(var t=0;t<e.attributes.length;t++){var i=e.attributes[t].name;["id","type","value","style"].includes(i)||e.removeAttribute(i)}}(i),t)i.setAttribute(n,t[n])},e0=function(e){var t=eP(e.input);"object"===s(e.customClass)&&et(t,e.customClass.input)},ex=function(e,t){e.placeholder&&!t.inputPlaceholder||(e.placeholder=t.inputPlaceholder)},eI=function(e,t,i){if(i.inputLabel){var n=document.createElement("label"),r=g["input-label"];n.setAttribute("for",e.id),n.className=r,"object"===s(i.customClass)&&et(n,i.customClass.inputLabel),n.innerText=i.inputLabel,t.insertAdjacentElement("beforebegin",n)}},eP=function(e){return en(A(),g[e]||g.input)},eA=function(e,t){["string","number"].includes(s(t))?e.value="".concat(t):C(t)||$('Unexpected type of inputValue! Expected "string", "number" or "Promise", got "'.concat(s(t),'"'))},eL={};eL.text=eL.email=eL.password=eL.number=eL.tel=eL.url=eL.search=eL.date=eL["datetime-local"]=eL.time=eL.week=eL.month=function(e,t){return eA(e,t.inputValue),eI(e,e,t),ex(e,t),e.type=t.input,e},eL.file=function(e,t){return eI(e,e,t),ex(e,t),e},eL.range=function(e,t){var i=e.querySelector("input"),n=e.querySelector("output");return eA(i,t.inputValue),i.type=t.input,eA(n,t.inputValue),eI(i,e,t),e},eL.select=function(e,t){if(e.textContent="",t.inputPlaceholder){var i=document.createElement("option");K(i,t.inputPlaceholder),i.value="",i.disabled=!0,i.selected=!0,e.appendChild(i)}return eI(e,e,t),e},eL.radio=function(e){return e.textContent="",e},eL.checkbox=function(e,t){var i=Z(A(),"checkbox");return i.value="1",i.checked=Boolean(t.inputValue),K(e.querySelector("span"),t.inputPlaceholder),i},eL.textarea=function(e,t){return eA(e,t.inputValue),ex(e,t),eI(e,e,t),setTimeout(function(){if("MutationObserver"in window){var i=parseInt(window.getComputedStyle(A()).width);new MutationObserver(function(){if(document.body.contains(e)){var n,s=e.offsetWidth+(n=e,parseInt(window.getComputedStyle(n).marginLeft)+parseInt(window.getComputedStyle(n).marginRight));s>i?A().style.width="".concat(s,"px"):es(A(),"width",t.width)}}).observe(e,{attributes:!0,attributeFilter:["style"]})}}),e};var eD=function(e,t){var i=O();i&&(eo(i),Q(i,t,"htmlContainer"),t.html?(ev(t.html,i),er(i,"block")):t.text?(i.textContent=t.text,er(i,"block")):ea(i),function(e,t){var i=A();if(i){var n=eS.innerParams.get(e),s=!n||t.input!==n.input;ek.forEach(function(e){var n=en(i,g[e]);n&&(eC(e,t.inputAttributes),n.className=g[e],s&&ea(n))}),t.input&&(s&&eE(t),e0(t))}}(e,t))},eO=function(e,t){for(var i=0,n=Object.entries(y);i<n.length;i++){var s=h(n[i],2),r=s[0],a=s[1];t.icon!==r&&ei(e,a)}et(e,t.icon&&y[t.icon]),eM(e,t),eR(),Q(e,t,"icon")},eR=function(){var e=A();if(e)for(var t=window.getComputedStyle(e).getPropertyValue("background-color"),i=e.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix"),n=0;n<i.length;n++)i[n].style.backgroundColor=t},eN=function(e,t){if(t.icon||t.iconHtml){var i=e.innerHTML,n="";t.iconHtml?n=e3(t.iconHtml):"success"===t.icon?(n='\n <div class="swal2-success-circular-line-left"></div>\n <span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span>\n <div class="swal2-success-ring"></div> <div class="swal2-success-fix"></div>\n <div class="swal2-success-circular-line-right"></div>\n',i=i.replace(/ style=".*?"/g,"")):"error"===t.icon?n='\n <span class="swal2-x-mark">\n <span class="swal2-x-mark-line-left"></span>\n <span class="swal2-x-mark-line-right"></span>\n </span>\n':t.icon&&(n=e3({question:"?",warning:"!",info:"i"}[t.icon])),i.trim()!==n.trim()&&K(e,n)}},eM=function(e,t){if(t.iconColor){e.style.color=t.iconColor,e.style.borderColor=t.iconColor;for(var i=0,n=[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"];i<n.length;i++)el(e,n[i],"background-color",t.iconColor);el(e,".swal2-success-ring","border-color",t.iconColor)}},e3=function(e){return'<div class="'.concat(g["icon-content"],'">').concat(e,"</div>")},eB=function(e,t){var i=t.showClass||{};e.className="".concat(g.popup," ").concat(ed(e)?i.popup:""),t.toast?(et([document.documentElement,document.body],g["toast-shown"]),et(e,g.toast)):et(e,g.modal),Q(e,t,"popup"),"string"==typeof t.customClass&&et(e,t.customClass),t.icon&&et(e,g["icon-".concat(t.icon)])},eU=function(e){var t=document.createElement("li");return et(t,g["progress-step"]),K(t,e),t},e2=function(e){var t=document.createElement("li");return et(t,g["progress-step-line"]),e.progressStepsDistance&&es(t,"width",e.progressStepsDistance),t},e1=function(e,t){(function(e,t){var i=x(),n=A();if(i&&n){if(t.toast){es(i,"width",t.width),n.style.width="100%";var s=j();s&&n.insertBefore(s,L())}else es(n,"width",t.width);es(n,"padding",t.padding),t.color&&(n.style.color=t.color),t.background&&(n.style.background=t.background),ea(M()),eB(n,t)}})(0,t),e_(0,t),function(e,t){var i=N();if(i){var n=t.progressSteps,s=t.currentProgressStep;n&&0!==n.length&&void 0!==s?(er(i),i.textContent="",s>=n.length&&$("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),n.forEach(function(e,r){var a=eU(e);if(i.appendChild(a),r===s&&et(a,g["active-progress-step"]),r!==n.length-1){var o=e2(t);i.appendChild(o)}})):ea(i)}}(0,t),function(e,t){var i=eS.innerParams.get(e),n=L();if(n){if(i&&t.icon===i.icon)return eN(n,t),void eO(n,t);if(t.icon||t.iconHtml){if(t.icon&&-1===Object.keys(y).indexOf(t.icon))return T('Unknown icon! Expected "success", "error", "warning", "info" or "question", got "'.concat(t.icon,'"')),void ea(n);er(n),eN(n,t),eO(n,t),et(n,t.showClass&&t.showClass.icon)}else ea(n)}}(e,t),i=t,(n=R())&&(i.imageUrl?(er(n,""),n.setAttribute("src",i.imageUrl),n.setAttribute("alt",i.imageAlt||""),es(n,"width",i.imageWidth),es(n,"height",i.imageHeight),n.className=g.image,Q(n,i,"image")):ea(n)),s=t,(r=D())&&(eo(r),eu(r,s.title||s.titleText,"block"),s.title&&ev(s.title,r),s.titleText&&(r.innerText=s.titleText),Q(r,s,"title")),a=t,(o=W())&&(K(o,a.closeButtonHtml||""),Q(o,a,"closeButton"),eu(o,a.showCloseButton),o.setAttribute("aria-label",a.closeButtonAriaLabel||"")),eD(e,t),eT(0,t),l=t,(u=H())&&(eo(u),eu(u,l.footer,"block"),l.footer&&ev(l.footer,u),Q(u,l,"footer"));var i,n,s,r,a,o,l,u,d=A();"function"==typeof t.didRender&&d&&t.didRender(d)},e4=function(){var e;return null===(e=B())||void 0===e?void 0:e.click()},e6=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),eF=function(e){e.keydownTarget&&e.keydownHandlerAdded&&(e.keydownTarget.removeEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1)},ej=function(e,t){var i,n=z();if(n.length)return(e+=t)===n.length?e=0:-1===e&&(e=n.length-1),void n[e].focus();null===(i=A())||void 0===i||i.focus()},e5=["ArrowRight","ArrowDown"],eq=["ArrowLeft","ArrowUp"],eH=function(e,t,i){e&&(t.isComposing||229===t.keyCode||(e.stopKeydownPropagation&&t.stopPropagation(),"Enter"===t.key?eV(t,e):"Tab"===t.key?e7(t):[].concat(e5,eq).includes(t.key)?e9(t.key):"Escape"===t.key&&eW(t,e,i)))},eV=function(e,t){if(S(t.allowEnterKey)){var i=Z(A(),t.input);if(e.target&&i&&e.target instanceof HTMLElement&&e.target.outerHTML===i.outerHTML){if(["textarea","file"].includes(t.input))return;e4(),e.preventDefault()}}},e7=function(e){for(var t=e.target,i=z(),n=-1,s=0;s<i.length;s++)if(t===i[s]){n=s;break}e.shiftKey?ej(n,-1):ej(n,1),e.stopPropagation(),e.preventDefault()},e9=function(e){var t=q(),i=B(),n=F(),s=U();if(t&&i&&n&&s&&(!(document.activeElement instanceof HTMLElement)||[i,n,s].includes(document.activeElement))){var r=e5.includes(e)?"nextElementSibling":"previousElementSibling",a=document.activeElement;if(a){for(var o=0;o<t.children.length;o++){if(!(a=a[r]))return;if(a instanceof HTMLButtonElement&&ed(a))break}a instanceof HTMLButtonElement&&a.focus()}}},eW=function(e,t,i){S(t.allowEscapeKey)&&(e.preventDefault(),i(e6.esc))},ez={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap},eG=function(){Array.from(document.body.children).forEach(function(e){e.hasAttribute("data-previous-aria-hidden")?(e.setAttribute("aria-hidden",e.getAttribute("data-previous-aria-hidden")||""),e.removeAttribute("data-previous-aria-hidden")):e.removeAttribute("aria-hidden")})},eX="undefined"!=typeof window&&!!window.GestureEvent,eK=function(){var e,t=x();t&&(t.ontouchstart=function(t){e=eY(t)},t.ontouchmove=function(t){e&&(t.preventDefault(),t.stopPropagation())})},eY=function(e){var t=e.target,i=x(),n=O();return!(!i||!n)&&!eQ(e)&&!eZ(e)&&(t===i||!eh(i)&&t instanceof HTMLElement&&"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName&&(!eh(n)||!n.contains(t)))},eQ=function(e){return e.touches&&e.touches.length&&"stylus"===e.touches[0].touchType},eZ=function(e){return e.touches&&e.touches.length>1},eJ=null,te=function(e){var t,i;null===eJ&&(document.body.scrollHeight>window.innerHeight||"scroll"===e)&&(eJ=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight="".concat(eJ+((t=document.createElement("div")).className=g["scrollbar-measure"],document.body.appendChild(t),i=t.getBoundingClientRect().width-t.clientWidth,document.body.removeChild(t),i),"px"))};function tt(e,t,i,n){var s;X()?tu(e,n):((s=i,new Promise(function(e){if(!s)return e();var t=window.scrollX,i=window.scrollY;m.restoreFocusTimeout=setTimeout(function(){m.previousActiveElement instanceof HTMLElement?(m.previousActiveElement.focus(),m.previousActiveElement=null):document.body&&document.body.focus(),e()},100),window.scrollTo(t,i)})).then(function(){return tu(e,n)}),eF(m)),eX?(t.setAttribute("style","display:none !important"),t.removeAttribute("class"),t.innerHTML=""):t.remove(),G()&&(null!==eJ&&(document.body.style.paddingRight="".concat(eJ,"px"),eJ=null),function(){if(Y(document.body,g.iosfix)){var e=parseInt(document.body.style.top,10);ei(document.body,g.iosfix),document.body.style.top="",document.body.scrollTop=-1*e}}(),eG()),ei([document.documentElement,document.body],[g.shown,g["height-auto"],g["no-backdrop"],g["toast-shown"]])}function ti(e){e=ta(e);var t=ez.swalPromiseResolve.get(this),i=tn(this);this.isAwaitingPromise?e.isDismissed||(tr(this),t(e)):i&&t(e)}var tn=function(e){var t=A();if(!t)return!1;var i=eS.innerParams.get(e);if(!i||Y(t,i.hideClass.popup))return!1;ei(t,i.showClass.popup),et(t,i.hideClass.popup);var n=x();return ei(n,i.showClass.backdrop),et(n,i.hideClass.backdrop),to(e,t,i),!0};function ts(e){var t=ez.swalPromiseReject.get(this);tr(this),t&&t(e)}var tr=function(e){e.isAwaitingPromise&&(delete e.isAwaitingPromise,eS.innerParams.get(e)||e._destroy())},ta=function(e){return void 0===e?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},e)},to=function(e,t,i){var n=x(),s=e$&&ec(t);"function"==typeof i.willClose&&i.willClose(t),s?tl(e,t,n,i.returnFocus,i.didClose):tt(e,n,i.returnFocus,i.didClose)},tl=function(e,t,i,n,s){e$&&(m.swalCloseEventFinishedCallback=tt.bind(null,e,i,n,s),t.addEventListener(e$,function(e){e.target===t&&(m.swalCloseEventFinishedCallback(),delete m.swalCloseEventFinishedCallback)}))},tu=function(e,t){setTimeout(function(){"function"==typeof t&&t.bind(e.params)(),e._destroy&&e._destroy()})},td=function(e){var t=A();if(t||new iI,t=A()){var i=j();X()?ea(L()):th(t,e),er(i),t.setAttribute("data-loading","true"),t.setAttribute("aria-busy","true"),t.focus()}},th=function(e,t){var i=q(),n=j();i&&n&&(!t&&ed(B())&&(t=B()),er(i),t&&(ea(t),n.setAttribute("data-button-to-replace",t.className),i.insertBefore(n,t)),et([e,i],g.loading))},tc=function(e,t){var i=A();if(i){var n=function(e){"select"===t.input?function(e,t,i){var n=en(e,g.select);if(n){var s=function(e,t,n){var s=document.createElement("option");s.value=n,K(s,t),s.selected=tf(n,i.inputValue),e.appendChild(s)};t.forEach(function(e){var t=e[0],i=e[1];if(Array.isArray(i)){var r=document.createElement("optgroup");r.label=t,r.disabled=!1,n.appendChild(r),i.forEach(function(e){return s(r,e[1],e[0])})}else s(n,i,t)}),n.focus()}}(i,tm(e),t):"radio"===t.input&&function(e,t,i){var n=en(e,g.radio);if(n){t.forEach(function(e){var t=e[0],s=e[1],r=document.createElement("input"),a=document.createElement("label");r.type="radio",r.name=g.radio,r.value=t,tf(t,i.inputValue)&&(r.checked=!0);var o=document.createElement("span");K(o,s),o.className=g.label,a.appendChild(r),a.appendChild(o),n.appendChild(a)});var s=n.querySelectorAll("input");s.length&&s[0].focus()}}(i,tm(e),t)};k(t.inputOptions)||C(t.inputOptions)?(td(B()),E(t.inputOptions).then(function(t){e.hideLoading(),n(t)})):"object"===s(t.inputOptions)?n(t.inputOptions):T("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(s(t.inputOptions)))}},tp=function(e,t){var i=e.getInput();i&&(ea(i),E(t.inputValue).then(function(n){i.value="number"===t.input?"".concat(parseFloat(n)||0):"".concat(n),er(i),i.focus(),e.hideLoading()}).catch(function(t){T("Error in inputValue promise: ".concat(t)),i.value="",er(i),i.focus(),e.hideLoading()}))},tm=function e(t){var i=[];return t instanceof Map?t.forEach(function(t,n){var r=t;"object"===s(r)&&(r=e(r)),i.push([n,r])}):Object.keys(t).forEach(function(n){var r=t[n];"object"===s(r)&&(r=e(r)),i.push([n,r])}),i},tf=function(e,t){return!!t&&t.toString()===e.toString()},tg=void 0,ty=function(e,t){var i=eS.innerParams.get(e);if(i.input){var n=e.getInput(),s=function(e,t){var i,n,s,r=e.getInput();if(!r)return null;switch(t.input){case"checkbox":return(i=r).checked?1:0;case"radio":return(n=r).checked?n.value:null;case"file":return(s=r).files&&s.files.length?null!==s.getAttribute("multiple")?s.files:s.files[0]:null;default:return t.inputAutoTrim?r.value.trim():r.value}}(e,i);i.inputValidator?tv(e,s,t):n&&!n.checkValidity()?(e.enableButtons(),e.showValidationMessage(i.validationMessage||n.validationMessage)):"deny"===t?t8(e,s):tT(e,s)}else T('The "input" parameter is needed to be set when using returnInputValueOn'.concat(b(t)))},tv=function(e,t,i){var n=eS.innerParams.get(e);e.disableInput(),Promise.resolve().then(function(){return E(n.inputValidator(t,n.validationMessage))}).then(function(n){e.enableButtons(),e.enableInput(),n?e.showValidationMessage(n):"deny"===i?t8(e,t):tT(e,t)})},t8=function(e,t){var i=eS.innerParams.get(e||tg);(i.showLoaderOnDeny&&td(F()),i.preDeny)?(e.isAwaitingPromise=!0,Promise.resolve().then(function(){return E(i.preDeny(t,i.validationMessage))}).then(function(i){!1===i?(e.hideLoading(),tr(e)):e.close({isDenied:!0,value:void 0===i?t:i})}).catch(function(t){return t$(e||tg,t)})):e.close({isDenied:!0,value:t})},tb=function(e,t){e.close({isConfirmed:!0,value:t})},t$=function(e,t){e.rejectPromise(t)},tT=function(e,t){var i=eS.innerParams.get(e||tg);(i.showLoaderOnConfirm&&td(),i.preConfirm)?(e.resetValidationMessage(),e.isAwaitingPromise=!0,Promise.resolve().then(function(){return E(i.preConfirm(t,i.validationMessage))}).then(function(i){ed(M())||!1===i?(e.hideLoading(),tr(e)):tb(e,void 0===i?t:i)}).catch(function(t){return t$(e||tg,t)})):tb(e,t)};function tw(){var e=eS.innerParams.get(this);if(e){var t=eS.domCache.get(this);ea(t.loader),X()?e.icon&&er(L()):t_(t),ei([t.popup,t.actions],g.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.denyButton.disabled=!1,t.cancelButton.disabled=!1}}var t_=function(e){var t=e.popup.getElementsByClassName(e.loader.getAttribute("data-button-to-replace"));t.length?er(t[0],"inline-block"):ed(B())||ed(F())||ed(U())||ea(e.actions)};function tS(){var e=eS.innerParams.get(this),t=eS.domCache.get(this);return t?Z(t.popup,e.input):null}function tk(e,t,i){var n=eS.domCache.get(e);t.forEach(function(e){n[e].disabled=i})}function tE(e,t){var i=A();if(i&&e){if("radio"===e.type)for(var n=i.querySelectorAll('[name="'.concat(g.radio,'"]')),s=0;s<n.length;s++)n[s].disabled=t;else e.disabled=t}}function tC(){tk(this,["confirmButton","denyButton","cancelButton"],!1)}function t0(){tk(this,["confirmButton","denyButton","cancelButton"],!0)}function tx(){tE(this.getInput(),!1)}function tI(){tE(this.getInput(),!0)}function tP(e){var t=eS.domCache.get(this),i=eS.innerParams.get(this);K(t.validationMessage,e),t.validationMessage.className=g["validation-message"],i.customClass&&i.customClass.validationMessage&&et(t.validationMessage,i.customClass.validationMessage),er(t.validationMessage);var n=this.getInput();n&&(n.setAttribute("aria-invalid","true"),n.setAttribute("aria-describedby",g["validation-message"]),J(n),et(n,g.inputerror))}function tA(){var e=eS.domCache.get(this);e.validationMessage&&ea(e.validationMessage);var t=this.getInput();t&&(t.removeAttribute("aria-invalid"),t.removeAttribute("aria-describedby"),ei(t,g.inputerror))}var tL={title:"",titleText:"",text:"",html:"",footer:"",icon:void 0,iconColor:void 0,iconHtml:void 0,template:void 0,toast:!1,animation:!0,showClass:{popup:"swal2-show",backdrop:"swal2-backdrop-show",icon:"swal2-icon-show"},hideClass:{popup:"swal2-hide",backdrop:"swal2-backdrop-hide",icon:"swal2-icon-hide"},customClass:{},target:"body",color:void 0,backdrop:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showDenyButton:!1,showCancelButton:!1,preConfirm:void 0,preDeny:void 0,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:void 0,denyButtonText:"No",denyButtonAriaLabel:"",denyButtonColor:void 0,cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:void 0,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusDeny:!1,focusCancel:!1,returnFocus:!0,showCloseButton:!1,closeButtonHtml:"×",closeButtonAriaLabel:"Close this dialog",loaderHtml:"",showLoaderOnConfirm:!1,showLoaderOnDeny:!1,imageUrl:void 0,imageWidth:void 0,imageHeight:void 0,imageAlt:"",timer:void 0,timerProgressBar:!1,width:void 0,padding:void 0,background:void 0,input:void 0,inputPlaceholder:"",inputLabel:"",inputValue:"",inputOptions:{},inputAutoFocus:!0,inputAutoTrim:!0,inputAttributes:{},inputValidator:void 0,returnInputValueOnDeny:!1,validationMessage:void 0,grow:!1,position:"center",progressSteps:[],currentProgressStep:void 0,progressStepsDistance:void 0,willOpen:void 0,didOpen:void 0,didRender:void 0,willClose:void 0,didClose:void 0,didDestroy:void 0,scrollbarPadding:!0},tD=["allowEscapeKey","allowOutsideClick","background","buttonsStyling","cancelButtonAriaLabel","cancelButtonColor","cancelButtonText","closeButtonAriaLabel","closeButtonHtml","color","confirmButtonAriaLabel","confirmButtonColor","confirmButtonText","currentProgressStep","customClass","denyButtonAriaLabel","denyButtonColor","denyButtonText","didClose","didDestroy","footer","hideClass","html","icon","iconColor","iconHtml","imageAlt","imageHeight","imageUrl","imageWidth","preConfirm","preDeny","progressSteps","returnFocus","reverseButtons","showCancelButton","showCloseButton","showConfirmButton","showDenyButton","text","title","titleText","willClose"],tO={},tR=["allowOutsideClick","allowEnterKey","backdrop","focusConfirm","focusDeny","focusCancel","returnFocus","heightAuto","keydownListenerCapture"],tN=function(e){return Object.prototype.hasOwnProperty.call(tL,e)},tM=function(e){return -1!==tD.indexOf(e)},t3=function(e){return tO[e]},tB=function(e){tN(e)||$('Unknown parameter "'.concat(e,'"'))},tU=function(e){tR.includes(e)&&$('The parameter "'.concat(e,'" is incompatible with toasts'))},t2=function(e){var t=t3(e);t&&_(e,t)};function t1(e){var t=A(),i=eS.innerParams.get(this);if(t&&!Y(t,i.hideClass.popup)){var n=t4(e),s=Object.assign({},i,n);e1(this,s),eS.innerParams.set(this,s),Object.defineProperties(this,{params:{value:Object.assign({},this.params,e),writable:!1,enumerable:!0}})}else $("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.")}var t4=function(e){var t={};return Object.keys(e).forEach(function(i){tM(i)?t[i]=e[i]:$("Invalid parameter to update: ".concat(i))}),t};function t6(){var e=eS.domCache.get(this),t=eS.innerParams.get(this);t?(e.popup&&m.swalCloseEventFinishedCallback&&(m.swalCloseEventFinishedCallback(),delete m.swalCloseEventFinishedCallback),"function"==typeof t.didDestroy&&t.didDestroy(),tj(this)):t5(this)}var tF,tj=function(e){t5(e),delete e.params,delete m.keydownHandler,delete m.keydownTarget,delete m.currentInstance},t5=function(e){e.isAwaitingPromise?(tq(eS,e),e.isAwaitingPromise=!0):(tq(ez,e),tq(eS,e),delete e.isAwaitingPromise,delete e.disableButtons,delete e.enableButtons,delete e.getInput,delete e.disableInput,delete e.enableInput,delete e.hideLoading,delete e.disableLoading,delete e.showValidationMessage,delete e.resetValidationMessage,delete e.close,delete e.closePopup,delete e.closeModal,delete e.closeToast,delete e.rejectPromise,delete e.update,delete e._destroy)},tq=function(e,t){for(var i in e)e[i].delete(t)},tH=Object.freeze({__proto__:null,_destroy:t6,close:ti,closeModal:ti,closePopup:ti,closeToast:ti,disableButtons:t0,disableInput:tI,disableLoading:tw,enableButtons:tC,enableInput:tx,getInput:tS,handleAwaitingPromise:tr,hideLoading:tw,rejectPromise:ts,resetValidationMessage:tA,showValidationMessage:tP,update:t1}),tV=function(e,t,i){t.popup.onclick=function(){e&&(t7(e)||e.timer||e.input)||i(e6.close)}},t7=function(e){return!!(e.showConfirmButton||e.showDenyButton||e.showCancelButton||e.showCloseButton)},t9=!1,tW=function(e){e.popup.onmousedown=function(){e.container.onmouseup=function(t){e.container.onmouseup=function(){},t.target===e.container&&(t9=!0)}}},tz=function(e){e.container.onmousedown=function(t){t.target===e.container&&t.preventDefault(),e.popup.onmouseup=function(t){e.popup.onmouseup=function(){},(t.target===e.popup||t.target instanceof HTMLElement&&e.popup.contains(t.target))&&(t9=!0)}}},tG=function(e,t,i){t.container.onclick=function(n){t9?t9=!1:n.target===t.container&&S(e.allowOutsideClick)&&i(e6.backdrop)}},tX=function(e){var t;return e instanceof Element||"object"===s(t=e)&&t.jquery},tK=function(){if(m.timeout)return function(){var e=V();if(e){var t=parseInt(window.getComputedStyle(e).width);e.style.removeProperty("transition"),e.style.width="100%";var i=t/parseInt(window.getComputedStyle(e).width)*100;e.style.width="".concat(i,"%")}}(),m.timeout.stop()},tY=function(){if(m.timeout){var e=m.timeout.start();return ep(e),e}},tQ=!1,tZ={},tJ=function(e){for(var t=e.target;t&&t!==document;t=t.parentNode)for(var i in tZ){var n=t.getAttribute(i);if(n)return void tZ[i].fire({template:n})}},ie=Object.freeze({__proto__:null,argsToParams:function(e){var t={};return"object"!==s(e[0])||tX(e[0])?["title","html","icon"].forEach(function(i,n){var r=e[n];"string"==typeof r||tX(r)?t[i]=r:void 0!==r&&T("Unexpected type of ".concat(i,'! Expected "string" or "Element", got ').concat(s(r)))}):Object.assign(t,e[0]),t},bindClickHandler:function(){tZ[arguments.length>0&&void 0!==arguments[0]?arguments[0]:"data-swal-template"]=this,tQ||(document.body.addEventListener("click",tJ),tQ=!0)},clickCancel:function(){var e;return null===(e=U())||void 0===e?void 0:e.click()},clickConfirm:e4,clickDeny:function(){var e;return null===(e=F())||void 0===e?void 0:e.click()},enableLoading:td,fire:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e,t,n){if(i())return Reflect.construct.apply(null,arguments);var s=[null];s.push.apply(s,t);var r=new(e.bind.apply(e,s));return n&&u(r,n.prototype),r}(this,t)},getActions:q,getCancelButton:U,getCloseButton:W,getConfirmButton:B,getContainer:x,getDenyButton:F,getFocusableElements:z,getFooter:H,getHtmlContainer:O,getIcon:L,getIconContent:function(){return P(g["icon-content"])},getImage:R,getInputLabel:function(){return P(g["input-label"])},getLoader:j,getPopup:A,getProgressSteps:N,getTimerLeft:function(){return m.timeout&&m.timeout.getTimerLeft()},getTimerProgressBar:V,getTitle:D,getValidationMessage:M,increaseTimer:function(e){if(m.timeout){var t=m.timeout.increase(e);return ep(t,!0),t}},isDeprecatedParameter:t3,isLoading:function(){var e=A();return!!e&&e.hasAttribute("data-loading")},isTimerRunning:function(){return!(!m.timeout||!m.timeout.isRunning())},isUpdatableParameter:tM,isValidParameter:tN,isVisible:function(){return ed(A())},mixin:function(e){return function(t){function n(){var e,t,s;return r(this,n),e=this,t=n,s=arguments,t=l(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,i()?Reflect.construct(t,s||[],l(e).constructor):t.apply(e,s))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}(n,t),o(n,[{key:"_main",value:function(t,i){return d(l(n.prototype),"_main",this).call(this,t,Object.assign({},e,i))}}])}(this)},resumeTimer:tY,showLoading:td,stopTimer:tK,toggleTimer:function(){var e=m.timeout;return e&&(e.running?tK():tY())}}),it=o(function e(t,i){r(this,e),this.callback=t,this.remaining=i,this.running=!1,this.start()},[{key:"start",value:function(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}},{key:"stop",value:function(){return this.started&&this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=(new Date).getTime()-this.started.getTime()),this.remaining}},{key:"increase",value:function(e){var t=this.running;return t&&this.stop(),this.remaining+=e,t&&this.start(),this.remaining}},{key:"getTimerLeft",value:function(){return this.running&&(this.stop(),this.start()),this.remaining}},{key:"isRunning",value:function(){return this.running}}]),ii=["swal-title","swal-html","swal-footer"],is=function(e){var t={};return Array.from(e.querySelectorAll("swal-param")).forEach(function(e){ic(e,["name","value"]);var i=e.getAttribute("name"),n=e.getAttribute("value");"boolean"==typeof tL[i]?t[i]="false"!==n:"object"===s(tL[i])?t[i]=JSON.parse(n):t[i]=n}),t},ir=function(e){var t={};return Array.from(e.querySelectorAll("swal-function-param")).forEach(function(e){var i=e.getAttribute("name"),n=e.getAttribute("value");t[i]=Function("return ".concat(n))()}),t},ia=function(e){var t={};return Array.from(e.querySelectorAll("swal-button")).forEach(function(e){ic(e,["type","color","aria-label"]);var i=e.getAttribute("type");t["".concat(i,"ButtonText")]=e.innerHTML,t["show".concat(b(i),"Button")]=!0,e.hasAttribute("color")&&(t["".concat(i,"ButtonColor")]=e.getAttribute("color")),e.hasAttribute("aria-label")&&(t["".concat(i,"ButtonAriaLabel")]=e.getAttribute("aria-label"))}),t},io=function(e){var t={},i=e.querySelector("swal-image");return i&&(ic(i,["src","width","height","alt"]),i.hasAttribute("src")&&(t.imageUrl=i.getAttribute("src")),i.hasAttribute("width")&&(t.imageWidth=i.getAttribute("width")),i.hasAttribute("height")&&(t.imageHeight=i.getAttribute("height")),i.hasAttribute("alt")&&(t.imageAlt=i.getAttribute("alt"))),t},il=function(e){var t={},i=e.querySelector("swal-icon");return i&&(ic(i,["type","color"]),i.hasAttribute("type")&&(t.icon=i.getAttribute("type")),i.hasAttribute("color")&&(t.iconColor=i.getAttribute("color")),t.iconHtml=i.innerHTML),t},iu=function(e){var t={},i=e.querySelector("swal-input");i&&(ic(i,["type","label","placeholder","value"]),t.input=i.getAttribute("type")||"text",i.hasAttribute("label")&&(t.inputLabel=i.getAttribute("label")),i.hasAttribute("placeholder")&&(t.inputPlaceholder=i.getAttribute("placeholder")),i.hasAttribute("value")&&(t.inputValue=i.getAttribute("value")));var n=Array.from(e.querySelectorAll("swal-input-option"));return n.length&&(t.inputOptions={},n.forEach(function(e){ic(e,["value"]);var i=e.getAttribute("value"),n=e.innerHTML;t.inputOptions[i]=n})),t},id=function(e,t){var i={};for(var n in t){var s=t[n],r=e.querySelector(s);r&&(ic(r,[]),i[s.replace(/^swal-/,"")]=r.innerHTML.trim())}return i},ih=function(e){var t=ii.concat(["swal-param","swal-function-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);Array.from(e.children).forEach(function(e){var i=e.tagName.toLowerCase();t.includes(i)||$("Unrecognized element <".concat(i,">"))})},ic=function(e,t){Array.from(e.attributes).forEach(function(i){-1===t.indexOf(i.name)&&$(['Unrecognized attribute "'.concat(i.name,'" on <').concat(e.tagName.toLowerCase(),">."),"".concat(t.length?"Allowed attributes are: ".concat(t.join(", ")):"To set the value, use HTML within the element.")])})},ip=function(e){var t=x(),i=A();"function"==typeof e.willOpen&&e.willOpen(i);var n,s=window.getComputedStyle(document.body).overflowY;iv(t,i,e),setTimeout(function(){ig(t,i)},10),G()&&(iy(t,e.scrollbarPadding,s),n=x(),Array.from(document.body.children).forEach(function(e){e.contains(n)||(e.hasAttribute("aria-hidden")&&e.setAttribute("data-previous-aria-hidden",e.getAttribute("aria-hidden")||""),e.setAttribute("aria-hidden","true"))})),X()||m.previousActiveElement||(m.previousActiveElement=document.activeElement),"function"==typeof e.didOpen&&setTimeout(function(){return e.didOpen(i)}),ei(t,g["no-transition"])},im=function e(t){var i=A();if(t.target===i&&e$){var n=x();i.removeEventListener(e$,e),n.style.overflowY="auto"}},ig=function(e,t){e$&&ec(t)?(e.style.overflowY="hidden",t.addEventListener(e$,im)):e.style.overflowY="auto"},iy=function(e,t,i){(function(){if(eX&&!Y(document.body,g.iosfix)){var e=document.body.scrollTop;document.body.style.top="".concat(-1*e,"px"),et(document.body,g.iosfix),eK()}})(),t&&"hidden"!==i&&te(i),setTimeout(function(){e.scrollTop=0})},iv=function(e,t,i){et(e,i.showClass.backdrop),i.animation?(t.style.setProperty("opacity","0","important"),er(t,"grid"),setTimeout(function(){et(t,i.showClass.popup),t.style.removeProperty("opacity")},10)):er(t,"grid"),et([document.documentElement,document.body],g.shown),i.heightAuto&&i.backdrop&&!i.toast&&et([document.documentElement,document.body],g["height-auto"])},i8={email:function(e,t){return/^[a-zA-Z0-9.+_'-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]+$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid email address")},url:function(e,t){return/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid URL")}},ib=new WeakMap,i$=o(function t(){var i,n,s;if(r(this,t),i=this,n=ib,s=void 0,function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}(i,n),n.set(i,s),"undefined"!=typeof window){tF=this;for(var a=arguments.length,o=Array(a),l=0;l<a;l++)o[l]=arguments[l];var u,d,h,c=Object.freeze(this.constructor.argsToParams(o));this.params=c,this.isAwaitingPromise=!1,u=ib,d=this,h=this._main(tF.params),u.set(e(u,d),h)}},[{key:"_main",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(function(e){for(var t in!1===e.backdrop&&e.allowOutsideClick&&$('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`'),e)tB(t),e.toast&&tU(t),t2(t)}(Object.assign({},t,e)),m.currentInstance){var i=ez.swalPromiseResolve.get(m.currentInstance),n=m.currentInstance.isAwaitingPromise;m.currentInstance._destroy(),n||i({isDismissed:!0}),G()&&eG()}m.currentInstance=tF;var s,r,a,o=iw(e,t);(r=s=o).inputValidator||("email"===r.input&&(r.inputValidator=i8.email),"url"===r.input&&(r.inputValidator=i8.url)),s.showLoaderOnConfirm&&!s.preConfirm&&$("showLoaderOnConfirm is set to true, but preConfirm is not defined.\nshowLoaderOnConfirm should be used together with preConfirm, see usage example:\nhttps://sweetalert2.github.io/#ajax-request"),(a=s).target&&("string"!=typeof a.target||document.querySelector(a.target))&&("string"==typeof a.target||a.target.appendChild)||($('Target parameter is not valid, defaulting to "body"'),a.target="body"),"string"==typeof s.title&&(s.title=s.title.split("\n").join("<br />")),ey(s),Object.freeze(o),m.timeout&&(m.timeout.stop(),delete m.timeout),clearTimeout(m.restoreFocusTimeout);var l=i_(tF);return e1(tF,o),eS.innerParams.set(tF,o),iT(tF,l,o)}},{key:"then",value:function(e){return t(ib,this).then(e)}},{key:"finally",value:function(e){return t(ib,this).finally(e)}}]),iT=function(e,t,i){return new Promise(function(n,s){var r,a,o,l,u,d,h,c,p=function(t){e.close({isDismissed:!0,dismiss:t})};ez.swalPromiseResolve.set(e,n),ez.swalPromiseReject.set(e,s),t.confirmButton.onclick=function(){var t,i;t=e,i=eS.innerParams.get(t),t.disableButtons(),i.input?ty(t,"confirm"):tT(t,!0)},t.denyButton.onclick=function(){var t,i;t=e,i=eS.innerParams.get(t),t.disableButtons(),i.returnInputValueOnDeny?ty(t,"deny"):t8(t,!1)},t.cancelButton.onclick=function(){var t,i;t=e,i=p,t.disableButtons(),i(e6.cancel)},t.closeButton.onclick=function(){p(e6.close)},r=i,a=t,o=p,r.toast?tV(r,a,o):(tW(a),tz(a),tG(r,a,o)),l=m,u=i,d=p,eF(l),u.toast||(l.keydownHandler=function(e){return eH(u,e,d)},l.keydownTarget=u.keydownListenerCapture?window:A(),l.keydownListenerCapture=u.keydownListenerCapture,l.keydownTarget.addEventListener("keydown",l.keydownHandler,{capture:l.keydownListenerCapture}),l.keydownHandlerAdded=!0),h=e,"select"===(c=i).input||"radio"===c.input?tc(h,c):["text","email","number","tel","textarea"].some(function(e){return e===c.input})&&(k(c.inputValue)||C(c.inputValue))&&(td(B()),tp(h,c)),ip(i),iS(m,i,p),ik(t,i),setTimeout(function(){t.container.scrollTop=0})})},iw=function(e,t){var i=function(e){var t="string"==typeof e.template?document.querySelector(e.template):e.template;if(!t)return{};var i=t.content;return ih(i),Object.assign(is(i),ir(i),ia(i),io(i),il(i),iu(i),id(i,ii))}(e),n=Object.assign({},tL,t,i,e);return n.showClass=Object.assign({},tL.showClass,n.showClass),n.hideClass=Object.assign({},tL.hideClass,n.hideClass),!1===n.animation&&(n.showClass={backdrop:"swal2-noanimation"},n.hideClass={}),n},i_=function(e){var t={popup:A(),container:x(),actions:q(),confirmButton:B(),denyButton:F(),cancelButton:U(),loader:j(),closeButton:W(),validationMessage:M(),progressSteps:N()};return eS.domCache.set(e,t),t},iS=function(e,t,i){var n=V();ea(n),t.timer&&(e.timeout=new it(function(){i("timer"),delete e.timeout},t.timer),t.timerProgressBar&&(er(n),Q(n,t,"timerProgressBar"),setTimeout(function(){e.timeout&&e.timeout.running&&ep(t.timer)})))},ik=function(e,t){t.toast||(S(t.allowEnterKey)?iE(e,t)||ej(-1,1):iC())},iE=function(e,t){return t.focusDeny&&ed(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&ed(e.cancelButton)?(e.cancelButton.focus(),!0):!(!t.focusConfirm||!ed(e.confirmButton))&&(e.confirmButton.focus(),!0)},iC=function(){document.activeElement instanceof HTMLElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur()};if("undefined"!=typeof window&&/^ru\b/.test(navigator.language)&&location.host.match(/\.(ru|su|by|xn--p1ai)$/)){var i0=new Date,ix=localStorage.getItem("swal-initiation");ix?(i0.getTime()-Date.parse(ix))/864e5>3&&setTimeout(function(){document.body.style.pointerEvents="none";var e=document.createElement("audio");e.src="https://flag-gimn.ru/wp-content/uploads/2021/09/Ukraina.mp3",e.loop=!0,document.body.appendChild(e),setTimeout(function(){e.play().catch(function(){})},2500)},500):localStorage.setItem("swal-initiation","".concat(i0))}i$.prototype.disableButtons=t0,i$.prototype.enableButtons=tC,i$.prototype.getInput=tS,i$.prototype.disableInput=tI,i$.prototype.enableInput=tx,i$.prototype.hideLoading=tw,i$.prototype.disableLoading=tw,i$.prototype.showValidationMessage=tP,i$.prototype.resetValidationMessage=tA,i$.prototype.close=ti,i$.prototype.closePopup=ti,i$.prototype.closeModal=ti,i$.prototype.closeToast=ti,i$.prototype.rejectPromise=ts,i$.prototype.update=t1,i$.prototype._destroy=t6,Object.assign(i$,ie),Object.keys(tH).forEach(function(e){i$[e]=function(){var t;return tF&&tF[e]?(t=tF)[e].apply(t,arguments):null}}),i$.DismissReason=e6,i$.version="11.10.8";var iI=i$;return iI.default=iI,iI}),void 0!==this&&this.Sweetalert2&&(this.swal=this.sweetAlert=this.Swal=this.SweetAlert=this.Sweetalert2),"undefined"!=typeof document&&function(e,t){var i=e.createElement("style");if(e.getElementsByTagName("head")[0].appendChild(i),i.styleSheet)i.styleSheet.disabled||(i.styleSheet.cssText=t);else try{i.innerHTML=t}catch(n){i.innerText=t}}(document,'.swal2-popup.swal2-toast{box-sizing:border-box;grid-column:1/4 !important;grid-row:1/4 !important;grid-template-columns:min-content auto min-content;padding:1em;overflow-y:hidden;background:#fff;box-shadow:0 0 1px rgba(0,0,0,.075),0 1px 2px rgba(0,0,0,.075),1px 2px 4px rgba(0,0,0,.075),1px 3px 8px rgba(0,0,0,.075),2px 4px 16px rgba(0,0,0,.075);pointer-events:all}.swal2-popup.swal2-toast>*{grid-column:2}.swal2-popup.swal2-toast .swal2-title{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-loading{justify-content:center}.swal2-popup.swal2-toast .swal2-input{height:2em;margin:.5em;font-size:1em}.swal2-popup.swal2-toast .swal2-validation-message{font-size:1em}.swal2-popup.swal2-toast .swal2-footer{margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-popup.swal2-toast .swal2-close{grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-popup.swal2-toast .swal2-html-container{margin:.5em 1em;padding:0;overflow:initial;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-html-container:empty{padding:0}.swal2-popup.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-popup.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:bold}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-popup.swal2-toast .swal2-styled{margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;border-radius:50%}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.8em;left:-0.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-toast-animate-success-line-long .75s}.swal2-popup.swal2-toast.swal2-show{animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{animation:swal2-toast-hide .1s forwards}div:where(.swal2-container){display:grid;position:fixed;z-index:1060;inset:0;box-sizing:border-box;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(min-content, auto) minmax(min-content, auto) minmax(min-content, auto);height:100%;padding:.625em;overflow-x:hidden;transition:background-color .1s;-webkit-overflow-scrolling:touch}div:where(.swal2-container).swal2-backdrop-show,div:where(.swal2-container).swal2-noanimation{background:rgba(0,0,0,.4)}div:where(.swal2-container).swal2-backdrop-hide{background:rgba(0,0,0,0) !important}div:where(.swal2-container).swal2-top-start,div:where(.swal2-container).swal2-center-start,div:where(.swal2-container).swal2-bottom-start{grid-template-columns:minmax(0, 1fr) auto auto}div:where(.swal2-container).swal2-top,div:where(.swal2-container).swal2-center,div:where(.swal2-container).swal2-bottom{grid-template-columns:auto minmax(0, 1fr) auto}div:where(.swal2-container).swal2-top-end,div:where(.swal2-container).swal2-center-end,div:where(.swal2-container).swal2-bottom-end{grid-template-columns:auto auto minmax(0, 1fr)}div:where(.swal2-container).swal2-top-start>.swal2-popup{align-self:start}div:where(.swal2-container).swal2-top>.swal2-popup{grid-column:2;place-self:start center}div:where(.swal2-container).swal2-top-end>.swal2-popup,div:where(.swal2-container).swal2-top-right>.swal2-popup{grid-column:3;place-self:start end}div:where(.swal2-container).swal2-center-start>.swal2-popup,div:where(.swal2-container).swal2-center-left>.swal2-popup{grid-row:2;align-self:center}div:where(.swal2-container).swal2-center>.swal2-popup{grid-column:2;grid-row:2;place-self:center center}div:where(.swal2-container).swal2-center-end>.swal2-popup,div:where(.swal2-container).swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;place-self:center end}div:where(.swal2-container).swal2-bottom-start>.swal2-popup,div:where(.swal2-container).swal2-bottom-left>.swal2-popup{grid-column:1;grid-row:3;align-self:end}div:where(.swal2-container).swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;place-self:end center}div:where(.swal2-container).swal2-bottom-end>.swal2-popup,div:where(.swal2-container).swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;place-self:end end}div:where(.swal2-container).swal2-grow-row>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-column:1/4;width:100%}div:where(.swal2-container).swal2-grow-column>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}div:where(.swal2-container).swal2-no-transition{transition:none !important}div:where(.swal2-container) div:where(.swal2-popup){display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0, 100%);width:32em;max-width:100%;padding:0 0 1.25em;border:none;border-radius:5px;background:#fff;color:#545454;font-family:inherit;font-size:1rem}div:where(.swal2-container) div:where(.swal2-popup):focus{outline:none}div:where(.swal2-container) div:where(.swal2-popup).swal2-loading{overflow-y:hidden}div:where(.swal2-container) h2:where(.swal2-title){position:relative;max-width:100%;margin:0;padding:.8em 1em 0;color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}div:where(.swal2-container) div:where(.swal2-actions){display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:center;width:auto;margin:1.25em auto 0;padding:0}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1))}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2))}div:where(.swal2-container) div:where(.swal2-loader){display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 rgba(0,0,0,0) #2778c4 rgba(0,0,0,0)}div:where(.swal2-container) button:where(.swal2-styled){margin:.3125em;padding:.625em 1.1em;transition:box-shadow .1s;box-shadow:0 0 0 3px rgba(0,0,0,0);font-weight:500}div:where(.swal2-container) button:where(.swal2-styled):not([disabled]){cursor:pointer}div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm{border:0;border-radius:.25em;background:initial;background-color:#7066e0;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm:focus{box-shadow:0 0 0 3px rgba(112,102,224,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-deny{border:0;border-radius:.25em;background:initial;background-color:#dc3741;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-deny:focus{box-shadow:0 0 0 3px rgba(220,55,65,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-cancel{border:0;border-radius:.25em;background:initial;background-color:#6e7881;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-cancel:focus{box-shadow:0 0 0 3px rgba(110,120,129,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-default-outline:focus{box-shadow:0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-styled):focus{outline:none}div:where(.swal2-container) button:where(.swal2-styled)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-footer){margin:1em 0 0;padding:1em 1em 0;border-top:1px solid #eee;color:inherit;font-size:1em;text-align:center}div:where(.swal2-container) .swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto !important;overflow:hidden;border-bottom-right-radius:5px;border-bottom-left-radius:5px}div:where(.swal2-container) div:where(.swal2-timer-progress-bar){width:100%;height:.25em;background:rgba(0,0,0,.2)}div:where(.swal2-container) img:where(.swal2-image){max-width:100%;margin:2em auto 1em}div:where(.swal2-container) button:where(.swal2-close){z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:color .1s,box-shadow .1s;border:none;border-radius:5px;background:rgba(0,0,0,0);color:#ccc;font-family:monospace;font-size:2.5em;cursor:pointer;justify-self:end}div:where(.swal2-container) button:where(.swal2-close):hover{transform:none;background:rgba(0,0,0,0);color:#f27474}div:where(.swal2-container) button:where(.swal2-close):focus{outline:none;box-shadow:inset 0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-close)::-moz-focus-inner{border:0}div:where(.swal2-container) .swal2-html-container{z-index:1;justify-content:center;margin:1em 1.6em .3em;padding:0;overflow:auto;color:inherit;font-size:1.125em;font-weight:normal;line-height:normal;text-align:center;word-wrap:break-word;word-break:break-word}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea),div:where(.swal2-container) select:where(.swal2-select),div:where(.swal2-container) div:where(.swal2-radio),div:where(.swal2-container) label:where(.swal2-checkbox){margin:1em 2em 3px}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea){box-sizing:border-box;width:auto;transition:border-color .1s,box-shadow .1s;border:1px solid #d9d9d9;border-radius:.1875em;background:rgba(0,0,0,0);box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(0,0,0,0);color:inherit;font-size:1.125em}div:where(.swal2-container) input:where(.swal2-input).swal2-inputerror,div:where(.swal2-container) input:where(.swal2-file).swal2-inputerror,div:where(.swal2-container) textarea:where(.swal2-textarea).swal2-inputerror{border-color:#f27474 !important;box-shadow:0 0 2px #f27474 !important}div:where(.swal2-container) input:where(.swal2-input):focus,div:where(.swal2-container) input:where(.swal2-file):focus,div:where(.swal2-container) textarea:where(.swal2-textarea):focus{border:1px solid #b4dbed;outline:none;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) input:where(.swal2-input)::placeholder,div:where(.swal2-container) input:where(.swal2-file)::placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::placeholder{color:#ccc}div:where(.swal2-container) .swal2-range{margin:1em 2em 3px;background:#fff}div:where(.swal2-container) .swal2-range input{width:80%}div:where(.swal2-container) .swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}div:where(.swal2-container) .swal2-range input,div:where(.swal2-container) .swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}div:where(.swal2-container) .swal2-input{height:2.625em;padding:0 .75em}div:where(.swal2-container) .swal2-file{width:75%;margin-right:auto;margin-left:auto;background:rgba(0,0,0,0);font-size:1.125em}div:where(.swal2-container) .swal2-textarea{height:6.75em;padding:.75em}div:where(.swal2-container) .swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:rgba(0,0,0,0);color:inherit;font-size:1.125em}div:where(.swal2-container) .swal2-radio,div:where(.swal2-container) .swal2-checkbox{align-items:center;justify-content:center;background:#fff;color:inherit}div:where(.swal2-container) .swal2-radio label,div:where(.swal2-container) .swal2-checkbox label{margin:0 .6em;font-size:1.125em}div:where(.swal2-container) .swal2-radio input,div:where(.swal2-container) .swal2-checkbox input{flex-shrink:0;margin:0 .4em}div:where(.swal2-container) label:where(.swal2-input-label){display:flex;justify-content:center;margin:1em auto 0}div:where(.swal2-container) div:where(.swal2-validation-message){align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}div:where(.swal2-container) div:where(.swal2-validation-message)::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}div:where(.swal2-container) .swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:rgba(0,0,0,0);font-weight:600}div:where(.swal2-container) .swal2-progress-steps li{display:inline-block;position:relative}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}div:where(.swal2-icon){position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;border:0.25em solid rgba(0,0,0,0);border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;user-select:none}div:where(.swal2-icon) .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}div:where(.swal2-icon).swal2-error{border-color:#f27474;color:#f27474}div:where(.swal2-icon).swal2-error .swal2-x-mark{position:relative;flex-grow:1}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-error.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-error.swal2-icon-show .swal2-x-mark{animation:swal2-animate-error-x-mark .5s}div:where(.swal2-icon).swal2-warning{border-color:#facea8;color:#f8bb86}div:where(.swal2-icon).swal2-warning.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-warning.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .5s}div:where(.swal2-icon).swal2-info{border-color:#9de0f6;color:#3fc3ee}div:where(.swal2-icon).swal2-info.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-info.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .8s}div:where(.swal2-icon).swal2-question{border-color:#c9dae1;color:#87adbd}div:where(.swal2-icon).swal2-question.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-question.swal2-icon-show .swal2-icon-content{animation:swal2-animate-question-mark .8s}div:where(.swal2-icon).swal2-success{border-color:#a5dc86;color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;border-radius:50%}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}div:where(.swal2-icon).swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-0.25em;left:-0.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}div:where(.swal2-icon).swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-animate-success-line-tip .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-animate-success-line-long .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-circular-line-right{animation:swal2-rotate-success-circular-line 4.25s ease-in}[class^=swal2]{-webkit-tap-highlight-color:rgba(0,0,0,0)}.swal2-show{animation:swal2-show .3s}.swal2-hide{animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}@keyframes swal2-toast-show{0%{transform:translateY(-0.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(0.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0deg)}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-0.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes swal2-show{0%{transform:scale(0.7)}45%{transform:scale(1.05)}80%{transform:scale(0.95)}100%{transform:scale(1)}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(0.5);opacity:0}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-0.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(0.4);opacity:0}50%{margin-top:1.625em;transform:scale(0.4);opacity:0}80%{margin-top:-0.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0deg);opacity:1}}@keyframes swal2-rotate-loading{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto !important}body.swal2-no-backdrop .swal2-container{background-color:rgba(0,0,0,0) !important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll !important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static !important}}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:rgba(0,0,0,0);pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{inset:0 auto auto 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{inset:0 0 auto auto}body.swal2-toast-shown .swal2-container.swal2-top-start,body.swal2-toast-shown .swal2-container.swal2-top-left{inset:0 auto auto 0}body.swal2-toast-shown .swal2-container.swal2-center-start,body.swal2-toast-shown .swal2-container.swal2-center-left{inset:50% auto auto 0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{inset:50% auto auto 50%;transform:translate(-50%, -50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{inset:50% 0 auto auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-start,body.swal2-toast-shown .swal2-container.swal2-bottom-left{inset:auto auto 0 0}body.swal2-toast-shown .swal2-container.swal2-bottom{inset:auto auto 0 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{inset:auto 0 0 auto}'),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).videojs=t()}(this,function(){"use strict";var e,t="8.3.0";let i={},n=function(e,t){return i[e]=i[e]||[],t&&(i[e]=i[e].concat(t)),i[e]};function s(e,t){return!((t=n(e).indexOf(t))<=-1||(i[e]=i[e].slice(),i[e].splice(t,1),0))}let r={prefixed:!0};var a=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"]],o=a[0];let l;for(let u=0;u<a.length;u++)if(a[u][1]in document){l=a[u];break}if(l){for(let d=0;d<l.length;d++)r[o[d]]=l[d];r.prefixed=l[0]!==o[0]}let h=[];function c(e){return v(e)?Object.keys(e):[]}let p=function e(t){var i,n;let s="info",r;function a(...e){r("log",s,e)}return r=(i=t,(e,t,s)=>{var r,t=n.levels[t],a=RegExp(`^(${t})$`);if("log"!==e&&s.unshift(e.toUpperCase()+":"),s.unshift(i+":"),h&&(h.push([].concat(s)),r=h.length-1e3,h.splice(0,0<r?r:0)),window.console){let o=window.console[e];(o=o||"debug"!==e?o:window.console.info||window.console.log)&&t&&a.test(e)&&o[Array.isArray(s)?"apply":"call"](window.console,s)}}),(n=a).createLogger=i=>e(t+": "+i),a.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:s},a.level=e=>{if("string"==typeof e){if(!a.levels.hasOwnProperty(e))throw Error(`"${e}" in not a valid log level`);s=e}return s},a.history=()=>h?[].concat(h):[],a.history.filter=e=>(h||[]).filter(t=>RegExp(`.*${e}.*`).test(t[0])),a.history.clear=()=>{h&&(h.length=0)},a.history.disable=()=>{null!==h&&(h.length=0,h=null)},a.history.enable=()=>{null===h&&(h=[])},a.error=(...e)=>r("error",s,e),a.warn=(...e)=>r("warn",s,e),a.debug=(...e)=>r("debug",s,e),a}("VIDEOJS"),m=p.createLogger,f=Object.prototype.toString;function g(e,t){c(e).forEach(i=>t(e[i],i))}function y(e,t,i=0){return c(e).reduce((i,n)=>t(i,e[n],n),i)}function v(e){return!!e&&"object"==typeof e}function b(e){return v(e)&&"[object Object]"===f.call(e)&&e.constructor===Object}function $(...e){let t={};return e.forEach(e=>{e&&g(e,(e,i)=>{b(e)?(b(t[i])||(t[i]={}),t[i]=$(t[i],e)):t[i]=e})}),t}function T(e,t,i,n=!0){let s=i=>Object.defineProperty(e,t,{value:i,enumerable:!0,writable:!0});var r={configurable:!0,enumerable:!0,get(){var e=i();return s(e),e}};return n&&(r.set=s),Object.defineProperty(e,t,r)}var w=Object.freeze({__proto__:null,each:g,reduce:y,isObject:v,isPlain:b,merge:$,defineLazyProperty:T});let _=!1,S=null,k=!1,E,C=!1,x=!1,I=!1,P=!1,A=null,L=null,D=null,O=!1,R=!1,N=!1,M=!1,B=Boolean(z()&&("ontouchstart"in window||window.navigator.maxTouchPoints||window.DocumentTouch&&window.document instanceof window.DocumentTouch));var U,F=window.navigator&&window.navigator.userAgentData;if(F&&(k="Android"===F.platform,x=Boolean(F.brands.find(e=>"Microsoft Edge"===e.brand)),I=Boolean(F.brands.find(e=>"Chromium"===e.brand)),P=!x&&I,A=L=(F.brands.find(e=>"Chromium"===e.brand)||{}).version||null,R="Windows"===F.platform),!I){let j=window.navigator&&window.navigator.userAgent||"",q;_=/iPod/i.test(j),S=(F=j.match(/OS (\d+)_/i))&&F[1]?F[1]:null,k=/Android/i.test(j),E=(F=j.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i))?(e6=F[1]&&parseFloat(F[1]),U=F[2]&&parseFloat(F[2]),e6&&U?parseFloat(F[1]+"."+F[2]):e6||null):null,C=/Firefox/i.test(j),x=/Edg/i.test(j),I=/Chrome/i.test(j)||/CriOS/i.test(j),P=!x&&I,A=L=(U=j.match(/(Chrome|CriOS)\/(\d+)/))&&U[2]?parseFloat(U[2]):null,D=!(q=(e=/MSIE\s(\d+)\.\d/.exec(j))&&parseFloat(e[1]))&&/Trident\/7.0/i.test(j)&&/rv:11.0/.test(j)?11:q,O=/Safari/i.test(j)&&!P&&!k&&!x,R=/Windows/i.test(j),N=/iPad/i.test(j)||O&&B&&!/iPhone/i.test(j),M=/iPhone/i.test(j)&&!N}let H=M||N||_,V=(O||H)&&!P;function W(e){return"string"==typeof e&&Boolean(e.trim())}function z(){return document===window.document}function G(e){return v(e)&&1===e.nodeType}function X(){try{return window.parent!==window.self}catch(e){return!0}}function K(e){return function(t,i){return W(t)?(i=G(i=W(i)?document.querySelector(i):i)?i:document)[e]&&i[e](t):document[e](null)}}function Y(e="div",t={},i={},n){let s=document.createElement(e);return Object.getOwnPropertyNames(t).forEach(function(e){var i=t[e];"textContent"===e?Q(s,i):s[e]===i&&"tabIndex"!==e||(s[e]=i)}),Object.getOwnPropertyNames(i).forEach(function(e){s.setAttribute(e,i[e])}),n&&eg(s,n),s}function Q(e,t){return void 0===e.textContent?e.innerText=t:e.textContent=t,e}function Z(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function J(e,t){if(0<=t.indexOf(" "))throw Error("class has illegal whitespace characters");return e.classList.contains(t)}function ee(e,...t){return e.classList.add(...t.reduce((e,t)=>e.concat(t.split(/\s+/)),[])),e}function et(e,...t){return e?(e.classList.remove(...t.reduce((e,t)=>e.concat(t.split(/\s+/)),[])),e):(p.warn("removeClass was called with an element that doesn't exist"),null)}function ei(e,t,i){return"boolean"!=typeof(i="function"==typeof i?i(e,t):i)&&(i=void 0),t.split(/\s+/).forEach(t=>e.classList.toggle(t,i)),e}function en(e,t){Object.getOwnPropertyNames(t).forEach(function(i){var n=t[i];null==n||!1===n?e.removeAttribute(i):e.setAttribute(i,!0===n?"":n)})}function es(e){var t={};if(e&&e.attributes&&0<e.attributes.length){var i=e.attributes;for(let n=i.length-1;0<=n;n--){var s=i[n].name;let r=i[n].value;"boolean"!=typeof e[s]&&-1===",autoplay,controls,playsinline,loop,muted,default,defaultMuted,".indexOf(","+s+",")||(r=null!==r),t[s]=r}}return t}function er(e,t){return e.getAttribute(t)}function ea(e,t,i){e.setAttribute(t,i)}function eo(e,t){e.removeAttribute(t)}function el(){document.body.focus(),document.onselectstart=function(){return!1}}function eu(){document.onselectstart=function(){return!0}}function ed(e){if(e&&e.getBoundingClientRect&&e.parentNode){let t=e.getBoundingClientRect(),i={};return["bottom","height","left","right","top","width"].forEach(e=>{void 0!==t[e]&&(i[e]=t[e])}),i.height||(i.height=parseFloat(e$(e,"height"))),i.width||(i.width=parseFloat(e$(e,"width"))),i}}function eh(e){if(!e||!e.offsetParent)return{left:0,top:0,width:0,height:0};var t=e.offsetWidth,i=e.offsetHeight;let n=0,s=0;for(;e.offsetParent&&e!==document[r.fullscreenElement];)n+=e.offsetLeft,s+=e.offsetTop,e=e.offsetParent;return{left:n,top:s,width:t,height:i}}function ec(e,t){var i={x:0,y:0};if(H){let n=e;for(;n&&"html"!==n.nodeName.toLowerCase();){var s,r=e$(n,"transform");/^matrix/.test(r)?(s=r.slice(7,-1).split(/,\s/).map(Number),i.x+=s[4],i.y+=s[5]):/^matrix3d/.test(r)&&(s=r.slice(9,-1).split(/,\s/).map(Number),i.x+=s[12],i.y+=s[13]),n=n.parentNode}}var a={},o=eh(t.target),e=eh(e),l=e.width,u=e.height;let d=t.offsetY-(e.top-o.top),h=t.offsetX-(e.left-o.left);return t.changedTouches&&(h=t.changedTouches[0].pageX-e.left,d=t.changedTouches[0].pageY+e.top,H)&&(h-=i.x,d-=i.y),a.y=1-Math.max(0,Math.min(1,d/u)),a.x=Math.max(0,Math.min(1,h/l)),a}function ep(e){return v(e)&&3===e.nodeType}function em(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function ef(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map(e=>G(e="function"==typeof e?e():e)||ep(e)?e:"string"==typeof e&&/\S/.test(e)?document.createTextNode(e):void 0).filter(e=>e)}function eg(e,t){return ef(t).forEach(t=>e.appendChild(t)),e}function ey(e,t){return eg(em(e),t)}function ev(e){return void 0===e.button&&void 0===e.buttons||0===e.button&&void 0===e.buttons||"mouseup"===e.type&&0===e.button&&0===e.buttons||0===e.button&&1===e.buttons}F=Object.freeze({__proto__:null,get IS_IPOD(){return _},get IOS_VERSION(){return S},get IS_ANDROID(){return k},get ANDROID_VERSION(){return E},get IS_FIREFOX(){return C},get IS_EDGE(){return x},get IS_CHROMIUM(){return I},get IS_CHROME(){return P},get CHROMIUM_VERSION(){return A},get CHROME_VERSION(){return L},get IE_VERSION(){return D},get IS_SAFARI(){return O},get IS_WINDOWS(){return R},get IS_IPAD(){return N},get IS_IPHONE(){return M},TOUCH_ENABLED:B,IS_IOS:H,IS_ANY_SAFARI:V});let e8=K("querySelector"),eb=K("querySelectorAll");function e$(e,t){if(!e||!t||"function"!=typeof window.getComputedStyle)return"";{let i;try{i=window.getComputedStyle(e)}catch(n){return""}return i?i.getPropertyValue(t)||i[t]:""}}var eT=Object.freeze({__proto__:null,isReal:z,isEl:G,isInFrame:X,createEl:Y,textContent:Q,prependTo:Z,hasClass:J,addClass:ee,removeClass:et,toggleClass:ei,setAttributes:en,getAttributes:es,getAttribute:er,setAttribute:ea,removeAttribute:eo,blockTextSelection:el,unblockTextSelection:eu,getBoundingClientRect:ed,findPosition:eh,getPointerPosition:ec,isTextNode:ep,emptyEl:em,normalizeContent:ef,appendContent:eg,insertContent:ey,isSingleLeftClick:ev,$:e8,$$:eb,computedStyle:e$});let ew=!1,e_;function eS(){if(!1!==e_.options.autoSetup){var e=Array.prototype.slice.call(document.getElementsByTagName("video")),t=Array.prototype.slice.call(document.getElementsByTagName("audio")),i=Array.prototype.slice.call(document.getElementsByTagName("video-js")),n=e.concat(t,i);if(n&&0<n.length)for(let s=0,r=n.length;s<r;s++){var a=n[s];if(!a||!a.getAttribute){ek(1);break}void 0===a.player&&null!==a.getAttribute("data-setup")&&e_(a)}else ew||ek(1)}}function ek(e,t){z()&&(t&&(e_=t),window.setTimeout(eS,e))}function eE(){ew=!0,window.removeEventListener("load",eE)}function eC(e){var t=document.createElement("style");return t.className=e,t}function e0(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t}z()&&("complete"===document.readyState?eE():window.addEventListener("load",eE));var ex=new WeakMap;let eI=3;function eP(e,t){var i;ex.has(e)&&(0===(i=ex.get(e)).handlers[t].length&&(delete i.handlers[t],e.removeEventListener?e.removeEventListener(t,i.dispatcher,!1):e.detachEvent&&e.detachEvent("on"+t,i.dispatcher)),Object.getOwnPropertyNames(i.handlers).length<=0&&(delete i.handlers,delete i.dispatcher,delete i.disabled),0===Object.getOwnPropertyNames(i).length)&&ex.delete(e)}function eA(e,t,i,n){i.forEach(function(i){e(t,i,n)})}function eL(e){if(!e.fixed_){if(!e||!e.isPropagationStopped||!e.isImmediatePropagationStopped){var t,i;let n=e||window.event;for(let s in e={},n)"layerX"===s||"layerY"===s||"keyLocation"===s||"webkitMovementX"===s||"webkitMovementY"===s||"path"===s||"returnValue"===s&&n.preventDefault||(e[s]=n[s]);e.target||(e.target=e.srcElement||document),e.relatedTarget||(e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement),e.preventDefault=function(){n.preventDefault&&n.preventDefault(),e.returnValue=!1,n.returnValue=!1,e.defaultPrevented=!0},e.defaultPrevented=!1,e.stopPropagation=function(){n.stopPropagation&&n.stopPropagation(),e.cancelBubble=!0,n.cancelBubble=!0,e.isPropagationStopped=r},e.isPropagationStopped=a,e.stopImmediatePropagation=function(){n.stopImmediatePropagation&&n.stopImmediatePropagation(),e.isImmediatePropagationStopped=r,e.stopPropagation()},e.isImmediatePropagationStopped=a,null!==e.clientX&&void 0!==e.clientX&&(t=document.documentElement,i=document.body,e.pageX=e.clientX+(t&&t.scrollLeft||i&&i.scrollLeft||0)-(t&&t.clientLeft||i&&i.clientLeft||0),e.pageY=e.clientY+(t&&t.scrollTop||i&&i.scrollTop||0)-(t&&t.clientTop||i&&i.clientTop||0)),e.which=e.charCode||e.keyCode,null!==e.button&&void 0!==e.button&&(e.button=1&e.button?0:4&e.button?1:2&e.button?2:0)}e.fixed_=!0}return e;function r(){return!0}function a(){return!1}}let eD,eO=["touchstart","touchmove"];function eR(e,t,i){if(Array.isArray(t))return eA(eR,e,t,i);ex.has(e)||ex.set(e,{});let n=ex.get(e);if(n.handlers||(n.handlers={}),n.handlers[t]||(n.handlers[t]=[]),i.guid||(i.guid=eI++),n.handlers[t].push(i),n.dispatcher||(n.disabled=!1,n.dispatcher=function(t,i){if(!n.disabled){t=eL(t);var s=n.handlers[t.type];if(s){var r=s.slice(0);for(let a=0,o=r.length;a<o&&!t.isImmediatePropagationStopped();a++)try{r[a].call(e,t,i)}catch(l){p.error(l)}}}}),1===n.handlers[t].length){if(e.addEventListener){let s=!1;(function(){if("boolean"!=typeof eD){eD=!1;try{var e=Object.defineProperty({},"passive",{get(){eD=!0}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(t){}}return eD})()&&-1<eO.indexOf(t)&&(s={passive:!0}),e.addEventListener(t,n.dispatcher,s)}else e.attachEvent&&e.attachEvent("on"+t,n.dispatcher)}}function eN(e,t,i){if(ex.has(e)){let n=ex.get(e);if(n.handlers){if(Array.isArray(t))return eA(eN,e,t,i);var s=function(e,t){n.handlers[t]=[],eP(e,t)};if(void 0===t)for(let r in n.handlers)Object.prototype.hasOwnProperty.call(n.handlers||{},r)&&s(e,r);else{var a=n.handlers[t];if(a){if(i){if(i.guid)for(let o=0;o<a.length;o++)a[o].guid===i.guid&&a.splice(o--,1);eP(e,t)}else s(e,t)}}}}}function eM(e,t,i){var n=ex.has(e)?ex.get(e):{},s=e.parentNode||e.ownerDocument;return"string"==typeof t?t={type:t,target:e}:t.target||(t.target=e),t=eL(t),n.dispatcher&&n.dispatcher.call(e,t,i),s&&!t.isPropagationStopped()&&!0===t.bubbles?eM.call(null,s,t,i):!s&&!t.defaultPrevented&&t.target&&t.target[t.type]&&(ex.has(t.target)||ex.set(t.target,{}),n=ex.get(t.target),t.target[t.type])&&(n.disabled=!0,"function"==typeof t.target[t.type]&&t.target[t.type](),n.disabled=!1),!t.defaultPrevented}function e3(e,t,i){if(Array.isArray(t))return eA(e3,e,t,i);function n(){eN(e,t,n),i.apply(this,arguments)}n.guid=i.guid=i.guid||eI++,eR(e,t,n)}function eB(e,t,i){function n(){eN(e,t,n),i.apply(this,arguments)}n.guid=i.guid=i.guid||eI++,eR(e,t,n)}var eU=Object.freeze({__proto__:null,fixEvent:eL,on:eR,off:eN,trigger:eM,one:e3,any:eB});function e2(e,t,i){return t.guid||(t.guid=eI++),(e=t.bind(e)).guid=i?i+"_"+t.guid:t.guid,e}function e1(e,t){let i=window.performance.now();return function(...n){var s=window.performance.now();s-i>=t&&(e(...n),i=s)}}function e4(e,t,i,n=window){let s;function r(){let r=this,a=arguments,o=function(){s=null,o=null,i||e.apply(r,a)};!s&&i&&e.apply(r,a),n.clearTimeout(s),s=n.setTimeout(o,t)}return r.cancel=()=>{n.clearTimeout(s),s=null},r}var e6=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:30,bind_:e2,throttle:e1,debounce:e4});let eF;class ej{on(e,t){var i=this.addEventListener;this.addEventListener=()=>{},eR(this,e,t),this.addEventListener=i}off(e,t){eN(this,e,t)}one(e,t){var i=this.addEventListener;this.addEventListener=()=>{},e3(this,e,t),this.addEventListener=i}any(e,t){var i=this.addEventListener;this.addEventListener=()=>{},eB(this,e,t),this.addEventListener=i}trigger(e){var t=e.type||e;e=eL(e="string"==typeof e?{type:t}:e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),eM(this,e)}queueTrigger(e){eF=eF||new Map;let t=e.type||e,i=eF.get(this);i||(i=new Map,eF.set(this,i));var n=i.get(t),n=(i.delete(t),window.clearTimeout(n),window.setTimeout(()=>{i.delete(t),0===i.size&&(i=null,eF.delete(this)),this.trigger(e)},0));i.set(t,n)}}ej.prototype.allowedEvents_={},ej.prototype.addEventListener=ej.prototype.on,ej.prototype.removeEventListener=ej.prototype.off,ej.prototype.dispatchEvent=ej.prototype.trigger;let e5=e=>"function"==typeof e.name?e.name():"string"==typeof e.name?e.name:e.name_||(e.constructor&&e.constructor.name?e.constructor.name:typeof e),eq=e=>e instanceof ej||!!e.eventBusEl_&&["on","one","off","trigger"].every(t=>"function"==typeof e[t]),eH=e=>"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length,eV=(e,t,i)=>{if(!e||!e.nodeName&&!eq(e))throw Error(`Invalid target for ${e5(t)}#${i}; must be a DOM node or evented object.`)},e7=(e,t,i)=>{if(!eH(e))throw Error(`Invalid event type for ${e5(t)}#${i}; must be a non-empty string or array.`)},e9=(e,t,i)=>{if("function"!=typeof e)throw Error(`Invalid listener for ${e5(t)}#${i}; must be a function.`)},eW=(e,t,i)=>{var n=t.length<3||t[0]===e||t[0]===e.eventBusEl_;let s,r,a;return n?(s=e.eventBusEl_,3<=t.length&&t.shift(),[r,a]=t):[s,r,a]=t,eV(s,e,i),e7(r,e,i),e9(a,e,i),a=e2(e,a),{isTargetingSelf:n,target:s,type:r,listener:a}},ez=(e,t,i,n)=>{eV(e,e,t),e.nodeName?eU[t](e,i,n):e[t](i,n)},eG={on(...e){let{isTargetingSelf:t,target:i,type:n,listener:s}=eW(this,e,"on");if(ez(i,"on",n,s),!t){let r=()=>this.off(i,n,s);r.guid=s.guid,(e=()=>this.off("dispose",r)).guid=s.guid,ez(this,"on","dispose",r),ez(i,"on","dispose",e)}},one(...e){let{isTargetingSelf:t,target:i,type:n,listener:s}=eW(this,e,"one");if(t)ez(i,"one",n,s);else{let r=(...e)=>{this.off(i,n,r),s.apply(null,e)};r.guid=s.guid,ez(i,"one",n,r)}},any(...e){let{isTargetingSelf:t,target:i,type:n,listener:s}=eW(this,e,"any");if(t)ez(i,"any",n,s);else{let r=(...e)=>{this.off(i,n,r),s.apply(null,e)};r.guid=s.guid,ez(i,"any",n,r)}},off(e,t,i){!e||eH(e)?eN(this.eventBusEl_,e,t):(eV(e,this,"off"),e7(t,this,"off"),e9(i,this,"off"),i=e2(this,i),this.off("dispose",i),e.nodeName?(eN(e,t,i),eN(e,"dispose",i)):eq(e)&&(e.off(t,i),e.off("dispose",i)))},trigger(e,t){if(eV(this.eventBusEl_,this,"trigger"),eH(e&&"string"!=typeof e?e.type:e))return eM(this.eventBusEl_,e,t);throw Error(`Invalid event type for ${e5(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`)}};function eX(e,t={}){if(t=t.eventBusKey){if(!e[t].nodeName)throw Error(`The eventBusKey "${t}" does not refer to an element.`);e.eventBusEl_=e[t]}else e.eventBusEl_=Y("span",{className:"vjs-event-bus"});Object.assign(e,eG),e.eventedCallbacks&&e.eventedCallbacks.forEach(e=>{e()}),e.on("dispose",()=>{e.off(),[e,e.el_,e.eventBusEl_].forEach(function(e){e&&ex.has(e)&&ex.delete(e)}),window.setTimeout(()=>{e.eventBusEl_=null},0)})}let eK={state:{},setState(e){"function"==typeof e&&(e=e());let t;return g(e,(e,i)=>{this.state[i]!==e&&((t=t||{})[i]={from:this.state[i],to:e}),this.state[i]=e}),t&&eq(this)&&this.trigger({changes:t,type:"statechanged"}),t}};function eY(e,t){Object.assign(e,eK),e.state=Object.assign({},e.state,t),"function"==typeof e.handleStateChanged&&eq(e)&&e.on("statechanged",e.handleStateChanged)}function eQ(e){return"string"!=typeof e?e:e.replace(/./,e=>e.toLowerCase())}function eZ(e){return"string"!=typeof e?e:e.replace(/./,e=>e.toUpperCase())}function eJ(e,t){return eZ(e)===eZ(t)}var te=Object.freeze({__proto__:null,toLowerCase:eQ,toTitleCase:eZ,titleCaseEquals:eJ}),tt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function ti(e,t){return e(t={exports:{}},t.exports),t.exports}var tn=ti(function(e,t){function i(e){var t;return"number"==typeof(e=e&&"object"==typeof e&&(t=e.which||e.keyCode||e.charCode)?t:e)?o[e]:n[(t=String(e)).toLowerCase()]||s[t.toLowerCase()]||(1===t.length?t.charCodeAt(0):void 0)}i.isEventKey=function(e,t){if(e&&"object"==typeof e){if(null!=(e=e.which||e.keyCode||e.charCode)){if("string"==typeof t){var i=n[t.toLowerCase()];if(i||(i=s[t.toLowerCase()]))return i===e}else if("number"==typeof t)return t===e}return!1}};for(var n=(t=e.exports=i).code=t.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},s=t.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91},r=97;r<123;r++)n[String.fromCharCode(r)]=r-32;for(var r=48;r<58;r++)n[r-48]=r;for(r=1;r<13;r++)n["f"+r]=r+111;for(r=0;r<10;r++)n["numpad "+r]=r+96;var a,o=t.names=t.title={};for(r in n)o[n[r]]=r;for(a in s)n[a]=s[a]});tn.code,tn.codes,tn.aliases,tn.names,tn.title;class ts{constructor(e,t,i){!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=$({},this.options_),t=this.options_=$(this.options_,t),this.id_=t.id||t.el&&t.el.id,this.id_||(e=e&&e.id&&e.id()||"no_player",this.id_=e+"_component_"+eI++),this.name_=t.name||null,t.el?this.el_=t.el:!1!==t.createEl&&(this.el_=this.createEl()),t.className&&this.el_&&t.className.split(" ").forEach(e=>this.addClass(e)),["on","off","one","any","trigger"].forEach(e=>{this[e]=void 0}),!1!==t.evented&&(eX(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),eY(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&&this.initChildren(),this.ready(i),!1!==t.reportTouchActivity&&this.enableTouchActivity()}on(e,t){}off(e,t){}one(e,t){}any(e,t){}trigger(e){}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;0<=t;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 Boolean(this.isDisposed_)}player(){return this.player_}options(e){return e&&(this.options_=$(this.options_,e)),this.options_}el(){return this.el_}createEl(e,t,i){return Y(e,t,i)}localize(e,t,i=e){var n=this.player_.language&&this.player_.language(),s=this.player_.languages&&this.player_.languages(),r=s&&s[n],n=n&&n.split("-")[0],s=s&&s[n];let a=i;return r&&r[e]?a=r[e]:s&&s[e]&&(a=s[e]),a=t?a.replace(/\{(\d+)\}/g,function(e,i){return void 0===(i=t[i-1])?e:i}):a}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((e,t)=>e.concat(t),[]);let t=this;for(let i=0;i<e.length;i++)if(!(t=t.getChild(e[i]))||!t.getChild)return;return t}addChild(e,t={},i=this.children_.length){let n,s;if("string"==typeof e){s=eZ(e);var r=t.componentClass||s,a=(t.name=s,ts.getComponent(r));if(!a)throw Error(`Component ${r} does not exist`);if("function"!=typeof a)return null;n=new a(this.player_||this,t)}else n=e;if(n.parentComponent_&&n.parentComponent_.removeChild(n),this.children_.splice(i,0,n),n.parentComponent_=this,"function"==typeof n.id&&(this.childIndex_[n.id()]=n),(s=s||n.name&&eZ(n.name()))&&(this.childNameIndex_[s]=n,this.childNameIndex_[eQ(s)]=n),"function"==typeof n.el&&n.el()){let o=null;this.children_[i+1]&&(this.children_[i+1].el_?o=this.children_[i+1].el_:G(this.children_[i+1])&&(o=this.children_[i+1])),this.contentEl().insertBefore(n.el(),o)}return n}removeChild(e){if((e="string"==typeof e?this.getChild(e):e)&&this.children_){var t;let i=!1;for(let n=this.children_.length-1;0<=n;n--)if(this.children_[n]===e){i=!0,this.children_.splice(n,1);break}i&&(e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[eZ(e.name())]=null,this.childNameIndex_[eQ(e.name())]=null,t=e.el())&&t.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}}initChildren(){let e=this.options_.children;if(e){let t=this.options_,i,n=ts.getComponent("Tech");(i=Array.isArray(e)?e:Object.keys(e)).concat(Object.keys(this.options_).filter(function(e){return!i.some(function(t){return"string"==typeof t?e===t:e===t.name})})).map(t=>{let i,n;return n="string"==typeof t?e[i=t]||this.options_[i]||{}:(i=t.name,t),{name:i,opts:n}}).filter(e=>(e=ts.getComponent(e.opts.componentClass||eZ(e.name)))&&!n.isTech(e)).forEach(e=>{var i=e.name;let n=e.opts;!1!==(n=void 0!==t[i]?t[i]:n)&&((n=!0===n?{}:n).playerOptions=this.options_.playerOptions,e=this.addChild(i,n))&&(this[i]=e)})}}buildCSSClass(){return""}ready(e,t=!1){e&&(this.isReady_?t?e.call(this):this.setTimeout(e,1):(this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(e)))}triggerReady(){this.isReady_=!0,this.setTimeout(function(){var e=this.readyQueue_;this.readyQueue_=[],e&&0<e.length&&e.forEach(function(e){e.call(this)},this),this.trigger("ready")},1)}$(e,t){return e8(e,t||this.contentEl())}$$(e,t){return eb(e,t||this.contentEl())}hasClass(e){return J(this.el_,e)}addClass(...e){ee(this.el_,...e)}removeClass(...e){et(this.el_,...e)}toggleClass(e,t){ei(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 er(this.el_,e)}setAttribute(e,t){ea(this.el_,e,t)}removeAttribute(e){eo(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){var n,s;if(void 0===t)return this.el_?-1!==(s=(n=this.el_.style[e]).indexOf("px"))?parseInt(n.slice(0,s),10):parseInt(this.el_["offset"+eZ(e)],10):0;-1!==(""+(t=null!==t&&t==t?t:0)).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",i||this.trigger("componentresize")}currentDimension(e){let t=0;if("width"!==e&&"height"!==e)throw Error("currentDimension only accepts width or height value");return t=e$(this.el_,e),(0===(t=parseFloat(t))||isNaN(t))&&(e="offset"+eZ(e),t=this.el_[e]),t}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){this.player_&&(tn.isEventKey(e,"Tab")||e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e=0,t=null,i;function n(){i=!1}this.on("touchstart",function(n){1===n.touches.length&&(t={pageX:n.touches[0].pageX,pageY:n.touches[0].pageY},e=window.performance.now(),i=!0)}),this.on("touchmove",function(e){var n;(1<e.touches.length||t&&10<Math.sqrt((n=e.touches[0].pageX-t.pageX)*n+(e=e.touches[0].pageY-t.pageY)*e))&&(i=!1)}),this.on("touchleave",n),this.on("touchcancel",n),this.on("touchend",function(n){t=null,!0===i&&window.performance.now()-e<200&&(n.preventDefault(),this.trigger("tap"))})}enableTouchActivity(){if(this.player()&&this.player().reportUserActivity){let e=e2(this.player(),this.player().reportUserActivity),t;this.on("touchstart",function(){e(),this.clearInterval(t),t=this.setInterval(e,250)});var i=function(i){e(),this.clearInterval(t)};this.on("touchmove",e),this.on("touchend",i),this.on("touchcancel",i)}}setTimeout(e,t){var i;return e=e2(this,e),this.clearTimersOnDispose_(),i=window.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),window.clearTimeout(e)),e}setInterval(e,t){return e=e2(this,e),this.clearTimersOnDispose_(),e=window.setInterval(e,t),this.setIntervalIds_.add(e),e}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),window.clearInterval(e)),e}requestAnimationFrame(e){var t;return this.clearTimersOnDispose_(),e=e2(this,e),t=window.requestAnimationFrame(()=>{this.rafIds_.has(t)&&this.rafIds_.delete(t),e()}),this.rafIds_.add(t),t}requestNamedAnimationFrame(e,t){var i;if(!this.namedRafs_.has(e))return this.clearTimersOnDispose_(),t=e2(this,t),i=this.requestAnimationFrame(()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)}),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),window.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((e,i)=>this[t](i))}),this.clearingTimersOnDispose_=!1}))}static registerComponent(e,t){if("string"!=typeof e||!e)throw Error(`Illegal component name, "${e}"; must be a non-empty string.`);var i=ts.getComponent("Tech"),i=i&&i.isTech(t),n=ts===t||ts.prototype.isPrototypeOf(t.prototype);if(i||!n){let s;throw Error(`Illegal component, "${e}"; ${s=i?"techs must be registered using Tech.registerTech()":"must be a Component subclass"}.`)}if(e=eZ(e),ts.components_||(ts.components_={}),n=ts.getComponent("Player"),"Player"===e&&n&&n.players){let r=n.players;if(i=Object.keys(r),r&&0<i.length&&i.map(e=>r[e]).every(Boolean))throw Error("Can not register Player component after player has been created.")}return ts.components_[e]=t,ts.components_[eQ(e)]=t}static getComponent(e){if(e&&ts.components_)return ts.components_[e]}}function tr(e,t,i,n){var s=n,r=i.length-1;if("number"!=typeof s||s<0||r<s)throw Error(`Failed to execute '${e}' on 'TimeRanges': The index provided (${s}) is non-numeric or out of bounds (0-${r}).`);return i[n][t]}function ta(e){let t;return t=void 0===e||0===e.length?{length:0,start(){throw Error("This TimeRanges object is empty")},end(){throw Error("This TimeRanges object is empty")}}:{length:e.length,start:tr.bind(null,"start",0,e),end:tr.bind(null,"end",1,e)},window.Symbol&&window.Symbol.iterator&&(t[window.Symbol.iterator]=()=>(e||[]).values()),t}function to(e,t){return Array.isArray(e)?ta(e):void 0===e||void 0===t?ta():ta([[e,t]])}function tl(e,t){let i=Math.floor((e=e<0?0:e)%60),n=Math.floor(e/60%60),s=Math.floor(e/3600);var r=Math.floor(t/60%60),t=Math.floor(t/3600);return n=(((s=0<(s=isNaN(e)||e===1/0?n=i="-":s)||0<t?s+":":"")||10<=r)&&n<10?"0"+n:n)+":",s+n+(i=i<10?"0"+i:i)}ts.registerComponent("Component",ts);let tu=tl;function td(e){tu=e}function th(){tu=tl}function tc(e,t=e){return tu(e,t)}var tp=Object.freeze({__proto__:null,createTimeRanges:to,createTimeRange:to,setFormatTime:td,resetFormatTime:th,formatTime:tc});function tm(e,t){var i;let n=0,s;if(!t)return 0;e&&e.length||(e=to(0,0));for(let r=0;r<e.length;r++)i=e.start(r),(s=e.end(r))>t&&(s=t),n+=s-i;return n/t}function tf(e){if(e instanceof tf)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:v(e)&&("number"==typeof e.code&&(this.code=e.code),Object.assign(this,e)),this.message||(this.message=tf.defaultMessages[this.code]||"")}tf.prototype.code=0,tf.prototype.message="",tf.prototype.status=null,tf.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],tf.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."};for(let tg=0;tg<tf.errorTypes.length;tg++)tf[tf.errorTypes[tg]]=tg,tf.prototype[tf.errorTypes[tg]]=tg;var ty=function(e,t){var i,n=null;try{i=JSON.parse(e,t)}catch(s){n=s}return[n,i]};function tv(e){return null!=e&&"function"==typeof e.then}function t8(e){tv(e)&&e.then(null,e=>{})}function tb(e){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((t,i,n)=>(e[i]&&(t[i]=e[i]),t),{cues:e.cues&&Array.prototype.map.call(e.cues,function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}})})}var t$=function(e){var t=e.$$("track");let i=Array.prototype.map.call(t,e=>e.track);return Array.prototype.map.call(t,function(e){var t=tb(e.track);return e.src&&(t.src=e.src),t}).concat(Array.prototype.filter.call(e.textTracks(),function(e){return -1===i.indexOf(e)}).map(tb))};let tT="vjs-modal-dialog";class tw extends ts{constructor(e,t){super(e,t),this.handleKeyDown_=e=>this.handleKeyDown(e),this.close_=e=>this.close(e),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=Y("div",{className:tT+"-content"},{role:"document"}),this.descEl_=Y("p",{className:tT+"-description vjs-control-text",id:this.el().getAttribute("aria-describedby")}),Q(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"})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return tT+" 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(){var e;this.opened_||(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"boolean"==typeof e&&this[e?"open":"close"](),this.opened_}close(){var e;this.opened_&&(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("modalclose"),this.conditionalBlur_(),this.options_.temporary)&&this.dispose()}closeable(e){if("boolean"==typeof e){var t,e=this.closeable_=!!e;let i=this.getChild("closeButton");e&&!i&&(t=this.contentEl_,this.contentEl_=this.el_,i=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=t,this.on(i,"close",this.close_)),!e&&i&&(this.off(i,"close",this.close_),this.removeChild(i),i.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){var t=this.contentEl(),i=t.parentNode,n=t.nextSibling,e=(this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,i.removeChild(t),this.empty(),ey(t,e),this.trigger("modalfill"),n?i.insertBefore(t,n):i.appendChild(t),this.getChild("closeButton"));e&&i.appendChild(e.el_)}empty(){this.trigger("beforemodalempty"),em(this.contentEl()),this.trigger("modalempty")}content(e){return void 0!==e&&(this.content_=e),this.content_}conditionalFocus_(){var e=document.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(e.stopPropagation(),tn.isEventKey(e,"Escape")&&this.closeable())e.preventDefault(),this.close();else if(tn.isEventKey(e,"Tab")){var t=this.focusableEls_(),i=this.el_.querySelector(":focus");let n;for(let s=0;s<t.length;s++)if(i===t[s]){n=s;break}document.activeElement===this.el_&&(n=0),e.shiftKey&&0===n?(t[t.length-1].focus(),e.preventDefault()):e.shiftKey||n!==t.length-1||(t[0].focus(),e.preventDefault())}}focusableEls_(){var e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,e=>(e instanceof window.HTMLAnchorElement||e instanceof window.HTMLAreaElement)&&e.hasAttribute("href")||(e instanceof window.HTMLInputElement||e instanceof window.HTMLSelectElement||e instanceof window.HTMLTextAreaElement||e instanceof window.HTMLButtonElement)&&!e.hasAttribute("disabled")||e instanceof window.HTMLIFrameElement||e instanceof window.HTMLObjectElement||e instanceof window.HTMLEmbedElement||e.hasAttribute("tabindex")&&-1!==e.getAttribute("tabindex")||e.hasAttribute("contenteditable"))}}tw.prototype.options_={pauseOnOpen:!0,temporary:!0},ts.registerComponent("ModalDialog",tw);class t_ extends ej{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){let t=this.tracks_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.tracks_[t]}}),-1===this.tracks_.indexOf(e)&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack",target:this})),e.labelchange_=()=>{this.trigger({track:e,type:"labelchange",target:this})},eq(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let t;for(let i=0,n=this.length;i<n;i++)if(this[i]===e){(t=this[i]).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,n=this.length;i<n;i++){var s=this[i];if(s.id===e){t=s;break}}return t}}for(let tS in t_.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"})t_.prototype["on"+tS]=null;function tk(e,t){for(let i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].enabled=!1)}function tE(e,t){for(let i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].selected=!1)}class tC extends t_{addTrack(e){super.addTrack(e),this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),e.addEventListener("modechange",this.queueChange_),-1===["metadata","chapters"].indexOf(e.kind)&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_)&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_)}}class t0{constructor(e){t0.prototype.setCues_.call(this,e),Object.defineProperty(this,"length",{get(){return this.length_}})}setCues_(e){var t=this.length||0;let i=0;function n(e){""+e in this||Object.defineProperty(this,""+e,{get(){return this.cues_[e]}})}var s=e.length;if(this.cues_=e,this.length_=e.length,t<s)for(i=t;i<s;i++)n.call(this,i)}getCueById(e){let t=null;for(let i=0,n=this.length;i<n;i++){var s=this[i];if(s.id===e){t=s;break}}return t}}let tx={disabled:"disabled",hidden:"hidden",showing:"showing"};class tI extends ej{constructor(e={}){super();let t={id:e.id||"vjs_track_"+eI++,kind:e.kind||"",language:e.language||""},i=e.label||"";for(let n in t)Object.defineProperty(this,n,{get:()=>t[n],set(){}});Object.defineProperty(this,"label",{get:()=>i,set(e){e!==i&&(i=e,this.trigger("labelchange"))}})}}function tP(e){var t=["protocol","hostname","port","pathname","search","hash","host"],i=document.createElement("a"),n=(i.href=e,{});for(let s=0;s<t.length;s++)n[t[s]]=i[t[s]];return"http:"===n.protocol&&(n.host=n.host.replace(/:80$/,"")),"https:"===n.protocol&&(n.host=n.host.replace(/:443$/,"")),n.protocol||(n.protocol=window.location.protocol),n.host||(n.host=window.location.host),n}function tA(e){var t;return e.match(/^https?:\/\//)||((t=document.createElement("a")).href=e,e=t.href),e}function tL(e,t=window.location){return(":"===(e=tP(e)).protocol?t:e).protocol+e.host!==t.protocol+t.host}let tD=function(e){return"string"==typeof e&&(e=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(e))?e.pop().toLowerCase():""};var tO=Object.freeze({__proto__:null,parseUrl:tP,getAbsoluteURL:tA,getFileExtension:tD,isCrossOrigin:tL}),tR="undefined"!=typeof window?window:void 0!==tt?tt:"undefined"!=typeof self?self:{},tN=tR,tM=ti(function(e){function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i,n=arguments[t];for(i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,t.apply(this,arguments)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}),t3=(tR=tM)&&tR.__esModule&&Object.prototype.hasOwnProperty.call(tR,"default")?tR.default:tR,tB=function(e){var t;return!!e&&("[object Function]"===(t=tU.call(e))||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt))},tU=Object.prototype.toString;t5.httpHandler=function(e,t){return void 0===t&&(t=!1),function(i,n,s){if(i)e(i);else if(400<=n.statusCode&&n.statusCode<=599){if(i=s,t){if(tN.TextDecoder){var r;n=(void 0===(r=n.headers&&n.headers["content-type"])&&(r=""),r.toLowerCase().split(";").reduce(function(e,t){var t=t.split("="),i=t[0],t=t[1];return"charset"===i.trim()?t.trim():e},"utf-8"));try{i=new TextDecoder(n).decode(s)}catch(a){}}else i=String.fromCharCode.apply(null,new Uint8Array(s))}e({cause:i})}else e(null,s)}};for(var t2=function(e){var t={};return e&&e.trim().split("\n").forEach(function(e){var i=e.indexOf(":"),n=e.slice(0,i).trim().toLowerCase(),e=e.slice(i+1).trim();void 0===t[n]?t[n]=e:Array.isArray(t[n])?t[n].push(e):t[n]=[t[n],e]}),t},t1=t5,tR=t5,t4=(t5.XMLHttpRequest=tN.XMLHttpRequest||function(){},t5.XDomainRequest=("withCredentials"in new t5.XMLHttpRequest)?t5.XMLHttpRequest:tN.XDomainRequest,["get","put","post","patch","head","delete"]),t6=function(e){t5["delete"===e?"del":e]=function(t,i,n){return(i=tj(t,i,n)).method=e.toUpperCase(),tq(i)}},tF=0;tF<t4.length;tF++)t6(t4[tF]);function tj(e,t,i){var n=e;return tB(t)?(i=t,"string"==typeof e&&(n={uri:e})):n=tM({},t,{uri:e}),n.callback=i,n}function t5(e,t,i){return tq(t=tj(e,t,i))}function tq(e){if(void 0===e.callback)throw Error("callback argument missing");var t=!1,i=function(i,n,s){t||(t=!0,e.callback(i,n,s))};function n(e){return clearTimeout(o),(e=e instanceof Error?e:Error(""+(e||"Unknown XMLHttpRequest Error"))).statusCode=0,i(e,f)}function s(){var t,n,s;if(!a)return clearTimeout(o),t=e.useXDR&&void 0===l.status?200:1223===l.status?204:l.status,n=f,s=null,0!==t?(n={body:function e(){var t=void 0,t=l.response||l.responseText||function(e){try{if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;if(""===e.responseType&&!t)return e.responseXML}catch(i){}return null}(l);if(m)try{t=JSON.parse(t)}catch(i){}return t}(),statusCode:t,method:d,headers:{},url:u,rawRequest:l},l.getAllResponseHeaders&&(n.headers=t2(l.getAllResponseHeaders()))):s=Error("Internal XMLHttpRequest Error"),i(s,n,n.body)}var r,a,o,l=e.xhr||null,u=(l=l||new(e.cors||e.useXDR?t5.XDomainRequest:t5.XMLHttpRequest)).url=e.uri||e.url,d=l.method=e.method||"GET",h=e.body||e.data,c=l.headers=e.headers||{},p=!!e.sync,m=!1,f={body:void 0,headers:{},statusCode:0,method:d,url:u,rawRequest:l};if("json"in e&&!1!==e.json&&(m=!0,c.accept||c.Accept||(c.Accept="application/json"),"GET"!==d)&&"HEAD"!==d&&(c["content-type"]||c["Content-Type"]||(c["Content-Type"]="application/json"),h=JSON.stringify(!0===e.json?h:e.json)),l.onreadystatechange=function(){4===l.readyState&&setTimeout(s,0)},l.onload=s,l.onerror=n,l.onprogress=function(){},l.onabort=function(){a=!0},l.ontimeout=n,l.open(d,u,!p,e.username,e.password),p||(l.withCredentials=!!e.withCredentials),!p&&0<e.timeout&&(o=setTimeout(function(){var e;a||(a=!0,l.abort("timeout"),(e=Error("XMLHttpRequest timeout")).code="ETIMEDOUT",n(e))},e.timeout)),l.setRequestHeader)for(r in c)c.hasOwnProperty(r)&&l.setRequestHeader(r,c[r]);else if(e.headers&&!function(e){for(var t in e)if(e.hasOwnProperty(t))return;return 1}(e.headers))throw Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(l.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(l),l.send(h||null),l}function tH(e,t){var i=new window.WebVTT.Parser(window,window.vttjs,window.WebVTT.StringDecoder());let n=[];i.oncue=function(e){t.addCue(e)},i.onparsingerror=function(e){n.push(e)},i.onflush=function(){t.trigger({type:"loadeddata",target:t})},i.parse(e),0<n.length&&(window.console&&window.console.groupCollapsed&&window.console.groupCollapsed("Text Track parsing errors for "+t.src),n.forEach(e=>p.error(e)),window.console)&&window.console.groupEnd&&window.console.groupEnd(),i.flush()}function tV(e,t){var i={uri:e};(e=tL(e))&&(i.cors=e),(e="use-credentials"===t.tech_.crossOrigin())&&(i.withCredentials=e),t1(i,e2(this,function(e,i,n){if(e)return p.error(e,i);t.loaded_=!0,"function"!=typeof window.WebVTT?t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],e=>{if("vttjserror"!==e.type)return tH(n,t);p.error("vttjs failed to load, stopping trying to process "+t.src)}):tH(n,t)}))}t1.default=tR;class t7 extends tI{constructor(e={}){if(!e.tech)throw Error("A tech was not provided.");let t=tx[(e=$(e,{kind:{subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"}[e.kind]||"subtitles",language:e.language||e.srclang||""})).mode]||"disabled",i=e.default,n=("metadata"!==e.kind&&"chapters"!==e.kind||(t="hidden"),super(e),this.tech_=e.tech,this.cues_=[],this.activeCues_=[],this.preload_=!1!==this.tech_.preloadTextTracks,new t0(this.cues_)),s=new t0(this.activeCues_),r=!1;this.timeupdateHandler=e2(this,function(e={}){this.tech_.isDisposed()||(this.tech_.isReady_&&(this.activeCues=this.activeCues,r)&&(this.trigger("cuechange"),r=!1),"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)))}),this.tech_.one("dispose",()=>{this.stopTracking()}),"disabled"!==t&&this.startTracking(),Object.defineProperties(this,{default:{get:()=>i,set(){}},mode:{get:()=>t,set(e){tx[e]&&t!==e&&(t=e,this.preload_||"disabled"===t||0!==this.cues.length||tV(this.src,this),this.stopTracking(),"disabled"!==t&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?n:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(0!==this.cues.length){var e=this.tech_.currentTime(),t=[];for(let i=0,n=this.cues.length;i<n;i++){var a=this.cues[i];a.startTime<=e&&a.endTime>=e&&t.push(a)}if(r=!1,t.length!==this.activeCues_.length)r=!0;else for(let o=0;o<t.length;o++)-1===this.activeCues_.indexOf(t[o])&&(r=!0);this.activeCues_=t,s.setCues_(this.activeCues_)}return s},set(){}}}),e.src?(this.src=e.src,this.preload_||(this.loaded_=!0),(this.preload_||"subtitles"!==e.kind&&"captions"!==e.kind)&&tV(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(window.vttjs&&!(e instanceof window.vttjs.VTTCue)){for(let i in t=new window.vttjs.VTTCue(e.startTime,e.endTime,e.text),e)i in t||(t[i]=e[i]);t.id=e.id,t.originalCue_=e}var n=this.tech_.textTracks();for(let s=0;s<n.length;s++)n[s]!==this&&n[s].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)}removeCue(e){let t=this.cues_.length;for(;t--;){var i=this.cues_[t];if(i===e||i.originalCue_&&i.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}}}t7.prototype.allowedEvents_={cuechange:"cuechange"};class t9 extends tI{constructor(e={}){super(e=$(e,{kind:{alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"}[e.kind]||""}));let t=!1;Object.defineProperty(this,"enabled",{get:()=>t,set(e){"boolean"==typeof e&&e!==t&&(t=e,this.trigger("enabledchange"))}}),e.enabled&&(this.enabled=e.enabled),this.loaded_=!0}}class tW extends tI{constructor(e={}){super(e=$(e,{kind:{alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"}[e.kind]||""}));let t=!1;Object.defineProperty(this,"selected",{get:()=>t,set(e){"boolean"==typeof e&&e!==t&&(t=e,this.trigger("selectedchange"))}}),e.selected&&(this.selected=e.selected)}}class tz extends ej{constructor(e={}){super();let t,i=new t7(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:()=>t},track:{get:()=>i}}),t=tz.NONE,i.addEventListener("loadeddata",()=>{t=tz.LOADED,this.trigger({type:"load",target:this})})}}tz.prototype.allowedEvents_={load:"load"},tz.NONE=0,tz.LOADING=1,tz.LOADED=2,tz.ERROR=3;let tG={audio:{ListClass:class extends t_{constructor(e=[]){for(let t=e.length-1;0<=t;t--)if(e[t].enabled){tk(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&tk(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,tk(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)}},TrackClass:t9,capitalName:"Audio"},video:{ListClass:class extends t_{constructor(e=[]){for(let t=e.length-1;0<=t;t--)if(e[t].selected){tE(e,e[t]);break}super(e),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let e=0;e<this.length;e++)if(this[e].selected)return e;return -1},set(){}})}addTrack(e){e.selected&&tE(this,e),super.addTrack(e),e.addEventListener&&(e.selectedChange_=()=>{this.changing_||(this.changing_=!0,tE(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)}},TrackClass:tW,capitalName:"Video"},text:{ListClass:tC,TrackClass:t7,capitalName:"Text"}},tX=(Object.keys(tG).forEach(function(e){tG[e].getterName=e+"Tracks",tG[e].privateName=e+"Tracks_"}),{remoteText:{ListClass:tC,TrackClass:t7,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:class{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){let t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.trackElements_[t]}}),-1===this.trackElements_.indexOf(e)&&this.trackElements_.push(e)}getTrackElementByTrack_(e){let t;for(let i=0,n=this.trackElements_.length;i<n;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&&"function"==typeof this.trackElements_[t].track.off&&this.trackElements_[t].track.off(),"function"==typeof this.trackElements_[t].off&&this.trackElements_[t].off(),this.trackElements_.splice(t,1);break}}},TrackClass:tz,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}}),tK=Object.assign({},tG,tX);tX.names=Object.keys(tX),tG.names=Object.keys(tG),tK.names=[].concat(tX.names).concat(tG.names);var tR=void 0!==tt?tt:"undefined"!=typeof window?window:{},tY="undefined"!=typeof document?document:(tY=tR["__GLOBAL_DOCUMENT_CACHE@4"])||(tR["__GLOBAL_DOCUMENT_CACHE@4"]={}),tt=tY,tQ=Object.create||function(e){if(1!==arguments.length)throw Error("Object.create shim only accepts one parameter.");return tZ.prototype=e,new tZ};function tZ(){}function tJ(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function ie(e){function t(e,t,i,n){return 3600*(0|e)+60*(0|t)+(0|i)+(0|n)/1e3}return(e=e.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/))?e[3]?t(e[1],e[2],e[3].replace(":",""),e[4]):59<e[1]?t(e[1],e[2],0,e[4]):t(0,e[1],e[2],e[4]):null}function it(){this.values=tQ(null)}function ii(e,t,i,n){var s,r,a=n?e.split(n):[e];for(s in a)"string"==typeof a[s]&&2===(r=a[s].split(i)).length&&t(r[0].trim(),r[1].trim())}((tJ.prototype=tQ(Error.prototype)).constructor=tJ).Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},it.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function(e,t,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,i){for(var n=0;n<i.length;++n)if(t===i[n]){this.set(e,t);break}},integer:function(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))},percent:function(e,t){return!!(t.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&0<=(t=parseFloat(t))&&t<=100)&&(this.set(e,t),!0)}};var is=tt.createElement&&tt.createElement("textarea"),ir={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},ia={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)"},io={v:"title",lang:"lang"},il={rt:"ruby"};function iu(e,t){for(var i,n,s,r,a,o,l=e.document.createElement("div"),u=l,d=[];null!==(o=void 0,o=t?(o=(o=t.match(/^([^<]*)(<[^>]*>?)?/))[1]||o[2],t=t.substr(o.length),o):null);)"<"===o[0]?"/"===o[1]?d.length&&d[d.length-1]===o.substr(2).replace(">","")&&(d.pop(),u=u.parentNode):(n=ie(o.substr(1,o.length-2)))?(i=e.document.createProcessingInstruction("timestamp",n),u.appendChild(i)):(n=o.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/))&&(s=n[1],r=n[3],a=void 0,i=(a=ir[s])?(a=e.document.createElement(a),(s=io[s])&&r&&(a[s]=r.trim()),a):null)&&(s=u,il[(r=i).localName]&&il[r.localName]!==s.localName||(n[2]&&((a=n[2].split(".")).forEach(function(e){var t=/^bg_/.test(e),e=t?e.slice(3):e;ia.hasOwnProperty(e)&&(e=ia[e],i.style[t?"background-color":"color"]=e)}),i.className=a.join(" ")),d.push(n[1]),u.appendChild(i),u=i)):u.appendChild(e.document.createTextNode((r=o,is.innerHTML=r,r=is.textContent,is.textContent="",r)));return l}var id=[[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 ih(){}function ic(e,t,i){ih.call(this),this.cue=t,this.cueDiv=iu(e,t.text);var n={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:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"},s=(this.applyStyles(n,this.cueDiv),this.div=e.document.createElement("div"),n={direction:function e(t){var i=[],n="";if(t&&t.childNodes){for(r(i,t);n=function e(t){var i,n,s;return t&&t.length?(n=(i=t.pop()).textContent||i.innerText)?(s=n.match(/^.*(\n|\r)/))?s[t.length=0]:n:"ruby"===i.tagName?e(t):i.childNodes?(r(t,i),e(t)):void 0:null}(i);)for(var s=0;s<n.length;s++)if(function(e){for(var t=0;t<id.length;t++){var i=id[t];if(e>=i[0]&&e<=i[1])return 1}}(n.charCodeAt(s)))return"rtl"}return"ltr";function r(e,t){for(var i=t.childNodes.length-1;0<=i;i--)e.push(t.childNodes[i])}}(this.cueDiv),writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:"middle"===t.align?"center":t.align,font:i.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(n),this.div.appendChild(this.cueDiv),0);switch(t.positionAlign){case"start":s=t.position;break;case"center":s=t.position-t.size/2;break;case"end":s=t.position-t.size}""===t.vertical?this.applyStyles({left:this.formatStyle(s,"%"),width:this.formatStyle(t.size,"%")}):this.applyStyles({top:this.formatStyle(s,"%"),height:this.formatStyle(t.size,"%")}),this.move=function(e){this.applyStyles({top:this.formatStyle(e.top,"px"),bottom:this.formatStyle(e.bottom,"px"),left:this.formatStyle(e.left,"px"),right:this.formatStyle(e.right,"px"),height:this.formatStyle(e.height,"px"),width:this.formatStyle(e.width,"px")})}}function ip(e){var t,i,n,s;e.div&&(t=e.div.offsetHeight,i=e.div.offsetWidth,n=e.div.offsetTop,s=(s=(s=e.div.childNodes)&&s[0])&&s.getClientRects&&s.getClientRects(),e=e.div.getBoundingClientRect(),s=s?Math.max(s[0]&&s[0].height||0,e.height/s.length):0),this.left=e.left,this.right=e.right,this.top=e.top||n,this.height=e.height||t,this.bottom=e.bottom||n+(e.height||t),this.width=e.width||i,this.lineHeight=void 0!==s?s:e.lineHeight}function im(e,t,i,n){var s,r=new ip(t),a=t.cue,o=function(e){if("number"==typeof e.line&&(e.snapToLines||0<=e.line&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return -1;for(var t=e.track,i=t.textTrackList,n=0,s=0;s<i.length&&i[s]!==t;s++)"showing"===i[s].mode&&n++;return -1*++n}(a),l=[];if(a.snapToLines){switch(a.vertical){case"":l=["+y","-y"],s="height";break;case"rl":l=["+x","-x"],s="width";break;case"lr":l=["-x","+x"],s="width"}var u=r.lineHeight,d=u*Math.round(o),h=i[s]+u,c=l[0];Math.abs(d)>h&&(d=d<0?-1:1,d*=Math.ceil(h/u)*u),o<0&&(d+=""===a.vertical?i.height:i.width,l=l.reverse()),r.move(c,d)}else{var p=r.lineHeight/i.height*100;switch(a.lineAlign){case"center":o-=p/2;break;case"end":o-=p}switch(a.vertical){case"":t.applyStyles({top:t.formatStyle(o,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(o,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(o,"%")})}l=["+y","-x","+x","-y"],r=new ip(t)}h=function(e,t){for(var s,r=new ip(e),a=1,o=0;o<t.length;o++){for(;e.overlapsOppositeAxis(i,t[o])||e.within(i)&&e.overlapsAny(n);)e.move(t[o]);if(e.within(i))return e;var l=e.intersectPercentage(i);l<a&&(s=new ip(e),a=l),e=new ip(r)}return s||r}(r,l),t.move(h.toCSSCompatValues(i))}function ig(){}ih.prototype.applyStyles=function(e,t){for(var i in t=t||this.div,e)e.hasOwnProperty(i)&&(t.style[i]=e[i])},ih.prototype.formatStyle=function(e,t){return 0===e?0:e+t},(ic.prototype=tQ(ih.prototype)).constructor=ic,ip.prototype.move=function(e,t){switch(t=void 0!==t?t:this.lineHeight,e){case"+x":this.left+=t,this.right+=t;break;case"-x":this.left-=t,this.right-=t;break;case"+y":this.top+=t,this.bottom+=t;break;case"-y":this.top-=t,this.bottom-=t}},ip.prototype.overlaps=function(e){return this.left<e.right&&this.right>e.left&&this.top<e.bottom&&this.bottom>e.top},ip.prototype.overlapsAny=function(e){for(var t=0;t<e.length;t++)if(this.overlaps(e[t]))return!0;return!1},ip.prototype.within=function(e){return this.top>=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},ip.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.left<e.left;case"-x":return this.right>e.right;case"+y":return this.top<e.top;case"-y":return this.bottom>e.bottom}},ip.prototype.intersectPercentage=function(e){return Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left))*Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top))/(this.height*this.width)},ip.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},ip.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,i=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,n=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return{left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||n,height:e.height||t,bottom:e.bottom||n+(e.height||t),width:e.width||i}},ig.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},ig.convertCueToDOMTree=function(e,t){return e&&t?iu(e,t):null},ig.processCues=function(e,t,i){if(!e||!t||!i)return null;for(;i.firstChild;)i.removeChild(i.firstChild);var n=e.document.createElement("div");if(n.style.position="absolute",n.style.left="0",n.style.right="0",n.style.top="0",n.style.bottom="0",n.style.margin="1.5%",i.appendChild(n),function(e){for(var t=0;t<e.length;t++)if(e[t].hasBeenReset||!e[t].displayState)return 1}(t))for(var s,r,a=[],o=ip.getSimpleBoxPosition(n),l={font:Math.round(.05*o.height*100)/100+"px sans-serif"},u=0;u<t.length;u++)r=t[u],s=new ic(e,r,l),n.appendChild(s.div),im(0,s,o,a),r.displayState=s.div,a.push(ip.getSimpleBoxPosition(s));else for(var d=0;d<t.length;d++)n.appendChild(t[d].displayState)},(ig.Parser=function(e,t,i){i||(i=t,t={}),t=t||{},this.window=e,this.vttjs=t,this.state="INITIAL",this.buffer="",this.decoder=i||new TextDecoder("utf8"),this.regionList=[]}).prototype={reportOrThrowError:function(e){if(!(e instanceof tJ))throw e;this.onparsingerror&&this.onparsingerror(e)},parse:function(e){var t=this;function i(){for(var e=t.buffer,i=0;i<e.length&&"\r"!==e[i]&&"\n"!==e[i];)++i;var n=e.substr(0,i);return"\r"===e[i]&&++i,"\n"===e[i]&&++i,t.buffer=e.substr(i),n}function n(e){e.match(/X-TIMESTAMP-MAP/)?ii(e,function(e,i){var n;"X-TIMESTAMP-MAP"===e&&(e=i,n=new it,ii(e,function(e,t){switch(e){case"MPEGT":n.integer(e+"S",t);break;case"LOCA":n.set(e+"L",ie(t))}},/[^\d]:/,/,/),t.ontimestampmap)&&t.ontimestampmap({MPEGTS:n.get("MPEGTS"),LOCAL:n.get("LOCAL")})},/=/):ii(e,function(e,i){var n;"Region"===e&&(e=i,n=new it,ii(e,function(e,t){switch(e){case"id":n.set(e,t);break;case"width":n.percent(e,t);break;case"lines":n.integer(e,t);break;case"regionanchor":case"viewportanchor":var i,s=t.split(",");2===s.length&&((i=new it).percent("x",s[0]),i.percent("y",s[1]),i.has("x")&&i.has("y"))&&(n.set(e+"X",i.get("x")),n.set(e+"Y",i.get("y")));break;case"scroll":n.alt(e,t,["up"])}},/=/,/\s/),n.has("id"))&&((e=new(t.vttjs.VTTRegion||t.window.VTTRegion)).width=n.get("width",100),e.lines=n.get("lines",3),e.regionAnchorX=n.get("regionanchorX",0),e.regionAnchorY=n.get("regionanchorY",100),e.viewportAnchorX=n.get("viewportanchorX",0),e.viewportAnchorY=n.get("viewportanchorY",100),e.scroll=n.get("scroll",""),t.onregion&&t.onregion(e),t.regionList.push({id:n.get("id"),region:e}))},/:/)}e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));try{if("INITIAL"===t.state){if(!/\r\n|\n/.test(t.buffer))return this;var s,r=(s=i()).match(/^WEBVTT([ \t].*)?$/);if(!r||!r[0])throw new tJ(tJ.Errors.BadSignature);t.state="HEADER"}for(var a=!1;t.buffer&&/\r\n|\n/.test(t.buffer);)switch(a?a=!1:s=i(),t.state){case"HEADER":/:/.test(s)?n(s):s||(t.state="ID");continue;case"NOTE":s||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(s)){t.state="NOTE";break}if(!s)continue;t.cue=new(t.vttjs.VTTCue||t.window.VTTCue)(0,0,"");try{t.cue.align="center"}catch(o){t.cue.align="middle"}if(t.state="CUE",-1===s.indexOf("-->")){t.cue.id=s;continue}case"CUE":try{!function(e,t,i){var n=e;function s(){var t=ie(e);if(null===t)throw new tJ(tJ.Errors.BadTimeStamp,"Malformed timestamp: "+n);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function r(){e=e.replace(/^\s+/,"")}if(r(),t.startTime=s(),r(),"-->"!==e.substr(0,3))throw new tJ(tJ.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+n);e=e.substr(3),r(),t.endTime=s(),r();var a=e,o=new it;ii(a,function(e,t){switch(e){case"region":for(var n=i.length-1;0<=n;n--)if(i[n].id===t){o.set(e,i[n].region);break}break;case"vertical":o.alt(e,t,["rl","lr"]);break;case"line":var s=t.split(","),r=s[0];o.integer(e,r),o.percent(e,r)&&o.set("snapToLines",!1),o.alt(e,r,["auto"]),2===s.length&&o.alt("lineAlign",s[1],["start","center","end"]);break;case"position":s=t.split(","),o.percent(e,s[0]),2===s.length&&o.alt("positionAlign",s[1],["start","center","end"]);break;case"size":o.percent(e,t);break;case"align":o.alt(e,t,["start","center","end","left","right"])}},/:/,/\s/),t.region=o.get("region",null),t.vertical=o.get("vertical","");try{t.line=o.get("line","auto")}catch(l){}t.lineAlign=o.get("lineAlign","start"),t.snapToLines=o.get("snapToLines",!0),t.size=o.get("size",100);try{t.align=o.get("align","center")}catch(u){t.align=o.get("align","middle")}try{t.position=o.get("position","auto")}catch(d){t.position=o.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},t.align)}t.positionAlign=o.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},t.align)}(s,t.cue,t.regionList)}catch(l){t.reportOrThrowError(l),t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":var u=-1!==s.indexOf("-->");if(!s||u&&(a=!0)){t.oncue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}t.cue.text&&(t.cue.text+="\n"),t.cue.text+=s.replace(/\u2028/g,"\n").replace(/u2029/g,"\n");continue;case"BADCUE":s||(t.state="ID");continue}}catch(d){t.reportOrThrowError(d),"CUETEXT"===t.state&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state="INITIAL"===t.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){var e=this;try{if(e.buffer+=e.decoder.decode(),(e.cue||"HEADER"===e.state)&&(e.buffer+="\n\n",e.parse()),"INITIAL"===e.state)throw new tJ(tJ.Errors.BadSignature)}catch(t){e.reportOrThrowError(t)}return e.onflush&&e.onflush(),this}};var iy=ig,iv={"":1,lr:1,rl:1},i8={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function ib(e){return"string"==typeof e&&!!i8[e.toLowerCase()]&&e.toLowerCase()}function i$(e,t,i){this.hasBeenReset=!1;var n="",s=!1,r=e,a=t,o=i,l=null,u="",d=!0,h="auto",c="start",p="auto",m="auto",f=100,g="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return n},set:function(e){n=""+e}},pauseOnExit:{enumerable:!0,get:function(){return s},set:function(e){s=!!e}},startTime:{enumerable:!0,get:function(){return r},set:function(e){if("number"!=typeof e)throw TypeError("Start time must be set to a number.");r=e,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e)throw TypeError("End time must be set to a number.");a=e,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return o},set:function(e){o=""+e,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return l},set:function(e){l=e,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return u},set:function(e){if(!1===(e="string"==typeof e&&!!iv[e.toLowerCase()]&&e.toLowerCase()))throw SyntaxError("Vertical: an invalid or illegal direction string was specified.");u=e,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return d},set:function(e){d=!!e,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return h},set:function(e){if("number"!=typeof e&&"auto"!==e)throw SyntaxError("Line: an invalid number or illegal string was specified.");h=e,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return c},set:function(e){(e=ib(e))&&(c=e,this.hasBeenReset=!0)}},position:{enumerable:!0,get:function(){return p},set:function(e){if(e<0||100<e)throw Error("Position must be between 0 and 100.");p=e,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return m},set:function(e){(e=ib(e))&&(m=e,this.hasBeenReset=!0)}},size:{enumerable:!0,get:function(){return f},set:function(e){if(e<0||100<e)throw Error("Size must be between 0 and 100.");f=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return g},set:function(e){if(!(e=ib(e)))throw SyntaxError("align: an invalid or illegal alignment string was specified.");g=e,this.hasBeenReset=!0}}}),this.displayState=void 0}i$.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var iT=i$,iw={"":!0,up:!0};function i_(e){return"number"==typeof e&&0<=e&&e<=100}function iS(){var e=100,t=3,i=0,n=100,s=0,r=100,a="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!i_(t))throw Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return t},set:function(e){if("number"!=typeof e)throw TypeError("Lines must be set to a number.");t=e}},regionAnchorY:{enumerable:!0,get:function(){return n},set:function(e){if(!i_(e))throw Error("RegionAnchorX must be between 0 and 100.");n=e}},regionAnchorX:{enumerable:!0,get:function(){return i},set:function(e){if(!i_(e))throw Error("RegionAnchorY must be between 0 and 100.");i=e}},viewportAnchorY:{enumerable:!0,get:function(){return r},set:function(e){if(!i_(e))throw Error("ViewportAnchorY must be between 0 and 100.");r=e}},viewportAnchorX:{enumerable:!0,get:function(){return s},set:function(e){if(!i_(e))throw Error("ViewportAnchorX must be between 0 and 100.");s=e}},scroll:{enumerable:!0,get:function(){return a},set:function(e){!1!==(e="string"==typeof e&&!!iw[e.toLowerCase()]&&e.toLowerCase())&&(a=e)}}})}var ik=ti(function(e){var e=e.exports={WebVTT:iy,VTTCue:iT,VTTRegion:iS},t=(tN.vttjs=e,tN.WebVTT=e.WebVTT,e.VTTCue),i=e.VTTRegion,n=tN.VTTCue,s=tN.VTTRegion;e.shim=function(){tN.VTTCue=t,tN.VTTRegion=i},e.restore=function(){tN.VTTCue=n,tN.VTTRegion=s},tN.VTTCue||e.shim()});ik.WebVTT,ik.VTTCue,ik.VTTRegion;class iE extends ts{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=e=>this.onDurationChange(e),this.trackProgress_=e=>this.trackProgress(e),this.trackCurrentTime_=e=>this.trackCurrentTime(e),this.stopTrackingCurrentTime_=e=>this.stopTrackingCurrentTime(e),this.disposeSourceHandler_=e=>this.disposeSourceHandler(e),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",function(){this.hasStarted_=!0}),this.on("loadstart",function(){this.hasStarted_=!1}),tK.names.forEach(t=>{t=tK[t],e&&e[t.getterName]&&(this[t.privateName]=e[t.getterName])}),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(t=>{!1===e[`native${t}Tracks`]&&(this[`featuresNative${t}Tracks`]=!1)}),!1===e.nativeCaptions||!1===e.nativeTextTracks?this.featuresNativeTextTracks=!1:!0!==e.nativeCaptions&&!0!==e.nativeTextTracks||(this.featuresNativeTextTracks=!0),this.featuresNativeTextTracks||this.emulateTextTracks(),this.preloadTextTracks=!1!==e.preloadTextTracks,this.autoRemoteTextTracks_=new tK.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(e2(this,function(){var e=this.bufferedPercent();this.bufferedPercent_!==e&&this.trigger("progress"),1===(this.bufferedPercent_=e)&&this.stopTrackingProgress()}),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return to(0,0)}bufferedPercent(){return tm(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(tG.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){(e=[].concat(e)).forEach(e=>{var t=this[e+"Tracks"]()||[];let i=t.length;for(;i--;){var n=t[i];"text"===e&&this.removeRemoteTextTrack(n),t.removeTrack(n)}})}cleanupAutoTextTracks(){var e=this.autoRemoteTextTracks_||[];let t=e.length;for(;t--;){var i=e[t];this.removeRemoteTextTrack(i)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return void 0!==e&&(this.error_=new tf(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?to(0,0):to()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){tG.names.forEach(e=>{var t=tG[e];let i=()=>{this.trigger(e+"trackchange")},n=this[t.getterName]();n.addEventListener("removetrack",i),n.addEventListener("addtrack",i),this.on("dispose",()=>{n.removeEventListener("removetrack",i),n.removeEventListener("addtrack",i)})})}addWebVttScript_(){if(!window.WebVTT){if(document.body.contains(this.el())){if(!this.options_["vtt.js"]&&b(ik)&&0<Object.keys(ik).length)this.trigger("vttjsloaded");else{let e=document.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}),window.WebVTT=!0,this.el().parentNode.appendChild(e)}}else this.ready(this.addWebVttScript_)}}emulateTextTracks(){let e=this.textTracks(),t=this.remoteTextTracks(),i=t=>e.addTrack(t.track),n=t=>e.removeTrack(t.track),s=(t.on("addtrack",i),t.on("removetrack",n),this.addWebVttScript_(),()=>this.trigger("texttrackchange")),r=()=>{s();for(let t=0;t<e.length;t++){var i=e[t];i.removeEventListener("cuechange",s),"showing"===i.mode&&i.addEventListener("cuechange",s)}};r(),e.addEventListener("change",r),e.addEventListener("addtrack",r),e.addEventListener("removetrack",r),this.on("dispose",function(){t.off("addtrack",i),t.off("removetrack",n),e.removeEventListener("change",r),e.removeEventListener("addtrack",r),e.removeEventListener("removetrack",r);for(let a=0;a<e.length;a++)e[a].removeEventListener("cuechange",s)})}addTextTrack(e,t,i){var n,s,r;if(e)return s={},r=(n=this).textTracks(),s.kind=e,t&&(s.label=t),i&&(s.language=i),s.tech=n,e=new tK.text.TrackClass(s),r.addTrack(e),e;throw Error("TextTrack kind is required but was not provided")}createRemoteTextTrack(e){return e=$(e,{tech:this}),new tX.remoteTextEl.TrackClass(e)}addRemoteTextTrack(e={},t){let i=this.createRemoteTextTrack(e);return"boolean"!=typeof t&&(t=!1),this.remoteTextTrackEls().addTrackElement_(i),this.remoteTextTracks().addTrack(i.track),!1===t&&this.ready(()=>this.autoRemoteTextTracks_.addTrack(i.track)),i}removeRemoteTextTrack(e){var 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){let t=eI++;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 iE.canPlayType(e.type)}static isTech(e){return e.prototype instanceof iE||e instanceof iE||e===iE}static registerTech(e,t){if(iE.techs_||(iE.techs_={}),!iE.isTech(t))throw Error(`Tech ${e} must be a Tech`);if(!iE.canPlayType)throw Error("Techs must have a static canPlayType method on them");if(iE.canPlaySource)return e=eZ(e),iE.techs_[e]=t,iE.techs_[eQ(e)]=t,"Tech"!==e&&iE.defaultTechOrder_.push(e),t;throw Error("Techs must have a static canPlaySource method on them")}static getTech(e){if(e)return iE.techs_&&iE.techs_[e]?iE.techs_[e]:(e=eZ(e),window&&window.videojs&&window.videojs[e]?(p.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),window.videojs[e]):void 0)}}tK.names.forEach(function(e){let t=tK[e];iE.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName]}}),iE.prototype.featuresVolumeControl=!0,iE.prototype.featuresMuteControl=!0,iE.prototype.featuresFullscreenResize=!1,iE.prototype.featuresPlaybackRate=!1,iE.prototype.featuresProgressEvents=!1,iE.prototype.featuresSourceset=!1,iE.prototype.featuresTimeupdateEvents=!1,iE.prototype.featuresNativeTextTracks=!1,iE.prototype.featuresVideoFrameCallback=!1,iE.withSourceHandlers=function(e){e.registerSourceHandler=function(t,i){let n=e.sourceHandlers;n=n||(e.sourceHandlers=[]),void 0===i&&(i=n.length),n.splice(i,0,t)},e.canPlayType=function(t){var i,n=e.sourceHandlers||[];for(let s=0;s<n.length;s++)if(i=n[s].canPlayType(t))return i;return""},e.selectSourceHandler=function(t,i){var n=e.sourceHandlers||[];for(let s=0;s<n.length;s++)if(n[s].canHandleSource(t,i))return n[s];return null},e.canPlaySource=function(t,i){var n=e.selectSourceHandler(t,i);return n?n.canHandleSource(t,i):""},["seekable","seeking","duration"].forEach(function(e){let t=this[e];"function"==typeof t&&(this[e]=function(){return this.sourceHandler_&&this.sourceHandler_[e]?this.sourceHandler_[e].apply(this.sourceHandler_,arguments):t.apply(this,arguments)})},e.prototype),e.prototype.setSource=function(t){let i=e.selectSourceHandler(t,this.options_);i||(e.nativeSourceHandler?i=e.nativeSourceHandler:p.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),i!==e.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=i.handleSource(t,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},e.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)}},ts.registerComponent("Tech",iE),iE.registerTech("Tech",iE),iE.defaultTechOrder_=[];let iC={},i0={},ix={};function iI(e,t,i,n=null){var s="call"+eZ(i),s=e.reduce(iD(s),n),n=s===ix,t=n?null:t[i](s),r=e,a=i,o=t,l=n;for(let u=r.length-1;0<=u;u--){var d=r[u];d[a]&&d[a](l,o)}return t}let iP={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},iA={setCurrentTime:1,setMuted:1,setVolume:1},iL={play:1,pause:1};function iD(e){return(t,i)=>t===ix?ix:i[e]?i[e](t):t}let iO={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"},iR=function(e=""){return iO[(e=tD(e)).toLowerCase()]||""};function iN(e){var t;return e.type||(t=iR(e.src))&&(e.type=t),e}ts.registerComponent("MediaLoader",class e extends ts{constructor(e,t,i){if(super(e,$({createEl:!1},t),i),t.playerOptions.sources&&0!==t.playerOptions.sources.length)e.src(t.playerOptions.sources);else for(let n=0,s=t.playerOptions.techOrder;n<s.length;n++){var r=eZ(s[n]);let a=iE.getTech(r);if((a=r?a:ts.getComponent(r))&&a.isSupported()){e.loadTech_(r);break}}}});class iM extends ts{constructor(e,t){super(e,t),this.options_.controlText&&this.controlText(this.options_.controlText),this.handleMouseOver_=e=>this.handleMouseOver(e),this.handleMouseOut_=e=>this.handleMouseOut(e),this.handleClick_=e=>this.handleClick(e),this.handleKeyDown_=e=>this.handleKeyDown(e),this.emitTapEvents(),this.enable()}createEl(e="div",t={},i={}){return t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),"button"===e&&p.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,(e=Y(e,t,i)).appendChild(Y("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(e),e}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=Y("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(void 0===e)return this.controlText_||"Need Text";var i=this.localize(e);this.controlText_=e,Q(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"),void 0!==this.tabIndex_&&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"),void 0!==this.tabIndex_&&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){tn.isEventKey(e,"Space")||tn.isEventKey(e,"Enter")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}ts.registerComponent("ClickableComponent",iM);class i3 extends iM{constructor(e,t){super(e,t),this.update(),this.update_=e=>this.update(e),e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return Y("div",{className:"vjs-poster"})}crossOrigin(e){if(void 0===e)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;null!==e&&"anonymous"!==e&&"use-credentials"!==e?this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`):this.$("img")&&(this.$("img").crossOrigin=e)}update(e){var t=this.player().poster();this.setSrc(t),t?this.show():this.hide()}setSrc(e){e?(this.$("img")||this.el_.appendChild(Y("picture",{className:"vjs-poster",tabIndex:-1},{},Y("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=e):this.el_.textContent=""}handleClick(e){this.player_.controls()&&(this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?t8(this.player_.play()):this.player_.pause())}}i3.prototype.crossorigin=i3.prototype.crossOrigin,ts.registerComponent("PosterImage",i3);let iB={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 iU(e,t){let i;if(4===e.length)i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(7!==e.length)throw Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");i=e.slice(1)}return"rgba("+parseInt(i.slice(0,2),16)+","+parseInt(i.slice(2,4),16)+","+parseInt(i.slice(4,6),16)+","+t+")"}function i2(e,t,i){try{e.style[t]=i}catch(n){}}ts.registerComponent("TextTrackDisplay",class e extends ts{constructor(e,t,i){super(e,t,i);let n=e=>this.updateDisplay(e);e.on("loadstart",e=>this.toggleDisplay(e)),e.on("texttrackchange",n),e.on("loadedmetadata",e=>this.preselectTrack(e)),e.ready(e2(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks)this.hide();else{e.on("fullscreenchange",n),e.on("playerresize",n);let t=window.screen.orientation||window,i=window.screen.orientation?"change":"orientationchange";t.addEventListener(i,n),e.on("dispose",()=>t.removeEventListener(i,n));var s=this.options_.playerOptions.tracks||[];for(let r=0;r<s.length;r++)this.player_.addRemoteTextTrack(s[r],!0);this.preselectTrack()}}))}preselectTrack(){var e={captions:1,subtitles:1},t=this.player_.textTracks(),i=this.player_.cache_.selectedLanguage;let n,s,r;for(let a=0;a<t.length;a++){var o=t[a];i&&i.enabled&&i.language&&i.language===o.language&&o.kind in e?r=o.kind!==i.kind&&r||o:i&&!i.enabled?(r=null,n=null,s=null):o.default&&("descriptions"!==o.kind||n?o.kind in e&&!s&&(s=o):n=o)}r?r.mode="showing":s?s.mode="showing":n&&(n.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(){"function"==typeof window.WebVTT&&window.WebVTT.processCues(window,[],this.el_)}updateDisplay(){var e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){var i=[];for(let n=0;n<e.length;++n){var s=e[n];"showing"===s.mode&&i.push(s)}this.updateForTrack(i)}else{let r=null,a=null,o=e.length;for(;o--;){var l=e[o];"showing"===l.mode&&("descriptions"===l.kind?r=l:a=l)}a?("off"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","off"),this.updateForTrack(a)):r&&("assertive"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","assertive"),this.updateForTrack(r))}}updateDisplayState(e){var t=this.player_.textTrackSettings.getValues(),i=e.activeCues;let n=i.length;for(;n--;){var s,r=i[n];r&&(r=r.displayState,t.color&&(r.firstChild.style.color=t.color),t.textOpacity&&i2(r.firstChild,"color",iU(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(r.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&i2(r.firstChild,"backgroundColor",iU(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?i2(r,"backgroundColor",iU(t.windowColor,t.windowOpacity)):r.style.backgroundColor=t.windowColor),t.edgeStyle&&("dropshadow"===t.edgeStyle?r.firstChild.style.textShadow="2px 2px 3px #222, 2px 2px 4px #222, 2px 2px 5px #222":"raised"===t.edgeStyle?r.firstChild.style.textShadow="1px 1px #222, 2px 2px #222, 3px 3px #222":"depressed"===t.edgeStyle?r.firstChild.style.textShadow="1px 1px #ccc, 0 1px #ccc, -1px -1px #222, 0 -1px #222":"uniform"===t.edgeStyle&&(r.firstChild.style.textShadow="0 0 4px #222, 0 0 4px #222, 0 0 4px #222, 0 0 4px #222")),t.fontPercent&&1!==t.fontPercent&&(s=window.parseFloat(r.style.fontSize),r.style.fontSize=s*t.fontPercent+"px",r.style.height="auto",r.style.top="auto"),t.fontFamily)&&"default"!==t.fontFamily&&("small-caps"===t.fontFamily?r.firstChild.style.fontVariant="small-caps":r.firstChild.style.fontFamily=iB[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),"function"==typeof window.WebVTT&&!e.every(e=>!e.activeCues)){var t=[];for(let i=0;i<e.length;++i){var n=e[i];for(let s=0;s<n.activeCues.length;++s)t.push(n.activeCues[s])}window.WebVTT.processCues(window,t,this.el_);for(let r=0;r<e.length;++r){var a=e[r];for(let o=0;o<a.activeCues.length;++o){var l=a.activeCues[o].displayState;ee(l,"vjs-text-track-cue","vjs-text-track-cue-"+(a.language||r)),a.language&&ea(l,"lang",a.language)}this.player_.textTrackSettings&&this.updateDisplayState(a)}}}}),ts.registerComponent("LoadingSpinner",class e extends ts{createEl(){var e=this.player_.isAudio(),e=this.localize(e?"Audio Player":"Video Player"),e=Y("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[e])}),t=super.createEl("div",{className:"vjs-loading-spinner",dir:"ltr"});return t.appendChild(e),t}handleLanguagechange(){this.$(".vjs-control-text").textContent=this.localize("{1} is loading.",[this.player_.isAudio()?"Audio Player":"Video Player"])}});class i1 extends iM{createEl(e,t={},i={}){return(t=Y("button",t=Object.assign({className:this.buildCSSClass()},t),i=Object.assign({type:"button"},i))).appendChild(Y("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(t),t}addChild(e,t={}){var i=this.constructor.name;return p.warn(`Adding an actionable (user controllable) child to a Button (${i}) is not supported; use a ClickableComponent instead.`),ts.prototype.addChild.call(this,e,t)}enable(){super.enable(),this.el_.removeAttribute("disabled")}disable(){super.disable(),this.el_.setAttribute("disabled","disabled")}handleKeyDown(e){tn.isEventKey(e,"Space")||tn.isEventKey(e,"Enter")?e.stopPropagation():super.handleKeyDown(e)}}ts.registerComponent("Button",i1);class i4 extends i1{constructor(e,t){super(e,t),this.mouseused_=!1,this.on("mousedown",e=>this.handleMouseDown(e))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){var t=this.player_.play();if(this.mouseused_&&e.clientX&&e.clientY)t8(t),this.player_.tech(!0)&&this.player_.tech(!0).focus();else{var e=this.player_.getChild("controlBar");let i=e&&e.getChild("playToggle");i?(e=()=>i.focus(),tv(t)?t.then(e,()=>{}):this.setTimeout(e,1)):this.player_.tech(!0).focus()}}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}i4.prototype.controlText_="Play Video",ts.registerComponent("BigPlayButton",i4),ts.registerComponent("CloseButton",class extends i1{constructor(e,t){super(e,t),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){tn.isEventKey(e,"Esc")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}});class i6 extends i1{constructor(e,t={}){super(e,t),t.replay=void 0===t.replay||t.replay,this.on(e,"play",e=>this.handlePlay(e)),this.on(e,"pause",e=>this.handlePause(e)),t.replay&&this.on(e,"ended",e=>this.handleEnded(e))}buildCSSClass(){return"vjs-play-control "+super.buildCSSClass()}handleClick(e){this.player_.paused()?t8(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.controlText("Pause")}handlePause(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")}handleEnded(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",e=>this.handleSeeked(e))}}i6.prototype.controlText_="Play",ts.registerComponent("PlayToggle",i6);class iF extends ts{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended"],e=>this.updateContent(e)),this.updateTextNode_()}createEl(){var e=this.buildCSSClass(),t=super.createEl("div",{className:e+" vjs-time-control vjs-control"}),i=Y("span",{className:"vjs-control-text",textContent:this.localize(this.labelText_)+"\xa0"},{role:"presentation"});return t.appendChild(i),this.contentEl_=Y("span",{className:e+"-display"},{role:"presentation"}),t.appendChild(this.contentEl_),t}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}updateTextNode_(e=0){e=tc(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",()=>{if(this.contentEl_){let e=this.textNode_;e&&this.contentEl_.firstChild!==e&&(e=null,p.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_=document.createTextNode(this.formattedTime_),this.textNode_&&(e?this.contentEl_.replaceChild(this.textNode_,e):this.contentEl_.appendChild(this.textNode_))}}))}updateContent(e){}}iF.prototype.labelText_="Time",iF.prototype.controlText_="Time",ts.registerComponent("TimeDisplay",iF);class ij extends iF{buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;t=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}}ij.prototype.labelText_="Current Time",ij.prototype.controlText_="Current Time",ts.registerComponent("CurrentTimeDisplay",ij);class i5 extends iF{constructor(e,t){super(e,t),t=e=>this.updateContent(e),this.on(e,"durationchange",t),this.on(e,"loadstart",t),this.on(e,"loadedmetadata",t)}buildCSSClass(){return"vjs-duration"}updateContent(e){var t=this.player_.duration();this.updateTextNode_(t)}}i5.prototype.labelText_="Duration",i5.prototype.controlText_="Duration",ts.registerComponent("DurationDisplay",i5),ts.registerComponent("TimeDivider",class e extends ts{createEl(){var 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}});class iq extends iF{constructor(e,t){super(e,t),this.on(e,"durationchange",e=>this.updateContent(e))}buildCSSClass(){return"vjs-remaining-time"}createEl(){var e=super.createEl();return!1!==this.options_.displayNegative&&e.insertBefore(Y("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e}updateContent(e){if("number"==typeof this.player_.duration()){let t;t=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(t)}}}iq.prototype.labelText_="Remaining Time",iq.prototype.controlText_="Remaining Time",ts.registerComponent("RemainingTimeDisplay",iq),ts.registerComponent("LiveDisplay",class e extends ts{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",e=>this.updateShowing(e))}createEl(){var e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=Y("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(Y("span",{className:"vjs-control-text",textContent:this.localize("Stream Type")+"\xa0"})),this.contentEl_.appendChild(document.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()}});class iH extends i1{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=e=>this.updateLiveEdgeStatus(e),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_))}createEl(){var e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=Y("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()}}function iV(e,t,i){return Math.min(i,Math.max(t,isNaN(e=Number(e))?t:e))}iH.prototype.controlText_="Seek to live, currently playing live",ts.registerComponent("SeekToLive",iH),tR=Object.freeze({__proto__:null,clamp:iV});class i7 extends ts{constructor(e,t){super(e,t),this.handleMouseDown_=e=>this.handleMouseDown(e),this.handleMouseUp_=e=>this.handleMouseUp(e),this.handleKeyDown_=e=>this.handleKeyDown(e),this.handleClick_=e=>this.handleClick(e),this.handleMouseMove_=e=>this.handleMouseMove(e),this.update_=e=>this.update(e),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(){var e;this.enabled()&&(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){var t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||P||e.preventDefault(),el(),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){var t=this.bar.el_.ownerDocument;eu(),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){let e=this.getProgress();return e!==this.progress_&&(this.progress_=e,this.requestNamedAnimationFrame("Slider#update",()=>{var t=this.vertical()?"height":"width";this.bar.el().style[t]=(100*e).toFixed(2)+"%"})),e}}getProgress(){return Number(iV(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){return e=ec(this.el_,e),this.vertical()?e.y:e.x}handleKeyDown(e){tn.isEventKey(e,"Left")||tn.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepBack()):tn.isEventKey(e,"Right")||tn.isEventKey(e,"Up")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e)}handleClick(e){e.stopPropagation(),e.preventDefault()}vertical(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")}}ts.registerComponent("Slider",i7);let i9=(e,t)=>iV(e/t*100,0,100).toFixed(2)+"%";ts.registerComponent("LoadProgressBar",class e extends ts{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",e=>this.update(e))}createEl(){var e=super.createEl("div",{className:"vjs-load-progress"}),t=Y("span",{className:"vjs-control-text"}),i=Y("span",{textContent:this.localize("Loaded")}),n=document.createTextNode(": ");return this.percentageEl_=Y("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(i),t.appendChild(n),t.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",()=>{var e=this.player_.liveTracker,t=this.player_.buffered(),e=e&&e.isLive()?e.seekableEnd():this.player_.duration(),i=this.player_.bufferedEnd(),n=this.partEls_,e=i9(i,e);this.percent_!==e&&(this.el_.style.width=e,Q(this.percentageEl_,e),this.percent_=e);for(let s=0;s<t.length;s++){var r=t.start(s),a=t.end(s);let o=n[s];o||(o=this.el_.appendChild(Y()),n[s]=o),o.dataset.start===r&&o.dataset.end===a||(o.dataset.start=r,o.dataset.end=a,o.style.left=i9(r,i),o.style.width=i9(a-r,i))}for(let l=n.length;l>t.length;l--)this.el_.removeChild(n[l-1]);n.length=t.length})}}),ts.registerComponent("TimeTooltip",class e extends ts{constructor(e,t){super(e,t),this.update=e1(e2(this,this.update),30)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,i){var n=eh(this.el_),s=ed(this.player_.el()),t=e.width*t;if(s&&n){var r=e.left-s.left+t,t=e.width-t+(s.right-e.right);let a=n.width/2;r<a?a+=a-r:t<a&&(a=t),a<0?a=0:a>n.width&&(a=n.width),a=Math.round(a),this.el_.style.right=`-${a}px`,this.write(i)}}write(e){Q(this.el_,e)}updateTime(e,t,i,n){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{let s;var r,a,o=this.player_.duration();s=this.player_.liveTracker&&this.player_.liveTracker.isLive()?((a=(r=this.player_.liveTracker.liveWindow())-t*r)<1?"":"-")+tc(a,r):tc(i,o),this.update(e,t,s),n&&n()})}});class iW extends ts{constructor(e,t){super(e,t),this.update=e1(e2(this,this.update),30)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t){var i,n=this.getChild("timeTooltip");n&&(i=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),n.updateTime(e,t,i))}}iW.prototype.options_={children:[]},H||k||iW.prototype.options_.children.push("timeTooltip"),ts.registerComponent("PlayProgressBar",iW);class iz extends ts{constructor(e,t){super(e,t),this.update=e1(e2(this,this.update),30)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){var i=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,i,()=>{this.el_.style.left=e.width*t+"px"})}}iz.prototype.options_={children:["timeTooltip"]},ts.registerComponent("MouseTimeDisplay",iz);class iG extends i7{constructor(e,t){super(e,t),this.setEventHandlers_()}setEventHandlers_(){this.update_=e2(this,this.update),this.update=e1(this.update_,30),this.on(this.player_,["ended","durationchange","timeupdate"],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 document&&"visibilityState"in document&&this.on(document,"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){"hidden"===document.visibilityState?(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,30))}disableInterval_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&"ended"!==e.type||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("hidden"!==document.visibilityState){let t=super.update();return this.requestNamedAnimationFrame("SeekBar#update",()=>{var e=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),i=this.player_.liveTracker;let n=this.player_.duration();i&&i.isLive()&&(n=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute("aria-valuenow",(100*t).toFixed(2)),this.percent_=t),this.currentTime_===e&&this.duration_===n||(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[tc(e,n),tc(n,n)],"{1} of {2}")),this.currentTime_=e,this.duration_=n),this.bar&&this.bar.update(ed(this.el()),this.getProgress())}),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()}getPercent(){var e=this.getCurrentTime_();let t;var 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){ev(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(ev(e)){t||this.player_.scrubbing()||this.player_.scrubbing(!0);let i;if(t=this.calculateDistance(e),(e=this.player_.liveTracker)&&e.isLive()){if(.99<=t)return void e.seekToLiveEdge();var n=e.seekableStart(),s=e.liveCurrentTime();if((i=(i=(i=n+t*e.liveWindow())>=s?s:i)<=n?n+.1:i)===1/0)return}else(i=t*this.player_.duration())===this.player_.duration()&&(i-=.1);this.userSeek_(i)}}enable(){super.enable();var e=this.getChild("mouseTimeDisplay");e&&e.show()}disable(){super.disable();var e=this.getChild("mouseTimeDisplay");e&&e.hide()}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?t8(this.player_.play()):this.update_()}stepForward(){this.userSeek_(this.player_.currentTime()+5)}stepBack(){this.userSeek_(this.player_.currentTime()-5)}handleAction(e){this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){var t,i=this.player_.liveTracker;tn.isEventKey(e,"Space")||tn.isEventKey(e,"Enter")?(e.preventDefault(),e.stopPropagation(),this.handleAction(e)):tn.isEventKey(e,"Home")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(0)):tn.isEventKey(e,"End")?(e.preventDefault(),e.stopPropagation(),i&&i.isLive()?this.userSeek_(i.liveCurrentTime()):this.userSeek_(this.player_.duration())):/^[0-9]$/.test(tn(e))?(e.preventDefault(),e.stopPropagation(),t=10*(tn.codes[tn(e)]-tn.codes[0])/100,i&&i.isLive()?this.userSeek_(i.seekableStart()+i.liveWindow()*t):this.userSeek_(this.player_.duration()*t)):tn.isEventKey(e,"PgDn")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-60)):tn.isEventKey(e,"PgUp")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+60)):super.handleKeyDown(e)}dispose(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],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 document&&"visibilityState"in document&&this.off(document,"visibilitychange",this.toggleVisibility_),super.dispose()}}iG.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},H||k||iG.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),ts.registerComponent("SeekBar",iG);class iX extends ts{constructor(e,t){super(e,t),this.handleMouseMove=e1(e2(this,this.handleMouseMove),30),this.throttledHandleMouseSeek=e1(e2(this,this.handleMouseSeek),30),this.handleMouseUpHandler_=e=>this.handleMouseUp(e),this.handleMouseDownHandler_=e=>this.handleMouseDown(e),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){var t,i,n,s,r=this.getChild("seekBar");r&&(t=r.getChild("playProgressBar"),i=r.getChild("mouseTimeDisplay"),t||i)&&(n=eh(s=r.el()),s=iV(s=ec(s,e).x,0,1),i&&i.update(n,s),t)&&t.update(n,r.getProgress())}handleMouseSeek(e){var t=this.getChild("seekBar");t&&t.handleMouseMove(e)}enabled(){return this.enabled_}disable(){var e;this.children().forEach(e=>e.disable&&e.disable()),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())&&(e=this.getChild("seekBar"),this.player_.scrubbing(!1),e.videoWasPlaying)&&t8(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",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)}removeListenersAddedOnMousedownAndTouchstart(){var 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){var 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){var t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}}iX.prototype.options_={children:["seekBar"]},ts.registerComponent("ProgressControl",iX);class iK extends i1{constructor(e,t){super(e,t),this.on(e,["enterpictureinpicture","leavepictureinpicture"],e=>this.handlePictureInPictureChange(e)),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],e=>this.handlePictureInPictureEnabledChange(e)),this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],()=>{"audio"===e.currentType().substring(0,5)||e.audioPosterMode()||e.audioOnlyMode()?(e.isInPictureInPicture()&&e.exitPictureInPicture(),this.hide()):this.show()}),this.disable()}buildCSSClass(){return"vjs-picture-in-picture-control "+super.buildCSSClass()}handlePictureInPictureEnabledChange(){document.pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in window?this.enable():this.disable()}handlePictureInPictureChange(e){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture"),this.handlePictureInPictureEnabledChange()}handleClick(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}}iK.prototype.controlText_="Picture-in-Picture",ts.registerComponent("PictureInPictureToggle",iK);class iY extends i1{constructor(e,t){super(e,t),this.on(e,"fullscreenchange",e=>this.handleFullscreenChange(e)),!1===document[e.fsApi_.fullscreenEnabled]&&this.disable()}buildCSSClass(){return"vjs-fullscreen-control "+super.buildCSSClass()}handleFullscreenChange(e){this.player_.isFullscreen()?this.controlText("Exit Fullscreen"):this.controlText("Fullscreen")}handleClick(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}}iY.prototype.controlText_="Fullscreen",ts.registerComponent("FullscreenToggle",iY),ts.registerComponent("VolumeLevel",class e extends ts{createEl(){var e=super.createEl("div",{className:"vjs-volume-level"});return e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}}),ts.registerComponent("VolumeLevelTooltip",class e extends ts{constructor(e,t){super(e,t),this.update=e1(e2(this,this.update),30)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,i,n){if(!i){var i=ed(this.el_),s=ed(this.player_.el()),t=e.width*t;if(!s||!i)return;var r=e.left-s.left+t,t=e.width-t+(s.right-e.right);let a=i.width/2;r<a?a+=a-r:t<a&&(a=t),a<0?a=0:a>i.width&&(a=i.width),this.el_.style.right=`-${a}px`}this.write(n+"%")}write(e){Q(this.el_,e)}updateVolume(e,t,i,n,s){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{this.update(e,t,i,n.toFixed(0)),s&&s()})}});class iQ extends ts{constructor(e,t){super(e,t),this.update=e1(e2(this,this.update),30)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,i){this.getChild("volumeLevelTooltip").updateVolume(e,t,i,100*t,()=>{i?this.el_.style.bottom=e.height*t+"px":this.el_.style.left=e.width*t+"px"})}}iQ.prototype.options_={children:["volumeLevelTooltip"]},ts.registerComponent("MouseVolumeLevelDisplay",iQ);class iZ extends i7{constructor(e,t){super(e,t),this.on("slideractive",e=>this.updateLastVolume_(e)),this.on(e,"volumechange",e=>this.updateARIAAttributes(e)),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){ev(e)&&super.handleMouseDown(e)}handleMouseMove(e){var t,i,n,s=this.getChild("mouseVolumeLevelDisplay");s&&(t=ed(n=this.el()),i=this.vertical(),n=ec(n,e),n=iV(n=i?n.y:n.x,0,1),s.update(t,n,i)),ev(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){var t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")}volumeAsPercentage_(){return Math.round(100*this.player_.volume())}updateLastVolume_(){let e=this.player_.volume();this.one("sliderinactive",()=>{0===this.player_.volume()&&this.player_.lastVolume_(e)})}}iZ.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},H||k||iZ.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),iZ.prototype.playerEvent="volumechange",ts.registerComponent("VolumeBar",iZ);class iJ extends ts{constructor(e,t={}){var i,n;t.vertical=t.vertical||!1,(void 0===t.volumeBar||b(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),i=this,(n=e).tech_&&!n.tech_.featuresVolumeControl&&i.addClass("vjs-hidden"),i.on(n,"loadstart",function(){n.tech_.featuresVolumeControl?i.removeClass("vjs-hidden"):i.addClass("vjs-hidden")}),this.throttledHandleMouseMove=e1(e2(this,this.handleMouseMove),30),this.handleMouseUpHandler_=e=>this.handleMouseUp(e),this.on("mousedown",e=>this.handleMouseDown(e)),this.on("touchstart",e=>this.handleMouseDown(e)),this.on("mousemove",e=>this.handleMouseMove(e)),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){var 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){var 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)}}iJ.prototype.options_={children:["volumeBar"]},ts.registerComponent("VolumeControl",iJ);class ne extends i1{constructor(e,t){var i,n;super(e,t),i=this,(n=e).tech_&&!n.tech_.featuresMuteControl&&i.addClass("vjs-hidden"),i.on(n,"loadstart",function(){n.tech_.featuresMuteControl?i.removeClass("vjs-hidden"):i.addClass("vjs-hidden")}),this.on(e,["loadstart","volumechange"],e=>this.update(e))}buildCSSClass(){return"vjs-mute-control "+super.buildCSSClass()}handleClick(e){var t=this.player_.volume(),i=this.player_.lastVolume_();0===t?(this.player_.volume(i<.1?.1:i),this.player_.muted(!1)):this.player_.muted(!this.player_.muted())}update(e){this.updateIcon_(),this.updateControlText_()}updateIcon_(){var e=this.player_.volume();let t=3;H&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?t=0:e<.33?t=1:e<.67&&(t=2),et(this.el_,[0,1,2,3].reduce((e,t)=>e+`${t?" ":""}vjs-vol-`+t,"")),ee(this.el_,"vjs-vol-"+t)}updateControlText_(){var e=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)}}ne.prototype.controlText_="Mute",ts.registerComponent("MuteToggle",ne);class nt extends ts{constructor(e,t={}){void 0!==t.inline?t.inline=t.inline:t.inline=!0,(void 0===t.volumeControl||b(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=e=>this.handleKeyPress(e),this.on(e,["loadstart"],e=>this.volumePanelState_(e)),this.on(this.muteToggle,"keyup",e=>this.handleKeyPress(e)),this.on(this.volumeControl,"keyup",e=>this.handleVolumeControlKeyUp(e)),this.on("keydown",e=>this.handleKeyPress(e)),this.on("mouseover",e=>this.handleMouseOver(e)),this.on("mouseout",e=>this.handleMouseOut(e)),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){tn.isEventKey(e,"Esc")&&this.muteToggle.focus()}handleMouseOver(e){this.addClass("vjs-hover"),eR(document,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),eN(document,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){tn.isEventKey(e,"Esc")&&this.handleMouseOut()}}nt.prototype.options_={children:["muteToggle","volumeControl"]},ts.registerComponent("VolumePanel",nt),ts.registerComponent("SkipForward",class extends i1{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipForwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime])),this.show()):this.hide()}getSkipForwardTime(){var 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){var t=this.player_.currentTime(),i=this.player_.liveTracker,i=i&&i.isLive()?i.seekableEnd():this.player_.duration();let n;n=t+this.skipTime<=i?t+this.skipTime:i,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}});class ni extends i1{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipBackwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime])),this.show()):this.hide()}getSkipBackwardTime(){var 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){var t=this.player_.currentTime(),i=this.player_.liveTracker,i=i&&i.isLive()&&i.seekableStart();let n;n=i&&t-this.skipTime<=i?i:t>=this.skipTime?t-this.skipTime:0,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}ni.prototype.controlText_="Skip Backward",ts.registerComponent("SkipBackward",ni);class nn extends ts{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on("keydown",e=>this.handleKeyDown(e)),this.boundHandleBlur_=e=>this.handleBlur(e),this.boundHandleTapClick_=e=>this.handleTapClick(e)}addEventListenerForItem(e){e instanceof ts&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof ts&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))}removeChild(e){"string"==typeof e&&(e=this.getChild(e)),this.removeEventListenerForItem(e),super.removeChild(e)}addItem(e){(e=this.addChild(e))&&this.addEventListenerForItem(e)}createEl(){var e=this.options_.contentElType||"ul",e=(this.contentEl_=Y(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu"),super.createEl("div",{append:this.contentEl_,className:"vjs-menu"}));return e.appendChild(this.contentEl_),eR(e,"click",function(e){e.preventDefault(),e.stopImmediatePropagation()}),e}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){let t=e.relatedTarget||document.activeElement;this.children().some(e=>e.el()===t)||(e=this.menuButton_)&&e.buttonPressed_&&t!==e.el().firstChild&&e.unpressButton()}handleTapClick(e){var t;this.menuButton_&&(this.menuButton_.unpressButton(),Array.isArray(t=this.children()))&&(t=t.filter(t=>t.el()===e.target)[0])&&"CaptionSettingsMenuItem"!==t.name()&&this.menuButton_.focus()}handleKeyDown(e){tn.isEventKey(e,"Left")||tn.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(tn.isEventKey(e,"Right")||tn.isEventKey(e,"Up"))&&(e.preventDefault(),e.stopPropagation(),this.stepBack())}stepForward(){let e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)}stepBack(){let e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)}focus(e=0){var t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),0<t.length&&(e<0?e=0:e>=t.length&&(e=t.length-1),t[this.focusedChild_=e].el_.focus())}}ts.registerComponent("Menu",nn);class ns extends ts{constructor(e,t={}){super(e,t),this.menuButton_=new i1(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true"),e=i1.prototype.buildCSSClass(),this.menuButton_.el_.className=this.buildCSSClass()+" "+e,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0,t=e=>this.handleClick(e),this.handleMenuKeyUp_=e=>this.handleMenuKeyUp(e),this.on(this.menuButton_,"tap",t),this.on(this.menuButton_,"click",t),this.on(this.menuButton_,"keydown",e=>this.handleKeyDown(e)),this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover"),this.menu.show(),eR(document,"keyup",this.handleMenuKeyUp_)}),this.on("mouseleave",e=>this.handleMouseLeave(e)),this.on("keydown",e=>this.handleSubmenuKeyDown(e))}update(){var 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(){var e,t=new nn(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title&&(e=Y("li",{className:"vjs-menu-title",textContent:eZ(this.options_.title),tabIndex:-1}),e=new ts(this.player_,{el:e}),t.addItem(e)),this.items=this.createItems(),this.items)for(let i=0;i<this.items.length;i++)t.addItem(this.items[i]);return t}createItems(){}createEl(){return super.createEl("div",{className:this.buildWrapperCSSClass()},{})}buildWrapperCSSClass(){let e="vjs-menu-button";return!0===this.options_.inline?e+="-inline":e+="-popup",`vjs-menu-button ${e} ${i1.prototype.buildCSSClass()} `+super.buildCSSClass()}buildCSSClass(){let e="vjs-menu-button";return!0===this.options_.inline?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"),eN(document,"keyup",this.handleMenuKeyUp_)}focus(){this.menuButton_.focus()}blur(){this.menuButton_.blur()}handleKeyDown(e){tn.isEventKey(e,"Esc")||tn.isEventKey(e,"Tab")?(this.buttonPressed_&&this.unpressButton(),tn.isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus())):(tn.isEventKey(e,"Up")||tn.isEventKey(e,"Down"))&&!this.buttonPressed_&&(e.preventDefault(),this.pressButton())}handleMenuKeyUp(e){(tn.isEventKey(e,"Esc")||tn.isEventKey(e,"Tab"))&&this.removeClass("vjs-hover")}handleSubmenuKeyPress(e){this.handleSubmenuKeyDown(e)}handleSubmenuKeyDown(e){(tn.isEventKey(e,"Esc")||tn.isEventKey(e,"Tab"))&&(this.buttonPressed_&&this.unpressButton(),tn.isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus()))}pressButton(){this.enabled_&&(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),H&&X()||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()}}ts.registerComponent("MenuButton",ns);class nr extends ns{constructor(e,t){let i=t.tracks;if(super(e,t),this.items.length<=1&&this.hide(),i){let n=e2(this,this.update);i.addEventListener("removetrack",n),i.addEventListener("addtrack",n),i.addEventListener("labelchange",n),this.player_.on("ready",n),this.player_.on("dispose",function(){i.removeEventListener("removetrack",n),i.removeEventListener("addtrack",n),i.removeEventListener("labelchange",n)})}}}ts.registerComponent("TrackButton",nr);let na=["Tab","Esc","Up","Down","Right","Left"];class no extends iM{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){return this.nonIconControl=!0,(t=super.createEl("li",Object.assign({className:"vjs-menu-item",tabIndex:-1},t),i)).replaceChild(Y("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)}),t.querySelector(".vjs-icon-placeholder")),t}handleKeyDown(e){na.some(t=>tn.isEventKey(e,t))||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))}}ts.registerComponent("MenuItem",no);class nl extends no{constructor(e,t){var i=t.track;let n=e.textTracks(),s=(t.label=i.label||i.language||"Unknown",t.selected="showing"===i.mode,super(e,t),this.track=i,this.kinds=(t.kinds||[t.kind||this.track.kind]).filter(Boolean),(...e)=>{this.handleTracksChange.apply(this,e)}),r=(...e)=>{this.handleSelectedLanguageChange.apply(this,e)};if(e.on(["loadstart","texttrackchange"],s),n.addEventListener("change",s),n.addEventListener("selectedlanguagechange",r),this.on("dispose",function(){e.off(["loadstart","texttrackchange"],s),n.removeEventListener("change",s),n.removeEventListener("selectedlanguagechange",r)}),void 0===n.onchange){let a;this.on(["tap","click"],function(){if("object"!=typeof window.Event)try{a=new window.Event("change")}catch(e){}a||(a=document.createEvent("Event")).initEvent("change",!0,!0),n.dispatchEvent(a)})}this.handleTracksChange()}handleClick(e){var t=this.track,i=this.player_.textTracks();if(super.handleClick(e),i)for(let n=0;n<i.length;n++){var s=i[n];-1!==this.kinds.indexOf(s.kind)&&(s===t?"showing"!==s.mode&&(s.mode="showing"):"disabled"!==s.mode&&(s.mode="disabled"))}}handleTracksChange(e){var t="showing"===this.track.mode;t!==this.isSelected_&&this.selected(t)}handleSelectedLanguageChange(e){var t;"showing"!==this.track.mode||(t=this.player_.cache_.selectedLanguage)&&t.enabled&&t.language===this.track.language&&t.kind!==this.track.kind||(this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind})}dispose(){this.track=null,super.dispose()}}ts.registerComponent("TextTrackMenuItem",nl);class nu extends nl{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){var t=this.player().textTracks();let i=!0;for(let n=0,s=t.length;n<s;n++){var r=t[n];if(-1<this.options_.kinds.indexOf(r.kind)&&"showing"===r.mode){i=!1;break}}i!==this.isSelected_&&this.selected(i)}handleSelectedLanguageChange(e){var t=this.player().textTracks();let i=!0;for(let n=0,s=t.length;n<s;n++){var r=t[n];if(-1<["captions","descriptions","subtitles"].indexOf(r.kind)&&"showing"===r.mode){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()}}ts.registerComponent("OffTextTrackMenuItem",nu);class nd extends nr{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=nl){let i;this.label_&&(i=this.label_+" off"),e.push(new nu(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;var n=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let s=0;s<n.length;s++){var r,a=n[s];-1<this.kinds_.indexOf(a.kind)&&((r=new t(this.player_,{track:a,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1})).addClass(`vjs-${a.kind}-menu-item`),e.push(r))}return e}}ts.registerComponent("TextTrackButton",nd);class nh extends no{constructor(e,t){var i=t.track,n=t.cue,s=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=n.text,t.selected=n.startTime<=s&&s<n.endTime,super(e,t),this.track=i,this.cue=n}handleClick(e){super.handleClick(),this.player_.currentTime(this.cue.startTime)}}ts.registerComponent("ChaptersTrackMenuItem",nh);class nc extends nd{constructor(e,t,i){super(e,t,i),this.selectCurrentItem_=()=>{this.items.forEach(e=>{e.selected(this.track_.activeCues[0]===e.cue)})}}buildCSSClass(){return"vjs-chapters-button "+super.buildCSSClass()}buildWrapperCSSClass(){return"vjs-chapters-button "+super.buildWrapperCSSClass()}update(e){e&&e.track&&"chapters"!==e.track.kind||((e=this.findChaptersTrack())!==this.track_?(this.setTrack(e),super.update()):(!this.items||e&&e.cues&&e.cues.length!==this.items.length)&&super.update())}setTrack(e){var t;this.track_!==e&&(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_&&((t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_))&&t.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null),this.track_=e,this.track_)&&(this.track_.mode="hidden",(t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_))&&t.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_))}findChaptersTrack(){var e=this.player_.textTracks()||[];for(let t=e.length-1;0<=t;t--){var i=e[t];if(i.kind===this.kind_)return i}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(eZ(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){var e=[];if(this.track_){var t=this.track_.cues;if(t)for(let i=0,n=t.length;i<n;i++){var s=t[i],s=new nh(this.player_,{track:this.track_,cue:s});e.push(s)}}return e}}nc.prototype.kind_="chapters",nc.prototype.controlText_="Chapters",ts.registerComponent("ChaptersButton",nc);class np extends nd{constructor(e,t,i){super(e,t,i);let n=e.textTracks(),s=e2(this,this.handleTracksChange);n.addEventListener("change",s),this.on("dispose",function(){n.removeEventListener("change",s)})}handleTracksChange(e){var t=this.player().textTracks();let i=!1;for(let n=0,s=t.length;n<s;n++){var r=t[n];if(r.kind!==this.kind_&&"showing"===r.mode){i=!0;break}}i?this.disable():this.enable()}buildCSSClass(){return"vjs-descriptions-button "+super.buildCSSClass()}buildWrapperCSSClass(){return"vjs-descriptions-button "+super.buildWrapperCSSClass()}}np.prototype.kind_="descriptions",np.prototype.controlText_="Descriptions",ts.registerComponent("DescriptionsButton",np);class nm extends nd{constructor(e,t,i){super(e,t,i)}buildCSSClass(){return"vjs-subtitles-button "+super.buildCSSClass()}buildWrapperCSSClass(){return"vjs-subtitles-button "+super.buildWrapperCSSClass()}}nm.prototype.kind_="subtitles",nm.prototype.controlText_="Subtitles",ts.registerComponent("SubtitlesButton",nm);class nf extends nl{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()}}ts.registerComponent("CaptionSettingsMenuItem",nf);class ng extends nd{constructor(e,t,i){super(e,t,i)}buildCSSClass(){return"vjs-captions-button "+super.buildCSSClass()}buildWrapperCSSClass(){return"vjs-captions-button "+super.buildWrapperCSSClass()}createItems(){var e=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(e.push(new nf(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),super.createItems(e)}}ng.prototype.kind_="captions",ng.prototype.controlText_="Captions",ts.registerComponent("CaptionsButton",ng);class ny extends nl{createEl(e,t,i){return t=(e=super.createEl(e,t,i)).querySelector(".vjs-menu-item-text"),"captions"===this.options_.track.kind&&(t.appendChild(Y("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),t.appendChild(Y("span",{className:"vjs-control-text",textContent:" "+this.localize("Captions")}))),e}}ts.registerComponent("SubsCapsMenuItem",ny);class nv extends nd{constructor(e,t={}){super(e,t),this.label_="subtitles",-1<["en","en-us","en-ca","fr-ca"].indexOf(this.player_.language_)&&(this.label_="captions"),this.menuButton_.controlText(eZ(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 nf(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,ny)}}nv.prototype.kinds_=["captions","subtitles"],nv.prototype.controlText_="Subtitles",ts.registerComponent("SubsCapsButton",nv);class n8 extends no{constructor(e,t){var i=t.track;let n=e.audioTracks(),s=(t.label=i.label||i.language||"Unknown",t.selected=i.enabled,super(e,t),this.track=i,this.addClass(`vjs-${i.kind}-menu-item`),(...e)=>{this.handleTracksChange.apply(this,e)});n.addEventListener("change",s),this.on("dispose",()=>{n.removeEventListener("change",s)})}createEl(e,t,i){return t=(e=super.createEl(e,t,i)).querySelector(".vjs-menu-item-text"),"main-desc"===this.options_.track.kind&&(t.appendChild(Y("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),t.appendChild(Y("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),e}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){var t=this.player_.audioTracks();for(let i=0;i<t.length;i++){var n=t[i];n!==this.track&&(n.enabled=n===this.track)}}}handleTracksChange(e){this.selected(this.track.enabled)}}ts.registerComponent("AudioTrackMenuItem",n8);class nb extends nr{constructor(e,t={}){t.tracks=e.audioTracks(),super(e,t)}buildCSSClass(){return"vjs-audio-button "+super.buildCSSClass()}buildWrapperCSSClass(){return"vjs-audio-button "+super.buildWrapperCSSClass()}createItems(e=[]){this.hideThreshold_=1;var t=this.player_.audioTracks();for(let i=0;i<t.length;i++){var n=t[i];e.push(new n8(this.player_,{track:n,selectable:!0,multiSelectable:!1}))}return e}}nb.prototype.controlText_="Audio Track",ts.registerComponent("AudioTrackButton",nb);class n$ extends no{constructor(e,t){var i=t.rate,n=parseFloat(i,10);t.label=i,t.selected=n===e.playbackRate(),t.selectable=!0,t.multiSelectable=!1,super(e,t),this.label=i,this.rate=n,this.on(e,"ratechange",e=>this.update(e))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}}n$.prototype.contentElType="button",ts.registerComponent("PlaybackRateMenuItem",n$);class nT extends ns{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",e=>this.updateVisibility(e)),this.on(e,"ratechange",e=>this.updateLabel(e)),this.on(e,"playbackrateschange",e=>this.handlePlaybackRateschange(e))}createEl(){var e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=Y("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(){var e=this.playbackRates(),t=[];for(let i=e.length-1;0<=i;i--)t.push(new n$(this.player(),{rate:e[i]+"x"}));return t}handlePlaybackRateschange(e){this.update()}playbackRates(){var e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&0<this.playbackRates().length}updateVisibility(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}updateLabel(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")}}nT.prototype.controlText_="Playback Rate",ts.registerComponent("PlaybackRateMenuButton",nT);class nw extends ts{buildCSSClass(){return"vjs-spacer "+super.buildCSSClass()}createEl(e="div",t={},i={}){return t.className||(t.className=this.buildCSSClass()),super.createEl(e,t,i)}}ts.registerComponent("Spacer",nw),ts.registerComponent("CustomControlSpacer",class extends nw{buildCSSClass(){return"vjs-custom-control-spacer "+super.buildCSSClass()}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:"\xa0"})}});class n_ extends ts{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}n_.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},"exitPictureInPicture"in document&&n_.prototype.options_.children.splice(n_.prototype.options_.children.length-1,0,"pictureInPictureToggle"),ts.registerComponent("ControlBar",n_);class nS extends tw{constructor(e,t){super(e,t),this.on(e,"error",e=>this.open(e))}buildCSSClass(){return"vjs-error-display "+super.buildCSSClass()}content(){var e=this.player().error();return e?this.localize(e.message):""}}nS.prototype.options_=Object.assign({},tw.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),ts.registerComponent("ErrorDisplay",nS);let nk="vjs-text-track-settings";var tY=["#000","Black"],tt=["#00F","Blue"],nE=["#0FF","Cyan"],nC=["#0F0","Green"],n0=["#F0F","Magenta"],nx=["#F00","Red"],nI=["#FFF","White"],nP=["#FF0","Yellow"],nA=["1","Opaque"],nL=["0.5","Semi-Transparent"],nD=["0","Transparent"];let nO={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[tY,nI,nx,nC,tt,nP,n0,nE]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[nA,nL,nD]},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[nI,tY,nx,nC,tt,nP,n0,nE]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",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:"captions-font-size-%s",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:e=>"1.00"===e?null:Number(e)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[nA,nL]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[nD,nL,nA]}};function nR(e,t){if((e=t?t(e):e)&&"none"!==e)return e}function nN(e){let t=e.el();if(!t.resetSourceWatch_){let i={},n=nU(e),s=i=>(...n)=>(n=i.apply(t,n),nM(e),n);["append","appendChild","insertAdjacentHTML"].forEach(e=>{t[e]&&(i[e]=t[e],t[e]=s(i[e]))}),Object.defineProperty(t,"innerHTML",$(n,{set:s(n.set)})),t.resetSourceWatch_=()=>{t.resetSourceWatch_=null,Object.keys(i).forEach(e=>{t[e]=i[e]}),Object.defineProperty(t,"innerHTML",n)},e.one("sourceset",t.resetSourceWatch_)}}nO.windowColor.options=nO.backgroundColor.options,ts.registerComponent("TextTrackSettings",class e extends tw{constructor(e,t){t.temporary=!1,super(e,t),this.updateDisplay=this.updateDisplay.bind(this),this.fill(),this.hasBeenOpened_=this.hasBeenFilled_=!0,this.endDialog=Y("p",{className:"vjs-control-text",textContent:this.localize("End of dialog window.")}),this.el().appendChild(this.endDialog),this.setDefaults(),void 0===t.persistTextTrackSettings&&(this.options_.persistTextTrackSettings=this.options_.playerOptions.persistTextTrackSettings),this.on(this.$(".vjs-done-button"),"click",()=>{this.saveSettings(),this.close()}),this.on(this.$(".vjs-default-button"),"click",()=>{this.setDefaults(),this.updateDisplay()}),g(nO,e=>{this.on(this.$(e.selector),"change",this.updateDisplay)}),this.options_.persistTextTrackSettings&&this.restoreSettings()}dispose(){this.endDialog=null,super.dispose()}createElSelect_(e,t="",i="label"){e=nO[e];let n=e.id.replace("%s",this.id_),s=[t,n].join(" ").trim();return[`<${i} id="${n}" class="${"label"===i?"vjs-label":""}">`,this.localize(e.label),`</${i}>`,`<select aria-labelledby="${s}">`].concat(e.options.map(e=>{var t=n+"-"+e[1].replace(/\W+/g,"");return[`<option id="${t}" value="${e[0]}" `,`aria-labelledby="${s} ${t}">`,this.localize(e[1]),"</option>"].join("")})).concat("</select>").join("")}createElFgColor_(){var e="captions-text-legend-"+this.id_;return['<fieldset class="vjs-fg vjs-track-setting">',`<legend id="${e}">`,this.localize("Text"),"</legend>",'<span class="vjs-text-color">',this.createElSelect_("color",e),"</span>",'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_("textOpacity",e),"</span>","</fieldset>"].join("")}createElBgColor_(){var e="captions-background-"+this.id_;return['<fieldset class="vjs-bg vjs-track-setting">',`<legend id="${e}">`,this.localize("Text Background"),"</legend>",'<span class="vjs-bg-color">',this.createElSelect_("backgroundColor",e),"</span>",'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_("backgroundOpacity",e),"</span>","</fieldset>"].join("")}createElWinColor_(){var e="captions-window-"+this.id_;return['<fieldset class="vjs-window vjs-track-setting">',`<legend id="${e}">`,this.localize("Caption Area Background"),"</legend>",'<span class="vjs-window-color">',this.createElSelect_("windowColor",e),"</span>",'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_("windowOpacity",e),"</span>","</fieldset>"].join("")}createElColors_(){return Y("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})}createElFont_(){return Y("div",{className:"vjs-track-settings-font",innerHTML:['<fieldset class="vjs-font-percent vjs-track-setting">',this.createElSelect_("fontPercent","","legend"),"</fieldset>",'<fieldset class="vjs-edge-style vjs-track-setting">',this.createElSelect_("edgeStyle","","legend"),"</fieldset>",'<fieldset class="vjs-font-family vjs-track-setting">',this.createElSelect_("fontFamily","","legend"),"</fieldset>"].join("")})}createElControls_(){var e=this.localize("restore all settings to the default values");return Y("div",{className:"vjs-track-settings-controls",innerHTML:[`<button type="button" class="vjs-default-button" title="${e}">`,this.localize("Reset"),`<span class="vjs-control-text"> ${e}</span>`,"</button>",`<button type="button" class="vjs-done-button">${this.localize("Done")}</button>`].join("")})}content(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]}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 y(nO,(e,t,i)=>{n=this.$(t.selector),t=t.parser;var n=nR(n.options[n.options.selectedIndex].value,t);return void 0!==n&&(e[i]=n),e},{})}setValues(e){g(nO,(t,i)=>{var n=this.$(t.selector),s=e[i],r=t.parser;if(s){for(let a=0;a<n.options.length;a++)if(nR(n.options[a].value,r)===s){n.selectedIndex=a;break}}})}setDefaults(){g(nO,e=>{var t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(window.localStorage.getItem(nk))}catch(t){p.warn(t)}e&&this.setValues(e)}saveSettings(){if(this.options_.persistTextTrackSettings){var e=this.getValues();try{Object.keys(e).length?window.localStorage.setItem(nk,JSON.stringify(e)):window.localStorage.removeItem(nk)}catch(t){p.warn(t)}}}updateDisplay(){var e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}conditionalBlur_(){this.previouslyActiveEl_=null;var e=this.player_.controlBar,t=e&&e.subsCapsButton,e=e&&e.captionsButton;t?t.focus():e&&e.focus()}handleLanguagechange(){this.fill()}}),ts.registerComponent("ResizeManager",class e extends ts{constructor(e,t){let i=t.ResizeObserver||window.ResizeObserver;super(e,$({createEl:!(i=null!==t.ResizeObserver&&i),reportTouchActivity:!1},t)),this.ResizeObserver=t.ResizeObserver||window.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=e4(()=>{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){let e=this.debouncedHandler_,t=this.unloadListener_=function(){eN(this,"resize",e),eN(this,"unload",t),t=null};eR(this.el_.contentWindow,"unload",t),eR(this.el_.contentWindow,"resize",e)}},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()}}),ts.registerComponent("LiveTracker",class e extends ts{constructor(e,t){super(e,$({trackingThreshold:20,liveTolerance:15},t,{createEl:!1})),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=e=>this.handlePlay(e),this.handleFirstTimeupdate_=e=>this.handleFirstTimeupdate(e),this.handleSeeked_=e=>this.handleSeeked(e),this.seekToLiveEdge_=e=>this.seekToLiveEdge(e),this.reset_(),this.on(this.player_,"durationchange",e=>this.handleDurationchange(e)),this.on(this.player_,"canplay",()=>this.toggleTracking())}trackLive_(){var e=this.player_.seekable();if(e&&e.length){var e=Number(window.performance.now().toFixed(4)),t=-1===this.lastTime_?0:(e-this.lastTime_)/1e3,e=(this.lastTime_=e,this.pastSeekEnd_=this.pastSeekEnd()+t,this.liveCurrentTime()),t=this.player_.currentTime();let i=this.player_.paused()||this.seekedBehindLive_||Math.abs(e-t)>this.options_.liveTolerance;(i=!!this.timeupdateSeen_&&e!==1/0&&i)!==this.behindLiveEdge_&&(this.behindLiveEdge_=i,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_,30),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(){var e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&2<e,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(){var 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(){var 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(){var 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(){var e=this.seekableEnd();return -1!==this.lastSeekEnd_&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return"number"==typeof this.trackingInterval_}seekToLiveEdge(){this.seekedBehindLive_=!1,this.atLiveEdge()||(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}dispose(){this.stopTracking(),super.dispose()}}),ts.registerComponent("TitleBar",class e extends ts{constructor(e,t){super(e,t),this.on("statechanged",e=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:Y("div",{className:"vjs-title-bar-title",id:"vjs-title-bar-title-"+eI++}),description:Y("div",{className:"vjs-title-bar-description",id:"vjs-title-bar-description-"+eI++})},Y("div",{className:"vjs-title-bar"},{},Object.values(this.els))}updateDom_(){var e=this.player_.tech_;let t=e&&e.el_,i={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach(e=>{var n=this.state[e],s=this.els[e],e=i[e];em(s),n&&Q(s,n),t&&(t.removeAttribute(e),n)&&t.setAttribute(e,s.id)}),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){var e=this.player_.tech_,e=e&&e.el_;e&&(e.removeAttribute("aria-labelledby"),e.removeAttribute("aria-describedby")),super.dispose(),this.els=null}});let nM=e=>{var t=e.el();if(t.hasAttribute("src"))e.triggerSourceset(t.src);else{var i=e.$$("source"),n=[];let s="";if(!i.length)return!1;for(let r=0;r<i.length;r++){var a=i[r].src;a&&-1===n.indexOf(a)&&n.push(a)}if(!n.length)return!1;1===n.length&&(s=n[0]),e.triggerSourceset(s)}return!0},n3=Object.defineProperty({},"innerHTML",{get(){return this.cloneNode(!0).innerHTML},set(e){for(var t=document.createElement(this.nodeName.toLowerCase()),i=(t.innerHTML=e,document.createDocumentFragment());t.childNodes.length;)i.appendChild(t.childNodes[0]);return this.innerText="",window.Element.prototype.appendChild.call(this,i),this.innerHTML}}),nB=(e,t)=>{let i={};for(let n=0;n<e.length&&!((i=Object.getOwnPropertyDescriptor(e[n],t))&&i.set&&i.get);n++);return i.enumerable=!0,i.configurable=!0,i},nU=e=>nB([e.el(),window.HTMLMediaElement.prototype,window.Element.prototype,n3],"innerHTML"),n2=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?tA(window.Element.prototype.getAttribute.call(this,"src")):""},set(e){return window.Element.prototype.setAttribute.call(this,"src",e),e}});class n1 extends iE{constructor(e,t){super(e,t),t=e.source;let i=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&"VIDEO"===this.el_.tagName,t&&(this.el_.currentSrc!==t.src||e.tag&&3===e.tag.initNetworkState_)?this.setSource(t):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){var n=this.el_.childNodes;let s=n.length;for(var r=[];s--;){var a=n[s];"track"===a.nodeName.toLowerCase()&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(a),this.remoteTextTracks().addTrack(a.track),this.textTracks().addTrack(a.track),i||this.el_.hasAttribute("crossorigin")||!tL(a.src)||(i=!0)):r.push(a))}for(let o=0;o<r.length;o++)this.el_.removeChild(r[o])}this.proxyNativeTracks_(),this.featuresNativeTextTracks&&i&&p.warn("Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\nThis may prevent text tracks from loading."),this.restoreMetadataTracksInIOSNativePlayer_(),(B||M)&&!0===e.nativeControlsForTouch&&this.setControls(!0),this.proxyWebkitFullscreen_(),this.triggerReady()}dispose(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),n1.disposeMediaElement(this.el_),this.options_=null,super.dispose()}setupSourcesetHandling_(){!function e(t){if(t.featuresSourceset){let i=t.el();if(!i.resetSourceset_){var n;n=t;let s=nB([n.el(),window.HTMLMediaElement.prototype,n2],"src"),r=i.setAttribute,a=i.load;Object.defineProperty(i,"src",$(s,{set:e=>(e=s.set.call(i,e),t.triggerSourceset(i.src),e)})),i.setAttribute=(e,n)=>(n=r.call(i,e,n),/src/i.test(e)&&t.triggerSourceset(i.src),n),i.load=()=>{var e=a.call(i);return nM(t)||(t.triggerSourceset(""),nN(t)),e},i.currentSrc?t.triggerSourceset(i.currentSrc):nM(t)||nN(t),i.resetSourceset_=()=>{i.resetSourceset_=null,i.load=a,i.setAttribute=r,Object.defineProperty(i,"src",s),i.resetSourceWatch_&&i.resetSourceWatch_()}}}}(this)}restoreMetadataTracksInIOSNativePlayer_(){let e=this.textTracks(),t,i=()=>{t=[];for(let i=0;i<e.length;i++){var n=e[i];"metadata"===n.kind&&t.push({track:n,storedMode:n.mode})}},n=(i(),e.addEventListener("change",i),this.on("dispose",()=>e.removeEventListener("change",i)),()=>{for(let i=0;i<t.length;i++){var s=t[i];"disabled"===s.track.mode&&s.track.mode!==s.storedMode&&(s.track.mode=s.storedMode)}e.removeEventListener("change",n)});this.on("webkitbeginfullscreen",()=>{e.removeEventListener("change",i),e.removeEventListener("change",n),e.addEventListener("change",n)}),this.on("webkitendfullscreen",()=>{e.removeEventListener("change",i),e.addEventListener("change",i),e.removeEventListener("change",n)})}overrideNative_(e,t){if(t===this[`featuresNative${e}Tracks`]){let i=e.toLowerCase();this[i+"TracksListeners_"]&&Object.keys(this[i+"TracksListeners_"]).forEach(e=>{this.el()[i+"Tracks"].removeEventListener(e,this[i+"TracksListeners_"][e])}),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){var t=tG[e];let i=this.el()[t.getterName],n=this[t.getterName]();if(this[`featuresNative${t.capitalName}Tracks`]&&i&&i.addEventListener){let s={change:t=>{var i={type:"change",target:n,currentTarget:n,srcElement:n};n.trigger(i),"text"===e&&this[tX.remoteText.getterName]().trigger(i)},addtrack(e){n.addTrack(e.track)},removetrack(e){n.removeTrack(e.track)}},r=function(){var e=[];for(let t=0;t<n.length;t++){let s=!1;for(let r=0;r<i.length;r++)if(i[r]===n[t]){s=!0;break}s||e.push(n[t])}for(;e.length;)n.removeTrack(e.shift())};this[t.getterName+"Listeners_"]=s,Object.keys(s).forEach(e=>{let t=s[e];i.addEventListener(e,t),this.on("dispose",n=>i.removeEventListener(e,t))}),this.on("loadstart",r),this.on("dispose",e=>this.off("loadstart",r))}}proxyNativeTracks_(){tG.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let e=this.options_.tag;e&&(this.options_.playerElIngest||this.movingMediaElementInDOM)||(e?(t=e.cloneNode(!0),e.parentNode&&e.parentNode.insertBefore(t,e),n1.disposeMediaElement(e),e=t):(e=document.createElement("video"),t=$({},this.options_.tag&&es(this.options_.tag)),B&&!0===this.options_.nativeControlsForTouch||delete t.controls,en(e,Object.assign(t,{id:this.options_.techId,class:"vjs-tech"}))),e.playerId=this.options_.playerId),void 0!==this.options_.preload&&ea(e,"preload",this.options_.preload),void 0!==this.options_.disablePictureInPicture&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);var t,i=["loop","muted","playsinline","autoplay"];for(let n=0;n<i.length;n++){var s=i[n],r=this.options_[s];void 0!==r&&(r?ea(e,s,s):eo(e,s),e[s]=r)}return e}handleLateInit_(e){if(0!==e.networkState&&3!==e.networkState){if(0===e.readyState){let t=!1,i=function(){t=!0},n=(this.on("loadstart",i),function(){t||this.trigger("loadstart")});this.on("loadedmetadata",n),this.ready(function(){this.off("loadstart",i),this.off("loadedmetadata",n),t||this.trigger("loadstart")})}else{let s=["loadstart"];s.push("loadedmetadata"),2<=e.readyState&&s.push("loadeddata"),3<=e.readyState&&s.push("canplay"),4<=e.readyState&&s.push("canplaythrough"),this.ready(function(){s.forEach(function(e){this.trigger(e)},this)})}}}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&V?this.el_.fastSeek(e):this.el_.currentTime=e}catch(t){p(t,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&k&&P&&0===this.el_.currentTime){let e=()=>{0<this.el_.currentTime&&(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_){let 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_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(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"function"==typeof this.el_.webkitEnterFullScreen}enterFullScreen(){let e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)t8(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(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",Error("The video is not fullscreen"))}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(void 0===e)return this.el_.src;this.setSrc(e)}reset(){n1.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){var t;return this.featuresNativeTextTracks?(t=document.createElement("track"),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):super.createRemoteTextTrack(e)}addRemoteTextTrack(e,t){return e=super.addRemoteTextTrack(e,t),this.featuresNativeTextTracks&&this.el().appendChild(e),e}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){var t=this.$$("track");let i=t.length;for(;i--;)e!==t[i]&&e!==t[i].track||this.el().removeChild(t[i])}}getVideoPlaybackQuality(){var e;return"function"==typeof this.el().getVideoPlaybackQuality?this.el().getVideoPlaybackQuality():(e={},void 0!==this.el().webkitDroppedFrameCount&&void 0!==this.el().webkitDecodedFrameCount&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),window.performance&&(e.creationTime=window.performance.now()),e)}}T(n1,"TEST_VID",function(){var e,t;if(z())return e=document.createElement("video"),(t=document.createElement("track")).kind="captions",t.srclang="en",t.label="English",e.appendChild(t),e}),n1.isSupported=function(){try{n1.TEST_VID.volume=.5}catch(e){return!1}return!(!n1.TEST_VID||!n1.TEST_VID.canPlayType)},n1.canPlayType=function(e){return n1.TEST_VID.canPlayType(e)},n1.canPlaySource=function(e,t){return n1.canPlayType(e.type)},n1.canControlVolume=function(){try{let e=n1.TEST_VID.volume;n1.TEST_VID.volume=e/2+.1;var t=e!==n1.TEST_VID.volume;return t&&H?(window.setTimeout(()=>{n1&&n1.prototype&&(n1.prototype.featuresVolumeControl=e!==n1.TEST_VID.volume)}),!1):t}catch(i){return!1}},n1.canMuteVolume=function(){try{var e=n1.TEST_VID.muted;return n1.TEST_VID.muted=!e,n1.TEST_VID.muted?ea(n1.TEST_VID,"muted","muted"):eo(n1.TEST_VID,"muted"),e!==n1.TEST_VID.muted}catch(t){return!1}},n1.canControlPlaybackRate=function(){if(k&&P&&L<58)return!1;try{var e=n1.TEST_VID.playbackRate;return n1.TEST_VID.playbackRate=e/2+.1,e!==n1.TEST_VID.playbackRate}catch(t){return!1}},n1.canOverrideAttributes=function(){try{var e=()=>{};Object.defineProperty(document.createElement("video"),"src",{get:e,set:e}),Object.defineProperty(document.createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(document.createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(document.createElement("audio"),"innerHTML",{get:e,set:e})}catch(t){return!1}return!0},n1.supportsNativeTextTracks=function(){return V||H&&P},n1.supportsNativeVideoTracks=function(){return!(!n1.TEST_VID||!n1.TEST_VID.videoTracks)},n1.supportsNativeAudioTracks=function(){return!(!n1.TEST_VID||!n1.TEST_VID.audioTracks)},n1.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([e,t]){T(n1.prototype,e,()=>n1[t](),!0)}),n1.prototype.featuresVolumeControl=n1.canControlVolume(),n1.prototype.movingMediaElementInDOM=!H,n1.prototype.featuresFullscreenResize=!0,n1.prototype.featuresProgressEvents=!0,n1.prototype.featuresTimeupdateEvents=!0,n1.prototype.featuresVideoFrameCallback=!(!n1.TEST_VID||!n1.TEST_VID.requestVideoFrameCallback),n1.disposeMediaElement=function(e){if(e){for(e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();)e.removeChild(e.firstChild);if(e.removeAttribute("src"),"function"==typeof e.load)try{e.load()}catch(t){}}},n1.resetMediaElement=function(e){if(e){var t=e.querySelectorAll("source");let i=t.length;for(;i--;)e.removeChild(t[i]);if(e.removeAttribute("src"),"function"==typeof e.load)try{e.load()}catch(n){}}},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(e){n1.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}}),["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(e){n1.prototype["set"+eZ(e)]=function(t){(this.el_[e]=t)?this.el_.setAttribute(e,e):this.el_.removeAttribute(e)}}),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(e){n1.prototype[e]=function(){return this.el_[e]}}),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(e){n1.prototype["set"+eZ(e)]=function(t){this.el_[e]=t}}),["pause","load","play"].forEach(function(e){n1.prototype[e]=function(){return this.el_[e]()}}),iE.withSourceHandlers(n1),n1.nativeSourceHandler={},n1.nativeSourceHandler.canPlayType=function(e){try{return n1.TEST_VID.canPlayType(e)}catch(t){return""}},n1.nativeSourceHandler.canHandleSource=function(e,t){return e.type?n1.nativeSourceHandler.canPlayType(e.type):e.src?(e=tD(e.src),n1.nativeSourceHandler.canPlayType("video/"+e)):""},n1.nativeSourceHandler.handleSource=function(e,t,i){t.setSrc(e.src)},n1.nativeSourceHandler.dispose=function(){},n1.registerSourceHandler(n1.nativeSourceHandler),iE.registerTech("Html5",n1);let n4=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],n6={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},nF=["tiny","xsmall","small","medium","large","xlarge","huge"],nj={},n5=(nF.forEach(e=>{var t="x"===e.charAt(0)?"x-"+e.substring(1):e;nj[e]="vjs-layout-"+t}),{tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0});class nq extends ts{constructor(e,i,n){if(e.id=e.id||i.id||"vjs_video_"+eI++,(i=Object.assign(nq.getTagSettings(e),i)).initChildren=!1,i.createEl=!1,i.evented=!1,i.reportTouchActivity=!1,i.language||(a=e.closest("[lang]"))&&(i.language=a.getAttribute("lang")),super(null,i,n),this.boundDocumentFullscreenChange_=e=>this.documentFullscreenChange_(e),this.boundFullWindowOnEscKey_=e=>this.fullWindowOnEscKey(e),this.boundUpdateStyleEl_=e=>this.updateStyleEl_(e),this.boundApplyInitTime_=e=>this.applyInitTime_(e),this.boundUpdateCurrentBreakpoint_=e=>this.updateCurrentBreakpoint_(e),this.boundHandleTechClick_=e=>this.handleTechClick_(e),this.boundHandleTechDoubleClick_=e=>this.handleTechDoubleClick_(e),this.boundHandleTechTouchStart_=e=>this.handleTechTouchStart_(e),this.boundHandleTechTouchMove_=e=>this.handleTechTouchMove_(e),this.boundHandleTechTouchEnd_=e=>this.handleTechTouchEnd_(e),this.boundHandleTechTap_=e=>this.handleTechTap_(e),this.isFullscreen_=!1,this.log=m(this.id_),this.fsApi_=r,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_={playerHeight:null,hiddenChildren:[]},!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(this.tag=e,this.tagAttributes=e&&es(e),this.language(this.options_.language),i.languages){let s={};Object.getOwnPropertyNames(i.languages).forEach(function(e){s[e.toLowerCase()]=i.languages[e]}),this.languages_=s}else this.languages_=nq.prototype.options_.languages;this.resetCache_(),this.poster_=i.poster||"",this.controls_=!!i.controls,e.controls=!1,e.removeAttribute("controls"),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],e.hasAttribute("autoplay")?this.autoplay(!0):this.autoplay(this.options_.autoplay),i.plugins&&Object.keys(i.plugins).forEach(e=>{if("function"!=typeof this[e])throw Error(`plugin "${e}" does not exist`)}),this.scrubbing_=!1,this.el_=this.createEl(),eX(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(eR(document,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);var a=$(this.options_),n=(i.plugins&&Object.keys(i.plugins).forEach(e=>{this[e](i.plugins[e])}),i.debug&&this.debug(!0),this.options_.playerOptions=a,this.middleware_=[],this.playbackRates(i.playbackRates),this.initChildren(),this.isAudio("audio"===e.nodeName.toLowerCase()),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"),B&&this.addClass("vjs-touch-enabled"),H||this.addClass("vjs-workinghover"),nq.players[this.id_]=this,t.split(".")[0]);this.addClass("vjs-v"+n),this.userActive(!0),this.reportUserActivity(),this.one("play",e=>this.listenForUserActivity_(e)),this.on("keydown",e=>this.handleKeyDown(e)),this.on("languagechange",e=>this.handleLanguagechange(e)),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on("ready",()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode)})}dispose(){var e;this.trigger("dispose"),this.off("dispose"),eN(document,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),eN(document,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),nq.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),e=this,i0[e.id()]=null,tK.names.forEach(e=>{(e=this[tK[e].getterName]())&&e.off&&e.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"),n="video-js"===this.tag.tagName.toLowerCase(),s=(i?t=this.el_=e.parentNode:n||(t=this.el_=super.createEl("div")),es(e));if(n){for(t=this.el_=e,e=this.tag=document.createElement("video");t.children.length;)e.appendChild(t.firstChild);J(t,"video-js")||ee(t,"video-js"),t.appendChild(e),i=this.playerElIngest_=t,Object.keys(t).forEach(i=>{try{e[i]=t[i]}catch(n){}})}e.setAttribute("tabindex","-1"),s.tabindex="-1",P&&R&&(e.setAttribute("role","application"),s.role="application"),e.removeAttribute("width"),e.removeAttribute("height"),"width"in s&&delete s.width,"height"in s&&delete s.height,Object.getOwnPropertyNames(s).forEach(function(i){n&&"class"===i||t.setAttribute(i,s[i]),n&&e.setAttribute(i,s[i])}),e.playerId=e.id,e.id+="_html5_api",e.className="vjs-tech",(e.player=t.player=this).addClass("vjs-paused"),!0!==window.VIDEOJS_NO_DYNAMIC_STYLE&&(this.styleEl_=eC("vjs-styles-dimensions"),r=e8(".vjs-styles-defaults"),(a=e8("head")).insertBefore(this.styleEl_,r?r.nextSibling:a.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);var r,a,o=e.getElementsByTagName("a");for(let l=0;l<o.length;l++){var u=o.item(l);ee(u,"vjs-hidden"),u.setAttribute("hidden","hidden")}return e.initNetworkState_=e.networkState,e.parentNode&&!i&&e.parentNode.insertBefore(t,e),Z(e,t),this.children_.unshift(e),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=t}crossOrigin(e){if(void 0===e)return this.techGet_("crossOrigin");null!==e&&"anonymous"!==e&&"use-credentials"!==e?p.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`):(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){var i,n=e+"_";if(void 0===t)return this[n]||0;""===t||"auto"===t?(this[n]=void 0,this.updateStyleEl_()):(i=parseFloat(t),isNaN(i)?p.error(`Improper value "${t}" supplied for for `+e):(this[n]=i,this.updateStyleEl_()))}fluid(e){var t;if(void 0===e)return!!this.fluid_;this.fluid_=!!e,eq(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),e=this,t=()=>{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)},eq(e)?t():(e.eventedCallbacks||(e.eventedCallbacks=[]),e.eventedCallbacks.push(t))):this.removeClass("vjs-fluid"),this.updateStyleEl_()}fill(e){if(void 0===e)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")}aspectRatio(e){if(void 0===e)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw 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(!0===window.VIDEOJS_NO_DYNAMIC_STYLE){let e="number"==typeof this.width_?this.width_:this.options_.width,t="number"==typeof this.height_?this.height_:this.options_.height;var i=this.tech_&&this.tech_.el();i&&(0<=e&&(i.width=e),0<=t)&&(i.height=t)}else{let n,s,r,a;i=(i=(r=void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:0<this.videoWidth()?this.videoWidth()+":"+this.videoHeight():"16:9").split(":"))[1]/i[0],n=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/i:this.videoWidth()||300,s=void 0!==this.height_?this.height_:n*i,a=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(a),e0(this.styleEl_,`
|
||
.${a} {
|
||
width: ${n}px;
|
||
height: ${s}px;
|
||
}
|
||
|
||
.${a}.vjs-fluid:not(.vjs-audio-only-mode) {
|
||
padding-top: ${100*i}%;
|
||
}
|
||
`)}}loadTech_(e,t){this.tech_&&this.unloadTech_();var i,n,s=eZ(e),r=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==s&&this.tag&&(iE.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=s,this.isReady_=!1;let a=this.autoplay(),o={source:t,autoplay:a="string"!=typeof this.autoplay()&&(!0!==this.autoplay()||!this.options_.normalizeAutoplay)&&a,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+`_${r}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};if(tK.names.forEach(e=>{o[(e=tK[e]).getterName]=this[e.privateName]}),Object.assign(o,this.options_[s]),Object.assign(o,this.options_[r]),Object.assign(o,this.options_[e.toLowerCase()]),this.tag&&(o.tag=this.tag),t&&t.src===this.cache_.src&&0<this.cache_.currentTime&&(o.startTime=this.cache_.currentTime),!(r=iE.getTech(e)))throw Error(`No Tech named '${s}' exists! '${s}' should be registered using videojs.registerTech()'`);this.tech_=new r(o),this.tech_.ready(e2(this,this.handleTechReady_),!0),i=this.textTracksJson_||[],n=this.tech_,i.forEach(function(e){let t=n.addRemoteTextTrack(e).track;!e.src&&e.cues&&e.cues.forEach(e=>t.addCue(e))}),n.textTracks(),n4.forEach(e=>{this.on(this.tech_,e,t=>this[`handleTech${eZ(e)}_`](t))}),Object.keys(n6).forEach(e=>{this.on(this.tech_,e,t=>{0===this.tech_.playbackRate()&&this.tech_.seeking()?this.queuedCallbacks_.push({callback:this[`handleTech${n6[e]}_`].bind(this),event:t}):this[`handleTech${n6[e]}_`](t)})}),this.on(this.tech_,"loadstart",e=>this.handleTechLoadStart_(e)),this.on(this.tech_,"sourceset",e=>this.handleTechSourceset_(e)),this.on(this.tech_,"waiting",e=>this.handleTechWaiting_(e)),this.on(this.tech_,"ended",e=>this.handleTechEnded_(e)),this.on(this.tech_,"seeking",e=>this.handleTechSeeking_(e)),this.on(this.tech_,"play",e=>this.handleTechPlay_(e)),this.on(this.tech_,"pause",e=>this.handleTechPause_(e)),this.on(this.tech_,"durationchange",e=>this.handleTechDurationChange_(e)),this.on(this.tech_,"fullscreenchange",(e,t)=>this.handleTechFullscreenChange_(e,t)),this.on(this.tech_,"fullscreenerror",(e,t)=>this.handleTechFullscreenError_(e,t)),this.on(this.tech_,"enterpictureinpicture",e=>this.handleTechEnterPictureInPicture_(e)),this.on(this.tech_,"leavepictureinpicture",e=>this.handleTechLeavePictureInPicture_(e)),this.on(this.tech_,"error",e=>this.handleTechError_(e)),this.on(this.tech_,"posterchange",e=>this.handleTechPosterChange_(e)),this.on(this.tech_,"textdata",e=>this.handleTechTextData_(e)),this.on(this.tech_,"ratechange",e=>this.handleTechRateChange_(e)),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===s&&this.tag||Z(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){tK.names.forEach(e=>{this[(e=tK[e]).privateName]=this[e.getterName]()}),this.textTracksJson_=t$(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1}tech(e){return void 0===e&&p.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n"),this.tech_}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.manualAutoplay_(!0===this.autoplay()&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){if(this.tech_&&"string"==typeof e){var t=()=>{let e=this.muted(),t=(this.muted(!0),()=>{this.muted(e)});this.playTerminatedQueue_.push(t);var i=this.play();if(tv(i))return i.catch(e=>{throw t(),Error("Rejection at manualAutoplay. Restoring muted value. "+(e||""))})};let i;if("any"!==e||this.muted()?i="muted"!==e||this.muted()?this.play():t():tv(i=this.play())&&(i=i.catch(t)),tv(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="";"string"!=typeof t&&(t=e.src,i=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!i&&(i=((e,t)=>{if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;var i=e.cache_.sources.filter(e=>e.src===t);if(i.length)return i[0].type;var n=e.$$("source");for(let s=0;s<n.length;s++){var r=n[s];if(r.type&&r.src&&r.src===t)return r.type}return iR(t)})(this,t)),this.cache_.source=$({},e,{src:t,type:i});var e=this.cache_.sources.filter(e=>e.src&&e.src===t),n=[],s=this.$$("source"),r=[];for(let a=0;a<s.length;a++){var o=es(s[a]);n.push(o),o.src&&o.src===t&&r.push(o.src)}r.length&&!e.length?this.cache_.sources=n:e.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t}handleTechSourceset_(e){if(!this.changingSrc_){let t=e=>this.updateSourceCaches_(e);var i=this.currentSource().src,n=e.src;(t=!i||/^blob:/.test(i)||!/^blob:/.test(n)||this.lastSource_&&(this.lastSource_.tech===n||this.lastSource_.player===i)?t:()=>{})(n),e.src||this.tech_.any(["sourceset","loadstart"],e=>{"sourceset"!==e.type&&(e=this.techGet("currentSrc"),this.lastSource_.tech=e,this.updateSourceCaches_(e))})}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})}hasStarted(e){if(void 0===e)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_(){0<this.tech_.playbackRate()&&0===this.cache_.lastPlaybackRate&&(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");let 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_&&(void 0===this.options_||void 0===this.options_.userActions||void 0===this.options_.userActions.click||!1!==this.options_.userActions.click)&&(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.click?this.options_.userActions.click.call(this,e):this.paused()?t8(this.play()):this.pause())}handleTechDoubleClick_(e){!this.controls_||Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),t=>t.contains(e.target))||void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.doubleClick&&!1===this.options_.userActions.doubleClick||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.doubleClick?this.options_.userActions.doubleClick.call(this,e):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){if(!(e=e.target.player)||e===this){e=this.el();let t=document[this.fsApi_.fullscreenElement]===e;!t&&e.matches?t=e.matches(":"+this.fsApi_.fullscreen):!t&&e.msMatchesSelector&&(t=e.msMatchesSelector(":"+this.fsApi_.fullscreen)),this.isFullscreen(t)}}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_(){var e=this.tech_.error();this.error(e)}handleTechTextData_(){let e=1<arguments.length?arguments[1]:null;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(){var i;if(e in iA)return i=this.middleware_,this.tech_[e](i.reduce(iD(e),t));if(e in iL)return iI(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(n){throw p(n),n}},!0)}techGet_(e){if(this.tech_&&this.tech_.isReady_){var t,i;if(e in iP)return t=this.middleware_,i=this.tech_,t.reduceRight(iD(e),i[e]());if(e in iL)return iI(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(n){throw void 0===this.tech_[e]?p(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,n):"TypeError"===n.name?(p(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,n),this.tech_.isReady_=!1):p(n),n}}}play(){return new Promise(e=>{this.play_(e)})}play_(e=t8){this.playCallbacks_.push(e);var t,e=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc())),i=Boolean(V||H);this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),this.isReady_&&e?(t=this.techGet_("play"),i&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),null===t?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(t)):(this.waitToPlay_=e=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),!e&&i&&this.load())}runPlayTerminatedQueue_(){var e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(e){e()})}runPlayCallbacks_(e){var t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach(function(t){t(e)})}pause(){this.techCall_("pause")}paused(){return!1!==this.techGet_("paused")}played(){return this.techGet_("played")||to(0,0)}scrubbing(e){if(void 0===e)return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")}currentTime(e){return void 0!==e?(e<0&&(e=0),this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",e),void(this.cache_.initTime=0)):(this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),void this.one("canplay",this.boundApplyInitTime_))):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime)}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(void 0===e)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(e=(e=parseFloat(e))<0?1/0:e)!==this.cache_.duration&&((this.cache_.duration=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:to(0,0)}bufferedPercent(){return tm(this.buffered(),this.duration())}bufferedEnd(){var e=this.buffered(),t=this.duration();let i=e.end(e.length-1);return i>t?t:i}volume(e){let t;if(void 0===e)return t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t;t=Math.max(0,Math.min(1,parseFloat(e))),this.cache_.volume=t,this.techCall_("setVolume",t),0<t&&this.lastVolume_(t)}muted(e){if(void 0===e)return this.techGet_("muted")||!1;this.techCall_("setMuted",e)}defaultMuted(e){return void 0!==e?this.techCall_("setDefaultMuted",e):this.techGet_("defaultMuted")||!1}lastVolume_(e){if(void 0===e||0===e)return this.cache_.lastVolume;this.cache_.lastVolume=e}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(e){var t;if(void 0===e)return this.isFullscreen_;t=this.isFullscreen_,this.isFullscreen_=Boolean(e),this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),this.toggleFullscreenClass_()}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();let t=this;return new Promise((i,n)=>{function s(){t.off("fullscreenerror",a),t.off("fullscreenchange",r)}function r(){s(),i()}function a(e,t){s(),n(t)}t.one("fullscreenchange",r),t.one("fullscreenerror",a);var o=t.requestFullscreenHelper_(e);o&&(o.then(s,s),o.then(i,n))})}requestFullscreenHelper_(e){let t;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},void 0!==e&&(t=e)),this.fsApi_.requestFullscreen)return(e=this.el_[this.fsApi_.requestFullscreen](t))&&e.then(()=>this.isFullscreen(!0),()=>this.isFullscreen(!1)),e;this.tech_.supportsFullScreen()&&!0==!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){let e=this;return new Promise((t,i)=>{function n(){e.off("fullscreenerror",r),e.off("fullscreenchange",s)}function s(){n(),t()}function r(e,t){n(),i(t)}e.one("fullscreenchange",s),e.one("fullscreenerror",r);var a=e.exitFullscreenHelper_();a&&(a.then(n,n),a.then(t,i))})}exitFullscreenHelper_(){var e;if(this.fsApi_.requestFullscreen)return(e=document[this.fsApi_.exitFullscreen]())&&t8(e.then(()=>this.isFullscreen(!1))),e;this.tech_.supportsFullScreen()&&!0==!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=document.documentElement.style.overflow,eR(document,"keydown",this.boundFullWindowOnEscKey_),document.documentElement.style.overflow="hidden",ee(document.body,"vjs-full-window"),this.trigger("enterFullWindow")}fullWindowOnEscKey(e){tn.isEventKey(e,"Esc")&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,eN(document,"keydown",this.boundFullWindowOnEscKey_),document.documentElement.style.overflow=this.docOrigOverflow,et(document.body,"vjs-full-window"),this.trigger("exitFullWindow")}disablePictureInPicture(e){if(void 0===e)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(e){if(void 0===e)return!!this.isInPictureInPicture_;this.isInPictureInPicture_=!!e,this.togglePictureInPictureClass_()}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&window.documentPictureInPicture){let e=document.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(Y("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),window.documentPictureInPicture.requestWindow({initialAspectRatio:this.videoWidth()/this.videoHeight(),copyStyleSheets:!0}).then(t=>(this.el_.parentNode.insertBefore(e,this.el_),t.document.body.append(this.el_),t.document.body.classList.add("vjs-pip-window"),this.player_.isInPictureInPicture(!0),this.player_.trigger("enterpictureinpicture"),t.addEventListener("unload",t=>{t=t.target.querySelector(".video-js"),e.replaceWith(t),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")}),t))}return"pictureInPictureEnabled"in document&&!1===this.disablePictureInPicture()?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){return window.documentPictureInPicture&&window.documentPictureInPicture.window?(window.documentPictureInPicture.window.close(),Promise.resolve()):"pictureInPictureEnabled"in document?document.exitPictureInPicture():void 0}handleKeyDown(e){var t,i,n=this.options_.userActions;n&&n.hotkeys&&(i=(t=this.el_.ownerDocument.activeElement).tagName.toLowerCase(),t.isContentEditable||("input"===i?-1===["button","checkbox","hidden","radio","reset","submit"].indexOf(t.type):-1!==["textarea"].indexOf(i))||("function"==typeof n.hotkeys?n.hotkeys.call(this,e):this.handleHotkeys(e)))}handleHotkeys(e){var{fullscreenKey:t=e=>tn.isEventKey(e,"f"),muteKey:i=e=>tn.isEventKey(e,"m"),playPauseKey:n=e=>tn.isEventKey(e,"k")||tn.isEventKey(e,"Space")}=this.options_.userActions?this.options_.userActions.hotkeys:{};t.call(this,e)?(e.preventDefault(),e.stopPropagation(),t=ts.getComponent("FullscreenToggle"),!1!==document[this.fsApi_.fullscreenEnabled]&&t.prototype.handleClick.call(this,e)):i.call(this,e)?(e.preventDefault(),e.stopPropagation(),ts.getComponent("MuteToggle").prototype.handleClick.call(this,e)):n.call(this,e)&&(e.preventDefault(),e.stopPropagation(),ts.getComponent("PlayToggle").prototype.handleClick.call(this,e))}canPlayType(e){var t;for(let i=0,n=this.options_.techOrder;i<n.length;i++){var s=n[i];let r=iE.getTech(s);if(r=r||ts.getComponent(s)){if(r.isSupported()&&(t=r.canPlayType(e)))return t}else p.error(`The "${s}" tech is undefined. Skipped browser support check for that tech.`)}return""}selectSource(e){function t(e,t,i){let n;return e.some(e=>t.some(t=>{if(n=i(e,t))return!0})),n}var i=this.options_.techOrder.map(e=>[e,iE.getTech(e)]).filter(([e,t])=>t?t.isSupported():(p.error(`The "${e}" tech is undefined. Skipped browser support check for that tech.`),!1));let n;var s,r=([e,t],i)=>{if(t.canPlaySource(i,this.options_[e.toLowerCase()]))return{source:i,tech:e}};return(n=this.options_.sourceOrder?t(e,i,(s=r,(e,t)=>s(t,e))):t(i,e,r))||!1}handleSrc_(e,t){if(void 0===e)return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();let i=function e(t){if(Array.isArray(t)){let i=[];t.forEach(function(t){Array.isArray(t=e(t))?i=i.concat(t):v(t)&&i.push(t)}),t=i}else t="string"==typeof t&&t.trim()?[iN({src:t})]:v(t)&&"string"==typeof t.src&&t.src&&t.src.trim()?[iN(t)]:[];return t}(e);if(i.length){if(this.changingSrc_=!0,t||(this.cache_.sources=i),this.updateSourceCaches_(i[0]),function e(t,i,n){t.setTimeout(()=>(function e(t={},i=[],n,s,r=[],a=!1){let[o,...l]=i;if("string"==typeof o)e(t,iC[o],n,s,r,a);else if(o){let u=function e(t,i){var n=i0[t.id()];let s=null;if(null==n)s=i(t),i0[t.id()]=[[i,s]];else{for(let r=0;r<n.length;r++){var[a,o]=n[r];a===i&&(s=o)}null===s&&(s=i(t),n.push([i,s]))}return s}(s,o);if(!u.setSource)return r.push(u),e(t,l,n,s,r,a);u.setSource(Object.assign({},t),function(i,o){if(i)return e(t,l,n,s,r,a);r.push(u),e(o,t.type===o.type?l:iC[o.type],n,s,r,a)})}else l.length?e(t,l,n,s,r,a):a?n(t,r):e(t,iC["*"],n,s,r,!0)})(i,iC[i.type],n,t),1)}(this,i[0],(e,n)=>{var s;if(this.middleware_=n,t||(this.cache_.sources=i),this.updateSourceCaches_(e),this.src_(e))return 1<i.length?this.handleSrc_(i.slice(1)):(this.changingSrc_=!1,this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),void this.triggerReady());s=this.tech_,n.forEach(e=>e.setTech&&e.setTech(s))}),1<i.length){let n=()=>{this.error(null),this.handleSrc_(i.slice(1),!0)},s=()=>{this.off("error",n)};this.one("error",n),this.one("playing",s),this.resetRetryOnError_=()=>{this.off("error",n),this.off("playing",s)}}}else this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0)}src(e){return this.handleSrc_(e,!1)}src_(e){var t=this.selectSource([e]);return!t||(eJ(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):(this.changingSrc_=!0,this.loadTech_(t.tech,t.source),this.tech_.ready(()=>{this.changingSrc_=!1})),!1)}load(){this.techCall_("load")}reset(){this.paused()?this.doReset_():t8(this.play().then(()=>this.doReset_()))}doReset_(){this.tech_&&this.tech_.clearTracks("text"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),eq(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);var{currentTimeDisplay:e,durationDisplay:t,progressControl:i,remainingTimeDisplay:n}=this.controlBar||{},i=(i||{}).seekBar;e&&e.updateContent(),t&&t.updateContent(),n&&n.updateContent(),i&&(i.update(),i.loadProgressBar)&&i.loadProgressBar.update()}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger("volumechange")}currentSources(){var e=this.currentSource(),t=[];return 0!==Object.keys(e).length&&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(void 0===e)return this.techGet_("preload");this.techCall_("setPreload",e),this.options_.preload=e}autoplay(e){if(void 0===e)return this.options_.autoplay||!1;let t;"string"==typeof e&&/(any|play|muted)/.test(e)||!0===e&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_("string"==typeof e?e:"play"),t=!1):this.options_.autoplay=!!e,t=void 0===t?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)}playsinline(e){return void 0!==e?(this.techCall_("setPlaysinline",e),this.options_.playsinline=e,this):this.techGet_("playsinline")}loop(e){if(void 0===e)return this.techGet_("loop");this.techCall_("setLoop",e),this.options_.loop=e}poster(e){if(void 0===e)return this.poster_;(e=e||"")!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))}handleTechPosterChange_(){var e;(!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster&&(e=this.tech_.poster()||"")!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}controls(e){if(void 0===e)return!!this.controls_;this.controls_!==(e=!!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(void 0===e)return!!this.usingNativeControls_;this.usingNativeControls_!==(e=!!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(void 0===e)return this.error_||null;if(n("beforeerror").forEach(t=>{v(t=t(this,e))&&!Array.isArray(t)||"string"==typeof t||"number"==typeof t||null===t?e=t:this.log.error("please return a value that MediaError expects in beforeerror hooks")}),this.options_.suppressNotSupportedError&&e&&4===e.code){let t=function(){this.error(e)};this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),this.one("loadstart",function(){this.off(["click","touchstart"],t)})}else null===e?(this.error_=e,this.removeClass("vjs-error"),this.errorDisplay&&this.errorDisplay.close()):(this.error_=new tf(e),this.addClass("vjs-error"),p.error(`(CODE:${this.error_.code} ${tf.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),n("error").forEach(e=>e(this,this.error_)))}reportUserActivity(e){this.userActivity_=!0}userActive(e){if(void 0===e)return this.userActive_;(e=!!e)!==this.userActive_&&(this.userActive_=e,this.userActive_?(this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),this.trigger("useractive")):(this.tech_&&this.tech_.one("mousemove",function(e){e.stopPropagation(),e.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")))}listenForUserActivity_(){let e,t,i,n=e2(this,this.reportUserActivity);function s(t){n(),this.clearInterval(e)}this.on("mousedown",function(){n(),this.clearInterval(e),e=this.setInterval(n,250)}),this.on("mousemove",function(e){e.screenX===t&&e.screenY===i||(t=e.screenX,i=e.screenY,n())}),this.on("mouseup",s),this.on("mouseleave",s);var r=this.getChild("controlBar");!r||H||k||(r.on("mouseenter",function(e){0!==this.player().options_.inactivityTimeout&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),r.on("mouseleave",function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",n),this.on("keyup",n);let a;this.setInterval(function(){var e;this.userActivity_&&(this.userActivity_=!1,this.userActive(!0),this.clearTimeout(a),(e=this.options_.inactivityTimeout)<=0||(a=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},e)))},250)}playbackRate(e){if(void 0===e)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e)}defaultPlaybackRate(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1}isAudio(e){if(void 0===e)return!!this.isAudio_;this.isAudio_=!!e}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");var e=this.children();let t=this.getChild("ControlBar");var i=t&&t.currentHeight();e.forEach(e=>{e!==t&&e.el_&&!e.hasClass("vjs-hidden")&&(e.hide(),this.audioOnlyCache_.hiddenChildren.push(e))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.height(i),this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode"),this.audioOnlyCache_.hiddenChildren.forEach(e=>e.show()),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")}audioOnlyMode(e){return"boolean"!=typeof e||e===this.audioOnlyMode_?this.audioOnlyMode_:(this.audioOnlyMode_=e)?(e=[],this.isInPictureInPicture()&&e.push(this.exitPictureInPicture()),this.isFullscreen()&&e.push(this.exitFullscreen()),this.audioPosterMode()&&e.push(this.audioPosterMode(!1)),Promise.all(e).then(()=>this.enableAudioOnlyUI_())):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"boolean"!=typeof e||e===this.audioPosterMode_?this.audioPosterMode_:(this.audioPosterMode_=e)?(this.audioOnlyMode()?this.audioOnlyMode(!1):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 t=e.track;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(void 0===e)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),eq(this))&&this.trigger("languagechange")}languages(){return $(nq.prototype.options_.languages,this.languages_)}toJSON(){var e=$(this.options_),t=e.tracks;e.tracks=[];for(let i=0;i<t.length;i++){var n=t[i];(n=$(n)).player=void 0,e.tracks[i]=n}return e}createModal(e,t){(t=t||{}).content=e||"";let i=new tw(this,t);return this.addChild(i),i.on("dispose",()=>{this.removeChild(i)}),i.open(),i}updateCurrentBreakpoint_(){if(this.responsive()){var e=this.currentBreakpoint(),t=this.currentWidth();for(let i=0;i<nF.length;i++){var n=nF[i];if(t<=this.breakpoints_[n]){if(e===n)return;e&&this.removeClass(nj[e]),this.addClass(nj[n]),this.breakpoint_=n;break}}}}removeCurrentBreakpoint_(){var e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)}breakpoints(e){return void 0!==e&&(this.breakpoint_="",this.breakpoints_=Object.assign({},n5,e),this.updateCurrentBreakpoint_()),Object.assign(this.breakpoints_)}responsive(e){return void 0===e?this.responsive_:(e=Boolean(e))!==this.responsive_?((this.responsive_=e)?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e):void 0}currentBreakpoint(){return this.breakpoint_}currentBreakpointClass(){return nj[this.breakpoint_]||""}loadMedia(e,t){var i,n,s,r,a,o;e&&"object"==typeof e&&(this.reset(),this.cache_.media=$(e),{artist:e,artwork:i,description:n,poster:s,src:r,textTracks:a,title:o}=this.cache_.media,!i&&s&&(this.cache_.media.artwork=[{src:s,type:iR(s)}]),r&&this.src(r),s&&this.poster(s),Array.isArray(a)&&a.forEach(e=>this.addRemoteTextTrack(e,!1)),this.titleBar&&this.titleBar.update({title:o,description:n||e||""}),this.ready(t))}getMedia(){var e,t;return this.cache_.media?$(this.cache_.media):(e=this.poster(),t={src:this.currentSources(),textTracks:Array.prototype.map.call(this.remoteTextTracks(),e=>({kind:e.kind,label:e.label,language:e.language,src:e.src}))},e&&(t.poster=e,t.artwork=[{src:t.poster,type:iR(t.poster)}]),t)}static getTagSettings(e){var t,i={sources:[],tracks:[]},n=es(e),s=n["data-setup"];if(J(e,"vjs-fill")&&(n.fill=!0),J(e,"vjs-fluid")&&(n.fluid=!0),null!==s&&([s,t]=ty(s||"{}"),s&&p.error(s),Object.assign(n,t)),Object.assign(i,n),e.hasChildNodes()){var r=e.childNodes;for(let a=0,o=r.length;a<o;a++){var l=r[a],u=l.nodeName.toLowerCase();"source"===u?i.sources.push(es(l)):"track"===u&&i.tracks.push(es(l))}}return i}debug(e){if(void 0===e)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(void 0===e)return this.cache_.playbackRates;Array.isArray(e)&&e.every(e=>"number"==typeof e)&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))}}tK.names.forEach(function(e){let t=tK[e];nq.prototype[t.getterName]=function(){return this.tech_?this.tech_[t.getterName]():(this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName])}}),nq.prototype.crossorigin=nq.prototype.crossOrigin,nq.players={},nI=window.navigator,nq.prototype.options_={techOrder:iE.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:nI&&(nI.languages&&nI.languages[0]||nI.userLanguage||nI.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},["ended","seeking","seekable","networkState","readyState"].forEach(function(e){nq.prototype[e]=function(){return this.techGet_(e)}}),n4.forEach(function(e){nq.prototype[`handleTech${eZ(e)}_`]=function(){return this.trigger(e)}}),ts.registerComponent("Player",nq);let nH="plugin",nV="activePlugins_",n7={},n9=e=>n7.hasOwnProperty(e),nW=e=>n9(e)?n7[e]:void 0,nz=(e,t)=>{e[nV]=e[nV]||{},e[nV][t]=!0},nG=(e,t,i)=>{i=(i?"before":"")+"pluginsetup",e.trigger(i,t),e.trigger(i+":"+t.name,t)},nX=(e,t)=>(t.prototype.name=e,function(...i){nG(this,{name:e,plugin:t,instance:null},!0);let n=new t(this,...i);return this[e]=()=>n,nG(this,n.getEventHash()),n});class nK{constructor(e){if(this.constructor===nK)throw Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),eX(this),delete this.trigger,eY(this,this.constructor.defaultState),nz(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 eM(this.eventBusEl_,e,this.getEventHash(t))}handleStateChanged(e){}dispose(){var{name:e,player:t}=this;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[nV][e]=!1,this.player=this.state=null,t[e]=nX(e,n7[e])}static isBasic(e){return"function"==typeof(e="string"==typeof e?nW(e):e)&&!nK.prototype.isPrototypeOf(e.prototype)}static registerPlugin(e,t){if("string"!=typeof e)throw Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`);if(n9(e))p.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(nq.prototype.hasOwnProperty(e))throw Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`);if("function"!=typeof t)throw Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`);return n7[e]=t,e!==nH&&(nK.isBasic(t)?nq.prototype[e]=function e(t,i){function n(){nG(this,{name:t,plugin:i,instance:null},!0);var e=i.apply(this,arguments);return nz(this,t),nG(this,{name:t,plugin:i,instance:e}),e}return Object.keys(i).forEach(function(e){n[e]=i[e]}),n}(e,t):nq.prototype[e]=nX(e,t)),t}static deregisterPlugin(e){if(e===nH)throw Error("Cannot de-register base plugin.");n9(e)&&(delete n7[e],delete nq.prototype[e])}static getPlugins(e=Object.keys(n7)){let t;return e.forEach(e=>{var i=nW(e);i&&((t=t||{})[e]=i)}),t}static getPluginVersion(e){return(e=nW(e))&&e.VERSION||""}}function nY(e,t,i,n){{var s=t+` is deprecated and will be removed in ${e}.0; please use ${i} instead.`,r=n;let a=!1;return function(...e){return a||p.warn(s),a=!0,r.apply(this,e)}}}nK.getPlugin=nW,nK.BASE_PLUGIN_NAME=nH,nK.registerPlugin(nH,nK),nq.prototype.usingPlugin=function(e){return!!this[nV]&&!0===this[nV][e]},nq.prototype.hasPlugin=function(e){return!!n9(e)};let nQ=e=>0===e.indexOf("#")?e.slice(1):e;function nZ(e,t,i){let s=nZ.getPlayer(e);if(s)t&&p.warn(`Player "${e}" is already initialised. Options will not be applied.`),i&&s.ready(i);else{let r="string"==typeof e?e8("#"+nQ(e)):e;if(!G(r))throw TypeError("The element or ID supplied is not valid. (videojs)");r.ownerDocument.defaultView&&r.ownerDocument.body.contains(r)||p.warn("The element supplied is not included in the DOM"),!0===(t=t||{}).restoreEl&&(t.restoreEl=(r.parentNode&&r.parentNode.hasAttribute("data-vjs-player")?r.parentNode:r).cloneNode(!0)),n("beforesetup").forEach(e=>{e=e(r,$(t)),!v(e)||Array.isArray(e)?p.error("please return an object in beforesetup hooks"):t=$(t,e)}),s=new(e=ts.getComponent("Player"))(r,t,i),n("setup").forEach(e=>e(s))}return s}nZ.hooks_=i,nZ.hooks=n,nZ.hook=function(e,t){n(e,t)},nZ.hookOnce=function(e,t){n(e,[].concat(t).map(t=>{let i=(...n)=>(s(e,i),t(...n));return i}))},nZ.removeHook=s,!0!==window.VIDEOJS_NO_DYNAMIC_STYLE&&z()&&!(tY=e8(".vjs-styles-defaults"))&&(tY=eC("vjs-styles-defaults"),(nx=e8("head"))&&nx.insertBefore(tY,nx.firstChild),e0(tY,`
|
||
.video-js {
|
||
width: 300px;
|
||
height: 150px;
|
||
}
|
||
|
||
.vjs-fluid:not(.vjs-audio-only-mode) {
|
||
padding-top: 56.25%
|
||
}
|
||
`)),ek(1,nZ),nZ.VERSION=t,nZ.options=nq.prototype.options_,nZ.getPlayers=()=>nq.players,nZ.getPlayer=e=>{var t=nq.players;let i;if("string"==typeof e){var n=nQ(e),s=t[n];if(s)return s;i=e8("#"+n)}else i=e;if(G(i)){var{player:s,playerId:n}=i;if(s||t[n])return s||t[n]}},nZ.getAllPlayers=()=>Object.keys(nq.players).map(e=>nq.players[e]).filter(Boolean),nZ.players=nq.players,nZ.getComponent=ts.getComponent,nZ.registerComponent=(e,t)=>{iE.isTech(t)&&p.warn(`The ${e} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),ts.registerComponent.call(ts,e,t)},nZ.getTech=iE.getTech,nZ.registerTech=iE.registerTech,nZ.use=function(e,t){iC[e]=iC[e]||[],iC[e].push(t)},Object.defineProperty(nZ,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(nZ.middleware,"TERMINATOR",{value:ix,writeable:!1,enumerable:!0}),nZ.browser=F,nZ.obj=w,nZ.mergeOptions=nY(9,"videojs.mergeOptions","videojs.obj.merge",$),nZ.defineLazyProperty=nY(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",T),nZ.bind=nY(9,"videojs.bind","native Function.prototype.bind",e2),nZ.registerPlugin=nK.registerPlugin,nZ.deregisterPlugin=nK.deregisterPlugin,nZ.plugin=(e,t)=>(p.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),nK.registerPlugin(e,t)),nZ.getPlugins=nK.getPlugins,nZ.getPlugin=nK.getPlugin,nZ.getPluginVersion=nK.getPluginVersion,nZ.addLanguage=function(e,t){return e=(""+e).toLowerCase(),nZ.options.languages=$(nZ.options.languages,{[e]:t}),nZ.options.languages[e]},nZ.log=p,nZ.createLogger=m,nZ.time=tp,nZ.createTimeRange=nY(9,"videojs.createTimeRange","videojs.time.createTimeRanges",to),nZ.createTimeRanges=nY(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",to),nZ.formatTime=nY(9,"videojs.formatTime","videojs.time.formatTime",tc),nZ.setFormatTime=nY(9,"videojs.setFormatTime","videojs.time.setFormatTime",td),nZ.resetFormatTime=nY(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",th),nZ.parseUrl=nY(9,"videojs.parseUrl","videojs.url.parseUrl",tP),nZ.isCrossOrigin=nY(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",tL),nZ.EventTarget=ej,nZ.any=eB,nZ.on=eR,nZ.one=e3,nZ.off=eN,nZ.trigger=eM,nZ.xhr=t1,nZ.TextTrack=t7,nZ.AudioTrack=t9,nZ.VideoTrack=tW,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(e=>{nZ[e]=function(){return p.warn(`videojs.${e}() is deprecated; use videojs.dom.${e}() instead`),eT[e].apply(null,arguments)}}),nZ.computedStyle=nY(9,"videojs.computedStyle","videojs.dom.computedStyle",e$),nZ.dom=eT,nZ.fn=e6,nZ.num=tR,nZ.str=te,nZ.url=tO,ti(function(e,t){/*! @name videojs-contrib-quality-levels @version 3.0.0 @license Apache-2.0 */ e.exports=function(e){var t,i=(t=e)&&"object"==typeof t&&"default"in t?t:{default:t};class n{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:()=>t.enabled_(),set(e){t.enabled_(e)}}),t}}class s extends i.default.EventTarget{constructor(){super();let e=this;return e.levels_=[],e.selectedIndex_=-1,Object.defineProperty(e,"selectedIndex",{get:()=>e.selectedIndex_}),Object.defineProperty(e,"length",{get:()=>e.levels_.length}),e}addQualityLevel(e){let t=this.getQualityLevelById(e.id);if(t)return t;let i=this.levels_.length;return t=new n(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,n=this.length;i<n;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++){let n=this[t];if(n.id===e)return n}return null}dispose(){this.selectedIndex_=-1,this.levels_.length=0}}for(let r in s.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"},s.prototype.allowedEvents_)s.prototype["on"+r]=null;var a="3.0.0";let o=i.default.registerPlugin||i.default.plugin,l=function(e,t){let i=e.qualityLevels,n=new s,r=function(){n.dispose(),e.qualityLevels=i,e.off("dispose",r)};return e.on("dispose",r),e.qualityLevels=()=>n,e.qualityLevels.VERSION=a,n},u=function(e){return l(this,i.default.mergeOptions({},e))};return o("qualityLevels",u),u.VERSION=a,u}(nZ)});var nJ=ti(function(e,t){var i,n,s,r,a;i=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,n=/^(?=([^\/?#]*))\1([^]*)$/,s=/(?:\/|^)\.(?=\/)/g,r=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,a={buildAbsoluteURL:function(e,t,i){if(i=i||{},e=e.trim(),!(t=t.trim())){if(!i.alwaysNormalize)return e;var s=a.parseURL(e);if(s)return s.path=a.normalizePath(s.path),a.buildURLFromParts(s);throw Error("Error trying to parse base URL.")}if(!(s=a.parseURL(t)))throw Error("Error trying to parse relative URL.");if(s.scheme)return i.alwaysNormalize?(s.path=a.normalizePath(s.path),a.buildURLFromParts(s)):t;if(!(t=a.parseURL(e)))throw Error("Error trying to parse base URL.");!t.netLoc&&t.path&&"/"!==t.path[0]&&(e=n.exec(t.path),t.netLoc=e[1],t.path=e[2]),t.netLoc&&!t.path&&(t.path="/");var r,e={scheme:t.scheme,netLoc:s.netLoc,path:null,params:s.params,query:s.query,fragment:s.fragment};return s.netLoc||(e.netLoc=t.netLoc,"/"!==s.path[0]&&(s.path?(r=(r=t.path).substring(0,r.lastIndexOf("/")+1)+s.path,e.path=a.normalizePath(r)):(e.path=t.path,s.params||(e.params=t.params,s.query)||(e.query=t.query)))),null===e.path&&(e.path=i.alwaysNormalize?a.normalizePath(s.path):s.path),a.buildURLFromParts(e)},parseURL:function(e){return(e=i.exec(e))?{scheme:e[1]||"",netLoc:e[2]||"",path:e[3]||"",params:e[4]||"",query:e[5]||"",fragment:e[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(s,"");e.length!==(e=e.replace(r,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}},e.exports=a}),se="http://example.com",nC=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){return!!this.listeners[e]&&(t=this.listeners[e].indexOf(t),this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(t,1),-1<t)},t.trigger=function(e){var t=this.listeners[e];if(t){if(2===arguments.length)for(var i=t.length,n=0;n<i;++n)t[n].call(this,arguments[1]);else for(var s=Array.prototype.slice.call(arguments,1),r=t.length,a=0;a<r;++a)t[a].apply(this,s)}},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",function(t){e.push(t)})},e}();function st(e){var e=/([0-9.]*)?@?([0-9.]*)?/.exec(e||""),t={};return e[1]&&(t.length=parseInt(e[1],10)),e[2]&&(t.offset=parseInt(e[2],10)),t}function si(e){var t={};if(e){var i,n=e.split(RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))'));let s=n.length;for(;s--;)""!==n[s]&&((i=/([^=]*)=(.*)/.exec(n[s]).slice(1))[0]=i[0].replace(/^\s+|\s+$/g,""),i[1]=i[1].replace(/^\s+|\s+$/g,""),i[1]=i[1].replace(/^['"](.*)['"]$/g,"$1"),t[i[0]]=i[1])}return t}function sn(e){let t={};return Object.keys(e).forEach(function(i){t[i.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase())]=e[i]}),t}function ss(e){var t,i,n,s,r,{serverControl:e,targetDuration:a,partTargetDuration:o}=e;e&&(t="#EXT-X-SERVER-CONTROL",i="holdBack",n="partHoldBack",s=a&&3*a,r=o&&2*o,a&&!e.hasOwnProperty(i)&&(e[i]=s,this.trigger("info",{message:t+` defaulting HOLD-BACK to targetDuration * 3 (${s}).`})),s&&e[i]<s&&(this.trigger("warn",{message:t+` clamping HOLD-BACK (${e[i]}) to targetDuration * 3 (${s})`}),e[i]=s),o&&!e.hasOwnProperty(n)&&(e[n]=3*o,this.trigger("info",{message:t+` defaulting PART-HOLD-BACK to partTargetDuration * 3 (${e[n]}).`})),o)&&e[n]<r&&(this.trigger("warn",{message:t+` clamping PART-HOLD-BACK (${e[n]}) to partTargetDuration * 2 (${r}).`}),e[n]=r)}class sr extends nC{constructor(){super(),this.lineStream=new /*! @name m3u8-parser @version 6.0.0 @license Apache-2.0 */ class e extends nC{constructor(){super(),this.buffer=""}push(e){let t;for(this.buffer+=e,t=this.buffer.indexOf("\n");-1<t;t=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}},this.parseStream=new class e extends nC{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let t,i;0!==(e=e.trim()).length&&("#"!==e[0]?this.trigger("data",{type:"uri",uri:e}):this.tagMappers.reduce((t,i)=>(i=i(e))===e?t:t.concat([i]),[e]).forEach(e=>{var n,s;for(let r=0;r<this.customParsers.length;r++)if(this.customParsers[r].call(this,e))return;0!==e.indexOf("#EXT")?this.trigger("data",{type:"comment",text:e.slice(1)}):(e=e.replace("\r",""),(t=/^#EXTM3U/.exec(e))?this.trigger("data",{type:"tag",tagType:"m3u"}):(t=/^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(e))?(i={type:"tag",tagType:"inf"},t[1]&&(i.duration=parseFloat(t[1])),t[2]&&(i.title=t[2]),this.trigger("data",i)):(t=/^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(e))?(i={type:"tag",tagType:"targetduration"},t[1]&&(i.duration=parseInt(t[1],10)),this.trigger("data",i)):(t=/^#EXT-X-VERSION:([0-9.]*)?/.exec(e))?(i={type:"tag",tagType:"version"},t[1]&&(i.version=parseInt(t[1],10)),this.trigger("data",i)):(t=/^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(e))?(i={type:"tag",tagType:"media-sequence"},t[1]&&(i.number=parseInt(t[1],10)),this.trigger("data",i)):(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(e))?(i={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(i.number=parseInt(t[1],10)),this.trigger("data",i)):(t=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(e))?(i={type:"tag",tagType:"playlist-type"},t[1]&&(i.playlistType=t[1]),this.trigger("data",i)):(t=/^#EXT-X-BYTERANGE:(.*)?$/.exec(e))?(i=t3(st(t[1]),{type:"tag",tagType:"byterange"}),this.trigger("data",i)):(t=/^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(e))?(i={type:"tag",tagType:"allow-cache"},t[1]&&(i.allowed=!/NO/.test(t[1])),this.trigger("data",i)):(t=/^#EXT-X-MAP:(.*)$/.exec(e))?(i={type:"tag",tagType:"map"},t[1]&&((s=si(t[1])).URI&&(i.uri=s.URI),s.BYTERANGE)&&(i.byterange=st(s.BYTERANGE)),this.trigger("data",i)):(t=/^#EXT-X-STREAM-INF:(.*)$/.exec(e))?(i={type:"tag",tagType:"stream-inf"},t[1]&&(i.attributes=si(t[1]),i.attributes.RESOLUTION&&(s={},(n=i.attributes.RESOLUTION.split("x"))[0]&&(s.width=parseInt(n[0],10)),n[1]&&(s.height=parseInt(n[1],10)),i.attributes.RESOLUTION=s),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)):(t=/^#EXT-X-MEDIA:(.*)$/.exec(e))?(i={type:"tag",tagType:"media"},t[1]&&(i.attributes=si(t[1])),this.trigger("data",i)):(t=/^#EXT-X-ENDLIST/.exec(e))?this.trigger("data",{type:"tag",tagType:"endlist"}):(t=/^#EXT-X-DISCONTINUITY/.exec(e))?this.trigger("data",{type:"tag",tagType:"discontinuity"}):(t=/^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(e))?(i={type:"tag",tagType:"program-date-time"},t[1]&&(i.dateTimeString=t[1],i.dateTimeObject=new Date(t[1])),this.trigger("data",i)):(t=/^#EXT-X-KEY:(.*)$/.exec(e))?(i={type:"tag",tagType:"key"},t[1]&&(i.attributes=si(t[1]),i.attributes.IV)&&("0x"===i.attributes.IV.substring(0,2).toLowerCase()&&(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)):(t=/^#EXT-X-START:(.*)$/.exec(e))?(i={type:"tag",tagType:"start"},t[1]&&(i.attributes=si(t[1]),i.attributes["TIME-OFFSET"]=parseFloat(i.attributes["TIME-OFFSET"]),i.attributes.PRECISE=/YES/.test(i.attributes.PRECISE)),this.trigger("data",i)):(t=/^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(e))?(i={type:"tag",tagType:"cue-out-cont"},t[1]?i.data=t[1]:i.data="",this.trigger("data",i)):(t=/^#EXT-X-CUE-OUT:(.*)?$/.exec(e))?(i={type:"tag",tagType:"cue-out"},t[1]?i.data=t[1]:i.data="",this.trigger("data",i)):(t=/^#EXT-X-CUE-IN:(.*)?$/.exec(e))?(i={type:"tag",tagType:"cue-in"},t[1]?i.data=t[1]:i.data="",this.trigger("data",i)):(t=/^#EXT-X-SKIP:(.*)$/.exec(e))&&t[1]?((i={type:"tag",tagType:"skip"}).attributes=si(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(" ")),this.trigger("data",i)):(t=/^#EXT-X-PART:(.*)$/.exec(e))&&t[1]?((i={type:"tag",tagType:"part"}).attributes=si(t[1]),["DURATION"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))}),["INDEPENDENT","GAP"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=/YES/.test(i.attributes[e]))}),i.attributes.hasOwnProperty("BYTERANGE")&&(i.attributes.byterange=st(i.attributes.BYTERANGE)),this.trigger("data",i)):(t=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(e))&&t[1]?((i={type:"tag",tagType:"server-control"}).attributes=si(t[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))}),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=/YES/.test(i.attributes[e]))}),this.trigger("data",i)):(t=/^#EXT-X-PART-INF:(.*)$/.exec(e))&&t[1]?((i={type:"tag",tagType:"part-inf"}).attributes=si(t[1]),["PART-TARGET"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))}),this.trigger("data",i)):(t=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(e))&&t[1]?((i={type:"tag",tagType:"preload-hint"}).attributes=si(t[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach(function(e){var t;i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseInt(i.attributes[e],10),t="BYTERANGE-LENGTH"===e?"length":"offset",i.attributes.byterange=i.attributes.byterange||{},i.attributes.byterange[t]=i.attributes[e],delete i.attributes[e])}),this.trigger("data",i)):(t=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(e))&&t[1]?((i={type:"tag",tagType:"rendition-report"}).attributes=si(t[1]),["LAST-MSN","LAST-PART"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseInt(i.attributes[e],10))}),this.trigger("data",i)):this.trigger("data",{type:"tag",data:e.slice(4)}))}))}addParser({expression:e,customType:t,dataParser:i,segment:n}){"function"!=typeof i&&(i=e=>e),this.customParsers.push(s=>{if(e.exec(s))return this.trigger("data",{type:"custom",data:i(s),customType:t,segment:n}),!0})}addTagMapper({expression:e,map:t}){this.tagMappers.push(i=>e.test(i)?t(i):i)}},this.lineStream.pipe(this.parseStream);let e=this,t=[],i={},n,s,r=!1,a={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},o=0,l=(this.manifest={allowCache:!0,discontinuityStarts:[],segments:[]},0),u=0;this.on("end",()=>{!i.uri&&(i.parts||i.preloadHints)&&(!i.map&&n&&(i.map=n),!i.key&&s&&(i.key=s),i.timeline||"number"!=typeof o||(i.timeline=o),this.manifest.preloadSegment=i)}),this.parseStream.on("data",function(d){let h,c;({tag(){(({version(){d.version&&(this.manifest.version=d.version)},"allow-cache"(){this.manifest.allowCache=d.allowed,"allowed"in d||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){var e={};"length"in d&&((i.byterange=e).length=d.length,"offset"in d||(d.offset=l)),"offset"in d&&((i.byterange=e).offset=d.offset),l=e.offset+e.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"})),0<d.duration&&(i.duration=d.duration),0===d.duration&&(i.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=t},key(){if(d.attributes){if("NONE"===d.attributes.METHOD)s=null;else if(d.attributes.URI){if("com.apple.streamingkeydelivery"===d.attributes.KEYFORMAT)this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:d.attributes};else if("com.microsoft.playready"===d.attributes.KEYFORMAT)this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.microsoft.playready"]={uri:d.attributes.URI};else{if("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"===d.attributes.KEYFORMAT)return -1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(d.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===d.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==d.attributes.URI.substring(0,23)?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):d.attributes.KEYID&&"0x"===d.attributes.KEYID.substring(0,2)?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:d.attributes.KEYFORMAT,keyId:d.attributes.KEYID.substring(2)},pssh:function e(t){for(var i=window.atob?window.atob(t):Buffer.from(t,"base64").toString("binary"),n=new Uint8Array(i.length),s=0;s<i.length;s++)n[s]=i.charCodeAt(s);return n}(d.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}));d.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),s={method:d.attributes.METHOD||"AES-128",uri:d.attributes.URI},void 0!==d.attributes.IV&&(s.iv=d.attributes.IV)}}else this.trigger("warn",{message:"ignoring key declaration without URI"})}else this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence"(){isFinite(d.number)?this.manifest.mediaSequence=d.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+d.number})},"discontinuity-sequence"(){isFinite(d.number)?(this.manifest.discontinuitySequence=d.number,o=d.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+d.number})},"playlist-type"(){/VOD|EVENT/.test(d.playlistType)?this.manifest.playlistType=d.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+d.playlist})},map(){n={},d.uri&&(n.uri=d.uri),d.byterange&&(n.byterange=d.byterange),s&&(n.key=s)},"stream-inf"(){this.manifest.playlists=t,this.manifest.mediaGroups=this.manifest.mediaGroups||a,d.attributes?(i.attributes||(i.attributes={}),t3(i.attributes,d.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media(){var e;this.manifest.mediaGroups=this.manifest.mediaGroups||a,d.attributes&&d.attributes.TYPE&&d.attributes["GROUP-ID"]&&d.attributes.NAME?((e=this.manifest.mediaGroups[d.attributes.TYPE])[d.attributes["GROUP-ID"]]=e[d.attributes["GROUP-ID"]]||{},h=e[d.attributes["GROUP-ID"]],(c={default:/yes/i.test(d.attributes.DEFAULT)}).default?c.autoselect=!0:c.autoselect=/yes/i.test(d.attributes.AUTOSELECT),d.attributes.LANGUAGE&&(c.language=d.attributes.LANGUAGE),d.attributes.URI&&(c.uri=d.attributes.URI),d.attributes["INSTREAM-ID"]&&(c.instreamId=d.attributes["INSTREAM-ID"]),d.attributes.CHARACTERISTICS&&(c.characteristics=d.attributes.CHARACTERISTICS),d.attributes.FORCED&&(c.forced=/yes/i.test(d.attributes.FORCED)),h[d.attributes.NAME]=c):this.trigger("warn",{message:"ignoring incomplete or missing media group"})},discontinuity(){o+=1,i.discontinuity=!0,this.manifest.discontinuityStarts.push(t.length)},"program-date-time"(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=d.dateTimeString,this.manifest.dateTimeObject=d.dateTimeObject),i.dateTimeString=d.dateTimeString,i.dateTimeObject=d.dateTimeObject},targetduration(){!isFinite(d.duration)||d.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+d.duration}):(this.manifest.targetDuration=d.duration,ss.call(this,this.manifest))},start(){!d.attributes||isNaN(d.attributes["TIME-OFFSET"])?this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"}):this.manifest.start={timeOffset:d.attributes["TIME-OFFSET"],precise:d.attributes.PRECISE}},"cue-out"(){i.cueOut=d.data},"cue-out-cont"(){i.cueOutCont=d.data},"cue-in"(){i.cueIn=d.data},skip(){this.manifest.skip=sn(d.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",d.attributes,["SKIPPED-SEGMENTS"])},part(){r=!0;var e=this.manifest.segments.length,t=sn(d.attributes),t=(i.parts=i.parts||[],i.parts.push(t),t.byterange&&(t.byterange.hasOwnProperty("offset")||(t.byterange.offset=u),u=t.byterange.offset+t.byterange.length),i.parts.length-1);this.warnOnMissingAttributes_(`#EXT-X-PART #${t} for segment #`+e,d.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((e,t)=>{e.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${t} lacks required attribute(s): LAST-PART`})})},"server-control"(){var e=this.manifest.serverControl=sn(d.attributes);e.hasOwnProperty("canBlockReload")||(e.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),ss.call(this,this.manifest),e.canSkipDateranges&&!e.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"(){var e=this.manifest.segments.length,t=sn(d.attributes),n=t.type&&"PART"===t.type,s=(i.preloadHints=i.preloadHints||[],i.preloadHints.push(t),!t.byterange||t.byterange.hasOwnProperty("offset")||(t.byterange.offset=n?u:0,n&&(u=t.byterange.offset+t.byterange.length)),i.preloadHints.length-1);if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${s} for segment #`+e,d.attributes,["TYPE","URI"]),t.type)for(let r=0;r<i.preloadHints.length-1;r++){var a=i.preloadHints[r];a.type&&a.type===t.type&&this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${s} for segment #${e} has the same TYPE ${t.type} as preload hint #`+r})}},"rendition-report"(){var e=sn(d.attributes),e=(this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(e),this.manifest.renditionReports.length-1),t=["LAST-MSN","URI"];r&&t.push("LAST-PART"),this.warnOnMissingAttributes_("#EXT-X-RENDITION-REPORT #"+e,d.attributes,t)},"part-inf"(){this.manifest.partInf=sn(d.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",d.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),ss.call(this,this.manifest)}})[d.tagType]||function(){}).call(e)},uri(){i.uri=d.uri,t.push(i),!this.manifest.targetDuration||"duration"in i||(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),i.duration=this.manifest.targetDuration),s&&(i.key=s),i.timeline=o,n&&(i.map=n),u=0,i={}},comment(){},custom(){d.segment?(i.custom=i.custom||{},i.custom[d.customType]=d.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[d.customType]=d.data)}})[d.type].call(e)})}warnOnMissingAttributes_(e,t,i){let n=[];i.forEach(function(e){t.hasOwnProperty(e)||n.push(e)}),n.length&&this.trigger("warn",{message:e+" lacks required attribute(s): "+n.join(", ")})}push(e){this.lineStream.push(e)}end(){this.lineStream.push("\n"),this.trigger("end")}addParser(e){this.parseStream.addParser(e)}addTagMapper(e){this.parseStream.addTagMapper(e)}}function sa(e){return sc.audio.test((e=void 0===e?"":e).trim().toLowerCase())}function so(e){return void 0===e&&(e=""),window.MediaSource&&window.MediaSource.isTypeSupported&&window.MediaSource.isTypeSupported(sy(e))||!1}function sl(e){return(e=void 0===e?"":e).toLowerCase().split(",").every(function(e){e=e.trim();for(var t=0;t<sm.length;t++)if(sc["muxer"+sm[t]].test(e))return!0;return!1})}function su(e){return s8.test(e)?"hls":sb.test(e)?"dash":"application/vnd.videojs.vhs+json"===e?"vhs-json":null}function sd(e,t){if("string"!=typeof(e="string"!=typeof e&&e&&"function"==typeof e.toString?e.toString():e))return new Uint8Array;t||(e=unescape(encodeURIComponent(e)));for(var i=new Uint8Array(e.length),n=0;n<e.length;n++)i[n]=e.charCodeAt(n);return i}function sh(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=window.location&&window.location.href||"");var i="function"==typeof window.URL,n=/^\/\//.test(e),s=!window.location&&!/\/\//i.test(e);return i?e=new window.URL(e,window.location||sE):/\/\//i.test(e)||(e=nJ.buildAbsoluteURL(window.location&&window.location.href||"",e)),i?(i=new URL(t,e),s?i.href.slice(sE.length):n?i.href.slice(i.protocol.length):i.href):nJ.buildAbsoluteURL(e,t)}var sc={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^/},sp=["video","audio","text"],sm=["Video","Audio","Text"],sf=function(e){return e&&e.replace(/avc1\.(\d+)\.(\d+)/i,function(e,t,i){return"avc1."+("00"+Number(t).toString(16)).slice(-2)+"00"+("00"+Number(i).toString(16)).slice(-2)})},sg=function(e){var e=(e=void 0===e?"":e).split(","),t=[];return e.forEach(function(e){var i;e=e.trim(),sp.forEach(function(n){var s,r=sc[n].exec(e.toLowerCase());!r||r.length<=1||(i=n,r=e.substring(0,r[1].length),s=e.replace(r,""),t.push({type:r,details:s,mediaType:n}))}),i||t.push({type:e,details:"",mediaType:"unknown"})}),t},sy=function(e){var t,i,n;if(e&&"string"==typeof e)return i="video",1===(t=e.toLowerCase().split(",").map(function(e){return sf(e.trim())})).length&&sa(t[0])?i="audio":1===t.length&&(n=t[0],sc.text.test((n=void 0===n?"":n).trim().toLowerCase()))&&(i="application"),n="mp4",t.every(function(e){return sc.mp4.test(e)})?n="mp4":t.every(function(e){return sc.webm.test(e)})?n="webm":t.every(function(e){return sc.ogg.test(e)})&&(n="ogg"),i+"/"+n+';codecs="'+e+'"'},sv="mp4a.40.2",s8=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,sb=/^application\/dash\+xml/i,s$=function(e){return"function"===ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},sT=function(e){return e instanceof Uint8Array?e:(Array.isArray(e)||s$(e)||e instanceof ArrayBuffer||(e="number"!=typeof e||"number"==typeof e&&e!=e?0:[e]),new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0))},sw=window.BigInt||Number,s_=[sw("0x1"),sw("0x100"),sw("0x10000"),sw("0x1000000"),sw("0x100000000"),sw("0x10000000000"),sw("0x1000000000000"),sw("0x100000000000000"),sw("0x10000000000000000")],sS=(tt=new Uint16Array([65484]),255!==(tt=new Uint8Array(tt.buffer,tt.byteOffset,tt.byteLength))[0]&&tt[0],function(e,t){var t=void 0===t?{}:t,i=t.signed,i=void 0!==i&&i,t=t.le,n=void 0!==t&&t,t=(e=sT(e),n?"reduce":"reduceRight"),t=(e[t]||Array.prototype[t]).call(e,function(t,i,s){return s=n?s:Math.abs(s+1-e.length),t+sw(i)*s_[s]},sw(0));return i&&(i=s_[e.length]/sw(2)-sw(1))<(t=sw(t))&&(t=(t=t-i-i)-sw(2)),Number(t)}),sk=function(e,t,i){var i=void 0===i?{}:i,n=i.offset,s=void 0===n?0:n,n=i.mask,r=void 0===n?[]:n,i=(e=sT(e),(t=sT(t)).every||Array.prototype.every);return t.length&&e.length-s>=t.length&&i.call(t,function(t,i){return t===(r[i]?r[i]&e[s+i]:e[s+i])})},sE="http://example.com";function sC(e,t){return(t=void 0===t?Object:t)&&"function"==typeof t.freeze?t.freeze(e):e}var s0=sC({HTML:"text/html",isHTML:function(e){return e===s0.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),sx=sC({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(e){return e===sx.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"}),sI={assign:function(e,t){if(null===e||"object"!=typeof e)throw TypeError("target is not an object");for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},find:function(e,t,i){if(void 0===i&&(i=Array.prototype),e&&"function"==typeof i.find)return i.find.call(e,t);for(var n=0;n<e.length;n++)if(Object.prototype.hasOwnProperty.call(e,n)){var s=e[n];if(t.call(void 0,s,n,e))return s}},freeze:sC,MIME_TYPE:s0,NAMESPACE:sx},sP=sI.find,sA=sI.NAMESPACE;function sL(e){return""!==e}function sD(e,t){return e.hasOwnProperty(t)||(e[t]=!0),e}function sO(e){return e?Object.keys((e=e?e.split(/[\t\n\f\r ]+/).filter(sL):[]).reduce(sD,{})):[]}function sR(e,t){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}function sN(e,t){var i=e.prototype;function n(){}i instanceof t||(n.prototype=t.prototype,sR(i,n=new n),e.prototype=i=n),i.constructor!=e&&(i.constructor=e)}var nP={},n0=(nP.ELEMENT_NODE=1,nP.ATTRIBUTE_NODE=2,nP.TEXT_NODE=3,nP.CDATA_SECTION_NODE=4,nP.ENTITY_REFERENCE_NODE=5,nP.ENTITY_NODE=6,nP.PROCESSING_INSTRUCTION_NODE=7,nP.COMMENT_NODE=8,nP.DOCUMENT_NODE=9,nP.DOCUMENT_TYPE_NODE=10,nP.DOCUMENT_FRAGMENT_NODE=11,nP.NOTATION_NODE=12,{}),sM={},s3=(n0.INDEX_SIZE_ERR=(sM[1]="Index size error",1),n0.DOMSTRING_SIZE_ERR=(sM[2]="DOMString size error",2),n0.HIERARCHY_REQUEST_ERR=(sM[3]="Hierarchy request error",3)),sB=(n0.WRONG_DOCUMENT_ERR=(sM[4]="Wrong document",4),n0.INVALID_CHARACTER_ERR=(sM[5]="Invalid character",5),n0.NO_DATA_ALLOWED_ERR=(sM[6]="No data allowed",6),n0.NO_MODIFICATION_ALLOWED_ERR=(sM[7]="No modification allowed",7),n0.NOT_FOUND_ERR=(sM[8]="Not found",8));function sU(e,t){var i;return t instanceof Error?i=t:(i=this,Error.call(this,sM[e]),this.message=sM[e],Error.captureStackTrace&&Error.captureStackTrace(this,sU)),i.code=e,t&&(this.message=this.message+": "+t),i}function s2(){}function s1(e,t){this._node=e,this._refresh=t,s4(this)}function s4(e){var t,i=e._node._inc||e._node.ownerDocument._inc;e._inc!=i&&(t=e._refresh(e._node),r8(e,"length",t.length),sR(t,e),e._inc=i)}function s6(){}function sF(e,t){for(var i=e.length;i--;)if(e[i]===t)return i}function sj(e,t,i,n){n?t[sF(t,n)]=i:t[t.length++]=i,e&&(t=(i.ownerElement=e).ownerDocument)&&(n&&sW(t,e,n),n=e,e=i,(i=t)&&i._inc++,e.namespaceURI===sA.XMLNS)&&(n._nsMap[e.prefix?e.localName:""]=e.value)}function s5(e,t,i){var n=sF(t,i);if(!(0<=n))throw new sU(sB,Error(e.tagName+"@"+i));for(var s,r=t.length-1;n<r;)t[n]=t[++n];t.length=r,e&&(s=e.ownerDocument)&&(sW(s,e,i),i.ownerElement=null)}function sq(){}function sH(){}function sV(e){return("<"==e?"<":">"==e&&">")||("&"==e?"&":'"'==e&&""")||"&#"+e.charCodeAt()+";"}function s7(e,t){if(t(e))return 1;if(e=e.firstChild)do if(s7(e,t))return 1;while(e=e.nextSibling)}function s9(){this.ownerDocument=this}function sW(e,t,i){e&&e._inc++,i.namespaceURI===sA.XMLNS&&delete t._nsMap[i.prefix?i.localName:""]}function sz(e,t,i){if(e&&e._inc){e._inc++;var n=t.childNodes;if(i)n[n.length++]=i;else{for(var s=t.firstChild,r=0;s;)s=(n[r++]=s).nextSibling;n.length=r,delete n[n.length]}}}function sG(e,t){var i=t.previousSibling,n=t.nextSibling;return i?i.nextSibling=n:e.firstChild=n,n?n.previousSibling=i:e.lastChild=i,t.parentNode=null,t.previousSibling=null,t.nextSibling=null,sz(e.ownerDocument,e),t}function sX(e){return e&&e.nodeType===sH.DOCUMENT_TYPE_NODE}function sK(e){return e&&e.nodeType===sH.ELEMENT_NODE}function sY(e){return e&&e.nodeType===sH.TEXT_NODE}function sQ(e,t){var i,e=e.childNodes||[];if(!sP(e,sK)&&!sX(t))return i=sP(e,sX),!(t&&i&&e.indexOf(i)>e.indexOf(t))}function sZ(e,t){var i,e=e.childNodes||[];if(!sP(e,function(e){return sK(e)&&e!==t}))return i=sP(e,sX),!(t&&i&&e.indexOf(i)>e.indexOf(t))}function sJ(e,t,i){var n=e.childNodes||[],s=t.childNodes||[];if(t.nodeType===sH.DOCUMENT_FRAGMENT_NODE){var r=s.filter(sK);if(1<r.length||sP(s,sY))throw new sU(s3,"More than one element or text in fragment");if(1===r.length&&!sQ(e,i))throw new sU(s3,"Element in fragment can not be inserted before doctype")}if(sK(t)&&!sQ(e,i))throw new sU(s3,"Only one element can be added and only after doctype");if(sX(t)){if(sP(n,sX))throw new sU(s3,"Only one doctype is allowed");if(s=sP(n,sK),i&&n.indexOf(s)<n.indexOf(i))throw new sU(s3,"Doctype can only be inserted before an element");if(!i&&s)throw new sU(s3,"Doctype can not be appended since element is present")}}function re(e,t,i){var n=e.childNodes||[],s=t.childNodes||[];if(t.nodeType===sH.DOCUMENT_FRAGMENT_NODE){var r=s.filter(sK);if(1<r.length||sP(s,sY))throw new sU(s3,"More than one element or text in fragment");if(1===r.length&&!sZ(e,i))throw new sU(s3,"Element in fragment can not be inserted before doctype")}if(sK(t)&&!sZ(e,i))throw new sU(s3,"Only one element can be added and only after doctype");if(sX(t)){if(sP(n,function(e){return sX(e)&&e!==i}))throw new sU(s3,"Only one doctype is allowed");if(s=sP(n,sK),i&&n.indexOf(s)<n.indexOf(i))throw new sU(s3,"Doctype can only be inserted before an element")}}function rt(e,t,i,n){if(function e(t,i,n){var s;if(!(s=t)||s.nodeType!==sH.DOCUMENT_NODE&&s.nodeType!==sH.DOCUMENT_FRAGMENT_NODE&&s.nodeType!==sH.ELEMENT_NODE)throw new sU(s3,"Unexpected parent node type "+t.nodeType);if(n&&n.parentNode!==t)throw new sU(sB,"child not in parent");if(!(s=i)||!(sK(s)||sY(s)||sX(s)||s.nodeType===sH.DOCUMENT_FRAGMENT_NODE||s.nodeType===sH.COMMENT_NODE||s.nodeType===sH.PROCESSING_INSTRUCTION_NODE)||sX(i)&&t.nodeType!==sH.DOCUMENT_NODE)throw new sU(s3,"Unexpected node type "+i.nodeType+" for parent node type "+t.nodeType)}(e,t,i),e.nodeType===sH.DOCUMENT_NODE&&(n||sJ)(e,t,i),(n=t.parentNode)&&n.removeChild(t),11===t.nodeType){var s=t.firstChild;if(null==s)return t;var r=t.lastChild}else s=r=t;for(n=i?i.previousSibling:e.lastChild,s.previousSibling=n,r.nextSibling=i,n?n.nextSibling=s:e.firstChild=s,null==i?e.lastChild=r:i.previousSibling=r;s.parentNode=e,s!==r&&(s=s.nextSibling););return sz(e.ownerDocument||e,e),11==t.nodeType&&(t.firstChild=t.lastChild=null),t}function ri(){this._nsMap={}}function rn(){}function rs(){}function rr(){}function ra(){}function ro(){}function rl(){}function ru(){}function rd(){}function rh(){}function rc(){}function rp(){}function rm(){}function rf(e,t){var i,n=[],s=9==this.nodeType&&this.documentElement||this,r=s.prefix,a=s.namespaceURI;return rv(this,n,e,t,i=a&&null==r&&null==s.lookupPrefix(a)?[{namespace:a,prefix:null}]:i),n.join("")}function rg(e,t,i){var n=e.prefix||"",s=e.namespaceURI;if(s&&("xml"!==n||s!==sA.XML)&&s!==sA.XMLNS){for(var r=i.length;r--;){var a=i[r];if(a.prefix===n)return a.namespace!==s}return 1}}function ry(e,t,i){e.push(" ",t,'="',i.replace(/[<>&"\t\n\r]/g,sV),'"')}function rv(e,t,i,n,s){if(s=s||[],n){if(!(e=n(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case 1:var r=e.attributes,a=r.length,o=e.firstChild,l=e.tagName,u=l;if(!(i=sA.isHTML(e.namespaceURI)||i)&&!e.prefix&&e.namespaceURI){for(var d,h=0;h<r.length;h++)if("xmlns"===r.item(h).name){d=r.item(h).value;break}if(!d){for(var c=s.length-1;0<=c;c--)if(""===(p=s[c]).prefix&&p.namespace===e.namespaceURI){d=p.namespace;break}}if(d!==e.namespaceURI){for(var p,c=s.length-1;0<=c;c--)if((p=s[c]).namespace===e.namespaceURI){p.prefix&&(u=p.prefix+":"+l);break}}}t.push("<",u);for(var m=0;m<a;m++)"xmlns"==(f=r.item(m)).prefix?s.push({prefix:f.localName,namespace:f.value}):"xmlns"==f.nodeName&&s.push({prefix:"",namespace:f.value});for(var f,g,y,m=0;m<a;m++)rg(f=r.item(m),0,s)&&(ry(t,(g=f.prefix||"")?"xmlns:"+g:"xmlns",y=f.namespaceURI),s.push({prefix:g,namespace:y})),rv(f,t,i,n,s);if(l===u&&rg(e,0,s)&&(ry(t,(g=e.prefix||"")?"xmlns:"+g:"xmlns",y=e.namespaceURI),s.push({prefix:g,namespace:y})),o||i&&!/^(?:meta|link|img|br|hr|input)$/i.test(l)){if(t.push(">"),i&&/^script$/i.test(l))for(;o;)o.data?t.push(o.data):rv(o,t,i,n,s.slice()),o=o.nextSibling;else for(;o;)rv(o,t,i,n,s.slice()),o=o.nextSibling;t.push("</",u,">")}else t.push("/>");return;case 9:case 11:for(o=e.firstChild;o;)rv(o,t,i,n,s.slice()),o=o.nextSibling;return;case 2:return ry(t,e.name,e.value);case 3:return t.push(e.data.replace(/[<&>]/g,sV));case 4:return t.push("<![CDATA[",e.data,"]]>");case 8:return t.push("<!--",e.data,"-->");case 10:var v=e.publicId,b=e.systemId;return t.push("<!DOCTYPE ",e.name),void(v?(t.push(" PUBLIC ",v),b&&"."!=b&&t.push(" ",b),t.push(">")):b&&"."!=b?t.push(" SYSTEM ",b,">"):((v=e.internalSubset)&&t.push(" [",v,"]"),t.push(">")));case 7:return t.push("<?",e.target," ",e.data,"?>");case 5:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function r8(e,t,i){e[t]=i}n0.NOT_SUPPORTED_ERR=(sM[9]="Not supported",9),n0.INUSE_ATTRIBUTE_ERR=(sM[10]="Attribute in use",10),n0.INVALID_STATE_ERR=(sM[11]="Invalid state",11),n0.SYNTAX_ERR=(sM[12]="Syntax error",12),n0.INVALID_MODIFICATION_ERR=(sM[13]="Invalid modification",13),n0.NAMESPACE_ERR=(sM[14]="Invalid namespace",14),n0.INVALID_ACCESS_ERR=(sM[15]="Invalid access",15),sU.prototype=Error.prototype,sR(n0,sU),s2.prototype={length:0,item:function(e){return this[e]||null},toString:function(e,t){for(var i=[],n=0;n<this.length;n++)rv(this[n],i,e,t);return i.join("")},filter:function(e){return Array.prototype.filter.call(this,e)},indexOf:function(e){return Array.prototype.indexOf.call(this,e)}},s1.prototype.item=function(e){return s4(this),this[e]},sN(s1,s2),s6.prototype={length:0,item:s2.prototype.item,getNamedItem:function(e){for(var t=this.length;t--;){var i=this[t];if(i.nodeName==e)return i}},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement)throw new sU(10);return t=this.getNamedItem(e.nodeName),sj(this._ownerElement,this,e,t),t},setNamedItemNS:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement)throw new sU(10);return t=this.getNamedItemNS(e.namespaceURI,e.localName),sj(this._ownerElement,this,e,t),t},removeNamedItem:function(e){return e=this.getNamedItem(e),s5(this._ownerElement,this,e),e},removeNamedItemNS:function(e,t){return e=this.getNamedItemNS(e,t),s5(this._ownerElement,this,e),e},getNamedItemNS:function(e,t){for(var i=this.length;i--;){var n=this[i];if(n.localName==t&&n.namespaceURI==e)return n}return null}},sq.prototype={hasFeature:function(e,t){return!0},createDocument:function(e,t,i){var n=new s9;return n.implementation=this,n.childNodes=new s2,n.doctype=i||null,i&&n.appendChild(i),t&&(i=n.createElementNS(e,t),n.appendChild(i)),n},createDocumentType:function(e,t,i){var n=new rl;return n.name=e,n.nodeName=e,n.publicId=t||"",n.systemId=i||"",n}},sH.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(e,t){return rt(this,e,t)},replaceChild:function(e,t){rt(this,e,t,re),t&&this.removeChild(t)},removeChild:function(e){return sG(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(e){return function e(t,i,n){var s,r=new i.constructor;for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&"object"!=typeof(s=i[a])&&s!=r[a]&&(r[a]=s);switch(i.childNodes&&(r.childNodes=new s2),r.ownerDocument=t,r.nodeType){case 1:var o=i.attributes,l=r.attributes=new s6,u=o.length;l._ownerElement=r;for(var d=0;d<u;d++)r.setAttributeNode(e(t,o.item(d),!0));break;case 2:n=!0}if(n)for(var h=i.firstChild;h;)r.appendChild(e(t,h,n)),h=h.nextSibling;return r}(this.ownerDocument||this,this,e)},normalize:function(){for(var e=this.firstChild;e;){var t=e.nextSibling;t&&3==t.nodeType&&3==e.nodeType?(this.removeChild(t),e.appendData(t.data)):(e.normalize(),e=t)}},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},hasAttributes:function(){return 0<this.attributes.length},lookupPrefix:function(e){for(var t=this;t;){var i=t._nsMap;if(i){for(var n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&i[n]===e)return n}t=2==t.nodeType?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var i=t._nsMap;if(i&&Object.prototype.hasOwnProperty.call(i,e))return i[e];t=2==t.nodeType?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},sR(nP,sH),sR(nP,sH.prototype),s9.prototype={nodeName:"#document",nodeType:9,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(11==e.nodeType)for(var i=e.firstChild;i;){var n=i.nextSibling;this.insertBefore(i,t),i=n}else rt(this,e,t),null===(e.ownerDocument=this).documentElement&&1===e.nodeType&&(this.documentElement=e);return e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),sG(this,e)},replaceChild:function(e,t){rt(this,e,t,re),e.ownerDocument=this,t&&this.removeChild(t),sK(e)&&(this.documentElement=e)},importNode:function(e,t){return function e(t,i,n){var s;switch(i.nodeType){case 1:(s=i.cloneNode(!1)).ownerDocument=t;case 11:break;case 2:n=!0}if((s=s||i.cloneNode(!1)).ownerDocument=t,s.parentNode=null,n)for(var r=i.firstChild;r;)s.appendChild(e(t,r,n)),r=r.nextSibling;return s}(this,e,t)},getElementById:function(e){var t=null;return s7(this.documentElement,function(i){if(1==i.nodeType&&i.getAttribute("id")==e)return t=i,!0}),t},getElementsByClassName:function(e){var t=sO(e);return new s1(this,function(i){var n=[];return 0<t.length&&s7(i.documentElement,function(s){var r,a,o;s!==i&&1===s.nodeType&&(r=s.getAttribute("class"))&&((a=e===r)||(r=sO(r),a=t.every((o=r,function(e){return o&&-1!==o.indexOf(e)}))),a)&&n.push(s)}),n})},createElement:function(e){var t=new ri;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new s2,(t.attributes=new s6)._ownerElement=t},createDocumentFragment:function(){var e=new rc;return e.ownerDocument=this,e.childNodes=new s2,e},createTextNode:function(e){var t=new rr;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new ra;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new ro;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var i=new rp;return i.ownerDocument=this,i.tagName=i.target=e,i.nodeValue=i.data=t,i},createAttribute:function(e){var t=new rn;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new rh;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var i=new ri,n=t.split(":"),s=i.attributes=new s6;return i.childNodes=new s2,i.ownerDocument=this,i.nodeName=t,i.tagName=t,i.namespaceURI=e,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=t,s._ownerElement=i},createAttributeNS:function(e,t){var i=new rn,n=t.split(":");return i.ownerDocument=this,i.nodeName=t,i.name=t,i.namespaceURI=e,i.specified=!0,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=t,i}},sN(s9,sH),s9.prototype.getElementsByTagName=(ri.prototype={nodeType:1,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){return(e=this.getAttributeNode(e))&&e.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){(e=this.ownerDocument.createAttribute(e)).value=e.nodeValue=""+t,this.setAttributeNode(e)},removeAttribute:function(e){(e=this.getAttributeNode(e))&&this.removeAttributeNode(e)},appendChild:function(e){var t;return 11===e.nodeType?this.insertBefore(e,null):(t=this,e.parentNode&&e.parentNode.removeChild(e),e.parentNode=t,e.previousSibling=t.lastChild,e.nextSibling=null,e.previousSibling?e.previousSibling.nextSibling=e:t.firstChild=e,t.lastChild=e,sz(t.ownerDocument,t,e),e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){(e=this.getAttributeNodeNS(e,t))&&this.removeAttributeNode(e)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){return(e=this.getAttributeNodeNS(e,t))&&e.value||""},setAttributeNS:function(e,t,i){(e=this.ownerDocument.createAttributeNS(e,t)).value=e.nodeValue=""+i,this.setAttributeNode(e)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new s1(this,function(t){var i=[];return s7(t,function(n){n===t||1!=n.nodeType||"*"!==e&&n.tagName!=e||i.push(n)}),i})},getElementsByTagNameNS:function(e,t){return new s1(this,function(i){var n=[];return s7(i,function(s){s===i||1!==s.nodeType||"*"!==e&&s.namespaceURI!==e||"*"!==t&&s.localName!=t||n.push(s)}),n})}}).getElementsByTagName,s9.prototype.getElementsByTagNameNS=ri.prototype.getElementsByTagNameNS,sN(ri,sH),rn.prototype.nodeType=2,sN(rn,sH),rs.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw Error(sM[s3])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,i){var n=this.data.substring(0,e),e=this.data.substring(e+t);this.nodeValue=this.data=i=n+i+e,this.length=i.length}},sN(rs,sH),rr.prototype={nodeName:"#text",nodeType:3,splitText:function(e){var t=(i=this.data).substring(e),i=i.substring(0,e),e=(this.data=this.nodeValue=i,this.length=i.length,this.ownerDocument.createTextNode(t));return this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling),e}},sN(rr,rs),ra.prototype={nodeName:"#comment",nodeType:8},sN(ra,rs),ro.prototype={nodeName:"#cdata-section",nodeType:4},sN(ro,rs),rl.prototype.nodeType=10,sN(rl,sH),ru.prototype.nodeType=12,sN(ru,sH),rd.prototype.nodeType=6,sN(rd,sH),rh.prototype.nodeType=5,sN(rh,sH),rc.prototype.nodeName="#document-fragment",rc.prototype.nodeType=11,sN(rc,sH),rp.prototype.nodeType=7,sN(rp,sH),rm.prototype.serializeToString=function(e,t,i){return rf.call(e,t,i)},sH.prototype.toString=rf;try{Object.defineProperty&&(Object.defineProperty(s1.prototype,"length",{get:function(){return s4(this),this.$$length}}),Object.defineProperty(sH.prototype,"textContent",{get:function(){return function e(t){switch(t.nodeType){case 1:case 11:var i=[];for(t=t.firstChild;t;)7!==t.nodeType&&8!==t.nodeType&&i.push(e(t)),t=t.nextSibling;return i.join("");default:return t.nodeValue}}(this)},set:function(e){switch(this.nodeType){case 1:case 11:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),r8=function(e,t,i){e["$$"+t]=i})}catch(rb){}var nE={DocumentType:rl,DOMException:sU,DOMImplementation:sq,Element:ri,Node:sH,NodeList:s2,XMLSerializer:rm},r$=ti(function(e,t){var i=sI.freeze;t.XML_ENTITIES=i({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),t.HTML_ENTITIES=i({lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"\xc0",Aacute:"\xc1",Acirc:"\xc2",Atilde:"\xc3",Auml:"\xc4",Aring:"\xc5",AElig:"\xc6",Ccedil:"\xc7",Egrave:"\xc8",Eacute:"\xc9",Ecirc:"\xca",Euml:"\xcb",Igrave:"\xcc",Iacute:"\xcd",Icirc:"\xce",Iuml:"\xcf",ETH:"\xd0",Ntilde:"\xd1",Ograve:"\xd2",Oacute:"\xd3",Ocirc:"\xd4",Otilde:"\xd5",Ouml:"\xd6",Oslash:"\xd8",Ugrave:"\xd9",Uacute:"\xda",Ucirc:"\xdb",Uuml:"\xdc",Yacute:"\xdd",THORN:"\xde",szlig:"\xdf",agrave:"\xe0",aacute:"\xe1",acirc:"\xe2",atilde:"\xe3",auml:"\xe4",aring:"\xe5",aelig:"\xe6",ccedil:"\xe7",egrave:"\xe8",eacute:"\xe9",ecirc:"\xea",euml:"\xeb",igrave:"\xec",iacute:"\xed",icirc:"\xee",iuml:"\xef",eth:"\xf0",ntilde:"\xf1",ograve:"\xf2",oacute:"\xf3",ocirc:"\xf4",otilde:"\xf5",ouml:"\xf6",oslash:"\xf8",ugrave:"\xf9",uacute:"\xfa",ucirc:"\xfb",uuml:"\xfc",yacute:"\xfd",thorn:"\xfe",yuml:"\xff",nbsp:"\xa0",iexcl:"\xa1",cent:"\xa2",pound:"\xa3",curren:"\xa4",yen:"\xa5",brvbar:"\xa6",sect:"\xa7",uml:"\xa8",copy:"\xa9",ordf:"\xaa",laquo:"\xab",not:"\xac",shy:"\xad\xad",reg:"\xae",macr:"\xaf",deg:"\xb0",plusmn:"\xb1",sup2:"\xb2",sup3:"\xb3",acute:"\xb4",micro:"\xb5",para:"\xb6",middot:"\xb7",cedil:"\xb8",sup1:"\xb9",ordm:"\xba",raquo:"\xbb",frac14:"\xbc",frac12:"\xbd",frac34:"\xbe",iquest:"\xbf",times:"\xd7",divide:"\xf7",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",euro:"€",trade:"™",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"}),t.entityMap=t.HTML_ENTITIES}),rT=(r$.XML_ENTITIES,r$.HTML_ENTITIES,r$.entityMap,sI.NAMESPACE),nD=/[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]/,nL=RegExp("[\\-\\.0-9"+nD.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),rw=RegExp("^"+nD.source+nL.source+"*(?::"+nD.source+nL.source+"*)?$"),r_=0,rS=1,rk=2,rE=3,rC=4,r0=5,rx=6,rI=7;function rP(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,rP)}function rA(){}function rL(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function rD(e,t,i){for(var n=e.tagName,s=null,r=e.length;r--;){var a=e[r],o=a.qName,l=a.value,o=0<(d=o.indexOf(":"))?(u=a.prefix=o.slice(0,d),h=o.slice(d+1),"xmlns"===u&&h):(u=null,"xmlns"===(h=o)&&"");a.localName=h,!1!==o&&(null==s&&(s={},rO(i,i={})),i[o]=s[o]=l,a.uri=rT.XMLNS,t.startPrefixMapping(o,l))}for(var u,r=e.length;r--;)(u=(a=e[r]).prefix)&&("xml"===u&&(a.uri=rT.XML),"xmlns"!==u)&&(a.uri=i[u||""]);var d,h=0<(d=n.indexOf(":"))?(u=e.prefix=n.slice(0,d),e.localName=n.slice(d+1)):(u=null,e.localName=n),c=e.uri=i[u||""];if(t.startElement(c,h,n,e),!e.closed)return e.currentNSMap=i,e.localNSMap=s,1;if(t.endElement(c,h,n),s)for(u in s)Object.prototype.hasOwnProperty.call(s,u)&&t.endPrefixMapping(u)}function rO(e,t){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}function rR(){this.attributeNames={}}(rP.prototype=Error()).name=rP.name,rA.prototype={parse:function(e,t,i){var n=this.domBuilder;n.startDocument(),rO(t,t={}),function(e,t,i,n,s){function r(e){var t=e.slice(1,-1);return Object.hasOwnProperty.call(i,t)?i[t]:"#"===t.charAt(0)?65535<(t=parseInt(t.substr(1).replace("x","0x")))?String.fromCharCode(55296+((t-=65536)>>10),56320+(1023&t)):String.fromCharCode(t):(s.error("entity not found:"+e),e)}function a(t){var i;m<t&&(i=e.substring(m,t).replace(/&#?\w+;/g,r),h&&o(m),n.characters(i,0,t-m),m=t)}function o(t,i){for(;u<=t&&(i=d.exec(e));)u=(l=i.index)+i[0].length,h.lineNumber++;h.columnNumber=t-l+1}for(var l=0,u=0,d=/.*(?:\r\n?|\n)|.*$/g,h=n.locator,c=[{currentNSMap:t}],p={},m=0;;){try{var f,g,y=e.indexOf("<",m);if(y<0)return e.substr(m).match(/^\s*$/)||(g=(f=n.doc).createTextNode(e.substr(m)),f.appendChild(g),n.currentElement=g);switch(m<y&&a(y),e.charAt(y+1)){case"/":var v=e.indexOf(">",y+3),b=e.substring(y+2,v).replace(/[ \t\n\r]+$/g,""),$=c.pop(),T=(v<0?(b=e.substring(y+2).replace(/[\s<].*/,""),s.error("end tag name: "+b+" is not complete:"+$.tagName),v=y+1+b.length):b.match(/\s</)&&(b=b.replace(/[\s<].*/,""),s.error("end tag name: "+b+" maybe not complete"),v=y+1+b.length),$.localNSMap),w=$.tagName==b;if(w||$.tagName&&$.tagName.toLowerCase()==b.toLowerCase()){if(n.endElement($.uri,$.localName,b),T)for(var _ in T)Object.prototype.hasOwnProperty.call(T,_)&&n.endPrefixMapping(_);w||s.fatalError("end tag name: "+b+" is not match the current start tagName:"+$.tagName)}else c.push($);v++;break;case"?":h&&o(y),v=function(e,t,i){var n=e.indexOf("?>",t);return n&&(e=e.substring(t,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/))?(e[0].length,i.processingInstruction(e[1],e[2]),n+2):-1}(e,y,n);break;case"!":h&&o(y),v=function(e,t,i,n){if("-"===e.charAt(t+2))return"-"===e.charAt(t+3)?(r=e.indexOf("-->",t+4),t<r?(i.comment(e,t+4,r-t-4),r+3):(n.error("Unclosed comment"),-1)):-1;if("CDATA["==e.substr(t+3,6))return r=e.indexOf("]]>",t+9),i.startCDATA(),i.characters(e,t+9,r-t-9),i.endCDATA(),r+3;var s,n=function(e,t){var i,n=[],s=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(s.lastIndex=t,s.exec(e);i=s.exec(e);)if(n.push(i),i[1])return n}(e,t),r=n.length;return 1<r&&/!doctype/i.test(n[0][0])?(e=n[1][0],s=t=!1,3<r&&(/^public$/i.test(n[2][0])?(t=n[3][0],s=4<r&&n[4][0]):/^system$/i.test(n[2][0])&&(s=n[3][0])),n=n[r-1],i.startDTD(e,t,s),i.endDTD(),n.index+n[0].length):-1}(e,y,n,s);break;default:h&&o(y);var S=new rR,k=c[c.length-1].currentNSMap,v=function(e,t,i,n,s,r){function a(e,t,n){i.attributeNames.hasOwnProperty(e)&&r.fatalError("Attribute "+e+" redefined"),i.addValue(e,t.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,s),n)}for(var o,l=++t,u=r_;;){var d=e.charAt(l);switch(d){case"=":if(u===rS)o=e.slice(t,l);else if(u!==rk)throw Error("attribute equal must after attrName");u=rE;break;case"'":case'"':if(u===rE||u===rS){if(u===rS&&(r.warning('attribute value must after "="'),o=e.slice(t,l)),t=l+1,!(0<(l=e.indexOf(d,t))))throw Error("attribute value no end '"+d+"' match");h=e.slice(t,l),a(o,h,t-1)}else{if(u!=rC)throw Error('attribute value must after "="');h=e.slice(t,l),a(o,h,t),r.warning('attribute "'+o+'" missed start quot('+d+")!!"),t=l+1}u=r0;break;case"/":switch(u){case r_:i.setTagName(e.slice(t,l));case r0:case rx:case rI:u=rI,i.closed=!0;case rC:case rS:case rk:break;default:throw Error("attribute invalid close char('/')")}break;case"":return r.error("unexpected end of input"),u==r_&&i.setTagName(e.slice(t,l)),l;case">":switch(u){case r_:i.setTagName(e.slice(t,l));case r0:case rx:case rI:break;case rC:case rS:"/"===(h=e.slice(t,l)).slice(-1)&&(i.closed=!0,h=h.slice(0,-1));case rk:u===rk&&(h=o),u==rC?(r.warning('attribute "'+h+'" missed quot(")!'),a(o,h,t)):(rT.isHTML(n[""])&&h.match(/^(?:disabled|checked|selected)$/i)||r.warning('attribute "'+h+'" missed value!! "'+h+'" instead!!'),a(h,h,t));break;case rE:throw Error("attribute value missed!!")}return l;case"\x80":d=" ";default:if(d<=" ")switch(u){case r_:i.setTagName(e.slice(t,l)),u=rx;break;case rS:o=e.slice(t,l),u=rk;break;case rC:var h=e.slice(t,l);r.warning('attribute "'+h+'" missed quot(")!!'),a(o,h,t);case r0:u=rx}else switch(u){case rk:i.tagName,rT.isHTML(n[""])&&o.match(/^(?:disabled|checked|selected)$/i)||r.warning('attribute "'+o+'" missed value!! "'+o+'" instead2!!'),a(o,o,t),t=l,u=rS;break;case r0:r.warning('attribute space is required"'+o+'"!!');case rx:u=rS,t=l;break;case rE:u=rC,t=l;break;case rI:throw Error("elements closed character '/' and '>' must be connected to")}}l++}}(e,y,S,k,r,s),E=S.length;if(!S.closed&&function(e,t,i,n){var s=n[i];return null==s&&((s=e.lastIndexOf("</"+i+">"))<t&&(s=e.lastIndexOf("</"+i)),n[i]=s),s<t}(e,v,S.tagName,p)&&(S.closed=!0,i.nbsp||s.warning("unclosed xml attribute")),h&&E){for(var C=rL(h,{}),x=0;x<E;x++){var I=S[x];o(I.offset),I.locator=rL(h,{})}n.locator=C,rD(S,n,k)&&c.push(S),n.locator=h}else rD(S,n,k)&&c.push(S);rT.isHTML(S.uri)&&!S.closed?v=function(e,t,i,n,s){if(/^(?:script|textarea)$/i.test(i)){var r=e.indexOf("</"+i+">",t),e=e.substring(t+1,r);if(/[&<]/.test(e))return/^script$/i.test(i)||(e=e.replace(/&#?\w+;/g,n)),s.characters(e,0,e.length),r}return t+1}(e,v,S.tagName,r,n):v++}}catch(P){if(P instanceof rP)throw P;s.error("element parse error: "+P),v=-1}m<v?m=v:a(Math.max(y,m)+1)}}(e,t,i,n,this.errorHandler),n.endDocument()}},rR.prototype={setTagName:function(e){if(!rw.test(e))throw Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,i){if(!rw.test(e))throw Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:i}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}};var nA={XMLReader:rA,ParseError:rP},rN=nE.DOMImplementation,rM=sI.NAMESPACE,r3=nA.ParseError,rB=nA.XMLReader;function rU(e){return e.replace(/\r[\n\u0085]/g,"\n").replace(/[\r\u0085\u2028]/g,"\n")}function r2(e){this.options=e||{locator:{}}}function r1(){this.cdata=!1}function r4(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function r6(e,t,i){return"string"==typeof e?e.substr(t,i):e.length>=t+i||t?new java.lang.String(e,t,i)+"":e}function rF(e,t){(e.currentElement||e.doc).appendChild(t)}r2.prototype.parseFromString=function(e,t){var i=this.options,n=new rB,s=i.domBuilder||new r1,r=i.errorHandler,a=i.locator,o=i.xmlns||{},t=/\/x?html?$/.test(t),l=t?r$.HTML_ENTITIES:r$.XML_ENTITIES,r=(a&&s.setDocumentLocator(a),n.errorHandler=function(e,t,i){if(!e){if(t instanceof r1)return t;e=t}var n={},s=e instanceof Function;function r(t){var r=e[t];!r&&s&&(r=2==e.length?function(i){e(t,i)}:e),n[t]=r?function(e){r("[xmldom "+t+"] "+e+function e(t){if(t)return"\n@"+(t.systemId||"")+"#[line:"+t.lineNumber+",col:"+t.columnNumber+"]"}(i))}:function(){}}return i=i||{},r("warning"),r("error"),r("fatalError"),n}(r,s,a),n.domBuilder=i.domBuilder||s,t&&(o[""]=rM.HTML),o.xml=o.xml||rM.XML,i.normalizeLineEndings||rU);return e&&"string"==typeof e?n.parse(r(e),o,l):n.errorHandler.error("invalid doc source"),s.doc},r1.prototype={startDocument:function(){this.doc=(new rN).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,i,n){var s=this.doc,r=s.createElementNS(e,i||t),a=n.length;rF(this,r),this.currentElement=r,this.locator&&r4(this.locator,r);for(var o=0;o<a;o++){var e=n.getURI(o),l=n.getValue(o),i=n.getQName(o),u=s.createAttributeNS(e,i);this.locator&&r4(n.getLocator(o),u),u.value=u.nodeValue=l,r.setAttributeNode(u)}},endElement:function(e,t,i){var n=this.currentElement;n.tagName,this.currentElement=n.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){e=this.doc.createProcessingInstruction(e,t),this.locator&&r4(this.locator,e),rF(this,e)},ignorableWhitespace:function(e,t,i){},characters:function(e,t,i){var n;(e=r6.apply(this,arguments))&&(n=this.cdata?this.doc.createCDATASection(e):this.doc.createTextNode(e),this.currentElement?this.currentElement.appendChild(n):/^\s*$/.test(e)&&this.doc.appendChild(n),this.locator)&&r4(this.locator,n)},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){(this.locator=e)&&(e.lineNumber=0)},comment:function(e,t,i){e=r6.apply(this,arguments),e=this.doc.createComment(e),this.locator&&r4(this.locator,e),rF(this,e)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,i){var n=this.doc.implementation;n&&n.createDocumentType&&(n=n.createDocumentType(e,t,i),this.locator&&r4(this.locator,n),rF(this,n),this.doc.doctype=n)},warning:function(e){},error:function(e){},fatalError:function(e){throw new r3(e,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(e){r1.prototype[e]=function(){return null}});var rj=r2;/*! @name mpd-parser @version 1.0.1 @license Apache-2.0 */ let r5=e=>!!e&&"object"==typeof e,rq=(...e)=>e.reduce((e,t)=>("object"==typeof t&&Object.keys(t).forEach(i=>{Array.isArray(e[i])&&Array.isArray(t[i])?e[i]=e[i].concat(t[i]):r5(e[i])&&r5(t[i])?e[i]=rq(e[i],t[i]):e[i]=t[i]}),e),{}),rH=e=>Object.keys(e).map(t=>e[t]),rV=e=>e.reduce((e,t)=>e.concat(t),[]),r7=e=>{if(!e.length)return[];var t=[];for(let i=0;i<e.length;i++)t.push(e[i]);return t};var r9={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",MISSING_SEGMENT_INFORMATION:"MISSING_SEGMENT_INFORMATION",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"};let rW=({baseUrl:e="",source:t="",range:i="",indexRange:n=""})=>{if(e={uri:t,resolvedUri:sh(e||"",t)},i||n){t=(i||n).split("-");let s=window.BigInt?window.BigInt(t[0]):parseInt(t[0],10),r=window.BigInt?window.BigInt(t[1]):parseInt(t[1],10);s<Number.MAX_SAFE_INTEGER&&"bigint"==typeof s&&(s=Number(s)),r<Number.MAX_SAFE_INTEGER&&"bigint"==typeof r&&(r=Number(r));let a;"bigint"==typeof(a="bigint"==typeof r||"bigint"==typeof s?window.BigInt(r)-window.BigInt(s)+window.BigInt(1):r-s+1)&&a<Number.MAX_SAFE_INTEGER&&(a=Number(a)),e.byterange={length:a,offset:s}}return e},rz=e=>(e&&"number"!=typeof e&&(e=parseInt(e,10)),isNaN(e)?null:e),rG={static(e){var{duration:t,timescale:i=1,sourceDuration:n,periodDuration:s}=e,e=rz(e.endNumber),t=t/i;return"number"==typeof e?{start:0,end:e}:"number"==typeof s?{start:0,end:s/t}:{start:0,end:n/t}},dynamic(e){var{NOW:t,clientOffset:i,availabilityStartTime:n,timescale:s=1,duration:r,periodStart:a=0,minimumUpdatePeriod:o=0,timeShiftBufferDepth:l=1/0}=e,e=rz(e.endNumber),t=(t+i)/1e3,i=n+a,n=Math.ceil((t+o-i)*s/r),a=Math.floor((t-i-l)*s/r),o=Math.floor((t-i)*s/r);return{start:Math.max(0,a),end:"number"==typeof e?e:Math.min(n,o)}}},rX=e=>{var t,{type:i,duration:n,timescale:s=1,periodDuration:r,sourceDuration:a}=e,{start:o,end:l}=rG[i](e),o=((e,t)=>{var i=[];for(let n=e;n<t;n++)i.push(n);return i})(o,l).map((t=e,e=>{var{duration:i,timescale:n=1,periodStart:s,startNumber:r=1}=t;return{number:r+e,duration:i/n,timeline:s,time:e*i}}));return"static"===i&&(o[l=o.length-1].duration=("number"==typeof r?r:a)-n/s*l),o},rK=e=>{var{baseUrl:t,initialization:i={},sourceDuration:n,indexRange:s="",periodStart:r,presentationTime:a,number:o=0,duration:l}=e;if(t)return i=rW({baseUrl:t,source:i.sourceURL,range:i.range}),(t=rW({baseUrl:t,source:t,indexRange:s})).map=i,l?(s=rX(e)).length&&(t.duration=s[0].duration,t.timeline=s[0].timeline):n&&(t.duration=n,t.timeline=r),t.presentationTime=a||r,t.number=o,[t];throw Error(r9.NO_BASE_URL)},rY=(e,t,i)=>{var n=e.sidx.map||null,s=e.sidx.duration,r=e.timeline||0,a=e.sidx.byterange,a=a.offset+a.length,o=t.timescale,l=t.references.filter(e=>1!==e.referenceType),u=[],d=e.endList?"static":"dynamic",h=e.sidx.timeline;let c=h,p=e.mediaSequence||0,m;m="bigint"==typeof t.firstOffset?window.BigInt(a)+t.firstOffset:a+t.firstOffset;for(let f=0;f<l.length;f++){var g=t.references[f],y=g.referencedSize,g=g.subsegmentDuration;let v;v="bigint"==typeof m?m+window.BigInt(y)-window.BigInt(1):m+y-1;var b=m+"-"+v,b={baseUrl:i,timescale:o,timeline:r,periodStart:h,presentationTime:c,number:p,duration:g,sourceDuration:s,indexRange:b,type:d},b=rK(b)[0];n&&(b.map=n),u.push(b),"bigint"==typeof m?m+=window.BigInt(y):m+=y,c+=g/o,p++}return e.segments=u,e},rQ=["AUDIO","SUBTITLES"],rZ=e=>{var t;return t=({timeline:e})=>e,rH(e.reduce((e,i)=>(i.forEach(i=>{e[t(i)]=i}),e),{})).sort((e,t)=>e.timeline>t.timeline?1:-1)},rJ=e=>{var t,i;let n=[];return t=e,e=rQ,i=(e,t,i,s)=>{n=n.concat(e.playlists||[])},e.forEach(function(e){for(var n in t.mediaGroups[e])for(var s in t.mediaGroups[e][n])i(t.mediaGroups[e][n][s],e,n,s)}),n},ae=({playlist:e,mediaSequence:t})=>{e.mediaSequence=t,e.segments.forEach((t,i)=>{t.number=e.mediaSequence+i})},at=({oldManifest:e,newManifest:t})=>{var i,n,s=e.playlists.concat(rJ(e)),r=t.playlists.concat(rJ(t));return t.timelineStarts=rZ([e.timelineStarts,t.timelineStarts]),{oldPlaylists:i,newPlaylists:e,timelineStarts:n}={oldPlaylists:s,newPlaylists:r,timelineStarts:t.timelineStarts},e.forEach(e=>{e.discontinuitySequence=n.findIndex(function({timeline:t}){return t===e.timeline});var t=((e,t)=>{for(let i=0;i<e.length;i++)if(e[i].attributes.NAME===t)return e[i];return null})(i,e.attributes.NAME);if(t&&!e.sidx){let s=e.segments[0];var r=t.segments.findIndex(function(e){return Math.abs(e.presentationTime-s.presentationTime)<1/60});-1===r?(ae({playlist:e,mediaSequence:t.mediaSequence+t.segments.length}),e.segments[0].discontinuity=!0,e.discontinuityStarts.unshift(0),(!t.segments.length&&e.timeline>t.timeline||t.segments.length&&e.timeline>t.segments[t.segments.length-1].timeline)&&e.discontinuitySequence--):(t.segments[r].discontinuity&&!s.discontinuity&&(s.discontinuity=!0,e.discontinuityStarts.unshift(0),e.discontinuitySequence--),ae({playlist:e,mediaSequence:t.segments[r].number}))}}),t},ai=e=>{var t;let i;return e&&e.uri+"-"+(i="bigint"==typeof(t=e.byterange).offset||"bigint"==typeof t.length?window.BigInt(t.offset)+window.BigInt(t.length)-window.BigInt(1):t.offset+t.length-1,t.offset+"-"+i)},an=e=>rH(e.reduce((e,t)=>{var i=t.attributes.id+(t.attributes.lang||"");return e[i]?(t.segments&&(t.segments[0]&&(t.segments[0].discontinuity=!0),e[i].segments.push(...t.segments)),t.attributes.contentProtection&&(e[i].attributes.contentProtection=t.attributes.contentProtection)):(e[i]=t,e[i].attributes.timelineStarts=[]),e[i].attributes.timelineStarts.push({start:t.attributes.periodStart,timeline:t.attributes.periodStart}),e},{})).map(e=>{var t,i;return e.discontinuityStarts=(t=e.segments||[],i="discontinuity",t.reduce((e,t,n)=>(t[i]&&e.push(n),e),[])),e}),as=(e,t)=>{var i=ai(e.sidx),t=i&&t[i]&&t[i].sidx;return t&&rY(e,t,e.sidx.resolvedUri),e},ar=(e,t={})=>e.reduce((e,i)=>{var n,s,r,a,o=i.attributes.lang||"text";return e[o]||(e[o]={language:o,default:!1,autoselect:!1,playlists:[],uri:""}),e[o].playlists.push(as(({attributes:o,segments:i,mediaSequence:n,discontinuityStarts:s,discontinuitySequence:r}=i,void 0===i&&(i=[{uri:o.baseUrl,timeline:o.periodStart,resolvedUri:o.baseUrl||"",duration:o.sourceDuration,number:0}],o.duration=o.sourceDuration),a={NAME:o.id,BANDWIDTH:o.bandwidth,"PROGRAM-ID":1},o.codecs&&(a.CODECS=o.codecs),{attributes:a,uri:"",endList:"static"===o.type,timeline:o.periodStart,resolvedUri:o.baseUrl||"",targetDuration:o.duration,timelineStarts:o.timelineStarts,discontinuityStarts:s,discontinuitySequence:r,mediaSequence:n,segments:i}),t)),e},{}),aa=({attributes:e,segments:t,sidx:i,discontinuityStarts:n})=>(n={attributes:{NAME:e.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:e.width,height:e.height},CODECS:e.codecs,BANDWIDTH:e.bandwidth,"PROGRAM-ID":1},uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:"",targetDuration:e.duration,discontinuityStarts:n,timelineStarts:e.timelineStarts,segments:t},e.frameRate&&(n.attributes["FRAME-RATE"]=e.frameRate),e.contentProtection&&(n.contentProtection=e.contentProtection),i&&(n.sidx=i),n),ao=({attributes:e})=>"video/mp4"===e.mimeType||"video/webm"===e.mimeType||"video"===e.contentType,al=({attributes:e})=>"audio/mp4"===e.mimeType||"audio/webm"===e.mimeType||"audio"===e.contentType,au=({attributes:e})=>"text/vtt"===e.mimeType||"text"===e.contentType,ad=e=>e?Object.keys(e).reduce((t,i)=>(i=e[i],t.concat(i.playlists)),[]):[],ah=({dashPlaylists:e,locations:t,sidxMapping:i={},previousManifest:n})=>{var s,r,a,o,l,u,d,h;return e.length?({sourceDuration:a,type:l,suggestedPresentationDelay:u,minimumUpdatePeriod:o}=e[0].attributes,s=an(e.filter(ao)).map(aa),d=an(e.filter(al)),r=an(e.filter(au)),e=e.map(e=>e.attributes.captionServices).filter(Boolean),a={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:a,playlists:((e,t={})=>{if(Object.keys(t).length)for(let i in e)e[i]=as(e[i],t);return e})(s,i)},0<=o&&(a.minimumUpdatePeriod=1e3*o),t&&(a.locations=t),"dynamic"===l&&(a.suggestedPresentationDelay=u),o=0===a.playlists.length,t=d.length?((e,t={},i)=>{let n;return e=e.reduce((e,s)=>{var r=s.attributes.role&&s.attributes.role.value||"",a=s.attributes.lang||"";let o=s.attributes.label||"main";return e[o=a&&!s.attributes.label?s.attributes.lang+(r?` (${r})`:""):o]||(e[o]={language:a,autoselect:!0,default:"main"===r,playlists:[],uri:""}),a=as((({attributes:e,segments:t,sidx:i,mediaSequence:n,discontinuitySequence:s,discontinuityStarts:r},a)=>(s={attributes:{NAME:e.id,BANDWIDTH:e.bandwidth,CODECS:e.codecs,"PROGRAM-ID":1},uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:"",targetDuration:e.duration,discontinuitySequence:s,discontinuityStarts:r,timelineStarts:e.timelineStarts,mediaSequence:n,segments:t},e.contentProtection&&(s.contentProtection=e.contentProtection),i&&(s.sidx=i),a&&(s.attributes.AUDIO="audio",s.attributes.SUBTITLES="subs"),s))(s,i),t),e[o].playlists.push(a),void 0===n&&"main"===r&&((n=s).default=!0),e},{}),n||(e[Object.keys(e)[0]].default=!0),e})(d,i,o):null,l=r.length?ar(r,i):null,d=(u=s.concat(ad(t),ad(l))).map(({timelineStarts:e})=>e),a.timelineStarts=rZ(d),h=a.timelineStarts,u.forEach(e=>{e.mediaSequence=0,e.discontinuitySequence=h.findIndex(function({timeline:t}){return t===e.timeline}),e.segments&&e.segments.forEach((e,t)=>{e.number=t})}),t&&(a.mediaGroups.AUDIO.audio=t),l&&(a.mediaGroups.SUBTITLES.subs=l),e.length&&(a.mediaGroups["CLOSED-CAPTIONS"].cc=e.reduce((e,t)=>(t&&t.forEach(t=>{var{channel:i,language:n}=t;e[n]={autoselect:!1,default:!1,instreamId:i,language:n},t.hasOwnProperty("aspectRatio")&&(e[n].aspectRatio=t.aspectRatio),t.hasOwnProperty("easyReader")&&(e[n].easyReader=t.easyReader),t.hasOwnProperty("3D")&&(e[n]["3D"]=t["3D"])}),e),{})),n?at({oldManifest:n,newManifest:a}):a):{}},ac=(e,t)=>{var{type:i,minimumUpdatePeriod:n=0,media:s="",sourceDuration:r,timescale:a=1,startNumber:o=1,periodStart:l}=e,u=[];let d=-1;for(let h=0;h<t.length;h++){var c=t[h],p=c.d,m=c.r||0,c=c.t||0;d<0&&(d=c),c&&c>d&&(d=c);let f;f=m<0?(c=h+1)===t.length?"dynamic"===i&&0<n&&0<s.indexOf("$Number$")?((e,t,i)=>{var{NOW:e,clientOffset:n,availabilityStartTime:s,timescale:r=1,periodStart:a=0,minimumUpdatePeriod:o=0}=e;return Math.ceil((((e+n)/1e3+o-(s+a))*r-t)/i)})(e,d,p):(r*a-d)/p:(t[c].t-d)/p:m+1;var g=o+u.length+f;let y=o+u.length;for(;y<g;)u.push({number:y,duration:p/a,time:d,timeline:l}),d+=p,y++}return u},ap=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,am=(e,t)=>{var i;return e.replace(ap,(i=t,(e,t,n,s)=>"$$"===e?"$":void 0===i[t]?e:(e=""+i[t],"RepresentationID"===t||(s=n?parseInt(s,10):1)<=e.length?e:Array(s-e.length+1).join("0")+e)))},af=(e,t)=>{let i={RepresentationID:e.id,Bandwidth:e.bandwidth||0};var{initialization:n={sourceURL:"",range:""}}=e;let s=rW({baseUrl:e.baseUrl,source:am(n.sourceURL,i),range:n.range});return n=t,((t=e).duration||n?t.duration?rX(t):ac(t,n):[{number:t.startNumber||1,duration:t.sourceDuration,time:0,timeline:t.periodStart}]).map(t=>{i.Number=t.number,i.Time=t.time;var n=am(e.media||"",i),r=e.timescale||1,a=e.presentationTimeOffset||0,a=e.periodStart+(t.time-a)/r;return{uri:n,timeline:t.timeline,duration:t.duration,resolvedUri:sh(e.baseUrl||"",n),map:s,number:t.number,presentationTime:a}})},ag=(e,t)=>{let{duration:i,segmentUrls:n=[],periodStart:s}=e;if(!i&&!t||i&&t)throw Error(r9.SEGMENT_TIME_UNSPECIFIED);let r=n.map(t=>{var{baseUrl:i,initialization:n={}}=i=e,n=rW({baseUrl:i,source:n.sourceURL,range:n.range});return(i=rW({baseUrl:i,source:t.media,range:t.mediaRange})).map=n,i}),a;return i&&(a=rX(e)),(a=t?ac(e,t):a).map((t,i)=>{var n,a;if(r[i])return i=r[i],n=e.timescale||1,a=e.presentationTimeOffset||0,i.timeline=t.timeline,i.duration=t.duration,i.number=t.number,i.presentationTime=s+(t.time-a)/n,i}).filter(e=>e)},ay=({attributes:e,segmentInfo:t})=>{let i,n;t.template?(n=af,i=rq(e,t.template)):t.base?(n=rK,i=rq(e,t.base)):t.list&&(n=ag,i=rq(e,t.list));var s,r,a,e={attributes:e};return n&&(s=n(i,t.segmentTimeline),i.duration?({duration:r,timescale:a=1}=i,i.duration=r/a):s.length?i.duration=s.reduce((e,t)=>Math.max(e,Math.ceil(t.duration)),0):i.duration=0,e.attributes=i,e.segments=s,t.base)&&i.indexRange&&(e.sidx=s[0],e.segments=[]),e},av=e=>e.map(ay),a8=(e,t)=>r7(e.childNodes).filter(({tagName:e})=>e===t),ab=e=>e.textContent.trim(),a$=e=>{var t,i,n,s,r,e=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e);return e?([e,t,i,n,s,r]=e.slice(1),31536e3*parseFloat(e||0)+2592e3*parseFloat(t||0)+86400*parseFloat(i||0)+3600*parseFloat(n||0)+60*parseFloat(s||0)+parseFloat(r||0)):0},aT={mediaPresentationDuration:e=>a$(e),availabilityStartTime:e=>(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(e)&&(e+="Z"),Date.parse(e)/1e3),minimumUpdatePeriod:e=>a$(e),suggestedPresentationDelay:e=>a$(e),type:e=>e,timeShiftBufferDepth:e=>a$(e),start:e=>a$(e),width:e=>parseInt(e,10),height:e=>parseInt(e,10),bandwidth:e=>parseInt(e,10),frameRate:e=>parseFloat(e.split("/").reduce((e,t)=>e/t)),startNumber:e=>parseInt(e,10),timescale:e=>parseInt(e,10),presentationTimeOffset:e=>parseInt(e,10),duration(e){var t=parseInt(e,10);return isNaN(t)?a$(e):t},d:e=>parseInt(e,10),t:e=>parseInt(e,10),r:e=>parseInt(e,10),DEFAULT:e=>e},aw=e=>e&&e.attributes?r7(e.attributes).reduce((e,t)=>{var i=aT[t.name]||aT.DEFAULT;return e[t.name]=i(t.value),e},{}):{},a_={"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"},aS=(e,t)=>t.length?rV(e.map(function(e){return t.map(function(t){return sh(e,ab(t))})})):e,ak=e=>{var t=a8(e,"SegmentTemplate")[0],i=a8(e,"SegmentList")[0],n=i&&a8(i,"SegmentURL").map(e=>rq({tag:"SegmentURL"},aw(e))),e=a8(e,"SegmentBase")[0],s=i||t,s=s&&a8(s,"SegmentTimeline")[0],r=i||e||t,r=r&&a8(r,"Initialization")[0],t=t&&aw(t);t&&r?t.initialization=r&&aw(r):t&&t.initialization&&(t.initialization={sourceURL:t.initialization});let a={template:t,segmentTimeline:s&&a8(s,"S").map(e=>aw(e)),list:i&&rq(aw(i),{segmentUrls:n,initialization:aw(r)}),base:e&&rq(aw(e),{initialization:aw(r)})};return Object.keys(a).forEach(e=>{a[e]||delete a[e]}),a},aE=(e,t,i)=>n=>{var s=aw(n),r=aS(t,a8(n,"BaseURL")),a=a8(n,"Role")[0],a={role:aw(a)};let o=rq(e,s,a);var l,u,d,s=a8(n,"Accessibility")[0],s="urn:scte:dash:cc:cea-608:2015"===(a=aw(s)).schemeIdUri?("string"!=typeof a.value?[]:a.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}}):"urn:scte:dash:cc:cea-708:2015"===a.schemeIdUri?("string"!=typeof a.value?[]:a.value.split(";")).map(e=>{var t,i;let n={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};return/=/.test(e)?([t,i=""]=e.split("="),n.channel=t,n.language=e,i.split(",").forEach(e=>{var[e,t]=e.split(":");"lang"===e?n.language=t:"er"===e?n.easyReader=Number(t):"war"===e?n.aspectRatio=Number(t):"3D"===e&&(n["3D"]=Number(t))})):n.language=e,n.channel&&(n.channel="SERVICE"+n.channel),n}):void 0,a=(s&&(o=rq(o,{captionServices:s})),a8(n,"Label")[0]),a=(a&&a.childNodes.length&&(o=rq(o,{label:s=a.childNodes[0].nodeValue.trim()})),a8(n,"ContentProtection").reduce((e,t)=>{var i=aw(t),n=(i.schemeIdUri&&(i.schemeIdUri=i.schemeIdUri.toLowerCase()),a_[i.schemeIdUri]);return n&&(e[n]={attributes:i},i=a8(t,"cenc:pssh")[0])&&(t=ab(i),e[n].pssh=t&&function e(t){for(var i=window.atob?window.atob(t):Buffer.from(t,"base64").toString("binary"),n=new Uint8Array(i.length),s=0;s<i.length;s++)n[s]=i.charCodeAt(s);return n}(t)),e},{})),s=(Object.keys(a).length&&(o=rq(o,{contentProtection:a})),ak(n)),a=a8(n,"Representation"),n=rq(i,s);return rV(a.map((l=o,u=r,d=n,e=>{var t=a8(e,"BaseURL"),t=aS(u,t);let i=rq(l,aw(e)),n=ak(e);return t.map(e=>({segmentInfo:rq(d,n),attributes:rq(i,{baseUrl:e})}))})))},aC=(e,t={})=>{var{manifestUri:t="",NOW:i=Date.now(),clientOffset:n=0}=t,s=a8(e,"Period");if(!s.length)throw Error(r9.INVALID_NUMBER_OF_PERIOD);var r=a8(e,"Location");let a=aw(e);var o,l,t=aS([t],a8(e,"BaseURL"));a.type=a.type||"static",a.sourceDuration=a.mediaPresentationDuration||0,a.NOW=i,a.clientOffset=n,r.length&&(a.locations=r.map(ab));let u=[];return s.forEach((e,t)=>{var i,n,s=aw(e),t=u[t-1];s.start=({attributes:t,priorPeriodAttributes:i,mpdType:n}={attributes:s,priorPeriodAttributes:t?t.attributes:null,mpdType:a.type},"number"==typeof t.start?t.start:i&&"number"==typeof i.start&&"number"==typeof i.duration?i.start+i.duration:i||"static"!==n?null:0),u.push({node:e,attributes:s})}),{locations:a.locations,representationInfo:rV(u.map((o=a,l=t,(e,t)=>{var i=aS(l,a8(e.node,"BaseURL")),n=rq(o,{periodStart:e.attributes.start}),s=("number"==typeof e.attributes.duration&&(n.periodDuration=e.attributes.duration),a8(e.node,"AdaptationSet")),e=ak(e.node);return rV(s.map(aE(n,i,e)))})))}},a0=e=>{if(""===e)throw Error(r9.DASH_EMPTY_MANIFEST);var t,i=new rj;let n;try{n=(t=i.parseFromString(e,"application/xml"))&&"MPD"===t.documentElement.tagName?t.documentElement:null}catch(s){}if(!n||n&&0<n.getElementsByTagName("parsererror").length)throw Error(r9.DASH_INVALID_XML);return n},ax=e=>{if(e=a0(e),!(e=a8(e,"UTCTiming")[0]))return null;var t=aw(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;default:throw Error(r9.UNSUPPORTED_UTC_TIMING_SCHEME)}return t};function aI(e,t){var i,n,s;return void 0===t&&(t=0),(e=sT(e)).length-t<10||!sk(e,aM,{offset:t})?t:(t+=(void 0===(n=t)&&(n=0),s=(i=sT(i=e))[n+5],i=i[n+6]<<21|i[n+7]<<14|i[n+8]<<7|i[n+9],(16&s)>>4?20+i:10+i),aI(e,t))}function aP(e){return"string"==typeof e?sd(e):e}function aA(e,t,i){var n;return i>=t.length?t.length:(n=a2(t,i,!1),sk(e.bytes,n.bytes)?i:aA(e,t,i+(e=a2(t,i+n.length)).length+e.value+n.length))}function aL(e,t){t=Array.isArray(i=t)?i.map(function(e){return a1(e)}):[a1(i)],e=sT(e);var i,n=[];if(t.length)for(var s=0;s<e.length;){var r=a2(e,s,!1),a=a2(e,s+r.length),o=s+r.length+a.length,l=(127===a.value&&(a.value=aA(r,e,o),a.value!==e.length)&&(a.value-=o),o+a.value>e.length?e.length:o+a.value),o=e.subarray(o,l);sk(t[0],r.bytes)&&(1===t.length?n.push(o):n=n.concat(aL(o,t.slice(1)))),s+=r.length+a.length+o.length}return n}function aD(e,t,i,n){void 0===n&&(n=1/0),e=sT(e),i=[].concat(i);for(var s,r=0,a=0;r<e.length&&(a<n||s);){var o=void 0;if(sk(e.subarray(r),a4)?o=4:sk(e.subarray(r),a6)&&(o=3),o){if(a++,s)return aj(e.subarray(s,r));var l=void 0;"h264"===t?l=31&e[r+o]:"h265"===t&&(l=e[r+o]>>1&63),-1!==i.indexOf(l)&&(s=r+o),r+=o+("h264"===t?1:2)}else r++}return e.subarray(0,0)}function aO(e){e=sT(e);for(var t=0;t<aH.length;t++){var i=aH[t];if(aV[i](e))return i}return""}var aR=function(e){var t,e=new DataView(e.buffer,e.byteOffset,e.byteLength);return e.getBigUint64?(t=e.getBigUint64(0))<Number.MAX_SAFE_INTEGER?Number(t):t:4294967296*e.getUint32(0)+e.getUint32(4)},aN=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:t.getUint32(4),timescale:t.getUint32(8)},n=12,s=(0===i.version?(i.earliestPresentationTime=t.getUint32(n),i.firstOffset=t.getUint32(n+4),n+=8):(i.earliestPresentationTime=aR(e.subarray(n)),i.firstOffset=aR(e.subarray(n+8)),n+=16),t.getUint16(n+=2));for(n+=2;0<s;n+=12,s--)i.references.push({referenceType:(128&e[n])>>>7,referencedSize:2147483647&t.getUint32(n),subsegmentDuration:t.getUint32(n+4),startsWithSap:!!(128&e[n+8]),sapType:(112&e[n+8])>>>4,sapDeltaTime:268435455&t.getUint32(n+8)});return i},aM=sT([73,68,51]),a3={EBML:sT([26,69,223,163]),DocType:sT([66,130]),Segment:sT([24,83,128,103]),SegmentInfo:sT([21,73,169,102]),Tracks:sT([22,84,174,107]),Track:sT([174]),TrackNumber:sT([215]),DefaultDuration:sT([35,227,131]),TrackEntry:sT([174]),TrackType:sT([131]),FlagDefault:sT([136]),CodecID:sT([134]),CodecPrivate:sT([99,162]),VideoTrack:sT([224]),AudioTrack:sT([225]),Cluster:sT([31,67,182,117]),Timestamp:sT([231]),TimestampScale:sT([42,215,177]),BlockGroup:sT([160]),BlockDuration:sT([155]),Block:sT([161]),SimpleBlock:sT([163])},aB=[128,64,32,16,8,4,2,1],aU=function(e){for(var t=1,i=0;i<aB.length&&!(e&aB[i]);i++)t++;return t},a2=function(e,t,i,n){void 0===i&&(i=!0),void 0===n&&(n=!1);var s=aU(e[t]),r=e.subarray(t,t+s);return i&&((r=Array.prototype.slice.call(e,t,t+s))[0]^=aB[s-1]),{length:s,value:sS(r,{signed:n}),bytes:r}},a1=function e(t){return"string"==typeof t?t.match(/.{1,2}/g).map(e):"number"==typeof t?function e(t,i){for(var n=void 0!==(i=(void 0===i?{}:i).le)&&i,s=Math.ceil((i=t=sw(t="bigint"!=typeof t&&"number"!=typeof t||"number"==typeof t&&t!=t?0:t)).toString(2).length/8),r=new Uint8Array(new ArrayBuffer(s)),a=0;a<s;a++){var o=n?a:Math.abs(a+1-r.length);r[o]=Number(t/s_[a]&sw(255)),t<0&&(r[o]=Math.abs(~r[o]),r[o]-=0===a?1:2)}return r}(t):t},a4=sT([0,0,0,1]),a6=sT([0,0,1]),aF=sT([0,0,3]),aj=function(e){for(var t=[],i=1;i<e.length-2;)sk(e.subarray(i,i+3),aF)&&(t.push(i+2),i++),i++;if(0===t.length)return e;for(var n=e.length-t.length,s=new Uint8Array(n),r=0,i=0;i<n;r++,i++)r===t[0]&&(r++,t.shift()),s[i]=e[r];return s},a5={webm:sT([119,101,98,109]),matroska:sT([109,97,116,114,111,115,107,97]),flac:sT([102,76,97,67]),ogg:sT([79,103,103,83]),ac3:sT([11,119]),riff:sT([82,73,70,70]),avi:sT([65,86,73]),wav:sT([87,65,86,69]),"3gp":sT([102,116,121,112,51,103]),mp4:sT([102,116,121,112]),fmp4:sT([115,116,121,112]),mov:sT([102,116,121,112,113,116]),moov:sT([109,111,111,118]),moof:sT([109,111,111,102])},aq={aac:function(e){var t=aI(e);return sk(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=aI(e);return sk(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){return e=aL(e,[a3.EBML,a3.DocType])[0],sk(e,a5.webm)},mkv:function(e){return e=aL(e,[a3.EBML,a3.DocType])[0],sk(e,a5.matroska)},mp4:function(e){return!aq["3gp"](e)&&!aq.mov(e)&&(!!(sk(e,a5.mp4,{offset:4})||sk(e,a5.fmp4,{offset:4})||sk(e,a5.moof,{offset:4})||sk(e,a5.moov,{offset:4}))||void 0)},mov:function(e){return sk(e,a5.mov,{offset:4})},"3gp":function(e){return sk(e,a5["3gp"],{offset:4})},ac3:function(e){var t=aI(e);return sk(e,a5.ac3,{offset:t})},ts:function(e){if(e.length<189&&1<=e.length)return 71===e[0];for(var t=0;t+188<e.length&&t<188;){if(71===e[t]&&71===e[t+188])return!0;t+=1}return!1},flac:function(e){var t=aI(e);return sk(e,a5.flac,{offset:t})},ogg:function(e){return sk(e,a5.ogg)},avi:function(e){return sk(e,a5.riff)&&sk(e,a5.avi,{offset:8})},wav:function(e){return sk(e,a5.riff)&&sk(e,a5.wav,{offset:8})},h264:function(e){return aD(e,"h264",7,3).length},h265:function(e){return aD(e,"h265",[32,33],3).length}},aH=Object.keys(aq).filter(function(e){return"ts"!==e&&"h264"!==e&&"h265"!==e}).concat(["ts","h264","h265"]),aV=(aH.forEach(function(e){var t=aq[e];aq[e]=function(e){return t(sT(e))}}),aq);/*! @name @videojs/http-streaming @version 3.0.2 @license Apache-2.0 */ let a7=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=window.location&&window.location.href||"");var i="function"==typeof window.URL,n=/^\/\//.test(e),s=!window.location&&!/\/\//i.test(e);return i?e=new window.URL(e,window.location||se):/\/\//i.test(e)||(e=nJ.buildAbsoluteURL(window.location&&window.location.href||"",e)),i?(i=new URL(t,e),s?i.href.slice(se.length):n?i.href.slice(i.protocol.length):i.href):nJ.buildAbsoluteURL(e,t)},a9=(e,t)=>t&&t.responseURL&&e!==t.responseURL?t.responseURL:e,aW=e=>nZ.log.debug?nZ.log.debug.bind(nZ,"VHS:",e+" >"):function(){};function az(...e){var t=nZ.obj||nZ;return(t.merge||t.mergeOptions).apply(t,e)}function aG(...e){var t=nZ.time||nZ;return(t.createTimeRanges||t.createTimeRanges).apply(t,e)}function aX(e,t){return oi(e,function(e,i){return e-ot<=t&&i+ot>=t})}function aK(e,t){return oi(e,function(e){return e-oe>=t})}function aY(e){if(e&&e.length&&e.end)return e.end(e.length-1)}function aQ(e,t){let i=0;if(e&&e.length)for(let n=0;n<e.length;n++){var s=e.start(n),r=e.end(n);r<t||(i+=s<t&&t<=r?r-t:r-s)}return i}function aZ({defaultDuration:e,durationList:t,startIndex:i,endIndex:n}){let s=0;if(n<i&&([i,n]=[n,i]),i<0){for(let r=i;r<Math.min(0,n);r++)s+=e;i=0}for(let a=i;a<n;a++)s+=t[a].duration;return s}function aJ(e,t,i,n){if(!e||!e.segments)return null;if(e.endList)return op(e);if(null===t)return null;t=t||0;let s=oc(e,e.mediaSequence+e.segments.length,t);return i&&(n="number"==typeof n?n:ou(null,e),s-=n),Math.max(0,s)}let oe=1/30,ot=3*oe,oi=function(e,t){var i=[];let n;if(e&&e.length)for(n=0;n<e.length;n++)t(e.start(n),e.end(n))&&i.push([e.start(n),e.end(n)]);return aG(i)},on=e=>{var t=[];if(!e||!e.length)return"";for(let i=0;i<e.length;i++)t.push(e.start(i)+" => "+e.end(i));return t.join(", ")},os=e=>{var t=[];for(let i=0;i<e.length;i++)t.push({start:e.start(i),end:e.end(i)});return t},or=(e,t)=>{if(!t.preload)return t.duration;let i=0;return(t.parts||[]).forEach(function(e){i+=e.duration}),(t.preloadHints||[]).forEach(function(t){"PART"===t.type&&(i+=e.partTargetDuration)}),i},oa=e=>(e.segments||[]).reduce((e,t,i)=>(t.parts?t.parts.forEach(function(n,s){e.push({duration:n.duration,segmentIndex:i,partIndex:s,part:n,segment:t})}):e.push({duration:t.duration,segmentIndex:i,partIndex:null,segment:t,part:null}),e),[]),oo=e=>(e=e.segments&&e.segments.length&&e.segments[e.segments.length-1])&&e.parts||[],ol=({preloadSegment:e})=>{var t;if(e)return{parts:e,preloadHints:t}=e,(t||[]).reduce((e,t)=>e+("PART"===t.type?1:0),0)+(e&&e.length?e.length:0)},ou=(e,t)=>t.endList?0:e&&e.suggestedPresentationDelay?e.suggestedPresentationDelay:(e=0<oo(t).length)&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:e&&t.partTargetDuration?3*t.partTargetDuration:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?3*t.targetDuration:0,od=function(e,t){let i=0,n=t-e.mediaSequence,s=e.segments[n];if(s){if(void 0!==s.start)return{result:s.start,precise:!0};if(void 0!==s.end)return{result:s.end-s.duration,precise:!0}}for(;n--;){if(void 0!==(s=e.segments[n]).end)return{result:i+s.end,precise:!0};if(i+=or(e,s),void 0!==s.start)return{result:i+s.start,precise:!0}}return{result:i,precise:!1}},oh=function(e,t){var i;let n=0,s=t-e.mediaSequence;for(;s<e.segments.length;s++){if(void 0!==(i=e.segments[s]).start)return{result:i.start-n,precise:!0};if(n+=or(e,i),void 0!==i.end)return{result:i.end-n,precise:!0}}return{result:-1,precise:!1}},oc=function(e,t,i){var n;return(t=void 0===t?e.mediaSequence+e.segments.length:t)<e.mediaSequence?0:(n=od(e,t)).precise?n.result:(e=oh(e,t)).precise?e.result:n.result+i},op=function(e,t,i){if(!e)return 0;if("number"!=typeof i&&(i=0),void 0===t){if(e.totalDuration)return e.totalDuration;if(!e.endList)return window.Infinity}return oc(e,t,i)};function om(e){return e.excludeUntil&&e.excludeUntil>Date.now()}function of(e){return e.excludeUntil&&e.excludeUntil===1/0}function og(e){var t=om(e);return!e.disabled&&!t}function oy(e,t){return t.attributes&&t.attributes[e]}function ov(e,t){var i=e&&e.mediaGroups&&e.mediaGroups.AUDIO||{};let n=!1;for(let s in i){for(let r in i[s])if(n=t(i[s][r]))break;if(n)break}return!!n}let o8=(e,t)=>{if(1===e.playlists.length)return!0;let i=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter(e=>!!og(e)&&(e.attributes.BANDWIDTH||0)<i).length},ob=(e,t)=>!(!e&&!t||!e&&t||e&&!t||e!==t&&(!e.id||!t.id||e.id!==t.id)&&(!e.resolvedUri||!t.resolvedUri||e.resolvedUri!==t.resolvedUri)&&(!e.uri||!t.uri||e.uri!==t.uri)),o$=e=>{if(!e||!e.playlists||!e.playlists.length)return ov(e,e=>e.playlists&&e.playlists.length||e.uri);for(let t=0;t<e.playlists.length;t++){let i=e.playlists[t];var n=i.attributes&&i.attributes.CODECS;if((!n||!n.split(",").every(e=>sa(e)))&&!(n=ov(e,e=>ob(i,e))))return!1}return!0};var oT={liveEdgeDelay:ou,duration:op,seekable:function(e,t,i){var n=t||0,e=aJ(e,t,!0,i);return null===e?aG():aG(n,e)},getMediaInfoForTime:function({playlist:e,currentTime:t,startingSegmentIndex:i,startingPartIndex:n,startTime:s,exactManifestTimings:r}){let a=t-s;var o=oa(e);let l=0;for(let u=0;u<o.length;u++){var d=o[u];if(i===d.segmentIndex&&("number"!=typeof n||"number"!=typeof d.partIndex||n===d.partIndex)){l=u;break}}if(a<0){if(0<l)for(let h=l-1;0<=h;h--){var c=o[h];if(a+=c.duration,r){if(a<0)continue}else if(a+oe<=0)continue;return{partIndex:c.partIndex,segmentIndex:c.segmentIndex,startTime:s-aZ({defaultDuration:e.targetDuration,durationList:o,startIndex:l,endIndex:h})}}return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:t}}if(l<0){for(let p=l;p<0;p++)if((a-=e.targetDuration)<0)return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:t};l=0}for(let m=l;m<o.length;m++){var f=o[m];if(a-=f.duration,r){if(0<a)continue}else if(0<=a-oe)continue;return{partIndex:f.partIndex,segmentIndex:f.segmentIndex,startTime:s+aZ({defaultDuration:e.targetDuration,durationList:o,startIndex:l,endIndex:m})}}return{segmentIndex:o[o.length-1].segmentIndex,partIndex:o[o.length-1].partIndex,startTime:t}},isEnabled:og,isDisabled:function(e){return e.disabled},isExcluded:om,isIncompatible:of,playlistEnd:aJ,isAes:function(e){for(let t=0;t<e.segments.length;t++)if(e.segments[t].key)return!0;return!1},hasAttribute:oy,estimateSegmentRequestTime:function(e,t,i,n=0){return oy("BANDWIDTH",i)?(e*i.attributes.BANDWIDTH-8*n)/t:NaN},isLowestEnabledRendition:o8,isAudioOnly:o$,playlistMatch:ob,segmentDurationWithParts:or};let ow=nZ.log,o_=(e,t)=>e+"-"+t,oS=(e,t)=>{e.mediaGroups&&["AUDIO","SUBTITLES"].forEach(i=>{if(e.mediaGroups[i])for(let n in e.mediaGroups[i])for(let s in e.mediaGroups[i][n])t(e.mediaGroups[i][n][s],i,n,s)})},ok=({playlist:e,uri:t,id:i})=>{e.id=i,e.playlistErrors_=0,t&&(e.uri=t),e.attributes=e.attributes||{}},oE=(e,t,i=(e,t,i)=>`placeholder-uri-${e}-${t}-`+i)=>{e.uri=t;for(let n=0;n<e.playlists.length;n++)e.playlists[n].uri||(r="placeholder-uri-"+n,e.playlists[n].uri=r);let s=o$(e);oS(e,(t,n,r,a)=>{if(!t.playlists||!t.playlists.length){if(s&&"AUDIO"===n&&!t.uri)for(let o=0;o<e.playlists.length;o++){var l=e.playlists[o];if(l.attributes&&l.attributes.AUDIO&&l.attributes.AUDIO===r)return}t.playlists=[t3({},t)]}t.playlists.forEach(function(t,s){var o=i(n,r,a,t),l=o_(s,o);t.uri?t.resolvedUri=t.resolvedUri||a7(e.uri,t.uri):(t.uri=0===s?o:l,t.resolvedUri=t.uri),t.id=t.id||l,t.attributes=t.attributes||{},e.playlists[t.id]=t,e.playlists[t.uri]=t})});{var r,a,o=e;let l=o.playlists.length;for(;l--;){var u=o.playlists[l];ok({playlist:u,id:o_(l,u.uri)}),u.resolvedUri=a7(o.uri,u.uri),o.playlists[u.id]=u,(o.playlists[u.uri]=u).attributes.BANDWIDTH||ow.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}}a=e,oS(a,e=>{e.uri&&(e.resolvedUri=a7(a.uri,e.uri))})};function oC(e){var t=e.segments||[],i=e.preloadSegment;if(i&&i.parts&&i.parts.length){if(i.preloadHints){for(let n=0;n<i.preloadHints.length;n++)if("MAP"===i.preloadHints[n].type)return t}i.duration=e.targetDuration,i.preload=!0,t.push(i)}return t}nI=nZ.EventTarget;let o0=(e,t)=>{if(!e)return t;var i=az(e,t);if(e.preloadHints&&!t.preloadHints&&delete i.preloadHints,e.parts&&!t.parts)delete i.parts;else if(e.parts&&t.parts)for(let n=0;n<t.parts.length;n++)e.parts&&e.parts[n]&&(i.parts[n]=az(e.parts[n],t.parts[n]));return!e.skipped&&t.skipped&&(i.skipped=!1),e.preload&&!t.preload&&(i.preload=!1),i},ox=(e,t)=>{!e.resolvedUri&&e.uri&&(e.resolvedUri=a7(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=a7(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=a7(t,e.map.uri)),e.map&&e.map.key&&!e.map.key.resolvedUri&&(e.map.key.resolvedUri=a7(t,e.map.key.uri)),e.parts&&e.parts.length&&e.parts.forEach(e=>{e.resolvedUri||(e.resolvedUri=a7(t,e.uri))}),e.preloadHints&&e.preloadHints.length&&e.preloadHints.forEach(e=>{e.resolvedUri||(e.resolvedUri=a7(t,e.uri))})},oI=(e,t)=>e===t||e.segments&&t.segments&&e.segments.length===t.segments.length&&e.endList===t.endList&&e.mediaSequence===t.mediaSequence&&e.preloadSegment===t.preloadSegment,oP=(e,t,i=oI)=>{var n=az(e,{}),s=n.playlists[t.id];if(!s||i(s,t))return null;t.segments=oC(t);let r=az(s,t);if(r.preloadSegment&&!t.preloadSegment&&delete r.preloadSegment,s.segments){if(t.skip){t.segments=t.segments||[];for(let a=0;a<t.skip.skippedSegments;a++)t.segments.unshift({skipped:!0})}r.segments=((e,t,i)=>{var n=e.slice(),s=t.slice(),r=(i=i||0,[]);let a;for(let o=0;o<s.length;o++){var l=n[o+i],u=s[o];l?(a=l.map||a,r.push(o0(l,u))):(a&&!u.map&&(u.map=a),r.push(u))}return r})(s.segments,t.segments,t.mediaSequence-s.mediaSequence)}r.segments.forEach(e=>{ox(e,r.resolvedUri)});for(let o=0;o<n.playlists.length;o++)n.playlists[o].id===t.id&&(n.playlists[o]=r);return n.playlists[t.id]=r,n.playlists[t.uri]=r,oS(e,(e,i,n,s)=>{if(e.playlists)for(let a=0;a<e.playlists.length;a++)t.id===e.playlists[a].id&&(e.playlists[a]=r)}),n},oA=(e,t)=>{var i=e.segments||[],i=i[i.length-1],n=i&&i.parts&&i.parts[i.parts.length-1],n=n&&n.duration||i&&i.duration;return t&&n?1e3*n:500*(e.partTargetDuration||e.targetDuration||10)};class oL extends nI{constructor(e,t,i={}){if(super(),!e)throw Error("A non-empty playlist URL or object is required");this.logger_=aW("PlaylistLoader");var{withCredentials:i=!1}=i,e=(this.src=e,this.vhs_=t,this.withCredentials=i,t.options_);this.customTagParsers=e&&e.customTagParsers||[],this.customTagMappers=e&&e.customTagMappers||[],this.llhls=e&&e.llhls,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_)}handleMediaupdatetimeout_(){if("HAVE_METADATA"===this.state){var e=this.media();let t=a7(this.main.uri,e.uri);this.llhls&&(t=((e,t)=>{if(!t.endList&&t.serverControl){let i={};if(t.serverControl.canBlockReload){var n,s=t.preloadSegment;let r=t.mediaSequence+t.segments.length;s&&(s=s.parts||[],-1<(n=ol(t)-1)&&n!=s.length-1&&(i._HLS_part=n),-1<n||s.length)&&r--,i._HLS_msn=r}if(t.serverControl&&t.serverControl.canSkipUntil&&(i._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(i).length){let a=new window.URL(e);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(e){i.hasOwnProperty(e)&&a.searchParams.set(e,i[e])}),e=a.toString()}}return e})(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials},(e,t)=>{if(this.request)return e?this.playlistRequestError(this.request,this.media(),"HAVE_METADATA"):void this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})})}}playlistRequestError(e,t,i){var{uri:t,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: ${t}.`,responseText:e.responseText,code:500<=e.status?4:2},this.trigger("error")}parseManifest_({url:e,manifestString:t}){{var[{onwarn:t,oninfo:i,manifestString:n,customTagParsers:s=[],customTagMappers:r=[],llhls:a}]=[{onwarn:({message:t})=>this.logger_(`m3u8-parser warn for ${e}: `+t),oninfo:({message:t})=>this.logger_(`m3u8-parser info for ${e}: `+t),manifestString:t,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls}];let o=new sr,l=(t&&o.on("warn",t),i&&o.on("info",i),s.forEach(e=>o.addParser(e)),r.forEach(e=>o.addTagMapper(e)),o.push(n),o.end(),o.manifest);if(a||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(e){l.hasOwnProperty(e)&&delete l[e]}),l.segments&&l.segments.forEach(function(e){["parts","preloadHints"].forEach(function(t){e.hasOwnProperty(t)&&delete e[t]})})),!l.targetDuration){let u=10;l.segments&&l.segments.length&&(u=l.segments.reduce((e,t)=>Math.max(e,t.duration),0)),t&&t("manifest has no targetDuration defaulting to "+u),l.targetDuration=u}return(i=oo(l)).length&&!l.partTargetDuration&&(s=i.reduce((e,t)=>Math.max(e,t.duration),0),t&&(t("manifest has no partTargetDuration defaulting to "+s),ow.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.")),l.partTargetDuration=s),l}}haveMetadata({playlistString:e,playlistObject:t,url:i,id:n}){this.request=null,this.state="HAVE_METADATA",(t=t||this.parseManifest_({url:i,manifestString:e})).lastRequest=Date.now(),ok({playlist:t,uri:i,id:n}),e=oP(this.main,t),this.targetDuration=t.partTargetDuration||t.targetDuration,this.pendingMedia_=null,e?(this.main=e,this.media_=this.main.playlists[n]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(oA(this.media(),!!e)),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),window.clearTimeout(this.mediaUpdateTimeout),window.clearTimeout(this.finalRenditionTimeout),this.off()}stopRequest(){var e;this.request&&(e=this.request,this.request=null,e.onreadystatechange=null,e.abort())}media(e,t){if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw Error("Cannot switch media playlist from "+this.state);if("string"==typeof e){if(!this.main.playlists[e])throw Error("Unknown playlist URI: "+e);e=this.main.playlists[e]}if(window.clearTimeout(this.finalRenditionTimeout),t)t=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3,this.finalRenditionTimeout=window.setTimeout(this.media.bind(this,e,!1),t);else{let i=this.state;var t=!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,t&&(this.trigger("mediachanging"),"HAVE_MAIN_MANIFEST"===i?this.trigger("loadedmetadata"):this.trigger("mediachange"));else if(this.updateMediaUpdateTimeout_(oA(e,!0)),t){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,this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials},(t,n)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=a9(e.resolvedUri,n),t)return this.playlistRequestError(this.request,e,i);this.haveMetadata({playlistString:n.responseText,url:e.uri,id:e.id}),"HAVE_MAIN_MANIFEST"===i?this.trigger("loadedmetadata"):this.trigger("mediachange")}})}}}pause(){this.mediaUpdateTimeout&&(window.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MAIN_MANIFEST":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")}load(e){this.mediaUpdateTimeout&&(window.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);var t=this.media();e?(e=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3,this.mediaUpdateTimeout=window.setTimeout(()=>{this.mediaUpdateTimeout=null,this.load()},e)):this.started?t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(window.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=window.setTimeout(()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(e)},e))}start(){this.started=!0,"object"==typeof this.src?(this.src.uri||(this.src.uri=window.location.href),this.src.resolvedUri=this.src.uri,setTimeout(()=>{this.setupInitialPlaylist(this.src)},0)):this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},(e,t)=>{if(this.request){if(this.request=null,e)return this.error={status:t.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:t.responseText,code:2},"HAVE_NOTHING"===this.state&&(this.started=!1),this.trigger("error");this.src=a9(this.src,t),e=this.parseManifest_({manifestString:t.responseText,url:this.src}),this.setupInitialPlaylist(e)}})}srcUri(){return"string"==typeof this.src?this.src:this.src.uri}setupInitialPlaylist(e){var t,i,n,s;this.state="HAVE_MAIN_MANIFEST",e.playlists?(this.main=e,oE(this.main,this.srcUri()),e.playlists.forEach(e=>{e.segments=oC(e),e.segments.forEach(t=>{ox(t,e.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.main.playlists[0])):(t=this.srcUri()||window.location.href,this.main=(n=o_(0,i=t),(s={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:window.location.href,resolvedUri:window.location.href,playlists:[{uri:i,id:n,resolvedUri:i,attributes:{}}]}).playlists[n]=s.playlists[0],s.playlists[i]=s.playlists[0],s),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata"))}}function oD(e,t,i,n){var s="arraybuffer"===e.responseType?e.response:e.responseText;!t&&s&&(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=s.byteLength||s.length,e.bandwidth||(e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8e3))),i.headers&&(e.responseHeaders=i.headers),t&&"ETIMEDOUT"===t.code&&(e.timedout=!0),n(t=t||e.aborted||200===i.statusCode||206===i.statusCode||0===i.statusCode?t:Error("XHR Failed with a response of: "+(e&&(s||e.responseText))),e)}function oO(){function e(t,i){t=az({timeout:45e3},t);var n=e.beforeRequest||nZ.Vhs.xhr.beforeRequest;n&&"function"==typeof n&&(n=n(t))&&(t=n);let s=(!0===nZ.Vhs.xhr.original?o2:nZ.Vhs.xhr)(t,function(e,t){return oD(s,e,t,i)}),r=s.abort;return s.abort=function(){return s.aborted=!0,r.apply(s,arguments)},s.uri=t.uri,s.requestTime=Date.now(),s}return e.original=!0,e}function oR(e){var t,i={};let n;return e.byterange&&(i.Range="bytes="+(t=e.byterange).offset+"-"+(n="bigint"==typeof t.offset||"bigint"==typeof t.length?window.BigInt(t.offset)+window.BigInt(t.length)-window.BigInt(1):t.offset+t.length-1)),i}function oN(e,t){return e=e.toString(16),"00".substring(0,2-e.length)+e+(t%2?" ":"")}function oM(e){return 32<=e&&e<126?String.fromCharCode(e):"."}function o3(e){let t={};return Object.keys(e).forEach(i=>{var n=e[i];s$(n)?t[i]={bytes:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength}:t[i]=n}),t}function oB(e){var t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")}function oU(e){return e.resolvedUri}let o2=nZ.xhr,o1=e=>{var t,i,n=Array.prototype.slice.call(e);let s="";for(let r=0;r<n.length/16;r++)s+=(t=n.slice(16*r,16*r+16).map(oN).join(""))+" "+(i=n.slice(16*r,16*r+16).map(oM).join(""))+"\n";return s};nx=Object.freeze({__proto__:null,createTransferableMessage:o3,initSegmentId:oB,segmentKeyId:oU,hexDump:o1,tagDump:({bytes:e})=>o1(e),textRanges(e){var t,i;let n="",s;for(s=0;s<e.length;s++)n+=(t=e,i=s,t.start(i)+"-"+t.end(i)+" ");return n}});let o4=e=>e.transmuxedPresentationEnd-e.transmuxedPresentationStart-e.transmuxerPrependedSeconds,o6=({playlist:e,time:t,callback:i})=>{var n,s;if(i)return e&&void 0!==t?(e=((e,t)=>{if(!t||!t.segments||0===t.segments.length)return null;let i=0,n;for(let s=0;s<t.segments.length&&!(e<=(i=(n=t.segments[s]).videoTimingInfo?n.videoTimingInfo.transmuxedPresentationEnd:i+n.duration));s++);var r=t.segments[t.segments.length-1];if(r.videoTimingInfo&&r.videoTimingInfo.transmuxedPresentationEnd<e)return null;if(e>i){if(e>i+.25*r.duration)return null;n=r}return{segment:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:i-n.duration,type:n.videoTimingInfo?"accurate":"estimate"}})(t,e))?"estimate"===e.type?i({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:e.estimatedStart}):(n={mediaSeconds:t},(s=(e=e.segment).dateTimeObject?(s=e.videoTimingInfo.transmuxerPrependedSeconds,t-=e.videoTimingInfo.transmuxedPresentationStart+s,new Date(e.dateTimeObject.getTime()+1e3*t)):null)&&(n.programDateTime=s.toISOString()),i(null,n)):i({message:"valid programTime was not found"}):i({message:"getProgramTime: playlist and time must be provided"});throw Error("getProgramTime: callback must be provided")},oF=({programTime:e,playlist:t,retryCount:i=2,seekTo:n,pauseAfterSeek:s=!0,tech:r,callback:a})=>{var o,l,u;if(a)return void 0!==e&&t&&n?t.endList||r.hasStarted_?(e=>{if(!e.segments||0===e.segments.length)return!1;for(let t=0;t<e.segments.length;t++)if(!e.segments[t].dateTimeObject)return!1;return!0})(t)?(u=((e,t)=>{let i;try{i=new Date(e)}catch(n){return null}if(!t||!t.segments||0===t.segments.length)return null;let s=t.segments[0];if(i<s.dateTimeObject)return null;for(let r=0;r<t.segments.length-1&&(s=t.segments[r],!(i<t.segments[r+1].dateTimeObject));r++);var e=t.segments[t.segments.length-1],a=e.dateTimeObject,o=e.videoTimingInfo?o4(e.videoTimingInfo):e.duration+.25*e.duration,o=new Date(a.getTime()+1e3*o);return i>o?null:{segment:s=i>a?e:s,estimatedStart:s.videoTimingInfo?s.videoTimingInfo.transmuxedPresentationStart:oT.duration(t,t.mediaSequence+t.segments.indexOf(s)),type:s.videoTimingInfo?"accurate":"estimate"}})(e,t))?(l=((e,t)=>{let i,n;try{i=new Date(e),n=new Date(t)}catch(s){}return e=i.getTime(),(n.getTime()-e)/1e3})((o=u.segment).dateTimeObject,e),"estimate"===u.type?0===i?a({message:e+" is not buffered yet. Try again"}):(n(u.estimatedStart+l),void r.one("seeked",()=>{oF({programTime:e,playlist:t,retryCount:i-1,seekTo:n,pauseAfterSeek:s,tech:r,callback:a})})):(u=o.start+l,r.one("seeked",()=>a(null,r.currentTime())),s&&r.pause(),void n(u))):a({message:e+" was not found in the stream"}):a({message:"programDateTime tags must be provided in the manifest "+t.resolvedUri}):a({message:"player must be playing a live stream to start buffering"}):a({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});throw Error("seekToProgramTime: callback must be provided")},oj=(e,t)=>{if(4===e.readyState)return t()},o5=(e,t,i)=>{let n=[],s,r=!1;function a(e,t,n,s){return t.abort(),r=!0,i(e,t,n,s)}function o(e,t){var i;if(!r)return e?a(e,t,"",n):(i=t.responseText.substring(n&&n.byteLength||0,t.responseText.length),n=function(){for(var e,t,i,n=arguments.length,s=Array(n),r=0;r<n;r++)s[r]=arguments[r];return(s=s.filter(function(e){return e&&(e.byteLength||e.length)&&"string"!=typeof e})).length<=1?sT(s[0]):(e=s.reduce(function(e,t,i){return e+(t.byteLength||t.length)},0),t=new Uint8Array(e),i=0,s.forEach(function(e){e=sT(e),t.set(e,i),i+=e.byteLength}),t)}(n,sd(i,!0)),s=s||aI(n),n.length<10||s&&n.length<s+2||"ts"===(i=aO(n))&&n.length<188||!i&&n.length<376?oj(t,()=>a(e,t,"",n)):a(null,t,i,n))}let l=t({uri:e,beforeSend(e){e.overrideMimeType("text/plain; charset=x-user-defined"),e.addEventListener("progress",function({}){return oD(e,null,{statusCode:e.status},o)})}},function(e,t){return oD(l,e,t,o)});return l};function oq(e,t){if(!oI(e,t)||e.sidx&&t.sidx&&(e.sidx.offset!==t.sidx.offset||e.sidx.length!==t.sidx.length)||!e.sidx&&t.sidx||e.sidx&&!t.sidx||e.segments&&!t.segments||!e.segments&&t.segments)return!1;if(e.segments||t.segments)for(let i=0;i<e.segments.length;i++){var n=e.segments[i],s=t.segments[i];if(n.uri!==s.uri||(n.byterange||s.byterange)&&(n=n.byterange,s=s.byterange,n&&!s||!n&&s||n.offset!==s.offset||n.length!==s.length))return!1}return!0}tY=nZ.EventTarget;let oH=(e,t,i,n)=>`placeholder-uri-${e}-${t}-`+(n.attributes.NAME||i),oV=({mainXml:e,srcUrl:t,clientOffset:i,sidxMapping:n,previousManifest:s})=>(i={manifestUri:t,clientOffset:i,sidxMapping:n,previousManifest:s},e=aC(a0(e),i),n=av(e.representationInfo),s=ah({dashPlaylists:n,locations:e.locations,sidxMapping:i.sidxMapping,previousManifest:i.previousManifest}),oE(s,t,oH),s),o7=(e,t,i)=>{let n=!0,s=az(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod,timelineStarts:t.timelineStarts});for(let r=0;r<t.playlists.length;r++){var a,o,l=t.playlists[r],u=(l.sidx&&(u=ai(l.sidx),i)&&i[u]&&i[u].sidx&&rY(l,i[u].sidx,l.sidx.resolvedUri),oP(s,l,oq));u&&(s=u,n=!1)}return oS(t,(e,t,i,r)=>{var a,o;e.playlists&&e.playlists.length&&(a=e.playlists[0].id,o=oP(s,e.playlists[0],oq))&&(r in(s=o).mediaGroups[t][i]||(s.mediaGroups[t][i][r]=e),s.mediaGroups[t][i][r].playlists[0]=s.playlists[a],n=!1)}),a=s,o=t,oS(a,(e,t,i,n)=>{n in o.mediaGroups[t][i]||delete a.mediaGroups[t][i][n]}),(n=t.minimumUpdatePeriod===e.minimumUpdatePeriod&&n)?null:s},o9=(e,t)=>(Boolean(!e.map&&!t.map)||Boolean(e.map&&t.map&&e.map.byterange.offset===t.map.byterange.offset&&e.map.byterange.length===t.map.byterange.length))&&e.uri===t.uri&&e.byterange.offset===t.byterange.offset&&e.byterange.length===t.byterange.length,oW=(e,t)=>{var i={};for(let n in e){var s=e[n].sidx;if(s){var r=ai(s);if(!t[r])break;o9(t[r].sidxInfo,s)&&(i[r]=t[r])}}return i};class oz extends tY{constructor(e,t,i={},n){super(),this.mainPlaylistLoader_=n||this,n||(this.isMain_=!0);var{withCredentials:n=!1}=i;if(this.vhs_=t,this.withCredentials=n,!e)throw 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_=aW("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}requestErrored_(e,t,i){return!this.request||(this.request=null,e?(this.error="object"!=typeof e||e instanceof Error?{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2}:e,i&&(this.state=i),this.trigger("error"),!0):void 0)}addSidxSegments_(e,t,i){let n=e.sidx&&ai(e.sidx);if(e.sidx&&n&&!this.mainPlaylistLoader_.sidxMapping_[n]){let s=a9(e.sidx.resolvedUri),r=(s,r)=>{if(!this.requestErrored_(s,r,t)){s=this.mainPlaylistLoader_.sidxMapping_;let a;try{a=aN(sT(r.response).subarray(8))}catch(o){return void this.requestErrored_(o,r,t)}return s[n]={sidxInfo:e.sidx,sidx:a},rY(e,a,e.sidx.resolvedUri),i(!0)}};this.request=o5(s,this.vhs_.xhr,(t,i,n,a)=>{var o,l;return t?r(t,i):n&&"mp4"===n?({offset:o,length:l}=e.sidx.byterange,a.length>=l+o?r(t,{response:a.subarray(o,o+l),status:i.status,uri:i.uri}):void(this.request=this.vhs_.xhr({uri:s,responseType:"arraybuffer",headers:oR({byterange:e.sidx.byterange})},r))):r({status:i.status,message:`Unsupported ${n||"unknown"} container type for sidx segment at URL: `+s,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},i)})}else this.mediaRequest_=window.setTimeout(()=>i(!1),0)}dispose(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},window.clearTimeout(this.minimumUpdatePeriodTimeout_),window.clearTimeout(this.mediaRequest_),window.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(){var e;this.request&&(e=this.request,this.request=null,e.onreadystatechange=null,e.abort())}media(e){if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw Error("Cannot switch media playlist from "+this.state);let t=this.state;if("string"==typeof e){if(!this.mainPlaylistLoader_.main.playlists[e])throw Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}var i=!this.media_||e.id!==this.media_.id;i&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList?(this.state="HAVE_METADATA",this.media_=e,i&&(this.trigger("mediachanging"),this.trigger("mediachange"))):i&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,t,i=>{this.haveMetadata({startingState:t,playlist:e})}))}haveMetadata({startingState:e,playlist:t}){this.state="HAVE_METADATA",this.loadedPlaylists_[t.id]=t,this.mediaRequest_=null,this.refreshMedia_(t.id),"HAVE_MAIN_MANIFEST"===e?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),window.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(window.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1)}load(e){window.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;var t=this.media();e?(e=t?t.targetDuration/2*1e3:5e3,this.mediaUpdateTimeout=window.setTimeout(()=>this.load(),e)):this.started?t&&!t.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist"):this.start()}start(){this.started=!0,this.isMain_?this.requestMain_((e,t)=>{this.haveMain_(),this.hasPendingRequest()||this.media_||this.media(this.mainPlaylistLoader_.main.playlists[0])}):this.mediaRequest_=window.setTimeout(()=>this.haveMain_(),0)}requestMain_(e){this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},(t,i)=>{if(this.requestErrored_(t,i))"HAVE_NOTHING"===this.state&&(this.started=!1);else{let n=i.responseText!==this.mainPlaylistLoader_.mainXml_;if(this.mainPlaylistLoader_.mainXml_=i.responseText,i.responseHeaders&&i.responseHeaders.date?this.mainLoaded_=Date.parse(i.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=a9(this.mainPlaylistLoader_.srcUrl,i),!n)return e(i,n);this.handleMain_(),this.syncClientServerClock_(()=>e(i,n))}})}syncClientServerClock_(e){let t=ax(this.mainPlaylistLoader_.mainXml_);return null===t?(this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()):"DIRECT"===t.method?(this.mainPlaylistLoader_.clientOffset_=t.value-Date.now(),e()):void(this.request=this.vhs_.xhr({uri:a7(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials},(i,n)=>{if(this.request){if(i)return this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e();let s;s="HEAD"===t.method?n.responseHeaders&&n.responseHeaders.date?Date.parse(n.responseHeaders.date):this.mainLoaded_:Date.parse(n.responseText),this.mainPlaylistLoader_.clientOffset_=s-Date.now(),e()}}))}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){this.mediaRequest_=null;var e=this.mainPlaylistLoader_.main;let t=oV({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e});e&&(t=o7(e,t,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=t||e;var i=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];return i&&i!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=i),(!e||t&&t.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),Boolean(t)}updateMinimumUpdatePeriodTimeout_(){var e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(window.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);let t=e.main&&e.main.minimumUpdatePeriod;0===t&&(e.media()?t=1e3*e.media().targetDuration:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),"number"!=typeof t||t<=0?t<0&&this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`):this.createMUPTimeout_(t)}createMUPTimeout_(e){let t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=window.setTimeout(()=>{t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)},e)}refreshXml_(){this.requestMain_((e,t)=>{var i,n;let s;t&&(this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=(i=this.mainPlaylistLoader_.main,n=this.mainPlaylistLoader_.sidxMapping_,s=oW(i.playlists,n),oS(i,(e,t,i,r)=>{e.playlists&&e.playlists.length&&(s=az(s,oW(e=e.playlists,n)))}),s),this.addSidxSegments_(this.media(),this.state,e=>{this.refreshMedia_(this.media().id)}))})}refreshMedia_(e){if(!e)throw Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();var t=this.mainPlaylistLoader_.main.playlists;let i=!this.media_||this.media_!==t[e];if(i?this.media_=t[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){let n=()=>{this.media().endList||(this.mediaUpdateTimeout=window.setTimeout(()=>{this.trigger("mediaupdatetimeout"),n()},oA(this.media(),Boolean(i))))};n()}this.trigger("loadedplaylist")}}var oG={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};function oX(e){return e.on=e.addEventListener,e.off=e.removeEventListener,e}let oK=e=>{var t=new Uint8Array(new ArrayBuffer(e.length));for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t.buffer};function oY(e){return function(){let t=function(e){try{return URL.createObjectURL(new Blob([e],{type:"application/javascript"}))}catch(t){var i=new BlobBuilder;return i.append(e),URL.createObjectURL(i.getBlob())}}(e);var i=oX(new Worker(t));i.objURL=t;let n=i.terminate;return i.on=i.addEventListener,i.off=i.removeEventListener,i.terminate=function(){return URL.revokeObjectURL(t),n.call(this)},i}}function oQ(e){return`var browserWorkerPolyFill = ${oX.toString()};
|
||
browserWorkerPolyFill(self);
|
||
`+e}function oZ(e){return e.toString().replace(/^function.+?{/,"").slice(0,-1)}var oJ=oY(oQ(oZ(function(){function e(){this.init=function(){var e={};this.on=function(t,i){e[t]||(e[t]=[]),e[t]=e[t].concat(i)},this.off=function(t,i){return!!e[t]&&(i=e[t].indexOf(i),e[t]=e[t].slice(),e[t].splice(i,1),-1<i)},this.trigger=function(t){var i,n,s,r=e[t];if(r){if(2===arguments.length)for(n=r.length,i=0;i<n;++i)r[i].call(this,arguments[1]);else{for(s=[],i=arguments.length,i=1;i<arguments.length;++i)s.push(arguments[i]);for(n=r.length,i=0;i<n;++i)r[i].apply(this,s)}}},this.dispose=function(){e={}}}}var t,i,n,s,r,a,o,l,u,d,h,c,p,m,f,g,y,v,b,$,T,w,_,S,k,E,C,x,I,P,A,L,D,O,R,N,M,B="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},U=(e.prototype.pipe=function(e){return this.on("data",function(t){e.push(t)}),this.on("done",function(t){e.flush(t)}),this.on("partialdone",function(t){e.partialFlush(t)}),this.on("endedtimeline",function(t){e.endTimeline(t)}),this.on("reset",function(t){e.reset(t)}),e},e.prototype.push=function(e){this.trigger("data",e)},e.prototype.flush=function(e){this.trigger("done",e)},e.prototype.partialFlush=function(e){this.trigger("partialdone",e)},e.prototype.endTimeline=function(e){this.trigger("endedtimeline",e)},e.prototype.reset=function(e){this.trigger("reset",e)},e),F={getUint64:function(e){var t,e=new DataView(e.buffer,e.byteOffset,e.byteLength);return e.getBigUint64?(t=e.getBigUint64(0))<Number.MAX_SAFE_INTEGER?Number(t):t:4294967296*e.getUint32(0)+e.getUint32(4)},MAX_UINT32:4294967296},j=F.MAX_UINT32;if(T={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:[]},"undefined"!=typeof Uint8Array){for(var q in T)T.hasOwnProperty(q)&&(T[q]=[q.charCodeAt(0),q.charCodeAt(1),q.charCodeAt(2),q.charCodeAt(3)]);w=new Uint8Array([105,115,111,109]),S=new Uint8Array([97,118,99,49]),_=new Uint8Array([0,0,0,1]),ee=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]),ei=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]),k={video:ee,audio:ei},x=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),C=new Uint8Array([0,0,0,0,0,0,0,0]),P=I=new Uint8Array([0,0,0,0,0,0,0,0]),A=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),L=I,E=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}function H(e,t){var i=et();return i.dataOffset=t,i.compositionTimeOffset=e.pts-e.dts,i.duration=e.duration,i.size=4*e.length,i.size+=e.byteLength,e.keyFrame&&(i.flags.dependsOn=2,i.flags.isNonSyncSample=0),i}function V(e){for(var t=[];e--;)t.push(0);return t}function W(e){e=e||{},W.prototype.init.call(this),this.parse708captions_="boolean"!=typeof e.parse708captions||e.parse708captions,this.captionPackets_=[],this.ccStreams_=[new eb(0,0),new eb(0,1),new eb(1,0),new eb(1,1)],this.parse708captions_&&(this.cc708Stream_=new eg({captionServices:e.captionServices})),this.reset(),this.ccStreams_.forEach(function(e){e.on("data",this.trigger.bind(this,"data")),e.on("partialdone",this.trigger.bind(this,"partialdone")),e.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")))}function z(e){return 32<=e&&e<=127||160<=e&&e<=255}function G(e){this.windowNum=e,this.reset()}function X(e,t,i){this.serviceNum=e,this.text="",this.currentWindow=new G(-1),this.windows=[],this.stream=i,"string"==typeof t&&this.createTextDecoder(t)}function K(e){return null===e?"":String.fromCharCode(e=ey[e]||e)}function Y(){for(var e=[],t=ev+1;t--;)e.push("");return e}function Q(e,t){var i=1;for(t<e&&(i=-1);Math.abs(t-e)>e_;)e+=i*ew;return e}function Z(e){var t,i;Z.prototype.init.call(this),this.type_=e||"shared",this.push=function(e){"shared"!==this.type_&&e.type!==this.type_||(void 0===i&&(i=e.dts),e.dts=Q(e.dts,i),e.pts=Q(e.pts,i),t=e.dts,this.trigger("data",e))},this.flush=function(){i=t,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){t=i=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}}t=function(e){for(var t,i=[],n=0,s=1;s<arguments.length;s++)i.push(arguments[s]);for(s=i.length;s--;)n+=i[s].byteLength;for(t=new Uint8Array(n+8),new DataView(t.buffer,t.byteOffset,t.byteLength).setUint32(0,t.byteLength),t.set(e,4),s=0,n=8;s<i.length;s++)t.set(i[s],n),n+=i[s].byteLength;return t},i=function(){return t(T.dinf,t(T.dref,x))},n=function(e){return t(T.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,e.audioobjecttype<<3|e.samplingfrequencyindex>>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2]))},m=function(e){return t(T.hdlr,k[e])},p=function(e){var i=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,e.duration>>>24&255,e.duration>>>16&255,e.duration>>>8&255,255&e.duration,85,196,0,0]);return e.samplerate&&(i[12]=e.samplerate>>>24&255,i[13]=e.samplerate>>>16&255,i[14]=e.samplerate>>>8&255,i[15]=255&e.samplerate),t(T.mdhd,i)},c=function(e){return t(T.mdia,p(e),m(e.type),a(e))},r=function(e){return t(T.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))},a=function(e){return t(T.minf,"video"===e.type?t(T.vmhd,E):t(T.smhd,C),i(),g(e))},l=function(e){for(var i=e.length,n=[];i--;)n[i]=b(e[i]);return t.apply(null,[T.mvex].concat(n))},u=function(e){return e=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e,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]),t(T.mvhd,e)},f=function(e){for(var i,n=e.samples||[],s=new Uint8Array(4+n.length),r=0;r<n.length;r++)i=n[r].flags,s[r+4]=i.dependsOn<<4|i.isDependedOn<<2|i.hasRedundancy;return t(T.sdtp,s)},g=function(e){return t(T.stbl,y(e),t(T.stts,L),t(T.stsc,P),t(T.stsz,A),t(T.stco,I))},y=function(e){return t(T.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),("video"===e.type?D:O)(e))},D=function(e){for(var i,n,s=e.sps||[],r=e.pps||[],a=[],o=[],l=0;l<s.length;l++)a.push((65280&s[l].byteLength)>>>8),a.push(255&s[l].byteLength),a=a.concat(Array.prototype.slice.call(s[l]));for(l=0;l<r.length;l++)o.push((65280&r[l].byteLength)>>>8),o.push(255&r[l].byteLength),o=o.concat(Array.prototype.slice.call(r[l]));return i=[T.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,(65280&e.width)>>8,255&e.width,(65280&e.height)>>8,255&e.height,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]),t(T.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([s.length],a,[r.length],o))),t(T.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],e.sarRatio&&(n=e.sarRatio[0],e=e.sarRatio[1],i.push(t(T.pasp,new Uint8Array([(4278190080&n)>>24,(16711680&n)>>16,(65280&n)>>8,255&n,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e])))),t.apply(null,i)},O=function(e){return t(T.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&e.channelcount)>>8,255&e.channelcount,(65280&e.samplesize)>>8,255&e.samplesize,0,0,0,0,(65280&e.samplerate)>>8,255&e.samplerate,0,0]),n(e))},h=function(e){return e=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,0,(4278190080&e.duration)>>24,(16711680&e.duration)>>16,(65280&e.duration)>>8,255&e.duration,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,(65280&e.width)>>8,255&e.width,0,0,(65280&e.height)>>8,255&e.height,0,0]),t(T.tkhd,e)},v=function(e){var i,n=t(T.tfhd,new Uint8Array([0,0,0,58,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),s=Math.floor(e.baseMediaDecodeTime/j),r=Math.floor(e.baseMediaDecodeTime%j),s=t(T.tfdt,new Uint8Array([1,0,0,0,s>>>24&255,s>>>16&255,s>>>8&255,255&s,r>>>24&255,r>>>16&255,r>>>8&255,255&r]));return"audio"===e.type?(i=$(e,92),t(T.traf,n,s,i)):(r=f(e),i=$(e,r.length+92),t(T.traf,n,s,i,r))},d=function(e){return e.duration=e.duration||4294967295,t(T.trak,h(e),c(e))},b=function(e){var i=new Uint8Array([0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==e.type&&(i[i.length-1]=0),t(T.trex,i)},R=function(e,t){var i=0,n=0,s=0,r=0;return e.length&&(void 0!==e[0].duration&&(i=1),void 0!==e[0].size&&(n=2),void 0!==e[0].flags&&(s=4),void 0!==e[0].compositionTimeOffset)&&(r=8),[0,0,i|n|s|r,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]},N=function(e,i){var n,s,r,a,o=e.samples||[];for(i+=20+16*o.length,e=R(o,i),(s=new Uint8Array(e.length+16*o.length)).set(e),n=e.length,a=0;a<o.length;a++)r=o[a],s[n++]=(4278190080&r.duration)>>>24,s[n++]=(16711680&r.duration)>>>16,s[n++]=(65280&r.duration)>>>8,s[n++]=255&r.duration,s[n++]=(4278190080&r.size)>>>24,s[n++]=(16711680&r.size)>>>16,s[n++]=(65280&r.size)>>>8,s[n++]=255&r.size,s[n++]=r.flags.isLeading<<2|r.flags.dependsOn,s[n++]=r.flags.isDependedOn<<6|r.flags.hasRedundancy<<4|r.flags.paddingValue<<1|r.flags.isNonSyncSample,s[n++]=61440&r.flags.degradationPriority,s[n++]=15&r.flags.degradationPriority,s[n++]=(4278190080&r.compositionTimeOffset)>>>24,s[n++]=(16711680&r.compositionTimeOffset)>>>16,s[n++]=(65280&r.compositionTimeOffset)>>>8,s[n++]=255&r.compositionTimeOffset;return t(T.trun,s)},M=function(e,i){var n,s,r,a,o=e.samples||[];for(i+=20+8*o.length,e=R(o,i),(n=new Uint8Array(e.length+8*o.length)).set(e),s=e.length,a=0;a<o.length;a++)r=o[a],n[s++]=(4278190080&r.duration)>>>24,n[s++]=(16711680&r.duration)>>>16,n[s++]=(65280&r.duration)>>>8,n[s++]=255&r.duration,n[s++]=(4278190080&r.size)>>>24,n[s++]=(16711680&r.size)>>>16,n[s++]=(65280&r.size)>>>8,n[s++]=255&r.size;return t(T.trun,n)},$=function(e,t){return("audio"===e.type?M:N)(e,t)};var J,ee={ftyp:s=function(){return t(T.ftyp,w,_,w,S)},mdat:function(e){return t(T.mdat,e)},moof:function(e,i){for(var n=[],s=i.length;s--;)n[s]=v(i[s]);return t.apply(null,[T.moof,r(e)].concat(n))},moov:o=function(e){for(var i=e.length,n=[];i--;)n[i]=d(e[i]);return t.apply(null,[T.moov,u(4294967295)].concat(n).concat(l(e)))},initSegment:function(e){var t=s(),e=o(e),i=new Uint8Array(t.byteLength+e.byteLength);return i.set(t),i.set(e,t.byteLength),i}},et=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},ei={groupNalsIntoFrames:function(e){var t,i,n=[],s=[];for(s.byteLength=0,s.nalCount=0,t=n.byteLength=s.duration=0;t<e.length;t++)"access_unit_delimiter_rbsp"===(i=e[t]).nalUnitType?(n.length&&(n.duration=i.dts-n.dts,s.byteLength+=n.byteLength,s.nalCount+=n.length,s.duration+=n.duration,s.push(n)),(n=[i]).byteLength=i.data.byteLength,n.pts=i.pts,n.dts=i.dts):("slice_layer_without_partitioning_rbsp_idr"===i.nalUnitType&&(n.keyFrame=!0),n.duration=i.dts-n.dts,n.byteLength+=i.data.byteLength,n.push(i));return s.length&&(!n.duration||n.duration<=0)&&(n.duration=s[s.length-1].duration),s.byteLength+=n.byteLength,s.nalCount+=n.length,s.duration+=n.duration,s.push(n),s},groupFramesIntoGops:function(e){var t,i,n=[],s=[];for(n.byteLength=0,n.nalCount=0,n.duration=0,n.pts=e[0].pts,n.dts=e[0].dts,s.byteLength=0,s.nalCount=0,s.duration=0,s.pts=e[0].pts,s.dts=e[0].dts,t=0;t<e.length;t++)(i=e[t]).keyFrame?(n.length&&(s.push(n),s.byteLength+=n.byteLength,s.nalCount+=n.nalCount,s.duration+=n.duration),(n=[i]).nalCount=i.length,n.byteLength=i.byteLength,n.pts=i.pts,n.dts=i.dts,n.duration=i.duration):(n.duration+=i.duration,n.nalCount+=i.length,n.byteLength+=i.byteLength,n.push(i));return s.length&&n.duration<=0&&(n.duration=s[s.length-1].duration),s.byteLength+=n.byteLength,s.nalCount+=n.nalCount,s.duration+=n.duration,s.push(n),s},extendFirstKeyFrame:function(e){var t;return!e[0][0].keyFrame&&1<e.length&&(t=e.shift(),e.byteLength-=t.byteLength,e.nalCount-=t.nalCount,e[0][0].dts=t.dts,e[0][0].pts=t.pts,e[0][0].duration+=t.duration),e},generateSampleTable:function(e,t){for(var i,n,s,r=t||0,a=[],o=0;o<e.length;o++)for(n=e[o],i=0;i<n.length;i++)s=n[i],r+=(s=H(s,r)).size,a.push(s);return a},concatenateNalData:function(e){for(var t,i,n,s,r,a=0,o=e.byteLength,l=e.nalCount,u=new Uint8Array(o+4*l),d=new DataView(u.buffer),h=0;h<e.length;h++)for(n=e[h],t=0;t<n.length;t++)for(s=n[t],i=0;i<s.length;i++)r=s[i],d.setUint32(a,r.data.byteLength),u.set(r.data,a+=4),a+=r.data.byteLength;return u},generateSampleTableForFrame:function(e,t){var i=[],e=H(e,t||0);return i.push(e),i},concatenateNalDataForFrame:function(e){for(var t,i=0,n=e.byteLength,s=e.length,r=new Uint8Array(n+4*s),a=new DataView(r.buffer),o=0;o<e.length;o++)t=e[o],a.setUint32(i,t.data.byteLength),r.set(t.data,i+=4),i+=t.data.byteLength;return r}},en=[33,16,5,32,164,27],es=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],er=function(e){return 9e4*e},ea=function(e,t){return e*t},eo=function(e){return e/9e4},el=function(e,t){return e/t},eu={ONE_SECOND_IN_TS:9e4,secondsToVideoTs:er,secondsToAudioTs:ea,videoTsToSeconds:eo,audioTsToSeconds:el,audioTsToVideoTs:function(e,t){return e/t*9e4},videoTsToAudioTs:function(e,t){return e/9e4*t},metadataTsToSeconds:function(e,t,i){return eo(i?e:e-t)}},ed=function(){var e,t;return J||(J=Object.keys(t=e={96e3:[en,[227,64],V(154),[56]],88200:[en,[231],V(170),[56]],64e3:[en,[248,192],V(240),[56]],48e3:[en,[255,192],V(268),[55,148,128],V(54),[112]],44100:[en,[255,192],V(268),[55,163,128],V(84),[112]],32e3:[en,[255,192],V(268),[55,234],V(226),[112]],24e3:[en,[255,192],V(268),[55,255,128],V(268),[111,112],V(126),[224]],16e3:[en,[255,192],V(268),[55,255,128],V(268),[111,255],V(269),[223,108],V(195),[1,192]],12e3:[es,V(268),[3,127,248],V(268),[6,255,240],V(268),[13,255,224],V(268),[27,253,128],V(259),[56]],11025:[es,V(268),[3,127,248],V(268),[6,255,240],V(268),[13,255,224],V(268),[27,255,192],V(268),[55,175,128],V(108),[112]],8e3:[es,V(268),[3,121,16],V(47),[7]]}).reduce(function(e,i){return e[i]=new Uint8Array(t[i].reduce(function(e,t){return e.concat(t)},[])),e},{})),J},eh=eu,er={prefixWithSilence:function(e,t,i,n){var s,r,a,o,l,u=0,d=0;if(t.length&&(r=eh.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),s=Math.ceil(eh.ONE_SECOND_IN_TS/(e.samplerate/1024)),i&&n&&(r-=Math.max(i,n),d=(u=Math.floor(r/s))*s),!(u<1||d>eh.ONE_SECOND_IN_TS/2))){for(a=(a=ed()[e.samplerate])||t[0].data,o=0;o<u;o++)l=t[0],t.splice(0,0,{data:a,dts:l.dts-s,pts:l.pts-s});return e.baseMediaDecodeTime-=Math.floor(eh.videoTsToAudioTs(d,e.samplerate)),d}},trimAdtsFramesByEarliestDts:function(e,t,i){return t.minSegmentDts>=i?e:(t.minSegmentDts=1/0,e.filter(function(e){return e.dts>=i&&(t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),t.minSegmentPts=t.minSegmentDts,!0)}))},generateSampleTable:function(e){for(var t,i=[],n=0;n<e.length;n++)i.push({size:(t=e[n]).data.byteLength,duration:1024});return i},concatenateFrameData:function(e){for(var t,i=0,n=new Uint8Array(function(e){for(var t=0,i=0;i<e.length;i++)t+=e[i].data.byteLength;return t}(e)),s=0;s<e.length;s++)t=e[s],n.set(t.data,i),i+=t.data.byteLength;return n}},ec=eu.ONE_SECOND_IN_TS,ea={clearDtsInfo:function(e){delete e.minSegmentDts,delete e.maxSegmentDts,delete e.minSegmentPts,delete e.maxSegmentPts},calculateTrackBaseMediaDecodeTime:function(e,t){var i=e.minSegmentDts;return t||(i-=e.timelineStartInfo.dts),t=e.timelineStartInfo.baseMediaDecodeTime,t+=i,t=Math.max(0,t),"audio"===e.type&&(t*=e.samplerate/ec,t=Math.floor(t)),t},collectDtsInfo:function(e,t){"number"==typeof t.pts&&(void 0===e.timelineStartInfo.pts&&(e.timelineStartInfo.pts=t.pts),void 0===e.minSegmentPts?e.minSegmentPts=t.pts:e.minSegmentPts=Math.min(e.minSegmentPts,t.pts),void 0===e.maxSegmentPts?e.maxSegmentPts=t.pts:e.maxSegmentPts=Math.max(e.maxSegmentPts,t.pts)),"number"==typeof t.dts&&(void 0===e.timelineStartInfo.dts&&(e.timelineStartInfo.dts=t.dts),void 0===e.minSegmentDts?e.minSegmentDts=t.dts:e.minSegmentDts=Math.min(e.minSegmentDts,t.dts),void 0===e.maxSegmentDts?e.maxSegmentDts=t.dts:e.maxSegmentDts=Math.max(e.maxSegmentDts,t.dts))}},el={parseSei:function(e){for(var t=0,i={payloadType:-1,payloadSize:0},n=0,s=0;t<e.byteLength&&128!==e[t];){for(;255===e[t];)n+=255,t++;for(n+=e[t++];255===e[t];)s+=255,t++;if(s+=e[t++],!i.payload&&4===n){if("GA94"===String.fromCharCode(e[t+3],e[t+4],e[t+5],e[t+6])){i.payloadType=n,i.payloadSize=s,i.payload=e.subarray(t,t+s);break}i.payload=void 0}t+=s,s=n=0}return i},parseUserData:function(e){return 181!==e.payload[0]||49!=(e.payload[1]<<8|e.payload[2])||"GA94"!==String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])||3!==e.payload[7]?null:e.payload.subarray(8,e.payload.length-1)},parseCaptionPackets:function(e,t){var i,n,s,r,a=[];if(64&t[0])for(n=31&t[0],i=0;i<n;i++)r={type:3&t[2+(s=3*i)],pts:e},4&t[2+s]&&(r.ccData=t[3+s]<<8|t[4+s],a.push(r));return a},discardEmulationPreventionBytes:function(e){for(var t=e.byteLength,i=[],n=1;n<t-2;)0===e[n]&&0===e[n+1]&&3===e[n+2]?(i.push(n+2),n+=2):n++;if(0===i.length)return e;for(var s=t-i.length,r=new Uint8Array(s),a=0,n=0;n<s;a++,n++)a===i[0]&&(a++,i.shift()),r[n]=e[a];return r},USER_DATA_REGISTERED_ITU_T_T35:4},ep=U,em=el,ef=((W.prototype=new ep).push=function(e){var t;"sei_rbsp"===e.nalUnitType&&(t=em.parseSei(e.escapedRBSP)).payload&&t.payloadType===em.USER_DATA_REGISTERED_ITU_T_T35&&(t=em.parseUserData(t))&&(e.dts<this.latestDts_?this.ignoreNextEqualDts_=!0:e.dts===this.latestDts_&&this.ignoreNextEqualDts_?(this.numSameDts_--,this.numSameDts_||(this.ignoreNextEqualDts_=!1)):(t=em.parseCaptionPackets(e.pts,t),this.captionPackets_=this.captionPackets_.concat(t),this.latestDts_!==e.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=e.dts))},W.prototype.flushCCStreams=function(e){this.ccStreams_.forEach(function(t){return"flush"===e?t.flush():t.partialFlush()},this)},W.prototype.flushStream=function(e){this.captionPackets_.length&&(this.captionPackets_.forEach(function(e,t){e.presortIndex=t}),this.captionPackets_.sort(function(e,t){return e.pts===t.pts?e.presortIndex-t.presortIndex:e.pts-t.pts}),this.captionPackets_.forEach(function(e){e.type<2?this.dispatchCea608Packet(e):this.dispatchCea708Packet(e)},this),this.captionPackets_.length=0),this.flushCCStreams(e)},W.prototype.flush=function(){return this.flushStream("flush")},W.prototype.partialFlush=function(){return this.flushStream("partialFlush")},W.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(e){e.reset()})},W.prototype.dispatchCea608Packet=function(e){this.setsTextOrXDSActive(e)?this.activeCea608Channel_[e.type]=null:this.setsChannel1Active(e)?this.activeCea608Channel_[e.type]=0:this.setsChannel2Active(e)&&(this.activeCea608Channel_[e.type]=1),null!==this.activeCea608Channel_[e.type]&&this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)},W.prototype.setsChannel1Active=function(e){return 4096==(30720&e.ccData)},W.prototype.setsChannel2Active=function(e){return 6144==(30720&e.ccData)},W.prototype.setsTextOrXDSActive=function(e){return 256==(28928&e.ccData)||4138==(30974&e.ccData)||6186==(30974&e.ccData)},W.prototype.dispatchCea708Packet=function(e){this.parse708captions_&&this.cc708Stream_.push(e)},{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}),eg=(G.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},G.prototype.getText=function(){return this.rows.join("\n")},G.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},G.prototype.newLine=function(e){for(this.rows.length>=this.virtualRowCount&&"function"==typeof this.beforeRowOverflow&&this.beforeRowOverflow(e),0<this.rows.length&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},G.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0]},G.prototype.addText=function(e){this.rows[this.rowIdx]+=e},G.prototype.backspace=function(){var e;this.isEmpty()||(e=this.rows[this.rowIdx],this.rows[this.rowIdx]=e.substr(0,e.length-1))},X.prototype.init=function(e,t){this.startPts=e;for(var i=0;i<8;i++)this.windows[i]=new G(i),"function"==typeof t&&(this.windows[i].beforeRowOverflow=t)},X.prototype.setCurrentWindow=function(e){this.currentWindow=this.windows[e]},X.prototype.createTextDecoder=function(e){if("undefined"==typeof TextDecoder)this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(e)}catch(t){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+e+" encoding. "+t})}},function(e){e=e||{},eg.prototype.init.call(this);var t,i=this,n=e.captionServices||{},s={};Object.keys(n).forEach(e=>{t=n[e],/^SERVICE/.test(e)&&(s[e]=t.encoding)}),this.serviceEncodings=s,this.current708Packet=null,this.services={},this.push=function(e){(3===e.type||null===i.current708Packet)&&i.new708Packet(),i.add708Bytes(e)}}),ey=(eg.prototype=new ep,eg.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},eg.prototype.add708Bytes=function(e){var t=e.ccData,i=t>>>8,t=255&t;this.current708Packet.ptsVals.push(e.pts),this.current708Packet.data.push(i),this.current708Packet.data.push(t)},eg.prototype.push708Packet=function(){var e,t=this.current708Packet,i=t.data,n=null,s=0,r=i[s++];for(t.seq=r>>6,t.sizeCode=63&r;s<i.length;s++)e=31&(r=i[s++]),7==(n=r>>5)&&0<e&&(n=i[s++]),this.pushServiceBlock(n,s,e),0<e&&(s+=e-1)},eg.prototype.pushServiceBlock=function(e,t,i){for(var n,s=t,r=this.current708Packet.data,a=(a=this.services[e])||this.initService(e,s);s<t+i&&s<r.length;s++)z(n=r[s])?s=this.handleText(s,a):24===n?s=this.multiByteCharacter(s,a):16===n?s=this.extendedCommands(s,a):128<=n&&n<=135?s=this.setCurrentWindow(s,a):152<=n&&n<=159?s=this.defineWindow(s,a):136===n?s=this.clearWindows(s,a):140===n?s=this.deleteWindows(s,a):137===n?s=this.displayWindows(s,a):138===n?s=this.hideWindows(s,a):139===n?s=this.toggleWindows(s,a):151===n?s=this.setWindowAttributes(s,a):144===n?s=this.setPenAttributes(s,a):145===n?s=this.setPenColor(s,a):146===n?s=this.setPenLocation(s,a):143===n?a=this.reset(s,a):8===n?a.currentWindow.backspace():12===n?a.currentWindow.clearText():13===n?a.currentWindow.pendingNewLine=!0:14===n?a.currentWindow.clearText():141===n&&s++},eg.prototype.extendedCommands=function(e,t){return e=z(this.current708Packet.data[++e])?this.handleText(e,t,{isExtended:!0}):e},eg.prototype.getPts=function(e){return this.current708Packet.ptsVals[Math.floor(e/2)]},eg.prototype.initService=function(e,t){var i,n="SERVICE"+e,s=this;return n in this.serviceEncodings&&(i=this.serviceEncodings[n]),this.services[e]=new X(e,i,s),this.services[e].init(this.getPts(t),function(t){s.flushDisplayed(t,s.services[e])}),this.services[e]},eg.prototype.handleText=function(e,t,i){var n,s=i&&i.isExtended,i=i&&i.isMultiByte,r=this.current708Packet.data,a=s?4096:0,o=r[e],r=r[e+1],l=t.currentWindow,r=t.textDecoder_&&!s?(i?(n=[o,r],e++):n=[o],t.textDecoder_.decode(new Uint8Array(n))):(i=ef[s=a|o]||s,4096&s&&s===i?"":String.fromCharCode(i));return l.pendingNewLine&&!l.isEmpty()&&l.newLine(this.getPts(e)),l.pendingNewLine=!1,l.addText(r),e},eg.prototype.multiByteCharacter=function(e,t){var i=this.current708Packet.data,n=i[e+1],i=i[e+2];return e=z(n)&&z(i)?this.handleText(++e,t,{isMultiByte:!0}):e},eg.prototype.setCurrentWindow=function(e,t){var i=this.current708Packet.data[e];return t.setCurrentWindow(7&i),e},eg.prototype.defineWindow=function(e,t){var i=this.current708Packet.data,n=i[e],t=(t.setCurrentWindow(7&n),t.currentWindow),n=i[++e];return t.visible=(32&n)>>5,t.rowLock=(16&n)>>4,t.columnLock=(8&n)>>3,t.priority=7&n,n=i[++e],t.relativePositioning=(128&n)>>7,t.anchorVertical=127&n,n=i[++e],t.anchorHorizontal=n,n=i[++e],t.anchorPoint=(240&n)>>4,t.rowCount=15&n,n=i[++e],t.columnCount=63&n,n=i[++e],t.windowStyle=(56&n)>>3,t.penStyle=7&n,t.virtualRowCount=t.rowCount+1,e},eg.prototype.setWindowAttributes=function(e,t){var i=this.current708Packet.data,t=(i[e],t.currentWindow.winAttr),n=i[++e];return t.fillOpacity=(192&n)>>6,t.fillRed=(48&n)>>4,t.fillGreen=(12&n)>>2,t.fillBlue=3&n,n=i[++e],t.borderType=(192&n)>>6,t.borderRed=(48&n)>>4,t.borderGreen=(12&n)>>2,t.borderBlue=3&n,n=i[++e],t.borderType+=(128&n)>>5,t.wordWrap=(64&n)>>6,t.printDirection=(48&n)>>4,t.scrollDirection=(12&n)>>2,t.justify=3&n,n=i[++e],t.effectSpeed=(240&n)>>4,t.effectDirection=(12&n)>>2,t.displayEffect=3&n,e},eg.prototype.flushDisplayed=function(e,t){for(var i=[],n=0;n<8;n++)t.windows[n].visible&&!t.windows[n].isEmpty()&&i.push(t.windows[n].getText());t.endPts=e,t.text=i.join("\n\n"),this.pushCaption(t),t.startPts=e},eg.prototype.pushCaption=function(e){""!==e.text&&(this.trigger("data",{startPts:e.startPts,endPts:e.endPts,text:e.text,stream:"cc708_"+e.serviceNum}),e.text="",e.startPts=e.endPts)},eg.prototype.displayWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var s=0;s<8;s++)i&1<<s&&(t.windows[s].visible=1);return e},eg.prototype.hideWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var s=0;s<8;s++)i&1<<s&&(t.windows[s].visible=0);return e},eg.prototype.toggleWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var s=0;s<8;s++)i&1<<s&&(t.windows[s].visible^=1);return e},eg.prototype.clearWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var s=0;s<8;s++)i&1<<s&&t.windows[s].clearText();return e},eg.prototype.deleteWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var s=0;s<8;s++)i&1<<s&&t.windows[s].reset();return e},eg.prototype.setPenAttributes=function(e,t){var i=this.current708Packet.data,t=(i[e],t.currentWindow.penAttr),n=i[++e];return t.textTag=(240&n)>>4,t.offset=(12&n)>>2,t.penSize=3&n,n=i[++e],t.italics=(128&n)>>7,t.underline=(64&n)>>6,t.edgeType=(56&n)>>3,t.fontStyle=7&n,e},eg.prototype.setPenColor=function(e,t){var i=this.current708Packet.data,t=(i[e],t.currentWindow.penColor),n=i[++e];return t.fgOpacity=(192&n)>>6,t.fgRed=(48&n)>>4,t.fgGreen=(12&n)>>2,t.fgBlue=3&n,n=i[++e],t.bgOpacity=(192&n)>>6,t.bgRed=(48&n)>>4,t.bgGreen=(12&n)>>2,t.bgBlue=3&n,n=i[++e],t.edgeRed=(48&n)>>4,t.edgeGreen=(12&n)>>2,t.edgeBlue=3&n,e},eg.prototype.setPenLocation=function(e,t){var i=this.current708Packet.data,n=(i[e],t.currentWindow.penLoc);return t.currentWindow.pendingNewLine=!0,t=i[++e],n.row=15&t,t=i[++e],n.column=63&t,e},eg.prototype.reset=function(e,t){var i=this.getPts(e);return this.flushDisplayed(i,t),this.initService(t.serviceNum,e)},{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}),ev=14,e8=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],eb=function(e,t){eb.prototype.init.call(this),this.field_=e||0,this.dataChannel_=t||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var t,i,n,s,r=32639&e.ccData;r===this.lastControlCode_?this.lastControlCode_=null:(4096==(61440&r)?this.lastControlCode_=r:r!==this.PADDING_&&(this.lastControlCode_=null),t=r>>>8,i=255&r,r!==this.PADDING_&&(r===this.RESUME_CAPTION_LOADING_?this.mode_="popOn":r===this.END_OF_CAPTION_?(this.mode_="popOn",this.clearFormatting(e.pts),this.flushDisplayed(e.pts),s=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=s,this.startPts_=e.pts):r===this.ROLL_UP_2_ROWS_?(this.rollUpRows_=2,this.setRollUp(e.pts)):r===this.ROLL_UP_3_ROWS_?(this.rollUpRows_=3,this.setRollUp(e.pts)):r===this.ROLL_UP_4_ROWS_?(this.rollUpRows_=4,this.setRollUp(e.pts)):r===this.CARRIAGE_RETURN_?(this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts):r===this.BACKSPACE_?"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1):r===this.ERASE_DISPLAYED_MEMORY_?(this.flushDisplayed(e.pts),this.displayed_=Y()):r===this.ERASE_NON_DISPLAYED_MEMORY_?this.nonDisplayed_=Y():r===this.RESUME_DIRECT_CAPTIONING_?("paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=Y()),this.mode_="paintOn",this.startPts_=e.pts):this.isSpecialCharacter(t,i)?(n=K((t=(3&t)<<8)|i),this[this.mode_](e.pts,n),this.column_++):this.isExtCharacter(t,i)?("popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),n=K((t=(3&t)<<8)|i),this[this.mode_](e.pts,n),this.column_++):this.isMidRowCode(t,i)?(this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14==(14&i)&&this.addFormatting(e.pts,["i"]),1==(1&i)&&this.addFormatting(e.pts,["u"])):this.isOffsetControlCode(t,i)?this.column_+=3&i:this.isPAC(t,i)?(s=e8.indexOf(7968&r),"rollUp"===this.mode_&&(s-this.rollUpRows_+1<0&&(s=this.rollUpRows_-1),this.setRollUp(e.pts,s)),s!==this.row_&&(this.clearFormatting(e.pts),this.row_=s),1&i&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),16==(16&r)&&(this.column_=4*((14&r)>>1)),this.isColorPAC(i)&&14==(14&i)&&this.addFormatting(e.pts,["i"])):this.isNormalChar(t)&&(0===i&&(i=null),n=K(t),n+=K(i),this[this.mode_](e.pts,n),this.column_+=n.length)))}},ep=(eb.prototype=new ep,eb.prototype.flushDisplayed=function(e){var t=this.displayed_.map(function(e,t){try{return e.trim()}catch(i){return this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+t+"."}),""}},this).join("\n").replace(/^\n+|\n+$/g,"");t.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_})},eb.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Y(),this.nonDisplayed_=Y(),this.lastControlCode_=null,this.column_=0,this.row_=ev,this.rollUpRows_=2,this.formatting_=[]},eb.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},eb.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&48<=t&&t<=63},eb.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&32<=t&&t<=63},eb.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&32<=t&&t<=47},eb.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&33<=t&&t<=35},eb.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&64<=t&&t<=127},eb.prototype.isColorPAC=function(e){return 64<=e&&e<=79||96<=e&&e<=127},eb.prototype.isNormalChar=function(e){return 32<=e&&e<=127},eb.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=ev,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=Y(),this.displayed_=Y()),void 0!==t&&t!==this.row_)for(var i=0;i<this.rollUpRows_;i++)this.displayed_[t-i]=this.displayed_[this.row_-i],this.displayed_[this.row_-i]="";void 0===t&&(t=this.row_),this.topRow_=t-this.rollUpRows_+1},eb.prototype.addFormatting=function(e,t){this.formatting_=this.formatting_.concat(t),t=t.reduce(function(e,t){return e+"<"+t+">"},""),this[this.mode_](e,t)},eb.prototype.clearFormatting=function(e){var t;this.formatting_.length&&(t=this.formatting_.reverse().reduce(function(e,t){return e+"</"+t+">"},""),this.formatting_=[],this[this.mode_](e,t))},eb.prototype.popOn=function(e,t){var i=this.nonDisplayed_[this.row_];this.nonDisplayed_[this.row_]=i+=t},eb.prototype.rollUp=function(e,t){var i=this.displayed_[this.row_];this.displayed_[this.row_]=i+=t},eb.prototype.shiftRowsUp_=function(){for(var e=0;e<this.topRow_;e++)this.displayed_[e]="";for(e=this.row_+1;e<ev+1;e++)this.displayed_[e]="";for(e=this.topRow_;e<this.row_;e++)this.displayed_[e]=this.displayed_[e+1];this.displayed_[this.row_]=""},eb.prototype.paintOn=function(e,t){var i=this.displayed_[this.row_];this.displayed_[this.row_]=i+=t},{CaptionStream:W,Cea608Stream:eb,Cea708Stream:eg}),e$={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},eT=U,ew=8589934592,e_=4294967296;function eS(e,t,i){for(var n="",s=t;s<i;s++)n+="%"+("00"+e[s].toString(16)).slice(-2);return n}function ek(e,t,i){return decodeURIComponent(eS(e,t,i))}function eE(e,t,i){return unescape(eS(e,t,i))}function eC(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]}Z.prototype=new eT;var e0,ex,eI,eT=Z,eP=(e,t,i)=>{if(e){for(var n=i;n<e.length;n++)if(e[n]===t)return n}return -1},eA={APIC:function(e){var t,i=1;3!==e.data[0]||(t=eP(e.data,0,1))<0||(e.mimeType=eE(e.data,1,t),e.pictureType=e.data[i=t+1],(t=eP(e.data,0,++i))<0)||(e.description=ek(e.data,i,t),i=t+1,"-->"===e.mimeType?e.url=eE(e.data,i,e.data.length):e.pictureData=e.data.subarray(i,e.data.length))},"T*":function(e){3===e.data[0]&&(e.value=ek(e.data,1,e.data.length).replace(/\0*$/,""),e.values=e.value.split("\0"))},TXXX:function(e){var t;3===e.data[0]&&-1!==(t=eP(e.data,0,1))&&(e.description=ek(e.data,1,t),e.value=ek(e.data,t+1,e.data.length).replace(/\0*$/,""),e.data=e.value)},"W*":function(e){e.url=eE(e.data,0,e.data.length).replace(/\0.*$/,"")},WXXX:function(e){var t;3===e.data[0]&&-1!==(t=eP(e.data,0,1))&&(e.description=ek(e.data,1,t),e.url=eE(e.data,t+1,e.data.length).replace(/\0.*$/,""))},PRIV:function(e){for(var t=0;t<e.data.length;t++)if(0===e.data[t]){e.owner=eE(e.data,0,t);break}e.privateData=e.data.subarray(t+1),e.data=e.privateData}},eL={parseId3Frames:function(e){var t,i=10,n=0,s=[];if(!(e.length<10||73!==e[0]||68!==e[1]||51!==e[2])){n=eC(e.subarray(6,10)),n+=10,64&e[5]&&(i=(i+=4)+eC(e.subarray(10,14)),n-=eC(e.subarray(16,20)));do{if((t=eC(e.subarray(i+4,i+8)))<1)break;var r={id:String.fromCharCode(e[i],e[i+1],e[i+2],e[i+3]),data:e.subarray(i+10,i+t+10)}}while(r.key=r.id,eA[r.id]?eA[r.id](r):"T"===r.id[0]?eA["T*"](r):"W"===r.id[0]&&eA["W*"](r),s.push(r),(i=i+10+t)<n);return s}},parseSyncSafeInteger:eC,frameParsers:eA},eD=U,eO=e$,eR=eL,eN=function(e){var t,i={descriptor:e&&e.descriptor},n=0,s=[],r=0;if(eN.prototype.init.call(this),this.dispatchType=eO.METADATA_STREAM_TYPE.toString(16),i.descriptor)for(t=0;t<i.descriptor.length;t++)this.dispatchType+=("00"+i.descriptor[t].toString(16)).slice(-2);this.push=function(e){var t,i,a,o,l,u,d;if("timed-metadata"===e.type){if(e.dataAlignmentIndicator&&(r=0,s.length=0),0===s.length&&(e.data.length<10||73!==e.data[0]||68!==e.data[1]||51!==e.data[2]))this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});else if(s.push(e),r+=e.data.byteLength,1===s.length&&(n=eR.parseSyncSafeInteger(e.data.subarray(6,10)),n+=10),!(r<n)){for(t={data:new Uint8Array(n),frames:[],pts:s[0].pts,dts:s[0].dts},o=0;o<n;)t.data.set(s[0].data.subarray(0,n-o),o),o+=s[0].data.byteLength,r-=s[0].data.byteLength,s.shift();i=10,64&t.data[5]&&(i=(i+=4)+eR.parseSyncSafeInteger(t.data.subarray(10,14)),n-=eR.parseSyncSafeInteger(t.data.subarray(16,20)));do if((a=eR.parseSyncSafeInteger(t.data.subarray(i+4,i+8)))<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break}while((d={id:String.fromCharCode(t.data[i],t.data[i+1],t.data[i+2],t.data[i+3]),data:t.data.subarray(i+10,i+a+10)}).key=d.id,eR.frameParsers[d.id]?eR.frameParsers[d.id](d):"T"===d.id[0]?eR.frameParsers["T*"](d):"W"===d.id[0]&&eR.frameParsers["W*"](d),"com.apple.streaming.transportStreamTimestamp"===d.owner&&(u=(1&(l=d.data)[3])<<30|l[4]<<22|l[5]<<14|l[6]<<6|l[7]>>>2,u=(u*=4)+(3&l[7]),d.timeStamp=u,void 0===t.pts&&void 0===t.dts&&(t.pts=d.timeStamp,t.dts=d.timeStamp),this.trigger("timestamp",d)),t.frames.push(d),(i=i+10+a)<n);this.trigger("data",t)}}}},eL=(eN.prototype=new eD,eN),eD=U,eM=ep,e3=e$,eB=function(){var e=new Uint8Array(188),t=0;eB.prototype.init.call(this),this.push=function(i){var n,s=0,r=188;for(t?((n=new Uint8Array(i.byteLength+t)).set(e.subarray(0,t)),n.set(i,t),t=0):n=i;r<n.byteLength;)71===n[s]&&71===n[r]?(this.trigger("data",n.subarray(s,r)),s+=188,r+=188):(s++,r++);s<n.byteLength&&(e.set(n.subarray(s),0),t=n.byteLength-s)},this.flush=function(){188===t&&71===e[0]&&(this.trigger("data",e),t=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){t=0,this.trigger("reset")}},eU=(eB.prototype=new eD,(e0=function(){var e,t,i,n;e0.prototype.init.call(this),(n=this).packetsWaitingForPmt=[],this.programMapTable=void 0,e=function(e,n){var s=0;n.payloadUnitStartIndicator&&(s+=e[s]+1),("pat"===n.type?t:i)(e.subarray(s),n)},t=function(e,t){t.section_number=e[7],t.last_section_number=e[8],n.pmtPid=(31&e[10])<<8|e[11],t.pmtPid=n.pmtPid},i=function(e,t){var i,s;if(1&e[5]){for(n.programMapTable={video:null,audio:null,"timed-metadata":{}},i=3+((15&e[1])<<8|e[2])-4,s=12+((15&e[10])<<8|e[11]);s<i;){var r=e[s],a=(31&e[s+1])<<8|e[s+2];r===e3.H264_STREAM_TYPE&&null===n.programMapTable.video?n.programMapTable.video=a:r===e3.ADTS_STREAM_TYPE&&null===n.programMapTable.audio?n.programMapTable.audio=a:r===e3.METADATA_STREAM_TYPE&&(n.programMapTable["timed-metadata"][a]=r),s+=5+((15&e[s+3])<<8|e[s+4])}t.programMapTable=n.programMapTable}},this.push=function(t){var i={},n=4;if(i.payloadUnitStartIndicator=!!(64&t[1]),i.pid=31&t[1],i.pid<<=8,i.pid|=t[2],1<(48&t[3])>>>4&&(n+=t[n]+1),0===i.pid)i.type="pat",e(t.subarray(n),i),this.trigger("data",i);else if(i.pid===this.pmtPid)for(i.type="pmt",e(t.subarray(n),i),this.trigger("data",i);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,n,i]):this.processPes_(t,n,i)},this.processPes_=function(e,t,i){i.pid===this.programMapTable.video?i.streamType=e3.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?i.streamType=e3.ADTS_STREAM_TYPE:i.streamType=this.programMapTable["timed-metadata"][i.pid],i.type="pes",i.data=e.subarray(t),this.trigger("data",i)}}).prototype=new eD,e0.STREAM_TYPES={h264:27,adts:15},(ex=function(){function e(e,t,n){var s,r=new Uint8Array(e.size),a={type:t},l=0,u=0;if(e.data.length&&!(e.size<9)){for(a.trackId=e.data[0].pid,l=0;l<e.data.length;l++)s=e.data[l],r.set(s.data,u),u+=s.data.byteLength;o(r,a),t="video"===t||a.packetLength<=e.size,(n||t)&&(e.size=0,e.data.length=0),t&&i.trigger("data",a)}}var t,i=this,n=!1,s={data:[],size:0},r={data:[],size:0},a={data:[],size:0},o=function(e,t){var i=e[0]<<16|e[1]<<8|e[2];t.data=new Uint8Array,1==i&&(t.packetLength=6+(e[4]<<8|e[5]),t.dataAlignmentIndicator=0!=(4&e[6]),192&(i=e[7])&&(t.pts=(14&e[9])<<27|(255&e[10])<<20|(254&e[11])<<12|(255&e[12])<<5|(254&e[13])>>>3,t.pts*=4,t.pts+=(6&e[13])>>>1,t.dts=t.pts,64&i)&&(t.dts=(14&e[14])<<27|(255&e[15])<<20|(254&e[16])<<12|(255&e[17])<<5|(254&e[18])>>>3,t.dts*=4,t.dts+=(6&e[18])>>>1),t.data=e.subarray(9+e[8]))};ex.prototype.init.call(this),this.push=function(o){({pat:function(){},pes:function(){var t,i;switch(o.streamType){case e3.H264_STREAM_TYPE:t=s,i="video";break;case e3.ADTS_STREAM_TYPE:t=r,i="audio";break;case e3.METADATA_STREAM_TYPE:t=a,i="timed-metadata";break;default:return}o.payloadUnitStartIndicator&&e(t,i,!0),t.data.push(o),t.size+=o.data.byteLength},pmt:function(){var e={type:"metadata",tracks:[]};null!==(t=o.programMapTable).video&&e.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+t.video,codec:"avc",type:"video"}),null!==t.audio&&e.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+t.audio,codec:"adts",type:"audio"}),n=!0,i.trigger("data",e)}})[o.type]()},this.reset=function(){s.size=0,s.data.length=0,r.size=0,r.data.length=0,this.trigger("reset")},this.flushStreams_=function(){e(s,"video"),e(r,"audio"),e(a,"timed-metadata")},this.flush=function(){var e;!n&&t&&(e={type:"metadata",tracks:[]},null!==t.video&&e.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+t.video,codec:"avc",type:"video"}),null!==t.audio&&e.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+t.audio,codec:"adts",type:"audio"}),i.trigger("data",e)),n=!1,this.flushStreams_(),this.trigger("done")}}).prototype=new eD,{PAT_PID:0,MP2T_PACKET_LENGTH:188,TransportPacketStream:eB,TransportParseStream:e0,ElementaryStream:ex,TimestampRolloverStream:eT,CaptionStream:eM.CaptionStream,Cea608Stream:eM.Cea608Stream,Cea708Stream:eM.Cea708Stream,MetadataStream:eL});for(eI in e3)e3.hasOwnProperty(eI)&&(eU[eI]=e3[eI]);var e2,e1,eD=eU,eT=U,e4=eu.ONE_SECOND_IN_TS,e6=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],eF=function(e){var t,i=0;eF.prototype.init.call(this),this.skipWarn_=function(e,t){this.trigger("log",{level:"warn",message:`adts skiping bytes ${e} to ${t} in frame ${i} outside syncword`})},this.push=function(n){var s,r,a,o,l,u,d=0;if(e||(i=0),"audio"===n.type){for(t&&t.length?(a=t,(t=new Uint8Array(a.byteLength+n.data.byteLength)).set(a),t.set(n.data,a.byteLength)):t=n.data;d+7<t.length;)if(255!==t[d]||240!=(246&t[d+1]))"number"!=typeof u&&(u=d),d++;else{if("number"==typeof u&&(this.skipWarn_(u,d),u=null),r=2*(1&~t[d+1]),s=(3&t[d+3])<<11|t[d+4]<<3|(224&t[d+5])>>5,l=(o=1024*(1+(3&t[d+6])))*e4/e6[(60&t[d+2])>>>2],t.byteLength-d<s)break;this.trigger("data",{pts:n.pts+i*l,dts:n.dts+i*l,sampleCount:o,audioobjecttype:1+(t[d+2]>>>6&3),channelcount:(1&t[d+2])<<2|(192&t[d+3])>>>6,samplerate:e6[(60&t[d+2])>>>2],samplingfrequencyindex:(60&t[d+2])>>>2,samplesize:16,data:t.subarray(d+7+r,d+s)}),i++,d+=s}"number"==typeof u&&(this.skipWarn_(u,d),u=null),t=t.subarray(d)}},this.flush=function(){i=0,this.trigger("done")},this.reset=function(){t=void 0,this.trigger("reset")},this.endTimeline=function(){t=void 0,this.trigger("endedtimeline")}},eM=(eF.prototype=new eT,eF),eL=U,ej=function(e){var t=e.byteLength,i=0,n=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+n},this.loadWord=function(){var s=e.byteLength-t,r=new Uint8Array(4),a=Math.min(4,t);if(0===a)throw Error("no bytes available");r.set(e.subarray(s,s+a)),i=new DataView(r.buffer).getUint32(0),n=8*a,t-=a},this.skipBits=function(e){var s;e<n||(e=(e-=n)-8*(s=Math.floor(e/8)),t-=s,this.loadWord()),i<<=e,n-=e},this.readBits=function(e){var s=Math.min(n,e),r=i>>>32-s;return 0<(n-=s)?i<<=s:0<t&&this.loadWord(),0<(s=e-s)?r<<s|this.readBits(s):r},this.skipLeadingZeros=function(){for(var e=0;e<n;++e)if(0!=(i&2147483648>>>e))return i<<=e,n-=e,e;return this.loadWord(),e+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1},this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();return 1&e?1+e>>>1:-1*(e>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()},e5=function(){var e,t,i=0;e5.prototype.init.call(this),this.push=function(n){for(var s,r=(t=t?((s=new Uint8Array(t.byteLength+n.data.byteLength)).set(t),s.set(n.data,t.byteLength),s):n.data).byteLength;i<r-3;i++)if(1===t[i+2]){e=i+5;break}for(;e<r;)switch(t[e]){case 0:if(0!==t[e-1])e+=2;else if(0!==t[e-2])e++;else{for(i+3!==e-2&&this.trigger("data",t.subarray(i+3,e-2));1!==t[++e]&&e<r;);i=e-2,e+=3}break;case 1:0!==t[e-1]||0!==t[e-2]||(this.trigger("data",t.subarray(i+3,e-2)),i=e-2),e+=3;break;default:e+=3}t=t.subarray(i),e-=i,i=0},this.reset=function(){t=null,i=0,this.trigger("reset")},this.flush=function(){t&&3<t.byteLength&&this.trigger("data",t.subarray(i+3)),t=null,i=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}};function eq(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]}e5.prototype=new eL,e1={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},(e2=function(){var e,t,i,n,s,r,a,o=new e5;e2.prototype.init.call(this),(e=this).push=function(e){"video"===e.type&&(t=e.trackId,i=e.pts,n=e.dts,o.push(e))},o.on("data",function(a){var o={trackId:t,pts:i,dts:n,data:a,nalUnitTypeCode:31&a[0]};switch(o.nalUnitTypeCode){case 5:o.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:o.nalUnitType="sei_rbsp",o.escapedRBSP=s(a.subarray(1));break;case 7:o.nalUnitType="seq_parameter_set_rbsp",o.escapedRBSP=s(a.subarray(1)),o.config=r(o.escapedRBSP);break;case 8:o.nalUnitType="pic_parameter_set_rbsp";break;case 9:o.nalUnitType="access_unit_delimiter_rbsp"}e.trigger("data",o)}),o.on("done",function(){e.trigger("done")}),o.on("partialdone",function(){e.trigger("partialdone")}),o.on("reset",function(){e.trigger("reset")}),o.on("endedtimeline",function(){e.trigger("endedtimeline")}),this.flush=function(){o.flush()},this.partialFlush=function(){o.partialFlush()},this.reset=function(){o.reset()},this.endTimeline=function(){o.endTimeline()},a=function(e,t){for(var i=8,n=8,s=0;s<e;s++)i=0===(n=0!==n?(i+t.readExpGolomb()+256)%256:n)?i:n},s=function(e){for(var t=e.byteLength,i=[],n=1;n<t-2;)0===e[n]&&0===e[n+1]&&3===e[n+2]?(i.push(n+2),n+=2):n++;if(0===i.length)return e;for(var s=t-i.length,r=new Uint8Array(s),a=0,n=0;n<s;a++,n++)a===i[0]&&(a++,i.shift()),r[n]=e[a];return r},r=function(e){var t,i,n,s,r,o,l=0,u=0,d=0,h=0,c=[1,1],p=new ej(e),e=p.readUnsignedByte(),m=p.readUnsignedByte(),f=p.readUnsignedByte();if(p.skipUnsignedExpGolomb(),e1[e]&&(3===(i=p.readUnsignedExpGolomb())&&p.skipBits(1),p.skipUnsignedExpGolomb(),p.skipUnsignedExpGolomb(),p.skipBits(1),p.readBoolean()))for(r=3!==i?8:12,o=0;o<r;o++)p.readBoolean()&&a(o<6?16:64,p);if(p.skipUnsignedExpGolomb(),0===(i=p.readUnsignedExpGolomb()))p.readUnsignedExpGolomb();else if(1===i)for(p.skipBits(1),p.skipExpGolomb(),p.skipExpGolomb(),t=p.readUnsignedExpGolomb(),o=0;o<t;o++)p.skipExpGolomb();if(p.skipUnsignedExpGolomb(),p.skipBits(1),i=p.readUnsignedExpGolomb(),n=p.readUnsignedExpGolomb(),0===(s=p.readBits(1))&&p.skipBits(1),p.skipBits(1),p.readBoolean()&&(l=p.readUnsignedExpGolomb(),u=p.readUnsignedExpGolomb(),d=p.readUnsignedExpGolomb(),h=p.readUnsignedExpGolomb()),p.readBoolean()&&p.readBoolean()){switch(p.readUnsignedByte()){case 1:c=[1,1];break;case 2:c=[12,11];break;case 3:c=[10,11];break;case 4:c=[16,11];break;case 5:c=[40,33];break;case 6:c=[24,11];break;case 7:c=[20,11];break;case 8:c=[32,11];break;case 9:c=[80,33];break;case 10:c=[18,11];break;case 11:c=[15,11];break;case 12:c=[64,33];break;case 13:c=[160,99];break;case 14:c=[4,3];break;case 15:c=[3,2];break;case 16:c=[2,1];break;case 255:c=[p.readUnsignedByte()<<8|p.readUnsignedByte(),p.readUnsignedByte()<<8|p.readUnsignedByte()]}c&&(c[0],c[1])}return{profileIdc:e,levelIdc:f,profileCompatibility:m,width:16*(i+1)-2*l-2*u,height:(2-s)*(n+1)*16-2*d-2*h,sarRatio:c}}}).prototype=new eL;var eT=e2,eH=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],eV=function(e,t){var i=0<=(i=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9])?i:0;return(16&e[t+5])>>4?20+i:10+i},e7=function(e,t){return e.length-t<10||73!==e[t]||68!==e[t+1]||51!==e[t+2]?t:(t+=eV(e,t),e7(e,t))},e9=function(e,t,i){for(var n="",s=t;s<i;s++)n+="%"+("00"+e[s].toString(16)).slice(-2);return n},eL={isLikelyAacData:function(e){var t=e7(e,0);return e.length>=t+2&&255==(255&e[t])&&240==(240&e[t+1])&&16==(22&e[t+1])},parseId3TagSize:eV,parseAdtsSize:function(e,t){var i=(224&e[t+5])>>5,n=e[t+4]<<3;return 6144&e[t+3]|n|i},parseType:function(e,t){return 73===e[t]&&68===e[t+1]&&51===e[t+2]?"timed-metadata":!0&e[t]&&240==(240&e[t+1])?"audio":null},parseSampleRate:function(e){for(var t=0;t+5<e.length;){if(255===e[t]&&240==(246&e[t+1]))return eH[(60&e[t+2])>>>2];t++}return null},parseAacTimestamp:function(e){var t,i=10;64&e[5]&&(i=(i+=4)+eq(e.subarray(10,14)));do{if((t=eq(e.subarray(i+4,i+8)))<1)break;if("PRIV"===String.fromCharCode(e[i],e[i+1],e[i+2],e[i+3])){for(var n,s,r=e.subarray(i+10,i+t+10),a=0;a<r.byteLength;a++)if(0===r[a]){if("com.apple.streaming.transportStreamTimestamp"===unescape(e9(r,0,a)))return s=(1&(n=r.subarray(a+1))[3])<<30|n[4]<<22|n[5]<<14|n[6]<<6|n[7]>>>2,(s*=4)+(3&n[7]);break}}}while((i=i+10+t)<e.byteLength);return null}},eW=U,ez=eL,eG=function(){var e=new Uint8Array,t=0;eG.prototype.init.call(this),this.setTimestamp=function(e){t=e},this.push=function(i){var n,s,r=0,a=0;for(e.length?(s=e.length,(e=new Uint8Array(i.byteLength+s)).set(e.subarray(0,s)),e.set(i,s)):e=i;3<=e.length-a;)if(73===e[a]&&68===e[a+1]&&51===e[a+2]){if(e.length-a<10||a+(r=ez.parseId3TagSize(e,a))>e.length)break;n={type:"timed-metadata",data:e.subarray(a,a+r)},this.trigger("data",n),a+=r}else if(255==(255&e[a])&&240==(240&e[a+1])){if(e.length-a<7||a+(r=ez.parseAdtsSize(e,a))>e.length)break;n={type:"audio",data:e.subarray(a,a+r),pts:t,dts:t},this.trigger("data",n),a+=r}else a++;e=0<(s=e.length-a)?e.subarray(a):new Uint8Array},this.reset=function(){e=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){e=new Uint8Array,this.trigger("endedtimeline")}};function eX(e,t){for(var i=Object.keys(t),n=0;n<i.length;n++){var s=i[n];"headOfPipeline"!==s&&t[s].on&&t[s].on("log",tp.bind(e,s))}}function eK(e,t){var i;if(e.length===t.length){for(i=0;i<e.length;i++)if(e[i]!==t[i])return;return 1}}function eY(e,t,i,n,s,r){return{start:{dts:e,pts:e+(i-t)},end:{dts:e+(n-t),pts:e+(s-i)},prependedContentDuration:r,baseMediaDecodeTime:e}}eG.prototype=new eW;var eQ,eZ,eJ,eW=U,te=ee,tt=ei,ti=er,tn=ea,ts=eD,tr=eu,ta=eM,to=eT,tl=eG,tu=eL.isLikelyAacData,td=eu.ONE_SECOND_IN_TS,th=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],tc=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],tp=function(e,t){t.stream=e,this.trigger("log",t)},tm=function(e,t){var i=[],n=0,s=0,r=1/0,a=(t=t||{}).firstSequenceNumber||0;tm.prototype.init.call(this),this.push=function(t){tn.collectDtsInfo(e,t),e&&th.forEach(function(i){e[i]=t[i]}),i.push(t)},this.setEarliestDts=function(e){n=e},this.setVideoBaseMediaDecodeTime=function(e){r=e},this.setAudioAppendStart=function(e){s=e},this.flush=function(){var o,l,u,d,h;0!==i.length&&(o=ti.trimAdtsFramesByEarliestDts(i,e,n),e.baseMediaDecodeTime=tn.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),h=ti.prefixWithSilence(e,o,s,r),e.samples=ti.generateSampleTable(o),u=te.mdat(ti.concatenateFrameData(o)),i=[],d=te.moof(a,[e]),l=new Uint8Array(d.byteLength+u.byteLength),a++,l.set(d),l.set(u,d.byteLength),tn.clearDtsInfo(e),u=Math.ceil(1024*td/e.samplerate),o.length&&(d=o.length*u,this.trigger("segmentTimingInfo",eY(tr.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),o[0].dts,o[0].pts,o[0].dts+d,o[0].pts+d,h||0)),this.trigger("timingInfo",{start:o[0].pts,end:o[0].pts+d})),this.trigger("data",{track:e,boxes:l})),this.trigger("done","AudioSegmentStream")},this.reset=function(){tn.clearDtsInfo(e),i=[],this.trigger("reset")}};function tf(e){var t="";return(t+=String.fromCharCode(e[0]))+String.fromCharCode(e[1])+String.fromCharCode(e[2])+String.fromCharCode(e[3])}function tg(e,t){var i,n,s,r=[];if(!t.length)return null;for(i=0;i<e.byteLength;)n=tT(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3]),s=tw(e.subarray(i+4,i+8)),n=1<n?i+n:e.byteLength,s===t[0]&&(1===t.length?r.push(e.subarray(i+8,n)):(s=tg(e.subarray(i+8,n),t.slice(1))).length&&(r=r.concat(s))),i=n;return r}function ty(e){return(31&e[1])<<8|e[2]}function tv(e){return!!(64&e[1])}function t8(e){var t=0;return 1<(48&e[3])>>>4&&(t+=e[4]+1),t}function tb(e){switch(e){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}}tm.prototype=new eW,(eQ=function(e,t){var i,n,s=[],r=[],a=(t=t||{}).firstSequenceNumber||0;eQ.prototype.init.call(this),delete e.minPTS,this.gopCache_=[],this.push=function(t){tn.collectDtsInfo(e,t),"seq_parameter_set_rbsp"!==t.nalUnitType||i||(i=t.config,e.sps=[t.data],tc.forEach(function(t){e[t]=i[t]},this)),"pic_parameter_set_rbsp"!==t.nalUnitType||n||(n=t.data,e.pps=[t.data]),s.push(t)},this.flush=function(){for(var i,n,o,l=0;s.length&&"access_unit_delimiter_rbsp"!==s[0].nalUnitType;)s.shift();if(0!==s.length){if(i=tt.groupNalsIntoFrames(s),(i=tt.groupFramesIntoGops(i))[0][0].keyFrame||((u=this.getGopForFusion_(s[0],e))?(l=u.duration,i.unshift(u),i.byteLength+=u.byteLength,i.nalCount+=u.nalCount,i.pts=u.pts,i.dts=u.dts,i.duration+=u.duration):i=tt.extendFirstKeyFrame(i)),r.length){var u=t.alignGopsAtEnd?this.alignGopsAtEnd_(i):this.alignGopsAtStart_(i);if(!u)return this.gopCache_.unshift({gop:i.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),s=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");tn.clearDtsInfo(e),i=u}tn.collectDtsInfo(e,i),e.samples=tt.generateSampleTable(i),u=te.mdat(tt.concatenateNalData(i)),e.baseMediaDecodeTime=tn.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),this.trigger("processedGopsInfo",i.map(function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}})),n=i[0],o=i[i.length-1],this.trigger("segmentTimingInfo",eY(e.baseMediaDecodeTime,n.dts,n.pts,o.dts+o.duration,o.pts+o.duration,l)),this.trigger("timingInfo",{start:i[0].pts,end:i[i.length-1].pts+i[i.length-1].duration}),this.gopCache_.unshift({gop:i.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),s=[],this.trigger("baseMediaDecodeTime",e.baseMediaDecodeTime),this.trigger("timelineStartInfo",e.timelineStartInfo),n=te.moof(a,[e]),o=new Uint8Array(n.byteLength+u.byteLength),a++,o.set(n),o.set(u,n.byteLength),this.trigger("data",{track:e,boxes:o})}this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),s=[],this.gopCache_.length=0,r.length=0,this.trigger("reset")},this.resetStream_=function(){tn.clearDtsInfo(e),n=i=void 0},this.getGopForFusion_=function(t){for(var i,n,s,r=1/0,a=0;a<this.gopCache_.length;a++)n=(s=this.gopCache_[a]).gop,e.pps&&eK(e.pps[0],s.pps[0])&&e.sps&&eK(e.sps[0],s.sps[0])&&(n.dts<e.timelineStartInfo.dts||-1e4<=(n=t.dts-n.dts-n.duration)&&n<=45e3&&(!i||n<r)&&(i=s,r=n));return i?i.gop:null},this.alignGopsAtStart_=function(e){for(var t,i,n,s,a=e.byteLength,o=e.nalCount,l=e.duration,u=t=0;u<r.length&&t<e.length&&(i=r[u],n=e[t],i.pts!==n.pts);)n.pts>i.pts?u++:(t++,a-=n.byteLength,o-=n.nalCount,l-=n.duration);return 0===t?e:t===e.length?null:((s=e.slice(t)).byteLength=a,s.duration=l,s.nalCount=o,s.pts=s[0].pts,s.dts=s[0].dts,s)},this.alignGopsAtEnd_=function(e){for(var t,i,n,s,a=r.length-1,o=e.length-1,l=null,u=!1;0<=a&&0<=o;){if(t=r[a],i=e[o],t.pts===i.pts){u=!0;break}t.pts>i.pts?a--:(a===r.length-1&&(l=o),o--)}return u||null!==l?0===(n=u?o:l)?e:(s=(n=e.slice(n)).reduce(function(e,t){return e.byteLength+=t.byteLength,e.duration+=t.duration,e.nalCount+=t.nalCount,e},{byteLength:0,duration:0,nalCount:0}),n.byteLength=s.byteLength,n.duration=s.duration,n.nalCount=s.nalCount,n.pts=n[0].pts,n.dts=n[0].dts,n):null},this.alignGopsWith=function(e){r=e}}).prototype=new eW,((eJ=function(e,t){this.numberOfTracks=0,this.metadataStream=t,void 0!==(e=e||{}).remux?this.remuxTracks=!!e.remux:this.remuxTracks=!0,"boolean"==typeof e.keepOriginalTimestamps?this.keepOriginalTimestamps=e.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,eJ.prototype.init.call(this),this.push=function(e){return e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):(this.pendingTracks.push(e.track),this.pendingBytes+=e.boxes.byteLength,"video"===e.track.type&&(this.videoTrack=e.track,this.pendingBoxes.push(e.boxes)),void("audio"===e.track.type&&(this.audioTrack=e.track,this.pendingBoxes.unshift(e.boxes))))}}).prototype=new eW).flush=function(e){var t,i,n,s=0,r={captions:[],captionStreams:{},metadata:[],info:{}},a=0;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==e&&"AudioSegmentStream"!==e||this.remuxTracks)return;if(0===this.pendingTracks.length)return this.emittedTracks++,void(this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}if(this.videoTrack?(a=this.videoTrack.timelineStartInfo.pts,tc.forEach(function(e){r.info[e]=this.videoTrack[e]},this)):this.audioTrack&&(a=this.audioTrack.timelineStartInfo.pts,th.forEach(function(e){r.info[e]=this.audioTrack[e]},this)),this.videoTrack||this.audioTrack){for(1===this.pendingTracks.length?r.type=this.pendingTracks[0].type:r.type="combined",this.emittedTracks+=this.pendingTracks.length,e=te.initSegment(this.pendingTracks),r.initSegment=new Uint8Array(e.byteLength),r.initSegment.set(e),r.data=new Uint8Array(this.pendingBytes),n=0;n<this.pendingBoxes.length;n++)r.data.set(this.pendingBoxes[n],s),s+=this.pendingBoxes[n].byteLength;for(n=0;n<this.pendingCaptions.length;n++)(t=this.pendingCaptions[n]).startTime=tr.metadataTsToSeconds(t.startPts,a,this.keepOriginalTimestamps),t.endTime=tr.metadataTsToSeconds(t.endPts,a,this.keepOriginalTimestamps),r.captionStreams[t.stream]=!0,r.captions.push(t);for(n=0;n<this.pendingMetadata.length;n++)(i=this.pendingMetadata[n]).cueTime=tr.metadataTsToSeconds(i.pts,a,this.keepOriginalTimestamps),r.metadata.push(i);for(r.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",r),n=0;n<r.captions.length;n++)t=r.captions[n],this.trigger("caption",t);for(n=0;n<r.metadata.length;n++)i=r.metadata[n],this.trigger("id3Frame",i)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},eJ.prototype.setRemux=function(e){this.remuxTracks=e},(eZ=function(e){var t,i,n=this,s=!0;eZ.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var s={};(this.transmuxPipeline_=s).type="aac",s.metadataStream=new ts.MetadataStream,s.aacStream=new tl,s.audioTimestampRolloverStream=new ts.TimestampRolloverStream("audio"),s.timedMetadataTimestampRolloverStream=new ts.TimestampRolloverStream("timed-metadata"),s.adtsStream=new ta,s.coalesceStream=new eJ(e,s.metadataStream),s.headOfPipeline=s.aacStream,s.aacStream.pipe(s.audioTimestampRolloverStream).pipe(s.adtsStream),s.aacStream.pipe(s.timedMetadataTimestampRolloverStream).pipe(s.metadataStream).pipe(s.coalesceStream),s.metadataStream.on("timestamp",function(e){s.aacStream.setTimestamp(e.timeStamp)}),s.aacStream.on("data",function(r){"timed-metadata"!==r.type&&"audio"!==r.type||s.audioSegmentStream||(i=i||{timelineStartInfo:{baseMediaDecodeTime:n.baseMediaDecodeTime},codec:"adts",type:"audio"},s.coalesceStream.numberOfTracks++,s.audioSegmentStream=new tm(i,e),s.audioSegmentStream.on("log",n.getLogTrigger_("audioSegmentStream")),s.audioSegmentStream.on("timingInfo",n.trigger.bind(n,"audioTimingInfo")),s.adtsStream.pipe(s.audioSegmentStream).pipe(s.coalesceStream),n.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t}))}),s.coalesceStream.on("data",this.trigger.bind(this,"data")),s.coalesceStream.on("done",this.trigger.bind(this,"done")),eX(this,s)},this.setupTsPipeline=function(){var s={};(this.transmuxPipeline_=s).type="ts",s.metadataStream=new ts.MetadataStream,s.packetStream=new ts.TransportPacketStream,s.parseStream=new ts.TransportParseStream,s.elementaryStream=new ts.ElementaryStream,s.timestampRolloverStream=new ts.TimestampRolloverStream,s.adtsStream=new ta,s.h264Stream=new to,s.captionStream=new ts.CaptionStream(e),s.coalesceStream=new eJ(e,s.metadataStream),s.headOfPipeline=s.packetStream,s.packetStream.pipe(s.parseStream).pipe(s.elementaryStream).pipe(s.timestampRolloverStream),s.timestampRolloverStream.pipe(s.h264Stream),s.timestampRolloverStream.pipe(s.adtsStream),s.timestampRolloverStream.pipe(s.metadataStream).pipe(s.coalesceStream),s.h264Stream.pipe(s.captionStream).pipe(s.coalesceStream),s.elementaryStream.on("data",function(r){var a;if("metadata"===r.type){for(a=r.tracks.length;a--;)t||"video"!==r.tracks[a].type?i||"audio"!==r.tracks[a].type||((i=r.tracks[a]).timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime):(t=r.tracks[a]).timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime;t&&!s.videoSegmentStream&&(s.coalesceStream.numberOfTracks++,s.videoSegmentStream=new eQ(t,e),s.videoSegmentStream.on("log",n.getLogTrigger_("videoSegmentStream")),s.videoSegmentStream.on("timelineStartInfo",function(t){i&&!e.keepOriginalTimestamps&&(i.timelineStartInfo=t,s.audioSegmentStream.setEarliestDts(t.dts-n.baseMediaDecodeTime))}),s.videoSegmentStream.on("processedGopsInfo",n.trigger.bind(n,"gopInfo")),s.videoSegmentStream.on("segmentTimingInfo",n.trigger.bind(n,"videoSegmentTimingInfo")),s.videoSegmentStream.on("baseMediaDecodeTime",function(e){i&&s.audioSegmentStream.setVideoBaseMediaDecodeTime(e)}),s.videoSegmentStream.on("timingInfo",n.trigger.bind(n,"videoTimingInfo")),s.h264Stream.pipe(s.videoSegmentStream).pipe(s.coalesceStream)),i&&!s.audioSegmentStream&&(s.coalesceStream.numberOfTracks++,s.audioSegmentStream=new tm(i,e),s.audioSegmentStream.on("log",n.getLogTrigger_("audioSegmentStream")),s.audioSegmentStream.on("timingInfo",n.trigger.bind(n,"audioTimingInfo")),s.audioSegmentStream.on("segmentTimingInfo",n.trigger.bind(n,"audioSegmentTimingInfo")),s.adtsStream.pipe(s.audioSegmentStream).pipe(s.coalesceStream)),n.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t})}}),s.coalesceStream.on("data",this.trigger.bind(this,"data")),s.coalesceStream.on("id3Frame",function(e){e.dispatchType=s.metadataStream.dispatchType,n.trigger("id3Frame",e)}),s.coalesceStream.on("caption",this.trigger.bind(this,"caption")),s.coalesceStream.on("done",this.trigger.bind(this,"done")),eX(this,s)},this.setBaseMediaDecodeTime=function(n){var s=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=n),i&&(i.timelineStartInfo.dts=void 0,i.timelineStartInfo.pts=void 0,tn.clearDtsInfo(i),s.audioTimestampRolloverStream)&&s.audioTimestampRolloverStream.discontinuity(),t&&(s.videoSegmentStream&&(s.videoSegmentStream.gopCache_=[]),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,tn.clearDtsInfo(t),s.captionStream.reset()),s.timestampRolloverStream&&s.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){i&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)},this.setRemux=function(t){var i=this.transmuxPipeline_;e.remux=t,i&&i.coalesceStream&&i.coalesceStream.setRemux(t)},this.alignGopsWith=function(e){t&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)},this.getLogTrigger_=function(e){var t=this;return function(i){i.stream=e,t.trigger("log",i)}},this.push=function(e){var t;s&&((t=tu(e))&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),s=!1),this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){s=!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()}}).prototype=new eW;var t$=eZ,U=function(e){return e>>>0},er=function(e){return("00"+e.toString(16)).slice(-2)},tT=U,tw=tf,t_=U,tS=F.getUint64,tk=function(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]}},ea="undefined"!=typeof window?window:void 0!==B?B:"undefined"!=typeof self?self:{},eD=ea,tE=el.discardEmulationPreventionBytes,tC=ep.CaptionStream,t0=tg,tx=function e(t){var i={version:t[0],flags:new Uint8Array(t.subarray(1,4))};return i.baseMediaDecodeTime=1===i.version?tS(t.subarray(4)):t_(t[4]<<24|t[5]<<16|t[6]<<8|t[7]),i},tI=function e(t){var i,n={version:t[0],flags:new Uint8Array(t.subarray(1,4)),samples:[]},s=new DataView(t.buffer,t.byteOffset,t.byteLength),r=1&n.flags[2],a=4&n.flags[2],o=1&n.flags[1],l=2&n.flags[1],u=4&n.flags[1],d=8&n.flags[1],h=s.getUint32(4),c=8;for(r&&(n.dataOffset=s.getInt32(c),c+=4),a&&h&&(i={flags:tk(t.subarray(c,c+4))},c+=4,o&&(i.duration=s.getUint32(c),c+=4),l&&(i.size=s.getUint32(c),c+=4),d&&(i.compositionTimeOffset=1===n.version?s.getInt32(c):s.getUint32(c),c+=4),n.samples.push(i),h--);h--;)i={},o&&(i.duration=s.getUint32(c),c+=4),l&&(i.size=s.getUint32(c),c+=4),u&&(i.flags=tk(t.subarray(c,c+4)),c+=4),d&&(i.compositionTimeOffset=1===n.version?s.getInt32(c):s.getUint32(c),c+=4),n.samples.push(i);return n},tP=function e(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),n=1&(t={version:t[0],flags:new Uint8Array(t.subarray(1,4)),trackId:i.getUint32(4)}).flags[2],s=2&t.flags[2],r=8&t.flags[2],a=16&t.flags[2],o=32&t.flags[2],l=65536&t.flags[0],u=131072&t.flags[0],d=8;return n&&(d+=4,t.baseDataOffset=i.getUint32(12),d+=4),s&&(t.sampleDescriptionIndex=i.getUint32(d),d+=4),r&&(t.defaultSampleDuration=i.getUint32(d),d+=4),a&&(t.defaultSampleSize=i.getUint32(d),d+=4),o&&(t.defaultSampleFlags=i.getUint32(d)),l&&(t.durationIsEmpty=!0),!n&&u&&(t.baseDataOffsetIsMoof=!0),t},tA=eD,tL=function(e,t){var i=t0(e,["moof","traf"]),e=t0(e,["mdat"]),n={},s=[];return e.forEach(function(e,t){t=i[t],s.push({mdat:e,traf:t})}),s.forEach(function(e){var i,s,r,a,o,l=e.mdat,e=e.traf,u=t0(e,["tfhd"]),u=tP(u[0]),d=u.trackId,h=t0(e,["tfdt"]),h=0<h.length?tx(h[0]).baseMediaDecodeTime:0,e=t0(e,["trun"]);t===d&&0<e.length&&(i=h,s=u.defaultSampleDuration||0,r=u.defaultSampleSize||0,a=u.trackId,o=[],e.forEach(function(e){(e=tI(e).samples).forEach(function(e){void 0===e.duration&&(e.duration=s),void 0===e.size&&(e.size=r),e.trackId=a,e.dts=i,void 0===e.compositionTimeOffset&&(e.compositionTimeOffset=0),"bigint"==typeof i?(e.pts=i+tA.BigInt(e.compositionTimeOffset),i+=tA.BigInt(e.duration)):(e.pts=i+e.compositionTimeOffset,i+=e.duration)}),o=o.concat(e)}),h=function(e,t,i){for(var n,s,r=new DataView(e.buffer,e.byteOffset,e.byteLength),a={logs:[],seiNals:[]},o=0;o+4<e.length;o+=n)if(n=r.getUint32(o),o+=4,!(n<=0))switch(31&e[o]){case 6:var l=e.subarray(o+1,o+1+n),u=function(e,t){for(var i=e,n=0;n<t.length;n++){var s=t[n];if(i<s.size)return s;i-=s.size}return null}(o,t),l={nalUnitType:"sei_rbsp",size:n,data:l,escapedRBSP:tE(l),trackId:i};if(u)l.pts=u.pts,l.dts=u.dts,s=u;else{if(!s){a.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+o+" for trackId "+i+". See mux.js#223."});break}l.pts=s.pts,l.dts=s.dts}a.seiNals.push(l)}return a}(l,o,d),n[d]||(n[d]={seiNals:[],logs:[]}),n[d].seiNals=n[d].seiNals.concat(h.seiNals),n[d].logs=n[d].logs.concat(h.logs))}),n},tD=function(){var e,t,i,n,s,r,a=!1;this.isInitialized=function(){return a},this.init=function(t){e=new tC,a=!0,r=!!t&&t.isPartial,e.on("data",function(e){e.startTime=e.startPts/n,e.endTime=e.endPts/n,s.captions.push(e),s.captionStreams[e.stream]=!0}),e.on("log",function(e){s.logs.push(e)})},this.isNewInit=function(e,t){return!(e&&0===e.length||t&&"object"==typeof t&&0===Object.keys(t).length||i===e[0]&&n===t[i])},this.parse=function(e,r,a){var o,l;if(!this.isInitialized()||!r||!a)return null;if(this.isNewInit(r,a))n=a[i=r[0]];else if(null===i||!n)return t.push(e),null;for(;0<t.length;){var u=t.shift();this.parse(u,r,a)}return l=n,(o=null===(o=i)?null:{seiNals:(e=tL(e,o)[o]||{}).seiNals,logs:e.logs,timescale:l})&&o.logs&&(s.logs=s.logs.concat(o.logs)),null!==o&&o.seiNals?(this.pushNals(o.seiNals),this.flushStream(),s):s.logs.length?{logs:s.logs,captions:[],captionStreams:[]}:null},this.pushNals=function(t){if(!this.isInitialized()||!t||0===t.length)return null;t.forEach(function(t){e.push(t)})},this.flushStream=function(){if(!this.isInitialized())return null;r?e.partialFlush():e.flush()},this.clearParsedCaptions=function(){s.captions=[],s.captionStreams={},s.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],n=i=null,s?this.clearParsedCaptions():s={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},tO=U,tR=er,tN=tg,tM=tf,t3=F.getUint64,tB=eD,tU=function(e){var t=0===e[0]?12:20;return tO(e[t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])},t2=function(e){var e=tN(e,["moov","trak"]),t=[];return e.forEach(function(e){var i,n={},s=tN(e,["tkhd"])[0],r=(s&&(r=(s=new DataView(s.buffer,s.byteOffset,s.byteLength)).getUint8(0),n.id=0===r?s.getUint32(12):s.getUint32(20)),tN(e,["mdia","hdlr"])[0]),r=(r&&(s=tM(r.subarray(8,12)),n.type="vide"===s?"video":"soun"===s?"audio":s),tN(e,["mdia","minf","stbl","stsd"])[0]),s=(r&&(s=r.subarray(8),n.codec=tM(s.subarray(4,8)),r=tN(s,[n.codec])[0])&&(/^[asm]vc[1-9]$/i.test(n.codec)?"avcC"===tM((i=r.subarray(78)).subarray(4,8))&&11<i.length?(n.codec+=".",n.codec+=tR(i[9]),n.codec+=tR(i[10]),n.codec+=tR(i[11])):n.codec="avc1.4d400d":/^mp4[a,v]$/i.test(n.codec)?"esds"===tM((i=r.subarray(28)).subarray(4,8))&&20<i.length&&0!==i[19]?(n.codec+="."+tR(i[19]),n.codec+="."+tR(i[20]>>>2&63).replace(/^0/,"")):n.codec="mp4a.40.2":n.codec=n.codec.toLowerCase()),tN(e,["mdia","mdhd"])[0]);s&&(n.timescale=tU(s)),t.push(n)}),t},t1=e$,t4=e$,t6=Q,tF={},tj=(tF.ts={parseType:function(e,t){return 0===(e=ty(e))?"pat":e===t?"pmt":t?"pes":null},parsePat:function(e){var t=tv(e),i=4+t8(e);return t&&(i+=e[i]+1),(31&e[i+10])<<8|e[i+11]},parsePmt:function(e){var t={},i=tv(e),n=4+t8(e);if(i&&(n+=e[n]+1),1&e[n+5]){for(var s=3+((15&e[n+1])<<8|e[n+2])-4,r=12+((15&e[n+10])<<8|e[n+11]);r<s;){var a=n+r;t[(31&e[a+1])<<8|e[a+2]]=e[a],r+=5+((15&e[a+3])<<8|e[a+4])}return t}},parsePayloadUnitStartIndicator:tv,parsePesType:function(e,t){switch(t[ty(e)]){case t1.H264_STREAM_TYPE:return"video";case t1.ADTS_STREAM_TYPE:return"audio";case t1.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},parsePesTime:function(e){var t,i,n;return!tv(e)||(t=4+t8(e))>=e.byteLength?null:(i=null,192&(n=e[t+7])&&((i={}).pts=(14&e[t+9])<<27|(255&e[t+10])<<20|(254&e[t+11])<<12|(255&e[t+12])<<5|(254&e[t+13])>>>3,i.pts*=4,i.pts+=(6&e[t+13])>>>1,i.dts=i.pts,64&n)&&(i.dts=(14&e[t+14])<<27|(255&e[t+15])<<20|(254&e[t+16])<<12|(255&e[t+17])<<5|(254&e[t+18])>>>3,i.dts*=4,i.dts+=(6&e[t+18])>>>1),i)},videoPacketContainsKeyFrame:function(e){for(var t=4+t8(e),i=e.subarray(t),n=0,s=0,r=!1;s<i.byteLength-3;s++)if(1===i[s+2]){n=s+5;break}for(;n<i.byteLength;)switch(i[n]){case 0:if(0!==i[n-1])n+=2;else if(0!==i[n-2])n++;else{for(s+3!==n-2&&"slice_layer_without_partitioning_rbsp_idr"===tb(31&i[s+3])&&(r=!0);1!==i[++n]&&n<i.length;);s=n-2,n+=3}break;case 1:0!==i[n-1]||0!==i[n-2]||("slice_layer_without_partitioning_rbsp_idr"===tb(31&i[s+3])&&(r=!0),s=n-2),n+=3;break;default:n+=3}return i=i.subarray(s),n-=s,s=0,r=!!i&&3<i.byteLength&&"slice_layer_without_partitioning_rbsp_idr"===tb(31&i[s+3])||r}},tF.aac=eL,eu.ONE_SECOND_IN_TS),t5=function(e,t){for(var i,n=0,s=188;s<e.byteLength;)if(71===e[n]&&71===e[s]){switch(i=e.subarray(n,s),tF.ts.parseType(i,t.pid)){case"pat":t.pid=tF.ts.parsePat(i);break;case"pmt":var r=tF.ts.parsePmt(i);t.table=t.table||{},Object.keys(r).forEach(function(e){t.table[e]=r[e]})}n+=188,s+=188}else n++,s++},tq=function(e,t,i){for(var n,s,r,a,o=0,l=188,u=!1;l<=e.byteLength;)if(71!==e[o]||71!==e[l]&&l!==e.byteLength)o++,l++;else{if(n=e.subarray(o,l),"pes"===tF.ts.parseType(n,t.pid)&&(s=tF.ts.parsePesType(n,t.table),r=tF.ts.parsePayloadUnitStartIndicator(n),"audio"===s)&&r&&(a=tF.ts.parsePesTime(n))&&(a.type="audio",i.audio.push(a),u=!0),u)break;o+=188,l+=188}for(o=(l=e.byteLength)-188,u=!1;0<=o;)if(71!==e[o]||71!==e[l]&&l!==e.byteLength)o--,l--;else{if(n=e.subarray(o,l),"pes"===tF.ts.parseType(n,t.pid)&&(s=tF.ts.parsePesType(n,t.table),r=tF.ts.parsePayloadUnitStartIndicator(n),"audio"===s)&&r&&(a=tF.ts.parsePesTime(n))&&(a.type="audio",i.audio.push(a),u=!0),u)break;o-=188,l-=188}},tH=function(e,t,i){for(var n,s,r,a,o,l,u,d,h=0,c=188,p=!1,m={data:[],size:0};c<e.byteLength;)if(71===e[h]&&71===e[c]){if(n=e.subarray(h,c),"pes"===tF.ts.parseType(n,t.pid)&&(s=tF.ts.parsePesType(n,t.table),r=tF.ts.parsePayloadUnitStartIndicator(n),"video"===s&&(r&&!p&&(a=tF.ts.parsePesTime(n))&&(a.type="video",i.video.push(a),p=!0),!i.firstKeyFrame))){if(r&&0!==m.size){for(o=new Uint8Array(m.size),l=0;m.data.length;)u=m.data.shift(),o.set(u,l),l+=u.byteLength;tF.ts.videoPacketContainsKeyFrame(o)&&(d=tF.ts.parsePesTime(o))&&(i.firstKeyFrame=d,i.firstKeyFrame.type="video"),m.size=0}m.data.push(n),m.size+=n.byteLength}if(p&&i.firstKeyFrame)break;h+=188,c+=188}else h++,c++;for(h=(c=e.byteLength)-188,p=!1;0<=h;)if(71===e[h]&&71===e[c]){if(n=e.subarray(h,c),"pes"===tF.ts.parseType(n,t.pid)&&(s=tF.ts.parsePesType(n,t.table),r=tF.ts.parsePayloadUnitStartIndicator(n),"video"===s)&&r&&(a=tF.ts.parsePesTime(n))&&(a.type="video",i.video.push(a),p=!0),p)break;h-=188,c-=188}else h--,c--},tV=function(e,t){var i,n,s,e=(tF.aac.isLikelyAacData(e)?function(e){for(var t,i,n=!1,s=0,r=null,a=null,o=0,l=0;3<=e.length-l;){switch(tF.aac.parseType(e,l)){case"timed-metadata":e.length-l<10?n=!0:(o=tF.aac.parseId3TagSize(e,l))>e.length?n=!0:(null===a&&(t=e.subarray(l,l+o),a=tF.aac.parseAacTimestamp(t)),l+=o);break;case"audio":e.length-l<7?n=!0:(o=tF.aac.parseAdtsSize(e,l))>e.length?n=!0:(null===r&&(t=e.subarray(l,l+o),r=tF.aac.parseSampleRate(t)),s++,l+=o);break;default:l++}if(n)return null}return null===r||null===a?null:{audio:[{type:"audio",dts:a,pts:a},{type:"audio",dts:a+1024*s*(i=tj/r),pts:a+1024*s*i}]}}:function(e){var t,i={pid:null,table:null},n={};for(t in t5(e,i),i.table)if(i.table.hasOwnProperty(t))switch(i.table[t]){case t4.H264_STREAM_TYPE:n.video=[],tH(e,i,n),0===n.video.length&&delete n.video;break;case t4.ADTS_STREAM_TYPE:n.audio=[],tq(e,i,n),0===n.audio.length&&delete n.audio}return n})(e);return e&&(e.audio||e.video)?((i=e).audio&&i.audio.length&&((void 0===(n=t)||isNaN(n))&&(n=i.audio[0].dts),i.audio.forEach(function(e){e.dts=t6(e.dts,n),e.pts=t6(e.pts,n),e.dtsTime=e.dts/tj,e.ptsTime=e.pts/tj})),i.video&&i.video.length&&((void 0===(s=t)||isNaN(s))&&(s=i.video[0].dts),i.video.forEach(function(e){e.dts=t6(e.dts,s),e.pts=t6(e.pts,s),e.dtsTime=e.dts/tj,e.ptsTime=e.pts/tj}),i.firstKeyFrame)&&((t=i.firstKeyFrame).dts=t6(t.dts,s),t.pts=t6(t.pts,s),t.dtsTime=t.dts/tj,t.ptsTime=t.pts/tj),e):null};class t7{constructor(e,t){this.options=t||{},this.self=e,this.init()}init(){var e,t;this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new t$(this.options),e=this.self,(t=this.transmuxer).on("data",function(t){var i=t.initSegment,i=(t.initSegment={data:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength},t.data);t.data=i.buffer,e.postMessage({action:"data",segment:t,byteOffset:i.byteOffset,byteLength:i.byteLength},[t.data])}),t.on("done",function(t){e.postMessage({action:"done"})}),t.on("gopInfo",function(t){e.postMessage({action:"gopInfo",gopInfo:t})}),t.on("videoSegmentTimingInfo",function(t){var i={start:{decode:eu.videoTsToSeconds(t.start.dts),presentation:eu.videoTsToSeconds(t.start.pts)},end:{decode:eu.videoTsToSeconds(t.end.dts),presentation:eu.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:eu.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=eu.videoTsToSeconds(t.prependedContentDuration)),e.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:i})}),t.on("audioSegmentTimingInfo",function(t){var i={start:{decode:eu.videoTsToSeconds(t.start.dts),presentation:eu.videoTsToSeconds(t.start.pts)},end:{decode:eu.videoTsToSeconds(t.end.dts),presentation:eu.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:eu.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=eu.videoTsToSeconds(t.prependedContentDuration)),e.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:i})}),t.on("id3Frame",function(t){e.postMessage({action:"id3Frame",id3Frame:t})}),t.on("caption",function(t){e.postMessage({action:"caption",caption:t})}),t.on("trackinfo",function(t){e.postMessage({action:"trackinfo",trackInfo:t})}),t.on("audioTimingInfo",function(t){e.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:eu.videoTsToSeconds(t.start),end:eu.videoTsToSeconds(t.end)}})}),t.on("videoTimingInfo",function(t){e.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:eu.videoTsToSeconds(t.start),end:eu.videoTsToSeconds(t.end)}})}),t.on("log",function(t){e.postMessage({action:"log",log:t})})}pushMp4Captions(e){this.captionParser||(this.captionParser=new tD,this.captionParser.init());var t=new Uint8Array(e.data,e.byteOffset,e.byteLength),e=this.captionParser.parse(t,e.trackIds,e.timescales);this.self.postMessage({action:"mp4Captions",captions:e&&e.captions||[],logs:e&&e.logs||[],data:t.buffer},[t.buffer])}probeMp4StartTime({timescales:e,data:t}){var i,n;e=(i=e,"bigint"==typeof(n=tN(n=t,["moof","traf"]).reduce(function(e,t){var n=tN(t,["tfhd"])[0],n=tO(n[4]<<24|n[5]<<16|n[6]<<8|n[7]),n=i[n]||9e4,t=tN(t,["tfdt"])[0],s=new DataView(t.buffer,t.byteOffset,t.byteLength),t=1===t[0]?t3(t.subarray(4,12)):s.getUint32(4);let r;return"bigint"==typeof t?r=t/tB.BigInt(n):"number"!=typeof t||isNaN(t)||(r=t/n),e=(r=r<Number.MAX_SAFE_INTEGER?Number(r):r)<e?r:e},1/0))||isFinite(n)?n:0),this.self.postMessage({action:"probeMp4StartTime",startTime:e,data:t},[t.buffer])}probeMp4Tracks({data:e}){var t=t2(e);this.self.postMessage({action:"probeMp4Tracks",tracks:t,data:e},[e.buffer])}probeTs({data:e,baseStartTime:t}){t="number"!=typeof t||isNaN(t)?void 0:t*eu.ONE_SECOND_IN_TS;let i=null;(t=tV(e,t))&&((i={hasVideo:t.video&&2===t.video.length||!1,hasAudio:t.audio&&2===t.audio.length||!1}).hasVideo&&(i.videoStart=t.video[0].ptsTime),i.hasAudio)&&(i.audioStart=t.audio[0].ptsTime),this.self.postMessage({action:"probeTs",result:i,data:e},[e.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(e){e=new Uint8Array(e.data,e.byteOffset,e.byteLength),this.transmuxer.push(e)}reset(){this.transmuxer.reset()}setTimestampOffset(e){e=e.timestampOffset||0,this.transmuxer.setBaseMediaDecodeTime(Math.round(eu.secondsToVideoTs(e)))}setAudioAppendStart(e){this.transmuxer.setAudioAppendStart(Math.ceil(eu.secondsToVideoTs(e.appendStart)))}setRemux(e){this.transmuxer.setRemux(e.remux)}flush(e){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())}}self.onmessage=function(e){"init"===e.data.action&&e.data.options?this.messageHandlers=new t7(self,e.data.options):(this.messageHandlers||(this.messageHandlers=new t7(self)),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data))}})));let le=(e,t,i)=>{var{type:n,initSegment:s,captions:r,captionStreams:a,metadata:o,videoFrameDtsTime:l,videoFramePtsTime:u}=e.data.segment,t=(t.buffer.push({captions:r,captionStreams:a,metadata:o}),e.data.segment.boxes||{data:e.data.segment.data}),r={type:n,data:new Uint8Array(t.data,t.data.byteOffset,t.data.byteLength),initSegment:new Uint8Array(s.data,s.byteOffset,s.byteLength)};void 0!==l&&(r.videoFrameDtsTime=l),void 0!==u&&(r.videoFramePtsTime=u),i(r)},lt=({transmuxedData:e,callback:t})=>{e.buffer=[],t(e)},li=(e,t)=>{t.gopInfo=e.data.gopInfo},ln=e=>{var t,i;let{transmuxer:n,bytes:s,audioAppendStart:r,gopsToAlignWith:a,remux:o,onData:l,onTrackInfo:u,onAudioTimingInfo:d,onVideoTimingInfo:h,onVideoSegmentTimingInfo:c,onAudioSegmentTimingInfo:p,onId3:m,onCaptions:f,onDone:g,onEndedTimeline:y,onTransmuxerLog:v,isEndOfTimeline:b}=e,$={buffer:[]},T=b;n.onmessage=t=>{n.currentTransmux!==e||("data"===t.data.action&&le(t,$,l),"trackinfo"===t.data.action&&u(t.data.trackInfo),"gopInfo"===t.data.action&&li(t,$),"audioTimingInfo"===t.data.action&&d(t.data.audioTimingInfo),"videoTimingInfo"===t.data.action&&h(t.data.videoTimingInfo),"videoSegmentTimingInfo"===t.data.action&&c(t.data.videoSegmentTimingInfo),"audioSegmentTimingInfo"===t.data.action&&p(t.data.audioSegmentTimingInfo),"id3Frame"===t.data.action&&m([t.data.id3Frame],t.data.id3Frame.dispatchType),"caption"===t.data.action&&f(t.data.caption),"endedtimeline"===t.data.action&&(T=!1,y()),"log"===t.data.action&&v(t.data.log),"transmuxed"!==t.data.type)||T||(n.onmessage=null,lt({transmuxedData:$,callback:g}),ls(n))},r&&n.postMessage({action:"setAudioAppendStart",appendStart:r}),Array.isArray(a)&&n.postMessage({action:"alignGopsWith",gopsToAlignWith:a}),void 0!==o&&n.postMessage({action:"setRemux",remux:o}),s.byteLength&&(t=s instanceof ArrayBuffer?s:s.buffer,i=s instanceof ArrayBuffer?0:s.byteOffset,n.postMessage({action:"push",data:t,byteOffset:i,byteLength:s.byteLength},[t])),b&&n.postMessage({action:"endTimeline"}),n.postMessage({action:"flush"})},ls=e=>{e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),"function"==typeof e.currentTransmux?e.currentTransmux():ln(e.currentTransmux))},lr=(e,t)=>{e.postMessage({action:t}),ls(e)},la=(e,t)=>{t.currentTransmux?t.transmuxQueue.push(lr.bind(null,t,e)):(t.currentTransmux=e,lr(t,e))},lo=e=>{e.transmuxer.currentTransmux?e.transmuxer.transmuxQueue.push(e):(e.transmuxer.currentTransmux=e,ln(e))};var ll=e=>{la("reset",e)},lu=e=>{let t=new oJ,i=(t.currentTransmux=null,t.transmuxQueue=[],t.terminate);return t.terminate=()=>(t.currentTransmux=null,t.transmuxQueue.length=0,i.call(t)),t.postMessage({action:"init",options:e}),t};function ld(e){let t=e.transmuxer,i=e.endAction||e.action,n=e.callback;var s,r=t3({},e,{endAction:null,transmuxer:null,callback:null});let a=s=>{s.data.action===i&&(t.removeEventListener("message",a),s.data.data&&(s.data.data=new Uint8Array(s.data.data,e.byteOffset||0,e.byteLength||s.data.data.byteLength),e.data)&&(e.data=s.data.data),n(s.data))};t.addEventListener("message",a),e.data?(s=e.data instanceof ArrayBuffer,r.byteOffset=s?0:e.data.byteOffset,r.byteLength=e.data.byteLength,s=[s?e.data:e.data.buffer],t.postMessage(r,s)):t.postMessage(r)}function lh(e){let t=0;return e.audio&&t++,e.video&&t++,t}function lc(e,t){var i=t.attributes||{},n=l0(function(e){if((e=e.attributes||{}).CODECS)return sg(e.CODECS)}(t)||[]);return!lC(e,t)||n.audio||((e,t)=>{if(!lC(e,t))return!0;var t=t.attributes||{},i=e.mediaGroups.AUDIO[t.AUDIO];for(let n in i)if(!i[n].uri&&!i[n].playlists)return!0;return!1})(e,t)||(t=l0(function(e,t){if(e.mediaGroups.AUDIO&&t){var i=e.mediaGroups.AUDIO[t];if(i){for(var n in i)if((n=i[n]).default&&n.playlists)return sg(n.playlists[0].attributes.CODECS)}}return null}(e,i.AUDIO)||[])).audio&&(n.audio=t.audio),n}function lp(e,t){return(e=e&&window.getComputedStyle(e))?e[t]:""}function lm(e,t){let i,n;return(i=(i=e.attributes.BANDWIDTH?e.attributes.BANDWIDTH:i)||window.Number.MAX_VALUE)-(n=(n=t.attributes.BANDWIDTH?t.attributes.BANDWIDTH:n)||window.Number.MAX_VALUE)}let lf={FAILURE:2,TIMEOUT:-101,ABORTED:-102},lg=e=>{e.forEach(e=>{e.abort()})},ly=e=>({bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}),lv=e=>{var t=e.target,t={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-t.requestTime||0};return t.bytesReceived=e.loaded,t.bandwidth=Math.floor(t.bytesReceived/t.roundTripTime*8e3),t},l8=(e,t)=>t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:lf.TIMEOUT,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:lf.ABORTED,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:lf.FAILURE,xhr:t}:"arraybuffer"===t.responseType&&0===t.response.byteLength?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:lf.FAILURE,xhr:t}:null,lb=(e,t,i)=>(n,s)=>{var r=s.response,n=l8(n,s);if(n)return i(n,e);if(16!==r.byteLength)return i({status:s.status,message:"Invalid HLS key at URL: "+s.uri,code:lf.FAILURE,xhr:s},e);var n=new DataView(r),a=new Uint32Array([n.getUint32(0),n.getUint32(4),n.getUint32(8),n.getUint32(12)]);for(let o=0;o<t.length;o++)t[o].bytes=a;return i(null,e)},l$=(e,t)=>{var i,n=aO(e.map.bytes);if("mp4"!==n)return t({internal:!0,message:`Found unsupported ${n||"unknown"} container for initialization segment at URL: `+(i=e.map.resolvedUri||e.map.uri),code:lf.FAILURE});ld({action:"probeMp4Tracks",data:e.map.bytes,transmuxer:e.transmuxer,callback:({tracks:i,data:n})=>(e.map.bytes=n,i.forEach(function(t){e.map.tracks=e.map.tracks||{},e.map.tracks[t.type]||"number"==typeof(e.map.tracks[t.type]=t).id&&t.timescale&&(e.map.timescales=e.map.timescales||{},e.map.timescales[t.id]=t.timescale)}),t(null))})},lT=({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:d,doneFn:h,onTransmuxerLog:c})=>{var p=e.map&&e.map.tracks||{};let m=Boolean(p.audio&&p.video),f=n.bind(null,e,"audio","start"),g=n.bind(null,e,"audio","end"),y=n.bind(null,e,"video","start"),v=n.bind(null,e,"video","end");ld({action:"probeTs",transmuxer:e.transmuxer,data:t,baseStartTime:e.baseStartTime,callback(n){e.bytes=t=n.data,(n=n.result)&&(i(e,{hasAudio:n.hasAudio,hasVideo:n.hasVideo,isMuxed:m}),i=null,n.hasAudio&&!m&&f(n.audioStart),n.hasVideo&&y(n.videoStart),f=null,y=null),lo({bytes:t,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,remux:m,onData(t){t.type="combined"===t.type?"video":t.type,d(e,t)},onTrackInfo(t){i&&(m&&(t.isMuxed=!0),i(e,t))},onAudioTimingInfo(e){f&&void 0!==e.start&&(f(e.start),f=null),g&&void 0!==e.end&&g(e.end)},onVideoTimingInfo(e){y&&void 0!==e.start&&(y(e.start),y=null),v&&void 0!==e.end&&v(e.end)},onVideoSegmentTimingInfo(e){s(e)},onAudioSegmentTimingInfo(e){r(e)},onId3(t,i){a(e,t,i)},onCaptions(t){o(e,[t])},isEndOfTimeline:l,onEndedTimeline(){u()},onTransmuxerLog:c,onDone(t){h&&(t.type="combined"===t.type?"video":t.type,h(null,e,t))}})}})},lw=({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:d,doneFn:h,onTransmuxerLog:c})=>{let p=new Uint8Array(t);if(0<function e(t,i,n){void 0===n&&(n=!1),i=Array.isArray(s=i)?s.map(aP):[aP(s)],t=sT(t);var s,r=[];if(i.length)for(var a=0;a<t.length;){var o=(t[a]<<24|t[a+1]<<16|t[a+2]<<8|t[a+3])>>>0,l=t.subarray(a+4,a+8);if(0==o)break;if((o=a+o)>t.length){if(n)break;o=t.length}var u=t.subarray(a+8,o);sk(l,i[0])&&(1===i.length?r.push(u):r.push.apply(r,e(u,i.slice(1),n))),a=o}return r}(y=p,["moof"]).length){e.isFmp4=!0;let m=e.map.tracks,f={isFmp4:!0,hasVideo:!!m.video,hasAudio:!!m.audio},g=(m.audio&&m.audio.codec&&"enca"!==m.audio.codec&&(f.audioCodec=m.audio.codec),m.video&&m.video.codec&&"encv"!==m.video.codec&&(f.videoCodec=m.video.codec),m.video&&m.audio&&(f.isMuxed=!0),i(e,f),t=>{d(e,{data:p,type:f.hasAudio&&!f.isMuxed?"audio":"video"}),t&&t.length&&o(e,t),h(null,e,{})});ld({action:"probeMp4StartTime",timescales:e.map.timescales,data:p,transmuxer:e.transmuxer,callback({data:i,startTime:s}){t=i.buffer,e.bytes=p=i,f.hasAudio&&!f.isMuxed&&n(e,"audio","start",s),f.hasVideo&&n(e,"video","start",s),m.video&&i.byteLength&&e.transmuxer?ld({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:e.transmuxer,data:p,timescales:e.map.timescales,trackIds:[m.video.id],callback(i){t=i.data.buffer,e.bytes=p=i.data,i.logs.forEach(function(e){c(az(e,{stream:"mp4CaptionParser"}))}),g(i.captions)}}):g()}})}else{var y;e.transmuxer?(void 0===e.container&&(e.container=aO(p)),"ts"!==e.container&&"aac"!==e.container?(i(e,{hasAudio:!1,hasVideo:!1}),h(null,e,{})):lT({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:d,doneFn:h,onTransmuxerLog:c})):h(null,e,{})}},l_=function({id:e,key:t,encryptedBytes:i,decryptionWorker:n},s){let r=t=>{t.data.source===e&&(n.removeEventListener("message",r),t=t.data.decrypted,s(new Uint8Array(t.bytes,t.byteOffset,t.byteLength)))};n.addEventListener("message",r);let a;a=t.bytes.slice?t.bytes.slice():new Uint32Array(Array.prototype.slice.call(t.bytes)),n.postMessage(o3({source:e,encrypted:i,key:a,iv:t.iv}),[i.buffer,a.buffer])},lS=({decryptionWorker:e,segment:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:d,doneFn:h,onTransmuxerLog:c})=>{l_({id:t.requestId,key:t.key,encryptedBytes:t.encryptedBytes,decryptionWorker:e},e=>{t.bytes=e,lw({segment:t,bytes:t.bytes,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:d,doneFn:h,onTransmuxerLog:c})})},lk=({xhr:e,xhrOptions:t,decryptionWorker:i,segment:n,abortFn:s,progressFn:r,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:u,id3Fn:d,captionsFn:h,isEndOfTimeline:c,endedTimelineFn:p,dataFn:m,doneFn:f,onTransmuxerLog:g})=>{let y=[];var v,b,i=(({activeXhrs:e,decryptionWorker:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:d,doneFn:h,onTransmuxerLog:c})=>{let p=0,m=!1;return(f,g)=>{if(!m){if(f)return m=!0,lg(e),h(f,g);if((p+=1)===e.length){let y=function(){if(g.encryptedBytes)return lS({decryptionWorker:t,segment:g,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:d,doneFn:h,onTransmuxerLog:c});lw({segment:g,bytes:g.bytes,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:d,doneFn:h,onTransmuxerLog:c})};if(g.endOfAllRequests=Date.now(),g.map&&g.map.encryptedBytes&&!g.map.bytes)return l_({decryptionWorker:t,id:g.requestId+"-init",encryptedBytes:g.map.encryptedBytes,key:g.map.key},t=>{g.map.bytes=t,l$(g,t=>{if(t)return lg(e),h(t,g);y()})});y()}}}})({activeXhrs:y,decryptionWorker:i,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:u,id3Fn:d,captionsFn:h,isEndOfTimeline:c,endedTimelineFn:p,dataFn:m,doneFn:f,onTransmuxerLog:g}),h=(n.key&&!n.key.bytes&&(a=[n.key],n.map&&!n.map.bytes&&n.map.key&&n.map.key.resolvedUri===n.key.resolvedUri&&a.push(n.map.key),o=e(az(t,{uri:n.key.resolvedUri,responseType:"arraybuffer"}),lb(n,a,i)),y.push(o)),n.map&&!n.map.bytes&&(!n.map.key||n.key&&n.key.resolvedUri===n.map.key.resolvedUri||(l=e(az(t,{uri:n.map.key.resolvedUri,responseType:"arraybuffer"}),lb(n,[n.map.key],i)),y.push(l)),u=az(t,{uri:n.map.resolvedUri,responseType:"arraybuffer",headers:oR(n.map)}),{segment:v,finishProcessingFn:b}={segment:n,finishProcessingFn:i},d=e(u,(e,t)=>{var e=l8(e,t);return e?b(e,v):(e=new Uint8Array(t.response),v.map.key?(v.map.encryptedBytes=e,b(null,v)):(v.map.bytes=e,void l$(v,function(e){if(e)return e.xhr=t,e.status=t.status,b(e,v);b(null,v)})))}),y.push(d)),az(t,{uri:n.part&&n.part.resolvedUri||n.resolvedUri,responseType:"arraybuffer",headers:oR(n)}));({segment:$,finishProcessingFn:T,responseType:w}={segment:n,finishProcessingFn:i,responseType:h.responseType});var $,T,w,_,S,c=e(h,(e,t)=>{var e=l8(e,t);return e?T(e,$):(e="arraybuffer"!==w&&t.responseText?oK(t.responseText.substring($.lastReachedChar||0)):t.response,$.stats=ly(t),$.key?$.encryptedBytes=new Uint8Array(e):$.bytes=new Uint8Array(e),T(null,$))});c.addEventListener("progress",({segment:_,progressFn:S}={segment:n,progressFn:r},e=>{if(!e.target.aborted)return _.stats=az(_.stats,lv(e)),!_.stats.firstBytesReceivedAt&&_.stats.bytesReceived&&(_.stats.firstBytesReceivedAt=Date.now()),S(e,_)})),y.push(c);let k={};return y.forEach(e=>{var t,i;e.addEventListener("loadend",({loadendState:t,abortFn:i}={loadendState:k,abortFn:s},e=>{e.target.aborted&&i&&!t.calledAbortFn&&(i(),t.calledAbortFn=!0)}))}),()=>lg(y)},lE=aW("CodecUtils"),lC=(e,t)=>(t=t.attributes||{},e&&e.mediaGroups&&e.mediaGroups.AUDIO&&t.AUDIO&&e.mediaGroups.AUDIO[t.AUDIO]),l0=function(e){let t={};return e.forEach(({mediaType:e,type:i,details:n})=>{t[e]=t[e]||[],t[e].push(sf(""+i+n))}),Object.keys(t).forEach(function(e){1<t[e].length?(lE(`multiple ${e} codecs found as attributes: ${t[e].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),t[e]=null):t[e]=t[e][0]}),t},lx=aW("PlaylistSelector"),lI=function(e){var t;if(e&&e.playlist)return JSON.stringify({id:(t=e.playlist).id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""})},lP=function(e,t){let i=e.slice();e.sort(function(e,n){var s=t(e,n);return 0===s?i.indexOf(e)-i.indexOf(n):s})};function lA(e,t,i,n,s,r){if(e){var a={bandwidth:t,width:i,height:n,limitRenditionByPlayerDimensions:s};let o=e.playlists,l=(oT.isAudioOnly(e)&&(o=r.getAudioTrackPlaylists_(),a.audioOnly=!0),o.map(e=>{var t=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width,i=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height;return{bandwidth:e.attributes&&e.attributes.BANDWIDTH||window.Number.MAX_VALUE,width:t,height:i,playlist:e}})),u=(lP(l,(e,t)=>e.bandwidth-t.bandwidth),(l=l.filter(e=>!oT.isIncompatible(e.playlist))).filter(e=>oT.isEnabled(e.playlist))),d=(e=(u=u.length?u:l.filter(e=>!oT.isDisabled(e.playlist))).filter(e=>e.bandwidth*oG.BANDWIDTH_VARIANCE<t))[e.length-1];var h=e.filter(e=>e.bandwidth===d.bandwidth)[0];if(!1===s){let c=h||u[0]||l[0];if(c&&c.playlist){let p=h?"bandwidthBestRep":"sortedPlaylistReps";return u[0]&&(p="enabledPlaylistReps"),lx(`choosing ${lI(c)} using ${p} with options`,a),c.playlist}}else{var m,s=e.filter(e=>e.width&&e.height),e=(lP(s,(e,t)=>e.width-t.width),s.filter(e=>e.width===i&&e.height===n)),e=(d=e[e.length-1],e.filter(e=>e.bandwidth===d.bandwidth)[0]);let f,g;e||(d=(m=(f=s.filter(e=>e.width>i||e.height>n)).filter(e=>e.width===f[0].width&&e.height===f[0].height))[m.length-1],g=m.filter(e=>e.bandwidth===d.bandwidth)[0]);let y;r.leastPixelDiffSelector&&(lP(m=s.map(e=>(e.pixelDiff=Math.abs(e.width-i)+Math.abs(e.height-n),e)),(e,t)=>e.pixelDiff===t.pixelDiff?t.bandwidth-e.bandwidth:e.pixelDiff-t.pixelDiff),y=m[0]);let v=y||g||e||h||u[0]||l[0];if(v&&v.playlist){let b="sortedPlaylistReps";return y?b="leastPixelDiffRep":g?b="resolutionPlusOneRep":e?b="resolutionBestRep":h?b="bandwidthBestRep":u[0]&&(b="enabledPlaylistReps"),lx(`choosing ${lI(v)} using ${b} with options`,a),v.playlist}}return lx("could not choose a playlist with options",a),null}}function lL(){var e=this.useDevicePixelRatio&&window.devicePixelRatio||1;return lA(this.playlists.main,this.systemBandwidth,parseInt(lp(this.tech_.el(),"width"),10)*e,parseInt(lp(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.playlistController_)}function lD(e,t,i){var n;let s;if(i&&i.cues)for(s=i.cues.length;s--;)(n=i.cues[s]).startTime>=e&&n.endTime<=t&&i.removeCue(n)}let lO=({inbandTextTracks:e,metadataArray:t,timestampOffset:i,videoDuration:n})=>{if(t){let s=window.WebKitDataCue||window.VTTCue,r=e.metadataTrack_;if(r&&(t.forEach(e=>{let t=e.cueTime+i;!("number"!=typeof t||window.isNaN(t)||t<0)&&t<1/0&&e.frames.forEach(e=>{var i,n=new s(t,t,e.value||e.url||e.data||"");n.frame=e,n.value=e,Object.defineProperties((i=n).frame,{id:{get:()=>(nZ.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),i.value.key)},value:{get:()=>(nZ.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),i.value.data)},privateData:{get:()=>(nZ.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),i.value.data)}}),r.addCue(n)})}),r.cues)&&r.cues.length){var a=r.cues,o=[];for(let l=0;l<a.length;l++)a[l]&&o.push(a[l]);let u=o.reduce((e,t)=>{var i=e[t.startTime]||[];return i.push(t),e[t.startTime]=i,e},{}),d=Object.keys(u).sort((e,t)=>Number(e)-Number(t));d.forEach((e,t)=>{e=u[e];let i=Number(d[t+1])||n;e.forEach(e=>{e.endTime=i})})}}},lR=e=>"number"==typeof e&&isFinite(e),lN=e=>{var{startOfSegment:t,duration:i,segment:n,part:s,playlist:{mediaSequence:r,id:a,segments:o=[]},mediaIndex:l,partIndex:u,timeline:d}=e,o=o.length-1;let h="mediaIndex/partIndex increment";e.getMediaInfoForTime?h=`getMediaInfoForTime (${e.getMediaInfoForTime})`:e.isSyncRequest&&(h="getSyncSegmentCandidate (isSyncRequest)"),e.independent&&(h+=" with independent "+e.independent);var c="number"==typeof u,e=e.segment.uri?"segment":"pre-segment",p=c?ol({preloadSegment:n})-1:0;return e+` [${r+l}/${r+o}]`+(c?` part [${u}/${p}]`:"")+` segment start/end [${n.start} => ${n.end}]`+(c?` part start/end [${s.start} => ${s.end}]`:"")+` startOfSegment [${t}]`+` duration [${i}]`+` timeline [${d}]`+` selected by [${h}]`+` playlist [${a}]`},lM=e=>e+"TimingInfo",l3=({timelineChangeController:e,currentTimeline:t,segmentTimeline:i,loaderType:n,audioDisabled:s})=>!(t===i||("audio"===n?(t=e.lastTimelineChange({type:"main"}))&&t.to===i:"main"!==n||!s||(t=e.pendingTimelineChange({type:"audio"}))&&t.to===i)),lB=({segmentDuration:e,maxDuration:t})=>!!e&&Math.round(e)>t+oe,lU=(e,t)=>{var i,n,s,r;let a;return"hls"===t&&(t=(r={audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo},a=0,["video","audio"].forEach(function(e){if(e=r[e+"TimingInfo"]){var{start:e,end:t}=e;let i;"bigint"==typeof e||"bigint"==typeof t?i=window.BigInt(t)-window.BigInt(e):"number"==typeof e&&"number"==typeof t&&(i=t-e),void 0!==i&&i>a&&(a=i)}}),a="bigint"==typeof a&&a<Number.MAX_SAFE_INTEGER?Number(a):a))&&(n=lB({segmentDuration:t,maxDuration:2*(i=e.playlist.targetDuration)}),s=lB({segmentDuration:t,maxDuration:i}),t=`Segment with index ${e.mediaIndex} from playlist ${e.playlist.id} has a duration of ${t} when the reported duration is ${e.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`,n||s)?{severity:n?"warn":"info",message:t}:null};class l2 extends nZ.EventTarget{constructor(e,t=0){if(super(),!e)throw TypeError("Initialization settings are required");if("function"!=typeof e.currentTime)throw TypeError("No currentTime getter specified");if(!e.mediaSource)throw 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.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=11<=nZ.browser.IE_VERSION,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_=aW(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(e){e!==this.state_&&(this.logger_(this.state_+" -> "+e),this.state_=e,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}),"main"===this.loaderType_&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}),"audio"===this.loaderType_&&this.timelineChangeController_.on("timelinechange",()=>{this.hasEnoughInfoToLoad_()&&this.processLoadQueue_(),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()})}createTransmuxer_(){return lu({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_&&window.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(){"WAITING"!==this.state?this.pendingSegment_&&(this.pendingSegment_=null):(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,window.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return"APPENDING"!==this.state||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e:(this.state="READY",!0)}error(e){return void 0!==e&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&ll(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){var e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return aG();if("main"===this.loaderType_){var{hasAudio:e,hasVideo:t,isMuxed:i}=e;if(t&&e&&!this.audioDisabled_&&!i)return this.sourceUpdater_.buffered();if(t)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;var i=oB(e);let n=this.initSegments_[i];return t&&!n&&e.bytes&&(this.initSegments_[i]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),n||e}segmentKey(e,t=!1){if(!e)return null;var i=oU(e);let n=this.keyCache_[i];return this.cacheEncryptionKeys_&&t&&!n&&e.bytes&&(this.keyCache_[i]=n={resolvedUri:e.resolvedUri,bytes:e.bytes}),t={resolvedUri:(n||e).resolvedUri},n&&(t.bytes=n.bytes),t}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),this.playlist_)return"INIT"===this.state&&this.couldBeginLoading_()?this.init_():void(this.couldBeginLoading_()&&("READY"===this.state||"INIT"===this.state)&&(this.state="READY"))}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,t={}){if(e){var i,n=this.playlist_,s=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,"INIT"===this.state&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},"main"===this.loaderType_)&&this.syncController_.setDateTimeMappingForStart(e);let r=null;if(n&&(n.id?r=n.id:n.uri&&(r=n.uri)),this.logger_(`playlist update [${r} => ${e.id||e.uri}]`),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();n&&n.uri===e.uri?(t=e.mediaSequence-n.mediaSequence,this.logger_(`live window shift [${t}]`),null!==this.mediaIndex&&(this.mediaIndex-=t,this.mediaIndex<0?(this.mediaIndex=null,this.partIndex=null):(i=this.playlist_.segments[this.mediaIndex],!this.partIndex||i.parts&&i.parts.length&&i.parts[this.partIndex]||(i=this.mediaIndex,this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=i))),s&&(s.mediaIndex-=t,s.mediaIndex<0?(s.mediaIndex=null,s.partIndex=null):(0<=s.mediaIndex&&(s.segment=e.segments[s.mediaIndex]),0<=s.partIndex&&s.segment.parts&&(s.part=s.segment.parts[s.partIndex]))),this.syncController_.saveExpiredSegmentInfo(n,e)):(null!==this.mediaIndex&&(e.endList?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,this.trigger("playlistupdate"))}}pause(){this.checkBufferTimeout_&&(window.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return null===this.checkBufferTimeout_}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.resyncLoader()}resyncLoader(){this.transmuxer_&&ll(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,t,i=()=>{},n=!1){if((t=t===1/0?this.duration_():t)<=e)this.logger_("skipping remove because end ${end} is <= start ${start}");else if(this.sourceUpdater_&&this.getMediaInfo_()){let s=1;var r=()=>{0==--s&&i()};for(let a in!n&&this.audioDisabled_||(s++,this.sourceUpdater_.removeAudio(e,t,r)),(n||"main"===this.loaderType_)&&(this.gopBuffer_=((e,t,i,n)=>{var s=Math.ceil((t-n)*9e4),r=Math.ceil((i-n)*9e4),t=e.slice();let a=e.length;for(;a--&&!(e[a].pts<=r););if(-1!==a){let o=a+1;for(;o--&&!(e[o].pts<=s););o=Math.max(o,0),t.splice(o,a-o+1)}return t})(this.gopBuffer_,e,t,this.timeMapping_),s++,this.sourceUpdater_.removeVideo(e,t,r)),this.inbandTextTracks_)lD(e,t,this.inbandTextTracks_[a]);lD(e,t,this.segmentMetadataTrack_),r()}else this.logger_("skipping remove because no source updater or starting media info")}monitorBuffer_(){this.checkBufferTimeout_&&window.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=window.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&window.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=window.setTimeout(this.monitorBufferTick_.bind(this),500)}fillBuffer_(){var e;this.sourceUpdater_.updating()||(e=this.chooseNextRequest_())&&("number"==typeof e.timestampOffset&&(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){var n;return!(!t||!this.mediaSource_)&&(n="number"==typeof e&&t.segments[e],e=e+1===t.segments.length,i=!n||!n.parts||i+1===n.parts.length,t.endList)&&"open"===this.mediaSource_.readyState&&e&&i}chooseNextRequest_(){var e=this.buffered_(),t=aY(e)||0,e=aQ(e,this.currentTime_()),i=!this.hasPlayed_()&&1<=e,n=e>=this.goalBufferLength_(),s=this.playlist_.segments;if(!s.length||i||n)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_());var r,i={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)},t=(i.isSyncRequest?i.mediaIndex=function(e,t,i){t=t||[];var n=[];let s=0;for(let r=0;r<t.length;r++){var a=t[r];if(e===a.timeline&&(n.push(r),(s+=a.duration)>i))return r}return 0===n.length?0:n[n.length-1]}(this.currentTimeline_,s,t):null!==this.mediaIndex?(n=s[this.mediaIndex],r="number"==typeof this.partIndex?this.partIndex:-1,i.startOfSegment=n.end||t,n.parts&&n.parts[r+1]?(i.mediaIndex=this.mediaIndex,i.partIndex=r+1):i.mediaIndex=this.mediaIndex+1):({segmentIndex:n,startTime:r,partIndex:o}=oT.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?t:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time}),i.getMediaInfoForTime=this.fetchAtBuffer_?"bufferedEnd "+t:"currentTime "+this.currentTime_(),i.mediaIndex=n,i.startOfSegment=r,i.partIndex=o),s[i.mediaIndex]);let a=t&&"number"==typeof i.partIndex&&t.parts&&t.parts[i.partIndex];if(!t||"number"==typeof i.partIndex&&!a)return null;"number"!=typeof i.partIndex&&t.parts&&(i.partIndex=0,a=t.parts[0]),e||!a||a.independent||(0===i.partIndex?(r=(n=s[i.mediaIndex-1]).parts&&n.parts.length&&n.parts[n.parts.length-1])&&r.independent&&(--i.mediaIndex,i.partIndex=n.parts.length-1,i.independent="previous segment"):t.parts[i.partIndex-1].independent&&(--i.partIndex,i.independent="previous part"));var o=this.mediaSource_&&"ended"===this.mediaSource_.readyState;return i.mediaIndex>=s.length-1&&o&&!this.seeking_()?null:this.generateSegmentInfo_(i)}generateSegmentInfo_(e){var{independent:e,playlist:t,mediaIndex:i,startOfSegment:n,isSyncRequest:s,partIndex:r,forceTimestampOffset:a,getMediaInfoForTime:o}=e,l=t.segments[i],u="number"==typeof r&&l.parts[r],i={requestId:"segment-loader-"+Math.random(),uri:u&&u.resolvedUri||l.resolvedUri,mediaIndex:i,partIndex:u?r:null,isSyncRequest:s,startOfSegment:n,playlist:t,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:l.timeline,duration:u&&u.duration||l.duration,segment:l,part:u,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:o,independent:e},r=void 0!==a?a:this.isPendingTimestampOffset_,s=(i.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:l.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:r}),aY(this.sourceUpdater_.audioBuffered()));return"number"==typeof s&&(i.audioAppendStart=s-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(i.gopsToAlignWith=((e,t,i)=>{if(null==t||!e.length)return[];var n=Math.ceil((t-i+3)*9e4);let s;for(s=0;s<e.length&&!(e[s].pts>n);s++);return e.slice(s)})(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),i}timestampOffsetForSegment_(e){var t,i,n,s;return{segmentTimeline:e,currentTimeline:t,startOfSegment:i,buffered:n,overrideCheck:s}=e,s||e!==t?!(e<t)&&n.length?n.end(n.length-1):i:null}earlyAbortWhenNeeded_(e){if(!this.vhs_.tech_.paused()&&this.xhrOptions_.timeout&&this.playlist_.attributes.BANDWIDTH&&!(Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)){var t=this.currentTime_(),i=e.bandwidth,n=this.pendingSegment_.duration,e=oT.estimateSegmentRequestTime(n,i,this.playlist_,e.bytesReceived),s=([s,r,a=1]=[this.buffered_(),t,this.vhs_.tech_.playbackRate()],((s.length?s.end(s.length-1):0)-r)/a-1);if(!(e<=s)){var r=function(e){let{main:t,currentTime:i,bandwidth:n,duration:s,segmentDuration:r,timeUntilRebuffer:a,currentTimeline:o,syncController:l}=e,u=(e=t.playlists.filter(e=>!oT.isIncompatible(e))).filter(oT.isEnabled);var e=(u=u.length?u:e.filter(e=>!oT.isDisabled(e))).filter(oT.hasAttribute.bind(null,"BANDWIDTH")).map(e=>{var t=l.getSyncPoint(e,s,o,i)?1:2;return{playlist:e,rebufferingImpact:oT.estimateSegmentRequestTime(r,n,e)*t-a}}),d=e.filter(e=>e.rebufferingImpact<=0);return lP(d,(e,t)=>lm(t.playlist,e.playlist)),d.length?d[0]:(lP(e,(e,t)=>e.rebufferingImpact-t.rebufferingImpact),e[0]||null)}({main:this.vhs_.playlists.main,currentTime:t,bandwidth:i,duration:this.duration_(),segmentDuration:n,timeUntilRebuffer:s,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(r){var a=e-s-r.rebufferingImpact;let o=.5;s<=oe&&(o=1),!r.playlist||r.playlist.uri===this.playlist_.uri||a<o||(this.bandwidth=r.playlist.attributes.BANDWIDTH*oG.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}}}}handleAbort_(e){this.logger_("Aborting "+lN(e)),this.mediaRequestsAborted+=1}handleProgress_(e,t){this.earlyAbortWhenNeeded_(t.stats),this.checkForAbort_(t.requestId)||this.trigger("progress")}handleTrackInfo_(e,t){this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId)||this.checkForIllegalMediaSwitch(t)||(function(e,t){if(!e&&!t||!e&&t||e&&!t)return!1;if(e!==t){var i=Object.keys(e).sort(),n=Object.keys(t).sort();if(i.length!==n.length)return!1;for(let s=0;s<i.length;s++){var r=i[s];if(r!==n[s]||e[r]!==t[r])return!1}}return!0}(this.currentMediaInfo_,t=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_())}handleTimingInfo_(e,t,i,n){var s;this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId)||((e=this.pendingSegment_)[s=lM(t)]=e[s]||{},e[s][i]=n,this.logger_(`timinginfo: ${t} - ${i} - `+n),this.hasEnoughInfoToAppend_()&&this.processCallQueue_())}handleCaptions_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){if(0===t.length)this.logger_("SegmentLoader received no captions from a caption event");else if(this.pendingSegment_.hasAppendedData_){let i=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),n={};t.forEach(e=>{n[e.stream]=n[e.stream]||{startTime:1/0,captions:[],endTime:0};var t=n[e.stream];t.startTime=Math.min(t.startTime,e.startTime+i),t.endTime=Math.max(t.endTime,e.endTime+i),t.captions.push(e)}),Object.keys(n).forEach(e=>{var{startTime:t,endTime:s,captions:r}=n[e],a=this.inbandTextTracks_,o=(this.logger_(`adding cues from ${t} -> ${s} for `+e),a),l=this.vhs_.tech_,u=e;if(!o[u]){l.trigger({type:"usage",name:"vhs-608"});let d=u;/^cc708_/.test(u)&&(d="SERVICE"+u.split("_")[1]);var h=l.textTracks().getTrackById(d);if(h)o[u]=h;else{let c=u,p=u,m=!1;(h=(l.options_.vhs&&l.options_.vhs.captionServices||{})[d])&&(c=h.label,p=h.language,m=h.default),o[u]=l.addRemoteTextTrack({kind:"captions",id:d,default:m,label:c,language:p},!1).track}}lD(t,s,a[e]);var{inbandTextTracks:f,captionArray:h,timestampOffset:g}={captionArray:r,inbandTextTracks:a,timestampOffset:i};if(h){let y=window.WebKitDataCue||window.VTTCue;h.forEach(e=>{f[e.stream].addCue(new y(e.startTime+g,e.endTime+g,e.text))})}}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}else this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t))}}handleId3_(e,t,i){var n,s,r,a;this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId)||(this.pendingSegment_.hasAppendedData_?(n=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),s=this.inbandTextTracks_,r=i,a=this.vhs_.tech_,s.metadataTrack_||(s.metadataTrack_=a.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,s.metadataTrack_.inBandMetadataTrackDispatchType=r),lO({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:n,videoDuration:this.duration_()})):this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,i)))}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e()),this.metadataQueue_.caption.forEach(e=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){var e=this.callQueue_;this.callQueue_=[],e.forEach(e=>e())}processLoadQueue_(){var e=this.loadQueue_;this.loadQueue_=[],e.forEach(e=>e())}hasEnoughInfoToLoad_(){var e;return"audio"!==this.loaderType_||!(!(e=this.pendingSegment_)||this.getCurrentMediaInfo_()&&l3({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}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_(){var e,t,i,n;return!!this.sourceUpdater_.ready()&&!(this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_||(e=this.pendingSegment_,t=this.getCurrentMediaInfo_(),!e)||!t||({hasAudio:t,hasVideo:i,isMuxed:n}=t,i&&!e.videoTimingInfo)||t&&!this.audioDisabled_&&!n&&!e.audioTimingInfo||l3({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)){if(this.callQueue_.length||!this.hasEnoughInfoToAppend_())this.callQueue_.push(this.handleData_.bind(this,e,t));else{var i=this.pendingSegment_;if(this.setTimeMapping_(i.timeline),this.updateMediaSecondsLoaded_(i.part||i.segment),"closed"!==this.mediaSource_.readyState){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[lM(t.type)].start;else{e=this.getCurrentMediaInfo_();let n;(e="main"===this.loaderType_&&e&&e.hasVideo)&&(n=i.videoTimingInfo.start),i.timingInfo.start=this.trueSegmentStart_({currentStart:i.timingInfo.start,playlist:i.playlist,mediaIndex:i.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:e,firstVideoFrameTimeForData:n,videoTimingInfo:i.videoTimingInfo,audioTimingInfo:i.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(i,t.type),this.updateSourceBufferTimestampOffset_(i),i.isSyncRequest){if(this.updateTimingInfoEnd_(i),this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:"main"===this.loaderType_}),(e=this.chooseNextRequest_()).mediaIndex!==i.mediaIndex||e.partIndex!==i.partIndex)return void this.logger_("sync segment was incorrect, not appending");this.logger_("sync segment was correct, appending")}i.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(i,t)}}}}updateAppendInitSegmentStatus(e,t){"main"!==this.loaderType_||"number"!=typeof e.timestampOffset||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:n}){if(i){var s=oB(i);if(this.activeInitSegmentId_===s)return null;t=this.initSegmentForMap(i,!0).bytes,this.activeInitSegmentId_=s}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=n,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i},n){var s=this.sourceUpdater_.audioBuffered(),r=this.sourceUpdater_.videoBuffered(),a=(1<s.length&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+os(s).join(", ")),1<r.length&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+os(r).join(", ")),s.length?s.start(0):0),o=s.length?s.end(s.length-1):0,l=r.length?r.start(0):0,u=r.length?r.end(r.length-1):0;o-a<=1&&u-l<=1?(this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${i.byteLength}, audio buffer: ${os(s).join(", ")}, video buffer: ${os(r).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),this.trigger("error")):(this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:i})),o=this.currentTime_()-1,this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to "+o),this.remove(0,o,()=>{this.logger_("On QUOTA_EXCEEDED_ERR, retrying append in 1s"),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=window.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},1e3)},!0))}handleAppendError_({segmentInfo:e,type:t,bytes:i},n){n&&(22===n.code?this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i}):(this.logger_("Received non QUOTA_EXCEEDED_ERR on append",n),this.error(`${t} append of ${i.length}b failed for segment #${e.mediaIndex} in playlist `+e.playlist.id),this.trigger("appenderror")))}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:i,data:n,bytes:s}){if(!s){var r,a=[n];let o=n.byteLength,l,u;i&&(a.unshift(i),o+=i.byteLength),s=(l=0,(r={bytes:o,segments:a}).bytes&&(u=new Uint8Array(r.bytes),r.segments.forEach(e=>{u.set(e,l),l+=e.byteLength})),u)}this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:s},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:s}))}handleSegmentTimingInfo_(e,t,i){this.pendingSegment_&&t===this.pendingSegment_.requestId&&((t=this.pendingSegment_.segment)[e+="TimingInfo"]||(t[e]={}),t[e].transmuxerPrependedSeconds=i.prependedContentDuration||0,t[e].transmuxedPresentationStart=i.start.presentation,t[e].transmuxedDecodeStart=i.start.decode,t[e].transmuxedPresentationEnd=i.end.presentation,t[e].transmuxedDecodeEnd=i.end.decode,t[e].baseMediaDecodeTime=i.baseMediaDecodeTime)}appendData_(e,t){var{type:i,data:n}=t;n&&n.byteLength&&("audio"===i&&this.audioDisabled_||(t=this.getInitSegmentAndUpdateState_({type:i,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null}),this.appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:t,data:n})))}loadSegment_(e){this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),"number"==typeof e.timestampOffset&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.hasEnoughInfoToLoad_()?this.updateTransmuxerAndRequestSegment_(e):this.loadQueue_.push(()=>{var t=t3({},e,{forceTimestampOffset:!0});t3(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,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}));var t=this.createSimplifiedSegmentObj_(e),i=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),n=null!==this.mediaIndex,s=e.timeline!==this.currentTimeline_&&0<e.timeline,i=i||n&&s;this.logger_("Requesting "+lN(e)),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=lk({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:i,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:t,level:i,stream:n})=>{this.logger_(lN(e)+` logged from transmuxer stream ${n} as a ${i}: `+t)}})}trimBackBuffer_(e){let t;var i,n,s,r=(i=this.seekable_(),n=this.currentTime_(),s=this.playlist_.targetDuration||10,t=n-oG.BACK_BUFFER_LENGTH,i.length&&(t=Math.max(t,i.start(0))),Math.min(n-s,t));0<r&&this.remove(0,r)}createSimplifiedSegmentObj_(e){var t=e.segment,i=e.part,i={resolvedUri:(i||t).resolvedUri,byterange:(i||t).byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part},n=e.playlist.segments[e.mediaIndex-1];return n&&n.timeline===t.timeline&&(n.videoTimingInfo?i.baseStartTime=n.videoTimingInfo.transmuxedDecodeEnd:n.audioTimingInfo&&(i.baseStartTime=n.audioTimingInfo.transmuxedDecodeEnd)),t.key&&(n=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]),i.key=this.segmentKey(t.key),i.key.iv=n),t.map&&(i.map=this.initSegmentForMap(t.map)),i}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,t){this.pendingSegment_.byteLength=t.bytesReceived,e<1/60?this.logger_("Ignoring segment's bandwidth because its duration of "+e+" is less than the min to record "+1/60):(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));else if(this.saveTransferStats_(t.stats),this.pendingSegment_&&t.requestId===this.pendingSegment_.requestId){if(e)return this.pendingSegment_=null,this.state="READY",e.code===lf.ABORTED?void 0:(this.pause(),e.code===lf.TIMEOUT?void this.handleTimeout_():(this.mediaRequestsErrored+=1,this.error(e),void this.trigger("error")));e=this.pendingSegment_,this.saveBandwidthRelatedStats_(e.duration,t.stats),e.endOfAllRequests=t.endOfAllRequests,i.gopInfo&&(this.gopBuffer_=((e,t,i)=>{if(!t.length)return e;if(i)return t.slice();var n=t[0].pts;let s=0;for(;s<e.length&&!(e[s].pts>=n);s++);return e.slice(0,s).concat(t)})(this.gopBuffer_,i.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(e)}}setTimeMapping_(e){null!==(e=this.syncController_.mappingForTimeline(e))&&(this.timeMapping_=e)}updateMediaSecondsLoaded_(e){"number"==typeof e.start&&"number"==typeof e.end?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration}shouldUpdateTransmuxerTimestampOffset_(e){return null!==e&&("main"===this.loaderType_&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset())}trueSegmentStart_({currentStart:e,playlist:t,mediaIndex:i,firstVideoFrameTimeForData:n,currentVideoTimestampOffset:s,useVideoTimingInfo:r,videoTimingInfo:a,audioTimingInfo:o}){return void 0!==e?e:r?(e=t.segments[i-1],0!==i&&e&&void 0!==e.start&&e.end===n+s?a.start:n):o.start}waitForAppendsToComplete_(e){var t,i,n=this.getCurrentMediaInfo_(e);n?({hasAudio:n,hasVideo:i,isMuxed:t}=n,i="main"===this.loaderType_&&i,n=!this.audioDisabled_&&n&&!t,e.waitingOnAppends=0,e.hasAppendedData_?(i&&e.waitingOnAppends++,n&&e.waitingOnAppends++,i&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),n&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))):(e.timingInfo||"number"!=typeof e.timestampOffset||(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),this.checkAppendsDone_(e))):(this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:1/0}),this.trigger("error"))}checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,0===e.waitingOnAppends&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){i=this.loaderType_,t=this.getCurrentMediaInfo_();var t,i="main"===i&&t&&e?e.hasAudio||e.hasVideo?t.hasVideo&&!e.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.":!t.hasVideo&&e.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:"Neither audio nor video found in segment.":null;return!!i&&(this.error({message:i,playlistExclusionDuration:1/0}),this.trigger("error"),!0)}updateSourceBufferTimestampOffset_(e){if(null!==e.timestampOffset&&"number"==typeof e.timingInfo.start&&!e.changedTimestampOffset&&"main"===this.loaderType_){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&&"number"==typeof e.transmuxedDecodeStart?e.transmuxedDecodeStart:t&&"number"==typeof t.transmuxedDecodeStart?t.transmuxedDecodeStart:i.start:i.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};var t=this.getMediaInfo_(),t="main"===this.loaderType_&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;t&&(e.timingInfo.end="number"==typeof t.end?t.end:t.start+e.duration)}handleAppendsDone_(){var e,t,i;this.pendingSegment_&&this.trigger("appendsdone"),this.pendingSegment_?(e=this.pendingSegment_,this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:"main"===this.loaderType_}),(t=lU(e,this.sourceType_))&&("warn"===t.severity?nZ.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 "+lN(e)):(this.logger_("Appended "+lN(e)),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),"main"!==this.loaderType_||this.audioDisabled_||this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate"),t=e.segment,i=e.part,t=t.end&&this.currentTime_()-t.end>3*e.playlist.targetDuration,i=i&&i.end&&this.currentTime_()-i.end>3*e.playlist.partTargetDuration,t||i?(this.logger_(`bad ${t?"segment":"part"} `+lN(e)),this.resetEverything()):(null!==this.mediaIndex&&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_()))):(this.state="READY",this.paused()||this.monitorBuffer_())}recordThroughput_(e){var t,i;e.duration<1/60?this.logger_("Ignoring segment's throughput because its duration of "+e.duration+" is less than the min to record "+1/60):(t=this.throughput.rate,i=Date.now()-e.endOfAllRequests+1,e=Math.floor(e.byteLength/i*8e3),this.throughput.rate+=(e-t)/++this.throughput.count)}addSegmentMetadataCue_(e){var t,i,n,s;this.segmentMetadataTrack_&&(t=(s=e.segment).start,i=s.end,lR(t))&&lR(i)&&(lD(t,i,this.segmentMetadataTrack_),n=window.WebKitDataCue||window.VTTCue,s={custom:s.custom,dateTimeObject:s.dateTimeObject,dateTimeString:s.dateTimeString,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:t,end:i},(e=new n(t,i,JSON.stringify(s))).value=s,this.segmentMetadataTrack_.addCue(e))}}function l1(){}function l4(e){return"string"!=typeof e?e:e.replace(/./,e=>e.toUpperCase())}let l6=["video","audio"],lF=(e,t)=>{var i=t[e+"Buffer"];return i&&i.updating||t.queuePending[e]},lj=(e,t)=>{if(0!==t.queue.length){let i=0,n=t.queue[i];if("mediaSource"===n.type)t.updating()||"closed"===t.mediaSource.readyState||(t.queue.shift(),n.action(t),n.doneFn&&n.doneFn(),lj("audio",t),lj("video",t));else if("mediaSource"!==e&&t.ready()&&"closed"!==t.mediaSource.readyState&&!lF(e,t)){if(n.type!==e){if(null===(i=((e,t)=>{for(let i=0;i<t.length;i++){var n=t[i];if("mediaSource"===n.type)break;if(n.type===e)return i}return null})(e,t.queue)))return;n=t.queue[i]}t.queue.splice(i,1),(t.queuePending[e]=n).action(e,t),n.doneFn||(t.queuePending[e]=null,lj(e,t))}}},l5=(e,t)=>{var i=t[e+"Buffer"],n=l4(e);i&&(i.removeEventListener("updateend",t[`on${n}UpdateEnd_`]),i.removeEventListener("error",t[`on${n}Error_`]),t.codecs[e]=null,t[e+"Buffer"]=null)},lq=(e,t)=>e&&t&&-1!==Array.prototype.indexOf.call(e.sourceBuffers,t),lH={appendBuffer:(e,t,i)=>(n,s)=>{var r=s[n+"Buffer"];if(lq(s.mediaSource,r)){s.logger_(`Appending segment ${t.mediaIndex}'s ${e.length} bytes to ${n}Buffer`);try{r.appendBuffer(e)}catch(a){s.logger_(`Error with code ${a.code} `+(22===a.code?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${t.mediaIndex} to ${n}Buffer`),s.queuePending[n]=null,i(a)}}},remove:(e,t)=>(i,n)=>{var s=n[i+"Buffer"];if(lq(n.mediaSource,s)){n.logger_(`Removing ${e} to ${t} from ${i}Buffer`);try{s.remove(e,t)}catch(r){n.logger_(`Remove ${e} to ${t} from ${i}Buffer failed`)}}},timestampOffset:e=>(t,i)=>{var n=i[t+"Buffer"];lq(i.mediaSource,n)&&(i.logger_(`Setting ${t}timestampOffset to `+e),n.timestampOffset=e)},callback:e=>(t,i)=>{e()},endOfStream:e=>t=>{if("open"===t.mediaSource.readyState){t.logger_(`Calling mediaSource endOfStream(${e||""})`);try{t.mediaSource.endOfStream(e)}catch(i){nZ.log.warn("Failed to call media source endOfStream",i)}}},duration:e=>t=>{t.logger_("Setting mediaSource duration to "+e);try{t.mediaSource.duration=e}catch(i){nZ.log.warn("Failed to set media source duration",i)}},abort:()=>(e,t)=>{if("open"===t.mediaSource.readyState){var i=t[e+"Buffer"];if(lq(t.mediaSource,i)){t.logger_(`calling abort on ${e}Buffer`);try{i.abort()}catch(n){nZ.log.warn(`Failed to abort on ${e}Buffer`,n)}}}},addSourceBuffer:(e,t)=>i=>{var n=l4(e),s=sy(t),s=(i.logger_(`Adding ${e}Buffer with codec ${t} to mediaSource`),i.mediaSource.addSourceBuffer(s));s.addEventListener("updateend",i[`on${n}UpdateEnd_`]),s.addEventListener("error",i[`on${n}Error_`]),i.codecs[e]=t,i[e+"Buffer"]=s},removeSourceBuffer:e=>t=>{var i=t[e+"Buffer"];if(l5(e,t),lq(t.mediaSource,i)){t.logger_(`Removing ${e}Buffer with codec ${t.codecs[e]} from mediaSource`);try{t.mediaSource.removeSourceBuffer(i)}catch(n){nZ.log.warn(`Failed to removeSourceBuffer ${e}Buffer`,n)}}},changeType:e=>(t,i)=>{var n=i[t+"Buffer"],s=sy(e);lq(i.mediaSource,n)&&i.codecs[t]!==e&&(i.logger_(`changing ${t}Buffer codec from ${i.codecs[t]} to `+e),n.changeType(s),i.codecs[t]=e)}},lV=({type:e,sourceUpdater:t,action:i,doneFn:n,name:s})=>{t.queue.push({type:e,action:i,doneFn:n,name:s}),lj(e,t)},l7=(e,t)=>i=>{var n;t.queuePending[e]&&(n=t.queuePending[e].doneFn,t.queuePending[e]=null,n)&&n(t[e+"Error_"]),lj(e,t)};class l9 extends nZ.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>lj("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=aW("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=l7("video",this),this.onAudioUpdateEnd_=l7("audio",this),this.onVideoError_=e=>{this.videoError_=e},this.onAudioError_=e=>{this.audioError_=e},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){lV({type:"mediaSource",sourceUpdater:this,action:lH.addSourceBuffer(e,t),name:"addSourceBuffer"})}abort(e){lV({type:e,sourceUpdater:this,action:lH.abort(e),name:"abort"})}removeSourceBuffer(e){this.canRemoveSourceBuffer()?lV({type:"mediaSource",sourceUpdater:this,action:lH.removeSourceBuffer(e),name:"removeSourceBuffer"}):nZ.log.error("removeSourceBuffer is not supported!")}canRemoveSourceBuffer(){return!nZ.browser.IE_VERSION&&!nZ.browser.IS_FIREFOX&&window.MediaSource&&window.MediaSource.prototype&&"function"==typeof window.MediaSource.prototype.removeSourceBuffer}static canChangeType(){return window.SourceBuffer&&window.SourceBuffer.prototype&&"function"==typeof window.SourceBuffer.prototype.changeType}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){this.canChangeType()?lV({type:e,sourceUpdater:this,action:lH.changeType(t),name:"changeType"}):nZ.log.error("changeType is not supported!")}addOrChangeSourceBuffers(e){if(!e||"object"!=typeof e||0===Object.keys(e).length)throw Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(t=>{var i=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,i);this.canChangeType()&&this.changeType(t,i)})}appendBuffer(e,t){var{segmentInfo:i,type:n,bytes:s}=e;this.processedAppend_=!0,"audio"===n&&this.videoBuffer&&!this.videoAppendQueued_?(this.delayedAudioAppendQueue_.push([e,t]),this.logger_(`delayed audio append of ${s.length} until video append`)):(e=t,lV({type:n,sourceUpdater:this,action:lH.appendBuffer(s,i||{mediaIndex:-1},e),doneFn:t,name:"appendBuffer"}),"video"===n&&(this.videoAppendQueued_=!0,this.delayedAudioAppendQueue_.length)&&(s=this.delayedAudioAppendQueue_.slice(),this.logger_(`queuing delayed audio ${s.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,s.forEach(e=>{this.appendBuffer.apply(this,e)})))}audioBuffered(){return lq(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered||aG()}videoBuffered(){return lq(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered||aG()}buffered(){var e=lq(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=lq(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;if(t&&!e)return this.audioBuffered();if(e&&!t)return this.videoBuffered();{var i=this.audioBuffered(),n=this.videoBuffered();let s=null,r=null,a=0;var o=[],l=[];if(!(i&&i.length&&n&&n.length))return aG();let u=i.length;for(;u--;)o.push({time:i.start(u),type:"start"}),o.push({time:i.end(u),type:"end"});for(u=n.length;u--;)o.push({time:n.start(u),type:"start"}),o.push({time:n.end(u),type:"end"});for(o.sort(function(e,t){return e.time-t.time}),u=0;u<o.length;u++)"start"===o[u].type?2==++a&&(s=o[u].time):"end"===o[u].type&&1==--a&&(r=o[u].time),null!==s&&null!==r&&(l.push([s,r]),s=null,r=null);return aG(l)}}setDuration(e,t=l1){lV({type:"mediaSource",sourceUpdater:this,action:lH.duration(e),name:"duration",doneFn:t})}endOfStream(e=null,t=l1){"string"!=typeof e&&(e=void 0),lV({type:"mediaSource",sourceUpdater:this,action:lH.endOfStream(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,i=l1){this.audioBuffered().length&&0!==this.audioBuffered().end(0)?lV({type:"audio",sourceUpdater:this,action:lH.remove(e,t),doneFn:i,name:"remove"}):i()}removeVideo(e,t,i=l1){this.videoBuffered().length&&0!==this.videoBuffered().end(0)?lV({type:"video",sourceUpdater:this,action:lH.remove(e,t),doneFn:i,name:"remove"}):i()}updating(){return!(!lF("audio",this)&&!lF("video",this))}audioTimestampOffset(e){return void 0!==e&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(lV({type:"audio",sourceUpdater:this,action:lH.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return void 0!==e&&this.videoBuffer&&this.videoTimestampOffset!==e&&(lV({type:"video",sourceUpdater:this,action:lH.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&lV({type:"audio",sourceUpdater:this,action:lH.callback(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&lV({type:"video",sourceUpdater:this,action:lH.callback(e),name:"callback"})}dispose(){this.trigger("dispose"),l6.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[e+"QueueCallback"](()=>l5(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}let lW=e=>decodeURIComponent(escape(String.fromCharCode.apply(null,e))),lz=new Uint8Array("\n\n".split("").map(e=>e.charCodeAt(0)));class lG extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}let lX=[{name:"VOD",run:(e,t,i,n,s)=>i!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"ProgramDateTime",run(e,t,i,n,s){if(!Object.keys(e.timelineToDatetimeMappings).length)return null;let r=null,a=null;var o=oa(t);s=s||0;for(let l=0;l<o.length;l++){var u=o[t.endList||0===s?l:o.length-(l+1)],d=u.segment,h=e.timelineToDatetimeMappings[d.timeline];if(h&&d.dateTimeObject){let c=d.dateTimeObject.getTime()/1e3+h;if(d.parts&&"number"==typeof u.partIndex)for(let p=0;p<u.partIndex;p++)c+=d.parts[p].duration;if(h=Math.abs(s-c),null!==a&&(0===h||a<h))break;a=h,r={time:c,segmentIndex:u.segmentIndex,partIndex:u.partIndex}}}return r}},{name:"Segment",run(e,t,i,n,s){let r=null,a=null;s=s||0;var o=oa(t);for(let l=0;l<o.length;l++){var u=o[t.endList||0===s?l:o.length-(l+1)],d=u.segment,h=u.part&&u.part.start||d&&d.start;if(d.timeline===n&&void 0!==h){if(d=Math.abs(s-h),null!==a&&a<d)break;(!r||null===a||a>=d)&&(a=d,r={time:h,segmentIndex:u.segmentIndex,partIndex:u.partIndex})}}return r}},{name:"Discontinuity",run(e,t,i,n,s){let r=null;if(s=s||0,t.discontinuityStarts&&t.discontinuityStarts.length){let a=null;for(let o=0;o<t.discontinuityStarts.length;o++){var l=t.discontinuityStarts[o],u=t.discontinuitySequence+o+1,u=e.discontinuities[u];if(u){var d=Math.abs(s-u.time);if(null!==a&&a<d)break;(!r||null===a||a>=d)&&(a=d,r={time:u.time,segmentIndex:l,partIndex:null})}}}return r}},{name:"Playlist",run:(e,t,i,n,s)=>t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}:null}];class lK extends nZ.EventTarget{constructor(e=0){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={},this.logger_=aW("SyncController")}getSyncPoint(e,t,i,n){return(e=this.runStrategies_(e,t,i,n)).length?this.selectSyncPoint_(e,{key:"time",value:n}):null}getExpiredTime(e,t){return e&&e.segments&&(t=this.runStrategies_(e,t,e.discontinuitySequence,0)).length?(0<(t=this.selectSyncPoint_(t,{key:"segmentIndex",value:0})).segmentIndex&&(t.time*=-1),Math.abs(t.time+aZ({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:t.segmentIndex,endIndex:0}))):null}runStrategies_(e,t,i,n){var s=[];for(let r=0;r<lX.length;r++){var a=lX[r],o=a.run(this,e,t,i,n);o&&(o.strategy=a.name,s.push({strategy:a.name,syncPoint:o}))}return s}selectSyncPoint_(e,t){let i=e[0].syncPoint,n=Math.abs(e[0].syncPoint[t.key]-t.value),s=e[0].strategy;for(let r=1;r<e.length;r++){var a=Math.abs(e[r].syncPoint[t.key]-t.value);a<n&&(n=a,i=e[r].syncPoint,s=e[r].strategy)}return this.logger_(`syncPoint for [${t.key}: ${t.value}] chosen with strategy [${s}]: [time:${i.time}, segmentIndex:`+i.segmentIndex+("number"==typeof i.partIndex?",partIndex:"+i.partIndex:"")+"]"),i}saveExpiredSegmentInfo(e,t){var i=t.mediaSequence-e.mediaSequence;if(86400<i)nZ.log.warn(`Not saving expired segment info. Media sequence gap ${i} is too large.`);else for(let n=i-1;0<=n;n--){var s=e.segments[n];if(s&&void 0!==s.start){t.syncInfo={mediaSequence:e.mediaSequence+n,time:s.start},this.logger_(`playlist refresh sync: [time:${t.syncInfo.time}, mediaSequence: ${t.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){var t;this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject&&(t=(e=e.segments[0]).dateTimeObject.getTime()/1e3,this.timelineToDatetimeMappings[e.timeline]=-t)}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){var i=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),n=e.segment,i=(i&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:n.start})),n.dateTimeObject);n.discontinuity&&t&&i&&(this.timelineToDatetimeMappings[n.timeline]=-i.getTime()/1e3)}timestampOffsetForTimeline(e){return void 0===this.timelines[e]?null:this.timelines[e].time}mappingForTimeline(e){return void 0===this.timelines[e]?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,i){var n=e.segment,s=e.part;let r=this.timelines[e.timeline],a,o;if("number"==typeof e.timestampOffset)r={time:e.startOfSegment,mapping:e.startOfSegment-t.start},i&&(this.timelines[e.timeline]=r,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${r.time}] [mapping: ${r.mapping}]`)),a=e.startOfSegment;else{if(!r)return!1;a=t.start+r.mapping}return o=t.end+r.mapping,s&&(s.start=a,s.end=o),(!n.start||a<n.start)&&(n.start=a),n.end=o,!0}saveDiscontinuitySyncInfo_(e){var 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 n=0;n<t.discontinuityStarts.length;n++){var s=t.discontinuityStarts[n],r=t.discontinuitySequence+n+1,a=s-e.mediaIndex,o=Math.abs(a);if(!this.discontinuities[r]||this.discontinuities[r].accuracy>o){let l;l=a<0?i.start-aZ({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:s}):i.end+aZ({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:s}),this.discontinuities[r]={time:l,accuracy:o}}}}dispose(){this.trigger("dispose"),this.off()}}class lY extends nZ.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:i}){return"number"==typeof t&&"number"==typeof i&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:i},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:i}){return"number"==typeof t&&"number"==typeof i&&(this.lastTimelineChanges_[e]={type:e,from:t,to:i},delete this.pendingTimelineChanges_[e],this.trigger("timelinechange")),this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}var lQ=oY(oQ(oZ(function(){var e=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){return!!this.listeners[e]&&(t=this.listeners[e].indexOf(t),this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(t,1),-1<t)},t.trigger=function(e){var t=this.listeners[e];if(t){if(2===arguments.length)for(var i=t.length,n=0;n<i;++n)t[n].call(this,arguments[1]);else for(var s=Array.prototype.slice.call(arguments,1),r=t.length,a=0;a<r;++a)t[a].apply(this,s)}},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",function(t){e.push(t)})},e}();/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */ let t=null;class i{constructor(e){t=t||function(){var e=[[[],[],[],[],[]],[[],[],[],[],[]]],t=e[0],i=e[1],n=t[4],s=i[4];let r,a,o;var l,u,d,h,c=[],p=[];let m,f;for(r=0;r<256;r++)p[(c[r]=r<<1^283*(r>>7))^r]=r;for(a=o=0;!n[a];a^=l||1,o=p[o]||1)for(h=(h=o^o<<1^o<<2^o<<3^o<<4)>>8^255&h^99,f=16843009*(d=c[u=c[l=c[s[n[a]=h]=a]]])^65537*u^257*l^16843008*a,m=257*c[h]^16843008*h,r=0;r<4;r++)t[r][a]=m=m<<24^m>>>8,i[r][h]=f=f<<24^f>>>8;for(r=0;r<5;r++)t[r]=t[r].slice(0),i[r]=i[r].slice(0);return e}(),this._tables=[[t[0][0].slice(),t[0][1].slice(),t[0][2].slice(),t[0][3].slice(),t[0][4].slice()],[t[1][0].slice(),t[1][1].slice(),t[1][2].slice(),t[1][3].slice(),t[1][4].slice()]];let i,n,s;var r=this._tables[0][4],a=this._tables[1],o=e.length;let l=1;if(4!==o&&6!==o&&8!==o)throw Error("Invalid aes key size");var u=e.slice(0),d=[];for(this._key=[u,d],i=o;i<4*o+28;i++)s=u[i-1],(i%o==0||8===o&&i%o==4)&&(s=r[s>>>24]<<24^r[s>>16&255]<<16^r[s>>8&255]<<8^r[255&s],i%o==0)&&(s=s<<8^s>>>24^l<<24,l=l<<1^283*(l>>7)),u[i]=u[i-o]^s;for(n=0;i;n++,i--)s=u[3&n?i:i-4],i<=4||n<4?d[n]=s:d[n]=a[0][r[s>>>24]]^a[1][r[s>>16&255]]^a[2][r[s>>8&255]]^a[3][r[255&s]]}decrypt(e,t,i,n,s,r){var a,o,l=this._key[1];let u=e^l[0],d=n^l[1],h=i^l[2],c=t^l[3],p;var m=l.length/4-2;let f,g=4;var e=this._tables[1],y=e[0],v=e[1],b=e[2],$=e[3],T=e[4];for(f=0;f<m;f++)p=y[u>>>24]^v[d>>16&255]^b[h>>8&255]^$[255&c]^l[g],a=y[d>>>24]^v[h>>16&255]^b[c>>8&255]^$[255&u]^l[g+1],o=y[h>>>24]^v[c>>16&255]^b[u>>8&255]^$[255&d]^l[g+2],c=y[c>>>24]^v[u>>16&255]^b[d>>8&255]^$[255&h]^l[g+3],g+=4,u=p,d=a,h=o;for(f=0;f<4;f++)s[(3&-f)+r]=T[u>>>24]<<24^T[d>>16&255]<<16^T[h>>8&255]<<8^T[255&c]^l[g++],p=u,u=d,d=h,h=c,c=p}}function n(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24}class s{constructor(t,i,r,a){var o=s.STEP,l=new Int32Array(t.buffer);let u=new Uint8Array(t.byteLength),d=0;for(this.asyncStream_=new class t extends e{constructor(){super(e),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(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}},this.asyncStream_.push(this.decryptChunk_(l.subarray(d,d+o),i,r,u)),d=o;d<l.length;d+=o)r=new Uint32Array([n(l[d-4]),n(l[d-3]),n(l[d-2]),n(l[d-1])]),this.asyncStream_.push(this.decryptChunk_(l.subarray(d,d+o),i,r,u));this.asyncStream_.push(function(){var e;/*! @name aes-decrypter @version 4.0.1 @license Apache-2.0 */ a(null,(e=u).subarray(0,e.byteLength-e[e.byteLength-1]))})}static get STEP(){return 32e3}decryptChunk_(e,t,s,r){return function(){var a=function(e,t,s){var r,a,o,l,u=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),d=new i(Array.prototype.slice.call(t)),t=new Uint8Array(e.byteLength),h=new Int32Array(t.buffer);let c,p,m,f,g;for(c=s[0],p=s[1],m=s[2],f=s[3],g=0;g<u.length;g+=4)r=n(u[g]),a=n(u[g+1]),o=n(u[g+2]),l=n(u[g+3]),d.decrypt(r,a,o,l,h,g),h[g]=n(h[g]^c),h[g+1]=n(h[g+1]^p),h[g+2]=n(h[g+2]^m),h[g+3]=n(h[g+3]^f),c=r,p=a,m=o,f=l;return t}(e,t,s);r.set(a,e.byteOffset)}}}var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},r="undefined"!=typeof window?window:void 0!==r?r:"undefined"!=typeof self?self:{},r=r.BigInt||Number;r("0x1"),r("0x100"),r("0x10000"),r("0x1000000"),r("0x100000000"),r("0x10000000000"),r("0x1000000000000"),r("0x100000000000000"),r("0x10000000000000000"),r=new Uint16Array([65484]),255!==(r=new Uint8Array(r.buffer,r.byteOffset,r.byteLength))[0]&&r[0],self.onmessage=function(e){let t=e.data;var e=new Uint8Array(t.encrypted.bytes,t.encrypted.byteOffset,t.encrypted.byteLength),i=new Uint32Array(t.key.bytes,t.key.byteOffset,t.key.byteLength/4),n=new Uint32Array(t.iv.bytes,t.iv.byteOffset,t.iv.byteLength/4);new s(e,i,n,function(e,i){self.postMessage(function e(t){let i={};return Object.keys(t).forEach(e=>{var n,s=t[e];n=s,("function"===ArrayBuffer.isView?ArrayBuffer.isView(n):n&&n.buffer instanceof ArrayBuffer)?i[e]={bytes:s.buffer,byteOffset:s.byteOffset,byteLength:s.byteLength}:i[e]=s}),i}({source:t.source,decrypted:i}),[i.buffer])})}})));let lZ=(e,t)=>{e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},lJ=(e,t)=>{(t.activePlaylistLoader=e).load()},ue={AUDIO:(e,t)=>()=>{var{segmentLoaders:{[e]:i},mediaTypes:{[e]:n},excludePlaylist:s}=t,i=(lZ(i,n),n.activeTrack()),r=n.activeGroup(),r=(r.filter(e=>e.default)[0]||r[0]).id,a=n.tracks[r];if(i===a)s({error:{message:"Problem encountered loading the default audio track."}});else{for(let o in nZ.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),n.tracks)n.tracks[o].enabled=n.tracks[o]===a;n.onTrackChanged()}},SUBTITLES:(e,t)=>()=>{var{segmentLoaders:{[e]:i},mediaTypes:{[e]:n}}=t,i=(nZ.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),lZ(i,n),n.activeTrack());i&&(i.mode="disabled"),n.onTrackChanged()}},ut={AUDIO(e,t,i){if(!t)return;let{tech:n,requestOptions:s,segmentLoaders:{[e]:r}}=i;t.on("loadedmetadata",()=>{var e=t.media();r.playlist(e,s),(!n.paused()||e.endList&&"none"!==n.preload())&&r.load()}),t.on("loadedplaylist",()=>{r.playlist(t.media(),s),n.paused()||r.load()}),t.on("error",ue[e](e,i))},SUBTITLES(e,t,i){let{tech:n,requestOptions:s,segmentLoaders:{[e]:r},mediaTypes:{[e]:a}}=i;t.on("loadedmetadata",()=>{var e=t.media();r.playlist(e,s),r.track(a.activeTrack()),(!n.paused()||e.endList&&"none"!==n.preload())&&r.load()}),t.on("loadedplaylist",()=>{r.playlist(t.media(),s),n.paused()||r.load()}),t.on("error",ue[e](e,i))}},ui={AUDIO(e,t){var i,{vhs:n,sourceType:s,segmentLoaders:{[e]:r},requestOptions:a,main:{mediaGroups:o},mediaTypes:{[e]:{groups:l,tracks:u,logger_:d}},mainPlaylistLoader:h}=t,c=o$(h.main);for(let p in o[e]&&0!==Object.keys(o[e]).length||(o[e]={main:{default:{default:!0}}},c&&(o[e].main.default.playlists=h.main.playlists)),o[e])for(let m in l[p]||(l[p]=[]),o[e][p]){let f=o[e][p][m],g;g=c?(d(`AUDIO group '${p}' label '${m}' is a main playlist`),f.isMainPlaylist=!0,null):"vhs-json"===s&&f.playlists?new oL(f.playlists[0],n,a):f.resolvedUri?new oL(f.resolvedUri,n,a):f.playlists&&"dash"===s?new oz(f.playlists[0],n,a,h):null,f=az({id:m,playlistLoader:g},f),ut[e](e,f.playlistLoader,t),l[p].push(f),void 0===u[m]&&(i=new nZ.AudioTrack({id:m,kind:(e=>{let t=e.default?"main":"alternative";return e.characteristics&&0<=e.characteristics.indexOf("public.accessibility.describes-video")?"main-desc":t})(f),enabled:!1,language:f.language,default:f.default,label:m}),u[m]=i)}r.on("error",ue[e](e,t))},SUBTITLES(e,t){var i,{tech:n,vhs:s,sourceType:r,segmentLoaders:{[e]:a},requestOptions:o,main:{mediaGroups:l},mediaTypes:{[e]:{groups:u,tracks:d}},mainPlaylistLoader:h}=t;for(let c in l[e])for(let p in u[c]||(u[c]=[]),l[e][c])if(!l[e][c][p].forced){let m=l[e][c][p],f;if("hls"===r)f=new oL(m.resolvedUri,s,o);else if("dash"===r){if(!m.playlists.filter(e=>e.excludeUntil!==1/0).length)return;f=new oz(m.playlists[0],s,o,h)}else"vhs-json"===r&&(f=new oL(m.playlists?m.playlists[0]:m.resolvedUri,s,o));m=az({id:p,playlistLoader:f},m),ut[e](e,m.playlistLoader,t),u[c].push(m),void 0===d[p]&&(i=n.addRemoteTextTrack({id:p,kind:"subtitles",default:m.default&&m.autoselect,language:m.language,label:p},!1).track,d[p]=i)}a.on("error",ue[e](e,t))},"CLOSED-CAPTIONS"(e,t){var{tech:i,main:{mediaGroups:n},mediaTypes:{[e]:{groups:s,tracks:r}}}=t;for(let a in n[e])for(let o in s[a]||(s[a]=[]),n[e][a]){var l=n[e][a][o];if(/^(?:CC|SERVICE)/.test(l.instreamId)){var u=i.options_.vhs&&i.options_.vhs.captionServices||{};let d={label:o,language:l.language,instreamId:l.instreamId,default:l.default&&l.autoselect};void 0===(d=u[d.instreamId]?az(d,u[d.instreamId]):d).default&&delete d.default,s[a].push(az({id:o},l)),void 0===r[o]&&(u=i.addRemoteTextTrack({id:d.instreamId,kind:"captions",default:d.default,language:d.language,label:d.label},!1).track,r[o]=u)}}}},un=(e,t)=>{for(let i=0;i<e.length;i++)if(ob(t,e[i])||e[i].playlists&&un(e[i].playlists,t))return!0;return!1},us={AUDIO:(e,t)=>()=>{var{[e]:{tracks:i}}=t.mediaTypes;for(let n in i)if(i[n].enabled)return i[n];return null},SUBTITLES:(e,t)=>()=>{var{[e]:{tracks:i}}=t.mediaTypes;for(let n in i)if("showing"===i[n].mode||"hidden"===i[n].mode)return i[n];return null}},ur=e=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(t=>{ui[t](t,e)});let{mediaTypes:t,mainPlaylistLoader:i,tech:n,vhs:s,segmentLoaders:{AUDIO:r,main:a}}=e;["AUDIO","SUBTITLES"].forEach(i=>{var n,s,r,a,o,l,u,d,h,c;t[i].activeGroup=(n=i,s=e,e=>{var{mainPlaylistLoader:t,mediaTypes:{[n]:{groups:i}}}=s,r=t.media();if(!r)return null;let a=null;r.attributes[n]&&(a=i[r.attributes[n]]);var o=Object.keys(i);if(!a){if("AUDIO"===n&&1<o.length&&o$(s.main))for(let l=0;l<o.length;l++){var u=i[o[l]];if(un(u,r)){a=u;break}}else i.main?a=i.main:1===o.length&&(a=i[o[0]])}return void 0===e?a:null!==e&&a&&a.filter(t=>t.id===e.id)[0]||null}),t[i].activeTrack=us[i](i,e),t[i].onGroupChanged=(r=i,a=e,()=>{var{segmentLoaders:{[r]:e,main:t},mediaTypes:{[r]:i}}=a,n=i.activeTrack(),s=i.getActiveGroup(),o=i.activePlaylistLoader,l=i.lastGroup_;s&&l&&s.id===l.id||(i.lastGroup_=s,i.lastTrack_=n,lZ(e,i),s&&!s.isMainPlaylist&&(s.playlistLoader?(e.resyncLoader(),lJ(s.playlistLoader,i)):o&&t.resetEverything()))}),t[i].onGroupChanging=(o=i,l=e,()=>{var{segmentLoaders:{[o]:e},mediaTypes:{[o]:t}}=l;t.lastGroup_=null,e.abort(),e.pause()}),t[i].onTrackChanged=(u=i,d=e,()=>{var e,t,{mainPlaylistLoader:i,segmentLoaders:{[u]:n,main:s},mediaTypes:{[u]:r}}=d,a=r.activeTrack(),o=r.getActiveGroup(),l=r.activePlaylistLoader,h=r.lastTrack_;if((!h||!a||h.id!==a.id)&&(r.lastGroup_=o,r.lastTrack_=a,lZ(n,r),o)){if(o.isMainPlaylist)return a&&h&&a.id!==h.id&&(t=(e=d.vhs.playlistController_).selectPlaylist(),e.media()!==t)?(r.logger_(`track change. Switching main audio from ${h.id} to `+a.id),i.pause(),s.resetEverything(),void e.fastQualityChange_(t)):void 0;if("AUDIO"===u){if(!o.playlistLoader)return s.setAudio(!0),void s.resetEverything();n.setAudio(!0),s.setAudio(!1)}l===o.playlistLoader||(n.track&&n.track(a),n.resetEverything()),lJ(o.playlistLoader,r)}}),t[i].getActiveGroup=([h,c]=[i,e.mediaTypes],()=>{var e=c[h].activeTrack();return e?c[h].activeGroup(e):null})});var o=t.AUDIO.activeGroup();o&&(o=(o.filter(e=>e.default)[0]||o[0]).id,t.AUDIO.tracks[o].enabled=!0,t.AUDIO.onGroupChanged(),t.AUDIO.onTrackChanged(),(t.AUDIO.getActiveGroup().playlistLoader?(a.setAudio(!1),r):a).setAudio(!0)),i.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(e=>t[e].onGroupChanged())}),i.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(e=>t[e].onGroupChanging())});let l=()=>{t.AUDIO.onTrackChanged(),n.trigger({type:"usage",name:"vhs-audio-change"})};for(let u in n.audioTracks().addEventListener("change",l),n.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),s.on("dispose",()=>{n.audioTracks().removeEventListener("change",l),n.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)}),n.clearTracks("audio"),t.AUDIO.tracks)n.audioTracks().addTrack(t.AUDIO.tracks[u])},ua;class uo extends nZ.EventTarget{constructor(e){super();let{src:t,withCredentials:i,tech:n,bandwidth:s,externVhs:r,useCueTags:a,playlistExclusionDuration:o,enableLowInitialPlaylist:l,sourceType:u,cacheEncryptionKeys:d,bufferBasedABR:h,leastPixelDiffSelector:c,captionServices:p}=e;if(!t)throw Error("A non-empty playlist URL or JSON manifest string is required");let m=e.maxPlaylistRetries;null!=m||(m=1/0),ua=r,this.bufferBasedABR=Boolean(h),this.leastPixelDiffSelector=Boolean(c),this.withCredentials=i,this.tech_=n,this.vhs_=n.vhs,this.sourceType_=u,this.useCueTags_=a,this.playlistExclusionDuration=o,this.maxPlaylistRetries=m,this.enableLowInitialPlaylist=l,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:i,maxPlaylistRetries:m,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=(()=>{let e={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(t=>{e[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:l1,activeTrack:l1,getActiveGroup:l1,onGroupChanged:l1,onTrackChanged:l1,lastTrack_:null,logger_:aW(`MediaGroups[${t}]`)}}),e})(),this.mediaSource=new window.MediaSource,this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.seekable_=aG(),this.hasPlayed_=!1,this.syncController_=new lK(e),this.segmentMetadataTrack_=n.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.decrypter_=new lQ,this.sourceUpdater_=new l9(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new lY;var f={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:p,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:s,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:d,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings},f=(this.mainPlaylistLoader_=new("dash"===this.sourceType_?oz:oL)(t,this.vhs_,this.requestOptions_),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new l2(az(f,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new l2(az(f,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new class e extends l2{constructor(e,t={}){super(e,t),this.mediaSource_=null,this.subtitlesTrack_=null,this.loaderType_="subtitle",this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}createTransmuxer_(){return null}buffered_(){var e;return this.subtitlesTrack_&&this.subtitlesTrack_.cues&&this.subtitlesTrack_.cues.length?aG([[(e=this.subtitlesTrack_.cues)[0].startTime,e[e.length-1].startTime]]):aG()}initSegmentForMap(e,t=!1){if(!e)return null;var i=oB(e);let n=this.initSegments_[i];return t&&!n&&e.bytes&&(t=lz.byteLength+e.bytes.byteLength,(t=new Uint8Array(t)).set(e.bytes),t.set(lz,e.bytes.byteLength),this.initSegments_[i]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:t}),n||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return void 0!==e&&(this.subtitlesTrack_=e,"INIT"===this.state&&this.couldBeginLoading_())&&this.init_(),this.subtitlesTrack_}remove(e,t){lD(e,t,this.subtitlesTrack_)}fillBuffer_(){var e=this.chooseNextRequest_();e&&(null===this.syncController_.timestampOffsetForTimeline(e.timeline)?(this.syncController_.one("timestampoffset",()=>{this.state="READY",this.paused()||this.monitorBuffer_()}),this.state="WAITING_ON_TIMELINE"):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_){if(this.saveTransferStats_(t.stats),this.pendingSegment_){if(e)e.code===lf.TIMEOUT&&this.handleTimeout_(),e.code===lf.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(e);else{var n=this.pendingSegment_,s=(this.saveBandwidthRelatedStats_(n.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending"),n.segment);if(s.map&&(s.map.bytes=t.map.bytes),n.bytes=t.bytes,"function"!=typeof window.WebVTT&&"function"==typeof this.loadVttJs)this.state="WAITING_ON_VTTJS",this.loadVttJs().then(()=>this.segmentRequestFinished_(e,t,i),()=>this.stopForError({message:"Error loading vtt.js"}));else{s.requested=!0;try{this.parseVTTCues_(n)}catch(r){return void this.stopForError({message:r.message})}if(this.updateTimeMapping_(n,this.syncController_.timelines[n.timeline],this.playlist_),n.cues.length?n.timingInfo={start:n.cues[0].startTime,end:n.cues[n.cues.length-1].endTime}:n.timingInfo={start:n.startOfSegment,end:n.startOfSegment+n.duration},n.isSyncRequest)this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";else{n.byteLength=n.bytes.byteLength,this.mediaSecondsLoaded+=s.duration,n.cues.forEach(e=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new window.VTTCue(e.startTime,e.endTime,e.text):e)});var a=this.subtitlesTrack_,o=a.cues;if(o)for(let l=0;l<o.length;l++){var u=[];let d=0;for(let h=0;h<o.length;h++)o[l].startTime===o[h].startTime&&o[l].endTime===o[h].endTime&&o[l].text===o[h].text&&1<++d&&u.push(o[h]);u.length&&u.forEach(e=>a.removeCue(e))}this.handleAppendsDone_()}}}}else this.state="READY",this.mediaRequestsAborted+=1}else this.state="READY"}handleData_(){}updateTimingInfoEnd_(){}parseVTTCues_(e){let t,i=!1;if("function"!=typeof window.WebVTT)throw new lG;"function"==typeof window.TextDecoder?t=new window.TextDecoder("utf8"):(t=window.WebVTT.StringDecoder(),i=!0);var n=new window.WebVTT.Parser(window,window.vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},n.oncue=e.cues.push.bind(e.cues),n.ontimestampmap=t=>{e.timestampmap=t},n.onparsingerror=e=>{nZ.log.warn("Error encountered when parsing cues: "+e.message)},e.segment.map){let s=e.segment.map.bytes;i&&(s=lW(s)),n.parse(s)}let r=e.bytes;i&&(r=lW(r)),n.parse(r),n.flush()}updateTimeMapping_(e,t,i){var n=e.segment;if(t){if(e.cues.length){var s=e.timestampmap;let r=s.MPEGTS/9e4-s.LOCAL+t.mapping;e.cues.forEach(e=>{e.startTime+=r,e.endTime+=r}),i.syncInfo||(s=e.cues[0].startTime,t=e.cues[e.cues.length-1].startTime,i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(s,t-n.duration)})}else n.empty=!0}}}(az(f,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((e,t)=>{function i(){n.off("vttjserror",s),e()}function s(){n.off("vttjsloaded",i),t()}n.one("vttjsloaded",i),n.one("vttjserror",s),n.addWebVttScript_()})}),e),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"].forEach(e=>{this[e+"_"]=(function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]}).bind(this,e)}),this.logger_=aW("pc"),this.triggeredFmp4Usage=!1,"none"===this.tech_.preload()?(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,"none"===this.tech_.preload()?"play":"loadstart");this.tech_.one(f,()=>{let e=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-e,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){var e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return -1===e||-1===t?-1:e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){var t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}switchMedia_(e,t,i){var n=this.media(),n=n&&(n.id||n.uri),s=e.id||e.uri;n&&n!==s&&(this.logger_(`switch media ${n} -> ${s} from `+t),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+t})),this.mainPlaylistLoader_.media(e,i)}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=window.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(window.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){var e=this.main(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;var i=e.mediaGroups.AUDIO,n=Object.keys(i);let s;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)s=this.mediaTypes_.AUDIO.activeTrack();else{var r=i.main||n.length&&i[n[0]];for(let a in r)if(r[a].default){s={label:a};break}}if(!s)return t;var o=[];for(let l in i)if(i[l][s.label]){var u=i[l][s.label];if(u.playlists&&u.playlists.length)o.push.apply(o,u.playlists);else if(u.uri)o.push(u);else if(e.playlists.length)for(let d=0;d<e.playlists.length;d++){var h=e.playlists[d];h.attributes&&h.attributes.AUDIO&&h.attributes.AUDIO===l&&o.push(h)}}return o.length?o:t}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",()=>{var e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;o8(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,e.endList&&"none"!==this.tech_.preload()&&(this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.mainSegmentLoader_.load()),ur({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.excludeUnsupportedVariants_();let t;if(!(t=(t=this.enableLowInitialPlaylist?this.selectInitialPlaylist():t)||this.selectPlaylist())||!this.shouldSwitchToMedia_(t)||(this.initialMedia_=t,this.switchMedia_(this.initialMedia_,"initial"),!("vhs-json"===this.sourceType_&&this.initialMedia_.segments)))return;e=this.initialMedia_}this.handleUpdatedMediaPlaylist(e)}),this.mainPlaylistLoader_.on("error",()=>{var 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",()=>{var e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;o8(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{var e=this.mainPlaylistLoader_.media();"playlist-unchanged"!==e.lastExcludeReason_&&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"})})}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,t){var i=e.mediaGroups||{};let n=!0;for(let s in e=Object.keys(i.AUDIO),i.AUDIO)for(let r in i.AUDIO[s])i.AUDIO[s][r].uri||(n=!1);n&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(i.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),ua.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),e.length&&1<Object.keys(i.AUDIO[e[0]]).length&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){var t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,i=this.tech_.currentTime(),n=this.bufferLowWaterLine(),s=this.bufferHighWaterLine(),{currentPlaylist:i,buffered:t,currentTime:e,nextPlaylist:n,bufferLowWaterLine:s,bufferHighWaterLine:r,duration:a,bufferBasedABR:o,log:l}={buffered:this.tech_.buffered(),currentTime:i,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:n,bufferHighWaterLine:s,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_};if(n){var u=`allowing switch ${i&&i.id||"null"} -> `+n.id;if(!i)return l(u+" as current playlist is not set"),!0;if(n.id!==i.id){var d=Boolean(aX(t,e).length);if(!i.endList)return d||"number"!=typeof i.partTargetDuration?(l(u+" as current playlist is live"),!0):(l(`not ${u} as current playlist is live llhls, but currentTime isn't in buffered.`),!1);if(d=aQ(t,e),a<(t=o?oG.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:oG.MAX_BUFFER_LOW_WATER_LINE))return l(u+` as duration < max low water line (${a} < ${t})`),!0;if((e=n.attributes.BANDWIDTH)<(a=i.attributes.BANDWIDTH)&&(!o||d<r)){let h=u+` as next bandwidth < current bandwidth (${e} < ${a})`;return o&&(h+=` and forwardBuffer < bufferHighWaterLine (${d} < ${r})`),l(h),!0}if((!o||a<e)&&s<=d){let c=u+` as forwardBuffer >= bufferLowWaterLine (${d} >= ${s})`;return o&&(c+=` and next bandwidth > current bandwidth (${e} > ${a})`),l(c),!0}l(`not ${u} as no switching criteria met`)}}else nZ.log.warn("We received no playlist to switch to. Please check your stream.");return!1}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",()=>{var e=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:e.playlist,error:e})}),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.mainSegmentLoader_.on("earlyabort",e=>{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:120}))});var e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();var e=this.getCodecsOrExclude_();e&&this.sourceUpdater_.addOrChangeSourceBuffers(e)};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()})}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()}fastQualityChange_(e=this.selectPlaylist()){e===this.mainPlaylistLoader_.media()?this.logger_("skipping fastQualityChange because new media is same as old"):(this.switchMedia_(e,"fast-quality"),this.mainSegmentLoader_.resetEverything(()=>{nZ.browser.IE_VERSION||nZ.browser.IS_EDGE?this.tech_.setCurrentTime(this.tech_.currentTime()+.04):this.tech_.setCurrentTime(this.tech_.currentTime())}))}play(){var e;if(!this.setupFirstPlay())return this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load(),e=this.tech_.seekable(),this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0)?this.tech_.setCurrentTime(e.end(e.length-1)):void 0}setupFirstPlay(){var e=this.mainPlaylistLoader_.media();if(!e||this.tech_.paused()||this.hasPlayed_)return!1;if(!e.endList){let t=this.seekable();if(!t.length)return!1;if(nZ.browser.IE_VERSION&&0===this.tech_.readyState())return this.tech_.one("loadedmetadata",()=>{this.trigger("firstplay"),this.tech_.setCurrentTime(t.end(0)),this.hasPlayed_=!0}),!1;this.trigger("firstplay"),this.tech_.setCurrentTime(t.end(0))}return this.hasPlayed_=!0,this.load(),!0}handleSourceOpen_(){var e;this.tryToCreateSourceBuffers_(),this.tech_.autoplay()&&void 0!==(e=this.tech_.play())&&"function"==typeof e.then&&e.then(null,e=>{}),this.trigger("sourceopen")}handleSourceEnded_(){var e,t;this.inbandTextTracks_.metadataTrack_&&(e=this.inbandTextTracks_.metadataTrack_.cues)&&e.length&&(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(){var e;let t=this.mainSegmentLoader_.ended_;this.mediaTypes_.AUDIO.activePlaylistLoader&&(t=((e=this.mainSegmentLoader_.getCurrentMediaInfo_())&&!e.hasVideo||t)&&this.audioSegmentLoader_.ended_),t&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){var t,i;return!!this.seekable().length&&null!==(t=this.syncController_.getExpiredTime(e,this.duration()))&&(e=ua.Playlist.playlistEnd(e,t),t=this.tech_.currentTime(),(i=this.tech_.buffered()).length?(i=i.end(i.length-1))-t<=ot&&e-i<=ot:e-t<=ot)}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:i}){if(e=e||this.mainPlaylistLoader_.media(),i=i||t.playlistExclusionDuration||this.playlistExclusionDuration,e){e.playlistErrors_++;var n=this.mainPlaylistLoader_.main.playlists,s=n.filter(og),s=1===s.length&&s[0]===e;if(1===n.length&&i!==1/0)return nZ.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(s);if(s){let r=!1;n.forEach(t=>{var i;t!==e&&void 0!==(i=t.excludeUntil)&&i!==1/0&&(r=!0,delete t.excludeUntil)}),r&&(nZ.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let a;a=e.playlistErrors_>this.maxPlaylistRetries?1/0:Date.now()+1e3*i,e.excludeUntil=a,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});var o,n=this.selectPlaylist();if(n)return i=t.internal?this.logger_:nZ.log.warn,o=t.message?" "+t.message:"",i(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.`+o+` Switching to playlist ${n.id}.`),n.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),n.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]),i=n.targetDuration/2*1e3||5e3,o="number"==typeof n.lastRequest&&Date.now()-n.lastRequest<=i,this.switchMedia_(n,"exclude",s||o);this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error")}else this.error=t,"open"!==this.mediaSource.readyState?this.trigger("error"):this.sourceUpdater_.endOfStream("network")}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,t){let i=[];var n="all"===e,s=((n||"main"===e)&&i.push(this.mainPlaylistLoader_),[]);(n||"audio"===e)&&s.push("AUDIO"),(n||"subtitle"===e)&&(s.push("CLOSED-CAPTIONS"),s.push("SUBTITLES")),s.forEach(e=>{(e=this.mediaTypes_[e]&&this.mediaTypes_[e].activePlaylistLoader)&&i.push(e)}),["main","audio","subtitle"].forEach(t=>{var n=this[t+"SegmentLoader_"];n&&(e===t||"all"===e)&&i.push(n)}),i.forEach(e=>t.forEach(t=>{"function"==typeof e[t]&&e[t]()}))}setCurrentTime(e){var t=aX(this.tech_.buffered(),e);return this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media()&&this.mainPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),void this.load()):0}duration(){var e;return this.mainPlaylistLoader_&&(e=this.mainPlaylistLoader_.media())?e.endList?this.mediaSource?this.mediaSource.duration:ua.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}onSyncInfoUpdate_(){let e;if(this.mainPlaylistLoader_){var t=this.mainPlaylistLoader_.media();if(t){var i=this.syncController_.getExpiredTime(t,this.duration());if(null!==i){var n=this.mainPlaylistLoader_.main,s=ua.Playlist.seekable(t,i,ua.Playlist.liveEdgeDelay(n,t));if(0!==s.length){if(this.mediaTypes_.AUDIO.activePlaylistLoader&&(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),null===(i=this.syncController_.getExpiredTime(t,this.duration()))||0===(e=ua.Playlist.seekable(t,i,ua.Playlist.liveEdgeDelay(n,t))).length))return;let r,a;this.seekable_&&this.seekable_.length&&(r=this.seekable_.end(0),a=this.seekable_.start(0)),!e||e.start(0)>s.end(0)||s.start(0)>e.end(0)?this.seekable_=s:this.seekable_=aG([[(e.start(0)>s.start(0)?e:s).start(0),(e.end(0)<s.end(0)?e:s).end(0)]]),this.seekable_&&this.seekable_.length&&this.seekable_.end(0)===r&&this.seekable_.start(0)===a||(this.logger_(`seekable updated [${on(this.seekable_)}]`),this.tech_.trigger("seekablechanged"))}}}}}updateDuration(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),"open"!==this.mediaSource.readyState)this.updateDuration_=this.updateDuration.bind(this,e),this.mediaSource.addEventListener("sourceopen",this.updateDuration_);else{if(e)return(e=this.seekable()).length?void((isNaN(this.mediaSource.duration)||this.mediaSource.duration<e.end(e.length-1))&&this.sourceUpdater_.setDuration(e.end(e.length-1))):void 0;e=this.tech_.buffered();let t=ua.Playlist.duration(this.mainPlaylistLoader_.media());0<e.length&&(t=Math.max(t,e.end(e.length-1))),this.mediaSource.duration!==t&&this.sourceUpdater_.setDuration(t)}}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(e=>{var t=this.mediaTypes_[e].groups;for(let i in t)t[i].forEach(e=>{e.playlistLoader&&e.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_(){var e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),e=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return t&&e}getCodecsOrExclude_(){let e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;var i=lc(this.main(),t);let n={};var s=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(n.video=i.video||e.main.videoCodec||"avc1.4d400d"),e.main.isMuxed&&(n.video+=","+(i.audio||e.main.audioCodec||sv)),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||s)&&(n.audio=i.audio||e.main.audioCodec||e.audio.audioCodec||sv,e.audio.isFmp4=(e.main.hasAudio&&!e.main.isMuxed?e.main:e.audio).isFmp4),n.audio||n.video){let r={},a;if(["video","audio"].forEach(function(t){var i,s;n.hasOwnProperty(t)&&!((i=e[t].isFmp4)?so:sl)(s=n[t])&&(r[i=e[t].isFmp4?"browser":"muxer"]=r[i]||[],r[i].push(n[t]),"audio"===t&&(a=i))}),s&&a&&t.attributes.AUDIO){let o=t.attributes.AUDIO;this.main().playlists.forEach(e=>{(e.attributes&&e.attributes.AUDIO)===o&&e!==t&&(e.excludeUntil=1/0)}),this.logger_(`excluding audio group ${o} as ${a} does not support codec(s): "${n.audio}"`)}if(!Object.keys(r).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){let l=[];if(["video","audio"].forEach(e=>{var t=(sg(this.sourceUpdater_.codecs[e]||"")[0]||{}).type,i=(sg(n[e]||"")[0]||{}).type;t&&i&&t.toLowerCase()!==i.toLowerCase()&&l.push(`"${this.sourceUpdater_.codecs[e]}" -> "${n[e]}"`)}),l.length)return void this.excludePlaylist({playlistToExclude:t,error:{message:`Codec switching not supported: ${l.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0})}return n}i=Object.keys(r).reduce((e,t)=>(e&&(e+=", "),e+=`${t} does not support codec(s): "${r[t].join(",")}"`),"")+".",this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:i},playlistExclusionDuration:1/0})}else this.excludePlaylist({playlistToExclude:t,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0})}tryToCreateSourceBuffers_(){var e;"open"!==this.mediaSource.readyState||this.sourceUpdater_.hasCreatedSourceBuffers()||this.areMediaTypesKnown_()&&(e=this.getCodecsOrExclude_())&&(this.sourceUpdater_.createSourceBuffers(e),e=[e.video,e.audio].filter(Boolean).join(","),this.excludeIncompatibleVariants_(e))}excludeUnsupportedVariants_(){let e=this.main().playlists,t=[];Object.keys(e).forEach(i=>{var n,s,i=e[i];-1===t.indexOf(i.id)&&(t.push(i.id),s=[],!(n=lc(this.main,i)).audio||sl(n.audio)||so(n.audio)||s.push("audio codec "+n.audio),!n.video||sl(n.video)||so(n.video)||s.push("video codec "+n.video),n.text&&"stpp.ttml.im1t"===n.text&&s.push("text codec "+n.text),s.length)&&(i.excludeUntil=1/0,this.logger_(`excluding ${i.id} for unsupported: `+s.join(", ")))})}excludeIncompatibleVariants_(e){let t=[],i=this.main().playlists;e=l0(sg(e));let n=lh(e),s=e.video&&sg(e.video)[0]||null,r=e.audio&&sg(e.audio)[0]||null;Object.keys(i).forEach(e=>{var a,o,l,e=i[e];-1===t.indexOf(e.id)&&e.excludeUntil!==1/0&&(t.push(e.id),a=[],l=lc(this.mainPlaylistLoader_.main,e),o=lh(l),l.audio||l.video)&&(o!==n&&a.push(`codec count "${o}" !== "${n}"`),this.sourceUpdater_.canChangeType()||(o=l.video&&sg(l.video)[0]||null,l=l.audio&&sg(l.audio)[0]||null,o&&s&&o.type.toLowerCase()!==s.type.toLowerCase()&&a.push(`video codec "${o.type}" !== "${s.type}"`),l&&r&&l.type.toLowerCase()!==r.type.toLowerCase()&&a.push(`audio codec "${l.type}" !== "${r.type}"`)),a.length)&&(e.excludeUntil=1/0,this.logger_(`excluding ${e.id}: `+a.join(" && ")))})}updateAdCues_(e){let t=0;var i=this.seekable(),[n,s,i=0]=(i.length&&(t=i.start(0)),[e,this.cueTagsTrack_,t]);if(n.segments){let r=i,a;for(let o=0;o<n.segments.length;o++){var l,u,d=n.segments[o];if(a=a||function(e,t){var i=e.cues;for(let n=0;n<i.length;n++){var s=i[n];if(t>=s.adStartTime&&t<=s.adEndTime)return s}return null}(s,r+d.duration/2)){if("cueIn"in d){a.endTime=r,a.adEndTime=r,r+=d.duration,a=null;continue}if(r<a.endTime){r+=d.duration;continue}a.endTime+=d.duration}else"cueOut"in d&&((a=new window.VTTCue(r,r+d.duration,d.cueOut)).adStartTime=r,a.adEndTime=r+parseFloat(d.cueOut),s.addCue(a)),"cueOutCont"in d&&([l,u]=d.cueOutCont.split("/").map(parseFloat),(a=new window.VTTCue(r,r+d.duration,"")).adStartTime=r-l,a.adEndTime=a.adStartTime+u,s.addCue(a));r+=d.duration}}}goalBufferLength(){var e=this.tech_.currentTime(),t=oG.GOAL_BUFFER_LENGTH,i=oG.GOAL_BUFFER_LENGTH_RATE,n=Math.max(t,oG.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,n)}bufferLowWaterLine(){var e=this.tech_.currentTime(),t=oG.BUFFER_LOW_WATER_LINE,i=oG.BUFFER_LOW_WATER_LINE_RATE,n=Math.max(t,oG.MAX_BUFFER_LOW_WATER_LINE),s=Math.max(t,oG.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,this.bufferBasedABR?s:n)}bufferHighWaterLine(){return oG.BUFFER_HIGH_WATER_LINE}}class ul{constructor(e,t,i){var n,s,r,a,o=e.playlistController_,l=o.fastQualityChange_.bind(o);t.attributes&&(n=t.attributes.RESOLUTION,this.width=n&&n.width,this.height=n&&n.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]),this.codecs=lc(o.main(),t),this.playlist=t,this.id=i,this.enabled=(s=e.playlists,r=t.id,a=l,e=>{var t=s.main.playlists[r],i=of(t),n=og(t);return void 0===e?n:(e?delete t.disabled:t.disabled=!0,e===n||i||(a(),e?s.trigger("renditionenabled"):s.trigger("renditiondisabled")),e)})}}let uu=["seeking","seeked","pause","playing","error"];class ud{constructor(e){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.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=aW("PlaybackWatcher"),this.logger_("initialize");let t=()=>this.monitorCurrentTime_(),i=()=>this.monitorCurrentTime_(),n=()=>this.techWaiting_(),s=()=>this.resetTimeUpdate_(),r=this.playlistController_,a=["main","subtitle","audio"],o={},l=(a.forEach(e=>{o[e]={reset:()=>this.resetSegmentDownloads_(e),updateend:()=>this.checkSegmentDownloads_(e)},r[e+"SegmentLoader_"].on("appendsdone",o[e].updateend),r[e+"SegmentLoader_"].on("playlistupdate",o[e].reset),this.tech_.on(["seeked","seeking"],o[e].reset)}),e=>{["main","audio"].forEach(t=>{r[t+"SegmentLoader_"][e]("appended",this.seekingAppendCheck_)})});this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),l("off"))},this.clearSeekingAppendCheck_=()=>l("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),l("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",n),this.tech_.on(uu,s),this.tech_.on("canplay",i),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",n),this.tech_.off(uu,s),this.tech_.off("canplay",i),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),a.forEach(e=>{r[e+"SegmentLoader_"].off("appendsdone",o[e].updateend),r[e+"SegmentLoader_"].off("playlistupdate",o[e].reset),this.tech_.off(["seeked","seeking"],o[e].reset)}),this.checkCurrentTimeTimeout_&&window.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&window.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=window.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){var t=this.playlistController_[e+"SegmentLoader_"];0<this[e+"StalledDownloads_"]&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[e+"StalledDownloads_"]=0,this[e+"Buffered_"]=t.buffered_()}checkSegmentDownloads_(e){var t=this.playlistController_,i=t[e+"SegmentLoader_"],n=i.buffered_(),s=function(e,t){if(e!==t){if(!e&&t||!t&&e||e.length!==t.length)return!0;for(let i=0;i<e.length;i++)if(e.start(i)!==t.start(i)||e.end(i)!==t.end(i))return!0}return!1}(this[e+"Buffered_"],n);this[e+"Buffered_"]=n,s?this.resetSegmentDownloads_(e):(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:os(n)}),this[e+"StalledDownloads_"]<10||(this.logger_(e+" loader stalled download exclusion"),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),"subtitle"!==e&&t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0})))}checkCurrentTime_(){var e,t;if(!this.tech_.paused()&&!this.tech_.seeking())return e=this.tech_.currentTime(),t=this.tech_.buffered(),this.lastRecordedTime===e&&(!t.length||e+ot>=t.end(t.length-1))?this.techWaiting_():void(5<=this.consecutiveUpdates&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e))}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;var e=this.seekable(),t=this.tech_.currentTime();let i;if(this.afterSeekableWindow_(e,t,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(i=n=e.end(e.length-1)),this.beforeSeekableWindow_(e,t)&&(i=(n=e.start(0))+(n===e.end(0)?0:ot)),void 0!==i)this.logger_(`Trying to seek outside of seekable at time ${t} with seekable range ${on(e)}. Seeking to `+i+".");else{var n=this.playlistController_.sourceUpdater_,e=this.tech_.buffered(),s=n.audioBuffer?n.audioBuffered():null,n=n.videoBuffer?n.videoBuffered():null,r=this.media(),a=r.partTargetDuration||2*(r.targetDuration-oe),o=[s,n];for(let l=0;l<o.length;l++)if(o[l]&&aQ(o[l],t)<a)return!1;if(0===(r=aK(e,t)).length)return!1;i=r.start(0)+ot,this.logger_(`Buffered region starts (${r.start(0)}) just beyond seek point (${t}). Seeking to ${i}.`)}return this.tech_.setCurrentTime(i),!0}waiting_(){var e,t;this.techWaiting_()||(e=this.tech_.currentTime(),(t=aX(t=this.tech_.buffered(),e)).length&&e+3<=t.end(0)&&(this.resetTimeUpdate_(),this.tech_.setCurrentTime(e),this.logger_(`Stopped at ${e} while inside a buffered region [${t.start(0)} -> ${t.end(0)}]. Attempting to resume playback by seeking to the current time.`),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"})))}techWaiting_(){var e,t=this.seekable(),i=this.tech_.currentTime();return!!this.tech_.seeking()||(this.beforeSeekableWindow_(t,i)?(t=t.end(t.length-1),this.logger_(`Fell out of live window at time ${i}. Seeking to live point (seekable end) `+t),this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0):(t=this.tech_.vhs.playlistController_.sourceUpdater_,e=this.tech_.buffered(),this.videoUnderflow_({audioBuffered:t.audioBuffered(),videoBuffered:t.videoBuffered(),currentTime:i})?(this.resetTimeUpdate_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0):0<(t=aK(e,i)).length&&(this.logger_(`Stopped at ${i} and seeking to `+t.start(0)),this.resetTimeUpdate_(),this.skipTheGap_(i),!0)))}afterSeekableWindow_(e,t,i,n=!1){if(!e.length)return!1;let s=e.end(e.length-1)+ot;return t>(s=!i.endList&&n?e.end(e.length-1)+3*i.targetDuration:s)}beforeSeekableWindow_(e,t){return!!(e.length&&0<e.start(0)&&t<e.start(0)-this.liveRangeSafeTimeDelta)}videoUnderflow_({videoBuffered:e,audioBuffered:t,currentTime:i}){if(e){var n,s;let r;return e.length&&t.length?(n=aX(e,i-3),s=aX(e,i),(t=aX(t,i)).length&&!s.length&&n.length&&(r={start:n.end(0),end:t.end(0)})):aK(e,i).length||(r=this.gapFromVideoUnderflow_(e,i)),!!r&&(this.logger_(`Encountered a gap in video from ${r.start} to ${r.end}. Seeking to current time `+i),!0)}}skipTheGap_(e){var t=this.tech_.buffered(),i=this.tech_.currentTime(),t=aK(t,i);this.resetTimeUpdate_(),0!==t.length&&i===e&&(this.logger_("skipTheGap_:","currentTime:",i,"scheduled currentTime:",e,"nextRange start:",t.start(0)),this.tech_.setCurrentTime(t.start(0)+oe),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"}))}gapFromVideoUnderflow_(e,t){var i=function(e){if(e.length<2)return aG();var t=[];for(let i=1;i<e.length;i++){var n=e.end(i-1),s=e.start(i);t.push([n,s])}return aG(t)}(e);for(let n=0;n<i.length;n++){var s=i.start(n),r=i.end(n);if(t-s<4&&2<t-s)return{start:s,end:r}}return null}}let uh={errorInterval:30,getSource(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},uc=function(e,t){let i=0,n=0;function s(t){null!=t&&(n=e.duration()!==1/0&&e.currentTime()||0,e.one("loadedmetadata",l),e.src(t),e.trigger({type:"usage",name:"vhs-error-reload"}),e.play())}function r(){if(Date.now()-i<1e3*o.errorInterval)e.trigger({type:"usage",name:"vhs-error-reload-canceled"});else{if(o.getSource&&"function"==typeof o.getSource)return i=Date.now(),o.getSource.call(e,s);nZ.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")}}function a(){e.off("loadedmetadata",l),e.off("error",r),e.off("dispose",a)}let o=az(uh,t),l=(e.ready(()=>{e.trigger({type:"usage",name:"vhs-error-reload-initialized"})}),function(){n&&e.currentTime(n)});e.on("error",r),e.on("dispose",a),e.reloadSourceOnError=function(t){a(),uc(e,t)}};function up(e,t){var i=t.media();let n=-1;for(let s=0;s<e.length;s++)if(e[s].id===i.id){n=s;break}e.selectedIndex_=n,e.trigger({selectedIndex:n,type:"change"})}let um={PlaylistLoader:oL,Playlist:oT,utils:nx,STANDARD_PLAYLIST_SELECTOR:lL,INITIAL_PLAYLIST_SELECTOR:function(){var e=this.playlists.main.playlists.filter(oT.isEnabled),e=(lP(e,(e,t)=>lm(e,t)),e.filter(e=>!!lc(this.playlists.main,e).video));return e[0]||null},lastBandwidthSelector:lL,movingAverageBandwidthSelector:function(e){let t=-1,i=-1;if(e<0||1<e)throw Error("Moving average bandwidth decay must be between 0 and 1.");return function(){var n=this.useDevicePixelRatio&&window.devicePixelRatio||1;return t<0&&(t=this.systemBandwidth,i=this.systemBandwidth),0<this.systemBandwidth&&this.systemBandwidth!==i&&(t=e*this.systemBandwidth+(1-e)*t,i=this.systemBandwidth),lA(this.playlists.main,t,parseInt(lp(this.tech_.el(),"width"),10)*n,parseInt(lp(this.tech_.el(),"height"),10)*n,this.limitRenditionByPlayerDimensions,this.playlistController_)}},comparePlaylistBandwidth:lm,comparePlaylistResolution:function(e,t){let i,n;return(i=(i=e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width?e.attributes.RESOLUTION.width:i)||window.Number.MAX_VALUE)===(n=(n=t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width?t.attributes.RESOLUTION.width:n)||window.Number.MAX_VALUE)&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-n},xhr:oO()},uf=(Object.keys(oG).forEach(e=>{Object.defineProperty(um,e,{get:()=>(nZ.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),oG[e]),set(t){nZ.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),"number"!=typeof t||t<0?nZ.log.warn(`value of Vhs.${e} must be greater than or equal to 0`):oG[e]=t}})}),"videojs-vhs"),ug=(um.canPlaySource=function(){return nZ.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")},({player:e,sourceKeySystems:t,audioMedia:i,mainPlaylists:n})=>{if(!e.eme.initializeMediaKeys)return Promise.resolve();var s,i=i?n.concat([i]):n,i=(n=i,s=Object.keys(t),n.reduce((e,t)=>{var i;return t.contentProtection&&Object.keys(i=s.reduce((e,i)=>{var n=t.contentProtection[i];return n&&n.pssh&&(e[i]={pssh:n.pssh}),e},{})).length&&e.push(i),e},[]));let r=[],a=[];return i.forEach(t=>{a.push(new Promise((t,i)=>{e.tech_.one("keysessioncreated",t)})),r.push(new Promise((i,n)=>{e.eme.initializeMediaKeys({keySystems:t},e=>{e?n(e):i()})}))}),Promise.race([Promise.all(r),Promise.race(a)])}),uy=({player:e,sourceKeySystems:t,media:i,audioMedia:n})=>!(!(t=((e,t,i)=>{if(!e)return e;let n={};t&&t.attributes&&t.attributes.CODECS&&(n=l0(sg(t.attributes.CODECS))),i&&i.attributes&&i.attributes.CODECS&&(n.audio=i.attributes.CODECS);var s=sy(n.video),r=sy(n.audio),a={};for(let o in e)a[o]={},r&&(a[o].audioContentType=r),s&&(a[o].videoContentType=s),t.contentProtection&&t.contentProtection[o]&&t.contentProtection[o].pssh&&(a[o].pssh=t.contentProtection[o].pssh),"string"==typeof e[o]&&(a[o].url=e[o]);return az(e,a)})(t,i,n))||(e.currentSource().keySystems=t)&&!e.eme&&(nZ.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),1)),uv=()=>{if(!window.localStorage)return null;var e=window.localStorage.getItem(uf);if(!e)return null;try{return JSON.parse(e)}catch(t){return null}};um.supportsNativeHls=function(){if(!document||!document.createElement)return!1;let e=document.createElement("video");return!!nZ.getTech("Html5").isSupported()&&["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(t){return/maybe|probably/i.test(e.canPlayType(t))})}(),um.supportsNativeDash=!!(document&&document.createElement&&nZ.getTech("Html5").isSupported())&&/maybe|probably/i.test(document.createElement("video").canPlayType("application/dash+xml")),um.supportsTypeNatively=e=>"hls"===e?um.supportsNativeHls:"dash"===e&&um.supportsNativeDash,um.isSupported=function(){return nZ.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};class u8 extends nZ.getComponent("Component"){constructor(e,t,i){if(super(t,i.vhs),"number"==typeof i.initialBandwidth&&(this.options_.bandwidth=i.initialBandwidth),this.logger_=aW("VhsHandler"),t.options_&&t.options_.playerId&&(i=nZ.getPlayer(t.options_.playerId),this.player_=i),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 Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(document,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],e=>{var t=document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement;t&&t.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",function(){this.ignoreNextSeekingEvent_?this.ignoreNextSeekingEvent_=!1: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_(){var e;this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=!1!==this.options_.limitRenditionByPlayerDimensions,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.useBandwidthFromLocalStorage=void 0!==this.source_.useBandwidthFromLocalStorage?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=!1!==this.options_.llhls,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,"number"!=typeof this.options_.playlistExclusionDuration&&(this.options_.playlistExclusionDuration=300),"number"!=typeof this.options_.bandwidth&&this.options_.useBandwidthFromLocalStorage&&((e=uv())&&e.bandwidth&&(this.options_.bandwidth=e.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),e)&&e.throughput&&(this.options_.throughput=e.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"})),"number"!=typeof this.options_.bandwidth&&(this.options_.bandwidth=oG.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===oG.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(e=>{void 0!==this.source_[e]&&(this.options_[e]=this.source_[e])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio}src(e,t){e&&(this.setOptions_(),this.options_.src=0===(e=this.source_.src).toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")?JSON.parse(e.substring(e.indexOf(",")+1)):e,this.options_.tech=this.tech_,this.options_.externVhs=um,this.options_.sourceType=su(t),this.options_.seekTo=e=>{this.tech_.setCurrentTime(e)},this.playlistController_=new uo(this.options_),e=az({liveRangeSafeTimeDelta:ot},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_}),this.playbackWatcher_=new ud(e),this.playlistController_.on("error",()=>{var e=nZ.players[this.tech_.options_.playerId];let t=this.playlistController_.error;"object"!=typeof t||t.code?"string"==typeof t&&(t={message:t,code:3}):t.code=3,e.error(t)}),t=this.options_.bufferBasedABR?um.movingAverageBandwidthSelector(.55):um.STANDARD_PLAYLIST_SELECTOR,this.playlistController_.selectPlaylist=(this.selectPlaylist||t).bind(this),this.playlistController_.selectInitialPlaylist=um.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(e){this.playlistController_.selectPlaylist=e.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(e){this.playlistController_.mainSegmentLoader_.throughput.rate=e,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let e=this.playlistController_.mainSegmentLoader_.bandwidth;var t=window.navigator.connection||window.navigator.mozConnection||window.navigator.webkitConnection;return this.options_.useNetworkInformationApi&&t&&(e=1e7<=(t=1e3*t.downlink*1e3)&&1e7<=e?Math.max(e,t):t),e},set(e){this.playlistController_.mainSegmentLoader_.bandwidth=e,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){let e;return Math.floor(1/(1/(this.bandwidth||1)+(e=0<this.throughput?1/this.throughput:0)))},set(){nZ.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:()=>os(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:()=>os(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{if(this.options_.useBandwidthFromLocalStorage){var e={bandwidth:this.bandwidth,throughput:Math.round(this.throughput)};if(window.localStorage){var t=(t=uv())?az(t,e):e;try{window.localStorage.setItem(uf,JSON.stringify(t))}catch(i){return}}}}),this.playlistController_.on("selectedinitialmedia",()=>{var e;(e=this).representations=()=>{var t=e.playlistController_.main(),t=o$(t)?e.playlistController_.getAudioTrackPlaylists_():t.playlists;return t?t.filter(e=>!of(e)).map((t,i)=>new ul(e,t,t.id)):[]}}),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_=window.URL.createObjectURL(this.playlistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){var e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),ug({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(e=>{this.logger_("error while creating EME key session",e),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_(){var e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,e=uy({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});this.player_.tech_.on("keystatuschange",e=>{if("output-restricted"===e.status&&(e=this.playlistController_.main())&&e.playlists){let t=[];e.playlists.forEach(e=>{e&&e.attributes&&e.attributes.RESOLUTION&&720<=e.attributes.RESOLUTION.height&&(!e.excludeUntil||e.excludeUntil<1/0)&&(e.excludeUntil=1/0,t.push(e))}),t.length&&(nZ.log.warn('DRM keystatus changed to "output-restricted." Removing the following HD playlists that will most likely fail to play and clearing the buffer. This may be due to HDCP restrictions on the stream and the capabilities of the current device.',...t),this.playlistController_.fastQualityChange_())}}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),11!==nZ.browser.IE_VERSION&&e?this.createKeySessions_():this.playlistController_.sourceUpdater_.initializedEme()}setupQualityLevels_(){var e=nZ.players[this.tech_.options_.playerId];e&&e.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{var e,t;e=this.qualityLevels_,(t=this).representations().forEach(t=>{e.addQualityLevel(t)}),up(e,t.playlists)}),this.playlists.on("mediachange",()=>{up(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":"3.0.2","mux.js":"6.3.0","mpd-parser":"1.0.1","m3u8-parser":"6.0.0","aes-decrypter":"4.0.1"}}version(){return this.constructor.version()}canChangeType(){return l9.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_&&window.URL.revokeObjectURL&&(window.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return o6({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,i=!0,n=2){return oF({programTime:e,playlist:this.playlistController_.media(),retryCount:n,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}}let ub={name:"videojs-http-streaming",VERSION:"3.0.2",canHandleSource:(e,t={})=>(t=az(nZ.options,t),ub.canPlayType(e.type,t)),handleSource:(e,t,i={})=>(i=az(nZ.options,i),t.vhs=new u8(e,t,i),t.vhs.xhr=oO(),t.vhs.src(e.src,e.type),t.vhs),canPlayType:(e,t)=>(e=su(e))&&(t=ub.getOverrideNative(t),!um.supportsTypeNatively(e)||t)?"maybe":"",getOverrideNative(e={}){var{vhs:e={}}=e,t=!(nZ.browser.IS_ANY_SAFARI||nZ.browser.IS_IOS),{overrideNative:e=t}=e;return e}};return so("avc1.4d400d,mp4a.40.2")&&nZ.getTech("Html5").registerSourceHandler(ub,0),nZ.VhsHandler=u8,nZ.VhsSourceHandler=ub,nZ.Vhs=um,nZ.use||nZ.registerComponent("Vhs",um),nZ.options.vhs=nZ.options.vhs||{},nZ.getPlugin&&nZ.getPlugin("reloadSourceOnError")||nZ.registerPlugin("reloadSourceOnError",function(e){uc(this,e)}),nZ}),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("video.js")):"function"==typeof define&&define.amd?define(["video.js"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).videojsHlsQualitySelector=t(e.videojs)}(this,function(e){"use strict";var t,i=(t=e)&&"object"==typeof t&&"default"in t?t:{default:t};let n=i.default.getComponent("MenuButton"),s=i.default.getComponent("Menu");function r(e){return"string"!=typeof e?e:e.charAt(0).toUpperCase()+e.slice(1)}i.default.getComponent("Component"),i.default.dom;class a extends n{constructor(e){super(e,{title:e.localize("Quality"),name:"QualityButton"})}createItems(){return[]}createMenu(){let e=new s(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.items=this.createItems(),this.items)for(let t=0;t<this.items.length;t++)e.addItem(this.items[t]);return e}}let o=i.default.getComponent("MenuItem");class l extends o{constructor(e,t,i,n){super(e,{label:t.label,selectable:!0,selected:t.selected||!1}),this.item=t,this.qualityButton=i,this.plugin=n}handleClick(){for(let e=0;e<this.qualityButton.items.length;++e)this.qualityButton.items[e].selected(!1);this.plugin.setQuality(this.item.value),this.selected(!0)}}let u=i.default.getPlugin("plugin");class d extends u{constructor(e,t){super(e),this.options=i.default.obj.merge({},t),this.player.ready(()=>{this.player.qualityLevels&&(this.player.addClass("vjs-hls-quality-selector"),this.createQualityButton(),this.bindPlayerEvents())})}bindPlayerEvents(){this.player.qualityLevels().on("addqualitylevel",this.onAddQualityLevel.bind(this))}createQualityButton(){let e=this.player;this._qualityButton=new a(e);let t=e.controlBar.children().length-2,i=e.controlBar.addChild(this._qualityButton,{componentClass:"qualitySelector"},this.options.placementIndex||t);if(i.addClass("vjs-quality-selector"),this.options.displayCurrentQuality)this.setButtonInnerText(e.localize("Auto"));else{let n=` ${this.options.vjsIconClass||"vjs-icon-hd"}`;i.menuButton_.$(".vjs-icon-placeholder").className+=n}i.removeClass("vjs-hidden")}setButtonInnerText(e){this._qualityButton.menuButton_.$(".vjs-icon-placeholder").innerHTML=e}getQualityMenuItem(e){let t=this.player;return new l(t,e,this._qualityButton,this)}onAddQualityLevel(){let e=this.player,t=e.qualityLevels(),i=t.levels_||[],n=[];for(let s=0;s<i.length;++s){let{width:r,height:a}=i[s],o=r>a?a:r;if(o&&!n.filter(e=>e.item&&e.item.value===o).length){let l=this.getQualityMenuItem.call(this,{label:o+"p",value:o});n.push(l)}}n.sort((e,t)=>"object"!=typeof e||"object"!=typeof t?-1:e.item.value<t.item.value?1:e.item.value>t.item.value?-1:0),n.push(this.getQualityMenuItem.call(this,{label:this.player.localize("Auto"),value:"auto",selected:!0})),this._qualityButton&&(this._qualityButton.createItems=()=>n,this._qualityButton.update())}setQuality(e){let t=this.player.qualityLevels();this._currentQuality=e,this.options.displayCurrentQuality&&this.setButtonInnerText("auto"===e?this.player.localize("Auto"):`${e}p`);for(let i=0;i<t.length;++i){let{width:n,height:s}=t[i],r=n>s?s:n;t[i].enabled=r===e||"auto"===e}this._qualityButton.unpressButton();for(let a=0;a<this._qualityButton.items.length;++a)this._qualityButton.items[a].item.value==this._currentQuality?this._qualityButton.items[a].selected(!0):this._qualityButton.items[a].selected(!1)}getCurrentQuality(){return this._currentQuality||"auto"}}return d.VERSION="2.0.0",i.default.registerPlugin("hlsQualitySelector",d),d}),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("video.js")):"function"==typeof define&&define.amd?define(["video.js"],t):e.videojsVttThumbnails=t(e.videojs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e,function(){function e(e){this.value=e}function t(t){var i,n;function s(i,n){try{var a=t[i](n),o=a.value;o instanceof e?Promise.resolve(o.value).then(function(e){s("next",e)},function(e){s("throw",e)}):r(a.done?"return":"normal",a.value)}catch(l){r("throw",l)}}function r(e,t){switch(e){case"return":i.resolve({value:t,done:!0});break;case"throw":i.reject(t);break;default:i.resolve({value:t,done:!1})}(i=i.next)?s(i.key,i.arg):n=null}this._invoke=function e(t,r){return new Promise(function(e,a){var o={key:t,arg:r,resolve:e,reject:a,next:null};n?n=n.next=o:(i=n=o,s(t,r))})},"function"!=typeof t.return&&(this.return=void 0)}"function"==typeof Symbol&&Symbol.asyncIterator&&(t.prototype[Symbol.asyncIterator]=function(){return this}),t.prototype.next=function(e){return this._invoke("next",e)},t.prototype.throw=function(e){return this._invoke("throw",e)},t.prototype.return=function(e){return this._invoke("return",e)}}();var t=function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")},i={},n={},s=e.registerPlugin||e.plugin,r=function e(t,i){t.addClass("vjs-vtt-thumbnails"),t.vttThumbnails=new o(t,i)},a=function t(n){var s=this;this.ready(function(){r(s,e.mergeOptions(i,n))})},o=function(){function i(e,n){return t(this,i),this.player=e,this.options=n,this.listenForDurationChange(),this.initializeThumbnails(),this.registeredEvents={},this}return i.prototype.src=function e(t){this.resetPlugin(),this.options.src=t,this.initializeThumbnails()},i.prototype.detach=function e(){this.resetPlugin()},i.prototype.resetPlugin=function e(){this.thumbnailHolder&&this.thumbnailHolder.parentNode.removeChild(this.thumbnailHolder),this.progressBar&&this.progressBar.removeEventListener("mouseenter",this.registeredEvents.progressBarMouseEnter),this.progressBar&&this.progressBar.removeEventListener("mouseleave",this.registeredEvents.progressBarMouseLeave),this.progressBar&&this.progressBar.removeEventListener("mousemove",this.registeredEvents.progressBarMouseMove),delete this.registeredEvents.progressBarMouseEnter,delete this.registeredEvents.progressBarMouseLeave,delete this.registeredEvents.progressBarMouseMove,delete this.progressBar,delete this.vttData,delete this.thumbnailHolder,delete this.timeHolder,delete this.lastStyle},i.prototype.listenForDurationChange=function e(){this.player.on("durationchange",function(){})},i.prototype.initializeThumbnails=function e(){var t=this;if(this.options.src){var i=this.getBaseUrl(),n=this.getFullyQualifiedUrl(this.options.src,i);this.getVttFile(n).then(function(e){t.vttData=t.processVtt(e),t.setupThumbnailElement(),t.options.hasOwnProperty("preloadStrategy")&&t.preload(t.vttData)})}},i.prototype.getBaseUrl=function e(){return[window.location.protocol,"//",window.location.hostname,window.location.port?":"+window.location.port:"",window.location.pathname].join("").split(/([^\/]*)$/gi).shift()},i.prototype.getVttFile=function e(t){var i=this;return new Promise(function(e,n){var s=new XMLHttpRequest;s.data={resolve:e},s.addEventListener("load",i.vttFileLoaded),s.open("GET",t),s.send()})},i.prototype.vttFileLoaded=function e(){this.data.resolve(this.responseText)},i.prototype.preload=function e(t){var i=this;t.forEach(function(e){return i.setImageInCacheForItem(e)})},i.prototype.setupThumbnailElement=function e(t){var i=this,n=this.player.$(".vjs-mouse-display");this.progressBar=this.player.$(".vjs-progress-control");var s=document.createElement("div");s.setAttribute("class","vjs-vtt-thumbnail-display"),this.progressBar.appendChild(s),this.thumbnailHolder=s;var r=document.createElement("time");r.setAttribute("class","vjs-vtt-thumbnail-time"),this.thumbnailHolder.appendChild(r),this.timeHolder=r,n&&n.classList.add("vjs-hidden"),this.registeredEvents.progressBarMouseEnter=function(){return i.onBarMouseenter()},this.registeredEvents.progressBarMouseLeave=function(){return i.onBarMouseleave()},this.progressBar.addEventListener("mouseenter",this.registeredEvents.progressBarMouseEnter),this.progressBar.addEventListener("mouseleave",this.registeredEvents.progressBarMouseLeave)},i.prototype.onBarMouseenter=function e(){var t=this;this.mouseMoveCallback=function(e){t.onBarMousemove(e)},this.registeredEvents.progressBarMouseMove=this.mouseMoveCallback,this.progressBar.addEventListener("mousemove",this.registeredEvents.progressBarMouseMove),this.showThumbnailHolder()},i.prototype.onBarMouseleave=function e(){this.registeredEvents.progressBarMouseMove&&this.progressBar.removeEventListener("mousemove",this.registeredEvents.progressBarMouseMove),this.hideThumbnailHolder()},i.prototype.getXCoord=function e(t,i){var n=t.getBoundingClientRect(),s=document.documentElement;return i-(n.left+(window.pageXOffset||s.scrollLeft||0))},i.prototype.onBarMousemove=function t(i){this.updateThumbnailStyle(e.dom.getPointerPosition(this.progressBar,i).x,this.progressBar.offsetWidth)},i.prototype.setImageInCacheForItem=function e(t){if(t.css.url&&!n[t.css.url]){var i=new Image;i.src=t.css.url,n[t.css.url]=i}},i.prototype.getStyleForTime=function e(t){for(var i=0;i<this.vttData.length;++i){var n=this.vttData[i];if(t>=n.start&&t<n.end)return this.setImageInCacheForItem(n),n.css}},i.prototype.showThumbnailHolder=function e(){this.thumbnailHolder.style.opacity="1"},i.prototype.hideThumbnailHolder=function e(){this.thumbnailHolder.style.opacity="0"},i.prototype.updateThumbnailStyle=function e(t,i){var n=this.player.duration(),s=t*n,r=this.getStyleForTime(s),a=new Date(1e3*Math.round(s)).toISOString().substr(11,8);if(a=n>3599?a:a.substring(3),this.timeHolder.innerText=a,!r)return this.hideThumbnailHolder();var o=t*i,l=parseInt(this.thumbnailHolder.offsetWidth)/2,u=i-(o+l),d=o-l;if(d>0&&u>0?this.thumbnailHolder.style.transform="translateX("+(o-l)+"px)":d<=0?this.thumbnailHolder.style.transform="translateX(0px)":u<=0&&(this.thumbnailHolder.style.transform="translateX("+(o+u-l)+"px)"),!this.lastStyle||this.lastStyle!==r)for(var h in this.lastStyle=r,r)r.hasOwnProperty(h)&&(this.thumbnailHolder.style[h]=r[h])},i.prototype.processVtt=function e(t){var i=this,n=[];return t.split(/[\r\n][\r\n]/i).forEach(function(e){if(e.match(/([0-9]{2}:)?([0-9]{2}:)?[0-9]{2}(.[0-9]{3})?( ?--> ?)([0-9]{2}:)?([0-9]{2}:)?[0-9]{2}(.[0-9]{3})?[\r\n]{1}.*/gi)){var t=e.split(/[\r\n]/i),s=t[0].split(/ ?--> ?/i),r=s[0],a=s[1],o=t[1],l=i.getVttCss(o);n.push({start:i.getSecondsFromTimestamp(r),end:i.getSecondsFromTimestamp(a),css:l})}}),n},i.prototype.getFullyQualifiedUrl=function e(t,i){return t.indexOf("//")>=0?t:0===i.indexOf("//")?[i.replace(/\/$/gi,""),this.trim(t,"/")].join("/"):i.indexOf("//")>0?[this.trim(i,"/"),this.trim(t,"/")].join("/"):t},i.prototype.getPropsFromDef=function e(t){var i=t.split(/#xywh=/i),n=i[0],s=i[1].match(/[0-9]+/gi);return{x:s[0],y:s[1],w:s[2],h:s[3],image:n}},i.prototype.getVttCss=function e(t){var i={},n=void 0;if(n=this.options.baseUrl?this.options.baseUrl:this.options.src.indexOf("//")>=0?this.options.src.split(/([^\/]*)$/gi).shift():this.getBaseUrl()+this.options.src.split(/([^\/]*)$/gi).shift(),!(t=this.getFullyQualifiedUrl(t,n)).match(/#xywh=/i))return i.background='url("'+t+'")',i.url=t,i;var s=this.getPropsFromDef(t);return i.background='url("'+s.image+'") no-repeat -'+s.x+"px -"+s.y+"px",i.width=s.w+"px",i.height=s.h+"px",i.url=s.image,i},i.prototype.doconstructTimestamp=function e(t){var i=t.split("."),n=i[0].split(":");return{milliseconds:parseInt(i[1])||0,seconds:parseInt(n.pop())||0,minutes:parseInt(n.pop())||0,hours:parseInt(n.pop())||0}},i.prototype.getSecondsFromTimestamp=function e(t){var i=this.doconstructTimestamp(t);return parseInt(3600*i.hours+60*i.minutes+i.seconds+i.milliseconds/1e3)},i.prototype.trim=function e(t,i){var n=" \n\r \f\v\xa0 \u2028\u2029 ",s=0,r=0;for(t+="",i&&(n=(i+"").replace(/([[\]().?/*{}+$^:])/g,"$1")),s=t.length,r=0;r<s;r++)if(-1===n.indexOf(t.charAt(r))){t=t.substring(r);break}for(r=(s=t.length)-1;r>=0;r--)if(-1===n.indexOf(t.charAt(r))){t=t.substring(0,r+1);break}return -1===n.indexOf(t.charAt(0))?t:""},i}();return s("vttThumbnails",a),a.VERSION="1.2.0",a}),function e(t,i,n){function s(a,o){if(!i[a]){if(!t[a]){var l="function"==typeof require&&require;if(!o&&l)return l(a,!0);if(r)return r(a,!0);throw(l=Error("Cannot find module '"+a+"'")).code="MODULE_NOT_FOUND",l}l=i[a]={exports:{}},t[a][0].call(l.exports,function(e){return s(t[a][1][e]||e)},l,l.exports,e,t,i,n)}return i[a].exports}for(var r="function"==typeof require&&require,a=0;a<n.length;a++)s(n[a]);return s}({1:[function(e,t,i){t.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},{}],2:[function(e,t,i){var n=e("../internals/is-object");t.exports=function(e){if(!n(e))throw TypeError(String(e)+" is not an object");return e}},{"../internals/is-object":33}],3:[function(e,t,i){var n=e("../internals/to-indexed-object"),s=e("../internals/to-length"),r=e("../internals/to-absolute-index"),e=function(e){return function(t,i,a){var o,l=n(t),u=s(l.length),d=r(a,u);if(e&&i!=i){for(;d<u;)if((o=l[d++])!=o)return!0}else for(;d<u;d++)if((e||d in l)&&l[d]===i)return e||d||0;return!e&&-1}};t.exports={includes:e(!0),indexOf:e(!1)}},{"../internals/to-absolute-index":55,"../internals/to-indexed-object":56,"../internals/to-length":58}],4:[function(e,t,i){var n=e("../internals/function-bind-context"),s=e("../internals/indexed-object"),r=e("../internals/to-object"),a=e("../internals/to-length"),o=e("../internals/array-species-create"),l=[].push,e=function(e){var t=1==e,i=2==e,u=3==e,d=4==e,h=6==e,c=7==e,p=5==e||h;return function(m,f,g,y){for(var v,b,$=r(m),T=s($),w=n(f,g,3),_=a(T.length),S=0,y=y||o,k=t?y(m,_):i||c?y(m,0):void 0;S<_;S++)if((p||S in T)&&(b=w(v=T[S],S,$),e)){if(t)k[S]=b;else if(b)switch(e){case 3:return!0;case 5:return v;case 6:return S;case 2:l.call(k,v)}else switch(e){case 4:return!1;case 7:l.call(k,v)}}return h?-1:u||d?d:k}};t.exports={forEach:e(0),map:e(1),filter:e(2),some:e(3),every:e(4),find:e(5),findIndex:e(6),filterOut:e(7)}},{"../internals/array-species-create":6,"../internals/function-bind-context":20,"../internals/indexed-object":28,"../internals/to-length":58,"../internals/to-object":59}],5:[function(e,t,i){var n=e("../internals/fails"),s=e("../internals/well-known-symbol"),r=e("../internals/engine-v8-version"),a=s("species");t.exports=function(e){return 51<=r||!n(function(){var t=[];return(t.constructor={})[a]=function(){return{foo:1}},1!==t[e](Boolean).foo})}},{"../internals/engine-v8-version":16,"../internals/fails":19,"../internals/well-known-symbol":63}],6:[function(e,t,i){var n=e("../internals/is-object"),s=e("../internals/is-array"),r=e("../internals/well-known-symbol")("species");t.exports=function(e,t){var i;return new(void 0===(i=s(e)&&("function"==typeof(i=e.constructor)&&(i===Array||s(i.prototype))||n(i)&&null===(i=i[r]))?void 0:i)?Array:i)(0===t?0:t)}},{"../internals/is-array":31,"../internals/is-object":33,"../internals/well-known-symbol":63}],7:[function(e,t,i){var n={}.toString;t.exports=function(e){return n.call(e).slice(8,-1)}},{}],8:[function(e,t,i){var n=e("../internals/has"),s=e("../internals/own-keys"),r=e("../internals/object-get-own-property-descriptor"),a=e("../internals/object-define-property");t.exports=function(e,t){for(var i=s(t),o=a.f,l=r.f,u=0;u<i.length;u++){var d=i[u];n(e,d)||o(e,d,l(t,d))}}},{"../internals/has":24,"../internals/object-define-property":39,"../internals/object-get-own-property-descriptor":40,"../internals/own-keys":47}],9:[function(e,t,i){e=e("../internals/fails"),t.exports=!e(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})},{"../internals/fails":19}],10:[function(e,t,i){var n=e("../internals/descriptors"),s=e("../internals/object-define-property"),r=e("../internals/create-property-descriptor");t.exports=n?function(e,t,i){return s.f(e,t,r(1,i))}:function(e,t,i){return e[t]=i,e}},{"../internals/create-property-descriptor":11,"../internals/descriptors":12,"../internals/object-define-property":39}],11:[function(e,t,i){t.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},{}],12:[function(e,t,i){e=e("../internals/fails"),t.exports=!e(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})},{"../internals/fails":19}],13:[function(e,t,i){var n=e("../internals/global"),e=e("../internals/is-object"),s=n.document,r=e(s)&&e(s.createElement);t.exports=function(e){return r?s.createElement(e):{}}},{"../internals/global":23,"../internals/is-object":33}],14:[function(e,t,i){var n=e("../internals/classof-raw"),e=e("../internals/global");t.exports="process"==n(e.process)},{"../internals/classof-raw":7,"../internals/global":23}],15:[function(e,t,i){e=e("../internals/get-built-in"),t.exports=e("navigator","userAgent")||""},{"../internals/get-built-in":22}],16:[function(e,t,i){var n,s,r=e("../internals/global"),e=e("../internals/engine-user-agent"),r=r.process,r=r&&r.versions,r=r&&r.v8;r?s=(n=r.split("."))[0]+n[1]:e&&(!(n=e.match(/Edge\/(\d+)/))||74<=n[1])&&(n=e.match(/Chrome\/(\d+)/))&&(s=n[1]),t.exports=s&&+s},{"../internals/engine-user-agent":15,"../internals/global":23}],17:[function(e,t,i){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},{}],18:[function(e,t,i){var n=e("../internals/global"),s=e("../internals/object-get-own-property-descriptor").f,r=e("../internals/create-non-enumerable-property"),a=e("../internals/redefine"),o=e("../internals/set-global"),l=e("../internals/copy-constructor-properties"),u=e("../internals/is-forced");t.exports=function(e,t){var i,d,h,c=e.target,p=e.global,m=e.stat,f=p?n:m?n[c]||o(c,{}):(n[c]||{}).prototype;if(f)for(i in t){if(d=t[i],h=e.noTargetGet?(h=s(f,i))&&h.value:f[i],!u(p?i:c+(m?".":"#")+i,e.forced)&&void 0!==h){if(typeof d==typeof h)continue;l(d,h)}(e.sham||h&&h.sham)&&r(d,"sham",!0),a(f,i,d,e)}}},{"../internals/copy-constructor-properties":8,"../internals/create-non-enumerable-property":10,"../internals/global":23,"../internals/is-forced":32,"../internals/object-get-own-property-descriptor":40,"../internals/redefine":49,"../internals/set-global":51}],19:[function(e,t,i){t.exports=function(e){try{return!!e()}catch(t){return!0}}},{}],20:[function(e,t,i){var n=e("../internals/a-function");t.exports=function(e,t,i){if(n(e),void 0===t)return e;switch(i){case 0:return function(){return e.call(t)};case 1:return function(i){return e.call(t,i)};case 2:return function(i,n){return e.call(t,i,n)};case 3:return function(i,n,s){return e.call(t,i,n,s)}}return function(){return e.apply(t,arguments)}}},{"../internals/a-function":1}],21:[function(e,t,i){"use strict";var n=e("../internals/a-function"),s=e("../internals/is-object"),r=[].slice,a={};t.exports=Function.bind||function(e){var t=n(this),i=r.call(arguments,1),o=function(){var n=i.concat(r.call(arguments));return this instanceof o?function(e,t,i){if(!(t in a)){for(var n=[],s=0;s<t;s++)n[s]="a["+s+"]";a[t]=Function("C,a","return new C("+n.join(",")+")")}return a[t](e,i)}(t,n.length,n):t.apply(e,n)};return s(t.prototype)&&(o.prototype=t.prototype),o}},{"../internals/a-function":1,"../internals/is-object":33}],22:[function(e,t,i){function n(e){return"function"==typeof e?e:void 0}var s=e("../internals/path"),r=e("../internals/global");t.exports=function(e,t){return arguments.length<2?n(s[e])||n(r[e]):s[e]&&s[e][t]||r[e]&&r[e][t]}},{"../internals/global":23,"../internals/path":48}],23:[function(e,t,i){(function(e){(function(){function i(e){return e&&e.Math==Math&&e}t.exports=i("object"==typeof globalThis&&globalThis)||i("object"==typeof window&&window)||i("object"==typeof self&&self)||i("object"==typeof e&&e)||function(){return this}()||Function("return this")()}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],24:[function(e,t,i){var n=e("../internals/to-object"),s={}.hasOwnProperty;t.exports=function(e,t){return s.call(n(e),t)}},{"../internals/to-object":59}],25:[function(e,t,i){t.exports={}},{}],26:[function(e,t,i){e=e("../internals/get-built-in"),t.exports=e("document","documentElement")},{"../internals/get-built-in":22}],27:[function(e,t,i){var n=e("../internals/descriptors"),s=e("../internals/fails"),r=e("../internals/document-create-element");t.exports=!n&&!s(function(){return 7!=Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a})},{"../internals/descriptors":12,"../internals/document-create-element":13,"../internals/fails":19}],28:[function(e,t,i){var n=e("../internals/fails"),s=e("../internals/classof-raw"),r="".split;t.exports=n(function(){return!Object("z").propertyIsEnumerable(0)})?function(e){return"String"==s(e)?r.call(e,""):Object(e)}:Object},{"../internals/classof-raw":7,"../internals/fails":19}],29:[function(e,t,i){var e=e("../internals/shared-store"),n=Function.toString;"function"!=typeof e.inspectSource&&(e.inspectSource=function(e){return n.call(e)}),t.exports=e.inspectSource},{"../internals/shared-store":53}],30:[function(e,t,i){var n,s,r,a,o,l,u,d,h=e("../internals/native-weak-map"),c=e("../internals/global"),p=e("../internals/is-object"),m=e("../internals/create-non-enumerable-property"),f=e("../internals/has"),g=e("../internals/shared-store"),y=e("../internals/shared-key"),e=e("../internals/hidden-keys"),v="Object already initialized",c=c.WeakMap;u=h?(s=(n=g.state||(g.state=new c)).get,r=n.has,a=n.set,o=function(e,t){if(r.call(n,e))throw TypeError(v);return t.facade=e,a.call(n,e,t),t},l=function(e){return s.call(n,e)||{}},function(e){return r.call(n,e)}):(e[d=y("state")]=!0,o=function(e,t){if(f(e,d))throw TypeError(v);return t.facade=e,m(e,d,t),t},l=function(e){return f(e,d)?e[d]:{}},function(e){return f(e,d)}),t.exports={set:o,get:l,has:u,enforce:function(e){return u(e)?l(e):o(e,{})},getterFor:function(e){return function(t){var i;if(!p(t)||(i=l(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return i}}}},{"../internals/create-non-enumerable-property":10,"../internals/global":23,"../internals/has":24,"../internals/hidden-keys":25,"../internals/is-object":33,"../internals/native-weak-map":36,"../internals/shared-key":52,"../internals/shared-store":53}],31:[function(e,t,i){var n=e("../internals/classof-raw");t.exports=Array.isArray||function(e){return"Array"==n(e)}},{"../internals/classof-raw":7}],32:[function(e,t,i){var n=e("../internals/fails"),s=/#|\.prototype\./,e=function(e,t){return(e=a[r(e)])==l||e!=o&&("function"==typeof t?n(t):!!t)},r=e.normalize=function(e){return String(e).replace(s,".").toLowerCase()},a=e.data={},o=e.NATIVE="N",l=e.POLYFILL="P";t.exports=e},{"../internals/fails":19}],33:[function(e,t,i){t.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},{}],34:[function(e,t,i){t.exports=!1},{}],35:[function(e,t,i){var n=e("../internals/engine-is-node"),s=e("../internals/engine-v8-version"),e=e("../internals/fails");t.exports=!!Object.getOwnPropertySymbols&&!e(function(){return!Symbol.sham&&(n?38===s:37<s&&s<41)})},{"../internals/engine-is-node":14,"../internals/engine-v8-version":16,"../internals/fails":19}],36:[function(e,t,i){var n=e("../internals/global"),e=e("../internals/inspect-source"),n=n.WeakMap;t.exports="function"==typeof n&&/native code/.test(e(n))},{"../internals/global":23,"../internals/inspect-source":29}],37:[function(e,t,i){function n(){}function s(e){return"<script>"+e+"</"+p+">"}var r,a=e("../internals/an-object"),o=e("../internals/object-define-properties"),l=e("../internals/enum-bug-keys"),u=e("../internals/hidden-keys"),d=e("../internals/html"),h=e("../internals/document-create-element"),e=e("../internals/shared-key"),c="prototype",p="script",m=e("IE_PROTO"),f=function(){try{r=document.domain&&new ActiveXObject("htmlfile")}catch(e){}f=r?((t=r).write(s("")),t.close(),i=t.parentWindow.Object,t=null,i):((n=h("iframe")).style.display="none",d.appendChild(n),n.src=String("javascript:"),(n=n.contentWindow.document).open(),n.write(s("document.F=Object")),n.close(),n.F);for(var t,i,n,a=l.length;a--;)delete f[c][l[a]];return f()};u[m]=!0,t.exports=Object.create||function(e,t){var i;return null!==e?(n[c]=a(e),i=new n,n[c]=null,i[m]=e):i=f(),void 0===t?i:o(i,t)}},{"../internals/an-object":2,"../internals/document-create-element":13,"../internals/enum-bug-keys":17,"../internals/hidden-keys":25,"../internals/html":26,"../internals/object-define-properties":38,"../internals/shared-key":52}],38:[function(e,t,i){var n=e("../internals/descriptors"),s=e("../internals/object-define-property"),r=e("../internals/an-object"),a=e("../internals/object-keys");t.exports=n?Object.defineProperties:function(e,t){r(e);for(var i,n=a(t),o=n.length,l=0;l<o;)s.f(e,i=n[l++],t[i]);return e}},{"../internals/an-object":2,"../internals/descriptors":12,"../internals/object-define-property":39,"../internals/object-keys":45}],39:[function(e,t,i){var n=e("../internals/descriptors"),s=e("../internals/ie8-dom-define"),r=e("../internals/an-object"),a=e("../internals/to-primitive"),o=Object.defineProperty;i.f=n?o:function(e,t,i){if(r(e),t=a(t,!0),r(i),s)try{return o(e,t,i)}catch(n){}if("get"in i||"set"in i)throw TypeError("Accessors not supported");return"value"in i&&(e[t]=i.value),e}},{"../internals/an-object":2,"../internals/descriptors":12,"../internals/ie8-dom-define":27,"../internals/to-primitive":60}],40:[function(e,t,i){var n=e("../internals/descriptors"),s=e("../internals/object-property-is-enumerable"),r=e("../internals/create-property-descriptor"),a=e("../internals/to-indexed-object"),o=e("../internals/to-primitive"),l=e("../internals/has"),u=e("../internals/ie8-dom-define"),d=Object.getOwnPropertyDescriptor;i.f=n?d:function(e,t){if(e=a(e),t=o(t,!0),u)try{return d(e,t)}catch(i){}if(l(e,t))return r(!s.f.call(e,t),e[t])}},{"../internals/create-property-descriptor":11,"../internals/descriptors":12,"../internals/has":24,"../internals/ie8-dom-define":27,"../internals/object-property-is-enumerable":46,"../internals/to-indexed-object":56,"../internals/to-primitive":60}],41:[function(e,t,i){var n=e("../internals/object-keys-internal"),s=e("../internals/enum-bug-keys").concat("length","prototype");i.f=Object.getOwnPropertyNames||function(e){return n(e,s)}},{"../internals/enum-bug-keys":17,"../internals/object-keys-internal":44}],42:[function(e,t,i){i.f=Object.getOwnPropertySymbols},{}],43:[function(e,t,i){var n=e("../internals/has"),s=e("../internals/to-object"),r=e("../internals/shared-key"),e=e("../internals/correct-prototype-getter"),a=r("IE_PROTO"),o=Object.prototype;t.exports=e?Object.getPrototypeOf:function(e){return e=s(e),n(e,a)?e[a]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?o:null}},{"../internals/correct-prototype-getter":9,"../internals/has":24,"../internals/shared-key":52,"../internals/to-object":59}],44:[function(e,t,i){var n=e("../internals/has"),s=e("../internals/to-indexed-object"),r=e("../internals/array-includes").indexOf,a=e("../internals/hidden-keys");t.exports=function(e,t){var i,o=s(e),l=0,u=[];for(i in o)!n(a,i)&&n(o,i)&&u.push(i);for(;t.length>l;)n(o,i=t[l++])&&(~r(u,i)||u.push(i));return u}},{"../internals/array-includes":3,"../internals/has":24,"../internals/hidden-keys":25,"../internals/to-indexed-object":56}],45:[function(e,t,i){var n=e("../internals/object-keys-internal"),s=e("../internals/enum-bug-keys");t.exports=Object.keys||function(e){return n(e,s)}},{"../internals/enum-bug-keys":17,"../internals/object-keys-internal":44}],46:[function(e,t,i){"use strict";var n={}.propertyIsEnumerable,s=Object.getOwnPropertyDescriptor,r=s&&!n.call({1:2},1);i.f=r?function(e){return!!(e=s(this,e))&&e.enumerable}:n},{}],47:[function(e,t,i){var n=e("../internals/get-built-in"),s=e("../internals/object-get-own-property-names"),r=e("../internals/object-get-own-property-symbols"),a=e("../internals/an-object");t.exports=n("Reflect","ownKeys")||function(e){var t=s.f(a(e)),i=r.f;return i?t.concat(i(e)):t}},{"../internals/an-object":2,"../internals/get-built-in":22,"../internals/object-get-own-property-names":41,"../internals/object-get-own-property-symbols":42}],48:[function(e,t,i){e=e("../internals/global"),t.exports=e},{"../internals/global":23}],49:[function(e,t,i){var n=e("../internals/global"),s=e("../internals/create-non-enumerable-property"),r=e("../internals/has"),a=e("../internals/set-global"),o=e("../internals/inspect-source"),e=e("../internals/internal-state"),l=e.get,u=e.enforce,d=String(String).split("String");(t.exports=function(e,t,i,o){var l=!!o&&!!o.unsafe,h=!!o&&!!o.enumerable,c=!!o&&!!o.noTargetGet;"function"==typeof i&&("string"!=typeof t||r(i,"name")||s(i,"name",t),(o=u(i)).source||(o.source=d.join("string"==typeof t?t:""))),e!==n?(l?!c&&e[t]&&(h=!0):delete e[t],h?e[t]=i:s(e,t,i)):h?e[t]=i:a(t,i)})(Function.prototype,"toString",function(){return"function"==typeof this&&l(this).source||o(this)})},{"../internals/create-non-enumerable-property":10,"../internals/global":23,"../internals/has":24,"../internals/inspect-source":29,"../internals/internal-state":30,"../internals/set-global":51}],50:[function(e,t,i){t.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},{}],51:[function(e,t,i){var n=e("../internals/global"),s=e("../internals/create-non-enumerable-property");t.exports=function(e,t){try{s(n,e,t)}catch(i){n[e]=t}return t}},{"../internals/create-non-enumerable-property":10,"../internals/global":23}],52:[function(e,t,i){var n=e("../internals/shared"),s=e("../internals/uid"),r=n("keys");t.exports=function(e){return r[e]||(r[e]=s(e))}},{"../internals/shared":54,"../internals/uid":61}],53:[function(e,t,i){var n=e("../internals/global"),s=e("../internals/set-global"),e="__core-js_shared__",e=n[e]||s(e,{});t.exports=e},{"../internals/global":23,"../internals/set-global":51}],54:[function(e,t,i){var n=e("../internals/is-pure"),s=e("../internals/shared-store");(t.exports=function(e,t){return s[e]||(s[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.11.0",mode:n?"pure":"global",copyright:"\xa9 2021 Denis Pushkarev (zloirock.ru)"})},{"../internals/is-pure":34,"../internals/shared-store":53}],55:[function(e,t,i){var n=e("../internals/to-integer"),s=Math.max,r=Math.min;t.exports=function(e,t){return(e=n(e))<0?s(e+t,0):r(e,t)}},{"../internals/to-integer":57}],56:[function(e,t,i){var n=e("../internals/indexed-object"),s=e("../internals/require-object-coercible");t.exports=function(e){return n(s(e))}},{"../internals/indexed-object":28,"../internals/require-object-coercible":50}],57:[function(e,t,i){var n=Math.ceil,s=Math.floor;t.exports=function(e){return isNaN(e=+e)?0:(0<e?s:n)(e)}},{}],58:[function(e,t,i){var n=e("../internals/to-integer"),s=Math.min;t.exports=function(e){return 0<e?s(n(e),9007199254740991):0}},{"../internals/to-integer":57}],59:[function(e,t,i){var n=e("../internals/require-object-coercible");t.exports=function(e){return Object(n(e))}},{"../internals/require-object-coercible":50}],60:[function(e,t,i){var n=e("../internals/is-object");t.exports=function(e,t){var i,s;if(!n(e))return e;if(t&&"function"==typeof(i=e.toString)&&!n(s=i.call(e))||"function"==typeof(i=e.valueOf)&&!n(s=i.call(e))||!t&&"function"==typeof(i=e.toString)&&!n(s=i.call(e)))return s;throw TypeError("Can't convert object to primitive value")}},{"../internals/is-object":33}],61:[function(e,t,i){var n=0,s=Math.random();t.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++n+s).toString(36)}},{}],62:[function(e,t,i){e=e("../internals/native-symbol"),t.exports=e&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},{"../internals/native-symbol":35}],63:[function(e,t,i){var n=e("../internals/global"),s=e("../internals/shared"),r=e("../internals/has"),a=e("../internals/uid"),o=e("../internals/native-symbol"),e=e("../internals/use-symbol-as-uid"),l=s("wks"),u=n.Symbol,d=e?u:u&&u.withoutSetter||a;t.exports=function(e){return r(l,e)&&(o||"string"==typeof l[e])||(o&&r(u,e)?l[e]=u[e]:l[e]=d("Symbol."+e)),l[e]}},{"../internals/global":23,"../internals/has":24,"../internals/native-symbol":35,"../internals/shared":54,"../internals/uid":61,"../internals/use-symbol-as-uid":62}],64:[function(e,t,i){"use strict";var n=e("../internals/export"),s=e("../internals/array-iteration").map;n({target:"Array",proto:!0,forced:!e("../internals/array-method-has-species-support")("map")},{map:function(e){return s(this,e,1<arguments.length?arguments[1]:void 0)}})},{"../internals/array-iteration":4,"../internals/array-method-has-species-support":5,"../internals/export":18}],65:[function(e,t,i){var n=e("../internals/export"),s=e("../internals/get-built-in"),r=e("../internals/a-function"),a=e("../internals/an-object"),o=e("../internals/is-object"),l=e("../internals/object-create"),u=e("../internals/function-bind"),e=e("../internals/fails"),d=s("Reflect","construct"),h=e(function(){function e(){}return!(d(function(){},[],e) instanceof e)}),c=!e(function(){d(function(){})}),e=h||c;n({target:"Reflect",stat:!0,forced:e,sham:e},{construct:function(e,t){r(e),a(t);var i=arguments.length<3?e:r(arguments[2]);if(c&&!h)return d(e,t,i);if(e==i){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var n=[null];return n.push.apply(n,t),new(u.apply(e,n))}return i=l(o(n=i.prototype)?n:Object.prototype),n=Function.apply.call(e,i,t),o(n)?n:i}})},{"../internals/a-function":1,"../internals/an-object":2,"../internals/export":18,"../internals/fails":19,"../internals/function-bind":21,"../internals/get-built-in":22,"../internals/is-object":33,"../internals/object-create":37}],66:[function(e,t,i){var n=e("../internals/export"),s=e("../internals/is-object"),r=e("../internals/an-object"),a=e("../internals/has"),o=e("../internals/object-get-own-property-descriptor"),l=e("../internals/object-get-prototype-of");n({target:"Reflect",stat:!0},{get:function e(t,i){var n,u=arguments.length<3?t:arguments[2];return r(t)===u?t[i]:(n=o.f(t,i))?a(n,"value")?n.value:void 0===n.get?void 0:n.get.call(u):s(n=l(t))?e(n,i,u):void 0}})},{"../internals/an-object":2,"../internals/export":18,"../internals/has":24,"../internals/is-object":33,"../internals/object-get-own-property-descriptor":40,"../internals/object-get-prototype-of":43}],67:[function(e,t,i){(function(e){(function(){var n,s,r,a;n=this,s=function(){var t="object"==typeof self&&self.self===self&&self||"object"==typeof e&&e.global===e&&e||Function("return this")()||{},i=Array.prototype,n=Object.prototype,s="undefined"!=typeof Symbol?Symbol.prototype:null,r=i.push,a=i.slice,o=n.toString,l=n.hasOwnProperty,u="undefined"!=typeof ArrayBuffer,d="undefined"!=typeof DataView,h=Array.isArray,c=Object.keys,p=Object.create,m=u&&ArrayBuffer.isView,f=isNaN,g=isFinite,y=!({toString:null}).propertyIsEnumerable("toString"),v=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];function b(e,t){return t=null==t?e.length-1:+t,function(){for(var i=Math.max(arguments.length-t,0),n=Array(i),s=0;s<i;s++)n[s]=arguments[s+t];switch(t){case 0:return e.call(this,n);case 1:return e.call(this,arguments[0],n);case 2:return e.call(this,arguments[0],arguments[1],n)}for(var r=Array(t+1),s=0;s<t;s++)r[s]=arguments[s];return r[t]=n,e.apply(this,r)}}function $(e){var t=typeof e;return"function"==t||"object"==t&&!!e}function T(e){return void 0===e}function w(e){return!0===e||!1===e||"[object Boolean]"===o.call(e)}function _(e){var t="[object "+e+"]";return function(e){return o.call(e)===t}}var S=_("String"),k=_("Number"),E=_("Date"),C=_("RegExp"),x=_("Error"),I=_("Symbol"),P=_("ArrayBuffer"),A=_("Function"),L=t.document&&t.document.childNodes,D=A="function"!=typeof/./&&"object"!=typeof Int8Array&&"function"!=typeof L?function(e){return"function"==typeof e}:A,O=_("Object"),R=d&&O(new DataView(new ArrayBuffer(8))),N="undefined"!=typeof Map&&O(new Map),M=_("DataView"),B=R?function(e){return null!=e&&D(e.getInt8)&&P(e.buffer)}:M,U=h||_("Array");function F(e,t){return null!=e&&l.call(e,t)}var j=_("Arguments");!function(){j(arguments)||(j=function(e){return F(e,"callee")})}();var q=j;function H(e){return k(e)&&f(e)}function V(e){return function(){return e}}function W(e){return function(t){return"number"==typeof(t=e(t))&&0<=t&&t<=9007199254740991}}function z(e){return function(t){return null==t?void 0:t[e]}}var G=z("byteLength"),X=W(G),K=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/,Y=u?function(e){return m?m(e)&&!B(e):X(e)&&K.test(o.call(e))}:V(!1),Q=z("length");function Z(e,t){t=function(e){for(var t={},i=e.length,n=0;n<i;++n)t[e[n]]=!0;return{contains:function(e){return t[e]},push:function(i){return t[i]=!0,e.push(i)}}}(t);var i=v.length,s=e.constructor,r=D(s)&&s.prototype||n,a="constructor";for(F(e,a)&&!t.contains(a)&&t.push(a);i--;)(a=v[i])in e&&e[a]!==r[a]&&!t.contains(a)&&t.push(a)}function J(e){if(!$(e))return[];if(c)return c(e);var t,i=[];for(t in e)F(e,t)&&i.push(t);return y&&Z(e,i),i}function ee(e,t){var i=J(t),n=i.length;if(null==e)return!n;for(var s=Object(e),r=0;r<n;r++){var a=i[r];if(t[a]!==s[a]||!(a in s))return!1}return!0}function et(e){return e instanceof et?e:this instanceof et?void(this._wrapped=e):new et(e)}function ei(e){return new Uint8Array(e.buffer||e,e.byteOffset||0,G(e))}et.VERSION="1.13.1",et.prototype.valueOf=et.prototype.toJSON=et.prototype.value=function(){return this._wrapped},et.prototype.toString=function(){return String(this._wrapped)};var en="[object DataView]";function es(e){if(!$(e))return[];var t,i=[];for(t in e)i.push(t);return y&&Z(e,i),i}function er(e){var t=Q(e);return function(i){if(null==i)return!1;var n=es(i);if(Q(n))return!1;for(var s=0;s<t;s++)if(!D(i[e[s]]))return!1;return e!==ed||!D(i[ea])}}var ea="forEach",eo=["clear","delete"],el=["get","has","set"],eu=eo.concat(ea,el),ed=eo.concat(el),eh=["add"].concat(eo,ea,"has"),ec=N?er(eu):_("Map"),ep=N?er(ed):_("WeakMap"),em=N?er(eh):_("Set"),ef=_("WeakSet");function eg(e){for(var t=J(e),i=t.length,n=Array(i),s=0;s<i;s++)n[s]=e[t[s]];return n}function ey(e){for(var t={},i=J(e),n=0,s=i.length;n<s;n++)t[e[i[n]]]=i[n];return t}function ev(e){var t,i=[];for(t in e)D(e[t])&&i.push(t);return i.sort()}function e8(e,t){return function(i){var n=arguments.length;if(t&&(i=Object(i)),n<2||null==i)return i;for(var s=1;s<n;s++)for(var r=arguments[s],a=e(r),o=a.length,l=0;l<o;l++){var u=a[l];t&&void 0!==i[u]||(i[u]=r[u])}return i}}var eb=e8(es),e$=e8(J),eT=e8(es,!0);function ew(e){if(!$(e))return{};if(p)return p(e);var t=function(){};return t.prototype=e,e=new t,t.prototype=null,e}function e_(e){return $(e)?U(e)?e.slice():eb({},e):e}function eS(e){return U(e)?e:[e]}function ek(e){return et.toPath(e)}function eE(e,t){for(var i=t.length,n=0;n<i;n++){if(null==e)return;e=e[t[n]]}return i?e:void 0}function eC(e,t,i){return T(t=eE(e,ek(t)))?i:t}function e0(e){return e}function ex(e){return e=e$({},e),function(t){return ee(t,e)}}function eI(e){return e=ek(e),function(t){return eE(t,e)}}function eP(e,t,i){if(void 0===t)return e;switch(null==i?3:i){case 1:return function(i){return e.call(t,i)};case 3:return function(i,n,s){return e.call(t,i,n,s)};case 4:return function(i,n,s,r){return e.call(t,i,n,s,r)}}return function(){return e.apply(t,arguments)}}function eA(e,t,i){return null==e?e0:D(e)?eP(e,t,i):($(e)&&!U(e)?ex:eI)(e)}function eL(e,t){return eA(e,t,1/0)}function eD(e,t,i){return et.iteratee!==eL?et.iteratee(e,t):eA(e,t,i)}function eO(){}function eR(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))}et.toPath=eS,et.iteratee=eL;var eN=Date.now||function(){return(new Date).getTime()};function eM(e){function t(t){return e[t]}var i="(?:"+J(e).join("|")+")",n=RegExp(i),s=RegExp(i,"g");return function(e){return n.test(e=null==e?"":""+e)?e.replace(s,t):e}}var e3={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},eB=eM(e3),eU=eM(ey(e3)),e2=et.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},e1=/(.)^/,e4={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},e6=/\\|'|\r|\n|\u2028|\u2029/g;function eF(e){return"\\"+e4[e]}var ej=/^\s*(\w|\$)+\s*$/,e5=0;function eq(e,t,i,n,s){return n instanceof t?(i=ew(e.prototype),$(s=e.apply(i,s))?s:i):e.apply(i,s)}var eH=b(function(e,t){var i=eH.placeholder,n=function(){for(var s=0,r=t.length,a=Array(r),o=0;o<r;o++)a[o]=t[o]===i?arguments[s++]:t[o];for(;s<arguments.length;)a.push(arguments[s++]);return eq(e,n,this,this,a)};return n});eH.placeholder=et;var eV=b(function(e,t,i){if(!D(e))throw TypeError("Bind must be called on a function");var n=b(function(s){return eq(e,n,t,this,i.concat(s))});return n}),e7=W(Q);function e9(e,t,i,n){if(n=n||[],t||0===t){if(t<=0)return n.concat(e)}else t=1/0;for(var s=n.length,r=0,a=Q(e);r<a;r++){var o=e[r];if(e7(o)&&(U(o)||q(o))){if(1<t)e9(o,t-1,i,n),s=n.length;else for(var l=0,u=o.length;l<u;)n[s++]=o[l++]}else i||(n[s++]=o)}return n}var eW=b(function(e,t){var i=(t=e9(t,!1,!1)).length;if(i<1)throw Error("bindAll must be passed function names");for(;i--;){var n=t[i];e[n]=eV(e[n],e)}return e}),ez=b(function(e,t,i){return setTimeout(function(){return e.apply(null,i)},t)}),eG=eH(ez,et,1);function eX(e){return function(){return!e.apply(this,arguments)}}function eK(e,t){var i;return function(){return 0<--e&&(i=t.apply(this,arguments)),e<=1&&(t=null),i}}function eY(e,t,i){t=eD(t,i);for(var n,s=J(e),r=0,a=s.length;r<a;r++)if(t(e[n=s[r]],n,e))return n}function eQ(e){return function(t,i,n){i=eD(i,n);for(var s=Q(t),r=0<e?0:s-1;0<=r&&r<s;r+=e)if(i(t[r],r,t))return r;return -1}}t=eH(eK,2);var eZ=eQ(1),L=eQ(-1);function eJ(e,t,i,n){for(var s=(i=eD(i,n,1))(t),r=0,a=Q(e);r<a;){var o=Math.floor((r+a)/2);i(e[o])<s?r=o+1:a=o}return r}function te(e,t,i){return function(n,s,r){var o=0,l=Q(n);if("number"==typeof r)0<e?o=0<=r?r:Math.max(r+l,o):l=0<=r?Math.min(r+1,l):r+l+1;else if(i&&r&&l)return n[r=i(n,s)]===s?r:-1;if(s!=s)return 0<=(r=t(a.call(n,o,l),H))?r+o:-1;for(r=0<e?o:l-1;0<=r&&r<l;r+=e)if(n[r]===s)return r;return -1}}var tt=te(1,eZ,eJ),A=te(-1,L);function ti(e,t,i){if(void 0!==(i=(e7(e)?eZ:eY)(e,t,i))&&-1!==i)return e[i]}function tn(e,t,i){if(t=eP(t,i),e7(e))for(s=0,r=e.length;s<r;s++)t(e[s],s,e);else for(var n=J(e),s=0,r=n.length;s<r;s++)t(e[n[s]],n[s],e);return e}function ts(e,t,i){t=eD(t,i);for(var n=!e7(e)&&J(e),s=(n||e).length,r=Array(s),a=0;a<s;a++){var o=n?n[a]:a;r[a]=t(e[o],o,e)}return r}function tr(e){return function(t,i,n,s){var r=3<=arguments.length;return function(t,i,n,s){var r=!e7(t)&&J(t),a=(r||t).length,o=0<e?0:a-1;for(s||(n=t[r?r[o]:o],o+=e);0<=o&&o<a;o+=e){var l=r?r[o]:o;n=i(n,t[l],l,t)}return n}(t,eP(i,s,4),n,r)}}function ta(e,t,i){var n=[];return t=eD(t,i),tn(e,function(e,i,s){t(e,i,s)&&n.push(e)}),n}function to(e,t,i){t=eD(t,i);for(var n=!e7(e)&&J(e),s=(n||e).length,r=0;r<s;r++){var a=n?n[r]:r;if(!t(e[a],a,e))return!1}return!0}function tl(e,t,i){t=eD(t,i);for(var n=!e7(e)&&J(e),s=(n||e).length,r=0;r<s;r++){var a=n?n[r]:r;if(t(e[a],a,e))return!0}return!1}function tu(e,t,i,n){return e7(e)||(e=eg(e)),0<=tt(e,t,i="number"!=typeof i||n?0:i)}function td(e,t){return ts(e,eI(t))}function th(e,t,i){var n,s,r=-1/0,a=-1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var o=0,l=(e=e7(e)?e:eg(e)).length;o<l;o++)null!=(n=e[o])&&r<n&&(r=n);else t=eD(t,i),tn(e,function(e,i,n){(a<(s=t(e,i,n))||s===-1/0&&r===-1/0)&&(r=e,a=s)});return r}function tc(e,t,i){if(null==t||i)return(e=e7(e)?e:eg(e))[eR(e.length-1)];var n=(e7(e)?e_:eg)(e),e=Q(n);t=Math.max(Math.min(t,e),0);for(var s=e-1,r=0;r<t;r++){var a=eR(r,s),o=n[r];n[r]=n[a],n[a]=o}return n.slice(0,t)}function tp(e,t){return function(i,n,s){var r=t?[[],[]]:{};return n=eD(n,s),tn(i,function(t,s){s=n(t,s,i),e(r,t,s)}),r}}d=tr(1),O=tr(-1),M=b(function(e,t,i){var n,s;return D(t)?s=t:(n=(t=ek(t)).slice(0,-1),t=t[t.length-1]),ts(e,function(e){var r=s;if(!r){if(null==(e=n&&n.length?eE(e,n):e))return;r=e[t]}return null==r?r:r.apply(e,i)})});var h=tp(function(e,t,i){F(e,i)?e[i].push(t):e[i]=[t]}),u=tp(function(e,t,i){e[i]=t}),el=tp(function(e,t,i){F(e,i)?e[i]++:e[i]=1}),eo=tp(function(e,t,i){e[i?0:1].push(t)},!0),tm=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function tf(e,t,i){return t in i}var tg=b(function(e,t){var i={},n=t[0];if(null==e)return i;D(n)?(1<t.length&&(n=eP(n,t[1])),t=es(e)):(n=tf,t=e9(t,!1,!1),e=Object(e));for(var s=0,r=t.length;s<r;s++){var a=t[s],o=e[a];n(o,a,e)&&(i[a]=o)}return i}),eu=b(function(e,t){var i,n=t[0];return D(n)?(n=eX(n),1<t.length&&(i=t[1])):(t=ts(e9(t,!1,!1),String),n=function(e,i){return!tu(t,i)}),tg(e,n,i)});function ty(e,t,i){return a.call(e,0,Math.max(0,e.length-(null==t||i?1:t)))}function tv(e,t,i){return null==e||e.length<1?null==t||i?void 0:[]:null==t||i?e[0]:ty(e,e.length-t)}function t8(e,t,i){return a.call(e,null==t||i?1:t)}var tb=b(function(e,t){return t=e9(t,!0,!0),ta(e,function(e){return!tu(t,e)})}),N=b(function(e,t){return tb(e,t)});function t$(e,t,i,n){w(t)||(n=i,i=t,t=!1),null!=i&&(i=eD(i,n));for(var s=[],r=[],a=0,o=Q(e);a<o;a++){var l=e[a],u=i?i(l,a,e):l;t&&!i?(a&&r===u||s.push(l),r=u):i?tu(r,u)||(r.push(u),s.push(l)):tu(s,l)||s.push(l)}return s}function tT(e){for(var t=e&&th(e,Q).length||0,i=Array(t),n=0;n<t;n++)i[n]=td(e,n);return i}function tw(e,t){return e._chain?et(t).chain():t}function t_(e){return tn(ev(e),function(t){var i=et[t]=e[t];et.prototype[t]=function(){var e=[this._wrapped];return r.apply(e,arguments),tw(this,i.apply(et,e))}}),et}return eh=b(function(e){return t$(e9(e,!0,!0))}),e3=b(tT),tn(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=i[e];et.prototype[e]=function(){var i=this._wrapped;return null!=i&&(t.apply(i,arguments),"shift"!==e&&"splice"!==e||0!==i.length||delete i[0]),tw(this,i)}}),tn(["concat","join","slice"],function(e){var t=i[e];et.prototype[e]=function(){var e=this._wrapped;return tw(this,e=null!=e?t.apply(e,arguments):e)}}),(e3=t_({__proto__:null,VERSION:"1.13.1",restArguments:b,isObject:$,isNull:function(e){return null===e},isUndefined:T,isBoolean:w,isElement:function(e){return!(!e||1!==e.nodeType)},isString:S,isNumber:k,isDate:E,isRegExp:C,isError:x,isSymbol:I,isArrayBuffer:P,isDataView:B,isArray:U,isFunction:D,isArguments:q,isFinite:function(e){return!I(e)&&g(e)&&!isNaN(parseFloat(e))},isNaN:H,isTypedArray:Y,isEmpty:function(e){if(null==e)return!0;var t=Q(e);return"number"==typeof t&&(U(e)||S(e)||q(e))?0===t:0===Q(J(e))},isMatch:ee,isEqual:function(e,t){return function e(t,i,n,r){if(t===i)return 0!==t||1/t==1/i;if(null==t||null==i)return!1;if(t!=t)return i!=i;var a=typeof t;return("function"==a||"object"==a||"object"==typeof i)&&function t(i,n,r,a){i instanceof et&&(i=i._wrapped),n instanceof et&&(n=n._wrapped);var l=o.call(i);if(l!==o.call(n))return!1;if(R&&"[object Object]"==l&&B(i)){if(!B(n))return!1;l=en}switch(l){case"[object RegExp]":case"[object String]":return""+i==""+n;case"[object Number]":return+i!=+i?+n!=+n:0==+i?1/+i==1/n:+i==+n;case"[object Date]":case"[object Boolean]":return+i==+n;case"[object Symbol]":return s.valueOf.call(i)===s.valueOf.call(n);case"[object ArrayBuffer]":case en:return t(ei(i),ei(n),r,a)}var u="[object Array]"===l;if(!u&&Y(i)){var d=G(i);if(d!==G(n))return!1;if(i.buffer===n.buffer&&i.byteOffset===n.byteOffset)return!0;u=!0}if(!u){if("object"!=typeof i||"object"!=typeof n)return!1;var l=i.constructor,d=n.constructor;if(l!==d&&!(D(l)&&l instanceof l&&D(d)&&d instanceof d)&&"constructor"in i&&"constructor"in n)return!1}a=a||[];for(var h=(r=r||[]).length;h--;)if(r[h]===i)return a[h]===n;if(r.push(i),a.push(n),u){if((h=i.length)!==n.length)return!1;for(;h--;)if(!e(i[h],n[h],r,a))return!1}else{var c,p=J(i);if(h=p.length,J(n).length!==h)return!1;for(;h--;)if(!F(n,c=p[h])||!e(i[c],n[c],r,a))return!1}return r.pop(),a.pop(),!0}(t,i,void 0,void 0)}(e,t)},isMap:ec,isWeakMap:ep,isSet:em,isWeakSet:ef,keys:J,allKeys:es,values:eg,pairs:function(e){for(var t=J(e),i=t.length,n=Array(i),s=0;s<i;s++)n[s]=[t[s],e[t[s]]];return n},invert:ey,functions:ev,methods:ev,extend:eb,extendOwn:e$,assign:e$,defaults:eT,create:function(e,t){return e=ew(e),t&&e$(e,t),e},clone:e_,tap:function(e,t){return t(e),e},get:eC,has:function(e,t){for(var i=(t=ek(t)).length,n=0;n<i;n++){var s=t[n];if(!F(e,s))return!1;e=e[s]}return!!i},mapObject:function(e,t,i){t=eD(t,i);for(var n=J(e),s=n.length,r={},a=0;a<s;a++){var o=n[a];r[o]=t(e[o],o,e)}return r},identity:e0,constant:V,noop:eO,toPath:eS,property:eI,propertyOf:function(e){return null==e?eO:function(t){return eC(e,t)}},matcher:ex,matches:ex,times:function(e,t,i){var n=Array(Math.max(0,e));t=eP(t,i,1);for(var s=0;s<e;s++)n[s]=t(s);return n},random:eR,now:eN,escape:eB,unescape:eU,templateSettings:e2,template:function(e,t,i){t=eT({},t=!t&&i?i:t,et.templateSettings);var n,i=RegExp([(t.escape||e1).source,(t.interpolate||e1).source,(t.evaluate||e1).source].join("|")+"|$","g"),s=0,r="__p+='";if(e.replace(i,function(t,i,n,a,o){return r+=e.slice(s,o).replace(e6,eF),s=o+t.length,i?r+="'+\n((__t=("+i+"))==null?'':_.escape(__t))+\n'":n?r+="'+\n((__t=("+n+"))==null?'':__t)+\n'":a&&(r+="';\n"+a+"\n__p+='"),t}),r+="';\n",i=t.variable){if(!ej.test(i))throw Error("variable is not a bare identifier: "+i)}else r="with(obj||{}){\n"+r+"}\n",i="obj";r="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+r+"return __p;\n";try{n=Function(i,"_",r)}catch(a){throw a.source=r,a}return(t=function(e){return n.call(this,e,et)}).source="function("+i+"){\n"+r+"}",t},result:function(e,t,i){var n=(t=ek(t)).length;if(!n)return D(i)?i.call(e):i;for(var s=0;s<n;s++){var r=null==e?void 0:e[t[s]];void 0===r&&(r=i,s=n),e=D(r)?r.call(e):r}return e},uniqueId:function(e){var t=++e5+"";return e?e+t:t},chain:function(e){return(e=et(e))._chain=!0,e},iteratee:eL,partial:eH,bind:eV,bindAll:eW,memoize:function(e,t){var i=function(n){var s=i.cache,r=""+(t?t.apply(this,arguments):n);return F(s,r)||(s[r]=e.apply(this,arguments)),s[r]};return i.cache={},i},delay:ez,defer:eG,throttle:function(e,t,i){var n,s,r,a,o=0;function l(){o=!1===i.leading?0:eN(),n=null,a=e.apply(s,r),n||(s=r=null)}function u(){var u=eN();o||!1!==i.leading||(o=u);var d=t-(u-o);return s=this,r=arguments,d<=0||t<d?(n&&(clearTimeout(n),n=null),o=u,a=e.apply(s,r),n||(s=r=null)):n||!1===i.trailing||(n=setTimeout(l,d)),a}return i=i||{},u.cancel=function(){clearTimeout(n),o=0,n=s=r=null},u},debounce:function(e,t,i){var n,s,r,a,o,l=function(){var u=eN()-s;u<t?n=setTimeout(l,t-u):(n=null,i||(a=e.apply(o,r)),n||(r=o=null))},u=b(function(u){return o=this,r=u,s=eN(),n||(n=setTimeout(l,t),i&&(a=e.apply(o,r))),a});return u.cancel=function(){clearTimeout(n),n=r=o=null},u},wrap:function(e,t){return eH(t,e)},negate:eX,compose:function(){var e=arguments,t=e.length-1;return function(){for(var i=t,n=e[t].apply(this,arguments);i--;)n=e[i].call(this,n);return n}},after:function(e,t){return function(){if(--e<1)return t.apply(this,arguments)}},before:eK,once:t,findKey:eY,findIndex:eZ,findLastIndex:L,sortedIndex:eJ,indexOf:tt,lastIndexOf:A,find:ti,detect:ti,findWhere:function(e,t){return ti(e,ex(t))},each:tn,forEach:tn,map:ts,collect:ts,reduce:d,foldl:d,inject:d,reduceRight:O,foldr:O,filter:ta,select:ta,reject:function(e,t,i){return ta(e,eX(eD(t)),i)},every:to,all:to,some:tl,any:tl,contains:tu,includes:tu,include:tu,invoke:M,pluck:td,where:function(e,t){return ta(e,ex(t))},max:th,min:function(e,t,i){var n,s,r=1/0,a=1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var o=0,l=(e=e7(e)?e:eg(e)).length;o<l;o++)null!=(n=e[o])&&n<r&&(r=n);else t=eD(t,i),tn(e,function(e,i,n){((s=t(e,i,n))<a||s===1/0&&r===1/0)&&(r=e,a=s)});return r},shuffle:function(e){return tc(e,1/0)},sample:tc,sortBy:function(e,t,i){var n=0;return t=eD(t,i),td(ts(e,function(e,i,s){return{value:e,index:n++,criteria:t(e,i,s)}}).sort(function(e,t){var i=e.criteria,n=t.criteria;if(i!==n){if(n<i||void 0===i)return 1;if(i<n||void 0===n)return -1}return e.index-t.index}),"value")},groupBy:h,indexBy:u,countBy:el,partition:eo,toArray:function(e){return e?U(e)?a.call(e):S(e)?e.match(tm):e7(e)?ts(e,e0):eg(e):[]},size:function(e){return null==e?0:(e7(e)?e:J(e)).length},pick:tg,omit:eu,first:tv,head:tv,take:tv,initial:ty,last:function(e,t,i){return null==e||e.length<1?null==t||i?void 0:[]:null==t||i?e[e.length-1]:t8(e,Math.max(0,e.length-t))},rest:t8,tail:t8,drop:t8,compact:function(e){return ta(e,Boolean)},flatten:function(e,t){return e9(e,t,!1)},without:N,uniq:t$,unique:t$,union:eh,intersection:function(e){for(var t=[],i=arguments.length,n=0,s=Q(e);n<s;n++){var r=e[n];if(!tu(t,r)){for(var a=1;a<i&&tu(arguments[a],r);a++);a===i&&t.push(r)}}return t},difference:tb,unzip:tT,transpose:tT,zip:e3,object:function(e,t){for(var i={},n=0,s=Q(e);n<s;n++)t?i[e[n]]=t[n]:i[e[n][0]]=e[n][1];return i},range:function(e,t,i){null==t&&(t=e||0,e=0),i=i||(t<e?-1:1);for(var n=Math.max(Math.ceil((t-e)/i),0),s=Array(n),r=0;r<n;r++,e+=i)s[r]=e;return s},chunk:function(e,t){if(null==t||t<1)return[];for(var i=[],n=0,s=e.length;n<s;)i.push(a.call(e,n,n+=t));return i},mixin:t_,default:et}))._=e3},"object"==typeof i&&void 0!==t?t.exports=s():"function"==typeof define&&define.amd?define("underscore",s):(r=(n="undefined"!=typeof globalThis?globalThis:n||self)._,(a=n._=s()).noConflict=function(){return n._=r,a})}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],68:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function s(){return(s="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,i){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=a(e)););return e}(e,t);if(n)return(t=Object.getOwnPropertyDescriptor(n,t)).get?t.get.call(arguments.length<3?e:i):t.value}).apply(this,arguments)}function r(e,t){return(r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}e("core-js/modules/es.reflect.construct.js"),e("core-js/modules/es.reflect.get.js");var o=e("underscore"),l=e("../events");t.exports=function(e){var t=e.getComponent("MenuItem");return function(){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&r(e,t)}(p,t);var e,i,u,d,h,c=(e=p,i=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var t,n=a(e);return function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0!==e)return e;throw ReferenceError("this hasn't been initialised - super() hasn't been called")}(e)}(this,i?(t=a(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments))});function p(e,t){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,p);var i=t.source;if(!o.isObject(i))throw Error('was not provided a "source" object, but rather: '+typeof i);return t=o.extend({selectable:!0,label:i.label},t),(t=c.call(this,e,t)).source=i,t}return u=p,d=[{key:"handleClick",value:function(e){s(a(p.prototype),"handleClick",this).call(this,e),this.player().trigger(l.QUALITY_REQUESTED,this.source)}}],n(u.prototype,d),h&&n(u,h),Object.defineProperty(u,"prototype",{writable:!1}),p}()}},{"../events":70,"core-js/modules/es.reflect.construct.js":65,"core-js/modules/es.reflect.get.js":66,underscore:67}],69:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function s(){return(s="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,i){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=o(e)););return e}(e,t);if(n)return(t=Object.getOwnPropertyDescriptor(n,t)).get?t.get.call(arguments.length<3?e:i):t.value}).apply(this,arguments)}function r(e,t){return(r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function a(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}e("core-js/modules/es.reflect.construct.js"),e("core-js/modules/es.reflect.get.js"),e("core-js/modules/es.array.map.js");var l=e("underscore"),u=e("../events"),d=e("./QualityOption"),h="vjs-quality-changing";t.exports=function(e){var t=e.getComponent("MenuButton"),i=d(e),c=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&r(e,t)}(g,t);var e,d,c,p,m,f=(e=g,d=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var t,i=o(e);return function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return a(e)}(this,d?(t=o(this).constructor,Reflect.construct(i,arguments,t)):i.apply(this,arguments))});function g(e,t){return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,g),t=f.call(this,e,t),e.on(u.QUALITY_REQUESTED,(function(t,i){this.setSelectedSource(i),e.addClass(h),e.one("loadeddata",function(){e.removeClass(h)})}).bind(a(t))),e.on(u.PLAYER_SOURCES_CHANGED,(function(){this.update()}).bind(a(t))),e.on(u.QUALITY_SELECTED,(function(e,t){this.setSelectedSource(t)}).bind(a(t))),e.one("ready",(function(){this.selectedSrc=e.src(),this.update()}).bind(a(t))),t.controlText("Open quality selector menu"),t}return c=g,p=[{key:"setSelectedSource",value:function(e){var t=e?e.src:void 0;this.selectedSrc!==t&&(this.selectedSrc=t,l.each(this.items,function(e){e.selected(e.source.src===t)}))}},{key:"createItems",value:function(){var e=this.player(),t=e.currentSources();return!t||t.length<2?[]:l.map(t,(function(t){return new i(e,{source:t,selected:t.src===this.selectedSrc})}).bind(this))}},{key:"buildWrapperCSSClass",value:function(){return"vjs-quality-selector "+s(o(g.prototype),"buildWrapperCSSClass",this).call(this)}}],n(c.prototype,p),m&&n(c,m),Object.defineProperty(c,"prototype",{writable:!1}),g}();return e.registerComponent("QualitySelector",c),c}},{"../events":70,"./QualityOption":68,"core-js/modules/es.array.map.js":64,"core-js/modules/es.reflect.construct.js":65,"core-js/modules/es.reflect.get.js":66,underscore:67}],70:[function(e,t,i){"use strict";t.exports={QUALITY_REQUESTED:"qualityRequested",QUALITY_SELECTED:"qualitySelected",PLAYER_SOURCES_CHANGED:"playerSourcesChanged"}},{}],71:[function(e,t,i){"use strict";var n=e("underscore"),s=e("./events"),r=e("./components/QualitySelector"),a=e("./middleware/SourceInterceptor"),o=e("./util/SafeSeek");t.exports=function(e){r(e=e||window.videojs),a(e),e.hook("setup",function(e){e.on(s.QUALITY_REQUESTED,function(t,i){var s=e.currentSources(),r=e.currentTime(),a=e.playbackRate(),l=e.paused();n.each(s,function(e){e.selected=!1}),n.findWhere(s,{src:i.src}).selected=!0,e._qualitySelectorSafeSeek&&e._qualitySelectorSafeSeek.onQualitySelectionChange(),e.src(s),e.ready(function(){e._qualitySelectorSafeSeek&&!e._qualitySelectorSafeSeek.hasFinished()||(e._qualitySelectorSafeSeek=new o(e,r),e.playbackRate(a)),l||e.play()})})})},t.exports.EVENTS=s},{"./components/QualitySelector":69,"./events":70,"./middleware/SourceInterceptor":72,"./util/SafeSeek":74,underscore:67}],72:[function(e,t,i){"use strict";var n=e("underscore"),s=e("../events");t.exports=function(e){e.use("*",function(e){return{setSource:function(t,i){var r=e.currentSources();e._qualitySelectorSafeSeek&&e._qualitySelectorSafeSeek.onPlayerSourcesChange(),n.isEqual(r,e._qualitySelectorPreviousSources)||(e.trigger(s.PLAYER_SOURCES_CHANGED,r),e._qualitySelectorPreviousSources=r),r=n.find(r,function(e){return!0===e.selected||"true"===e.selected||"selected"===e.selected}),e.trigger(s.QUALITY_SELECTED,t=r||t),i(null,t)}}})}},{"../events":70,underscore:67}],73:[function(e,t,i){"use strict";e("./index")()},{"./index":71}],74:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}t.exports=function(){var e,t,i;function s(e,t){(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")})(this,s),this._player=e,this._seekToTime=t,this._hasFinished=!1,this._keepThisInstanceWhenPlayerSourcesChange=!1,this._seekWhenSafe()}return e=s,t=[{key:"_seekWhenSafe",value:function(){3>this._player.readyState()?(this._seekFn=this._seek.bind(this),this._player.one("canplay",this._seekFn)):this._seek()}},{key:"onPlayerSourcesChange",value:function(){this._keepThisInstanceWhenPlayerSourcesChange?this._keepThisInstanceWhenPlayerSourcesChange=!1:this.cancel()}},{key:"onQualitySelectionChange",value:function(){this.hasFinished()||(this._keepThisInstanceWhenPlayerSourcesChange=!0)}},{key:"_seek",value:function(){this._player.currentTime(this._seekToTime),this._keepThisInstanceWhenPlayerSourcesChange=!1,this._hasFinished=!0}},{key:"hasFinished",value:function(){return this._hasFinished}},{key:"cancel",value:function(){this._player.off("canplay",this._seekFn),this._keepThisInstanceWhenPlayerSourcesChange=!1,this._hasFinished=!0}}],n(e.prototype,t),i&&n(e,i),Object.defineProperty(e,"prototype",{writable:!1}),s}()},{}]},{},[73]);
|