/*
 @license
 Shaka Player
 Copyright 2016 Google LLC
 SPDX-License-Identifier: Apache-2.0
*/
(function(){var innerGlobal=typeof window!="undefined"?window:global;var exportTo={};(function(window,global,module){/*

 Copyright The Closure Library Authors.
 SPDX-License-Identifier: Apache-2.0
*/
var ca,da=this||self;function v(a,b){a=a.split(".");var c=da;a[0]in c||typeof c.execScript=="undefined"||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)a.length||b===void 0?c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}:c[d]=b};/*
 @license
 Shaka Player
 Copyright 2016 Google LLC
 SPDX-License-Identifier: Apache-2.0
*/
function ea(a){return a.h/(1-Math.pow(a.g,a.j))}var fa=class{constructor(a){this.i=Math.log(.5);this.g=Math.exp(this.i/a);this.j=this.h=0}sample(a,b){const c=Math.pow(this.g,a);b=b*(1-c)+c*this.h;isNaN(b)||(this.h=b,this.j+=a)}};var ha=class{constructor(){this.h=new fa(2);this.j=new fa(5);this.g=0;this.i=128E3;this.l=16E3}configure(a){this.i=a.minTotalBytes;this.l=a.minBytes;var b=this.h;b.g=Math.exp(b.i/a.fastHalfLife);b=this.j;b.g=Math.exp(b.i/a.slowHalfLife)}sample(a,b){if(!(b<this.l)){var c=8E3*b/a;a/=1E3;this.g+=b;this.h.sample(a,c);this.j.sample(a,c)}}getBandwidthEstimate(a){return this.g<this.i?a:Math.min(ea(this.h),ea(this.j))}};function ia(){}function ja(){}function la(a,...b){ma.has(a)||(ma.add(a),ja(...b))}function na(){}function oa(){}function pa(){}var ma=new Set;window.console&&((new Map).set(1,(...a)=>console.error(...a)).set(2,(...a)=>console.warn(...a)).set(3,(...a)=>console.info(...a)).set(4,(...a)=>console.log(...a)).set(5,(...a)=>console.debug(...a)).set(6,(...a)=>console.debug(...a)),ja=(...a)=>{console.warn(...a)},ia=(...a)=>{console.error(...a)});function qa(a,b){return typeof a==="number"&&typeof b==="number"&&isNaN(a)&&isNaN(b)?!0:a===b}function sa(a,b){b=a.indexOf(b);b>-1&&a.splice(b,1)}function ta(a,b,c){c||=qa;if(a.length!=b.length)return!1;b=b.slice();for(const d of a){a=b.findIndex(e=>c(d,e));if(a==-1)return!1;b[a]=b[b.length-1];b.pop()}return b.length==0}function ua(a,b){const c=[],d=[];for(const e of a)b(e)?c.push(e):d.push(e);return[c,d]}function wa(a,b){let c=0,d=a.length;for(;c<d;){const e=c+d>>>1;b(a[e])?c=e+1:d=e}return c}
function xa(a,b,c){if(a===b)return!0;if(!a||!b)return a==b;c||=qa;if(a.length!=b.length)return!1;for(let d=0;d<a.length;d++)if(!c(a[d],b[d]))return!1;return!0};var ya=class{constructor(){this.g=new Map}push(a,b){this.g.has(a)?this.g.get(a).push(b):this.g.set(a,[b])}get(a){return this.g.has(a)?this.g.get(a).slice():null}remove(a,b){if(this.g.has(a)){var c=this.g.get(a).filter(d=>d!=b);this.g.set(a,c);c.length||this.g.delete(a)}}forEach(a){this.g.forEach((b,c)=>{a(c,b)})}size(){return this.g.size}keys(){return Array.from(this.g.keys())}};var Aa=class{constructor(){this.g=new ya}release(){this.La();this.g=null}D(a,b,c,d){this.g&&(a=new za(a,b,c,d),this.g.push(b,a))}za(a,b,c,d){const e=f=>{this.Ja(a,b,e);c(f)};this.D(a,b,e,d)}Ja(a,b,c){if(this.g){var d=this.g.get(b)||[];for(const e of d)e.target!=a||c!=e.listener&&c||(e.Ja(),this.g.remove(b,e))}}La(){if(this.g){var a=this.g;const b=[];for(const c of a.g.values())b.push(...c);a=b;for(const c of a)c.Ja();this.g.g.clear()}}};v("shaka.util.EventManager",Aa);Aa.prototype.removeAll=Aa.prototype.La;
Aa.prototype.unlisten=Aa.prototype.Ja;Aa.prototype.listenOnce=Aa.prototype.za;Aa.prototype.listen=Aa.prototype.D;Aa.prototype.release=Aa.prototype.release;function Ba(a,b){if(b==void 0)return!1;if(typeof b=="boolean")return b;const c=new Set(["passive","capture"]);Object.keys(b).filter(d=>!c.has(d));return Ca(a)?b:b.capture||!1}
function Ca(a){let b=Da;if(b==void 0){b=!1;try{const d={};var c={get:()=>{b=!0;return!1}};Object.defineProperty(d,"passive",c);Object.defineProperty(d,"capture",c);c=()=>{};a.addEventListener("test",c,d);a.removeEventListener("test",c,d)}catch(d){b=!1}Da=b}return b||!1}
var za=class{constructor(a,b,c,d){this.target=a;this.type=b;this.listener=c;this.g=Ba(a,d);this.target.addEventListener(b,c,this.g)}Ja(){this.target.removeEventListener(this.type,this.listener,this.g);this.listener=this.target=null;this.g=!1}},Da=void 0;v("shaka.config.AutoShowText",{NEVER:0,ALWAYS:1,IF_PREFERRED_TEXT_LANGUAGE:2,IF_SUBTITLES_MAY_BE_NEEDED:3});var Ea=class{constructor(a){this.h=a;this.g=void 0}value(){this.g===void 0&&(this.g=this.h());return this.g}};function Fa(){return Ga.value()}var Ha=null,Ia=null,Ga=new Ea(()=>{let a=void 0;Ha&&(a=Ha());!a&&Ia&&(a=Ia());return a});var Ja=class{constructor(a,b){this.g=a;this.h=b}toString(){return"v"+this.g+"."+this.h}};var Qa=class{constructor(){var a=La,b=Ma;this.g=Na;this.i=a;this.h=b}};function La(a,b,c,d){ja([c,"has been deprecated and will be removed in",b,". We are currently at version",a,". Additional information:",d].join(" "))}function Ma(a,b,c,d){ia([c,"has been deprecated and has been removed in",b,". We are now at version",a,". Additional information:",d].join(" "))}function Ra(a,b){var c=new Ja(5,0),d=Sa,e=d.g;const f=c.h-e.h;((c.g-e.g||f)>0?d.i:d.h)(d.g,c,a,b)}var Sa=null;/*
 @license
 Copyright 2006 The Closure Library Authors
 SPDX-License-Identifier: Apache-2.0
*/
var Ta=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$");function Ua(a){var b;a instanceof Ua?(Va(this,a.Rb),this.Dc=a.Dc,Wa(this,a.pb),Ya(this,a.Uc),this.Pb=a.Pb,Za(this,a.g.clone()),this.sc=a.sc):a&&(b=String(a).match(Ta))?(Va(this,b[1]||"",!0),this.Dc=$a(b[2]||""),Wa(this,b[3]||"",!0),Ya(this,b[4]),this.Pb=$a(b[5]||"",!0),Za(this,b[6]||"",!0),this.sc=$a(b[7]||"")):this.g=new ab(null)}ca=Ua.prototype;ca.Rb="";ca.Dc="";ca.pb="";ca.Uc=null;ca.Pb="";ca.sc="";
ca.toString=function(){var a=[],b=this.Rb;b&&a.push(bb(b,cb,!0),":");if(b=this.pb){a.push("//");var c=this.Dc;c&&a.push(bb(c,cb,!0),"@");a.push(encodeURIComponent(b).replace(/%25([0-9a-fA-F]{2})/g,"%$1"));b=this.Uc;b!=null&&a.push(":",String(b))}if(b=this.Pb)this.pb&&b.charAt(0)!="/"&&a.push("/"),a.push(bb(b,b.charAt(0)=="/"?db:eb,!0));(b=this.g.toString())&&a.push("?",b);(b=this.sc)&&a.push("#",bb(b,fb));return a.join("")};
ca.resolve=function(a){var b=this.clone();b.Rb==="data"&&(b=new Ua);var c=!!a.Rb;c?Va(b,a.Rb):c=!!a.Dc;c?b.Dc=a.Dc:c=!!a.pb;c?Wa(b,a.pb):c=a.Uc!=null;var d=a.Pb;if(c)Ya(b,a.Uc);else if(c=!!a.Pb){if(d.charAt(0)!="/")if(this.pb&&!this.Pb)d="/"+d;else{var e=b.Pb.lastIndexOf("/");e!=-1&&(d=b.Pb.substr(0,e+1)+d)}if(d==".."||d==".")d="";else if(d.indexOf("./")!=-1||d.indexOf("/.")!=-1){e=d.lastIndexOf("/",0)==0;d=d.split("/");for(var f=[],g=0;g<d.length;){var h=d[g++];h=="."?e&&g==d.length&&f.push(""):
h==".."?((f.length>1||f.length==1&&f[0]!="")&&f.pop(),e&&g==d.length&&f.push("")):(f.push(h),e=!0)}d=f.join("/")}}c?b.Pb=d:c=a.g.toString()!=="";c?Za(b,a.g.clone()):c=!!a.sc;c&&(b.sc=a.sc);return b};ca.clone=function(){return new Ua(this)};function Va(a,b,c){a.Rb=c?$a(b,!0):b;a.Rb&&(a.Rb=a.Rb.replace(/:$/,""))}function Wa(a,b,c){a.pb=c?$a(b,!0):b}function Ya(a,b){if(b){b=Number(b);if(isNaN(b)||b<0)throw Error("Bad port number "+b);a.Uc=b}else a.Uc=null}
function Za(a,b,c){b instanceof ab?a.g=b:(c||(b=bb(b,gb)),a.g=new ab(b))}function $a(a,b){return a?b?decodeURI(a):decodeURIComponent(a):""}function bb(a,b,c){return a!=null?(a=encodeURI(a).replace(b,ib),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null}function ib(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)}var cb=/[#\/\?@]/g,eb=/[#\?:]/g,db=/[#\?]/g,gb=/[#\?@]/g,fb=/#/g;function ab(a){this.g=a||null}
function jb(a){if(!a.Ya&&(a.Ya=new Map,a.hd=0,a.g))for(var b=a.g.split("&"),c=0;c<b.length;c++){var d=b[c].indexOf("="),e=null;if(d>=0){var f=b[c].substring(0,d);e=b[c].substring(d+1)}else f=b[c];f=decodeURIComponent(f);e=e||"";a.add(f,decodeURIComponent(e))}}ca=ab.prototype;ca.Ya=null;ca.hd=null;ca.add=function(a,b){jb(this);this.g=null;var c=this.Ya.has(a)?this.Ya.get(a):null;c||this.Ya.set(a,c=[]);c.push(b);this.hd++;return this};
ca.set=function(a,b){jb(this);this.g=null;this.Ya.has(a)?this.Ya.set(a,[b]):this.add(a,b);return this};ca.get=function(a){jb(this);return this.Ya.get(a)||[]};ca.toString=function(){if(this.g)return this.g;if(!this.Ya||!this.Ya.size)return"";var a=[];for(const f of this.Ya.keys())for(var b=encodeURIComponent(f),c=this.Ya.get(f),d=0;d<c.length;d++){var e=b;c[d]!==""&&(e+="="+encodeURIComponent(c[d]));a.push(e)}return this.g=a.join("&")};
ca.clone=function(){var a=new ab;a.g=this.g;if(this.Ya){var b=new Map;for(const [c,d]of this.Ya)b.set(c,d.concat());a.Ya=b;a.hd=this.hd}return a};function kb(a,b){if(!a&&!b)return!0;if(!a||!b||a.byteLength!=b.byteLength)return!1;if((ArrayBuffer.isView(a)?a.buffer:a)==(ArrayBuffer.isView(b)?b.buffer:b)&&(a.byteOffset||0)==(b.byteOffset||0))return!0;const c=C(a);b=C(b);for(let d=0;d<a.byteLength;d++)if(c[d]!=b[d])return!1;return!0}function C(a,b=0,c=Infinity){return lb(a,b,c,Uint8Array)}function mb(a){return ArrayBuffer.isView(a)?a.byteOffset==0&&a.byteLength==a.buffer.byteLength?a.buffer:(new Uint8Array(a)).buffer:a}
function lb(a,b,c,d){const e=ArrayBuffer.isView(a)?a.buffer:a;let f=1;"BYTES_PER_ELEMENT"in d&&(f=d.BYTES_PER_ELEMENT);const g=((a.byteOffset||0)+a.byteLength)/f;a=Math.floor(Math.max(0,Math.min(((a.byteOffset||0)+b)/f,g)));return new d(e,a,Math.floor(Math.min(a+Math.max(c,0),g))-a)}function nb(a,b=0,c=Infinity){return lb(a,b,c,Uint16Array)}function ob(a,b=0,c=Infinity){return lb(a,b,c,DataView)}var qb=class{};v("shaka.util.BufferUtils",qb);qb.toDataView=ob;qb.toUint16=nb;qb.toUint8=C;
qb.toArrayBuffer=mb;qb.equal=kb;function sb(a,b){if(a===b||!a.length||!b.length)return!0;for(const c of a){if(tb(c))return!0;for(const d of b)if(c.keySystem===d.keySystem||tb(d))return!0}return!1}function tb(a){return(a=a.licenseServerUri)?a.startsWith("data:application/json;base64,"):!1}
function ub(a,b){if(!a.length)return b;if(!b.length)return a;const c=[];for(const e of a)for(const f of b)if(e.keySystem==f.keySystem){a=new Map;var d=(e.initData||[]).concat(f.initData||[]);for(const g of d)a.set(g.keyId,g);a=Array.from(a.values());d=e.keyIds&&f.keyIds?new Set([...e.keyIds,...f.keyIds]):e.keyIds||f.keyIds;c.push({keySystem:e.keySystem,licenseServerUri:e.licenseServerUri||f.licenseServerUri,distinctiveIdentifierRequired:e.distinctiveIdentifierRequired||f.distinctiveIdentifierRequired,
persistentStateRequired:e.persistentStateRequired||f.persistentStateRequired,videoRobustness:e.videoRobustness||f.videoRobustness,audioRobustness:e.audioRobustness||f.audioRobustness,serverCertificate:e.serverCertificate||f.serverCertificate,serverCertificateUri:e.serverCertificateUri||f.serverCertificateUri,initData:a,keyIds:d});break}else tb(e)?c.push(e):tb(f)&&c.push(f);return c}function vb(a){return a==="org.w3.clearkey"}function wb(a){return a?!!a.match(/^com\.widevine\.alpha/):!1}
function xb(a){return a?!!a.match(/^com\.(microsoft|chromecast)\.playready/):!1}function zb(a){return a?!!a.match(/^com\.apple\.fps/):!1}function Ab(a,b,c,d){d=[...(new Set(d))].sort().join("#");return`${a}#${b}#${c}#${d}`}var Bb=new Ea(()=>mb(new Uint8Array([0]))),Cb=new Map;var F=class{constructor(a,b,c,...d){this.severity=a;this.category=b;this.code=c;this.data=d;this.handled=!1;this.message="Shaka Error "+this.code;if(Db)try{throw Error(this.message||"Shaka Error");}catch(e){this.stack=e.stack}}toString(){return"shaka.util.Error "+JSON.stringify(this,null,"  ")}};v("shaka.util.Error",F);var Db=!0;F.Severity={RECOVERABLE:1,CRITICAL:2};F.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9,ADS:10};
F.Code={UNSUPPORTED_SCHEME:1E3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,REQUEST_FILTER_ERROR:1006,RESPONSE_FILTER_ERROR:1007,MALFORMED_TEST_URI:1008,UNEXPECTED_TEST_REQUEST:1009,ATTEMPTS_EXHAUSTED:1010,SEGMENT_MISSING:1011,INVALID_TEXT_HEADER:2E3,INVALID_TEXT_CUE:2001,UNABLE_TO_DETECT_ENCODING:2003,BAD_ENCODING:2004,INVALID_XML:2005,INVALID_MP4_TTML:2007,INVALID_MP4_VTT:2008,UNABLE_TO_EXTRACT_CUE_START_TIME:2009,INVALID_MP4_CEA:2010,TEXT_COULD_NOT_GUESS_MIME_TYPE:2011,
CANNOT_ADD_EXTERNAL_TEXT_TO_SRC_EQUALS:2012,TEXT_ONLY_WEBVTT_SRC_EQUALS:2013,MISSING_TEXT_PLUGIN:2014,UNSUPPORTED_EXTERNAL_THUMBNAILS_URI:2017,BUFFER_READ_OUT_OF_BOUNDS:3E3,JS_INTEGER_OVERFLOW:3001,EBML_OVERFLOW:3002,EBML_BAD_FLOATING_POINT_SIZE:3003,MP4_SIDX_WRONG_BOX_TYPE:3004,MP4_SIDX_INVALID_TIMESCALE:3005,MP4_SIDX_TYPE_NOT_SUPPORTED:3006,WEBM_CUES_ELEMENT_MISSING:3007,WEBM_EBML_HEADER_ELEMENT_MISSING:3008,WEBM_SEGMENT_ELEMENT_MISSING:3009,WEBM_INFO_ELEMENT_MISSING:3010,WEBM_DURATION_ELEMENT_MISSING:3011,
WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING:3012,WEBM_CUE_TIME_ELEMENT_MISSING:3013,MEDIA_SOURCE_OPERATION_FAILED:3014,MEDIA_SOURCE_OPERATION_THREW:3015,VIDEO_ERROR:3016,QUOTA_EXCEEDED_ERROR:3017,TRANSMUXING_FAILED:3018,CONTENT_TRANSFORMATION_FAILED:3019,MSS_MISSING_DATA_FOR_TRANSMUXING:3020,MSS_TRANSMUXING_FAILED:3022,TRANSMUXING_NO_VIDEO_DATA:3023,STREAMING_NOT_ALLOWED:3024,UNABLE_TO_GUESS_MANIFEST_TYPE:4E3,DASH_INVALID_XML:4001,DASH_NO_SEGMENT_INFO:4002,DASH_EMPTY_ADAPTATION_SET:4003,DASH_EMPTY_PERIOD:4004,
DASH_WEBM_MISSING_INIT:4005,DASH_UNSUPPORTED_CONTAINER:4006,DASH_PSSH_BAD_ENCODING:4007,DASH_NO_COMMON_KEY_SYSTEM:4008,DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED:4009,DASH_CONFLICTING_KEY_IDS:4010,RESTRICTIONS_CANNOT_BE_MET:4012,HLS_PLAYLIST_HEADER_MISSING:4015,INVALID_HLS_TAG:4016,HLS_INVALID_PLAYLIST_HIERARCHY:4017,DASH_DUPLICATE_REPRESENTATION_ID:4018,HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND:4020,HLS_REQUIRED_ATTRIBUTE_MISSING:4023,HLS_REQUIRED_TAG_MISSING:4024,HLS_COULD_NOT_GUESS_CODECS:4025,HLS_KEYFORMATS_NOT_SUPPORTED:4026,
DASH_UNSUPPORTED_XLINK_ACTUATE:4027,DASH_XLINK_DEPTH_LIMIT:4028,CONTENT_UNSUPPORTED_BY_BROWSER:4032,CANNOT_ADD_EXTERNAL_TEXT_TO_LIVE_STREAM:4033,NO_VARIANTS:4036,PERIOD_FLATTENING_FAILED:4037,INCONSISTENT_DRM_ACROSS_PERIODS:4038,HLS_VARIABLE_NOT_FOUND:4039,HLS_MSE_ENCRYPTED_MP2T_NOT_SUPPORTED:4040,HLS_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED:4041,NO_WEB_CRYPTO_API:4042,CANNOT_ADD_EXTERNAL_THUMBNAILS_TO_LIVE_STREAM:4045,MSS_INVALID_XML:4046,MSS_LIVE_CONTENT_NOT_SUPPORTED:4047,AES_128_INVALID_IV_LENGTH:4048,
AES_128_INVALID_KEY_LENGTH:4049,DASH_CONFLICTING_AES_128:4050,DASH_UNSUPPORTED_AES_128:4051,DASH_INVALID_PATCH:4052,HLS_EMPTY_MEDIA_PLAYLIST:4053,DASH_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED:4054,CANNOT_ADD_EXTERNAL_CHAPTERS_TO_LIVE_STREAM:4055,STREAMING_ENGINE_STARTUP_INVALID_STATE:5006,NO_RECOGNIZED_KEY_SYSTEMS:6E3,REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE:6001,FAILED_TO_CREATE_CDM:6002,FAILED_TO_ATTACH_TO_VIDEO:6003,INVALID_SERVER_CERTIFICATE:6004,FAILED_TO_CREATE_SESSION:6005,FAILED_TO_GENERATE_LICENSE_REQUEST:6006,
LICENSE_REQUEST_FAILED:6007,LICENSE_RESPONSE_REJECTED:6008,ENCRYPTED_CONTENT_WITHOUT_DRM_INFO:6010,NO_LICENSE_SERVER_GIVEN:6012,OFFLINE_SESSION_REMOVED:6013,EXPIRED:6014,SERVER_CERTIFICATE_REQUIRED:6015,INIT_DATA_TRANSFORM_ERROR:6016,SERVER_CERTIFICATE_REQUEST_FAILED:6017,MIN_HDCP_VERSION_NOT_MATCH:6018,ERROR_CHECKING_HDCP_VERSION:6019,MISSING_EME_SUPPORT:6020,LOAD_INTERRUPTED:7E3,OPERATION_ABORTED:7001,NO_VIDEO_ELEMENT:7002,OBJECT_DESTROYED:7003,CONTENT_NOT_LOADED:7004,SRC_EQUALS_PRELOAD_NOT_SUPPORTED:7005,
PRELOAD_DESTROYED:7006,QUEUE_INDEX_OUT_OF_BOUNDS:7007,CAST_API_UNAVAILABLE:8E3,NO_CAST_RECEIVERS:8001,ALREADY_CASTING:8002,UNEXPECTED_CAST_ERROR:8003,CAST_CANCELED_BY_USER:8004,CAST_CONNECTION_TIMED_OUT:8005,CAST_RECEIVER_APP_UNAVAILABLE:8006,STORAGE_NOT_SUPPORTED:9E3,INDEXED_DB_ERROR:9001,DEPRECATED_OPERATION_ABORTED:9002,REQUESTED_ITEM_NOT_FOUND:9003,MALFORMED_OFFLINE_URI:9004,CANNOT_STORE_LIVE_OFFLINE:9005,NO_INIT_DATA_FOR_OFFLINE:9007,LOCAL_PLAYER_INSTANCE_REQUIRED:9008,NEW_KEY_OPERATION_NOT_SUPPORTED:9011,
KEY_NOT_FOUND:9012,MISSING_STORAGE_CELL:9013,STORAGE_LIMIT_REACHED:9014,DOWNLOAD_SIZE_CALLBACK_ERROR:9015,MODIFY_OPERATION_NOT_SUPPORTED:9016,INDEXED_DB_INIT_TIMED_OUT:9017,CS_IMA_SDK_MISSING:1E4,CS_AD_MANAGER_NOT_INITIALIZED:10001,SS_IMA_SDK_MISSING:10002,SS_AD_MANAGER_NOT_INITIALIZED:10003,CURRENT_DAI_REQUEST_NOT_FINISHED:10004,MT_AD_MANAGER_NOT_INITIALIZED:10005,INTERSTITIAL_AD_MANAGER_NOT_INITIALIZED:10006,VAST_INVALID_XML:10007};function Eb(a){if(!a)return"";a=C(a);a[0]==239&&a[1]==187&&a[2]==191&&(a=a.subarray(3));if(window.TextDecoder&&!Fa().T())return a=(new TextDecoder).decode(a),a.includes("\ufffd")&&ia('Decoded string contains an "unknown character" codepoint.  That probably means the UTF8 encoding was incorrect!'),a;let b="";for(let d=0;d<a.length;++d){var c=65533;(a[d]&128)==0?c=a[d]:a.length>=d+2&&(a[d]&224)==192&&(a[d+1]&192)==128?(c=(a[d]&31)<<6|a[d+1]&63,d+=1):a.length>=d+3&&(a[d]&240)==224&&(a[d+1]&192)==128&&
(a[d+2]&192)==128?(c=(a[d]&15)<<12|(a[d+1]&63)<<6|a[d+2]&63,d+=2):a.length>=d+4&&(a[d]&241)==240&&(a[d+1]&192)==128&&(a[d+2]&192)==128&&(a[d+3]&192)==128&&(c=(a[d]&7)<<18|(a[d+1]&63)<<12|(a[d+2]&63)<<6|a[d+3]&63,d+=3);if(c<=65535)b+=String.fromCharCode(c);else{c-=65536;const e=c&1023;b+=String.fromCharCode(55296+(c>>10));b+=String.fromCharCode(56320+e)}}return b}
function Fb(a,b,c){if(!a)return"";if(!c&&a.byteLength%2!=0)throw new F(2,2,2004);c=Math.floor(a.byteLength/2);const d=new Uint16Array(c);a=ob(a);for(let e=0;e<c;e++)d[e]=a.getUint16(e*2,b);return Gb.value()(d)}
function Hb(a){if(!a)return"";const b=C(a);if(b[0]==239&&b[1]==187&&b[2]==191)return Eb(b);if(b[0]==254&&b[1]==255)return Fb(b.subarray(2),!1);if(b[0]==255&&b[1]==254)return Fb(b.subarray(2),!0);const c=d=>b.byteLength<=d||b[d]>=9&&b[d]<=126;if(b[0]==0&&b[2]==0)return Fb(a,!1);if(b[1]==0&&b[3]==0)return Fb(a,!0);if(c(0)&&c(1)&&c(2)&&c(3))return Eb(a);throw new F(2,2,2003);}
function Ib(a){if(window.TextEncoder&&!Fa().T()){var b=new TextEncoder;return mb(b.encode(a))}a=encodeURIComponent(a);a=unescape(a);b=new Uint8Array(a.length);for(let c=0;c<a.length;c++)b[c]=a[c].charCodeAt(0);return mb(b)}function Jb(a,b){const c=new ArrayBuffer(a.length*2),d=new DataView(c);for(let e=0;e<a.length;++e)d.setUint16(e*2,a.charCodeAt(e),b);return c}
function Kb(a){const b={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&apos;":"'","&nbsp;":"\u00a0","&lrm;":"\u200e","&rlm;":"\u200f"},c=/&(?:amp|lt|gt|quot|apos|nbsp|lrm|rlm|#[xX]?[0-9a-fA-F]+);/g,d=RegExp(c.source);return a&&d.test(a)?a.replace(c,e=>e[1]=="#"?(e=e[2]=="x"||e[2]=="X"?parseInt(e.substring(3),16):parseInt(e.substring(2),10),e>=0&&e<=1114111?String.fromCodePoint(e):""):b[e]||"'"):a||""}var Lb=class{};v("shaka.util.StringUtils",Lb);Lb.resetFromCharCode=function(){Gb.g=void 0};
Lb.toUTF16=Jb;Lb.toUTF8=Ib;Lb.fromBytesAutoDetect=Hb;Lb.fromUTF16=Fb;Lb.fromUTF8=Eb;var Gb=new Ea(()=>{const a=b=>{try{const c=new Uint8Array(b);return String.fromCharCode.apply(null,c).length>0}catch(c){return!1}};for(let b=65536;b>0;b/=2)if(a(b))return c=>{let d="";for(let e=0;e<c.length;e+=b)d+=String.fromCharCode.apply(null,c.subarray(e,e+b));return d};return null});function Mb(a){a=C(a);return Uint8Array.prototype.toBase64?a.toBase64({alphabet:"base64",omitPadding:!1}):(a=Gb.value()(a),btoa(a))}function Nb(a,b){b=b==void 0?!0:b;return Uint8Array.prototype.toBase64?C(a).toBase64({alphabet:"base64url",omitPadding:!b}):(a=Mb(a).replace(/\+/g,"-").replace(/\//g,"_"),b?a:a.replace(/[=]*$/,""))}
function Ob(a){if(!("fromBase64"in Uint8Array)){a=window.atob(a.replace(/-/g,"+").replace(/_/g,"/"));const b=new Uint8Array(a.length);for(let c=0;c<a.length;++c)b[c]=a.charCodeAt(c);return b}a=a.replace(/\s+/g,"");return Uint8Array.fromBase64(a,{alphabet:/[-_]/.test(a)?"base64url":"base64"})}function Pb(a){if(!("fromHex"in Uint8Array)){const b=a.length/2,c=new Uint8Array(b);for(let d=0;d<b;d++)c[d]=window.parseInt(a.substr(d*2,2),16);return c}return Uint8Array.fromHex(a)}
function Qb(a){a=C(a);if(!Uint8Array.prototype.toHex){let b="";for(let c of a)c=c.toString(16),c.length==1&&(c="0"+c),b+=c;return b}return a.toHex()}function Rb(...a){return Sb(a,0,a.length)}function Sb(a,b=0,c=a.length){var d=0;for(var e=b;e<c;++e)d+=a[e].byteLength;d=new Uint8Array(d);for(e=0;b<c;++b){const f=a[b];ArrayBuffer.isView(f)&&f.BYTES_PER_ELEMENT===1?d.set(f,e):d.set(C(f),e);e+=f.byteLength}return d}var Ub=class{};v("shaka.util.Uint8ArrayUtils",Ub);Ub.concat=Rb;Ub.toHex=Qb;
Ub.fromHex=Pb;Ub.fromBase64=Ob;Ub.toBase64=Nb;Ub.toStandardBase64=Mb;function Vb(a,b,c=""){if(b.length==0)return a;if(a.length==1&&b.length==1){var d=new Ua(a[0]),e=new Ua(b[0]);d=d.resolve(e);c&&Za(d,c);return[d.toString()]}b=b.map(g=>new Ua(g));const f=[];for(d of a){a=new Ua(d);for(e of b){const g=a.resolve(e);c&&Za(g,c);f.push(g.toString())}}return f}
function Wb(a,b,c,d,e){b={keySystem:a,encryptionScheme:b,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,serverCertificateUri:"",sessionType:"",initData:c||[],keyIds:new Set,mediaTypes:e};d&&(b.keySystemUris=new Set([d]));!c&&zb(a)&&b.initData.push({initDataType:"sinf",initData:new Uint8Array(0),keyId:null});return b}
function Xb(a,b="cenc"){const c=[],d=[],e=[];a.forEach((g,h)=>{let k=h;k.length!=22&&(k=Nb(Pb(h),!1));let l=g;l.length!=22&&(l=Nb(Pb(g),!1));g={kty:"oct",kid:k,k:l};c.push(g);d.push(g.kid);e.push(h)});a=JSON.stringify({keys:c});var f=JSON.stringify({kids:d});f=[{initData:C(Ib(f)),initDataType:"keyids"}];return{keySystem:"org.w3.clearkey",encryptionScheme:b,licenseServerUri:"data:application/json;base64,"+window.btoa(a),distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",
videoRobustness:"",serverCertificate:null,serverCertificateUri:"",sessionType:"",initData:f,keyIds:new Set(e)}}function Yb(a,b){if(b.length==1)return b[0];a=Zb(a,b);if(a!=null)return a;throw new F(2,4,4025,b);}function Zb(a,b){const c=$b.get(a);for(const d of c)for(const e of b)if(d.test(e.trim()))return e.trim();return a==G?"":null}function ac(a,b){const c=[];a=$b.get(a);for(const d of a)for(const e of b)d.test(e.trim())&&c.push(e.trim());return c}
var G="text",bc={qk:"video",ij:"audio",jg:G,Dj:"image",hj:"application"},cc=1/15,$b=(new Map).set("audio",[/^vorbis$/,/^Opus$/,/^opus$/,/^fLaC$/,/^flac$/,/^mp4a/,/^[ae]c-3$/,/^ac-4/,/^dts[cehx]?$/,/^iamf/,/^mhm[12]/,/^ac3$/,/^eac3$/,/^apac$/]).set("video",[/^avc/,/^hev/,/^hvc/,/^vvc/,/^vvi/,/^vp0?[89]/,/^av01/,/^mp2v/,/^dvh/,/^dva/,/^dav/]).set("text",[/^vtt$/,/^wvtt/,/^stpp/]);function dc(a){return a&&typeof LCEVCdec!=="undefined"?a.codecs=="lvc1":!1}function ec(a){a.g&&a.i.classList.add("shaka-hidden")}
var fc=class{constructor(a,b,c,d){this.g=null;this.l=a;this.i=b;this.m=c;this.o=d;this.j=!1;a:{typeof libDPIModule==="undefined"&&ja("Could not find LCEVC Library dependencies on this page");if(typeof LCEVCdec!=="undefined")this.h=LCEVCdec;else if(typeof LcevcDil!=="undefined")this.h=LcevcDil,this.j=!0,Ra("LcevcDil","lcevc_dil.js is deprecated, please use lcevc_dec.js instead");else{ja("Could not find LCEVC Library on this page");a=!1;break a}typeof this.h.SupportObject==="undefined"?(ja("Could not find LCEVC Library on this page"),
a=!1):(this.h.SupportObject.SupportStatus||ja(this.h.SupportObject.SupportError),a=typeof this.h!=="undefined"&&typeof libDPIModule!=="undefined"&&this.i instanceof HTMLCanvasElement&&this.h.SupportObject.SupportStatus)}a&&!this.g&&this.h.SupportObject.webGLSupport(this.i)&&(this.i.classList.remove("shaka-hidden"),this.g=this.j?new this.h.LcevcDil(this.l,this.i,this.m):new this.h.LCEVCdec(this.l,this.i,this.m))}release(){this.g&&(this.g.close(),this.g=null)}};v("shaka.lcevc.Dec",fc);
fc.prototype.release=fc.prototype.release;function hc(a,b){ic.set(a,b)}function jc(){const a={};Fa();if(kc())for(var b of ic.keys())a[b]=!0;b=["application/dash+xml","application/x-mpegurl","application/vnd.apple.mpegurl","audio/x-mpegurl","application/vnd.ms-sstr+xml"];for(const c of b)a[c]=kc()?ic.has(c):lc(c);return a}function mc(a,b){if(b){const c=ic.get(b);if(c)return c}throw new F(2,4,4E3,a,b);}var nc=class{};v("shaka.media.ManifestParser",nc);nc.unregisterParserByMime=function(a){ic.delete(a)};nc.registerParserByMime=hc;
nc.registerParserByExtension=function(){Ra("ManifestParser.registerParserByExtension","Please use an ManifestParser with registerParserByMime function.")};nc.AccessibilityPurpose={rk:"visually impaired",Bj:"hard of hearing",Xj:"spoken subtitles"};var ic=new Map;var oc=class{extract(){}decode(){return[]}clear(){}getStreams(){return[]}};var pc=class{init(){}parse(){return[]}};function qc(a){return rc.get(a)}function sc(a,b){rc.set(a,b)}function tc(a,b){b=a.j.parse(b);for(const c of b)b=C(c.packet),b.length>0&&a.g.extract(b,c.pts);return a.g.decode()}
var vc=class{constructor(a){this.h=new Map;this.i=0;this.j=new pc;if(a=qc(a.toLowerCase()))this.j=a();this.g=new oc;if(a=uc)this.g=a(),this.h.set(this.i,this.g)}init(a,b=!1,c=-1){if(c!=-1&&this.i!=c)if(b=this.h.get(c),this.h.set(this.i,this.g),b)this.g=b;else{if(b=uc)this.g=b();this.h.set(c,this.g)}else b||this.g.clear();this.j.init(a);c!=-1&&(this.i=c)}remove(a=[]){a=new Set(a);for(const b of this.h.keys())if(!a.has(b)){let c=this.h.get(b);c&&c.clear();this.h.delete(b)}}};
v("shaka.media.ClosedCaptionParser",vc);vc.findDecoder=function(){return uc};vc.unregisterDecoder=function(){uc=null};vc.registerDecoder=function(a){uc=a};vc.findParser=qc;vc.unregisterParser=function(a){rc.delete(a)};vc.registerParser=sc;var rc=new Map,uc=null;var yc=class{constructor(){this.id="";this.regionAnchorY=this.regionAnchorX=this.viewportAnchorY=this.viewportAnchorX=0;this.height=this.width=100;this.viewportAnchorUnits=this.widthUnits=this.heightUnits=wc;this.scroll=xc}};v("shaka.text.CueRegion",yc);var wc=1;yc.units={PX:0,PERCENTAGE:wc,LINES:2};var xc="";yc.scrollMode={NONE:xc,UP:"up"};function zc(a){return a?Ac(new Bc(a)):null}function Ac(a){a=Cc(a,Dc);if(a==null)return null;const b=Number(a[2]),c=Number(a[3]);return b>59||c>59?null:(Number(a[6])||0)/1E3+c+b*60+(Number(a[1])||0)*3600}function Ec(a){return a.g==a.h.length?null:(a=Cc(a,/[^ \t\n]*/gm))?a[0]:null}function Cc(a,b){b.lastIndex=a.g;b=b.exec(a.h);b=b==null?null:{position:b.index,length:b[0].length,results:b};if(a.g==a.h.length||b==null||b.position!=a.g)return null;a.g+=b.length;return b.results}
function Fc(a){Cc(a,/[ \t]+/gm)}var Bc=class{constructor(a){this.h=a||"";this.g=0}},Dc=/(?:(\d{1,}):)?(\d{2}):(\d{2})((\.(\d{1,3})))?/g;function Gc(a){const b=new WeakSet,c=d=>{switch(typeof d){case "undefined":case "boolean":case "number":case "string":case "symbol":case "function":return d;default:if(!d||ArrayBuffer.isView(d))return d;if(b.has(d))return null;const e=Array.isArray(d);if(d.constructor!=Object&&!e)return null;b.add(d);const f=e?[]:{};for(const g in d)f[g]=c(d[g]);e&&(f.length=d.length);return f}};return c(a)}function Hc(a){const b={};for(const c in a)b[c]=a[c];return b}
function Ic(a){if(Array.isArray(a)){var b=[];for(var c=0;c<a.length;c++){var d=c.toString(),e=a[c];e!==void 0&&(e=Ic(e))&&b.push(d+":"+e)}a="["+b.join(",")+"]"}else if(typeof a=="function")a="";else if(a instanceof Object){d=Object.keys(a);d.sort();b=[];for(c of d)d=JSON.stringify(c),e=a[c],e!==void 0&&(e=Ic(e))&&b.push(d+":"+e);a="{"+b.join(",")+"}"}else a=JSON.stringify(a);return a}var Jc=class{};v("shaka.util.ObjectUtils",Jc);Jc.alphabeticalKeyOrderStringify=Ic;Jc.shallowCloneObject=Hc;
Jc.cloneObject=Gc;/*
 @license
 tXml
 Copyright 2015 Tobias Nickel
 SPDX-License-Identifier: MIT
*/
function Kc(a,b){a=Hb(a);return Lc(a,b,!1)}function Lc(a,b,c=!1){a=Mc(a,c);if(!b&&a.length)return a[0];const d=b.split(",");return(b=a.find(e=>d.includes(e.tagName)))?b:null}
function Mc(a,b){function c(g,h=!1){const k=[];for(;a[e];)if(a.charCodeAt(e)==60){if(a.charCodeAt(e+1)===47){h=e+2;e=a.indexOf(">",e);h=a.substring(h,e);var l=h.indexOf(g);if(l==-1){var m=g.indexOf(".");m>0&&(l=h.indexOf(g.substring(0,m)))}if(l==-1)throw g=a.substring(0,e).split("\n"),Error("Unexpected close tag\nLine: "+(g.length-1)+"\nColumn: "+(g[g.length-1].length+1)+"\nChar: "+a[e]);e+1&&(e+=1);break}else if(a.charCodeAt(e+1)===33){if(a.charCodeAt(e+2)==45){for(;e!==-1&&(a.charCodeAt(e)!==62||
a.charCodeAt(e-1)!=45||a.charCodeAt(e-2)!=45||e==-1);)e=a.indexOf(">",e+1);e===-1&&(e=a.length)}else if(a.charCodeAt(e+2)===91&&a.charCodeAt(e+8)===91&&a.substr(e+3,5).toLowerCase()==="cdata"){l=a.indexOf("]]\x3e",e);l==-1?(k.push(a.substr(e+9)),e=a.length):(k.push(a.substring(e+9,l)),e=l+3);continue}e++;continue}if(f>512)throw Error("XML is too deeply nested");f++;a:{m=h;e++;var n=d(),p={};for(l=[];a.charCodeAt(e)!==62&&a[e];){var r=a.charCodeAt(e);if(r>64&&r<91||r>96&&r<123){r=d();for(var q=a.charCodeAt(e);q&&
q!==39&&q!==34&&!(q>64&&q<91||q>96&&q<123)&&q!==62;)e++,q=a.charCodeAt(e);var t=e+1;e=a.indexOf(a[e],t);t=(" "+a.slice(t,e)).slice(1);if(q===39||q===34){if(e===-1){m={tagName:n,attributes:p,children:l,parent:null};if(b)for(n=0;n<l.length;n++)typeof l[n]!=="string"&&(l[n].parent=m);l=m;break a}}else t=null,e--;if(r.startsWith("xmlns:")){q=t;var u=r.split(":")[1];Pc.set(q,u);Qc.set(u,q)}n==="tt"&&r==="xml:space"&&t==="preserve"&&(m=!0);p[r]=t}e++}a.charCodeAt(e-1)!==47?(e++,l=c(n,m)):e++;m={tagName:n,
attributes:p,children:l,parent:null};n=l.length;for(p=0;p<n;p++)r=l[p],typeof r!=="string"?b&&(r.parent=m):p==n-1&&r=="\n"&&l.pop();l=m}f--;k.push(l);if(typeof l==="string")break;l.tagName[0]==="?"&&l.children&&(k.push(...l.children),l.children=[])}else l=e,e=a.indexOf("<",e)-1,e===-2&&(e=a.length),l=(" "+a.slice(l,e+1)).slice(1),h?l.length>0&&k.push(l):k.length&&l.length==1&&l[0]=="\n"?k.push(l):l.trim().length>0&&k.push(l),e++;return k}function d(){const g=e;for(;"\r\n\t>/= ".indexOf(a[e])===-1&&
a[e];)e++;return(" "+a.slice(g,e)).slice(1)}let e=0,f=0;return c("")}function Rc(a){return Pc.has(a)?Pc.get(a):""}function Sc(a){return typeof a==="string"}function Tc(a){const b=[];if(!a.children)return[];for(const c of a.children)typeof c!=="string"&&b.push(c);return b}function Uc(a,b){const c=[];if(!a.children)return[];for(const d of a.children)d.tagName===b&&c.push(d);return c}
function Vc(a){if(typeof a==="string")return Kb(a);const b=[];for(const c of a.children)typeof c==="string"&&b.push(c);a=b.join("");return a===""?null:Kb(a)}function Wc(a){for(const b of a.children)if(typeof b!=="string")return null;(a=Vc(a))&&(a=a.trim());return a}function Xc(a,b,c=[]){a.tagName===b&&c.push(a);if(a.children)for(const d of a.children)Xc(d,b,c);return c}function Yc(a,b){a=Uc(a,b);return a.length!=1?null:a[0]}function Zc(a,b,c){a=$c(a,b,c);return a.length!=1?null:a[0]}
function $c(a,b,c){const d=Rc(b);b=[];if(a.children){c=d?`${d}:${c}`:c;for(const e of a.children)e&&e.tagName===c&&b.push(e)}return b}function H(a,b,c,d=null){let e=null;a=a.attributes[b];a==null||a===""&&d!==null||(e=c(a));return e==null?d:e}function ad(a,b,c){b=Rc(b);return a.attributes[`${b}:${c}`]||null}function bd(a,b,c){for(const d of b)if(b=ad(a,d,c))return b;return null}
function cd(a){if(!a)return null;/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(a)&&(a+="Z");a=Date.parse(a);return isNaN(a)?null:a/1E3}function dd(a){if(!a)return null;a=RegExp("^P(?:([0-9]*)Y)?(?:([0-9]*)M)?(?:([0-9]*)D)?(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$","i").exec(a);if(!a)return null;a=31536E3*Number(a[1]||null)+2592E3*Number(a[2]||null)+86400*Number(a[3]||null)+3600*Number(a[4]||null)+60*Number(a[5]||null)+Number(a[6]||null);return isFinite(a)?a:null}
function ed(a){var b=/([0-9]+)-([0-9]+)/.exec(a);if(!b)return null;a=Number(b[1]);if(!isFinite(a))return null;b=Number(b[2]);return isFinite(b)?{start:a,end:b}:null}function fd(a){a=Number(a);return a%1===0?a:null}function gd(a){a=Number(a);return a%1===0&&a>0?a:null}function hd(a){a=Number(a);return a%1===0&&a>=0?a:null}function id(a){a=Number(a);return isNaN(a)?null:a}function ld(a){return a?a.toLowerCase()==="true":!1}
function md(a){let b,c;c=(b=a.match(/^(\d+)\/(\d+)$/))?Number(b[1])/Number(b[2]):Number(a);return isNaN(c)?null:c}
function nd(a){const b=[];a=Kb(a).split(/\/+(?=(?:[^'"]*['"][^'"]*['"])*[^'"]*$)/);for(const c of a)if(a=c.match(/^([\w]+)/)){const d=c.match(/(@id='(.*?)')/),e=c.match(/(@t='(\d+)')/),f=c.match(/(@n='(\d+)')/),g=c.match(/\[(\d+)\]/);b.push({name:a[0],id:d?d[0].match(/'(.*?)'/)[0].replace(/'/gm,""):null,t:e?Number(e[0].match(/'(.*?)'/)[0].replace(/'/gm,"")):null,n:f?Number(f[0].match(/'(.*?)'/)[0].replace(/'/gm,"")):null,position:g?Number(g[1])-1:null,dc:c.split("/@")[1]||null})}else c.startsWith("@")&&
b.length&&(b[b.length-1].dc=c.slice(1));return b}function od(a,b){var c=nd(b.attributes.sel||"");if(c.length){var d=c[c.length-1],e=b.attributes.pos||null;c=d.position;c==null&&(d.t!==null&&(c=pd(a,"t",d.t)),d.n!==null&&(c=pd(a,"n",d.n)));c===null?c=e==="prepend"?0:a.length:e==="prepend"?--c:e==="after"&&++c;e=b.tagName;(d=d.dc)&&a[c]?qd(a[c],e,d,Wc(b)||""):(e!=="remove"&&e!=="replace"||a.splice(c,1),e!=="add"&&e!=="replace"||a.splice(c,0,...b.children))}}
function pd(a,b,c){let d=0;for(const e of a){if(Number(e.attributes[b])===c)return d;d++}return null}function qd(a,b,c,d){if(b==="remove")delete a.attributes[c];else if(b==="add"||b==="replace")a.attributes[c]=d}
function rd(a){var b="";const c=a.tagName.split(":");c.length>0&&(b=c[0],b=Qc.has(b)?Qc.get(b):"");b=document.createElementNS(b,a.tagName);for(const d in a.attributes)b.setAttribute(d,a.attributes[d]);for(const d of a.children){let e;typeof d=="string"?e=new Text(d):e=rd(d);b.appendChild(e)}return b}
function sd(a){if(!a)return null;const b={tagName:a.tagName,attributes:Hc(a.attributes),children:[],parent:null};for(const c of a.children)typeof c==="string"?b.children.push(c):(a=sd(c),a.parent=b,b.children.push(a));return b}var Pc=new Map,Qc=new Map;function td(a,b){a=new ud(a,b,"");a.lineBreak=!0;return a}function vd(a,b){if(a.payload!=b.payload||!(Math.abs(a.startTime-b.startTime)<.001&&Math.abs(a.endTime-b.endTime)<.001))return!1;for(const c in a)if(c!="startTime"&&c!="endTime"&&c!="payload")if(c=="nestedCues"){if(!xa(a.nestedCues,b.nestedCues,vd))return!1}else if(c=="region"||c=="cellResolution")for(const d in a[c]){if(a[c][d]!=b[c][d])return!1}else if(Array.isArray(a[c])){if(!xa(a[c],b[c]))return!1}else if(a[c]!=b[c])return!1;return!0}
function wd(a,b=new Map){var c=a.payload;if(c.includes("<")){b.size===0&&xd(b);var d=c;c=[];var e=-1;for(var f=0;f<d.length;f++)d[f]==="<"?e=f+1:d[f]===">"&&e>0&&(e=d.substr(e,f-e),e.match(yd)&&c.push(e),e=-1);for(var g of c)d=d.replace("<"+g+">",'<div time="'+g+'">'),d+="</div>";c=d;a:{d=c;f=[];e=-1;g="";c=!1;for(let m=0;m<d.length;m++)if(d[m]==="/"){var h=d.indexOf(">",m);if(h===-1){c=d;break a}h=d.substring(m+1,h);if(!h||h!="v"){g+=d[m];continue}c=!0;let n=null;f.length&&(n=f[f.length-1]);if(n){if(n===
h)g+="/"+h+">";else{if(!n.startsWith("v")){g+=d[m];continue}g+="/"+n+">"}m+=h.length+1}else g+=d[m]}else d[m]==="<"?(e=m+1,d[e]!="v"&&(e=-1)):d[m]===">"&&e>0&&(f.push(d.substr(e,m-e)),e=-1),g+=d[m];for(var k of f)d=k.replace(" ",".voice-"),g=g.replace(`<${k}>`,`<${d}>`),g=g.replace(`</${k}>`,`</${d}>`),c||(g+=`</${d}>`);c=g}c=zd(c);a.payload="";k="<span>"+c.replace(/\n/g,"<br />")+"</span>";try{var l=Lc(k,"span")}catch(m){}if(l)if(l=l.children,l.length!=1||l[0].tagName)for(const m of l)Ad(m,a,b);
else a.payload=Kb(c);else a.payload=Kb(c)}else a.payload=Kb(c)}function xd(a){for(const [c,d]of Object.entries(Bd)){var b=new ud(0,0,"");b.color=d;a.set("."+c,b)}for(const [c,d]of Object.entries(Cd))b=new ud(0,0,""),b.backgroundColor=d,a.set("."+c,b)}function zd(a){const b={"< ":""," >":" &gt;"},c=/(< +>|<\s|\s>)/g,d=RegExp(c.source);return a&&d.test(a)?a.replace(c,e=>b[e]||""):a||""}
function Ad(a,b,c){var d=b.clone();d.nestedCues=[];d.payload="";d.rubyTag="";d.line=null;d.region=new yc;d.position=null;d.size=0;d.textAlign=Dd;if(a.tagName){var e=a.tagName.split(/(?=[ .])+/g);for(var f of e){var g=f;g.startsWith(".voice-")&&(e=g.split("-").pop(),g=`v[voice="${e}"]`,c.has(g)||(g=`v[voice=${e}]`));c.has(g)&&(e=d,g=c.get(g))&&(e.backgroundColor=Ed(g.backgroundColor,e.backgroundColor),e.color=Ed(g.color,e.color),e.fontFamily=Ed(g.fontFamily,e.fontFamily),e.fontSize=Ed(g.fontSize,e.fontSize),
e.textShadow=Ed(g.textShadow,e.textShadow),e.fontWeight=g.fontWeight,e.fontStyle=g.fontStyle,e.opacity=g.opacity,e.rubyTag=g.rubyTag,e.textCombineUpright=g.textCombineUpright,e.wrapLine=g.wrapLine);switch(f){case "br":d=td(d.startTime,d.endTime);b.nestedCues.push(d);return;case "b":d.fontWeight=Fd;break;case "i":d.fontStyle=Gd;break;case "u":d.textDecoration.push(Hd);break;case "font":if(e=a.attributes.color)d.color=e;break;case "div":e=a.attributes.time;if(!e)break;if(e=zc(e))d.startTime=e;break;
case "ruby":case "rp":case "rt":d.rubyTag=f}}}f=a.children;if(Sc(a)||f.length==1&&Sc(f[0])){a=Vc(a).split("\n");c=!0;for(const h of a)c||(a=td(d.startTime,d.endTime),b.nestedCues.push(a)),h.length>0&&(a=d.clone(),a.payload=Kb(h),b.nestedCues.push(a)),c=!1}else{b.nestedCues.push(d);for(const h of f)Ad(h,d,c)}}function Ed(a,b){return a&&a.length>0?a:b}
var ud=class{constructor(a,b,c){this.startTime=a;this.endTime=b;this.payload=c;this.region=new yc;this.position=null;this.positionAlign=Id;this.size=0;this.textAlign=Dd;this.direction=Jd;this.writingMode=Kd;this.lineInterpretation=Ld;this.line=null;this.lineHeight="";this.lineAlign=Md;this.displayAlign=Nd;this.fontSize=this.border=this.backgroundImage=this.backgroundColor=this.color="";this.fontWeight=Od;this.fontStyle=Pd;this.linePadding=this.letterSpacing=this.fontFamily="";this.opacity=1;this.textCombineUpright=
"";this.textDecoration=[];this.textStrokeWidth=this.textStrokeColor=this.textShadow="";this.wrapLine=!0;this.id="";this.nestedCues=[];this.lineBreak=this.isContainer=!1;this.rubyTag=null;this.cellResolution={columns:32,rows:15}}clone(){const a=new ud(0,0,"");for(const b in this)a[b]=this[b],Array.isArray(a[b])&&(a[b]=a[b].slice());return a}};v("shaka.text.Cue",ud);ud.parseCuePayload=wd;ud.equal=vd;ud.prototype.clone=ud.prototype.clone;var Id="auto";
ud.positionAlign={LEFT:"line-left",RIGHT:"line-right",CENTER:"center",AUTO:Id};var Dd="center",Qd={LEFT:"left",RIGHT:"right",CENTER:Dd,START:"start",END:"end"};ud.textAlign=Qd;var Nd="after",Rd={BEFORE:"before",CENTER:"center",AFTER:Nd};ud.displayAlign=Rd;var Jd="ltr";ud.direction={HORIZONTAL_LEFT_TO_RIGHT:Jd,HORIZONTAL_RIGHT_TO_LEFT:"rtl"};var Kd="horizontal-tb";ud.writingMode={HORIZONTAL_TOP_TO_BOTTOM:Kd,VERTICAL_LEFT_TO_RIGHT:"vertical-lr",VERTICAL_RIGHT_TO_LEFT:"vertical-rl"};var Ld=0;
ud.lineInterpretation={LINE_NUMBER:Ld,PERCENTAGE:1};var Md="start",Sd={CENTER:"center",START:Md,END:"end"};ud.lineAlign=Sd;var Bd={white:"white",lime:"lime",cyan:"cyan",red:"red",yellow:"yellow",magenta:"magenta",blue:"blue",black:"black"};ud.defaultTextColor=Bd;var Cd={bg_white:"white",bg_lime:"lime",bg_cyan:"cyan",bg_red:"red",bg_yellow:"yellow",bg_magenta:"magenta",bg_blue:"blue",bg_black:"black"};ud.defaultTextBackgroundColor=Cd;var Od=400,Fd=700;ud.fontWeight={NORMAL:Od,BOLD:Fd};
var Pd="normal",Gd="italic",Td={NORMAL:Pd,ITALIC:Gd,OBLIQUE:"oblique"};ud.fontStyle=Td;var Hd="underline";ud.textDecoration={UNDERLINE:Hd,LINE_THROUGH:"lineThrough",OVERLINE:"overline"};var yd=/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{2,3})/g;function Ud(a,b,c){Vd.set(a.toLowerCase().split(";")[0]+"-"+c,{priority:c,ze:b})}function Wd(a,b){const c=a.toLowerCase().split(";")[0];var d=[Xd,Yd,Zd,$d];for(const e of d)if(d=Vd.get(c+"-"+e)){const f=d.ze(),g=f.isSupported(a,b);f.destroy();if(g)return d.ze}return null}var ae=class{destroy(){}};v("shaka.transmuxer.TransmuxerEngine",ae);ae.findTransmuxer=Wd;ae.unregisterTransmuxer=function(a,b){Vd.delete(a.toLowerCase().split(";")[0]+"-"+b)};ae.registerTransmuxer=Ud;ae.prototype.destroy=ae.prototype.destroy;
var Vd=new Map,$d=1,Zd=2,Yd=3,Xd=4;ae.PluginPriority={FALLBACK:$d,PREFERRED_SECONDARY:Zd,PREFERRED:Yd,APPLICATION:Xd};function be(a,b){let c=a;b&&!ce.includes(a)&&(c+='; codecs="'+b+'"');return c}function de(a,b){b&&(a+='; codecs="'+b+'"');return a}function ee(a,b,c){const d=be(a,b);b=de(a,b);Wd(b)?(a=Wd(b))?(a=a(),c=a.convertCodecs(c,b),a.destroy()):c=b:c=a!="video/mp2t"&&c=="audio"?d.replace("video","audio"):d;return c}function fe(a){return a.split(";")[0].split("/")[1]}
function ge(a){var b=he(a);a=b[0].toLowerCase();b=b[1].toLowerCase();switch(!0){case a==="mp4a"&&b==="69":case a==="mp4a"&&b==="6b":case a==="mp4a"&&b==="40.34":return"mp3";case a==="mp4a"&&b==="66":case a==="mp4a"&&b==="67":case a==="mp4a"&&b==="68":case a==="mp4a"&&b==="40.2":case a==="mp4a"&&b==="40.02":case a==="mp4a"&&b==="40.5":case a==="mp4a"&&b==="40.05":case a==="mp4a"&&b==="40.29":case a==="mp4a"&&b==="40.42":return"aac";case a==="mp4a"&&b==="a5":case a==="ac3":case a==="ac-3":return"ac-3";
case a==="mp4a"&&b==="a6":case a==="eac3":case a==="ec-3":return"ec-3";case a==="ac-4":return"ac-4";case a==="mp4a"&&b==="b2":return"dtsx";case a==="mp4a"&&b==="a9":return"dtsc";case a==="vp09":case a==="vp9":return"vp9";case a==="avc1":case a==="avc3":return"avc";case a==="hvc1":case a==="hev1":return"hevc";case a==="vvc1":case a==="vvi1":return"vvc";case a==="dvh1":case a==="dvhe":return b&&b.startsWith("05")?"dovi-p5":"dovi-hevc";case a==="dvav":case a==="dva1":return"dovi-avc";case a==="dav1":return"dovi-av1";
case a==="dvc1":case a==="dvi1":return"dovi-vvc";case a==="lvc1":return"lcevc"}return a}function he(a){a=a.split(".");const b=a[0];a.shift();return[b,a.join(".")]}function ie(a){const b=[];for(const c of a.split(","))a=he(c),b.push(a[0]);return b.sort().join(",")}function ke(a){return a.split(";")[0]}function le(a){a=a.split(/ *; */);a.shift();return(a=a.find(b=>b.startsWith("codecs=")))?a.split("=")[1].replace(/^"|"$/g,""):""}
function me(a){return a==="application/x-mpegurl"||a==="application/vnd.apple.mpegurl"||a==="audio/x-mpegurl"}var ne=class{};v("shaka.util.MimeUtils",ne);ne.getFullTypeWithAllCodecs=de;ne.getFullType=be;(new Map).set("codecs","codecs").set("frameRate","framerate").set("bandwidth","bitrate").set("width","width").set("height","height").set("channelsCount","channels");var ce=["audio/aac","audio/ac3","audio/ec3","audio/mpeg"];function oe(a,b){pe.set(a,b)}function qe(a){return pe.get(a)}function re(a){return pe.has(a)?!0:a=="application/cea-608"||a=="application/cea-708"?!!uc:!1}
async function se(a,b,c,d,e){await Promise.resolve();if(a.i&&a.l)if(c==null||d==null)a.i.parseInit(C(b));else{var f={periodStart:a.A?0:a.u,segmentStart:c,segmentEnd:d,vttOffset:a.F||a.A?c:a.u};b=a.i.parseMedia(C(b),f,e,[]);for(const g of b)a.B(g,e||null,f);e=b.filter(g=>g.startTime>=a.m&&g.startTime<a.o);a.l.append(e);a.g==null&&(a.g=Math.max(c,a.m));a.h=Math.min(d,a.o)}}function te(a,b,c){for(const d of a.j.keys()){let e=a.j.get(d);e=e.filter(f=>f.startTime<b||f.endTime>=c);a.j.set(d,e)}}
function ue(a){let b=Infinity,c=-Infinity;for(const d of a.j.values())for(const e of d)b=Math.min(b,e.startTime),c=Math.max(c,e.endTime);b!==Infinity&&c!==-Infinity&&(a.g=a.g==null?Math.max(b,a.m):Math.min(a.g,Math.max(b,a.m)),a.h=Math.max(a.h,Math.min(c,a.o)))}function ve(a,b,c){a.m=b;a.o=c}function we(a,b,c){a.C=b;if(b=a.j.get(b))b=b.filter(d=>d.endTime<=c),b.length&&a.l.append(b)}function xe(a,b,c){b.startTime+=c;b.endTime+=c;for(const d of b.nestedCues)xe(a,d,c)}
function ye(a,b,c){const d=new Map;for(const e of b){b=e.stream;const f=e.cue;d.has(b)||d.set(b,[]);xe(a,f,c);f.startTime>=a.m&&f.startTime<a.o&&(d.get(b).push(f),b==a.C&&a.l.append([f]))}for(const e of d.keys()){a.j.has(e)||a.j.set(e,[]);for(const f of d.get(e))a.j.get(e).push(f)}ue(a)}
var ze=class{constructor(a){this.i=null;this.l=a;this.A=this.F=!1;this.m=this.u=0;this.o=Infinity;this.h=this.g=null;this.C="";this.B=()=>{};this.j=new Map}destroy(){this.l=this.i=null;this.j.clear();return Promise.resolve()}async remove(a,b,c=!1){await Promise.resolve();if(!(a>=b)){if(c&&(te(this,a,b),this.C===""))return;this.l&&this.l.remove(a,b)&&this.g!=null&&(b<=this.g||a>=this.h||(a<=this.g&&b>=this.h?this.g=this.h=null:a<=this.g&&b<this.h?this.g=b:a>this.g&&b>=this.h&&(this.h=a)),ue(this))}}};
v("shaka.text.TextEngine",ze);ze.prototype.destroy=ze.prototype.destroy;ze.findParser=qe;ze.unregisterParser=function(a){pe.delete(a)};ze.registerParser=oe;var pe=new Map;function Ae(a,b,c){let d=!0,e=null;a.h=()=>{clearTimeout(e);d=!1};e=setTimeout(()=>{d&&b()},c*1E3)}function Be(a,b){Ae(a,()=>{Be(a,b);a.g()},b)}var Ce=class{constructor(a){this.g=a;this.h=null}kb(){this.stop();this.g();return this}ma(a){this.stop();Ae(this,()=>{this.g()},a);return this}Da(a){this.stop();Be(this,a);return this}stop(){this.h?.();this.h=null}};v("shaka.util.Timer",Ce);Ce.prototype.stop=Ce.prototype.stop;Ce.prototype.tickEvery=Ce.prototype.Da;Ce.prototype.tickAfter=Ce.prototype.ma;
Ce.prototype.tickNow=Ce.prototype.kb;function De(a,b){return a.concat(b)}function Ee(){}function Fe(a){return a!=null}function Ge(a,b){return Promise.race([b,new Promise((c,d)=>{(new Ce(d)).ma(a)})])};function He(a,b){a=Ie(a);b=Ie(b);return a.split("-")[0]==b.split("-")[0]}function Je(a,b){a=Ie(a);b=Ie(b);a=a.split("-");b=b.split("-");return a[0]==b[0]&&a.length==1&&b.length==2}function Ke(a,b){a=Ie(a);b=Ie(b);a=a.split("-");b=b.split("-");return a.length==2&&b.length==2&&a[0]==b[0]}function Ie(a){const [b="",c=""]=a.split("-x-"),[d="",e=""]=b.split("-");a=c?`${"x-"}${c}`:"";let f=d.toLowerCase();f=Le.get(f)||f;const g=e.toUpperCase();return`${g?`${f}-${g}`:f}${a?`-${a}`:""}`}
function Me(a,b){a=Ie(a);b=Ie(b);return b==a?4:Je(b,a)?3:Ke(b,a)?2:Je(a,b)?1:0}function Ne(a){const b=a.indexOf("-");a=b>=0?a.substring(0,b):a;a=a.toLowerCase();return a=Le.get(a)||a}function Oe(a){return a.language?Ie(a.language):a.audio&&a.audio.language?Ie(a.audio.language):a.video&&a.video.language?Ie(a.video.language):"und"}
function Pe(a,b){a=Ie(a);const c=new Set;for(const d of b)c.add(Ie(d));for(const d of c)if(d==a)return d;for(const d of c)if(Je(d,a))return d;for(const d of c)if(Ke(d,a))return d;for(const d of c)if(Je(a,d))return d;return null}var Qe=class{};v("shaka.util.LanguageUtils",Qe);Qe.findClosestLocale=Pe;Qe.getLocaleForVariant=Oe;Qe.getLocaleForText=function(a){return Ie(a.language||"und")};Qe.getBase=Ne;Qe.relatedness=Me;Qe.areSiblings=function(a,b){const c=Ne(a),d=Ne(b);return a!=c&&b!=d&&c==d};
Qe.normalize=Ie;Qe.isSiblingOf=Ke;Qe.isParentOf=Je;Qe.areLanguageCompatible=He;Qe.areLocaleCompatible=function(a,b){a=Ie(a);b=Ie(b);return a==b};
var Le=new Map([["aar","aa"],["abk","ab"],["afr","af"],["aka","ak"],["alb","sq"],["amh","am"],["ara","ar"],["arg","an"],["arm","hy"],["asm","as"],["ava","av"],["ave","ae"],["aym","ay"],["aze","az"],["bak","ba"],["bam","bm"],["baq","eu"],["bel","be"],["ben","bn"],["bih","bh"],["bis","bi"],["bod","bo"],["bos","bs"],["bre","br"],["bul","bg"],["bur","my"],["cat","ca"],["ces","cs"],["cha","ch"],["che","ce"],["chi","zh"],["chu","cu"],["chv","cv"],["cor","kw"],["cos","co"],["cre","cr"],["cym","cy"],["cze",
"cs"],["dan","da"],["deu","de"],["div","dv"],["dut","nl"],["dzo","dz"],["ell","el"],["eng","en"],["epo","eo"],["est","et"],["eus","eu"],["ewe","ee"],["fao","fo"],["fas","fa"],["fij","fj"],["fin","fi"],["fra","fr"],["fre","fr"],["fry","fy"],["ful","ff"],["geo","ka"],["ger","de"],["gla","gd"],["gle","ga"],["glg","gl"],["glv","gv"],["gre","el"],["grn","gn"],["guj","gu"],["hat","ht"],["hau","ha"],["heb","he"],["her","hz"],["hin","hi"],["hmo","ho"],["hrv","hr"],["hun","hu"],["hye","hy"],["ibo","ig"],["ice",
"is"],["ido","io"],["iii","ii"],["iku","iu"],["ile","ie"],["ina","ia"],["ind","id"],["ipk","ik"],["isl","is"],["ita","it"],["jav","jv"],["jpn","ja"],["kal","kl"],["kan","kn"],["kas","ks"],["kat","ka"],["kau","kr"],["kaz","kk"],["khm","km"],["kik","ki"],["kin","rw"],["kir","ky"],["kom","kv"],["kon","kg"],["kor","ko"],["kua","kj"],["kur","ku"],["lao","lo"],["lat","la"],["lav","lv"],["lim","li"],["lin","ln"],["lit","lt"],["ltz","lb"],["lub","lu"],["lug","lg"],["mac","mk"],["mah","mh"],["mal","ml"],["mao",
"mi"],["mar","mr"],["may","ms"],["mkd","mk"],["mlg","mg"],["mlt","mt"],["mon","mn"],["mri","mi"],["msa","ms"],["mya","my"],["nau","na"],["nav","nv"],["nbl","nr"],["nde","nd"],["ndo","ng"],["nep","ne"],["nld","nl"],["nno","nn"],["nob","nb"],["nor","no"],["nya","ny"],["oci","oc"],["oji","oj"],["ori","or"],["orm","om"],["oss","os"],["pan","pa"],["per","fa"],["pli","pi"],["pol","pl"],["por","pt"],["pus","ps"],["que","qu"],["roh","rm"],["ron","ro"],["rum","ro"],["run","rn"],["rus","ru"],["sag","sg"],["san",
"sa"],["sin","si"],["slk","sk"],["slo","sk"],["slv","sl"],["sme","se"],["smo","sm"],["sna","sn"],["snd","sd"],["som","so"],["sot","st"],["spa","es"],["sqi","sq"],["srd","sc"],["srp","sr"],["ssw","ss"],["sun","su"],["swa","sw"],["swe","sv"],["tah","ty"],["tam","ta"],["tat","tt"],["tel","te"],["tgk","tg"],["tgl","tl"],["tha","th"],["tib","bo"],["tir","ti"],["ton","to"],["tsn","tn"],["tso","ts"],["tuk","tk"],["tur","tr"],["twi","tw"],["uig","ug"],["ukr","uk"],["urd","ur"],["uzb","uz"],["ven","ve"],["vie",
"vi"],["vol","vo"],["wel","cy"],["wln","wa"],["wol","wo"],["xho","xh"],["yid","yi"],["yor","yo"],["zha","za"],["zho","zh"],["zul","zu"]]);function Re(a,b,c,d,e){if(e.length){var f=a.textStreams;for(const m of e)if(e=f.filter(n=>n.codecs.startsWith(m)||n.mimeType.startsWith(m)?!0:!1),e.length){f=e;break}a.textStreams=f}f=a.variants;if(b.length||c.length)f=Se(f,b,c);if(d.length){b=new ya;for(var g of f)b.push(String(g.video.width||0),g);const m=[];b.forEach((n,p)=>{n=0;let r=[];for(const q of p)p=d.filter(t=>q.decodingInfos[0][t]).length,p>n?(n=p,r=[q]):p==n&&r.push(q);m.push(...r)});f=m}g=new Set;for(var h of f)h.video&&g.add(h.video);
if(g.size){var k={vp8:1,avc:1,"dovi-avc":.95,vp9:.9,vp09:.9,hevc:.85,"dovi-hevc":.8,"dovi-p5":.75,av01:.7,"dovi-av1":.65,vvc:.6};b=Array.from(g).sort((m,n)=>m.bandwidth&&n.bandwidth&&m.bandwidth!=n.bandwidth?m.bandwidth-n.bandwidth:m.width!=n.width?m.width-n.width:m.codecs&&n.codecs?(m=ge(m.codecs),n=ge(n.codecs),(k[m]||1)-(k[n]||1)):0);var l=[];h=new Map;g=m=>{const n=[String(m.width||""),String(m.height||""),String(Math.round(m.frameRate||0)),m.hdr||"",m.fastSwitching];m.dependencyStream&&n.push(m.dependencyStream.baseOriginalId||
"");m.roles&&n.push(m.roles.sort().join("_"));return n.join(";")};for(const m of b){b=g(m);c=h.get(b)||[];if(c.length){e=ge(c[c.length-1].codecs);const n=ge(m.codecs);e==n&&(c.push(m),l.push(m.id))}else c.push(m),l.push(m.id);h.set(b,c)}a.variants=f.filter(m=>(m=m.video)&&!l.includes(m.id)?!1:!0)}else a.variants=f}
function Se(a,b,c){for(const d of b)if(b=a.filter(e=>e.video&&e.video.codecs.startsWith(d)),b.length){a=b;break}for(const d of c)if(c=a.filter(e=>e.audio&&e.audio.codecs.startsWith(d)),c.length){a=c;break}return a}function Te(a,b){var c={width:Infinity,height:Infinity};a.variants=a.variants.filter(d=>Ue(d,b,c))}
function Ue(a,b,c){if(a&&a.video&&a.video.width&&a.video.height){var d=a.video.width;let e=a.video.height;e>d&&([d,e]=[e,d]);(c=!(d>=b.minWidth&&d<=Math.min(b.maxWidth,c.width))||!(e>=b.minHeight&&e<=Math.min(b.maxHeight,c.height)))||(d*=e,c=!(d>=b.minPixels&&d<=b.maxPixels));if(c)return!1}if(d=a&&a.video&&a.video.frameRate)d=a.video.frameRate,d=!(d>=b.minFrameRate&&d<=b.maxFrameRate);!d&&(d=a&&a.audio&&a.audio.channelsCount)&&(d=a.audio.channelsCount,d=!(d>=b.minChannelsCount&&d<=b.maxChannelsCount));
d||(a=a.bandwidth,d=!(a>=b.minBandwidth&&a<=b.maxBandwidth));return d?!1:!0}async function Ve(a,b,c=[],d={}){await We(a,b,b.offlineSessionIds.length>0,c,d);Xe(b);await Ye(b)}async function We(a,b,c,d,e){Fa().ua()&&Ze(b.variants);await $e(b.variants,c,!1,d);let f=null;a&&(a=a.g)&&(f=a.keySystem);b.variants=b.variants.filter(g=>{const h=af(g,f,e);if(!h){const k=[];g.audio&&k.push(bf(g.audio));g.video&&k.push(bf(g.video))}return h})}
function Xe(a){a.textStreams=a.textStreams.filter(b=>{b=be(b.mimeType,b.codecs);return re(b)})}async function Ye(a){const b=[];for(const d of a.imageStreams){let e=d.mimeType;e=="application/mp4"&&d.codecs=="mjpg"&&(e="image/jpg");if(!cf.has(e)){var c=df.get(e);c?(c=await ef(c),cf.set(e,c)):cf.set(e,!1)}cf.get(e)&&b.push(d)}a.imageStreams=b}
function Ze(a){const b=(new Map).set("dvav","avc3").set("dva1","avc1").set("dvhe","hev1").set("dvh1","hvc1").set("dvc1","vvc1").set("dvi1","vvi1"),c=new Set;for(const d of a)d.video&&c.add(d.video);for(const d of c)for(const [e,f]of b)if(d.codecs.includes(e)){d.codecs=d.codecs.replace(e,f);break}}
async function $e(a,b,c,d){if(!a.some(e=>e.decodingInfos.length)){for(const e of d){let f=!1;for(const g of a){const h=ff(g,b,c).filter(k=>{k=k[0];k=k.keySystemConfiguration&&k.keySystemConfiguration.keySystem;return!k||k===e});for(const k of h)await gf(g,k);g.decodingInfos.some(k=>k.supported)&&(f=!0)}if(f)return}for(const e of a){a=ff(e,b,c).filter(f=>{f=f[0];f=f.keySystemConfiguration&&f.keySystemConfiguration.keySystem;return!f||!d.includes(f)});for(const f of a)await gf(e,f)}}}
function af(a,b,c){if(!a.decodingInfos.some(k=>!k.supported||b&&(k=k.keySystemAccess)&&(c[k.keySystem]||k.keySystem)!=b?!1:!0))return!1;var d=Fa(),e=d.m()==="Xbox";d=d.i()==="MOBILE"&&d.h()==="GECKO";const f=a.video,g=f&&f.width||0,h=f&&f.height||0;if(e&&f&&(g>1920||h>1080)&&(f.codecs.includes("avc1.")||f.codecs.includes("avc3."))||(e=f&&f.dependencyStream)&&!dc(e))return!1;a=a.audio;return d&&a&&a.encrypted&&a.codecs.toLowerCase().includes("opus")||a&&a.dependencyStream?!1:!0}
async function gf(a,b){const c=(f,g)=>{if(f){const h=Hc(f);h.supported=f.supported&&g.supported;h.powerEfficient=f.powerEfficient&&g.powerEfficient;h.smooth=f.smooth&&g.smooth;g.keySystemAccess&&!h.keySystemAccess&&(h.keySystemAccess=g.keySystemAccess);return h}return g};let d=null;const e=[];for(const f of b){const g=Ic(f),h=hf;h.has(g)?d=c(d,h.get(g)):e.push(jf(f).then(k=>{let l=null;for(const m of k||[])l=c(l,m);l&&(h.set(g,l),d=c(d,l))}))}await Promise.all(e);d&&a.decodingInfos.push(d)}
function jf(a){let b=[""];a.video&&(b=le(a.video.contentType).split(","));let c=[""];a.audio&&(c=le(a.audio.contentType).split(","));const d=[];for(const e of b)for(const f of c){const g=Gc(a);a.video&&(g.video.contentType=be(ke(g.video.contentType),e));a.audio&&(g.audio.contentType=be(ke(g.audio.contentType),f));d.push(new Promise((h,k)=>{(Fa().i()=="MOBILE"?Ge(5,navigator.mediaCapabilities.decodingInfo(g)):navigator.mediaCapabilities.decodingInfo(g)).then(l=>{h(l)}).catch(k)}))}return Promise.all(d).catch(()=>
{JSON.stringify(a);return null})}
function ff(a,b,c){const d=a.audio,e=a.video;var f=[],g=[];if(e)for(var h of e.fullMimeTypes){var k=le(h);if(k.includes(",")&&!d){var l=k.split(","),m=ke(h);k=Yb("video",l);l=Yb("audio",l);l=kf(l,m);m=ee(m,l,"audio");g.push({contentType:m,channels:2,bitrate:a.bandwidth||1,samplerate:1,spatialRendering:!1})}k=lf(k);k={contentType:ee(ke(h),k,"video"),width:e.width||64,height:e.height||64,bitrate:e.bandwidth||a.bandwidth||1,framerate:e.frameRate||30};if(e.hdr)switch(e.hdr){case "PQ":k.transferFunction="pq";
break;case "HLG":k.transferFunction="hlg"}e.colorGamut&&(k.colorGamut=e.colorGamut);f.push(k)}if(d)for(var n of d.fullMimeTypes)h=ke(n),k=kf(le(n),h),h=ee(h,k,"audio"),g.push({contentType:h,channels:d.channelsCount||2,bitrate:d.bandwidth||a.bandwidth||1,samplerate:d.audioSamplingRate||1,spatialRendering:d.spatialAudio});n=[];f.length==0&&f.push(null);g.length==0&&g.push(null);for(var p of f)for(var r of g)f={type:c?"file":"media-source"},p&&(f.video=p),r&&(f.audio=r),n.push(f);g=(a.video?a.video.drmInfos:
[]).concat(a.audio?a.audio.drmInfos:[]);if(!g.length)return[n];a=[];c=new Map;for(var q of g)c.get(q.keySystem)||c.set(q.keySystem,[]),c.get(q.keySystem).push(q);q=b?"required":"optional";b=b?["persistent-license"]:["temporary"];for(const t of c.keys()){p=c.get(t);g=new Map;for(const u of p)p=`${u.videoRobustness},${u.audioRobustness}`,g.get(p)||g.set(p,[]),g.get(p).push(u);for(const u of g.values()){g=[];for(const x of n){p=Object.assign({},x);r={keySystem:t,initDataType:"cenc",persistentState:q,
distinctiveIdentifier:"optional",sessionTypes:b};for(const y of u){if(y.initData&&y.initData.length){f=new Set;for(const w of y.initData)f.add(w.initDataType);r.initDataType=y.initData[0].initDataType}y.distinctiveIdentifierRequired&&(r.distinctiveIdentifier="required");y.persistentStateRequired&&(r.persistentState="required");y.sessionType&&(r.sessionTypes=[y.sessionType]);d&&(r.audio?(y.encryptionScheme&&(r.audio.encryptionScheme=r.audio.encryptionScheme||y.encryptionScheme),r.audio.robustness=
r.audio.robustness||y.audioRobustness):(r.audio={robustness:y.audioRobustness},y.encryptionScheme&&(r.audio.encryptionScheme=y.encryptionScheme)),r.audio.robustness==""&&delete r.audio.robustness);e&&(r.video?(y.encryptionScheme&&(r.video.encryptionScheme=r.video.encryptionScheme||y.encryptionScheme),r.video.robustness=r.video.robustness||y.videoRobustness):(r.video={robustness:y.videoRobustness},y.encryptionScheme&&(r.video.encryptionScheme=y.encryptionScheme)),r.video.robustness==""&&delete r.video.robustness)}p.keySystemConfiguration=
r;g.push(p)}a.push(g)}}return a}function kf(a,b){const c=Fa();return a.toLowerCase()=="flac"?c.h()!="WEBKIT"?"flac":"fLaC":a.toLowerCase()==="opus"?c.h()!="WEBKIT"?"opus":fe(b)=="mp4"?"Opus":"opus":a.toLowerCase()=="ac-3"&&c.I()?"ec-3":a}function lf(a){if(a.includes("avc1")){const b=a.split(".");if(b.length==3)return a=b.shift()+".",a+=parseInt(b.shift(),10).toString(16),a+=("000"+parseInt(b.shift(),10).toString(16)).slice(-4)}else if(a=="vp9")return"vp09.00.41.08";return a}
function ef(a){return new Promise(b=>{const c=new Image;c.src=a;"decode"in c?c.decode().then(()=>{b(!0)}).catch(()=>{b(!1)}):c.onload=c.onerror=()=>{b(c.height===2)}})}
function mf(a){var b=a.audio;const c=a.video;var d=b?b.mimeType:null,e=c?c.mimeType:null;const f=b?b.codecs:null,g=c?c.codecs:null,h=b?b.groupId:null;var k=[];c&&k.push(c.mimeType);b&&k.push(b.mimeType);k=k[0]||null;var l=[];b&&l.push(b.kind);c&&l.push(c.kind);l=l[0]||null;const m=new Set;if(b)for(const n of b.roles)m.add(n);if(c)for(const n of c.roles)m.add(n);a={id:a.id,active:!1,type:"variant",bandwidth:a.bandwidth,language:a.language,label:null,videoLabel:null,kind:l,width:null,height:null,frameRate:null,
pixelAspectRatio:null,hdr:null,colorGamut:null,videoLayout:null,mimeType:k,audioMimeType:d,videoMimeType:e,codecs:"",audioCodec:f,videoCodec:g,primary:a.primary,roles:Array.from(m),audioRoles:null,videoRoles:null,forced:!1,videoId:null,audioId:null,audioGroupId:h,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,tilesLayout:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:null,originalImageId:null,accessibilityPurpose:null,originalLanguage:null};
if(c){a.videoId=c.id;a.originalVideoId=c.originalId;a.width=c.width||null;a.height=c.height||null;a.frameRate=c.frameRate||null;a.pixelAspectRatio=c.pixelAspectRatio||null;a.videoBandwidth=c.bandwidth||null;a.hdr=c.hdr||null;a.colorGamut=c.colorGamut||null;a.videoLayout=c.videoLayout||null;a.videoRoles=c.roles;a.videoLabel=c.label;if(d=c.dependencyStream)a.width=d.width||a.width,a.height=d.height||a.height,a.videoCodec=d.codecs||a.videoCodec,a.pixelAspectRatio=d.pixelAspectRatio||a.pixelAspectRatio,
a.videoBandwidth&&d.bandwidth&&(a.videoBandwidth+=d.bandwidth);if(g.includes(",")){a.channelsCount=c.channelsCount;a.audioSamplingRate=c.audioSamplingRate;a.spatialAudio=c.spatialAudio;a.originalLanguage=c.originalLanguage;a.audioMimeType=e;e=g.split(",");try{a.videoCodec=Yb("video",e),a.audioCodec=Yb("audio",e)}catch(n){}}}b&&(a.audioId=b.id,a.originalAudioId=b.originalId,a.channelsCount=b.channelsCount,a.audioSamplingRate=b.audioSamplingRate,a.audioBandwidth=b.bandwidth||null,a.spatialAudio=b.spatialAudio,
a.label=b.label,a.audioRoles=b.roles,a.accessibilityPurpose=b.accessibilityPurpose,a.originalLanguage=b.originalLanguage,e=b.dependencyStream)&&(a.audioCodec=e.codecs||a.audioCodec,a.audioBandwidth&&e.bandwidth&&(a.audioBandwidth+=e.bandwidth));c&&!a.videoBandwidth&&(b?a.audioBandwidth&&(a.videoBandwidth=a.bandwidth-a.audioBandwidth):a.videoBandwidth=a.bandwidth);b&&!a.audioBandwidth&&(c?a.videoBandwidth&&(a.audioBandwidth=a.bandwidth-a.videoBandwidth):a.audioBandwidth=a.bandwidth);b=[];a.videoCodec&&
b.push(a.videoCodec);a.audioCodec&&b.push(a.audioCodec);a.codecs=b.join(", ");return a}function nf(a){return{id:a.id,active:!1,type:G,bandwidth:a.bandwidth||0,language:a.language,label:a.label,kind:a.kind||null,mimeType:a.mimeType,codecs:a.codecs||null,primary:a.primary,roles:a.roles,accessibilityPurpose:a.accessibilityPurpose,forced:a.forced,originalTextId:a.originalId,originalLanguage:a.originalLanguage}}
function of(a){let b=a.width||null,c=a.height||null,d=null;a.segmentIndex&&(d=a.segmentIndex.qb());let e=a.tilesLayout;d&&(e=d.tilesLayout||e);e&&b!=null&&(b/=Number(e.split("x")[0]));e&&c!=null&&(c/=Number(e.split("x")[1]));return{id:a.id,type:"image",bandwidth:a.bandwidth||0,width:b,height:c,mimeType:a.mimeType,codecs:a.codecs||null,tilesLayout:e||null,originalImageId:a.originalId}}function pf(a){a.__shaka_id||(a.__shaka_id=qf++);return a.__shaka_id}
function rf(a){const b={id:pf(a),active:a.mode!="disabled",type:G,bandwidth:0,language:Ie(a.language||"und"),label:a.label,kind:a.kind,mimeType:null,codecs:null,primary:!1,roles:[],accessibilityPurpose:null,forced:a.kind=="forced",originalTextId:a.id,originalLanguage:a.language};a.kind=="captions"&&(b.mimeType="unknown");a.kind=="subtitles"&&(b.mimeType="text/vtt");a.kind&&(b.roles=[a.kind]);return b}
function sf(a,b){var c=a?a.language:null;c={id:pf(a||b),active:a?a.enabled:b.selected,type:"variant",bandwidth:0,language:Ie(c||"und"),label:a?a.label:null,videoLabel:null,kind:a?a.kind:null,width:null,height:null,frameRate:null,pixelAspectRatio:null,hdr:null,colorGamut:null,videoLayout:null,mimeType:null,audioMimeType:null,videoMimeType:null,codecs:null,audioCodec:null,videoCodec:null,primary:a?a.kind=="main":!1,roles:[],forced:!1,audioRoles:null,videoRoles:null,videoId:null,audioId:null,audioGroupId:null,
channelsCount:null,audioSamplingRate:null,spatialAudio:!1,tilesLayout:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:b?b.id:null,originalAudioId:a?a.id:null,originalTextId:null,originalImageId:null,accessibilityPurpose:null,originalLanguage:c};a&&a.kind&&(c.roles=[a.kind],c.audioRoles=[a.kind]);a&&a.configuration&&(a.configuration.codec&&(c.audioCodec=a.configuration.codec,c.codecs=c.audioCodec),a.configuration.bitrate&&(c.audioBandwidth=a.configuration.bitrate,c.bandwidth+=c.audioBandwidth),
a.configuration.sampleRate&&(c.audioSamplingRate=a.configuration.sampleRate),a.configuration.numberOfChannels&&(c.channelsCount=a.configuration.numberOfChannels));if(b&&b.configuration&&(b.configuration.codec&&(c.videoCodec=b.configuration.codec,c.codecs=c.codecs?c.codecs+(","+c.videoCodec):c.videoCodec),b.configuration.bitrate&&(c.videoBandwidth=b.configuration.bitrate,c.bandwidth+=c.videoBandwidth),b.configuration.framerate&&(c.frameRate=b.configuration.framerate),b.configuration.width&&(c.width=
b.configuration.width),b.configuration.height&&(c.height=b.configuration.height),b.configuration.colorSpace&&b.configuration.colorSpace.transfer))switch(b.configuration.colorSpace.transfer){case "pq":c.hdr="PQ";break;case "hlg":c.hdr="HLG";break;case "bt709":c.hdr="SDR"}return c}function tf(a){return a.allowedByApplication&&a.allowedByKeySystem&&a.disabledUntilTime==0}function uf(a){return a.filter(b=>tf(b))}
function vf(a,b,c,d){let e=a;const f=a.filter(h=>h.primary);f.length&&(e=f);const g=e.length?e[0].language:"";e=e.filter(h=>h.language==g);if(b){const h=Pe(Ie(b),a.map(k=>k.language));h&&(e=a.filter(k=>Ie(k.language)==h))}e=e.filter(h=>h.forced==d);if(c){if(a=wf(e,c),a.length)return a}else if(a=e.filter(h=>h.roles.length==0),a.length)return a;a=e.map(h=>h.roles).reduce(De,[]);return a.length?wf(e,a[0]):e}function wf(a,b){return a.filter(c=>c.roles.includes(b))}
function xf(a){const b=[];a.audio&&b.push(a.audio);a.video&&b.push(a.video);return b}function yf(a,b){b.length&&(b=b.filter(c=>ge(a.codecs)==ge(c.codecs)).sort((c,d)=>c.bandwidth&&d.bandwidth&&c.bandwidth!=d.bandwidth?c.bandwidth-d.bandwidth:(c.width||0)-(d.width||0)),a.trickModeVideo=b[0],b.length>1&&(b=b.find(c=>a.width==c.width&&a.height==c.height)))&&(a.trickModeVideo=b)}
function bf(a){return a.type=="audio"?"type=audio codecs="+a.codecs+" bandwidth="+a.bandwidth+" channelsCount="+a.channelsCount+" audioSamplingRate="+a.audioSamplingRate:a.type=="video"?"type=video codecs="+a.codecs+" bandwidth="+a.bandwidth+" frameRate="+a.frameRate+" width="+a.width+" height="+a.height:"unexpected stream type"}
function zf(a,b,c){if(c.autoShowText==0)return!1;if(c.autoShowText==1)return!0;const d=Ie(c.preferredTextLanguage);b=Ie(b.language);if(c.autoShowText==2)return He(b,d);if(c.autoShowText==3){if(!a)return!1;a=Ie(a.language);return He(b,d)&&!He(a,b)}ja("Invalid autoShowText setting!");return!1}
function Af(a){const b={id:0,language:"und",disabledUntilTime:0,primary:!1,audio:null,video:null,bandwidth:100,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]};for(const c of a)a={id:0,originalId:null,groupId:null,createSegmentIndex:()=>Promise.resolve(),segmentIndex:null,mimeType:c?ke(c):"",codecs:c?le(c):"",encrypted:!0,drmInfos:[],keyIds:new Set,language:"und",originalLanguage:null,label:null,type:"video",primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,
roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!1,fastSwitching:!1,fullMimeTypes:new Set,isAudioMuxedInVideo:!1,baseOriginalId:null},a.fullMimeTypes.add(be(a.mimeType,a.codecs)),c.startsWith("audio/")?(a.type="audio",b.audio=a):b.video=a;return b}var Bf=class{};v("shaka.util.StreamUtils",Bf);Bf.meetsRestrictions=Ue;
var hf=new Map,qf=0,cf=(new Map).set("image/svg+xml",!0).set("image/png",!0).set("image/jpeg",!0).set("image/jpg",!0),df=(new Map).set("image/webp","data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA").set("image/avif","data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=");function Cf(a,b,c,d,e){if(a.C){const f=a.C.Ag();f&&(c=c.filter(g=>g.bandwidth&&f?g.bandwidth<=f:!0))}b&&(c=c.filter(f=>Ue(f,b,{width:e,height:d})));return c.sort((f,g)=>f.bandwidth-g.bandwidth)}function Df(a){const b=[];for(const c of a){if(!c)continue;(a=c.video)&&a.height&&a.width&&b.push({height:a.height,width:a.width})}return b.sort((c,d)=>c.width-d.width)}
function Ef(a,b=!1){if(!b){if(!a.I){b=a.u;if(!(b.g>=b.i))return;a.I=!0;a.A-=(a.g.switchInterval-a.g.minTimeToSwitch)*1E3}if(Date.now()-a.A<a.g.switchInterval*1E3)return}b=a.chooseVariant();a.getBandwidthEstimate();b&&a.F&&a.F(b,a.g.clearBufferSwitch,a.g.safeMarginSwitch)}
var Gf=class{constructor(){this.F=null;this.G=!1;this.u=new ha;this.j=new Aa;navigator.connection&&navigator.connection.addEventListener&&this.j.D(navigator.connection,"change",()=>{this.g.useNetworkInformation&&navigator.onLine&&(this.u=new ha,this.g&&this.u.configure(this.g.advanced),this.trySuggestStreams())});this.l=[];this.H=1;this.I=!1;this.h=this.o=this.g=this.A=null;this.m=new Ce(()=>{if(this.G&&(this.g.restrictToElementSize||this.g.restrictToScreenSize)){const a=this.chooseVariant();a&&this.F&&
this.F(a,this.g.clearBufferSwitch,this.g.safeMarginSwitch)}});this.B=window;"documentPictureInPicture"in window&&this.j.D(window.documentPictureInPicture,"enter",()=>{this.B=window.documentPictureInPicture.window;this.m&&this.m.kb();this.j.za(this.B,"pagehide",()=>{this.B=window;this.m&&this.m.kb()})});this.C=this.i=null}stop(){this.F=null;this.G=!1;this.l=[];this.H=1;this.o=this.A=null;this.h&&(this.h.disconnect(),this.h=null);this.m&&this.m.stop();this.C=this.i=null}release(){this.stop();this.j.release();
this.m=null}init(a){this.F=a}chooseVariant(a=!1){var b=Infinity,c=Infinity;this.g.restrictToScreenSize&&(c=this.g.ignoreDevicePixelRatio?1:this.B.devicePixelRatio,b=this.B.screen.height*c,c*=this.B.screen.width);if(this.h&&this.g.restrictToElementSize){var d=this.g.ignoreDevicePixelRatio?1:this.B.devicePixelRatio,e=this.o.clientHeight,f=this.o.clientWidth;this.i&&document.pictureInPictureElement&&document.pictureInPictureElement==this.o&&(e=this.i.height,f=this.i.width);b=Math.min(b,e*d);c=Math.min(c,
f*d)}e=this.l.filter(h=>h&&!(h.audio&&h.audio.fastSwitching||h.video&&h.video.fastSwitching));e.length||(e=this.l);d=e;a&&e.length!=this.l.length&&(d=this.l.filter(h=>h&&(h.audio&&h.audio.fastSwitching||h.video&&h.video.fastSwitching?!0:!1)));a=Cf(this,this.g.restrictions,d,Infinity,Infinity);if(b!=Infinity||c!=Infinity){a=Df(a);for(var g of a)if(g.height>=b&&g.width>=c){b=g.height;c=g.width;break}a=Cf(this,this.g.restrictions,d,b,c)}b=this.getBandwidthEstimate();d.length&&!a.length&&(a=Cf(this,null,
d,Infinity,Infinity),a=[a[0]]);g=a[0]||null;for(c=0;c<a.length;c++){d=a[c];f=isNaN(this.H)?1:Math.abs(this.H);e=f*d.bandwidth/this.g.bandwidthDowngradeTarget;let h={bandwidth:Infinity};for(let k=c+1;k<a.length;k++)if(d.bandwidth!=a[k].bandwidth){h=a[k];break}f=f*h.bandwidth/this.g.bandwidthUpgradeTarget;g&&d&&b>=e&&b<=f&&(g.bandwidth!=d.bandwidth||g.bandwidth==d.bandwidth&&g.video&&d.video&&(g.video.width<d.video.width||g.video.height<d.video.height))&&(g=d)}this.A=Date.now();return g}enable(){this.G=
!0;this.l.length&&this.trySuggestStreams()}disable(){this.G=!1}segmentDownloaded(a,b,c,d){let e=a;this.g.removeLatencyFromFirstPacketTime&&d&&d.packetNumber===1&&d.timeToFirstByte&&(e=a-d.timeToFirstByte);e>=this.g.cacheLoadThreshold&&this.u.sample(e,b);c&&this.A!=null&&this.G&&Ef(this)}trySuggestStreams(){this.G&&(this.A=Date.now(),Ef(this,!0))}getBandwidthEstimate(){var a=this.g.defaultBandwidthEstimate;navigator.connection&&navigator.connection.downlink&&this.g.useNetworkInformation&&(a=navigator.connection.downlink*
1E6);if(navigator.connection&&navigator.connection.downlink&&this.g.useNetworkInformation&&this.g.preferNetworkInformationBandwidth)return a;a=this.u.getBandwidthEstimate(a);return this.C?this.C.getBandwidthEstimate(a):a}setVariants(a){if(ta(a,this.l))return!1;this.l=a;return!0}playbackRateChanged(a){this.H=a}setMediaElement(a){this.o=a;this.h&&(this.h.disconnect(),this.h=null);const b=()=>{this.m.ma(Ff)};this.o&&"ResizeObserver"in window&&(this.h=new ResizeObserver(b),this.h.observe(this.o));this.j.D(a,
"enterpictureinpicture",c=>{c.pictureInPictureWindow&&(this.i=c.pictureInPictureWindow,this.j.D(this.i,"resize",b))});this.j.D(a,"leavepictureinpicture",()=>{this.i&&this.j.Ja(this.i,"resize",b);this.i=null})}setCmsdManager(a){this.C=a}configure(a){this.g=a;this.u&&this.g&&this.u.configure(this.g.advanced)}};v("shaka.abr.SimpleAbrManager",Gf);Gf.prototype.configure=Gf.prototype.configure;Gf.prototype.setCmsdManager=Gf.prototype.setCmsdManager;Gf.prototype.setMediaElement=Gf.prototype.setMediaElement;
Gf.prototype.playbackRateChanged=Gf.prototype.playbackRateChanged;Gf.prototype.setVariants=Gf.prototype.setVariants;Gf.prototype.getBandwidthEstimate=Gf.prototype.getBandwidthEstimate;Gf.prototype.trySuggestStreams=Gf.prototype.trySuggestStreams;Gf.prototype.segmentDownloaded=Gf.prototype.segmentDownloaded;Gf.prototype.disable=Gf.prototype.disable;Gf.prototype.enable=Gf.prototype.enable;Gf.prototype.chooseVariant=Gf.prototype.chooseVariant;Gf.prototype.init=Gf.prototype.init;
Gf.prototype.release=Gf.prototype.release;Gf.prototype.stop=Gf.prototype.stop;var Ff=1;function Hf(){return{maxAttempts:2,baseDelay:1E3,backoffFactor:2,fuzzFactor:.5,timeout:3E4,stallTimeout:5E3,connectionTimeout:1E4}}function If(a){a.g=1;a.h=a.j}async function Jf(a){if(a.g>=a.l)if(a.i)If(a);else throw new F(2,7,1010);const b=a.g;a.g++;if(b!=0){var c=a.h*(1+(Math.random()*2-1)*a.o);await new Promise(d=>{(new Ce(d)).ma(c/1E3)});a.h*=a.m}}
var Kf=class{constructor(a,b=!1){const c=Hf();this.l=a.maxAttempts==null?c.maxAttempts:a.maxAttempts;this.j=a.baseDelay==null?c.baseDelay:a.baseDelay;this.o=a.fuzzFactor==null?c.fuzzFactor:a.fuzzFactor;this.m=a.backoffFactor==null?c.backoffFactor:a.backoffFactor;this.g=0;this.h=this.j;if(this.i=b)this.g=1}};var Lf=class{constructor(){let a,b;const c=new Promise((d,e)=>{a=d;b=e});c.resolve=a;c.reject=b;return c}resolve(){}reject(){}};function Mf(a){return new Nf(Promise.reject(a),()=>Promise.resolve())}function Of(){const a=Promise.reject(new F(2,7,7001));a.catch(()=>{});return new Nf(a,()=>Promise.resolve())}function Pf(a){return new Nf(Promise.resolve(a),()=>Promise.resolve())}function Qf(a){return new Nf(a,()=>a.catch(()=>{}))}function Rf(a){return new Nf(Promise.all(a.map(b=>b.promise)),()=>Promise.all(a.map(b=>b.abort())))}
function Sf(a,b,c){try{const d=a(b);if(d&&d.promise&&d.abort)return c.resolve(d.promise),()=>d.abort();c.resolve(d);return()=>Promise.resolve(d).then(()=>{},()=>{})}catch(d){return c.reject(d),()=>Promise.resolve()}}
var Nf=class{constructor(a,b){this.promise=a;this.i=b;this.g=null}get aborted(){return this.g!==null}abort(){this.g||(this.g=this.i());return this.g}finally(a){this.promise.then(()=>a(!0),()=>a(!1));return this}Qa(a,b){const c=new Lf;c.catch(()=>{});const d=new F(2,7,7001);let e=()=>{c.reject(d);return this.abort()};const f=g=>h=>{if(this.g&&g)c.reject(d);else{var k=g?a:b;k?e=Sf(k,h,c):(g?c.resolve:c.reject)(h)}};this.promise.then(f(!0),f(!1));return new Nf(c,()=>e())}};
v("shaka.util.AbortableOperation",Nf);Nf.prototype.chain=Nf.prototype.Qa;Nf.prototype["finally"]=Nf.prototype.finally;Nf.all=Rf;Nf.prototype.abort=Nf.prototype.abort;Nf.notAbortable=Qf;Nf.completed=Pf;Nf.aborted=Of;Nf.failed=Mf;function Tf(a){const b=new L(a.type);for(const c in a)Object.defineProperty(b,c,{value:a[c],writable:!0,enumerable:!0});return b}
var L=class{constructor(a,b){if(b)if(b instanceof Map)for(const c of b.keys())Object.defineProperty(this,c,{value:b.get(c),writable:!0,enumerable:!0});else for(const c in b)Object.defineProperty(this,c,{value:b[c],writable:!0,enumerable:!0});this.defaultPrevented=this.cancelable=this.bubbles=!1;this.timeStamp=window.performance&&window.performance.now?window.performance.now():Date.now();this.type=a;this.isTrusted=!1;this.target=this.currentTarget=null;this.g=!1}preventDefault(){this.cancelable&&(this.defaultPrevented=
!0)}stopImmediatePropagation(){this.g=!0}stopPropagation(){}};v("shaka.util.FakeEvent",L);
var Uf={kj:"abrstatuschanged",lj:"adaptation",mj:"audiotrackchanged",nj:"audiotrackschanged",oj:"boundarycrossed",pj:"buffering",qj:"canupdatestarttime",rj:"complete",sj:"currentitemchanged",tj:"downloadcompleted",uj:"downloadfailed",vj:"downloadheadersreceived",wj:"drmsessionupdate",xj:"emsg",Ej:"itemsinserted",Fj:"itemsremoved",Uj:"prft",Error:"error",yj:"expirationupdated",zj:"firstquartile",Aj:"gapjumped",Gj:"keystatuschanged",Jj:"loaded",Kj:"loading",Mj:"manifestparsed",Nj:"manifestupdated",
Oj:"mediaqualitychanged",Pj:"mediasourcerecovered",Qj:"metadataadded",Metadata:"metadata",Rj:"midpoint",Sj:"nospatialvideoinfo",Tj:"onstatechange",Vj:"ratechange",Yj:"segmentappended",Zj:"sessiondata",$j:"spatialvideoinfo",bk:"stalldetected",ck:"started",dk:"statechanged",ek:"streaming",fk:"textchanged",gk:"texttrackvisibility",hk:"thirdquartile",ik:"timelineregionadded",jk:"timelineregionenter",kk:"timelineregionexit",lk:"trackschanged",pk:"unloading",tk:"variantchanged"};var Vf=class{constructor(){this.Na=new ya;this.Qd=this}addEventListener(a,b){this.Na&&this.Na.push(a,b)}removeEventListener(a,b){this.Na&&this.Na.remove(a,b)}dispatchEvent(a){if(!this.Na)return!0;let b=this.Na.get(a.type)||[];const c=this.Na.get("All");c&&(b=b.concat(c));for(const d of b){a.target=this.Qd;a.currentTarget=this.Qd;try{d.handleEvent?d.handleEvent(a):d.call(this,a)}catch(e){}if(a.g)break}return a.defaultPrevented}release(){this.Na=null}};function Wf(a,b){a.g.push(b.finally(()=>{sa(a.g,b)}))}var Xf=class{constructor(){this.g=[]}destroy(){const a=[];for(const b of this.g)b.promise.catch(()=>{}),a.push(b.abort());this.g=[];return Promise.all(a)}};function Yf(a,b,c,d=!1){c=c||Zf;const e=$f.get(a);(!e||c>=e.priority)&&$f.set(a,{priority:c,ze:b,Fi:d})}function ag(a,b,c=null){return{uris:a,method:"GET",body:null,headers:{},allowCrossSiteCredentials:!1,retryParameters:b,licenseRequestType:null,sessionId:null,drmInfo:null,initData:null,initDataType:null,streamDataCallback:c}}function bg(a,b){for(const c of a.g)b.g.add(c);for(const c of a.h)b.h.add(c)}
function cg(a,b,c,d){let e=Pf(void 0);const f=g=>{e=e.Qa(()=>{c.body&&(c.body=mb(c.body));return g(b,c,d)})};a.C&&f(a.C);for(const g of a.g)f(g);return e.Qa(void 0,g=>{if(g instanceof F&&g.code==7001)throw g;throw new F(2,1,1006,g);})}function dg(a,b,c,d){let e=Pf(void 0);for(const f of a.h)e=e.Qa(()=>{const g=c.response;g.data&&(g.data=mb(g.data));return f(b,g,d)});return e.Qa(()=>c,f=>{let g=2;if(f instanceof F){if(f.code==7001)throw f;g=f.severity}throw new F(g,1,1007,f);})}
function eg(a){if(a){const b=a.segment;a=a.stream;if(b&&a&&a.fastSwitching&&b.xc)return!1}return!0}
function fg(a,b,c,d,e,f,g,h){a.i.forceHTTP&&(c.uris[f]=c.uris[f].replace("https://","http://"));a.i.forceHTTPS&&(c.uris[f]=c.uris[f].replace("http://","https://"));f>0&&a.G&&a.G(b,d,c.uris[f],c.uris[f-1]);var k=new Ua(c.uris[f]),l=k.Rb;let m=!1;l||(l=location.protocol,l=l.slice(0,-1),Va(k,l),c.uris[f]=k.toString());l=l.toLowerCase();const n=(l=$f.get(l))?l.ze:null;if(!n)return Mf(new F(2,1,1E3,k));const p=l.Fi;(k=a.l.get(k.pb))&&(c.headers["common-access-token"]=k);let r=null,q=null,t=!1,u=!1,x;return Qf(Jf(e)).Qa(()=>
{if(a.j)return Of();x=Date.now();let y=0;c.requestStartTime=Date.now();const w=n(c.uris[f],c,b,(B,D,E)=>{r&&r.stop();q&&q.ma(A/1E3);a.o&&b==gg&&(y++,c.packetNumber=y,a.o(B,D,eg(d),c,d),m=!0,h.g=E)},B=>{u=!0;c.timeToFirstByte=Date.now()-c.requestStartTime;a.m&&a.m(B,c,b)},{minBytesForProgressEvents:a.i.minBytesForProgressEvents});if(!p)return w;const z=c.retryParameters.connectionTimeout;z&&(r=new Ce(()=>{t=!0;w.abort()}),r.ma(z/1E3));const A=c.retryParameters.stallTimeout;A&&(q=new Ce(()=>{t=!0;w.abort()}));
return w}).Qa(y=>{r&&r.stop();q&&q.stop();y.timeMs==void 0&&(y.timeMs=Date.now()-x);var w=y.headers["common-access-token"];if(w){const z=new Ua(y.uri);a.l.set(z.pb,w)}w={response:y,ei:m};!u&&a.m&&a.m(y.headers,c,b);a.A&&a.A(c,y);return w},y=>{r&&r.stop();q&&q.stop();if(a.B){var w=null;let z=0;y instanceof F&&(w=y,y.code==1001&&(z=y.data[1]));a.B(c,w,z,t)}if(a.j)return Of();t&&(y=new F(1,1,1003,c.uris[f],b));if(y instanceof F){if(y.code==7001)throw y;if(y.code==1010)throw g;if(y.severity==1){w=(new Map).set("error",
y);w=new L("retry",w);w.cancelable=!0;a.dispatchEvent(w);if(w.defaultPrevented)throw y;f=(f+1)%c.uris.length;return fg(a,b,c,d,e,f,y,h)}}throw y;})}
var jg=class extends Vf{constructor(a,b,c,d,e,f,g){super();this.i=null;this.j=!1;this.u=new Xf;this.g=new Set;this.h=new Set;this.o=a||null;this.m=b||null;this.A=c||null;this.B=d||null;this.C=e||null;this.G=f||null;this.F=g||null;this.l=new Map}configure(a){this.i=a}Ii(a){this.g.add(a)}cj(a){this.g.delete(a)}oh(){this.g.clear()}Ji(a){this.h.add(a)}dj(a){this.h.delete(a)}ph(){this.h.clear()}pg(){this.l.clear()}destroy(){this.j=!0;this.g.clear();this.h.clear();this.l.clear();super.release();return this.u.destroy()}request(a,
b,c){const d=new hg;if(this.j){var e=Promise.reject(new F(2,7,7001));e.catch(()=>{});return new ig(e,()=>Promise.resolve(),d)}b.method=b.method||"GET";b.headers=b.headers||{};b.retryParameters=b.retryParameters?Gc(b.retryParameters):Hf();b.uris=Gc(b.uris);e=cg(this,a,b,c);const f=e.Qa(()=>fg(this,a,b,c,new Kf(b.retryParameters,!1),0,null,d)),g=f.Qa(n=>dg(this,a,n,c)),h=Date.now();let k=0;e.promise.then(()=>{k=Date.now()-h},()=>{});let l=0;f.promise.then(()=>{l=Date.now()},()=>{});const m=g.Qa(n=>
{const p=Date.now()-l,r=n.response;r.timeMs+=k;r.timeMs+=p;n.ei||!this.o||r.fromCache||b.method=="HEAD"||a!=gg||this.o(r.timeMs,r.data.byteLength,eg(c),b,c);this.F&&this.F(a,r,c);return r},n=>{n&&(n.severity=2);throw n;});e=new ig(m.promise,()=>m.abort(),d);Wf(this.u,e);return e}};v("shaka.net.NetworkingEngine",jg);jg.prototype.request=jg.prototype.request;jg.prototype.destroy=jg.prototype.destroy;jg.makeRequest=ag;jg.defaultRetryParameters=function(){return Hf()};
jg.prototype.clearCommonAccessTokenMap=jg.prototype.pg;jg.prototype.clearAllResponseFilters=jg.prototype.ph;jg.prototype.unregisterResponseFilter=jg.prototype.dj;jg.prototype.registerResponseFilter=jg.prototype.Ji;jg.prototype.clearAllRequestFilters=jg.prototype.oh;jg.prototype.unregisterRequestFilter=jg.prototype.cj;jg.prototype.registerRequestFilter=jg.prototype.Ii;jg.unregisterScheme=function(a){$f.delete(a)};jg.registerScheme=Yf;jg.prototype.configure=jg.prototype.configure;
var hg=class{constructor(){this.g=0}};jg.NumBytesRemainingClass=hg;var ig=class extends Nf{constructor(a,b,c){super(a,b);this.h=c}};jg.PendingRequest=ig;var gg=1;jg.RequestType={MANIFEST:0,SEGMENT:gg,LICENSE:2,APP:3,TIMING:4,SERVER_CERTIFICATE:5,KEY:6,ADS:7,CONTENT_STEERING:8,CMCD:9};
jg.AdvancedRequestType={INIT_SEGMENT:0,MEDIA_SEGMENT:1,MEDIA_PLAYLIST:2,MASTER_PLAYLIST:3,MPD:4,MSS:5,MPD_PATCH:6,MEDIATAILOR_SESSION_INFO:7,MEDIATAILOR_TRACKING_INFO:8,MEDIATAILOR_STATIC_RESOURCE:9,MEDIATAILOR_TRACKING_EVENT:10,INTERSTITIAL_ASSET_LIST:11,INTERSTITIAL_AD_URL:12};var Zf=3;jg.PluginPriority={FALLBACK:1,PREFERRED:2,APPLICATION:Zf};var $f=new Map;function kg(a,b){if(a.g){if(b instanceof F&&b.code==7003)throw b;throw new F(2,7,7003,b);}}var lg=class{constructor(a){this.g=!1;this.h=new Lf;this.i=a}destroy(){if(this.g)return this.h;this.g=!0;return this.i().then(()=>{this.h.resolve()},()=>{this.h.resolve()})}};function mg(a,b){const c=[];for(const d of a)c.push(b(d));return c}function ng(a,b){for(const c of a)if(!b(c))return!1;return!0};function og(a){const b=new Map;for(const c of Object.keys(a))b.set(c,a[c]);return b}function pg(a){const b={};a.forEach((c,d)=>{b[d]=c});return b};function qg(){return new F(2,3,3E3)}
var sg=class{constructor(a,b){this.h=ob(a);this.i=b==rg;this.g=0}Ga(){return this.g<this.h.byteLength}Ka(){return this.g}getLength(){return this.h.byteLength}Z(){try{const a=this.h.getUint8(this.g);this.g+=1;return a}catch(a){throw qg();}}Ca(){try{const a=this.h.getUint16(this.g,this.i);this.g+=2;return a}catch(a){throw qg();}}V(){try{const a=this.h.getUint32(this.g,this.i);this.g+=4;return a}catch(a){throw qg();}}Lf(){try{const a=this.h.getInt32(this.g,this.i);this.g+=4;return a}catch(a){throw qg();
}}Xc(){let a,b;try{this.i?(a=this.h.getUint32(this.g,!0),b=this.h.getUint32(this.g+4,!0)):(b=this.h.getUint32(this.g,!1),a=this.h.getUint32(this.g+4,!1))}catch(c){throw qg();}if(b>2097151)throw new F(2,3,3001);this.g+=8;return b*4294967296+a}Bb(a,b){if(this.g+a>this.h.byteLength)throw qg();const c=C(this.h,this.g,a);this.g+=a;return b?new Uint8Array(c):c}skip(a){if(this.g+a>this.h.byteLength)throw qg();this.g+=a}Pg(a){if(this.g<a)throw qg();this.g-=a}seek(a){if(a<0||a>this.h.byteLength)throw qg();
this.g=a}Wc(){for(var a=this.g;this.Ga()&&this.h.getUint8(this.g)!=0;)this.g+=1;a=C(this.h,a,this.g-a);this.g+=1;return Eb(a)}};v("shaka.util.DataViewReader",sg);sg.prototype.readTerminatedString=sg.prototype.Wc;sg.prototype.seek=sg.prototype.seek;sg.prototype.rewind=sg.prototype.Pg;sg.prototype.skip=sg.prototype.skip;sg.prototype.readBytes=sg.prototype.Bb;sg.prototype.readUint64=sg.prototype.Xc;sg.prototype.readInt32=sg.prototype.Lf;sg.prototype.readUint32=sg.prototype.V;
sg.prototype.readUint16=sg.prototype.Ca;sg.prototype.readUint8=sg.prototype.Z;sg.prototype.getLength=sg.prototype.getLength;sg.prototype.getPosition=sg.prototype.Ka;sg.prototype.hasMoreData=sg.prototype.Ga;var rg=1;sg.Endianness={BIG_ENDIAN:0,LITTLE_ENDIAN:rg};function tg(a){let b=0;for(const c of a)b=b<<8|c.charCodeAt(0);return b}function ug(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}function vg(a){const b=wg(a);for(;a.reader.Ga()&&!a.parser.g;)a.parser.Tc(a.start+b,a.reader,a.partialOkay,a.stopOnPartial)}function wg(a){return 8+(a.has64BitSize?8:0)+(a.flags!=null?4:0)}function xg(a){const b=wg(a),c=a.reader.V();for(let d=0;d<c&&(a.parser.Tc(a.start+b,a.reader,a.partialOkay,a.stopOnPartial),!a.parser.g);d++);}
function yg(a){const b=wg(a);for(a.reader.skip(78);a.reader.Ga()&&!a.parser.g;)a.parser.Tc(a.start+b,a.reader,a.partialOkay,a.stopOnPartial)}function zg(a){const b=wg(a);a.reader.skip(8);const c=a.reader.Ca();a.reader.skip(6);c==2?a.reader.skip(48):a.reader.skip(12);for(c==1&&a.reader.skip(16);a.reader.Ga()&&!a.parser.g;)a.parser.Tc(a.start+b,a.reader,a.partialOkay,a.stopOnPartial)}function Ag(a,b){return c=>{a(c.reader.Bb(c.reader.getLength()-c.reader.Ka(),b))}}
var Dg=class{constructor(){this.i=new Map;this.h=new Map;this.g=!1}box(a,b){a=tg(a);this.i.set(a,Bg);this.h.set(a,b);return this}boxes(a,b){for(const c of a)this.box(c,b);return this}ka(a,b){a=tg(a);this.i.set(a,Cg);this.h.set(a,b);return this}stop(){this.g=!0}parse(a,b,c){a=new sg(a,0);for(this.g=!1;a.Ga()&&!this.g;)this.Tc(0,a,b,c)}Tc(a,b,c,d){const e=b.Ka();if(d&&e+8>b.getLength())this.g=!0;else{var f=b.V(),g=b.V(),h=ug(g),k=!1;switch(f){case 0:f=b.getLength()-e;break;case 1:if(d&&b.Ka()+8>b.getLength()){this.g=
!0;return}f=b.Xc();k=!0}var l=this.h.get(g);if(l){let n=null;var m=null;if(this.i.get(g)==Cg){if(d&&b.Ka()+4>b.getLength()){this.g=!0;return}m=b.V();n=m>>>24;m&=16777215}g=e+f;c&&g>b.getLength()&&(g=b.getLength());d&&g>b.getLength()?this.g=!0:(g-=b.Ka(),b=g>0?b.Bb(g,!1):new Uint8Array(0),b=new sg(b,0),l({name:h,parser:this,partialOkay:c||!1,stopOnPartial:d||!1,version:n,flags:m,reader:b,size:f,start:e+a,has64BitSize:k}))}else b.skip(Math.min(e+f-b.Ka(),b.getLength()-b.Ka()))}}};
v("shaka.util.Mp4Parser",Dg);Dg.headerSize=wg;Dg.typeToString=ug;Dg.allData=Ag;Dg.audioSampleEntry=zg;Dg.visualSampleEntry=yg;Dg.sampleDescription=xg;Dg.children=vg;Dg.prototype.parseNext=Dg.prototype.Tc;Dg.prototype.parse=Dg.prototype.parse;Dg.prototype.stop=Dg.prototype.stop;Dg.prototype.fullBox=Dg.prototype.ka;Dg.prototype.boxes=Dg.prototype.boxes;Dg.prototype.box=Dg.prototype.box;var Bg=0,Cg=1;function Eg(a,b,c,d){const e=a.length;let f=12+b.length+4+e;d>0&&(f+=4+16*c.size);const g=new Uint8Array(f),h=ob(g);let k=0;h.setUint32(k,f);k+=4;h.setUint32(k,1886614376);k+=4;d<1?h.setUint32(k,0):h.setUint32(k,16777216);k+=4;g.set(b,k);k+=b.length;if(d>0){h.setUint32(k,c.size);k+=4;for(const l of c)b=Pb(l),g.set(b,k),k+=b.length}h.setUint32(k,e);g.set(a,k+4);return g}
var Fg=class{constructor(a){this.g=[];this.data=[];(new Dg).boxes(["moov","moof"],vg).ka("pssh",b=>{if(!(b.version>1)){var c=C(b.reader.h,-12,b.size);this.data.push(c);b=b.reader.Bb(16,!1);this.g.push(Qb(b))}}).parse(a)}};function Gg(a,b){a=og(a);if(a.size!=0){a=Xb(a);for(const c of b)c.video&&(c.video.drmInfos=[a]),c.audio&&(c.audio.drmInfos=[a])}}function Hg(a,b){const c=[];b.forEach((d,e)=>{c.push({keySystem:e,licenseServerUri:d,distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,serverCertificateUri:"",initData:[],keyIds:new Set})});for(const d of a)d.video&&(d.video.drmInfos=c),d.audio&&(d.audio.drmInfos=c)}
function Ig(a,b,c,d){const e=a.keySystem;if(e&&(!vb(e)||!a.licenseServerUri)){b.size&&b.get(e)&&(b=b.get(e),a.licenseServerUri=b);a.keyIds||(a.keyIds=new Set);if(c=c.get(e))a.distinctiveIdentifierRequired||(a.distinctiveIdentifierRequired=c.distinctiveIdentifierRequired),a.persistentStateRequired||(a.persistentStateRequired=c.persistentStateRequired),a.serverCertificate||(a.serverCertificate=c.serverCertificate),c.sessionType&&(a.sessionType=c.sessionType),a.serverCertificateUri||(a.serverCertificateUri=
c.serverCertificateUri);d[e]&&(a.keySystem=d[e]);window.cast&&window.cast.__platform__&&e=="com.microsoft.playready"&&(a.keySystem="com.chromecast.playready")}}
async function Jg(){var a="org.w3.clearkey com.widevine.alpha com.widevine.alpha.experiment com.microsoft.playready com.microsoft.playready.hardware com.microsoft.playready.recommendation com.microsoft.playready.recommendation.3000 com.microsoft.playready.recommendation.3000.clearlead com.chromecast.playready com.apple.fps.1_0 com.apple.fps com.huawei.wiseplay".split(" ");if(!(window.MediaKeys&&window.navigator&&window.navigator.requestMediaKeySystemAccess&&window.MediaKeySystemAccess&&window.MediaKeySystemAccess.prototype.getConfiguration)){var b=
{};for(var c of a)b[c]=null;return b}const d="1.0 1.1 1.2 1.3 1.4 2.0 2.1 2.2 2.3".split(" ");c=["SW_SECURE_CRYPTO","SW_SECURE_DECODE","HW_SECURE_CRYPTO","HW_SECURE_DECODE","HW_SECURE_ALL"];c={"com.widevine.alpha":c,"com.widevine.alpha.experiment":c,"com.microsoft.playready.recommendation":["150","2000","3000"]};const e={videoCapabilities:[{contentType:'video/mp4; codecs="avc1.42E01E"'},{contentType:'video/webm; codecs="vp8"'}],audioCapabilities:[{contentType:'audio/mp4; codecs="mp4a.40.2"'},{contentType:'audio/webm; codecs="opus"'}],
initDataTypes:["cenc","sinf","skd","keyids"]},f=[null,"cenc","cbcs"],g=new Map,h=Fa(),k=async(n,p,r)=>{let q;try{q=await p.createMediaKeys()}catch(x){return}var t=p.getConfiguration().sessionTypes,u=t?t.includes("persistent-license"):!1;h.ea()&&(u=!1);t=p.getConfiguration().videoCapabilities;p=p.getConfiguration().audioCapabilities;u={persistentState:u,encryptionSchemes:[],videoRobustnessLevels:[],audioRobustnessLevels:[],minHdcpVersions:[]};g.get(n)?u=g.get(n):g.set(n,u);(n=t[0].encryptionScheme)&&
!u.encryptionSchemes.includes(n)&&u.encryptionSchemes.push(n);(n=t[0].robustness)&&!u.videoRobustnessLevels.includes(n)&&u.videoRobustnessLevels.push(n);(n=p[0].robustness)&&!u.audioRobustnessLevels.includes(n)&&u.audioRobustnessLevels.push(n);if(r&&"getStatusForPolicy"in q)for(const x of d)if(!u.minHdcpVersions.includes(x))if(await q.getStatusForPolicy({minHdcpVersion:x})=="usable")u.minHdcpVersions.includes(x)||u.minHdcpVersions.push(x);else break},l=async(n,p,r,q,t=!1)=>{try{const u=Gc(e);for(const w of u.videoCapabilities)w.encryptionScheme=
p,w.robustness=r;for(const w of u.audioCapabilities)w.encryptionScheme=p,w.robustness=q;const x=Gc(u);x.persistentState="required";x.sessionTypes=["persistent-license"];p=[x,u];let y;y=Fa().i()=="MOBILE"?await Ge(5,navigator.requestMediaKeySystemAccess(n,p)):await navigator.requestMediaKeySystemAccess(n,p);await k(n,y,t)}catch(u){}},m=[];for(b of a){g.set(b,null);if(Fa().h()==="WEBKIT"&&vb(b))continue;a=!0;for(const n of f)m.push(l(b,n,"","",a)),a=!1;for(const n of c[b]||[])m.push(l(b,null,n,"")),
m.push(l(b,null,"",n))}await Promise.all(m);return pg(g)}
function Kg(a,b,c,d,e,f,g,h){var k=[];for(const m of a){b.includes(m.encryptionScheme)||b.push(m.encryptionScheme);vb(m.keySystem)&&m.licenseServerUri.startsWith("data:application/json;base64,")?k.includes(m.licenseServerUri)||k.push(m.licenseServerUri):c.includes(m.licenseServerUri)||c.push(m.licenseServerUri);e.includes(m.serverCertificateUri)||e.push(m.serverCertificateUri);m.serverCertificate&&(d.some(n=>kb(n,m.serverCertificate))||d.push(m.serverCertificate));if(m.initData)for(const n of m.initData)f.some(p=>
p.keyId&&p.keyId==n.keyId?!0:p.initDataType==n.initDataType&&kb(p.initData,n.initData))||f.push(n);if(m.keyIds)for(const n of m.keyIds)g.add(n);if(m.keySystemUris&&h)for(const n of m.keySystemUris)h.add(n)}if(k.length==1)c.push(k[0]);else if(k.length>0){a=[];for(var l of k)k=window.atob(l.split("data:application/json;base64,").pop()),k=JSON.parse(k),a.push(...k.keys);l=JSON.stringify({keys:a});c.push("data:application/json;base64,"+window.btoa(l))}}
function Lg(a){var b=a.Y;const c=a.ea;c.clear();b.forEach((d,e)=>c.set(e,d));b=Array.from(c.values());b.length&&b.every(d=>d=="expired")&&a.u(new F(2,6,6014));a.C.ye(pg(c))}function Mg(a){a.i.forEach((b,c)=>{const d=b.Hf;let e=c.expiration;isNaN(e)&&(e=Infinity);e!=d&&(a.C.onExpirationUpdated(c.sessionId,e),b.Hf=e)})}
async function Ng(a){a.o.release();a.o=null;a.l.reject();a.F.stop();a.F=null;a.K.stop();a.K=null;await Og(a);if(a.j){try{await a.j.setMediaKeys(null)}catch(b){ja("DrmEngine.destroyNow_ exception",b)}a.j=null}a.g=null;a.A=null;a.B=new Map;a.h=null;a.u=()=>{};a.C=null;a.N=!1;a.H=null}
async function Og(a){const b=Array.from(a.i.entries());a.i.clear();await Promise.all(b.map(async([c,d])=>{try{a.W||a.B.has(c.sessionId)||d.type!=="persistent-license"||a.h.persistentSessionOnlinePlayback?await Pg(c):await c.remove()}catch(e){}}))}
async function Qg(a,b,c){Gg(a.h.clearKeys,b);const d=b.some(k=>k.video&&k.video.drmInfos.length||k.audio&&k.audio.drmInfos.length?!0:!1),e=og(a.h.servers),f=og(a.h.advanced||{});!d&&c&&Hg(b,e);c=new WeakSet;for(var g of b){const k=(g.video?g.video.drmInfos:[]).concat(g.audio?g.audio.drmInfos:[]);for(var h of k)c.has(h)||(c.add(h),Ig(h,e,f,a.h.keySystemsMapping))}g=(k,l)=>{const m=[];for(const n of k)if(k=n[l]||f.has(n.keySystem)&&f.get(n.keySystem)[l]||"",k==""&&wb(n.keySystem)&&(l=="audioRobustness"?
k=[a.h.defaultAudioRobustnessForWidevine]:l=="videoRobustness"&&(k=[a.h.defaultVideoRobustnessForWidevine])),typeof k==="string")m.push(n);else if(Array.isArray(k)){k.length===0&&(k=[""]);for(const p of k)m.push(Object.assign({},n,{[l]:p}))}return m};h=new WeakSet;for(const k of b)k.video&&!h.has(k.video)&&(k.video.drmInfos=g(k.video.drmInfos,"videoRobustness"),k.video.drmInfos=g(k.video.drmInfos,"audioRobustness"),h.add(k.video)),k.audio&&!h.has(k.audio)&&(k.audio.drmInfos=g(k.audio.drmInfos,"videoRobustness"),
k.audio.drmInfos=g(k.audio.drmInfos,"audioRobustness"),h.add(k.audio));await $e(b,a.O,a.N,a.h.preferredKeySystems);kg(a.m);if(!(d||e.size>0))return a.R=!0,Promise.resolve();b=Rg(a,b);return d?b:b.catch(()=>{})}function Sg(a,b,c){a.W=!0;a.B=new Map;a.O=c;return Qg(a,b,!1)}
function Tg(a,b,c,d=!0){a.B=new Map;for(const e of c)a.B.set(e,{initData:null,initDataType:null});for(const e of a.h.persistentSessionsMetadata)a.B.set(e.sessionId,{initData:e.initData,initDataType:e.initDataType});a.O=a.B.size>0;return Qg(a,b,d)}
async function Rg(a,b){const c=new Map;b=Ug(a,b,c);if(!b){if(!navigator.requestMediaKeySystemAccess)throw new F(2,6,6020);throw new F(2,6,6001);}kg(a.m);try{b.getConfiguration();const d=a.h.keySystemsMapping[b.keySystem]||b.keySystem;a.g=Vg(a,d,c.get(d));if(!a.g.licenseServerUri)throw new F(2,6,6012,a.g.keySystem);const e=await b.createMediaKeys();kg(a.m);a.A=e;if(a.h.minHdcpVersion!=""&&"getStatusForPolicy"in a.A)try{if(await a.A.getStatusForPolicy({minHdcpVersion:a.h.minHdcpVersion})!="usable")throw new F(2,
6,6018);kg(a.m)}catch(f){if(f instanceof F)throw f;throw new F(2,6,6019,f.message);}a.R=!0;a.F.Da(a.h.updateExpirationTime);await Wg(a);kg(a.m)}catch(d){kg(a.m,d);a.g=null;if(d instanceof F)throw d;throw new F(2,6,6002,d.message);}}
async function Xg(a,b,c,d,e,f){var g=[];f.length&&g.push(f[0].contentType);e.length&&g.push(e[0].contentType);const h=k=>{k=Wb(b,k,null);k.licenseServerUri=c;k.serverCertificate=d;k.persistentStateRequired=!0;k.sessionType="persistent-license";return k};g=Af(g);g.video&&(f=h(f[0].encryptionScheme||""),g.video.drmInfos.push(f));g.audio&&(e=h(e[0].encryptionScheme||""),g.audio.drmInfos.push(e));await $e([g],!0,a.N,[]);kg(a.m);return Rg(a,[g])}
async function Yg(a){if(!a.j.mediaKeys){if(a.H)await a.H;else try{a.H=a.j.setMediaKeys(a.A),await a.H}catch(b){a.u(new F(2,6,6003,b.message))}kg(a.m)}}
function Zg(a,b,c){if(c.length){try{c=a.h.initDataTransform(c,b,a.g)}catch(d){b=d;d instanceof F||(b=new F(2,6,6016,d));a.u(b);return}if(a.h.ignoreDuplicateInitData){const d=a.i.values();for(const f of d)if(kb(c,f.initData))return;let e=!1;a.B.forEach(f=>{!e&&kb(c,f.initData)&&(e=!0)});if(e)return}a.J=!0;a.i.size>0&&$g(a)&&(a.l.resolve(),a.J=!1,a.l=new Lf,a.l.catch(()=>{}));ah(a,b,c,a.g.sessionType)}}async function bh(a,b){await Yg(a);Zg(a,b.initDataType,C(b.initData))}
async function ch(a){if(a.B.size){a.B.forEach((c,d)=>{dh(a,d,c)});await a.l;if((a.g&&a.g.keyIds||new Set([])).size>0&&eh(a))return a.l;a.J=!1;a.l=new Lf;a.l.catch(()=>{})}const b=(a.g?a.g.initData:[])||[];for(const c of b)Zg(a,c.initDataType,c.initData);$g(a)&&a.l.resolve();return a.l}
async function Wg(a){if(a.A&&a.g){if(a.g.serverCertificateUri&&(!a.g.serverCertificate||!a.g.serverCertificate.length)){const b=ag([a.g.serverCertificateUri],a.h.retryParameters);try{const c=await a.C.Yb.request(5,b,{isPreload:a.S()}).promise;a.g.serverCertificate=C(c.data)}catch(c){throw new F(2,6,6017,c);}if(a.m.g)return}if(a.g.serverCertificate&&a.g.serverCertificate.length)try{await a.A.setServerCertificate(a.g.serverCertificate)}catch(b){throw new F(2,6,6004,b.message);}}}
async function dh(a,b,c){let d;try{d=a.A.createSession("persistent-license")}catch(e){return b=new F(2,6,6005,e.message),a.u(b),Promise.reject(b)}a.o.D(d,"message",e=>{fh(a)?a.M.push(e):gh(a,e)});a.o.D(d,"keystatuseschange",e=>hh(a,e));c={initData:c.initData,initDataType:c.initDataType,loaded:!1,Hf:Infinity,wb:null,type:"persistent-license"};a.i.set(d,c);try{const e=await d.load(b);kg(a.m);e||(a.i.delete(d),a.u(new F(a.h.persistentSessionOnlinePlayback?1:2,6,6013)),c.loaded=!0);ih(a,c);jh(a);return d}catch(e){kg(a.m,
e),a.i.delete(d),a.u(new F(a.h.persistentSessionOnlinePlayback?1:2,6,6005,e.message)),c.loaded=!0,jh(a)}return Promise.resolve()}async function kh(a,b){if(b=await dh(a,b,{initData:null,initDataType:null})){var c=[],d=a.i.get(b);d&&(d.wb=new Lf,c.push(d.wb));c.push(b.remove());await Promise.all(c);a.i.delete(b)}}function eh(a){const b=a.g&&a.g.keyIds||new Set([]);for(const c of b)if(a.Y.get(c)!=="usable")return!1;return!0}function $g(a){a=a.i.values();return ng(a,b=>b.loaded)}
function Vg(a,b,c){const d=[],e=[],f=[],g=[],h=[],k=new Set,l=new Set;Kg(c,d,e,g,f,h,k,l);a=a.O?"persistent-license":"temporary";b={keySystem:b,encryptionScheme:d[0],licenseServerUri:e[0],distinctiveIdentifierRequired:c[0].distinctiveIdentifierRequired,persistentStateRequired:c[0].persistentStateRequired,sessionType:c[0].sessionType||a,audioRobustness:c[0].audioRobustness||"",videoRobustness:c[0].videoRobustness||"",serverCertificate:g[0],serverCertificateUri:f[0],initData:h,keyIds:k,mediaTypes:c[0].mediaTypes};
l.size>0&&(b.keySystemUris=l);for(const m of c)m.distinctiveIdentifierRequired&&(b.distinctiveIdentifierRequired=m.distinctiveIdentifierRequired),m.persistentStateRequired&&(b.persistentStateRequired=m.persistentStateRequired);return b}
function ah(a,b,c,d){let e;try{e=a.A.createSession(d)}catch(f){a.u(new F(2,6,6005,f.message));return}a.o.D(e,"message",f=>{fh(a)?a.M.push(f):gh(a,f)});a.o.D(e,"keystatuseschange",f=>hh(a,f));a.i.set(e,{initData:c,initDataType:b,loaded:!1,Hf:Infinity,wb:null,type:d});a.h.logLicenseExchange&&Nb(c);e.generateRequest(b,c).catch(f=>{if(!a.m.g){a.i.delete(e);var g=f.errorCode;if(g&&g.systemCode){var h=g.systemCode;h<0&&(h+=4294967296);h="0x"+h.toString(16)}a.u(new F(2,6,6006,f.message,f,h))}})}
function lh(a){a=a.i.keys();a=mg(a,b=>b.sessionId);return Array.from(a)}function mh(a){return a.I?a.I:NaN}
function Ug(a,b,c){for(var d of b){var e=(d.video?d.video.drmInfos:[]).concat(d.audio?d.audio.drmInfos:[]);for(const g of e)c.has(g.keySystem)||c.set(g.keySystem,[]),c.get(g.keySystem).push(g)}if(c.size==1&&c.has(""))throw new F(2,6,6E3);d=a.h.preferredKeySystems;d.length||(e=og(a.h.servers),e.size==1&&(d=Array.from(e.keys())));for(const g of d)for(var f of b)if(e=f.decodingInfos.find(h=>h.supported&&h.keySystemAccess!=null&&h.keySystemAccess.keySystem==g))return e.keySystemAccess;for(const g of[!0,
!1])for(const h of b)for(const k of h.decodingInfos){if(!k.supported||!k.keySystemAccess)continue;f=k.keySystemAccess.keySystem;if(d.includes(f))continue;e=c.get(f);!e&&a.h.keySystemsMapping[f]&&(e=c.get(a.h.keySystemsMapping[f]));for(const l of e)if(!!l.licenseServerUri==g)return k.keySystemAccess}return null}function jh(a){$g(a)&&a.l.resolve()}function ih(a,b){(new Ce(()=>{b.loaded=!0;jh(a)})).ma(nh)}
function hh(a,b){b=b.target;const c=a.i.get(b);let d=!1;b.keyStatuses.forEach((f,g)=>{if(typeof g=="string"){var h=g;g=f;f=h}h=Fa();if(xb(a.g.keySystem)&&g.byteLength==16&&h.M()){h=ob(g);const k=h.getUint32(0,!0),l=h.getUint16(4,!0),m=h.getUint16(6,!0);h.setUint32(0,k,!1);h.setUint16(4,l,!1);h.setUint16(6,m,!1)}f!="status-pending"&&(c.loaded=!0);f=="expired"&&(d=!0);g=Qb(g).slice(0,32);a.Y.set(g,f)});const e=b.expiration-Date.now();(e<0||d&&e<1E3)&&c&&!c.wb&&(a.i.delete(b),Pg(b));$g(a)&&(a.l.resolve(),
a.K.ma(oh))}function fh(a){return a.j?a.h.delayLicenseRequestUntilPlayed&&a.j.paused&&!a.ha:!a.W&&a.h.delayLicenseRequestUntilPlayed}
async function gh(a,b){var c=b.target;a.h.logLicenseExchange&&Nb(b.message);const d=a.i.get(c);var e=a.g.licenseServerUri;const f=a.h.advanced[a.g.keySystem];b.messageType=="individualization-request"&&f&&f.individualizationServer&&(e=f.individualizationServer);e=ag([e],a.h.retryParameters);e.body=b.message;e.method="POST";e.licenseRequestType=b.messageType;e.sessionId=c.sessionId;e.drmInfo=a.g;d&&(e.initData=d.initData,e.initDataType=d.initDataType);if(f&&f.headers)for(const m in f.headers)e.headers[m]=
f.headers[m];if(vb(a.g.keySystem)){b=a.g;try{var g=Hb(e.body);if(g){var h=JSON.parse(g);h.type||(h.type=b.sessionType,e.body=Ib(JSON.stringify(h)))}}catch(m){}}if(xb(a.g.keySystem))if(g=Fb(e.body,!0,!0),g.includes("PlayReadyKeyMessage")){g=Lc(g,"PlayReadyKeyMessage");h=Xc(g,"HttpHeader");for(var k of h)h=Xc(k,"name")[0],b=Xc(k,"value")[0],e.headers[Vc(h)]=Vc(b);k=Xc(g,"Challenge")[0];e.body=Ob(Vc(k))}else e.headers["Content-Type"]="text/xml; charset=utf-8";k=Date.now();try{const m=a.C.Yb.request(2,
e,{isPreload:a.S()});a.T.push(m);var l=await m.promise;sa(a.T,m)}catch(m){if(a.m.g)return;l=new F(2,6,6007,m,{sessionId:c.sessionId,sessionType:d.type,initData:d.initData,initDataType:d.initDataType});a.i.size==1?(a.u(l),d&&d.wb&&d.wb.reject(l)):(d&&d.wb&&d.wb.reject(l),a.i.delete(c),$g(a)&&(a.l.resolve(),a.K.ma(.1)));return}if(!a.m.g){a.I+=(Date.now()-k)/1E3;a.h.logLicenseExchange&&Nb(l.data);try{await c.update(l.data)}catch(m){c=new F(2,6,6008,m&&m.message||String(m));a.u(c);d&&d.wb&&d.wb.reject(c);
return}a.m.g||(c=new L("drmsessionupdate"),a.C.onEvent(c),d&&(d.wb&&d.wb.resolve(),ih(a,d)))}}async function ph(a){a.J&&!fh(a)&&(await a.l,await Promise.all(a.T.map(b=>b.promise)))}async function Pg(a){try{await Ge(qh,Promise.all([a.close().catch(()=>{}),a.closed]))}catch(b){}}
var rh=class{constructor(a){this.C=a;this.j=this.A=null;this.W=this.R=!1;this.I=0;this.g=null;this.o=new Aa;this.i=new Map;this.T=[];this.B=new Map;this.J=!1;this.l=new Lf;this.h=null;this.u=b=>{b.severity==2&&this.l.reject(b);a.onError(b)};this.Y=new Map;this.ea=new Map;this.K=new Ce(()=>Lg(this));this.O=!1;this.M=[];this.ha=!1;this.F=new Ce(()=>{Mg(this)});this.l.catch(()=>{});this.m=new lg(()=>Ng(this));this.N=!1;this.G=this.H=null;this.S=()=>!1}destroy(){return this.m.destroy()}configure(a,b){this.h=
a;b&&(this.S=b);this.F&&this.R&&this.g&&this.F.Da(this.h.updateExpirationTime)}async Db(a){this.j!==a&&(this.A?(this.j=a,this.h.delayLicenseRequestUntilPlayed&&this.o.za(this.j,"play",()=>{for(const b of this.M)gh(this,b);this.ha=!0;this.M=[]}),this.j.remote?(this.o.D(this.j.remote,"connect",()=>Og(this)),this.o.D(this.j.remote,"connecting",()=>Og(this)),this.o.D(this.j.remote,"disconnect",()=>Og(this))):"webkitCurrentPlaybackTargetIsWireless"in this.j&&this.o.D(this.j,"webkitcurrentplaybacktargetiswirelesschanged",
()=>Og(this)),this.G=this.g?this.g.initData.find(b=>b.initData.length>0)||null:null,a=this.g.keySystem,(a=Fa().R(a))||!this.G&&this.g.keySystem==="com.apple.fps"&&!this.B.size||await Yg(this),ch(this).catch(()=>{}),!a&&(this.G||this.B.size||this.h.parseInbandPsshEnabled)||this.o.D(this.j,"encrypted",b=>bh(this,b))):this.o.za(a,"encrypted",()=>{this.u(new F(2,6,6010))}))}uf(){var a=this.i.keys();a=mg(a,b=>{const c=this.i.get(b);return{sessionId:b.sessionId,sessionType:c.type,initData:c.initData,initDataType:c.initDataType}});
return Array.from(a)}md(){let a=Infinity;const b=this.i.keys();for(const c of b)isNaN(c.expiration)||(a=Math.min(a,c.expiration));return a}ae(){return pg(this.ea)}},qh=1,nh=5,oh=.5;function sh(a,b){const c=a.g!==b;a.g=b;c&&b===th&&(a.i=Date.now());return c}var vh=class{constructor(){this.g=th;this.j=(new Map).set(th,2).set(uh,1);this.i=0;this.h=-1}},uh=0,th=1;function wh(a,b){const c=xh(a,b);if(b){const d=a.g?a.g.g:null;if(d&&a.g.A){const e=new Set;for(const f of b.variants)f.audio&&e.add(f.audio),f.video&&e.add(f.video);for(const f of e)yh(a,d.keySystem,f)}zh(a,b)}return c}
async function Ah(a,b){await Ve(a.g,b,a.h.drm.preferredKeySystems,a.h.drm.keySystemsMapping);a.h.streaming.dontChooseCodecs||Re(b,a.h.preferredVideoCodecs,a.h.preferredAudioCodecs,a.h.preferredDecodingAttributes,a.h.preferredTextFormats);if(!b.variants.some(tf))throw new F(2,4,4032);return wh(a,b)}function xh(a,b){var c=b.variants;b=a.h.restrictions;a=a.i;let d=!1;for(const e of c)c=e.allowedByApplication,e.allowedByApplication=Ue(e,b,a),c!=e.allowedByApplication&&(d=!0);return d}
function yh(a,b,c){for(const d of c.drmInfos)if(d.keySystem==b){for(const e of d.initData||[])Zg(a.g,e.initDataType,e.initData);c=a.g;c.g&&(c.g.mediaTypes!==d.mediaTypes&&(c.g.mediaTypes=d.mediaTypes),tb(d)&&(c.g=Vg(c,c.g.keySystem,[c.g,d])))}}
function zh(a,b){const c=a.g?a.g.ae():{};a=Object.keys(c);const d=a.length&&a[0]=="00";a=!1;const e=new Set,f=new Set,g=new WeakSet,h=k=>{if(k&&!g.has(k)&&(g.add(k),k.keyIds.size))for(const l of k.keyIds)(k=c[d?"00":l])?Bh.includes(k)&&f.add(k):e.add(l)};for(const k of b.variants){if(!k.allowedByApplication)a=!0;else if(k.allowedByKeySystem)return;h(k.audio);h(k.video)}b={hasAppRestrictions:a,missingKeys:Array.from(e),restrictedKeyStatuses:Array.from(f)};throw new F(2,4,4012,b);}
var Ch=class{constructor(a,b,c){this.h=a;this.i=b;this.g=c}},Bh=["output-restricted","internal-error"];v("shaka.config.CodecSwitchingStrategy",{RELOAD:"reload",SMOOTH:"smooth"});function Dh(a){if(Eh.has(a))return Eh.get(a);var b=window.ManagedMediaSource||window.MediaSource;return b?(b=b.isTypeSupported(a),Eh.set(a,b),b):!1}function Fh(){const a=window.ManagedMediaSource||window.MediaSource;return a&&a.prototype?!!a.prototype.setLiveSeekableRange&&!!a.prototype.clearLiveSeekableRange:!1}var Eh=new Map;function Gh(a,b){let c=null,d=null,e=null,f=null;const g=a.V();b&1&&(e=a.Xc());b&2&&(f=a.V());b&8&&(c=a.V());b&16&&(d=a.V());return{trackId:g,jd:c,kd:d,jh:e,Qg:f}}function Hh(a,b){return b==1?(b=a.V(),a=a.V(),{baseMediaDecodeTime:b*4294967296+a}):{baseMediaDecodeTime:a.V()}}function Ih(a,b){b==1?(a.skip(8),a.skip(8)):(a.skip(4),a.skip(4));b=a.V();a.skip(4);a=a.Ca();return{timescale:b,language:String.fromCharCode((a>>10)+96)+String.fromCharCode(((a&960)>>5)+96)+String.fromCharCode((a&31)+96)}}
function Jh(a,b,c){const d=a.V(),e=[];let f=null;c&1&&(f=a.Lf());c&4&&a.skip(4);for(let g=0;g<d;g++){const h={Tf:null,sampleSize:null,Ce:null};c&256&&(h.Tf=a.V());c&512&&(h.sampleSize=a.V());c&1024&&a.skip(4);c&2048&&(h.Ce=b==0?a.V():a.Lf());e.push(h)}return{yk:d,Sf:e,Xe:f}}function Kh(a){a.skip(6);a.skip(2);a.skip(8);const b=a.Ca();a.skip(2);a.skip(2);a.skip(2);a=a.Ca()+a.Ca()/65536;return{channelCount:b,sampleRate:a}}
function Lh(a,b=!1){a=a.toString(16).toUpperCase();return b?a:("0"+a).slice(-2)}function Mh(a){a=a.V();return{codec:ug(a)}}
function Nh(a){let b=null,c=null;var d=a.Bb(4,!1);let e;e=String.fromCharCode(d[0]);e+=String.fromCharCode(d[1]);e+=String.fromCharCode(d[2]);e+=String.fromCharCode(d[3]);if(e==="nclx"){switch(a.Ca()){case 1:case 5:case 6:case 7:b="srgb";break;case 9:b="rec2020";break;case 11:case 12:b="p3"}d=a.Ca();a.Ca();switch(d){case 1:case 6:case 13:case 14:case 15:c="SDR";break;case 16:c="PQ";break;case 18:c="HLG"}}return{colorGamut:b,Gd:c}}function Oh(a){return(a<10?"0":"")+a};function Ph(a){return a.encrypted&&a.drmInfos.length>0}function Qh(a,...b){let c=Rh.get(a);c||(c=[a.charCodeAt(0),a.charCodeAt(1),a.charCodeAt(2),a.charCodeAt(3)],Rh.set(a,c));a=8;for(var d=b.length-1;d>=0;d--)a+=b[d].byteLength;d=new Uint8Array(a);d[0]=a>>24&255;d[1]=a>>16&255;d[2]=a>>8&255;d[3]=a&255;d.set(c,4);for(let e=0,f=8;e<b.length;e++)d.set(b[e],f),f+=b[e].byteLength;return d}
function Sh(a){if(a.g.length===0)throw Error("StreamInfos must have elements");var b=[];for(var c of a.g){var d=b,e=d.push;var f=c.id+1;var g=c.stream.width||0;var h=c.stream.height||0;c.type=="audio"&&(h=g=0);var k=c.duration*c.timescale,l=Math.floor(k/(Th+1));k=Math.floor(k%(Th+1));f=new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,...Uh(f,4),0,0,0,0,...Uh(l,4),...Uh(k,4),0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,...Uh(g,2),0,
0,...Uh(h,2),0,0]);f=Qh("tkhd",f);h=c.duration*c.timescale;g=Math.floor(h/(Th+1));h=Math.floor(h%(Th+1));l=c.stream.language;l=l.charCodeAt(0)-96<<10|l.charCodeAt(1)-96<<5|l.charCodeAt(2)-96;g=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,...Uh(c.timescale,4),...Uh(g,4),...Uh(h,4),...Uh(l,2),0,0]);g=Qh("mdhd",g);h=new Uint8Array([]);switch(c.type){case "video":h=Vh.value();break;case "audio":h=Wh.value()}h=Qh("hdlr",h);a:{switch(c.type){case "video":l=Qh("minf",Qh("vmhd",Xh.value()),Yh.value(),
Zh(c));break a;case "audio":l=Qh("minf",Qh("smhd",$h.value()),Yh.value(),Zh(c));break a}l=new Uint8Array([])}g=Qh("mdia",g,h,l);f=Qh("trak",f,g);e.call(d,f)}d=a.g[0];c=d.duration*d.timescale;e=Math.floor(c/(Th+1));c=Math.floor(c%(Th+1));e=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,...Uh(d.timescale,4),...Uh(e,4),...Uh(c,4),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]);e=Qh("mvhd",e);c=[];for(m of a.g)a=c,f=a.push,g=new Uint8Array([0,0,0,0,...Uh(m.id+1,4),0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0]),g=Qh("trex",g),f.call(a,g);var m=Qh("mvex",...c);b=Qh("moov",e,...b,m,ai(d.stream));m=bi.value();a=new Uint8Array(m.byteLength+b.byteLength);a.set(m);a.set(b,m.byteLength);return a}function ai(a){const b=[];if(!Ph(a))return new Uint8Array([]);for(const c of a.drmInfos)if(c.initData)for(const d of c.initData)b.push(d.initData);return Rb(...b)}
function Uh(a,b){const c=[];for(--b;b>=0;b--)c.push(a>>8*b&255);return c}
function Zh(a){var b="aac";a.codecs.includes("mp3")?b="mp3":a.codecs.includes("ac-3")?b=Fa().I()?"ec-3":"ac-3":a.codecs.includes("ec-3")?b="ec-3":a.codecs.includes("opus")&&(b="opus");var c=new Uint8Array([]);switch(a.type){case "video":if(a.codecs.includes("avc1")){b=a.stream.width||0;c=a.stream.height||0;if(a.Ma.byteLength>0)var d=Qh("avcC",a.Ma);else{var e=7,f=[];d=[];var g=0,h=0;let l=0;for(var k=0;k<a.mb.length;k++){const m=ci(a.mb[k]);switch(m[0]&31){case 7:f.push(m);e+=m.length+2;break;case 8:d.push(m),
e+=m.length+2}}f.length>0&&(g=f[0][1],l=f[0][2],h=f[0][3]);e=new Uint8Array(e);k=0;e[k++]=1;e[k++]=g;e[k++]=l;e[k++]=h;e[k++]=255;e[k++]=224|f.length;for(g=0;g<f.length;g++)e[k++]=(f[g].length&65280)>>8,e[k++]=f[g].length&255,e.set(f[g],k),k+=f[g].length;e[k++]=d.length;for(f=0;f<d.length;f++)e[k++]=(d[f].length&65280)>>8,e[k++]=d[f].length&255,e.set(d[f],k),k+=d[f].length;d=Qh("avcC",e)}b=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,...Uh(b,2),...Uh(c,2),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]);c="avc1";f=di(a);g=new Uint8Array([]);Ph(a.stream)&&(g=ei(a.stream,a.codecs),c="encv");c=Qh(c,b,d,f,g)}else a.codecs.includes("hvc1")&&(c=a.stream.width||0,d=a.stream.height||0,b=new Uint8Array([]),a.Ma.byteLength>0&&(b=Qh("hvcC",a.Ma)),c=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,...Uh(c,2),...Uh(d,2),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]),d="hvc1",f=di(a),g=new Uint8Array([]),Ph(a.stream)&&(g=ei(a.stream,a.codecs),d="encv"),c=Qh(d,c,b,f,g));break;case "audio":if(b=="mp3")a=Qh(".mp3",fi(a));else if(b=="ac-3")b=Qh("dac3",a.ya),c="ac-3",d=new Uint8Array([]),Ph(a.stream)&&(d=ei(a.stream,a.codecs),c="enca"),a=Qh(c,fi(a),b,d);else if(b=="ec-3")b=Qh("dec3",a.ya),c="ec-3",d=new Uint8Array([]),Ph(a.stream)&&(d=ei(a.stream,a.codecs),c="enca"),a=Qh(c,fi(a),b,
d);else if(b=="opus")b=Qh("dOps",a.ya),c="Opus",d=new Uint8Array([]),Ph(a.stream)&&(d=ei(a.stream,a.codecs),c="enca"),a=Qh(c,fi(a),b,d);else{if(a.ya.byteLength>0)b=Qh("esds",a.ya);else{b=a.id+1;c=a.stream.channelsCount||2;f=a.stream.audioSamplingRate||44100;g=Yb("audio",a.codecs.split(","));h={96E3:0,88200:1,64E3:2,48E3:3,44100:4,32E3:5,24E3:6,22050:7,16E3:8,12E3:9,11025:10,8E3:11,7350:12};d=h[f];if(g==="mp4a.40.5"||g==="mp4a.40.29")d=h[f*2];f=parseInt(g.split(".").pop(),10);b=new Uint8Array([0,0,
0,0,3,25,...Uh(b,2),0,4,17,64,21,0,0,0,0,0,0,0,0,0,0,0,5,2,f<<3|d>>>1,d<<7|c<<3,6,1,2]);b=Qh("esds",b)}c="mp4a";d=new Uint8Array([]);Ph(a.stream)&&(d=ei(a.stream,a.codecs),c="enca");a=Qh(c,fi(a),b,d)}c=a}a=Qh("stsd",gi.value(),c);return Qh("stbl",a,Qh("stts",hi.value()),Qh("stsc",ii.value()),Qh("stsz",ji.value()),Qh("stco",ki.value()))}function di(a){if(!a.Sa&&!a.Ta)return new Uint8Array([]);const b=a.Ta;a=new Uint8Array([...Uh(a.Sa,4),...Uh(b,4)]);return Qh("pasp",a)}
function ei(a,b){b=new Uint8Array([...Uh(li(b.split(".")[0]),4)]);b=Qh("frma",b);var c="cenc";var d=a.drmInfos[0];d&&d.encryptionScheme&&(c=d.encryptionScheme);c=new Uint8Array([0,0,0,0,...Uh(li(c),4),0,1,0,0]);c=Qh("schm",c);d=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);for(const e of a.drmInfos)if(e&&e.keyIds&&e.keyIds.size)for(const f of e.keyIds)d=ci(f);a=new Uint8Array([0,0,0,0,0,0,1,8]);a=Qh("tenc",a,d);return Qh("sinf",b,c,Qh("schi",a))}
function ci(a){const b=new Uint8Array(a.length/2);for(let c=0;c<a.length/2;c+=1)b[c]=parseInt(String(a[c*2]+a[c*2+1]),16);return b}function fi(a){return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,a.stream.channelsCount||2,0,16,0,0,0,0,...Uh(a.stream.audioSamplingRate||44100,2),0,0])}function li(a){let b=0;for(let c=0;c<a.length;c+=1)b|=a.charCodeAt(c)<<(a.length-c-1)*8;return b}function mi(a){a=(a.data?a.data.ib:[]).map(b=>b.data);return Qh("mdat",...a)}
function ni(a){const b=[];for(const p of a.g){a=b;var c=a.push;var d=new Uint8Array([0,0,0,0,...Uh(p.data?p.data.sequenceNumber:0,4)]);d=Qh("mfhd",d);var e;var f=p.data?p.data.ib:[];var g=new Uint8Array(4+f.length);for(e=0;e<f.length;e++){var h=f[e].flags;g[e+4]=h.$d<<4|h.je<<2|h.fe}f=Qh("sdtp",g);h=f.length+32+20+8+16+8+8;g=new Uint8Array([0,0,0,58,...Uh(p.id+1,4),0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0]);g=Qh("tfhd",g);e=p.data?p.data.baseMediaDecodeTime:0;var k=Math.floor(e%(Th+1));e=new Uint8Array([1,
0,0,0,...Uh(Math.floor(e/(Th+1)),4),...Uh(k,4)]);e=Qh("tfdt",e);var l=h;h=p.data?p.data.ib:[];k=h.length;var m=12+16*k;const r=new Uint8Array(m);l+=8+m;r.set([p.type==="video"?1:0,0,15,1,...Uh(k,4),...Uh(l,4)],0);for(l=0;l<k;l++){var n=h[l];m=Uh(n.duration,4);const q=Uh(n.size,4),t=n.flags;n=Uh(n.cb,4);r.set([...m,...q,t.Bf<<2|t.$d,t.je<<6|t.fe<<4|t.Cf,t.Zd&61440,t.Zd&15,...n],12+16*l)}h=Qh("trun",r);f=Qh("traf",g,e,h,f);d=Qh("moof",d,f);c.call(a,d,mi(p))}return Rb(...b)}
var oi=class{constructor(a=[]){this.g=a}},Th=4294967295,Rh=new Map,Vh=new Ea(()=>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])),Wh=new Ea(()=>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])),hi=new Ea(()=>new Uint8Array([0,0,0,0,0,0,0,0])),ii=new Ea(()=>new Uint8Array([0,0,0,0,0,0,0,0])),ki=new Ea(()=>new Uint8Array([0,0,0,0,0,0,0,0])),ji=new Ea(()=>new Uint8Array([0,
0,0,0,0,0,0,0,0,0,0,0])),Xh=new Ea(()=>new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])),$h=new Ea(()=>new Uint8Array([0,0,0,0,0,0,0,0])),gi=new Ea(()=>new Uint8Array([0,0,0,0,0,0,0,1])),bi=new Ea(()=>{const a=new Uint8Array([105,115,111,109]),b=new Uint8Array([97,118,99,49]),c=new Uint8Array([0,0,0,1]);return Qh("ftyp",a,c,a,b)}),Yh=new Ea(()=>{var a=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]);a=Qh("dref",a);return Qh("dinf",a)});function pi(a){a=C(a);let b=null;(new Dg).boxes(["moov","trak","mdia","minf","stbl"],vg).ka("stsd",xg).box("enca",c=>{b=c.reader.h;return zg(c)}).box("sinf",vg).box("frma",c=>{c.parser.stop();({codec:c}=Mh(c.reader));c==="ec-3"&&b&&b.getUint16(16)!==2&&b.setUint16(16,2)}).parse(a);return a}
function qi(a,b,c){let d=b=C(b),e=!1,f;const g=[],h=[];(new Dg).boxes(["moov","trak","mdia","minf","stbl"],k=>{g.push(k);vg(k)}).ka("stsd",k=>{f=k;g.push(k);xg(k)}).boxes(["encv","enca"],k=>{e=!0;k.parser.stop()}).boxes("dvav dva1 dvh1 dvhe dvc1 dvi1 hev1 hvc1 avc1 avc3".split(" "),k=>{h.push({box:k,Kg:1701733238})}).boxes("ac-3 ec-3 ac-4 Opus fLaC mp4a".split(" "),k=>{h.push({box:k,Kg:1701733217})}).parse(b);if(e)return b;if(h.length==0||!f)throw pa(Qb(b)),new F(2,3,3019,c);h.reverse();for(const k of h)d=
ri(a,d,f,k.box,g,k.Kg);d=si(a,d);return Fa().S()?(a=new Uint8Array(b.byteLength+d.byteLength),a.set(d),a.set(b,d.byteLength),a):d}function ti(a){a=C(a);const b=[];(new Dg).box("mdat",d=>{b.push(d)}).parse(a);const c=[];for(let d=0;d<b.length;d++){const e=b[d-1],f=b[d];c.push(ui(a.subarray(e?e.start+e.size:0,f.start+f.size)))}return Rb(...c)}
function ui(a){let b,c,d,e;const f=[];(new Dg).boxes(["moof","traf"],k=>{f.push(k);vg(k)}).ka("tfhd",k=>{b=k;d=Gh(k.reader,k.flags)}).ka("trun",k=>{c=k;e=Jh(k.reader,k.version,k.flags)}).parse(a);if(d&&d.Qg!==2){const k=b.start+wg(b)+4+(d.jh!==null?8:0);var g=ob(a);if(d.Qg!==null)g.setUint32(k,2);else{vi(a,b.start,b.size+4);var h=g.getUint32(b.start+8);g.setUint32(b.start+8,h|2);e&&e.Xe!==null&&g.setInt32(c.start+wg(c)+4,e.Xe+4);h=a.subarray(0,k);g=a.subarray(k);a=new Uint8Array(a.byteLength+4);a.set(h);
h=[];for(let l=3;l>=0;l--)h.push(2>>8*l&255);a.set(new Uint8Array(h),k);a.set(g,k+4);for(const l of f)vi(a,l.start,l.size+4)}}return a}function vi(a,b,c){a=ob(a,b);b=a.getUint32(0);b!=0&&(b==1?(a.setUint32(8,c>>32),a.setUint32(12,c&4294967295)):a.setUint32(0,c))}
function ri(a,b,c,d,e,f){var g=ei(a,d.name);const h=b.subarray(d.start,d.start+d.size);a=new Uint8Array(d.size+g.byteLength);a.set(h,0);ob(a).setUint32(4,f);a.set(g,d.size);vi(a,0,a.byteLength);f=new Uint8Array(b.byteLength+a.byteLength);d=Fa().K()?d.start:d.start+d.size;g=b.subarray(d);f.set(b.subarray(0,d));f.set(a,d);f.set(g,d+a.byteLength);for(const k of e)vi(f,k.start,k.size+a.byteLength);b=ob(f,c.start);c=wg(c);e=b.getUint32(c);b.setUint32(c,e+1);return f}
function si(a,b){a=ai(a);if(a.byteLength===0)return b;let c=0,d=0;(new Dg).box("moov",h=>{c=h.start;d=h.size;h.parser.stop()}).parse(b);const e=c+d;vi(b,c,d+a.byteLength);const f=new Uint8Array(b.byteLength+a.byteLength),g=b.subarray(e);f.set(b.subarray(0,e));f.set(a,e);f.set(g,e+a.byteLength);return f}
function wi(a){const b=C(a),c=[];(new Dg).boxes(["moov","trak","mdia","minf","stbl"],d=>{c.push({start:d.start,size:d.size});vg(d)}).box("stsd",d=>{c.push({start:d.start,size:d.size});const e=ob(b,d.start);for(let f=0;f<d.size-3;f++){const g=e.getUint32(f);g==1633889587?e.setUint32(f,1700998451):g==1684103987&&e.setUint32(f,1684366131)}}).parse(b);return b};function xi(a,b){return a===b?!0:a&&b?a.kc()==b.kc()&&a.hc()==b.hc()&&xa(a.P().sort(),b.P().sort())&&kb(a.Jb(),b.Jb()):a==b}var yi=class{constructor(a,b,c,d=null,e=null,f=null,g=null,h=!1){this.P=a;this.startByte=b;this.endByte=c;this.Qc=d;this.timescale=e;this.h=f;this.aesKey=g;this.g=this.mimeType=this.codecs=null;this.encrypted=h}kc(){return this.startByte}hc(){return this.endByte}Bd(a){this.h=a}Jb(){return this.h}};v("shaka.media.InitSegmentReference",yi);yi.prototype.getEndByte=yi.prototype.hc;
yi.prototype.getStartByte=yi.prototype.kc;function zi(a){if(a.endByte)return a.endByte+1-a.startByte;if(a.bandwidth){const b=a.bandwidth*(a.endTime-a.startTime);if(!isNaN(b)&&b>0)return b}if(a.g.length>0&&a.m)for(const b of a.g){zi(b);break}return null}function Ai(a,b){a.$=b;for(const c of a.g)Ai(c,b)}
var M=class{constructor(a,b,c,d,e,f,g,h,k,l=[],m="",n=null,p=null,r=Bi,q=null,t=!1){this.startTime=a;this.j=this.endTime=b;this.B=c;this.startByte=d;this.endByte=e;this.$=f;this.timestampOffset=g;this.appendWindowStart=h;this.appendWindowEnd=k;this.g=l;this.tilesLayout=m;this.A=n;this.h=p;this.status=r;this.preload=!1;this.l=!0;this.o=!1;this.aesKey=q;this.thumbnailSprite=null;this.i=-1;this.m=t;this.td=this.xc=!1;for(const u of this.g)u.Jg();this.m&&this.g.length&&this.g[this.g.length-1].Ig();this.u=
this.bandwidth=this.mimeType=this.codecs=null;this.C=!1}P(){return this.B()}getStartTime(){return this.startTime}Gh(){return this.endTime}kc(){return this.startByte}hc(){return this.endByte}$h(){return this.tilesLayout}Zh(){return this.A}Kb(){return this.status}ui(){this.status=Ci}Ef(){this.preload=!0}isPreload(){return this.preload}Pc(){this.l=!1}li(){return this.l}Jg(){this.xc=!0}ni(){return this.xc}Ig(){this.td=!0}mi(){return this.td}Hg(){this.o=!0}gi(){return this.o}He(a){this.thumbnailSprite=
a}Xh(){return this.thumbnailSprite}offset(a){this.startTime+=a;this.endTime+=a;this.j+=a;for(const b of this.g)b.startTime+=a,b.endTime+=a,b.j+=a}ag(a){this.h==null?ia("Sync attempted without sync time!"):(a=this.h-a-this.startTime,Math.abs(a)>=.001&&this.offset(a))}Bd(a,b=!1){this.u=a;this.C=b}Jb(a=!0){const b=this.u;a&&this.C&&(this.u=null);return b}};v("shaka.media.SegmentReference",M);M.prototype.getSegmentData=M.prototype.Jb;M.prototype.setSegmentData=M.prototype.Bd;M.prototype.syncAgainst=M.prototype.ag;
M.prototype.offset=M.prototype.offset;M.prototype.getThumbnailSprite=M.prototype.Xh;M.prototype.setThumbnailSprite=M.prototype.He;M.prototype.hasByterangeOptimization=M.prototype.gi;M.prototype.markAsByterangeOptimization=M.prototype.Hg;M.prototype.isLastPartial=M.prototype.mi;M.prototype.markAsLastPartial=M.prototype.Ig;M.prototype.isPartial=M.prototype.ni;M.prototype.markAsPartial=M.prototype.Jg;M.prototype.isIndependent=M.prototype.li;M.prototype.markAsNonIndependent=M.prototype.Pc;
M.prototype.isPreload=M.prototype.isPreload;M.prototype.markAsPreload=M.prototype.Ef;M.prototype.markAsUnavailable=M.prototype.ui;M.prototype.getStatus=M.prototype.Kb;M.prototype.getTileDuration=M.prototype.Zh;M.prototype.getTilesLayout=M.prototype.$h;M.prototype.getEndByte=M.prototype.hc;M.prototype.getStartByte=M.prototype.kc;M.prototype.getEndTime=M.prototype.Gh;M.prototype.getStartTime=M.prototype.getStartTime;M.prototype.getUris=M.prototype.P;var Bi=0,Ci=1;M.Status={jj:Bi,nk:Ci,Lj:2};function Di(a){return a.length==1&&a.end(0)-a.start(0)<1E-4}function Ei(a){return!a||Di(a)?null:a.length==1&&a.start(0)<0?0:a.length?a.start(0):null}function Fi(a){return!a||Di(a)?null:a.length?a.end(a.length-1):null}function Gi(a,b){return!a||!a.length||Di(a)||b>a.end(a.length-1)?!1:b>=a.start(0)}function Hi(a,b){if(!a||!a.length||Di(a))return 0;let c=0;for(const {start:d,end:e}of Ii(a))e>b&&(c+=e-Math.max(d,b));return c}
function Ii(a){if(!a)return[];const b=[];for(let c=0;c<a.length;c++)b.push({start:a.start(c),end:a.end(c)});return b}function Ji(a,b,c){if(!a||!a.length||Di(a))return null;a=Ii(a).findIndex((d,e,f)=>d.start>b&&(e==0||f[e-1].end-b<=c));return a>=0?a:null};function Ki(a,b=""){const c=document.createElement("source");c.src=a;c.type=b;return c}function Li(a){let b=!1;const c=a.getElementsByTagName("source");for(let d=c.length-1;d>=0;--d)a.removeChild(c[d]),b=!0;a.src&&(a.removeAttribute("src"),b=!0);return b}function Mi(a){for(;a.firstChild;)a.removeChild(a.firstChild)}
function Ni(){if(Oi)return Oi;Pi||=new Ce(()=>{Oi=null});(Oi=document.getElementsByTagName("video")[0]||document.getElementsByTagName("audio")[0])||(Oi=document.createElement("video"));Pi.ma(1);return Oi}
async function Qi(a,b){if("fonts"in document&&"FontFace"in window&&(await document.fonts.ready,"entries"in document.fonts)){var c=d=>{d=d.entries();const e=[];let f=d.next();for(;f.done===!1;)e.push(f.value),f=d.next();return e};for(const d of c(document.fonts))if(d.family===a&&d.display==="swap")return;a=new FontFace(a,`url(${b})`,{display:"swap"});document.fonts.add(a)}}var Ri=class{};v("shaka.util.Dom",Ri);Ri.removeAllChildren=Mi;Ri.clearSourceFromVideo=Li;var Pi=null,Oi=null;function Si(a,b){return b+10<=a.length&&a[b]===73&&a[b+1]===68&&a[b+2]===51&&a[b+3]<255&&a[b+4]<255&&a[b+6]<128&&a[b+7]<128&&a[b+8]<128&&a[b+9]<128?!0:!1}function Ti(a,b){return b+10<=a.length&&a[b]===51&&a[b+1]===68&&a[b+2]===73&&a[b+3]<255&&a[b+4]<255&&a[b+6]<128&&a[b+7]<128&&a[b+8]<128&&a[b+9]<128?!0:!1}function Ui(a,b){let c;c=(a[b]&127)<<21;c|=(a[b+1]&127)<<14;c|=(a[b+2]&127)<<7;return c|=a[b+3]&127}
function Vi(a){const b={key:a.type,description:"",data:"",mimeType:null,pictureType:null};if(a.type==="APIC"){if(a.size<2||a.data[0]!==3)return null;var c=a.data.subarray(1).indexOf(0);if(c===-1)return null;var d=Eb(C(a.data,1,c));const e=a.data[2+c],f=a.data.subarray(3+c).indexOf(0);if(f===-1)return null;const g=Eb(C(a.data,3+c,f));let h;d==="--\x3e"?h=Eb(C(a.data,4+c+f)):h=mb(a.data.subarray(4+c+f));b.mimeType=d;b.pictureType=e;b.description=g;b.data=h;return b}if(a.type==="TXXX"){if(a.size<2||
a.data[0]!==3)return null;d=a.data.subarray(1).indexOf(0);if(d===-1)return null;c=Eb(C(a.data,1,d));a=Eb(C(a.data,2+d)).replace(/\0*$/,"");b.description=c;b.data=a;return b}if(a.type==="WXXX"){if(a.size<2||a.data[0]!==3)return null;d=a.data.subarray(1).indexOf(0);if(d===-1)return null;c=Eb(C(a.data,1,d));a=Eb(C(a.data,2+d)).replace(/\0*$/,"");b.description=c;b.data=a;return b}if(a.type==="PRIV"){if(a.size<2)return null;c=a.data.indexOf(0);if(c===-1)return null;c=Eb(C(a.data,0,c));b.description=c;
c=="com.apple.streaming.transportStreamTimestamp"?(c=a.data.subarray(c.length+1),a=c[3]&1,c=(c[4]<<23)+(c[5]<<15)+(c[6]<<7)+c[7],c/=45,a&&(c+=4.772185884E7),b.data=c):(a=mb(a.data.subarray(c.length+1)),b.data=a);return b}if(a.type[0]==="T"){if(a.size<2||a.data[0]!==3)return null;a=Eb(a.data.subarray(1)).replace(/\0*$/,"");b.data=a;return b}return a.type[0]==="W"?(a=Eb(a.data).replace(/\0*$/,""),b.data=a,b):a.data?(b.data=mb(a.data),b):null}
function Wi(a){let b=0;const c=[];for(;Si(a,b);){var d=Ui(a,b+6);a[b+5]>>6&1&&(b+=10);b+=10;for(d=b+d;b+10<d;){var e=a.subarray(b),f=Ui(e,4);e={type:String.fromCharCode(e[0],e[1],e[2],e[3]),size:f,data:e.subarray(10,10+f)};(f=Vi(e))&&c.push(f);b+=e.size+10}Ti(a,b)&&(b+=10)}return c}function Xi(a,b=0){const c=b;let d=0;for(;Si(a,b);)a[b+5]>>6&1&&(d+=10),d+=10,d+=Ui(a,b+6),Ti(a,b+10)&&(d+=10),b+=d;return d>0?a.subarray(c,c+d):new Uint8Array([])}var Yi=class{};v("shaka.util.Id3Utils",Yi);
Yi.getID3Data=Xi;Yi.getID3Frames=Wi;function Zi(a,b,c=Number.EPSILON){if(a===b)return!0;a=Math.abs(a-b);return a<=c?!0:c!==Number.EPSILON?Math.abs(a-c)<=Number.EPSILON:!1};function $i(a){return(new Date(Date.UTC(1900,0,1,0,0,0,0)+a)).getTime()};/*

 Copyright Brightcove, Inc.

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
*/
function aj(a){const b=a.j.byteLength-a.i,c=Math.min(4,a.i);if(c!==0){var d=0;for(let e=0;e<c;e++)d=d<<8|a.j[b+e];a.h=d<<(4-c)*8;a.g=c*8;a.i-=c}}function bj(a,b){if(a.g<=b){b-=a.g;const c=Math.floor(b/8);b-=c*8;a.g-=c;aj(a)}a.h<<=b;a.g-=b}function cj(a,b){let c=Math.min(a.g,b);const d=a.h>>>32-c;a.g-=c;a.g>0?a.h<<=c:a.i>0&&aj(a);c=b-c;return c>0?d<<c|cj(a,c):d}
function dj(a){let b=0;for(;a.g===0;){if(a.i===0)return b;aj(a)}for(;;){let c=Math.clz32(a.h);c>a.g&&(c=a.g);b+=c;a.h<<=c;a.g-=c;if(a.g>0||a.i===0)break;aj(a)}return b}function ej(a){bj(a,1+dj(a))}function O(a){const b=dj(a);return cj(a,b+1)-1}function hj(a){a=O(a);return 1&a?1+a>>>1:-1*(a>>>1)}function P(a){return cj(a,1)===1}function ij(a){return cj(a,8)}function jj(a,b){let c=8;var d=8;for(let e=0;e<b;e++)d!==0&&(d=hj(a),d=(c+d+256)%256),c=d===0?c:d}function kj(a){ij(a);O(a);return O(a)}
var lj=class{constructor(a,b=!1){this.j=a;if(b){b=new Uint8Array(a.byteLength);let c=0;for(let d=0;d<a.byteLength;d++)d>=2&&a[d]==3&&a[d-1]==0&&a[d-2]==0||(b[c]=a[d],c++);this.j=C(b,0,c)}this.i=this.j.byteLength;this.g=this.h=0}};v("shaka.util.ExpGolomb",lj);function mj(a){const b=Math.min(1E3,a.length-564);let c=0;for(;c<b;){if(a[c]==71&&a[c+188]==71&&a[c+376]==71)return c;const d=a.indexOf(71,c+1);c=d>=0&&d<b?d:c+1}return-1}function nj(a){return mj(a)<0?!1:!0}function oj(a,b,c){return Sb(a,b[c],c+1<b.length?b[c+1]:a.length)}function pj(a,b){let c=1;for(a>b&&(c=-1);Math.abs(b-a)>4294967296;)a+=c*8589934592;return a}
function qj(a,b){if((b[0]<<16|b[1]<<8|b[2])!==1)return null;const c=b[4]<<8|b[5];if(c&&c>b.byteLength-6)return null;let d=null;var e=null;const f=b[7];if(f&192){const g=(b[9]&14)*536870912+(b[10]&255)*4194304+(b[11]&254)*16384+(b[12]&255)*128+(b[13]&254)/2;a.A==null&&(a.A=g);d=pj(g,a.A);e=a.A=d;f&64&&(e=(b[14]&14)*536870912+(b[15]&255)*4194304+(b[16]&254)*16384+(b[17]&255)*128+(b[18]&254)/2,a.u==null&&(a.u=e),e=d!=g?pj(e,a.u):e);a.u=e}a=b[8]+9;return b.byteLength<=a?null:{data:b.subarray(a),packetLength:c,
pts:d,dts:e,nalus:[]}}
function rj(a){const b={height:null,width:null,codec:null,frameRate:null};var c=a.ee();if(!c.length)return b;c=c.find(A=>A.type==33);if(!c)return b;var d=new lj(c.fullData,!0);ij(d);ij(d);cj(d,4);var e=cj(d,3);P(d);var f=cj(d,2),g=cj(d,1);const h=cj(d,5),k=cj(d,32);c=ij(d);const l=ij(d),m=ij(d),n=ij(d),p=ij(d),r=ij(d),q=ij(d);var t=[],u=[];for(var x=0;x<e;x++)t.push(P(d)),u.push(P(d));if(e>0)for(x=e;x<8;x++)cj(d,2);for(x=0;x<e;x++)t[x]&&cj(d,88),u[x]&&ij(d);O(d);e=O(d);e==3&&cj(d,1);t=O(d);u=O(d);
let y=x=0,w=0,z=0;P(d)&&(x+=O(d),y+=O(d),w+=O(d),z+=O(d));b.width=String(t-(x+y)*(e===1||e===2?2:1));b.height=String(u-(w+z)*(e===1?2:1));d=(A=>{let B=0;for(let D=0;D<32;D++)B|=(A>>D&1)<<31-D;return B>>>0})(k);g=g==1?"H":"L";f="hvc1"+("."+["","A","B","C"][f]+h);f+="."+d.toString(16).toUpperCase();f+="."+g+q;r&&(f+="."+r.toString(16).toUpperCase());p&&(f+="."+p.toString(16).toUpperCase());n&&(f+="."+n.toString(16).toUpperCase());m&&(f+="."+m.toString(16).toUpperCase());l&&(f+="."+l.toString(16).toUpperCase());
c&&(f+="."+c.toString(16).toUpperCase());b.codec=f;b.frameRate=sj(a);return b}
function tj(a){const b={height:null,width:null,codec:null,frameRate:null};var c=a.ee();if(!c.length)return b;c=c.find(r=>r.type==7);if(!c)return b;c=new lj(c.data);const d=ij(c),e=ij(c),f=ij(c);ej(c);if(uj.includes(d)){var g=O(c);g===3&&bj(c,1);ej(c);ej(c);bj(c,1);if(P(c)){g=g!==3?8:12;for(var h=0;h<g;h++)P(c)&&(h<6?jj(c,16):jj(c,64))}}ej(c);g=O(c);if(g===0)O(c);else if(g===1)for(bj(c,1),ej(c),ej(c),g=O(c),h=0;h<g;h++)ej(c);ej(c);bj(c,1);g=O(c);h=O(c);const k=cj(c,1);k===0&&bj(c,1);bj(c,1);let l=
0,m=0,n=0,p=0;P(c)&&(l=O(c),m=O(c),n=O(c),p=O(c));b.height=String((2-k)*(h+1)*16-n*2-p*2);b.width=String((g+1)*16-l*2-m*2);b.codec="avc1."+("0"+d.toString(16).toUpperCase()).slice(-2)+("0"+e.toString(16).toUpperCase()).slice(-2)+("0"+f.toString(16).toUpperCase()).slice(-2);b.frameRate=sj(a);return b}function sj(a){var b=a.Nc();return b.length>1&&(a=b[0].pts,b=b[1].pts,!isNaN(b-a))?String(Math.abs(1/(b-a)*9E4)):null}
var vj=class{constructor(){this.K=null;this.M=!1;this.B=this.N=null;this.C=[];this.j=[];this.g=[];this.G=this.H=null;this.l=[];this.i=[];this.h=[];this.I=null;this.o=[];this.m=[];this.F=this.J=this.u=this.A=null}clearData(){this.C=[];this.j=[];this.g=[];this.l=[];this.i=[];this.h=[];this.o=[];this.m=[]}Fe(a){this.F!=null&&this.F!=a&&(this.u=this.A=null);this.F=a}parse(a){if(a.length<564)return this;const b=Math.max(0,mj(a)),c=a.length-(a.length+b)%188;let d=!1;for(let k=b;k<c;k+=188)if(a[k]==71){var e=
!!(a[k+1]&64),f=((a[k+1]&31)<<8)+a[k+2],g=void 0;if((a[k+3]&48)>>4>1){if(g=k+5+a[k+4],g==k+188)continue}else g=k+4;switch(f){case 0:e&&(g+=a[g]+1);this.K=(a[g+10]&31)<<8|a[g+11];break;case 17:case 8191:break;case this.K:e&&(g+=a[g]+1);e=a;f={audio:-1,video:-1,ge:-1,audioCodec:"",videoCodec:""};const l=g+3+((e[g+1]&15)<<8|e[g+2])-4;for(g+=12+((e[g+10]&15)<<8|e[g+11]);g<l;){const m=(e[g+1]&31)<<8|e[g+2],n=(e[g+3]&15)<<8|e[g+4];switch(e[g]){case 6:if(n>0){let p=g+5,r=n;for(;r>2;){const q=e[p+1]+2;switch(e[p]){case 5:var h=
p+2;h=e[h]<<24|e[h+1]<<16|e[h+2]<<8|e[h+3];f.audio==-1&&h===1332770163?(f.audio=m,f.audioCodec="opus"):f.video==-1&&h===1096167473&&(f.video=m,f.videoCodec="av1");break;case 106:f.audio==-1&&(f.audio=m,f.audioCodec="ac3");break;case 122:f.audio==-1&&(f.audio=m,f.audioCodec="ec3");break;case 124:f.audio==-1&&(f.audio=m,f.audioCodec="aac");break;case 127:f.audioCodec=="opus"&&(h=null,e[p+2]===128&&(h=e[p+3]),h!=null&&(this.J={channelCount:(h&15)===0?2:h&15,nh:h,sampleRate:48E3}))}p+=q;r-=q}}break;case 15:f.audio==
-1&&(f.audio=m,f.audioCodec="aac");break;case 17:f.audio==-1&&(f.audio=m,f.audioCodec="aac-loas");break;case 21:f.ge==-1&&(f.ge=m);break;case 27:f.video==-1&&(f.video=m,f.videoCodec="avc");break;case 3:case 4:f.audio==-1&&(f.audio=m,f.audioCodec="mp3");break;case 36:f.video==-1&&(f.video=m,f.videoCodec="hvc");break;case 129:f.audio==-1&&(f.audio=m,f.audioCodec="ac3");break;case 132:case 135:f.audio==-1&&(f.audio=m,f.audioCodec="ec3")}g+=n+5}e=f;e.video!=-1&&(this.N=e.video,this.B=e.videoCodec);e.audio!=
-1&&(this.H=e.audio,this.G=e.audioCodec);e.ge!=-1&&(this.I=e.ge);d&&!this.M&&(d=!1,k=b-188);this.M=!0;break;case this.N:g=a.subarray(g,k+188);e?(this.j.push(this.C.length),this.C.push(g)):this.j.length&&this.C.push(g);break;case this.H:g=a.subarray(g,k+188);e?(this.i.push(this.l.length),this.l.push(g)):this.i.length&&this.l.push(g);break;case this.I:g=a.subarray(g,k+188);e?(this.m.push(this.o.length),this.o.push(g)):this.m.length&&this.o.push(g);break;default:d=!0}}return this}Ei(a){Ra("TsParser.parseAvcNalus",
"Please use parseNalus function instead.");return this.Jf(a,{vd:null,state:null})}Jf(a,b){var c=a.pts?a.pts/9E4:null;a=a.data;const d=a.byteLength;let e=1;this.B=="hvc"&&(e=2);var f=b.state||0;const g=f;let h=0;const k=[];let l=-1,m=0;const n=this.B==="hvc";f==-1&&(l=0,m=n?a[0]>>1&63:a[0]&31,f=0,h=1);for(;h<d;){var p=a[h++];if(f)if(f===1)f=p?0:2;else if(p)if(p==1){p=h-f-1;if(l>=0)k.push({data:a.subarray(l+e,p),fullData:a.subarray(l,p),type:m,time:c,state:null});else if(f=k.length?k[k.length-1]:b.vd)g&&
h<=4-g&&f.state&&(f.data=f.data.subarray(0,f.data.byteLength-g),f.fullData=f.fullData.subarray(0,f.fullData.byteLength-g)),p>0&&(p=a.subarray(0,p),f.data=Rb(f.data,p),f.fullData=Rb(f.fullData,p),f.state=0);h<d?(m=n?a[h]>>1&63:a[h]&31,l=h,f=0):f=-1}else f=0;else f=3;else f=p?0:1}l>=0&&f>=0&&k.push({data:a.subarray(l+e,d),fullData:a.subarray(l,d),type:m,time:c,state:f});!k.length&&b.vd&&(c=k.length?k[k.length-1]:b.vd)&&(c.data=Rb(c.data,a),c.fullData=Rb(c.fullData,a));b.state=f;return k}getMetadata(){const a=
[];for(let c=0;c<this.m.length;c++){var b=oj(this.o,this.m,c);(b=qj(this,b))&&a.push({cueTime:b.pts?b.pts/9E4:null,data:b.data,frames:Wi(b.data),dts:b.dts,pts:b.pts})}return a}gb(){if(this.i.length&&!this.h.length)for(let b=0;b<this.i.length;b++){var a=oj(this.l,this.i,b);const c=qj(this,a);let d=this.h.length?this.h[this.h.length-1]:null;c&&c.pts!=null&&c.dts!=null&&(!d||d.pts!=c.pts&&d.dts!=c.dts)?this.h.push(c):this.h.length&&(a=c?c.data:a)&&(d=this.h[this.h.length-1],d.data=Rb(d.data,a))}return this.h}Nc(a=
!0){if(this.j.length&&!this.g.length){for(var b=0;b<this.j.length;b++){var c=oj(this.C,this.j,b);const e=qj(this,c);var d=this.g.length?this.g[this.g.length-1]:null;e&&e.pts!=null&&e.dts!=null&&(!d||d.pts!=e.pts&&d.dts!=e.dts)?this.g.push(e):this.g.length&&(c=e?e.data:c)&&(d=this.g[this.g.length-1],d.data=Rb(d.data,c))}if(a){b={vd:null,state:null};d=[];for(const e of this.g)e.nalus=this.Jf(e,b),e.nalus.length&&(d.push(e),b.vd=e.nalus[e.nalus.length-1]);this.g=d}}return a?this.g:(a=this.g,this.g=[],
a)}getStartTime(a){if(a=="audio"){a=null;var b=this.gb();b.length&&(a=b[0],a=Math.min(a.dts,a.pts)/9E4);return a}return a=="video"?(a=null,b=this.Nc(!1),b.length&&(a=b[0],a=Math.min(a.dts,a.pts)/9E4),a):null}ld(){return{audio:this.G,video:this.B}}ee(){const a=[];for(const b of this.Nc())a.push(...b.nalus);return a}ci(){Ra("TsParser.getVideoResolution","Please use getVideoInfo function instead.");const a=this.yf();return{height:a.height,width:a.width}}yf(){return this.B=="hvc"?rj(this):tj(this)}};
v("shaka.util.TsParser",vj);vj.syncOffset=mj;vj.probe=nj;vj.prototype.getVideoInfo=vj.prototype.yf;vj.prototype.getVideoResolution=vj.prototype.ci;vj.prototype.getVideoNalus=vj.prototype.ee;vj.prototype.getCodecs=vj.prototype.ld;vj.prototype.getStartTime=vj.prototype.getStartTime;vj.prototype.getVideoData=vj.prototype.Nc;vj.prototype.getAudioData=vj.prototype.gb;vj.prototype.getMetadata=vj.prototype.getMetadata;vj.prototype.parseNalus=vj.prototype.Jf;vj.prototype.parseAvcNalus=vj.prototype.Ei;
vj.prototype.parse=vj.prototype.parse;vj.prototype.setDiscontinuitySequence=vj.prototype.Fe;vj.prototype.clearData=vj.prototype.clearData;vj.Timescale=9E4;var uj=[100,110,122,244,44,83,86,118,128,138,139,134];function wj(){var a=['video/mp4; codecs="avc1.42E01E"','video/mp4; codecs="avc3.42E01E"','video/mp4; codecs="hev1.1.6.L93.90"','video/mp4; codecs="hvc1.1.6.L93.90"','video/mp4; codecs="hev1.2.4.L153.B0"; eotf="smpte2084"','video/mp4; codecs="hvc1.2.4.L153.B0"; eotf="smpte2084"','video/mp4; codecs="hvc1.2.20000000.L153.B0"','video/mp4; codecs="hvc1.2.4.L120.b0"','video/mp4; codecs="hvc1.2.4.L123.b0"','video/mp4; codecs="vp9"','video/mp4; codecs="vp09.00.10.08"','video/mp4; codecs="av01.0.01M.08"',
'video/mp4; codecs="av01.0.31M.10.0.111.09.16.09.0"','video/mp4; codecs="av01.0.31M.10.0.112.09.18.09.0"','video/mp4; codecs="dvh1.05.01"','video/mp4; codecs="dvh1.08.01"','video/mp4; codecs="dav1.10.01"','video/mp4; codecs="dvh1.20.01"','audio/mp4; codecs="mp4a.40.2"','audio/mp4; codecs="ac-3"','audio/mp4; codecs="ec-3"','audio/mp4; codecs="ac-4.02.01.03"','audio/mp4; codecs="opus"','audio/mp4; codecs="flac"','audio/mp4; codecs="dtsc"','audio/mp4; codecs="dtse"','audio/mp4; codecs="dtsx"','audio/mp4; codecs="apac.31.00"',
'video/webm; codecs="vp8"','video/webm; codecs="vp9"','video/webm; codecs="vp09.00.10.08"','audio/webm; codecs="vorbis"','audio/webm; codecs="opus"','video/mp2t; codecs="avc1.42E01E"','video/mp2t; codecs="avc3.42E01E"','video/mp2t; codecs="hvc1.1.6.L93.90"','video/mp2t; codecs="mp4a.40.2"','video/mp2t; codecs="ac-3"','video/mp2t; codecs="ec-3"',"text/vtt",'application/mp4; codecs="wvtt"',"application/ttml+xml",'application/mp4; codecs="stpp"',...ce];const b={};Fa();for(const c of a){if(re(c))b[c]=
!0;else if(kc()){a=ke(c);const d=kf(le(c),a);a=be(a,d);b[c]=Dh(a)||(Wd(a)?!0:!1)}else b[c]=lc(c);a=c.split(";")[0];b[a]=b[a]||b[c]}return b}
function xj(a,b){a.ua=!0;let c;window.ManagedMediaSource?(a.I||(a.g.disableRemotePlayback=!0),c=new ManagedMediaSource,a.u.D(c,"startstreaming",()=>{a.ua=!0}),a.u.D(c,"endstreaming",()=>{a.ua=!1})):c=new MediaSource;a.u.za(c,"sourceopen",()=>{URL.revokeObjectURL(a.va);b.resolve()});a.u.za(a.g,"playing",()=>{a.Wa=!0});a.va=yj(c);zj(a);a.A.useSourceElements?(a.T=Ki(a.va),a.g.appendChild(a.T),a.I&&a.g.appendChild(a.I),a.g.load()):a.g.src=a.va;return c}
async function Aj(a){const b=[];for(const [c,d]of a.m){const e=d[0];a.m.set(c,d.slice(0,1));e&&b.push(e.p.catch(Ee));for(const f of d.slice(1))f.p.reject(new F(2,7,7003,void 0))}a.h&&b.push(a.h.destroy());await Promise.all(b);for(const c of a.j.values())c.destroy();a.u&&(a.u.release(),a.u=null);a.g&&(zj(a),a.g.load(),a.g.disableRemotePlayback=!1);a.g=null;a.T=null;a.I=null;a.A=null;a.i=null;a.h=null;a.Y=null;a.l.clear();a.Aa.clear();a.j.clear();a.H=null;a.m.clear();a.N=null;a.W.clear();a.M=null}
function zj(a){a.g&&(a.g.removeAttribute("src"),a.T?.parentElement===a.g&&a.g.removeChild(a.T),a.I?.parentElement===a.g&&a.g.removeChild(a.I))}function Bj(a,b,c){a.g&&window.ManagedMediaSource&&a.i&&a.A.useSourceElements&&(a.I?.parentElement===a.g&&a.g.removeChild(a.I),a.I=Ki(b,c),a.g.appendChild(a.I),a.g.disableRemotePlayback=!1)}function Cj(a){return a.F?!1:a.i?a.i.readyState=="ended":!0}function Dj(a){return a.F?!1:a.i?a.i.readyState=="closed":!0}
function Ej(a,b,c,d){b=="audio"&&d&&(d=kf(d,c.mimeType));b=="video"&&d&&c.mimeType=="video/mp4"&&(d=lf(d));var e=be(c.mimeType,d);if(b==G)Fj(a,e,a.G,c.external);else{var f=a.A.forceTransmux;if(!Dh(e)||!a.G&&ce.includes(e))f=!0;var g=de(c.mimeType,d);if(f){f=Zb("audio",(d||"").split(","));d=Zb("video",(d||"").split(","));if(f&&d){a.o=!0;Ej(a,"audio",c,f);Ej(a,"video",c,d);return}if(d=Wd(g))e=d(),a.j.set(b,e),e=e.convertCodecs(b,g)}g=e+a.A.addExtraFeaturesToSourceBuffer(e);kg(a.C);let h;try{h=a.i.addSourceBuffer(g)}catch(k){throw new F(2,
3,3015,k,"The mediaSource_ status was "+a.i.readyState+" expected 'open'",null);}a.G&&(h.mode=Gj);a.u.D(h,"error",()=>{const k=a.m.get(b)[0];k.p.reject(new F(2,3,3014,a.g.error?a.g.error.code:0,k.uri))});a.u.D(h,"updateend",()=>Hj(a,b));a.l.set(b,h);a.B.set(b,e);a.Aa.set(b,!!c.drmInfos.length)}}
function Fj(a,b,c,d){a.h||(a.h=new ze(a.Y),a.h&&(a.h.B=a.A.modifyCueCallback));var e=a.h,f=a.Ba;a=a.O;b=="application/cea-608"||b=="application/cea-708"?e.i=null:(e.i=pe.get(b)(),e.i.setSequenceMode?e.i.setSequenceMode(c):Ra("Text parsers w/ setSequenceMode",'Text parsers should have a "setSequenceMode" method!'),e.i.setManifestType?e.i.setManifestType(a):Ra("Text parsers w/ setManifestType",'Text parsers should have a "setManifestType" method!'),e.F=f,e.A=d)}
function Hj(a,b){if(a.F||a.C.g){var c=a.m.get(b);c&&c.length&&((c=c[0])&&c.p&&c.p.resolve(),a.m.set(b,[]))}else if(c=a.m.get(b)[0])c.p.resolve(),Ij(a,b)}function Jj(a){return a.ua&&!a.K&&!a.F}function Kj(a,b){if(a.F||a.K||Dj(a))return null;try{return a.l.get(b).buffered}catch(c){return a.l.has(b),null}}function Lj(a,b){return a.l.size?b==G?a.h.g:Ei(Kj(a,b)):null}function Mj(a,b){return a.l.size?b==G?a.h.h:Fi(Kj(a,b)):null}
function Nj(a,b,c){if(b==G)return a=a.h,a.h==null||a.h<c?0:a.h-Math.max(c,a.g);a=Kj(a,b);return Hi(a,c)}
function Oj(a,b,c,d){const e=Zi(b.startTime,c.startTime+b.presentationTimeDelta/b.timescale);d&&a.O=="HLS"&&!e&&(c=-d+c.startTime,b.startTime+=c,b.endTime+=c);a.M.Bi(b);!b.messageData||b.schemeIdUri!="https://aomedia.org/emsg/ID3"&&b.schemeIdUri!="https://developer.apple.com/streaming/emsg-id3"||(c=Wi(b.messageData),c.length&&(d=b.startTime,a.M.onMetadata([{cueTime:d,data:b.messageData,frames:c,dts:d,pts:d}],0,b.endTime)))}
function Pj(a,b,c,d,e,f,g=!1){let h=null;var k=[],l=C(c);if(ce.includes(f))c=Wi(l),c.length&&d&&((g=c.find(m=>m.description==="com.apple.streaming.transportStreamTimestamp"))&&typeof g.data=="number"&&(h=Math.round(g.data)/1E3),a.M.onMetadata([{cueTime:d.startTime,data:l,frames:c,dts:d.startTime,pts:d.startTime}],0,d.endTime));else if(f.includes("/mp4")&&d&&d.$){l=new Dg;const m=e.emsgSchemeIdUris!=null&&e.emsgSchemeIdUris.length>0||a.A.dispatchAllEmsgBoxes,n=[];m&&l.ka("emsg",t=>{a:{var u=e.emsgSchemeIdUris;
let y,w,z,A,B,D;if(t.version===0){z=t.reader.Wc();D=t.reader.Wc();var x=t.reader.V();B=t.reader.V();w=t.reader.V();y=t.reader.V();A=d.startTime+B/x}else x=t.reader.V(),A=t.reader.Xc()/x+d.timestampOffset,B=A-d.startTime,w=t.reader.V(),y=t.reader.V(),z=t.reader.Wc(),D=t.reader.Wc();t=t.reader.Bb(t.reader.getLength()-t.reader.Ka(),!0);if(u&&u.includes(z)||a.A.dispatchAllEmsgBoxes)if(z=="urn:mpeg:dash:event:2012")a.M.Di();else{u=A;if(z!=="https://aomedia.org/emsg/ID3"||w!==4294967295)u+=w/x;x={startTime:A,
endTime:u,schemeIdUri:z,value:D,timescale:x,presentationTimeDelta:B,eventDuration:w,id:y,messageData:t};break a}x=null}x&&n.push(x)});const p=d.$.timescale;b=p&&!isNaN(p);let r=0,q=!1;b&&l.ka("prft",t=>{var u=t.reader,x=t.version;u.V();t=u.V();const y=u.V();t=t*1E3+y/2**32*1E3;x===0?u=u.V():(x=u.V(),u=u.V(),u=x*4294967296+u);t=$i(t);u=(new Map).set("detail",{wallClockTime:t,programStartDate:new Date(t-u/p*1E3)});u=new L("prft",u);a.M.onEvent(u)}).boxes(["moof","traf"],vg).ka("tfdt",t=>{q||(r=Hh(t.reader,
t.version).baseMediaDecodeTime/p,q=!0,m||t.parser.stop())});(m||b)&&l.parse(c,!1,g);q&&d.timestampOffset==0&&(h=r);for(const t of n)Oj(a,t,d,h)}else f.includes("/mp4")||f.includes("/webm")||!nj(l)||(a.W.has(b)||a.W.set(b,new vj),k=a.W.get(b),k.clearData(),k.Fe(d.i),k.parse(l),l=k.getStartTime(b),l!=null&&(h=l),k=k.getMetadata());return{timestamp:h,metadata:k}}
async function Qj(a,b,c,d,e,f,g=!1,h=!1,k=!1,l=!1,m){if(b==G)a.O=="HLS"&&(g=await a.Na,a.h.u=g),await se(a.h,c,d?d.startTime:null,d?d.endTime:null,d?d.P()[0]:null);else if(!l&&a.o)await Qj(a,"audio",c,d,e,f,g,h,k,!0),await Qj(a,"video",c,d,e,f,g,h,k,!0);else if(a.l.has(b)){var n=a.l.get(b).timestampOffset;l=a.B.get(b);a.j.has(b)&&(l=a.j.get(b).getOriginalMimeType());if(d){const {timestamp:r,metadata:q}=Pj(a,b,c,d,e,l,k);if(r!=null){if(a.S==null&&b=="video"&&(a.S=r,a.qa=d.startTime,a.R!=null)){var p=
0;a.qa==a.ha&&(p=a.S-a.R);a.ea.resolve(p)}a.R==null&&b=="audio"&&(a.R=r,a.ha=d.startTime,a.S!=null&&(p=0,a.qa==a.ha&&(p=a.S-a.R),a.ea.resolve(p)));p=r;!a.G&&ce.includes(a.B.get(b))&&(p=0);p=d.startTime-p;(Math.abs(n-p)>=.001||g||h)&&(!k||p>0||!n)&&(n=p,a.Ra&&(Rj(a,b,()=>Sj(a,b),null),Rj(a,b,()=>Tj(a,b,n),null)));b!="video"&&a.l.has("video")||a.Na.resolve(n)}if(q.length)a.M.onMetadata(q,n,d?d.endTime:null)}f&&b=="video"&&(a.h||Fj(a,"application/cea-608",a.G,!1),a.H||(a.H=new vc(l.split(";",1)[0])),
d?(f=tc(a.H,c),f.length&&ye(a.h,f,n)):a.H.init(c,h,m));if(a.j.has(b))if(f=await a.j.get(b).transmux(c,e,d,a.i.duration,b),ArrayBuffer.isView(f))c=f;else{if(f.init!=null){const r=f.init;Rj(a,b,()=>{Uj(a,r,n,e);a.l.get(b).appendBuffer(r)},d?d.P()[0]:null)}c=f.data}c=Vj(a,e,c,d,b);if(d&&a.G&&b!=G&&(g||h)){let r=d.startTime;a.O=="HLS"&&!a.o&&b=="audio"&&a.l.has("video")&&(g=await a.ea,Math.abs(g)>.15&&(r-=g));Rj(a,b,()=>Sj(a,b),null);Rj(a,b,()=>Tj(a,b,r),null)}await Rj(a,b,()=>{var r=c;Uj(a,r,n,e);a.l.get(b).appendBuffer(r)},
d?d.P()[0]:null)}}function Rj(a,b,c,d){kg(a.C);c={start:c,p:new Lf,uri:d};a.m.get(b).push(c);a.m.get(b).length==1&&Wj(a,b);return c.p}function Sj(a,b){const c=a.l.get(b),d=c.appendWindowStart,e=c.appendWindowEnd;c.abort();c.appendWindowStart=d;c.appendWindowEnd=e;Hj(a,b)}function Tj(a,b,c){c<0&&(c+=.001);a.l.get(b).timestampOffset=c;Hj(a,b)}
function Vj(a,b,c,d,e){if(fe(a.B.get(e))!="mp4")return c;const f=d===null,g=a.Aa.get(e),h=a.M.Lh();let k=!1;d&&d.$&&(k=d.$.encrypted);d=d?d.P()[0]:null;const l=Fa();a.A.correctEc3Enca&&f&&e==="audio"&&(c=pi(c));a.A.insertFakeEncryptionInInit&&g&&l.G(h,e)&&(f?c=qi(b,c,d):!k&&l.qa(e)&&(c=ti(c)));f&&l.I()&&(c=wi(c));return c}function Xj(a,b){const c=Mj(a,"video")||0;we(a.h,b,c)}function Yj(a){a.h&&we(a.h,"",0)}
function Zj(a,b,c,d){if(d<=c)Hj(a,b);else{if(a.N){var e=a.N;b==="video"&&e.g&&e.g.flushBuffer(c,d)}a.l.get(b).remove(c,d)}}async function ak(a,b){b==G?a.h&&await a.h.remove(0,Infinity):(b==="video"&&a.H&&a.h&&await a.h.remove(0,Infinity,!0),await Rj(a,b,()=>Zj(a,b,0,a.i.duration),null),a.o&&await Rj(a,"audio",()=>Zj(a,"audio",0,a.i.duration),null))}function bk(a){a.H&&a.H.g.clear()}
async function ck(a,b,c,d,e){const {type:f,Sb:g,ve:h}=dk(a,b,c,d,e);if(c=e.get("audio"))a.o=c.isAudioMuxedInVideo;if(f==ek)return a.j.has(b)&&!g?(a.j.get(b).destroy(),a.j.delete(b)):!a.j.has(b)&&g?a.j.set(b,g):g&&(a.j.has(b)&&a.j.get(b).transmux!==g.transmux?(a.j.get(b).destroy(),a.j.set(b,g)):g.destroy()),!1;f==fk?await gk(a,b,h,g):f==hk&&(g&&g.destroy(),await ik(a,e));return!0}
function jk(a,b,c,d){const e=a.l.get(b);if(e.appendWindowEnd!==d||e.appendWindowStart!==c)e.appendWindowStart=0,e.appendWindowEnd=d,e.appendWindowStart=c;Hj(a,b)}
async function kk(a,b,c,d,e,f,g,h,k){if(b==G)f||(a.h.u=c),ve(a.h,d,e);else{var l=[];await ck(a,b,g,h,k)||(l.push(Rj(a,b,()=>Sj(a,b),null)),a.o&&l.push(Rj(a,"audio",()=>Sj(a,"audio"),null)));f||(l.push(Rj(a,b,()=>Tj(a,b,c),null)),a.o&&l.push(Rj(a,"audio",()=>Tj(a,"audio",c),null)));if(d!=0||e!=Infinity)l.push(Rj(a,b,()=>jk(a,b,d,e),null)),a.o&&l.push(Rj(a,"audio",()=>jk(a,"audio",d,e),null));l.length&&await Promise.all(l)}}
async function lk(a,b,c){if(b!=G&&(b=="video"&&(a.Na=new Lf),a.G)){var d=Mj(a,b);d&&Math.abs(d-c)<.15||(Rj(a,b,()=>Sj(a,b),null),a.o&&Rj(a,"audio",()=>Sj(a,"audio"),null),await Rj(a,b,()=>Tj(a,b,c),null),a.o&&await Rj(a,"audio",()=>Tj(a,"audio",c),null))}}
async function mk(a,b){kg(a.C);const c=[],d=Array.from(a.l.keys()),e=new Map;for(const f of d){const g=new Lf,h={start:()=>g.resolve(),p:g,uri:null},k=a.m.get(f);k.push(h);c.push(g);e.set(f,h);k.length==1&&h.start()}try{await Promise.all(c)}catch(f){if(a.C.g){for(const g of d)b=a.m.get(g),e.has(g)&&sa(b,e.get(g));return}throw f;}try{await b()}catch(f){throw new F(2,3,3015,f,a.g.error||"No error in the media element",null);}finally{for(const f of d)Ij(a,f)}}
async function nk(a,b,c){a.C.g||a.g.error||a.K||a.F||Cj(a)||Dj(a)||await mk(a,()=>{Cj(a)||Dj(a)||a.i.setLiveSeekableRange(b,c)})}async function ok(a){a.C.g||a.g.error||a.K||a.F||Cj(a)||Dj(a)||await mk(a,()=>{Cj(a)||Dj(a)||a.i.clearLiveSeekableRange()})}function Uj(a,b,c,d){a.N&&(a=a.N,d.type!=="video"||a.o&&!d.baseOriginalId||a.g&&a.g.appendBuffer(b,"video",d.id,-c,!a.o))}function Ij(a,b){a.m.get(b).shift();Wj(a,b)}
function Wj(a,b){const c=a.m.get(b)[0];if(c)try{c.start()}catch(d){d.name=="QuotaExceededError"?c.p.reject(new F(2,3,3017,b)):Jj(a)?c.p.reject(new F(2,3,3015,d,a.g.error||"No error in the media element",c.uri)):c.p.reject(new F(2,3,3024,b)),Ij(a,b)}}function pk(a,b){a.Y=b;a.h&&(a.h.l=b)}
function gk(a,b,c,d){return Rj(a,b,()=>{if(b!==G){a.B.get(b);if(Fa().l()){a.j.has(b)&&(a.j.get(b).destroy(),a.j.delete(b));d&&a.j.set(b,d);const e=c+a.A.addExtraFeaturesToSourceBuffer(c);a.l.get(b).changeType(e);a.B.set(b,c)}Hj(a,b)}},null)}
async function qk(a,b){if(!a.F&&!a.K){a.F=!0;a.o=!1;var c=a.g.currentTime,d=a.g.autoplay;a.g.paused||(a.Ha=!0);a.Wa&&(a.g.autoplay=!1);try{a.u.La();for(const n of a.j.values())n.destroy();for(const n of a.l.values())try{a.i.removeSourceBuffer(n)}catch(p){}a.j.clear();a.l.clear();const e=a.i.duration;a.J=new Lf;a.i=xj(a,a.J);await a.J;!isNaN(e)&&e?a.i.duration=e:!isNaN(a.sa)&&a.sa&&(a.i.duration=a.sa);const f=new Lf,g=a.i.sourceBuffers,h=b.size;let k=0;const l=()=>{k++;k===h&&(f.resolve(),a.u.Ja(g,
"addsourcebuffer",l))};a.u.D(g,"addsourcebuffer",l);for(const n of b.keys()){const p=b.get(n);Ej(a,n,p,p.codecs)}const m=b.get("audio");m&&m.isAudioMuxedInVideo&&(a.o=!0);a.o&&!a.m.has("audio")&&a.m.set("audio",[]);await f}finally{a.F=!1,kg(a.C),a.u.za(a.g,"loadedmetadata",()=>{a.C.g||(a.g.currentTime=c)}),a.u.za(a.g,"canplaythrough",()=>{a.C.g||(a.g.autoplay=d,a.Ha&&(a.Ha=!1,a.g.play()))})}}}function ik(a,b){return mk(a,()=>qk(a,b))}
function rk(a,b,c,d){let e,f=!1;const g=Zb("audio",(d||"").split(",")),h=Zb("video",(d||"").split(","));var k=h;b=="audio"&&(k=g);k||=d;let l=be(c,k);const m=ke(a.B.get(b));let n=a.A.forceTransmux;!Dh(l)||!a.G&&ce.includes(l)?n=!0:n||c==m||(n=!Fa().N()&&ce.includes(c));n&&(a=de(c,k),k=Wd(a))&&(e=k(),g&&h&&(f=!0),l=e.convertCodecs(b,a));!e&&b==="video"&&g&&(l=be(c,d));b=ge(le(l));return{Sb:e,bj:f,mg:ke(l),codec:b,mimeType:l}}
function dk(a,b,c,d,e){if(b==G)return{type:ek,ve:c,Sb:null};var f=ge(le(a.B.get(b)));const g=ke(a.B.get(b));var h=rk(a,b,c,d);const k=h.Sb,l=h.bj,m=h.mg,n=h.codec;h=h.mimeType;var p=!0;l&&a.B.has("audio")&&(c=rk(a,"audio",c,d),d=ge(le(a.B.get("audio"))),p=ke(a.B.get("audio")),p=d==c.codec&&p==c.mg,c.Sb&&c.Sb.destroy());if(f===n&&g===m&&p)return{type:ek,ve:h,Sb:k};f=!0;if(a.o&&!e.has("audio")||l&&k&&!a.j.has(b))f=!1;b=Fa();if(f&&a.A.codecSwitchingStrategy==="smooth"&&b.l())return{type:fk,ve:h,Sb:k};
k&&k.destroy();return{type:hk,ve:h,Sb:null}}function sk(a,b,c,d,e){a=dk(a,b,c,d,e);a.Sb&&a.Sb.destroy();return a.type==hk}
var tk=class{constructor(a,b,c,d,e){this.g=a;this.M=c;this.A=d;this.Y=b;this.l=new Map;this.B=new Map;this.Aa=new Map;this.h=null;this.Ba=!1;this.N=e||null;this.m=new Map;this.u=new Aa;this.j=new Map;this.H=null;this.J=new Lf;this.va="";this.Wa=!1;this.ua=!0;this.K=!1;this.I=this.T=null;this.i=xj(this,this.J);this.Ha=this.F=!1;this.C=new lg(()=>Aj(this));this.G=!1;this.O="UNKNOWN";this.Ra=this.Va=!1;this.Na=new Lf;this.o=!1;this.sa=null;this.W=new Map;this.ha=this.R=this.qa=this.S=null;this.ea=new Lf;
this.g.remote&&(this.K=this.g.remote.state!="disconnected",this.u.D(this.g.remote,"connect",()=>{this.K=this.g.remote.state!="disconnected"}),this.u.D(this.g.remote,"connecting",()=>{this.K=this.g.remote.state!="disconnected"}),this.u.D(this.g.remote,"disconnect",()=>{this.K=this.g.remote.state!="disconnected"}))}destroy(){return this.C.destroy()}async init(a,b=!1,c="UNKNOWN",d=!1){await this.J;if(Cj(this)||Dj(this))ia("Expected MediaSource to be open during init(); reopening the media source."),
this.J=new Lf,this.i=xj(this,this.J),await this.J;this.G=b;this.O=c;this.Va=d;this.Ra=!this.G&&this.O=="HLS"&&!this.Va;this.W.clear();this.ha=this.R=this.qa=this.S=null;this.ea=new Lf;for(const e of a.keys())b=a.get(e),Ej(this,e,b,b.codecs),this.o?(this.m.set("audio",[]),this.m.set("video",[])):this.m.set(e,[]);(a=a.get("audio"))&&a.isAudioMuxedInVideo&&(this.o=!0)}configure(a){this.A=a;this.h&&(this.h.B=a.modifyCueCallback)}fc(){const a={total:this.F?[]:Ii(this.g.buffered),audio:Ii(Kj(this,"audio")),
video:Ii(Kj(this,"video")),text:[]};if(this.h){const b=this.h.g,c=this.h.h;b!=null&&c!=null&&a.text.push({start:b,end:c})}return a}async remove(a,b,c,d){a=="video"&&this.H&&(this.H.remove(d),this.h.remove(this.h.g||0,c,!0));a==G?await this.h.remove(b,c):c>b&&(await Rj(this,a,()=>Zj(this,a,b,c),null),this.o&&await Rj(this,"audio",()=>Zj(this,"audio",b,c),null))}async flush(a){a!=G&&(await Rj(this,a,()=>{this.g.currentTime-=.001;Hj(this,a)},null),this.o&&await Rj(this,"audio",()=>{this.g.currentTime-=
.001;Hj(this,"audio")},null))}async endOfStream(a){await mk(this,()=>{Cj(this)||Dj(this)||(a?this.i.endOfStream(a):this.i.endOfStream())})}async jb(a){await mk(this,()=>{if(this.A.durationReductionEmitsUpdateEnd&&a<this.i.duration)for(const b of this.l.keys()){const c={start:()=>{},p:new Lf,uri:null};this.m.get(b).unshift(c)}this.sa=this.i.duration=a})}getDuration(){return this.i.duration}},yj=window.URL.createObjectURL,Gj="sequence",ek="none",hk="reset",fk="changeType";var Q=class{constructor(a,b,c=!0){this.i=a;this.C=b;this.u=this.l=Infinity;this.h=1;this.g=this.j=null;this.A=0;this.B=!0;this.I=!1;this.H=0;this.F=c;this.G=0;this.o=!1;this.m=a}getDuration(){return this.l}Nh(){return this.h}Ug(a){this.i=a}jb(a){this.l=a}Sh(){return this.i}Tg(a){this.A=a}Ac(a){a&&!this.B&&(this.I=!0);this.B=a}Ge(a){this.u=a}ce(){return this.u}Xf(a){this.C=a}Fh(){return this.C}Mg(a,b){if(a.length!=0){var c=(Date.now()+this.A)/1E3;a=a.filter(e=>e.start+b<c);if(a.length!=0){var d=a[a.length-
1].end+b;this.we(a[0].start+b);this.h=a.reduce((e,f)=>Math.max(e,f.end-f.start),this.h);this.g=Math.max(this.g,d);this.i!=null&&this.F&&!this.o&&(this.i=c-this.g-this.h)}}}wd(a){if(a.length!=0){var b=a[0].startTime,c=a[0].endTime,d=(Date.now()+this.A)/1E3;for(const e of a)d<e.startTime||(b=Math.min(b,e.startTime),c=Math.max(c,e.endTime),this.h=Math.max(this.h,e.endTime-e.startTime));this.we(b);this.g=Math.max(this.g,c);this.i!=null&&this.F&&!this.o&&(this.i=d-this.g-this.h)}}Lg(a,b){this.we(a);b==
Infinity||this.U()||(this.g=Math.max(this.g,b))}Oh(){return this.g}pe(){this.o=!0}oi(){return this.o}Yf(a){this.m=a}Kh(){return this.m}we(a){this.j==null?this.j=a:this.I||(this.j=Math.min(this.j,a))}Ff(a){this.h=Math.max(this.h,a)}offset(a){this.j!=null&&(this.j+=a);this.g!=null&&(this.g+=a)}U(){return this.l==Infinity&&!this.B}vc(){return this.l!=Infinity&&!this.B}ub(){return Math.max(this.H,this.jc()-this.u)}Xg(a){this.H=a}jc(){return this.U()||this.vc()?Math.min(Math.max(0,(Date.now()+this.A)/
1E3-this.h-this.i)+this.G,this.l):this.g?Math.min(this.g,this.l):this.l}od(a){const b=Math.max(this.j,this.H);return this.u==Infinity?Math.ceil(b*1E3)/1E3:Math.max(b,Math.min(this.jc()-this.u+a,this.sb()))}Ib(){return this.od(0)}sb(){return Math.max(0,this.jc()-(this.U()||this.vc()?this.C:0))}dh(){return this.i==null||this.g!=null&&this.F?!1:!0}Sg(a){this.G=a}Ah(){return this.G}};v("shaka.media.PresentationTimeline",Q);Q.prototype.getAvailabilityTimeOffset=Q.prototype.Ah;
Q.prototype.setAvailabilityTimeOffset=Q.prototype.Sg;Q.prototype.usingPresentationStartTime=Q.prototype.dh;Q.prototype.getSeekRangeEnd=Q.prototype.sb;Q.prototype.getSeekRangeStart=Q.prototype.Ib;Q.prototype.getSafeSeekRangeStart=Q.prototype.od;Q.prototype.getSegmentAvailabilityEnd=Q.prototype.jc;Q.prototype.setUserSeekStart=Q.prototype.Xg;Q.prototype.getSegmentAvailabilityStart=Q.prototype.ub;Q.prototype.isInProgress=Q.prototype.vc;Q.prototype.isLive=Q.prototype.U;Q.prototype.offset=Q.prototype.offset;
Q.prototype.notifyMaxSegmentDuration=Q.prototype.Ff;Q.prototype.notifyMinSegmentStartTime=Q.prototype.we;Q.prototype.getInitialProgramDateTime=Q.prototype.Kh;Q.prototype.setInitialProgramDateTime=Q.prototype.Yf;Q.prototype.isStartTimeLocked=Q.prototype.oi;Q.prototype.lockStartTime=Q.prototype.pe;Q.prototype.getMaxSegmentEndTime=Q.prototype.Oh;Q.prototype.notifyPeriodDuration=Q.prototype.Lg;Q.prototype.notifySegments=Q.prototype.wd;Q.prototype.notifyTimeRange=Q.prototype.Mg;Q.prototype.getDelay=Q.prototype.Fh;
Q.prototype.setDelay=Q.prototype.Xf;Q.prototype.getSegmentAvailabilityDuration=Q.prototype.ce;Q.prototype.setSegmentAvailabilityDuration=Q.prototype.Ge;Q.prototype.setStatic=Q.prototype.Ac;Q.prototype.setClockOffset=Q.prototype.Tg;Q.prototype.getPresentationStartTime=Q.prototype.Sh;Q.prototype.setDuration=Q.prototype.jb;Q.prototype.setPresentationStartTime=Q.prototype.Ug;Q.prototype.getMaxSegmentDuration=Q.prototype.Nh;Q.prototype.getDuration=Q.prototype.getDuration;function uk(a){if(!a.h.stallEnabled)return null;const b=a.h.stallThreshold,c=a.h.stallSkip;return new vk(new wk(a.g),b,async()=>{if(Ii(a.g.buffered).length){if(c)a.g.currentTime+=c;else{await a.g.play();if(!a.g)return;a.g.pause();a.g.play()}a.G++;a.u(new L("stalldetected"))}})}
function xk(a){if(a.g.readyState!=0){if(a.g.seeking){if(!a.o)return}else a.o=!1;if(!a.g.paused||a.g.currentTime==a.m&&(a.g.autoplay||a.g.currentTime!=a.m))if(!a.j||!yk(a.j)){var b=a.g.currentTime,c=a.g.buffered,d=Ji(c,b,a.h.gapDetectionThreshold);if(d==null&&a.j&&!yk(a.j)){var e=Ii(c);for(var f=0;f<e.length-1;f++)if(Math.abs(b-e[f].end)<.1&&e[f+1].start>e[f].end){d=f+1;break}}d==null||d==0&&!a.A||(e=c.start(d),(f=a.h.gapPadding)&&(e=Math.ceil((e+f)*100)/100),e>=a.C.sb()||e-b<.001||(d!=0&&c.end(d-
1),zk(a,e),b==a.m&&(a.m=e),a.F++,a.u(new L("gapjumped"))))}}}function zk(a,b){a.B=!0;a.l.za(a.g,"seeked",()=>{a.B=!1});a.g.currentTime=b}
var Ak=class{constructor(a,b,c,d){this.u=d;this.g=a;this.C=b;this.h=c;this.l=new Aa;this.o=!1;this.m=0;this.B=!1;this.G=this.F=0;this.j=uk(this);this.A=!1;this.l.D(a,"waiting",()=>xk(this));this.i=(new Ce(()=>{xk(this)})).Da(this.h.gapJumpTimerTime)}release(){this.l&&(this.l.release(),this.l=null);this.i!=null&&(this.i.stop(),this.i=null);this.j&&(this.j.release(),this.j=null);this.g=this.C=this.u=null}Sc(){this.A=!0;this.i&&this.i.Da(this.h.gapJumpTimerTime);xk(this)}};
function yk(a){const b=a.h;var c=Bk(b),d=b.g.currentTime;const e=Date.now()/1E3;if(a.g!=d||a.m!=c)a.l=e,a.g=d,a.m=c,a.i=!1;d=e-a.l;if(c=d>=a.o&&c&&!a.i)a.j&&a.j(a.g,d),a.i=!0,a.g=b.g.currentTime;return c}var vk=class{constructor(a,b,c){this.h=a;this.m=Bk(a);this.g=a.g.currentTime;this.l=Date.now()/1E3;this.i=!1;this.o=b;this.j=c}release(){this.h&&this.h.release();this.j=this.h=null}};
function Bk(a){if(a.g.paused||a.g.playbackRate==0||a.i||a.g.buffered.length==0)var b=!1;else a:{b=a.g.buffered;a=a.g.currentTime;for(const {start:c,end:d}of Ii(b))if(!(a<c-.1||a>d-.5)){b=!0;break a}b=!1}return b}var wk=class{constructor(a){this.g=a;this.h=new Aa;this.i=!1;this.h.D(this.g,"audiofocuspaused",()=>{this.i=!0});this.h.D(this.g,"audiofocusgranted",()=>{this.i=!1});this.h.D(this.g,"audiofocuslost",()=>{this.i=!0})}release(){this.h&&this.h.release();this.h=null}};function Ck(a,b,c,d){b==HTMLMediaElement.HAVE_NOTHING||a.readyState>=b?d():(b=Dk.value().get(b),c.za(a,b,d))}var Dk=new Ea(()=>new Map([[HTMLMediaElement.HAVE_METADATA,"loadedmetadata"],[HTMLMediaElement.HAVE_CURRENT_DATA,"loadeddata"],[HTMLMediaElement.HAVE_FUTURE_DATA,"canplay"],[HTMLMediaElement.HAVE_ENOUGH_DATA,"canplaythrough"]]));function Ek(a,b){Math.abs(a.g.currentTime-b)<.001?Fk(a):(a.h.za(a.g,"seeking",()=>{Fk(a)}),Gk(a.i,a.g.currentTime&&a.g.currentTime!=0?a.g.currentTime:b))}function Hk(a){return a.o?a.g.currentTime:a.j()}function Ik(a,b){a.g.readyState>0?Gk(a.i,b):Ck(a.g,HTMLMediaElement.HAVE_METADATA,a.h,()=>{Ek(a,a.j())})}function Fk(a){a.o=!0;a.h.D(a.g,"seeking",()=>a.m());a.u(a.g.currentTime)}
var Kk=class{constructor(a,b,c,d){this.g=a;this.m=b;this.u=c;this.l=null;this.j=()=>{this.l==null&&(this.l=d());return this.l};this.o=!1;this.h=new Aa;this.i=new Jk(a);Ck(this.g,HTMLMediaElement.HAVE_METADATA,this.h,()=>{Ek(this,this.j())})}release(){this.h&&(this.h.release(),this.h=null);this.i!=null&&(this.i.release(),this.i=null);this.m=()=>{};this.g=null}};function Gk(a,b){a.l=a.g.currentTime;a.j=b;a.i=a.m;a.g.currentTime=b;a.h.Da(.1)}
var Jk=class{constructor(a){this.g=a;this.m=10;this.j=this.l=this.i=0;this.h=new Ce(()=>{this.i<=0?this.h.stop():this.g.currentTime!=this.l||this.g.currentTime===this.j?this.h.stop():(this.g.currentTime=this.j,this.i--)})}release(){this.h&&(this.h.stop(),this.h=null);this.g=null}};function Lk(a){return a.g.getStartDate&&(a=a.g.getStartDate().getTime(),!isNaN(a))?a/1E3:null}function Mk(a,b){a=a.g.seekable;a.length>0&&(b=Math.max(a.start(0),b),b=Math.min(a.end(a.length-1),b));return b}
var Nk=class{constructor(a){this.g=a;this.i=!1;this.h=null;this.j=new Aa}ready(){const a=()=>{if(this.h==null||this.h==0&&this.g.duration!=Infinity)this.i=!0;else{const b=this.g.currentTime;let c=null;if(typeof this.h==="number")c=this.h;else if(this.h instanceof Date){const d=Lk(this);d!==null&&(c=this.h.getTime()/1E3-d,c=Mk(this,c))}c==null?this.i=!0:(c<0&&(c=Math.max(0,b+c)),b!=c?(this.j.za(this.g,"seeking",()=>{this.i=!0}),this.g.currentTime=c):this.i=!0)}};Ck(this.g,HTMLMediaElement.HAVE_FUTURE_DATA,
this.j,()=>{a()})}release(){this.j&&(this.j.release(),this.j=null);this.g=null}u(a){this.h=this.i?this.h:a}m(){let a=this.i?this.g.currentTime:this.h;a instanceof Date&&(a=a.getTime()/1E3-(Lk(this)||0),a=Mk(this,a));return a||0}G(){return 0}C(){return 0}F(){return!1}I(){}H(){const a=Fi(this.g.buffered);return a!=null&&a>=this.g.duration-1}};
function Ok(a,b){b==null?b=a.g.getDuration()<Infinity?a.g.Ib():a.g.sb():b instanceof Date?b=b.getTime()/1E3-(a.g.m||a.g.i):b<0&&(b=a.g.sb()+b);return Pk(a,Qk(a,b))}function Qk(a,b){const c=a.g.Ib();if(b<c)return c;a=a.g.sb();return b>a?a:b}function Pk(a,b){const c=a.g.getDuration();return b>=c?c-a.l.durationBackoff:b}
function Rk(a,b){var c=a.l.rebufferingGoal;const d=a.l.safeSeekOffset;let e=a.g.Ib();const f=a.g.sb(),g=a.g.getDuration();f-e<3&&(e=f-3);const h=a.g.od(c),k=a.g.od(d);c=a.g.od(c+d);return b>=g?Pk(a,b):b>f?f-a.l.safeSeekEndOffset:b<e?a.g.U()&&a.l.returnToEndOfLiveWindowWhenOutside?f-a.l.safeSeekEndOffset:Gi(a.h.buffered,k)?k:c:b>=h||Gi(a.h.buffered,b)?b:c}
var Sk=class{constructor(a,b,c,d,e,f){this.h=a;this.g=b.presentationTimeline;this.l=c;this.B=e;this.A=null;this.i=new Ak(a,b.presentationTimeline,c,f);this.j=new Kk(a,()=>{a:{var g=this.i;g.o=!0;g.A=!1;g.i&&g.i.Da(g.h.gapJumpTimerTime);xk(g);var h=Hk(this.j);g=Rk(this,h);if(!Fh()&&Math.abs(g-h)>.001){h=!1;const k=Fa().sa();if(k){const l=Date.now()/1E3;if(!this.A||this.A<l-k)this.A=l,h=!0}else h=!0;if(h){Ik(this.j,g);g=void 0;break a}}this.B();g=void 0}return g},g=>{var h=this.i;h.g.seeking&&!h.o&&
(h.o=!0,h.m=g);h.i&&h.i.Da(h.h.gapJumpTimerTime);xk(h)},()=>Ok(this,d));this.o=new Ce(()=>{if(this.h.readyState!=0&&!this.h.paused){var g=Hk(this.j),h=this.g.Ib(),k=this.g.sb();k-h<3&&(h=k-3);g<h&&(g=Rk(this,g),this.h.currentTime=g)}})}ready(){this.o.Da(.25)}release(){this.j&&(this.j.release(),this.j=null);this.i&&(this.i.release(),this.i=null);this.o&&(this.o.stop(),this.o=null);this.h=this.j=this.g=this.l=null;this.B=()=>{}}u(a){Ik(this.j,Ok(this,a))}m(){const a=Hk(this.j);return this.h.readyState>
0&&!this.h.paused?Qk(this,a):a}G(){return this.i.G}C(){return this.i.F}F(){return this.i.B}I(){this.i.Sc()}H(){if(this.g.U()){const a=this.g.jc(),b=Fi(this.h.buffered);if(b!=null&&b>=a)return!0}return!1}};function Tk(a,b,c){a=new M(a,a+b,()=>c,0,null,null,a,a,a+b);return new Uk([a])}
var Uk=class{constructor(a){this.g=a;this.m=null;this.i=0;this.o=!1}getNumReferences(){return this.g.length}getNumEvicted(){return this.i}release(){this.o||(this.g=[],this.m&&this.m.stop(),this.m=null)}wi(){this.o=!0}fb(a){for(const b of this.g)a(b)}qb(){return this.g[0]||null}find(a){var b=this.g.length-1;if(b<0)return null;if(a<this.g[0].startTime)return this.i;const c=wa(this.g,e=>e.startTime<=a)-1;if(c<0)return null;const d=this.g[c];b=c<b?this.g[c+1].startTime:d.endTime;return a>=d.startTime&&
a<b?c+this.i:null}get(a){if(this.g.length==0)return null;a-=this.i;return a<0||a>=this.g.length?null:this.g[a]}offset(a){if(!this.o)for(const b of this.g)b.offset(a)}re(a){if(!this.o&&a.length){var b=Math.round(a[0].startTime*1E3)/1E3,c=wa(this.g,d=>Math.round(d.startTime*1E3)/1E3<b);this.g.length=c;this.g.push(...a)}}ud(a,b){const c=Math.max(b,this.g.length>0?this.g[0].startTime:-Infinity);let d=0;for(;d<a.length&&a[d].endTime<=c;)d++;d>0&&(a=a.slice(d));this.re(a);this.Oa(b)}Oa(a){if(!this.o){var b=
wa(this.g,c=>c.endTime<=a);b>0&&(this.i+=b,this.g=this.g.slice(b))}}Ic(a,b,c=!1){if(!this.o){for(;this.g.length;)if(this.g[this.g.length-1].startTime>=b)this.g.pop();else break;var d=wa(this.g,e=>e.endTime<=a);d>0&&(c||(this.i+=d),this.g=this.g.slice(d));this.g.length!=0&&(c=this.g[this.g.length-1],b=new M(c.startTime,b,c.B,c.startByte,c.endByte,c.$,c.timestampOffset,c.appendWindowStart,c.appendWindowEnd,c.g,c.tilesLayout,c.A,c.h,c.status,c.aesKey),b.mimeType=c.mimeType,b.codecs=c.codecs,b.i=c.i,
this.g[this.g.length-1]=b)}}Je(a,b){this.o||(this.m&&this.m.stop(),this.m=new Ce(()=>{const c=b();c?this.g.push(...c):(this.m.stop(),this.m=null)}),this.m.Da(a))}[Symbol.iterator](){return this.Fb(0)}Fb(a,b=!1,c=!1){let d=this.find(a);if(d==null)return null;const e=this.get(d);c?d++:d--;let f=-1;if(e&&e.g.length>0)for(let g=e.g.length-1;g>=0;--g){let h=e.g[g];if(a>=h.startTime&&a<h.endTime){if(!b){for(;g&&!h.l;)g--,h=e.g[g];if(!h.l)return ia("No independent partial segment found!"),null}c?d--:d++;
f=g-1;break}}return new Vk(this,d,f,c)}u(){return-1}};v("shaka.media.SegmentIndex",Uk);Uk.forSingleSegment=Tk;Uk.prototype.getIteratorForTime=Uk.prototype.Fb;Uk.prototype.updateEvery=Uk.prototype.Je;Uk.prototype.fit=Uk.prototype.Ic;Uk.prototype.evict=Uk.prototype.Oa;Uk.prototype.mergeAndEvict=Uk.prototype.ud;Uk.prototype.offset=Uk.prototype.offset;Uk.prototype.get=Uk.prototype.get;Uk.prototype.find=Uk.prototype.find;Uk.prototype.markImmutable=Uk.prototype.wi;Uk.prototype.release=Uk.prototype.release;
Uk.prototype.getNumEvicted=Uk.prototype.getNumEvicted;Uk.prototype.getNumReferences=Uk.prototype.getNumReferences;
var Vk=class{constructor(a,b,c,d){this.i=a;this.h=b;this.g=c;this.reverse=d}bd(a){this.reverse=a}sh(){return this.h}current(){let a=this.i.get(this.h);a&&a.g.length>0&&a.m&&this.g>=a.g.length&&(this.h++,this.g=0,a=this.i.get(this.h));return a&&a.g.length>0?a.g[this.g]:a}next(){var a=this.i.get(this.h);this.reverse?a&&a.g.length>0?(this.g--,this.g<0&&(this.h--,this.g=(a=this.i.get(this.h))&&a.g.length>0?a.g.length-1:0)):(this.h--,this.g=0):a&&a.g.length>0?(this.g++,a.m&&this.g==a.g.length&&(this.h++,
this.g=0)):(this.h++,this.g=0);a=this.current();return{value:a,done:!a}}Qf(){var a=this.current();if(a&&a.xc&&!a.l&&(a=this.i.get(this.h))&&a.g.length>0){let b=a.g[this.g];for(;b.l&&!(this.g<=0);)this.g--,b=a.g[this.g]}}};v("shaka.media.SegmentIterator",Vk);Vk.prototype.resetToLastIndependent=Vk.prototype.Qf;Vk.prototype.next=Vk.prototype.next;Vk.prototype.current=Vk.prototype.current;Vk.prototype.currentPosition=Vk.prototype.sh;Vk.prototype.setReverse=Vk.prototype.bd;
function Wk(a,b){for(const c of a.h)b(c)}function Xk(a,b){for(const c of a.h)if(c.find(b)!=null)return c.u();return-1}
var Yk=class extends Uk{constructor(){super([]);this.h=[]}clone(){const a=new Yk;a.h=this.h.slice();a.i=this.i;return a}release(){this.h=[]}fb(a){for(const b of this.h)b.fb(a)}find(a){let b=this.i;for(const c of this.h){const d=c.find(a);if(d!=null)return d+b;b+=c.getNumEvicted()+c.getNumReferences()}return null}get(a){let b=this.i;for(const d of this.h){var c=d.get(a-b);if(c)return c;c=d.getNumReferences();b+=d.getNumEvicted()+c}return null}offset(){}re(){}Oa(a){if(this.h.length){var b=this.h[0];
b.Oa(a);b.getNumReferences()==0&&(this.h.shift(),this.i+=b.getNumEvicted(),b.release(),this.Oa(a))}}ud(){}Ic(){}Je(){}};v("shaka.media.MetaSegmentIndex",Yk);Yk.prototype.updateEvery=Yk.prototype.Je;Yk.prototype.fit=Yk.prototype.Ic;Yk.prototype.mergeAndEvict=Yk.prototype.ud;Yk.prototype.evict=Yk.prototype.Oa;Yk.prototype.merge=Yk.prototype.re;Yk.prototype.offset=Yk.prototype.offset;Yk.prototype.get=Yk.prototype.get;Yk.prototype.find=Yk.prototype.find;Yk.prototype.forEachTopLevelReference=Yk.prototype.fb;
Yk.prototype.release=Yk.prototype.release;function Zk(a){a.i.stop();const b=a.j?0:a.h;if(b>=0&&b<=16)try{a.g.wf()!=b&&a.g.Vg(b);return}catch(c){}a.i.Da(.25);a.g.wf()!=0&&a.g.Vg(0)}var $k=class{constructor(a){this.g=a;this.j=!1;this.h=this.g.wf();this.i=new Ce(()=>{this.g.isPaused()||this.g.zi(this.h*.25)})}release(){this.set(this.Lc());this.i&&(this.i.stop(),this.i=null);this.g=null}set(a){this.h=a;Zk(this)}Lc(){return this.g.Lc()}};function al(a,b){const c=a.j.currentTime;for(const d of a.g)d.j(c,b)}var bl=class{constructor(a){this.j=a;this.h=new Aa;this.g=new Set;this.i=(new Ce(()=>{al(this,!1)})).kb();a.paused||this.i.Da(.25);this.h.D(a,"playing",()=>{this.i.kb().Da(.25)});this.h.D(a,"pause",()=>{this.i.stop()});this.h.D(a,"seeked",()=>{this.i.kb();a.paused||this.i.Da(.25)})}release(){this.h&&(this.h.release(),this.h=null);this.i.stop();for(const a of this.g)a.release();this.g.clear()}};function cl(a){const b={bandwidth:a.bandwidth||0,audioSamplingRate:null,codecs:a.codecs,contentType:a.type,frameRate:null,height:null,mimeType:a.mimeType,channelsCount:null,pixelAspectRatio:null,width:null,label:null,roles:a.roles,language:null};a.type=="video"&&(b.frameRate=a.frameRate||null,b.height=a.height||null,b.pixelAspectRatio=a.pixelAspectRatio||null,b.width=a.width||null);a.type=="audio"&&(b.audioSamplingRate=a.audioSamplingRate,b.channelsCount=a.channelsCount,b.label=a.label||null,b.language=
a.language);return b}function dl(a,b){let c=a.g.get(b);c||(c={zd:[],We:null,contentType:b},a.g.set(b,c));return c}function el(a,b){if((a=a.h()[b.contentType])&&a.length>0){const c=a[0].start,d=a[a.length-1].end,e=b.zd;b.zd=e.filter((f,g)=>f.position<=c&&g+1<e.length&&e[g+1].position<=c||f.position>=d?!1:!0)}else b.zd=[]}function fl(a,b,c){var d=dl(a,b.contentType);el(a,d);a={Qc:b,position:c};d=d.zd;b=d.findIndex(e=>e.position>=c);b>=0?d.splice(b,d[b].position==c?1:0,a):d.push(a)}
function gl(a,b,c){return(a=a.h()[c])&&a.length>0&&(c=a[a.length-1].end,b>=a[0].start&&b<c)?!0:!1}
var hl=class extends Vf{constructor(a){super();this.g=new Map;this.h=a}release(){this.g.clear();super.release()}j(a){for(const f of this.g.values()){var b=f.We;a:{var c=f.zd;for(var d=c.length-1;d>=0;d--){var e=c[d];if(e.position<=a){c=e.Qc;break a}}c=null}d=c&&!(b===c||b&&c&&b.bandwidth==c.bandwidth&&b.audioSamplingRate==c.audioSamplingRate&&b.codecs==c.codecs&&b.contentType==c.contentType&&b.frameRate==c.frameRate&&b.height==c.height&&b.mimeType==c.mimeType&&b.channelsCount==c.channelsCount&&b.pixelAspectRatio==
c.pixelAspectRatio&&b.width==c.width);e=c&&b&&c.label&&b.label&&b.label!==c.label;const g=c&&b&&c.language&&b.language&&b.language!==c.language;b=c&&b&&c.roles&&b.roles&&!xa(b.roles,c.roles);(e||g||b)&&gl(this,a,c.contentType)&&(f.We=c,b=new L("audiotrackchange",new Map([["quality",c],["position",a]])),this.dispatchEvent(b));d&&gl(this,a,c.contentType)&&(f.We=c,JSON.stringify(c),b=new L("qualitychange",new Map([["quality",c],["position",a]])),this.dispatchEvent(b))}}};function il(a){a.g||(a.g=(new Ce(()=>{const b=a.i();for(const [c,d]of a.h)if(d.endTime<b.start){a.h.delete(c);const e=new L("regionremove",new Map([["region",d]]));a.dispatchEvent(e)}!a.h.size&&a.g&&(a.g.stop(),a.g=null)})).Da(2))}function jl(a,b){const c=`${b.schemeIdUri}_${b.id}_${b.startTime.toFixed(1)}_${b.endTime.toFixed(1)}`;a.h.has(c)||(a.h.set(c,b),b=new L("regionadd",new Map([["region",b]])),a.dispatchEvent(b),il(a))}
var kl=class extends Vf{constructor(a){super();this.h=new Map;this.i=a;this.g=null}release(){this.h.clear();this.g&&(this.g.stop(),this.g=null);super.release()}};function ll(a,b){a.l=b;for(const c of a.g.values())c.g=b}function ml(a,b){if(!a.i.segmentIndex||b.Jb()||Array.from(a.j.keys()).some(e=>xi(e,b)))return Promise.resolve();const c=new nl(a.l),d=ol(c,b,a.i);a.j.set(b,c);return d}function pl(a){if(a.g.size){var b=Array.from(a.g.keys());for(const c of a.j.keys())b.some(d=>xi(d.$,c))||ql(a,c)}}
function rl(a,b,c=!1){if(!a.i.segmentIndex)return Promise.resolve();a.h||(a.h=a.i.segmentIndex.Fb(b,!0,a.o));if(!a.h)return Promise.resolve();c&&a.h.next();for(b=[];a.g.size<a.m;){c=a.h.next().value;if(!c)break;var d=!0;c.isPreload()&&c.endByte!=null&&(d=!1);c.Kb()==2&&(d=!1);c.Jb(!1)&&(d=!1);d&&c.$&&b.push(ml(a,c.$));d&&!a.g.has(c)&&(d=new nl(a.l),b.push(ol(d,c,a.i)),a.g.set(c,d));if(!a.u(c,a.i))break}pl(a);return Promise.all(b)}
function ql(a,b){let c=a.g;b instanceof yi&&(c=a.j);a=c.get(b);c.delete(b);a&&a.abort()}function sl(a){var b=a.g;for(const c of b.keys())c&&ql(a,c);b=a.j;for(const c of b.keys())c&&ql(a,c);a.h=null}function tl(a,b){a.m=b;const c=Array.from(a.g.keys());for(;c.length>b;){const d=c.pop();d&&ql(a,d)}pl(a)}function ul(a,b){b&&b!==a.i&&(sl(a),a.i=b)}
var vl=class{constructor(a,b,c,d,e){this.m=a;this.i=b;this.l=c;this.g=new Map;this.j=new Map;this.h=null;this.o=d;a=(f,g)=>g.fastSwitching&&f.xc&&f.td?!1:!0;this.u=e||a}Oa(a,b=!1){for(const c of this.g.keys())a>c.endTime&&ql(this,c);b&&pl(this)}bd(a){this.o=a;this.h&&this.h.bd(a)}};
function ol(a,b,c){let d=new Uint8Array(0);a.xd=a.g(b,c,async e=>{d.byteLength>0?d=Rb(d,e):d=e;a.$f&&(await a.$f(d),d=new Uint8Array(0))});return a.xd.promise.catch(e=>e instanceof F&&e.code==7001?Promise.resolve():Promise.reject(e))}var nl=class{constructor(a){this.g=a;this.xd=this.$f=null}abort(){this.xd&&this.xd.abort()}};v("shaka.config.CrossBoundaryStrategy",{KEEP:"keep",RESET:"reset",RESET_TO_ENCRYPTED:"reset_to_encrypted",RESET_ON_ENCRYPTION_CHANGE:"RESET_ON_ENCRYPTION_CHANGE"});function wl(a){const b=ke(a),c=b.split("/")[0];a=le(a);return{type:c,mimeType:b,codecs:a,language:null,height:null,width:null,channelCount:null,sampleRate:null,closedCaptions:new Map,Gd:null,colorGamut:null,frameRate:null,timescale:null}}
function xl(a,b,c){const d=[];let e=[],f=!1,g=!1;const h=w=>{w=w.toLowerCase();switch(w){case "avc1":case "avc3":e.push(w+".42E01E");g=!0;break;case "hev1":case "hvc1":e.push(w+".1.6.L93.90");g=!0;break;case "dvh1":case "dvhe":e.push(w+".05.04");g=!0;break;case "vp09":e.push(w+".00.10.08");g=!0;break;case "av01":e.push(w+".0.01M.08");g=!0;break;case "mp4a":d.push("mp4a.40.2");f=!0;break;case "ac-3":case "ec-3":case "ac-4":case "opus":case "flac":d.push(w);f=!0;break;case "apac":d.push("apac.31.00"),
f=!0}};let k=null,l=null,m=null,n=null,p=null,r=null,q=null,t=null,u;var x=w=>{const z=Kh(w.reader);n=z.channelCount;p=z.sampleRate;h(w.name)},y=w=>{u=w.name;var z=w.reader;z.skip(24);const A=z.Ca(),B=z.Ca();z.skip(50);m=String(A);l=String(B);w.reader.Ga()&&vg(w)};(new Dg).box("moov",vg).box("trak",vg).box("mdia",vg).ka("mdhd",w=>{w=Ih(w.reader,w.version);k=w.language;t=w.timescale}).box("minf",vg).box("stbl",vg).ka("stsd",xg).box("mp4a",w=>{const z=Kh(w.reader);n=z.channelCount;p=z.sampleRate;w.reader.Ga()?
vg(w):h(w.name)}).box("esds",w=>{w=w.reader;let z="mp4a";for(var A,B;w.Ga();){A=w.Z();for(var D=w.Z();D&128;)D=w.Z();if(A==3)w.Ca(),D=w.Z(),D&128&&w.Ca(),D&64&&w.skip(w.Z()),D&32&&w.Ca();else if(A==4)B=w.Z(),w.skip(12);else if(A==5)break}B&&(z+="."+Lh(B),A==5&&w.Ga()&&(A=w.Z(),B=(A&248)>>3,B===31&&w.Ga()&&(B=32+((A&7)<<3)+((w.Z()&224)>>5)),z+="."+B));d.push(z);f=!0}).box("ac-3",x).box("ec-3",x).box("ac-4",x).box("Opus",x).box("fLaC",x).box("apac",x).box("avc1",y).box("avc3",y).box("hev1",y).box("hvc1",
y).box("dva1",y).box("dvav",y).box("dvh1",y).box("dvhe",y).box("vp09",y).box("av01",y).box("avcC",w=>{var z=u||"";switch(u){case "dvav":z="avc3";break;case "dva1":z="avc1"}w=w.reader;w.skip(1);w=z+"."+Lh(w.Z())+Lh(w.Z())+Lh(w.Z());e.push(w);g=!0}).box("hvcC",w=>{var z=u||"";switch(u){case "dvh1":z="hvc1";break;case "dvhe":z="hev1"}var A=w.reader;A.skip(1);w=A.Z();var B=["","A","B","C"][w>>6],D=w&31,E=A.V(),Z=(w&32)>>5?"H":"L";w=[A.Z(),A.Z(),A.Z(),A.Z(),A.Z(),A.Z()];A=A.Z();let J=0;for(let K=0;K<32;K++){J|=
E&1;if(K==31)break;J<<=1;E>>=1}z=z+("."+B+D)+("."+Lh(J,!0));z+="."+Z+A;B="";for(D=w.length;D--;)if((Z=w[D])||B)B="."+Z.toString(16).toUpperCase()+B;z+=B;e.push(z);g=!0}).box("dvcC",w=>{var z=u||"";switch(u){case "hvc1":z="dvh1";break;case "hev1":z="dvhe";break;case "avc1":z="dva1";break;case "avc3":z="dvav";break;case "av01":z="dav1"}var A=w.reader;A.skip(2);w=A.Z();A=A.Z();e.push(z+"."+Oh(w>>1&127)+"."+Oh(w<<5&32|A>>3&31));g=!0}).box("dvvC",w=>{var z=u||"";switch(u){case "hvc1":z="dvh1";break;case "hev1":z=
"dvhe";break;case "avc1":z="dva1";break;case "avc3":z="dvav";break;case "av01":z="dav1"}var A=w.reader;A.skip(2);w=A.Z();A=A.Z();e.push(z+"."+Oh(w>>1&127)+"."+Oh(w<<5&32|A>>3&31));g=!0}).ka("vpcC",w=>{var z=u||"",A=w.reader;w=A.Z();const B=A.Z();A=A.Z()>>4&15;e.push(z+"."+Oh(w)+"."+Oh(B)+"."+Oh(A));g=!0}).box("av1C",w=>{var z=u||"";switch(u){case "dav1":z="av01"}var A=w.reader;A.skip(1);w=A.Z();A=A.Z();const B=w>>>5,D=(A&64)>>6;e.push(z+"."+B+"."+Oh(w&31)+(A>>>7?"H":"M")+"."+Oh(B===2&&D?(A&32)>>5?
12:10:D?10:8)+"."+((A&16)>>4)+"."+((A&8)>>3)+((A&4)>>2)+(A&3)+"."+Oh(1)+"."+Oh(1)+"."+Oh(1)+".0");g=!0}).box("enca",zg).box("encv",yg).box("sinf",vg).box("frma",w=>{({codec:w}=Mh(w.reader));h(w)}).box("colr",w=>{e=e.map(B=>{if(B.startsWith("av01.")){var D=w.reader;const J=D.Ka();var E=D.Bb(4,!1);var Z=String.fromCharCode(E[0]);Z+=String.fromCharCode(E[1]);Z+=String.fromCharCode(E[2]);Z+=String.fromCharCode(E[3]);if(Z==="nclx"){E=D.Ca();Z=D.Ca();const K=D.Ca(),ba=D.Z()>>7,I=B.split(".");I.length==
10&&(I[6]=Oh(E),I[7]=Oh(Z),I[8]=Oh(K),I[9]=String(ba),B=I.join("."))}D.seek(J)}return B});const {Gd:z,colorGamut:A}=Nh(w.reader);r=z;q=A}).parse(a||b,!0,!0);if(!d.length&&!e.length)return null;x=f&&!g;y=new Map;if(g&&!c){c=new vc("video/mp4");a&&c.init(a);try{tc(c,b);for(const w of c.g.getStreams())y.set(w,w)}catch(w){}c.g.clear()}return{type:x?"audio":"video",mimeType:x?"audio/mp4":"video/mp4",codecs:yl(d.concat(e)).join(", "),language:k,height:l,width:m,channelCount:n,sampleRate:p,closedCaptions:y,
Gd:r,colorGamut:q,frameRate:null,timescale:t}}function yl(a){var b=new Set;const c=[];for(var d of a)a=ie(d),b.has(a)||(c.push(d),b.add(a));b=ac("audio",c);a=ac("video",c);d=ac(G,c);a=zl(a);b=b.concat(a).concat(d);return c.length&&!b.length?c:b}
function zl(a){if(a.length<=1)return a;const b=a.find(c=>c.startsWith("dvav.")||c.startsWith("dva1.")||c.startsWith("dvh1.")||c.startsWith("dvhe.")||c.startsWith("dav1.")||c.startsWith("dvc1.")||c.startsWith("dvi1."));return b?Dh(`video/mp4; codecs="${b}"`)?[b]:a.filter(c=>c!=b):a}
function Al(a){let b=null;(new Dg).box("moov",vg).box("trak",vg).box("mdia",vg).box("minf",vg).box("stbl",vg).ka("stsd",xg).box("encv",yg).box("enca",zg).box("sinf",vg).box("schi",vg).ka("tenc",c=>{c=c.reader;c.Z();c.Z();c.Z();c.Z();c=c.Bb(16,!1);b=Qb(c)}).parse(a,!0);return b}
async function Bl(a,b,c){b.cryptoKey||await b.fetchKey();let d=b.iv;if(!d){d=C(new ArrayBuffer(16));c=b.firstMediaSequenceNumber+c;for(let f=d.byteLength-1;f>=0;f--)d[f]=c&255,c>>=8}let e;b.blockCipherMode=="CBC"?e={name:"AES-CBC",iv:d}:e={name:"AES-CTR",counter:d,length:64};return window.crypto.subtle.decrypt(e,b.cryptoKey,a)};async function Cl(a,b,c){let d=Dl.get(El(a));if(d)return d;a=ag([a],c);try{a.method="HEAD",d=(await b.request(0,a).promise).headers["content-type"]}catch(e){!e||e.code!=1002&&e.code!=1001||(a.method="GET",d=(await b.request(0,a).promise).headers["content-type"])}return d?d.toLowerCase().split(";").shift():""}
function El(a){let b=a.length;for(var c=0;c<a.length;c++){var d=a.charCodeAt(c);if(d===63||d===35){b=c;break}}for(c=b-1;c>=0;c--){d=a.charCodeAt(c);if(d===46){if(c+1<b)return a.slice(c+1,b).toLowerCase();break}if(d===47)break}return""}function Fl(a,b,c,d,e){a=ag(a,d,e);if(b!=0||c!=null)a.headers.Range=c?"bytes="+b+"-"+c:"bytes="+b+"-";return a}
var Dl=(new Map).set("mp4","video/mp4").set("m4v","video/mp4").set("m4a","audio/mp4").set("webm","video/webm").set("weba","audio/webm").set("mkv","video/webm").set("ts","video/mp2t").set("ogv","video/ogg").set("ogg","audio/ogg").set("mpg","video/mpeg").set("mpeg","video/mpeg").set("mov","video/quicktime").set("m3u8","application/x-mpegurl").set("mpd","application/dash+xml").set("ism","application/vnd.ms-sstr+xml").set("mp3","audio/mpeg").set("aac","audio/aac").set("flac","audio/flac").set("wav","audio/wav").set("sbv",
"text/x-subviewer").set("srt","text/srt").set("vtt","text/vtt").set("webvtt","text/vtt").set("ttml","application/ttml+xml").set("lrc","application/x-subtitle-lrc").set("ssa","text/x-ssa").set("ass","text/x-ssa").set("jpeg","image/jpeg").set("jpg","image/jpeg").set("png","image/png").set("svg","image/svg+xml").set("webp","image/webp").set("avif","image/avif").set("html","text/html").set("htm","text/html");function Gl(a){return a&&a.type==G&&(a.stream.mimeType=="application/cea-608"||a.stream.mimeType=="application/cea-708")}function Hl(a,b,c,d,e,f=!1){const g=a instanceof M?a:void 0,h=g?1:0;a=Fl(a.P(),a.startByte,a.endByte,d,c);a.contentType=b.type;return e.request(gg,a,{type:h,stream:b,segment:g,isPreload:f})}
async function Il(a){a.u&&a.u.stop();a.u=null;a.J&&a.J.stop();a.J=null;a.F&&(a.F.release(),a.F=null);const b=[];for(const c of a.h.values())Jl(c),b.push(Kl(c)),c.ba&&(sl(c.ba),c.ba=null);for(const c of a.m.values())sl(c);await Promise.all(b);a.h.clear();a.m.clear();a.g=null;a.j=null;a.i=null;a.H=null}function Jl(a){a.ab!=null&&(a.ab.stop(),a.ab=null)}async function Kl(a){a.Pa&&await a.Pa.abort()}
function Ll(a,b){if(b.type==="video"&&a.i.disableVideoPrefetch||b.type==="audio"&&a.i.disableAudioPrefetch||b.type===G&&(b.mimeType=="application/cea-608"||b.mimeType=="application/cea-708")||b.type===G&&a.i.disableTextPrefetch)return null;if(a.m.has(b))return a.m.get(b);var c=a.h.get(b.type);return(c=c&&c.ba)&&b===c.i?c:a.i.segmentPrefetchLimit>0?new vl(a.i.segmentPrefetchLimit,b,(d,e,f)=>Hl(d,e,f||null,a.i.retryParameters,a.g.Yb),a.g.rb()<0,a.g.$i):null}
function Ml(a){const b=a.i.segmentPrefetchLimit,c=a.i.prefetchAudioLanguages;for(const e of a.j.variants){if(!e.audio)continue;if(a.m.has(e.audio)){var d=a.m.get(e.audio);tl(d,b);if(!(b>0&&c.some(f=>He(e.audio.language,f)))){const f=a.h.get(e.audio.type);d!==(f&&f.ba)&&sl(d);a.m.delete(e.audio)}continue}if(b<=0)continue;if(!c.some(f=>He(e.audio.language,f)))continue;if(d=Ll(a,e.audio))e.audio.segmentIndex||e.audio.createSegmentIndex(),a.m.set(e.audio,d)}}
function Nl(a,b,c){a.j.presentationTimeline.U()||(a.Y=b,a.W=c)}async function Ol(a,b){if(!a.o)throw new F(2,5,5006);const c=Pl(a,!0);await a.g.X.init(c,a.j.sequenceMode,a.j.type,a.j.ignoreManifestTimestampsInSegmentsMode);kg(a.l);a.updateDuration();for(const e of c.keys()){var d=c.get(e);if(!a.h.has(e)){const f=Ql(a,d);b.has(d.id)&&(d=b.get(d.id),ll(d,(g,h,k)=>Hl(g,h,k||null,a.i.retryParameters,a.g.Yb)),f.ba=d);a.h.set(e,f);Rl(a,f,0)}}Sl(a)}
function Ql(a,b){const c={stream:b,type:b.type,ra:null,ba:Ll(a,b),Ea:null,$a:null,oe:null,Wb:null,Vb:null,le:null,me:null,nc:null,endOfStream:!1,Fa:!1,ab:null,Cb:!1,Gc:0,dd:!1,Eb:!1,zc:!0,Pe:!1,Nf:!1,Oc:!1,Pa:null,ec:null};b.dependencyStream&&(c.ec=Ql(a,b.dependencyStream));return c}function Rl(a,b,c){const d=b.type;if(d!=G||a.h.has(d))b.ab=(new Ce(async()=>{try{await Tl(a,b)}catch(e){if(a.g)a.g.onError(e)}})).ma(c)}
async function Ul(a,b){a.S++;const c=a.S;try{await ak(a.g.X,G)}catch(e){if(a.g)a.g.onError(e)}const d=be(b.mimeType,b.codecs);Fj(a.g.X,d,a.j.sequenceMode,b.external);(a.g.X.Y.isTextVisible()||a.i.alwaysStreamText)&&a.S==c&&(b=Ql(a,b),a.h.set(G,b),Rl(a,b,0))}function Vl(a){const b=a.h.get(G);b&&(Jl(b),Kl(b).catch(()=>{}),a.G=a.h.get(G),a.h.delete(G),b.stream&&b.stream.closeSegmentIndex&&b.stream.closeSegmentIndex());a.A=null}
function Wl(a,b,c,d,e,f){const g=a.h.get(b.type);g||b.type!=G?g&&(g.nc&&(b.trickModeVideo?(g.nc=b,b=b.trickModeVideo):g.nc=null),g.stream!=b||e)&&(a.m.has(b)?g.ba=a.m.get(b):g.ba&&ul(g.ba,b),b.type==G&&g.stream!=b&&(e=be(b.mimeType,b.codecs),Fj(a.g.X,e,a.j.sequenceMode,b.external)),!a.m.has(g.stream)&&g.stream.closeSegmentIndex&&(g.Fa?(e="("+g.type+":"+g.stream.id+")",a.K.has(e)||a.K.set(e,g.stream.closeSegmentIndex)):g.stream.closeSegmentIndex()),e=g.stream.isAudioMuxedInVideo!=b.isAudioMuxedInVideo,
g.stream=b,g.ra=null,g.Pe=!!f,b.dependencyStream?g.ec=Ql(a,b.dependencyStream):g.ec=null,Sl(a),e&&(g.$a=null,g.Wb=null,g.Vb=null,b.isAudioMuxedInVideo&&(b=null,g.type==="video"?b=a.h.get("audio"):g.type==="audio"&&(b=a.h.get("video")),b&&(Kl(b).catch(()=>{}),b.$a=null,b.Wb=null,b.Vb=null,Xl(a,b),Yl(a,b).catch(h=>{if(a.g)a.g.onError(h)})))),c?g.Eb?g.dd=!0:g.Fa?(g.Cb=!0,g.Gc=d,g.dd=!0):(Jl(g),Zl(a,g,!0,d).catch(h=>{if(a.g)a.g.onError(h)})):g.Fa||g.ab||Rl(a,g,0),Yl(a,g).catch(h=>{if(a.g)a.g.onError(h)})):
Ul(a,b)}function $l(a,b){var c=a.g.rb()<0;for(var d of a.h.values())d.ra&&d.ra.bd(c),d.ba&&d.ba.bd(c);for(const e of a.m.values())e.bd(c);if(c=a.h.get("video"))if(d=c.stream)if(b)(b=d.trickModeVideo)&&!c.nc&&(Wl(a,b,!1,0,!1),c.nc=d);else if(b=c.nc)c.nc=null,Wl(a,b,!0,0,!1)}function am(a,b,c=!1,d=0,e=!1,f=!1){a.o=b;a.M&&(b.video&&Wl(a,b.video,c,d,e,f),b.audio&&Wl(a,b.audio,c,d,e,f))}async function bm(a,b){a.G=null;a.A=b;a.M&&(b.segmentIndex||await b.createSegmentIndex(),Wl(a,b,!0,0,!1))}
function cm(a){const b=a.h.get(G);b&&Wl(a,b.stream,!0,0,!0)}function dm(a,b){for(const [c,d]of a.K.entries()){const e=c,f=d;e.includes(b.type)&&(f(),a.K.delete(e))}}function Sl(a){a.F.La();em(a)&&(a.F.D(a.g.video,"waiting",()=>fm(a)),a.F.D(a.g.video,"timeupdate",()=>fm(a)))}function Xl(a,b){b.Eb||b.Cb||(b.Fa?(b.Cb=!0,b.Gc=0):Lj(a.g.X,b.type)==null?b.ab==null&&Rl(a,b,0):(Jl(b),Zl(a,b,!1,0).catch(c=>{if(a.g)a.g.onError(c)})))}
async function Yl(a,b){if(b.Pa){var c=b.stream,d=b.Pa;c.segmentIndex||await c.createSegmentIndex();var e=c.dependencyStream;e&&!e.segmentIndex&&await e.createSegmentIndex();if(d=b.Pa==d){if(c=b.stream==c){c=a.g.Hb();d=Mj(a.g.X,b.type);e=b.stream.segmentIndex.find(b.Ea?b.Ea.endTime:c);var f=e==null?null:b.stream.segmentIndex.get(e);e=f?zi(f):null;f&&!e&&(e=(f.endTime-f.getStartTime())*(b.stream.bandwidth||a.o.bandwidth)/8);e?((f=f.$)&&(e+=(f.endByte?f.endByte+1-f.startByte:null)||0),f=a.g.getBandwidthEstimate(),
c=e*8/f<(d||0)-c-a.i.rebufferingGoal||b.Pa.h.g>e?!0:!1):c=!0}d=c}d&&b.Pa.abort()}}async function Zl(a,b,c,d){b.Cb=!1;b.dd=!1;b.Gc=0;b.Eb=!0;b.Ea=null;b.ra=null;b.ba&&!a.m.has(b.stream)&&sl(b.ba);if(d){c=a.g.Hb();const e=a.g.X.getDuration();await a.g.X.remove(b.type,c+d,e)}else await ak(a.g.X,b.type),kg(a.l),c&&await a.g.X.flush(b.type);kg(a.l);b.Eb=!1;b.endOfStream=!1;b.Fa||b.ab||Rl(a,b,0)}
function em(a){if(a.i.crossBoundaryStrategy!=="keep")return!0;const b=Fa();if(!b.l())for(var c of a.h.keys()){var d=a.h.get(c);if(d.type===bc.jg)continue;if((d=d.stream)&&d.fullMimeTypes&&d.fullMimeTypes.size>1)return!0}else if(!b.N())for(const e of a.h.keys()){c=a.h.get(e);if(c.type===bc.jg)continue;if((c=c.stream)&&c.fullMimeTypes&&c.fullMimeTypes.size>1){a=new Set;for(d of c.fullMimeTypes)a.add(fe(d));return a.size>1}}return!1}
function fm(a){if(em(a)){a.J.stop();var b=a.g.Hb(),c=a.h.get("video")||a.h.get("audio");c&&(c=c.$a)&&c.g!==null&&(b=c.g-b,b<0||b>1||(a.H=c.g+.1,a.J.ma(b)))}}
function Pl(a,b=!1){const c=f=>{if(f.fullMimeTypes&&f.fullMimeTypes.size>1&&a.h.has(f.type)){var g=a.h.get(f.type);const h=Mj(a.g.X,g.type),k=a.g.Hb();(g=gm(a,g,k,h))&&g.codecs&&g.mimeType&&(f.codecs=g.codecs,f.mimeType=g.mimeType)}},d=new Map;var e=a.o.audio;e&&(c(e),d.set("audio",e));if(e=a.o.video)c(e),d.set("video",e);b&&a.A&&d.set(G,a.A);return d}
async function hm(a,b,c){if(c.code==3024)b.Fa=!1,Jl(b),Rl(a,b,0);else{await Jf(a.T);kg(a.l);if(c.category===1&&c.code!=1003){if(b.nc){$l(a,!1);return}c.handled=a.g.disableStream(b.stream,im(a,c));c.handled&&(c.severity=1)}if(!c.handled&&c.code==1011){const d=a.g.Hb(),e=Mj(a.g.X,b.type);let f=gm(a,b,d,e);for(;f?.Kb()===2;)b.Ea=f,f=gm(a,b,d,e);if(f){await lk(a.g.X,b.type,f.startTime);b.Fa=!1;b.Oc=!1;Jl(b);Rl(a,b,0);return}}if(!c.handled||c.code!=1011)a.g.onError(c);c.handled||a.i.failureCallback(c)}}
function jm(a,b){if(Gl(b))return Xj(a.g.X,b.stream.originalId||""),null;b.type==G&&Yj(a.g.X);if(b.stream.isAudioMuxedInVideo&&b.type=="audio")return null;if(b.type!=G&&Dj(a.g.X))return km(a,!0),null;var c=a.i.updateIntervalSeconds/Math.max(1,Math.abs(a.g.rb()));if(!Jj(a.g.X)&&b.type!=G)return c/2;const d=a.g.Hb();if(b.type==="audio")for(var e of a.m.keys()){var f=a.m.get(e);f.Oa(d,!0);rl(f,d)}e=b.Ea?b.Ea.endTime:d;var g=Nj(a.g.X,b.type,d);f=Math.max(1,Math.max(a.i.rebufferingGoal,a.i.bufferingGoal)*
a.B);var h=a.j.presentationTimeline.getDuration()-e,k=Mj(a.g.X,b.type);if(h<1E-6&&k)return b.endOfStream=!0,b.type=="video"&&((c=a.h.get(G))&&Gl(c)&&(c.endOfStream=!0),(c=a.h.get("audio"))&&c.stream.isAudioMuxedInVideo&&(c.endOfStream=!0)),null;b.endOfStream=!1;if(g>=f)return c/2;g=!b.ra;k=gm(a,b,d,k);if(!k)return a=Infinity,(b=b.Ea)&&(a=b.endTime-b.startTime),Math.min(a/2,c);h=b.$a;const l=k.$;h&&l&&xi(l,h)&&(h.g=l.g);h=!1;g&&b.Pe&&(h=!0,b.Pe=!1);g=Infinity;for(const m of a.h.values())Gl(m)||m.stream.isAudioMuxedInVideo||
m.ra&&!m.ra.current()||(g=Math.min(g,m.Ea?m.Ea.endTime:d));if(e>=g+a.j.presentationTimeline.h)return c;b.ba&&b.ra&&!a.m.has(b.stream)&&(b.ba.Oa(k.startTime+.001),rl(b.ba,k.startTime).catch(()=>{}));if(em(a)&&lm(a,b,k))return null;mm(a,b,d,k,h).catch(()=>{});b.ec&&nm(a,b.ec,d,f);return null}
async function Tl(a,b){kg(a.l);if(!b.Fa&&b.ab!=null&&!b.Eb)if(b.ab=null,b.Cb)await Zl(a,b,b.dd,b.Gc);else{dm(a,b);if(!b.stream.segmentIndex){var c=b.stream;try{await b.stream.createSegmentIndex()}catch(d){await hm(a,b,d);return}if(c!=b.stream){c.closeSegmentIndex&&c.closeSegmentIndex();b.Fa||b.ab||Rl(a,b,0);return}}if(b.ec&&!b.ec.stream.segmentIndex)try{await b.ec.stream.createSegmentIndex()}catch(d){}try{const d=jm(a,b);d!=null&&(Rl(a,b,d),b.Oc=!1)}catch(d){await hm(a,b,d);return}b.type!==G&&(c=
[],b.stream&&!b.stream.isAudioMuxedInVideo&&c.push(b),(b=a.h.get(b.type==="audio"?"video":"audio"))&&b.stream&&!b.stream.isAudioMuxedInVideo&&c.push(b),a.M&&c.every(d=>d.endOfStream)&&(await a.g.X.endOfStream(),kg(a.l),b=a.g.X.getDuration(),b!=0&&b<a.j.presentationTimeline.getDuration()&&a.j.presentationTimeline.jb(b)))}}
async function km(a,b=!1){var c=Date.now()/1E3,d=a.i.minTimeBetweenRecoveries;if(!b&&(!a.i.allowMediaSourceRecoveries||c-a.O<d))return!1;a.O=c;if(b=a.h.get("audio"))Jl(b),b.Pa&&(b.Pa.abort(),b.Pa=null),b.$a=null,b.Wb=null,b.Vb=null,b.Fa=!1,b.Cb=!1,b.Gc=0,b.dd=!1,b.Eb=!1,b.ra&&b.ra.Qf();if(c=a.h.get("video"))Jl(c),c.Pa&&(c.Pa.abort(),c.Pa=null),c.$a=null,c.Wb=null,c.Vb=null,c.Fa=!1,c.Cb=!1,c.Gc=0,c.dd=!1,c.Eb=!1,c.ra&&c.ra.Qf();d=a.g.video.paused;await ik(a.g.X,Pl(a));!c||c.Eb||c.Fa||c.ab||Rl(a,c,
0);!b||b.Eb||b.Fa||b.ab||Rl(a,b,0);d||a.g.video.play();return!0}
function gm(a,b,c,d){if(b.ra)return(c=b.ra.current())&&b.Ea&&(a=b.Ea.endTime,Zi(b.Ea.startTime,c.startTime,.002)&&Zi(a,c.endTime,.002)&&(c=b.ra.next().value)),c;if(b.Ea||d)return c=b.Ea?b.Ea.endTime:d,a=a.g.rb()<0,b.stream.segmentIndex&&(b.ra=b.stream.segmentIndex.Fb(c,!1,a)),b.ra&&b.ra.next().value;d=a.j.sequenceMode||em(a)?0:a.i.inaccurateManifestTolerance;let e=Math.max(c-d,0);var f=a.g.X.getDuration();Math.abs(e-f)<1&&(d=1,e=Math.max(c-d,0));a=a.g.rb()<0;f=null;d&&(b.stream.segmentIndex&&(b.ra=
b.stream.segmentIndex.Fb(e,!1,a)),f=b.ra&&b.ra.next().value);f||(b.stream.segmentIndex&&(b.ra=b.stream.segmentIndex.Fb(c,!1,a)),f=b.ra&&b.ra.next().value);for(;f?.Kb()===2;)f=b.ra?.next().value??null;return f}
function lm(a,b,c){if(b.type===G)return!1;const d=b.$a;if(!d)return!1;const e=c.$;c=d.g!==e.g;a.i.crossBoundaryStrategy==="reset_to_encrypted"&&(d.encrypted||e.encrypted||(c=!1),d.encrypted&&(a.i.crossBoundaryStrategy="keep"));a.i.crossBoundaryStrategy==="RESET_ON_ENCRYPTION_CHANGE"&&d.encrypted==e.encrypted&&(c=!1);if(a.i.crossBoundaryStrategy==="keep"&&d.mimeType&&e.mimeType){const f=ge(le(d.mimeType)),g=ge(le(e.mimeType));d.mimeType==e.mimeType&&f==g&&(c=!1)}(a.h.get("video")||a.h.get("audio"))===
b&&c&&(a.I||b.zc)&&(a.I=!1,km(a,!0).then(()=>{const f=(new Map).set("oldEncrypted",d.encrypted).set("newEncrypted",e.encrypted);a.g.onEvent(new L("boundarycrossed",f))}));return c}
async function mm(a,b,c,d,e){const f=b.stream;var g=b.ra;b.Fa=!0;try{if(d.Kb()==2)throw new F(1,1,1011);await om(a,b,d,e);kg(a.l);if(!a.C){var h=f.mimeType=="video/mp4"||f.mimeType=="audio/mp4",k=window.ReadableStream;if(a.i.lowLatencyMode&&a.j.isLowLatency&&k&&h&&(a.j.type!="HLS"||d.o)){let m=new Uint8Array(0),n=!1,p=!1,r;const q=await pm(a,b,d,async t=>{if(!n&&(p=!0,kg(a.l),!a.C))try{m=Rb(m,t);let u=!1,x=0;(new Dg).box("mdat",y=>{x=y.size+y.start;u=!0}).parse(m,!1,!0);if(u){const y=m.subarray(0,
x);m=m.subarray(x);await qm(a,b,c,f,d,y,!0,e);b.ba&&b.ra&&rl(b.ba,d.startTime,!0)}}catch(u){r=u}});if(r)throw r;if(!p){n=!0;kg(a.l);if(a.C)return;if(b.Cb){b.Fa=!1;Rl(a,b,0);return}await qm(a,b,c,f,d,q,!1,e)}b.ba&&b.ra&&rl(b.ba,d.startTime,!0)}else{const m=await pm(a,b,d);kg(a.l);if(a.C)return;kg(a.l);if(b.Cb){b.Fa=!1;Rl(a,b,0);return}await qm(a,b,c,f,d,m,!1,e)}kg(a.l);if(!a.C){b.Ea=d;g.next();b.Fa=!1;b.Nf=!1;var l=a.g.X.fc()[b.type];oa(JSON.stringify(l));b.Cb||(g=null,b.type==="video"?g=a.h.get("audio"):
b.type==="audio"&&(g=a.h.get("video")),g&&g.type=="audio"?a.g.Sc(d,b.stream,g.stream.isAudioMuxedInVideo,!1):a.g.Sc(d,b.stream,b.stream.codecs.includes(","),!1));Jl(b);Rl(a,b,0)}}}catch(m){kg(a.l,m),a.C||(b.Fa=!1,m.code==7001?(b.Fa=!1,Jl(b),Rl(a,b,0)):b.type==G&&a.i.ignoreTextStreamFailures?a.h.delete(G):m.code==3017?await rm(a,b,m):(b.Oc=!0,m.category==1&&b.ba&&ql(b.ba,d),m.severity=2,await hm(a,b,m)))}}
async function nm(a,b,c,d){var e=b.stream,f=e.segmentIndex;for(c=(f=f&&f.Fb(c))&&f.next().value;c&&a.N.includes(c.startTime);)c=f&&f.next().value;if(c){if((f=c.$)&&!xi(f,b.$a)){b.$a=f;try{const g=await pm(a,b,f);if(!a.g)return;Uj(a.g.X,g,0,e);a.N=[]}catch(g){throw b.$a=null,g;}}if(!b.Ea||b.Ea!=c){b.Ea=c;try{const g=await pm(a,b,c);if(!a.g)return;Uj(a.g.X,g,0,e);a.N.push(c.startTime)}catch(g){throw b.Ea=null,g;}a.g&&(b.Cb||(e=null,b.type==="video"?e=a.h.get("audio"):b.type==="audio"&&(e=a.h.get("video")),
e&&e.type=="audio"?a.g.Sc(c,b.stream,e.stream.isAudioMuxedInVideo,!0):a.g.Sc(c,b.stream,b.stream.codecs.includes(","),!0)),e=Math.max(0,...a.N),a.g.Hb()+d>e&&await nm(a,b,c.startTime,d))}}}
async function om(a,b,c,d){var e=b.Ea==null;const f=[];var g=Math.max(0,Math.max(c.appendWindowStart,a.Y)-.1);const h=Math.min(c.appendWindowEnd,a.W)+.1;var k=c.codecs||b.stream.codecs;const l=ie(k),m=ke(c.mimeType||b.stream.mimeType),n=c.timestampOffset;if(n!=b.oe||g!=b.Wb||h!=b.Vb||l!=b.le||m!=b.me)b.le&&b.me&&sk(a.g.X,b.type,m,k,Pl(a))&&(k=null,b.type==="video"?k=a.h.get("audio"):b.type==="audio"&&(k=a.h.get("video")),k&&(await Kl(k).catch(()=>{}),k.$a=null,k.Wb=null,k.Vb=null,Xl(a,k))),await sm(a,
b,n,g,h,c,l,m);if(!xi(c.$,b.$a)&&(b.$a=c.$,c.l&&c.$)){const p=pm(a,b,c.$);g=c.startTime;e&&(e=Mj(a.g.X,b.type),e!=null&&(g=e));a.g.Ci(g,c.$);f.push((async()=>{try{const r=await p;kg(a.l);let q=null;const t=new Map,u={projection:null,hfov:null};if(b.stream){const A=b.stream.videoLayout;if(A){const B=A.split("/");B.includes("PROJ-RECT")?u.projection="rect":B.includes("PROJ-EQUI")?u.projection="equi":B.includes("PROJ-HEQU")?u.projection="hequ":B.includes("PROJ-PRIM")?u.projection="prim":B.includes("PROJ-AIV")&&
(u.projection="hequ")}}const x=new Dg;x.box("moov",vg).box("trak",vg).box("mdia",vg).ka("mdhd",A=>{q=Ih(A.reader,A.version).timescale}).ka("hdlr",A=>{A=A.reader;A.skip(4);A=A.Bb(4,!1);switch(String.fromCharCode(A[0],A[1],A[2],A[3])){case "soun":t.set("audio",q);break;case "vide":t.set("video",q)}q=null});b.type!=="video"||u.projection||x.box("minf",vg).box("stbl",vg).ka("stsd",xg).boxes("encv avc1 avc3 hev1 hvc1 dvav dva1 dvh1 dvhe dvc1 dvi1".split(" "),yg).box("vexu",vg).box("proj",vg).ka("prji",
A=>{A=A.reader.Wc();u.projection=A}).box("hfov",A=>{A=A.reader.V()/1E3;u.hfov=A});x.parse(r,!0,!0);b.type==="video"&&tm(a,u);t.has(b.type)?c.$.timescale=t.get(b.type):q!=null&&(c.$.timescale=q);const y=b.stream.segmentIndex;let w;y instanceof Yk&&(w=Xk(y,c.startTime));const z=b.stream.closedCaptions&&b.stream.closedCaptions.size>0;await a.g.ng(b.type,r);await Qj(a.g.X,b.type,r,null,b.stream,z,b.zc,d,!1,!1,w)}catch(r){throw b.$a=null,r;}})())}c.i!=(b.Ea?b.Ea.i:-1)&&f.push(lk(a.g.X,b.type,c.startTime));
await Promise.all(f)}async function pm(a,b,c,d){var e=c.Jb();if(e)return e;e=null;if(b.ba){{e=b.ba;let f=e.g;c instanceof yi&&(f=e.j);f.has(c)?(e=f.get(c),d&&(e.$f=d),e=e.xd):e=null}}e||=Hl(c,b.stream,d||null,a.i.retryParameters,a.g.Yb);a=0;b.ra&&(a=b.ra.h);b.Pa=e;d=await e.promise;b.Pa=null;b=d.data;c.aesKey&&(b=await Bl(b,c.aesKey,a));return b}
async function qm(a,b,c,d,e,f,g=!1,h=!1){const k=d.closedCaptions&&d.closedCaptions.size>0;if(a.i.shouldFixTimestampOffset){const l=d.mimeType=="video/mp4"||d.mimeType=="audio/mp4";let m=null;e.$&&(m=e.$.timescale);l&&m&&d.type==="video"&&a.j.type=="DASH"&&(new Dg).box("moof",vg).box("traf",vg).ka("tfdt",async n=>{if(n=Hh(n.reader,n.version).baseMediaDecodeTime)n=-n/m,(Number(b.oe)||0)<n&&await sm(a,b,n,b.Wb,b.Vb,e)}).parse(f,!1,g)}await um(a,b,c);kg(a.l);c=b.zc;b.zc=!1;await a.g.ng(b.type,f);await Qj(a.g.X,
b.type,f,e,d,k,c,h,g);kg(a.l)}async function rm(a,b,c){var d=!1;for(const e of a.h.values())if(e!=b&&e.Nf){d=!0;break}if(!d){if(a.i.avoidEvictionOnQuotaExceededError){if(a.g.disableStream(b.stream,im(a,c)))return;Rl(a,b,4);return}d=Math.round(100*a.B);if(d>20)a.B-=.2;else if(d>4)a.B-=.04;else{a.g.disableStream(b.stream,im(a,c))?(a.B=1,c=a.g.Hb(),await um(a,b,c)):(b.Oc=!0,a.C=!0,a.g.onError(c));return}b.Nf=!0;c=a.g.Hb();await um(a,b,c)}Rl(a,b,4)}
function im(a,b){return a.i.maxDisabledTime===0&&b.code==1011?1:a.i.maxDisabledTime}
async function um(a,b,c){a.G==b&&(a.G=null);var d=b.stream.segmentIndex;let e;d instanceof Yk&&(d.Oa(a.j.presentationTimeline.ub()),e=[],Wk(d,m=>{e.push(m.u())}));d=Math.max(a.i.bufferBehind*a.B,a.j.presentationTimeline.h);const f=Lj(a.g.X,b.type);if(f!=null){var g=c-f,h=a.i.evictionGoal,k=a.j.presentationTimeline.Ib(),l=g-d;a.j.presentationTimeline.sb()-k>h&&(l=Math.max(g-d,k-h-f));l<=h||(await a.g.X.remove(b.type,f,f+l,e),kg(a.l),a.G&&(await um(a,a.G,c),kg(a.l)))}}
async function sm(a,b,c,d,e,f,g,h){const k=Pl(a);try{b.Wb=d;b.Vb=e;g&&(b.le=g);h&&(b.me=h);b.oe=c;const l=a.j.sequenceMode||a.j.type=="HLS";g=null;b.type==="video"?g=a.h.get("audio"):b.type==="audio"&&(g=a.h.get("video"));g&&g.stream&&g.stream.isAudioMuxedInVideo&&await kk(a.g.X,g.type,c,d,e,l,g.stream.mimeType,g.stream.codecs,k);await kk(a.g.X,b.type,c,d,e,l,f.mimeType||b.stream.mimeType,f.codecs||b.stream.codecs,k)}catch(l){throw b.Wb=null,b.Vb=null,b.le=null,b.me=null,b.oe=null,l;}}
function tm(a,b){if(a.R.projection!=b.projection||a.R.hfov!=b.hfov){if(b.projection!=null||b.hfov!=null){var c=(new Map).set("detail",b);c=new L("spatialvideoinfo",c)}else c=new L("nospatialvideoinfo");c.cancelable=!0;a.g.onEvent(c);a.R=b}}
var vm=class{constructor(a,b){this.g=b;this.j=a;this.i=null;this.K=new Map;this.B=1;this.A=this.o=null;this.S=0;this.h=new Map;this.M=!1;this.T=null;this.C=!1;this.l=new lg(()=>Il(this));this.O=Date.now()/1E3;this.m=new Map;this.R={projection:null,hfov:null};this.Y=0;this.W=Infinity;this.G=null;this.N=[];this.u=new Ce(()=>{if(this.j&&this.g)if(this.j.presentationTimeline.U()){var c=this.j.presentationTimeline.Ib(),d=this.j.presentationTimeline.sb();d-c>1?nk(this.g.X,c,d):ok(this.g.X)}else ok(this.g.X),
this.u&&this.u.stop();else this.u&&this.u.stop()});this.H=null;this.I=!1;this.J=new Ce(()=>{const c=this.g.video;!c.ended&&this.H&&(this.I=!0,c.currentTime=this.H,this.H=null)});this.F=new Aa}destroy(){return this.l.destroy()}configure(a){this.i=a;this.T=new Kf({maxAttempts:Math.max(a.retryParameters.maxAttempts,2),baseDelay:a.retryParameters.baseDelay,backoffFactor:a.retryParameters.backoffFactor,fuzzFactor:a.retryParameters.fuzzFactor,timeout:0,stallTimeout:0,connectionTimeout:0},!0);if(a.disableAudioPrefetch){var b=
this.h.get("audio");b&&b.ba&&(sl(b.ba),b.ba=null);for(const c of this.m.keys())sl(this.m.get(c)),this.m.delete(c)}a.disableTextPrefetch&&(b=this.h.get(G))&&b.ba&&(sl(b.ba),b.ba=null);a.disableVideoPrefetch&&(b=this.h.get("video"))&&b.ba&&(sl(b.ba),b.ba=null);for(const c of this.h.keys())b=this.h.get(c),b.ba?(tl(b.ba,a.segmentPrefetchLimit),a.segmentPrefetchLimit>0||(sl(b.ba),b.ba=null)):a.segmentPrefetchLimit>0&&(b.ba=Ll(this,b.stream));a.disableAudioPrefetch||Ml(this)}async start(a){await Ol(this,
a||new Map);kg(this.l);this.M=!0}zc(){if(this.g){var a=this.g.Hb(),b=c=>{var d=this.g.X;c==G?(c=d.h,c=c.g==null||c.h==null?!1:a>=c.g&&a<c.h):(c=Kj(d,c),c=Gi(c,a));return c};for(const c of this.h.keys()){const d=this.h.get(c);if(!this.I&&!b(c)){this.O=0;d.ba&&(d.ba.h=null);if(d.type==="audio")for(const e of this.m.values())e.h=null;d.ra=null;(Mj(this.g.X,c)!=null||d.Fa)&&Xl(this,d);d.Pa&&(d.Pa.abort(),d.Pa=null);c===G&&bk(this.g.X);d.zc=!0}!this.I||d.Eb||d.Fa||d.ab||Rl(this,d,0)}em(this)&&fm(this)}}updateDuration(){const a=
Fh(),b=this.j.presentationTimeline.getDuration();b<Infinity?(a&&(this.u&&this.u.stop(),ok(this.g.X)),this.g.X.jb(b)):a?(this.u&&this.u.Da(.5),this.g.X.jb(Infinity)):this.g.X.jb(4294967296)}};function wm(a,b,c,d,e){const f=e in d,g=new Set(["__proto__","constructor","prototype"]);let h;h=f?c.constructor==Object&&Object.keys(d).length==0:c.constructor==Object&&Object.keys(c).length==0;const k=f||h;let l=!0;for(const n of Object.keys(b)){var m=e+"."+n;const p=f?d[e]:c[n];g.has(n)?(ia("Invalid config, dangerous key "+m),l=!1):k||n in c?b[n]===void 0?p===void 0||k?delete a[n]:a[n]=Gc(p):h?a[n]=b[n]:p.constructor==Object&&b[n]&&b[n].constructor==Object?(a[n]||(a[n]=Gc(p)),m=wm(a[n],b[n],p,
d,m),l=l&&m):typeof b[n]!=typeof p||b[n]==null||typeof b[n]!="function"&&b[n].constructor!=p.constructor?(ia("Invalid config, wrong type for "+m),l=!1):typeof c[n]=="function"&&c[n].length!=b[n].length?(ja("Unexpected number of arguments for "+m),a[n]=b[n]):a[n]=Array.isArray(a[n])?b[n].slice():b[n]:(ia("Invalid config, unrecognized key "+m),l=!1)}return l}
function xm(a,b){const c={};let d=c;for(var e=0,f=0;;){e=a.indexOf(".",e);if(e<0)break;if(e==0||a[e-1]!="\\")f=a.substring(f,e).replace(/\\\./g,"."),d[f]={},d=d[f],f=e+1;e+=1}d[a.substring(f).replace(/\\\./g,".")]=b;return c}function ym(a,b){return a&&b}
function zm(a,b){const c=f=>f&&typeof f==="object"&&!Array.isArray(f),d=(f,g)=>Object.keys(f).reduce((h,k)=>{var l=f[k];if(g.hasOwnProperty(k))if(l instanceof HTMLElement&&g[k]instanceof HTMLElement)l.isEqualNode(g[k])||(h[k]=l);else if(c(l)&&c(g[k])){if(l=d(l,g[k]),Object.keys(l).length>0||!c(l))h[k]=l}else Array.isArray(l)&&Array.isArray(g[k])?ta(l,g[k])||(h[k]=l):Number.isNaN(l)&&Number.isNaN(g[k])||l!==g[k]&&(h[k]=l);else h[k]=l;return h},{});a=d(a,b);const e=f=>{for(const h of Object.keys(f))if(!(f[h]instanceof
HTMLElement))if(c(f[h])&&Object.keys(f[h]).length===0)delete f[h];else{var g=f[h];Array.isArray(g)&&g.length===0?delete f[h]:typeof f[h]=="function"?delete f[h]:c(f[h])&&(e(f[h]),Object.keys(f[h]).length===0&&delete f[h])}};e(a);return a}var Am=class{};v("shaka.util.ConfigUtils",Am);Am.getDifferenceFromConfigObjects=zm;Am.convertToConfigObject=xm;Am.mergeConfigObjects=wm;v("shaka.config.RepeatMode",{OFF:0,ALL:1,SINGLE:2});function Bm(a){a=Hb(a);return(new Ua(a)).pb}function Cm(a,b,c){if(!c||!c.byteLength)throw new F(2,6,6015);let d;typeof b=="string"?d=Jb(b,!0):d=b;a=Hb(a);a=Jb(a,!0);const e=new Uint8Array(12+a.byteLength+d.byteLength+c.byteLength);let f=0;b=g=>{ob(e).setUint32(f,g.byteLength,!0);f+=4;e.set(C(g),f);f+=g.byteLength};b(a);b(d);b(c);return e}function Em(a,b,c){if(b!=="skd")return a;b=c.serverCertificate;c=Hb(a).split("skd://").pop();return Cm(a,c,b)}
function Fm(a,b){a===2&&(a=b.drmInfo)&&zb(a.keySystem)&&(b.headers["Content-Type"]="application/octet-stream")}var Gm=class{};v("shaka.drm.FairPlay",Gm);
Gm.commonFairPlayResponse=function(a,b){if(a===2&&(a=b.originalRequest.drmInfo)&&zb(a.keySystem)){try{var c=Eb(b.data)}catch(d){return}a=!1;c=c.trim();c.substr(0,5)==="<ckc>"&&c.substr(-6)==="</ckc>"&&(c=c.slice(5,-6),a=!0);if(!a)try{const d=JSON.parse(c);d.ckc&&(c=d.ckc,a=!0);d.CkcMessage&&(c=d.CkcMessage,a=!0);d.License&&(c=d.License,a=!0)}catch(d){}a&&(b.data=mb(Ob(c)))}};Gm.muxFairPlayRequest=function(a,b){Fm(a,b)};
Gm.expressplayFairPlayRequest=function(a,b){if(a===2){var c=b.drmInfo;c&&zb(c.keySystem)&&Fm(a,b)}};Gm.conaxFairPlayRequest=function(a,b){Fm(a,b)};Gm.ezdrmFairPlayRequest=function(a,b){Fm(a,b)};Gm.verimatrixFairPlayRequest=function(a,b){a===2&&(a=b.drmInfo)&&zb(a.keySystem)&&(a=C(b.body),a=Nb(a),b.headers["Content-Type"]="application/x-www-form-urlencoded",b.body=Ib("spc="+a))};Gm.muxInitDataTransform=function(a,b,c){return Em(a,b,c)};
Gm.expressplayInitDataTransform=function(a,b,c){return Em(a,b,c)};Gm.conaxInitDataTransform=function(a,b,c){if(b!=="skd")return a;b=c.serverCertificate;c=Hb(a).split("skd://").pop().split("?").shift();c=window.atob(c);var d=new ArrayBuffer(c.length*2);d=nb(d);for(let e=0,f=c.length;e<f;e++)d[e]=c.charCodeAt(e);return Cm(a,d,b)};Gm.ezdrmInitDataTransform=function(a,b,c){if(b!=="skd")return a;b=c.serverCertificate;c=Hb(a).split(";").pop();return Cm(a,c,b)};
Gm.verimatrixInitDataTransform=function(a,b,c){return Em(a,b,c)};Gm.initDataTransform=Cm;Gm.defaultGetContentId=Bm;Gm.isFairPlaySupported=async function(){const a={initDataTypes:["cenc","sinf","skd"],videoCapabilities:[{contentType:'video/mp4; codecs="avc1.42E01E"'}]};try{return await navigator.requestMediaKeySystemAccess("com.apple.fps",[a]),!0}catch(b){return!1}};function Hm(a,b){if(a.mimeType!=b.mimeType)return!1;a=a.codecs.split(",").map(c=>ie(c));b=b.codecs.split(",").map(c=>ie(c));return ta(a,b)}
function Im(a,b,c=!0){a=a.h;var d;if(!(d=!!a.audio!=!!b.audio||!!a.video!=!!b.video||a.language!=b.language)&&(d=a.audio&&b.audio)){d=a.audio;var e=b.audio;d=!(!((!d.channelsCount||!e.channelsCount||d.channelsCount>2||e.channelsCount>2)&&d.channelsCount!=e.channelsCount||d.spatialAudio!==e.spatialAudio||c&&!Hm(d,e))&&ta(d.roles,e.roles)&&d.groupId===e.groupId)}!d&&(d=a.video&&b.video)&&(a=a.video,b=b.video,d=!((!c||Hm(a,b))&&ta(a.roles,b.roles)));return d?!1:!0}
var Jm=class{constructor(a,b,c=!0){this.h=a;this.g=new Set([a]);b=b||[];for(const d of b)this.add(d,c)}add(a,b){return Im(this,a,b)?(this.g.add(a),!0):!1}values(){return this.g.values()}};v("shaka.media.AdaptationSet",Jm);function Km(a,b){b=Ie(b);const c=Pe(b,a.map(d=>Oe(d)));return c?a.filter(d=>c==Oe(d)):[]}function Lm(a,b){return a.filter(c=>c.audio?b?c.audio.roles.includes(b):c.audio.roles.length==0:!1)}function Mm(a,b){return a.filter(c=>c.video?b?c.video.roles.includes(b):c.video.roles.length==0:!1)}function Nm(a,b){return a.filter(c=>c.audio&&c.audio.label?c.audio.label.toLowerCase()==b.toLowerCase():!1)}
function Om(a,b){return a.filter(c=>c.video&&c.video.label?c.video.label.toLowerCase()==b.toLowerCase():!1)}function Pm(a,b){return a.filter(c=>c.audio&&c.audio.channelsCount&&c.audio.channelsCount>b?!1:!0).sort((c,d)=>c.audio||d.audio?c.audio?d.audio?(d.audio.channelsCount||0)-(c.audio.channelsCount||0):1:-1:0)}function Qm(a,b){if(b=="AUTO"){const c=a.some(d=>d.video&&d.video.hdr&&d.video.hdr=="HLG"?!0:!1);b=Fa().F(c)}return a.filter(c=>c.video&&c.video.hdr&&c.video.hdr!=b?!1:!0)}
function Rm(a,b){return a.filter(c=>c.video&&c.video.videoLayout&&c.video.videoLayout!=b?!1:!0)}function Sm(a,b){return a.filter(c=>c.audio&&c.audio.spatialAudio!=b?!1:!0)}function Tm(a,b){return a.filter(c=>c.audio&&c.audio.codecs!=b?!1:!0)}
var Um=class{constructor(){this.h=this.g=null}configure(a){this.g=a}getConfiguration(){return this.g}create(a){var b;if(this.g.language){const g=Km(a,this.g.language);g.length&&(b=g)}b||(b=a.filter(g=>g.primary),b=b.length?b:a);a=Lm(b,this.g.role);a.length&&(b=a);a=Mm(b,this.g.videoRole);a.length&&(b=a);this.g.videoLayout&&(a=Rm(b,this.g.videoLayout),a.length&&(b=a));this.g.hdrLevel&&(a=Qm(b,this.g.hdrLevel),a.length&&(b=a));const c=[this.g.channelCount,this.g.preferredAudioChannelCount];a=c.filter((g,
h)=>g&&c.indexOf(g)===h);if(a.length)for(var d of a)if(a=Pm(b,d),a.length){b=a;break}this.g.audioLabel&&(d=Nm(b,this.g.audioLabel),d.length&&(b=d));this.g.videoLabel&&(d=Om(b,this.g.videoLabel),d.length&&(b=d));d=Sm(b,this.g.spatialAudio);d.length&&(b=d);const e=[this.g.audioCodec,this.g.activeAudioCodec,...this.g.preferredAudioCodecs];d=e.filter((g,h)=>g&&e.indexOf(g)===h);if(d.length)for(var f of d)if(d=Tm(b,f),d.length){b=d;break}f=Fa();f=this.g.codecSwitchingStrategy=="smooth"&&f.l();return this.h=
new Jm(b[0],b,!f)}getLastAdaptationSet(){return this.h}};function Vm(){let a=Infinity;const b=Fa();navigator.connection&&navigator.connection.saveData&&(a=360);const c={retryParameters:Hf(),servers:{},clearKeys:{},advanced:{},delayLicenseRequestUntilPlayed:!1,persistentSessionOnlinePlayback:!1,persistentSessionsMetadata:[],initDataTransform:(h,k,l)=>{"apple"===window.shakaMediaKeysPolyfill&&k=="skd"&&(k=l.serverCertificate,l=Bm(h),h=Cm(h,l,k));return h},logLicenseExchange:!1,updateExpirationTime:1,preferredKeySystems:[],keySystemsMapping:{},parseInbandPsshEnabled:!1,
minHdcpVersion:"",ignoreDuplicateInitData:!0,defaultAudioRobustnessForWidevine:"SW_SECURE_CRYPTO",defaultVideoRobustnessForWidevine:"SW_SECURE_DECODE"};let d="reload";b.l()&&(d="smooth");const e={retryParameters:Hf(),availabilityWindowOverride:NaN,disableAudio:!1,disableVideo:!1,disableText:!1,disableThumbnails:!1,disableIFrames:!1,defaultPresentationDelay:0,segmentRelativeVttTiming:!1,raiseFatalErrorOnManifestUpdateRequestFailure:!1,continueLoadingWhenPaused:!0,ignoreSupplementalCodecs:!1,updatePeriod:-1,
ignoreDrmInfo:!1,enableAudioGroups:!0,dash:{clockSyncUri:"",disableXlinkProcessing:!0,xlinkFailGracefully:!1,ignoreMinBufferTime:!1,autoCorrectDrift:!0,initialSegmentLimit:1E3,ignoreSuggestedPresentationDelay:!1,ignoreEmptyAdaptationSet:!1,ignoreMaxSegmentDuration:!1,keySystemsByURI:{"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:e2719d58-a985-b3c9-781a-b030af78d30e":"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:79f0049a-4098-8642-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:94ce86fb-07ff-4f43-adb8-93d2fa968ca2":"com.apple.fps","urn:uuid:3d5e6d35-9b9a-41e8-b843-dd3c6e72c42c":"com.huawei.wiseplay"},manifestPreprocessor:Wm,manifestPreprocessorTXml:Xm,sequenceMode:!1,useStreamOnceInPeriodFlattening:!1,enableFastSwitching:!0},hls:{ignoreTextStreamFailures:!1,ignoreImageStreamFailures:!1,defaultAudioCodec:"mp4a.40.2",defaultVideoCodec:"avc1.42E01E",ignoreManifestProgramDateTime:!1,ignoreManifestProgramDateTimeForTypes:[],
mediaPlaylistFullMimeType:'video/mp2t; codecs="avc1.42E01E, mp4a.40.2"',liveSegmentsDelay:3,sequenceMode:b.B(),ignoreManifestTimestampsInSegmentsMode:!1,disableCodecGuessing:!1,disableClosedCaptionsDetection:!1,allowLowLatencyByteRangeOptimization:!0,allowRangeRequestsToGuessMimeType:!1},mss:{manifestPreprocessor:Wm,manifestPreprocessorTXml:Xm,sequenceMode:!1,keySystemsBySystemId:{"9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","79f0049a-4098-8642-ab92-e65be0885f95":"com.microsoft.playready"}}},
f={trackSelectionCallback:async h=>h,downloadSizeCallback:async h=>{if(navigator.storage&&navigator.storage.estimate){const k=await navigator.storage.estimate();return k.usage+h<k.quota*.95}return!0},progressCallback:(h,k)=>ym([h,k]),usePersistentLicense:!0,numberOfParallelDownloads:5},g={drm:c,manifest:e,streaming:{retryParameters:Hf(),failureCallback:h=>ym([h]),rebufferingGoal:0,bufferingGoal:10,bufferBehind:30,evictionGoal:1,ignoreTextStreamFailures:!1,alwaysStreamText:!1,startAtSegmentBoundary:!1,
gapDetectionThreshold:.5,gapPadding:0,gapJumpTimerTime:.25,durationBackoff:1,safeSeekOffset:5,safeSeekEndOffset:0,stallEnabled:!0,stallThreshold:1,stallSkip:.1,useNativeHlsForFairPlay:!0,inaccurateManifestTolerance:2,lowLatencyMode:!0,preferNativeDash:!1,preferNativeHls:!1,updateIntervalSeconds:1,observeQualityChanges:!1,maxDisabledTime:30,segmentPrefetchLimit:1,prefetchAudioLanguages:[],disableAudioPrefetch:!1,disableTextPrefetch:!1,disableVideoPrefetch:!1,liveSync:{enabled:!1,targetLatency:.5,targetLatencyTolerance:.5,
maxPlaybackRate:1.1,minPlaybackRate:.95,panicMode:!1,panicThreshold:60,dynamicTargetLatency:{enabled:!1,stabilityThreshold:60,rebufferIncrement:.5,maxAttempts:10,maxLatency:4,minLatency:1}},allowMediaSourceRecoveries:!0,minTimeBetweenRecoveries:5,vodDynamicPlaybackRate:!1,vodDynamicPlaybackRateLowBufferRate:.95,vodDynamicPlaybackRateBufferRatio:.5,preloadNextUrlWindow:30,loadTimeout:30,clearDecodingCache:!1,dontChooseCodecs:!1,shouldFixTimestampOffset:!1,avoidEvictionOnQuotaExceededError:!1,crossBoundaryStrategy:"keep",
returnToEndOfLiveWindowWhenOutside:!1},networking:{forceHTTP:!1,forceHTTPS:!1,minBytesForProgressEvents:16E3},mediaSource:{codecSwitchingStrategy:d,addExtraFeaturesToSourceBuffer:h=>ym([h],""),forceTransmux:!1,insertFakeEncryptionInInit:!0,correctEc3Enca:!1,modifyCueCallback:(h,k,l)=>ym([h,k,l]),dispatchAllEmsgBoxes:!1,useSourceElements:!0,durationReductionEmitsUpdateEnd:!0},offline:f,abrFactory:()=>new Gf,adaptationSetCriteriaFactory:(...h)=>new Um(...h),abr:{enabled:!0,useNetworkInformation:!0,
defaultBandwidthEstimate:1E6,switchInterval:8,bandwidthUpgradeTarget:.85,bandwidthDowngradeTarget:.95,restrictions:{minWidth:0,maxWidth:Infinity,minHeight:0,maxHeight:a,minPixels:0,maxPixels:Infinity,minFrameRate:0,maxFrameRate:Infinity,minBandwidth:0,maxBandwidth:Infinity,minChannelsCount:0,maxChannelsCount:Infinity},advanced:{minTotalBytes:128E3,minBytes:16E3,fastHalfLife:2,slowHalfLife:5},restrictToElementSize:!1,restrictToScreenSize:!1,ignoreDevicePixelRatio:!1,clearBufferSwitch:!1,safeMarginSwitch:0,
cacheLoadThreshold:5,minTimeToSwitch:0,preferNetworkInformationBandwidth:!1,removeLatencyFromFirstPacketTime:!1},autoShowText:3,preferredAudioLanguage:"",preferredAudioLabel:"",preferredTextLanguage:"",preferredAudioRole:"",preferredVideoRole:"",preferredTextRole:"",preferredAudioChannelCount:2,preferredVideoHdrLevel:"AUTO",preferredVideoLayout:"",preferredVideoLabel:"",preferredVideoCodecs:[],preferredAudioCodecs:[],preferredTextFormats:[],preferForcedSubs:!1,preferSpatialAudio:!1,preferredDecodingAttributes:[],
restrictions:{minWidth:0,maxWidth:Infinity,minHeight:0,maxHeight:Infinity,minPixels:0,maxPixels:Infinity,minFrameRate:0,maxFrameRate:Infinity,minBandwidth:0,maxBandwidth:Infinity,minChannelsCount:0,maxChannelsCount:Infinity},playRangeStart:0,playRangeEnd:Infinity,textDisplayer:{captionsUpdatePeriod:.25,fontScaleFactor:1},textDisplayFactory:()=>null,cmcd:{enabled:!1,sessionId:"",contentId:"",rtpSafetyFactor:5,useHeaders:!1,includeKeys:[],version:1,targets:[]},cmsd:{enabled:!0,applyMaximumSuggestedBitrate:!0,
estimatedThroughputWeightRatio:.5},lcevc:{enabled:!1,dynamicPerformanceScaling:!0,logLevel:0,drawLogo:!1,poster:!0},ads:{customPlayheadTracker:!1,skipPlayDetection:!1,supportsMultipleMediaElements:!0,disableHLSInterstitial:!1,disableDASHInterstitial:!1,allowPreloadOnDomElements:!0,allowStartInMiddleOfInterstitial:!0},ignoreHardwareResolution:!1,queue:{preloadNextUrlWindow:Infinity,preloadPrevItem:!0,repeatMode:0}};f.trackSelectionCallback=async h=>Ym(h,g.preferredAudioLanguage,g.preferredVideoHdrLevel);
return b.j(g)}function Wm(a){return ym([a],a)}function Xm(a){return ym([a],a)}
function Ym(a,b,c){let d=c;d=="AUTO"&&(c=a.some(h=>h.hdr&&h.hdr=="HLG"?!0:!1),d=Fa().F(c));var e=a.filter(h=>h.type!="variant"||h.hdr&&h.hdr!=d?!1:!0);c=[];const f=Pe(b,e.map(h=>h.language));f&&(c=e.filter(h=>Ie(h.language)==f));c.length==0&&(c=e.filter(h=>h.primary));c.length==0&&(e.map(h=>h.language),c=e);const g=c.filter(h=>h.height&&h.height<=480);g.length&&(g.sort((h,k)=>k.height-h.height),c=g.filter(h=>h.height==g[0].height));b=[];c.length&&(e=Math.floor(c.length/2),c.sort((h,k)=>h.bandwidth-
k.bandwidth),b.push(c[e]));for(const h of a)h.type!=G&&h.type!="image"||b.push(h);return b}function Zm(){return{streaming:{inaccurateManifestTolerance:0,segmentPrefetchLimit:2,updateIntervalSeconds:.1,maxDisabledTime:1,retryParameters:{baseDelay:100}},manifest:{dash:{autoCorrectDrift:!1},retryParameters:{baseDelay:100}},drm:{retryParameters:{baseDelay:100}}}}
function $m(a,b,c){const d={".drm.keySystemsMapping":"",".drm.servers":"",".drm.clearKeys":"",".drm.advanced":{distinctiveIdentifierRequired:!1,persistentStateRequired:!1,videoRobustness:[],audioRobustness:[],sessionType:"",serverCertificate:new Uint8Array(0),serverCertificateUri:"",individualizationServer:"",headers:{}}};return wm(a,b,c||Vm(),d,"")}var an=class{};v("shaka.util.PlayerConfiguration",an);an.mergeConfigObjects=$m;an.createDefaultForLL=Zm;an.createDefault=Vm;function bn(a,b){let c=0;a.g&&a.g.state==b&&(c+=a.g.duration);for(const d of a.h)c+=d.state==b?d.duration:0;return c}function cn(a){const b=d=>({timestamp:d.timestamp,state:d.state,duration:d.duration}),c=[];for(const d of a.h)c.push(b(d));a.g&&c.push(b(a.g));return c}var dn=class{constructor(){this.g=null;this.h=[]}};function en(a,b,c){a.i!=b&&(a.i=b,a.g.push({timestamp:Date.now()/1E3,id:b.id,type:"text",fromAdaptation:c,bandwidth:null}))}var fn=class{constructor(){this.i=this.h=null;this.g=[]}};function gn(a,b,c){a.O=b;a.N=c}function hn(a,b,c){a.T=b;a.B=c}function jn(a,b){b>=0&&(a.I=b)}function kn(a,b){a.i=isNaN(a.i)?b:Math.max(a.i,b)}function ln(a,b){b>=0&&(a.o=b)}function mn(a,b){b>=0&&(a.C=b)}function nn(a,b){b>=0&&(a.J=b)}function on(a,b){a.j=isNaN(a.j)?b:a.j+b}
function pn(a){var b=a.T,c=a.B,d=a.l,e=a.A,f=a.N,g=a.O,h=a.M,k=a.S,l=a.R,m=a.u,n=a.i,p=a.F,r=a.I,q=a.m,t=bn(a.g,"playing"),u=bn(a.g,"paused"),x=bn(a.g,"buffering"),y=a.o,w=a.C,z=a.J,A=a.Gg,B=a.j,D=a.K,E=a.H,Z=a.G,J=cn(a.g);a=a.h;const K=[];for(const ba of a.g)K.push({timestamp:ba.timestamp,id:ba.id,type:ba.type,fromAdaptation:ba.fromAdaptation,bandwidth:ba.bandwidth});return{width:b,height:c,currentCodecs:d,streamBandwidth:e,decodedFrames:f,droppedFrames:g,corruptedFrames:h,stallsDetected:k,gapsJumped:l,
estimatedBandwidth:m,completionPercent:n,loadLatency:p,manifestTimeSeconds:r,drmTimeSeconds:q,playTime:t,pauseTime:u,bufferingTime:x,licenseTime:y,liveLatency:w,maxSegmentDuration:z,manifestSizeBytes:A,bytesDownloaded:B,nonFatalErrorCount:D,manifestPeriodCount:E,manifestGapCount:Z,stateHistory:J,switchHistory:K}}
var qn=class{constructor(){this.B=this.T=NaN;this.l="";this.j=this.Gg=this.u=this.A=this.J=this.C=this.o=this.m=this.I=this.F=this.i=this.R=this.S=this.M=this.N=this.O=NaN;this.K=0;this.G=this.H=NaN;this.g=new dn;this.h=new fn}};function rn(a){const b=c=>c.video&&c.audio||c.video&&c.video.codecs.includes(",");a.variants.some(b)&&(a.variants=a.variants.filter(b))}function sn(a,b,c){(a=b?a.I:a.J)?a.push(c):c()}function tn(a){if(a.I)for(const b of a.I)b();a.I=null}function un(a,b){a.N=b;a.O=!0;if(a.J)for(const c of a.J)c();a.J=null}function vn(a){a.qa=!0;return a.H}function wn(a){a.Y=!0;return a.j}function xn(a){a.sa=!0;return a.K}
async function yn(a){zn(a,"manifest-parser");a.m||(a.G=mc(a.M,a.S),a.m=a.G(),a.m.configure(a.g.manifest,()=>a.C));const b=Date.now()/1E3;zn(a,"manifest");a.h||(a.h=await a.m.start(a.M,a.Ha),rn(a.h),await An(a));a.ea.resolve();var c=new L("manifestparsed",void 0);await Promise.resolve();a.dispatchEvent(c);if(a.h.variants.length==0)throw new F(2,4,4036);rn(a.h);xh(a.F,a.h)&&(c=new L("trackschanged",void 0),await Promise.resolve(),Bn(a),a.dispatchEvent(c));jn(a.T,Date.now()/1E3-b)}
function Bn(a){if(a.l)throw new F(2,7,7003);}async function Cn(a,b){if(a.h&&!a.j){zn(a,"drm-engine");a.ua=Date.now()/1E3;a.j=a.Aa();a.F.g=a.j;a.j.configure(a.g.drm,()=>a.C);var c=uf(a.h.variants),d=!0;a.h&&a.h.presentationTimeline&&(d=a.h.presentationTimeline.U());await Tg(a.j,c,a.h.offlineSessionIds,d);Bn(a);b&&(await a.j.Db(b),Bn(a));await Ah(a.F,a.h)&&(b=new L("trackschanged",void 0),await Promise.resolve(),a.dispatchEvent(b))}}
async function Dn(a){a.i&&!a.h.variants.includes(a.i)&&(await En(a.i),a.i=Fn(a),a.i&&await Gn(a.i))}async function Hn(a){if(!a.i){var b=Fn(a);b&&(a.i=b)}if(a.i){b=a.h.presentationTimeline.U();const c=[],d=a.i;d.video&&c.push(In(a,d.video,b));d.audio&&c.push(In(a,d.audio,b));const e=vf(a.h.textStreams,a.g.preferredTextLanguage,a.g.preferredTextRole,a.g.preferForcedSubs)[0]||null;e&&zf(d.audio,e,a.g)&&(c.push(In(a,e,b)),a.R=e);await Promise.all(c)}}
function zn(a,b){a.dispatchEvent(new L("onstatechange",(new Map).set("state",b)))}
async function An(a){a.B||(a.B=a.g.adaptationSetCriteriaFactory(),a.B.configure({language:a.g.preferredAudioLanguage,role:a.g.preferredAudioRole,videoRole:a.g.preferredVideoRole,channelCount:0,hdrLevel:a.g.preferredVideoHdrLevel,spatialAudio:a.g.preferSpatialAudio,videoLayout:a.g.preferredVideoLayout,audioLabel:a.g.preferredAudioLabel,videoLabel:a.g.preferredVideoLabel,codecSwitchingStrategy:a.g.mediaSource.codecSwitchingStrategy,audioCodec:"",activeAudioCodec:"",activeAudioChannelCount:0,preferredAudioCodecs:a.g.preferredAudioCodecs,
preferredAudioChannelCount:a.g.preferredAudioChannelCount}));if(a.i||!a.h.variants.length?0:a.h.variants.length==1||a.h.type=="HLS")a.i=Fn(a),a.i&&await Gn(a.i)}function Fn(a){if(!a.u){var b=a.g.abrFactory;a.u=b();a.u.configure(a.g.abr)}b=uf(a.h.variants);b=a.B.create(b);a.u.setVariants(Array.from(b.values()));return a.u.chooseVariant(!0)}async function Gn(a){const b=[];for(const c of[a.video,a.audio])c&&!c.segmentIndex&&b.push(c.createSegmentIndex());b.length>0&&await Promise.all(b)}
async function En(a){const b=[];for(const c of[a.video,a.audio])c&&c.segmentIndex&&c.closeSegmentIndex&&b.push(c.closeSegmentIndex());b.length>0&&await Promise.all(b)}
async function In(a,b,c){const d=new vl(a.g.streaming.segmentPrefetchLimit||2,b,(g,h,k)=>Hl(g,h,k||null,a.g.streaming.retryParameters,a.va,a.C),!1);a.K.set(b.id,d);b.segmentIndex||await b.createSegmentIndex();const e=b.segmentIndex.Fb(typeof a.o==="number"?a.o:0);let f=null;e&&(f=e.current(),f||(f=e.next().value));f||=b.segmentIndex.qb();f&&(c?f.$&&await ml(d,f.$):await rl(d,f.startTime))}
var Jn=class extends Vf{constructor(a,b,c,d){super();this.M=a;this.S=b;this.va=d.networkingEngine;this.o=c;this.B=null;this.ua=0;this.Aa=d.Hc;this.F=d.si;this.Ha=d.ti;this.g=d.config;this.m=this.G=this.h=null;this.ha=!1;this.H=d.Hi;this.qa=!1;this.j=null;this.Y=!1;this.u=null;this.K=new Map;this.sa=!1;this.Ba=d.Gi;this.T=new qn;this.ea=new Lf;this.A=new Lf;this.N=null;this.l=!1;this.W=d.hh;this.R=this.i=null;this.O=!1;this.J=[];this.I=[];this.C=!0}getStartTime(){return this.o}Kc(){return this.M}vf(){return this.h}getStats(){return this.T}Rh(){return this.i?
mf(this.i):null}Qh(){return this.R?nf(this.R):null}start(){(async()=>{await Promise.resolve();try{await yn(this),Bn(this),"webkit"!==window.shakaMediaKeysPolyfill&&(await Cn(this),Bn(this)),await Dn(this),Bn(this),this.W&&(await Hn(this),Bn(this)),this.W&&this.j&&(await ph(this.j),Bn(this)),this.A.resolve()}catch(a){a instanceof F&&(a.code==7001||a.code==7003)||this.A.reject(a)}})()}dispatchEvent(a){return this.N?this.N.dispatchEvent(a):super.dispatchEvent(a)}onError(a){a.severity===2&&(this.A.reject(a),
this.destroy());var b=(new Map).set("detail",a);b=new L("error",b);this.dispatchEvent(b);b.defaultPrevented&&(a.handled=!0)}configure(a,b){a=xm(a,b);$m(this.g,a)}getConfiguration(){return Gc(this.g)}gj(){return this.A}async destroy(){this.l=!0;this.m&&!this.ha&&await this.m.stop();this.u&&this.u.release();this.H&&!this.qa&&this.H.release();this.j&&!this.Y&&await this.j.destroy();if(this.K.size>0&&!this.sa)for(const a of this.K.values())sl(a)}};v("shaka.media.PreloadManager",Jn);
Jn.prototype.destroy=Jn.prototype.destroy;Jn.prototype.waitForFinish=Jn.prototype.gj;Jn.prototype.getPrefetchedTextTrack=Jn.prototype.Qh;Jn.prototype.getPrefetchedVariantTrack=Jn.prototype.Rh;function Kn(a,b,c,d){b=new L(b,new Map([["region",c],["seeking",d]]));a.dispatchEvent(b)}
var On=class extends Vf{constructor(a,b){super();this.i=a;this.l=b;this.g=new Map;this.m=[{Fc:null,Ec:Ln,uc:(c,d)=>Kn(this,"enter",c,d)},{Fc:Mn,Ec:Ln,uc:(c,d)=>Kn(this,"enter",c,d)},{Fc:Nn,Ec:Ln,uc:(c,d)=>Kn(this,"enter",c,d)},{Fc:Ln,Ec:Mn,uc:(c,d)=>Kn(this,"exit",c,d)},{Fc:Ln,Ec:Nn,uc:(c,d)=>Kn(this,"exit",c,d)},{Fc:Mn,Ec:Nn,uc:(c,d)=>{d?Kn(this,"skip",c,d):(Kn(this,"enter",c,d),Kn(this,"exit",c,d))}},{Fc:Nn,Ec:Mn,uc:(c,d)=>Kn(this,"skip",c,d)}];this.h=new Aa;this.h.D(this.i,"regionremove",c=>{this.g.delete(c.region)})}release(){this.i=
null;this.g.clear();this.h.release();this.h=null;super.release()}j(a,b){if(!this.l||a!=0){this.l=!1;for(const c of this.i.h.values()){const d=this.g.get(c),e=a<c.startTime?Mn:a>c.endTime?Nn:Ln;this.g.set(c,e);for(const f of this.m)f.Fc==d&&f.Ec==e&&f.uc(c,b)}}}},Mn=1,Ln=2,Nn=3;/*
 @license
 Copyright 2013 Ali Al Dallal

 Licensed under the MIT license.

 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
 in the Software without restriction, including without limitation the rights
 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the Software is
 furnished to do so, subject to the following conditions:

 The above copyright notice and this permission notice shall be included in
 all copies or substantial portions of the Software.

 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 SOFTWARE.
*/
var Pn={ach:"Lwo",ady:"\u0410\u0434\u044b\u0433\u044d\u0431\u0437\u044d",af:"Afrikaans","af-NA":"Afrikaans (Namibia)","af-ZA":"Afrikaans (South Africa)",ak:"T\u0255\u0265i",ar:"\u0627\u0644\u0639\u0631\u0628\u064a\u0629","ar-AR":"\u0627\u0644\u0639\u0631\u0628\u064a\u0629","ar-MA":"\u0627\u0644\u0639\u0631\u0628\u064a\u0629","ar-SA":"\u0627\u0644\u0639\u0631\u0628\u064a\u0629 (\u0627\u0644\u0633\u0639\u0648\u062f\u064a\u0629)","ay-BO":"Aymar aru",az:"Az\u0259rbaycan dili","az-AZ":"Az\u0259rbaycan dili",
"be-BY":"\u0411\u0435\u043b\u0430\u0440\u0443\u0441\u043a\u0430\u044f",bg:"\u0411\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438","bg-BG":"\u0411\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438",bn:"\u09ac\u09be\u0982\u09b2\u09be","bn-IN":"\u09ac\u09be\u0982\u09b2\u09be (\u09ad\u09be\u09b0\u09a4)","bn-BD":"\u09ac\u09be\u0982\u09b2\u09be(\u09ac\u09be\u0982\u09b2\u09be\u09a6\u09c7\u09b6)","bs-BA":"Bosanski",ca:"Catal\u00e0","ca-ES":"Catal\u00e0",cak:"Maya Kaqchikel","ck-US":"\u13e3\u13b3\u13a9 (tsalagi)",
cs:"\u010ce\u0161tina","cs-CZ":"\u010ce\u0161tina",cy:"Cymraeg","cy-GB":"Cymraeg",da:"Dansk","da-DK":"Dansk",de:"Deutsch","de-AT":"Deutsch (\u00d6sterreich)","de-DE":"Deutsch (Deutschland)","de-CH":"Deutsch (Schweiz)",dsb:"Dolnoserb\u0161\u0107ina",el:"\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac","el-GR":"\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac",en:"English","en-GB":"English (UK)","en-AU":"English (Australia)","en-CA":"English (Canada)","en-IE":"English (Ireland)","en-IN":"English (India)",
"en-PI":"English (Pirate)","en-UD":"English (Upside Down)","en-US":"English (US)","en-ZA":"English (South Africa)","en@pirate":"English (Pirate)",eo:"Esperanto","eo-EO":"Esperanto",es:"Espa\u00f1ol","es-AR":"Espa\u00f1ol (Argentine)","es-419":"Espa\u00f1ol (Latinoam\u00e9rica)","es-CL":"Espa\u00f1ol (Chile)","es-CO":"Espa\u00f1ol (Colombia)","es-EC":"Espa\u00f1ol (Ecuador)","es-ES":"Espa\u00f1ol (Espa\u00f1a)","es-LA":"Espa\u00f1ol (Latinoam\u00e9rica)","es-NI":"Espa\u00f1ol (Nicaragua)","es-MX":"Espa\u00f1ol (M\u00e9xico)",
"es-US":"Espa\u00f1ol (Estados Unidos)","es-VE":"Espa\u00f1ol (Venezuela)",et:"eesti keel","et-EE":"Eesti (Estonia)",eu:"Euskara","eu-ES":"Euskara",fa:"\u0641\u0627\u0631\u0633\u06cc","fa-IR":"\u0641\u0627\u0631\u0633\u06cc","fb-LT":"Leet Speak",ff:"Fulah",fi:"Suomi","fi-FI":"Suomi","fo-FO":"F\u00f8royskt",fr:"Fran\u00e7ais","fr-CA":"Fran\u00e7ais (Canada)","fr-FR":"Fran\u00e7ais (France)","fr-BE":"Fran\u00e7ais (Belgique)","fr-CH":"Fran\u00e7ais (Suisse)","fy-NL":"Frysk",ga:"Gaeilge","ga-IE":"Gaeilge (Gaelic)",
gl:"Galego","gl-ES":"Galego","gn-PY":"Ava\u00f1e'\u1ebd","gu-IN":"\u0a97\u0ac1\u0a9c\u0ab0\u0abe\u0aa4\u0ac0","gx-GR":"\u1f19\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ae \u1f00\u03c1\u03c7\u03b1\u03af\u03b1",he:"\u05e2\u05d1\u05e8\u05d9\u05ea\u200f","he-IL":"\u05e2\u05d1\u05e8\u05d9\u05ea\u200f",hi:"\u0939\u093f\u0928\u094d\u0926\u0940","hi-IN":"\u0939\u093f\u0928\u094d\u0926\u0940",hr:"Hrvatski","hr-HR":"Hrvatski",hsb:"Hornjoserb\u0161\u0107ina",ht:"Krey\u00f2l",hu:"Magyar","hu-HU":"Magyar","hy-AM":"\u0540\u0561\u0575\u0565\u0580\u0565\u0576",
id:"Bahasa Indonesia","id-ID":"Bahasa Indonesia",is:"\u00cdslenska","is-IS":"\u00cdslenska (Iceland)",it:"Italiano","it-IT":"Italiano",ja:"\u65e5\u672c\u8a9e","ja-JP":"\u65e5\u672c\u8a9e","jv-ID":"Basa Jawa","ka-GE":"\u10e5\u10d0\u10e0\u10d7\u10e3\u10da\u10d8","kk-KZ":"\u049a\u0430\u0437\u0430\u049b\u0448\u0430",km:"\u1797\u17b6\u179f\u17b6\u1781\u17d2\u1798\u17c2\u179a","km-KH":"\u1797\u17b6\u179f\u17b6\u1781\u17d2\u1798\u17c2\u179a",kab:"Taqbaylit",kn:"\u0c95\u0ca8\u0ccd\u0ca8\u0ca1","kn-IN":"\u0c95\u0ca8\u0ccd\u0ca8\u0ca1 (India)",
ko:"\ud55c\uad6d\uc5b4","ko-KR":"\ud55c\uad6d\uc5b4 (\u97e9\u56fd)",ku:"Kurd\u00ee","ku-TR":"Kurd\u00ee",la:"Latin","la-VA":"Latin",lb:"L\u00ebtzebuergesch","li-NL":"L\u00e8mb\u00f6rgs",lt:"Lietuvi\u0173","lt-LT":"Lietuvi\u0173",lv:"Latvie\u0161u","lv-LV":"Latvie\u0161u",mai:"\u092e\u0948\u0925\u093f\u0932\u0940, \u09ae\u09c8\u09a5\u09bf\u09b2\u09c0","mg-MG":"Malagasy",mk:"\u041c\u0430\u043a\u0435\u0434\u043e\u043d\u0441\u043a\u0438","mk-MK":"\u041c\u0430\u043a\u0435\u0434\u043e\u043d\u0441\u043a\u0438 (\u041c\u0430\u043a\u0435\u0434\u043e\u043d\u0441\u043a\u0438)",
ml:"\u0d2e\u0d32\u0d2f\u0d3e\u0d33\u0d02","ml-IN":"\u0d2e\u0d32\u0d2f\u0d3e\u0d33\u0d02","mn-MN":"\u041c\u043e\u043d\u0433\u043e\u043b",mr:"\u092e\u0930\u093e\u0920\u0940","mr-IN":"\u092e\u0930\u093e\u0920\u0940",ms:"Bahasa Melayu","ms-MY":"Bahasa Melayu",mt:"Malti","mt-MT":"Malti",my:"\u1017\u1019\u102c\u1005\u1000\u102c",nb:"Norsk (bokm\u00e5l)","nb-NO":"Norsk (bokm\u00e5l)",ne:"\u0928\u0947\u092a\u093e\u0932\u0940","ne-NP":"\u0928\u0947\u092a\u093e\u0932\u0940",nl:"Nederlands","nl-BE":"Nederlands (Belgi\u00eb)",
"nl-NL":"Nederlands (Nederland)","nn-NO":"Norsk (nynorsk)",no:"Norsk",oc:"Occitan","or-IN":"\u0b13\u0b21\u0b3c\u0b3f\u0b06",pa:"\u0a2a\u0a70\u0a1c\u0a3e\u0a2c\u0a40","pa-IN":"\u0a2a\u0a70\u0a1c\u0a3e\u0a2c\u0a40 (\u0a2d\u0a3e\u0a30\u0a24 \u0a28\u0a42\u0a70)",pl:"Polski","pl-PL":"Polski","ps-AF":"\u067e\u069a\u062a\u0648",pt:"Portugu\u00eas","pt-BR":"Portugu\u00eas (Brasil)","pt-PT":"Portugu\u00eas (Portugal)","qu-PE":"Qhichwa","rm-CH":"Rumantsch",ro:"Rom\u00e2n\u0103","ro-RO":"Rom\u00e2n\u0103",ru:"\u0420\u0443\u0441\u0441\u043a\u0438\u0439",
"ru-RU":"\u0420\u0443\u0441\u0441\u043a\u0438\u0439","sa-IN":"\u0938\u0902\u0938\u094d\u0915\u0943\u0924\u092e\u094d","se-NO":"Davvis\u00e1megiella","si-LK":"\u0db4\u0dc5\u0dcf\u0dad",sk:"Sloven\u010dina","sk-SK":"Sloven\u010dina (Slovakia)",sl:"Sloven\u0161\u010dina","sl-SI":"Sloven\u0161\u010dina","so-SO":"Soomaaliga",sq:"Shqip","sq-AL":"Shqip",sr:"\u0421\u0440\u043f\u0441\u043a\u0438","sr-RS":"\u0421\u0440\u043f\u0441\u043a\u0438 (Serbia)",su:"Basa Sunda",sv:"Svenska","sv-SE":"Svenska",sw:"Kiswahili",
"sw-KE":"Kiswahili",ta:"\u0ba4\u0bae\u0bbf\u0bb4\u0bcd","ta-IN":"\u0ba4\u0bae\u0bbf\u0bb4\u0bcd",te:"\u0c24\u0c46\u0c32\u0c41\u0c17\u0c41","te-IN":"\u0c24\u0c46\u0c32\u0c41\u0c17\u0c41",tg:"\u0437\u0430\u0431\u043e\u0301\u043d\u0438 \u0442\u043e\u04b7\u0438\u043a\u04e3\u0301","tg-TJ":"\u0442\u043e\u04b7\u0438\u043a\u04e3",th:"\u0e20\u0e32\u0e29\u0e32\u0e44\u0e17\u0e22","th-TH":"\u0e20\u0e32\u0e29\u0e32\u0e44\u0e17\u0e22 (\u0e1b\u0e23\u0e30\u0e40\u0e17\u0e28\u0e44\u0e17\u0e22)",tl:"Filipino","tl-PH":"Filipino",
tlh:"tlhIngan-Hol",tr:"T\u00fcrk\u00e7e","tr-TR":"T\u00fcrk\u00e7e","tt-RU":"\u0442\u0430\u0442\u0430\u0440\u0447\u0430",uk:"\u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430","uk-UA":"\u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430",ur:"\u0627\u0631\u062f\u0648","ur-PK":"\u0627\u0631\u062f\u0648",uz:"O'zbek","uz-UZ":"O'zbek",vi:"Ti\u1ebfng Vi\u1ec7t","vi-VN":"Ti\u1ebfng Vi\u1ec7t","xh-ZA":"isiXhosa",yi:"\u05d9\u05d9\u05b4\u05d3\u05d9\u05e9","yi-DE":"\u05d9\u05d9\u05b4\u05d3\u05d9\u05e9 (German)",
zh:"\u4e2d\u6587","zh-HANS":"\u4e2d\u6587\u7b80\u4f53","zh-HANT":"\u4e2d\u6587\u7e41\u9ad4","zh-CN":"\u4e2d\u6587\uff08\u4e2d\u56fd\uff09","zh-HK":"\u4e2d\u6587\uff08\u9999\u6e2f\uff09","zh-SG":"\u4e2d\u6587\uff08\u65b0\u52a0\u5761\uff09","zh-TW":"\u4e2d\u6587\uff08\u53f0\u7063\uff09","zu-ZA":"isiZulu"};for(let a of Object.keys(Pn))Pn[a.toLowerCase()]=Pn[a];function Qn(a,b){if(a.lineBreak)return"\n";if(a.nestedCues.length)return a.nestedCues.map(g=>Qn(g,a)).join("");if(!a.payload)return a.payload;const c=[];var d=a.fontWeight>=Fd,e=a.fontStyle==Gd;const f=a.textDecoration.includes(Hd);d&&c.push(["b"]);e&&c.push(["i"]);f&&c.push(["u"]);e=a.color;e==""&&b&&(e=b.color);d="";(e=Rn(e))&&(d+=`.${e}`);e=a.backgroundColor;e==""&&b&&(e=b.backgroundColor);(b=Rn(e))&&(d+=`.bg_${b}`);d&&c.push(["c",d]);return c.reduceRight((g,[h,k=""])=>`<${h}${k}>${g}</${h}>`,
a.payload)}
function Rn(a){a=a.toLowerCase();const b=a.replace(/\s/g,"").match(/^rgba?\((\d+),(\d+),(\d+),?([^,\s)]+)?/i);b?a="#"+(parseInt(b[1],10)|256).toString(16).slice(1)+(parseInt(b[2],10)|256).toString(16).slice(1)+(parseInt(b[3],10)|256).toString(16).slice(1):a.startsWith("#")&&a.length>7&&(a=a.slice(0,7));switch(a){case "white":case "#fff":case "#ffffff":return"white";case "lime":case "#0f0":case "#00ff00":return"lime";case "cyan":case "#0ff":case "#00ffff":return"cyan";case "red":case "#f00":case "#ff0000":return"red";case "yellow":case "#ff0":case "#ffff00":return"yellow";
case "magenta":case "#f0f":case "#ff00ff":return"magenta";case "blue":case "#00f":case "#0000ff":return"blue";case "black":case "#000":case "#000000":return"black"}return null}function Sn(a,b){const c=[];for(const d of Tn(a))d.isContainer?c.push(...Sn(d.nestedCues,d)):(a=d.clone(),a.nestedCues=[],a.payload=Qn(d,b),c.push(a));return c}function Tn(a){const b=[];for(const c of a)b.some(d=>vd(c,d))||b.push(c);return b}
function Un(a){if(a.startTime>=a.endTime)return null;const b=new VTTCue(a.startTime,a.endTime,a.payload),c=d=>{let e=5381,f=d.length;for(;f;)e=e*33^d.charCodeAt(--f);return(e>>>0).toString()};b.id=c(a.startTime.toString())+c(a.endTime.toString())+c(a.payload);b.lineAlign=a.lineAlign;b.positionAlign=a.positionAlign;a.size&&(b.size=a.size);try{b.align=a.textAlign}catch(d){}a.textAlign=="center"&&b.align!="center"&&(b.align="middle");a.writingMode=="vertical-lr"?b.vertical="lr":a.writingMode=="vertical-rl"&&
(b.vertical="rl");a.lineInterpretation==1&&(b.snapToLines=!1);a.line!=null&&(b.line=a.line);a.position!=null&&(b.position=a.position);return b}
function Vn(a,b){var c=Sn(b);const d=[];b=a.cues?Array.from(a.cues):[];for(const e of c)!b.some(f=>f.startTime==e.startTime&&f.endTime==e.endTime&&f.text==e.payload?!0:!1)&&e.payload&&(c=Un(e))&&d.push(c);b=d.slice().sort((e,f)=>e.startTime!=f.startTime?e.startTime-f.startTime:e.endTime!=f.endTime?e.endTime-f.startTime:"line"in VTTCue.prototype?d.indexOf(f)-d.indexOf(e):d.indexOf(e)-d.indexOf(f));for(const e of b)a.addCue(e)}
function Wn(a,b){let c=!1;a.mode==="disabled"&&(c=!0,a.mode="hidden");let d=0;for(;d<a.cues.length;){const e=a.cues[d];b(e)?a.removeCue(e):d++}c&&(a.mode="disabled")};var Xn=class{constructor(a){this.i=a;this.l=new Aa;this.j=null;this.h=new Map;this.g=-1;this.u=!1;this.m=null;this.B=()=>{this.m?.stop();this.m=null;this.l.Ja(this.i,"textchanged",this.o);this.l.Ja(this.j.textTracks,"change",this.A);for(const b of this.h.values())b.remove();this.h.clear();this.g=-1;this.j=null};this.o=()=>{const b=new Map;var c=this.i.lc();for(var d of c){if(this.h.has(d.id))c=this.h.get(d.id),d.active||c.track.mode==="disabled"||(c.track.mode="disabled"),this.h.delete(d.id);else{var e=
c=this.j.ownerDocument.createElement("track");var f=Fa();f=d.forced&&f.h()==="WEBKIT"?"forced":d.kind==="caption"?"captions":"subtitles";e.kind=f;e=c;f=void 0;if(d.label)f=d.label;else if(d.language)if(d.language in Pn)f=Pn[d.language];else{const g=Ne(d.language);g in Pn&&(f=`${Pn[g]} (${d.language})`)}f||(f=d.originalTextId,d.language&&d.language!==d.originalTextId&&(f+=` (${d.language})`));e.label=f;d.language?d.language in Pn?c.srclang=d.language:(e=Ne(d.language),c.srclang=e??"und"):c.srclang=
"und";c.src="data:,WEBVTT";c.track.mode="disabled";this.j.appendChild(c)}b.set(d.id,c);d.active&&(this.g=d.id)}for(const g of this.h.values())g.remove();this.g>-1&&(b.has(this.g)?(d=b.get(this.g).track,d.mode==="disabled"&&(d.mode=this.u?"showing":"hidden")):this.g=-1);this.h=b};this.A=()=>{if(!this.m){var b=this.j;this.m=(new Ce(()=>{this.m=null;if(this.j===b){var c=-1,d=!1;if(this.h.has(this.g)){const e=this.h.get(this.g);e.track.mode==="showing"?(c=this.g,d=!0):e.track.mode==="hidden"&&(c=this.g)}if(!d)for(const [e,
f]of this.h)if(f.track.mode==="showing"){c=e;break}else c<0&&f.track.mode==="hidden"&&(c=e);for(const [e,f]of this.h)e!==c&&f.track.mode!=="disabled"&&(f.track.mode="disabled");this.g!==c&&(this.g=c,c>-1&&this.i.Vf({id:c}));this.i.Zf(c>-1&&this.h.get(c).track.mode==="showing")}})).ma(0)}};this.l.D(a,"loaded",()=>this.enableTextDisplayer());this.enableTextDisplayer()}configure(){}remove(a,b){if(this.i)this.h.has(this.g)&&Wn(this.h.get(this.g).track,c=>c.startTime<b&&c.endTime>a);else return!1;return!0}append(a){this.h.has(this.g)&&
Vn(this.h.get(this.g).track,a)}destroy(){this.i&&(this.j&&this.B(),this.i=null);this.m?.stop();this.m=null;this.l?.release();this.l=null;return Promise.resolve()}isTextVisible(){return this.u}setTextVisibility(a){this.u=a;if(this.h.has(this.g)){var b=this.h.get(this.g).track;b.mode!=="disabled"&&(a=a?"showing":"hidden",b.mode!==a&&(b.mode=a))}else if(this.i&&this.i.nd()===3)if(b=Array.from(this.i.be().textTracks).filter(c=>["captions","subtitles","forced"].includes(c.kind)),a){a=null;for(const c of b)if(c.mode===
"showing"){a=null;break}else a||c.mode!=="hidden"||(a=c);a&&(a.mode="showing")}else for(const c of b)c.mode==="showing"&&(c.mode="hidden")}setTextLanguage(){}enableTextDisplayer(){!this.j&&this.i&&this.i.nd()===2&&(this.j=this.i.be(),this.l.za(this.i,"unloading",this.B),this.l.D(this.i,"textchanged",this.o),this.l.D(this.j.textTracks,"change",this.A),this.o())}};v("shaka.text.NativeTextDisplayer",Xn);Xn.prototype.enableTextDisplayer=Xn.prototype.enableTextDisplayer;Xn.prototype.setTextLanguage=Xn.prototype.setTextLanguage;
Xn.prototype.setTextVisibility=Xn.prototype.setTextVisibility;Xn.prototype.isTextVisible=Xn.prototype.isTextVisible;Xn.prototype.destroy=Xn.prototype.destroy;Xn.prototype.append=Xn.prototype.append;Xn.prototype.remove=Xn.prototype.remove;Xn.prototype.configure=Xn.prototype.configure;function Yn(a){a.h&&!a.g&&(a.g=a.h.addTextTrack("subtitles",a.i),a.g.mode="hidden")}
var Zn=class{constructor(a,b){Ra("SimpleTextDisplayer","Please migrate to NativeTextDisplayer");this.h=a;this.i=b;this.g=null;for(const c of Array.from(this.h.textTracks))c.kind!=="metadata"&&c.kind!=="chapters"&&(c.mode="disabled",c.label==this.i&&(this.g=c));this.g&&(this.g.mode="hidden")}configure(){}remove(a,b){if(!this.g)return!1;Wn(this.g,c=>c.startTime<b&&c.endTime>a);return!0}append(a){this.g&&Vn(this.g,a)}destroy(){this.g&&(Wn(this.g,()=>!0),this.g.mode="disabled");this.g=this.h=null;return Promise.resolve()}isTextVisible(){return this.g?
this.g.mode=="showing":!1}setTextVisibility(a){a&&!this.g&&Yn(this);this.g&&(this.g.mode=a?"showing":"hidden")}setTextLanguage(){}enableTextDisplayer(){Yn(this)}};v("shaka.text.SimpleTextDisplayer",Zn);Zn.prototype.enableTextDisplayer=Zn.prototype.enableTextDisplayer;Zn.prototype.setTextLanguage=Zn.prototype.setTextLanguage;Zn.prototype.setTextVisibility=Zn.prototype.setTextVisibility;Zn.prototype.isTextVisible=Zn.prototype.isTextVisible;Zn.prototype.destroy=Zn.prototype.destroy;
Zn.prototype.append=Zn.prototype.append;Zn.prototype.remove=Zn.prototype.remove;Zn.prototype.configure=Zn.prototype.configure;var $n=class{configure(){}remove(){}append(){}destroy(){}isTextVisible(){return!1}setTextVisibility(){}setTextLanguage(){}enableTextDisplayer(){}};v("shaka.text.StubTextDisplayer",$n);$n.prototype.enableTextDisplayer=$n.prototype.enableTextDisplayer;$n.prototype.setTextLanguage=$n.prototype.setTextLanguage;$n.prototype.setTextVisibility=$n.prototype.setTextVisibility;$n.prototype.isTextVisible=$n.prototype.isTextVisible;$n.prototype.destroy=$n.prototype.destroy;$n.prototype.append=$n.prototype.append;
$n.prototype.remove=$n.prototype.remove;$n.prototype.configure=$n.prototype.configure;function ao(a,b){for(let c=a.length-1;c>=0;c--){const d=b(a[c]);if(d||d===0)return d}return null}function bo(a,b,c,d=1){var e=(e=(new RegExp(/(\d*\.?\d+)([a-z]+|%+)/)).exec(a))?{value:Number(e[1]),unit:e[2]}:null;if(!e)return a;a=e.unit;d*=e.value;switch(a){case "%":return d/100*c.clientHeight/b.cellResolution.rows+"px";case "c":return c.clientHeight*d/b.cellResolution.rows+"px";default:return d+a}}
function co(a,b=!1){if(a.g){var c=a.m.currentTime;if(!a.j||b){for(const d of a.F.values())Mi(d);Mi(a.g);a.o.clear();a.F.clear()}a.j&&eo(a,a.h,a.g,c,[])}}function fo(a){a.A&&(a.h.length?a.A.Da((a.B?a.B.captionsUpdatePeriod:.25)/Math.max(1,Math.abs(a.m.playbackRate))):a.A.stop())}function go(a,b){for(;b!=null;){if(b==a.g)return!0;b=b.parentElement}return!1}
function ho(a,b,c){var d=c.length>1,e=d?"span":"div";b.lineBreak&&(e="br");b.rubyTag&&(e=b.rubyTag);d=!d&&b.nestedCues.length>0;const f=document.createElement(e);e!="br"&&io(a,f,b,c,d);c=null;if(b.region&&b.region.id){{const n=b.region,p=a.u===4/3?2.5:1.9;e=`${n.id}_${n.width}x${n.height}${n.heightUnits==wc?"%":"px"}-${n.viewportAnchorX}x${n.viewportAnchorY}${n.viewportAnchorUnits==wc?"%":"px"}-${n.regionAnchorX}x${n.regionAnchorY}`;if(a.F.has(e))c=a.F.get(e);else{c=document.createElement("span");
var g=n.heightUnits==wc?"%":"px",h=n.widthUnits==wc?"%":"px",k=n.viewportAnchorUnits==wc?"%":"px";c.id="shaka-text-region---"+e;c.classList.add("shaka-text-region");c.style.position="absolute";var l=n.height,m=n.width;n.heightUnits===2&&(l=n.height*5.33,g="%");n.widthUnits===2&&(m=n.width*p,h="%");c.style.height=l+g;c.style.width=m+h;n.viewportAnchorUnits===2?(g=n.viewportAnchorY/75*100,h=n.viewportAnchorX/(a.u===4/3?160:210)*100,g-=n.regionAnchorY*l/100,h-=n.regionAnchorX*m/100,c.style.top=g+"%",
c.style.left=h+"%"):(c.style.top=n.viewportAnchorY-n.regionAnchorY*l/100+k,c.style.left=n.viewportAnchorX-n.regionAnchorX*m/100+k);n.heightUnits!==0&&n.widthUnits!==0&&n.viewportAnchorUnits!==0&&(l=Math.max(0,Math.min(100-(parseInt(c.style.width.slice(0,-1),10)||0),parseInt(c.style.left.slice(0,-1),10)||0)),c.style.top=Math.max(0,Math.min(100-(parseInt(c.style.height.slice(0,-1),10)||0),parseInt(c.style.top.slice(0,-1),10)||0))+"%",c.style.left=l+"%");c.style.display="flex";c.style.flexDirection=
"column";c.style.alignItems="center";c.style.justifyContent=b.displayAlign=="before"?"flex-start":b.displayAlign=="center"?"center":"flex-end";a.F.set(e,c)}}}e=f;d&&(e=document.createElement("span"),e.classList.add("shaka-text-wrapper"),e.style.backgroundColor=b.backgroundColor,e.style.lineHeight="normal",f.appendChild(e));a.o.set(b,{Ve:f,fh:e,yc:c})}
function eo(a,b,c,d,e){let f=!1;const g=[],h=[];for(const k of b){e.push(k);b=a.o.get(k);const l=k.startTime<=d&&k.endTime>d;let m=b?b.fh:null;b&&(g.push(b.Ve),b.yc&&g.push(b.yc),l||(f=!0,a.o.delete(k),b=null));l&&(h.push(k),b?go(a,m)||(f=!0):(ho(a,k,e),b=a.o.get(k),m=b.fh,f=!0));k.nestedCues.length>0&&m&&eo(a,k.nestedCues,m,d,e);e.pop()}if(f){for(const k of g)k.parentElement&&k.parentElement.removeChild(k);h.sort((k,l)=>k.startTime!=l.startTime?k.startTime-l.startTime:k.endTime-l.endTime);for(const k of h)d=
a.o.get(k),d.yc?(d.yc.contains(c)&&d.yc.removeChild(c),c.appendChild(d.yc),d.yc.appendChild(d.Ve)):c.appendChild(d.Ve)}}
function io(a,b,c,d,e){const f=b.style;var g=c.nestedCues.length==0,h=d.length>1;f.whiteSpace="pre-wrap";const k=c.payload.replace(/\s+$/g,l=>"\u00a0".repeat(l.length));f.webkitTextStrokeColor=c.textStrokeColor;f.webkitTextStrokeWidth=c.textStrokeWidth;f.color=c.color;f.direction=c.direction;f.opacity=c.opacity;f.paddingLeft=bo(c.linePadding,c,a.l);f.paddingRight=bo(c.linePadding,c,a.l);f.textCombineUpright=c.textCombineUpright;f.textShadow=c.textShadow;if(c.backgroundImage)f.backgroundImage="url('"+
c.backgroundImage.replace(/['"()\\]/g,"")+"')",f.backgroundRepeat="no-repeat",f.backgroundSize="contain",f.backgroundPosition="center",c.backgroundColor&&(f.backgroundColor=c.backgroundColor),f.width="100%",f.height="100%";else{let l;c.nestedCues.length?l=b:(l=document.createElement("span"),b.appendChild(l));c.border&&(l.style.border=c.border);e||((b=ao(d,m=>m.backgroundColor))?l.style.backgroundColor=b:k&&(l.style.backgroundColor="rgba(0, 0, 0, 0.8)"));k&&(l.setAttribute("translate","no"),l.textContent=
k)}if(h&&!d[d.length-1].isContainer)f.display="inline";else{f.display="flex";f.flexDirection="column";f.alignItems="center";if(c.textAlign=="left"||c.textAlign=="start")f.width="100%",f.alignItems="flex-start";else if(c.textAlign=="right"||c.textAlign=="end")f.width="100%",f.alignItems="flex-end";f.justifyContent=c.displayAlign=="before"?"flex-start":c.displayAlign=="center"?"center":"flex-end"}g||(f.margin="0");f.fontFamily=c.fontFamily;f.fontWeight=c.fontWeight.toString();f.fontStyle=c.fontStyle;
f.letterSpacing=c.letterSpacing;d=a.B?a.B.fontScaleFactor:1;if(d!==1||c.fontSize)f.fontSize=bo(c.fontSize||"1em",c,a.l,d);d=c.line;d!=null&&(g=c.lineInterpretation,g==Ld&&(g=1,h=16,a.u&&a.u<1&&(h=32),d=d<0?100+d/h*100:d/h*100),g==1&&(f.position="absolute",c.writingMode==Kd?(f.width="100%",c.lineAlign==Md?f.top=d+"%":c.lineAlign=="end"&&(f.bottom=100-d+"%")):c.writingMode=="vertical-lr"?(f.height="100%",c.lineAlign==Md?f.left=d+"%":c.lineAlign=="end"&&(f.right=100-d+"%")):(f.height="100%",c.lineAlign==
Md?f.right=d+"%":c.lineAlign=="end"&&(f.left=100-d+"%"))));f.lineHeight=c.lineHeight;a=jo(c);a=="line-left"?(f.cssFloat="left",c.position!==null&&(f.position="absolute",c.writingMode==Kd?(f.left=c.position+"%",f.width="auto"):f.top=c.position+"%")):a=="line-right"?(f.cssFloat="right",c.position!==null&&(f.position="absolute",c.writingMode==Kd?(f.right=100-c.position+"%",f.width="auto"):f.bottom=c.position+"%")):c.position!==null&&c.position!=50&&(f.position="absolute",c.writingMode==Kd?(f.left=c.position+
"%",f.width="auto"):f.top=c.position+"%",c.size&&(f.transform="translateX(-50%)"));f.textAlign=c.textAlign;f.textDecoration=c.textDecoration.join(" ");f.writingMode=c.writingMode;"writingMode"in document.documentElement.style&&f.writingMode==c.writingMode||(f.webkitWritingMode=c.writingMode);c.size&&(c.writingMode==Kd?f.width=c.size+"%":f.height=c.size+"%")}
function jo(a){const b=a.direction,c=a.positionAlign;a=a.textAlign;return c!==Id?c:a==="left"||a==="start"&&b===Jd||a==="end"&&b==="rtl"?"line-left":a==="right"||a==="start"&&b==="rtl"||a==="end"&&b===Jd?"line-right":"center"}
var ko=class{constructor(a,b){this.j=!1;this.h=[];this.m=a;this.l=b;this.B=this.u=null;this.g=document.createElement("div");this.g.classList.add("shaka-text-container");this.g.style.textAlign="center";this.g.style.display="flex";this.g.style.flexDirection="column";this.g.style.alignItems="center";this.g.style.justifyContent="flex-end";this.A=new Ce(()=>{this.m.paused||co(this)});fo(this);this.o=new Map;this.i=new Aa;this.i.D(document,"fullscreenchange",()=>{co(this,!0)});this.i.D(this.m,"seeking",
()=>{co(this,!0)});this.i.D(this.m,"ratechange",()=>{fo(this)});this.i.D(this.m,"resize",()=>{var c=this.m;const d=c.videoWidth;c=c.videoHeight;d&&c?this.u=d/c:this.u=null});this.G=!1;this.C=null;"ResizeObserver"in window&&(this.C=new ResizeObserver(()=>{this.G||(this.G=!0,requestAnimationFrame(()=>{this.G=!1;this.g&&this.g.parentElement&&this.j&&co(this,!0)}))}),this.C.observe(this.l));this.F=new Map}configure(a){this.B=a;fo(this);co(this,!0)}append(a){const b=[...this.h];for(const c of Tn(a))b.some(d=>
vd(d,c))||this.h.push(c);this.h.length&&fo(this);co(this)}destroy(){if(!this.g)return Promise.resolve();this.g.parentElement&&this.l.removeChild(this.g);this.g=null;this.j=!1;this.h=[];this.A&&(this.A.stop(),this.A=null);this.o.clear();this.i&&(this.i.release(),this.i=null);this.C&&(this.C.disconnect(),this.C=null);return Promise.resolve()}remove(a,b){if(!this.g)return!1;const c=this.h.length;this.h=this.h.filter(d=>d.startTime<a||d.endTime>=b);co(this,c>this.h.length);this.h.length||fo(this);return!0}isTextVisible(){return this.j}setTextVisibility(a){(this.j=
a)?(this.g.parentElement||this.l.appendChild(this.g),co(this,!0)):this.g.parentElement&&this.l.removeChild(this.g)}setTextLanguage(a){a&&a!="und"?this.g.setAttribute("lang",a):this.g.setAttribute("lang","")}enableTextDisplayer(){}};v("shaka.text.UITextDisplayer",ko);ko.prototype.enableTextDisplayer=ko.prototype.enableTextDisplayer;ko.prototype.setTextLanguage=ko.prototype.setTextLanguage;ko.prototype.setTextVisibility=ko.prototype.setTextVisibility;ko.prototype.isTextVisible=ko.prototype.isTextVisible;
ko.prototype.remove=ko.prototype.remove;ko.prototype.destroy=ko.prototype.destroy;ko.prototype.append=ko.prototype.append;ko.prototype.configure=ko.prototype.configure;function lo(a,b){const c=e=>{var f=e;for(var g of b)g.end&&g.start<e&&(f+=g.end-g.start);e=Math.floor(f/3600);g=Math.floor(f/60%60);const h=Math.floor(f%60);f=Math.floor(f*1E3%1E3);return(e<10?"0":"")+e+":"+(g<10?"0":"")+g+":"+(h<10?"0":"")+h+"."+(f<100?f<10?"00":"0":"")+f};a=Sn(a);let d="WEBVTT\n\n";for(const e of a)d+=c(e.startTime)+" --\x3e "+c(e.endTime)+(f=>{const g=[];switch(f.textAlign){case "left":g.push("align:left");break;case "right":g.push("align:right");break;case Dd:g.push("align:middle");
break;case "start":g.push("align:start");break;case "end":g.push("align:end")}switch(f.writingMode){case "vertical-lr":g.push("vertical:lr");break;case "vertical-rl":g.push("vertical:rl")}return g.length?" "+g.join(" "):""})(e)+"\n",d+=e.payload+"\n\n";return d}v("shaka.text.WebVttGenerator",class{});function mo(a,b){if(!b||a.includes("offline:"))return a;a=new Ua(a);a.g.set("CMCD",b);return a.toString()}function no(a){var b=Object.keys(a);const c={},d=["Object","Request","Session","Status"],e=[{},{},{},{}],f={br:0,d:0,ot:0,tb:0,url:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,ltc:1,ttfb:1,ttlb:1,ts:1,rc:1,cmsdd:1,cmsds:1,sn:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,msd:2,bs:3,rtp:3,bg:3};for(const g of b)e[f[g]!=null?f[g]:1][g]=a[g];for(a=0;a<e.length;a++)(b=oo(e[a]))&&(c[`CMCD-${d[a]}`]=b);return c}
function oo(a){const b=[],c=g=>!Number.isNaN(g)&&g!=null&&g!==""&&g!==!1;var d=g=>Math.round(g),e=g=>Math.round(g/100)*100;d={br:d,d,bl:e,dl:e,mtp:e,nor:g=>encodeURIComponent(g),rtp:e,tb:d,ttfb:d,ttlb:d};e=Object.keys(a||{}).sort();for(const g of e){e=a[g];if(!c(e))continue;if(g==="v"&&e===1)continue;if(g=="pr"&&e===1)continue;var f=d[g];f&&(e=f(e));f=typeof e;e=f==="string"&&g!=="ot"&&g!=="sf"&&g!=="st"?`${g}=${JSON.stringify(e)}`:f==="boolean"?g:f==="symbol"?`${g}=${e.description}`:`${g}=${e}`;
b.push(e)}return b.join(",")}
function po(a){a.i.D(a.h,"playing",()=>{a.B||(a.B=Date.now());qo(a,"ps",{Bc:"p"})});a.i.D(a.h,"volumechange",()=>{qo(a,a.h.muted?"m":"um")});a.i.D(a.h,"play",()=>{a.A||(a.A=Date.now(),qo(a,"ps",{Bc:"s"}))});a.i.D(a.h,"pause",()=>{qo(a,"ps",{Bc:"a"})});a.i.D(a.j,"buffering",()=>{qo(a,"ps",{Bc:"w"})});a.i.D(a.h,"seeking",()=>qo(a,"ps",{Bc:"k"}));a.i.D(document,"fullscreenchange",()=>{qo(a,document.fullscreenElement?"pe":"pc")});const b=a.h;(b.webkitPresentationMode||b.webkitSupportsFullscreen)&&a.i.D(b,
"webkitpresentationmodechanged",()=>{b.webkitPresentationMode?qo(a,b.webkitPresentationMode!=="inline"?"pe":"pc"):b.webkitSupportsFullscreen&&qo(a,b.webkitDisplayingFullscreen?"pe":"pc")});a.i.D(a.h,"enterpictureinpicture",()=>{qo(a,"pe")});a.i.D(a.h,"leavepictureinpicture",()=>{qo(a,"pc")});"documentPictureInPicture"in window&&a.i.D(window.documentPictureInPicture,"enter",c=>{qo(a,"pe");a.i.za(c.window,"pagehide",()=>{qo(a,"pc")})});a.i.D(document,"visibilitychange",()=>{document.hidden?qo(a,"b",
{bg:!0}):qo(a,"b")});a.i.D(a.j,"complete",()=>{qo(a,"ps",{Bc:"e"})})}function ro(a){so(a);var b=to(a);for(const c of b)if(b=c.timeInterval,b===void 0&&(b=uo),b>=1){const d=new Ce(()=>qo(a,vo));d.Da(b);a.F.push(d)}}function so(a){if(a.F)for(const b of a.F)b.stop();a.F=[]}function wo(a){a.m.clear();a.C=!1;a.I=!0;a.H=!1;a.u=!1;a.A=0;a.B=0;a.G=0;a.J={request:!1,response:!1,event:!1};so(a);a.o={};a.h=null;a.i.La()}
function qo(a,b,c={}){b=Object.assign({e:b,ts:Date.now()},c);b=xo(a,b,yo);c=a.g.targets;if(!(a.g.version<zo)&&c){var d=to(a);c=Array.from(new Set([...Ao,...Bo]));for(const e of d){d=Co(e.includeKeys||[],c);d.includes(Do)||d.push(Do);const f=Eo(b,d);d=e.events||[];const g=f.e,h=f.sta;g&&(!Fo.includes(g)||!(g!=="ps"||h&&Go.includes(h))||d&&d.length>0&&!d.includes(g))||Ho(a,f,e)}}}function Io(a,b){a.u=b;a.u?a.l==Jo?a.l=Ko:a.l==Lo&&(a.l=Mo):a.l==Ko?a.l=Jo:a.l==Mo&&(a.l=Lo)}
function No(a,b){if(a.g&&a.g.enabled&&(qo(a,"ps",{Bc:"d"}),a.h&&a.h.autoplay)){const c=a.h.play();c&&c.then(()=>{a.G=b}).catch(()=>{a.G=0})}}function Oo(a,b,c){if(a.g.enabled){c=xo(a,c,Po);var d=Qo({mode:Po,useHeaders:a.g.useHeaders,includeKeys:a.g.includeKeys||[]});a.o[d]||(a.o[d]={request:1,response:1});c.sn=a.o[d].request++;d=a.g.includeKeys||[];var e=a.g.version==zo?Array.from(new Set([...Ao,...Ro])):So;d=Co(d,e);c=Eo(c,d);To(a,c,b,a.g.useHeaders)}}
function Uo(a,b,c,d={}){if(a.g.enabled)if(c.method==="HEAD")Oo(a,c,{});else switch(b){case 0:try{if(a.g.enabled){if(d.type){a:{switch(d.type){case 4:var e=a.u?Ko:Jo;break a;case 3:case 2:e=a.u?Mo:Lo;break a;case 5:e=Vo;break a}e=void 0}a.l=e}Oo(a,c,{ot:Wo,su:!a.C})}}catch(g){la("CMCD_MANIFEST_ERROR","Could not generate manifest CMCD data.",g)}break;case gg:try{if(a.g.enabled){var f=Xo(a,d,c.uris[0]);f.ts=Date.now();a.m.has(c)&&a.m.delete(c);a.m.set(c,f.ts);Oo(a,c,f)}}catch(g){la("CMCD_SEGMENT_ERROR",
"Could not generate segment CMCD data.",g)}break;case 2:case 5:case 6:Oo(a,c,{ot:Yo});break;case 4:Oo(a,c,{ot:Zo})}}function $o(a){return(a=a.g.targets)?a.filter(b=>b.mode===ap&&b.enabled===!0):[]}
function bp(a,b,c,d={}){if($o(a).length!==0)switch(b){case gg:try{const k=Xo(a,d,c.uri);c.originalRequest&&c.originalRequest.timeToFirstByte!=null&&(k.ttfb=c.originalRequest.timeToFirstByte);c.timeMs!=null&&(k.ttlb=c.timeMs);var e=c.originalUri||c.uri;if(e.includes("CMCD="))try{const m=new URL(e);m.searchParams.delete("CMCD");var f=m.toString()}catch(m){f=e}else f=e;k.url=f;a.m.has(c.originalRequest)?(k.ts=a.m.get(c.originalRequest),a.m.delete(c.originalRequest)):k.ts||(k.ts=Date.now());const l=$o(a);
if(l.length!==0){var g=a.g.version==zo?Array.from(new Set([...Ao,...cp])):So;k.rc=c.status||0;var h=xo(a,k,ap);c.headers&&c.headers["CMSD-Static"]&&(h.cmsds=btoa(c.headers["CMSD-Static"]));c.headers&&c.headers["CMSD-Dynamic"]&&(h.cmsdd=btoa(c.headers["CMSD-Dynamic"]));for(const m of l){const n=Co(m.includeKeys||[],g),p=Qo(m);a.o[p]||(a.o[p]={request:1,response:1});h.sn=a.o[p].response++;const r=Eo(h,n);Ho(a,r,m,c)}}}catch(k){la("CMCD_SEGMENT_ERROR","Could not generate response segment CMCD data.",
k)}}}
function Xo(a,b,c){var d=b.segment,e=0;d&&(e=d.endTime-d.startTime);e={d:e*1E3,st:a.j.U()?dp:ep};e.ot=fp(b);const f=e.ot===gp||e.ot===hp||e.ot===ip||e.ot===jp;if(b=b.stream){var g=a.j.rb();if(f&&(e.bl=kp(a,b.type),e.ot!==jp)){var h=lp(a,b.type);e.dl=g?h/Math.abs(g):h}b.bandwidth&&(e.br=b.bandwidth/1E3);if(b.segmentIndex&&d){if((g=b.segmentIndex.Fb(d.endTime,!0,g<0))&&(g=g.next().value)&&g!=d){if(c&&!xa(d.P(),g.P())){var k=g.P()[0];h=new URL(k);var l=new URL(c);if(h.origin!==l.origin)c=k;else{c=h.pathname.split("/").slice(1);
k=l.pathname.split("/").slice(1,-1);l=Math.min(c.length,k.length);for(let m=0;m<l&&c[m]===k[m];m++)c.shift(),k.shift();for(;k.length;)k.shift(),c.unshift("..");c=c.join("/")+h.search+h.hash}e.nor=c}!g.startByte&&!g.endByte||d.startByte==g.startByte&&d.endByte==g.endByte||(c=g.startByte+"-",g.endByte&&(c+=g.endByte),e.nrr=c)}g=a.j.rb()||1;c=lp(a,b.type)||500;d=(b=b.bandwidth)?b*(d.endTime-d.startTime)/1E3/(c/g/1E3)*a.g.rtpSafetyFactor:NaN;isNaN(d)||(e.rtp=d)}}f&&e.ot!==jp&&(e.tb=mp(a,e.ot)/1E3);return e}
function np(a){a.g.sessionId||(a.g.sessionId=window.crypto.randomUUID());return{v:a.g.version,sf:a.l,sid:a.g.sessionId,cid:a.g.contentId,mtp:a.j.getBandwidthEstimate()/1E3}}
function op(a,b,c){try{if(!a.g.enabled)return b;const e=np(a);a:{switch(c.toLowerCase()){case "audio/mp4":case "audio/webm":case "audio/ogg":case "audio/mpeg":case "audio/aac":case "audio/flac":case "audio/wav":var d=hp;break a;case "video/webm":case "video/mp4":case "video/mpeg":case "video/mp2t":d=ip;break a;case "application/x-mpegurl":case "application/vnd.apple.mpegurl":case "audio/x-mpegurl":case "application/dash+xml":case "video/vnd.mpeg.dash.mpd":case "application/vnd.ms-sstr+xml":d=Wo;break a}d=
void 0}e.ot=d;e.su=!0;const f=oo(e);return mo(b,f)}catch(e){return la("CMCD_SRC_ERROR","Could not generate src CMCD data.",e),b}}function to(a){return(a=a.g.targets)?a.filter(b=>b.mode===yo&&b.enabled):[]}function xo(a,b,c){Object.assign(b,np(a));b.pr=a.j.rb();var d=b.ot===gp||b.ot===ip;a.H&&d&&(b.bs=!0,b.su=!0,a.H=!1);b.su==null&&(b.su=a.I);a.j.U()&&(d=pp(a.j),b.ltc=d||void 0);document.hidden&&(b.bg=!0);d=a.B&&a.A?a.B-(a.G||a.A):void 0;d==void 0||a.J[c]||(b.msd=d,a.J[c]=!0);return b}
function Co(a,b){if(!a||a.length===0)return b;for(const c of a)b.includes(c);return a=a.filter(c=>b.includes(c))}function Eo(a,b){return Object.keys(a).reduce((c,d)=>{b.includes(d)&&(c[d]=a[d]);return c},{})}function Ho(a,b,c,d){const e=Hf();var f=c.url;if(c.useHeaders){b=no(b);if(!Object.keys(b).length)return;d&&Object.assign(d.headers,b);d=ag([f],e);Object.assign(d.headers,b)}else{b=oo(b);if(!b)return;f=mo(f,b);d&&(d.uri=f);d=ag([f],e)}a.j.Gb().request(9,d)}
function Qo(a){const b=Object.keys(a).sort().reduce((c,d)=>{d!=="enabled"&&(c[d]=a[d]);return c},{});return JSON.stringify(b)}function To(a,b,c,d){if(d){b=no(b);if(!Object.keys(b).length)return;Object.assign(c.headers,b)}else{const e=oo(b);if(!e)return;c.uris=c.uris.map(f=>mo(f,e))}$o(a).length>0||!a.m.has(c)||a.m.delete(c)}
function fp(a){if(a.type===0)return qp;if(a=a.stream){var b=a.type;if(b=="video")return a.codecs&&a.codecs.includes(",")?ip:gp;if(b=="audio")return hp;if(b=="text")return a.mimeType==="application/mp4"?jp:rp}}function kp(a,b){b=a.j.fc()[b];if(!b.length)return NaN;const c=a.h?a.h.currentTime:0;return(a=b.find(d=>d.start<=c&&d.end>=c))?(a.end-c)*1E3:NaN}function lp(a,b){b=a.j.fc()[b];if(!b.length)return 0;const c=a.h?a.h.currentTime:0;return(a=b.find(d=>d.start<=c&&d.end>=c))?(a.end-c)*1E3:0}
function mp(a,b){a=a.j.Ub();if(!a.length)return NaN;let c=a[0];for(const d of a)d.type==="variant"&&d.bandwidth>c.bandwidth&&(c=d);switch(b){case gp:return c.videoBandwidth||NaN;case hp:return c.audioBandwidth||NaN;default:return c.bandwidth}}
var sp=class{constructor(a,b){this.g=b;this.j=a;this.m=new Map;this.l=void 0;this.C=!1;this.I=!0;this.u=this.H=!1;this.B=this.A=void 0;this.G=0;this.J={request:!1,response:!1,event:!1};this.o={};this.i=new Aa;this.F=[];this.h=null}setMediaElement(a){this.h=a;po(this)}configure(a){this.g=a;ro(this)}},Wo="m",hp="a",gp="v",ip="av",qp="i",rp="c",jp="tt",Yo="k",Zo="o",zo=2,ep="v",dp="l",Jo="d",Ko="ld",Lo="h",Mo="lh",Vo="s";v("shaka.util.CmcdManager.StreamingFormat",{DASH:Jo,Hj:Ko,HLS:Lo,Ij:Mo,Wj:Vo,OTHER:"o"});
var So="br bl bs cid d dl mtp nor nrr ot pr rtp sf sid st su tb v".split(" "),Ao="br ab bl tbl bs cdn cid ltc mtp pr sf sid bg sta st ts tpb tb lb tab lab pt ec msd v sn".split(" "),Ro="ab bl tbl bs cdn cid d dl ltc mtp nor ot pr rtp sf sid bg sta st su ts tpb tb lb tab lab pt ec msd v".split(" "),cp="d dl nor ot rtp rc su ttfb ttfbb ttlb url cmsdd cmsds".split(" "),Bo=["e","sta"],Fo="ps e t c b m um pe pc".split(" "),Go="spawkrfeqd".split(""),uo=10,Do="ts",vo="t",Po="request",ap="response",yo="event";function tp(a){return a?a.toLowerCase()==="false"?!1:/^[-0-9]/.test(a)?parseInt(a,10):a.replace(/["]+/g,""):!0}
var yp=class{constructor(a){this.h=a;this.g=null}configure(a){this.h=a}Ag(){return this.h.enabled&&this.h.applyMaximumSuggestedBitrate&&this.g&&this.g.has(up)?this.g.get(up)*1E3:null}yg(){return this.h.enabled&&this.g&&this.g.has(vp)?this.g.get(vp)*1E3:null}Th(){return this.h.enabled&&this.g&&this.g.has(wp)?this.g.get(wp):null}Uh(){return this.h.enabled&&this.g&&this.g.has(xp)?this.g.get(xp):null}getBandwidthEstimate(a){const b=this.yg();if(!b)return a;const c=this.h.estimatedThroughputWeightRatio;
return c>0&&c<=1?a*(1-c)+b*c:a}};v("shaka.util.CmsdManager",yp);yp.prototype.getBandwidthEstimate=yp.prototype.getBandwidthEstimate;yp.prototype.getRoundTripTime=yp.prototype.Uh;yp.prototype.getResponseDelay=yp.prototype.Th;yp.prototype.getEstimatedThroughput=yp.prototype.yg;yp.prototype.getMaxBitrate=yp.prototype.Ag;var vp="etp",up="mb",wp="rd",xp="rtt";async function zp(a,b){a.g&&await new Promise(c=>a.h.push(c));a.g=b}var Ap=class{constructor(){this.g=null;this.h=[]}release(){this.h.length>0?this.h.shift()():this.g=null}};function Bp(a,b){return new L(a,b)}function Cp(a,b){Dp.set(a,b)}function Ep(a,b,c){b>0&&(a.U()||a.Xg(b));b=a.getDuration();c<b&&(a.U()||a.jb(c))}
function Fp(a){const b=new Map,c=new Map;for(let e=0;e<a.length;e++){const f=a[e];let g="und",h=[];f.language&&(g=Ie(f.language));f.type=="variant"?h=f.audioRoles:h=f.roles;h&&h.length||(h=[""]);b.has(g)||b.set(g,new Set);for(const k of h)b.get(g).add(k),f.label&&(c.has(g)||c.set(g,new Map),c.get(g).set(k,f.label))}const d=[];b.forEach((e,f)=>{for(const g of e)e=null,c.has(f)&&c.get(f).has(g)&&(e=c.get(f).get(g)),d.push({language:f,role:g,label:e})});return d}
function Gp(a){const b=new Set;for(const c of a)c.language?b.add(Ie(c.language)):b.add("und");return b}function pp(a){if(!a.h||!a.h.currentTime)return null;const b=a.Cg();return b?Math.floor(Date.now()-(b.getTime()+a.h.currentTime*1E3)):null}
function Hp(a){const b=Vm();b.streaming.failureCallback=c=>{if(a.U()){var d=null;c.code==1001||c.code==1002?(d=1,a.g.streaming.lowLatencyMode&&(d=.1)):c.code==1003&&(d=.1);d!=null&&(c.severity=1,a.Rf(d))}};b.textDisplayFactory=()=>{if(a.Hd){var c=a.h;c=c.webkitDisplayingFullscreen||c.webkitPresentationMode&&c.webkitPresentationMode!="inline"?!1:!0}else c=!1;return c?new ko(a.h,a.Hd):"track"in document.createElement("track")?new Xn(a):new $n};return b}
function Ip(a,b){b||=()=>null;const c=f=>{b()?sn(b(),!0,f):f()},d=f=>{b()?b().dispatchEvent(f):a.dispatchEvent(f)},e=new jg((f,g,h,k,l)=>{c(()=>{a.o&&a.o.segmentDownloaded(f,g,h,k,l)})},(f,g,h)=>{g=(new Map).set("headers",f).set("request",g).set("requestType",h);d(Bp("downloadheadersreceived",g));c(()=>{if(a.qa){var k=a.qa;if(k.h.enabled){var l=f["cmsd-static"];if(l)try{var m=new Map;const p=l.split(",");for(l=0;l<p.length;l++){const r=p[l].split("=");m.set(r[0],tp(r[1]))}}catch(p){}if(m=f["cmsd-dynamic"]){a:{try{const p=
new Map,r=m.split(";");for(m=1;m<r.length;m++){const q=r[m].split("=");p.set(q[0],tp(q[1]))}var n=p;break a}catch(p){n=null;break a}n=void 0}n&&(k.g=n)}}}})},(f,g)=>{f=(new Map).set("request",f).set("response",g);d(Bp("downloadcompleted",f))},(f,g,h,k)=>{f=(new Map).set("request",f).set("error",g).set("httpResponseCode",h).set("aborted",k);d(Bp("downloadfailed",f))},(f,g,h)=>{c(()=>{a.J&&Uo(a.J,f,g,h)})},(f,g,h,k)=>{(f=b()?b().m:a.H)&&f.banLocation&&f.banLocation(k)},(f,g,h)=>{if(g.data){const k=
g.data.byteLength,l=b()?b().getStats():a.A;l&&(on(l,k),f===0&&(l.Gg=k));bp(a.J,f,g,h)}});e.configure(a.g.networking);return e}function Jp(a,b=!0){if(a.m==Kp){a.Od.stop();for(const c of a.i.variants)c.disabledUntilTime=0;b&&Lp(a)}}function Mp(a){a.R!=null&&(ec(a.R),a.R.release(),a.R=null)}function Np(a,b,c){c||b.lcevc.enabled?(Mp(a),a.R==null&&(a.R=new fc(a.h,a.ig,b.lcevc,c),a.G&&(a.G.N=a.R))):Mp(a)}function Op(a,b){a.dispatchEvent(Bp("onstatechange",(new Map).set("state",b)))}
async function Pp(a,b){const c=++a.Td;await zp(a.Y,b);return c!=a.Td?(a.Y.release(),!0):!1}
async function Qp(a){Fa();Op(a,"media-source");a.g.mediaSource.useSourceElements&&Li(a.h);Rp(a);const b=Sp(a.h,a.u,{Lh:()=>a.keySystem(),onMetadata:(c,d,e)=>{for(const f of c)if(f.data&&typeof f.cueTime=="number"&&f.frames){c=f.cueTime+d;let g=e;g&&c>g&&(g=c);for(const h of f.frames)Tp(a,c,g,"org.id3",h);if(a.B)a.B.onHlsTimedMetadata(f,c)}},Bi:c=>{a.Va&&jl(a.Va,{schemeIdUri:c.schemeIdUri,startTime:c.startTime,endTime:c.endTime,id:String(c.id),emsg:c})},onEvent:c=>a.dispatchEvent(c),Di:()=>{a.H&&a.H.update&&
a.H.update()}},a.R,a.g.mediaSource);b.Ba=a.g.manifest.segmentRelativeVttTiming;await b.J;a.G=b}
function Up(a){var b=a.Af();if(a.A&&a.O&&a.F){if(a.g.streaming.rebufferingGoal==0){var c=a.K;c.j=!1;Zk(c)}else c=a.K,c.j=b,Zk(c);a.J&&(c=a.J,b||c.C||(c.C=!0),c.C&&b&&(c.H=!0,qo(c,"ps",{Bc:"r"})),c.I=b);Vp(a);c=a.g.streaming.liveSync.dynamicTargetLatency.maxAttempts;if(a.g.streaming.liveSync.dynamicTargetLatency.enabled&&b&&a.Ud<c){c=a.g.streaming.liveSync.dynamicTargetLatency.maxLatency;const d=a.g.streaming.liveSync.targetLatencyTolerance,e=a.g.streaming.liveSync.dynamicTargetLatency.rebufferIncrement;
a.S&&(a.S=Math.min(a.S+ ++a.Ud*e,c-d))}}b=(new Map).set("buffering",b);a.dispatchEvent(Bp("buffering",b))}async function Wp(a,b){a=await Cl(b,a.M,a.g.manifest.retryParameters);me(a)?Fa().h()==="WEBKIT"&&(a="application/vnd.apple.mpegurl"):a==="video/quicktime"&&Fa().h()==="CHROMIUM"&&(a="video/mp4");return a}
async function Xp(a,b,c,d,e=!1,f){d||=await Wp(a,b);if(Yp(a,d))return null;f=f||a.g;let g=!1;e&&a.h&&a.h.nodeName==="AUDIO"&&(g=!0);b=Zp(a,b,c,d||null,f,!e,g);return b=e?b.then(h=>{h.C=!1;return h}):b.then(h=>{a.Pd.push(h);return h})}function $p(a,b,c){b=(new Map).set("startTime",b.startTime).set("endTime",b.endTime).set("metadataType",b.schemeIdUri).set("payload",b.payload);a.dispatchEvent(Bp(c,b))}
async function aq(a,b){const c=Date.now()/1E3;let d=!0;a.C=a.Hc({Yb:a.M,onError:e=>{bq(a,e)},ye:()=>{},onExpirationUpdated:()=>{const e=Bp("expirationupdated");a.dispatchEvent(e)},onEvent:e=>{a.dispatchEvent(e);if(e.type=="drmsessionupdate"&&d){d=!1;e=a.A;var f=Date.now()/1E3-c;f>=0&&(e.m=f)}}});a.C.configure(a.g.drm);b=Af([b]);a.C.N=!0;await Tg(a.C,[b],[]);await a.C.Db(a.h)}
async function cq(a,b,c){Op(a,"src-equals");const d=a.h;a.F=new Nk(d);let e=!1;a.Jd.push(()=>{e=!0});a.dispatchEvent(Bp("canupdatestarttime"));a.N!=null&&a.F.u(a.N);a.Lb=dq(a,a.N||0);eq(a,d);fq(a,d,!0);if(d.textTracks){Rp(a);const h=k=>{if(!(a.u instanceof Xn)){var l=gq(a).find(m=>m.mode!=="disabled");l&&(l.mode=k?"showing":"hidden");a.u instanceof Zn&&(l=hq(a))&&(l.mode=!k&&a.u.isTextVisible()?"showing":"hidden")}};a.j.D(d,"enterpictureinpicture",()=>h(!0));a.j.D(d,"leavepictureinpicture",()=>h(!1));
d.remote?(a.j.D(d.remote,"connect",()=>h(!1)),a.j.D(d.remote,"connecting",()=>h(!1)),a.j.D(d.remote,"disconnect",()=>h(!1))):"webkitCurrentPlaybackTargetIsWireless"in d&&a.j.D(d,"webkitcurrentplaybacktargetiswirelesschanged",()=>h(!1));(d.webkitPresentationMode||d.webkitSupportsFullscreen)&&a.j.D(d,"webkitpresentationmodechanged",()=>{d.webkitPresentationMode?h(d.webkitPresentationMode!=="inline"):d.webkitSupportsFullscreen&&h(d.webkitDisplayingFullscreen)})}iq(a,d,b);b=op(a.J,a.T,c);!b.includes("#t=")&&
(a.g.playRangeStart>0||isFinite(a.g.playRangeEnd))&&(b+="#t=",a.g.playRangeStart>0&&(b+=a.g.playRangeStart),isFinite(a.g.playRangeEnd)&&(b+=","+a.g.playRangeEnd));a.G&&(await a.G.destroy(),a.G=null);Li(d);d.src=b;b=Fa();b.i()=="TV"&&d.load();d.preload!="none"&&!d.autoplay&&me(c)&&b.h()==="WEBKIT"&&d.load();a.m=jq;a.dispatchEvent(Bp("streaming"));const f=()=>new Promise(h=>{const k=new Ce(h);a.j.D(d.textTracks,"change",()=>k.ma(.5));k.ma(.5)}),g=new Lf;Ck(d,HTMLMediaElement.HAVE_METADATA,a.j,async()=>
{a.F.ready();a.Ba&&me(a.Ba)&&await f();g.resolve()});Ck(d,HTMLMediaElement.HAVE_CURRENT_DATA,a.j,async()=>{await f();if(!e){kq(a);var h=gq(a);h.some(k=>k.mode==="showing")&&(a.W=!0,a.u.setTextVisibility(!0));if(!(a.u instanceof Xn)){h.length&&(a.u.enableTextDisplayer?a.u.enableTextDisplayer():Ra("Text displayer w/ enableTextDisplayer",'Text displayer should have a "enableTextDisplayer" method'));let k=!1;for(const l of h)l.mode!=="disabled"&&(k?(l.mode="disabled",ja("Found more than one enabled text track, disabling it",
l)):(lq(a,l),k=!0))}mq(a)}});d.error?g.reject(nq(a)):d.preload=="none"&&(ja('With <video preload="none">, the browser will not load anything until play() is called. We are unable to measure load latency in a meaningful way, and we cannot provide track info yet. Please do not use preload="none" with Shaka Player.'),g.resolve());a.j.za(d,"error",()=>{g.reject(nq(a))});await Ge(a.g.streaming.loadTimeout,g);((c=a.U())&&(a.g.streaming.liveSync&&a.g.streaming.liveSync.enabled||a.g.streaming.liveSync.panicMode)||
a.g.streaming.vodDynamicPlaybackRate)&&a.j.D(d,"timeupdate",()=>oq(a));c||(a.j.D(d,"timeupdate",()=>pq(a)),pq(a));if(a.B&&(a.B.onManifestUpdated(c),c)){let h=a.Ia().end;a.j.D(d,"progress",()=>{const k=a.Ia().end;h!=k&&(a.B.onManifestUpdated(a.U()),h=k)})}a.Ha=!0}function qq(a){for(const b of a.i.variants)b.video&&(b.video.closeSegmentIndex(),b.video=null),b.bandwidth=b.audio&&b.audio.bandwidth?b.audio.bandwidth:0;a.i.variants=a.i.variants.filter(b=>b.audio)}
async function rq(a,b,c,d){Op(a,"load");const e=a.h;eq(a,e);iq(a,e,b);"onchange"in window.screen&&a.j.D(window.screen,"change",()=>{if(a.I.getConfiguration){const m=a.I.getConfiguration();m.hdrLevel=="AUTO"?Lp(a):a.g.preferredVideoHdrLevel=="AUTO"&&a.g.abr.enabled&&(m.hdrLevel="AUTO",a.I.configure(m),Lp(a))}});var f=!1;for(var g of a.i.variants){var h=g.video&&g.video.dependencyStream;h&&(f=dc(h))}Np(a,a.g,f);a.Yc=a.g.preferredTextLanguage;a.ed=a.g.preferredTextRole;a.Kd=a.g.preferForcedSubs;Ep(a.i.presentationTimeline,
a.g.playRangeStart,a.g.playRangeEnd);a.o.init((m,n,p)=>sq(a,m,n,p));a.o.setMediaElement(e);a.o.setCmsdManager(a.qa);a.l=tq(a);a.l.configure(a.g.streaming);a.m=Kp;a.dispatchEvent(Bp("streaming"));f=c;do{g=a.l.o;g||(h=uq(a,!0),c||(f=h));const m=[];h=g||f;for(var k of[h.video,h.audio])k&&!k.segmentIndex&&(m.push(k.createSegmentIndex()),k.dependencyStream&&m.push(k.dependencyStream.createSegmentIndex()));m.length>0&&await Promise.all(m)}while(!h||h.disabledUntilTime!=0);Lp(a);if(a.H&&a.H.onInitialVariantChosen)a.H.onInitialVariantChosen(h);
a.i.isLowLatency&&(a.g.streaming.lowLatencyMode?a.configure(a.Me):ja("Low-latency live stream detected, but low-latency streaming mode is not enabled in Shaka Player. Set streaming.lowLatencyMode configuration to true, and see https://bit.ly/3clctcj for details."));a.J&&(Io(a.J,a.i.isLowLatency&&a.g.streaming.lowLatencyMode),No(a.J,b*1E3));Ep(a.i.presentationTimeline,a.g.playRangeStart,a.g.playRangeEnd);Nl(a.l,a.g.playRangeStart,a.g.playRangeEnd);a.Ha=!0;a.dispatchEvent(Bp("canupdatestarttime"));
b=m=>{a.F=vq(a,m);a.Lb=wq(a,m);fq(a,e,!1)};a.g.streaming.startAtSegmentBoundary||(c=a.N,c==null&&a.i.startTime&&(c=a.i.startTime),b(c));if(!g){if(a.g.streaming.startAtSegmentBoundary){c=a.i.presentationTimeline;var l;a.N instanceof Date&&(k=a.N.getTime()/1E3-(c.m||c.i),k!=null&&(l=k));l==null&&(l=typeof a.N==="number"?a.N:a.U()?Infinity:a.h.currentTime);a.N==null&&a.i.startTime&&(l=a.i.startTime);k=c.Ib();c=c.sb();l<k?l=k:l>c&&(l=c);l=await xq(f,l);b(l)}yq(a,f,!0,!1,0)}a.F.ready();a.lc().find(m=>
m.active)||((l=vf(a.i.textStreams,a.Yc,a.ed,a.Kd)[0]||null)&&en(a.A.h,l,!0),f&&zq(a,f,l),l&&(a.g.streaming.alwaysStreamText||a.Df())&&(bm(a.l,l),Aq(a)));await a.l.start(d);a.g.abr.enabled&&(a.o.enable(),Bq(a));Cq(a);a.i.variants.some(m=>m.primary);((d=a.U())&&(a.g.streaming.liveSync&&a.g.streaming.liveSync.enabled||a.i.serviceDescription||a.g.streaming.liveSync.panicMode)||a.g.streaming.vodDynamicPlaybackRate)&&a.j.D(e,"timeupdate",()=>oq(a));if(!d&&(a.j.D(e,"timeupdate",()=>pq(a)),pq(a),a.i.nextUrl)){if(a.g.streaming.preloadNextUrlWindow>
0){const m=async()=>{const n=a.Ia().end-a.h.currentTime;!isNaN(n)&&n<=a.g.streaming.preloadNextUrlWindow&&(a.j.Ja(e,"timeupdate",m),a.Ra=await a.preload(a.i.nextUrl))};a.j.D(e,"timeupdate",m)}a.j.D(e,"ended",()=>{a.load(a.Ra||a.i.nextUrl)})}if(a.B)a.B.onManifestUpdated(d)}
async function Dq(a,b=!1){var c=null;if(a.i&&a.H&&a.ac&&a.T&&a.g){c=a.h.currentTime;b||(c=null);c=await Zp(a,a.T,c,a.Ba,a.g,!0,!1);a.Pd.push(c);a.H&&a.H.setMediaElement&&a.H.setMediaElement(null);if(b=a.l?a.l.o:null)c.i=b;b=c;var d=a.H,e=a.ac;b.h=a.i;b.m=d;b.G=e;c.B=a.I;c.start();a.i=null;a.H=null;a.ac=null;a.o=null;a.Nd=null}return c}
async function Zp(a,b,c,d,e,f=!0,g=!1){let h=null;e=Gc(e);g&&(e.manifest.disableVideo=!0);const k=()=>h.O&&h.l?null:h;a.sa.width!=Infinity||a.sa.height!=Infinity||a.g.ignoreHardwareResolution||(g=await Fa().u(),a.sa.width=g.width,a.sa.height=g.height);const l=new Ch(e,a.sa,null);g={networkingEngine:a.M,filter:async t=>{await Ah(l,t)&&(t=Bp("trackschanged"),await Promise.resolve(),h.dispatchEvent(t))},makeTextStreamsForClosedCaptions:t=>Eq(a,t),onTimelineRegionAdded:t=>{jl(h.H,t)},onEvent:t=>h.dispatchEvent(t),
onError:t=>h.onError(t),isLowLatencyMode:()=>(k()?k().getConfiguration():a.g).streaming.lowLatencyMode,updateDuration:()=>{a.l&&h.O&&a.l.updateDuration()},newDrmInfo:t=>{const u=h.j,x=u?u.g:null;x&&u.A&&yh(l,x.keySystem,t)},onManifestUpdated:()=>{const t=(new Map).set("isLive",a.U());h.dispatchEvent(Bp("manifestupdated",t));sn(h,!1,()=>{if(a.B)a.B.onManifestUpdated(a.U())})},getBandwidthEstimate:()=>a.o.getBandwidthEstimate(),onMetadata:(t,u,x,y)=>{let w=t;if(t=="com.apple.hls.interstitial"||t=="com.apple.hls.overlay")if(w=
"com.apple.quicktime.HLS",t={startTime:u,endTime:x,values:y},a.B)a.B.onHLSInterstitialMetadata(a,a.h,t);for(const z of y)z.name!="ID"&&sn(h,!1,()=>{Tp(a,u,x,w,z)})},disableStream:t=>a.disableStream(t,a.g.streaming.maxDisabledTime),addFont:(t,u)=>a.addFont(t,u)};const m=new kl(()=>a.Ia());m.addEventListener("regionadd",t=>{const u=t.region;Fq(a,"timelineregionadded",u,h);sn(h,!1,()=>{a.B&&(a.B.onDashTimedMetadata(u),a.B.onDASHInterstitialMetadata(a,a.h,u))})});let n=null;e.streaming.observeQualityChanges&&
(n=new hl(()=>a.fc()),n.addEventListener("qualitychange",t=>{Gq(a,t.quality,t.position)}),n.addEventListener("audiotrackchange",t=>{Gq(a,t.quality,t.position,!0)}));let p=!0;const r={Yb:a.M,onError:t=>h.onError(t),ye:t=>{sn(h,!0,()=>{a.C&&Hq(a,t)})},onExpirationUpdated:(t,u)=>{var x=Bp("expirationupdated");h.dispatchEvent(x);if((x=h.m)&&x.onExpirationUpdated)x.onExpirationUpdated(t,u)},onEvent:t=>{h.dispatchEvent(t);if(t.type=="drmsessionupdate"&&p){p=!1;const u=Date.now()/1E3-h.ua;t=a.A||h.getStats();
u>=0&&(t.m=u);a.R&&ec(a.R)}}},q=Ip(a,k);bg(a.M,q);return h=new Jn(b,d,c,{config:e,ti:g,Hi:m,Gi:n,Hc:()=>a.Hc(r),si:l,networkingEngine:q,hh:f})}
async function bq(a,b){if(a.m!=Iq){b.severity===1&&a.A.K++;var c=!0;if(a.Ha&&a.i&&a.l&&(b.code==3016||b.code==3014||b.code==3015||b.code==3024||b.code==3018)){if(Fa().h()==="WEBKIT"&&b.code==3016)return;try{const d=await km(a.l);c=!d;if(d){const e=Bp("mediasourcerecovered");a.dispatchEvent(e)}}catch(d){c=!0}}c&&(b.severity===2&&Jp(a,!1),c=Bp("error",(new Map).set("detail",b)),a.dispatchEvent(c),c.defaultPrevented&&(b.handled=!0))}}
function Yp(a,b){if(!kc(Fa()))return!0;if(b){if((a.h||Ni()).canPlayType(b)=="")return!1;if(!kc(Fa())||!ic.has(b))return!0;if(me(b))return Fa().h()==="WEBKIT"&&(a.g.drm.servers["com.apple.fps"]||a.g.drm.servers["com.apple.fps.1_0"])?a.g.streaming.useNativeHlsForFairPlay:a.g.streaming.preferNativeHls;if(b==="application/dash+xml"||b==="video/vnd.mpeg.dash.mpd")return a.g.streaming.preferNativeDash}return!1}
function Eq(a,b){const c=new Set;for(var d of b.textStreams)d.mimeType!="application/cea-608"&&d.mimeType!="application/cea-708"||c.add(d.originalId);for(const f of b.variants)if((d=f.video)&&d.closedCaptions)for(const g of d.closedCaptions.keys())if(!c.has(g)){var e=g.startsWith("CC")?"application/cea-608":"application/cea-708";const h=new Yk,k=d.closedCaptions.get(g);e={id:a.Md++,originalId:g,groupId:null,createSegmentIndex:()=>Promise.resolve(),segmentIndex:h,mimeType:e,codecs:"",kind:"caption",
encrypted:!1,drmInfos:[],keyIds:new Set,language:k,originalLanguage:k,label:null,type:G,primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:d.roles,forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!1,fastSwitching:!1,fullMimeTypes:new Set([be(e,"")]),isAudioMuxedInVideo:!1,baseOriginalId:null};b.textStreams.push(e);c.add(g)}}
function Tp(a,b,c,d,e){a.ua&&(b={schemeIdUri:d,startTime:b,endTime:c||Infinity,id:"",payload:e},b.id=JSON.stringify(b),jl(a.ua,b))}function Fq(a,b,c,d=a){a=(new Map).set("detail",{schemeIdUri:c.schemeIdUri,value:c.value,startTime:c.startTime,endTime:c.endTime,id:c.id,timescale:c.timescale,eventElement:c.eventElement,eventNode:c.eventNode});d.dispatchEvent(Bp(b,a))}
function Gq(a,b,c,d=!1){b=(new Map).set("mediaQuality",{bandwidth:b.bandwidth,audioSamplingRate:b.audioSamplingRate,codecs:b.codecs,contentType:b.contentType,frameRate:b.frameRate,height:b.height,mimeType:b.mimeType,channelsCount:b.channelsCount,pixelAspectRatio:b.pixelAspectRatio,width:b.width,label:b.label,roles:b.roles,language:b.language}).set("position",c);a.dispatchEvent(Bp(d?"audiotrackchanged":"mediaqualitychanged",b))}
function Hq(a,b){if(a.l){var c=Bp("keystatuschanged");a.dispatchEvent(c);var d=Object.keys(b);d.length==1&&d[0]==""&&(d=["00"],b={"00":b[""]});var e=d.length==1&&d[0]=="00";c=!1;if(d.length){d=a.keySystem();const h=og(a.g.drm.clearKeys),k=(l,m)=>{l.allowedByKeySystem=!0;for(const n of m)if((m=b[e?"00":n])||a.C.G)l.allowedByKeySystem=l.allowedByKeySystem&&!!m&&!Bh.includes(m)};for(var f of a.i.variants){var g=xf(f);for(const l of g){g=f.allowedByKeySystem;if(l.keyIds.size)if(l.drmInfos.length&&!h.size&&
a.i.type=="HLS")for(const m of l.drmInfos)m.keySystem==d&&(m.keyIds.size?k(f,m.keyIds):k(f,l.keyIds));else k(f,l.keyIds);g!=f.allowedByKeySystem&&(c=!0)}}}c&&(Cq(a),(f=a.l.o)&&!f.allowedByKeySystem?Jq(a):Lp(a))}}
function Rp(a,b=!1){const c=a.g.textDisplayFactory;a.hg!==c||b?(b=a.u,a.u=c(),a.u.configure?a.u.configure(a.g.textDisplayer):Ra("Text displayer w/ configure",'Text displayer should have a "configure" method!'),a.u.setTextLanguage||Ra("Text displayer w/ setTextLanguage",'Text displayer should have a "setTextLanguage" method!'),b?(a.u.setTextVisibility(b.isTextVisible()),b.destroy().catch(()=>{})):a.u.setTextVisibility(a.W),a.G&&pk(a.G,a.u),a.hg=c,a.l&&cm(a.l)):a.u&&a.u.configure&&a.u.configure(a.g.textDisplayer)}
function Sp(a,b,c,d,e){return new tk(a,b,c,e,d)}function eq(a,b){a.K=new $k({wf:()=>b.playbackRate,Lc:()=>b.defaultPlaybackRate,Vg:c=>{b.playbackRate=c},zi:c=>{const d=b.currentTime;if(Gi(b.buffered,d)&&!(b.readyState<=HTMLMediaElement.HAVE_CURRENT_DATA)){c=d+c;var e=a.Ia();c<e.start?d!==e.start&&(b.currentTime=e.start):c>e.end?d!==e.end&&(b.currentTime=e.end):b.currentTime=c}},isPaused:()=>b.paused})}
function Vp(a){if(a.A&&a.O){var b=a.A.g,c="playing";a.O.g==uh?c="buffering":a.sd()?c="ended":a.h.paused&&(c="paused");var d=c;if(b.g==null)b.g={timestamp:Date.now()/1E3,state:d,duration:0},b=!0;else{{const e=Date.now()/1E3;b.g.duration=e-b.g.timestamp;b.g.state==d?b=!1:(b.h.push(b.g),b.g={timestamp:e,state:d,duration:0},b=!0)}}b&&(c=(new Map).set("newstate",c),a.dispatchEvent(Bp("statechanged",c)))}}
function Kq(a){var b=a.h.playbackRate;b==0?(b=a.rb(),b!==0&&b!==1&&(b=Bp("ratechange"),a.dispatchEvent(b))):(a.K&&(a.K.set(b),a.m==Kp&&a.o.playbackRateChanged(b),Lq(a,b)),b=Bp("ratechange"),a.dispatchEvent(b))}function Mq(a){const b=Bp("textchanged");Nq(a,b)}function Cq(a){const b=Bp("trackschanged");Nq(a,b);Oq(a)}
function Pq(a,b){if(b.kind=="metadata"){b.mode="hidden";a.j.D(b,"cuechange",()=>{if(b.activeCues)for(var d of b.activeCues)if(Tp(a,d.startTime,d.endTime,d.type,d.value),a.B)a.B.onCueMetadataChange(d.value);if(b.cues){d=[];for(const e of b.cues)if(e.type=="com.apple.quicktime.HLS"&&e.startTime!=null){let f=d.find(g=>g.startTime==e.startTime&&g.endTime==e.endTime);f||(f={startTime:e.startTime,endTime:e.endTime,values:[]},d.push(f));f.values.push(e.value)}for(const e of d)e.values.some(f=>f.key=="X-ASSET-URI"||
f.key=="X-ASSET-LIST")&&a.B&&(e.values.push({key:"CUE",description:"",data:e.startTime!=0||a.U()?"ONCE":"ONCE,PRE",mimeType:null,pictureType:null}),a.B.onHLSInterstitialMetadata(a,a.h,e))}});var c=(new Ce(()=>{const d=Qq(a);for(const e of d)e.mode="hidden"})).kb().ma(.5);a.Jd.push(()=>{c.stop()})}}function Rq(a,b){if(b&&b.kind=="chapters"){b.mode="hidden";var c=(new Ce(()=>{b.mode="hidden"})).kb().ma(.5);a.Jd.push(()=>{c.stop()})}}
function iq(a,b,c){const d=()=>Vp(a);a.j.D(b,"playing",d);a.j.D(b,"pause",d);a.j.D(b,"ended",d);a.j.D(b,"ratechange",()=>Kq(a));b.remote&&(a.j.D(b.remote,"connect",()=>{a.l&&b.remote.state=="connected"&&Mq(a);Cq(a)}),a.j.D(b.remote,"connecting",()=>Cq(a)),a.j.D(b.remote,"disconnect",async()=>{a.l&&b.remote.state=="disconnected"&&(await km(a.l),Mq(a));Cq(a)}));b.audioTracks&&(a.j.D(b.audioTracks,"addtrack",()=>Cq(a)),a.j.D(b.audioTracks,"removetrack",()=>Cq(a)),a.j.D(b.audioTracks,"change",()=>Cq(a)));
b.videoTracks&&(a.j.D(b.videoTracks,"addtrack",()=>Cq(a)),a.j.D(b.videoTracks,"removetrack",()=>Cq(a)),a.j.D(b.videoTracks,"change",()=>Cq(a)));(b.webkitPresentationMode||b.webkitSupportsFullscreen)&&a.j.D(b,"webkitpresentationmodechanged",()=>{a.Hd&&Rp(a,!0)});if(b.textTracks){const e=()=>{a.m===jq&&a.u instanceof Xn&&Mq(a);Cq(a)};a.j.D(b.textTracks,"addtrack",f=>{if(f.track)switch(f=f.track,f.kind){case "metadata":Pq(a,f);break;case "chapters":Rq(a,f);break;default:e()}});a.j.D(b.textTracks,"removetrack",
e);a.j.D(b.textTracks,"change",e)}b.preload!="none"&&a.j.za(b,"loadedmetadata",()=>{var e=a.A,f=Date.now()/1E3-c;f>=0&&(e.F=f)})}function Lp(a){try{zh(a.Ld,a.i)}catch(c){return bq(a,c),!1}var b=uf(a.i.variants);b=a.I.create(b);a=a.o.setVariants(Array.from(b.values()));return typeof a=="boolean"?a:!0}function sq(a,b,c=!1,d=0){a.i&&a.l&&b!=a.l.o&&yq(a,b,!0,c,d)}
function tq(a){return new vm(a.i,{Hb:()=>a.F?a.F.m():0,getBandwidthEstimate:()=>a.o.getBandwidthEstimate(),rb:()=>a.rb(),video:a.h,X:a.G,Yb:a.M,onError:b=>bq(a,b),onEvent:b=>a.dispatchEvent(b),Sc:(b,c,d,e)=>{var f=b.startTime,g=b.endTime,h=c.type;if(h!=G){if(a.F){a.F.I();const k=Lj(a.G,h);!a.U()&&a.h.paused&&!a.h.seeking&&k!=null&&k>0&&a.F.m()<k&&!Zi(a.F.m(),k,.001)&&a.F.u(k)}Sq(a)}d=(new Map).set("start",f).set("end",g).set("contentType",h).set("isMuxed",d).set("isDependency",e);a.dispatchEvent(Bp("segmentappended",
d));a.o&&c.fastSwitching&&b.xc&&b.td&&a.o.trySuggestStreams()},Ci:(b,c)=>{(c=c.Qc)&&a.Ed&&fl(a.Ed,c,b)},ng:(b,c)=>{var d=a.C;if(d.h.parseInbandPsshEnabled&&!d.G&&["audio","video"].includes(b)){b=new Fg(C(c));c=0;for(var e of b.data)c+=e.length;if(c==0)d=Promise.resolve();else{e=new Uint8Array(c);c=0;for(const f of b.data)e.set(f,c),c+=f.length;Zg(d,"cenc",e);d=d.l}}else d=Promise.resolve();return d},disableStream:(b,c)=>a.disableStream(b,c),$i:(b,c)=>a.g.abr.enabled&&c.fastSwitching&&b.xc&&b.td?!1:
!0})}function uq(a,b=!1){if(Lp(a)){if(!a.g.abr.enabled){var c=a.I;typeof c.getLastAdaptationSet!="function"&&(Ra("AdaptationSetCriteria w/o getLastAdaptationSet","Please use an AdaptationSetCriteria with getLastAdaptationSet."),c.getLastAdaptationSet=()=>null);if(c=c.getLastAdaptationSet())if(c=Array.from(c.values()),c.length){const d=a.l.o;if(d&&d.video&&(c=c.find(e=>e.video==d.video)))return c}}return a.o.chooseVariant(b)}return null}
function vq(a,b){return new Sk(a.h,a.i,a.g.streaming,b,()=>{a.Lb&&al(a.Lb,!a.F.F());a.l&&a.l.zc();a.O&&Sq(a,"seeking")},c=>a.dispatchEvent(c))}
function wq(a,b){var c=a.U()||typeof b==="number"&&b>0;b=new On(a.Fd,c);b.addEventListener("enter",f=>{Fq(a,"timelineregionenter",f.region)});b.addEventListener("exit",f=>{Fq(a,"timelineregionexit",f.region)});b.addEventListener("skip",f=>{const g=f.region;f.seeking||(Fq(a,"timelineregionenter",g),Fq(a,"timelineregionexit",g))});const d=new On(a.ua,c);d.addEventListener("enter",f=>{$p(a,f.region,"metadata")});c=new On(a.Va,c);c.addEventListener("enter",f=>{f=(new Map).set("detail",f.region.emsg);
a.dispatchEvent(Bp("emsg",f))});const e=new bl(a.h);e.g.add(b);e.g.add(d);e.g.add(c);a.Ed&&e.g.add(a.Ed);return e}
function fq(a,b,c){a.O=new vh;sh(a.O,uh);Tq(a);Up(a);a.Aa=new Ce(()=>{Sq(a)});a.g.streaming.rebufferingGoal&&a.Aa.Da(.25);a.j.D(b,"waiting",()=>Sq(a,"waiting"));a.j.D(b,"canplaythrough",()=>Sq(a,"canplaythrough"));a.j.D(b,"playing",()=>Sq(a,"playing"));a.j.D(b,"seeked",()=>Sq(a,"seeked"));a.j.D(b,"timeupdate",()=>Sq(a,"timeupdate"));c&&(a.j.D(b,"progress",()=>Sq(a,"progress")),a.j.D(b,"stalled",()=>Sq(a,"stalled")))}
async function xq(a,b){var c=a.video;const d=async(e,f)=>{if(!e)return null;e.segmentIndex||await e.createSegmentIndex();return(e=(e=e.segmentIndex.Fb(f))?e.next().value:null)?e.startTime:null};a=await d(a.audio,b);c=await d(c,b);return c!=null&&a!=null?Math.max(c,a):c!=null?c:a!=null?a:b}
function yq(a,b,c,d,e,f=!1){var g=a.l.o;if(b==g)d&&am(a.l,b,d,e,!0);else{var h=a.A.h;h.h!=b&&(h.h=b,h.g.push({timestamp:Date.now()/1E3,id:b.id,type:"variant",fromAdaptation:c,bandwidth:b.bandwidth}));am(a.l,b,d,e,f,c);d=null;g&&(d=mf(g));g=mf(b);g.active=!0;if(a.R&&(e=a.R,h=b.video)){h.dependencyStream&&(h=h.dependencyStream);b=0;f=-1;switch(h.mimeType){case "video/webm":b=1;break;case "video/mp4":b=2}switch(a.zg()){case "DASH":f=1;break;case "HLS":f=0}e.g&&(e.g.setLevelSwitching(h.id,!0),e.g.setContainerFormat(b),
e.j||e.g.setStreamingFormat(f))}c?(c=(new Map).set("oldTrack",d).set("newTrack",g),c=Bp("adaptation",c),Nq(a,c)):Uq(a,d,g);Vq(a,d,g)}}function zq(a,b,c){c?(zf(b.audio,c,a.g)&&(a.W=!0),a.W&&a.u.setTextVisibility(!0)):(a.W=!1,a.u.setTextVisibility(!1));Wq(a)}function Aq(a){const b=a.lc().find(c=>c.active);b&&a.u&&a.u.setTextLanguage&&a.u.setTextLanguage(b.language)}function Bq(a){a.g.abr.enabled||Jp(a);const b=(new Map).set("newStatus",a.g.abr.enabled);Nq(a,Bp("abrstatuschanged",b))}
function oq(a){const b=a.h.playbackRate;var c=a.U();if(a.g.streaming.vodDynamicPlaybackRate&&!c){var d=a.g.streaming.vodDynamicPlaybackRateLowBufferRate,e=a.xg();e<=a.g.streaming.vodDynamicPlaybackRateBufferRatio?b!=d&&a.Dd(d,!1):e==1&&b!==a.K.Lc()&&a.gd()}if(c&&(c=a.Ia(),Number.isFinite(c.end)&&!(a.h.currentTime<c.start||a.h.paused))){d=a.g.streaming.liveSync.targetLatencyTolerance;e=a.g.streaming.liveSync.dynamicTargetLatency.enabled;var f=a.g.streaming.liveSync.dynamicTargetLatency.stabilityThreshold;
if(a.g.streaming.liveSync&&a.g.streaming.liveSync.enabled){var g=a.g.streaming.liveSync.targetLatency;var h=g+d;var k=Math.max(0,g-d);var l=a.g.streaming.liveSync.maxPlaybackRate;var m=a.g.streaming.liveSync.minPlaybackRate}else a.i&&a.i.serviceDescription&&(g=a.i.serviceDescription.targetLatency,a.i.serviceDescription.targetLatency!=null?h=a.i.serviceDescription.targetLatency+d:a.i.serviceDescription.maxLatency!=null&&(h=a.i.serviceDescription.maxLatency),a.i.serviceDescription.targetLatency!=null?
k=Math.max(0,a.i.serviceDescription.targetLatency-d):a.i.serviceDescription.minLatency!=null&&(k=a.i.serviceDescription.minLatency),l=a.i.serviceDescription.maxPlaybackRate||a.g.streaming.liveSync.maxPlaybackRate,m=a.i.serviceDescription.minPlaybackRate||a.g.streaming.liveSync.minPlaybackRate);a.S||typeof g!=="number"||(a.S=g);var n=a.g.streaming.liveSync.dynamicTargetLatency.maxAttempts;e&&a.Mb&&a.S!==null&&typeof g==="number"&&a.Ud<n&&Date.now()-a.Mb>f*1E3&&(f=a.g.streaming.liveSync.dynamicTargetLatency.minLatency,
a.S=Math.max(a.S-(g-f)/2,f+d),a.Mb=Date.now());e&&a.S!==null&&(h=a.S+d,k=a.S-d);g=c.end-a.h.currentTime;d=0;a.m==jq&&(e=a.h.buffered,e.length>0&&(d=e.end(e.length-1),d=Math.max(l,d-c.end)));c=a.g.streaming.liveSync.panicMode;e=a.g.streaming.liveSync.panicThreshold*1E3;f=Date.now()-a.O.i;c&&!m&&(m=a.g.streaming.liveSync.minPlaybackRate);c&&m&&f<=e?b!=m&&a.Dd(m,!1):h!=void 0&&l&&g-d>h?(b!=l&&a.Dd(l,!1),a.Mb=null):k!=void 0&&m&&g-d<k?(b!=m&&a.Dd(m,!1),a.Mb=null):b!==a.K.Lc()&&(a.gd(),a.Mb=Date.now())}}
function pq(a){if(a.h){var b=a.Ia();b=b.end-b.start;b=b>0?a.h.currentTime/b:0;if(!isNaN(b)){b*=100;if(Xq(a,0,b))var c=Bp("started");else if(Xq(a,25,b))c=Bp("firstquartile");else if(Xq(a,50,b))c=Bp("midpoint");else if(Xq(a,75,b))c=Bp("thirdquartile");else{if(Xq(a,100,b)||b>100)c=Bp("complete");a.g&&a.g.playRangeEnd!=Infinity&&a.sd()&&a.h.pause()}c&&a.dispatchEvent(c)}}}
function dq(a,b){b=new On(a.ua,b instanceof Date||b>0);b.addEventListener("enter",d=>{$p(a,d.region,"metadata")});const c=new bl(a.h);c.g.add(b);return c}function gq(a){return Array.from(a.h.textTracks).filter(b=>b.kind!="metadata"&&b.kind!="chapters"&&b.label!="Shaka Player TextTrack")}function hq(a){return Array.from(a.h.textTracks).find(b=>b.label=="Shaka Player TextTrack")}function kq(a){const b=a.g.preferredAudioLanguage;b!=""&&a.Rg(b,a.g.preferredAudioRole)}
function lq(a,b){a.j.D(b,"cuechange",()=>{a.u.remove(0,Math.max(0,a.h.currentTime-a.g.streaming.bufferBehind));const c={periodStart:0,segmentStart:0,segmentEnd:a.h.duration,vttOffset:0},d=[];var e=Array.from(b.activeCues||[]);for(const f of e){a:{if(f.endTime===Infinity||f.endTime<f.startTime){e=null;break a}e=new ud(f.startTime,f.endTime,f.text);e.line=typeof f.line==="number"?f.line:null;f.lineAlign&&(e.lineAlign=f.lineAlign);e.lineInterpretation=f.snapToLines?Ld:1;e.position=typeof f.position===
"number"?f.position:null;f.positionAlign&&(e.positionAlign=f.positionAlign);e.size=f.size;e.textAlign=f.align;f.vertical==="lr"?e.writingMode="vertical-lr":f.vertical==="rl"&&(e.writingMode="vertical-rl");f.region&&(e.region.id=f.region.id,e.region.height=f.region.lines,e.region.heightUnits=2,e.region.regionAnchorX=f.region.regionAnchorX,e.region.regionAnchorY=f.region.regionAnchorY,e.region.scroll=f.region.scroll,e.region.viewportAnchorX=f.region.viewportAnchorX,e.region.viewportAnchorY=f.region.viewportAnchorY,
e.region.viewportAnchorUnits=wc,e.region.width=f.region.width,e.region.widthUnits=wc);wd(e)}if(e){const g=a.g.mediaSource.modifyCueCallback;g&&g(e,null,c);d.push(e)}}a.u.append(d)});b.mode=document.pictureInPictureElement?"showing":"hidden"}function mq(a){const b=a.g.preferredTextLanguage;b!=""&&a.Uf(b,a.g.preferredTextRole,a.g.preferForcedSubs)}
function nq(a,b=!0){if(!a.h.error)return b?new F(2,3,3016):null;const c=a.h.error.code;if(!b&&c==1)return null;if(b=a.h.error.msExtendedCode)b<0&&(b+=4294967296),b=b.toString(16);return new F(2,3,3016,c,b,a.h.error.message)}function Qq(a){return Array.from(a.h.textTracks).filter(b=>b.kind=="metadata")}function Tq(a){const b=a.g.streaming.rebufferingGoal;a.O.j.set(th,Math.min(.5,b/2)).set(uh,b)}
function Sq(a,b){if(a.g.streaming.rebufferingGoal){b=a.G?Cj(a.G):!1;b=a.sd()||b||a.F.H();var c=Hi(a.h.buffered,a.h.currentTime),d=a.O,e=d.j.get(d.g);sh(d,b||c>=e&&c>0?th:uh)&&Up(a)}else if(b){c=a.O;d=a.h.currentTime;e=c.h;c.h=d;let f=void 0;switch(b){case "seeking":case "waiting":c.h=-1;f=uh;break;case "canplaythrough":case "playing":case "seeked":f=th;break;case "timeupdate":e>=0&&d-e>.01&&(f=th)}f!==void 0&&sh(c,f)&&Up(a)}}
function Yq(a,b){a.Ld=new Ch(a.g,a.sa,a.C);if(a.H){var c=Gc(a.g.manifest);a.h&&a.h.nodeName==="AUDIO"&&(c.disableVideo=!0);a.H.configure(c)}a.C&&a.C.configure(a.g.drm);if(a.l){a.l.configure(a.g.streaming);try{a.m!=Iq&&wh(a.Ld,a.i)&&Cq(a)}catch(e){bq(a,e)}a.o&&Lp(a);c=a.l.o;!c||c.allowedByApplication&&c.allowedByKeySystem||Jq(a)}a.M&&a.M.configure(a.g.networking);a.G&&(a.G.configure(a.g.mediaSource),a.G.Ba=a.g.manifest.segmentRelativeVttTiming);a.u&&Rp(a);a.o&&(a.o.configure(a.g.abr),a.g.abr.enabled?
a.o.enable():a.o.disable(),Bq(a));a.O&&Tq(a);a.Aa&&(a.g.streaming.rebufferingGoal?a.Aa.Da(.25):a.Aa.stop());a.i&&Ep(a.i.presentationTimeline,a.g.playRangeStart,a.g.playRangeEnd);a.B&&a.B.configure(a.g.ads);a.J&&a.J.configure(a.g.cmcd);a.qa&&a.qa.configure(a.g.cmsd);a.va&&a.va.configure(a.g.queue);if(a.m==Kp&&a.I.getConfiguration){c=a.I.getConfiguration();var d=!1;b.preferredVideoHdrLevel!=a.g.preferredVideoHdrLevel&&c.hdrLevel!=a.g.preferredVideoHdrLevel&&(c.hdrLevel=a.g.preferredVideoHdrLevel,d=
!0);b.preferredVideoLayout!=a.g.preferredVideoLayout&&c.videoLayout!=a.g.preferredVideoLayout&&(c.videoLayout=a.g.preferredVideoLayout,d=!0);b.preferSpatialAudio!=a.g.preferSpatialAudio&&c.spatialAudio!=a.g.preferSpatialAudio&&(c.spatialAudio=a.g.preferSpatialAudio,d=!0);b.preferredVideoRole!=a.g.preferredVideoRole&&c.videoRole!=a.g.preferredVideoRole&&(c.videoRole=a.g.preferredVideoRole,d=!0);d&&(a.I.configure(c),Jq(a))}}function Jq(a,b=!0,c=0,d=!1,e=!0){const f=uq(a);f&&yq(a,f,e,b,c,d)}
function Lq(a,b){a.Ob.La();a.Ob.D(a.h,"timeupdate",()=>{const c=a.h.currentTime,d=a.Ia(),e=a.U(),f=e?a.g.streaming.safeSeekOffset:0;b>0?e&&b>1&&Math.floor(c)>=Math.floor(d.end)&&a.gd():Math.floor(c)<=Math.floor(d.start+f)&&a.gd()})}function Zq(a){return a.h&&a.h.videoTracks?Array.from(a.h.videoTracks).find(b=>b.selected):null}
async function $q(a,b){if(a.m!=Kp&&a.m!=jq)return null;let c=a.Rd;a.i&&(c=a.i.imageStreams);let d=c[0];if(!d)return null;b!=null&&(d=c.find(e=>e.id==b));if(!d)return null;d.segmentIndex||await d.createSegmentIndex();d.closeSegmentIndex&&(a.Zb.has(d)||a.Zb.set(d,new Ce(()=>{d&&(d.closeSegmentIndex(),a.Zb.delete(d))})),a.Zb.get(d).ma(5));return d}function ar(a){return a?(a=/(\d+)x(\d+)/.exec(a))?{columns:parseInt(a[1],10),rows:parseInt(a[2],10)}:null:null}
function br(a,b,c,d){const e=b.width||0,f=b.height||0;let g=e/d.columns,h=f/d.rows;const k=d.columns*d.rows;var l=a.j-a.startTime;l=a.A||l/k;let m=a.startTime,n=0;var p=0;k>1&&(p=Math.floor((c-a.startTime)/l+1E-4),m=a.startTime+p*l,n=p%d.columns*g,p=Math.floor(p/d.columns)*h);if(m>=a.endTime||Zi(m,a.endTime,1E-4))return null;d=!1;if(c=a.thumbnailSprite)d=!0,h=c.height,n=c.positionX,p=c.positionY,g=c.width;return{segment:a,imageHeight:f,imageWidth:e,height:h,positionX:n,positionY:p,startTime:m,duration:l,
uris:a.P(),startByte:a.kc(),endByte:a.hc(),width:g,sprite:d,mimeType:a.mimeType||b.mimeType,codecs:a.codecs||b.codecs}}function cr(a,b){var c=Array.from(a.h.audioTracks).find(e=>e.enabled);b.enabled=!0;if(c){b.id!==c.id&&(c.enabled=!1);var d=Zq(a);c=sf(c,d);b=sf(b,d);Uq(a,c,b);Vq(a,c,b)}}function Wq(a){const b=Bp("texttrackvisibility");Nq(a,b)}async function dr(a,b){let c;try{c=await Cl(b,a.M,a.g.streaming.retryParameters)}catch(d){}if(c)return c;throw new F(1,2,2011,b);}
async function er(a,b,c,d,e,f,g){if(e!="text/vtt"||g.length)b=await fr(a,b),b=gr(a,b,e,g),b=yj(new Blob([b],{type:"text/vtt"}));e=document.createElement("track");a:{g=a.J;try{if(!g.g.enabled){var h=b;break a}const k=np(g);k.ot=rp;k.su=!0;const l=oo(k);h=mo(b,l);break a}catch(k){la("CMCD_TEXT_TRACK_ERROR","Could not generate text track CMCD data.",k);h=b;break a}h=void 0}e.src=h;e.label=f;e.kind=d;e.srclang=c;a.h.getAttribute("crossorigin")||a.h.setAttribute("crossorigin","anonymous");a.h.appendChild(e);
a.Le.push(e);return e}async function fr(a,b){b=ag([b],a.g.streaming.retryParameters);b.method="GET";var c=a.J;try{c.g.enabled&&Oo(c,b,{ot:rp,su:!0})}catch(d){la("CMCD_TEXT_ERROR","Could not generate text CMCD data.",d)}return(await a.M.request(gg,b).promise).data}function gr(a,b,c,d){const e=qe(c);if(e)return c=e(),a={periodStart:0,segmentStart:0,segmentEnd:a.h.duration,vttOffset:0},b=C(b),b=c.parseMedia(b,a,null,[]),lo(b,d);throw new F(2,2,2014,c);}
function Xq(a,b,c){return(Zi(b,c,.01)||c>b)&&a.Ke<b?(a.Ke=b,!0):!1}function Uq(a,b,c){b=(new Map).set("oldTrack",b).set("newTrack",c);b=Bp("variantchanged",b);Nq(a,b)}function Vq(a,b,c){let d=!1;b&&b.audioId==c.audioId&&b.audioGroupId==c.audioGroupId||(d=!0);d&&Oq(a)}async function Nq(a,b){await Promise.resolve();a.m!=Iq&&a.dispatchEvent(b)}function Oq(a){const b=Bp("audiotrackschanged");Nq(a,b)}
var R=class extends Vf{constructor(a,b=null,c){super();this.m=hr;this.h=null;this.Hd=b;this.W=!1;this.Sd=new Aa;this.Id=new Aa;this.j=new Aa;this.Ob=new Aa;this.Vc=new Aa;this.F=this.G=this.C=this.M=null;this.Td=0;this.Y=new Ap;this.N=this.Ba=this.T=this.i=this.ac=this.H=this.l=this.Ed=this.R=this.ig=this.qa=this.J=this.Va=this.ua=this.Fd=this.O=this.Aa=this.K=this.Lb=null;this.Ha=!1;this.Nd=this.o=null;this.Md=1E9;this.Rd=[];this.Zb=new Map;this.Wa=[];this.Ke=-1;this.g=Hp(this);this.Me=Zm();this.S=
null;this.Ud=-1;this.Mb=null;this.sa={width:Infinity,height:Infinity};this.Ld=new Ch(this.g,this.sa,null);this.Pd=[];this.A=null;this.I=this.g.adaptationSetCriteriaFactory();this.I.configure({language:this.g.preferredAudioLanguage,role:this.g.preferredAudioRole,videoRole:this.g.preferredVideoRole,channelCount:0,hdrLevel:this.g.preferredVideoHdrLevel,spatialAudio:this.g.preferSpatialAudio,videoLayout:this.g.preferredVideoLayout,audioLabel:this.g.preferredAudioLabel,videoLabel:this.g.preferredVideoLabel,
codecSwitchingStrategy:this.g.mediaSource.codecSwitchingStrategy,audioCodec:"",activeAudioCodec:"",activeAudioChannelCount:0,preferredAudioCodecs:this.g.preferredAudioCodecs,preferredAudioChannelCount:this.g.preferredAudioChannelCount});this.Yc=this.g.preferredTextLanguage;this.ed=this.g.preferredTextRole;this.Kd=this.g.preferForcedSubs;this.Jd=[];c&&c(this);this.J=new sp(this,this.g.cmcd);this.qa=new yp(this.g.cmsd);this.M=Ip(this);this.ea=this.ha=this.va=this.B=null;this.Oe=!1;this.Le=[];this.Ne=
new Ce(async()=>{this.ha&&(await this.Db(this.ea,!0),await this.load(this.ha),this.Oe?this.ea.pause():this.ea.play(),this.ha=null,this.Oe=!1)});ir&&(this.B=ir(),this.B.configure(this.g.ads),this.Vc.D(this.B,"ad-content-pause-requested",async d=>{this.Ne.stop();if(!this.ha){this.ea=this.h;this.Oe=this.sd();d=d.saveLivePosition||!1;let e=!0;this.U()&&(e=d);this.ha=await this.sg(!0,e)}}),this.Vc.D(this.B,"ad-content-resume-requested",d=>{d=d.offset||0;if(this.ha){var e=this.ha;e.o&&d&&(typeof e.o===
"number"?e.o+=d:e.o.setTime(e.o.getTime()+d*1E3))}this.Ne.ma(.1)}),this.Vc.D(this.B,"ad-content-attach-requested",async()=>{!this.h&&this.ea&&(await this.Db(this.ea,!0),this.ea=null)}));jr&&(this.va=jr(this),this.va.configure(this.g.queue));this.Sd.D(window,"online",()=>{Jp(this);this.Rf()});this.Od=new Ce(()=>{const d=Date.now()/1E3;let e=!1,f=!0;for(const g of this.i.variants)g.disabledUntilTime>0&&g.disabledUntilTime<=d&&(g.disabledUntilTime=0,e=!0),g.disabledUntilTime>0&&(f=!1);f&&this.Od.stop();
e&&Jq(this,!1,void 0,!1,!1)});this.Ra=null;a&&(Ra("Player w/ mediaElement","Please migrate from initializing Player with a mediaElement; use the attach method instead."),this.Db(a,!0));this.u=null}async destroy(){if(this.m!=Iq){Mp(this);var a=this.detach();this.m=Iq;await a;await this.Ye();this.Sd&&(this.Sd.release(),this.Sd=null);this.Id&&(this.Id.release(),this.Id=null);this.j&&(this.j.release(),this.j=null);this.Ob&&(this.Ob.release(),this.Ob=null);this.Vc&&(this.Vc.release(),this.Vc=null);this.qa=
this.J=this.Hd=this.A=this.g=this.Nd=null;this.M&&(await this.M.destroy(),this.M=null);this.o&&(this.o.release(),this.o=null);this.va&&(this.va.destroy(),this.va=null);super.release()}}async Db(a,b=!0){if(this.m==Iq)throw new F(2,7,7E3);const c=this.h&&this.h==a;this.h&&this.h!=a&&await this.detach();if(!await Pp(this,"attach"))try{c||(Op(this,"attach"),this.Id.D(a,"error",()=>{const d=nq(this,!1);d&&bq(this,d)}),this.h=a,this.J&&this.J.setMediaElement(a)),Fa(),b&&kc()&&!this.G&&await Qp(this)}catch(d){throw await this.detach(),
d;}finally{this.Y.release()}}ih(a){this.ig=a}async detach(a=!1){if(this.m==Iq)throw new F(2,7,7E3);await this.cc(!1,a);if(!await Pp(this,"detach"))try{this.h&&(this.Id.La(),this.h=null),Op(this,"detach"),this.B&&!a&&this.B.release()}finally{this.Y.release()}}async cc(a=!0,b=!1){this.m!=Iq&&(this.m=hr);if(!await Pp(this,"unload")){try{this.Ha=!1;Op(this,"unload");Mp(this);const c=this.Jd.map(d=>d());this.Jd=[];await Promise.all(c);this.dispatchEvent(Bp("unloading"));this.Fd&&(this.Fd.release(),this.Fd=
null);this.ua&&(this.ua.release(),this.ua=null);this.Va&&(this.Va.release(),this.Va=null);this.h&&(this.j.La(),this.Ob.La());this.Od.stop();this.Lb&&(this.Lb.release(),this.Lb=null);this.Aa&&(this.Aa.stop(),this.Aa=null);this.H&&(await this.H.stop(),this.ac=this.H=null);this.o&&this.o.stop();this.l&&(await this.l.destroy(),this.l=null);this.K&&(this.K.release(),this.K=null);this.F&&(this.F.release(),this.F=null);"webkit"===window.shakaMediaKeysPolyfill&&this.C&&(await this.C.destroy(),this.C=null);
this.G&&(await this.G.destroy(),this.G=null);if(this.B&&!b)this.B.onAssetUnload();this.ha&&!b&&(this.ha.destroy(),this.ha=null);b||this.Ne.stop();this.J&&wo(this.J);this.qa&&(this.qa.g=null);this.u&&(await this.u.destroy(),this.u=null);this.W=!1;if(this.h){for(const d of this.Le)d.src.startsWith("blob:")&&URL.revokeObjectURL(d.src),d.remove();this.Le=[];Li(this.h)&&this.h.load()}this.C&&(await this.C.destroy(),this.C=null);this.Ra&&this.T!=this.Ra.Kc()&&(this.Ra.l||this.Ra.destroy(),this.Ra=null);
this.O=this.Ba=this.T=null;if(this.i){for(const d of this.i.variants)for(const e of[d.audio,d.video])e&&e.segmentIndex&&e.segmentIndex.release();for(const d of this.i.textStreams)d.segmentIndex&&d.segmentIndex.release()}this.g&&this.g.streaming.clearDecodingCache&&(hf.clear(),Cb.clear());this.i=null;this.A=new qn;this.S=this.Mb=this.hg=null;this.Ud=-1;this.Rd=[];for(const d of this.Zb.values())d.stop();this.Zb.clear();this.Wa=[];this.Ke=-1;this.M&&this.M.pg();Up(this)}finally{this.Y.release()}Fa();
a&&kc()&&!this.G&&this.h&&await Qp(this)}}fj(a){this.N=a}async load(a,b=null,c){if(this.m==Iq)throw new F(2,7,7E3);!this.h&&this.ea&&(await this.Db(this.ea,!0),this.ea=null);let d=null,e="";c=c?.toLowerCase();if(a instanceof Jn){if(a.l)throw new F(2,7,7006);d=a;e=d.Kc()||""}else e=a||"";await zp(this.Y,"load");this.Y.release();if(!this.h)throw new F(2,7,7002);this.T&&(this.T=e,await this.cc(!1));const f=++this.Td,g=async()=>{if(this.Td!=f)throw d&&await d.destroy(),new F(2,7,7E3);};a=async(h,k)=>
{try{await zp(this.Y,k),await g(),await h(),await g(),d&&this.g&&(d.g=this.g)}finally{this.Y.release()}};try{b==null&&d&&(b=d.getStartTime());this.N=b;this.Ha=!1;this.dispatchEvent(Bp("loading"));d?c=d.S:c||await a(async()=>{c=await Wp(this,e)},"guessMimeType_");const h=!!d;d?(un(d,this),this.A=d.getStats()):(d=await Xp(this,e,b,c,!0,this.g))?(d.C=!1,un(d,this),this.A=d.getStats(),d.start(),d.A.catch(()=>{})):this.A=new qn;b=!d;const k=Date.now()/1E3;this.A=d?d.getStats():new qn;this.T=e;this.Ba=
c||null;Up(this);const l=()=>{const m=this.h?this.h.buffered:null;return{start:Ei(m)||0,end:Fi(m)||0}};this.ua=new kl(l);this.ua.addEventListener("regionadd",m=>{$p(this,m.region,"metadataadded")});if(b)await a(async()=>{await aq(this,c)},"initializeSrcEqualsDrmInner_"),await a(async()=>{await cq(this,k,c)},"srcEqualsInner_");else{this.Va=new kl(l);await a(async()=>{await Promise.race([d.ea,d.A]);this.ac=d.G;var q=d;q.ha=!0;this.H=q.m;this.i=d.vf()},"waitForFinish");this.G||await a(async()=>{await Qp(this)},
"initializeMediaSourceEngineInner_");this.i&&this.i.textStreams.length&&(this.u.enableTextDisplayer?this.u.enableTextDisplayer():Ra("Text displayer w/ enableTextDisplayer",'Text displayer should have a "enableTextDisplayer" method!'));await a(async()=>{await d.A},"waitForFinish");this.g=d.getConfiguration();this.Ld=d.F;this.H&&this.H.setMediaElement&&this.h&&this.H.setMediaElement(this.h);this.Fd=vn(d);this.Ed=d.Ba;const m=d.B;m&&(this.I=m);h&&this.h&&this.h.nodeName==="AUDIO"&&(qq(this),this.configure("manifest.disableVideo",
!0));d.j||await a(async()=>{await Cn(d,this.h)},"drmEngine_.init");this.C=wn(d);await a(async()=>{await this.C.Db(this.h)},"drmEngine_.attach");const n=this.g.abrFactory;this.o&&this.Nd==n||(this.Nd=n,this.o&&this.o.release(),this.o=n(),typeof this.o.setMediaElement!="function"&&(Ra("AbrManager w/o setMediaElement","Please use an AbrManager with setMediaElement function."),this.o.setMediaElement=()=>{}),typeof this.o.setCmsdManager!="function"&&(Ra("AbrManager w/o setCmsdManager","Please use an AbrManager with setCmsdManager function."),
this.o.setCmsdManager=()=>{}),typeof this.o.trySuggestStreams!="function"&&(Ra("AbrManager w/o trySuggestStreams","Please use an AbrManager with trySuggestStreams function."),this.o.trySuggestStreams=()=>{}),this.o.configure(this.g.abr));const p=xn(d),r=d.i;await a(async()=>{await rq(this,k,r,p)},"loadInner_");tn(d);this.Ba&&Fa().Ba()&&me(this.Ba)&&Bj(this.G,this.T,this.Ba)}this.dispatchEvent(Bp("loaded"))}catch(h){throw h&&h.code!=7E3&&await this.cc(!1),h;}finally{d&&await d.destroy(),this.Ra=null}}async bh(a=
!0,b=!1,c=!1){c=await Dq(this,c);await this.cc(a,b);return c}async sg(a=!1,b=!1){b=await Dq(this,b);await this.detach(a);return b}async preload(a,b=null,c,d){c=c?.toLowerCase();const e=Hp(this);$m(e,d||this.g,Hp(this));(a=await Xp(this,a,b,c,!1,e))?a.start():bq(this,new F(2,7,7005));return a}async Ye(){const a=[];for(const b of this.Pd)b.l||a.push(b.destroy());this.Pd=[];await Promise.all(a)}Li(){for(var a=this.Y;a.g;)a.release()}Hc(a){return new rh(a)}configure(a,b){const c=this.getConfiguration();
arguments.length==2&&typeof a=="string"&&(a=xm(a,b));"preferredVariantRole"in a&&(Ra("preferredVariantRole configuration","Please Use preferredAudioRole instead."),a.preferredAudioRole=a.preferredVariantRole,delete a.preferredVariantRole);a.streaming&&"forceTransmuxTS"in a.streaming&&(Ra("streaming.forceTransmuxTS configuration","Please Use mediaSource.forceTransmux instead."),a.mediaSource=a.mediaSource||{},a.mediaSource.mediaSource=a.streaming.forceTransmuxTS,delete a.streaming.forceTransmuxTS);
a.streaming&&"forceTransmux"in a.streaming&&(Ra("streaming.forceTransmux configuration","Please Use mediaSource.forceTransmux instead."),a.mediaSource=a.mediaSource||{},a.mediaSource.mediaSource=a.streaming.forceTransmux,delete a.streaming.forceTransmux);if(a.streaming&&"useNativeHlsOnSafari"in a.streaming){Ra("streaming.useNativeHlsOnSafari configuration","Please Use streaming.useNativeHlsForFairPlay or streaming.preferNativeHls instead.");var d=Fa();a.streaming.preferNativeHls=a.streaming.useNativeHlsOnSafari&&
d.h()==="WEBKIT";delete a.streaming.useNativeHlsOnSafari}a.streaming&&typeof a.streaming.liveSync=="boolean"&&(Ra("streaming.liveSync","Please Use streaming.liveSync.enabled instead."),d=a.streaming.liveSync,a.streaming.liveSync={},a.streaming.liveSync.enabled=d);if(a.streaming&&!(a.streaming.liveSync&&"targetLatency"in a.streaming.liveSync)&&("liveSyncMinLatency"in a.streaming||"liveSyncMaxLatency"in a.streaming)){d=a.streaming.liveSyncMinLatency||0;const f=Math.abs((a.streaming.liveSyncMaxLatency||
1)-d)/2;a.streaming.liveSync=a.streaming.liveSync||{};a.streaming.liveSync.targetLatency=d+f;a.streaming.liveSync.targetLatencyTolerance=f}a.streaming&&"liveSyncMaxLatency"in a.streaming&&(Ra("streaming.liveSyncMaxLatency","Please Use streaming.liveSync.targetLatency and streaming.liveSync.targetLatencyTolerance instead. Or, set the values in your DASH manifest"),delete a.streaming.liveSyncMaxLatency);a.streaming&&"liveSyncMinLatency"in a.streaming&&(Ra("streaming.liveSyncMinLatency","Please Use streaming.liveSync.targetLatency and streaming.liveSync.targetLatencyTolerance instead. Or, set the values in your DASH manifest"),
delete a.streaming.liveSyncMinLatency);a.streaming&&"liveSyncTargetLatency"in a.streaming&&(Ra("streaming.liveSyncTargetLatency","Please Use streaming.liveSync.targetLatency instead."),a.streaming.liveSync=a.streaming.liveSync||{},a.streaming.liveSync.targetLatency=a.streaming.liveSyncTargetLatency,delete a.streaming.liveSyncTargetLatency);a.streaming&&"liveSyncTargetLatencyTolerance"in a.streaming&&(Ra("streaming.liveSyncTargetLatencyTolerance","Please Use streaming.liveSync.targetLatencyTolerance instead."),
a.streaming.liveSync=a.streaming.liveSync||{},a.streaming.liveSync.targetLatencyTolerance=a.streaming.liveSyncTargetLatencyTolerance,delete a.streaming.liveSyncTargetLatencyTolerance);a.streaming&&"liveSyncPlaybackRate"in a.streaming&&(Ra("streaming.liveSyncPlaybackRate","Please Use streaming.liveSync.maxPlaybackRate instead."),a.streaming.liveSync=a.streaming.liveSync||{},a.streaming.liveSync.maxPlaybackRate=a.streaming.liveSyncPlaybackRate,delete a.streaming.liveSyncPlaybackRate);a.streaming&&"liveSyncMinPlaybackRate"in
a.streaming&&(Ra("streaming.liveSyncMinPlaybackRate","Please Use streaming.liveSync.minPlaybackRate instead."),a.streaming.liveSync=a.streaming.liveSync||{},a.streaming.liveSync.minPlaybackRate=a.streaming.liveSyncMinPlaybackRate,delete a.streaming.liveSyncMinPlaybackRate);a.streaming&&"liveSyncPanicMode"in a.streaming&&(Ra("streaming.liveSyncPanicMode","Please Use streaming.liveSync.panicMode instead."),a.streaming.liveSync=a.streaming.liveSync||{},a.streaming.liveSync.panicMode=a.streaming.liveSyncPanicMode,
delete a.streaming.liveSyncPanicMode);a.streaming&&"liveSyncPanicThreshold"in a.streaming&&(Ra("streaming.liveSyncPanicThreshold","Please Use streaming.liveSync.panicThreshold instead."),a.streaming.liveSync=a.streaming.liveSync||{},a.streaming.liveSync.panicThreshold=a.streaming.liveSyncPanicThreshold,delete a.streaming.liveSyncPanicThreshold);if(a.mediaSource&&"sourceBufferExtraFeatures"in a.mediaSource){Ra("mediaSource.sourceBufferExtraFeatures configuration","Please Use mediaSource.addExtraFeaturesToSourceBuffer() instead.");
const f=a.mediaSource.sourceBufferExtraFeatures;a.mediaSource.addExtraFeaturesToSourceBuffer=()=>f;delete a.mediaSource.sourceBufferExtraFeatures}a.manifest&&a.manifest.hls&&"useSafariBehaviorForLive"in a.manifest.hls&&(Ra("manifest.hls.useSafariBehaviorForLive configuration","Please Use liveSync config to keep on live Edge instead."),delete a.manifest.hls.useSafariBehaviorForLive);a.streaming&&"parsePrftBox"in a.streaming&&(Ra("streaming.parsePrftBox configuration","Now fired without needing a configuration."),
delete a.streaming.parsePrftBox);a.manifest&&a.manifest.dash&&"enableAudioGroups"in a.manifest.dash&&(Ra("manifest.dash.enableAudioGroups configuration","Please Use manifest.enableAudioGroups instead."),a.manifest.enableAudioGroups=a.manifest.dash.enableAudioGroups,delete a.manifest.dash.enableAudioGroups);a.streaming&&"dispatchAllEmsgBoxes"in a.streaming&&(Ra("streaming.dispatchAllEmsgBoxes configuration","Please Use mediaSource.dispatchAllEmsgBoxes instead."),a.mediaSource=a.mediaSource||{},a.mediaSource.dispatchAllEmsgBoxes=
a.streaming.dispatchAllEmsgBoxes,delete a.streaming.dispatchAllEmsgBoxes);a.streaming&&"autoLowLatencyMode"in a.streaming&&(Ra("streaming.autoLowLatencyMode configuration","Please Use streaming.lowLatencyMode instead."),a.streaming.lowLatencyMode=a.streaming.autoLowLatencyMode,delete a.streaming.autoLowLatencyMode);a.manifest&&a.manifest.dash&&"ignoreSupplementalCodecs"in a.manifest.dash&&(Ra("manifest.dash.ignoreSupplementalCodecs configuration","Please Use manifest.ignoreSupplementalCodecs instead."),
a.manifest.ignoreSupplementalCodecs=a.manifest.dash.ignoreSupplementalCodecs,delete a.manifest.dash.ignoreSupplementalCodecs);a.manifest&&a.manifest.hls&&"ignoreSupplementalCodecs"in a.manifest.hls&&(Ra("manifest.hls.ignoreSupplementalCodecs configuration","Please Use manifest.ignoreSupplementalCodecs instead."),a.manifest.ignoreSupplementalCodecs=a.manifest.hls.ignoreSupplementalCodecs,delete a.manifest.hls.ignoreSupplementalCodecs);a.manifest&&a.manifest.dash&&"updatePeriod"in a.manifest.dash&&
(Ra("manifest.dash.updatePeriod configuration","Please Use manifest.updatePeriod instead."),a.manifest.updatePeriod=a.manifest.dash.updatePeriod,delete a.manifest.dash.updatePeriod);a.manifest&&a.manifest.hls&&"updatePeriod"in a.manifest.hls&&(Ra("manifest.hls.updatePeriod configuration","Please Use manifest.updatePeriod instead."),a.manifest.updatePeriod=a.manifest.hls.updatePeriod,delete a.manifest.hls.updatePeriod);a.manifest&&a.manifest.dash&&"ignoreDrmInfo"in a.manifest.dash&&(Ra("manifest.dash.ignoreDrmInfo configuration",
"Please Use manifest.ignoreDrmInfo instead."),a.manifest.ignoreDrmInfo=a.manifest.dash.ignoreDrmInfo,delete a.manifest.dash.ignoreDrmInfo);if(a.drm&&a.drm.advanced){d=!1;for(var e in a.drm.advanced){const {videoRobustness:f,audioRobustness:g}=a.drm.advanced[e];"videoRobustness"in a.drm.advanced[e]&&!Array.isArray(a.drm.advanced[e].videoRobustness)&&(a.drm.advanced[e].videoRobustness=[f],d=!0);"audioRobustness"in a.drm.advanced[e]&&!Array.isArray(a.drm.advanced[e].audioRobustness)&&(a.drm.advanced[e].audioRobustness=
[g],d=!0)}d&&Ra("AdvancedDrmConfiguration's videoRobustness and audioRobustness","These properties are no longer strings but array of strings, please update your usage of these properties.")}a.streaming&&"forceHTTP"in a.streaming&&(Ra("streaming.forceHTTP configuration","Please Use networking.forceHTTP instead."),a.networking=a.networking||{},a.networking.forceHTTP=a.streaming.forceHTTP,delete a.streaming.forceHTTP);a.streaming&&"forceHTTPS"in a.streaming&&(Ra("streaming.forceHTTPS configuration",
"Please Use networking.forceHTTP instead."),a.networking=a.networking||{},a.networking.forceHTTPS=a.streaming.forceHTTPS,delete a.streaming.forceHTTPS);a.streaming&&"minBytesForProgressEvents"in a.streaming&&(Ra("streaming.minBytesForProgressEvents configuration","Please Use networking.minBytesForProgressEvents instead."),a.networking=a.networking||{},a.networking.minBytesForProgressEvents=a.streaming.minBytesForProgressEvents,delete a.streaming.minBytesForProgressEvents);e=$m(this.g,a,Hp(this));
Yq(this,c);return e}rh(a){this.Me=a}getConfiguration(){const a=Hp(this);$m(a,this.g,Hp(this));return a}Eh(){return this.Me}Bg(){const a=Hp(this);$m(a,this.g,Hp(this));return zm(this.g,Hp(this))}xg(){if(this.h){var a=this.h.buffered.length;a=a?this.h.buffered.end(a-1):0;const b=Math.min(this.h.currentTime+this.g.streaming.bufferingGoal,this.Ia().end);if(a>=b)return 1;if(!(a<=this.h.currentTime)&&a<b)return(a-this.h.currentTime)/(b-this.h.currentTime)}return 0}Og(){const a=this.getConfiguration();for(const b in this.g)delete this.g[b];
$m(this.g,Hp(this),Hp(this));Yq(this,a)}nd(){return this.m}zg(){return this.i?this.i.type:null}be(){return this.h}Gb(){return this.M}Kc(){return this.T}wg(){return this.B?this.B:null}Dg(){return this.va?this.va:null}U(){return this.i&&!this.xa()?this.i.presentationTimeline.U():this.h&&(this.h.src||this.xa())?this.h.duration==Infinity:!1}vc(){return this.i?this.i.presentationTimeline.vc():!1}ii(){if(this.i&&!this.xa()){const a=this.i.variants;return a.length?!a[0].video:!1}return this.h&&(this.h.src||
this.xa())?this.h.videoTracks?this.h.videoTracks.length==0:this.h.videoHeight==0:!1}Fg(){if(this.i&&!this.xa()){var a=this.i.variants;if(!a.length)return!1;a=a[0];return a.audio||!a.video?!1:!a.video.codecs.includes(",")}return this.h&&(this.h.src||this.xa())&&this.h.audioTracks?this.h.audioTracks.length==0:!1}Ia(){if(this.i&&!this.xa()){if(!this.Ha&&this.i.type=="HLS")return{start:0,end:0};var a=this.i.presentationTimeline;return{start:a.Ib(),end:a.sb()}}if(this.h&&(this.h.src||this.xa())&&(a=this.h.seekable)&&
a.length){var b=this.g?this.g.playRangeStart:0;b=Math.max(a.start(0),b);const c=this.g?this.g.playRangeEnd:Infinity;a=Math.min(a.end(a.length-1),c);return{start:b,end:a}}return{start:0,end:0}}di(){this.U()&&(this.h.currentTime=this.Ia().end)}ji(){return this.Ha}keySystem(){var a=this.drmInfo();return a?a.keySystem:""}drmInfo(){return this.C?this.C.g:null}md(){return this.C?this.C.md():Infinity}uf(){return this.C?this.C.uf():[]}ae(){return this.C?this.C.ae():{}}Af(){return this.O?this.O.g==uh:!!this.T}rb(){return this.h?
this.K?this.K.h:1:0}gg(a){this.m==Kp&&this.l&&$l(this.l,a)}Dd(a,b=!0){if(a==0)ja("A trick play rate of 0 is unsupported!");else{var c=this.h.playbackRate,d=this.K.h;this.K.set(a);this.m==Kp&&(this.o.playbackRateChanged(a),this.gg(b&&a!=1));Lq(this,a);c===0&&this.h.playbackRate===0&&a!=d&&Kq(this)}}gd(){const a=this.K.Lc();this.m==jq&&this.K.set(a);this.m==Kp&&(this.K.set(a),this.o.playbackRateChanged(a),this.gg(!1));this.Ob.La()}Ub(){if(this.i&&!this.xa()){var a=this.l?this.l.o:null;const b=[];let c=
0;for(const d of this.i.variants){if(!tf(d))continue;const e=mf(d);e.active=d==a;e.active||c==1||a==null||d.video!=a.video||d.audio!=a.audio||(e.active=!0);e.active&&c++;b.push(e)}return b}if(this.h&&this.h.audioTracks){const b=Zq(this);a=Array.from(this.h.audioTracks);return a.length?a.map(c=>sf(c,b)):b?[sf(null,b)]:[]}return[]}lc(){if(this.i){if(this.xa())return[];const a=this.l?this.l.A:null,b=[];for(const c of this.i.textStreams){const d=nf(c);d.active=c==a;b.push(d)}return b}return this.h&&this.h.src&&
this.h.textTracks?gq(this).map(a=>rf(a)):[]}Jh(){let a=this.Rd;this.i&&(a=this.i.imageStreams);return a.map(b=>of(b))}async wh(a){const b=await $q(this,a);if(!b)return null;const c=[];b.segmentIndex.fb(d=>{const e=ar(d.tilesLayout||b.tilesLayout);if(e){const f=e.rows*e.columns,g=(d.j-d.startTime)/f;for(let h=0;h<f;h++){const k=br(d,b,d.startTime+h*g,e);if(!k)break;c.push(k)}}});return c}async Yh(a,b){a=await $q(this,a);if(!a)return null;var c=a.segmentIndex.find(b);if(c==null)return null;c=a.segmentIndex.get(c);
const d=ar(c.tilesLayout||a.tilesLayout);return d?br(c,a,b,d):null}Vf(a){const b=()=>{const c=this.i.textStreams.find(d=>d.id==a.id);c&&c!=this.l.A&&(en(this.A.h,c,!1),bm(this.l,c),Mq(this),Aq(this),this.Yc=c.language)};if(this.i&&this.F&&(b(),!this.xa()))return;(()=>{if(this.h&&this.h.textTracks){var c=gq(this);const e=c.find(f=>pf(f)===a.id);if(e){if(this.u instanceof Xn)for(var d of c)c=d===e?this.W?"showing":"hidden":"disabled",d.mode!==c&&(d.mode=c);else d=c.find(f=>f.mode!=="disabled"),d!==
e&&(d&&(d.mode="disabled",this.j.Ja(d,"cuechange"),this.u.remove(0,Infinity)),e&&lq(this,e));Mq(this);Aq(this)}}})()}Ee(a,b=!1,c=0){const d=()=>{const e=this.i.variants.find(g=>g.id==a.id);if(e&&tf(e)){var f=this.l.o;this.g.abr.enabled&&(f.video!=e.video||f.audio&&e.audio&&f.audio.language==e.audio.language&&f.audio.channelsCount==e.audio.channelsCount&&f.audio.label==e.audio.label)&&ja("Changing tracks while abr manager is enabled will likely result in the selected track being overridden. Consider disabling abr before calling selectVariantTrack().");
this.xa()?yq(this,e,!1,!1,0):yq(this,e,!1,b||!1,c||0);this.I.configure({language:e.language,role:e.audio&&e.audio.roles&&e.audio.roles[0]||"",videoRole:e.video&&e.video.roles&&e.video.roles[0]||"",channelCount:e.audio&&e.audio.channelsCount?e.audio.channelsCount:0,hdrLevel:e.video&&e.video.hdr?e.video.hdr:"",spatialAudio:e.audio&&e.audio.spatialAudio?e.audio.spatialAudio:!1,videoLayout:e.video&&e.video.videoLayout?e.video.videoLayout:"",audioLabel:e.audio&&e.audio.label?e.audio.label:"",videoLabel:e.video&&
e.video.label?e.video.label:"",codecSwitchingStrategy:this.g.mediaSource.codecSwitchingStrategy,audioCodec:e.audio&&e.audio.codecs?e.audio.codecs:"",activeAudioCodec:f.audio&&f.audio.codecs?f.audio.codecs:"",activeAudioChannelCount:f.audio&&f.audio.channelsCount?f.audio.channelsCount:0,preferredAudioCodecs:this.g.preferredAudioCodecs,preferredAudioChannelCount:this.g.preferredAudioChannelCount});Lp(this)}};if(this.i&&this.F&&(d(),!this.xa()))return;(()=>{if(a.originalAudioId&&this.h&&this.h.audioTracks){const e=
Array.from(this.h.audioTracks);for(const f of e)if(pf(f)==a.id){cr(this,f);break}}})()}Si(a,b=0){const c=()=>{const d=this.I.getConfiguration();d.audioCodec=a.codecs||"";d.audioLabel=a.label||"";d.channelCount=a.channelsCount||0;d.language=a.language;d.role=a.roles[0]||"";d.spatialAudio=a.spatialAudio;var e=this.l.o;if(e=e&&e.audio)d.activeAudioCodec=e.codecs||"",d.activeAudioChannelCount=e.channelsCount||0;this.I.configure(d);Jq(this,!0,b,!1,!1)};if(this.i&&this.F&&(c(),!this.xa()))return;(()=>{if(this.h&&
this.h.audioTracks){const e=Ie(a.language);var d=Array.from(this.h.audioTracks);let f=null;for(const g of d)if(d=g.language||"und",g.label==a.label&&Ie(d)==e&&g.kind==a.roles[0]){f=g;break}f&&cr(this,f)}})()}getAudioTracks(){if(this.i&&!this.xa()){var a=this.Ub();if(!a.length)return[];const c=a.find(d=>d.active);if(!c)return[];var b=a;this.m!=Kp||this.xa()||(b=a.filter(d=>d.originalVideoId===c.originalVideoId&&(d.audioCodec||ce.includes(d.audioMimeType||""))));if(!b.length)return[];a=new Map;for(const d of b){b=
[d.language,d.originalLanguage,d.label||"",(d.audioRoles||[]).join(","),d.channelsCount,d.spatialAudio,d.audioCodec||"",d.accessibilityPurpose||""].join("_");const e={active:d.active,language:d.language,label:d.label,mimeType:d.audioMimeType,codecs:d.audioCodec,primary:d.primary,roles:d.audioRoles||[],accessibilityPurpose:d.accessibilityPurpose,channelsCount:d.channelsCount,audioSamplingRate:d.audioSamplingRate,spatialAudio:d.spatialAudio,originalLanguage:d.originalLanguage};a.has(b)?!a.get(b).active&&
e.active&&a.set(b,e):a.set(b,e)}return Array.from(a.values())}return this.h&&this.h.audioTracks?Array.from(this.h.audioTracks).map(c=>{var d=c.language;d={active:c.enabled,language:Ie(d||"und"),label:c.label,mimeType:null,codecs:null,primary:c.kind=="main",roles:[],accessibilityPurpose:null,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,originalLanguage:d};c.kind&&(c.kind=="description"&&(d.accessibilityPurpose="visually impaired"),d.roles.push(c.kind));c.configuration&&(c.configuration.codec&&
(d.codecs=c.configuration.codec),c.configuration.sampleRate&&(d.audioSamplingRate=c.configuration.sampleRate),c.configuration.numberOfChannels&&(d.channelsCount=c.configuration.numberOfChannels));return d}):[]}Ui(a,b=!1,c=0){var d=this.Ub();if(d.length){var e=d.find(g=>g.active);if(e){d=d.filter(g=>(g.videoBandwidth||g.bandwidth)==a.bandwidth&&g.width==a.width&&g.height==a.height&&g.frameRate==a.frameRate&&g.pixelAspectRatio==a.pixelAspectRatio&&g.hdr==a.hdr&&g.colorGamut==a.colorGamut&&g.videoLayout==
a.videoLayout&&g.videoMimeType==a.mimeType&&g.videoCodec==a.codecs&&xa(g.videoRoles,a.roles)&&g.videoLabel==a.label);var f;d.length==1?f=d[0]:f=d.find(g=>g.audioId===e.audioId);f||=d.find(g=>g.language==e.language&&g.label===e.label&&g.channelsCount===e.channelsCount&&g.spatialAudio===e.spatialAudio&&g.audioMimeType===e.audioMimeType&&ge(g.audioCodec||"")===ge(e.audioCodec||"")&&xa(g.audioRoles,e.audioRoles));f&&!f.active&&this.Ee(f,b,c)}}}getVideoTracks(){if(this.m==jq||this.xa())return[];var a=
this.Ub();if(!a.length)return[];const b=a.find(d=>d.active);if(!b)return[];var c=a;this.Fg()||(c=a.filter(d=>d.videoCodec&&d.audioGroupId===b.audioGroupId&&d.originalAudioId===b.originalAudioId?d.audioId===b.audioId?!0:d.language===b.language&&d.label===b.label&&d.channelsCount===b.channelsCount&&d.spatialAudio===b.spatialAudio&&d.audioMimeType===b.audioMimeType&&ge(d.audioCodec||"")===ge(b.audioCodec||"")&&xa(d.audioRoles,b.audioRoles):!1));if(!c.length)return[];a=new Map;for(const d of c)(c=d.originalVideoId)||
d.videoId==null||(c=String(d.videoId)),c&&a.set(c,{active:d.active,bandwidth:d.videoBandwidth||d.bandwidth,width:d.width,height:d.height,frameRate:d.frameRate,pixelAspectRatio:d.pixelAspectRatio,hdr:d.hdr,colorGamut:d.colorGamut,videoLayout:d.videoLayout,mimeType:d.videoMimeType,codecs:d.videoCodec,roles:d.videoRoles||[],label:d.videoLabel});return Array.from(a.values())}yh(){return Fp(this.Ub())}Wh(){return Fp(this.lc())}xh(){return Array.from(Gp(this.Ub()))}Vh(){return Array.from(Gp(this.lc()))}Rg(a,
b,c=0,d=0,e="",f=!1,g=""){const h=()=>{var k=this.l.o;this.I=this.g.adaptationSetCriteriaFactory();this.I.configure({language:a,role:b||"",videoRole:k.video&&k.video.roles&&k.video.roles[0]||"",channelCount:c||0,hdrLevel:"",spatialAudio:f||!1,videoLayout:"",audioLabel:g||"",videoLabel:"",codecSwitchingStrategy:this.g.mediaSource.codecSwitchingStrategy,audioCodec:e||"",activeAudioCodec:k.audio&&k.audio.codecs?k.audio.codecs:"",activeAudioChannelCount:k.audio&&k.audio.channelsCount?k.audio.channelsCount:
0,preferredAudioCodecs:this.g.preferredAudioCodecs,preferredAudioChannelCount:this.g.preferredAudioChannelCount});const l=(p,r)=>p.video||r.video?p.video&&r.video?Math.abs((p.video.height||0)-(r.video.height||0))+Math.abs((p.video.width||0)-(r.video.width||0)):Infinity:0,m=this.I.create(this.i.variants);let n=null;for(const p of m.values())tf(p)&&(!n||l(n,k)>l(p,k))&&(n=p);n!=k&&(n?(k=mf(n),this.Ee(k,!0,d||0)):Jq(this))};if(this.i&&this.F&&(h(),!this.xa()))return;(()=>{if(this.h&&this.h.audioTracks){const k=
vf(this.Ub(),a,b||"",!1)[0];k&&this.Ee(k)}})()}Uf(a,b,c=!1){const d=()=>{this.Yc=a;this.ed=b||"";this.Kd=c||!1;const e=vf(this.i.textStreams,this.Yc,this.ed,this.Kd)[0]||null;e&&e!=this.l.A&&(en(this.A.h,e,!1),this.g.streaming.alwaysStreamText||this.Df())&&(bm(this.l,e),Mq(this),Aq(this))};if(this.i&&this.F&&(d(),!this.xa()))return;(()=>{const e=vf(this.lc(),a,b||"",c||!1)[0];e&&this.Vf(e)})()}Ti(a,b=!0,c=0){const d=()=>{let e=null;for(const f of this.i.variants)if(f.audio.label==a){e=f;break}e!=
null&&(this.I=this.g.adaptationSetCriteriaFactory(),this.I.configure({language:e.language,role:"",videoRole:"",channelCount:0,hdrLevel:"",spatialAudio:!1,videoLayout:"",videoLabel:"",audioLabel:a,codecSwitchingStrategy:this.g.mediaSource.codecSwitchingStrategy,audioCodec:"",activeAudioCodec:"",activeAudioChannelCount:0,preferredAudioCodecs:this.g.preferredAudioCodecs,preferredAudioChannelCount:this.g.preferredAudioChannelCount}),Jq(this,b,c))};if(this.i&&this.F&&(d(),!this.xa()))return;(()=>{if(this.h&&
this.h.audioTracks){const e=Array.from(this.h.audioTracks);let f=null;for(const g of e)g.label==a&&(f=g);f&&cr(this,f)}})()}Df(){const a=this.W;return this.u?this.u.isTextVisible():a}Dh(){return this.Wa.map(a=>nf(a))}Bh(a){Ra("getChapters","Please use an getChaptersAsync.");if(!this.Wa.length)return[];const b=Ie(a);a=this.Wa.filter(e=>Ie(e.language)==b);if(!a.length)return[];const c=[],d=new Set;for(const e of a)e.segmentIndex&&e.segmentIndex.fb(f=>{const g=f.P()[0],h=f.startTime+"-"+f.endTime+"-"+
g;f={id:h,title:g,startTime:f.startTime,endTime:f.endTime};d.has(h)||(c.push(f),d.add(h))});return c}async Ch(a){if(!this.Wa.length)return[];const b=Ie(a);a=this.Wa.filter(e=>Ie(e.language)==b);if(!a.length)return[];const c=[],d=new Set;for(const e of a)e.segmentIndex||await e.createSegmentIndex(),e.segmentIndex.fb(f=>{const g=f.P()[0],h=f.startTime+"-"+f.endTime+"-"+g;f={id:h,title:g,startTime:f.startTime,endTime:f.endTime};d.has(h)||(c.push(f),d.add(h))});return c}Zf(a){a=!!a;this.W!=a&&(this.W=
a,this.m==Kp?(this.u.setTextVisibility(a),this.g.streaming.alwaysStreamText||(a?this.l.A||(a=vf(this.i.textStreams,this.Yc,this.ed,this.Kd),a.length>0&&(bm(this.l,a[0]),Mq(this),Aq(this))):Vl(this.l))):this.h&&this.h.src&&this.h.textTracks&&this.u.setTextVisibility(a),Wq(this))}Ph(){let a;if(this.F)a=this.F.m();else{if(this.N==null)return new Date;if(this.N instanceof Date)return this.N;a=this.N}if(this.i&&!this.xa()){var b=this.i.presentationTimeline;return new Date(((b.m||b.i)+a)*1E3)}return this.h&&
this.h.getStartDate?(b=this.h.getStartDate(),b instanceof Date&&!isNaN(b.getTime())?new Date(b.getTime()+a*1E3):null):null}Cg(){if(this.i&&!this.xa()){var a=this.i.presentationTimeline;a=a.m||a.i;return a===null?null:new Date(a*1E3)}return this.h&&this.h.getStartDate?(a=this.h.getStartDate(),a instanceof Date&&!isNaN(a.getTime())?a:null):null}ce(){return this.U()?this.i?this.i.presentationTimeline.ce():null:null}fc(){if(this.m==Kp)return this.G.fc();const a={total:[],audio:[],video:[],text:[]};this.m==
jq&&(a.total=Ii(this.h.buffered));return a}getBandwidthEstimate(){return this.o?this.o.getBandwidthEstimate():NaN}getStats(){if(this.m!=Kp&&this.m!=jq)return{width:NaN,height:NaN,currentCodecs:"",streamBandwidth:NaN,decodedFrames:NaN,droppedFrames:NaN,corruptedFrames:NaN,stallsDetected:NaN,gapsJumped:NaN,estimatedBandwidth:NaN,completionPercent:NaN,loadLatency:NaN,manifestTimeSeconds:NaN,drmTimeSeconds:NaN,playTime:NaN,pauseTime:NaN,bufferingTime:NaN,licenseTime:NaN,liveLatency:NaN,maxSegmentDuration:NaN,
manifestSizeBytes:NaN,bytesDownloaded:NaN,nonFatalErrorCount:NaN,manifestPeriodCount:NaN,manifestGapCount:NaN,switchHistory:[],stateHistory:[]};Vp(this);var a=this.h,b=a.currentTime/a.duration;isNaN(b)||this.U()||kn(this.A,Math.round(100*b));this.F&&(this.A.R=this.F.C(),this.A.S=this.F.G());a.getVideoPlaybackQuality&&(b=a.getVideoPlaybackQuality(),gn(this.A,Number(b.droppedVideoFrames),Number(b.totalVideoFrames)),this.A.M=Number(b.corruptedVideoFrames));ln(this.A,this.C?mh(this.C):NaN);hn(this.A,
a.videoWidth||NaN,a.videoHeight||NaN);this.A.l="";this.U()&&(a=pp(this),a!=null&&mn(this.A,a/1E3));b=this.Ub().find(c=>c.active);a=this.lc().find(c=>c.active);if(b){if(b.bandwidth){const c=this.K?this.K.h:1;let d=c*b.bandwidth;a&&a.bandwidth&&(d+=c*a.bandwidth);this.A.A=d}b.width&&b.height&&hn(this.A,b.width||NaN,b.height||NaN);b=b.codecs;a&&(b+=","+(a.codecs||a.mimeType));b&&(this.A.l=b)}this.m!=Kp||this.xa()||(this.i&&(this.A.H=this.i.periodCount,this.A.G=this.i.gapCount,this.i.presentationTimeline&&
nn(this.A,this.i.presentationTimeline.h)),a=this.o.getBandwidthEstimate(),this.A.u=a);this.m==jq&&on(this.A,NaN);return pn(this.A)}async fd(a,b,c,d,e,f,g=!1){if(this.m!=Kp&&this.m!=jq)throw new F(1,7,7004);c!="subtitles"&&c!="captions"&&ja("Using a kind value different of `subtitles` or `captions` can cause unwanted issues.");d||=await dr(this,a);let h=[];this.B&&(h=this.B.getCuePoints());if(this.m==jq){e=Fa();g&&e.h()==="WEBKIT"&&(c="forced");d=await er(this,a,b,c,d,f||"",h);if(d.track)return Cq(this),
Mq(this),rf(d.track);throw new F(1,2,2012);}var k=this.Ia();k=k.end-k.start;this.i&&(k=this.i.presentationTimeline.getDuration());if(k==Infinity)throw new F(1,4,4033);h.length&&(a=await fr(this,a),d=gr(this,a,d,h),a=yj(new Blob([d],{type:"text/vtt"})),d="text/vtt");b={id:this.Md++,originalId:null,groupId:null,createSegmentIndex:()=>Promise.resolve(),segmentIndex:Tk(0,k,[a]),mimeType:d||"",codecs:e||"",kind:c,encrypted:!1,drmInfos:[],keyIds:new Set,language:b,originalLanguage:b,label:f||null,type:G,
primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],forced:!!g,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!0,fastSwitching:!1,fullMimeTypes:new Set([be(d||"",e||"")]),isAudioMuxedInVideo:!1,baseOriginalId:null};c=be(b.mimeType,b.codecs);if(!re(c))throw new F(2,2,2014,d);this.i.textStreams.push(b);Cq(this);Mq(this);return nf(b)}async Wd(a,b){if(this.m!=Kp&&this.m!=jq)throw new F(1,7,7004);b||=await dr(this,
a);if(b!="text/vtt")throw new F(1,2,2017,a);var c=this.Ia(),d=c.end-c.start;this.i&&(d=this.i.presentationTimeline.getDuration());if(d==Infinity)throw new F(1,4,4045);c=await fr(this,a);var e=qe(b);if(!e)throw new F(2,2,2014,b);e=e();d={periodStart:0,segmentStart:0,segmentEnd:d,vttOffset:0};c=C(c);e=e.parseMedia(c,d,a,[]);c=[];for(const f of e){let g=null;e=new M(f.startTime,f.endTime,()=>{g==null&&(g=Vb([a],[f.payload]));return g||[]},0,null,null,0,0,Infinity);f.payload.includes("#xywh")&&(d=f.payload.split("#xywh=")[1].split(","),
d.length===4&&e.He({height:parseInt(d[3],10),positionX:parseInt(d[0],10),positionY:parseInt(d[1],10),width:parseInt(d[2],10)}));c.push(e)}c.length&&(b=await dr(this,c[0].P()[0]));b={id:this.Md++,originalId:null,groupId:null,createSegmentIndex:()=>Promise.resolve(),segmentIndex:new Uk(c),mimeType:b||"",codecs:"",kind:"",encrypted:!1,drmInfos:[],keyIds:new Set,language:"und",originalLanguage:null,label:null,type:"image",primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],
forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,tilesLayout:"1x1",accessibilityPurpose:null,external:!0,fastSwitching:!1,fullMimeTypes:new Set([be(b||"","")]),isAudioMuxedInVideo:!1,baseOriginalId:null};this.m==jq?this.Rd.push(b):this.i.imageStreams.push(b);Cq(this);return of(b)}async Vd(a,b,c){if(this.m!=Kp&&this.m!=jq)throw new F(1,7,7004);c||=await dr(this,a);var d=this.Ia();d=d.end-d.start;this.i&&(d=this.i.presentationTimeline.getDuration());if(d==Infinity)throw new F(1,
4,4055);var e=qe(c);if(!e)throw new F(2,2,2014,c);c=await fr(this,a);e=e();d={periodStart:0,segmentStart:0,segmentEnd:d,vttOffset:0};c=C(c);d=e.parseMedia(c,d,a,[]);a=[];for(const f of d)d=new M(f.startTime,f.endTime,()=>[f.payload],0,null,null,0,0,Infinity),a.push(d);b={id:this.Md++,originalId:null,groupId:null,createSegmentIndex:()=>Promise.resolve(),segmentIndex:new Uk(a),mimeType:"text/plain",codecs:"",kind:"",encrypted:!1,drmInfos:[],keyIds:new Set,language:b,originalLanguage:b,label:null,type:G,
primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!0,fastSwitching:!1,fullMimeTypes:new Set([be("text/plain","")]),isAudioMuxedInVideo:!1,baseOriginalId:null};this.Wa.push(b);Cq(this);return nf(b)}Zi(a,b){this.sa.width=a;this.sa.height=b}Rf(a=.1){if(this.m==Kp){var b=this.l;if(b.l.g)a=!1;else if(b.C)a=!1;else{for(const c of b.h.values())!c.Oc||
c.Fa||c.ab||(c.Oc=!1,Rl(b,c,a));a=!0}}else a=!1;return a}vf(){ja("Shaka Player's internal Manifest structure is NOT covered by semantic versioning compatibility guarantees.  It may change at any time!  Please consider filing a feature request for whatever you use getManifest() for.");return this.i}Mh(){return this.ac}Hh(){const a={video:null,audio:null,text:null};if(this.m!=Kp)return a;var b=this.l.o;const c=this.l.A,d=this.h.currentTime;for(const e of[b.video,b.audio,c]){if(!e||!e.segmentIndex)continue;
b=e.segmentIndex.find(d);b=e.segmentIndex.get(b);b={codecs:b.codecs||e.codecs,mimeType:b.mimeType||e.mimeType,bandwidth:b.bandwidth||e.bandwidth};e.type=="video"?(b.width=e.width,b.height=e.height,a.video=b):e.type=="audio"?a.audio=b:e.type==G&&(a.text=b)}return a}Yg(a){this.Hd=a}disableStream(a,b){if(!this.g.abr.enabled||this.m===Iq||!navigator.onLine||b==0||!this.i)return!1;if(this.i.variants.some(c=>{const d=c[a.type];return d&&d.id!==a.id&&!c.disabledUntilTime?a.type=="audio"?a.language===d.language:
!0:!1})){let c=!1,d=!1;for(const e of this.i.variants){const f=e[a.type];f&&(f.id===a.id?(e.disabledUntilTime=Date.now()/1E3+b,c=!0):f.trickModeVideo&&f.trickModeVideo.id==a.id&&(d=!0))}if(!c&&d)return!1;this.Od.Da(1);({video:b}=this.fc());b=b.reduce((e,{start:f,end:g})=>e+g-f,0);Jq(this,!1,b,!0,!1);return!0}return!1}addFont(a,b){return Qi(a,b)}xa(){return this.h&&this.h.remote?this.h.remote.state!="disconnected":!1}sd(){return!this.h||this.h.ended?!0:this.Ha&&!this.U()&&this.h.currentTime>=this.Ia().end}};
v("shaka.Player",R);R.prototype.isEnded=R.prototype.sd;R.prototype.isRemotePlayback=R.prototype.xa;R.prototype.addFont=R.prototype.addFont;R.prototype.setVideoContainer=R.prototype.Yg;R.prototype.getFetchedPlaybackInfo=R.prototype.Hh;R.prototype.getManifestParserFactory=R.prototype.Mh;R.prototype.getManifest=R.prototype.vf;R.prototype.retryStreaming=R.prototype.Rf;R.prototype.setMaxHardwareResolution=R.prototype.Zi;R.prototype.addChaptersTrack=R.prototype.Vd;R.prototype.addThumbnailsTrack=R.prototype.Wd;
R.prototype.addTextTrackAsync=R.prototype.fd;R.prototype.getStats=R.prototype.getStats;R.prototype.getBufferedInfo=R.prototype.fc;R.prototype.getSegmentAvailabilityDuration=R.prototype.ce;R.prototype.getPresentationStartTimeAsDate=R.prototype.Cg;R.prototype.getPlayheadTimeAsDate=R.prototype.Ph;R.prototype.setTextTrackVisibility=R.prototype.Zf;R.prototype.getChaptersAsync=R.prototype.Ch;R.prototype.getChapters=R.prototype.Bh;R.prototype.getChaptersTracks=R.prototype.Dh;
R.prototype.isTextTrackVisible=R.prototype.Df;R.prototype.selectVariantsByLabel=R.prototype.Ti;R.prototype.selectTextLanguage=R.prototype.Uf;R.prototype.selectAudioLanguage=R.prototype.Rg;R.prototype.getTextLanguages=R.prototype.Vh;R.prototype.getAudioLanguages=R.prototype.xh;R.prototype.getTextLanguagesAndRoles=R.prototype.Wh;R.prototype.getAudioLanguagesAndRoles=R.prototype.yh;R.prototype.getVideoTracks=R.prototype.getVideoTracks;R.prototype.selectVideoTrack=R.prototype.Ui;
R.prototype.getAudioTracks=R.prototype.getAudioTracks;R.prototype.selectAudioTrack=R.prototype.Si;R.prototype.selectVariantTrack=R.prototype.Ee;R.prototype.selectTextTrack=R.prototype.Vf;R.prototype.getThumbnails=R.prototype.Yh;R.prototype.getAllThumbnails=R.prototype.wh;R.prototype.getImageTracks=R.prototype.Jh;R.prototype.getTextTracks=R.prototype.lc;R.prototype.getVariantTracks=R.prototype.Ub;R.prototype.cancelTrickPlay=R.prototype.gd;R.prototype.trickPlay=R.prototype.Dd;
R.prototype.useTrickPlayTrackIfAvailable=R.prototype.gg;R.prototype.getPlaybackRate=R.prototype.rb;R.prototype.isBuffering=R.prototype.Af;R.prototype.getKeyStatuses=R.prototype.ae;R.prototype.getActiveSessionsMetadata=R.prototype.uf;R.prototype.getExpiration=R.prototype.md;R.prototype.drmInfo=R.prototype.drmInfo;R.prototype.keySystem=R.prototype.keySystem;R.prototype.isFullyLoaded=R.prototype.ji;R.prototype.goToLive=R.prototype.di;R.prototype.seekRange=R.prototype.Ia;R.prototype.isVideoOnly=R.prototype.Fg;
R.prototype.isAudioOnly=R.prototype.ii;R.prototype.isInProgress=R.prototype.vc;R.prototype.isLive=R.prototype.U;R.prototype.getQueueManager=R.prototype.Dg;R.prototype.getAdManager=R.prototype.wg;R.prototype.getAssetUri=R.prototype.Kc;R.prototype.getNetworkingEngine=R.prototype.Gb;R.prototype.getMediaElement=R.prototype.be;R.prototype.getManifestType=R.prototype.zg;R.prototype.getLoadMode=R.prototype.nd;R.prototype.resetConfiguration=R.prototype.Og;R.prototype.getBufferFullness=R.prototype.xg;
R.prototype.getNonDefaultConfiguration=R.prototype.Bg;R.prototype.getConfigurationForLowLatency=R.prototype.Eh;R.prototype.getConfiguration=R.prototype.getConfiguration;R.prototype.configurationForLowLatency=R.prototype.rh;R.prototype.configure=R.prototype.configure;R.prototype.releaseAllMutexes=R.prototype.Li;R.prototype.destroyAllPreloads=R.prototype.Ye;R.prototype.preload=R.prototype.preload;R.prototype.detachAndSavePreload=R.prototype.sg;R.prototype.unloadAndSavePreload=R.prototype.bh;
R.prototype.load=R.prototype.load;R.prototype.updateStartTime=R.prototype.fj;R.prototype.unload=R.prototype.cc;R.prototype.detach=R.prototype.detach;R.prototype.attachCanvas=R.prototype.ih;R.prototype.attach=R.prototype.Db;R.probeSupport=async function(a=!0){let b={};a&&(b=await Jg());a=jc();const c=wj(),d=await Fa().u(),e={manifest:a,media:c,drm:b,hardwareResolution:d};Dp.forEach((f,g)=>{e[g]=f()});return e};
R.isBrowserSupported=function(){window.Promise||ja("A Promise implementation or polyfill is required");if(!(window.Promise&&window.Uint8Array&&Array.prototype.forEach)||(navigator.userAgent||"").includes("Trident/"))return!1;Fa();return kc()?!0:lc("application/x-mpegurl")};R.setQueueManagerFactory=function(a){jr=a};R.setAdManagerFactory=function(a){ir=a};R.registerSupportPlugin=Cp;R.prototype.destroy=R.prototype.destroy;var Iq=0,hr=1,Kp=2,jq=3;
R.LoadMode={DESTROYED:Iq,NOT_LOADED:hr,MEDIA_SOURCE:Kp,SRC_EQUALS:jq};R.version="v4.16.37";var Na;const kr=["4","16"];Na=new Ja(Number(kr[0]),Number(kr[1]));Sa=new Qa;var Dp=new Map,ir=null,jr=null;function lr(a){return a.g.length?a.g.reduce((b,c)=>b+c,0)/a.g.length:0}var mr=class{constructor(){this.g=[];this.i=this.m=this.l=this.j=this.h=0}};var S=class{constructor(a,b,c){this.g=a;this.h=b;this.m=c;this.i=!1;this.j=this.h.getVolume();this.l=new Aa;this.l.D(this.h,google.ima.AdEvent.Type.PAUSED,()=>{this.i=!0});this.l.D(this.h,google.ima.AdEvent.Type.RESUMED,()=>{this.i=!1})}needsSkipUI(){return!1}isClientRendering(){return!0}hasCustomClick(){return!0}isUsingAnotherMediaElement(){return!0}getDuration(){return this.g.getDuration()}getMinSuggestedDuration(){return this.g.getMinSuggestedDuration()}getRemainingTime(){return this.h.getRemainingTime()}isPaused(){return this.i}isSkippable(){return this.g.getSkipTimeOffset()>=
0}getTimeUntilSkippable(){var a=this.g.getSkipTimeOffset();a=this.getRemainingTime()-a;return Math.max(a,0)}canSkipNow(){return this.h.getAdSkippableState()}skip(){return this.h.skip()}pause(){return this.h.pause()}play(){return this.h.resume()}getVolume(){return this.h.getVolume()}setVolume(a){this.m.volume=a;return this.h.setVolume(a)}isMuted(){return this.h.getVolume()==0}isLinear(){return this.g.isLinear()}resize(a,b){this.h.resize(a,b)}setMuted(a){(this.m.muted=a)?(this.j=this.getVolume(),this.h.setVolume(0)):
this.h.setVolume(this.j)}getSequenceLength(){const a=this.g.getAdPodInfo();return a==null?1:a.getTotalAds()}getPositionInSequence(){const a=this.g.getAdPodInfo();return a==null?1:a.getAdPosition()}getTitle(){return this.g.getTitle()}getDescription(){return this.g.getDescription()}getVastMediaBitrate(){return this.g.getVastMediaBitrate()}getVastMediaHeight(){return this.g.getVastMediaHeight()}getVastMediaWidth(){return this.g.getVastMediaWidth()}getVastAdId(){return""}getAdId(){return this.g.getAdId()}getCreativeAdId(){return this.g.getCreativeAdId()}getAdvertiserName(){return this.g.getAdvertiserName()}getMediaUrl(){return this.g.getMediaUrl()}getTimeOffset(){const a=
this.g.getAdPodInfo();return a==null?0:a.getTimeOffset()}getPodIndex(){const a=this.g.getAdPodInfo();return a==null?0:a.getPodIndex()}release(){this.h=this.g=null}};v("shaka.ads.ClientSideAd",S);S.prototype.release=S.prototype.release;S.prototype.getPodIndex=S.prototype.getPodIndex;S.prototype.getTimeOffset=S.prototype.getTimeOffset;S.prototype.getMediaUrl=S.prototype.getMediaUrl;S.prototype.getAdvertiserName=S.prototype.getAdvertiserName;S.prototype.getCreativeAdId=S.prototype.getCreativeAdId;
S.prototype.getAdId=S.prototype.getAdId;S.prototype.getVastAdId=S.prototype.getVastAdId;S.prototype.getVastMediaWidth=S.prototype.getVastMediaWidth;S.prototype.getVastMediaHeight=S.prototype.getVastMediaHeight;S.prototype.getVastMediaBitrate=S.prototype.getVastMediaBitrate;S.prototype.getDescription=S.prototype.getDescription;S.prototype.getTitle=S.prototype.getTitle;S.prototype.getPositionInSequence=S.prototype.getPositionInSequence;S.prototype.getSequenceLength=S.prototype.getSequenceLength;
S.prototype.setMuted=S.prototype.setMuted;S.prototype.resize=S.prototype.resize;S.prototype.isLinear=S.prototype.isLinear;S.prototype.isMuted=S.prototype.isMuted;S.prototype.setVolume=S.prototype.setVolume;S.prototype.getVolume=S.prototype.getVolume;S.prototype.play=S.prototype.play;S.prototype.pause=S.prototype.pause;S.prototype.skip=S.prototype.skip;S.prototype.canSkipNow=S.prototype.canSkipNow;S.prototype.getTimeUntilSkippable=S.prototype.getTimeUntilSkippable;S.prototype.isSkippable=S.prototype.isSkippable;
S.prototype.isPaused=S.prototype.isPaused;S.prototype.getRemainingTime=S.prototype.getRemainingTime;S.prototype.getMinSuggestedDuration=S.prototype.getMinSuggestedDuration;S.prototype.getDuration=S.prototype.getDuration;S.prototype.isUsingAnotherMediaElement=S.prototype.isUsingAnotherMediaElement;S.prototype.hasCustomClick=S.prototype.hasCustomClick;S.prototype.isClientRendering=S.prototype.isClientRendering;S.prototype.needsSkipUI=S.prototype.needsSkipUI;function nr(a,b){const c=[];for(const l of Uc(a,"Ad")){a=Yc(l,"InLine");if(!a)continue;if(a=Yc(a,"Creatives"))for(const m of Uc(a,"Creative"))if((a=Yc(m,"Linear"))&&or(c,b,a),a=Yc(m,"NonLinearAds")){a=Uc(a,"NonLinear");for(const n of a)a:{a=c;var d=b;let p;var e=Yc(n,"StaticResource");if(e)p=e.attributes.creativeType;else{e=Yc(n,"HTMLResource");if(!e)break a;p="text/html"}let r=Wc(e);if(r){p==="text/html"&&(r="data:text/html;charset=UTF-8,"+encodeURIComponent(r));e=H(n,"width",fd)||H(n,"expandedWidth",
fd);var f=H(n,"height",fd)||H(n,"expandedHeight",fd);if(e||f){var g=null,h=Yc(n,"NonLinearClickThrough");h&&(h=Wc(h))&&(g=h);h=null;var k=n.attributes.minSuggestedDuration;k&&(h=zc(k));k=0;d!=null&&(k=d);a.push({id:null,groupId:null,startTime:k,endTime:null,uri:r,mimeType:p,isSkippable:!1,skipOffset:null,skipFor:null,canJump:!1,resumeOffset:0,playoutLimit:h,once:!0,pre:d==null,post:d==Infinity,timelineRange:!1,loop:!1,overlay:{viewport:{x:0,y:0},topLeft:{x:0,y:0},size:{x:e||0,y:f||0}},displayOnBackground:!1,
currentVideo:null,background:null,clickThroughUrl:g})}}}}}return c}
function or(a,b,c){let d=0;b!=null&&(d=b);let e=null;c.attributes.skipoffset&&(e=zc(c.attributes.skipoffset),isNaN(e)&&(e=null));var f=Yc(c,"MediaFiles");if(f){var g=null;(c=Yc(c,"VideoClicks"))&&(c=Yc(c,"ClickThrough"))&&(c=Wc(c))&&(g=c);f=c=Uc(f,"MediaFile");c=c.filter(h=>h.attributes.delivery=="streaming");c.length&&(f=c);f=f.sort((h,k)=>(parseInt(k.attributes.height,10)||0)-(parseInt(h.attributes.height,10)||0));for(const h of f){if(h.attributes.apiFramework)continue;if(f=Wc(h)){a.push({id:null,
groupId:null,startTime:d,endTime:null,uri:f,mimeType:h.attributes.type||null,isSkippable:e!=null,skipOffset:e,skipFor:null,canJump:!1,resumeOffset:0,playoutLimit:null,once:!0,pre:b==null,post:b==Infinity,timelineRange:!1,loop:!1,overlay:null,displayOnBackground:!1,currentVideo:null,background:null,clickThroughUrl:g});break}}}}
function pr(a){const b=[];for(const d of Uc(a,"vmap:AdBreak")){var c=d.attributes.timeOffset;if(!c)continue;a=null;c=="start"?a=null:c=="end"?a=Infinity:a=zc(c);c=Yc(d,"vmap:AdSource");if(!c)continue;c=Yc(c,"vmap:AdTagURI");if(!c)continue;(c=Vc(c))&&b.push({time:a,uri:c})}return b}var qr=class{};v("shaka.ads.Utils",qr);qr.ADS_LOADED="ads-loaded";qr.AD_STARTED="ad-started";qr.AD_FIRST_QUARTILE="ad-first-quartile";qr.AD_MIDPOINT="ad-midpoint";qr.AD_THIRD_QUARTILE="ad-third-quartile";
qr.AD_COMPLETE="ad-complete";qr.AD_STOPPED="ad-stopped";qr.AD_SKIPPED="ad-skipped";qr.AD_VOLUME_CHANGED="ad-volume-changed";qr.AD_MUTED="ad-muted";qr.AD_PAUSED="ad-paused";qr.AD_RESUMED="ad-resumed";qr.AD_SKIP_STATE_CHANGED="ad-skip-state-changed";qr.CUEPOINTS_CHANGED="ad-cue-points-changed";qr.IMA_AD_MANAGER_LOADED="ima-ad-manager-loaded";qr.IMA_STREAM_MANAGER_LOADED="ima-stream-manager-loaded";qr.AD_CLICKED="ad-clicked";qr.AD_PROGRESS="ad-progress";qr.AD_BUFFERING="ad-buffering";
qr.AD_IMPRESSION="ad-impression";qr.AD_DURATION_CHANGED="ad-duration-changed";qr.AD_CLOSED="ad-closed";qr.AD_LOADED="ad-loaded";qr.ALL_ADS_COMPLETED="all-ads-completed";qr.AD_LINEAR_CHANGED="ad-linear-changed";qr.AD_METADATA="ad-metadata";qr.AD_RECOVERABLE_ERROR="ad-recoverable-error";qr.AD_ERROR="ad-error";qr.AD_BREAK_READY="ad-break-ready";qr.AD_INTERACTION="ad-interaction";qr.AD_CONTENT_PAUSE_REQUESTED="ad-content-pause-requested";qr.AD_CONTENT_RESUME_REQUESTED="ad-content-resume-requested";
qr.AD_CONTENT_ATTACH_REQUESTED="ad-content-attach-requested";function rr(a,b){a.l(new L("ads-loaded",(new Map).set("loadTime",Date.now()/1E3-a.G)));if(a.o.customPlayheadTracker){const c={currentTime:a.i.currentTime};a.g=b.getAdsManager(c,a.B);a.i.muted?a.g.setVolume(0):a.g.setVolume(a.i.volume);a.h.D(a.i,"timeupdate",()=>{a.i.duration&&(c.currentTime=a.i.currentTime)});a.h.D(a.i,"volumechange",()=>{a.j&&(a.j.setVolume(a.i.volume),a.i.muted&&a.j.setMuted(!0))})}else a.g=b.getAdsManager(a.i,a.B);a.l(new L("ima-ad-manager-loaded",(new Map).set("imaAdManager",
a.g)));b=a.g.getCuePoints();if(b.length){const c=[];for(const d of b)c.push({start:d,end:null});a.l(new L("ad-cue-points-changed",(new Map).set("cuepoints",c)))}sr(a);try{a.g.init(a.i.offsetWidth,a.i.offsetHeight),a.h.D(a.i,"loadeddata",()=>{a.g.resize(a.i.offsetWidth,a.i.offsetHeight)}),"ResizeObserver"in window?(a.A=new ResizeObserver(()=>{a.g.resize(a.i.offsetWidth,a.i.offsetHeight)}),a.A.observe(a.i)):a.h.D(document,"fullscreenchange",()=>{a.g.resize(a.i.offsetWidth,a.i.offsetHeight)}),a.F||a.o.skipPlayDetection?
a.g.start():a.h.za(a.i,"play",()=>{a.F=!0;a.g.start()})}catch(c){tr(a,null)}}function ur(a,b){b.getError();b=(new Map).set("originalEvent",b);a.l(new L("ad-error",b));tr(a,null);a.l(new L("ad-cue-points-changed",(new Map).set("cuepoints",[])))}
function tr(a,b){b&&b.type==google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED&&!a.o.supportsMultipleMediaElements&&a.l(new L("ad-content-resume-requested"));a.l(new L("ad-stopped",(new Map).set("originalEvent",b)));a.j&&a.j.isLinear()&&(a.u.removeAttribute("ad-active"),a.o.customPlayheadTracker||a.i.ended||a.i.play())}
function sr(a){const b=(c,d)=>{c=(new Map).set("originalEvent",c);a.l(new L(d,c))};a.h.D(a.g,google.ima.AdErrorEvent.Type.AD_ERROR,c=>{ur(a,c)});a.h.D(a.g,google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,c=>{vr(a,c)});a.h.D(a.g,google.ima.AdEvent.Type.STARTED,c=>{vr(a,c)});a.h.D(a.g,google.ima.AdEvent.Type.FIRST_QUARTILE,c=>{b(c,"ad-first-quartile")});a.h.D(a.g,google.ima.AdEvent.Type.MIDPOINT,c=>{b(c,"ad-midpoint")});a.h.D(a.g,google.ima.AdEvent.Type.THIRD_QUARTILE,c=>{b(c,"ad-third-quartile")});
a.h.D(a.g,google.ima.AdEvent.Type.COMPLETE,c=>{b(c,"ad-complete")});a.h.D(a.g,google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,c=>{tr(a,c)});a.h.D(a.g,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,c=>{b(c,"all-ads-completed");tr(a,c)});a.h.D(a.g,google.ima.AdEvent.Type.SKIPPED,c=>{b(c,"ad-skipped")});a.h.D(a.g,google.ima.AdEvent.Type.VOLUME_CHANGED,c=>{b(c,"ad-volume-changed")});a.h.D(a.g,google.ima.AdEvent.Type.VOLUME_MUTED,c=>{b(c,"ad-muted")});a.h.D(a.g,google.ima.AdEvent.Type.PAUSED,c=>{a.j&&(a.j.i=
!0,b(c,"ad-paused"))});a.h.D(a.g,google.ima.AdEvent.Type.RESUMED,c=>{a.j&&(a.j.i=!1,b(c,"ad-resumed"))});a.h.D(a.g,google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED,c=>{a.j&&b(c,"ad-skip-state-changed")});a.h.D(a.g,google.ima.AdEvent.Type.CLICK,c=>{b(c,"ad-clicked")});a.h.D(a.g,google.ima.AdEvent.Type.AD_PROGRESS,c=>{b(c,"ad-progress")});a.h.D(a.g,google.ima.AdEvent.Type.AD_BUFFERING,c=>{b(c,"ad-buffering")});a.h.D(a.g,google.ima.AdEvent.Type.IMPRESSION,c=>{b(c,"ad-impression")});a.h.D(a.g,google.ima.AdEvent.Type.DURATION_CHANGE,
c=>{b(c,"ad-duration-changed")});a.h.D(a.g,google.ima.AdEvent.Type.USER_CLOSE,c=>{b(c,"ad-closed")});a.h.D(a.g,google.ima.AdEvent.Type.LOADED,c=>{b(c,"ad-loaded")});a.h.D(a.g,google.ima.AdEvent.Type.LINEAR_CHANGED,c=>{b(c,"ad-linear-changed")});a.h.D(a.g,google.ima.AdEvent.Type.AD_METADATA,c=>{b(c,"ad-metadata")});a.h.D(a.g,google.ima.AdEvent.Type.LOG,c=>{b(c,"ad-recoverable-error")});a.h.D(a.g,google.ima.AdEvent.Type.AD_BREAK_READY,c=>{b(c,"ad-break-ready")});a.h.D(a.g,google.ima.AdEvent.Type.INTERACTION,
c=>{b(c,"ad-interaction")})}
function vr(a,b){const c=b.getAd();c?(a.j=new S(c,a.g,a.i),b.type!=google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED||a.o.supportsMultipleMediaElements||a.l(new L("ad-content-pause-requested")),b=(new Map).set("ad",a.j).set("sdkAdObject",c).set("originalEvent",b),a.l(new L("ad-started",b)),a.j.isLinear()&&(a.u.setAttribute("ad-active","true"),a.o.customPlayheadTracker||a.i.pause(),a.i.muted?(b=a.j,b.j=a.i.volume,b.h.setVolume(0)):a.j.setVolume(a.i.volume))):ja("The IMA SDK fired a "+b.type+" event with no associated ad. Unable to play ad!")}
var wr=class{constructor(a,b,c,d,e){this.u=a;this.i=b;this.F=!1;this.A=this.o=null;this.G=NaN;this.l=e;this.j=null;this.h=new Aa;google.ima.settings.setLocale(c);google.ima.settings.setDisableCustomPlaybackForIOS10Plus(!0);this.C=new google.ima.AdDisplayContainer(this.u,this.i);this.C.initialize();this.m=new google.ima.AdsLoader(this.C);this.m.getSettings().setPlayerType("shaka-player");this.m.getSettings().setPlayerVersion("v4.16.37");this.g=null;this.B=d||new google.ima.AdsRenderingSettings;this.h.D(this.m,
google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,f=>{rr(this,f)});this.h.D(this.m,google.ima.AdErrorEvent.Type.AD_ERROR,f=>{ur(this,f)});this.h.D(this.i,"ended",()=>{this.m.contentComplete()});this.h.za(this.i,"play",()=>{this.F=!0})}configure(a){this.o=a}stop(){this.g&&this.g.stop();this.u&&Mi(this.u)}release(){this.stop();this.A&&this.A.disconnect();this.h&&this.h.release();this.g&&this.g.destroy();this.m.destroy();this.C.destroy()}};var T=class{constructor(a,b,c,d,e,f){this.g=a;this.h=b;this.j=(this.i=b.isSkippable)?b.skipOffset||0:b.skipOffset;this.l=b.skipFor;this.A=c;this.o=d;this.m=e;this.u=f;this.B=b.overlay}needsSkipUI(){return!0}isClientRendering(){return!0}hasCustomClick(){return this.h.clickThroughUrl!=null}isUsingAnotherMediaElement(){return this.u}getDuration(){const a=this.g.duration;return isNaN(a)?-1:a}getMinSuggestedDuration(){return this.getDuration()}getRemainingTime(){const a=this.g.duration;return isNaN(a)?
-1:a-this.g.currentTime}isPaused(){return this.g.paused}isSkippable(){return this.i&&this.l!=null?this.getDuration()-this.getRemainingTime()<this.j+this.l:this.i}getTimeUntilSkippable(){if(this.isSkippable()){const a=this.getRemainingTime()+this.j-this.getDuration();return Math.max(a,0)}return Math.max(this.getRemainingTime(),0)}canSkipNow(){return this.i&&this.getTimeUntilSkippable()==0}skip(){this.canSkipNow()&&this.A()}pause(){return this.g.pause()}play(){return this.g.play()}getVolume(){return this.g.volume}setVolume(a){this.g.volume=
a}isMuted(){return this.g.muted}isLinear(){return this.B==null}resize(){}setMuted(a){this.g.muted=a}getSequenceLength(){return this.o}getPositionInSequence(){return this.m}getTitle(){return""}getDescription(){return""}getVastMediaBitrate(){return 0}getVastMediaHeight(){return 0}getVastMediaWidth(){return 0}getVastAdId(){return""}getAdId(){return this.h.id||""}getCreativeAdId(){return""}getAdvertiserName(){return""}getMediaUrl(){return this.h.uri}getTimeOffset(){return this.h.pre?0:this.h.post?-1:
this.h.startTime}getPodIndex(){return 0}release(){this.g=null}};v("shaka.ads.InterstitialAd",T);T.prototype.release=T.prototype.release;T.prototype.getPodIndex=T.prototype.getPodIndex;T.prototype.getTimeOffset=T.prototype.getTimeOffset;T.prototype.getMediaUrl=T.prototype.getMediaUrl;T.prototype.getAdvertiserName=T.prototype.getAdvertiserName;T.prototype.getCreativeAdId=T.prototype.getCreativeAdId;T.prototype.getAdId=T.prototype.getAdId;T.prototype.getVastAdId=T.prototype.getVastAdId;
T.prototype.getVastMediaWidth=T.prototype.getVastMediaWidth;T.prototype.getVastMediaHeight=T.prototype.getVastMediaHeight;T.prototype.getVastMediaBitrate=T.prototype.getVastMediaBitrate;T.prototype.getDescription=T.prototype.getDescription;T.prototype.getTitle=T.prototype.getTitle;T.prototype.getPositionInSequence=T.prototype.getPositionInSequence;T.prototype.getSequenceLength=T.prototype.getSequenceLength;T.prototype.setMuted=T.prototype.setMuted;T.prototype.resize=T.prototype.resize;
T.prototype.isLinear=T.prototype.isLinear;T.prototype.isMuted=T.prototype.isMuted;T.prototype.setVolume=T.prototype.setVolume;T.prototype.getVolume=T.prototype.getVolume;T.prototype.play=T.prototype.play;T.prototype.pause=T.prototype.pause;T.prototype.skip=T.prototype.skip;T.prototype.canSkipNow=T.prototype.canSkipNow;T.prototype.getTimeUntilSkippable=T.prototype.getTimeUntilSkippable;T.prototype.isSkippable=T.prototype.isSkippable;T.prototype.isPaused=T.prototype.isPaused;
T.prototype.getRemainingTime=T.prototype.getRemainingTime;T.prototype.getMinSuggestedDuration=T.prototype.getMinSuggestedDuration;T.prototype.getDuration=T.prototype.getDuration;T.prototype.isUsingAnotherMediaElement=T.prototype.isUsingAnotherMediaElement;T.prototype.hasCustomClick=T.prototype.hasCustomClick;T.prototype.isClientRendering=T.prototype.isClientRendering;T.prototype.needsSkipUI=T.prototype.needsSkipUI;var U=class{constructor(a,b,c){this.g=a;this.j=b;this.h=c;this.i=a.overlay==null}needsSkipUI(){return!0}isClientRendering(){return!0}hasCustomClick(){return this.g.clickThroughUrl!=null}isUsingAnotherMediaElement(){return!1}getDuration(){return-1}getMinSuggestedDuration(){return this.getDuration()}getRemainingTime(){return-1}isPaused(){return!1}isSkippable(){return!1}getTimeUntilSkippable(){return 0}canSkipNow(){return!1}skip(){}pause(){}play(){}getVolume(){return 1}setVolume(){}isMuted(){return!1}isLinear(){return this.i}resize(){}setMuted(){}getSequenceLength(){return this.j}getPositionInSequence(){return this.h}getTitle(){return""}getDescription(){return""}getVastMediaBitrate(){return 0}getVastMediaHeight(){return 0}getVastMediaWidth(){return 0}getVastAdId(){return""}getAdId(){return this.g.id||
""}getCreativeAdId(){return""}getAdvertiserName(){return""}getMediaUrl(){return this.g.uri}getTimeOffset(){return this.g.pre?0:this.g.post?-1:this.g.startTime}getPodIndex(){return 0}release(){}};v("shaka.ads.InterstitialStaticAd",U);U.prototype.release=U.prototype.release;U.prototype.getPodIndex=U.prototype.getPodIndex;U.prototype.getTimeOffset=U.prototype.getTimeOffset;U.prototype.getMediaUrl=U.prototype.getMediaUrl;U.prototype.getAdvertiserName=U.prototype.getAdvertiserName;
U.prototype.getCreativeAdId=U.prototype.getCreativeAdId;U.prototype.getAdId=U.prototype.getAdId;U.prototype.getVastAdId=U.prototype.getVastAdId;U.prototype.getVastMediaWidth=U.prototype.getVastMediaWidth;U.prototype.getVastMediaHeight=U.prototype.getVastMediaHeight;U.prototype.getVastMediaBitrate=U.prototype.getVastMediaBitrate;U.prototype.getDescription=U.prototype.getDescription;U.prototype.getTitle=U.prototype.getTitle;U.prototype.getPositionInSequence=U.prototype.getPositionInSequence;
U.prototype.getSequenceLength=U.prototype.getSequenceLength;U.prototype.setMuted=U.prototype.setMuted;U.prototype.resize=U.prototype.resize;U.prototype.isLinear=U.prototype.isLinear;U.prototype.isMuted=U.prototype.isMuted;U.prototype.setVolume=U.prototype.setVolume;U.prototype.getVolume=U.prototype.getVolume;U.prototype.play=U.prototype.play;U.prototype.pause=U.prototype.pause;U.prototype.skip=U.prototype.skip;U.prototype.canSkipNow=U.prototype.canSkipNow;U.prototype.getTimeUntilSkippable=U.prototype.getTimeUntilSkippable;
U.prototype.isSkippable=U.prototype.isSkippable;U.prototype.isPaused=U.prototype.isPaused;U.prototype.getRemainingTime=U.prototype.getRemainingTime;U.prototype.getMinSuggestedDuration=U.prototype.getMinSuggestedDuration;U.prototype.getDuration=U.prototype.getDuration;U.prototype.isUsingAnotherMediaElement=U.prototype.isUsingAnotherMediaElement;U.prototype.hasCustomClick=U.prototype.hasCustomClick;U.prototype.isClientRendering=U.prototype.isClientRendering;U.prototype.needsSkipUI=U.prototype.needsSkipUI;function xr(a){a.i.configure(a.B.Bg());a.i.configure("ads.disableHLSInterstitial",!0);a.i.configure("ads.disableDASHInterstitial",!0);a.i.configure("playRangeEnd",Infinity);bg(a.B.Gb(),a.i.Gb())}
function yr(a,b=!1,c=null){let d=0,e=null;if(a.G.size&&a.l!=null){const h=a.g.ended;var f=Array.from(a.G).sort((k,l)=>l.startTime-k.startTime),g=f;g=b?f.filter(k=>k.pre):h?f.filter(k=>k.post):f.filter(k=>!k.pre&&!k.post);for(const k of g){f=!1;if(b)f=k.pre;else if(h)f=k.post;else if(!k.pre&&!k.post){g=a.l-Math.round(k.startTime*1E3)/1E3;let l=1;a.K.allowStartInMiddleOfInterstitial&&k.endTime&&k.endTime!=Infinity&&(l=k.endTime-k.startTime);(g>0||g==0&&a.l==0)&&(g<=l||!k.canJump)&&(f=c==null&&a.A&&
!a.A.pre&&!a.A.post&&a.A.startTime>=k.startTime?!1:!0)}f&&(!a.A||k.startTime>=a.A.startTime)&&(d==(c||0)?e=k:e&&!k.canJump&&Math.round(k.startTime*1E3)/1E3-Math.round(e.startTime*1E3)/1E3>.001&&(e=k,d=0),d++)}}return e}
function zr(a,b,c,d,e,f=0){a.A=b;Ar(a);a.u||!a.m||a.h.parentElement||a.m.appendChild(a.h);d==1&&c==1&&(c=Array.from(a.G).filter(g=>b.pre?g.pre==b.pre:b.post?g.post==b.post:Math.abs(g.startTime-b.startTime)<.001).length);b.once&&(f++,a.G.delete(b),Br(a),b.overlay||Cr(a));b.mimeType&&(b.mimeType.startsWith("image/")||b.mimeType==="text/html")?b.overlay?Dr(a,b,c,d,f):ja("Unsupported interstitial",b):a.u&&b.overlay?ja("Unsupported interstitial",b):Er(a,b,c,d,e,f)}
function Fr(a,b){if(a.J.has(b)){var c=a.J.get(b);for(const d of c)d.parentNode.removeChild(d);a.J.delete(b)}}function Br(a){a.Y&&!a.G.size&&(a.H.Ja(a.g,"playing",a.S),a.H.Ja(a.g,"timeupdate",a.S),a.H.Ja(a.g,"seeked",a.ha),a.H.Ja(a.g,"ended",a.T),a.N!=-1&&(a.g.cancelVideoFrameCallback(a.N),a.N=-1),a.O&&a.O.stop(),a.M&&a.M.stop(),a.Y=!1)}function Gr(a){return(a=a.mimeType)?!a.startsWith("image/")&&a!=="text/html":!0}
function Hr(a,b){if(!(a.J.has(b)||a.K&&!a.K.allowPreloadOnDomElements)){var c=e=>{const f=document.createElement("link");f.rel="preload";f.href=e;f.as="image";document.head.appendChild(f);return f},d=[];if(b.background){const e=b.background.match(/url\(('|")?([^'"()]+)('|")\)?/);e&&d.push(c(e[2]))}b.mimeType&&b.mimeType.startsWith("image/")&&d.push(c(b.uri));a.J.set(b,d)}}
function Cr(a){const b=[];for(const c of a.G){if(c.overlay)continue;const d={start:c.startTime,end:null};c.pre?(d.start=0,d.end=null):c.post?(d.start=-1,d.end=null):c.timelineRange&&(d.end=c.endTime);b.find(e=>d.start==e.start&&d.end==e.end)||b.push(d)}Ir(a,"ad-cue-points-changed",(new Map).set("cuepoints",b))}
function Ar(a){if(a.m&&a.K){var b=a.K.supportsMultipleMediaElements,c=a.g;c.controls?b=!1:c.webkitPresentationMode&&c.webkitPresentationMode!=="inline"?b=!1:c.webkitDisplayingFullscreen&&(b=!1);a.u==b&&(a.u=!b,a.u?(a.h=a.g,a.F&&(a.F.parentElement&&a.m.removeChild(a.F),a.F=null)):(a.F||(b=document.createElement(a.g.tagName),b.autoplay=!0,b.style.position="absolute",b.style.top="0",b.style.left="0",b.style.width="100%",b.style.height="100%",b.style.display="none",b.setAttribute("playsinline",""),a.F=
b),a.h=a.F))}else a.u=!0}function Jr(){const a=Fa().i();return a=="TV"||a=="CONSOLE"||a=="CAST"?!0:!1}function Kr(a){if(!a.Y&&a.G.size){a.H.D(a.g,"playing",a.S);a.H.D(a.g,"timeupdate",a.S);a.H.D(a.g,"seeked",a.ha);a.H.D(a.g,"ended",a.T);if("requestVideoFrameCallback"in a.g&&!Jr()){const b=a.g,c=()=>{a.N!=-1&&(a.T(),a.N!=-1&&(a.N=b.requestVideoFrameCallback(c)))};a.N=b.requestVideoFrameCallback(c)}else a.O.Da(.025);a.M&&a.M.Da(1);a.Y=!0}}
function Lr(a,b){if(!b||b.displayOnBackground)a.g.style.zIndex="";b&&b.currentVideo==null||(a.g.style.transformOrigin="",a.g.style.transition="",a.g.style.transform="");a.m&&(a.m.removeAttribute("ad-active"),a.m.style.pointerEvents="",!b||b.background)&&(a.m.style.background="");a.F&&(a.F.style.background="")}
function Mr(a){const b=[];if(!a)return b;var c=a.values.find(u=>u.key=="X-ASSET-URI");if(!c)return b;c=c.data;if(!c)return b;let d=null;var e=a.values.find(u=>u.key=="X-OVERLAY-ID");e&&(d=e.data);e=d==null?Math.floor(a.startTime*10)/10:a.startTime;let f=a.endTime;a.endTime&&a.endTime!=Infinity&&typeof a.endTime=="number"&&(f=d==null?Math.floor(a.endTime*10)/10:a.endTime);let g=!1,h=!1;var k=!1,l=a.values.find(u=>u.key=="CUE");l&&(k=l.data,g=k.includes("ONCE"),h=k.includes("PRE"),k=k.includes("POST"));
l=null;var m=a.values.find(u=>u.key=="X-ASSET-MIMETYPE");m&&(l=m.data);m=!1;var n=a.values.find(u=>u.key=="X-LOOP");n&&(m=n.data=="YES");n=1;var p=a.values.find(u=>u.key=="X-DEPTH");p&&(n=parseFloat(p.data),isNaN(n)&&(n=1));p=null;var r=a.values.find(u=>u.key=="X-BACKGROUND");r&&(p=r.data);r=1920;var q=1080,t=a.values.find(u=>u.key=="X-VIEWPORT");if(t){q=t.data.split("x");if(q.length!=2)return b;r=parseFloat(q[0]);q=parseFloat(q[1])}r={viewport:{x:r,y:q},topLeft:{x:0,y:0},size:{x:r,y:q}};if(q=a.values.find(u=>
u.key=="X-OVERLAY-POSITION")){q=q.data.split("x");if(q.length!=2)return b;r.topLeft.x=parseFloat(q[0]);r.topLeft.y=parseFloat(q[1])}if(q=a.values.find(u=>u.key=="X-OVERLAY-SIZE")){q=q.data.split("x");if(q.length!=2)return b;r.size.x=parseFloat(q[0]);r.size.y=parseFloat(q[1])}q=null;if(t=a.values.find(u=>u.key=="X-SQUEEZECURRENT"))if(q=parseFloat(t.data),isNaN(q)&&(q=1),q={viewport:{x:1920,y:1080},topLeft:{x:0,y:0},size:{x:1920*q,y:1080*q}},a=a.values.find(u=>u.key=="X-SQUEEZECURRENT-POSITION")){a=
a.data.split("x");if(a.length!=2)return b;q.topLeft.x=parseFloat(a[0]);q.topLeft.y=parseFloat(a[1])}b.push({id:d,groupId:null,startTime:e,endTime:f,uri:c,mimeType:l,isSkippable:!1,skipOffset:null,skipFor:null,canJump:!0,resumeOffset:null,playoutLimit:null,once:g,pre:h,post:k,timelineRange:!0,loop:m,overlay:r,displayOnBackground:n==-1,currentVideo:q,background:p,clickThroughUrl:null});return b}
async function Nr(a,b){const c=[];if(!b)return c;var d=b.values.find(z=>z.key=="X-ASSET-URI");const e=b.values.find(z=>z.key=="X-ASSET-LIST");if(!d&&!e)return c;let f=null;var g=b.values.find(z=>z.key=="ID");g&&(f=g.data);g=f==null?Math.floor(b.startTime*10)/10:b.startTime;let h=b.endTime;b.endTime&&b.endTime!=Infinity&&typeof b.endTime=="number"&&(h=f==null?Math.floor(b.endTime*10)/10:b.endTime);var k=b.values.find(z=>z.key=="X-RESTRICT");let l=!0;var m=!0;k&&k.data&&(m=k.data,l=!m.includes("SKIP"),
m=!m.includes("JUMP"));k=l?0:null;var n=b.values.find(z=>z.key=="X-ENABLE-SKIP-AFTER");n&&(k=parseFloat(n.data),isNaN(k)&&(k=l?0:null));n=null;var p=b.values.find(z=>z.key=="X-ENABLE-SKIP-FOR");p&&(n=parseFloat(p.data),isNaN(k)&&(n=null));p=null;const r=b.values.find(z=>z.key=="X-RESUME-OFFSET");r&&(p=parseFloat(r.data),isNaN(p)&&(p=null));let q=null;var t=b.values.find(z=>z.key=="X-PLAYOUT-LIMIT");t&&(q=parseFloat(t.data),isNaN(q)&&(q=null));let u=t=!1;var x=!1,y=b.values.find(z=>z.key=="CUE");y&&
(x=y.data,t=x.includes("ONCE"),u=x.includes("PRE"),x=x.includes("POST"));y=!1;(b=b.values.find(z=>z.key=="X-TIMELINE-OCCUPIES"))?y=b.data.includes("RANGE"):!r&&a.B.U()&&(y=!u&&!x);if(d){var w=d.data;if(!w)return c;c.push({id:f,groupId:null,startTime:g,endTime:h,uri:w,mimeType:null,isSkippable:l,skipOffset:k,skipFor:n,canJump:m,resumeOffset:p,playoutLimit:q,once:t,pre:u,post:x,timelineRange:y,loop:!1,overlay:null,displayOnBackground:!1,currentVideo:null,background:null,clickThroughUrl:null})}else if(e){d=
e.data;if(!d)return c;try{const z=await Or(a,d,{type:11}),A=Eb(z);w=JSON.parse(A);const B=w["SKIP-CONTROL"];if(B){const D=B["ENABLE-SKIP-AFTER"];typeof D=="number"&&(k=parseFloat(D),isNaN(D)&&(k=l?0:null));const E=B["ENABLE-SKIP-FOR"];typeof E=="number"&&(n=parseFloat(E),isNaN(E)&&(n=null))}for(a=0;a<w.ASSETS.length;a++){const D=w.ASSETS[a];D.URI&&c.push({id:f+"_shaka_asset_"+a,groupId:f,startTime:g,endTime:h,uri:D.URI,mimeType:null,isSkippable:l,skipOffset:k,skipFor:n,canJump:m,resumeOffset:p,playoutLimit:q,
once:t,pre:u,post:x,timelineRange:y,loop:!1,overlay:null,displayOnBackground:!1,currentVideo:null,background:null,clickThroughUrl:null})}}catch(z){}}return c}
async function Pr(a,b){let c=!1;for(const d of b){if(!d.uri){ja("Missing URL in interstitial",d);continue}if(!d.mimeType)try{d.mimeType=await Cl(d.uri,a.i.Gb(),a.B.getConfiguration().streaming.retryParameters)}catch(e){}b=d.id||JSON.stringify(d);if(a.R.has(b))continue;d.loop&&!d.overlay&&ja("Loop is only supported in overlay interstitials",d);d.overlay||(c=!0);a.R.add(b);a.G.add(d);b=!1;if(d.pre&&a.l==null)b=!0;else if(d.startTime==0&&!d.canJump)b=!0;else if(a.l!=null){const e=d.startTime-a.l;e>0&&
e<=10&&(b=!0)}b&&(!a.C.has(d)&&Gr(d)&&a.C.set(d,a.i.preload(d.uri,null,d.mimeType||void 0)),Hr(a,d))}c&&Cr(a);Kr(a)}async function Qr(a,b){var c=null;const d=b.values.find(e=>e.key=="ID");d&&(c=d.data);if(c){if(a.ea.has(c))return;a.ea.add(c)}xr(a);c=[];c=b&&b.values.find(e=>e.key=="X-OVERLAY-ID")?Mr(b):await Nr(a,b);c.length?Pr(a,c):ja("Unsupported HLS interstitial",b)}
function Rr(a,b){var c=Yc(b.eventNode,"OverlayEvent");const d=c.attributes.uri,e=c.attributes.mimeType,f=c.attributes.loop=="true",g=H(c,"z",fd);if(d&&g!=0){var h=null,k=Yc(c,"Background");if(k){var l=k.attributes.uri;l?h=`center / contain no-repeat url('${l}')`:h=Wc(k)}k=1920;l=1080;var m=Yc(c,"Viewport");if(m){k=H(m,"x",fd);if(k==null)return;l=H(m,"y",fd);if(l==null)return}var n={viewport:{x:k,y:l},topLeft:{x:0,y:0},size:{x:k,y:l}},p=Yc(c,"Overlay");if(m&&p){var r=Yc(p,"TopLeft"),q=Yc(p,"Size");
if(r&&q){p=H(r,"x",fd);if(p==null)return;r=H(r,"y",fd);if(r==null)return;const t=H(q,"x",fd);if(t==null)return;q=H(q,"y",fd);if(q==null)return;n.topLeft.x=p;n.topLeft.y=r;n.size.x=t;n.size.y=q}}p=null;c=Yc(c,"Squeeze");if(m&&c&&(q=Yc(c,"TopLeft"),c=Yc(c,"Size"),q&&c)){m=H(q,"x",fd);if(m==null)return;p=H(q,"y",fd);if(p==null)return;q=H(c,"x",fd);if(q==null)return;c=H(c,"y",fd);if(c==null)return;p={viewport:{x:k,y:l},topLeft:{x:m,y:p},size:{x:q,y:c}}}Pr(a,[{id:b.id,groupId:null,startTime:b.startTime,
endTime:b.endTime,uri:d,mimeType:e,isSkippable:!1,skipOffset:null,skipFor:null,canJump:!0,resumeOffset:null,playoutLimit:null,once:!1,pre:!1,post:!1,timelineRange:!0,loop:f,overlay:n,displayOnBackground:g==-1,currentVideo:p,background:h,clickThroughUrl:null}])}}async function Or(a,b,c){return(await a.B.Gb().request(7,ag([b],Hf()),c).promise).data}
function Dr(a,b,c,d,e){a.I=!0;var f=b.overlay;const g=b.mimeType=="text/html"?"iframe":"img",h=document.createElement(g);h.style.objectFit="contain";h.style.position="absolute";h.style.border="none";Sr(a,b);const k=()=>{a.o&&(a.o.stop(),a.o=null);a.m.removeChild(h);Lr(a,b);Ir(a,"ad-stopped");a.j.La();const p=yr(a,b.pre,d-e);p?zr(a,p,c,++d,Date.now(),e):a.I=!1};var l=new U(b,c,d);Ir(a,"ad-impression");Ir(a,"ad-started",(new Map).set("ad",l));g=="iframe"?h.src=b.uri:(h.src=b.uri,h.onerror=p=>{Ir(a,
"ad-error",(new Map).set("originalEvent",p));k()});l=f.viewport;const m=f.topLeft;f=f.size;l.x==0&&l.y==0?(h.width=b.overlay.size.x,h.height=b.overlay.size.y,h.style.bottom="10%",h.style.left="0",h.style.right="0",h.style.width="100%",b.overlay.size.y||g!="iframe"||(h.style.height="auto")):(h.style.height=f.y/l.y*100+"%",h.style.left=m.x/l.x*100+"%",h.style.top=m.y/l.y*100+"%",h.style.width=f.x/l.x*100+"%");a.m.appendChild(h);const n=Date.now();a.o&&a.o.stop();a.o=new Ce(()=>{b.playoutLimit&&(Date.now()-
n)/1E3>b.playoutLimit?(Ir(a,"ad-complete"),k()):b.endTime&&a.g.currentTime>b.endTime?(Ir(a,"ad-complete"),k()):a.g.currentTime<b.startTime&&(Ir(a,"ad-skipped"),k())});b.playoutLimit&&!b.endTime?a.o.ma(b.playoutLimit):b.endTime&&a.o.Da(.025);a.j.D(a.g,"seeked",()=>{const p=a.g.currentTime;if(p<b.startTime||b.endTime&&p>b.endTime)a.o&&a.o.stop(),Ir(a,"ad-skipped"),k()});b.clickThroughUrl&&a.j.D(h,"click",()=>{b.clickThroughUrl&&window.open(b.clickThroughUrl,"_blank")})}
async function Er(a,b,c,d,e,f){var g=Date.now();a.I=!0;let h=!1;const k=()=>{if(!a.u&&!b.overlay&&b.resumeOffset==null)if(b.timelineRange&&b.endTime&&b.endTime!=Infinity)a.g.currentTime!=b.endTime&&(a.g.currentTime=b.endTime);else{const t=Date.now();a.g.currentTime+=(t-e)/1E3;e=t}},l=async t=>{k();let u=yr(a,b.pre,d-f);if(t&&b.groupId)for(;u&&u.groupId==b.groupId;)d++,u=yr(a,b.pre,d-f);a.o&&(!b.groupId||u&&u.groupId!=b.groupId)&&(a.o.stop(),a.o=null);Lr(a,b);if(!u||u.overlay)b.post&&(a.l=null,a.A=
null),a.u?await a.i.detach():await a.i.cc(),a.u&&(t=b.resumeOffset,t==null&&(t=b.timelineRange&&b.endTime&&b.endTime!=Infinity?b.endTime-(a.l||0):(Date.now()-e)/1E3),Ir(a,"ad-content-resume-requested",(new Map).set("offset",t))),Ir(a,"ad-stopped"),a.j.La(),a.I=!1,a.u?Cr(a):(a.h.style.display="none",k(),a.g.ended||a.g.play());Ar(a);u&&(Ir(a,"ad-stopped"),a.j.La(),zr(a,u,c,++d,e,f))},m=async t=>{h||(h=!0,Ir(a,"ad-error",(new Map).set("originalEvent",t)),await l(!1))},n=async()=>{h||(h=!0,await l(!1),
Ir(a,"ad-complete"))};a.W=async()=>{h||(h=!0,Ir(a,"ad-skipped"),await l(!0))};const p=new T(a.h,b,a.W,c,d,!a.u);a.u||(p.setMuted(a.g.muted),p.setVolume(a.g.volume));Ir(a,"ad-started",(new Map).set("ad",p));let r=p.canSkipNow();r&&Ir(a,"ad-skip-state-changed");a.j.za(a.i,"error",m);a.j.D(a.h,"timeupdate",()=>{if(a.h.duration){var t=p.canSkipNow();r!=t&&p.getRemainingTime()>0&&p.getDuration()>0&&Ir(a,"ad-skip-state-changed");r=t;!a.u&&!b.overlay&&b.resumeOffset==null&&b.timelineRange&&b.endTime&&b.endTime!=
Infinity&&a.g.currentTime!=b.endTime&&a.B.Ia().end>=b.endTime&&(a.g.currentTime=b.endTime)}});a.j.za(a.i,"firstquartile",()=>{k();Ir(a,"ad-first-quartile")});a.j.za(a.i,"midpoint",()=>{k();Ir(a,"ad-midpoint")});a.j.za(a.i,"thirdquartile",()=>{k();Ir(a,"ad-third-quartile")});a.j.za(a.i,"complete",n);a.j.D(a.h,"play",()=>{Ir(a,"ad-resumed")});a.j.D(a.h,"pause",()=>{const t=a.i.getConfiguration();a.h.currentTime>=t.playRangeEnd?n():Ir(a,"ad-paused")});a.j.D(a.h,"volumechange",()=>{a.h.muted?Ir(a,"ad-muted"):
Ir(a,"ad-volume-changed");a.u||(a.g.volume=a.h.volume,a.g.muted=a.h.muted)});b.clickThroughUrl&&a.j.D(a.m||a.h,"click",()=>{b.clickThroughUrl&&(p.isPaused()||p.pause(),window.open(b.clickThroughUrl,"_blank"))});if(a.u&&d==1){Ir(a,"ad-content-pause-requested",(new Map).set("saveLivePosition",!0));const t=new Lf,u=async x=>{x.state=="detach"&&(Jr()&&await new Promise(y=>(new Ce(y)).ma(.1)),t.resolve(),a.j.Ja(a.B,"onstatechange",u))};a.j.D(a.B,"onstatechange",u);await t}Sr(a,b);if(!a.u)if(a.h.style.display=
"",b.overlay){a.h.loop=b.loop;var q=b.overlay.viewport;const t=b.overlay.topLeft,u=b.overlay.size;a.h.style.height=u.y/q.y*100+"%";a.h.style.left=t.x/q.x*100+"%";a.h.style.top=t.y/q.y*100+"%";a.h.style.width=u.x/q.x*100+"%"}else a.g.pause(),b.resumeOffset!=null&&b.resumeOffset!=0&&(a.g.currentTime+=b.resumeOffset),a.h.loop=!1,a.h.style.height="100%",a.h.style.left="0",a.h.style.top="0",a.h.style.width="100%";try{xr(a);if(b.startTime&&b.endTime&&b.endTime!=Infinity&&b.startTime!=b.endTime){const t=
b.endTime-b.startTime;t>0&&a.i.configure("playRangeEnd",t)}b.playoutLimit&&!a.o&&(a.o=(new Ce(()=>{a.W()})).ma(b.playoutLimit),a.i.configure("playRangeEnd",b.playoutLimit));await a.i.Db(a.h);q=null;if(!b.pre&&!b.post&&a.K.allowStartInMiddleOfInterstitial&&a.l!=null){const t=a.l-b.startTime;Math.abs(t)>.25&&(q=t)}if(a.C.has(b)){const t=await a.C.get(b);a.C.delete(b);t?await a.i.load(t):await a.i.load(b.uri,q,b.mimeType||void 0)}else await a.i.load(b.uri,q,b.mimeType||void 0);b.overlay&&a.g.paused?
a.h.pause():a.h.play();Ir(a,"ads-loaded",(new Map).set("loadTime",(Date.now()-g)/1E3));a.u&&a.g.play();b.overlay&&(b.pre||b.post||a.B.U()&&!(b.startTime>0)||(g=()=>{const t=a.g.currentTime-b.startTime;Math.abs(t-a.h.currentTime)>.1&&(a.h.currentTime=t)},a.j.za(a.h,"playing",g),a.j.D(a.g,"seeking",g)),a.j.D(a.g,"seeked",()=>{const t=a.g.currentTime;(t<b.startTime||b.endTime&&t>b.endTime)&&a.W()}))}catch(t){a.I&&m(t)}}
function Sr(a,b){b.displayOnBackground&&(a.g.style.zIndex="1");if(b.currentVideo!=null){var c=b.currentVideo;a.g.style.transformOrigin="top left";let e=!0;const f=[];var d=c.topLeft.x/c.viewport.x*100;d>0&&d<=100&&(f.push(`translateX(${d}%)`),e=!1);d=c.topLeft.y/c.viewport.y*100;d>0&&d<=100&&(f.push(`translateY(${d}%)`),e=!1);d=c.size.x/c.viewport.x;d<1&&f.push(`scaleX(${d})`);c=c.size.y/c.viewport.y;d<1&&f.push(`scaleY(${c})`);f.length&&(a.g.style.transform=f.join(" "));e&&(a.g.style.transition=
"transform 250ms")}a.m&&(b.clickThroughUrl?(a.m.setAttribute("ad-active","true"),a.m.style.pointerEvents=""):a.m.style.pointerEvents="none",b.background&&(a.m.style.background=b.background));a.F&&(a.F.style.background=b.overlay?"":"rgb(0, 0, 0)")}function Ir(a,b,c){a.qa(new L(b,c))}
var Tr=class{constructor(a,b,c,d){this.K=null;this.m=a;this.B=b;this.g=c;this.F=null;this.u=!0;this.h=this.g;this.qa=d;this.ea=new Set;this.R=new Set;this.G=new Set;this.C=new Map;this.J=new Map;this.i=new R;xr(this);this.H=new Aa;this.j=new Aa;this.I=!1;this.W=this.o=this.A=this.l=null;this.Y=!1;this.N=-1;const e=f=>f?f.overlay?!0:this.g.ended?f.post:this.g.paused?!1:!0:!1;this.T=()=>{if(!this.I&&this.l&&!this.B.xa()){this.l=this.g.currentTime;var f=yr(this);f&&e(f)&&zr(this,f,1,1,Date.now())}};
this.S=()=>{if(!(this.I||this.l||this.B.xa())){this.g.paused||(this.l=this.g.currentTime);var f;this.A||(f=yr(this,!0));f||=yr(this);f&&e(f)&&zr(this,f,1,1,Date.now())}};this.ha=()=>{if(!this.I&&this.l&&!this.B.xa()){var f=this.g.currentTime;this.A&&!this.A.pre&&!this.A.post&&f<(this.A.endTime||this.A.startTime)&&(this.A=null)}};this.O=new Ce(this.T);this.M=new Ce(async()=>{if(this.G.size&&this.l!=null){var f=this.B.nd();if(f!=Iq&&f!=hr){f=!1;var g=Array.from(this.G),h=this.B.Ia();for(const k of g)k!=
this.A&&(h.start-(k.endTime||k.startTime)>=1?(this.C.has(k)&&((g=await this.C.get(k))&&g.destroy(),this.C.delete(k)),Fr(this,k),g=k.id||JSON.stringify(k),this.R.has(g)&&this.R.delete(g),this.G.delete(k),Br(this),k.overlay||(f=!0)):(g=k.startTime-this.l,g>0&&g<=10&&(!this.C.has(k)&&Gr(k)&&this.C.set(k,this.i.preload(k.uri,null,k.mimeType||void 0)),Hr(this,k))));f&&Cr(this)}}});this.configure(this.B.getConfiguration().ads)}configure(a){this.K=a;this.I||Ar(this)}stop(){this.j&&this.j.La();this.ea.clear();
this.R.clear();this.G.clear();this.i.Ye();if(this.C.size){var a=Array.from(this.C.values());for(const b of a)b&&b.then(c=>{c&&c.destroy()})}this.C.clear();if(this.J.size){a=Array.from(this.J.keys());for(const b of a)Fr(this,b)}this.J.clear();this.i.detach();this.I=!1;this.A=this.l=null;this.u=!0;this.h=this.g;this.F=null;Lr(this);Br(this);this.m&&Mi(this.m);this.o&&(this.o.stop(),this.o=null)}release(){this.stop();this.H&&this.H.release();this.j&&this.j.release();this.O&&(this.O.stop(),this.O=null);
this.M&&(this.M.stop(),this.M=null);this.i.destroy()}Mc(){return this.i}async addAdUrlInterstitial(a){const b={type:12};a=await Or(this,a,b);a=Kc(a,"VAST,vmap:VMAP");if(!a)throw new F(2,10,10007);let c=[];if(a.tagName=="VAST")c=nr(a,this.l);else if(a.tagName=="vmap:VMAP"){const d=async f=>{var g=await Or(this,f.uri,b);g=Kc(g,"VAST");if(!g)throw new F(2,10,10007);c.push(...nr(g,f.time))},e=[];for(const f of pr(a))e.push(d(f));e.length&&await Promise.all(e)}Pr(this,c)}};var V=class{constructor(a,b,c,d,e){this.h=a;this.j=zc(this.h.skipOffset);this.g=e;this.i=b;this.l=c;this.o=d;this.m=!1}needsSkipUI(){return!0}isClientRendering(){return!1}hasCustomClick(){return!1}isUsingAnotherMediaElement(){return!1}getDuration(){return this.h.durationInSeconds}getMinSuggestedDuration(){return this.getDuration()}getRemainingTime(){return this.h.startTimeInSeconds+this.h.durationInSeconds-this.g.currentTime}isPaused(){return this.g.paused}isSkippable(){return typeof this.j=="number"?
!0:!1}getTimeUntilSkippable(){if(typeof this.j!="number")return this.getRemainingTime();const a=this.getRemainingTime()+this.j-this.getDuration();return Math.max(a,0)}canSkipNow(){return this.getTimeUntilSkippable()==0}skip(){this.m=!0;this.g.currentTime+=this.getRemainingTime()}pause(){return this.g.pause()}play(){return this.g.play()}getVolume(){return this.g.volume}setVolume(a){this.g.volume=a}isMuted(){return this.g.muted}isLinear(){return this.o}resize(){}setMuted(a){this.g.muted=a}getSequenceLength(){return this.l?
this.l:1}getPositionInSequence(){return this.i?this.i:1}getTitle(){return this.h.adTitle}getDescription(){return""}getVastMediaBitrate(){return 0}getVastMediaHeight(){return 0}getVastMediaWidth(){return 0}getVastAdId(){return this.h.vastAdId||""}getAdId(){return this.h.adId}getCreativeAdId(){return this.h.creativeId}getAdvertiserName(){return""}getMediaUrl(){return null}getTimeOffset(){return 0}getPodIndex(){return 0}release(){this.l=this.i=this.g=this.h=null}};v("shaka.ads.MediaTailorAd",V);
V.prototype.release=V.prototype.release;V.prototype.getPodIndex=V.prototype.getPodIndex;V.prototype.getTimeOffset=V.prototype.getTimeOffset;V.prototype.getMediaUrl=V.prototype.getMediaUrl;V.prototype.getAdvertiserName=V.prototype.getAdvertiserName;V.prototype.getCreativeAdId=V.prototype.getCreativeAdId;V.prototype.getAdId=V.prototype.getAdId;V.prototype.getVastAdId=V.prototype.getVastAdId;V.prototype.getVastMediaWidth=V.prototype.getVastMediaWidth;V.prototype.getVastMediaHeight=V.prototype.getVastMediaHeight;
V.prototype.getVastMediaBitrate=V.prototype.getVastMediaBitrate;V.prototype.getDescription=V.prototype.getDescription;V.prototype.getTitle=V.prototype.getTitle;V.prototype.getPositionInSequence=V.prototype.getPositionInSequence;V.prototype.getSequenceLength=V.prototype.getSequenceLength;V.prototype.setMuted=V.prototype.setMuted;V.prototype.resize=V.prototype.resize;V.prototype.isLinear=V.prototype.isLinear;V.prototype.isMuted=V.prototype.isMuted;V.prototype.setVolume=V.prototype.setVolume;
V.prototype.getVolume=V.prototype.getVolume;V.prototype.play=V.prototype.play;V.prototype.pause=V.prototype.pause;V.prototype.skip=V.prototype.skip;V.prototype.canSkipNow=V.prototype.canSkipNow;V.prototype.getTimeUntilSkippable=V.prototype.getTimeUntilSkippable;V.prototype.isSkippable=V.prototype.isSkippable;V.prototype.isPaused=V.prototype.isPaused;V.prototype.getRemainingTime=V.prototype.getRemainingTime;V.prototype.getMinSuggestedDuration=V.prototype.getMinSuggestedDuration;
V.prototype.getDuration=V.prototype.getDuration;V.prototype.isUsingAnotherMediaElement=V.prototype.isUsingAnotherMediaElement;V.prototype.hasCustomClick=V.prototype.hasCustomClick;V.prototype.isClientRendering=V.prototype.isClientRendering;V.prototype.needsSkipUI=V.prototype.needsSkipUI;async function Ur(a,b,c){var d=ag([b],Hf());d.method="POST";c&&(c=JSON.stringify(c),d.body=Ib(c));d=a.J.request(7,d,{type:7});try{const e=await d.promise,f=Eb(e.data),g=JSON.parse(f);if(g.manifestUrl&&g.trackingUrl){const h=new Ua(b),k=new Ua(g.trackingUrl);a.G=h.resolve(k).toString();a.i(new L("ads-loaded",(new Map).set("loadTime",Date.now()/1E3-a.O)));const l=new Ua(g.manifestUrl);a.o.resolve(h.resolve(l).toString());a.o=null}else throw Error("Insufficient data from MediaTailor.");}catch(e){a.H.length?
a.o.resolve(a.H):a.o.reject("MediaTailor request returned an error and there was no backup asset uri provided."),a.o=null}}function Vr(a){if(a.g){for(;a.B.lastChild;)a.B.removeChild(a.B.firstChild);a.I||a.M.push(a.C.adId);Wr(a,a.g.m);const b=a.g.getPositionInSequence(),c=a.g.getSequenceLength();b===c&&Xr(a,"breakEnd");a.g=null;a.C=null;a.K=null}}
async function Yr(a,b,c){b=a.J.request(7,ag([b],Hf()),{type:8});try{const d=await b.promise;b=[];const e=Eb(d.data),f=JSON.parse(e);if(f.avails.length>0){if(JSON.stringify(a.j)!=JSON.stringify(f.avails)){a.j=f.avails;for(const g of a.j)for(const h of g.nonLinearAdsList)for(const k of h.nonLinearAdList)Zr(a,k);b=a.getCuePoints();a.i(new L("ad-cue-points-changed",(new Map).set("cuepoints",b)))}}else a.j.length&&a.i(new L("ad-cue-points-changed",(new Map).set("cuepoints",b))),Vr(a),a.j=[];c&&(a.I||b.length>
0)&&$r(a)}catch(d){}}async function Zr(a,b){if(b.staticResource){var c=as(b);if(!a.F.get(c)){b=a.J.request(7,ag([b.staticResource],Hf()),{type:9});try{a.F.set(c,[]);const d=await b.promise,e=Eb(d.data),f=JSON.parse(e).apps;a.F.set(c,f)}catch(d){a.F.delete(c)}}}}function $r(a){bs(a);a.I||(cs(a),a.m.D(a.h,"seeked",()=>{cs(a)}),a.m.D(a.h,"ended",()=>{Vr(a)}));a.m.D(a.h,"timeupdate",()=>{bs(a)})}
function as(a){return[a.adId,a.adParameters,a.adSystem,a.adTitle,a.creativeAdId,a.creativeId,a.creativeSequence,a.height,a.width,a.staticResource].join("")}
function bs(a){if(a.h.duration&&(a.g||a.j.length)){var b=a.h.currentTime,c=!1;if(a.g){c=!0;var d=a.C,e=d.startTimeInSeconds+.5*d.durationInSeconds,f=d.startTimeInSeconds+.75*d.durationInSeconds;b>=d.startTimeInSeconds+.25*d.durationInSeconds&&!a.u.includes("firstQuartile")?(a.u.push("firstQuartile"),Xr(a,"firstQuartile")):b>=e&&!a.u.includes("midpoint")?(a.u.push("midpoint"),Xr(a,"midpoint")):b>=f&&!a.u.includes("thirdQuartile")&&(a.u.push("thirdQuartile"),Xr(a,"thirdQuartile"));d=a.g.getRemainingTime();
e=a.g.getDuration();a.g.canSkipNow()&&d>0&&e>0&&Xr(a,"skipStateChanged");e>0&&(d<=0||d>e)&&Vr(a)}if(!a.g||!a.g.isLinear()){a:for(var g of a.j){if(a.g&&a.g.isLinear())break;for(d=0;d<g.ads.length;d++)if(e=g.ads[d],f=e.startTimeInSeconds+e.durationInSeconds,e.startTimeInSeconds<=b&&f>b){if(a.M.includes(e.adId)){if(a.h.ended)continue;a.h.currentTime=f;break a}Vr(a);a.K=g;a.g=new V(e,d+1,g.ads.length,!0,a.h);a.C=e;d===0&&Xr(a,"breakStart");ds(a);break}}if(!a.g)for(const h of a.j){if(a.g)break;for(g=0;g<
h.nonLinearAdsList.length;g++){d=h.nonLinearAdsList[g];if(!d.nonLinearAdList.length)continue;e=h.startTimeInSeconds;f=a.F.get(as(d.nonLinearAdList[0]));if(e<=b&&f&&f.length){Vr(a);e=a;for(const k of f){if(!k.data.source.length)continue;f=document.createElement("img");f.src=k.data.source[0].url;f.style.top=(k.placeholder.top||0)+"%";f.style.height=100-(k.placeholder.top||0)+"%";f.style.left=(k.placeholder.left||0)+"%";f.style.maxWidth=100-(k.placeholder.left||0)+"%";f.style.objectFit="contain";f.style.position=
"absolute";e.B.appendChild(f)}a.K=h;a.g=new V(d,g+1,h.ads.length,!1,a.h);a.C=d;g===0&&Xr(a,"breakStart");ds(a);break}}}c&&!a.g&&(b=a.h.currentTime,a.A&&a.A>b&&(a.h.currentTime=a.A),a.A=null)}}}
function cs(a){const b=a.h.currentTime;if(b!=0&&a.A==null){for(const e of a.j)for(const f of e.ads)if(!c){if(f.startTimeInSeconds<b){var c=f;var d=e}}else if(f.startTimeInSeconds<b&&f.startTimeInSeconds>c.startTimeInSeconds+c.durationInSeconds){c=f;d=e;break}d&&c&&!a.M.includes(c.adId)&&(a.A=b,a.h.currentTime=d.startTimeInSeconds)}}
function Xr(a,b){var c=a.C.trackingEvents.find(d=>d.eventType==b);c||=a.K.adBreakTrackingEvents.find(d=>d.eventType==b);if(c){const d={type:10};for(const e of c.beaconUrls){if(!e||e=="")continue;c=ag([e],Hf());c.method="POST";a.J.request(7,c,d)}}switch(b){case "impression":a.i(new L("ad-impression"));break;case "start":a.i(new L("ad-started",(new Map).set("ad",a.g)));break;case "mute":a.i(new L("ad-muted"));break;case "unmute":a.i(new L("ad-volume-changed"));break;case "resume":a.i(new L("ad-resumed"));
break;case "pause":a.i(new L("ad-paused"));break;case "firstQuartile":a.i(new L("ad-first-quartile"));break;case "midpoint":a.i(new L("ad-midpoint"));break;case "thirdQuartile":a.i(new L("ad-third-quartile"));break;case "complete":a.i(new L("ad-complete"));a.i(new L("ad-stopped"));break;case "skip":a.i(new L("ad-skipped"));a.i(new L("ad-stopped"));break;case "breakStart":a.B.setAttribute("ad-active","true");break;case "breakEnd":a.B.removeAttribute("ad-active");break;case "skipStateChanged":a.i(new L("ad-skip-state-changed"))}}
function ds(a){let b=!1;a.h.paused?b=!0:(Xr(a,"impression"),Xr(a,"start"));a.l.push({target:a.h,type:"volumechange",listener:()=>{a.h.muted&&Xr(a,"mute")}});a.l.push({target:a.h,type:"volumechange",listener:()=>{a.h.muted||Xr(a,"unmute")}});a.l.push({target:a.h,type:"play",listener:()=>{b?(Xr(a,"impression"),Xr(a,"start"),b=!1):Xr(a,"resume")}});a.l.push({target:a.h,type:"pause",listener:()=>{Xr(a,"pause")}});for(const c of a.l)a.m.D(c.target,c.type,c.listener)}
function Wr(a,b=!1){b?Xr(a,"skip"):Xr(a,"complete");for(const c of a.l)a.m.Ja(c.target,c.type,c.listener);a.l=[];a.u=[]}
var es=class{constructor(a,b,c,d){this.B=a;this.J=b;this.h=c;this.o=null;this.O=NaN;this.i=d;this.I=!1;this.A=null;this.j=[];this.M=[];this.K=this.C=this.g=null;this.F=new Map;this.l=[];this.u=[];this.G="";this.N=!0;this.H="";this.m=new Aa}stop(){for(const a of this.l)this.m.Ja(a.target,a.type,a.listener);Vr(this);this.l=[];this.u=[];this.G="";this.N=!0;this.H="";this.A=null;this.j=[];this.M=[];this.F.clear()}release(){this.stop();this.m&&this.m.release()}onManifestUpdated(a){this.I=a;this.G!=""&&
(Yr(this,this.G,this.N),this.N=!1)}getCuePoints(){const a=[];for(const b of this.j)for(const c of b.ads)a.push({start:c.startTimeInSeconds,end:c.startTimeInSeconds+c.durationInSeconds});return a}};var W=class{constructor(a,b){this.g=a;this.i=null;this.h=b}needsSkipUI(){return!0}isClientRendering(){return!1}hasCustomClick(){return!0}isUsingAnotherMediaElement(){return!1}getDuration(){return this.i?this.i.duration:-1}getMinSuggestedDuration(){return this.getDuration()}getRemainingTime(){return this.i?this.i.duration-this.i.currentTime:-1}isPaused(){return this.h.paused}isSkippable(){return this.g.isSkippable()}getTimeUntilSkippable(){var a=this.g.getSkipTimeOffset();a=this.getRemainingTime()-
a;return Math.max(a,0)}canSkipNow(){return this.getTimeUntilSkippable()==0}skip(){this.h.currentTime+=this.getRemainingTime()}pause(){return this.h.pause()}play(){return this.h.play()}getVolume(){return this.h.volume}setVolume(a){this.h.volume=a}isMuted(){return this.h.muted}isLinear(){return!0}resize(){}setMuted(a){this.h.muted=a}getSequenceLength(){const a=this.g.getAdPodInfo();return a==null?1:a.getTotalAds()}getPositionInSequence(){const a=this.g.getAdPodInfo();return a==null?1:a.getAdPosition()}getTitle(){return this.g.getTitle()}getDescription(){return this.g.getDescription()}getVastMediaBitrate(){return 0}getVastMediaHeight(){return this.g.getVastMediaHeight()}getVastMediaWidth(){return this.g.getVastMediaWidth()}getVastAdId(){return""}getAdId(){return this.g.getAdId()}getCreativeAdId(){return this.g.getCreativeAdId()}getAdvertiserName(){return this.g.getAdvertiserName()}getMediaUrl(){return null}getTimeOffset(){const a=
this.g.getAdPodInfo();return a==null?0:a.getTimeOffset()}getPodIndex(){const a=this.g.getAdPodInfo();return a==null?0:a.getPodIndex()}release(){this.h=this.i=this.g=null}};v("shaka.ads.ServerSideAd",W);W.prototype.release=W.prototype.release;W.prototype.getPodIndex=W.prototype.getPodIndex;W.prototype.getTimeOffset=W.prototype.getTimeOffset;W.prototype.getMediaUrl=W.prototype.getMediaUrl;W.prototype.getAdvertiserName=W.prototype.getAdvertiserName;W.prototype.getCreativeAdId=W.prototype.getCreativeAdId;
W.prototype.getAdId=W.prototype.getAdId;W.prototype.getVastAdId=W.prototype.getVastAdId;W.prototype.getVastMediaWidth=W.prototype.getVastMediaWidth;W.prototype.getVastMediaHeight=W.prototype.getVastMediaHeight;W.prototype.getVastMediaBitrate=W.prototype.getVastMediaBitrate;W.prototype.getDescription=W.prototype.getDescription;W.prototype.getTitle=W.prototype.getTitle;W.prototype.getPositionInSequence=W.prototype.getPositionInSequence;W.prototype.getSequenceLength=W.prototype.getSequenceLength;
W.prototype.setMuted=W.prototype.setMuted;W.prototype.resize=W.prototype.resize;W.prototype.isLinear=W.prototype.isLinear;W.prototype.isMuted=W.prototype.isMuted;W.prototype.setVolume=W.prototype.setVolume;W.prototype.getVolume=W.prototype.getVolume;W.prototype.play=W.prototype.play;W.prototype.pause=W.prototype.pause;W.prototype.skip=W.prototype.skip;W.prototype.canSkipNow=W.prototype.canSkipNow;W.prototype.getTimeUntilSkippable=W.prototype.getTimeUntilSkippable;W.prototype.isSkippable=W.prototype.isSkippable;
W.prototype.isPaused=W.prototype.isPaused;W.prototype.getRemainingTime=W.prototype.getRemainingTime;W.prototype.getMinSuggestedDuration=W.prototype.getMinSuggestedDuration;W.prototype.getDuration=W.prototype.getDuration;W.prototype.isUsingAnotherMediaElement=W.prototype.isUsingAnotherMediaElement;W.prototype.hasCustomClick=W.prototype.hasCustomClick;W.prototype.isClientRendering=W.prototype.isClientRendering;W.prototype.needsSkipUI=W.prototype.needsSkipUI;function fs(a,b){a.i(new L("ads-loaded",(new Map).set("loadTime",Date.now()/1E3-a.F)));b=b.getStreamData().url;a.j.resolve(b);a.j=null;a.G||a.h.D(a.l,"seeked",()=>{const c=a.l.currentTime;if(c!=0){a.g.streamTimeForContentTime(c);var d=a.g.previousCuePointForStreamTime(c);d&&!d.played&&(a.o=c,a.l.currentTime=d.start)}})}
var gs=class{constructor(a,b,c,d){this.u=a;this.l=b;this.j=null;this.F=NaN;this.i=d;this.G=!1;this.A=this.m=this.o=null;this.B="";this.C=[];this.h=new Aa;a=new google.ima.dai.api.UiSettings;a.setLocale(c);this.g=new google.ima.dai.api.StreamManager(this.l,this.u,a);this.i(new L("ima-stream-manager-loaded",(new Map).set("imaStreamManager",this.g)));this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.LOADED,e=>{fs(this,e)});this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.ERROR,()=>{this.B.length?
this.j.resolve(this.B):this.j.reject("IMA Stream request returned an error and there was no backup asset uri provided.");this.j=null});this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.AD_BREAK_STARTED,()=>{});this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.STARTED,e=>{e=e.getAd();this.m=new W(e,this.l);this.A&&(this.m.i=this.A);this.i(new L("ad-started",(new Map).set("ad",this.m)));this.u.setAttribute("ad-active","true")});this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.AD_BREAK_ENDED,
()=>{this.u.removeAttribute("ad-active");const e=this.l.currentTime;this.o&&this.o>e&&(this.l.currentTime=this.o,this.o=null)});this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.AD_PROGRESS,e=>{this.A=e.getStreamData().adProgressData;this.m&&(this.m.i=this.A)});this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.FIRST_QUARTILE,()=>{this.i(new L("ad-first-quartile"))});this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.MIDPOINT,()=>{this.i(new L("ad-midpoint"))});this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.THIRD_QUARTILE,
()=>{this.i(new L("ad-third-quartile"))});this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.COMPLETE,()=>{this.i(new L("ad-complete"));this.i(new L("ad-stopped"));this.u.removeAttribute("ad-active");this.m=null});this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.SKIPPED,()=>{this.i(new L("ad-skipped"));this.i(new L("ad-stopped"))});this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.CUEPOINTS_CHANGED,e=>{e=e.getStreamData();const f=[];for(const g of e.cuepoints)f.push({start:g.start,end:g.end});
this.C=f;this.i(new L("ad-cue-points-changed",(new Map).set("cuepoints",f)))})}configure(){}stop(){this.B="";this.o=null;this.C=[]}release(){this.stop();this.h&&this.h.release()}onCueMetadataChange(a){if(a.key&&a.data){const b={};b[a.key]=a.data;this.g.onTimedMetadata(b)}}getCuePoints(){return this.C}};function hs(a,b){if(b&&b.type)switch(b.type){case "ads-loaded":a.m.g.push(b.loadTime);break;case "ad-started":a.m.h++;const c=b.ad;c&&!c.isLinear()&&a.m.j++;break;case "ad-complete":a.m.l++;break;case "ad-skipped":a.m.m++;break;case "ad-error":a.m.i++}a.dispatchEvent(b)}
var X=class extends Vf{constructor(){super();this.h=this.i=this.j=this.g=null;this.m=new mr;this.o=navigator.language;this.l=null}setLocale(a){this.o=a}configure(a){this.l=a;this.g&&this.g.configure(this.l);this.j&&this.j.configure(this.l);this.h&&this.h.configure(this.l)}initInterstitial(a,b,c){this.g&&this.g.release();this.g=new Tr(a,b,c,d=>hs(this,d));this.g.configure(this.l)}initClientSide(a,b,c){if(!window.google||!google.ima||!google.ima.AdsLoader)throw new F(2,10,1E4);this.j&&this.j.release();
this.j=new wr(a,b,this.o,c,d=>hs(this,d));this.j.configure(this.l)}release(){this.g&&(this.g.release(),this.g=null);this.j&&(this.j.release(),this.j=null);this.i&&(this.i.release(),this.i=null);this.h&&(this.h.release(),this.h=null);super.release()}onAssetUnload(){this.g&&this.g.stop();this.j&&this.j.stop();this.i&&this.i.stop();this.h&&this.h.stop();this.dispatchEvent(new L("ad-stopped"));this.dispatchEvent(new L("ad-content-attach-requested"));this.m=new mr}requestClientSideAds(a){if(!this.j)throw new F(1,
10,10001);var b=this.j;b.g&&b.g.destroy();b.m&&b.m.contentComplete();b.G=Date.now()/1E3;b.m.requestAds(a)}updateClientSideAdsRenderingSettings(a){if(!this.j)throw new F(1,10,10001);var b=this.j;b.B=a;b.g&&b.g.updateAdsRenderingSettings(b.B)}initMediaTailor(a,b,c){this.i&&this.i.release();this.i=new es(a,b,c,d=>hs(this,d))}requestMediaTailorStream(a,b,c=""){if(!this.i)throw new F(1,10,10005);var d=this.i;d.o?a=Promise.reject(new F(1,10,10004)):(d.o=new Lf,Ur(d,a,b),d.H=c||"",d.O=Date.now()/1E3,a=d.o);
return a}addMediaTailorTrackingUrl(a){if(!this.i)throw new F(1,10,10005);var b=this.i;b.G=a;b.i(new L("ads-loaded",(new Map).set("loadTime",0)))}initServerSide(a,b){if(!window.google||!google.ima||!google.ima.dai)throw new F(2,10,10002);this.h&&this.h.release();this.h=new gs(a,b,this.o,c=>hs(this,c));this.h.configure(this.l)}requestServerSideStream(a,b=""){if(!this.h)throw new F(1,10,10003);a.adTagParameters||(a.adTagParameters={});var c=a.adTagParameters;(c.mpt||c.mpv)&&ja('You have attempted to set "mpt" and/or "mpv" parameters of the ad tag. Please note that those parameters are used for Shaka adoption tracking and will be overridden.');
a.adTagParameters.mpt="shaka-player";a.adTagParameters.mpv="v4.16.37";c=this.h;c.j?a=Promise.reject(new F(1,10,10004)):(a instanceof google.ima.dai.api.LiveStreamRequest&&(c.G=!0),c.j=new Lf,c.g.requestStream(a),c.B=b||"",c.F=Date.now()/1E3,a=c.j);return a}replaceServerSideAdTagParameters(a){if(!this.h)throw new F(1,10,10003);(a.mpt||a.mpv)&&ja('You have attempted to set "mpt" and/or "mpv" parameters of the ad tag. Please note that those parameters are used for Shaka adoption tracking and will be overridden.');
a.mpt="Shaka Player";a.mpv="v4.16.37";this.h.g.replaceAdTagParameters(a)}getServerSideCuePoints(){Ra("AdManager.getServerSideCuePoints","Please use getCuePoints function.");return this.getCuePoints()}getCuePoints(){let a=[];this.h&&(a=a.concat(this.h.getCuePoints()));this.i&&(a=a.concat(this.i.getCuePoints()));return a}getStats(){var a=this.m;return{loadTimes:a.g,averageLoadTime:lr(a),started:a.h,overlayAds:a.j,playedCompletely:a.l,skipped:a.m,errors:a.i}}onManifestUpdated(a){if(this.i)this.i.onManifestUpdated(a)}onDashTimedMetadata(a){this.h&&
a.schemeIdUri=="urn:google:dai:2018"&&this.h.g.processMetadata(a.schemeIdUri,a.eventNode?a.eventNode.attributes.messageData:null,a.startTime)}onHlsTimedMetadata(a,b){this.h&&this.h.g.processMetadata("ID3",a.data,b)}onCueMetadataChange(a){if(this.h)this.h.onCueMetadataChange(a)}onHLSInterstitialMetadata(a,b,c){this.l&&this.l.disableHLSInterstitial||(this.g||this.initInterstitial(null,a,b),this.g&&Qr(this.g,c))}onDASHInterstitialMetadata(a,b,c){if(!this.l||!this.l.disableDASHInterstitial){var d=c.schemeIdUri;
if(d=="urn:mpeg:dash:event:alternativeMPD:insert:2025"||d=="urn:mpeg:dash:event:alternativeMPD:replace:2025"){if(this.g||this.initInterstitial(null,a,b),this.g){a=this.g;const l=c.schemeIdUri=="urn:mpeg:dash:event:alternativeMPD:replace:2025",m=c.schemeIdUri=="urn:mpeg:dash:event:alternativeMPD:insert:2025";if(l||m){b=c.startTime;d=c.endTime;var e=null,f=0;for(var g of c.eventNode.children)if(g.tagName=="AlternativeMPD"){var h=g.attributes.uri;if(h){var k=h;break}}else if(g.tagName=="InsertPresentation"||
g.tagName=="ReplacePresentation")if(h=g.attributes.uri||g.attributes.url){k=Kb(h);(h=H(g,"maxDuration",fd))&&(e=h/c.timescale);(g=H(g,"returnOffset",fd))&&(f=g/c.timescale);l&&f&&(d=b+f);break}k&&Pr(a,[{id:c.id,groupId:null,startTime:b,endTime:d,uri:k,mimeType:null,isSkippable:!1,skipOffset:null,skipFor:null,canJump:!0,resumeOffset:m?f:null,playoutLimit:e,once:!1,pre:!1,post:!1,timelineRange:l&&!m,loop:!1,overlay:null,displayOnBackground:!1,currentVideo:null,background:null,clickThroughUrl:null}])}}}else(d==
"urn:mpeg:dash:event:2012"||d=="urn:scte:dash:scte214-events")&&c.eventNode&&Yc(c.eventNode,"OverlayEvent")&&(this.g||this.initInterstitial(null,a,b),this.g&&Rr(this.g,c))}}addCustomInterstitial(a){if(!this.g)throw new F(1,10,10006);Pr(this.g,[a])}addAdUrlInterstitial(a){if(!this.g)throw new F(1,10,10006);return this.g.addAdUrlInterstitial(a)}getInterstitialPlayer(){if(!this.g)throw new F(1,10,10006);return this.g.Mc()}};v("shaka.ads.AdManager",X);X.prototype.getInterstitialPlayer=X.prototype.getInterstitialPlayer;
X.prototype.addAdUrlInterstitial=X.prototype.addAdUrlInterstitial;X.prototype.addCustomInterstitial=X.prototype.addCustomInterstitial;X.prototype.onDASHInterstitialMetadata=X.prototype.onDASHInterstitialMetadata;X.prototype.onHLSInterstitialMetadata=X.prototype.onHLSInterstitialMetadata;X.prototype.onCueMetadataChange=X.prototype.onCueMetadataChange;X.prototype.onHlsTimedMetadata=X.prototype.onHlsTimedMetadata;X.prototype.onDashTimedMetadata=X.prototype.onDashTimedMetadata;
X.prototype.onManifestUpdated=X.prototype.onManifestUpdated;X.prototype.getStats=X.prototype.getStats;X.prototype.getCuePoints=X.prototype.getCuePoints;X.prototype.getServerSideCuePoints=X.prototype.getServerSideCuePoints;X.prototype.replaceServerSideAdTagParameters=X.prototype.replaceServerSideAdTagParameters;X.prototype.requestServerSideStream=X.prototype.requestServerSideStream;X.prototype.initServerSide=X.prototype.initServerSide;X.prototype.addMediaTailorTrackingUrl=X.prototype.addMediaTailorTrackingUrl;
X.prototype.requestMediaTailorStream=X.prototype.requestMediaTailorStream;X.prototype.initMediaTailor=X.prototype.initMediaTailor;X.prototype.updateClientSideAdsRenderingSettings=X.prototype.updateClientSideAdsRenderingSettings;X.prototype.requestClientSideAds=X.prototype.requestClientSideAds;X.prototype.onAssetUnload=X.prototype.onAssetUnload;X.prototype.release=X.prototype.release;X.prototype.initClientSide=X.prototype.initClientSide;X.prototype.initInterstitial=X.prototype.initInterstitial;
X.prototype.configure=X.prototype.configure;X.prototype.setLocale=X.prototype.setLocale;X.ADS_LOADED="ads-loaded";X.AD_STARTED="ad-started";X.AD_FIRST_QUARTILE="ad-first-quartile";X.AD_MIDPOINT="ad-midpoint";X.AD_THIRD_QUARTILE="ad-third-quartile";X.AD_COMPLETE="ad-complete";X.AD_STOPPED="ad-stopped";X.AD_SKIPPED="ad-skipped";X.AD_VOLUME_CHANGED="ad-volume-changed";X.AD_MUTED="ad-muted";X.AD_PAUSED="ad-paused";X.AD_RESUMED="ad-resumed";X.AD_SKIP_STATE_CHANGED="ad-skip-state-changed";
X.CUEPOINTS_CHANGED="ad-cue-points-changed";X.IMA_AD_MANAGER_LOADED="ima-ad-manager-loaded";X.IMA_STREAM_MANAGER_LOADED="ima-stream-manager-loaded";X.AD_CLICKED="ad-clicked";X.AD_PROGRESS="ad-progress";X.AD_BUFFERING="ad-buffering";X.AD_IMPRESSION="ad-impression";X.AD_DURATION_CHANGED="ad-duration-changed";X.AD_CLOSED="ad-closed";X.AD_LOADED="ad-loaded";X.ALL_ADS_COMPLETED="all-ads-completed";X.AD_LINEAR_CHANGED="ad-linear-changed";X.AD_METADATA="ad-metadata";X.AD_RECOVERABLE_ERROR="ad-recoverable-error";
X.AD_ERROR="ad-error";X.AD_BREAK_READY="ad-break-ready";X.AD_INTERACTION="ad-interaction";X.AD_CONTENT_PAUSE_REQUESTED="ad-content-pause-requested";X.AD_CONTENT_RESUME_REQUESTED="ad-content-resume-requested";X.AD_CONTENT_ATTACH_REQUESTED="ad-content-attach-requested";ir=()=>new X;function is(a){return JSON.stringify(a,(b,c)=>{if(typeof c!="function"){b=c instanceof L;if(c instanceof Event||b){var d={};for(var e in c){var f=c[e];f&&typeof f=="object"?e=="detail"?d[e]=f:f instanceof Event||f instanceof L?d[e]={__type__:"Event",event:is(f)}:b&&Array.isArray(f)&&(d[e]=f):e in Event||(d[e]=f)}return d}if(c instanceof Error){e=new Set(["name","message","stack"]);for(f in c)e.add(f);for(const g of Object.getOwnPropertyNames(c))e.add(g);b={};for(d of e)b[d]=c[d];c={__type__:"Error",
contents:b}}else if(c instanceof TimeRanges){e={__type__:"TimeRanges",length:c.length,start:[],end:[]};for(const {start:g,end:h}of Ii(c))e.start.push(g),e.end.push(h);c=e}else c=ArrayBuffer.isView(c)&&c.BYTES_PER_ELEMENT===1?{__type__:"Uint8Array",entries:Array.from(c)}:typeof c=="number"?isNaN(c)?"NaN":isFinite(c)?c:c<0?"-Infinity":"Infinity":c;return c}})}
function js(a){return JSON.parse(a,(b,c)=>{if(c=="NaN")var d=NaN;else if(c=="-Infinity")d=-Infinity;else if(c=="Infinity")d=Infinity;else if(c&&typeof c=="object"&&c.__type__=="TimeRanges")d=ks(c);else if(c&&typeof c=="object"&&c.__type__=="Uint8Array")d=new Uint8Array(c.entries);else if(c&&typeof c=="object"&&c.__type__=="Error"){b=c.contents;c=Error(b.message);for(d in b)c[d]=b[d];d=c}else d=c&&typeof c=="object"&&c.__type__=="Event"?js(c.event):c;return d})}
function ks(a){return{length:a.length,start:b=>a.start[b],end:b=>a.end[b]}}
var ls="ended play playing pause pausing ratechange seeked seeking timeupdate volumechange".split(" "),ms="buffered currentTime duration ended loop muted paused playbackRate seeking videoHeight videoWidth volume".split(" "),ns=["loop","playbackRate"],os=["pause","play"],ps=(new Map).set("getAssetUri",2).set("getAudioLanguages",4).set("getAudioLanguagesAndRoles",4).set("getBufferFullness",1).set("getBufferedInfo",2).set("getExpiration",2).set("getKeyStatuses",2).set("getPlaybackRate",2).set("getTextLanguages",
4).set("getTextLanguagesAndRoles",4).set("isAudioOnly",10).set("isBuffering",1).set("isInProgress",1).set("isLive",10).set("isTextTrackVisible",1).set("isVideoOnly",10).set("keySystem",10).set("seekRange",1).set("getLoadMode",10).set("getManifestType",10).set("isFullyLoaded",1).set("isEnded",1).set("getBandwidthEstimate",1).set("isRemotePlayback",1),qs=(new Map).set("getConfiguration",4).set("getConfigurationForLowLatency",4).set("getStats",5).set("getAudioTracks",2).set("getChaptersTracks",2).set("getImageTracks",
2).set("getVideoTracks",2).set("getTextTracks",2).set("getVariantTracks",2),rs=(new Map).set("getPlayheadTimeAsDate",1).set("getPresentationStartTimeAsDate",20).set("getSegmentAvailabilityDuration",20),ss=[["getConfiguration","configure","getConfigurationForLowLatency","configurationForLowLatency"]],ts=[["isTextTrackVisible","setTextTrackVisibility"]],us="cancelTrickPlay configure configurationForLowLatency getChapters resetConfiguration retryStreaming selectAudioLanguage selectAudioTrack selectTextLanguage selectTextTrack selectVariantTrack selectVariantsByLabel selectVideoTrack setTextTrackVisibility trickPlay updateStartTime goToLive useTrickPlayTrackIfAvailable".split(" "),
vs="addChaptersTrack addTextTrackAsync addThumbnailsTrack getAllThumbnails getChaptersAsync getThumbnails attach attachCanvas detach load unload".split(" ");function ws(a){const b=xs?xs.status=="connected":!1;if(a.i&&!b){a.F();for(const c in a.g)a.g[c]={};ys(a)}a.i=b;a.I=b?xs.receiver.friendlyName:"";a.l.kb()}function ys(a){if(a.h)for(const b of a.h.keys()){const c=a.h.get(b);a.h.delete(b);c.reject(new F(1,7,7E3))}}function zs(a){const b=xs;b.removeUpdateListener(a.B);b.removeMessageListener("urn:x-cast:com.google.shaka.v2",a.C)}
function As(a,b){b=is(b);var c=xs;try{c.sendMessage("urn:x-cast:com.google.shaka.v2",b,()=>{},na)}catch(d){throw b=new F(2,8,8005,d),c=new L("error",(new Map).set("detail",b)),a.A("player",c),a.Jc(),b;}}function Bs(a,b){const c=a.M();xs=b;b.addUpdateListener(a.B);b.addMessageListener("urn:x-cast:com.google.shaka.v2",a.C);ws(a);As(a,{type:"init",initState:c,appData:a.o});a.j.resolve()}
function Cs(a,b){let c=8003;switch(b.code){case "cancel":c=8004;break;case "timeout":c=8005;break;case "receiver_unavailable":c=8006}a.j.reject(new F(2,8,c,b))}function Ds(a){a.i&&chrome.cast.requestSession(b=>Bs(a,b),b=>Cs(a,b))}function Es(a,b,c,...d){As(a,{type:"call",targetName:b,methodName:c,args:d})}function Fs(a,b,c,...d){const e=new Lf,f=a.H.toString();a.H++;a.h.set(f,e);try{As(a,{type:"asyncCall",targetName:b,methodName:c,args:d,id:f})}catch(g){e.reject(g)}return e}
var Ls=class{constructor(a,b,c,d,e,f,g){this.G=a;this.J=g;this.l=new Ce(b);this.K=c;this.u=!1;this.A=d;this.F=e;this.M=f;this.i=this.m=!1;this.I="";this.o=null;this.B=()=>ws(this);this.C=(h,k)=>{h=js(k);switch(h.type){case "event":var l=h.targetName,m=Tf(h.event);this.A(l,m);break;case "update":l=h.update;for(m in l){h=this.g[m]||{};for(var n in l[m])h[n]=l[m][n]}this.u&&(this.K(),this.u=!1);break;case "asyncComplete":if(n=h.id,m=h.error,k=h.res,h=this.h.get(n),this.h.delete(n),h)if(m){n=new F(m.severity,
m.category,m.code);for(l in m)n[l]=m[l];h.reject(n)}else h.resolve(k)}};this.g={video:{},player:{}};this.H=0;this.h=new Map;this.j=null;Gs.add(this)}destroy(){Gs.delete(this);ys(this);xs&&zs(this);this.l&&(this.l.stop(),this.l=null);this.F=this.A=null;this.i=this.m=!1;this.C=this.B=this.j=this.h=this.g=this.o=null;return Promise.resolve()}hb(){return this.i}Mf(){return this.I}init(){if(this.G.length)if(window.chrome&&chrome.cast&&chrome.cast.isAvailable){this.m=!0;this.l.kb();var a=new chrome.cast.SessionRequest(this.G,
[],null,this.J,null);a=new chrome.cast.ApiConfig(a,b=>{for(const e of Gs){var c=e,d=b;c.j=new Lf;c.u=!0;Bs(c,d)}},b=>{for(const c of Gs)Hs=b=="available",c.l.kb()},"origin_scoped");chrome.cast.initialize(a,()=>{},()=>{});Hs&&this.l.ma(Is);(a=xs)&&a.status!=chrome.cast.SessionStatus.STOPPED?(this.j=new Lf,this.u=!0,Bs(this,a)):xs=null}else window.__onGCastApiAvailable!==Js&&(Ks=window.__onGCastApiAvailable||null,window.__onGCastApiAvailable=Js)}Wf(a){this.o=a;this.i&&As(this,{type:"appData",appData:this.o})}async cast(){if(!this.m)throw new F(1,
8,8E3);if(!Hs)throw new F(1,8,8001);if(this.i)throw new F(1,8,8002);this.j=new Lf;chrome.cast.requestSession(a=>Bs(this,a),a=>Cs(this,a));await this.j}Jc(){if(this.i){ys(this);if(xs){zs(this);try{xs.stop(()=>{},()=>{})}catch(a){}xs=null}ws(this)}}get(a,b){if(a=="video"){if(os.includes(b))return(...c)=>Es(this,a,b,...c)}else if(a=="player"){if(rs.has(b)&&!this.get("player","isLive")())return()=>{};if(us.includes(b))return(...c)=>Es(this,a,b,...c);if(vs.includes(b))return(...c)=>Fs(this,a,b,...c);if(ps.has(b)||
qs.has(b))return()=>this.g[a][b]}return this.g[a][b]}set(a,b,c){this.g[a][b]=c;As(this,{type:"set",targetName:a,property:b,value:c})}},Is=.02,Hs=!1,xs=null,Ks=null,Gs=new Set,Js=a=>{Ks?window.__onGCastApiAvailable=Ks:delete window.__onGCastApiAvailable;Ks=null;if(a)for(const b of Gs)b.init();typeof window.__onGCastApiAvailable==="function"&&window.__onGCastApiAvailable(a)};function Ms(a){const b=new L("caststatuschanged");a.dispatchEvent(b)}function Ns(a){const b=new L(a.j.paused?"pause":"play");a.m.dispatchEvent(b)}function Os(a,b,c){a.g.hb()&&(b=="video"?a.m.dispatchEvent(c):b=="player"&&(c.type=="unloading"&&Ps(a),a.o.dispatchEvent(c)))}
function Qs(a){for(var b of ss){var c=b[1],d=a.g.get("player",b[0])();a.h[c](d)}const e=a.C,f=a.B,g=a.A;Ps(a);const h=a.g.get("player","getAssetUri")();d=a.g.get("video","ended");b=Promise.resolve();const k=a.i.autoplay;c=null;d||(c=a.g.get("video","currentTime"));let l;(d=a.g.get("player","getTextTracks")())&&d.length&&(l=d.find(p=>p.active));const m=a.g.get("player","isTextTrackVisible")();h&&(a.i.autoplay=!1,b=a.h.load(h,c));const n={};for(const p of ns)n[p]=a.g.get("video",p);b.then(()=>{if(a.i){for(var p of e)a.Mc().Wd(...p);
for(var r of f)a.Mc().fd(...r);for(const q of g)a.Mc().Vd(...q);for(const q of ns)a.i[q]=n[q];for(const q of ts)p=q[1],r=a.g.get("player",q[0])(),a.h[p](r);a.h.Zf(m);l&&a.h.Uf(l.language,l.roles,l.forced);a.i.autoplay=k;h&&a.i.play()}},p=>{p=(new Map).set("detail",p);p=new L("error",p);a.h.dispatchEvent(p)})}
function Rs(a){const b={video:{},player:{},playerAfterLoad:{},manifest:a.h.Kc(),startTime:null,addThumbnailsTrackCalls:a.C,addTextTrackAsyncCalls:a.B,addChaptersTrackCalls:a.A};a.i.pause();for(var c of ns)b.video[c]=a.i[c];a.i.ended||(b.startTime=a.i.currentTime);for(var d of ss){c=d[1];const e=a.h[d[0]]();b.player[c]=e}for(const e of ts)d=e[1],c=a.h[e[0]](),b.playerAfterLoad[d]=c;return b}
function Ss(a){a.g.init();a.l=new Aa;for(const b of ls)a.l.D(a.i,b,c=>{a.g.hb()||(c=Tf(c),a.m.dispatchEvent(c))});for(const b in Uf)a.l.D(a.h,Uf[b],c=>{a.g.hb()||a.o.dispatchEvent(c)});a.j={};for(const b in a.i)Object.defineProperty(a.j,b,{configurable:!1,enumerable:!0,get:()=>Ts(a,b),set:c=>{var d=b;a.g.hb()?a.g.set("video",d,c):a.i[d]=c}});a.u={};Us(a,b=>{Object.defineProperty(a.u,b,{configurable:!1,enumerable:!0,get:()=>Vs(a,b)})});Ws(a);a.m=new Vf;a.m.Qd=a.j;a.o=new Vf;a.o.Qd=a.u;a.l.D(a.h,"unloading",
()=>{a.g&&a.g.hb()||Ps(a)})}function Ts(a,b){if(b=="addEventListener")return(c,d,e)=>a.m.addEventListener(c,d,e);if(b=="removeEventListener")return(c,d,e)=>a.m.removeEventListener(c,d,e);if(a.g.hb()&&Object.keys(a.g.g.video).length==0){const c=a.i[b];if(typeof c!="function")return c}return a.g.hb()?a.g.get("video",b):(b=a.i[b],typeof b=="function"&&(b=b.bind(a.i)),b)}
function Us(a,b){function c(g){return g=="constructor"||typeof d[g]!="function"?!1:!e.has(g)}const d=a.h,e=new Set;for(var f in d)c(f)&&(e.add(f),b(f,d[f]));a=Object.getPrototypeOf(d);for(f=Object.getPrototypeOf({});a&&a!=f;){for(const g of Object.getOwnPropertyNames(a))c(g)&&(e.add(g),b(g,d[g]));a=Object.getPrototypeOf(a)}}
function Vs(a,b,c=!1){a.F.has(b)&&(b=a.F.get(b));if(b=="addEventListener")return(d,e,f)=>a.o.addEventListener(d,e,f);if(b=="removeEventListener")return(d,e,f)=>a.o.removeEventListener(d,e,f);if(b=="getMediaElement")return()=>a.j;if(b=="getSharedConfiguration")return a.g.get("player","getConfiguration");if(b=="getNetworkingEngine")return()=>a.h.Gb();if(b=="getDrmEngine")return()=>a.h.C;if(b=="getAdManager")return()=>a.h.wg();if(b=="getQueueManager")return()=>a.h.Dg();if(b=="setVideoContainer")return d=>
a.h.Yg(d);if(!c){if(b=="addThumbnailsTrack")return(...d)=>{a.C.push(d);return Vs(a,b,!0)(...d)};if(b=="addTextTrackAsync")return(...d)=>{a.B.push(d);return Vs(a,b,!0)(...d)};if(b=="addChaptersTrack")return(...d)=>{a.A.push(d);return Vs(a,b,!0)(...d)}}if(a.g.hb()){if(b=="getManifest"||b=="drmInfo")return()=>{ja(b+"() does not work while casting!");return null};if(b=="attach"||b=="detach")return()=>{ja(b+"() does not work while casting!");return Promise.resolve()};if(b=="getChapters")return()=>{ja(b+
"() does not work while casting!");return[]}}return a.g.hb()&&Object.keys(a.g.g.video).length==0&&(ps.has(b)||qs.has(b))||!a.g.hb()?a.h[b].bind(a.h):a.g.get("player",b)}function Ws(a){const b=new Map;Us(a,(c,d)=>{b.has(d)?(d=b.get(d),c.length<d.length?a.F.set(c,d):a.F.set(d,c)):b.set(d,c)})}function Ps(a){a.C=[];a.B=[];a.A=[]}
var Xs=class extends Vf{constructor(a,b,c,d=!1){super();this.i=a;this.h=b;this.l=this.o=this.m=this.u=this.j=null;this.H=c;this.G=d;this.C=[];this.B=[];this.A=[];this.F=new Map;this.g=null;window.chrome&&Fa().i()!="CAST"?(this.g=new Ls(c,()=>Ms(this),()=>Ns(this),(e,f)=>Os(this,e,f),()=>Qs(this),()=>Rs(this),d),Ss(this)):(this.j=this.i,this.u=this.h)}destroy(a=!1){this.g&&a&&this.g.Jc();this.l&&(this.l.release(),this.l=null);a=[];this.h&&(a.push(this.h.destroy()),this.h=null);this.g&&(a.push(this.g.destroy()),
this.g=null);this.u=this.j=this.i=null;super.release();return Promise.all(a)}bi(){return this.j}Mc(){return this.u}kh(){return this.g?this.g.m&&Hs:!1}hb(){return this.g?this.g.hb():!1}Mf(){return this.g?this.g.Mf():""}async cast(){this.g&&(await this.g.cast(),this.h&&await this.h.cc())}Wf(a){this.g&&this.g.Wf(a)}aj(){this.g&&Ds(this.g)}Jc(){this.g&&this.g.Jc()}async mh(a,b=!1){if(a!=this.H||b!=this.G)this.H=a,this.G=b,this.g&&(this.g.Jc(),await this.g.destroy(),this.g=null,this.g=new Ls(a,()=>Ms(this),
()=>Ns(this),(c,d)=>Os(this,c,d),()=>Qs(this),()=>Rs(this),b),this.g.init())}};v("shaka.cast.CastProxy",Xs);Xs.prototype.changeReceiverId=Xs.prototype.mh;Xs.prototype.forceDisconnect=Xs.prototype.Jc;Xs.prototype.suggestDisconnect=Xs.prototype.aj;Xs.prototype.setAppData=Xs.prototype.Wf;Xs.prototype.cast=Xs.prototype.cast;Xs.prototype.receiverName=Xs.prototype.Mf;Xs.prototype.isCasting=Xs.prototype.hb;Xs.prototype.canCast=Xs.prototype.kh;Xs.prototype.getPlayer=Xs.prototype.Mc;
Xs.prototype.getVideo=Xs.prototype.bi;Xs.prototype.destroy=Xs.prototype.destroy;function Ys(a){a.C.ma(Zs);const b={video:{},player:{}};for(var c of ms)b.video[c]=a.g[c];a.h.U()&&rs.forEach((d,e)=>{a.m%d==0&&(b.player[e]=a.h[e]())});ps.forEach((d,e)=>{a.m%d==0&&(b.player[e]=a.h[e]())});if(c=cast.receiver.CastReceiverManager.getInstance().getSystemVolume())b.video.volume=c.level,b.video.muted=c.muted;$s(a,{type:"update",update:b},a.l);qs.forEach((d,e)=>{a.m%d==0&&(d={player:{}},d.player[e]=a.h[e](),$s(a,{type:"update",update:d},a.l))});a.B&&(a.m+=1);at(a)}
function bt(a){const b=cast.receiver.CastReceiverManager.getInstance();b.onSenderConnected=()=>ct(a);b.onSenderDisconnected=()=>ct(a);b.onSystemVolumeChanged=()=>{const c=cast.receiver.CastReceiverManager.getInstance().getSystemVolume();c&&$s(a,{type:"update",update:{video:{volume:c.level,muted:c.muted}}},a.l);$s(a,{type:"event",targetName:"video",event:{type:"volumechange"}},a.l)};a.u=b.getCastMessageBus("urn:x-cast:com.google.cast.media");a.u.onMessage=c=>dt(a,c);a.l=b.getCastMessageBus("urn:x-cast:com.google.shaka.v2");
a.l.onMessage=c=>et(a,c);b.start();for(const c of ls)a.j.D(a.g,c,d=>ft(a,"video",d));for(const c in Uf)a.j.D(a.h,Uf[c],d=>ft(a,"player",d));a.j.D(a.g,"loadeddata",()=>{a.B=!0});a.j.D(a.h,"loading",()=>{a.o=!1;gt(a)});a.j.D(a.g,"playing",()=>{a.o=!1;gt(a)});a.j.D(a.g,"pause",()=>{gt(a)});a.j.D(a.h,"unloading",()=>{a.o=!0;gt(a)});a.j.D(a.g,"ended",()=>{(new Ce(()=>{a.g&&a.g.ended&&(a.o=!0,gt(a))})).ma(ht)})}
function ct(a){a.m=0;a.A=!0;a.G=cast.receiver.CastReceiverManager.getInstance().getSenders().length!=0;gt(a)}
function dt(a,b){const c=js(b.data);switch(c.type){case "PLAY":a.g.play();it(a);break;case "PAUSE":a.g.pause();it(a);break;case "SEEK":b=c.currentTime;var d=c.resumeState;b!=null&&(a.g.currentTime=Number(b));d&&d=="PLAYBACK_START"?(a.g.play(),it(a)):d&&d=="PLAYBACK_PAUSE"&&(a.g.pause(),it(a));break;case "STOP":a.h.cc().then(()=>{a.h&&it(a)});break;case "GET_STATUS":jt(a,Number(c.requestId));break;case "VOLUME":d=c.volume;b=d.level;d=d.muted;var e=a.g.volume,f=a.g.muted;b!=null&&(a.g.volume=Number(b));
d!=null&&(a.g.muted=d);e==a.g.volume&&f==a.g.muted||it(a);break;case "LOAD":a.m=0;a.B=!1;a.A=!1;b=c.media;d=c.currentTime;e=a.I(b.contentId);f=c.autoplay||!0;a.F(b.customData);f&&(a.g.autoplay=!0);a.h.load(e,d).then(()=>{a.h&&jt(a)}).catch(g=>{let h="LOAD_FAILED";g.category==7&&g.code==7E3&&(h="LOAD_CANCELLED");$s(a,{requestId:Number(c.requestId),type:h},a.u)});break;default:$s(a,{requestId:Number(c.requestId),type:"INVALID_REQUEST",reason:"INVALID_COMMAND"},a.u)}}
function et(a,b){var c=js(b.data);switch(c.type){case "init":a.m=0;a.B=!1;a.A=!0;kt(a,c.initState,c.appData);Ys(a);break;case "appData":a.F(c.appData);break;case "set":var d=c.targetName,e=c.property;c=c.value;if(d=="video")if(b=cast.receiver.CastReceiverManager.getInstance(),e=="volume"){b.setSystemVolumeLevel(c);break}else if(e=="muted"){b.setSystemVolumeMuted(c);break}a.H[d][e]=c;break;case "call":d=a.H[c.targetName];d[c.methodName].apply(d,c.args);break;case "asyncCall":d=c.targetName;e=c.methodName;
d=="player"&&e=="load"&&(a.m=0,a.B=!1);const f=c.id,g=b.senderId;b=a.H[d];c=b[e].apply(b,c.args);d=="player"&&e=="load"&&(c=c.then(()=>{a.A=!0}));c.then(h=>lt(a,g,f,null,h),h=>lt(a,g,f,h,null))}}function ft(a,b,c){a.h&&(Ys(a),$s(a,{type:"event",targetName:b,event:c},a.l))}async function gt(a){await Promise.resolve();if(a.h){var b=new L("caststatuschanged");a.dispatchEvent(b);at(a)||it(a)}}function at(a){return a.A&&(a.g.duration||a.h.U())?(jt(a),a.A=!1,!0):!1}
function it(a,b=0,c=null){const d={mediaSessionId:0,playbackRate:a.g.playbackRate,playerState:a.o?mt:a.h.Af()?nt:a.g.paused?ot:pt,currentTime:a.g.currentTime,supportedMediaCommands:63,volume:{level:a.g.volume,muted:a.g.muted}};c&&(d.media=c);$s(a,{requestId:b,type:"MEDIA_STATUS",status:[d]},a.u)}
async function kt(a,b,c){for(const d in b.player)a.h[d](b.player[d]);a.F(c);c=a.g.autoplay;if(b.manifest){a.g.autoplay=!1;try{await a.h.load(b.manifest,b.startTime);if(b.addThumbnailsTrackCalls)for(const d of b.addThumbnailsTrackCalls)a.h.Wd(...d);if(b.addTextTrackAsyncCalls)for(const d of b.addTextTrackAsyncCalls)a.h.fd(...d);if(b.addChaptersTrackCalls)for(const d of b.addChaptersTrackCalls)a.h.Vd(...d)}catch(d){b=(new Map).set("detail",d);b=new L("error",b);a.h&&a.h.dispatchEvent(b);return}}else await Promise.resolve();
if(a.h){for(const d in b.video)a.g[d]=b.video[d];for(const d in b.playerAfterLoad)a.h[d](b.playerAfterLoad[d]);a.g.autoplay=c;b.manifest&&(a.g.play(),it(a))}}function $s(a,b,c,d){a.G&&(a=is(b),d?c.getCastChannel(d).send(a):c.broadcast(a))}function jt(a,b=0){const c={contentId:a.h.Kc(),streamType:a.h.U()?"LIVE":"BUFFERED",contentType:""};a.h.U()||(c.duration=a.g.duration);a.i&&(c.metadata=a.i);it(a,b,c)}function lt(a,b,c,d,e){a.h&&$s(a,{type:"asyncComplete",id:c,error:d,res:e},a.l,b)}
var qt=class extends Vf{constructor(a,b,c,d){super();this.g=a;this.h=b;this.j=new Aa;this.H={video:a,player:b};this.F=c||(()=>{});this.I=d||(e=>e);this.i=null;this.G=!1;this.o=!0;this.m=0;this.B=!1;this.A=!0;this.u=this.l=null;this.C=new Ce(()=>{Ys(this)});bt(this)}isConnected(){return this.G}ki(){return this.o}Xi(a){this.i=a}qh(){this.i=null}Yi(a){this.i||(this.i={metadataType:cast.receiver.media.MetadataType.GENERIC});this.i.title=a}Wi(a){this.i||(this.i={metadataType:cast.receiver.media.MetadataType.GENERIC});
this.i.images=[{url:a}]}Vi(a){this.i||(this.i={});this.i.artist=a;this.i.metadataType=cast.receiver.media.MetadataType.MUSIC_TRACK}async destroy(){this.j&&(this.j.release(),this.j=null);const a=[];this.h&&(a.push(this.h.destroy()),this.h=null);this.C&&(this.C.stop(),this.C=null);this.F=this.H=this.g=null;this.G=!1;this.o=!0;this.u=this.l=null;super.release();await Promise.all(a);cast.receiver.CastReceiverManager.getInstance().stop()}};v("shaka.cast.CastReceiver",qt);qt.prototype.destroy=qt.prototype.destroy;
qt.prototype.setContentArtist=qt.prototype.Vi;qt.prototype.setContentImage=qt.prototype.Wi;qt.prototype.setContentTitle=qt.prototype.Yi;qt.prototype.clearContentMetadata=qt.prototype.qh;qt.prototype.setContentMetadata=qt.prototype.Xi;qt.prototype.isIdle=qt.prototype.ki;qt.prototype.isConnected=qt.prototype.isConnected;var Zs=.5,ht=5,mt="IDLE",pt="PLAYING",nt="BUFFERING",ot="PAUSED";function rt(a,b,c,d,e){if(d>=e)return null;var f=-1;let g=-1;for(var h=0;h<c.length;h++)if(c[h].some(t=>t!=null&&t.g.trim()!="")){f=h;break}for(h=c.length-1;h>=0;h--)if(c[h].some(t=>t!=null&&t.g.trim()!="")){g=h;break}if(f===-1||g===-1)return null;let k=h=!1,l="white",m="black";for(var n=st(d,e,h,k,l,m);f<=g;f++){var p=c[f],r=-1;let t=-1;for(var q=0;q<p.length;q++)if(p[q]!=null&&p[q].g.trim()!==""){r=q;break}for(q=p.length-1;q>=0;q--)if(p[q]!=null&&p[q].g.trim()!==""){t=q;break}if(r===-1||t===-1)p=
tt(d,e),a.nestedCues.push(p);else{for(;r<=t;r++){q=p[r];if(!q){n.payload+=" ";continue}const u=q.l,x=q.i,y=q.j,w=q.h;if(u!=h||x!=k||y!=l||w!=m)n.payload&&a.nestedCues.push(n),n=st(d,e,u,x,y,w),h=u,k=x,l=y,m=w;n.payload+=q.g}n.payload&&a.nestedCues.push(n);f!==g&&(n=tt(d,e),a.nestedCues.push(n));n=st(d,e,h,k,l,m)}}return a.nestedCues.length?{cue:a,stream:b}:null}function st(a,b,c,d,e,f){a=new ud(a,b,"");c&&a.textDecoration.push(Hd);d&&(a.fontStyle=Gd);a.color=e;a.backgroundColor=f;return a}
function tt(a,b){a=new ud(a,b,"");a.lineBreak=!0;return a}var ut=class{constructor(a,b,c,d,e){this.g=a;this.l=b;this.i=c;this.h=d;this.j=e}};function vt(a){wt(a,0,15);a.g=1}function xt(a,b,c){const d=`CC${(a.C<<1|a.B)+1}`,e=new ud(b,c,"");e.lineInterpretation=1;let f=yt.get(a.g);f&&(e.line=f);a.u!=null&&a.A!=null&&(e.position=10+Math.min(70,a.u*10)+a.A*2.5);(b=rt(e,d,a.i,b,c))&&a.g+b.cue.nestedCues.length-3>15&&(f=yt.get(a.g+3-b.cue.nestedCues.length))&&(e.line=f);return b}
function zt(a,b,c){if(!(c<32||c>127)){var d="";switch(b){case 0:d=At.has(c)?At.get(c):String.fromCharCode(c);break;case 1:d=Bt.get(c);break;case 2:a.i[a.g].pop();d=Ct.get(c);break;case 3:a.i[a.g].pop(),d=Dt.get(c)}d&&a.i[a.g].push(new ut(d,a.m,a.j,a.o,a.l))}}function Et(a,b,c,d){if(!(c<0||b<0))if(b>=c)for(--d;d>=0;d--)a.i[b+d]=a.i[c+d].map(e=>e);else for(let e=0;e<d;e++)a.i[b+e]=a.i[c+e].map(f=>f)}function wt(a,b,c){for(let d=0;d<=c;d++)a.i[b+d]=[]}
var Ft=class{constructor(a,b){this.i=[];this.g=1;this.h=0;this.C=a;this.B=b;this.j=this.m=!1;this.l="white";this.o="black";this.u=this.A=null;vt(this)}},At=new Map([[39,"\u2019"],[42,"\u00e1"],[92,"\u00e9"],[92,"\u00e9"],[94,"\u00ed"],[95,"\u00f3"],[96,"\u00fa"],[123,"\u00e7"],[124,"\u00f7"],[125,"\u00d1"],[126,"\u00f1"],[127,"\u2588"]]),Bt=new Map([[48,"\u00ae"],[49,"\u00b0"],[50,"\u00bd"],[51,"\u00bf"],[52,"\u2122"],[53,"\u00a2"],[54,"\u00a3"],[55,"\u266a"],[56,"\u00e0"],[57," "],[58,"\u00e8"],
[59,"\u00e2"],[60,"\u00ea"],[61,"\u00ee"],[62,"\u00f4"],[63,"\u00fb"]]),Ct=new Map([[32,"\u00c1"],[33,"\u00c9"],[34,"\u00d3"],[35,"\u00da"],[36,"\u00dc"],[37,"\u00fc"],[38,"\u2018"],[39,"\u00a1"],[40,"*"],[41,"'"],[42,"\u2500"],[43,"\u00a9"],[44,"\u2120"],[45,"\u00b7"],[46,"\u201c"],[47,"\u201d"],[48,"\u00c0"],[49,"\u00c2"],[50,"\u00c7"],[51,"\u00c8"],[52,"\u00ca"],[53,"\u00cb"],[54,"\u00eb"],[55,"\u00ce"],[56,"\u00cf"],[57,"\u00ef"],[58,"\u00d4"],[59,"\u00d9"],[60,"\u00f9"],[61,"\u00db"],[62,"\u00ab"],
[63,"\u00bb"]]),Dt=new Map([[32,"\u00c3"],[33,"\u00e3"],[34,"\u00cd"],[35,"\u00cc"],[36,"\u00ec"],[37,"\u00d2"],[38,"\u00f2"],[39,"\u00d5"],[40,"\u00f5"],[41,"{"],[42,"}"],[43,"\\"],[44,"^"],[45,"_"],[46,"|"],[47,"~"],[48,"\u00c4"],[49,"\u00e4"],[50,"\u00d6"],[51,"\u00f6"],[52,"\u00df"],[53,"\u00a5"],[54,"\u00a4"],[55,"\u2502"],[56,"\u00c5"],[57,"\u00e5"],[58,"\u00d8"],[59,"\u00f8"],[60,"\u250c"],[61,"\u2510"],[62,"\u2514"],[63,"\u2518"]]),yt=new Map([[1,10],[2,15.33],[3,20.66],[4,26],[5,31.33],[6,
36.66],[7,42],[8,47.33],[9,52.66],[10,58],[11,63.33],[12,68.66],[13,74],[14,79.33],[15,84.66]]);function Gt(a){a.h=1;a.g=a.j;a.g.h=0}function Ht(a,b,c){a.g=a.i;const d=a.g;let e=null;a.h!==3&&a.h!==4&&(e=xt(d,a.l,c),c=a.i,c.g=c.h>0?c.h:0,wt(c,0,15),c=a.j,c.g=c.h>0?c.h:0,wt(c,0,15),d.g=15);a.h=3;d.h=b;return e}function It(a){la("Cea608DataChannel","CEA-608 text mode entered, but is unsupported");a.g=a.o;a.h=4}
var Jt=class{constructor(a,b){this.h=0;this.o=new Ft(a,b);this.i=new Ft(a,b);this.g=this.j=new Ft(a,b);this.l=0;this.m=null}},Kt="black green blue cyan red yellow magenta black".split(" "),Lt="white green blue cyan red yellow magenta white_italics".split(" ");function Mt(a){a.i=[];for(let b=0;b<16;b++)a.i.push(Nt())}function Nt(){const a=[];for(let b=0;b<42;b++)a.push(null);return a}function Ot(a){const b=a.g<a.m&&a.g>=0;return a.h<a.o&&a.h>=0&&b}function Pt(a,b){Ot(a)&&(a.i[a.h][a.g]=new ut(b,a.C,a.A,a.u,a.B),a.g++)}function Qt(a){let b=0;for(var c=1;c<16;c++,b++)a.i[b]=a.i[c];for(c=0;c<1;c++,b++)a.i[b]=Nt()}
function Rt(a,b,c){const d=new ud(a.j,b,"");d.textAlign=a.F===0?"left":a.F===1?"right":Dd;var e=d.region;a.I&&(e.id+="svc"+a.I);e.id+="win"+a.M;e.height=a.o;e.width=a.m;e.heightUnits=2;e.widthUnits=2;e.viewportAnchorX=a.H;e.viewportAnchorY=a.K;e.viewportAnchorUnits=a.J?wc:2;switch(a.G){case 0:e.regionAnchorX=0;e.regionAnchorY=0;break;case 1:e.regionAnchorX=50;e.regionAnchorY=0;break;case 2:e.regionAnchorX=100;e.regionAnchorY=0;break;case 3:e.regionAnchorX=0;e.regionAnchorY=50;break;case 4:e.regionAnchorX=
50;e.regionAnchorY=50;break;case 5:e.regionAnchorX=100;e.regionAnchorY=50;break;case 6:e.regionAnchorX=0;e.regionAnchorY=100;break;case 7:e.regionAnchorX=50;e.regionAnchorY=100;break;case 8:e.regionAnchorX=100,e.regionAnchorY=100}if(c=rt(d,`svc${c}`,a.i,a.j,b))a.j=b;return c}
var St=class{constructor(a,b){this.I=b;this.M=a;this.J=this.l=!1;this.m=this.o=this.G=this.K=this.H=0;this.F=2;this.i=[];this.g=this.h=this.j=0;this.C=this.A=!1;this.B="white";this.u="black";Mt(this)}isVisible(){return this.l}display(){this.l=!0}};function Tt(a,b){b.type===3?(a.g=(b.value&63)*2-1,a.h=[]):a.h&&(a.g>0&&(a.h.push(b),a.g--),a.g===0&&(a.i.push(new Ut(a.h)),a.h=null,a.g=0))}var Vt=class{constructor(){this.i=[];this.h=null;this.g=0}};function Wt(a){if(!a.Ga())throw new F(2,2,3E3);return a.h[a.g++]}var Ut=class{constructor(a){this.g=0;this.h=a}Ga(){return this.g<this.h.length}Ka(){return this.g}skip(a){if(this.g+a>this.h.length)throw new F(2,2,3E3);this.g+=a}Pg(a){if(this.g-a<0)throw new F(2,2,3E3);this.g-=a}};function Xt(a,b,c,d){if(!a.g)return[];if(c==24)return c=Wt(b).value,d=Wt(b).value,c=(f=>f.map(g=>("0"+(g&255).toString(16)).slice(-2)).join(""))([c,d]),Pt(a.g,String.fromCharCode(parseInt(c,16))),[];b=a.g;let e=null;switch(c){case 8:!Ot(b)||b.g<=0&&b.h<=0||(b.g<=0?(b.g=b.m-1,b.h--):b.g--,b.i[b.h][b.g]=null);break;case 13:b.isVisible()&&(e=Rt(b,d,a.i));b.h+1>=b.o?Qt(b):b.h++;b.g=0;break;case 14:b.isVisible()&&(e=Rt(b,d,a.i));b.i[b.h]=Nt();b.g=0;break;case 12:b.isVisible()&&(e=Rt(b,d,a.i)),Mt(b),b.h=
0,b.g=0}return e?[e]:[]}
function Yt(a,b,c,d){if(c>=128&&c<=135)d=c&7,a.h[d]&&(a.g=a.h[d]);else{if(c===136){var e=Wt(b).value;b=[];for(var f of Zt(a,e)){e=a.h[f];if(e.isVisible()){var g=Rt(e,d,a.i);g&&b.push(g)}Mt(e)}return b}if(c===137){b=Wt(b).value;for(var h of Zt(a,b))b=a.h[h],b.isVisible()||(b.j=d),b.display()}else{if(c===138){f=Wt(b).value;b=null;for(e of Zt(a,f))f=a.h[e],f.isVisible()&&(b=Rt(f,d,a.i)),f.l=!1;return b?[b]:[]}if(c===139){f=Wt(b).value;b=null;for(g of Zt(a,f))f=a.h[g],f.isVisible()?b=Rt(f,d,a.i):f.j=
d,f.l=!f.l;return b?[b]:[]}if(c===140)return b=Wt(b).value,$t(a,b,d);if(c===143)return d=$t(a,255,d),au(a),d;if(c===144)b.skip(1),b=Wt(b).value,a.g&&(d=(b&64)>0,a.g.A=(b&128)>0,a.g.C=d);else if(c===145)d=Wt(b).value,f=Wt(b).value,b.skip(1),a.g&&(b=bu((f&48)>>4,(f&12)>>2,f&3),a.g.B=bu((d&48)>>4,(d&12)>>2,d&3),a.g.u=b);else if(c===146)d=Wt(b).value,b=Wt(b).value,a.g&&(a=a.g,a.h=d&15,a.g=b&63);else if(c===151)b.skip(1),b.skip(1),d=Wt(b).value,b.skip(1),a.g&&(a.g.F=d&3);else if(c>=152&&c<=159){f=(c&15)-
8;e=a.h[f]!==null;e||(g=new St(f,a.i),g.j=d,a.h[f]=g);d=Wt(b).value;g=Wt(b).value;h=Wt(b).value;c=Wt(b).value;const k=Wt(b).value;b=Wt(b).value;e&&(b&7)===0||(b=a.h[f],b.h=0,b.g=0,b.C=!1,b.A=!1,b.B="white",b.u="black");b=a.h[f];b.l=(d&32)>0;b.K=g&127;b.H=h;b.G=(c&240)>>4;b.J=(g&128)>0;b.o=(c&15)+1;b.m=(k&63)+1;a.g=a.h[f]}}}return[]}function $t(a,b,c){const d=[];for(const e of Zt(a,b))b=a.h[e],b.isVisible()&&(b=Rt(b,c,a.i))&&d.push(b),a.h[e]=null;return d}
function Zt(a,b){const c=[];for(let d=0;d<8;d++)(b&1)===1&&a.h[d]&&c.push(d),b>>=1;return c}function au(a){a.g=null;a.h=[null,null,null,null,null,null,null,null]}function bu(a,b,c){const d={0:0,1:0,2:1,3:1};a=d[a];b=d[b];c=d[c];return cu[a<<2|b<<1|c]}
var du=class{constructor(a){this.i=a;this.h=[null,null,null,null,null,null,null,null];this.g=null}},eu=new Map([[32," "],[33,"\u00a0"],[37,"\u2026"],[42,"\u0160"],[44,"\u0152"],[48,"\u2588"],[49,"\u2018"],[50,"\u2019"],[51,"\u201c"],[52,"\u201d"],[53,"\u2022"],[57,"\u2122"],[58,"\u0161"],[60,"\u0153"],[61,"\u2120"],[63,"\u0178"],[118,"\u215b"],[119,"\u215c"],[120,"\u215d"],[121,"\u215e"],[122,"\u2502"],[123,"\u2510"],[124,"\u2514"],[125,"\u2500"],[126,"\u2518"],[127,"\u250c"]]),cu="black blue green cyan red magenta yellow white".split(" ");function fu(a){a.o=0;a.u=0;for(const b of a.m.values())b.h=0,b.g=b.j,b.m=null,vt(b.i),vt(b.j),vt(b.o);a.B=!0}
function gu(a,b){var c=b.type;if((b.ob&112)===16){var d=b.ob>>3&1;c===0?a.o=d:a.u=d}d=`CC${(c<<1|(c?a.u:a.o))+1}`;c=a.m.get(d);if(b.ob===255&&b.Tb===255||!b.ob&&!b.Tb||!hu(b.ob)||!hu(b.Tb))return++a.l>=45&&fu(a),null;a.l=0;b.ob&=127;b.Tb&=127;var e=b.ob;if(e>=1&&e<=15||!b.ob&&!b.Tb)return null;e=null;if((b.ob&112)===16)a:{a.A.add(d),d=b.ob;a=b.Tb;if(c.m===(d<<8|a))c.m=null;else if(c.m=d<<8|a,(d&240)===16&&(a&192)===64){b=[11,11,1,2,3,4,12,13,14,15,5,6,7,8,9,10][(d&7)<<1|a>>5&1];d="white";e=!1;let g=
null;var f=a>95?a-96:a-64;f<=13?d=Lt[Math.floor(f/2)]:f<=15?e=!0:g=Math.floor((f-16)/2);f=(a&1)===1;c.h!==4&&(a=c.g,c.h===3&&b!==a.g&&(c=1+b-a.h,Et(a,c,1+a.g-a.h,a.h),wt(a,0,c-1),wt(a,b+1,15-b)),a.g=b,a.m=f,a.j=e,a.l=d,a.u=g,a.o="black")}else if((d&247)===17&&(a&240)===32)c.g.m=!1,c.g.j=!1,c.g.l="white",zt(c.g,0,32),d=!1,b=Lt[(a&14)>>1],b==="white_italics"&&(b="white",d=!0),c.g.m=(a&1)===1,c.g.j=d,c.g.l=b;else if((d&247)===16&&(a&240)===32||(d&247)===23&&(a&255)===45)b="black",(d&7)===0&&(b=Kt[(a&
14)>>1]),c.g.o=b;else if((d&247)===17&&(a&240)===48)zt(c.g,1,a);else if((d&246)===18&&(a&224)===32)zt(c.g,d&1?3:2,a);else{if((d&246)===20&&(a&240)===32){a=b.pts;d=null;switch(b.Tb){case 32:Gt(c);break;case 33:c=c.g;c.i[c.g].pop();break;case 37:d=Ht(c,2,a);break;case 38:d=Ht(c,3,a);break;case 39:d=Ht(c,4,a);break;case 40:zt(c.g,0,32);break;case 41:c.h=2;c.g=c.i;c.g.h=0;c.l=a;break;case 42:vt(c.o);It(c);break;case 43:It(c);break;case 44:b=c.i;d=null;c.h!==4&&(d=xt(b,c.l,a));wt(b,0,15);break;case 45:e=
c.g;c.h!==3?d=null:(b=xt(e,c.l,a),d=e.g-e.h+1,Et(e,d-1,d,e.h),wt(e,0,d-1),wt(e,e.g,15-e.g),c.l=a,d=b);break;case 46:wt(c.j,0,15);break;case 47:b=null,c.h!==4&&(b=xt(c.i,c.l,a)),d=c.j,c.j=c.i,c.i=d,Gt(c),c.l=a,d=b}e=d;break a}(d==23||d==31)&&a>=33&&a<=35&&(c.g.A=a-32)}e=null}else a=b.Tb,zt(c.g,0,b.ob),zt(c.g,0,a);return e}
function iu(a,b){const c=[];try{for(;b.Ga();){const h=Wt(b).value;var d=(h&224)>>5;const k=h&31;d===7&&k!=0&&(d=Wt(b).value&63);if(d!=0){a.A.add("svc"+d);a.j.has(d)||a.j.set(d,new du(d));const l=a.j.get(d),m=b.Ka();for(;b.Ka()-m<k;){{d=l;var e=b;const n=Wt(e);let p=n.value;const r=n.pts;if(p===16){const q=Wt(e);p=p<<16|q.value}if(p>=0&&p<=31)var f=Xt(d,e,p,r);else if(p>=128&&p<=159)f=Yt(d,e,p,r);else{if(p>=4096&&p<=4127)d=e,e=p&255,e>=8&&e<=15?d.skip(1):e>=16&&e<=23?d.skip(2):e>=24&&e<=31&&d.skip(3);
else if(p>=4224&&p<=4255)d=e,e=p&255,e>=128&&e<=135?d.skip(4):e>=136&&e<=143&&d.skip(5);else if(p>=32&&p<=127)e=p,d.g&&(e===127?Pt(d.g,"\u266a"):Pt(d.g,String.fromCharCode(e)));else if(p>=160&&p<=255)d.g&&Pt(d.g,String.fromCharCode(p));else if(p>=4128&&p<=4223){if(e=p&255,d.g)if(eu.has(e)){var g=eu.get(e);Pt(d.g,g)}else Pt(d.g,"_")}else p>=4256&&p<=4351&&d.g&&((p&255)!=160?Pt(d.g,"_"):Pt(d.g,"[CC]"));f=[]}}c.push(...f)}}}}catch(h){if(h instanceof F&&h.code===3E3)la("CEA708_INVALID_DATA","Buffer read out of bounds / invalid CEA-708 Data.");
else throw h;}return c}function hu(a){let b=0;for(;a;)b^=a&1,a>>=1;return b===1}
var ju=class{constructor(){this.h=[];this.g=[];this.i=new Vt;this.l=0;this.m=new Map([["CC1",new Jt(0,0)],["CC2",new Jt(0,1)],["CC3",new Jt(1,0)],["CC4",new Jt(1,1)]]);this.u=this.o=0;this.j=new Map;this.B=!0;this.A=new Set;fu(this)}clear(){this.l=0;this.h=[];this.g=[];var a=this.i;a.i=[];a.h=[];a.g=0;fu(this);for(const b of this.j.values())au(b)}extract(a,b){if(this.B){for(var c of this.m.values())c.l=b;this.B=!1}a=new sg(a,0);if(!(a.getLength()<8)&&a.Z()===181&&a.Ca()===49&&a.V()===1195456820&&
a.Z()===3&&(c=a.Z(),(c&64)!==0)){c&=31;a.skip(1);for(let e=0;e<c;e++){var d=a.Z();const f=(d&4)>>2,g=a.Z(),h=a.Z();f&&(d&=3,d===0||d===1?this.h.push({pts:b,type:d,ob:g,Tb:h,order:this.h.length}):(this.g.push({pts:b,type:d,value:g,order:this.g.length}),this.g.push({pts:b,type:2,value:h,order:this.g.length})))}}}decode(){const a=[];var b=(d,e)=>d.pts-e.pts||d.order-e.order;this.h.sort(b);this.g.sort(b);for(var c of this.h)(b=gu(this,c))&&a.push(b);for(const d of this.g)Tt(this.i,d);c=this.i.i;for(const d of c)c=
iu(this,d),a.push(...c);this.i.i=[];this.h=[];this.g=[];return a}getStreams(){return Array.from(this.A)}};v("shaka.cea.CeaDecoder",ju);uc=()=>new ju;function ku(a){const b=[];for(var c=a,d=a=0;d<c.length;)a==2&&c[d]==3?(a=0,c=[...c],c.splice(d,1),c=new Uint8Array(c)):c[d]==0?a++:a=0,d++;a=c;for(d=0;d<a.length;){for(c=0;a[d]==255;)c+=255,d++;c+=a[d++];let e=0;for(;a[d]==255;)e+=255,d++;e+=a[d++];c==4&&b.push(a.subarray(d,d+e));d+=e}return b};function lu(a,b,c,d,e,f,g,h,k){let l=0,m=f;var n=h.map(q=>q.Sf);n=[].concat(...n);n.length&&(m=n[0].sampleSize||f);for(b.skip(g+h[0].Xe);b.Ga();){g=b.V();var p=b.Z(),r=null;r=!1;h=1;switch(a.g){case mu:r=p&31;r=r==6;break;case nu:h=2;b.skip(1);r=p>>1&63;r=r==39||r==40;break;case ou:h=2;b.skip(1);r=p>>1&63;r=r==23||r==24;break;default:return}if(r){p=0;l<n.length&&(p=n[l].Ce||0);p=(c+p)/d;h=b.Bb(g-h,!1);for(const q of ku(h))k.push({packet:q,pts:p})}else try{b.skip(g-h)}catch(q){break}m-=g+4;m==0&&(c=
l<n.length?c+(n[l].Tf||e):c+e,l++,l<n.length?m=n[l].sampleSize||f:m=f)}}
var ru=class{constructor(){this.j=new Map;this.i=this.h=0;this.g=pu}init(a){const b=[],c=[];(new Dg).boxes("moov trak mdia minf stbl mvex".split(" "),vg).ka("trex",d=>{var e=d.reader;e.skip(4);e.skip(4);d=e.V();e=e.V();this.h=d;this.i=e}).ka("tkhd",d=>{var e=d.reader;d=d.version;d==1?(e.skip(8),e.skip(8)):(e.skip(4),e.skip(4));const f=e.V();d==1?e.skip(8):e.skip(4);e.skip(4);e.skip(8);e.skip(2);e.skip(2);e.skip(2);e.skip(2);e.skip(36);e.Ca();e.Ca();e.Ca();e.Ca();b.push(f)}).ka("mdhd",d=>{d=Ih(d.reader,
d.version);c.push(d.timescale)}).ka("stsd",xg).boxes("avc1 avc3 dvav dva1 hev1 hvc1 dvh1 dvhe vvc1 vvi1 dvc1 dvi1".split(" "),d=>{d=d.name;qu.has(d)&&(this.g=qu.get(d))}).box("encv",yg).box("sinf",vg).box("frma",d=>{({codec:d}=Mh(d.reader));qu.has(d)&&(this.g=qu.get(d))}).parse(a,!0,!0);if(!b.length||!c.length||b.length!=c.length)throw new F(2,2,2010);this.g==pu&&ja("Unable to determine bitstream format for CEA parsing!");b.forEach((d,e)=>{this.j.set(d,c[e])})}parse(a){if(this.g==pu)return[];const b=
[];let c=0,d=[];(new Dg).box("moof",e=>{c=e.start;d=[];vg(e)}).box("traf",e=>{d.push({baseMediaDecodeTime:null,jd:this.h,kd:this.i,Ng:[],timescale:9E4});vg(e)}).ka("trun",e=>{const f=d[d.length-1];e=Jh(e.reader,e.version,e.flags);f.Ng.push(e)}).ka("tfhd",e=>{const f=d[d.length-1];e=Gh(e.reader,e.flags);f.jd=e.jd||this.h;f.kd=e.kd||this.i;e=e.trackId;this.j.has(e)&&(f.timescale=this.j.get(e))}).ka("tfdt",e=>{const f=d[d.length-1];e=Hh(e.reader,e.version);f.baseMediaDecodeTime=e.baseMediaDecodeTime}).box("mdat",
e=>{const f=c-e.start-8,g=e.reader.Ka();for(const h of d)h.baseMediaDecodeTime===null?ja("Unable to find base media decode time for CEA captions!"):(e.reader.seek(g),lu(this,e.reader,h.baseMediaDecodeTime,h.timescale,h.jd,h.kd,f,h.Ng,b))}).parse(a,!1,!0);return b}};v("shaka.cea.Mp4CeaParser",ru);
var pu=0,mu=1,nu=2,ou=3,qu=(new Map).set("avc1",mu).set("avc3",mu).set("dvav",mu).set("dva1",mu).set("hev1",nu).set("hvc1",nu).set("dvh1",nu).set("dvhe",nu).set("vvc1",ou).set("vvi1",ou).set("dvc1",ou).set("dvi1",ou);sc("video/mp4",()=>new ru);var su=class{constructor(){this.g=null}init(){}parse(a){this.g?this.g.clearData():this.g=new vj;const b=[];a=C(a);if(!nj(a))return b;var c=this.g.parse(a);a=c.ld();c=c.ee();const d=[];switch(a.video){case "avc":d.push(6);break;case "hvc":d.push(39),d.push(40)}if(!d.length)return b;for(const e of c)if(d.includes(e.type)&&e.time!=null)for(const f of ku(e.data))b.push({packet:f,pts:e.time});return b}};v("shaka.cea.TsCeaParser",su);sc("video/mp2t",()=>new su);function tu(a){var b=0,c=ob(a),d=c.getUint32(b,!0);if(d!=a.byteLength)return[];a:{a=b+4+2;for(b=[];a<c.byteLength-1;){d=c.getUint16(a,!0);a+=2;const e=c.getUint16(a,!0);a+=2;if((e&1)!=0||e+a>c.byteLength){c=[];break a}const f=C(c,a,e);b.push({type:d,value:f});a+=e}c=b}return c}function uu(a){a=Ob(Vc(a));a=tu(a).filter(b=>b.type===vu)[0];if(!a)return null;a=Fb(a.value,!0);return(a=Lc(a,"WRMHEADER"))?a:null}
function wu(a){try{const c=uu(a);if(c)a:{for(const d of Xc(c,"DATA"))if(d.children)for(const e of d.children)if(e.tagName=="LA_URL"){var b=Vc(e);break a}b=""}else b="";return b}catch(c){return""}}var vu=1;function xu(a){var b=Zc(a.node,"https://dashif.org/CPS","Laurl");if(b&&(b=Vc(b)))return b;if((b=Zc(a.node,"urn:microsoft:playready","pro"))&&Vc(b))return wu(b);if(a=Zc(a.node,"urn:mpeg:cenc:2013","pssh"))if(a=Vc(a)){b=Ob(a);a=8;b=ob(b);const c=b.getUint8(a);a+=20;c>0&&(a+=4+16*b.getUint32(a));a=C(b,a+4);a=Mb(a);a=Lc("<pro>"+a+"</pro>");return wu(a)}return""}
function yu(a,b,c,d,e){const f=[];for(const l of c)if(c=d[l.Zc]){a:{var g=Zc(l.node,"urn:microsoft:playready","pro");if(!g||!Vc(g)){g=null;break a}g=Vc(g);g=Ob(g);var h=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);g=[{initData:Eg(g,h,new Set,0),initDataType:"cenc",keyId:l.keyId}]}h=null;if(l.Zc==="urn:uuid:e2719d58-a985-b3c9-781a-b030af78d30e")a:{h=l;var k=e;if(k.size==0){h=null;break a}const m=new Uint8Array([16,119,239,236,192,178,77,2,172,227,60,30,82,226,251,75]),
n=new Uint8Array([]);h=[{initData:Eg(n,m,k,1),initDataType:"cenc",keyId:h.keyId}]}g=Wb(c,b,l.init||a||g||h);if(c=zu.get(c))g.licenseServerUri=c(l);a:{if(c=Zc(l.node,"https://dashif.org/CPS","Certurl"))if(c=Vc(c))break a;c=""}g.serverCertificateUri=c;f.push(g)}return f}
function Au(a){if(!window.crypto||!window.crypto.subtle)throw ja("Web Crypto API is not available to decrypt AES-128. (Web Crypto only exists in secure origins like https)"),new F(2,4,4042);var b=Zc(a.node,"urn:mpeg:dash:schema:sea:2012","SegmentEncryption");if(!b)throw new F(2,4,4051);if(b.attributes.schemeIdUri!="urn:mpeg:dash:sea:aes128-cbc:2013")throw new F(2,4,4051);b=Zc(a.node,"urn:mpeg:dash:schema:sea:2012","CryptoPeriod");if(!b)throw new F(2,4,4051);a=b.attributes.IV;b=Kb(b.attributes.keyUriTemplate);
if(!a||!b)throw new F(2,4,4051);a=Pb(a.substr(2));if(a.byteLength!=16)throw new F(2,4,4048);return{pi:b,iv:a}}function Bu(a,b){const c=[];for(const d of b)(b=Cu(a,d))&&c.push(b);return c}
function Du(a,b,c,d){const e=Bu(a,b);let f=null;a=[];var g=[];b=null;const h=new Set(e.map(m=>m.keyId));h.delete(null);let k="cenc";if(h.size>1)throw new F(2,4,4010);if(!c){g=e.filter(m=>m.Zc=="urn:mpeg:dash:sea:2012");if(g.length>1)throw new F(2,4,4050);g.length&&(b=Au(g[0]));(g=e.find(m=>m.Zc=="urn:mpeg:dash:mp4protection:2011"))&&g.encryptionScheme&&(k=g.encryptionScheme);g=e.filter(m=>m.Zc=="urn:mpeg:dash:mp4protection:2011"?(f=m.init||f,!1):m.Zc!="urn:mpeg:dash:sea:2012");g.length&&(a=yu(f,k,
g,d,h),a.length==0&&(a=[Wb("",k,f)]))}if(e.length&&!b&&(c||!g.length)){a=[];for(var l of Object.values(d))vb(l)||(c=Wb(l,k,f),a.push(c))}if(l=Array.from(h)[0]||null)for(const m of a)for(const n of m.initData)n.keyId=l;return{qg:l,vk:f,drmInfos:a,Qe:b,vg:!0}}
function Eu(a,b,c,d,e){const f=Du(a,b,d,e);if(c.vg){a=c.drmInfos.length==1&&!c.drmInfos[0].keySystem;b=f.drmInfos.length==0;if(c.drmInfos.length==0||a&&!b)c.drmInfos=f.drmInfos;c.vg=!1}else if(f.drmInfos.length>0&&(c.drmInfos=c.drmInfos.filter(g=>f.drmInfos.some(h=>h.keySystem==g.keySystem)),c.drmInfos.length==0))throw new F(2,4,4008);return f.qg||c.qg}
function Cu(a,b){let c=b.attributes.schemeIdUri,d=ad(b,"urn:mpeg:cenc:2013","default_KID");const e=$c(b,"urn:mpeg:cenc:2013","pssh").map(Wc),f=b.attributes.value;if(!c)return null;c=c.toLowerCase();if(d&&(d=d.replace(/-/g,"").toLowerCase(),d.includes(" ")))throw new F(2,4,4009);let g=[];try{g=e.map(h=>{if(!a.g.has(h)){const k=Ob(h);a.g.set(h,k)}return{initDataType:"cenc",initData:a.g.get(h),keyId:null}})}catch(h){throw new F(2,4,4007);}return{node:b,Zc:c,keyId:d,init:g.length>0?g:null,encryptionScheme:f}}
var Fu=class{constructor(){this.g=new Map}release(){this.g.clear()}},zu=(new Map).set("com.apple.fps",function(a){if("apple"===window.shakaMediaKeysPolyfill)throw new F(2,4,4054);if(a=Zc(a.node,"https://dashif.org/CPS","Laurl"))if(a=Vc(a))return a;return""}).set("com.widevine.alpha",function(a){var b=Zc(a.node,"https://dashif.org/CPS","Laurl");return b&&(b=Vc(b))?b:(a=Zc(a.node,"urn:microsoft","laurl"))?Kb(a.attributes.licenseUrl)||"":""}).set("com.microsoft.playready",xu).set("com.microsoft.playready.recommendation",
xu).set("com.microsoft.playready.software",xu).set("com.microsoft.playready.hardware",xu).set("org.w3.clearkey",function(a){var b=Zc(a.node,"https://dashif.org/CPS","Laurl");return b&&(b=Vc(b))?b:(a=Zc(a.node,"http://dashif.org/guidelines/clearKey","Laurl"))&&a.attributes.Lic_type==="EME-1.0"&&a&&(a=Vc(a))?a:""});function Gu(a,b,c,d,e,f){const g=(new Map).set("RepresentationID",b).set("Number",c).set("SubNumber",d).set("Bandwidth",e).set("Time",f);return a.replace(/\$(RepresentationID|Number|SubNumber|Bandwidth|Time)?(?:%0([0-9]+)([diouxX]))?\$/g,(h,k,l,m)=>{if(h=="$$")return"$";let n=g.get(k);if(n==null)return h;k=="RepresentationID"&&l&&(l=void 0);k=="Time"&&typeof n!="bigint"&&(Math.abs(n-Math.round(n))>=.2&&ja("Calculated $Time$ values must be close to integers"),n=Math.round(n));switch(m){case void 0:case "d":case "i":case "u":h=
n.toString();break;case "o":h=n.toString(8);break;case "x":h=n.toString(16);break;case "X":h=n.toString(16).toUpperCase();break;default:h=n.toString()}l=window.parseInt(l,10)||1;return Array(Math.max(0,l-h.length)+1).join("0")+h})}
function Hu(a,b){var c=Iu(a,b,"timescale");let d=1;c&&(d=gd(c)||1);c=Iu(a,b,"duration");const e=(c=gd(c||""))?c/d:null;var f=Iu(a,b,"startNumber");const g=Number(Iu(a,b,"presentationTimeOffset"))||0;let h=hd(f||"");if(f==null||h==null)h=1;f=null;if(b=Ju(a,b,"SegmentTimeline")){b=Uc(b,"S");f=d;a=a.na.duration||Infinity;var k=h;const q=[];var l=-g;for(let t=0;t<b.length;++t){var m=b[t],n=b[t+1],p=H(m,"t",hd);const u=H(m,"d",hd);var r=H(m,"r",fd);m=H(m,"k",fd)||0;p!=null&&(p-=g);if(!u)continue;p=p!=
null?p:l;r=r||0;if(r<0)if(n){n=H(n,"t",hd);if(n==null)break;else if(p>=n)break;r=Math.ceil((n-p)/u)-1}else{if(a==Infinity)break;else if(p/f>=a)break;r=Math.ceil((a*f-p)/u)-1}q.length>0&&p!=l&&(q[q.length-1].end=p/f);for(n=0;n<=r;++n)l=p+u,q.push({start:p/f,cd:p,end:l/f,fg:l,$b:m,Ri:q.length+k}),p=l}f=q}return{timescale:d,Ie:c,Za:e,Cd:h,Qb:g/d||0,Cc:g,timeline:f}}function Ku(a,b){return[b(a.L),b(a.oa),b(a.wa)].filter(Fe)}
function Iu(a,b,c){a=Ku(a,b);b=null;for(const d of a)if(b=d.attributes[c])break;return b}function Ju(a,b,c){a=Ku(a,b);b=null;for(const d of a)if(b=Yc(d,c))break;return b}
function Lu(a,b,c,d,e,f){const g=ad(a,"http://www.w3.org/1999/xlink","href"),h=ad(a,"http://www.w3.org/1999/xlink","actuate")||"onRequest";for(const l of Object.keys(a.attributes)){const m=l.split(":"),n=Rc("http://www.w3.org/1999/xlink");m[0]==n&&delete a.attributes[l]}if(f>=5)return Mf(new F(2,4,4028));if(h!="onLoad")return Mf(new F(2,4,4027));const k=Vb([d],[g]);return e.request(0,ag(k,b)).Qa(l=>{l=Kc(l.data,a.tagName);if(!l)return Mf(new F(2,4,4001,g));for(a.children=[];l.children.length;){const m=
l.children.shift();a.children.push(m)}for(const m of Object.keys(l.attributes))a.attributes[m]=l.attributes[m];return Mu(a,b,c,k[0],e,f+1)})}
function Mu(a,b,c,d,e,f=0){if(ad(a,"http://www.w3.org/1999/xlink","href")){var g=Lu(a,b,c,d,e,f);c&&(g=g.Qa(void 0,()=>Mu(a,b,c,d,e,f)));return g}g=[];for(const h of Tc(a))ad(h,"http://www.w3.org/1999/xlink","href")=="urn:mpeg:dash:resolve-to-zero:2013"?a.children=a.children.filter(k=>k!==h):h.tagName!="SegmentTimeline"&&g.push(Mu(h,b,c,d,e,f));return Rf(g).Qa(()=>a)};function Nu(a,b,c,d,e,f,g,h){let k;const l=(new Dg).ka("sidx",m=>{k=Ou(b,d,e,f,g,c,m,h)});a&&l.parse(a);if(k)return k;throw new F(2,3,3004);}
function Ou(a,b,c,d,e,f,g,h=!1){const k=[];g.reader.skip(4);const l=g.reader.V();if(l==0)throw new F(2,3,3005);if(g.version==0){var m=g.reader.V();var n=g.reader.V()}else m=g.reader.Xc(),n=g.reader.Xc();g.reader.skip(2);const p=g.reader.Ca();a=(h?-g.size:a)+g.size+n;for(h=0;h<p;h++){var r=g.reader.V();n=(r&2147483648)>>>31;r&=2147483647;const q=g.reader.V();g.reader.skip(4);if(n==1)throw new F(2,3,3006);k.push(new M(m/l+c,(m+q)/l+c,()=>f,a,a+r-1,b,c,d,e));m+=q;a+=r}g.parser.stop();return k};function Su(a){const b=a.g.Ka();var c=a.g.Z();if(c==0)throw new F(2,3,3002);c=8-Math.floor(Math.log2(c));a.g.skip(c-1);return C(a.h,b,c)}
function Tu(a){var b=Su(a);if(b.length>7)throw new F(2,3,3002);var c=0;for(var d of b)c=256*c+d;b=c;c=Su(a);a:{for(e of Uu)if(kb(c,new Uint8Array(e))){var e=!0;break a}e=!1}if(e)c=a.h.byteLength-a.g.Ka();else{if(c.length==8&&c[1]&224)throw new F(2,3,3001);e=0;for(d=0;d<c.length;d++){const f=c[d];e=d==0?f&(1<<8-c.length)-1:256*e+f}c=e}c=a.g.Ka()+c<=a.h.byteLength?c:a.h.byteLength-a.g.Ka();e=ob(a.h,a.g.Ka(),c);a.g.skip(c);return new Vu(b,e)}
var Wu=class{constructor(a){this.h=ob(a);this.g=new sg(this.h,0)}Ga(){return this.g.Ga()}},Uu=[[255],[127,255],[63,255,255],[31,255,255,255],[15,255,255,255,255],[7,255,255,255,255,255],[3,255,255,255,255,255,255],[1,255,255,255,255,255,255,255]];function Xu(a){if(a.g.byteLength>8)throw new F(2,3,3002);if(a.g.byteLength==8&&a.g.getUint8(0)&224)throw new F(2,3,3001);let b=0;for(let c=0;c<a.g.byteLength;c++){const d=a.g.getUint8(c);b=256*b+d}return b}var Vu=class{constructor(a,b){this.id=a;this.g=b}};function Yu(a,b,c,d,e,f,g){b=new Wu(b);if(Tu(b).id!=440786851)throw new F(2,3,3008);var h=Tu(b);if(h.id!=408125543)throw new F(2,3,3009);b=h.g.byteOffset;h=new Wu(h.g);for(var k=null;h.Ga();){var l=Tu(h);if(l.id==357149030){k=l;break}}if(!k)throw new F(2,3,3010);k=new Wu(k.g);l=1E6;for(h=null;k.Ga();){const m=Tu(k);if(m.id==2807729)l=Xu(m);else if(m.id==17545)if(m.g.byteLength==4)h=m.g.getFloat32(0);else if(m.g.byteLength==8)h=m.g.getFloat64(0);else throw new F(2,3,3003);}if(h==null)throw new F(2,
3,3011);k=l/1E9;h*=k;a=Tu(new Wu(a));if(a.id!=475249515)throw new F(2,3,3007);return Zu(a,b,k,h,c,d,e,f,g)}function Zu(a,b,c,d,e,f,g,h,k){const l=[],m=()=>e;a=new Wu(a.g);let n=null,p=null;for(;a.Ga();){var r=Tu(a);if(r.id!=187)continue;var q=$u(r);if(!q)continue;r=c*q.ej;q=b+q.Ki;n!=null&&l.push(new M(n+g,r+g,m,p,q-1,f,g,h,k));n=r;p=q}n!=null&&l.push(new M(n+g,d+g,m,p,null,f,g,h,k));return l}
function $u(a){var b=new Wu(a.g);a=Tu(b);if(a.id!=179)throw new F(2,3,3013);a=Xu(a);b=Tu(b);if(b.id!=183)throw new F(2,3,3012);b=new Wu(b.g);let c=0;for(;b.Ga();){const d=Tu(b);if(d.id==241){c=Xu(d);break}}return{ej:a,Ki:c}};function av(a,b,c){b=Ju(a,b,"Initialization");if(!b)return null;let d=a.L.Ua();var e=b.attributes.sourceURL;e&&(d=Vb(d,[Kb(e)],a.xb()));e=0;let f=null;if(b=H(b,"range",ed))e=b.start,f=b.end;c=new yi(()=>d,e,f,bv(a),null,null,c,a.oa.encrypted);c.codecs=a.L.codecs;c.mimeType=a.L.mimeType;a.na&&!a.na.ke&&(c.g=a.na.start+a.na.duration);return c}
function bv(a){const b=a.L;return{bandwidth:a.bandwidth,audioSamplingRate:b.audioSamplingRate,codecs:b.codecs,contentType:b.contentType,frameRate:b.frameRate||null,height:b.height||null,mimeType:b.mimeType,channelsCount:b.xe,pixelAspectRatio:b.pixelAspectRatio||null,width:b.width||null,label:a.oa.label||null,roles:a.roles||null,language:a.oa.language||null}}
function cv(a,b,c){const d=Number(Iu(a,dv,"presentationTimeOffset"))||0,e=Iu(a,dv,"timescale");let f=1;e&&(f=gd(e)||1);const g=d/f||0,h=av(a,dv,c);ev(a,h);const k=Hc(a);return{endTime:-1,timeline:-1,tc:()=>{var l=Ju(k,dv,"RepresentationIndex");var m=k.L.Ua();l&&(l=Kb(l.attributes.sourceURL))&&(m=Vb(m,[l],k.xb()));l=fv(k);return gv(k,b,h,m,l.start,l.end,g)},timescale:f}}
async function gv(a,b,c,d,e,f,g){const h=a.presentationTimeline,k=!a.eb||!a.na.ke,l=a.na.start;var m=a.na.duration;const n=a.L.mimeType.split("/")[1];var p=null;f=[b(d,e,f,!1),n=="webm"?b(c.P(),c.startByte,c.endByte,!0):null];b=null;b=await Promise.all(f);f=b[0];b=b[1]||null;p=null;g=l-g;m=m?l+m:Infinity;p=a.L.Ua();const r=p.length!=d.length||p.some((q,t)=>q!=d[t]);p=n=="mp4"?Nu(f,e,p,c,g,l,m,r):Yu(f,b,p,c,g,l,m);for(const q of p)q.codecs=a.L.codecs,q.mimeType=a.L.mimeType,q.bandwidth=a.bandwidth;
h.wd(p);p=new Uk(p);k&&p.Ic(l,m,!0);return p}function dv(a){return a.$c}function fv(a){const b=Ju(a,dv,"RepresentationIndex");a=Iu(a,dv,"indexRange");a=ed(a||"");b&&(a=H(b,"range",ed,a));return a}function ev(a,b){hv(a,b);if(!fv(a))throw new F(2,4,4002);}function hv(a,b){const c=a.L.mimeType.split("/")[1];if(a.L.contentType!=G&&c!="mp4"&&c!="webm")throw new F(2,4,4006);if(c=="webm"&&!b)throw new F(2,4,4005);};function iv(a,b,c){const d=av(a,jv,c),e=kv(a);if(!e.Za&&!e.timeline&&e.Rc.length>1)throw new F(2,4,4002);if(!e.Za&&!a.na.duration&&!e.timeline&&e.Rc.length==1)throw new F(2,4,4002);if(e.timeline&&e.timeline.length==0)throw new F(2,4,4002);let f=null,g=null;a.wa.id&&a.L.id&&(g=b.get(a.wa.id+","+a.L.id))&&(f=g.segmentIndex);const h=lv(a.na.start,a.na.duration,a.L.Ua,e,d,c,a.L.mimeType,a.L.codecs,a.bandwidth,a.xb);b=!f;f?f.ud(h,a.presentationTimeline.ub()):f=new Uk(h);a.presentationTimeline.wd(h);a.eb&&
a.na.ke||f.Ic(a.na.start,a.na.duration?a.na.start+a.na.duration:Infinity,b);g&&(g.segmentIndex=f);return{endTime:-1,timeline:-1,tc:()=>{f&&f.getNumReferences()!=0||f.re(h);return Promise.resolve(f)},timescale:e.timescale}}function jv(a){return a.bc}function kv(a){const b=mv(a);a=Hu(a,jv);let c=a.Cd;c==0&&(c=1);let d=0;a.Za?d=a.Za*(c-1):a.timeline&&a.timeline.length>0&&(d=a.timeline[0].start);return{Za:a.Za,startTime:d,Cd:c,Qb:a.Qb,timescale:a.timescale,timeline:a.timeline,Rc:b}}
function lv(a,b,c,d,e,f,g,h,k,l){let m=d.Rc.length;d.timeline&&d.timeline.length!=d.Rc.length&&(m=Math.min(d.timeline.length,d.Rc.length));const n=a-d.Qb,p=b?a+b:Infinity,r=[];var q=d.startTime;for(let u=0;u<m;u++){const x=d.Rc[u];var t=q;q=d.Za!=null?t+d.Za:d.timeline?d.timeline[u].end:t+b;let y=null;t=new M(a+t,a+q,()=>{y==null&&(y=Vb(c(),[x.xi],l()));return y},x.start,x.end,e,n,a,p,[],"",null,null,Bi,f);t.codecs=h;t.mimeType=g;t.bandwidth=k;r.push(t)}return r}
function mv(a){return[a.L.bc,a.oa.bc,a.wa.bc].filter(Fe).map(b=>Uc(b,"SegmentURL")).reduce((b,c)=>b.length>0?b:c).map(b=>{b.attributes.indexRange&&!a.zf&&(a.zf=!0);const c=Kb(b.attributes.media);b=H(b,"mediaRange",ed,{start:0,end:null});return{xi:c,start:b.start,end:b.end}})};function nv(a,b,c,d,e,f,g,h,k,l){k||a.L.ie||(a.L.ie=Iu(a,ov,"initialization"));const m=a.L.ie?pv(a,g):null,n=qv(a);rv(n);const p=Hc(a);if(n.rd)return hv(a,m),{endTime:-1,timeline:-1,tc:()=>{var x=Gu(n.rd,p.L.originalId,null,null,p.bandwidth||null,null);x=Vb(p.L.Ua(),[x]);return gv(p,b,m,x,0,null,n.Qb)},timescale:n.timescale};if(n.Za){if(!d&&a.oa.contentType!=="image"&&a.oa.contentType!=="text"){l=a.na.start;var r=a.wa.id;d=a.na.duration;r=(r=r!=null&&f.get(r)||d)?l+r:Infinity;a.presentationTimeline.Ff(n.Za);
a.presentationTimeline.Lg(l,r)}return{endTime:-1,timeline:-1,tc:()=>sv(p,n,e,m,f,g,h,a.L.De),timescale:n.timescale}}let q=null;d=d=null;a.wa.id&&a.L.id&&(d=a.wa.id+","+a.L.id,d=c.get(d))&&(q=d.segmentIndex);const t=a.na.start,u=a.na.duration?t+a.na.duration:Infinity;if(q)l=q,tv(l,n,t,u,m,a.eb),l.Oa(a.presentationTimeline.ub());else{c=0;k=-1;if(a.wa.id!=null&&a.L.id!=null){const x=l.get(a.wa.id);if(x)k=x.timeline;else for(r of l.values())if(Math.abs(n.Qb-r.endTime)<=cc&&r.Pf.includes(a.L.id)){k=r.timeline;
break}else r.timeline>=c&&(c=r.timeline+1)}k==-1&&(k=c);q=new uv(a.eb,n,a.L.originalId,a.bandwidth,a.L.Ua,a.xb,t,u,m,g,a.L.De,k)}n.timeline&&a.oa.contentType!=="image"&&a.oa.contentType!=="text"&&a.presentationTimeline.Mg(q.h?q.h.timeline:[],t);d&&a.eb&&(d.segmentIndex=q);l=(l=(l=n.timeline)&&l[l.length-1])?l.end+n.Qb:-1;r=-1;q instanceof uv&&(r=q.u());return{endTime:l,timeline:r,tc:()=>{q instanceof uv&&q.getNumReferences()==0&&tv(q,n,t,u,m,a.eb);return Promise.resolve(q)},timescale:n.timescale}}
function ov(a){return a.qc}function qv(a){const b=Hu(a,ov),c=Iu(a,ov,"media"),d=Iu(a,ov,"index"),e=Iu(a,ov,"k");let f=0;e&&(f=parseInt(e,10));return{Ie:b.Ie,Za:b.Za,timescale:b.timescale,Cd:b.Cd,Qb:b.Qb,Cc:b.Cc,timeline:b.timeline,Nb:c&&Kb(c),rd:d,mimeType:a.L.mimeType,codecs:a.L.codecs,bandwidth:a.bandwidth,Ai:f}}function rv(a){let b;b=a.rd?1:0;b+=a.timeline?1:0;b+=a.Za?1:0;if(b==0)throw new F(2,4,4002);b!=1&&(a.rd&&(a.timeline=null),a.Ie=null,a.Za=null);if(!a.rd&&!a.Nb)throw new F(2,4,4002);}
function sv(a,b,c,d,e,f,g,h){const k=a.presentationTimeline,l=a.na.start,m=a.wa.id,n=a.na.duration,p=()=>{const J=m!=null&&e.get(m)||n;return J?l+J:Infinity},r=b.Za,q=b.Cd,t=b.Nb,u=a.bandwidth||null,x=a.L.originalId,y=a.L.Ua,w=a.xb,z=l-b.Qb,A=()=>{var J=[Math.max(k.ub(),l),Math.min(k.jc(),p())].map(K=>K-l);J=[Math.ceil(J[0]/r),Math.ceil(J[1]/r)-1];a.L.bb&&J[1]++;return J.map(K=>K+q)};var B=A();c=a.eb?Math.max(B[0],B[1]-c+1):B[0];g=g||B[1];const D=J=>{var K=J-q,ba=K*r,I=b.Ie;let aa=K*I;"BigInt"in window&&
aa>Number.MAX_SAFE_INTEGER&&(aa=BigInt(K)*BigInt(I));ba+=l;K=ba+r;I=Math.min(K,p());const N=[],ra=b.Ai;if(ra){const Oa=(I-ba)/ra;for(let pb=0;pb<ra;pb++){var Ka=ba+Oa*pb;const hb=pb;Ka=new M(Ka,Ka+Oa,()=>{const Tb=Gu(t,x,J,hb,u,aa);return Vb(y(),[Tb],w())},0,null,d,z,l,p(),[],"",null,null,Bi,f);Ka.codecs=a.L.codecs;Ka.mimeType=a.L.mimeType;h==0?pb>0&&Ka.Pc():pb%h!=0&&Ka.Pc();N.push(Ka)}}ba=new M(ba,I,()=>{if(ra)return[];const Oa=Gu(t,x,J,null,u,aa);return Vb(y(),[Oa],w())},0,null,d,z,l,p(),N,"",null,
null,Bi,f,N.length>0);ba.codecs=a.L.codecs;ba.mimeType=a.L.mimeType;ba.bandwidth=a.bandwidth;ba.j=K;return ba},E=new vv(c,g,q,l,r,D);B=k.jc()<p();const Z=k.U();if(B||Z){let J=Math.max(c,g+1);c=r;a.L.bb&&(c=.1);E.Je(c,()=>{const K=k.ub();E.Oa(K);const [,ba]=A(),I=[];for(;J<=ba;){const aa=D(J);I.push(aa);J++}return K>p()&&!I.length?null:I})}return Promise.resolve(E)}
function pv(a,b){let c=a.L.ie;c||=Iu(a,ov,"initialization");if(!c)return null;c=Kb(c);const d=a.L.originalId,e=a.bandwidth||null,f=a.L.Ua,g=a.xb;b=new yi(()=>{const h=Gu(c,d,null,null,e,null);return Vb(f(),[h],g())},0,null,bv(a),null,null,b,a.oa.encrypted);b.codecs=a.L.codecs;b.mimeType=a.L.mimeType;a.na&&!a.na.ke&&(b.g=a.na.start+a.na.duration);return b}
var vv=class extends Uk{constructor(a,b,c,d,e,f){super(Array(Math.max(0,b-a+1)));this.h=a;this.A=c;this.j=d;this.l=e;this.B=f}find(a){var b=this.g.length-1;if(b<0)return null;var c=this.get(this.i);if(!c)return null;if(a<c.startTime)return this.i;c=Math.floor((a-this.j)/this.l)+this.A-this.h;if(c<this.i)return null;const d=this.get(c);if(!d)return null;b=(b=c-this.i<b?this.get(c+1):null)?b.startTime:d.endTime;return a>=d.startTime&&a<b?c:null}get(a){const b=a-this.i;if(b<0||b>=this.g.length)return null;
let c=this.g[b];c||(c=this.B(this.h+a),this.g[b]=c);return c}qb(){return this.get(this.i)}fb(a){for(let b=0;b<this.g.length;b++){const c=this.get(b+this.i);c&&a(c)}}Oa(a){if(!this.o){var b=this.g.length-1;if(!(b<0)){var c=this.get(this.i);!c||c.endTime>a||(a=(b=this.get(this.i+b))&&b.endTime<=a?this.g.length:Math.max(0,Math.min(this.g.length,Math.floor((a-this.j)/this.l+this.A-1)-(this.h+this.i)+1)),a>0&&(this.i+=a,this.g=this.g.slice(a)))}}}};
function wv(a,b,c,d,e,f,g,h){a=Gu(a,b,c,f,d||null,e);return Vb(g(),[a],h()).map(k=>k.toString())}
function tv(a,b,c,d,e,f){xv(a,e);a.F=f;if(a.h){if(a.h.Cc!==b.Cc)for(c=b.Cc-a.h.Cc,e=0;e<b.timeline.length;e++)f=b.timeline[e],f.cd+=c,f.fg+=c,f.start=(f.cd+c)/b.timescale,f.end=(f.fg+c)/b.timescale;a.h.Nb!==b.Nb&&(a.h.Nb=b.Nb);c=a.h.timeline;if(c.length){const g=c[c.length-1];b=b.timeline.filter(h=>h.end>g.end)}else b=b.timeline.slice();b.length>0&&a.h.timeline.push(...b);a.l!==d&&(a.l=d)}else a.h=b,a.j=c,a.l=d;yv(a)}
function yv(a){if(a.h&&!a.o){var b=a.h.timeline,c=[];for(const d of b)d.start>=a.l||d.end<=0||c.push(d);a.h.timeline=c;a.Oa(a.j)}}function xv(a,b){if(a.A!==b){a.A=b;for(const c of a.g)c&&Ai(c,b)}}
var uv=class extends Uk{constructor(a,b,c,d,e,f,g,h,k,l,m,n){super([]);this.F=a;this.h=b;this.H=c;this.C=d;this.G=e;this.J=f;this.j=g;this.l=h;this.A=k;this.B=l;this.I=m;this.K=n;yv(this)}getNumReferences(){return this.h?this.h.timeline.length:0}release(){super.release();this.h=null}Oa(a){if(this.h){var b=this.h.timeline;if(b){for(var c=0;c<b.length&&b[c].end+this.j<=a;)c++;c>0&&(this.h.timeline=b.slice(c),this.g.length>=c&&(this.g=this.g.slice(c)),this.i+=c,this.getNumReferences()===0&&this.release())}}}find(a){if(this.h&&
this.h.timeline&&this.h.timeline.length&&a<this.h.timeline[0].start+this.j)return this.i;if(!this.h)return null;var b=this.h.timeline;if(a<this.j||a>=this.l)return null;const c=b.length-1,d=wa(b,g=>g.start+this.j<=a)-1;if(d<0)return null;const e=b[d],f=e.start+this.j;b=d<c?b[d+1].start+this.j:this.l===Infinity?e.end+this.j:this.l;return a>=f&&a<b?d+this.i:null}get(a){a-=this.i;if(a<0||a>=this.getNumReferences()||!this.h)return null;var b=this.g[a];if(!b){b=this.h.timeline[a];const e=b.Ri,f=b.cd+this.h.Cc,
g=this.j-this.h.Qb,h=this.j+b.end;let k=h;a===this.getNumReferences()-1&&this.l!==Infinity&&(k=this.F&&Math.abs(k-this.l)>.1?Math.min(k,this.l):this.l);const l=this.h.codecs,m=this.h.mimeType,n=this.h.bandwidth,p=[];var c=!1;b.$b&&this.h&&this.h.Nb&&(c=this.h.Nb.includes("$SubNumber$"));if(c){c=(b.end-b.start)/b.$b;for(let r=0;r<b.$b;r++){var d=b.start+c*r;const q=r;let t=null;d=new M(this.j+d,this.j+(d+c),()=>{if(!this.h)return[];t==null&&(t=wv(this.h.Nb,this.H,e,this.C,f,q,this.G,this.J));return t},
0,null,this.A,g,this.j,this.l,[],"",null,null,Bi,this.B);d.codecs=l;d.mimeType=m;d.bandwidth=n;this.I==0?r>0&&d.Pc():r%this.I!=0&&d.Pc();p.push(d)}}b=new M(this.j+b.start,k,()=>p.length>0||!this.h?[]:wv(this.h.Nb,this.H,e,this.C,f,null,this.G,this.J),0,null,this.A,g,this.j,this.l,p,"",null,null,Bi,this.B,p.length>0);b.codecs=l;b.mimeType=m;b.j=h;b.bandwidth=n;this.g[a]=b}return b}fb(a){yv(this);for(let b=0;b<this.getNumReferences();b++){const c=this.get(b+this.i);c&&a(c)}}u(){return this.K}};function zv(a,b){if(!a.m.length)return b;b=new Ua(b);const c=a.B||a.m[0],d=Math.round(a.A.getBandwidthEstimate()),e=b.g;a.u=="DASH"?(e.add("_DASH_pathway",c),e.add("_DASH_throughput",String(d))):a.u=="HLS"&&(e.add("_HLS_pathway",c),e.add("_HLS_throughput",String(d)));jb(e);e.hd&&Za(b,e);return b.toString()}function Av(a,b,c){a.g!=null&&(a.g.stop(),a.g=null);const d=b["RELOAD-URI"]||c;a.g=new Ce(()=>{Bv(a,d)});if(c=b.TTL)a.C=c;a.g.ma(a.C);a.m=b["PATHWAY-PRIORITY"]||[];a.F=b["PATHWAY-CLONES"]||[]}
async function Bv(a,b){var c=Vb(a.i,[zv(a,b)]);c=a.A.networkingEngine.request(8,ag(c,a.o.retryParameters));Wf(a.G,c);try{const d=await c.promise,e=Eb(d.data),f=JSON.parse(e);f.VERSION==1&&Av(a,f,d.uri)}catch(d){d&&d.code==7001||(a.g!=null&&(a.g.stop(),a.g=null),a.g=new Ce(()=>{Bv(a,b)}),a.g.ma(a.C))}}function Cv(a,b,c,d){let e=a.l.get(b);e||=new Map;e.set(c,d);a.l.set(b,e)}
function Dv(a,b,c=!1){b=a.l.get(b)||new Map;var d=[];for(const h of a.m){var e=b.get(h);if(e)d.push({Kf:h,location:e});else if(e=a.F.find(k=>k.Cj==h)){var f=b.get(e["BASE-ID"]);f&&(e["URI-REPLACEMENT"].gh?(f=new Ua(f),Wa(f,e["URI-REPLACEMENT"].gh),d.push({Kf:h,location:f.toString()})):d.push({Kf:h,location:f}))}}e=Date.now();for(var g of a.j.keys())f=a.j.get(g),e>f&&a.j.delete(g);d=d.filter(h=>{for(const k of a.j.keys())if(k.includes((new Ua(h.location)).pb))return!1;return!0});d.length&&(a.B=d[0].Kf);
g=d.map(h=>h.location);if(!g.length&&a.h)for(const h of a.h.split(","))if(d=b.get(h))a.B=a.h,g.push(d);if(!g.length)for(const h of b.values())g.push(h);return c?g:Vb(a.i,g)}
var Ev=class{constructor(a){this.o=null;this.A=a;this.G=new Xf;this.i=[];this.h=null;this.m=[];this.B=null;this.F=[];this.C=300;this.l=new Map;this.j=new Map;this.g=null;this.u="UNKNOWN"}configure(a){this.o=a}destroy(){this.A=this.o=null;this.i=[];this.h=null;this.m=[];this.F=[];this.l.clear();this.g!=null&&(this.g.stop(),this.g=null);return this.G.destroy()}setManifestType(a){this.u=a}banLocation(a){this.j.set(a,Date.now()+6E4)}};function Fv(a){const b=Object.assign({},a);b.originalId=null;b.createSegmentIndex=()=>Promise.resolve();b.closeSegmentIndex=()=>{};b.roles=b.roles.slice();b.segmentIndex=null;b.emsgSchemeIdUris=[];b.keyIds=new Set(a.keyIds);b.closedCaptions=a.closedCaptions?new Map(a.closedCaptions):null;b.trickModeVideo=null;b.dependencyStream=null;return b}
function Gv(a,b){var c=(d,e)=>{d||=[];for(const f of e)d.includes(f)||d.push(f);return d};a.roles=c(a.roles,b.roles);b.emsgSchemeIdUris&&(a.emsgSchemeIdUris=c(a.emsgSchemeIdUris,b.emsgSchemeIdUris));for(const d of b.keyIds)a.keyIds.add(d);a.originalId==null?a.originalId=b.originalId:(c=b.originalId||"")&&!a.originalId.endsWith(c)&&(a.originalId+=","+c);c=ub(a.drmInfos,b.drmInfos);if(b.drmInfos.length&&a.drmInfos.length&&!c.length)throw new F(2,4,4038);a.drmInfos=c;a.encrypted=a.encrypted||b.encrypted;
if(b.closedCaptions){a.closedCaptions||(a.closedCaptions=new Map);for(const [d,e]of b.closedCaptions)a.closedCaptions.set(d,e)}a.bandwidth&&b.bandwidth&&(a.bandwidth=Math.max(a.bandwidth,b.bandwidth));b.trickModeVideo?(a.trickModeVideo||(a.trickModeVideo=Fv(b.trickModeVideo),a.trickModeVideo.matchedStreams=[],a.trickModeVideo.createSegmentIndex=()=>{if(a.trickModeVideo.segmentIndex)return Promise.resolve();const d=new Yk;for(const e of a.trickModeVideo.matchedStreams)d.h.push(e.segmentIndex);a.trickModeVideo.segmentIndex=
d;return Promise.resolve()}),a.trickModeVideo.matchedStreams.push(b.trickModeVideo),Gv(a.trickModeVideo,b.trickModeVideo)):a.trickModeVideo&&(a.trickModeVideo.matchedStreams.push(b),Gv(a.trickModeVideo,b));b.dependencyStream?(a.dependencyStream||(a.dependencyStream=Fv(b.dependencyStream),a.dependencyStream.matchedStreams=[],a.dependencyStream.createSegmentIndex=()=>{if(a.dependencyStream.segmentIndex)return Promise.resolve();const d=new Yk;for(const e of a.dependencyStream.matchedStreams)d.h.push(e.segmentIndex);
a.dependencyStream.segmentIndex=d;return Promise.resolve()}),a.dependencyStream.matchedStreams.push(b.dependencyStream),Gv(a.dependencyStream,b.dependencyStream)):a.dependencyStream&&(a.dependencyStream.matchedStreams.push(b),Gv(a.dependencyStream,b))}
async function Hv(a){if(a.length==1)return a[0];var b=a.map(k=>new Map(k.filter(l=>l.type==="audio").map(l=>[Iv(l),l]))),c=a.map(k=>new Map(k.filter(l=>l.type==="video").map(l=>[Jv(l),l]))),d=a.map(k=>new Map(k.filter(l=>l.type===G).map(l=>[Kv(l),l])));a=a.map(k=>new Map(k.filter(l=>l.type==="image").map(l=>[Lv(l),l])));for(var e of d){const k=Mv(G);e.set(Kv(k),k)}for(var f of a)e=Mv("image"),f.set(Lv(e),e);f=new Nv;b=await Ov(f,[],b,0,Pv,Qv,0);c=await Ov(f,[],c,0,Pv,Qv,0);d=await Ov(f,[],d,0,Pv,
Qv,0);a=await Ov(f,[],a,0,Pv,Qv,0);f=0;if(c.length&&b.length)for(var g of b)for(const k of c){var h=f++;k.variantIds.push(h);g.variantIds.push(h)}else{g=c.concat(b);for(h of g)h.variantIds=[f++]}return c.concat(b).concat(d).concat(a)}function Pv(a){const b=Object.assign({},a);b.roles=b.roles.slice();b.keyIds=new Set(a.keyIds);b.segments=[];b.variantIds=[];b.closedCaptions=a.closedCaptions?new Map(a.closedCaptions):null;return b}
function Qv(a,b){var c=a.roles,d=b.roles;c||=[];for(const e of d)c.includes(e)||c.push(e);a.roles=c;for(const e of b.keyIds)a.keyIds.add(e);a.encrypted=a.encrypted&&b.encrypted;a.segments.push(...b.segments);if(b.closedCaptions){a.closedCaptions||(a.closedCaptions=new Map);for(const [e,f]of b.closedCaptions)a.closedCaptions.set(e,f)}}function Rv(a){switch(a.type){case G:return!a.language;case "image":return!a.tilesLayout;default:return!1}}
async function Sv(a,b){var c=[];const d=a.matchedStreams;for(let e=b;e<d.length;e++){const f=d[e];c.push(f.createSegmentIndex());f.trickModeVideo&&!f.trickModeVideo.segmentIndex&&c.push(f.trickModeVideo.createSegmentIndex());f.dependencyStream&&!f.dependencyStream.segmentIndex&&c.push(f.dependencyStream.createSegmentIndex())}await Promise.all(c);if(a.segmentIndex instanceof Yk)for(;b<d.length;b++)c=d[b],c.segmentIndex&&a.segmentIndex.h.push(c.segmentIndex)}
function Tv(a,b,c,d,e){const f=a.matchedStreams;for(b+=e;b<f.length;b++){const h=f[b];c(a,h);var g=!0;a.type=="audio"&&Me(a.language,h.language)==0&&(g=!1);if(g&&((g=d[b-e])&&g.delete(h),h.fullMimeTypes))for(const k of h.fullMimeTypes.values())a.fullMimeTypes.add(k)}}function Iv(a){return Uv([a.fastSwitching,a.channelsCount,a.language,a.bandwidth,a.label,a.codecs,a.mimeType,a.roles,a.audioSamplingRate,a.primary,a.dependencyStream?a.dependencyStream.baseOriginalId:null,Array.from(a.keyIds)])}
function Jv(a){return Uv([a.fastSwitching,a.width,a.frameRate,a.codecs,a.mimeType,a.label,a.roles,a.closedCaptions?Array.from(a.closedCaptions.entries()):null,a.bandwidth,a.dependencyStream?a.dependencyStream.baseOriginalId:null,Array.from(a.keyIds)])}function Kv(a){return Uv([a.language,a.label,a.codecs,a.mimeType,a.bandwidth,a.roles])}function Lv(a){return Uv([a.width,a.codecs,a.mimeType])}
function Vv(a,b){return b.language?a.forced!==b.forced||Me(a.language,b.language)==0||b.kind!=a.kind?!1:!0:!0}function Wv(){return!0}
function Xv(a,b,c){var d=Yv(a,b,c);if(d===Zv)return!0;if(d===$v)return!1;d=Me(a.language,b.language);var e=Me(a.language,c.language);if(e>d)return!0;if(e<d)return!1;if(b.label!==c.label){if(a.label===b.label)return!1;if(a.label===c.label)return!0}if(a.roles.length){d=b.roles.filter(f=>a.roles.includes(f));e=c.roles.filter(f=>a.roles.includes(f));if(e.length>d.length)return!0;if(e.length<d.length)return!1;if(c.roles.length!==b.roles.length)return c.roles.length<b.roles.length}else{if(!c.roles.length&&
b.roles.length)return!0;if(c.roles.length&&!b.roles.length)return!1}if(!b.primary&&c.primary)return!0;if(b.primary&&!c.primary)return!1;d=aw(a.channelsCount,b.channelsCount,c.channelsCount);if(d==Zv)return!0;if(d==$v)return!1;d=aw(a.audioSamplingRate,b.audioSamplingRate,c.audioSamplingRate);return d==Zv?!0:d==$v?!1:a.bandwidth&&bw(a.bandwidth,b.bandwidth,c.bandwidth)==Zv?!0:!1}
function cw(a,b,c){var d=Yv(a,b,c);if(d===Zv)return!0;if(d===$v)return!1;d=aw(a.width*a.height,b.width*b.height,c.width*c.height);if(d==Zv)return!0;if(d==$v)return!1;if(a.frameRate){d=aw(a.frameRate,b.frameRate,c.frameRate);if(d==Zv)return!0;if(d==$v)return!1}return a.bandwidth&&bw(a.bandwidth,b.bandwidth,c.bandwidth)==Zv?!0:!1}
function dw(a,b,c){var d=Me(a.language,b.language),e=Me(a.language,c.language);if(e>d)return!0;if(e<d)return!1;if(!b.primary&&c.primary)return!0;if(b.primary&&!c.primary)return!1;if(b.label!==c.label){if(a.label===b.label)return!1;if(a.label===c.label)return!0}if(a.roles.length){d=b.roles.filter(f=>a.roles.includes(f));e=c.roles.filter(f=>a.roles.includes(f));if(e.length>d.length)return!0;if(e.length<d.length)return!1}else{if(!c.roles.length&&b.roles.length)return!0;if(c.roles.length&&!b.roles.length)return!1}return c.mimeType!=
a.mimeType||c.codecs!=a.codecs||b.mimeType==a.mimeType&&b.codecs==a.codecs?!1:!0}function ew(a,b,c){return aw(a.width*a.height,b.width*b.height,c.width*c.height)==Zv?!0:!1}function fw(a,b){return a.mimeType!=b.mimeType?!1:gw(a.codecs)===gw(b.codecs)}function gw(a){if(!hw.has(a)){const b=ge(a);hw.set(a,b)}return hw.get(a)}
function Yv(a,b,c){const d=a.mimeType===b.mimeType&&a.codecs===b.codecs,e=a.mimeType===c.mimeType&&a.codecs===c.codecs;if(d&&!e)return $v;if(!d&&e)return Zv;b=fw(a,b);a=fw(a,c);return b&&!a?$v:!b&&a?Zv:iw}function aw(a,b,c){if(b==a&&a!=c)return $v;if(c==a&&a!=b)return Zv;if(b>a){if(c<=a||c-a<b-a)return Zv;if(c-a>b-a)return $v}else{if(c>a)return $v;if(a-c<a-b)return Zv;if(a-c>a-b)return $v}return iw}function bw(a,b,c){b=Math.abs(a-b);a=Math.abs(a-c);return a<b?Zv:b<a?$v:iw}
function Mv(a){return{id:0,originalId:"",groupId:null,primary:!1,type:a,mimeType:"",codecs:"",language:"",originalLanguage:null,label:null,width:null,height:null,encrypted:!1,keyIds:new Set,segments:[],variantIds:[],roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,external:!1,fastSwitching:!1,isAudioMuxedInVideo:!1,baseOriginalId:null}}
function jw(a){return{id:0,originalId:"",groupId:null,createSegmentIndex:()=>Promise.resolve(),segmentIndex:new Uk([]),mimeType:"",codecs:"",encrypted:!1,drmInfos:[],keyIds:new Set,language:"",originalLanguage:null,label:null,type:a,primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!1,fastSwitching:!1,fullMimeTypes:new Set,isAudioMuxedInVideo:!1,
baseOriginalId:null}}function Uv(a){return JSON.stringify(a)}async function Ov(a,b,c,d,e,f,g){const h=[];for(let k=0;k<c.length;k++)k>=d?h.push(new Set(c[k].values())):h.push(new Set);for(const k of b)if(!await kw(a,k,c,d,f,h,g))throw new F(2,4,4037);for(const k of h)for(const l of k)(d=lw(a,b,l,c,e,f,h))&&b.push(d);for(const k of h)for(const l of k)if(!Rv(l)&&b.some(m=>l.drmInfos&&!sb(l.drmInfos,m.drmInfos)?!1:!0))throw new F(2,4,4037);return b}
function mw(a,b){const c=[],d=[],e=[],f=[];for(const h of a){a=new Map(h.audioStreams.map(n=>[Iv(n),n]));const k=new Map(h.videoStreams.map(n=>[Jv(n),n])),l=new Map(h.textStreams.map(n=>[Kv(n),n])),m=new Map(h.imageStreams.map(n=>[Lv(n),n]));if(b){var g=jw(G);l.set(Kv(g),g);g=jw("image");m.set(Lv(g),g)}c.push(a);d.push(k);e.push(l);f.push(m)}return{lg:c,eh:d,Zg:e,Eg:f}}
async function kw(a,b,c,d,e,f,g){nw(a,c,b,g>0);if(!b.matchedStreams)return!1;b.segmentIndex&&await Sv(b,d+g);Tv(b,d,e,f,g);return!0}
function lw(a,b,c,d,e,f,g){if(Rv(c))return null;const h=e(c);nw(a,d,h);h.createSegmentIndex&&(h.createSegmentIndex=async()=>{h.segmentIndex||(h.segmentIndex=new Yk,await Sv(h,0))},h.closeSegmentIndex=()=>{h.segmentIndex&&(h.segmentIndex.release(),h.segmentIndex=null);if(h.matchedStreams)for(const n of h.matchedStreams){var k;if(k=n.segmentIndex){a:{k=n;var l=h,m=b;for(const p of m)if(p!==l&&p.segmentIndex&&p.matchedStreams&&p.matchedStreams.includes(k)){k=!0;break a}k=!1}k=!k}k&&(n.segmentIndex.release(),
n.segmentIndex=null)}});if(!h.matchedStreams||!h.matchedStreams.length)return null;Tv(h,0,f,g,0);return h}function nw(a,b,c,d=!1){d=d?c.matchedStreams:[];for(const e of b){b=ow(a,e,c);if(!b)return;d.push(b)}c.matchedStreams=d}
function ow(a,b,c){const d={audio:Iv,video:Jv,text:Kv,image:Lv}[c.type];let e=null;var f=d(c);if(b.has(f))e=b.get(f);else{f={audio:(h,k)=>h.drmInfos&&!sb(h.drmInfos,k.drmInfos)?!1:!0,video:(h,k)=>h.drmInfos&&!sb(h.drmInfos,k.drmInfos)?!1:!0,text:Vv,image:Wv}[c.type];const g={audio:Xv,video:cw,text:dw,image:ew}[c.type];for(const h of b.values())!f(c,h)||c.fastSwitching!=h.fastSwitching||e&&!g(c,e,h)||(e=h)}a.o&&!Rv(e)&&b.delete(d(e));return e}
var Nv=class{constructor(){this.l=[];this.h=[];this.g=[];this.j=[];this.i=[];this.o=!1;this.m=new Set}release(){const a=this.h.concat(this.g,this.j,this.i);for(const b of a)b.segmentIndex&&b.segmentIndex.release();this.h=[];this.g=[];this.j=[];this.i=[];this.l=[];this.o=!1;this.m.clear()}ai(){return this.l}xf(){return this.j.slice()}Ih(){return this.i}rg(a,b){if(a){if(a.type=="audio")for(const c of this.h)c.matchedStreams=c.matchedStreams.filter(d=>d!==a);else if(a.type=="video")for(const c of this.g)c.matchedStreams=
c.matchedStreams.filter(d=>d!==a),c.trickModeVideo&&(c.trickModeVideo.matchedStreams=c.trickModeVideo.matchedStreams.filter(d=>d!==a)),c.dependencyStream&&(c.dependencyStream.matchedStreams=c.dependencyStream.matchedStreams.filter(d=>d!==a));else if(a.type==G)for(const c of this.j)c.matchedStreams=c.matchedStreams.filter(d=>d!==a);else if(a.type=="image")for(const c of this.i)c.matchedStreams=c.matchedStreams.filter(d=>d!==a);a.segmentIndex&&a.closeSegmentIndex();this.m.delete(b)}}async Ue(a,b,c=
!1){if(b||a.length!=1){b=c?this.m.size:0;c=-1;for(var d=0;d<a.length;d++){const n=a[d];this.m.has(n.id)||(this.m.add(n.id),c==-1&&(c=d))}if(c==-1)return;const {lg:h,eh:k,Zg:l,Eg:m}=mw(a,!0);await Promise.all([Ov(this,this.h,h,c,Fv,Gv,b),Ov(this,this.g,k,c,Fv,Gv,b),Ov(this,this.j,l,c,Fv,Gv,b),Ov(this,this.i,m,c,Fv,Gv,b)])}else{const {lg:h,eh:k,Zg:l,Eg:m}=mw(a,!1);this.h=Array.from(h[0].values());this.g=Array.from(k[0].values());this.j=Array.from(l[0].values());this.i=Array.from(m[0].values())}a=0;
b=[];if(this.g.length&&this.h.length)for(var e of this.h)for(var f of this.g){var g=ub(e.drmInfos,f.drmInfos);if(e.drmInfos.length&&f.drmInfos.length&&!g.length)continue;c=(e.bandwidth||0)+(f.bandwidth||0);e.dependencyStream&&(c+=e.dependencyStream.bandwidth||0);f.dependencyStream&&(c+=f.dependencyStream.bandwidth||0);d=a++;b.push({id:d,language:e.language,disabledUntilTime:0,primary:e.primary,audio:e,video:f,bandwidth:c,drmInfos:g,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]})}else{e=
this.g.length?this.g:this.h;for(g of e)e=a++,f=g.bandwidth||0,g.dependencyStream&&(f+=g.dependencyStream.bandwidth||0),b.push({id:e,language:g.language,disabledUntilTime:0,primary:g.primary,audio:g.type=="audio"?g:null,video:g.type=="video"?g:null,bandwidth:f,drmInfos:g.drmInfos,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]})}this.l=b}Wg(a){this.o=a}};v("shaka.util.PeriodCombiner",Nv);Nv.prototype.setUseStreamOnce=Nv.prototype.Wg;Nv.prototype.combinePeriods=Nv.prototype.Ue;
Nv.prototype.deleteStream=Nv.prototype.rg;Nv.prototype.getImageStreams=Nv.prototype.Ih;Nv.prototype.getTextStreams=Nv.prototype.xf;Nv.prototype.getVariants=Nv.prototype.ai;var Zv=1,iw=0,$v=-1,hw=new Map;function pw(a,b){var c=new DOMParser;const d=qw.value()(a);a=null;try{a=c.parseFromString(d,"text/xml")}catch(e){return null}c=a.documentElement;if(!c||c.getElementsByTagName("parsererror").length||c.tagName!=b)return null;if(!("createNodeIterator"in document))return c;for(b=document.createNodeIterator(a,NodeFilter.SHOW_ALL);a=b.nextNode();)if(a instanceof HTMLElement||a instanceof SVGElement)return null;return c}function rw(a,b){try{const c=Hb(a);return pw(c,b)}catch(c){return null}}
var qw=new Ea(()=>{if(typeof trustedTypes!=="undefined"){const a=trustedTypes.createPolicy("shaka-player#xml",{createHTML:b=>b});return b=>a.createHTML(b)}return a=>a});function sw(a,b,c){return()=>a&&b?Dv(a,"BaseURL"):c.slice()}function tw(){return""}function uw(a,b){b=be(a,b);return re(b)?G:a.split("/")[0]}async function vw(a){let b=0;try{b=await ww(a)}catch(c){if(a.j){if(a.g.raiseFatalErrorOnManifestUpdateRequestFailure){a.j.onError(c);return}c.severity=1;a.j.onError(c)}}a.j&&(a.j.onManifestUpdated(),xw(a,b))}
async function ww(a){var b=4,c="MPD",d=yw(a);let e=a.A;d.length?(e=d,c="Patch",b=6):a.A.length>1&&a.i&&(d=Dv(a.i,"Location",!0),d.length&&(e=d));d=Date.now();b=await zw(a,ag(e,a.g.retryParameters),0,{type:b});if(!a.j)return 0;b.uri&&b.uri!=b.originalUri&&!a.A.includes(b.uri)&&a.A.unshift(b.uri);a.W=(new Ua(b.uri)).g.toString();await Aw(a,b.data,b.uri,c);c=(Date.now()-d)/1E3;a.Ba.sample(1,c);a.ea.clear();return c}
function xw(a,b){if(!(a.K<0)){var c=a.K;a.g.updatePeriod>=0&&(c=a.g.updatePeriod);a.M.ma(Math.max(c-b,ea(a.Ba)))}}function yw(a){const b=a.l.yd;if(!a.l.ue||!b||!a.H.length)return[];const c=Date.now()/1E3,d=a.H.filter(e=>{e=hd(e.attributes.ttl);return!e||b+e>c}).map(Wc).filter(Fe);return d.length?Vb(a.A,d):[]}function zw(a,b,c,d){d||={};d.isPreload=a.ha();b=a.j.networkingEngine.request(c,b,d);Wf(a.R,b);return b.promise}
async function Aw(a,b,c,d){var e=b;b=a.g.dash.manifestPreprocessor;if(b!=Wm){Ra("manifest.dash.manifestPreprocessor configuration","Please Use manifest.dash.manifestPreprocessorTXml instead.");e=rw(e,d);if(!e)throw new F(2,4,4001,c);b(e);e=Ib(e.outerHTML)}b=Kc(e,d);if(!b)throw new F(2,4,4001,c);e=a.g.dash.manifestPreprocessorTXml;e!=Xm&&e(b);if(d==="Patch")return Bw(a,b);if(a.g.dash.disableXlinkProcessing)return Cw(a,b,c);d=Mu(b,a.g.retryParameters,a.g.dash.xlinkFailGracefully,c,a.j.networkingEngine);
Wf(a.R,d);d=await d.promise;return Cw(a,d,c)}
async function Bw(a,b){var c=b.attributes.mpdId,d=H(b,"originalPublishTime",cd);if(!c||c!==a.l.ue||d!==a.l.yd)throw a.H=[],new F(1,4,4052);c=[];d=[];const e=new Set;for(const k of Tc(b)){b=nd(k.attributes.sel||"");var f=b[b.length-1];b=Wc(k)||"";if(f.name==="MPD")if(f.dc==="mediaPresentationDuration"){if(f=Wc(k)||"",b=a,f=dd(f),f!=null){b.l.Xb=f;for(const l of b.u.values())l.Xb=f}}else if(f.dc==="type"){f=a;f.h.presentationTimeline.Ac(b=="static");f.l.type=b;for(const l of f.u.values())l.eb=b=="dynamic";
b=="static"&&(f.K=-1)}else f.dc==="publishTime"?a.l.yd=cd(b)||0:f.dc===null&&k.tagName==="add"&&d.push(k);else if(f.name==="PatchLocation")od(a.H,k);else if(f.name==="Period")k.tagName==="add"?d.push(k):k.tagName==="remove"&&f.id&&Dw(a,f.id);else if(f.name==="SegmentTemplate"){a:{b=a;var g=nd(k.attributes.sel||"");f=g[g.length-1];if(!f.dc){b=[];break a}g=Ew(b,g);var h=Wc(k)||"";for(const l of g){const m=b.u.get(l);qd(m.L.qc,k.tagName,f.dc,h)}b=g}for(const l of b)e.add(l)}else if(f.name==="SegmentTimeline"||
f.name==="S"){b=a;f=nd(k.attributes.sel||"");f=Ew(b,f);for(const l of f)g=b.u.get(l),g=Ju(g,ov,"SegmentTimeline"),h=Uc(g,"S"),od(h,k),g.children=h;b=f;for(const l of b)e.add(l)}}for(const k of e)Fw(a,k);for(const k of d)c.push(...Gw(a,{eb:a.l.type=="dynamic",presentationTimeline:a.h.presentationTimeline,wa:null,na:null,oa:null,L:null,bandwidth:0,zf:!1,bb:a.l.bb,profiles:a.l.profiles,Xb:a.l.Xb,roles:null,xb:tw},a.l.Ua,k,!0).periods);c.length&&(a.h.periodCount+=c.length,a.h.gapCount=a.N,await Hw(a,
c,!0));a.l.type=="static"&&a.h.presentationTimeline.jb(a.l.Xb||Infinity)}
async function Cw(a,b,c){a.i&&a.i.l.clear();c=[c];var d=[],e=new Map,f=Uc(b,"Location");for(var g of f){f=g.attributes.serviceLocation;var h=Wc(g);if(!h)continue;h=Vb(c,[h])[0];f&&(a.i?Cv(a.i,"Location",f,h):e.set(f,h));d.push(h)}a.i?(g=Dv(a.i,"Location",!0),g.length>0&&(c=a.A=g)):d.length&&(c=a.A=d);a.l.ue=b.attributes.id||"";a.l.yd=H(b,"publishTime",cd)||0;a.H=Uc(b,"PatchLocation");g=Promise.resolve();if((d=Yc(b,"ContentSteering"))&&a.j){f=d.attributes.defaultServiceLocation;a.i?(a.i.i=c,a.i.h=
f):(a.i=new Ev(a.j),a.i.configure(a.g),a.i.setManifestType("DASH"),a.i.i=c,a.i.h=f,(f=Wc(d))&&(H(d,"queryBeforeStart",ld,!1)?g=Bv(a.i,f):Bv(a.i,f)));for(var k of e.keys())d=e.get(k),Cv(a.i,"Location",k,d)}k=Uc(b,"BaseURL");e=!1;if(a.i)for(var l of k)d=l.attributes.serviceLocation,f=Wc(l),d&&f&&(Cv(a.i,"BaseURL",d,f),e=!0);a.ua.splice(0);e&&a.i||(l=k.map(Wc),a.ua.push(...Vb(c,l)));c=sw.call(Iw,a.i,e,a.ua);a.l.Ua=c;f=0;k&&k.length&&(f=H(k[0],"availabilityTimeOffset",id)||0);a.l.bb=f;a.K=H(b,"minimumUpdatePeriod",
dd,-1);l=H(b,"availabilityStartTime",cd);h=H(b,"timeShiftBufferDepth",dd);k=null;a.g.dash.ignoreSuggestedPresentationDelay||(k=H(b,"suggestedPresentationDelay",dd));e=null;a.g.dash.ignoreMaxSegmentDuration||(e=H(b,"maxSegmentDuration",dd));d=b.attributes.type||"static";a.h&&a.h.presentationTimeline&&(a.T=a.h.presentationTimeline.U()&&d=="static");a.l.type=d;if(a.h){l=a.h.presentationTimeline;var m=l.ub();for(var n of a.o.values())n.segmentIndex&&n.segmentIndex.Oa(m)}else n=0,a.g.dash.ignoreMinBufferTime||
(n=H(b,"minBufferTime",dd)||0),l=new Q(l,k!=null?Math.min(k,h||Infinity):a.g.defaultPresentationDelay>0?a.g.defaultPresentationDelay:Math.min(n*1.5,h||Infinity),a.g.dash.autoCorrectDrift);l.Ac(d=="static");l.U()&&!isNaN(a.g.availabilityWindowOverride)&&(h=a.g.availabilityWindowOverride);h==null&&(h=Infinity);l.Ge(h);n=b.attributes.profiles||"";a.l.profiles=n.split(",");f={eb:d!="static",presentationTimeline:l,wa:null,na:null,oa:null,L:null,bandwidth:0,zf:!1,bb:f,Xb:null,profiles:n.split(","),roles:null,
xb:tw};await g;a.N=0;g=Gw(a,f,c,b,!1);h=g.duration;n=g.periods;(d!="static"||a.T)&&g.ug||l.jb(h||Infinity);a.S&&a.qa&&l.Sg(a.Y);l.Ff(e||1);a.S&&a.qa&&l.Xf(k!=null?k:a.g.defaultPresentationDelay);if(a.h)a.h.periodCount=n.length,a.h.gapCount=a.N,await Hw(a,n,!1);else{await a.m.Ue(n,f.eb);g=l;k=a.m.l;e=a.m.xf();d=a.m.i;f=a.g.dash.sequenceMode;if(m=Yc(b,"ServiceDescription"))if(h=Yc(m,"Latency"),m=Yc(m,"PlaybackRate"),h||m){var p={};h&&("target"in h.attributes&&(p.targetLatency=parseInt(h.attributes.target,
10)/1E3),"max"in h.attributes&&(p.maxLatency=parseInt(h.attributes.max,10)/1E3),"min"in h.attributes&&(p.minLatency=parseInt(h.attributes.min,10)/1E3));m&&("max"in m.attributes&&(p.maxPlaybackRate=parseFloat(m.attributes.max)),"min"in m.attributes&&(p.minPlaybackRate=parseFloat(m.attributes.min)));h=p}else h=null;else h=null;a:{m=Uc(b,"SupplementalProperty");if(m.length)for(r of m)if(r.attributes.schemeIdUri=="urn:mpeg:dash:chaining:2016"){var r=r.attributes.value;break a}r=null}a.h={presentationTimeline:g,
variants:k,textStreams:e,imageStreams:d,offlineSessionIds:[],sequenceMode:f,ignoreManifestTimestampsInSegmentsMode:!1,type:"DASH",serviceDescription:h,nextUrl:r,periodCount:n.length,gapCount:a.N,isLowLatency:a.S,startTime:null};if(l.dh()){b=Uc(b,"UTCTiming");b=await Jw(a,c,b);if(!a.j)return;l.Tg(b)}l.pe();a.m&&!a.h.presentationTimeline.U()&&a.m.release()}a.j.makeTextStreamsForClosedCaptions(a.h);Kw(a);Lw(a,n)}
function Gw(a,b,c,d,e){let f=b.Xb;f||(f=H(d,"mediaPresentationDuration",dd),a.l.Xb=f);let g=0;a.h&&a.h.presentationTimeline&&a.T&&(g=a.h.presentationTimeline.Ib());const h=[];var k=g;d=Uc(d,"Period");const l=b.eb;l||a.G.clear();const m=l&&!e?new Set(a.C.slice(1,-1)):null;for(let t=0;t<d.length;t++){var n=d[t],p=d[t+1];let u=H(n,"start",dd,k);var r=n.attributes.id;const x=H(n,"duration",dd);u=t==0&&u==0&&a.T?g:u;let y=null;if(p){var q=H(p,"start",dd);q!=null&&(y=q-u+g)}else f!=null&&(y=f-u+g);q=cc;
y&&x&&Math.abs(y-x)>q&&y>x&&a.N++;y==null&&(y=x);if(a.O!==null&&r!=null&&u!==null&&u<a.O&&!a.C.includes(r)&&t+1!=d.length)continue;u!==null&&(a.O===null||u>a.O)&&(a.O=u);k={start:u,duration:y,node:n,ke:y==null||!p};n=null;p=t>0&&t<d.length-1;l&&m&&p&&!e&&(r??="__shaka_period_"+u,m.has(r)&&(r=a.G.get(r))&&(n=r));n||(n=Mw(a,b,c,k),l&&n.id&&a.G.set(n.id,n));h.push(n);n.id&&y&&a.va.set(n.id,y);if(y==null){k=null;break}k=u+y}l&&!e&&Nw(a,h);if(e)for(const t of h)b=t.id,a.C.includes(b)||a.C.push(b);else a.C=
h.map(t=>t.id);return f!=null?{periods:h,duration:f+g,ug:!1}:{periods:h,duration:k,ug:!0}}async function Hw(a,b,c){await a.m.Ue(b,!0,c);a.h.variants=a.m.l;b=a.m.xf();b.length>0&&(a.h.textStreams=b);a.h.imageStreams=a.m.i;a.j.filter(a.h)}
async function Jw(a,b,c){c=c.map(e=>({scheme:e.attributes.schemeIdUri,value:e.attributes.value}));const d=a.g.dash.clockSyncUri;!c.length&&d&&c.push({scheme:"urn:mpeg:dash:utc:http-head:2014",value:d});for(const e of c)try{const f=e.scheme,g=e.value;switch(f){case "urn:mpeg:dash:utc:http-head:2014":case "urn:mpeg:dash:utc:http-head:2012":return await Ow(a,b,g,"HEAD");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":return await Ow(a,
b,g,"GET");case "urn:mpeg:dash:utc:direct:2014":case "urn:mpeg:dash:utc:direct:2012":const h=Date.parse(g);return isNaN(h)?0:h-Date.now();case "urn:mpeg:dash:utc:http-ntp:2014":case "urn:mpeg:dash:utc:ntp:2014":case "urn:mpeg:dash:utc:sntp:2014":ja("NTP UTCTiming scheme is not supported");break;default:ja("Unrecognized scheme in UTCTiming element",f)}}catch(f){}ja("A UTCTiming element should always be given in live manifests! This content may not play on clients with bad clocks!");return 0}
function Kw(a){var b=Array.from(a.F.keys()).filter(c=>!a.C.includes(c));for(const c of b){b=!0;for(const d of a.F.get(c)){const e=a.o.get(d);e&&(e.segmentIndex&&e.segmentIndex.getNumReferences()!=0?b=!1:(a.m&&a.m.rg(e,c),a.o.delete(d)))}b&&a.F.delete(c)}}function Lw(a,b){b=new Set(b.map(c=>c.id));for(const c of a.B.keys())b.has(c)||a.B.delete(c)}
function Dw(a,b){a.h.periodCount--;for(const c of a.u.keys())if(c.startsWith(b)){const d=a.u.get(c);Ju(d,ov,"SegmentTimeline").children=[];Fw(a,c);a.u.delete(c)}a.C=a.C.filter(c=>c!==b);a.G.delete(b)}
function Fw(a,b){var c=a.u.get(b);const d=a.o.get(b);d.segmentIndex&&d.segmentIndex.Oa(a.h.presentationTimeline.ub());try{const e=nv(c,(f,g,h,k)=>Pw(a,f,g,h,k),a.o,!0,a.g.dash.initialSegmentLimit,a.va,c.L.aesKey,null,!0,a.B);d.createSegmentIndex=async()=>{d.segmentIndex||(d.segmentIndex=await e.tc())}}catch(e){if(b=c.L.contentType,c=b=="image",b!=G&&b!="application"&&!c||e.code!=4002)throw e;}}
function Ew(a,b){let c="",d="",e=-1,f="";for(const g of b)g.name==="Period"?c=g.id:g.name==="AdaptationSet"?(d=g.id,g.position!==null&&(e=g.position)):g.name==="Representation"&&(f=g.id);b=[];if(f)b.push(c+","+f);else if(d)for(const g of a.u.values())g.wa.id===c&&g.oa.id===d&&g.L.id&&b.push(c+","+g.L.id);else if(e>-1)for(const g of a.u.values())g.wa.id===c&&g.oa.position===e&&g.L.id&&b.push(c+","+g.L.id);return b}
async function Pw(a,b,c,d,e){e=e?0:1;b=Fl(b,c,d,a.g.retryParameters);return(await zw(a,b,gg,{type:e})).data}
function Mw(a,b,c,d){b.wa=Qw(a,d.node,null,c);b.na=d;b.wa.bb=b.bb;b.wa.id||(b.wa.id="__shaka_period_"+d.start);c=Uc(d.node,"EventStream");const e=b.presentationTimeline.ub();for(var f of c)Rw(a,d.start,d.duration,f,e);f=Uc(d.node,"SupplementalProperty");for(var g of f)g.attributes.schemeIdUri=="urn:mpeg:dash:urlparam:2014"&&(f=Sw(a,g))&&(b.xb=f);g=Uc(d.node,"AdaptationSet").map((t,u)=>Tw(a,b,u,t)).filter(Fe);if(b.eb){f=[];for(var h of g)for(var k of h.Ni)f.push(k);if(f.length!=(new Set(f)).size)throw new F(2,
4,4018);}h=new Map;for(var l of g)for(const [t,u]of l.uh)h.set(t,u);if(h.size){l=null;for(const t of g){k=[];for(const u of t.streams)if(h.has(u.originalId)){l||=Uc(d.node,"AdaptationSet").map((x,y)=>Tw(a,b,y,x)).filter(Fe);for(const x of l)if(f=x.streams.find(y=>y.originalId==u.originalId))f.dependencyStream=h.get(f.originalId),f.originalId+=f.dependencyStream.originalId,k.push(f)}k.length&&t.streams.push(...k)}}const [m,n]=ua(g,t=>!!t.ah);if(!a.g.disableIFrames)for(var p of m){d=p.ah.split(" ");
for(var r of n)if(d.includes(r.id))for(var q of r.streams)yf(q,p.streams)}p=Uw(a.g.disableAudio,n,"audio");r=Uw(a.g.disableVideo,n,"video");q=Uw(a.g.disableText,n,G);d=Uw(a.g.disableThumbnails,n,"image");if(r.length===0&&p.length===0)throw new F(2,4,4004);return{id:b.wa.id,audioStreams:p,videoStreams:r,textStreams:q,imageStreams:d}}function Nw(a,b){b=new Set(b.map(c=>c.id));for(const c of Array.from(a.G.keys()))b.has(c)||a.G.delete(c)}
function Qw(a,b,c,d){c=c||{contentType:"",mimeType:"",codecs:"",emsgSchemeIdUris:[],frameRate:void 0,pixelAspectRatio:void 0,xe:null,audioSamplingRate:null,bb:0,De:1,encrypted:!1};d=d||c.Ua;const e=b.attributes.id,f=b.attributes.supplementalId,g=Uc(b,"BaseURL");let h,k=!1;if(a.i)for(var l of g){var m=l.attributes.serviceLocation,n=Wc(l);m&&n&&(Cv(a.i,e,m,n),k=!0)}k&&a.i||(h=g.map(Wc));const p=a.i;a=b.attributes.contentType||c.contentType;l=b.attributes.mimeType||c.mimeType;m=yl([b.attributes.codecs||
c.codecs]).join(",");n=H(b,"frameRate",md)||c.frameRate;const r=b.attributes.sar||c.pixelAspectRatio,q=Vw(Uc(b,"InbandEventStream"),c.emsgSchemeIdUris);var t=Uc(b,"AudioChannelConfiguration");t=Ww(t)||c.xe;const u=H(b,"audioSamplingRate",hd)||c.audioSamplingRate;a||=uw(l,m);const x=Yc(b,"SegmentBase"),y=Yc(b,"SegmentTemplate");var w=x?H(x,"availabilityTimeOffset",id)||0:0,z=y?H(y,"availabilityTimeOffset",id)||0:0,A=g&&g.length?H(g[0],"availabilityTimeOffset",id)||0:0;w=c.bb+A+w+z;z=null;(A=Yc(b,"SegmentSequenceProperties"))&&
(A=H(A,"cadence",gd))&&(z=A);A=b.attributes.label;var B=Uc(b,"Label");B&&B.length&&(B=B[0],Vc(B)&&(A=Vc(B)));return{Ua:()=>Vb(d(),g.length?p&&k?Dv(p,e):h?h:[]:[]),$c:x||c.$c,bc:Yc(b,"SegmentList")||c.bc,qc:y||c.qc,Ae:Yc(b,"ProducerReferenceTime")||c.Ae,width:H(b,"width",hd)||c.width,height:H(b,"height",hd)||c.height,contentType:a,mimeType:l,codecs:m,frameRate:n,pixelAspectRatio:r,emsgSchemeIdUris:q,id:f||e,originalId:e,language:b.attributes.lang,xe:t,audioSamplingRate:u,bb:w,ie:null,De:z||c.De,label:A||
null,encrypted:!1}}function Rw(a,b,c,d,e){const f=d.attributes.schemeIdUri||"",g=d.attributes.value||"",h=H(d,"timescale",hd)||1,k=H(d,"presentationTimeOffset",hd)||0;for(const m of Uc(d,"Event")){var l=H(m,"presentationTime",hd)||0;d=H(m,"duration",hd)||0;l=Math.max((l-k)/h+b,b);d=l+d/h;c!=null&&(l=Math.min(l,b+c),d=Math.min(d,b+c));if(d<e)continue;d={schemeIdUri:f,value:g,startTime:l,endTime:d,id:m.attributes.id||"",timescale:h,eventElement:rd(m),eventNode:sd(m)};a.j.onTimelineRegionAdded(d)}}
function Sw(a,b){if((b=Zc(b,"urn:mpeg:dash:schema:urlparam:2014","UrlQueryInfo"))&&H(b,"useMPDUrlQuery",ld,!1)){const c=b.attributes.queryTemplate;if(c)return()=>c=="$querypart$"?a.W:c.split("&").map(d=>{if(d=="$querypart$")return a.W;var e=/\$query:(.*?)\$/g.exec(d);if(e&&e.length==2){e=e[1];const f=(new ab(a.W)).get(e);if(f.length)return e+"="+f[0]}return d}).join("&")}return null}
function Tw(a,b,c,d){b.oa=Qw(a,d,b.wa,null);b.oa.position=c;let e=!1;var f=Uc(d,"Role");const g=f.map(N=>N.attributes.value).filter(Fe);let h=void 0;(c=b.oa.contentType==G)&&(h="subtitle");for(var k of f)if(f=k.attributes.schemeIdUri,f==null||f=="urn:mpeg:dash:role:2011")switch(f=k.attributes.value,f){case "main":e=!0;break;case "caption":case "subtitle":h=f}let l,m;f=N=>{switch(N){case 1:case 6:case 13:case 14:case 15:return"SDR";case 16:return"PQ";case 18:return"HLG"}};var n=N=>{switch(N){case 1:case 5:case 6:case 7:return"srgb";
case 9:return"rec2020";case 11:case 12:return"p3"}};const p=N=>{const ra=N.attributes["dvb:fontFamily"];N=N.attributes["dvb:url"];ra&&N&&(N=Vb(b.oa.Ua(),[N],b.xb()),a.j.addFont(ra,N[0]))};var r=Uc(d,"EssentialProperty");k=null;let q=!1,t=null,u=!1;for(var x of r)r=x.attributes.schemeIdUri,r=="http://dashif.org/guidelines/trickmode"?k=x.attributes.value:r=="urn:mpeg:mpegB:cicp:TransferCharacteristics"?l=f(parseInt(x.attributes.value,10)):r=="urn:mpeg:mpegB:cicp:ColourPrimaries"?m=n(parseInt(x.attributes.value,
10)):r!="urn:mpeg:mpegB:cicp:MatrixCoefficients"&&(r=="urn:mpeg:dash:ssr:2023"&&a.g.dash.enableFastSwitching?q=!0:r=="urn:dvb:dash:fontdownload:2014"?p(x):r=="urn:mpeg:dash:urlparam:2014"?(t=Sw(a,x))||(u=!0):u=!0);if(u)return null;let y=null;x=Uc(d,"SupplementalProperty");for(var w of x)x=w.attributes.schemeIdUri,x=="http://dashif.org/guidelines/last-segment-number"?y=parseInt(w.attributes.value,10)-1:x=="urn:mpeg:mpegB:cicp:TransferCharacteristics"?l=f(parseInt(w.attributes.value,10)):x=="urn:mpeg:mpegB:cicp:ColourPrimaries"?
m=n(parseInt(w.attributes.value,10)):x=="urn:dvb:dash:fontdownload:2014"?p(w):x=="urn:mpeg:dash:urlparam:2014"&&(t=Sw(a,w));t&&(b.xb=t);w=Uc(d,"Accessibility");const z=new Map;let A;for(var B of w)if(w=B.attributes.schemeIdUri,x=B.attributes.value,w!="urn:scte:dash:cc:cea-608:2015"||a.g.disableText)if(w!="urn:scte:dash:cc:cea-708:2015"||a.g.disableText)w=="urn:mpeg:dash:role:2011"?x!=null&&(g.push(x),x=="captions"&&(h="caption")):w=="urn:tva:metadata:cs:AudioPurposeCS:2007"&&(x=="1"?A="visually impaired":
x=="2"?A="hard of hearing":x=="9"&&(A="spoken subtitles"));else if(w=1,x!=null)for(var D of x.split(";"))D.includes("=")?(f=D.split("="),x=`svc${f[0]}`,f=f[1].split(",")[0].split(":").pop()):(x=`svc${w}`,w++,f=D),z.set(x,Ie(f));else z.set("svc1","und");else if(w=1,x!=null){x=x.split(";");for(var E of x)E.includes("=")?(n=E.split("="),f=n[0].startsWith("CC")?n[0]:`CC${n[0]}`,n=n[1]||"und"):(f=`CC${w}`,x.length==2?w+=2:w++,n=E),z.set(f,Ie(n))}else z.set("CC1","und");B=Uc(d,"ContentProtection");const Z=
Du(a.sa,B,a.g.ignoreDrmInfo,a.g.dash.keySystemsByURI);b.oa.encrypted=B.length>0;const J=Ie(b.oa.language||"und"),K=b.oa.label,ba=new Map;d=Uc(d,"Representation");if(!a.g.ignoreSupplementalCodecs){B=[];for(var I of d)if(D=ad(I,"urn:scte:dash:scte214-extensions","supplementalCodecs"))E=Gc(I),E.attributes.codecs=D.split(" ").join(","),E.attributes.id&&(E.attributes.supplementalId=E.attributes.id+"_supplementalCodecs"),B.push(E);d.push(...B)}I=d.map(N=>{const ra=Xw(a,b,Z,h,J,K,e,g,z,N,A,y);return ra&&
(ra.hdr=ra.hdr||l,ra.colorGamut=ra.colorGamut||m,ra.fastSwitching=q,N=N.attributes.dependencyId)?(ra.baseOriginalId=N,ba.set(N,ra),null):ra}).filter(N=>!!N);if(I.length==0&&ba.size==0){var aa=b.oa.contentType=="image";if(a.g.dash.ignoreEmptyAdaptationSet||c||aa)return null;throw new F(2,4,4003);}if(!b.oa.contentType||b.oa.contentType=="application"){b.oa.contentType=uw(I[0].mimeType,I[0].codecs);for(const N of I)N.type=b.oa.contentType}c=b.oa.id||"__fake__"+a.Aa++;for(aa of I){for(const N of Z.drmInfos)N.keyIds=
N.keyIds&&aa.keyIds?new Set([...N.keyIds,...aa.keyIds]):N.keyIds||aa.keyIds;a.g.enableAudioGroups&&(aa.groupId=c)}aa=d.map(N=>N.attributes.supplementalId||N.attributes.id).filter(Fe);return{id:c,contentType:b.oa.contentType,language:J,wk:e,streams:I,drmInfos:Z.drmInfos,ah:k,Ni:aa,uh:ba}}function Uw(a,b,c){return a||!b.length?[]:b.reduce((d,e)=>{if(e.contentType!=c)return d;d.push(...e.streams);return d},[])}
function Xw(a,b,c,d,e,f,g,h,k,l,m,n){b.L=Qw(a,l,b.oa,null);var p=b.L.id;a.Y=Math.min(a.Y,b.L.bb);a.S=a.Y>0;if(!Yw(b.L))return null;const r=b.na.start;b.bandwidth=H(l,"bandwidth",gd)||0;b.roles=h;var q=Uc(l,"SupplementalProperty"),t=Uc(l,"EssentialProperty"),u=Uc(l,"ContentProtection");l=null;var x=t.find(D=>D.attributes.schemeIdUri=="urn:mpeg:dash:urlparam:2014");x?l=Sw(a,x):(x=q.find(D=>D.attributes.schemeIdUri=="urn:mpeg:dash:urlparam:2014"))&&(l=Sw(a,x));l&&(b.xb=l);let y;x=b.L.contentType;l=x==
G||x=="application";x=x=="image";u.length&&(b.oa.encrypted=!0);try{let D=void 0;if(c.Qe){var w=b.L.Ua;const E=b.xb,Z=Vb(w(),[c.Qe.pi],E()),J=ag(Z,a.g.retryParameters);D={bitsKey:128,blockCipherMode:"CBC",iv:c.Qe.iv,firstMediaSequenceNumber:0,fetchKey:async()=>{const K=await zw(a,J,6);if(!K.data||K.data.byteLength!=16)throw new F(2,4,4049);D.cryptoKey=await window.crypto.subtle.importKey("raw",K.data,{name:"AES-CBC"},!0,["decrypt"]);D.fetchKey=void 0}}}b.L.aesKey=D;w=(E,Z,J,K)=>Pw(a,E,Z,J,K);if(b.L.$c)y=
cv(b,w,D);else if(b.L.bc)y=iv(b,a.o,D);else if(b.L.qc)y=nv(b,w,a.o,!!a.h,a.g.dash.initialSegmentLimit,a.va,D,n,!1,a.B);else{const E=b.na.duration||0,Z=b.L.Ua,J=b.L.mimeType,K=b.L.codecs;y={endTime:-1,timeline:-1,tc:()=>{const ba=Tk(r,E,Z());ba.fb(I=>{I.mimeType=J;I.codecs=K});return Promise.resolve(ba)},timescale:1}}}catch(D){if((l||x)&&D.code==4002)return null;throw D;}n=Eu(a.sa,u,c,a.g.ignoreDrmInfo,a.g.dash.keySystemsByURI);n=new Set(n?[n]:[]);u=q.some(D=>D.attributes.schemeIdUri=="tag:dolby.com,2018:dash:EC3_ExtensionType:2018"&&
D.attributes.value=="JOC");q=q.some(D=>D.attributes.schemeIdUri=="tag:dolby.com,2016:dash:virtualized_content:2016"&&D.attributes.value=="1");q=u||q;u=!1;l&&(u=h.includes("forced_subtitle")||h.includes("forced-subtitle"));let z;if(x&&((t=t.find(D=>["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"].includes(D.attributes.schemeIdUri)))&&(z=t.attributes.value),!z))return null;let A;l=b.L.codecs;b.profiles.includes("http://dashif.org/guidelines/dash-if-uhd#hevc-hdr-pq10")&&
(l.includes("hvc1.2.4.L153.B0")||l.includes("hev1.2.4.L153.B0"))&&(A="PQ");t=b.L.id?b.wa.id+","+b.L.id:"";a.H.length&&p&&a.u.set(`${b.wa.id},${p}`,Zw(b));b.L.Ae&&$w(a,b.L.Ae,y,b.presentationTimeline);y.endTime!=-1&&b.wa.id!=null&&b.L.id!=null&&((p=a.B.get(b.wa.id))?(p.endTime=y.endTime,p.Pf.includes(b.L.id)||p.Pf.push(b.L.id),a.B.set(b.wa.id,p)):a.B.set(b.wa.id,{endTime:y.endTime,timeline:y.timeline,Pf:[b.L.id]}));let B;B=t&&a.o.has(t)?a.o.get(t):{id:a.Aa++,originalId:b.L.id,groupId:null,createSegmentIndex:()=>
Promise.resolve(),closeSegmentIndex:()=>{B.segmentIndex&&(B.segmentIndex.release(),B.segmentIndex=null)},segmentIndex:null,mimeType:b.L.mimeType,codecs:l,frameRate:b.L.frameRate,pixelAspectRatio:b.L.pixelAspectRatio,bandwidth:b.bandwidth,width:b.L.width,height:b.L.height,kind:d,encrypted:c.drmInfos.length>0,drmInfos:c.drmInfos,keyIds:n,language:e,originalLanguage:b.oa.language,label:f,type:b.oa.contentType,primary:g,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:b.L.emsgSchemeIdUris,roles:h,
forced:u,channelsCount:b.L.xe,audioSamplingRate:b.L.audioSamplingRate,spatialAudio:q,closedCaptions:k,hdr:A,colorGamut:void 0,videoLayout:void 0,tilesLayout:z,accessibilityPurpose:m,external:!1,fastSwitching:!1,fullMimeTypes:new Set([be(b.L.mimeType,b.L.codecs)]),isAudioMuxedInVideo:!1,baseOriginalId:null};B.createSegmentIndex=async()=>{B.segmentIndex||(B.segmentIndex=await y.tc())};t&&b.eb&&!a.o.has(t)&&(b=b.wa.id||"",a.F.has(b)||a.F.set(b,[]),a.o.set(t,B),a.F.get(b).push(t));return B}
function Yw(a){let b;b=a.$c?1:0;b+=a.bc?1:0;b+=a.qc?1:0;if(b==0)return a.contentType==G||a.contentType=="application"?!0:!1;b!=1&&(a.$c&&(a.bc=null),a.qc=null);return!0}function Zw(a){const b=c=>{if(!c)return null;c=Hc(c);c.$c=null;c.bc=null;c.qc=sd(c.qc);c.Ae=null;return c};a=Hc(a);a.wa=b(a.wa);a.oa=b(a.oa);a.L=b(a.L);a.na&&(a.na=Hc(a.na),a.na.node=null);return a}
function $w(a,b,c,d){if(!a.ea.has(b)){a.ea.add(b);var e=H(b,"presentationTime",hd)||0,f=Yc(b,"UTCTiming"),g;if(g=f&&f.attributes.schemeIdUri)f=f.attributes.schemeIdUri,g=!(f==="urn:mpeg:dash:utc:http-ntp:2014"||f==="urn:mpeg:dash:utc:ntp:2014"||f==="urn:mpeg:dash:utc:sntp:2014");g?b=(H(b,"wallClockTime",cd)||0)*1E3:(b=H(b,"wallClockTime",hd)||0,b=$i(b));c=new Date(b-e/c.timescale*1E3);e=c.getTime()/1E3;isNaN(e)||(d.o||d.Yf(e),d=(new Map).set("detail",{wallClockTime:b,programStartDate:c}),d=new L("prft",
d),a.j.onEvent(d))}}function Vw(a,b){b=b.slice();for(const c of a)a=c.attributes.schemeIdUri,b.includes(a)||b.push(a);return b}
function Ww(a){for(const e of a){var b=e.attributes.schemeIdUri;if(!b)continue;if(a=e.attributes.value)switch(b){case "urn:mpeg:dash:outputChannelPositionList:2012":return a.trim().split(/ +/).length;case "urn:mpeg:dash:23003:3:audio_channel_configuration:2011":case "urn:dts:dash:audio_channel_configuration:2012":a=parseInt(a,10);if(!a)continue;return a;case "tag:dolby.com,2015:dash:audio_channel_configuration:2015":b=[2,1,2,2,2,2,1,2,2,1,1,1,1,2,1,1,2,2];a=parseInt(a,16);if(!a)continue;var c=0;for(var d=
0;d<b.length;d++)a&1<<d&&(c+=b[d]);if(c)return c;continue;case "tag:dolby.com,2014:dash:audio_channel_configuration:2011":case "urn:dolby:dash:audio_channel_configuration:2011":b=[1,1,1,1,1,2,2,1,1,2,2,2,1,2,1,1].reverse();a=parseInt(a,16);if(!a)continue;c=0;for(d=0;d<b.length;d++)a&1<<d&&(c+=b[d]);if(c)return c;continue;case "urn:mpeg:mpegB:cicp:ChannelConfiguration":if(b=[0,1,2,3,4,5,6,8,2,3,4,7,8,24,8,12,10,12,14,12,14],(a=parseInt(a,10))&&a>0&&a<b.length)return b[a]}}return null}
async function Ow(a,b,c,d){c=[Kb(c)];b=Vb(b(),c);b=ag(b,a.g.retryParameters);b.method=d;b=a.j.networkingEngine.request(4,b,{isPreload:a.ha()});Wf(a.R,b);a=await b.promise;if(d=="HEAD"){if(!a.headers||!a.headers.date)return 0;d=a.headers.date}else d=Eb(a.data);d=Date.parse(d);return isNaN(d)?0:d-Date.now()}
var Iw=class{constructor(){this.j=this.g=null;this.A=[];this.h=null;this.Aa=1;this.H=[];this.l={ue:"",type:"",profiles:[],Xb:null,bb:0,Ua:null,yd:0};this.u=new Map;this.B=new Map;this.G=new Map;this.o=new Map;this.F=new Map;this.va=new Map;this.m=new Nv;this.K=0;this.Ba=new fa(5);this.M=new Ce(()=>{if(this.J&&!this.g.continueLoadingWhenPaused&&(this.I.Ja(this.J,"timeupdate"),this.J.paused)){this.I.za(this.J,"timeupdate",()=>vw(this));return}vw(this)});this.R=new Xf;this.O=null;this.C=[];this.Y=Infinity;
this.qa=!1;this.i=null;this.N=0;this.S=!1;this.I=new Aa;this.J=null;this.T=!1;this.W="";this.ha=()=>!1;this.ua=[];this.ea=new Set;this.sa=new Fu}configure(a,b){const c=this.j&&a.updatePeriod!=this.g.updatePeriod&&a.updatePeriod>=0;this.g=a;b&&(this.ha=b);c&&this.h&&this.h.presentationTimeline.U()&&this.M.kb();this.i&&this.i.configure(this.g);this.m&&this.m.Wg(this.g.dash.useStreamOnceInPeriodFlattening)}async start(a,b){this.qa=b.isLowLatencyMode();this.A=[a];this.j=b;a=await ww(this);this.j&&xw(this,
a);if(!this.j)throw new F(2,7,7001);return this.h}stop(){for(const a of this.o.values())a.segmentIndex&&a.segmentIndex.release();this.m&&this.m.release();this.g=this.j=null;this.A=[];this.h=null;this.o.clear();this.F.clear();this.u.clear();this.B.clear();this.G.clear();this.l={ue:"",type:"",profiles:[],Xb:null,bb:0,Ua:null,yd:0};this.m=null;this.M!=null&&(this.M.stop(),this.M=null);this.i&&this.i.destroy();this.I&&(this.I.release(),this.I=null);this.ea.clear();this.sa.release();return this.R.destroy()}async update(){try{await ww(this)}catch(a){if(this.j&&
a)this.j.onError(a)}}onExpirationUpdated(){}onInitialVariantChosen(a){if(this.h&&this.h.presentationTimeline.U()){var b=a.video||a.audio;if(b&&b.segmentIndex){a=this.h.presentationTimeline.jc();const c=b.segmentIndex.find(a);c!=null&&(b=b.segmentIndex.get(c))&&(this.K=b.endTime-a,xw(this,0))}}}banLocation(a){this.i&&this.i.banLocation(a)}setMediaElement(a){this.J=a}};v("shaka.dash.DashParser",Iw);hc("application/dash+xml",()=>new Iw);hc("video/vnd.mpeg.dash.mpd",()=>new Iw);var ax=class{};v("shaka.dependencies",ax);ax.has=function(a){return bx.has(a)};ax.add=function(a,b){if(!cx[a])throw Error(`${a} is not supported`);a==dx?Ra("mux.js","mux.js is no longer used in Shaka Player."):bx.set(a,()=>b)};var dx="muxjs",cx={xk:dx,ISOBoxer:"ISOBoxer"};ax.Allowed=cx;var bx=new Map([["ISOBoxer",()=>window.ISOBoxer]]);function kc(){const a=window.ManagedMediaSource||window.MediaSource;return a&&a.isTypeSupported?!0:!1}function lc(a){return Ni().canPlayType(a)!=""}
var ex=class{constructor(){this.Ha=new Ea(()=>{var a=navigator.userAgent.toLowerCase(),b=[{type:"VR",Of:/oculus|quest/},{type:"TV",Of:/smart[ _]?tv|android ?tv/},{type:"MOBILE",Of:/iphone|ipad|ipod|android/}];for(const c of b)if(c.Of.test(a))return c.type;a=navigator.userAgentData;b=a?.platform?.toLowerCase()||"";if(a){if(a.mobile)return"MOBILE";if(b.includes("android"))return"TV"}return"DESKTOP"});this.Na=new Ea(()=>{const a=navigator.userAgent;return navigator.vendor.includes("Apple")&&(a.includes("Version/")||
a.includes("OS/"))?"WEBKIT":a.includes("Edge/")?"EDGE":a.includes("Chrome/")?"CHROMIUM":a.includes("Firefox/")?"GECKO":"UNKNOWN"})}o(){return!!navigator.mediaCapabilities}i(){return this.Ha.value()}h(){return this.Na.value()}G(){return!1}S(){return!1}K(){return!1}qa(){return!1}I(){return!1}B(){return!0}l(){const a=window.ManagedSourceBuffer||window.SourceBuffer;return!!a&&!!a.prototype&&!!a.prototype.changeType}J(){return!0}sa(){return 0}u(){return Promise.resolve({width:Infinity,height:Infinity})}ua(){return!1}T(){return!1}j(a){const b=
this.i();if(b==="TV"||b==="CONSOLE"||b==="CAST")a.ads.customPlayheadTracker=!0,a.ads.skipPlayDetection=!0,a.ads.supportsMultipleMediaElements=!1;return a}W(){return!!window.indexedDB}ha(){return[]}F(a){return window.matchMedia!==void 0&&(window.matchMedia("(color-gamut: p3)").matches||window.matchMedia("(dynamic-range: high)").matches)?a?"HLG":"PQ":"SDR"}Ba(){return!1}Y(){return!1}M(){return!1}O(){return!0}ea(){return!1}va(){return!0}A(){return!1}R(a){return a==="com.apple.fps"}N(){return!0}toString(){return`Device: ${this.m()} v${this.g()}; Type: ${this.i()}`}};function fx(a){a=a.C.value();return a[0]>=27?!0:a[0]===26&&a[1]>=4}
var gx=class extends ex{constructor(){super();this.C=new Ea(()=>{let a=navigator.userAgent.match(/Version\/(\d+)(?:\.(\d+))?/);a||=navigator.userAgent.match(/OS (\d+)(?:_(\d+))?/);return a?[parseInt(a[1],10),parseInt(a[2]||"0",10)]:[0,0]});this.H=new Ea(()=>/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)||navigator.maxTouchPoints>1?"xr"in navigator?"APPLE_VR":"MOBILE":"xr"in navigator?"APPLE_VR":"DESKTOP")}g(){return this.C.value()[0]}m(){return"Apple Browser"}i(){return this.H.value()}h(){return"WEBKIT"}o(){return!1}G(a,b){return!fx(this)&&
b==="audio"}K(){return!fx(this)}qa(a){return!fx(this)&&a==="audio"}j(a){super.j(a);a.abr.minTimeToSwitch=.5;return a}Ba(){return!0}N(){return!1}};(navigator.vendor||"").includes("Apple")&&(/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)||navigator.maxTouchPoints>1||navigator.userAgentData&&navigator.userAgentData.platform&&navigator.userAgentData.platform.toLowerCase()=="macos"||navigator.platform&&navigator.platform.toLowerCase().includes("mac"))&&(Ha=()=>new gx);function hx(){return navigator.userAgent.includes("CrKey")&&!navigator.userAgent.includes("VIZIO SmartCast")}
var lx=class extends ex{constructor(){if(!hx())throw Error("Not a Chromecast device!");super();this.H=new Ea(()=>{const a=navigator.userAgent.match(/Chrome\/(\d+)/);return a?parseInt(a[1],10):null});this.C=new Ea(()=>{let a=navigator.userAgentData&&navigator.userAgentData.platform||navigator.userAgent;a=a.toLowerCase();return a.includes("android")?ix:a.includes("fuchsia")?jx:kx})}g(){return this.H.value()}m(){return"Chromecast with "+this.C.value()}i(){return"CAST"}h(){return"CHROMIUM"}o(){return super.o()&&
this.C.value()!==kx}l(){return super.l()&&this.C.value()!==kx}sa(){switch(this.C.value()){case ix:return 0;case jx:return 3;default:return 1}}async u(){const a=window.cast&&cast.__platform__&&cast.__platform__.canDisplayType,b={width:1280,height:720};try{a&&await cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=3840; height=2160')?(b.width=3840,b.height=2160):a&&await cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=1920; height=1080')&&(b.width=1920,
b.height=1080)}catch(c){ia("Failed to check canDisplayType:",c)}return b}j(a){super.j(a);a.streaming.stallSkip=0;return a}W(){return!1}A(){return!0}},ix="Android",jx="Fuchsia",kx="Linux";hx()&&(Ha=()=>new lx);var mx=class extends ex{constructor(){super();this.Aa=new Ea(()=>{const a=navigator.userAgent.match(/(Chrome|Firefox)\/(\d+)/);return a?parseInt(a[2],10):null});this.C=new Ea(()=>navigator.userAgent.match(/Edge?\//)?"Edge":navigator.userAgent.includes("Chrome")?"Chrome":navigator.userAgent.includes("Firefox")?"Firefox":"Unknown");this.H=new Ea(()=>navigator.userAgentData&&navigator.userAgentData.platform?navigator.userAgentData.platform.toLowerCase()=="windows":navigator.platform?navigator.platform.toLowerCase().includes("win32"):
!1);this.Wa=new Ea(()=>super.l()?navigator.userAgent.match(/Edge?\//)?!this.H.value():!0:!1);this.Va=new Ea(()=>navigator.userAgent.includes("sony.hbbtv.tv"));this.Ra=new Ea(()=>navigator.userAgentData&&navigator.userAgentData.platform?navigator.userAgentData.platform.toLowerCase()=="android":navigator.userAgent.includes("Android")?!0:!1)}g(){return this.Aa.value()}m(){return this.C.value()}G(a){return xb(a)?this.C.value()==="Edge"&&this.H.value():!1}S(){return this.C.value()==="Edge"&&this.H.value()}K(){return this.C.value()===
"Edge"&&this.H.value()}l(){return this.Wa.value()}j(a){super.j(a);if(this.H.value())switch(this.C.value()){case "Firefox":a.drm.keySystemsMapping={"com.microsoft.playready":"com.microsoft.playready.recommendation"};break;case "Chrome":a.drm.keySystemsMapping={"com.microsoft.playready":"com.microsoft.playready.recommendation.3000","com.microsoft.playready.recommendation":"com.microsoft.playready.recommendation.3000"}}this.Ra.value()&&(a.drm.defaultAudioRobustnessForWidevine="",a.drm.defaultVideoRobustnessForWidevine=
"");return a}M(){return this.C.value()==="Edge"||this.Va.value()}A(){if(this.h()==="GECKO"){const a=this.g();return a!==null?a>=100:super.A()}return super.A()}R(a){return this.h()==="GECKO"?a.startsWith("com.microsoft.playready.recommendation"):super.R(a)}};Ia=()=>new mx;var nx=class extends ex{g(){return null}m(){return"Hisense"}i(){return"TV"}o(){return!1}l(){return!1}u(){const a={width:1920,height:1080};let b=null;if(window.Hisense_Get4KSupportState)try{b=window.Hisense_Get4KSupportState()}catch(c){}b==null&&(b=navigator.userAgent.includes("UHD"));b&&(a.width=3840,a.height=2160);return Promise.resolve(a)}j(a){super.j(a);a.streaming.stallSkip=0;return a}};if(navigator.userAgent.includes("Hisense")||navigator.userAgent.includes("VIDAA"))Ha=()=>new nx;var ox=class extends ex{constructor(){super();this.C=new Ea(()=>{const a=navigator.userAgent.match(/PlayStation (\d+)/);return a?parseInt(a[1],10):null})}m(){return"PlayStation"}i(){return"CONSOLE"}h(){return"WEBKIT"}g(){return this.C.value()}o(){return!1}B(){return!1}l(){return!1}T(){return this.g()===4}async u(){const a={width:1920,height:1080};let b=!1;try{b=(await window.msdk.device.getDisplayInfo()).resolution==="4K"}catch(c){try{b=(await window.msdk.device.getDisplayInfoImmediate()).resolution===
"4K"}catch(d){ja("PlayStation: Failed to get the display info:",d)}}b&&(a.width=3840,a.height=2160);return a}j(a){super.j(a);this.g()===4&&a.drm.preferredKeySystems.push("com.microsoft.playready");a.streaming.clearDecodingCache=!0;return a}M(){return this.g()===4}O(){return this.g()!==4}};navigator.userAgent.includes("PlayStation")&&(Ha=()=>new ox);var px=class extends ex{constructor(){super();const a=navigator.userAgent.match(/Tizen (\d+).(\d+)/);this.C=a?parseInt(a[1],10):null;this.H=a?parseInt(a[2],10):null}g(){return this.C}m(){return"Tizen"}h(){return"CHROMIUM"}i(){return"TV"}G(){return!0}I(){return this.g()===3}o(){return!1}B(){const a=this.g();return a!==null?a>=4:super.B()}l(){return!1}J(){return this.C&&this.H?this.C===5?this.H>=5:this.C>5:super.J()}u(){var a=window.devicePixelRatio;a={width:window.screen.width*a>1920?3840:1920,height:window.screen.height*
a>1080?2160:1080};try{if(webapis.systeminfo&&webapis.systeminfo.getMaxVideoResolution){const b=webapis.systeminfo.getMaxVideoResolution();a.width=b.width;a.height=b.height}else webapis.productinfo.is8KPanelSupported&&webapis.productinfo.is8KPanelSupported()?(a.width=7680,a.height=4320):webapis.productinfo.isUdPanelSupported&&webapis.productinfo.isUdPanelSupported()&&(a.width=3840,a.height=2160)}catch(b){ja("Tizen: Error detecting screen size, default screen size 1920x1080.")}return Promise.resolve(a)}j(a){super.j(a);
a.drm.ignoreDuplicateInitData=this.g()!==2;this.g()===3&&(a.streaming.crossBoundaryStrategy="reset_to_encrypted");a.streaming.shouldFixTimestampOffset=!0;a.streaming.stallSkip=0;a.streaming.gapPadding=2;return a}ha(){const a=[];this.C!==null&&this.C<5&&a.push("opus");return a}F(a){try{if(webapis.avinfo.isHdrTvSupport())return a?"HLG":"PQ"}catch(b){return super.F(a)}return"SDR"}Y(){return!0}ea(){return this.g()===3}};navigator.userAgent.includes("Tizen")&&(Ha=()=>new px);var qx=class extends ex{g(){return null}m(){return"Vizio"}i(){return"TV"}o(){return!1}};navigator.userAgent.includes("VIZIO SmartCast")&&(Ha=()=>new qx);var rx=class extends ex{constructor(){super();this.Aa=new Ea(()=>navigator.userAgent.includes("DT_STB_BCM")||navigator.userAgent.includes("Sky_STB"));this.H=new Ea(()=>navigator.userAgent.includes("SOPOpenBrowser"));this.C=new Ea(()=>{if(navigator.userAgent.includes("DT_STB_BCM"))return 11;let a=navigator.userAgent.match(/Version\/(\d+)/);return a?parseInt(a[1],10):(a=navigator.userAgent.match(/OS (\d+)(?:_\d+)?/))?parseInt(a[1],10):null})}g(){return this.C.value()}m(){return"WebKit STB"}i(){return"TV"}h(){return"WEBKIT"}o(){return!1}B(){const a=
this.C.value();return a!==null?a>=15:!0}G(){return this.H.value()}u(){return Promise.resolve({width:window.screen.width*window.devicePixelRatio,height:window.screen.height*window.devicePixelRatio})}O(){return!this.Aa.value()}N(){return!1}};
if(navigator.userAgent.includes("SOPOpenBrowser")||navigator.userAgent.includes("DT_STB_BCM")||navigator.userAgent.includes("Sky_STB")||!(!(navigator.vendor||"").includes("Apple")||/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)||navigator.maxTouchPoints>1||navigator.userAgentData&&navigator.userAgentData.platform&&navigator.userAgentData.platform.toLowerCase()=="macos"||navigator.platform&&navigator.platform.toLowerCase().includes("mac")))Ha=()=>new rx;function sx(){let a=null;const b=navigator.userAgent.match(/Chrome\/(\d+)/);b&&(a=parseInt(b[1],10));switch(a){case 38:return 3;case 53:return 4;case 68:return 5;case 79:return 6;case 87:return 22;case 94:return 23;case 108:return 24;case 120:return 25;default:return null}}
var tx=class extends ex{constructor(){super();this.H=sx();this.C=null;try{const a=new PalmServiceBridge;a.onservicecallback=b=>{b=JSON.parse(b);this.C=b.configs?.["tv.model.supportHDR"]??b.configs?.["tv.config.supportDolbyHDRContents"]??!1};a.call("luna://com.webos.service.config/getConfigs",JSON.stringify({configNames:["tv.model.supportHDR","tv.config.supportDolbyHDRContents"]}))}catch(a){ja("WebOS: getConfigs call failed",a)}}g(){return this.H}m(){return"WebOS"}i(){return"TV"}h(){return"CHROMIUM"}o(){return!1}B(){const a=
this.g();return a!==null?a>3:super.B()}l(){return!1}J(){const a=this.g();return a!==null?a>3:super.J()}u(){const a={width:1920,height:1080};try{const b=JSON.parse(window.PalmSystem.deviceInfo);a.width=Math.max(1920,b.screenWidth);a.height=Math.max(1080,b.screenHeight)}catch(b){ja("WebOS: Error detecting screen size, default screen size 1920x1080.")}return Promise.resolve(a)}j(a){super.j(a);this.g()===3&&(a.streaming.crossBoundaryStrategy="reset");a.streaming.shouldFixTimestampOffset=!0;a.streaming.stallSkip=
0;return a}F(a){return this.C==null?(ja("WebOS: getConfigs call haven't finished"),super.F(a)):this.C?a?"HLG":"PQ":"SDR"}va(){return!1}A(){const a=this.g();return a!==null?a>=6:super.A()}};if(navigator.userAgent.includes("Web0S")){const a=new tx;Ha=()=>a};function ux(){let a=null;try{a=typeof Windows!=="undefined"?Windows:chrome.webview.hostObjects.sync.Windows}catch(b){}return a}
var vx=class extends ex{constructor(){super();this.C=navigator.userAgent.includes("Edge/");const a=navigator.userAgent.match(/Edge?\/(\d+)/);this.H=a?parseInt(a[1],10):null}g(){return this.H}m(){return"Xbox"}i(){return"CONSOLE"}h(){return this.C?"EDGE":"CHROMIUM"}G(){return!0}S(){return!0}K(){return!0}ua(){return this.C}u(){const a={width:1920,height:1080};var b=ux();if(b)try{const c=new b.Media.Protection.ProtectionCapabilities,d=b.Media.Protection.ProtectionCapabilityResult;b=null;do b=c.isTypeSupported('video/mp4;codecs="hvc1,mp4a";features="decode-res-x=3840,decode-res-y=2160,decode-bitrate=20000,decode-fps=30,decode-bpc=10,display-res-x=3840,display-res-y=2160,display-bpc=8"',
"com.microsoft.playready.recommendation");while(b===d.maybe);b===d.probably&&(a.width=3840,a.height=2160)}catch(c){ja("Xbox: Error detecting screen size, default screen size 1920x1080.")}return Promise.resolve(a)}j(a){super.j(a);a.drm.parseInbandPsshEnabled=this.C;a.drm.preferredKeySystems.push("com.microsoft.playready");this.C&&(a.streaming.gapPadding=.01);return a}M(){return!0}W(){return!1}};if(navigator.userAgent.includes("Xbox One")||ux()!==null)Ha=()=>new vx;var wx=class{constructor(a,b,c){this.type=a;this.aa=b;this.segments=c||null}};function xx(a,b){if(b)return a.toString();b=(new Set).add("AUDIO").add("VIDEO").add("SUBTITLES").add("PATHWAY-ID").add("GROUP-ID").add("URI");return a.toString(b)}function yx(a,b){return a.attributes.find(c=>c.name===b)||null}function Y(a,b,c){return(a=yx(a,b))?a.value:c||null}function zx(a,b){a=yx(a,b);if(!a)throw new F(2,4,4023,b);return a.value}
var Ax=class{constructor(a,b,c,d=null){this.id=a;this.name=b;this.attributes=c;this.value=d}toString(a){var b=d=>d.name+"="+(isNaN(Number(d.value))?'"'+d.value+'"':d.value);let c="#"+this.name;b=this.attributes?this.attributes.filter(d=>a?!a.has(d.name):!0).map(b):[];this.value&&b.unshift(this.value);b.length>0&&(c+=":"+b.join(","));return c}},Bx=class{constructor(a,b,c=[]){this.aa=b;this.g=a;this.$b=c}},Cx=class{constructor(a,b){this.name=a;this.value=b}};function Dx(a,b){return a.filter(c=>c.name==b)}function Ex(a,b){return a.filter(c=>zx(c,"TYPE")==b)}function Fx(a,b){for(const c of a)if(c.name===b)return c;return null}function Gx(a,b,c=0){return(a=Fx(a,b))?Number(a.value):c}function Hx(a,b,c){return b?Ix(a,[b],c):[]}function Ix(a,b,c){if(!b.length)return[];let d=b;c&&c.size&&(d=b.map(e=>Jx(e,c)));return Vb(a,d)}
function Jx(a,b){if(!b||!b.size)return a;a=String(a).replace(/%7B/g,"{").replace(/%7D/g,"}");var c=a.match(/{\$\w*}/g);if(c)for(const d of c){c=d.slice(2,d.length-1);const e=b.get(c);if(e)a=a.replace(d,e);else throw new F(2,4,4039,c);}return a}function Kx(a){a=a.value;const b=a.indexOf(",");return Number(b===-1?a:a.substring(0,b))};function Lx(a,b){var c=b.indexOf(":"),d=c===-1?b.substring(1):b.substring(1,c);if(!d.startsWith("EXT"))throw new F(2,4,4016,b);const {name:e,data:f}={name:d,data:c===-1?null:b.substring(c+1)};if(f===null)return new Ax(a,e,[]);if(f.indexOf("=")===-1)return new Ax(a,e,[],f);b=[];c=null;d=0;var g=f.indexOf(","),h=f.indexOf("=");g!==-1&&g<h&&(c=f.substring(0,g),d=g+1);for(;d<f.length;){for(;f[d]===" ";)d++;h=f.indexOf("=",d);if(h===-1)break;g=f.substring(d,h);d=h+1;if(f[d]==='"'){d++;var k=f.indexOf('"',
d);h=k===-1?f.substring(d):f.substring(d,k);d=k===-1?f.length:k+1}else k=f.indexOf(",",d),h=k===-1?f.substring(d):f.substring(d,k),d=k===-1?f.length:k;d<f.length&&f[d]===","&&d++;b.push(new Cx(g,h))}return new Ax(a,e,b,c)}
function Mx(a,b){var c=Eb(b).trim().split(/[\r\n]+/);if(!c[0].startsWith("#EXTM3U"))throw new F(2,4,4015);b=0;var d=!1;const e=[];var f=!0;for(var g=0;g<c.length;g++){var h=c[g],k=c[g+1];if(h.startsWith("#")&&!h.startsWith("#EXT")||f){f=!1;continue}h=Lx(a.g++,h);d||(Nx.has(h.name)?(b=1,d=!0):h.name=="EXT-X-STREAM-INF"||h.name=="EXT-X-MEDIA"?d=!0:Ox.has(h.name)&&(b=1,d=!0));if(Ox.has(h.name)){if(b!=1)throw new F(2,4,4017);var l=g;g=Array(Math.max(100,Math.floor((c.length-l)/2)));d=0;k=[];h=[];for(f=
null;l<c.length;l++){var m=c[l];if(m.startsWith("#EXT"))m=Lx(a.g++,m),Nx.has(m.name)?e.push(m):m.name=="EXT-X-MAP"?f=m:m.name=="EXT-X-PART"?h.push(m):m.name=="EXT-X-PRELOAD-HINT"?Y(m,"TYPE")=="PART"?h.push(m):Y(m,"TYPE")=="MAP"&&(m.name="EXT-X-MAP",f=m):k.push(m);else if(!m.startsWith("#")||m.startsWith("#EXT"))m=m.trim(),f&&k.push(f),k=new Bx(m,k,h),d<g.length?g[d++]=k:(g.push(k),d++),k=[],h=[]}h.length&&(f&&k.push(f),a=new Bx("",k,h),d<g.length?g[d++]=a:(g.push(a),d++));return new wx(b,e,d<g.length?
g.slice(0,d):g)}e.push(h);h.name=="EXT-X-STREAM-INF"&&(h.attributes.push(new Cx("URI",k)),f=!0)}return new wx(b,e)}var Px=class{constructor(){this.g=0}},Nx=new Set("EXT-X-TARGETDURATION EXT-X-MEDIA-SEQUENCE EXT-X-DISCONTINUITY-SEQUENCE EXT-X-PLAYLIST-TYPE EXT-X-I-FRAMES-ONLY EXT-X-ENDLIST EXT-X-SERVER-CONTROL EXT-X-SKIP EXT-X-PART-INF EXT-X-DATERANGE".split(" ")),Ox=new Set("EXTINF EXT-X-BYTERANGE EXT-X-DISCONTINUITY EXT-X-PROGRAM-DATE-TIME EXT-X-KEY EXT-X-DATERANGE EXT-X-MAP EXT-X-GAP EXT-X-TILES".split(" "));function Qx(a,b){try{const c=Rx(a);return Pf({uri:a,originalUri:a,data:c.data,headers:{"content-type":c.contentType},originalRequest:b})}catch(c){return Mf(c)}}
function Rx(a){if(!a.startsWith("data:"))throw new F(2,1,1004,a);var b=a.substring(5),c=b.indexOf(",");if(c<0)throw new F(2,1,1004,a);a=b.substring(0,c);b=decodeURIComponent(b.substring(c+1));c=a.split(";");a=c[0];let d=!1;c.length>1&&c[c.length-1].toLowerCase()=="base64"&&(d=!0,c.pop());let e;d?e=Ob(b):e=Ib(b);return{data:e,contentType:a,eg:c}}var Sx=class{};v("shaka.net.DataUriPlugin",Sx);Sx.parse=Qx;Yf("data",Qx);async function Tx(a,b,c,d){if(c=="video/mp2t")throw new F(2,4,4040);if("apple"===window.shakaMediaKeysPolyfill)throw new F(2,4,4041);var e=zx(b,"METHOD");if(!["SAMPLE-AES","SAMPLE-AES-CTR"].includes(e))return null;c="cenc";e=="SAMPLE-AES"&&(c="cbcs");e=zx(b,"URI");b=Wb("com.apple.fps",c,null,e);c=(new Ua(e)).pb.replace(/-/g,"").toLowerCase();c=c.length===32&&/^[0-9a-f]+$/.test(c)?c:null;!c&&d&&(c=await Ux(a,d));c&&b.keyIds.add(c);return b}
async function Vx(a){if(a.h){try{const b=Date.now();await a.update();const c=Date.now();if(Wx(a)){a.Lb.sample(1,(c-b)/1E3);const d=Math.max(0,(a.g.updatePeriod>0?a.g.updatePeriod:a.u)-ea(a.Lb));isFinite(d)?a.A.ma(d):a.A.ma(1)}}catch(b){if(!a.h)return;if(a.g.raiseFatalErrorOnManifestUpdateRequestFailure){a.h.onError(b);return}b.severity=1;a.h.onError(b);a.A.ma(.1)}if(a.h)a.h.onManifestUpdated()}}function Xx(a,b,c){return Yx(a,ag(b,a.g.retryParameters),0,{type:c?2:3})}
async function Zx(a,b){b=Mx(a.Na,b);var c=Dx(b.aa,"EXT-X-DEFINE"),d=[],e=[],f=[];a.m=new Q(null,0);a.m.Ac(!0);const g=()=>[a.G];var h=null,k=new Map;a.i={presentationTimeline:a.m,variants:d,textStreams:e,imageStreams:f,offlineSessionIds:[],sequenceMode:a.g.hls.sequenceMode,ignoreManifestTimestampsInSegmentsMode:a.g.hls.ignoreManifestTimestampsInSegmentsMode,type:"HLS",serviceDescription:null,nextUrl:null,periodCount:1,gapCount:0,isLowLatency:!1,startTime:a.o};if(b.type==1){a.O=!1;k=Dx(b.aa,"EXT-X-DEFINE");
k=$x(a,k,a.G);h=new Map;var l=await ay(a,a.F++,k,b,g,"","video","",!0,"Media Playlist",null,h,null,!1,null,!1);a.j.set(a.G,l);if(l.stream){const r=cl(l.stream);l.stream.segmentIndex.fb(q=>{q.$&&(q.$.Qc=r)})}h=l.stream.type;c=!0;a.g.disableAudio&&l.type=="audio"?c=!1:a.g.disableVideo&&l.type=="video"&&!l.stream.codecs.includes(",")&&(c=!1);c&&d.push({id:0,language:Ie("und"),disabledUntilTime:0,primary:!0,audio:l.type=="audio"?l.stream:null,video:l.type=="video"?l.stream:null,bandwidth:l.stream.bandwidth||
0,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]})}else{by(a,c);e=Dx(b.aa,"EXT-X-MEDIA");d=Dx(b.aa,"EXT-X-STREAM-INF");f=Dx(b.aa,"EXT-X-IMAGE-STREAM-INF");c=Dx(b.aa,"EXT-X-I-FRAME-STREAM-INF");const r=Dx(b.aa,"EXT-X-SESSION-KEY");var m=Dx(b.aa,"EXT-X-SESSION-DATA"),n=Dx(b.aa,"EXT-X-CONTENT-STEERING");cy(a,m);await dy(a,n);if(!a.g.ignoreSupplementalCodecs){m=[];for(var p of d){n=Y(p,"SUPPLEMENTAL-CODECS");if(!n)continue;const q=n.split(/\s*,\s*/).map(t=>t.split("/")[0]);n=p.attributes.map(t=>
{const u=t.name;let x=t.value;u=="CODECS"&&(x=q.join(","),t=t.value.split(","),t.length>1&&(t=Zb("audio",t))&&(x+=","+t));return new Cx(u,x)});m.push(new Ax(p.id,p.name,n,null))}d.push(...m);p=[];for(l of c){m=Y(l,"SUPPLEMENTAL-CODECS");if(!m)continue;const q=m.split(/\s*,\s*/).map(t=>t.split("/")[0]);m=l.attributes.map(t=>{const u=t.name;t=t.value;u=="CODECS"&&(t=q.join(","));return new Cx(u,t)});p.push(new Ax(l.id,l.name,m,null))}c.push(...p)}ey(a,d);fy(a,e);l=gy(a,c);d=await hy(a,d,r,e,g,a.B,l);
e=iy(a,e);f=await jy(a,f,c)}if(!a.h)throw new F(2,7,7001);ky(a,b);b.type==1&&(Wx(a)&&(ly(a,b),a.A.ma(a.u)),l=Array.from(a.j.values()),my(a,l),ny(a),oy(a,b.aa,h,k,g));a.i.variants=d;a.i.textStreams=e;a.i.imageStreams=f;a.i.startTime=a.o;if(!a.Y&&a.g.hls.disableCodecGuessing){b=[];for(const r of a.i.variants)r.audio&&r.audio.codecs===""&&b.push(r.audio.createSegmentIndex()),r.video&&r.video.codecs===""&&b.push(r.video.createSegmentIndex());await Promise.all(b)}a.h.makeTextStreamsForClosedCaptions(a.i)}
function Wx(a){return a.Ba!=py}
async function qy(a,b){if(!b.stream.isAudioMuxedInVideo){var c=[];for(var d of b.P()){var e=new Ua(d),f=e.g;b.Xd&&(b.zb>=0&&f.add("_HLS_msn",String(b.zb)),b.Ab>=0&&f.add("_HLS_part",String(b.Ab)));b.Yd&&f.add("_HLS_skip","YES");c.push(e.toString())}try{var g=await Xx(a,c,!0).promise}catch(q){throw a.h&&a.h.disableStream(b.stream),q;}if(b.stream.segmentIndex){c=Mx(a.Na,g.data);if(c.type!=1)throw new F(2,4,4017);d=g.uri;d==g.originalUri||b.P().includes(d)||b.Be.push(d);g=Dx(c.aa,"EXT-X-DEFINE");g=$x(a,
g,d);d=b.stream;e=ry(a,b);var {keyIds:h,drmInfos:k,encrypted:l,kg:m}=await sy(a,c,d.mimeType,b.P,g);d.encrypted||!l||m||(d.encrypted=!0);((q,t)=>q.size===t.size&&[...q].every(u=>t.has(u)))(d.keyIds,h)||(d.keyIds=h,d.drmInfos=k,a.h.newDrmInfo(d));var {segments:n,bandwidth:p}=ty(a,c,e,g,b.P,b.type);p&&(d.bandwidth=p);f=cl(d);for(var r of n)r.$&&(r.$.Qc=f);d.segmentIndex.ud(n,a.m.ub());if(n.length){r=Gx(c.aa,"EXT-X-MEDIA-SEQUENCE",0);f=(f=Fx(c.aa,"EXT-X-SKIP"))?Number(Y(f,"SKIPPED-SEGMENTS")):0;const {zb:q,
Ab:t}=uy(r,n);b.zb=q+f;b.Ab=t;r=e.get(r);d.segmentIndex.Oa(r)}if(r=d.segmentIndex.qb())b.wc=r.startTime,b.mc=n[n.length-1].endTime;Fx(c.aa,"EXT-X-ENDLIST")&&(b.pd=!0);vy(a,c);oy(a,c.aa,d.type,g,b.P)}}}function wy(a,b){const c=[];for(const d of b)d.segmentIndex&&d.segmentIndex.fb(e=>{c.push(e)});a.m.wd(c)}function xy(a,b){a.Ba=b;a.m&&a.m.Ac(!Wx(a));Wx(a)||a.A.stop()}
function ny(a){if(Wx(a)){if(a.Ba==yy){var b=Infinity;let c=Infinity;for(const d of a.j.values())d.stream.segmentIndex&&d.stream.type!="text"&&!d.stream.isAudioMuxedInVideo&&(b=Math.min(b,d.mc),c=Math.min(c,d.wc));b=b-c||0;isNaN(a.g.availabilityWindowOverride)||(b=a.g.availabilityWindowOverride);a.m.Ge(b)}}else a.m.jb(zy(a));if(!a.m.o)for(const c of a.j.values()){if(!c.stream.segmentIndex)continue;if(c.type!="audio"&&c.type!="video")continue;(b=c.stream.segmentIndex.qb())&&b.h!=null&&a.m.Yf(b.h)}a.m.pe()}
function ry(a,b){return Wx(a)?a.C.get(b.type):b.qe}function $x(a,b,c){c=(new Ua(c)).g;const d=new Map;for(const g of b){var e=Y(g,"NAME");const h=Y(g,"VALUE");var f=Y(g,"QUERYPARAM");b=Y(g,"IMPORT");e&&h&&(d.has(e)||d.set(e,h));f&&(e=c.get(f)[0])&&!d.has(e)&&d.set(f,e);b&&(f=a.B.get(b))&&d.set(b,f)}return d}
async function sy(a,b,c,d,e){var f=new Map;if(!a.g.ignoreDrmInfo&&b.segments)for(var g of b.segments){var h=Dx(g.aa,"EXT-X-KEY"),k=void 0;if(h.length){k=Ay(a,b,g.aa,d,e);for(var l of h)f.set(l,k)}}g=b=!1;h=[];k=new Set;for(const [n,p]of f){f=n;l=p;var m=zx(f,"METHOD");if(m!="NONE"){b=!0;const r=Y(f,"KEYFORMAT")||"identity";if(By(m))g=!0;else if(f=r=="identity"?await Cy(a,f,c,d,l,e):(m=a.Ob.get(r))?await m(f,c,l):null,f){if(f.keyIds)for(const q of f.keyIds)k.add(q);h.push(f)}}}return{drmInfos:h,keyIds:k,
encrypted:b,kg:g}}
function ty(a,b,c,d,e,f){const g=b.segments;let h=null,k=null,l=null,m=null,n=void 0,p=Gx(b.aa,"EXT-X-DISCONTINUITY-SEQUENCE",-1);const r=Gx(b.aa,"EXT-X-MEDIA-SEQUENCE",0);var q=Fx(b.aa,"EXT-X-SKIP");const t=q?Number(Y(q,"SKIPPED-SEGMENTS")):0;var u=r+t;let x=0;Wx(a)&&c.has(u)&&(x=c.get(u));x===0&&a.Ba==yy&&c.size>0&&!c.has(u)&&a.m.i!=null&&(x=a.m.ub());const y=[];var w=null;q=[];const z=E=>{E=El(E);if(!E)return null;let Z=Dy.get(f).get(E);Z||=Ey.get(E);return Z};for(let E=0;E<g.length;E++){var A=g[E];
(u=Fx(A.aa,"EXT-X-MAP"))&&u.id!==k&&(h=Ay(a,b,A.aa,e,d),k=u.id);u=A.g;var B="";u&&(B=El(u));B!==m&&(l=z(u),m=B);B=E==0?x:w.endTime;u=r+t+E;Fx(A.aa,"EXT-X-DISCONTINUITY")&&(p++,w&&w.$&&(w.$.g=B));for(const Z of A.aa)Z.name=="EXT-X-KEY"&&(By(zx(Z,"METHOD"))?n=Fy(a,Z,b,e,d):n=void 0);c.set(u,B);if(B=Gy(a,h,w,A,B,d,f,e,l,n)){if(w=Gx(A.aa,"EXT-X-BITRATE"))q.push({bitrate:w,duration:B.endTime-B.startTime}),B.bandwidth=w;else if(B.endByte){if(A=zi(B))w=B.endTime-B.startTime,A=A*8/w/1E3,q.push({bitrate:A,
duration:w}),B.bandwidth=A}else q.length&&(w=q[q.length-1],w.duration+=B.endTime-B.startTime,B.bandwidth=w.bitrate);if(B.bandwidth)for(const Z of B.g)Z.bandwidth=B.bandwidth;w=B;B.i=p;Hy(a,f)&&a.M!=null&&u<a.M||y.push(B)}}b=void 0;q.length&&(b=q.reduce((E,Z)=>E+Z.duration,0),b=Math.round(q.reduce((E,Z)=>E+Z.bitrate*Z.duration,0)/b*1E3));if(q=y.some(E=>E.h!=null))for(c=0;c<y.length;c++){const E=y[c];if(E.h!=null)continue;let Z=0,J=c;d=()=>{const I=y[J];if(I){if(I.h!=null)return I.h+Z;Z-=I.endTime-
I.startTime;J+=1}return null};let K=0,ba=c;for(e=()=>{const I=y[ba];if(I){I!=E&&(K+=I.endTime-I.startTime);if(I.h!=null)return I.h+K;--ba}return null};E.h==null;)E.h=e(),E.h==null&&(E.h=d())}if(q)for(var D of y){c=D.h;for(const E of D.g)E.h=c,c+=E.endTime-E.startTime}D=a.ea;if(q&&D!=Infinity&&!Hy(a,f))for(const E of y)E.ag(D);return{segments:y,bandwidth:b}}
function uy(a,b){a=a+b.length-1;let c=-1;if(!b.length)return a++,{zb:a,Ab:c};b=b[b.length-1];const d=b.g;if(!b.g.length)return a++,b.o&&(c=0),{zb:a,Ab:c};c=d.length-1;d[d.length-1].isPreload()||(a++,c=0);return{zb:a,Ab:c}}
function vy(a,b){var c=Infinity,d=b.segments;if(d.length)for(var e=d.length-1;e>=0;){const f=Fx(d[e].aa,"EXTINF");if(f){c=Kx(f);break}e--}d=Fx(b.aa,"EXT-X-TARGETDURATION");if(!d)throw new F(2,4,4024,"EXT-X-TARGETDURATION");d=Number(d.value);if(e=Fx(b.aa,"EXT-X-PART-INF"))a.R=Number(zx(e,"PART-TARGET"));b=Fx(b.aa,"EXT-X-SERVER-CONTROL");a.ha&&a.R?(a.u=a.Zb?a.R*5<=c?Math.min(a.R,a.u):Math.min(c,a.u):Math.min(a.R,a.u),a.Ha=b?Number(zx(b,"PART-HOLD-BACK")):0):(a.u=Math.min(c,a.u),c=b?yx(b,"HOLD-BACK"):
null,a.Aa=c?Number(c.value):0);a.Ra=Math.max(d,a.Ra)}
function oy(a,b,c,d,e){if(c=="video"||c=="audio"){var f=a.m.m;if(f!=null&&!Hy(a,c))for(b=Dx(b,"EXT-X-DATERANGE"),b=b.filter(h=>yx(h,"START-DATE")!=null).sort((h,k)=>{h=zx(h,"START-DATE");k=zx(k,"START-DATE");return h<k?-1:h>k?1:0}),c=0;c<b.length;c++){const h=b[c];try{const k=zx(h,"START-DATE"),l=cd(k);if(isNaN(l))continue;const m=Math.max(0,l-f);let n=null;const p=Y(h,"END-DATE");if(p){const u=cd(p);if(!isNaN(u)&&(n=u-f,n<0))continue}if(n==null){const u=Y(h,"DURATION")||Y(h,"PLANNED-DURATION");if(u){const x=
parseFloat(u);isNaN(x)||(n=m+x);if(l-f+x<0)continue}}const r=Y(h,"CLASS")||"com.apple.quicktime.HLS",q=Y(h,"END-ON-NEXT")=="YES";if(n==null&&q){for(var g=c+1;g<b.length;g++){const u=Y(b[g],"CLASS")||"com.apple.quicktime.HLS";if(r!=u)continue;const x=zx(b[g],"START-DATE"),y=cd(x);if(!isNaN(y)&&y&&y>l){n=Math.max(0,y-f);break}}if(n==null)continue}g=["CLASS","START-DATE","END-DATE","DURATION","END-ON-NEXT"];const t=[];for(const u of h.attributes){if(g.includes(u.name))continue;let x=Jx(u.value,d);if(u.name==
"X-ASSET-URI"||u.name=="X-ASSET-LIST")x=Hx(e(),u.value,d)[0];t.push({key:u.name,description:"",data:x,mimeType:null,pictureType:null})}if(t.length>1)a.h.onMetadata(r,m,n,t)}catch(k){}}}}function Hy(a,b){return a.g.hls.ignoreManifestProgramDateTime?!0:a.g.hls.ignoreManifestProgramDateTimeForTypes.includes(b)}function Iy(a,b,c){if(!(Math.abs(c)<.001)){b.wc+=c;b.mc+=c;a=ry(a,b);for(const [d,e]of a)a.set(d,e+c);b.P()}}
function Jy(a,b,c=!1){var d=a.M==-1;for(const f of b){var e=f.stream.segmentIndex;const g=ry(a,f);if(e=e.qb())for(const [h,k]of g)if(k==e.startTime){d&&(a.M=Math.max(a.M,h));f.Ze=h;break}}if(!(a.M<0))for(const f of b){if(!Hy(a,f.type)&&!c)continue;if(b=f.stream.segmentIndex)if(d=a.M-f.Ze,d>0&&(b.g.splice(0,d),b=b.qb()))b=-b.startTime,f.stream.segmentIndex.offset(b),Iy(a,f,b)}}
function Ky(a,b){if(a.ea==Infinity)for(var c of b)b=c.stream.segmentIndex.qb(),b!=null&&b.h!=null&&(a.ea=Math.min(a.ea,b.h));c=a.ea;if(c!=Infinity)for(const d of a.j.values()){if(Hy(a,d.type))continue;b=d.stream.segmentIndex;if(b!=null){const e=b.qb();if(e)if(e.h==null)ia("Missing EXT-X-PROGRAM-DATE-TIME for stream",d.P(),"Expect AV sync issues!");else{Iy(a,d,e.h-c-e.startTime);for(const f of b)f.ag(c)}}}}
async function ay(a,b,c,d,e,f,g,h,k,l,m,n,p,r,q,t,u,x=!0,y=!0){b=d.segments||[];var w=b.every(ra=>Fx(ra.aa,"EXT-X-GAP")?!0:!1);if(!b.length||w)throw new F(2,4,4053);Ly(a,d);Wx(a)&&vy(a,d);b=Wx(a)?a.C.get(g):new Map;const {segments:z,bandwidth:A}=ty(a,d,b,c,e,g);let B=w=null,D=null,E=null,Z=null;z.length>0&&x&&(x=await My(a,z),g!=x.type&&Wx(a)&&(a.C.set(x.type,a.C.get(g)),a.C.set(g,new Map)),g=x.type,h=x.language,m=x.channelCount,q=x.sampleRate,a.g.disableText||(n=x.closedCaptions),B=x.height,w=x.width,
D=x.Gd,E=x.colorGamut,Z=x.frameRate,y&&(u=x.mimeType,f=x.codecs));u||(u=await Ny(a,g,f,z),g!=G||f||u!="application/mp4"||!z[0]||z[0].$||(u="text/vtt"));const {drmInfos:J,keyIds:K,encrypted:ba,kg:I}=await sy(a,d,u,e,c);if(ba&&!J.length&&!I)throw new F(2,4,4026);c=Oy(a,f,g,h,k,l,m,n,p,r,q,t);c.encrypted=ba&&!I;c.drmInfos=J;c.keyIds=K;c.mimeType=u;A&&(c.bandwidth=A);Py(c);g=="video"&&(w||B||D||E)&&Qy(c,w,B,Z,D,null,E);Wx(a)&&vy(a,d);a=z[0].startTime;u=z[z.length-1].endTime;c.segmentIndex=new Uk(z);f=
(h=Fx(d.aa,"EXT-X-SERVER-CONTROL"))?yx(h,"CAN-SKIP-UNTIL")!=null:!1;h=h?yx(h,"CAN-BLOCK-RELOAD")!=null:!1;d=Gx(d.aa,"EXT-X-MEDIA-SEQUENCE",0);const {zb:aa,Ab:N}=uy(d,z);return{stream:c,type:g,Be:[],P:e,wc:a,mc:u,Yd:f,Xd:h,pd:!1,Ze:-1,zb:aa,Ab:N,qe:b}}function by(a,b){const c=(new Ua(a.G)).g;for(const e of b){var d=Y(e,"NAME");const f=Y(e,"VALUE");b=Y(e,"QUERYPARAM");d&&f&&(a.B.has(d)||a.B.set(d,f));b&&(d=c.get(b)[0])&&!a.B.has(d)&&a.B.set(b,d)}}
function cy(a,b){for(const d of b){var c=Y(d,"DATA-ID");b=Y(d,"URI");const e=Y(d,"LANGUAGE"),f=Y(d,"VALUE");c=(new Map).set("id",c);b&&c.set("uri",Hx([a.G],b,a.B)[0]);e&&c.set("language",e);f&&c.set("value",f);b=new L("sessiondata",c);if(a.h)a.h.onEvent(b)}}async function dy(a,b){if(a.h&&a.g){for(const d of b){b=Y(d,"PATHWAY-ID");const e=Y(d,"SERVER-URI");if(b&&e){a.l=new Ev(a.h);a.l.configure(a.g);a.l.i=[a.G];a.l.setManifestType("HLS");a.l.h=b;var c=Bv(a.l,e);break}}await c}}
function ey(a,b){for(const e of b){var c=Y(e,"AUDIO");b=Y(e,"VIDEO");var d=Y(e,"SUBTITLES");const f=Ry(a,e);if(d){const g=Zb(G,f);a.J.set(d,g);sa(f,g)}c&&(d=Zb("audio",f),d||(d=a.g.hls.defaultAudioCodec),a.J.set(c,d));b&&(c=Zb("video",f),c||(c=a.g.hls.defaultVideoCodec),a.J.set(b,c))}}
function fy(a,b){b=Ex(b,"CLOSED-CAPTIONS");a.O=b.length==0;for(const d of b){var c=Y(d,"LANGUAGE");b=Ie(c||"und");c||(c=Y(d,"NAME"))&&(b=c);c=zx(d,"GROUP-ID");const e=zx(d,"INSTREAM-ID").replace("SERVICE","svc");a.I.get(c)||a.I.set(c,new Map);a.I.get(c).set(e,b)}}function gy(a,b){return b.map(c=>{c=Sy(a,c);return c.stream.type!=="video"?null:c.stream}).filter(c=>c)}
async function hy(a,b,c,d,e,f,g){const h=[],k=new Set;if(!a.g.ignoreDrmInfo&&c.length>0)for(var l of c){c=zx(l,"METHOD");var m=Y(l,"KEYFORMAT")||"identity";let r=null;if(c!="NONE")if(By(c))m=Hx(e(),zx(l,"URI"),f),c=m.sort().join(""),a.N.has(c)||(m=Yx(a,ag(m,a.g.retryParameters),6).promise,a.N.set(c,m));else if(r=m=="identity"?await Cy(a,l,"",e,null,f):(c=a.Ob.get(m))?await c(l,"",null):null,r){if(r.keyIds)for(var n of r.keyIds)k.add(n);h.push(r)}}e={};for(var p of b)b=xx(p,!a.l),e[b]?e[b].push(p):
e[b]=[p];p=[];for(const r in e){l=e[r];c=l[0];b=Y(c,"FRAME-RATE");f=Number(zx(c,"BANDWIDTH"))||Number(Y(c,"AVERAGE-BANDWIDTH"));n=Y(c,"RESOLUTION");const [q,t]=n?n.split("x"):[null,null];n=Y(c,"VIDEO-RANGE");(c=Y(c,"REQ-VIDEO-LAYOUT"))&&c.includes(",")&&(c=c.split(",").filter(u=>u=="CH-STEREO"||u=="CH-MONO")[0]);c=c||"CH-MONO";l=Ty(a,l,d);p.push(...Uy(a,l.audio,l.video,f,q,t,b,n,c,h,k,g))}return p.filter(r=>r!=null)}
function iy(a,b){b=Ex(b,"SUBTITLES");const c={};for(var d of b){const f=xx(d,!a.l);c[f]?c[f].push(d):c[f]=[d]}d=[];if(!a.g.disableText)for(var e in c)try{d.push(Vy(a,c[e],new Map).stream)}catch(f){if(!a.g.hls.ignoreTextStreamFailures)throw f;}for(const f of b)if(b=zx(f,"GROUP-ID"),e=a.J.get(b))if(b=a.K.get(b))for(const g of b)g.stream.codecs=e,g.stream.mimeType=Wy(G,e)||Xy(G),Py(g.stream);return d.filter(f=>f)}
async function jy(a,b,c){b=b.map(async d=>{if(a.g.disableThumbnails)return null;try{return(await Yy(a,d)).stream}catch(e){if(a.g.hls.ignoreImageStreamFailures)return null;throw e;}}).concat(c.map(d=>{if(a.g.disableThumbnails)return null;try{const e=Sy(a,d);return e.stream.type!=="image"?null:e.stream}catch(e){if(a.g.hls.ignoreImageStreamFailures)return null;throw e;}}));return(await Promise.all(b)).filter(d=>d)}
function ky(a,b){a.o==null&&(b=Fx(b.aa,"EXT-X-START"))&&(a.o=Number(zx(b,"TIME-OFFSET")))}function ly(a,b){let c=0;if(a.g.defaultPresentationDelay)c=a.g.defaultPresentationDelay;else if(a.Ha)c=a.Ha;else if(a.Aa)c=a.Aa;else{const e=b.segments.length;var d=Math.min(e,a.g.hls.liveSegmentsDelay);for(d=e-d;d<e;d++){const f=Fx(b.segments[d].aa,"EXTINF");c=f?c+Kx(f):c+a.Ra}}a.o&&a.o<0&&(c=Math.min(-a.o,c),a.o+=c);a.m.Ug(0);a.m.Xf(c);a.m.Ac(!1)}
function my(a,b){if(!Wx(a)){var c=zy(a);for(var d of b)d.stream.segmentIndex.Ic(0,c)}wy(a,b.map(f=>f.stream));d=Array.from(a.j.values()).filter(f=>f.stream.segmentIndex);c=d.some(f=>f.stream.type=="audio");const e=d.some(f=>f.stream.type=="video");d=Wx(a)&&!a.Va;c=!Wx(a)&&a.Va&&!(c&&e);a.g.hls.ignoreManifestProgramDateTime||d||c?Jy(a,b,d):(Ky(a,b),a.g.hls.ignoreManifestProgramDateTimeForTypes.length>0&&Jy(a,b))}
function Zy(a,b){a=Wx(a)?Math.trunc((b.length-1)/2):0;let c=b[a];for(;c.Kb()==2&&a+1<b.length;)a++,c=b[a];return{segment:c,segmentIndex:a}}async function $y(a,b,c){if(!b)return{mimeType:null,data:null};var d=Fl(b.P(),b.kc(),b.hc(),a.g.retryParameters);d=await Yx(a,d,gg,{type:b instanceof M?1:0}).promise;a=d.data;b.aesKey&&(a=await Bl(a,b.aesKey,c));b instanceof M?b.Bd(a,!0):b.Bd(a);(b=d.headers["content-type"])&&(b=b.split(";")[0].toLowerCase());return{mimeType:b,data:a}}
async function My(a,b){const c=wl(a.g.hls.mediaPlaylistFullMimeType);if(!b.length)return c;const {segment:d,segmentIndex:e}=Zy(a,b);b=d.P();var f=El(b[0]);if(f&&(b=Ey.get(f)))return wl(b);var g=await Promise.all([$y(a,d.$,0),$y(a,d,e)]);b=g[1].mimeType;var h=g[0].data;g=g[1].data;var k="mp4 mp4a m4s m4i m4a m4f cmfa mp4v m4v cmfv fmp4".split(" "),l=["audio/mp4","video/mp4","video/iso.segment"];l=d.$||l.includes(b);if(!l&&nj(C(g))){{k=a.g.disableAudio;l=a.g.disableVideo;a=a.g.disableText;f=C(g);const n=
(new vj).parse(f),p=n.ld();f=n.yf();h=[];let r=!1,q=!1;if(!k)switch(p.audio){case "aac":case "aac-loas":n.gb().length&&(h.push("mp4a.40.2"),r=!0);break;case "mp3":n.gb().length&&(h.push("mp4a.40.34"),r=!0);break;case "ac3":n.gb().length&&(h.push("ac-3"),r=!0);break;case "ec3":n.gb().length&&(h.push("ec-3"),r=!0);break;case "opus":n.gb().length&&(h.push("opus"),r=!0)}if(!l)switch(p.video){case "avc":f.codec?h.push(f.codec):h.push("avc1.42E01E");q=!0;break;case "hvc":f.codec?h.push(f.codec):h.push("hvc1.1.6.L93.90");
q=!0;break;case "av1":h.push("av01.0.01M.08"),q=!0}if(h.length){k=r&&!q;l=new Map;if(q&&!a){a=new vc("video/mp2t");tc(a,g);for(m of a.g.getStreams())l.set(m,m);a.g.clear()}var m={type:k?"audio":"video",mimeType:"video/mp2t",codecs:h.join(", "),language:null,height:f.height,width:f.width,channelCount:null,sampleRate:null,closedCaptions:l,Gd:null,colorGamut:null,frameRate:f.frameRate,timescale:null}}else m=null}if(m)return m}else if(l||k.includes(f))if(m=xl(h,g,a.g.disableText))return m;return b?wl(b):
c}function Yx(a,b,c,d){if(!a.W)throw new F(2,7,7001);d||={};d.isPreload=a.Mb();b=a.h.networkingEngine.request(c,b,d);Wf(a.W,b);return b}function zy(a){let b=Infinity;for(const c of a.j.values())c.stream.segmentIndex&&c.stream.type!="text"&&!c.stream.isAudioMuxedInVideo&&(b=Math.min(b,c.mc));return b}
function Ry(a,b){b=Y(b,"CODECS")||"";a.Y=b.length>0;a.Y||a.g.hls.disableCodecGuessing||(b=[],a.g.disableVideo||b.push(a.g.hls.defaultVideoCodec),a.g.disableAudio||b.push(a.g.hls.defaultAudioCodec),b=b.join(","));return yl(b.split(/\s*,\s*/))}
function Vy(a,b,c,d=!0){var e=[],f=[],g=new Map;for(var h of b){var k=++a.F,l=d?zx(h,"URI"):Y(h,"URI")||"shaka://hls-muxed"+k;k=zx(h,"GROUP-ID");e.push(l);f.push(k);g.set(k,l);(l=Y(h,"PATHWAY-ID"))&&c.set(k,l)}d=f.sort().join(",");k=b[0];b="";h=zx(k,"TYPE").toLowerCase();h=="subtitles"&&(h=G);if(h==G)b=Y(k,"CODECS")||"";else for(var m of f)if(a.J.has(m)){b=a.J.get(m);break}f=e.sort().join(",");h=="audio"&&d&&(f+=d);if(a.j.has(f))return a.j.get(f);m=a.F++;if(a.l)for(const [t,u]of g)(g=c.get(t))&&Cv(a.l,
m,g,u);c=Y(k,"LANGUAGE");g=Y(k,"NAME");l=Y(k,"DEFAULT")=="YES";var n=h=="audio"?(n=Y(k,"CHANNELS"))?parseInt(n.split("/")[0],10):null:null;var p;h=="audio"?(p=Y(k,"CHANNELS"))?(p=p.split("/"),p=p.length!=2?!1:p[1]==="JOC"||p[1].includes("ATMOS")||p[1].includes("IMSA")):p=!1:p=!1;const r=Y(k,"CHARACTERISTICS"),q=Y(k,"FORCED")=="YES";h=="audio"?k=(k=Y(k,"SAMPLE-RATE"))?parseInt(k,10):null:k=null;e=az(a,m,e,b,h,c,l,g,n,null,r,q,k,p);e.stream&&a.g.enableAudioGroups&&(e.stream.groupId=d);a.K.has(d)?a.K.get(d).push(e):
a.K.set(d,[e]);a.j.set(f,e);return e}function Wy(a,b){if(a==G){if(b=="vtt"||b=="wvtt")return"text/vtt";if(b&&b!=="")return"application/mp4"}return a!="image"||b&&b!="jpeg"?a=="audio"&&b=="mp4a.40.34"?"audio/mpeg":b=="mjpg"?"application/mp4":null:"image/jpeg"}function Xy(a){return a==G?"text/vtt":Dy.get(a).get("mp4")}function Py(a){const b=new Set([be(a.mimeType,a.codecs)]);a.segmentIndex&&a.segmentIndex.fb(c=>{c.mimeType&&b.add(be(c.mimeType,a.codecs))});a.fullMimeTypes=b}
async function Yy(a,b){const c=zx(b,"URI");var d=Y(b,"CODECS","jpeg")||"";if(a.j.has(c))return a.j.get(c);var e=Y(b,"LANGUAGE"),f=Y(b,"NAME");const g=Y(b,"CHARACTERISTICS");d=az(a,a.F++,[c],d,"image",e,!1,f,null,null,g,!1,null,!1);if(e=Y(b,"RESOLUTION")){await d.stream.createSegmentIndex();if(f=d.stream.segmentIndex.qb().tilesLayout)d.stream.width=Number(e.split("x")[0])*Number(f.split("x")[0]),d.stream.height=Number(e.split("x")[1])*Number(f.split("x")[1]);d.stream.closeSegmentIndex()}if(b=Y(b,"BANDWIDTH"))d.stream.bandwidth=
Number(b);a.j.set(c,d);return d}function Sy(a,b){var c="video";const d=zx(b,"URI");var e=Y(b,"CODECS")||"";e=="mjpg"&&(c="image");if(a.j.has(d))return a.j.get(d);const f=Y(b,"LANGUAGE"),g=Y(b,"NAME"),h=Y(b,"CHARACTERISTICS");c=az(a,a.F++,[d],e,c,f,!1,g,null,null,h,!1,null,!1);e=Y(b,"RESOLUTION");const [k,l]=e?e.split("x"):[null,null];c.stream.width=Number(k)||void 0;c.stream.height=Number(l)||void 0;if(b=Y(b,"BANDWIDTH"))c.stream.bandwidth=Number(b);a.j.set(d,c);return c}
function bz(a,b,c){b=b.filter(e=>{const f=Y(e,"URI")||"";e=Y(e,"TYPE");return e!="SUBTITLES"&&(f!=""||e=="AUDIO")});const d={};for(const e of b)b=xx(e,!a.l),d[b]?d[b].push(e):d[b]=[e];for(const e in d)Vy(a,d[e],c,!1)}function By(a){return a=="AES-128"||a=="AES-256"||a=="AES-256-CTR"}
async function Cy(a,b,c,d,e,f){if(c=="video/mp2t")throw new F(2,4,4040);if("apple"===window.shakaMediaKeysPolyfill)throw new F(2,4,4041);c=zx(b,"METHOD");if(!["SAMPLE-AES","SAMPLE-AES-CTR"].includes(c))return null;d=Hx(d(),zx(b,"URI"),f);d[0].startsWith("data:text/plain;base64,")?b=Qb(Ob(d[0].split("data:text/plain;base64,").pop())):(b=d.sort().join(""),a.sa.has(b)||(d=Yx(a,ag(d,a.g.retryParameters),6).promise,a.sa.set(b,d)),b=await a.sa.get(b),b=Qb(b.data));d="00000000000000000000000000000000";e&&
(a=await Ux(a,e))&&(d=a);a=new Map;a.set(d,b);e="cenc";c=="SAMPLE-AES"&&(e="cbcs");return Xb(a,e)}
function Ty(a,b,c){const d={audio:[],video:[]};var e=new Map;const f=[];var g=!1,h=!1;for(var k of b){var l=Y(k,"AUDIO");const n=Y(k,"VIDEO"),p=l||n;if(!p)continue;f.includes(p)||f.push(p);const r=Y(k,"PATHWAY-ID");r&&e.set(p,r);l?g=!0:n&&(h=!0)}f.length&&c.length&&(c=c.filter(n=>f.includes(zx(n,"GROUP-ID"))),bz(a,c,e));c=(e=f.sort().join(","))&&a.K.has(e)?a.K.get(e):[];g?d.audio.push(...c):h&&d.video.push(...c);h=!1;const m=b.map(n=>zx(n,"URI"));g=d.audio.find(n=>n&&n.P().find(p=>m.includes(p)));
c=Ry(a,b[0]);k=Zb("video",c);(l=Zb("audio",c))&&!k?(g="audio",h=d.audio.length>0&&!d.audio.some(n=>n.stream.isAudioMuxedInVideo)):!d.audio.length&&!d.video.length&&l&&k?(g="video",c=[[k,l].join()]):d.audio.length&&g?(g="audio",h=!0):g=d.video.length&&!d.audio.length?"audio":"video";h||(b=cz(a,b,c,g),e&&a.g.enableAudioGroups&&(b.stream.groupId=e),b.stream.type=="audio"&&g==="audio"&&d.audio.some(n=>n.stream.isAudioMuxedInVideo)&&(a=d.audio[0].stream,b.stream.language=a.language,b.stream.channelsCount=
a.channelsCount,b.stream.label=a.label,b.stream.audioSamplingRate=a.audioSamplingRate,b.stream.originalId=a.originalId,b.stream.originalLanguage=a.originalLanguage),d[b.stream.type]=[b]);return d}
function Uy(a,b,c,d,e,f,g,h,k,l,m,n){for(var p of c)Qy(p.stream,e,f,g,h,k,null);e=a.g.disableVideo;if(!c.length||e)c=[null];e&&(b=b.filter(r=>!r.stream.isAudioMuxedInVideo));e=a.g.disableAudio;if(!b.length||e)b=[null];e=[];for(const r of b)for(const q of c){if(b=r?r.stream:null)b.drmInfos=l,b.keyIds=m;if(f=q?q.stream:null)f.drmInfos=l,f.keyIds=m,a.g.disableIFrames||yf(f,n);f&&!b&&(f.bandwidth=d);!f&&b&&(b.bandwidth=d);g=r?r.stream.drmInfos:null;h=q?q.stream.drmInfos:null;k=q?q.P().sort().join(","):
"";p=r?r.P().sort().join(","):"";const t=[];b&&b.codecs&&t.push(b.codecs);f&&f.codecs&&t.push(f.codecs);k=[k,p,t.sort()].join("-");if(b&&f&&!sb(g,h))continue;if(a.Wa.has(k))continue;b={id:a.F++,language:b?b.language:"und",disabledUntilTime:0,primary:!!b&&b.primary||!!f&&f.primary,audio:b,video:f,bandwidth:d,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]};e.push(b);a.Wa.add(k)}return e}
function cz(a,b,c,d){const e=a.F++,f=[];for(var g of b){var h=zx(g,"URI");const l=Y(g,"PATHWAY-ID");a.l&&l&&Cv(a.l,e,l,h);f.push(h)}g=f.sort().join(",")+c.sort().join(",");if(a.j.has(g))return a.j.get(g);h=f.join(",");a:{b=Y(b[0],"CLOSED-CAPTIONS");if(d=="video"){if(a.g.disableText){a.O=!1;var k=null;break a}if(b){if(b!="NONE"){k=a.I.get(b);break a}a.O=!1}else if(!b&&a.I.size)for(k of a.I.keys()){k=a.I.get(k);break a}}k=null}c=Yb(d,c);d=az(a,e,f,c,d,null,!1,h,null,k,null,!1,null,!1);a.j.set(g,d);
return d}function Qy(a,b,c,d,e,f,g){a&&(a.width=Number(b)||void 0,a.height=Number(c)||void 0,a.frameRate=Number(d)||void 0,a.hdr=e||void 0,a.videoLayout=f||void 0,a.colorGamut=g||void 0)}
function az(a,b,c,d,e,f,g,h,k,l,m,n,p,r){const q=Oy(a,d,e,f,g,h,k,l,m,n,p,r);c.some(z=>z.startsWith("shaka://hls-muxed"))&&(q.isAudioMuxedInVideo=!0,q.mimeType="video/mp2t",Py(q));const t={stream:q,type:e,Be:[],P:()=>{},wc:0,mc:0,qe:new Map,Yd:!1,Xd:!1,pd:!1,Ze:-1,zb:-1,Ab:-1},u=()=>a.l&&c.length>1?Dv(a.l,b):t.Be.concat(Ix([a.G],c,a.B));t.P=u;const x=async z=>{try{const I=await z.promise;if(!z.aborted){var A=I.uri;A!=I.originalUri&&(t.P().includes(A)||t.Be.push(A));var B=Mx(a.Na,I.data);if(B.type!=
1)throw new F(2,4,4017);var D=Dx(B.aa,"EXT-X-DEFINE"),E=$x(a,D,A);A=!1;(!a.Y&&a.g.hls.disableCodecGuessing||a.O&&e=="video"&&!a.g.hls.disableClosedCaptionsDetection)&&B.segments.length>0&&(a.O=!1,A=!0);var Z=Wx(a),J=await ay(a,0,E,B,u,d,e,f,g,h,k,l,m,n,p,r,void 0,A,!a.Y&&a.g.hls.disableCodecGuessing);if(!z.aborted){var K=J.stream;ky(a,B);Wx(a)&&!Z&&ly(a,B);t.wc=J.wc;t.mc=J.mc;t.Yd=J.Yd;t.Xd=J.Xd;t.pd=J.pd;t.qe=J.qe;t.zb=J.zb;t.Ab=J.Ab;q.segmentIndex=K.segmentIndex;q.encrypted=K.encrypted;q.drmInfos=
K.drmInfos;q.keyIds=K.keyIds;q.mimeType=K.mimeType;q.bandwidth=q.bandwidth||K.bandwidth;q.codecs=q.codecs||K.codecs;q.closedCaptions=q.closedCaptions||K.closedCaptions;q.width=q.width||K.width;q.height=q.height||K.height;q.hdr=q.hdr||K.hdr;q.colorGamut=q.colorGamut||K.colorGamut;q.frameRate=q.frameRate||K.frameRate;q.language=="und"&&K.language!="und"&&(q.language=K.language);q.language=q.language||K.language;q.channelsCount=q.channelsCount||K.channelsCount;q.audioSamplingRate=q.audioSamplingRate||
K.audioSamplingRate;Py(q);q.drmInfos.length&&a.h.newDrmInfo(q);z=!1;if(!l&&q.closedCaptions||l&&q.closedCaptions&&l.size!=q.closedCaptions.size)z=!0;a.i&&z&&a.h.makeTextStreamsForClosedCaptions(a.i);if(e==G){const aa=K.segmentIndex.qb();aa&&aa.$&&(q.mimeType="application/mp4",Py(q))}var ba=cl(q);q.segmentIndex.fb(aa=>{aa.$&&(aa.$.Qc=ba)});if(dz(a))if(a.ac)my(a,[t]);else{a.ac=!0;const aa=Array.from(a.j.values()).filter(ra=>ra.stream.segmentIndex);my(a,aa);ny(a);const N=a.u;N>0&&a.A.ma(N)}oy(a,B.aa,
q.type,E,u);a.i&&(a.i.startTime=a.o)}}}catch(I){if(q.closeSegmentIndex(),I.code!==7001&&!a.h.disableStream(q))throw I;}};let y=null,w;q.createSegmentIndex=()=>{if(y)return y;if(q.isAudioMuxedInVideo)return q.segmentIndex=new Uk([]),Promise.resolve();w=Xx(a,t.P(),!0);return y=new Promise(z=>{z(x(w))})};q.closeSegmentIndex=()=>{y&&!q.segmentIndex&&w.abort();q.segmentIndex&&(q.segmentIndex.release(),q.segmentIndex=null);y=null};return t}
function Oy(a,b,c,d,e,f,g,h,k,l,m,n){const p=Wy(c,b)||Xy(c),r=[];if(k)for(var q of k.split(","))r.push(q);q=void 0;k=null;c==G?q=r.includes("public.accessibility.transcribes-spoken-dialog")&&r.includes("public.accessibility.describes-music-and-sound")?"caption":"subtitle":r.includes("public.accessibility.describes-video")&&(k="visually impaired");r.length||q!=="subtitle"||r.push("subtitle");q=null;c!="video"&&(q=f);a={id:a.F++,originalId:f,groupId:null,createSegmentIndex:()=>Promise.resolve(),segmentIndex:null,
mimeType:p,codecs:b,kind:c==G?"subtitle":void 0,encrypted:!1,drmInfos:[],keyIds:new Set,language:Ie(d||"und"),originalLanguage:d,label:q,type:c,primary:e,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,frameRate:void 0,pixelAspectRatio:void 0,width:void 0,height:void 0,bandwidth:void 0,roles:r,forced:l,channelsCount:g,audioSamplingRate:m,spatialAudio:n,closedCaptions:h,hdr:void 0,colorGamut:void 0,videoLayout:void 0,tilesLayout:void 0,accessibilityPurpose:k,external:!1,fastSwitching:!1,
fullMimeTypes:new Set,isAudioMuxedInVideo:!1,baseOriginalId:null};Py(a);return a}function dz(a){if(!a.i||!a.i.variants.length)return!1;const b=[],c=[];for(const d of a.i.variants)d.video&&b.push(d.video),d.audio&&c.push(d.audio);return b.length>0&&!b.some(d=>d.segmentIndex)||c.length>0&&!c.some(d=>d.segmentIndex)?!1:!0}function Ly(a,b){var c=Fx(b.aa,"EXT-X-PLAYLIST-TYPE");b=Fx(b.aa,"EXT-X-ENDLIST");b=c&&c.value=="VOD"||b;c=c&&c.value=="EVENT"&&!b;c=!b&&!c;b?xy(a,py):c?xy(a,yy):xy(a,ez)}
async function Ny(a,b,c,d){({segment:d}=Zy(a,d));if(d.status==2)return Xy(b);d=d.P();const e=El(d[0]);if(e){let h=Dy.get(b).get(e);if(h||(h=Ey.get(e)))return h}if(c=Wy(b,c))return c;let f;d=ag(d,a.g.retryParameters);let g;try{d.method="HEAD",g=await Yx(a,d,gg,{type:1}).promise,f=g.headers["content-type"]}catch(h){!h||h.code!=1002&&h.code!=1001||(d.method="GET",a.g.hls.allowRangeRequestsToGuessMimeType&&(d.headers.Range="bytes=0-0"),g=await Yx(a,d,gg,{type:1}).promise,f=g.headers["content-type"])}return f&&
(c=f.toLowerCase().split(";")[0],c=="application/octet-stream"&&(g.data.byteLength||(d.method="GET",g=await Yx(a,d,gg,{type:1}).promise),nj(C(g.data))&&(c="video/mp2t")),c!="application/octet-stream")?c:Xy(b)}
function Ay(a,b,c,d,e){const f=Fx(c,"EXT-X-MAP");if(!f)return null;var g=zx(f,"URI");const h=Hx(d(),g,e);g=[h.toString(),Y(f,"BYTERANGE","")].join("-");if(!a.va.has(g)){let k=void 0,l=null,m=!1;for(const n of c)n.name=="EXT-X-KEY"?(c=zx(n,"METHOD"),By(c)&&n.id<f.id?(m=!1,k=Fy(a,n,b,d,e)):m=c!="NONE"):n.name=="EXT-X-BYTERANGE"&&n.id<f.id&&(l=n);b=fz(h,f,l,k,m);a.va.set(g,b)}return a.va.get(g)}
function Fy(a,b,c,d,e){if(!window.crypto||!window.crypto.subtle)throw ja("Web Crypto API is not available to decrypt AES. (Web Crypto only exists in secure origins like https)"),new F(2,4,4042);let f=0,g;const h=Y(b,"IV","");if(h){if(g=Pb(h.substr(2)),g.byteLength!=16)throw new F(2,4,4048);}else f=Gx(c.aa,"EXT-X-MEDIA-SEQUENCE",0);const k=Hx(d(),zx(b,"URI"),e),l=k.sort().join("");c=`${b.toString()}-${f}-${l}`;if(!a.qa.has(c)){const m={bitsKey:128,blockCipherMode:"CBC",iv:g,firstMediaSequenceNumber:f};
switch(zx(b,"METHOD")){case "AES-256":m.bitsKey=256;break;case "AES-256-CTR":m.bitsKey=256,m.blockCipherMode="CTR"}m.fetchKey=async()=>{if(!a.N.has(l)){var n=Yx(a,ag(k,a.g.retryParameters),6).promise;a.N.set(l,n)}n=await a.N.get(l);if(!n.data||n.data.byteLength!=m.bitsKey/8)throw new F(2,4,4049);m.cryptoKey=await window.crypto.subtle.importKey("raw",n.data,{name:m.blockCipherMode=="CTR"?"AES-CTR":"AES-CBC",length:m.bitsKey},!0,["decrypt"]);m.fetchKey=void 0};a.qa.set(c,m)}return a.qa.get(c)}
function fz(a,b,c,d,e){var f=0,g=null;b=Y(b,"BYTERANGE");!b&&c&&(b=c.value);b&&(f=b.split("@"),g=Number(f[0]),f=Number(f[1]),g=f+g-1,d&&(c=g+1-f,c%16&&(g+=16-c%16)));return new yi(()=>a,f,g,null,null,null,d,e)}function gz(a,b){var c=0;let d=null;b&&(c=b.split("@"),b=Number(c[0]),c=c[1]?Number(c[1]):a.endByte+1,d=c+b-1);return[c,d]}
function Gy(a,b,c,d,e,f,g,h,k,l){const m=d.aa;var n=Fx(m,"EXTINF"),p=0;let r=0,q=null;d.$b.length&&(a.i.isLowLatency=!0);let t=null;if(!a.g.hls.ignoreManifestProgramDateTime){var u=Fx(m,"EXT-X-PROGRAM-DATE-TIME");u&&u.value&&(t=cd(u.value),a.Va=!0)}let x=Bi;Fx(m,"EXT-X-GAP")&&(a.i.gapCount++,x=2);if(!n){if(d.$b.length==0)throw new F(2,4,4024,"EXTINF");if(!a.ha)return null}let y=[];u=!1;let w=null,z=!1,A=!1;if(a.ha&&d.$b.length){p=b&&window.ReadableStream&&a.g.hls.allowLowLatencyByteRangeOptimization;
let ba=t;for(let I=0;I<d.$b.length;I++){var B=d.$b[I],D=I==0?c:y[y.length-1],E=I==0?e:D.endTime;const aa=Number(Y(B,"DURATION"))||a.R;if(!aa)continue;const N=E+aa;var Z=0,J=null;B.name=="EXT-X-PRELOAD-HINT"?(Z=(Z=Y(B,"BYTERANGE-START"))?Number(Z):0,(D=Y(B,"BYTERANGE-LENGTH"))?J=Z+Number(D)-1:Z&&(J=Number.MAX_SAFE_INTEGER)):(J=Y(B,"BYTERANGE"),[Z,J]=gz(D,J));const ra=Y(B,"URI");if(!ra)continue;D=Bi;Y(B,"GAP")=="YES"&&(a.i.gapCount++,D=2,z=!0);let Ka=null;const Oa=()=>{Ka==null&&(Ka=Hx(h(),ra,f));return Ka};
p&&Z>=0&&J!=null&&(w=Oa,u=!0);E=new M(E,N,Oa,Z,J,b,0,0,Infinity,[],"",null,ba,D,l);B.name=="EXT-X-PRELOAD-HINT"&&(E.Ef(),A=!0);Y(B,"INDEPENDENT")!="YES"&&I>0&&E.Pc();B=k;B||(y.length&&y[0].mimeType?B=y[0].mimeType:ra&&(B=El(ra),B=Dy.get(g).get(B)||null));B&&(E.mimeType=B,hz.has(B)&&(E.$=null));y.push(E);ba&&(ba+=aa)}}if(n){n=Kx(n);if(n==0)return null;p=e+n}else if(y.length)p=y[y.length-1].endTime;else return null;u&&(z||y[0].startByte!=0?(u=!1,w=null):y=[]);(n=Fx(m,"EXT-X-BYTERANGE"))?[r,q]=gz(c,
n.value):y.length&&(r=y[0].startByte,q=y[y.length-1].endByte);c="";n=null;g=="image"&&(c="1x1",g=Fx(m,"EXT-X-TILES"))&&(c=zx(g,"LAYOUT"),(g=Y(g,"DURATION"))&&(n=Number(g)));let K=null;b=new M(e,p,()=>{if(w)return w();K==null&&(K=Hx(h(),d.g,f));return K||[]},r,q,b,0,0,Infinity,y,c,n,t,x,l,y.length>0&&!!d.g);k&&(b.mimeType=k,hz.has(k)&&(b.$=null));u&&(a.Zb=!0,b.Hg(),A&&b.Ef());return b}
async function Ux(a,b){if(a.ua.has(b))var c=a.ua.get(b);else c=Fl(b.P(),b.kc(),b.hc(),a.g.retryParameters),c=await Yx(a,c,gg,{type:0}).promise,b.Bd(c.data),c=Al(c.data),a.ua.set(b,c);return c}
var iz=class{constructor(){this.g=this.h=null;this.F=1;this.B=new Map;this.K=new Map;this.C=new Map;this.C.set("video",new Map);this.C.set("audio",new Map);this.C.set(G,new Map);this.C.set("image",new Map);this.Ob=(new Map).set("com.apple.streamingkeydelivery",(a,b,c)=>Tx(this,a,b,c)).set("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",a=>{var b=zx(a,"METHOD");if(["SAMPLE-AES","SAMPLE-AES-CTR"].includes(b)){var c="cenc";b=="SAMPLE-AES"&&(c="cbcs");var d=zx(a,"URI");b=Rx(d.split("?")[0]);d=d.split("?")[0];
if(!this.H.has(d)){const e=C(b.data);this.H.set(d,e)}c=Wb("com.widevine.alpha",c,[{initDataType:"cenc",initData:this.H.get(d)}],void 0,b.eg);(a=Y(a,"KEYID"))&&c.keyIds.add(a.toLowerCase().substr(2));a=Promise.resolve(c)}else a=Promise.resolve(null);return a}).set("com.microsoft.playready",a=>{var b=zx(a,"METHOD");if(["SAMPLE-AES","SAMPLE-AES-CTR"].includes(b)){var c="cenc";b=="SAMPLE-AES"&&(c="cbcs");a=zx(a,"URI");b=Rx(a.split("?")[0]);a=C(b.data);var d=new Uint8Array([154,4,240,121,152,64,66,134,
171,146,230,91,224,136,95,149]);d=Eg(a,d,new Set,0);c=Wb("com.microsoft.playready",c,[{initDataType:"cenc",initData:d}],void 0,b.eg);if(a=Lc(["<PLAYREADY>",Nb(a),"</PLAYREADY>"].join("\n")))c.licenseServerUri=wu(a);c=Promise.resolve(c)}else c=Promise.resolve(null);return c}).set("urn:uuid:3d5e6d35-9b9a-41e8-b843-dd3c6e72c42c",a=>{var b=zx(a,"METHOD");if(["SAMPLE-AES","SAMPLE-AES-CTR"].includes(b)){var c="cenc";b=="SAMPLE-AES"&&(c="cbcs");var d=zx(a,"URI");b=Rx(d.split("?")[0]);d=d.split("?")[0];if(!this.H.has(d)){const e=
C(b.data);this.H.set(d,e)}c=Wb("com.huawei.wiseplay",c,[{initDataType:"cenc",initData:this.H.get(d)}],void 0,b.eg);(a=Y(a,"KEYID"))&&c.keyIds.add(a.toLowerCase().substr(2));a=Promise.resolve(c)}else a=Promise.resolve(null);return a});this.Wa=new Set;this.j=new Map;this.m=null;this.G="";this.Na=new Px;this.M=-1;this.ea=Infinity;this.Y=this.ac=this.Va=!1;this.A=new Ce(()=>{if(this.T&&!this.g.continueLoadingWhenPaused&&(this.S.Ja(this.T,"timeupdate"),this.T.paused)){this.S.za(this.T,"timeupdate",()=>
Vx(this));return}Vx(this)});this.Ba=py;this.i=null;this.Ra=0;this.u=Infinity;this.Ha=this.Aa=this.R=0;this.W=new Xf;this.I=new Map;this.J=new Map;this.va=new Map;this.qa=new Map;this.N=new Map;this.sa=new Map;this.ua=new Map;this.Zb=this.ha=!1;this.Lb=new fa(5);this.l=null;this.O=!0;this.S=new Aa;this.o=this.T=null;this.Mb=()=>!1;this.H=new Map}configure(a,b){const c=this.h&&a.updatePeriod!=this.g.updatePeriod&&a.updatePeriod>=0;this.g=a;b&&(this.Mb=b);this.l&&this.l.configure(this.g);c&&this.i&&
this.i.presentationTimeline.U()&&this.A.kb()}async start(a,b){this.h=b;this.ha=b.isLowLatencyMode();a=await Xx(this,[a]).promise;this.G=a.uri;await Zx(this,a.data);return this.i}stop(){this.A&&(this.A.stop(),this.A=null);const a=[];this.W&&(a.push(this.W.destroy()),this.W=null);this.g=this.h=null;this.Wa.clear();this.i=null;this.j.clear();this.K.clear();this.J.clear();this.B.clear();this.va.clear();this.qa.clear();this.N.clear();this.sa.clear();this.ua.clear();this.H.clear();this.l&&this.l.destroy();
this.S&&(this.S.release(),this.S=null);return Promise.all(a)}async update(){if(Wx(this)){var a=[],b=Array.from(this.j.values()).filter(c=>!c.stream.isAudioMuxedInVideo&&c.stream.segmentIndex);if(b.length!==0){this.u=Infinity;this.i.gapCount=0;for(const c of b)a.push(qy(this,c));await Promise.all(a);wy(this,b.map(c=>c.stream));a=b.some(c=>c.pd==0);b.length&&!a&&(xy(this,py),ny(this));a&&ny(this);for(const c of b)c.stream.isAudioMuxedInVideo||!c.stream.segmentIndex||c.stream.segmentIndex.qb()||this.h.disableStream(c.stream)}}}onExpirationUpdated(){}onInitialVariantChosen(){}banLocation(a){this.l&&
this.l.banLocation(a)}setMediaElement(a){this.T=a}};v("shaka.hls.HlsParser",iz);
var Ey=(new Map).set("aac","audio/aac").set("ac3","audio/ac3").set("ec3","audio/ec3").set("mp3","audio/mpeg"),jz=(new Map).set("mp4","audio/mp4").set("mp4a","audio/mp4").set("m4s","audio/mp4").set("m4i","audio/mp4").set("m4a","audio/mp4").set("m4f","audio/mp4").set("cmfa","audio/mp4").set("ts","video/mp2t").set("tsa","video/mp2t"),kz=(new Map).set("mp4","video/mp4").set("mp4v","video/mp4").set("m4s","video/mp4").set("m4i","video/mp4").set("m4v","video/mp4").set("m4f","video/mp4").set("cmfv","video/mp4").set("ts",
"video/mp2t").set("tsv","video/mp2t"),lz=(new Map).set("mp4","application/mp4").set("m4s","application/mp4").set("m4i","application/mp4").set("m4f","application/mp4").set("cmft","application/mp4").set("vtt","text/vtt").set("webvtt","text/vtt").set("ttml","application/ttml+xml"),mz=(new Map).set("jpg","image/jpeg").set("png","image/png").set("svg","image/svg+xml").set("webp","image/webp").set("avif","image/avif"),Dy=(new Map).set("audio",jz).set("video",kz).set("text",lz).set("image",mz),hz=new Set(["video/mp2t",
...ce]),py="VOD",ez="EVENT",yy="LIVE";hc("application/x-mpegurl",()=>new iz);hc("application/vnd.apple.mpegurl",()=>new iz);hc("audio/x-mpegurl",()=>new iz);function nz(a){return wu(a)}var oz=(new Map).set("com.microsoft.playready",nz).set("com.microsoft.playready.recommendation",nz).set("com.microsoft.playready.software",nz).set("com.microsoft.playready.hardware",nz);async function pz(a){try{await qz(a)}catch(b){a.h&&(b.severity=1,a.h.onError(b))}}
async function qz(a){const b=Date.now();var c=a.h.networkingEngine.request(0,ag(a.l,a.g.retryParameters),{type:5,isPreload:a.A()});Wf(a.B,c);var d=await c.promise;if(a.h){d.uri&&!a.l.includes(d.uri)&&a.l.unshift(d.uri);c=d.uri;var e=d.data;d=a.g.mss.manifestPreprocessor;if(d!=Wm){Ra("manifest.mss.manifestPreprocessor configuration","Please Use manifest.mss.manifestPreprocessorTXml instead.");e=rw(e,"SmoothStreamingMedia");if(!e)throw new F(2,4,4046,c);d(e);e=Ib(e.outerHTML)}d=Kc(e,"SmoothStreamingMedia");
if(!d)throw new F(2,4,4046,c);c=a.g.mss.manifestPreprocessorTXml;c!=Xm&&c(d);a.i||(a.i=new Q(null,0));if(c=H(d,"IsLive",ld,!1))throw new F(2,4,4047);a.i.Ac(!c);e=H(d,"TimeScale",hd,1E7);var f=H(d,"DVRWindowLength",hd);c&&(f===0||isNaN(f))&&(f=Infinity);var g=H(d,"CanSeek",ld,!1);f===0&&g&&(f=Infinity);g=null;f&&f>0&&(g=f/e);c&&!isNaN(a.g.availabilityWindowOverride)&&(g=a.g.availabilityWindowOverride);g==null&&(g=Infinity);a.i.Ge(g);f=H(d,"Duration",hd,Infinity);c||a.i.jb(f/e);c={variants:[],textStreams:[],
timescale:e,duration:f/e};f=Uc(d,"Protection");e=a.g.mss.keySystemsBySystemId;g=[];for(var h of f)g=g.concat(Uc(h,"ProtectionHeader"));if(g.length){h=g;f=[];for(g=0;g<h.length;g++){var k=h[g],l=k.attributes.SystemID.toLowerCase(),m=e[l];if(m){var n;a:{if(n=uu(k))for(r of Xc(n,"DATA"))if(n=Yc(r,"KID")){n=Ob(Vc(n));n=new Uint8Array([n[3],n[2],n[1],n[0],n[5],n[4],n[7],n[6],...n.slice(8)]);n=Qb(n);break a}n=null}var p=Ob(Vc(k));l=Pb(l.replace(/-/g,""));l=[{initData:Eg(p,l,new Set,0),initDataType:"cenc",
keyId:n}];l=Wb(m,"cenc",l);n&&l.keyIds.add(n);if(m=oz.get(m))l.licenseServerUri=m(k);f.push(l)}}var r=f}else r=[];f=r;h=[];r=[];e=[];d=Uc(d,"StreamIndex");for(var q of d){d=Uc(q,"QualityLevel");g=c.timescale;k=c.duration;m=Uc(q,"c");l=[];var t=0;for(n=0;n<m.length;++n){var u=m[n],x=m[n+1],y=H(u,"t",hd);p=H(u,"d",hd);u=H(u,"r",fd);if(!p)break;y=y!=null?y:t;(u=u||0)&&u--;if(u<0)if(x){x=H(x,"t",hd);if(x==null)break;else if(y>=x)break;u=Math.ceil((x-y)/p)-1}else{if(k==Infinity)break;else if(y/g>=k)break;
u=Math.ceil((k*g-y)/p)-1}for(x=0;x<=u;++x)t=y+p,l.push({start:y/g,end:t/g,cd:y}),y=t}g=l;for(var w of d)(d=rz(a,q,w,g,f,c))&&(d.type!="audio"||a.g.disableAudio?d.type!="video"||a.g.disableVideo?d.type!=G||a.g.disableText||e.push(d):r.push(d):h.push(d))}q=[];for(const z of h.length>0?h:[null])for(const A of r.length>0?r:[null])w=q,d=w.push,h=0,z&&z.bandwidth&&z.bandwidth>0&&(h+=z.bandwidth),A&&A.bandwidth&&A.bandwidth>0&&(h+=A.bandwidth),h={id:a.u++,language:z?z.language:"und",disabledUntilTime:0,
primary:!!z&&z.primary||!!A&&A.primary,audio:z,video:A,bandwidth:h,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]},d.call(w,h);c.variants=q;c.textStreams=e;a.j?(a.j.variants=c.variants,a.j.textStreams=c.textStreams,a.h.filter(a.j)):(a.j={presentationTimeline:a.i,variants:c.variants,textStreams:c.textStreams,imageStreams:[],offlineSessionIds:[],sequenceMode:a.g.mss.sequenceMode,ignoreManifestTimestampsInSegmentsMode:!1,type:"MSS",serviceDescription:null,nextUrl:null,periodCount:1,gapCount:0,
isLowLatency:!1,startTime:null},a.i.pe());Promise.resolve();a.C.sample(1,(Date.now()-b)/1E3)}}
function rz(a,b,c,d,e,f){const g=b.attributes.Type;if(g!=="audio"&&g!=="video"&&g!=="text")return ja("Ignoring unrecognized type:",g),null;const h=b.attributes.Language,k=a.u++,l=H(c,"Bitrate",gd),m=H(c,"MaxWidth",gd),n=H(c,"MaxHeight",gd),p=H(c,"Channels",gd),r=H(c,"SamplingRate",gd);let q=f.duration;d.length&&(q=d[d.length-1].end-d[0].start);var t=a.i.getDuration();a.i.jb(Math.min(q,t));(t=b.attributes.Name)&&(t+=c.attributes.Index);t||=String(k);const u={id:k,originalId:t,groupId:null,createSegmentIndex:()=>
Promise.resolve(),closeSegmentIndex:()=>Promise.resolve(),segmentIndex:null,mimeType:"",codecs:"",frameRate:void 0,pixelAspectRatio:void 0,bandwidth:l||0,width:m||void 0,height:n||void 0,kind:"",encrypted:e.length>0,drmInfos:e,keyIds:new Set,language:Ie(h||"und"),originalLanguage:h,label:"",type:"",primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:[],roles:[],forced:!1,channelsCount:p,audioSamplingRate:r,spatialAudio:!1,closedCaptions:null,hdr:void 0,colorGamut:void 0,videoLayout:void 0,
tilesLayout:void 0,matchedStreams:[],mssPrivateData:{duration:q,timescale:f.timescale,codecPrivateData:null},accessibilityPurpose:null,external:!1,fastSwitching:!1,fullMimeTypes:new Set,isAudioMuxedInVideo:!1,baseOriginalId:null};if(e=b.attributes.Subtype)(e=sz.get(e))&&u.roles.push(e),e==="main"&&(u.primary=!0);e=c.attributes.FourCC;if(e===null||e==="")e=b.attributes.FourCC;if(!e)if(g==="audio")e="AAC";else if(g==="video")return ja('FourCC is not defined whereas it is required for a QualityLevel element for a StreamIndex of type "video"'),
null;if(!tz.includes(e.toUpperCase()))return ja("Codec not supported:",e),null;c=uz(c,g,e,u);u.mssPrivateData.codecPrivateData=c;switch(g){case "audio":if(!c)return ja("Quality unsupported without CodecPrivateData",g),null;u.type="audio";u.mimeType="mss/audio/mp4";u.codecs=vz(e,c);break;case "video":if(!c)return ja("Quality unsupported without CodecPrivateData",g),null;u.type="video";u.mimeType="mss/video/mp4";u.codecs=wz(c);break;case "text":if(u.type=G,u.mimeType="application/mp4",e==="TTML"||e===
"DFXP")u.codecs="stpp"}u.fullMimeTypes.add(be(u.mimeType,u.codecs));u.createSegmentIndex=()=>{if(u.segmentIndex)return Promise.resolve();if(a.m.has(u.id))var x=a.m.get(u.id);else x=[],u.type=="video"&&(x=u.mssPrivateData.codecPrivateData.split("00000001").slice(1)),x={id:u.id,type:u.type,codecs:u.codecs,encrypted:u.encrypted,timescale:u.mssPrivateData.timescale,duration:u.mssPrivateData.duration,mb:x,ya:new Uint8Array([]),Ma:new Uint8Array([]),Sa:0,Ta:0,data:null,stream:u},x=Sh(new oi([x])),a.m.set(u.id,
x);x=xz(a,new yi(()=>[],0,null,cl(u),u.mssPrivateData.timescale,x,null,u.encrypted),u,b,d);u.segmentIndex=new Uk(x);return Promise.resolve()};u.closeSegmentIndex=()=>{u.segmentIndex&&(u.segmentIndex.release(),u.segmentIndex=null)};return u}
function uz(a,b,c,d){if(a=a.attributes.CodecPrivateData)return a;if(b!=="audio")return null;b=d.channelsCount||2;a=d.audioSamplingRate||44100;const e={96E3:0,88200:1,64E3:2,48E3:3,44100:4,32E3:5,24E3:6,22050:7,16E3:8,12E3:9,11025:10,8E3:11,7350:12};d=e[a];if(c==="AACH")return c=new Uint8Array(4),a=e[a*2],c[0]=40|d>>1,c[1]=d<<7|b<<3|a>>1,c[2]=a<<7|8,c[3]=0,b=new Uint16Array(2),b[0]=(c[0]<<8)+c[1],b[1]=(c[2]<<8)+c[3],b[0].toString(16)+b[1].toString(16);c=new Uint8Array(2);c[0]=16|d>>1;c[1]=d<<7|b<<
3;b=new Uint16Array(1);b[0]=(c[0]<<8)+c[1];return b[0].toString(16)}function vz(a,b){let c=0;a==="AACH"&&(c=5);b?c===0&&(c=(parseInt(b.substr(0,2),16)&248)>>3):(c=2,a==="AACH"&&(c=5));return"mp4a.40."+c}function wz(a){const b=/00000001[0-9]7/.exec(a);return b.length&&a?"avc1."+a.substr(a.indexOf(b[0])+10,6):""}
function xz(a,b,c,d,e){const f=d.attributes.Url.replace("{bitrate}",String(c.bandwidth));d=[];for(const g of e)d.push(new M(g.start,g.end,()=>Vb(a.l,[f.replace("{start time}",String(g.cd))]),0,null,b,0,0,c.mssPrivateData.duration));return d}
var yz=class{constructor(){this.h=this.g=null;this.l=[];this.j=null;this.u=1;this.i=null;this.C=new fa(5);this.o=new Ce(()=>{pz(this)});this.B=new Xf;this.m=new Map;this.A=()=>!1}configure(a,b){this.g=a;b&&(this.A=b)}async start(a,b){this.l=[a];this.h=b;await qz(this);if(!this.h)throw new F(2,7,7001);return this.j}stop(){this.g=this.h=null;this.l=[];this.j=null;this.o!=null&&(this.o.stop(),this.o=null);this.m.clear();return this.B.destroy()}async update(){try{await qz(this)}catch(a){if(this.h&&a)this.h.onError(a)}}onExpirationUpdated(){}onInitialVariantChosen(){}banLocation(){}setMediaElement(){}};
v("shaka.mss.MssParser",yz);var tz="AAC AACL AACH AACP AVC1 H264 TTML DFXP".split(" "),sz=(new Map).set("CAPT","main").set("SUBT","alternate").set("DESC","main");hc("application/vnd.ms-sstr+xml",()=>new yz);function zz(a,b,c,d,e,f,g){if(c>=200&&c<=299&&c!=202||c==304)return{uri:e||d,originalUri:d,data:b,status:c,headers:a,fromCache:!!a["x-shaka-from-cache"],originalRequest:f};f=null;try{f=Hb(b)}catch(h){}throw new F(c==401||c==403?2:1,1,1001,d,c,f,a,g,e||d);};function Az(a,b,c,d,e,f){const g=new Bz;try{og(b.headers).forEach((l,m)=>{g.append(m,l)})}catch(l){return Mf(new F(1,1,1002,a,l,c))}const h=new Cz,k={og:!1,$g:!1};a=Dz(a,b,c,{body:b.body||void 0,headers:g,method:b.method,signal:h.signal,credentials:b.allowCrossSiteCredentials?"include":void 0},k,d,e,b.streamDataCallback,f.minBytesForProgressEvents||0);a=new Nf(a,()=>{k.og=!0;h.abort();return Promise.resolve()});if(b=b.retryParameters.timeout){const l=new Ce(()=>{k.$g=!0;h.abort()});l.ma(b/1E3);a.finally(()=>
{l.stop()})}return a}
async function Dz(a,b,c,d,e,f,g,h,k){let l,m=new ArrayBuffer(0),n=0,p=0,r={},q=Date.now();try{l=await Ez(a,d);r=Fz(l.headers);g(r);if(d.method!="HEAD"){const t=l.headers.get("Content-Length"),u=t?parseInt(t,10):0;if(l.body){const x=l.clone().body.getReader();new Gz({start:y=>{const w=async()=>{let z;try{z=await x.read()}catch(D){return}z.done||(n+=z.value.byteLength,h&&await h(z.value));const A=Date.now(),B=n-p;if(A-q>100&&B>=k||z.done)f(A-q,B,z.done?0:u-n),p=n,q=A;z.done?y.close():(y.enqueue(z.value),
w())};w()}});m=await l.arrayBuffer()}else m=await l.arrayBuffer(),f(Date.now()-q,m.byteLength,0)}if(b.headers.Range){const t=b.headers.Range.replace("bytes=","").split("-").filter(u=>u).map(u=>parseInt(u,10));t.length==2&&m.byteLength!=t[1]-t[0]+1&&ja("Payload length does not match range requested bytes",b,l)}}catch(t){if(e.og)throw new F(1,1,7001,a,c);if(e.$g)throw new F(1,1,1003,a,c);throw new F(1,1,1002,a,t,c);}return zz(r,m,l.status,a,l.url,b,c)}
function Fz(a){const b={};a.forEach((c,d)=>{b[d.trim()]=c});return b}function Hz(){if(window.ReadableStream)try{new ReadableStream({})}catch(a){return!1}else return!1;if(window.Response){if(!(new Response("")).body)return!1}else return!1;return!(!window.fetch||"polyfill"in window.fetch||!window.AbortController)}var Iz=class{};v("shaka.net.HttpFetchPlugin",Iz);Iz.isSupported=Hz;Iz.parse=Az;var Ez=window.fetch,Cz=window.AbortController,Gz=window.ReadableStream,Bz=window.Headers;
Hz()&&(Yf("http",Az,2,!0),Yf("https",Az,2,!0),Yf("blob",Az,2,!0));function Jz(a,b,c,d,e,f){const g=new Kz;let h=Date.now(),k=0;const l=new Promise((m,n)=>{g.open(b.method,a,!0);g.responseType="arraybuffer";g.timeout=b.retryParameters.timeout;g.withCredentials=b.allowCrossSiteCredentials;let p={};g.onabort=()=>{n(new F(1,1,7001,a,c))};g.onreadystatechange=()=>{if(g.readyState===XMLHttpRequest.HEADERS_RECEIVED){var r=g.getAllResponseHeaders().trim().split("\r\n");const q={};for(const t of r)r=t.indexOf(": "),r!==-1&&(q[t.slice(0,r).toLowerCase()]=t.slice(r+2));p=
q;e(p)}};g.onload=()=>{const r=g.response;try{const q=zz(p,r,g.status,a,g.responseURL,b,c);m(q)}catch(q){n(q)}};g.onerror=r=>{n(new F(1,1,1002,a,r,c))};g.ontimeout=()=>{n(new F(1,1,1003,a,c))};g.onprogress=r=>{const q=Date.now(),t=f.minBytesForProgressEvents||0,u=r.loaded-k;if(q-h>100&&u>=t||r.lengthComputable&&r.loaded==r.total)d(q-h,u,g.readyState==4?0:r.total-r.loaded),k=r.loaded,h=q};for(const r in b.headers)try{g.setRequestHeader(r.toLowerCase(),b.headers[r])}catch(q){throw new F(1,1,1002,a,
q,c);}g.send(b.body)});return new Nf(l,()=>{g.abort();return Promise.resolve()})}var Lz=class{};v("shaka.net.HttpXHRPlugin",Lz);Lz.parse=Jz;var Kz=window.XMLHttpRequest;Yf("http",Jz,1,!0);Yf("https",Jz,1,!0);Yf("blob",Jz,1,!0);function Mz(a){const b=a.Jb(!1);return b?Nb(b):a.P().map(c=>"{"+encodeURI(c.split("#xywh=")[0])+"}").join("")+":"+a.startByte+":"+a.endByte}function Nz(a,b){return Fl(a.g.P(),a.g.startByte,a.g.endByte,b.streaming.retryParameters)}var Oz=class{constructor(a,b,c,d,e){this.g=a;this.h=b;this.groupId=c;this.i=d;this.j=e}};function Pz(a,b){a.i+=b;const c=a.l;a.l++;a.h.set(c,b);return c}function Qz(a){return a.i==0?0:a.j/a.i}var Rz=class{constructor(){this.g=this.j=this.i=0;this.h=new Map;this.l=0}close(a,b){if(this.h.has(a)){var c=this.h.get(a);this.h.delete(a);this.j+=c;this.g+=b}}};function Sz(a){a.l=!0;const b=a.j.map(c=>c());a.j=[];return Promise.all(b)}function Tz(a,b,c){a.o=b;a.m=c}async function Uz(a,b){const c=a.u.request(gg,b);b=()=>c.abort();a.j.push(b);const d=await c.promise;sa(a.j,b);return d.data}
function Vz(a,b,c,d,e,f){kg(a.h);const g=(a.i.get(b)||Promise.resolve()).then(()=>{if(a.h.g)throw new F(2,9,7001);if(e){var h=C(c);h=new Fg(h);for(const k in h.data){const l=Number(k);a.m(h.data[l],h.g[l])}}a.g.close(d,c.byteLength);a.o(Qz(a.g),a.g.g);return f(c)});a.i.set(b,g)}async function Wz(a){await Promise.all(a.i.values());return a.g.g}
var Xz=class{constructor(a){this.u=a;this.i=new Map;this.h=new lg(()=>Sz(this).catch(()=>{}));this.j=[];this.o=()=>{};this.m=()=>{};this.g=new Rz;this.l=!1}destroy(){return this.h.destroy()}queue(a,b,c,d,e){kg(this.h);const f=(this.i.get(a)||Promise.resolve()).then(async()=>{const g=await Uz(this,b);if(this.h.g)throw new F(2,9,7001);if(d){var h=C(g);h=new Fg(h);for(const k in h.data){const l=Number(k);this.m(h.data[l],h.g[l])}}this.g.close(c,g.byteLength);this.o(Qz(this.g),this.g.g);return e(g)});
this.i.set(a,f);return f}};function Yz(a,b){return new Promise((c,d)=>{const e=a.h.openCursor();e.onerror=d;e.onsuccess=async()=>{if(e.result==null)c();else{var f=e.result;await b(f.key,f.value,f);f.continue()}}})}var Zz=class{constructor(a,b){this.i=a;this.h=a.objectStore(b);this.g=new Lf;a.onabort=c=>{c.preventDefault();this.g.reject()};a.onerror=c=>{c.preventDefault();this.g.reject()};a.oncomplete=()=>{this.g.resolve()}}async abort(){try{this.i.abort()}catch(a){}try{await this.g}catch(a){}}store(){return this.h}promise(){return this.g}};function $z(a,b,c){c=a.h.transaction([b],c);const d=new Zz(c,b);a.g.push(d);d.promise().then(()=>{sa(a.g,d)},()=>{sa(a.g,d)});return d}function aA(a,b){return $z(a,b,"readwrite")}var bA=class{constructor(a){this.h=a;this.g=[]}destroy(){return Promise.all(this.g.map(a=>a.abort()))}};function cA(a){return Promise.reject(new F(2,9,9011,"Cannot add new value to "+a))}function dA(a,b,c,d){a=aA(a.h,b);b=a.store();for(const e of c)b.delete(e).onsuccess=()=>d(e);return a.promise()}async function eA(a,b,c){a=$z(a.h,b,"readonly");b=a.store();const d={},e=[];for(const f of c){const g=b.get(f);g.onsuccess=()=>{g.result==void 0&&e.push(f);d[f]=g.result}}await a.promise();if(e.length)throw new F(2,9,9012,"Could not find values for "+e);return c.map(f=>d[f])}
function fA(a,b,c){a=aA(a.h,a.g);const d=a.store();d.get(b).onsuccess=()=>{d.put(c,b)};return a.promise()}
var gA=class{constructor(a,b,c){this.h=new bA(a);this.j=b;this.g=c}destroy(){return this.h.destroy()}hasFixedKeySpace(){return!0}addSegments(){return cA(this.j)}removeSegments(a,b){return dA(this,this.j,a,b)}async getSegments(a){return(await eA(this,this.j,a)).map(b=>this.l(b))}addManifests(){return cA(this.g)}updateManifest(){return Promise.reject(new F(2,9,9016,"Cannot modify values in "+this.g))}updateManifestExpiration(a,b){const c=aA(this.h,this.g),d=c.store();d.get(a).onsuccess=e=>{if(e=e.target.result)e.expiration=
b,d.put(e,a)};return c.promise()}removeManifests(a,b){return dA(this,this.g,a,b)}async getManifests(a){a=await eA(this,this.g,a);return Promise.all(a.map(b=>this.i(b)))}async getAllManifests(){const a=$z(this.h,this.g,"readonly"),b=new Map;await Yz(a,async(c,d)=>{d=await this.i(d);b.set(c,d)});await a.promise();return b}l(a){return a}i(a){return Promise.resolve(a)}async add(a,b){a=aA(this.h,a);const c=a.store(),d=[];for(const e of b){const f=c.add(e);f.onsuccess=()=>{d.push(f.result)}}await a.promise();
return d}};var hA=class{constructor(a){this.g=new bA(a)}destroy(){return this.g.destroy()}async getAll(){const a=$z(this.g,"session-ids","readonly"),b=[];await Yz(a,(c,d)=>{b.push(d)});await a.promise();return b}add(a){const b=aA(this.g,"session-ids"),c=b.store();for(const d of a)c.add(d);return b.promise()}async remove(a){const b=aA(this.g,"session-ids");await Yz(b,(c,d,e)=>{a.includes(d.sessionId)&&e.delete()});await b.promise()}};function iA(a,b){jA.set(a,b)}function kA(a){let b=null;a.g.forEach((c,d)=>{c.getCells().forEach((e,f)=>{e.hasFixedKeySpace()||b||(b={path:{yb:d,Xa:f},Xa:e})})});if(b)return b;throw new F(2,9,9013,"Could not find a cell that supports add-operations");}function lA(a,b){a.g.forEach((c,d)=>{c.getCells().forEach((e,f)=>{b({yb:d,Xa:f},e)})})}
function mA(a,b,c){a=a.g.get(b);if(!a)throw new F(2,9,9013,"Could not find mechanism with name "+b);b=a.getCells().get(c);if(!b)throw new F(2,9,9013,"Could not find cell with name "+c);return b}function nA(a,b){a.g.forEach(c=>{b(c.getEmeSessionCell())})}function oA(a){const b=Array.from(a.g.keys());if(!b.length)throw new F(2,9,9E3,"No supported storage mechanisms found");return a.g.get(b[0]).getEmeSessionCell()}
async function pA(a){const b=Array.from(a.g.values());(a=b.length>0)||jA.forEach(c=>{(c=c())&&b.push(c)});await Promise.all(b.map(c=>c.erase()));a||await Promise.all(b.map(c=>c.destroy()))}var qA=class{constructor(){this.g=new Map}destroy(){const a=[];for(const b of this.g.values())a.push(b.destroy());this.g.clear();return Promise.all(a)}init(){jA.forEach((b,c)=>{(b=b())&&this.g.set(c,b)});const a=[];for(const b of this.g.values())a.push(b.init());return Promise.all(a)}};
v("shaka.offline.StorageMuxer",qA);qA.unregister=function(a){jA.delete(a)};qA.register=iA;qA.prototype.destroy=qA.prototype.destroy;var jA=new Map;function rA(a,b){sA(a);for(const c of a.streams);return a.streams.map(c=>tA(c,a.startTime,b))}
function tA(a,b,c){const d=a.initSegmentUri?uA(a.initSegmentUri):null,e=b+a.presentationTimeOffset,f=b+c;return{id:a.id,originalId:null,groupId:null,primary:a.primary,type:a.contentType,mimeType:a.mimeType,codecs:a.codecs,frameRate:a.frameRate,pixelAspectRatio:void 0,hdr:void 0,colorGamut:void 0,videoLayout:void 0,kind:a.kind,language:a.language,originalLanguage:a.language||null,label:a.label,width:a.width,height:a.height,initSegmentKey:d,encrypted:a.encrypted,keyIds:new Set([a.keyId]),segments:a.segments.map(g=>
{const h=uA(g.uri);return{startTime:b+g.startTime,endTime:b+g.endTime,dataKey:h,initSegmentKey:d,appendWindowStart:b,appendWindowEnd:f,timestampOffset:e,tilesLayout:"",mimeType:null,codecs:null,thumbnailSprite:null}}),variantIds:a.variantIds,roles:[],forced:!1,audioSamplingRate:null,channelsCount:null,spatialAudio:!1,closedCaptions:null,tilesLayout:void 0,external:!1,fastSwitching:!1,isAudioMuxedInVideo:!1}}
function uA(a){let b;if((b=/^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(a))||(b=/^offline:segment\/([0-9]+)$/.exec(a)))return Number(b[1]);throw new F(2,9,9004,"Could not parse uri "+a);}
function sA(a){var b=a.streams.filter(f=>f.contentType=="audio");a=a.streams.filter(f=>f.contentType=="video");if(!b.every(f=>f.variantIds)||!a.every(f=>f.variantIds)){for(var c of b)c.variantIds=[];for(var d of a)d.variantIds=[];c=0;if(a.length&&!b.length){d=c++;for(var e of a)e.variantIds.push(d)}if(!a.length&&b.length){e=c++;for(const f of b)f.variantIds.push(e)}if(a.length&&b.length)for(const f of b)for(const g of a)b=c++,f.variantIds.push(b),g.variantIds.push(b)}}
var vA=class extends gA{async updateManifestExpiration(a,b){const c=aA(this.h,this.g),d=c.store(),e=new Lf;d.get(a).onsuccess=f=>{(f=f.target.result)?(f.expiration=b,d.put(f),e.resolve()):e.reject(new F(2,9,9012,"Could not find values for "+a))};await Promise.all([c.promise(),e])}async i(a){var b=[];for(let c=0;c<a.periods.length;++c){const d=rA(a.periods[c],(c==a.periods.length-1?a.duration:a.periods[c+1].startTime)-a.periods[c].startTime);b.push(d)}b=await Hv(b);return{creationTime:0,originalManifestUri:a.originalManifestUri,
duration:a.duration,size:a.size,expiration:a.expiration==null?Infinity:a.expiration,streams:b,sessionIds:a.sessionIds,drmInfo:a.drmInfo,appMetadata:a.appMetadata,sequenceMode:!1}}l(a){return{data:a.data}}};function wA(a,b,c){return{id:a.id,originalId:a.originalId,groupId:null,primary:a.primary,type:a.contentType,mimeType:a.mimeType,codecs:a.codecs,frameRate:a.frameRate,pixelAspectRatio:a.pixelAspectRatio,hdr:void 0,colorGamut:void 0,videoLayout:void 0,kind:a.kind,language:a.language,originalLanguage:a.language||null,label:a.label,width:a.width,height:a.height,encrypted:a.encrypted,keyIds:new Set([a.keyId]),segments:a.segments.map(d=>({startTime:b+d.startTime,endTime:b+d.endTime,initSegmentKey:a.initSegmentKey,
appendWindowStart:b,appendWindowEnd:c,timestampOffset:b-a.presentationTimeOffset,dataKey:d.dataKey,tilesLayout:"",mimeType:null,codecs:null,thumbnailSprite:null})),variantIds:a.variantIds,roles:[],forced:!1,audioSamplingRate:null,channelsCount:null,spatialAudio:!1,closedCaptions:null,tilesLayout:void 0,external:!1,fastSwitching:!1,isAudioMuxedInVideo:!1}}
var xA=class extends gA{async i(a){var b=[];for(let e=0;e<a.periods.length;++e){var c=a.periods[e],d=(e==a.periods.length-1?a.duration:a.periods[e+1].startTime)-a.periods[e].startTime;const f=[];for(const g of c.streams)g.variantIds.length!=0&&f.push(wA(g,c.startTime,c.startTime+d));b.push(f)}b=await Hv(b);return{appMetadata:a.appMetadata,creationTime:0,drmInfo:a.drmInfo,duration:a.duration,expiration:a.expiration==null?Infinity:a.expiration,originalManifestUri:a.originalManifestUri,sessionIds:a.sessionIds,
size:a.size,streams:b,sequenceMode:!1}}};var yA=class extends gA{hasFixedKeySpace(){return!1}addSegments(a){return this.add(this.j,a)}addManifests(a){return this.add(this.g,a)}updateManifest(a,b){return fA(this,a,b)}i(a){a.expiration==null&&(a.expiration=Infinity);return Promise.resolve(a)}};function zA(){const a=new Lf,b=window.indexedDB.deleteDatabase("shaka_offline_db");b.onblocked=()=>{};b.onsuccess=()=>{a.resolve()};b.onerror=c=>{a.reject(new F(2,9,9001,b.error));c.preventDefault()};return a}
var BA=class{constructor(){this.m=this.j=this.i=this.h=this.g=this.l=null}init(){const a=new Lf;let b=!1;const c=new Ce(()=>{b=!0;a.reject(new F(2,9,9017))});typeof AA==="number"&&AA>0&&c.ma(AA);const d=window.indexedDB.open("shaka_offline_db",5);d.onsuccess=()=>{if(!b){c.stop();var e=d.result;this.l=e;var f=e.objectStoreNames;f=f.contains("manifest")&&f.contains("segment")?new vA(e,"segment","manifest"):null;this.g=f;f=e.objectStoreNames;f=f.contains("manifest-v2")&&f.contains("segment-v2")?new xA(e,
"segment-v2","manifest-v2"):null;this.h=f;f=e.objectStoreNames;f=f.contains("manifest-v3")&&f.contains("segment-v3")?new xA(e,"segment-v3","manifest-v3"):null;this.i=f;f=e.objectStoreNames;f=f.contains("manifest-v5")&&f.contains("segment-v5")?new yA(e,"segment-v5","manifest-v5"):null;this.j=f;e=e.objectStoreNames.contains("session-ids")?new hA(e):null;this.m=e;a.resolve()}};d.onupgradeneeded=()=>{var e=d.result;const f=["segment-v5","manifest-v5","session-ids"];for(const g of f)e.objectStoreNames.contains(g)||
e.createObjectStore(g,{autoIncrement:!0})};d.onerror=e=>{b||(c.stop(),a.reject(new F(2,9,9001,d.error)),e.preventDefault())};return a}async destroy(){this.g&&await this.g.destroy();this.h&&await this.h.destroy();this.i&&await this.i.destroy();this.j&&await this.j.destroy();this.m&&await this.m.destroy();this.l&&this.l.close()}getCells(){const a=new Map;this.g&&a.set("v1",this.g);this.h&&a.set("v2",this.h);this.i&&a.set("v3",this.i);this.j&&a.set("v5",this.j);return a}getEmeSessionCell(){return this.m}async erase(){this.g&&
await this.g.destroy();this.h&&await this.h.destroy();this.i&&await this.i.destroy();this.j&&await this.j.destroy();this.l&&this.l.close();await zA();this.j=this.i=this.h=this.g=this.l=null;await this.init()}},AA=5;v("shaka.offline.indexeddb.StorageMechanismOpenTimeout",AA);iA("idb",()=>Fa().W()?new BA:null);function CA(a){a=/^offline:([a-z]+)\/([^/]+)\/([^/]+)\/([0-9]+)$/.exec(a);if(a==null)return null;const b=a[1];if(b!="manifest"&&b!="segment")return null;const c=a[2];if(!c)return null;const d=a[3];return d&&b!=null?new DA(b,c,d,Number(a[4])):null}var DA=class{constructor(a,b,c,d){this.g=a;this.i=b;this.h=c;this.l=d;this.j=["offline:",a,"/",b,"/",c,"/",d].join("")}yb(){return this.i}Xa(){return this.h}key(){return this.l}toString(){return this.j}};function EA(a,b,c,d){var e=new Set;for(var f of b)for(const h of f.variantIds)e.add(h);for(const h of c)for(const k of h.variantIds)e.add(k);f=new Map;for(const h of e)f.set(h,{id:h,language:"",disabledUntilTime:0,primary:!1,audio:null,video:null,bandwidth:0,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]});for(var g of b){b=FA(a,g,d);for(const h of g.variantIds)e=f.get(h),e.language=b.language,e.primary=e.primary||b.primary,e.audio=b}for(const h of c){c=FA(a,h,d);for(const k of h.variantIds)g=
f.get(k),g.primary=g.primary||c.primary,g.video=c}return f}
function FA(a,b,c){const d=b.segments.map(e=>GA(a,e,b));c.wd(d);return{id:b.id,originalId:b.originalId,groupId:b.groupId,createSegmentIndex:()=>Promise.resolve(),segmentIndex:new Uk(d),mimeType:b.mimeType,codecs:b.codecs,width:b.width||void 0,height:b.height||void 0,frameRate:b.frameRate,pixelAspectRatio:b.pixelAspectRatio,hdr:b.hdr,colorGamut:b.colorGamut,videoLayout:b.videoLayout,kind:b.kind,encrypted:b.encrypted,drmInfos:[],keyIds:b.keyIds,language:b.language,originalLanguage:b.originalLanguage||
null,label:b.label,type:b.type,primary:b.primary,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:b.roles,forced:b.forced,channelsCount:b.channelsCount,audioSamplingRate:b.audioSamplingRate,spatialAudio:b.spatialAudio,closedCaptions:b.closedCaptions,tilesLayout:b.tilesLayout,mssPrivateData:b.mssPrivateData,accessibilityPurpose:null,external:b.external,fastSwitching:b.fastSwitching,fullMimeTypes:new Set([be(b.mimeType,b.codecs)]),isAudioMuxedInVideo:b.isAudioMuxedInVideo||!1,baseOriginalId:null}}
function HA(a,b){const c=new Q(null,0);c.jb(b.duration);var d=b.streams.filter(h=>h.type=="audio"),e=b.streams.filter(h=>h.type=="video");d=EA(a,d,e,c);e=b.streams.filter(h=>h.type==G).map(h=>FA(a,h,c));const f=b.streams.filter(h=>h.type=="image").map(h=>FA(a,h,c)),g=b.drmInfo?[b.drmInfo]:[];if(b.drmInfo)for(const h of d.values())h.audio&&h.audio.encrypted&&(h.audio.drmInfos=g),h.video&&h.video.encrypted&&(h.video.drmInfos=g);return{presentationTimeline:c,offlineSessionIds:b.sessionIds,variants:Array.from(d.values()),
textStreams:e,imageStreams:f,sequenceMode:b.sequenceMode||!1,ignoreManifestTimestampsInSegmentsMode:!1,type:b.type||"UNKNOWN",serviceDescription:null,nextUrl:null,periodCount:1,gapCount:0,isLowLatency:!1,startTime:null}}
function GA(a,b,c){const d=new DA("segment",a.h,a.g,b.dataKey);a=new M(b.startTime,b.endTime,()=>[d.toString()],0,null,b.initSegmentKey!=null?IA(a,b.initSegmentKey):null,b.timestampOffset,b.appendWindowStart,b.appendWindowEnd,[],b.tilesLayout||"");a.mimeType=b.mimeType||c.mimeType||"";a.codecs=b.codecs||c.codecs||"";b.thumbnailSprite&&a.He(b.thumbnailSprite);return a}function IA(a,b){const c=new DA("segment",a.h,a.g,b);return new yi(()=>[c.toString()],0,null)}
var JA=class{constructor(a,b){this.h=a;this.g=b}};var KA=class{constructor(){this.g=null}configure(){}async start(a,b){const c=CA(a);this.g=c;if(c==null||c.g!="manifest")throw new F(2,1,9004,a);a=new qA;try{await a.init();const d=(await (await mA(a,c.yb(),c.Xa())).getManifests([c.key()]))[0],e=HA(new JA(c.yb(),c.Xa()),d);b.makeTextStreamsForClosedCaptions(e);return e}finally{await a.destroy()}}stop(){return Promise.resolve()}update(){}async onExpirationUpdated(a,b){const c=this.g,d=new qA;try{await d.init();const e=await mA(d,c.yb(),c.Xa()),f=(await e.getManifests([c.key()]))[0],
g=f.sessionIds.includes(a),h=f.expiration==void 0||f.expiration>b;g&&h&&await e.updateManifestExpiration(c.key(),b)}catch(e){}finally{await d.destroy()}}onInitialVariantChosen(){}banLocation(){}setMediaElement(){}};hc("application/x-offline-manifest",()=>new KA);function LA(a,b){const c=CA(a);c&&c.g=="manifest"?(a={uri:a,originalUri:a,data:new ArrayBuffer(0),headers:{"content-type":"application/x-offline-manifest"},originalRequest:b},a=Pf(a)):a=c&&c.g=="segment"?MA(c.key(),c,b):Mf(new F(2,1,9004,a));return a}function MA(a,b,c){const d=new qA;return Pf(void 0).Qa(()=>d.init()).Qa(()=>mA(d,b.yb(),b.Xa())).Qa(e=>e.getSegments([b.key()])).Qa(e=>({uri:b,data:e[0].data,headers:{},originalRequest:c})).finally(()=>d.destroy())}var NA=class{};
v("shaka.offline.OfflineScheme",NA);NA.plugin=LA;Yf("offline",LA);function OA(a){const b=[];for(const c of a){a=!1;for(const d of b)if(PA(d.info,c)){d.sessionIds.push(c.sessionId);a=!0;break}a||b.push({info:c,sessionIds:[c.sessionId]})}return b}function PA(a,b){const c=(d,e)=>d.robustness==e.robustness&&d.contentType==e.contentType;return a.keySystem==b.keySystem&&a.licenseUri==b.licenseUri&&ta(a.audioCapabilities,b.audioCapabilities,c)&&ta(a.videoCapabilities,b.videoCapabilities,c)}
async function QA(a,b,c){const d=new rh({Yb:b,onError:()=>{},ye:()=>{},onExpirationUpdated:()=>{},onEvent:()=>{}});try{d.configure(a),await Xg(d,c.info.keySystem,c.info.licenseUri,c.info.serverCertificate,c.info.audioCapabilities,c.info.videoCapabilities)}catch(f){return await d.destroy(),[]}const e=[];await Promise.all(c.sessionIds.map(async f=>{try{await kh(d,f),e.push(f)}catch(g){}}));await d.destroy();return e}
async function RA(a,b,c){let d=[];for(const e of OA(c))c=await QA(a,b,e),d=d.concat(c);return d};function SA(a,b,c){const d=b.presentationTimeline.getDuration();b=TA(b);return{offlineUri:null,originalManifestUri:a,duration:d,size:0,expiration:Infinity,tracks:b,appMetadata:c,isIncomplete:!1}}function TA(a){const b=[],c=uf(a.variants);for(const d of c)b.push(mf(d));a=a.textStreams;for(const d of a)b.push(nf(d));return b}
function UA(a,b){var c=HA(new JA(a.yb(),a.Xa()),b);const d=b.appMetadata||{};c=TA(c);return{offlineUri:a.toString(),originalManifestUri:b.originalManifestUri,duration:b.duration,size:b.size,expiration:b.expiration,tracks:c,appMetadata:d,isIncomplete:b.isIncomplete||!1}};function VA(a,b){const c=b.audio,d=b.video;c&&!d&&a.g.set(c.id,c.bandwidth||b.bandwidth);!c&&d&&a.g.set(d.id,d.bandwidth||b.bandwidth);if(c&&d){const e=c.bandwidth||393216;let f=d.bandwidth||b.bandwidth-e;f<=0&&(f=b.bandwidth);a.g.set(c.id,e);a.g.set(d.id,f)}}function WA(a,b){a=a.g.get(b);a==null&&(a=0);return a}var XA=class{constructor(){this.g=new Map}};function YA(){if(kc(Fa()))a:{var a=jA;for(b of a.values())if(a=b()){a.destroy();var b=!0;break a}b=!1}else b=!1;return b}async function ZA(a){const b=new qA;await b.init();const c=await kA(b);a=new DA("manifest",c.path.yb,c.path.Xa,a);await b.destroy();await (new $A).remove(a.toString())}
async function aB(a,b,c,d,e,f){let g=!1;try{let h=!0;for(const k of c.streams)for(const l of k.segments){let m=l.pendingSegmentRefId?d[l.pendingSegmentRefId]:null;m!=null&&(l.dataKey=m,l.pendingSegmentRefId=void 0);m=l.pendingInitSegmentRefId?d[l.pendingInitSegmentRefId]:null;m!=null&&(l.initSegmentKey=m,l.pendingInitSegmentRefId=void 0);l.pendingSegmentRefId&&(h=!1);l.pendingInitSegmentRefId&&(h=!1)}c.size+=e;h&&(c.isIncomplete=!1);await a.updateManifest(b,c);g=!0;f()}catch(h){throw await ZA(b),
g||(b=Object.values(d),await a.removeSegments(b,()=>{})),h;}}function bB(a){a.variants.map(c=>c.video);const b=new Set(a.variants.map(c=>c.audio));a=a.textStreams;for(const c of b)for(const d of b);for(const c of a)for(const d of a);}
function cB(a,b){const c=[];for(const d of a.streams)b&&d.type=="video"?c.push({contentType:be(d.mimeType,d.codecs),robustness:a.drmInfo.videoRobustness}):b||d.type!="audio"||c.push({contentType:be(d.mimeType,d.codecs),robustness:a.drmInfo.audioRobustness});return c}
async function dB(a,b,c,d){if(d.drmInfo){c=oA(c);var e=d.sessionIds.map(g=>({sessionId:g,keySystem:d.drmInfo.keySystem,licenseUri:d.drmInfo.licenseServerUri,serverCertificate:d.drmInfo.serverCertificate,audioCapabilities:cB(d,!1),videoCapabilities:cB(d,!0)})),f=await RA(b,a,e);await c.remove(f);await c.add(e.filter(g=>!f.includes(g.sessionId)))}}
function eB(a){const b=new Set;for(const c of a.streams)for(const d of c.segments)d.initSegmentKey!=null&&b.add(d.initSegmentKey),b.add(d.dataKey);return Array.from(b)}function fB(a){const b=new Set;for(const c of a.variants)c.audio&&b.add(c.audio),c.video&&b.add(c.video);for(const c of a.textStreams)b.add(c);for(const c of a.imageStreams)b.add(c);return b}function gB(a,b,c){b=a.segmentIndex.find(b);if(b!=null)for(var d=a.segmentIndex.get(b);d;)c(d,b),d=a.segmentIndex.get(++b)}
async function hB(a,b,c,d,e,f,g,h){iB();let k=null,l=null;const m=new qA;let n=null,p=null,r=null;try{k=await f();const q=await jB(a,b,k,g);kB(a);if(q.presentationTimeline.U()||q.presentationTimeline.vc())throw new F(2,9,9005,b);for(const z of d){const A=await lB(a,z,q);q.imageStreams.push(A);kB(a)}for(const z of e){const A=await mB(a,q,z.uri,z.language,z.kind,z.mime,z.codecs);q.textStreams.push(A);kB(a)}Gg(g.drm.clearKeys,q.variants);const t=q.variants.some(z=>{if(z.audio)for(const A of z.audio.drmInfos)if(A.licenseServerUri.startsWith("data:"))return!0;
if(z.video)for(const A of z.video.drmInfos)if(A.licenseServerUri.startsWith("data:"))return!0;return!1});let u=g.offline.usePersistentLicense;t&&(u=!1);l=await a.Hc(q,z=>{r=r||z},g,u);kB(a);if(r)throw r;await nB(q,l,g,u);await m.init();kB(a);n=await kA(m);kB(a);const {ri:x,dg:y}=oB(l,q,b,c,g,h,u),w=await n.Xa.addManifests([x]);kB(a);p=w[0];kB(a);if(r)throw r;await pB(a,y,p,x,h,g,n.Xa,q,l,u);kB(a);qB(q,x,l,u);await n.Xa.updateManifest(p,x);kB(a);return UA(new DA("manifest",n.path.yb,n.path.Xa,p),x)}catch(q){throw p!=
null&&await ZA(p),r||q;}finally{await m.destroy(),k&&await k.stop(),l&&await l.destroy()}}function rB(a,b){const c=b.promise;a.i.push(c);return b.finally(()=>{sa(a.i,c)})}function iB(){if(!YA())throw new F(2,9,9E3);}
async function jB(a,b,c,d){let e=null;const f={networkingEngine:a.g,filter:()=>Promise.resolve(),makeTextStreamsForClosedCaptions:()=>{},onTimelineRegionAdded:()=>{},onEvent:()=>{},onError:g=>{e=g},isLowLatencyMode:()=>!1,updateDuration:()=>{},newDrmInfo:()=>{},onManifestUpdated:()=>{},getBandwidthEstimate:()=>d.abr.defaultBandwidthEstimate,onMetadata:()=>{},disableStream:()=>{},addFont:()=>{}};c.configure(d.manifest);kB(a);b=await c.start(b,f);kB(a);c=fB(b);await Promise.all(mg(c,g=>g.createSegmentIndex()));
kB(a);if(e)throw e;return b}function kB(a){if(a.j.g)throw new F(2,9,7001);}
async function lB(a,b,c){var d=await sB(a,b);if(d!="text/vtt")throw new F(1,2,2017,b);var e=await tB(b,a.g,a.h.streaming.retryParameters),f=qe(d);if(!f)throw new F(2,2,2014,d);f=f();c={periodStart:0,segmentStart:0,segmentEnd:c.presentationTimeline.getDuration(),vttOffset:0};e=C(e);f=f.parseMedia(e,c,b,[]);e=[];for(const g of f){let h=null;f=new M(g.startTime,g.endTime,()=>{h==null&&(h=Vb([b],[g.payload]));return h||[]},0,null,null,0,0,Infinity);g.payload.includes("#xywh")&&(c=g.payload.split("#xywh=")[1].split(","),
c.length===4&&f.He({height:parseInt(c[3],10),positionX:parseInt(c[0],10),positionY:parseInt(c[1],10),width:parseInt(c[2],10)}));e.push(f)}e.length&&(d=await Cl(e[0].P()[0],a.g,a.h.manifest.retryParameters));return{id:a.m++,originalId:null,groupId:null,createSegmentIndex:()=>Promise.resolve(),segmentIndex:new Uk(e),mimeType:d||"",codecs:"",kind:"",encrypted:!1,drmInfos:[],keyIds:new Set,language:"und",originalLanguage:null,label:null,type:"image",primary:!1,trickModeVideo:null,dependencyStream:null,
emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,tilesLayout:"1x1",accessibilityPurpose:null,external:!0,fastSwitching:!1,fullMimeTypes:new Set([be(d||"","")]),isAudioMuxedInVideo:!1,baseOriginalId:null}}
async function mB(a,b,c,d,e,f,g){f||=await sB(a,c);a={id:a.m++,originalId:null,groupId:null,createSegmentIndex:()=>Promise.resolve(),segmentIndex:Tk(0,b.presentationTimeline.getDuration(),[c]),mimeType:f||"",codecs:g||"",kind:e,encrypted:!1,drmInfos:[],keyIds:new Set,language:d,originalLanguage:d,label:null,type:G,primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,
external:!0,fastSwitching:!1,fullMimeTypes:new Set([be(f||"",g||"")]),isAudioMuxedInVideo:!1,baseOriginalId:null};b=be(a.mimeType,a.codecs);if(!re(b))throw new F(2,2,2014,f);return a}
async function nB(a,b,c,d){Te(a,c.restrictions);await We(b,a,d,c.drm.preferredKeySystems,c.drm.keySystemsMapping);b=[];Re(a,c.preferredVideoCodecs,c.preferredAudioCodecs,c.preferredDecodingAttributes,c.preferredTextFormats);for(var e of a.variants)b.push(mf(e));for(var f of a.textStreams)b.push(nf(f));for(var g of a.imageStreams)b.push(of(g));e=await c.offline.trackSelectionCallback(b);f=a.presentationTimeline.getDuration();g=0;for(const m of e)g+=m.bandwidth*f/8;try{if(!await c.offline.downloadSizeCallback(g))throw new F(2,
9,9014);}catch(m){if(m instanceof F)throw m;throw new F(2,9,9015);}const h=new Set,k=new Set,l=new Set;for(const m of e)m.type=="variant"&&h.add(m.id),m.type=="text"&&k.add(m.id),m.type=="image"&&l.add(m.id);a.variants=a.variants.filter(m=>h.has(m.id));a.textStreams=a.textStreams.filter(m=>k.has(m.id));a.imageStreams=a.imageStreams.filter(m=>l.has(m.id));bB(a)}
function oB(a,b,c,d,e,f,g){const h=SA(c,b,d),k=e.offline.progressCallback;Tz(f,(q,t)=>{h.size=t;k(h,q)},(q,t)=>{l&&g&&m==t&&Zg(a,"cenc",q)});const l=uB(b)&&!vB(b);let m=null;l&&(m=wB.get(a.g.keySystem));const n=new XA;for(const q of b.textStreams)n.g.set(q.id,52);for(const q of b.imageStreams)n.g.set(q.id,q.bandwidth||2048);for(const q of b.variants)VA(n,q);const {streams:p,dg:r}=xB(f,n,b,e);(e=a.g)&&g&&(e.initData=[]);return{ri:{creationTime:Date.now(),originalManifestUri:c,duration:b.presentationTimeline.getDuration(),
size:0,expiration:a.md(),streams:p,sessionIds:g?lh(a):[],drmInfo:e,appMetadata:d,isIncomplete:!0,sequenceMode:b.sequenceMode,type:b.type},dg:r}}
async function pB(a,b,c,d,e,f,g,h,k,l){let m={},n=0;const p=()=>{if(a.j.g||e.l)throw new F(2,9,7001);};var r=async(q,t)=>{for(const u of q){p();q=Nz(u,f);const x=u.h,y=u.i,w=async A=>{var B=u.g,D=B.Jb(!1);B.aesKey&&!D&&(A=await Bl(A,B.aesKey,u.j));B=Mz(B);D=await g.addSegments([{data:A}]);p();m[B]=D[0];n+=A.byteLength},z=u.g.Jb(!1);z?Vz(e,u.groupId,z,x,y,w):e.queue(u.groupId,q,x,y,w)}await Wz(e);p();t&&!e.l&&(qB(h,d,k,l),await g.updateManifest(c,d))};try{uB(h),await r(b,!1),p(),b=m,r=n,m={},n=0,await aB(g,
c,d,b,r,()=>p()),p()}catch(q){throw b=Object.values(m),await g.removeSegments(b,()=>{}),q;}}function qB(a,b,c,d){b.expiration=c.md();c=lh(c);b.sessionIds=d?c:[];if(uB(a)&&d&&!c.length)throw new F(2,9,9007);}function uB(a){return a.variants.some(b=>{const c=b.audio&&b.audio.encrypted;return b.video&&b.video.encrypted||c})}function vB(a){return a.variants.some(b=>(b.video?b.video.drmInfos:[]).concat(b.audio?b.audio.drmInfos:[]).some(c=>c.initData&&c.initData.length))}
function xB(a,b,c,d){const e=new Map;var f=fB(c);const g=new Map;for(const h of f)f=yB(a,b,c,h,d,e),g.set(h.id,f);for(const h of c.variants)h.audio&&g.get(h.audio.id).variantIds.push(h.id),h.video&&g.get(h.video.id).variantIds.push(h.id);return{streams:Array.from(g.values()),dg:Array.from(e.values())}}async function zB(a,b){a.i.push(b);try{return await b}finally{sa(a.i,b)}}
async function AB(a,b){iB();const c=CA(b);if(c==null||c.g!="manifest")throw new F(2,9,9004,b);b=new qA;try{await b.init();const d=await mA(b,c.yb(),c.Xa()),e=(await d.getManifests([c.key()]))[0];await Promise.all([BB(a,e,b),CB(d,c,e)])}finally{await b.destroy()}}async function BB(a,b,c){await dB(a.g,a.h.drm,c,b)}function CB(a,b,c){const d=eB(c);UA(b,c);c=()=>{};return Promise.all([a.removeSegments(d,c),a.removeManifests([b.key()],c)])}
async function DB(a){iB();const b=a.g;a=a.h.drm;const c=new qA;let d=!1;try{await c.init();const e=[];nA(c,f=>e.push(f));for(const f of e){const g=await f.getAll(),h=await RA(a,b,g);await f.remove(h);h.length!=g.length&&(d=!0)}}finally{await c.destroy()}return!d}
async function EB(){iB();const a=[],b=new qA;try{await b.init();let c=Promise.resolve();lA(b,(d,e)=>{c=c.then(async()=>{(await e.getAllManifests()).forEach((f,g)=>{f=UA(new DA("manifest",d.yb,d.Xa,g),f);a.push(f)})})});await c}finally{await b.destroy()}return a}async function sB(a,b){let c;try{c=await Cl(b,a.g,a.h.streaming.retryParameters)}catch(d){}if(c)return c;throw new F(1,2,2011,b);}async function tB(a,b,c){a=ag([a],c);a.method="GET";return(await b.request(gg,a).promise).data}
function yB(a,b,c,d,e,f){const g={id:d.id,originalId:d.originalId,groupId:d.groupId,primary:d.primary,type:d.type,mimeType:d.mimeType,codecs:d.codecs,frameRate:d.frameRate,pixelAspectRatio:d.pixelAspectRatio,hdr:d.hdr,colorGamut:d.colorGamut,videoLayout:d.videoLayout,kind:d.kind,language:d.language,originalLanguage:d.originalLanguage,label:d.label,width:d.width||null,height:d.height||null,encrypted:d.encrypted,keyIds:d.keyIds,segments:[],variantIds:[],roles:d.roles,forced:d.forced,channelsCount:d.channelsCount,
audioSamplingRate:d.audioSamplingRate,spatialAudio:d.spatialAudio,closedCaptions:d.closedCaptions,tilesLayout:d.tilesLayout,mssPrivateData:d.mssPrivateData,external:d.external,fastSwitching:d.fastSwitching,isAudioMuxedInVideo:d.isAudioMuxedInVideo},h=e.offline.numberOfParallelDownloads;let k=h===0?d.id:0;gB(d,c.presentationTimeline.ub(),(l,m)=>{const n=Mz(l);let p=void 0;if(!f.has(n)){var r=l.endTime-l.startTime;r=WA(b,d.id)*r;r=Pz(a.g,r);f.set(n,new Oz(l,r,k,!1,m))}l.$&&(p=Mz(l.$),f.has(p)||(r=WA(b,
d.id)*.5,r=Pz(a.g,r),f.set(p,new Oz(l.$,r,k,!0,m))));g.segments.push({pendingInitSegmentRefId:p,initSegmentKey:p?0:null,startTime:l.startTime,endTime:l.endTime,appendWindowStart:l.appendWindowStart,appendWindowEnd:l.appendWindowEnd,timestampOffset:l.timestampOffset,tilesLayout:l.tilesLayout,pendingSegmentRefId:n,dataKey:0,mimeType:l.mimeType,codecs:l.codecs,thumbnailSprite:l.thumbnailSprite});h!==0&&(k=(k+1)%h)});return g}
var $A=class{constructor(a){if(a&&a.constructor!=R)throw new F(2,9,9008);this.g=this.h=null;a?(this.h=a.g,this.g=a.Gb()):(this.h=Vm(),this.g=new jg,this.g.configure(this.h.networking));this.i=[];this.l=[];const b=!a;this.j=new lg(async()=>{await Promise.all(this.l.map(e=>Sz(e)));const c=()=>{},d=[];for(const e of this.i)d.push(e.then(c,c));await Promise.all(d);b&&await this.g.destroy();this.g=this.h=null});this.m=1E9}destroy(){return this.j.destroy()}configure(a,b){arguments.length==2&&typeof a==
"string"&&(a=xm(a,b));return $m(this.h,a)}getConfiguration(){const a=Vm();$m(a,this.h,Vm());return a}Gb(){return this.g}store(a,b,c,d,e){const f=this.getConfiguration(),g=new Xz(this.g);this.l.push(g);b=hB(this,a,b||{},d||[],e||[],async()=>{c||=await Cl(a,this.g,f.manifest.retryParameters);return mc(a,c||null)()},f,g);b=new Nf(b,()=>Sz(g));b.finally(()=>{sa(this.l,g)});return rB(this,b)}remove(a){return zB(this,AB(this,a))}Mi(){return zB(this,DB(this))}list(){return zB(this,EB())}async Hc(a,b,c,d){b=
new rh({Yb:this.g,onError:b,ye:()=>{},onExpirationUpdated:()=>{},onEvent:()=>{}});b.configure(c.drm);await Sg(b,a.variants,d);d&&await ch(b);return b}};v("shaka.offline.Storage",$A);$A.deleteAll=async function(){const a=new qA;try{await pA(a)}finally{await a.destroy()}};$A.prototype.list=$A.prototype.list;$A.prototype.removeEmeSessions=$A.prototype.Mi;$A.prototype.remove=$A.prototype.remove;$A.prototype.store=$A.prototype.store;$A.prototype.getNetworkingEngine=$A.prototype.Gb;
$A.prototype.getConfiguration=$A.prototype.getConfiguration;$A.prototype.configure=$A.prototype.configure;$A.prototype.destroy=$A.prototype.destroy;$A.support=YA;
var wB=(new Map).set("org.w3.clearkey","1077efecc0b24d02ace33c1e52e2fb4b").set("com.widevine.alpha","edef8ba979d64acea3c827dcd51d21ed").set("com.microsoft.playready","9a04f07998404286ab92e65be0885f95").set("com.microsoft.playready.recommendation","9a04f07998404286ab92e65be0885f95").set("com.microsoft.playready.software","9a04f07998404286ab92e65be0885f95").set("com.microsoft.playready.hardware","9a04f07998404286ab92e65be0885f95").set("com.huawei.wiseplay","3d5e6d359b9a41e8b843dd3c6e72c42c");
Cp("offline",YA);function FB(a,b){a={priority:b||0,callback:a};for(b=0;b<GB.length;b++)if(GB[b].priority<a.priority){GB.splice(b,0,a);return}GB.push(a)}var HB=class{};v("shaka.polyfill",HB);HB.register=FB;HB.installAll=function(){for(const a of GB)try{a.callback()}catch(b){ja("Error installing polyfill!",b)}};var GB=[];var IB=class{constructor(a,b,c){this.g=a;this.i=b||null;this.h=c||null;this.keySystem=a.keySystem}getConfiguration(){const a=this.g.getConfiguration();if(a.videoCapabilities)for(const b of a.videoCapabilities)b.encryptionScheme=this.i;if(a.audioCapabilities)for(const b of a.audioCapabilities)b.encryptionScheme=this.h;return a}createMediaKeys(){return this.g.createMediaKeys()}};function JB(a){if(zb(a))return"cbcs";if(wb(a)||xb(a)||vb(a)||a==="com.huawei.wiseplay")return"cenc";ja("EmeEncryptionSchemePolyfill: Unknown key system:",a,"Please contribute!");return null}function KB(a){if(!a)return!1;a=a.getConfiguration();const b=a.audioCapabilities&&a.audioCapabilities[0];return(a=a.videoCapabilities&&a.videoCapabilities[0]||b)&&a.encryptionScheme!==void 0?!0:!1}function LB(a,b){return!a||a==b||(a=="cbcs"||a=="cbcs-1-9")&&Fa().A()?!0:!1};function MB(){Fa().O()&&!NB&&!navigator.emeEncryptionSchemePolyfilled&&navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration&&(NB=navigator.requestMediaKeySystemAccess,navigator.requestMediaKeySystemAccess=OB,navigator.emeEncryptionSchemePolyfilled=!0)}async function OB(a,b){const c=await NB.call(this,a,b);if(KB(c))return navigator.requestMediaKeySystemAccess=NB,c;navigator.requestMediaKeySystemAccess=PB;return PB.call(this,a,b)}
async function PB(a,b){var c=JB(a),d=[];for(var e of b){b=QB(e.videoCapabilities,c);const f=QB(e.audioCapabilities,c);if(!e.videoCapabilities||!e.videoCapabilities.length||b.length)if(!e.audioCapabilities||!e.audioCapabilities.length||f.length){const g=Object.assign({},e);g.videoCapabilities=b;g.audioCapabilities=f;d.push(g)}}if(!d.length)throw d=Error("Unsupported keySystem or supportedConfigurations."),d.name="NotSupportedError",d.code=DOMException.NOT_SUPPORTED_ERR,d;a=await NB.call(this,a,d);
e=c=null;d[0]&&(d[0].videoCapabilities&&(c=d[0].videoCapabilities[0].encryptionScheme),d[0].audioCapabilities&&(e=d[0].audioCapabilities[0].encryptionScheme));return new IB(a,c,e)}function QB(a,b){return a?a.filter(c=>LB(c.encryptionScheme,b)):a}var RB=class{},NB;HB.EmeEncryptionScheme=RB;RB.install=MB;FB(MB);function SB(){Fa().O()&&!TB&&!navigator.mediaCapabilitiesEncryptionSchemePolyfilled&&navigator.mediaCapabilities&&(TB=navigator.mediaCapabilities.decodingInfo,navigator.mediaCapabilities.decodingInfo=UB,navigator.mediaCapabilitiesEncryptionSchemePolyfilled=!0)}
async function UB(a){const b=await TB.call(this,a);if(!b.supported||!a.keySystemConfiguration)return b;const c=b.keySystemAccess;if(KB(c))return navigator.mediaCapabilities.decodingInfo=TB,b;navigator.mediaCapabilities.decodingInfo=VB;return c?VB.call(this,a):(b.keySystemAccess=await WB(a),b)}
async function VB(a){var b=null;let c=null;if(a.keySystemConfiguration){b=a.keySystemConfiguration;var d=b.keySystem;c=b.audio&&b.audio.encryptionScheme;b=b.video&&b.video.encryptionScheme;d=JB(d);const e={powerEfficient:!1,smooth:!1,supported:!1,keySystemAccess:null,configuration:a};if(!LB(c,d)||!LB(b,d))return e}d=await TB.call(this,a);d.keySystemAccess?d.keySystemAccess=new IB(d.keySystemAccess,b,c):a.keySystemConfiguration&&(d.keySystemAccess=await WB(a));return d}
async function WB(a){var b=a.keySystemConfiguration;const c=[],d=[];b.audio&&c.push({robustness:b.audio.robustness||"",contentType:a.audio.contentType,encryptionScheme:b.audio.encryptionScheme});b.video&&d.push({robustness:b.video.robustness||"",contentType:a.video.contentType,encryptionScheme:b.video.encryptionScheme});b={initDataTypes:b.initDataType?[b.initDataType]:[],distinctiveIdentifier:b.distinctiveIdentifier,persistentState:b.persistentState,sessionTypes:b.sessionTypes};c.length&&(b.audioCapabilities=
c);d.length&&(b.videoCapabilities=d);return await navigator.requestMediaKeySystemAccess(a.keySystemConfiguration.keySystem,[b])}var XB=class{},TB;HB.MCapEncryptionScheme=XB;XB.install=SB;FB(SB,-2);function YB(){Fa().o()||(navigator.mediaCapabilities||(navigator.mediaCapabilities={}),ZB.originalMcap=navigator.mediaCapabilities,navigator.mediaCapabilities.decodingInfo=$B)}
async function $B(a){const b={supported:!1,powerEfficient:!0,smooth:!0,keySystemAccess:null,configuration:a};Fa();const c=a.video,d=a.audio;if(a.type=="media-source"){if(!kc()||c&&!await aC(c)||d&&!await bC(d))return b}else if(a.type=="file"){if(c&&!lc(c.contentType)||d&&!lc(d.contentType))return b}else return b;if(a.keySystemConfiguration){if(a=await cC(c,d,a.keySystemConfiguration))b.supported=!0,b.keySystemAccess=a}else b.supported=!0;return b}
async function aC(a){return Fa().i()==="CAST"?await dC(a):Dh(a.contentType)}async function bC(a){const b=Fa().i();let c=a.contentType;return b==="CAST"&&a.spatialRendering&&(c+="; spatialRendering=true",window.cast&&cast.__platform__&&cast.__platform__.canDisplayType)?(eC.has(c)?a=eC.get(c):(a=await cast.__platform__.canDisplayType(c),eC.set(c,a)),a):Dh(c)}
async function cC(a,b,c){var d=[],e=[];const f=[];if(c.audio){var g={robustness:c.audio.robustness||"",contentType:b.contentType};Fa().Y()&&b.contentType.includes('codecs="ac-3"')&&(g.contentType='audio/mp4; codecs="ec-3"');c.audio.encryptionScheme&&(g.encryptionScheme=c.audio.encryptionScheme,f.push(c.audio.encryptionScheme));d.push(g)}c.video&&(g={robustness:c.video.robustness||"",contentType:a.contentType},c.video.encryptionScheme&&(g.encryptionScheme=c.video.encryptionScheme,f.push(c.video.encryptionScheme)),
e.push(g));g={initDataTypes:[c.initDataType],distinctiveIdentifier:c.distinctiveIdentifier,persistentState:c.persistentState,sessionTypes:c.sessionTypes};d.length&&(g.audioCapabilities=d);e.length&&(g.videoCapabilities=e);a=a?a.contentType:"";d=b?b.contentType:"";b=ke(a)+";"+ie(a);a=ke(d)+";"+ie(d);d=c.keySystem;e=null;try{const h=Ab(b,a,d,f);if(Cb.has(h)){const k=Ab(b,a,d,f);e=Cb.get(k)||null}else{c=e=await navigator.requestMediaKeySystemAccess(c.keySystem,[g]);const k=Ab(b,a,d,f);Cb.set(k,c)}}catch(h){}return e}
async function dC(a){if(!(window.cast&&cast.__platform__&&cast.__platform__.canDisplayType))return Dh(a.contentType);let b=a.contentType;a.width&&a.height&&a.width>1280&&a.height>720&&(b+=`; width=${a.width}; height=${a.height}`);if(a.framerate){const c=Math.round(a.framerate);if(c<24||c>30)b+=`; framerate=${a.framerate}`}switch(a.transferFunction||""){case "":case "srgb":break;case "pq":b+="; eotf=smpte2084";break;case "hlg":b+="; eotf=arib-std-b67";break;default:return!1}eC.has(b)?a=eC.get(b):(a=
await cast.__platform__.canDisplayType(b),eC.set(b,a));return a}var ZB=class{};HB.MediaCapabilities=ZB;ZB.install=YB;ZB.originalMcap=null;var eC=new Map;FB(YB,-1);function fC(){const a=Fa(),b=a.h()==="WEBKIT"?a.g():null;(window.MediaSource||window.ManagedMediaSource)&&b&&window.MediaSource&&(b<=12?(gC(),hC()):b<=15&&gC());for(const c of a.ha())iC(c);(window.MediaSource||window.ManagedMediaSource)&&jC();window.MediaSource&&MediaSource.isTypeSupported('video/webm; codecs="vp9"')&&!MediaSource.isTypeSupported('video/webm; codecs="vp09.00.10.08"')&&kC()}
function gC(){const a=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(...b){b=a.apply(this,b);b.abort=function(){};return b}}function hC(){const a=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(b,c){return a.call(this,b,c-.001)}}
function iC(a){const b=MediaSource.isTypeSupported.bind(MediaSource);MediaSource.isTypeSupported=c=>ie(c)!=a&&b(c);if(window.ManagedMediaSource){const c=ManagedMediaSource.isTypeSupported.bind(ManagedMediaSource);window.ManagedMediaSource.isTypeSupported=d=>ie(d)!=a&&c(d)}}
function jC(){if(window.MediaSource){const a=MediaSource.isTypeSupported.bind(MediaSource);MediaSource.isTypeSupported=b=>fe(b)!="mp2t"&&a(b)}if(window.ManagedMediaSource){const a=ManagedMediaSource.isTypeSupported.bind(ManagedMediaSource);window.ManagedMediaSource.isTypeSupported=b=>fe(b)!="mp2t"&&a(b)}}
function kC(){const a=MediaSource.isTypeSupported;Fa().va()&&(MediaSource.isTypeSupported=b=>{const c=b.split(/ *; */),d=c.findIndex(g=>g.startsWith("codecs="));if(d<0)return a(b);const e=c[d].replace("codecs=","").replace(/"/g,"").split(/\s*,\s*/),f=e.findIndex(g=>g.startsWith("vp09"));f>=0&&(e[f]="vp9",c[d]='codecs="'+e.join(",")+'"',b=c.join("; "));return a(b)})}var lC=class{};HB.MediaSource=lC;lC.install=fC;FB(fC);function mC(a=!1){window.HTMLVideoElement&&window.WebKitMediaKeys&&window.shakaMediaKeysPolyfill!=nC&&(a&&(oC=!0,pC=Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype,"mediaKeys"),qC=HTMLMediaElement.prototype.setMediaKeys,rC=window.MediaKeys,sC=window.MediaKeySystemAccess,tC=navigator.requestMediaKeySystemAccess),delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=uC,window.MediaKeys=vC,window.MediaKeySystemAccess=
wC,navigator.requestMediaKeySystemAccess=xC,window.shakaMediaKeysPolyfill=nC,hf.clear(),Cb.clear())}function xC(a,b){try{const c=new wC(a,b);return Promise.resolve(c)}catch(c){return Promise.reject(c)}}function uC(a){const b=this.mediaKeys;b&&b!=a&&yC(b,null);delete this.mediaKeys;return(this.mediaKeys=a)?yC(a,this):Promise.resolve()}
function zC(a){a=C(a.initData);if(ob(a).getUint32(0,!0)+4!=a.byteLength)throw new RangeError("Malformed FairPlay init data");a=Fb(a.subarray(4),!0);a=Ib(a);const b=new Event("encrypted");b.initDataType="skd";b.initData=mb(a);this.dispatchEvent(b)}var AC=class{},oC,pC,qC,rC,sC,tC;HB.PatchedMediaKeysApple=AC;
AC.uninstall=function(){window.shakaMediaKeysPolyfill==nC&&oC&&(oC=!1,Object.defineProperty(HTMLMediaElement.prototype,"mediaKeys",pC),HTMLMediaElement.prototype.setMediaKeys=qC,window.MediaKeys=rC,window.MediaKeySystemAccess=sC,navigator.requestMediaKeySystemAccess=tC,pC=tC=qC=sC=rC=null,window.shakaMediaKeysPolyfill="",hf.clear(),Cb.clear())};AC.install=mC;
var wC=class{constructor(a,b){this.keySystem=a;if(a.startsWith("com.apple.fps"))for(var c of b){a:{if(c.persistentState=="required"){a=null;break a}a={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:c.initDataTypes,sessionTypes:["temporary"],label:c.label};let d=b=!1;if(c.audioCapabilities)for(const e of c.audioCapabilities)e.contentType&&(b=!0,WebKitMediaKeys.isTypeSupported(this.keySystem,e.contentType.split(";")[0])&&(a.audioCapabilities.push(e),
d=!0));if(c.videoCapabilities)for(const e of c.videoCapabilities)e.contentType&&(b=!0,WebKitMediaKeys.isTypeSupported(this.keySystem,e.contentType.split(";")[0])&&(a.videoCapabilities.push(e),d=!0));b||(d=WebKitMediaKeys.isTypeSupported(this.keySystem,"video/mp4"));a=d?a:null}if(a){this.g=a;return}}c=Error("Unsupported keySystem");c.name="NotSupportedError";c.code=DOMException.NOT_SUPPORTED_ERR;throw c;}createMediaKeys(){const a=new vC(this.keySystem);return Promise.resolve(a)}getConfiguration(){return this.g}};
function yC(a,b){a.g.La();if(!b)return Promise.resolve();a.g.D(b,"webkitneedkey",zC);try{return Ck(b,HTMLMediaElement.HAVE_METADATA,a.g,()=>{b.webkitSetMediaKeys(a.h)}),Promise.resolve()}catch(c){return Promise.reject(c)}}var vC=class{constructor(a){this.h=new WebKitMediaKeys(a);this.g=new Aa}createSession(a){a=a||"temporary";if(a!="temporary")throw new TypeError("Session type "+a+" is unsupported on this platform.");return new BC(this.h)}setServerCertificate(){return Promise.resolve(!1)}getStatusForPolicy(){return Promise.resolve("usable")}};
function CC(a,b){var c=a.keyStatuses;c.size=b==void 0?0:1;c.g=b;b=new L("keystatuseschange");a.dispatchEvent(b);if(a.onkeystatuseschange)a.onkeystatuseschange(b)}
var BC=class extends Vf{constructor(a){super();this.i=null;this.l=a;this.g=this.h=null;this.j=new Aa;this.sessionId="";this.expiration=NaN;this.closed=new Lf;this.keyStatuses=new DC;this.onkeystatuseschange=null}generateRequest(a,b){this.h=new Lf;try{const c=this.l.createSession("video/mp4",C(b));this.i=c;this.sessionId=c.sessionId||"";this.j.D(this.i,"webkitkeymessage",d=>{this.h&&(this.h.resolve(),this.h=null);d=(new Map).set("messageType",this.keyStatuses.Kb()==void 0?"license-request":"license-renewal").set("message",
mb(d.message));d=new L("message",d);this.dispatchEvent(d)});this.j.D(c,"webkitkeyadded",()=>{this.g&&(CC(this,"usable"),this.g.resolve(),this.g=null)});this.j.D(c,"webkitkeyerror",()=>{const d=Error("EME PatchedMediaKeysApple key error");d.errorCode=this.i.error;if(this.h!=null)this.h.reject(d),this.h=null;else if(this.g!=null)this.g.reject(d),this.g=null;else switch(this.i.error.code){case WebKitMediaKeyError.MEDIA_KEYERR_OUTPUT:case WebKitMediaKeyError.MEDIA_KEYERR_HARDWARECHANGE:CC(this,"output-not-allowed");
break;default:CC(this,"internal-error")}});CC(this,"status-pending")}catch(c){this.h.reject(c)}return this.h}load(){return Promise.reject(Error("MediaKeySession.load not yet supported"))}update(a){this.g=new Lf;try{this.i.update(C(a))}catch(b){this.g.reject(b)}return this.g}close(){try{this.i.close(),this.closed.resolve(),this.j.La()}catch(a){this.closed.reject(a)}return this.closed}remove(){return Promise.reject(Error("MediaKeySession.remove is only applicable for persistent licenses, which are not supported on this platform"))}},
DC=class{constructor(){this.size=0;this.g=void 0}Kb(){return this.g}forEach(a){this.g&&a(this.g,Bb.value())}get(a){if(this.has(a))return this.g}has(a){const b=Bb.value();return this.g&&kb(a,b)?!0:!1}entries(){}keys(){}values(){}},nC="apple";FB(function(){window.HTMLVideoElement&&window.WebKitMediaKeys&&(navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||mC())});function EC(){if(window.MediaKeys){var a=Fa();MediaKeys.prototype.setServerCertificate&&a.J()||(MediaKeys.prototype.setServerCertificate=FC)}}function FC(){return Promise.resolve(!1)}var GC=class{};HB.PatchedMediaKeysCert=GC;GC.install=EC;FB(EC);function HC(){if(!(!window.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration)){if(HTMLMediaElement.prototype.webkitGenerateKeyRequest)IC="webkit";else if(!HTMLMediaElement.prototype.generateKeyRequest)return;navigator.requestMediaKeySystemAccess=JC;delete HTMLMediaElement.prototype.mediaKeys;HTMLMediaElement.prototype.mediaKeys=null;HTMLMediaElement.prototype.setMediaKeys=KC;window.MediaKeys=LC;window.MediaKeySystemAccess=MC;window.shakaMediaKeysPolyfill=
NC}}function OC(a){const b=IC;return b?b+a.charAt(0).toUpperCase()+a.slice(1):a}function JC(a,b){try{const c=new MC(a,b);return Promise.resolve(c)}catch(c){return Promise.reject(c)}}function KC(a){const b=this.mediaKeys;b&&b!=a&&PC(b,null);delete this.mediaKeys;(this.mediaKeys=a)&&PC(a,this);return Promise.resolve()}var QC=class{};HB.PatchedMediaKeysWebkit=QC;QC.install=HC;
var MC=class{constructor(a,b){this.g=this.keySystem=a;var c=!1;a=="org.w3.clearkey"&&(this.g="webkit-org.w3.clearkey",c=!1);let d=!1;var e=document.getElementsByTagName("video");e=e.length?e[0]:document.createElement("video");for(const f of b){b={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:f.initDataTypes,sessionTypes:["temporary"],label:f.label};let g=!1;if(f.audioCapabilities)for(const h of f.audioCapabilities)h.contentType&&
(g=!0,e.canPlayType(h.contentType.split(";")[0],this.g)&&(b.audioCapabilities.push(h),d=!0));if(f.videoCapabilities)for(const h of f.videoCapabilities)h.contentType&&(g=!0,e.canPlayType(h.contentType,this.g)&&(b.videoCapabilities.push(h),d=!0));g||(d=e.canPlayType("video/mp4",this.g)||e.canPlayType("video/webm",this.g));f.persistentState=="required"&&(c?(b.persistentState="required",b.sessionTypes=["persistent-license"]):d=!1);if(d){this.h=b;return}}c="Unsupported keySystem";if(a=="org.w3.clearkey"||
a=="com.widevine.alpha")c="None of the requested configurations were supported.";a=Error(c);a.name="NotSupportedError";a.code=DOMException.NOT_SUPPORTED_ERR;throw a;}createMediaKeys(){const a=new LC(this.g);return Promise.resolve(a)}getConfiguration(){return this.h}};
function PC(a,b){a.h=b;a.g.La();const c=IC;b&&(a.g.D(b,c+"needkey",d=>{const e=new CustomEvent("encrypted");e.initDataType="cenc";e.initData=mb(d.initData);a.h.dispatchEvent(e)}),a.g.D(b,c+"keymessage",d=>{const e=RC(a,d.sessionId);e&&(d=(new Map).set("messageType",e.keyStatuses.Kb()==void 0?"licenserequest":"licenserenewal").set("message",d.message),d=new L("message",d),e.h&&(e.h.resolve(),e.h=null),e.dispatchEvent(d))}),a.g.D(b,c+"keyadded",d=>{(d=RC(a,d.sessionId))&&d.ready()}),a.g.D(b,c+"keyerror",
d=>{const e=RC(a,d.sessionId);if(e){var f=Error("EME v0.1b key error");const g=d.errorCode;g.systemCode=d.systemCode;f.errorCode=g;!d.sessionId&&e.h?(d.systemCode==45&&(f.message="Unsupported session type."),e.h.reject(f),e.h=null):d.sessionId&&e.g?(e.g.reject(f),e.g=null):(f=d.systemCode,d.errorCode.code==MediaKeyError.MEDIA_KEYERR_OUTPUT?SC(e,"output-restricted"):f==1?SC(e,"expired"):SC(e,"internal-error"))}}))}
function RC(a,b){let c=a.j.get(b);return c?c:(c=a.i.shift())?(c.sessionId=b,a.j.set(b,c),c):null}var LC=class{constructor(a){this.l=a;this.h=null;this.g=new Aa;this.i=[];this.j=new Map}createSession(a){a=a||"temporary";if(a!="temporary"&&a!="persistent-license")throw new TypeError("Session type "+a+" is unsupported on this platform.");const b=this.h||document.createElement("video");b.src||(b.src="about:blank");a=new TC(b,this.l,a);this.i.push(a);return a}setServerCertificate(){return Promise.resolve(!1)}getStatusForPolicy(){return Promise.resolve("usable")}};
function SC(a,b){var c=a.keyStatuses;c.size=b==void 0?0:1;c.g=b;b=new L("keystatuseschange");a.dispatchEvent(b);if(a.onkeystatuseschange)a.onkeystatuseschange(b)}
function UC(a,b,c){if(a.m)return Promise.reject(Error("The session is already initialized."));a.m=!0;let d;try{if(a.l=="persistent-license")if(c)d=C(Ib("LOAD_SESSION|"+c));else{const f=Ib("PERSISTENT|");d=Rb(f,b)}else d=C(b)}catch(f){return Promise.reject(f)}a.h=new Lf;const e=OC("generateKeyRequest");try{a.j[e](a.i,d)}catch(f){if(f.name!="InvalidStateError")return a.h=null,Promise.reject(f);(new Ce(()=>{try{a.j[e](a.i,d)}catch(g){a.h.reject(g),a.h=null}})).ma(.01)}return a.h}
function VC(a,b,c){if(a.g)a.g.then(()=>VC(a,b,c)).catch(()=>VC(a,b,c));else{a.g=b;if(a.i=="webkit-org.w3.clearkey"){var d=Eb(c);var e=JSON.parse(d);e.keys[0].kty!="oct"&&(a.g.reject(Error("Response is not a valid JSON Web Key Set.")),a.g=null);d=Ob(e.keys[0].k);e=Ob(e.keys[0].kid)}else d=C(c),e=null;var f=OC("addKey");try{a.j[f](a.i,d,e,a.sessionId)}catch(g){a.g.reject(g),a.g=null}}}
var TC=class extends Vf{constructor(a,b,c){super();this.j=a;this.m=!1;this.g=this.h=null;this.i=b;this.l=c;this.sessionId="";this.expiration=NaN;this.closed=new Lf;this.keyStatuses=new WC;this.onkeystatuseschange=null}ready(){SC(this,"usable");this.g&&this.g.resolve();this.g=null}generateRequest(a,b){return UC(this,b,null)}load(a){return this.l=="persistent-license"?UC(this,null,a):Promise.reject(Error("Not a persistent session."))}update(a){const b=new Lf;VC(this,b,a);return b}close(){if(this.l!=
"persistent-license"){if(!this.sessionId)return this.closed.reject(Error("The session is not callable.")),this.closed;const a=OC("cancelKeyRequest");try{this.j[a](this.i,this.sessionId)}catch(b){}}this.closed.resolve();return this.closed}remove(){return this.l!="persistent-license"?Promise.reject(Error("Not a persistent session.")):this.close()}},WC=class{constructor(){this.size=0;this.g=void 0}Kb(){return this.g}forEach(a){this.g&&a(this.g,Bb.value())}get(a){if(this.has(a))return this.g}has(a){const b=
Bb.value();return this.g&&kb(a,b)?!0:!1}entries(){}keys(){}values(){}},IC="",NC="webkit";FB(HC);function XC(){window.crypto&&("randomUUID"in window.crypto||(window.crypto.randomUUID=YC))}function YC(){const a=URL.createObjectURL(new Blob),b=a.toString();URL.revokeObjectURL(a);return b.substr(b.lastIndexOf("/")+1)}var ZC=class{};HB.RandomUUID=ZC;ZC.install=XC;FB(XC);function $C(){const a=Symbol.prototype;"description"in a||Object.defineProperty(a,"description",{get:aD})}function aD(){const a=/\((.*)\)/.exec(this.toString());return a?a[1]:void 0}var bD=class{};HB.Symbol=bD;bD.install=$C;FB($C);function cD(){const a=[Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,Int8Array,Int16Array,Int32Array,Float32Array,Float64Array];for(const b of a){let c;(c=b.prototype).indexOf??(c.indexOf=Array.prototype.indexOf);let d;(d=b.prototype).lastIndexOf??(d.lastIndexOf=Array.prototype.lastIndexOf);let e;(e=b.prototype).includes??(e.includes=Array.prototype.includes)}}var dD=class{};HB.TypedArray=dD;dD.install=cD;FB(cD);function eD(){if(window.HTMLMediaElement){const a=HTMLMediaElement.prototype.play;HTMLMediaElement.prototype.play=function(){const b=a.apply(this);b&&b.catch(()=>{});return b}}}var fD=class{};HB.VideoPlayPromise=fD;fD.install=eD;FB(eD);function gD(){if(window.HTMLVideoElement){var a=HTMLVideoElement.prototype;!a.getVideoPlaybackQuality&&("webkitDroppedFrameCount"in a||typeof Ni().webkitDroppedFrameCount==="number")&&(a.getVideoPlaybackQuality=hD)}}function hD(){return{droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0}}var iD=class{};HB.VideoPlaybackQuality=iD;iD.install=gD;FB(gD);function jD(){if(!window.VTTCue&&window.TextTrackCue){var a=null,b=TextTrackCue.length;if(b==3)a=kD;else if(b==6)a=lD;else{try{var c=!!kD(1,2,"")}catch(d){c=!1}c&&(a=kD)}a&&(window.VTTCue=function(d,e,f){return a(d,e,f)})}}function kD(a,b,c){return new window.TextTrackCue(a,b,c)}function lD(a,b,c){return new window.TextTrackCue(a+"-"+b+"-"+c,a,b,c)}var mD=class{};HB.VTTCue=mD;mD.install=jD;FB(jD);var nD=class extends Vf{constructor(a){super();this.g=a;this.m=null;this.h=[];this.j=-1;this.i=this.l=null;this.o=new Aa}async destroy(){await this.removeAllItems();this.g=null;this.o&&(this.o.release(),this.o=null);super.release()}configure(a){this.m=a}getConfiguration(){return this.m}getCurrentItem(){return this.h.length&&this.j>=0&&this.j<this.h.length?this.h[this.j]:null}getCurrentItemIndex(){return this.j}getItems(){return this.h.slice()}insertItems(a){this.h.push(...a);this.dispatchEvent(new L("itemsinserted"))}async removeAllItems(){this.o.La();
this.h.length&&this.j>=0&&await this.g.cc();const a=[];this.i&&(this.i.preloadManager.l||a.push(this.i.preloadManager.destroy()),this.i=null);this.l&&(this.l.preloadManager.l||a.push(this.l.preloadManager.destroy()),this.l=null);for(const b of this.h)b.preloadManager&&!b.preloadManager.l&&a.push(b.preloadManager.destroy());a.length&&await Promise.all(a);this.h=[];this.j=-1;this.dispatchEvent(new L("itemsremoved"))}async playItem(a){this.o.La();if(!this.h.length||a>=this.h.length)throw new F(2,7,7007);
const b=this.getCurrentItem(),c=this.h[a];this.j!=a&&(this.j=a,this.dispatchEvent(new L("currentitemchanged")));const d=this.g.be(),e=this.m?this.m.preloadNextUrlWindow:0;if(e>0){let g=!1;this.o.D(d,"timeupdate",async()=>{if(!(this.l||this.h.length<=1||g||this.g.U())&&d.duration){var h=this.g.Ia().end-d.currentTime;if(!isNaN(h)&&h<=e){var k=this.m&&this.m.repeatMode;h=null;this.j+1<this.h.length?h=this.h[this.j+1]:k==1&&(h=this.h[0]);if(h&&(!h.preloadManager||h.preloadManager.l)){g=!0;k=null;try{k=
await this.g.preload(h.manifestUri,h.startTime,h.mimeType,h.config)}catch(l){k=null}this.l={item:h,preloadManager:k};g=!1}}}})}this.o.D(this.g,"complete",()=>{const g=this.m&&this.m.repeatMode;let h=!1;if(g==2)h=!0;else{const k=this.j+1;k<this.h.length?this.playItem(k):g==1&&(this.h.length==1?h=!0:this.playItem(0))}h&&(d.paused?(d.currentTime=this.g.Ia().start,d.play()):this.o.D(d,"paused",()=>{d.currentTime=this.g.Ia().start;d.play()}))});a=c.manifestUri;c.preloadManager&&!c.preloadManager.l&&(a=
c.preloadManager);var f=!1;this.l&&this.l.item==c&&this.l.preloadManager?a=this.l.preloadManager:this.i&&this.i.item==c&&this.i.preloadManager&&(a=this.i.preloadManager,f=!0);this.i&&(f||this.i.preloadManager.l||await this.i.preloadManager.destroy(),this.i=null);if(this.m&&this.m.preloadPrevItem&&b&&this.g.nd()===Kp){f=null;try{f=await this.g.bh()}catch(g){f=null}this.i={item:b,preloadManager:f}}c.config&&(this.g.Og(),this.g.configure(c.config));await this.g.load(a,c.startTime,c.mimeType);this.l=
null;if(c.extraText)for(const g of c.extraText)g.mime?this.g.fd(g.uri,g.language,g.kind,g.mime,g.codecs):this.g.fd(g.uri,g.language,g.kind);if(c.extraThumbnail)for(const g of c.extraThumbnail)this.g.Wd(g);if(c.extraChapter)for(const g of c.extraChapter)this.g.Vd(g.uri,g.language,g.mime)}};v("shaka.queue.QueueManager",nD);nD.prototype.playItem=nD.prototype.playItem;nD.prototype.removeAllItems=nD.prototype.removeAllItems;nD.prototype.insertItems=nD.prototype.insertItems;nD.prototype.getItems=nD.prototype.getItems;
nD.prototype.getCurrentItemIndex=nD.prototype.getCurrentItemIndex;nD.prototype.getCurrentItem=nD.prototype.getCurrentItem;nD.prototype.getConfiguration=nD.prototype.getConfiguration;nD.prototype.configure=nD.prototype.configure;nD.prototype.destroy=nD.prototype.destroy;jr=a=>new nD(a);var qD=class{parseInit(){}setSequenceMode(){}setManifestType(){}parseMedia(a,b){let c=null;const d=[];a=Eb(a).split(/\r?\n/);for(const f of a){if(!f||/^\s+$/.test(f))continue;if(a=oD.exec(f)){var e=pD.exec(a[1]);e=parseInt(e[1],10)*60+parseFloat(e[2].replace(",","."));a=new ud(e,b.segmentEnd?b.segmentEnd:e+2,a[2]);c&&(c.endTime=e,d.push(c));c=a}}c&&d.push(c);return d}};v("shaka.text.LrcTextParser",qD);qD.prototype.parseMedia=qD.prototype.parseMedia;qD.prototype.setManifestType=qD.prototype.setManifestType;
qD.prototype.setSequenceMode=qD.prototype.setSequenceMode;qD.prototype.parseInit=qD.prototype.parseInit;var oD=/^\[(\d{1,2}:\d{1,2}(?:[.,]\d{1,3})?)\](.*)/,pD=/^(\d+):(\d{1,2}(?:[.,]\d{1,3})?)$/;oe("application/x-subtitle-lrc",()=>new qD);function rD(a){return a?(a=/^(\d+) (\d+)$/.exec(a))?{columns:parseInt(a[1],10),rows:parseInt(a[2],10)}:null:null}
function sD(a,b,c,d){const e=new yc;var f=b.attributes["xml:id"];if(!f)return null;e.id=f;f=null;d&&(f=tD.exec(d)||uD.exec(d));d=f?Number(f[1]):null;f=f?Number(f[2]):null;let g,h;const k=vD(a,b,c,"extent");k&&(g=(h=tD.exec(k))||uD.exec(k),g!=null&&(e.width=Number(g[1]),e.height=Number(g[2]),h||(d!=null&&(e.width=e.width*100/d),f!=null&&(e.height=e.height*100/f)),e.widthUnits=h||d!=null?wc:0,e.heightUnits=h||f!=null?wc:0));if(a=vD(a,b,c,"origin"))if(g=(h=tD.exec(a))||uD.exec(a),g!=null)e.viewportAnchorX=
Number(g[1]),e.viewportAnchorY=Number(g[2]),h?k||(e.width=100-e.viewportAnchorX,e.widthUnits=wc,e.height=100-e.viewportAnchorY,e.heightUnits=wc):(f!=null&&(e.viewportAnchorY=e.viewportAnchorY*100/f),d!=null&&(e.viewportAnchorX=e.viewportAnchorX*100/d)),e.viewportAnchorUnits=h||d!=null?wc:0;return e}
function wD(a,b,c,d,e,f,g,h,k,l,m,n,p,r){let q,t=m;if(Sc(b)){if(!n)return null;q={tagName:"span",children:[Vc(b)],attributes:{},parent:null}}else q=b;let u=null;for(var x of xD)if(u=yD(q,"backgroundImage",e,"#",x)[0])break;x=null;var y=bd(q,xD,"backgroundImage"),w=/^(urn:)(mpeg:[a-z0-9][a-z0-9-]{0,31}:)(subs:)([0-9]+)$/;if(y&&w.test(y)){x=parseInt(y.split(":").pop(),10)-1;if(x>=r.length)return null;x=r[x]}else p&&y&&!y.startsWith("#")&&(w=new Ua(p),y=new Ua(y),(y=w.resolve(y).toString())&&(x=y));
if(b.tagName=="p"||u||x)n=!0;b=n;y=(q.attributes["xml:space"]||(k?"default":"preserve"))=="default";w=q.children.every(Sc);k=[];if(!w)for(const B of q.children){const D=wD(a,B,c,d,e,f,g,h,y,l,q,n,p,r);D&&k.push(D)}e=m!=null;p=Vc(q);p=q.children.length&&p&&/\S/.test(p);r=q.attributes.begin||q.attributes.end||q.attributes.dur;if(!(r||p||q.tagName=="br"||k.length!=0||e&&!y))return null;let {start:z,end:A}=zD(q,d);for(;t&&t.tagName&&t.tagName!="tt";)({start:z,end:A}=AD(t,d,z,A)),t=t.parent;z==null&&(z=
0);z+=c.periodStart;A=A==null?Infinity:A+c.periodStart;a.g!=="HLS"&&(z=Math.max(z,c.segmentStart),A=Math.min(A,c.segmentEnd));if(!r&&k.length>0){z=Infinity;A=0;for(const B of k)z=Math.min(z,B.startTime),A=Math.max(A,B.endTime)}if(q.tagName=="br")return a=new ud(z,A,""),a.lineBreak=!0,a;c="";w&&(c=Kb(Vc(q)||""),y&&(c=c.replace(/\s+/g," ")));c=new ud(z,A,c);c.nestedCues=k;n||(c.isContainer=!0);l&&(c.cellResolution=l);l=yD(q,"region",g,"")[0];if(q.attributes.region&&l&&l.attributes["xml:id"]){const B=
l.attributes["xml:id"];c.region=h.filter(D=>D.id==B)[0]}h=l;m&&e&&!q.attributes.region&&!q.attributes.style&&(h=yD(m,"region",g,"")[0]);BD(a,c,q,h,u,x,f,b,k.length==0);return c}function yD(a,b,c,d,e){const f=[];if(!a||c.length<1)return f;var g=a;for(a=null;!a&&!(a=e?ad(g,e,b):g.attributes[b])&&(g=g.parent,g););if(b=a){b=b.split(" ");for(const h of b)for(const k of c)if(d+k.attributes["xml:id"]==h){f.push(k);break}}return f}
function zD(a,b){const c=CD(a.attributes.begin,b);let d=CD(a.attributes.end,b);a=CD(a.attributes.dur,b);d==null&&a!=null&&(d=c+a);return{start:c,end:d}}function AD(a,b,c,d){a=zD(a,b);c==null?c=a.start:a.start!=null&&(c+=a.start);d==null?d=a.end:a.start!=null&&(d+=a.start);return{start:c,end:d}}
function BD(a,b,c,d,e,f,g,h,k){h=h||k;DD(a,c,d,g,"direction",h)=="rtl"&&(b.direction="rtl");k=DD(a,c,d,g,"writingMode",h);k=="tb"||k=="tblr"?b.writingMode="vertical-lr":k=="tbrl"?b.writingMode="vertical-rl":k=="rltb"||k=="rl"?b.direction="rtl":k&&(b.direction=Jd);(k=DD(a,c,d,g,"textAlign",!0))?(b.positionAlign=ED.get(k),b.lineAlign=FD.get(k),b.textAlign=Qd[k.toUpperCase()]):b.textAlign=Dd;if(k=DD(a,c,d,g,"displayAlign",!0))b.displayAlign=Rd[k.toUpperCase()];if(k=DD(a,c,d,g,"color",h))b.color=GD(k);
if(k=DD(a,c,d,g,"backgroundColor",h))b.backgroundColor=GD(k);if(k=DD(a,c,d,g,"border",h))b.border=k;if(k=DD(a,c,d,g,"fontFamily",h))switch(k){case "monospaceSerif":b.fontFamily="Courier New,Liberation Mono,Courier,monospace";break;case "proportionalSansSerif":b.fontFamily="Arial,Helvetica,Liberation Sans,sans-serif";break;case "sansSerif":b.fontFamily="sans-serif";break;case "monospaceSansSerif":b.fontFamily="Consolas,monospace";break;case "proportionalSerif":b.fontFamily="serif";break;default:b.fontFamily=
k.split(",").filter(l=>l!="default").join(",")}(k=DD(a,c,d,g,"fontWeight",h))&&k=="bold"&&(b.fontWeight=Fd);k=DD(a,c,d,g,"wrapOption",h);b.wrapLine=k&&k=="noWrap"?!1:!0;(k=DD(a,c,d,g,"lineHeight",h))&&k.match(HD)&&(b.lineHeight=k);(k=DD(a,c,d,g,"fontSize",h))&&(k.match(HD)||k.match(ID))&&(b.fontSize=k);if(k=DD(a,c,d,g,"fontStyle",h))b.fontStyle=Td[k.toUpperCase()];e?(f=e.attributes.imageType||e.attributes.imagetype,k=e.attributes.encoding,e=Vc(e).trim(),f=="PNG"&&k=="Base64"&&e&&(b.backgroundImage=
"data:image/png;base64,"+e)):f&&(b.backgroundImage=f);if(e=DD(a,c,d,g,"textOutline",h))e=e.split(" "),e[0].match(HD)?b.textStrokeColor=b.color:(b.textStrokeColor=GD(e[0]),e.shift()),e[0]&&e[0].match(HD)?b.textStrokeWidth=e[0]:b.textStrokeColor="";(e=DD(a,c,d,g,"letterSpacing",h))&&e.match(HD)&&(b.letterSpacing=e);(e=DD(a,c,d,g,"linePadding",h))&&e.match(HD)&&(b.linePadding=e);if(e=DD(a,c,d,g,"opacity",h))b.opacity=parseFloat(e);(e=vD(a,d,g,"textDecoration"))&&JD(b,e);(e=KD(a,c,g,"textDecoration"))&&
JD(b,e);if(e=DD(a,c,d,g,"textCombine",h))b.textCombineUpright=e;switch(DD(a,c,d,g,"ruby",h)){case "container":b.rubyTag="ruby";break;case "text":b.rubyTag="rt"}}function vD(a,b,c,d){if(!b)return null;const e=bd(b,LD,d);return e?e:MD(a,b,c,d)}function GD(a){var b=a.match(/rgba\(([^)]+)\)/);return b&&(b=b[1].split(","),b.length==4)?(b[3]=String(Number(b[3])/255),"rgba("+b.join(",")+")"):a}function DD(a,b,c,d,e,f=!0){return(b=KD(a,b,d,e))?b:f?vD(a,c,d,e):null}
function JD(a,b){for(const c of b.split(" "))switch(c){case "underline":a.textDecoration.includes(Hd)||a.textDecoration.push(Hd);break;case "noUnderline":a.textDecoration.includes(Hd)&&sa(a.textDecoration,Hd);break;case "lineThrough":a.textDecoration.includes("lineThrough")||a.textDecoration.push("lineThrough");break;case "noLineThrough":a.textDecoration.includes("lineThrough")&&sa(a.textDecoration,"lineThrough");break;case "overline":a.textDecoration.includes("overline")||a.textDecoration.push("overline");
break;case "noOverline":a.textDecoration.includes("overline")&&sa(a.textDecoration,"overline")}}function KD(a,b,c,d){const e=bd(b,LD,d);return e?e:MD(a,b,c,d)}function MD(a,b,c,d){b=yD(b,"style",c,"");let e=null;for(let f=0;f<b.length;f++){let g=ad(b[f],"urn:ebu:tt:style",d);g||=bd(b[f],LD,d);g||=KD(a,b[f],c,d);g&&(e=g)}return e}
function CD(a,b){var c=null;if(ND.test(a)){a=ND.exec(a);c=Number(a[1]);const d=Number(a[2]);let e=Number(a[3]),f=Number(a[4]);f+=(Number(a[5])||0)/b.h;e+=f/b.frameRate;c=e+d*60+c*3600}else if(OD.test(a))c=PD(OD,a);else if(QD.test(a))c=PD(QD,a);else if(RD.test(a))a=RD.exec(a),c=Number(a[1])/b.frameRate;else if(SD.test(a))a=SD.exec(a),c=Number(a[1])/b.g;else if(TD.test(a))c=PD(TD,a);else if(a)throw new F(2,2,2001,"Could not parse cue time range in TTML");return c}
function PD(a,b){a=a.exec(b);return a==null||a[0]==""?null:(Number(a[4])||0)/1E3+(Number(a[3])||0)+(Number(a[2])||0)*60+(Number(a[1])||0)*3600}
var WD=class{constructor(){this.g="UNKNOWN"}parseInit(){}setSequenceMode(){}setManifestType(a){this.g=a}parseMedia(a,b,c,d){var e=Eb(a);a=[];if(e=="")return a;var f=Lc(e,"tt",!0);if(!f)throw new F(2,2,2005,"Failed to parse TTML.");e=Xc(f,"body")[0];if(!e)return[];var g=bd(f,UD,"frameRate"),h=bd(f,UD,"subFrameRate"),k=bd(f,UD,"frameRateMultiplier"),l=bd(f,UD,"tickRate"),m=bd(f,UD,"cellResolution"),n=f.attributes["xml:space"]||"default";const p=bd(f,LD,"extent");if(n!="default"&&n!="preserve")throw new F(2,
2,2005,"Invalid xml:space value: "+n);n=n=="default";g=new VD(g,h,k,l);m=rD(m);h=Xc(f,"metadata")[0];h=(h?h.children:[]).filter(r=>r!="\n");k=Xc(f,"style");f=Xc(f,"region");l=[];for(const r of f){const q=sD(this,r,k,p);q&&l.push(q)}if(Uc(e,"p").length)throw new F(2,2,2001,"<p> can only be inside <div> in TTML");for(const r of Uc(e,"div"))if(Uc(r,"span").length)throw new F(2,2,2001,"<span> can only be inside <p> in TTML");if(b=wD(this,e,b,g,h,k,f,l,n,m,null,!1,c,d))b.backgroundColor||(b.backgroundColor=
"transparent"),a.push(b);return a}};v("shaka.text.TtmlTextParser",WD);WD.prototype.parseMedia=WD.prototype.parseMedia;WD.prototype.setManifestType=WD.prototype.setManifestType;WD.prototype.setSequenceMode=WD.prototype.setSequenceMode;WD.prototype.parseInit=WD.prototype.parseInit;
var VD=class{constructor(a,b,c,d){this.frameRate=Number(a)||30;this.h=Number(b)||1;this.g=Number(d);this.g==0&&(this.g=a?this.frameRate*this.h:1);c&&(a=/^(\d+) (\d+)$/g.exec(c))&&(this.frameRate*=Number(a[1])/Number(a[2]))}},tD=/^(\d{1,2}(?:\.\d+)?|100(?:\.0+)?)% (\d{1,2}(?:\.\d+)?|100(?:\.0+)?)%$/,ID=/^(\d{1,4}(?:\.\d+)?|100)%$/,HD=/^(\d+px|\d+em|\d*\.?\d+c)$/,uD=/^(\d+)px (\d+)px$/,ND=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,OD=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,QD=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d+)$/,
RD=/^(\d*(?:\.\d*)?)f$/,SD=/^(\d*(?:\.\d*)?)t$/,TD=RegExp("^(?:(\\d*(?:\\.\\d*)?)h)?(?:(\\d*(?:\\.\\d*)?)m)?(?:(\\d*(?:\\.\\d*)?)s)?(?:(\\d*(?:\\.\\d*)?)ms)?$"),FD=(new Map).set("left",Md).set("center","center").set("right","end").set("start",Md).set("end","end"),ED=(new Map).set("left","line-left").set("center","center").set("right","line-right").set("start","line-left").set("end","line-right"),UD=["http://www.w3.org/ns/ttml#parameter","http://www.w3.org/2006/10/ttaf1#parameter"],LD=["http://www.w3.org/ns/ttml#styling",
"http://www.w3.org/2006/10/ttaf1#styling"],xD=["http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt","http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt"];oe("application/ttml+xml",()=>new WD);var XD=class{constructor(){this.g=new WD}parseInit(a){let b=!1;(new Dg).boxes(["moov","trak","mdia","minf","stbl"],vg).ka("stsd",xg).box("stpp",c=>{b=!0;c.parser.stop()}).parse(a);if(!b)throw new F(2,2,2007);}setSequenceMode(a){this.g.setSequenceMode(a)}setManifestType(a){this.g.setManifestType(a)}parseMedia(a,b,c){let d=[],e=null;const f=[],g=new Map,h=[];(new Dg).boxes(["moof","traf"],vg).ka("tfhd",m=>{e=Gh(m.reader,m.flags).kd}).ka("trun",m=>{m=Jh(m.reader,m.version,m.flags);for(const n of m.Sf)h.push(n.sampleSize||
e||0)}).ka("subs",m=>{const n=m.reader,p=n.V();let r=-1;for(let t=0;t<p;t++){var q=n.V();r+=q;q=n.Ca();const u=[];for(let x=0;x<q;x++)m.version==1?u.push(n.V()):u.push(n.Ca()),n.Z(),n.Z(),n.V();g.set(r,u)}}).box("mdat",Ag(m=>{f.push(m)},!1)).parse(a,!1);if(f.length==0)throw new F(2,2,2007);a=Rb(...f);let k=0;for(let m=0;m<h.length;m++){const n=C(a,k,h[m]);k+=h[m];const p=g.get(m);if(p&&p.length){const r=C(n,0,p[0]),q=[];let t=p[0];for(let u=1;u<p.length;u++){var l=C(n,t,p[u]);l=Mb(l);q.push("data:image/png;base64,"+
l);t+=p[u]}d=d.concat(this.g.parseMedia(r,b,c,q))}else d=d.concat(this.g.parseMedia(n,b,c,[]))}return d}};v("shaka.text.Mp4TtmlParser",XD);XD.prototype.parseMedia=XD.prototype.parseMedia;XD.prototype.setManifestType=XD.prototype.setManifestType;XD.prototype.setSequenceMode=XD.prototype.setSequenceMode;XD.prototype.parseInit=XD.prototype.parseInit;oe('application/mp4; codecs="stpp"',()=>new XD);oe('application/mp4; codecs="stpp.ttml"',()=>new XD);oe('application/mp4; codecs="stpp.ttml.im1i"',()=>new XD);
oe('application/mp4; codecs="stpp.ttml.im1t"',()=>new XD);oe('application/mp4; codecs="stpp.ttml.im2i"',()=>new XD);oe('application/mp4; codecs="stpp.ttml.im2t"',()=>new XD);oe('application/mp4; codecs="stpp.ttml.etd1"',()=>new XD);oe('application/mp4; codecs="stpp.ttml.etd1|im1t"',()=>new XD);oe('application/mp4; codecs="stpp.ttml.im1t|etd1"',()=>new XD);oe('application/mp4; codecs="stpp.TTML.im1t"',()=>new XD);function YD(a,b,c){let d;if(d=ZD.exec(b))b=d[1],b=="middle"?a.textAlign=Dd:a.textAlign=Qd[b.toUpperCase()];else if(d=$D.exec(b))a.writingMode=d[1]=="lr"?"vertical-lr":"vertical-rl";else if(d=aE.exec(b))a.size=Number(d[1]);else if(d=bE.exec(b))a.position=Number(d[1]),d[2]&&(b=d[2],a.positionAlign=b=="line-left"||b=="start"?"line-left":b=="line-right"||b=="end"?"line-right":b=="center"||b=="middle"?"center":Id);else if(d=cE.exec(b)){if(b=dE(c,d[1]))a.region=b}else if(c=eE.exec(b))a.lineInterpretation=
1,a.line=Number(c[1]),c[2]&&(a.lineAlign=Sd[c[2].toUpperCase()]);else if(c=fE.exec(b))a.lineInterpretation=Ld,a.line=Number(c[1]),c[2]&&(a.lineAlign=Sd[c[2].toUpperCase()])}function dE(a,b){a=a.filter(c=>c.id==b);return a.length?a[0]:null}
var hE=class{constructor(){this.g="UNKNOWN"}parseInit(){}setSequenceMode(){}setManifestType(a){this.g=a}parseMedia(a,b){a=Eb(a);a=a.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");var c=a.split(/\n{2,}/m);if(!/^WEBVTT($|[ \t\n])/m.test(c[0]))throw new F(2,2,2E3);a=b.vttOffset;if(this.g=="HLS"&&c[0].includes("X-TIMESTAMP-MAP")){var d=c[0];a=d.match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m);d=d.match(/MPEGTS:(\d+)/m);if(!a||!d)throw new F(2,2,2E3);a=zc(a[1]);if(a==null)throw new F(2,2,2E3);d=Number(d[1]);
for(var e=b.segmentStart-b.periodStart;e>=95443.7176888889;)e-=95443.7176888889,d+=8589934592;a=b.periodStart+d/9E4-a}b=[];for(var f of c[0].split("\n"))if(/^Region:/.test(f)){e=new Bc(f);var g=new yc;Ec(e);Fc(e);for(var h=Ec(e);h;){var k=void 0;d=g;(k=/^id=(.*)$/.exec(h))?d.id=k[1]:(k=/^width=(\d{1,2}|100)%$/.exec(h))?d.width=Number(k[1]):(k=/^lines=(\d+)$/.exec(h))?(d.height=Number(k[1]),d.heightUnits=2):(k=/^regionanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(h))?(d.regionAnchorX=Number(k[1]),d.regionAnchorY=
Number(k[2])):(k=/^viewportanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(h))?(d.viewportAnchorX=Number(k[1]),d.viewportAnchorY=Number(k[2])):/^scroll=up$/.exec(h)&&(d.scroll="up");Fc(e);h=Ec(e)}b.push(g)}f=new Map;xd(f);d=[];for(const p of c.slice(1)){c=p.split("\n");if((c.length!=1||c[0])&&!gE.test(c[0])&&c[0]=="STYLE"){e=[];g=-1;for(h=1;h<c.length;h++)c[h].includes("::cue")&&(e.push([]),g=e.length-1),g!=-1&&(e[g].push(c[h]),c[h].includes("}")&&(g=-1));for(const r of e){e="global";(g=r[0].match(/\((.*)\)/))&&
(e=g.pop());g=r.slice(1,-1);r[0].includes("}")&&(h=/\{(.*?)\}/.exec(r[0]))&&(g=h[1].split(";"));(h=f.get(e))||(h=new ud(0,0,""));k=!1;for(var l=0;l<g.length;l++){var m=/^\s*([^:]+):\s*(.*)/.exec(g[l]);if(m){var n=m[2].trim().replace(";","");switch(m[1].trim()){case "background-color":case "background":k=!0;h.backgroundColor=n;break;case "color":k=!0;h.color=n;break;case "font-family":k=!0;h.fontFamily=n;break;case "font-size":k=!0;h.fontSize=n;break;case "font-weight":if(parseInt(n,10)>=700||n=="bold")k=
!0,h.fontWeight=Fd;break;case "font-style":switch(n){case "normal":k=!0;h.fontStyle=Pd;break;case "italic":k=!0;h.fontStyle=Gd;break;case "oblique":k=!0,h.fontStyle="oblique"}break;case "opacity":k=!0;h.opacity=parseFloat(n);break;case "text-combine-upright":k=!0;h.textCombineUpright=n;break;case "text-shadow":k=!0;h.textShadow=n;break;case "white-space":k=!0,h.wrapLine=n!="noWrap"}}}k&&f.set(e,h)}}a:{k=c;m=a;if(k.length==1&&!k[0]||gE.test(k[0])||k[0]=="STYLE"||k[0]=="REGION"){c=null;break a}c=null;
l=0;k[0].includes("--\x3e")||(c=k[0],l=1);e=new Bc(k[l]);g=Ac(e);n=Cc(e,/[ \t]+--\x3e[ \t]+/g);h=Ac(e);if(g==null||n==null||h==null){ja("Failed to parse VTT time code. Cue skipped:",c,k);c=null;break a}g+=m;h+=m;g<0&&(g=0);m="";for(n=l+1;n<k.length;n++)n>l+1&&(m+="\n"),m+=k[n];m=m.trim();f.has("global")?(k=f.get("global").clone(),k.startTime=g,k.endTime=h,k.payload=m):k=new ud(g,h,m);Fc(e);for(g=Ec(e);g;)YD(k,g,b),Fc(e),g=Ec(e);wd(k,f);c!=null&&(k.id=c);c=k}c&&d.push(c)}return d}};
v("shaka.text.VttTextParser",hE);hE.prototype.parseMedia=hE.prototype.parseMedia;hE.prototype.setManifestType=hE.prototype.setManifestType;hE.prototype.setSequenceMode=hE.prototype.setSequenceMode;hE.prototype.parseInit=hE.prototype.parseInit;
var gE=/^NOTE($|[ \t])/,ZD=/^align:(start|middle|center|end|left|right)$/,$D=/^vertical:(lr|rl)$/,aE=/^size:([\d.]+)%$/,bE=/^position:([\d.]+)%(?:,(line-left|line-right|middle|center|start|end|auto))?$/,cE=/^region:(.*)$/,eE=/^line:([\d.]+)%(?:,(start|end|center))?$/,fE=/^line:(-?\d+)(?:,(start|end|center))?$/;oe("text/vtt",()=>new hE);oe('text/vtt; codecs="vtt"',()=>new hE);oe('text/vtt; codecs="wvtt"',()=>new hE);function iE(a,b,c){let d,e,f;(new Dg).box("payl",Ag(g=>{d=Eb(g)},!1)).box("iden",Ag(g=>{e=Eb(g)},!1)).box("sttg",Ag(g=>{f=Eb(g)},!1)).parse(a);return d?jE(d,e,f,b,c):null}function jE(a,b,c,d,e){a=new ud(d,e,a);wd(a);b&&(a.id=b);if(c)for(b=new Bc(c),c=Ec(b);c;)YD(a,c,[]),Fc(b),c=Ec(b);return a}
var kE=class{constructor(){this.g=null}parseInit(a){let b=!1;(new Dg).boxes(["moov","trak","mdia","minf","stbl"],vg).ka("mdhd",c=>{this.g=Ih(c.reader,c.version).timescale}).ka("stsd",xg).box("wvtt",()=>{b=!0}).parse(a);if(!this.g)throw new F(2,2,2008);if(!b)throw new F(2,2,2008);}setSequenceMode(){}setManifestType(){}parseMedia(a,b){if(!a.length)return[];if(!this.g)throw new F(2,2,2008);let c=0,d=[],e;const f=[];let g=!1,h=!1,k=!1,l=null;(new Dg).boxes(["moof","traf"],vg).ka("tfdt",p=>{g=!0;c=Hh(p.reader,
p.version).baseMediaDecodeTime}).ka("tfhd",p=>{l=Gh(p.reader,p.flags).jd}).ka("trun",p=>{h=!0;d=Jh(p.reader,p.version,p.flags).Sf}).box("mdat",Ag(p=>{k=!0;e=p},!1)).parse(a,!1);if(!k&&!g&&!h)throw new F(2,2,2008);a=c;const m=new sg(e,0);for(const p of d){const r=p.Tf||l,q=p.Ce?c+p.Ce:a;a=q+(r||0);let t=0;do{var n=m.V();t+=n;const u=m.V();let x=null;ug(u)=="vttc"?n>8&&(x=m.Bb(n-8,!1)):m.skip(n-8);r&&x&&(n=iE(x,b.periodStart+q/this.g,b.periodStart+a/this.g),f.push(n))}while(p.sampleSize&&t<p.sampleSize)}return f.filter(Fe)}};
v("shaka.text.Mp4VttParser",kE);kE.prototype.parseMedia=kE.prototype.parseMedia;kE.prototype.setManifestType=kE.prototype.setManifestType;kE.prototype.setSequenceMode=kE.prototype.setSequenceMode;kE.prototype.parseInit=kE.prototype.parseInit;oe('application/mp4; codecs="wvtt"',()=>new kE);var lE=class{parseInit(){}setSequenceMode(){}setManifestType(){}parseMedia(a){var b=Eb(a).replace(/\r+/g,"");b=b.trim();a=[];if(b=="")return a;b=b.split("\n\n");for(const d of b){b=d.split("\n");var c=new Bc(b[0]);const e=Ac(c),f=Cc(c,/,/g);c=Ac(c);if(e==null||f==null||c==null)throw new F(2,2,2001,"Could not parse cue time range in SubViewer");a.push(new ud(e,c,b.slice(1).join("\n").trim()))}return a}};v("shaka.text.SbvTextParser",lE);lE.prototype.parseMedia=lE.prototype.parseMedia;
lE.prototype.setManifestType=lE.prototype.setManifestType;lE.prototype.setSequenceMode=lE.prototype.setSequenceMode;lE.prototype.parseInit=lE.prototype.parseInit;oe("text/x-subviewer",()=>new lE);var mE=class{constructor(){this.g=new hE}parseInit(){}setSequenceMode(){}setManifestType(){}parseMedia(a,b,c){var d=Eb(a);a="WEBVTT\n\n";if(d!=""){d=d.replace(/\r+/g,"");d=d.trim();d=d.split("\n\n");for(e of d)d=e.split(/\n/),d[0].match(/\d+/)&&d.shift(),d[0]=d[0].replace(/,/g,"."),a+=d.join("\n").replace(/{b}/g,"<b>").replace(/{\/b}/g,"</b>").replace(/{i}/g,"<i>").replace(/{\/i}/g,"</i>").replace(/{u}/g,"<u>").replace(/{\/u}/g,"</u>")+"\n\n"}var e=a;e=C(Ib(e));return this.g.parseMedia(e,b,c,[])}};
v("shaka.text.SrtTextParser",mE);mE.prototype.parseMedia=mE.prototype.parseMedia;mE.prototype.setManifestType=mE.prototype.setManifestType;mE.prototype.setSequenceMode=mE.prototype.setSequenceMode;mE.prototype.parseInit=mE.prototype.parseInit;oe("text/srt",()=>new mE);function nE(a,b){var c=b.Fontname;c&&(a.fontFamily=c);if(c=b.Fontsize)a.fontSize=c+"px";if(c=b.PrimaryColour)if(c=oE(c))a.color=c;if(c=b.BackColour)if(c=oE(c))a.backgroundColor=c;b.Bold&&(a.fontWeight=Fd);b.Italic&&(a.fontStyle=Gd);b.Underline&&a.textDecoration.push(Hd);if(c=b.Spacing)a.letterSpacing=c+"px";if(c=b.Alignment)switch(parseInt(c,10)){case 1:a.displayAlign=Nd;a.textAlign="start";break;case 2:a.displayAlign=Nd;a.textAlign=Dd;break;case 3:a.displayAlign=Nd;a.textAlign="end";break;case 5:a.displayAlign=
"before";a.textAlign="start";break;case 6:a.displayAlign="before";a.textAlign=Dd;break;case 7:a.displayAlign="before";a.textAlign="end";break;case 9:a.displayAlign="center";a.textAlign="start";break;case 10:a.displayAlign="center";a.textAlign=Dd;break;case 11:a.displayAlign="center",a.textAlign="end"}if(b=b.AlphaLevel)a.opacity=parseFloat(b)}function oE(a){a=parseInt(a.replace("&H",""),16);return a>=0?"rgba("+(a&255)+","+(a>>8&255)+","+(a>>16&255)+","+(a>>24&255^255)/255+")":null}
function pE(a){a=qE.exec(a);return(a[1]?parseInt(a[1].replace(":",""),10):0)*3600+parseInt(a[2],10)*60+parseFloat(a[3])}
var uE=class{parseInit(){}setSequenceMode(){}setManifestType(){}parseMedia(a){var b="",c="",d=null,e=null;e=Eb(a).split(/\r?\n\s*\r?\n/);for(var f of e){e=f;if(a=rE.exec(f))d=a[1],e=a[2];d=="V4 Styles"||d=="V4+ Styles"?(b=e,b=c?b+("\n"+e):e):d=="Events"&&(c=c?c+("\n"+e):e)}d=[];f=null;b=b.split(/\r?\n/);for(var g of b){if(/^\s*;/.test(g))continue;if(e=sE.exec(g))if(b=e[1].trim(),e=e[2].trim(),b=="Format")f=e.split(tE);else if(b=="Style"){b=e.split(tE);e={};for(a=0;a<f.length&&a<b.length;a++)e[f[a]]=
b[a];d.push(e)}}g=[];f=null;c=c.split(/\r?\n/);for(const h of c){if(/^\s*;/.test(h))continue;if(b=sE.exec(h))if(c=b[1].trim(),b=b[2].trim(),c=="Format")f=b.split(tE);else if(c=="Dialogue"){b=b.split(tE);c={};for(e=0;e<f.length&&e<b.length;e++)c[f[e]]=b[e];e=pE(c.Start);a=pE(c.End);b=new ud(e,a,b.slice(f.length-1).join(",").replace(/\\N/g,"\n").replace(/\{[^}]+\}/g,""));const k=c.Style;(c=d.find(l=>l.Name==k))&&nE(b,c);g.push(b)}}return g}};v("shaka.text.SsaTextParser",uE);
uE.prototype.parseMedia=uE.prototype.parseMedia;uE.prototype.setManifestType=uE.prototype.setManifestType;uE.prototype.setSequenceMode=uE.prototype.setSequenceMode;uE.prototype.parseInit=uE.prototype.parseInit;var rE=/^\s*\[([^\]]+)\]\r?\n([\s\S]*)/,sE=/^\s*([^:]+):\s*(.*)/,tE=/\s*,\s*/,qE=/^(\d+:)?(\d{1,2}):(\d{1,2}(?:[.]\d{1,3})?)?$/;oe("text/x-ssa",()=>new uE);function vE(a,b){const c=a[b+1]&1?7:9;return b+c<=a.length&&(a=((a[b+3]&3)<<11|a[b+4]<<3|(a[b+5]&224)>>>5)-c,a>0)?{qd:c,ia:a}:null}function wE(a,b){const c=[96E3,88200,64E3,48E3,44100,32E3,24E3,22050,16E3,12E3,11025,8E3,7350],d=(a[b+2]&60)>>>2;if(d>c.length-1)return null;const e=((a[b+2]&192)>>>6)+1;let f=(a[b+2]&1)<<2;f|=(a[b+3]&192)>>>6;return{sampleRate:c[d],channelCount:f,codec:"mp4a.40."+e}}
function xE(a,b){if(b+1<a.length&&a[b]===255&&(a[b+1]&246)===240){const c=a[b+1]&1?7:9;if(b+c>=a.length)return!1;const d=(a[b+3]&3)<<11|a[b+4]<<3|(a[b+5]&224)>>>5;if(d<=c)return!1;b+=d;return b===a.length||b+1<a.length&&a[b]===255&&(a[b+1]&246)===240}return!1}
function yE(a,b){switch(a){case "mp4a.40.2":if(b===1)return new Uint8Array([0,200,0,128,35,128]);if(b===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(b===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(b===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(b===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(b===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,
2,0,178,0,32,8,224]);break;default:if(b===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(b===2||b===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null};var zE=Object.freeze({Bf:0,je:0,fe:0,Zd:0,$d:2,Cf:0}),AE=Object.freeze({Bf:0,je:0,fe:0,Zd:0,$d:2,Cf:0}),BE=Object.freeze({Bf:0,je:0,fe:0,Zd:0,$d:1,Cf:1});var CE=class{constructor(a){this.j=a;this.h=0;this.g=new Map;this.i=null}destroy(){this.g.clear()}isSupported(a){return a.toLowerCase().split(";")[0]=="audio/aac"?Dh(this.convertCodecs("audio",a)):!1}convertCodecs(a,b){return b.toLowerCase().split(";")[0]=="audio/aac"?`audio/mp4; codecs="${le(b)||"mp4a.40.2"}"`:b}getOriginalMimeType(){return this.j}transmux(a,b,c,d){var e=C(a),f=Xi(e);let g=f.length;for(;g<e.length&&!xE(e,g);g++);a=c.endTime*1E3;f=Wi(f);f.length&&c&&(f=f.find(k=>k.description==="com.apple.streaming.transportStreamTimestamp"))&&
(a=f.data);f=wE(e,g);if(!f)return Promise.reject(new F(2,3,3018,c?c.P()[0]:null));b.audioSamplingRate=f.sampleRate;b.channelsCount=f.channelCount;const h=[];for(;g<e.length;){const k=vE(e,g);if(!k)return Promise.reject(new F(2,3,3018,c?c.P()[0]:null));const l=k.qd+k.ia;g+l<=e.length&&h.push({data:e.subarray(g+k.qd,g+l),size:k.ia,duration:1024,cb:0,flags:zE});g+=l}e=f.sampleRate;a=Math.floor(a*e/1E3);d={id:b.id,type:"audio",codecs:f.codec,timescale:e,duration:d,mb:[],ya:new Uint8Array([]),Ma:new Uint8Array([]),
Sa:0,Ta:0,data:{sequenceNumber:this.h,baseMediaDecodeTime:a,ib:h},stream:b};d=new oi([d]);c=b.id+"_"+c.i;this.g.has(c)?b=this.g.get(c):(b=Sh(d),this.g.set(c,b));c=this.i!==b;d=ni(d);this.i=b;this.h++;return Promise.resolve({data:d,init:c?b:null})}};v("shaka.transmuxer.AacTransmuxer",CE);CE.prototype.transmux=CE.prototype.transmux;CE.prototype.getOriginalMimeType=CE.prototype.getOriginalMimeType;CE.prototype.convertCodecs=CE.prototype.convertCodecs;CE.prototype.isSupported=CE.prototype.isSupported;
CE.prototype.destroy=CE.prototype.destroy;Ud("audio/aac",()=>new CE("audio/aac"),$d);function DE(a,b,c){if(b+8>a.length||a[b]!==11||a[b+1]!==119)return!1;const d=a[b+4]>>6;if(d>=3)return!1;const e=a[b+4]&63,f=[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,
1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][e*3+d]*2;if(b+f>a.length)return!1;const g=a[b+6]>>5;var h=0;g===2?h+=2:(g&1&&g!==1&&(h+=2),g&4&&(h+=2));h=(a[b+6]<<8|a[b+7])>>12-h&1;const k=a[b+5]&7;a=new Uint8Array([d<<6|a[b+5]>>3<<1|k>>2,(k&3)<<6|g<<3|h<<2|e>>4,e<<4&224]);c.sampleRate=[48E3,44100,32E3][d];c.channelCount=[2,1,2,3,3,4,4,5][g]+h;c.ya=a;c.ia=f;return!0}
function EE(a,b){if(a[b]===11&&a[b+1]===119){let d=0,e=5;b+=e;let f;for(;e>0;){f=a[b];const g=Math.min(e,8),h=8-g;var c=4278190080>>>24+h<<h;c=(f&c)>>h;d=d?d<<g|c:c;b+=1;e-=g}if(d<16)return!0}return!1};var FE=class{constructor(a){this.j=a;this.h=0;this.g=new Map;this.i=null}destroy(){this.g.clear()}isSupported(a){return a.toLowerCase().split(";")[0]=="audio/ac3"?Dh(this.convertCodecs("audio",a)):!1}convertCodecs(a,b){return b.toLowerCase().split(";")[0]=="audio/ac3"?Fa().I()?'audio/mp4; codecs="ec-3"':'audio/mp4; codecs="ac-3"':b}getOriginalMimeType(){return this.j}transmux(a,b,c,d){a=C(a);var e=Xi(a);let f=e.length;for(;f<a.length&&!EE(a,f);f++);let g=c.endTime*1E3;e=Wi(e);e.length&&c&&(e=e.find(m=>
m.description==="com.apple.streaming.transportStreamTimestamp"))&&(g=e.data);e=0;let h=new Uint8Array([]);const k=[],l={sampleRate:0,channelCount:0,ya:new Uint8Array(0),ia:0};for(;f<a.length;){if(!DE(a,f,l))return Promise.reject(new F(2,3,3018,c?c.P()[0]:null));b.audioSamplingRate=l.sampleRate;b.channelsCount=l.channelCount;e=l.sampleRate;h=l.ya;k.push({data:a.subarray(f,f+l.ia),size:l.ia,duration:1536,cb:0,flags:zE});f+=l.ia}a=Math.floor(g*e/1E3);d={id:b.id,type:"audio",codecs:"ac-3",timescale:e,
duration:d,mb:[],ya:h,Ma:new Uint8Array([]),Sa:0,Ta:0,data:{sequenceNumber:this.h,baseMediaDecodeTime:a,ib:k},stream:b};d=new oi([d]);c=b.id+"_"+c.i;this.g.has(c)?b=this.g.get(c):(b=Sh(d),this.g.set(c,b));c=this.i!==b;d=ni(d);this.i=b;this.h++;return Promise.resolve({data:d,init:c?b:null})}};v("shaka.transmuxer.Ac3Transmuxer",FE);FE.prototype.transmux=FE.prototype.transmux;FE.prototype.getOriginalMimeType=FE.prototype.getOriginalMimeType;FE.prototype.convertCodecs=FE.prototype.convertCodecs;
FE.prototype.isSupported=FE.prototype.isSupported;FE.prototype.destroy=FE.prototype.destroy;Ud("audio/ac3",()=>new FE("audio/ac3"),$d);function GE(a,b,c){if(b+8>a.length||(a[b]<<8|a[b+1]<<0)!==2935)return!1;var d=new lj(a.subarray(b+2));bj(d,2);bj(d,3);const e=cj(d,11)+1<<1;var f=cj(d,2);let g;f==3?(f=cj(d,2),f=[24E3,22060,16E3][f],g=3):(f=[48E3,44100,32E3][f],g=cj(d,2));const h=cj(d,3),k=cj(d,1);d=cj(d,5);if(b+e>a.byteLength)return!1;a=Math.floor(e*f/([1,2,3,6][g]*16));a=new Uint8Array([(a&8160)>>5,(a&31)<<3,f<<6|d<<1|0,0|h<<1|k<<0,0]);c.sampleRate=f;c.channelCount=[2,1,2,3,3,4,4,5][h]+k;c.ya=a;c.ia=e;return!0};var HE=class{constructor(a){this.j=a;this.h=0;this.g=new Map;this.i=null}destroy(){this.g.clear()}isSupported(a){return a.toLowerCase().split(";")[0]=="audio/ec3"?Dh(this.convertCodecs("audio",a)):!1}convertCodecs(a,b){return b.toLowerCase().split(";")[0]=="audio/ec3"?'audio/mp4; codecs="ec-3"':b}getOriginalMimeType(){return this.j}transmux(a,b,c,d){a=C(a);var e=Xi(a);let f=e.length;for(;f<a.length&&(a[f]<<8|a[f+1]<<0)!==2935;f++);let g=c.endTime*1E3;e=Wi(e);e.length&&c&&(e=e.find(m=>m.description===
"com.apple.streaming.transportStreamTimestamp"))&&(g=e.data);e=0;let h=new Uint8Array([]);const k=[],l={sampleRate:0,channelCount:0,ya:new Uint8Array(0),ia:0};for(;f<a.length;){if(!GE(a,f,l))return Promise.reject(new F(2,3,3018,c?c.P()[0]:null));b.audioSamplingRate=l.sampleRate;b.channelsCount=l.channelCount;e=l.sampleRate;h=l.ya;k.push({data:a.subarray(f,f+l.ia),size:l.ia,duration:1536,cb:0,flags:zE});f+=l.ia}a=Math.floor(g*e/1E3);d={id:b.id,type:"audio",codecs:"ec-3",timescale:e,duration:d,mb:[],
ya:h,Ma:new Uint8Array([]),Sa:0,Ta:0,data:{sequenceNumber:this.h,baseMediaDecodeTime:a,ib:k},stream:b};d=new oi([d]);c=b.id+"_"+c.i;this.g.has(c)?b=this.g.get(c):(b=Sh(d),this.g.set(c,b));c=this.i!==b;d=ni(d);this.i=b;this.h++;return Promise.resolve({data:d,init:c?b:null})}};v("shaka.transmuxer.Ec3Transmuxer",HE);HE.prototype.transmux=HE.prototype.transmux;HE.prototype.getOriginalMimeType=HE.prototype.getOriginalMimeType;HE.prototype.convertCodecs=HE.prototype.convertCodecs;
HE.prototype.isSupported=HE.prototype.isSupported;HE.prototype.destroy=HE.prototype.destroy;Ud("audio/ec3",()=>new HE("audio/ec3"),$d);function IE(a){if(!a.length)return null;var b=a.find(p=>p.type==7);a=a.find(p=>p.type==8);if(!b||!a)return null;var c=new lj(b.data),d=ij(c);ij(c);ij(c);ej(c);if(JE.includes(d)&&(d=O(c),d===3&&bj(c,1),ej(c),ej(c),bj(c,1),P(c))){d=d!==3?8:12;for(var e=0;e<d;e++)P(c)&&(e<6?jj(c,16):jj(c,64))}ej(c);d=O(c);if(d===0)O(c);else if(d===1)for(bj(c,1),ej(c),ej(c),d=O(c),e=0;e<d;e++)ej(c);ej(c);bj(c,1);var f=O(c),g=O(c),h=cj(c,1);h===0&&bj(c,1);bj(c,1);var k=0,l=0;let m=0,n=0;P(c)&&(k=O(c),l=O(c),m=O(c),n=O(c));
e=d=1;if(P(c)&&P(c)){const p=ij(c),r=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],q=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];p>0&&p<=16?(d=r[p-1],e=q[p-1]):p===255&&(d=cj(c,16),e=cj(c,16))}c=(2-h)*(g+1)*16-m*2-n*2;f=(f+1)*16-k*2-l*2;b=b.fullData;k=b.byteLength;a=a.fullData;l=a.byteLength;g=0;h=new Uint8Array(11+k+l);h[g++]=1;h[g++]=b[1];h[g++]=b[2];h[g++]=b[3];h[g++]=255;h[g++]=225;h[g++]=k>>>8&255;h[g++]=k&255;h.set(b,g);g+=k;h[g++]=1;h[g++]=l>>>8&255;h[g++]=l&255;h.set(a,g);return{height:c,
width:f,Ma:h,Sa:d,Ta:e}}
function KE(a){const b=[];let c=null,d=!1;const e=()=>{if(c&&c.nalus.length&&c.frame){var l=c.nalus.length*4;for(var m of c.nalus)l+=m.fullData.byteLength;l=new Uint8Array(l);m=0;for(const n of c.nalus){const p=n.fullData.byteLength;l[m]=p>>24&255;l[m+1]=p>>16&255;l[m+2]=p>>8&255;l[m+3]=p&255;l.set(n.fullData,m+4);m+=4+p}c.data=l;b.push(c)}},f=new Uint8Array(0),g=l=>{c={data:f,frame:!1,isKeyframe:!1,pts:l.pts,dts:l.dts,nalus:[]}};for(let l=0;l<a.length;l++){const m=a[l];var h=m.nalus;let n=!1;c&&
h.length&&!d&&(e(),g(m));for(const p of m.nalus){h=!1;switch(p.type){case 1:let r=!1;h=!0;var k=p.data;n&&k.length>4&&(k=kj(new lj(k)),k===2||k===4||k===7||k===9)&&(r=!0);r&&c&&c.frame&&!c.isKeyframe&&(e(),c=null);c||g(m);c.frame=!0;c.isKeyframe=r;break;case 5:h=!0;c&&c.frame&&!c.isKeyframe&&(e(),c=null);c||g(m);c.frame=!0;c.isKeyframe=!0;break;case 6:h=!0;break;case 7:n=h=!0;break;case 8:h=!0;break;case 9:d=h=!0;c&&c.frame&&(e(),c=null);c||g(m);break;case 12:h=!0;break;default:h=!1}c&&h&&c.nalus.push(p)}}e();
return b}var JE=[100,110,122,244,44,83,86,118,128,138,139,134];function LE(a){if(!a.length)return null;var b=a.find(g=>g.type==32);const c=a.find(g=>g.type==33),d=a.find(g=>g.type==34);if(!b||!c||!d)return null;const e=ME(b.fullData);a=NE(c.fullData);const f=OE(d.fullData);b=PE(b.fullData,c.fullData,d.fullData,{Gf:e.Gf,cg:e.cg,rf:a.rf,tf:a.tf,kf:a.kf,qf:a.qf,lf:a.lf,mf:a.mf,nf:a.nf,pf:a.pf,cf:a.cf,df:a.df,ef:a.ef,gf:a.gf,hf:a.hf,jf:a.jf,se:a.se,Te:a.Te,Se:a.Se,Re:a.Re,If:f.If,bf:a.bf,$e:a.$e});return{height:a.height,width:a.width,Ma:b,Sa:a.Qi,Ta:a.Pi}}
function ME(a){var b=new lj(a,!0);ij(b);ij(b);cj(b,4);cj(b,2);cj(b,6);a=cj(b,3);b=P(b);return{Gf:a+1,cg:b}}
function NE(a){a=new lj(a,!0);ij(a);ij(a);let b=0,c=0,d=0,e=0;cj(a,4);const f=cj(a,3);P(a);const g=cj(a,2),h=cj(a,1),k=cj(a,5),l=ij(a),m=ij(a),n=ij(a),p=ij(a),r=ij(a),q=ij(a),t=ij(a),u=ij(a),x=ij(a),y=ij(a),w=ij(a);var z=[],A=[];for(var B=0;B<f;B++)z.push(P(a)),A.push(P(a));if(f>0)for(B=f;B<8;B++)cj(a,2);for(B=0;B<f;B++)z[B]&&cj(a,88),A[B]&&ij(a);O(a);z=O(a);z==3&&cj(a,1);A=O(a);B=O(a);P(a)&&(b+=O(a),c+=O(a),d+=O(a),e+=O(a));const D=O(a),E=O(a);var Z=O(a);if(P(a))for(var J=0;J<=f;J++)O(a),O(a),O(a);
else O(a),O(a),O(a);O(a);O(a);O(a);O(a);O(a);O(a);if(P(a)&&P(a))for(J=0;J<4;J++)for(var K=0;K<(J===3?2:6);K++)if(P(a)){var ba=Math.min(64,1<<4+(J<<1));J>1&&hj(a);for(var I=0;I<ba;I++)hj(a)}else O(a);P(a);P(a);P(a)&&(ij(a),O(a),O(a),P(a));J=O(a);K=0;for(ba=0;ba<J;ba++)if(I=!1,ba!==0&&(I=P(a)),I){ba===J&&O(a);P(a);O(a);I=0;for(var aa=0;aa<=K;aa++){var N=P(a),ra=!1;N||(ra=P(a));(N||ra)&&I++}K=I}else{aa=O(a);I=O(a);K=aa+I;for(N=0;N<aa;N++)O(a),P(a);for(aa=0;aa<I;aa++)O(a),P(a)}if(P(a))for(J=O(a),K=0;K<
J;K++){for(ba=0;ba<Z+4;ba++)cj(a,1);cj(a,1)}J=Z=1;K=!0;ba=1;aa=I=0;P(a);P(a);if(P(a)){if(P(a)){N=ij(a);ra=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2];var Ka=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];N>0&&N<=16?(Z=ra[N-1],J=Ka[N-1]):N===255&&(Z=cj(a,16),J=cj(a,16))}P(a)&&P(a);P(a)&&(cj(a,3),P(a),P(a)&&(ij(a),ij(a),ij(a)));P(a)&&(O(a),O(a));P(a);P(a);P(a);if(N=P(a))ej(a),ej(a),ej(a),ej(a);if(P(a)&&(ba=cj(a,32),I=cj(a,32),P(a)&&O(a),P(a))){Ka=!1;N=P(a);ra=P(a);if(N||ra){if(Ka=P(a))ij(a),cj(a,
5),P(a),cj(a,5);cj(a,4);cj(a,4);Ka&&cj(a,4);cj(a,5);cj(a,5);cj(a,5)}for(let pb=0;pb<=f;pb++){K=P(a);var Oa=!0;let hb=1;K||(Oa=P(a));let Tb=!1;Oa?O(a):Tb=P(a);Tb||(hb=O(a)+1);if(N){for(Oa=0;Oa<hb;Oa++)O(a),O(a),Ka&&(O(a),O(a));P(a)}if(ra){for(Oa=0;Oa<hb;Oa++)O(a),O(a),Ka&&(O(a),O(a));P(a)}}}P(a)&&(P(a),P(a),P(a),aa=O(a),O(a),O(a),O(a),O(a))}return{kf:w,rf:g,tf:h,qf:k,lf:l,mf:m,nf:n,pf:p,cf:r,df:q,ef:t,gf:u,hf:x,jf:y,se:aa,Te:z,Se:D,Re:E,width:A-(b+c)*(z===1||z===2?2:1),height:B-(d+e)*(z===1?2:1),Qi:Z,
Pi:J,bf:I/ba,$e:K}}function OE(a){var b=new lj(a,!0);ij(b);ij(b);O(b);O(b);P(b);P(b);cj(b,3);P(b);P(b);O(b);O(b);hj(b);P(b);P(b);P(b)&&O(b);hj(b);hj(b);P(b);P(b);P(b);P(b);a=P(b);b=P(b);let c=1;b&&a?c=0:b?c=3:a&&(c=2);return{If:c}}
function PE(a,b,c,d){const e=new Uint8Array(23+(5+a.byteLength)+(5+b.byteLength)+(5+c.byteLength));e[0]=1;e[1]=(d.rf&3)<<6|(d.tf?1:0)<<5|d.qf&31;e[2]=d.lf;e[3]=d.mf;e[4]=d.nf;e[5]=d.pf;e[6]=d.cf;e[7]=d.df;e[8]=d.ef;e[9]=d.gf;e[10]=d.hf;e[11]=d.jf;e[12]=d.kf;e[13]=240|(d.se&3840)>>8;e[14]=d.se&255;e[15]=252|d.If&3;e[16]=252|d.Te&3;e[17]=248|d.Se&7;e[18]=248|d.Re&7;e[19]=0;e[20]=parseInt(d.bf,10);e[21]=((d.$e?1:0)&3)<<6|(d.Gf&7)<<3|(d.cg?1:0)<<2|3;e[22]=3;a=[a,b,c];b=23;c=a.length-1;for(d=0;d<a.length;d+=
1)e.set(new Uint8Array([32+d|(d===c?128:0),0,1,a[d].byteLength>>8,a[d].byteLength&255]),b),b+=5,e.set(a[d],b),b+=a[d].byteLength;return e};function QE(a,b){var c=a[b+1]>>3&3;const d=a[b+1]>>1&3;var e=a[b+2]>>4&15,f=a[b+2]>>2&3;if(c!==1&&e!==0&&e!==15&&f!==3){const h=a[b+3]>>6;e=RE[(c===3?3-d:d===3?3:4)*14+e-1]*1E3;f=SE[(c===3?0:c===2?1:2)*3+f];c=TE[c][d];const k=UE[d],l=Math.floor(c*e/f+(a[b+2]>>1&1))*k;var g=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);(g=g?parseInt(g[1],10):0)&&g<=87&&d===2&&e>=224E3&&h===0&&(a[b+3]|=128);return{sampleRate:f,channelCount:h===3?1:2,ia:l,Oi:c*8*k}}return null}
function VE(a,b){return a[b]===255&&(a[b+1]&224)===224&&(a[b+1]&6)!==0}function WE(a,b){if(b+1<a.length&&VE(a,b)){const c=QE(a,b);let d=4;c&&c.ia&&(d=c.ia);b+=d;return b===a.length||b+1<a.length&&VE(a,b)}return!1}
var RE=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],SE=[44100,48E3,32E3,22050,24E3,16E3,11025,12E3,8E3],TE=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],UE=[0,1,1,4];var XE=class{constructor(a){this.j=a;this.h=0;this.g=new Map;this.i=null}destroy(){this.g.clear()}isSupported(a){return a.toLowerCase().split(";")[0]=="audio/mpeg"?Dh(this.convertCodecs("audio",a)):!1}convertCodecs(a,b){return b.toLowerCase().split(";")[0]=="audio/mpeg"?'audio/mp4; codecs="mp3"':b}getOriginalMimeType(){return this.j}transmux(a,b,c,d){var e=C(a);let f=Xi(e).length;for(;f<e.length&&!WE(e,f);f++);let g;for(a=[];f<e.length;){const h=QE(e,f);if(!h)return Promise.reject(new F(2,3,3018,
c?c.P()[0]:null));g||=h;f+h.ia<=e.length&&a.push({data:e.subarray(f,f+h.ia),size:h.ia,duration:1152,cb:0,flags:zE});f+=h.ia}if(!g)return Promise.reject(new F(2,3,3018,c?c.P()[0]:null));e=g.Oi*9E4/g.sampleRate*this.h;d={id:b.id,type:"audio",codecs:"mp3",timescale:g.sampleRate,duration:d,mb:[],ya:new Uint8Array([]),Ma:new Uint8Array([]),Sa:0,Ta:0,data:{sequenceNumber:this.h,baseMediaDecodeTime:e,ib:a},stream:b};d=new oi([d]);c=b.id+"_"+c.i;this.g.has(c)?b=this.g.get(c):(b=Sh(d),this.g.set(c,b));c=this.i!==
b;d=ni(d);this.i=b;this.h++;return Promise.resolve({data:d,init:c?b:null})}};v("shaka.transmuxer.Mp3Transmuxer",XE);XE.prototype.transmux=XE.prototype.transmux;XE.prototype.getOriginalMimeType=XE.prototype.getOriginalMimeType;XE.prototype.convertCodecs=XE.prototype.convertCodecs;XE.prototype.isSupported=XE.prototype.isSupported;XE.prototype.destroy=XE.prototype.destroy;Ud("audio/mpeg",()=>new XE("audio/mpeg"),$d);var YE=class{constructor(a){this.h=a;this.g=null}destroy(){}isSupported(a){if(a.toLowerCase().split(";")[0]!="video/mp2t")return!1;var b=le(a).split(",");const c=Zb("audio",b);b=Zb("video",b);return!c||b||ge(c)!="mp3"?!1:Dh(this.convertCodecs("audio",a))}convertCodecs(a,b){return b.toLowerCase().split(";")[0]=="video/mp2t"?"audio/mpeg":b}getOriginalMimeType(){return this.h}transmux(a,b,c,d,e){this.g?this.g.clearData():this.g=new vj;this.g.Fe(c.i);a=C(a);a=this.g.parse(a);if(a.ld().audio!="mp3"||e!=
"audio")return Promise.reject(new F(2,3,3018,c?c.P()[0]:null));c=new Uint8Array([]);for(const f of a.gb()){e=f.data;if(!e)continue;for(a=0;a<e.length;)(b=QE(e,a))?(a+b.ia<=e.length&&(c=Rb(c,e.subarray(a,a+b.ia))),a+=b.ia):a++}return Promise.resolve(c)}};v("shaka.transmuxer.MpegTsTransmuxer",YE);YE.prototype.transmux=YE.prototype.transmux;YE.prototype.getOriginalMimeType=YE.prototype.getOriginalMimeType;YE.prototype.convertCodecs=YE.prototype.convertCodecs;YE.prototype.isSupported=YE.prototype.isSupported;
YE.prototype.destroy=YE.prototype.destroy;Ud("video/mp2t",()=>new YE("video/mp2t"),Zd);/*
 @license
 MSS Transmuxer
 Copyright 2015 Dash Industry Forum
 SPDX-License-Identifier: BSD-3-Clause
*/
function ZE(a){function b(){this._procFullBox();this.flags&1&&(this._procField("AlgorithmID","uint",24),this._procField("IV_size","uint",8),this._procFieldArray("KID",16,"uint",8));this._procField("sample_count","uint",32);this._procEntries("entry",this.sample_count,function(c){this._procEntryField(c,"InitializationVector","data",8);this.flags&2&&(this._procEntryField(c,"NumberOfEntries","uint",16),this._procSubEntries(c,"clearAndCryptedData",c.NumberOfEntries,function(d){this._procEntryField(d,"BytesOfClearData",
"uint",16);this._procEntryField(d,"BytesOfEncryptedData","uint",32)}))})}a.g.addBoxProcessor("saio",function(){this._procFullBox();this.flags&1&&(this._procField("aux_info_type","uint",32),this._procField("aux_info_type_parameter","uint",32));this._procField("entry_count","uint",32);this._procFieldArray("offset",this.entry_count,"uint",this.version===1?64:32)});a.g.addBoxProcessor("saiz",function(){this._procFullBox();this.flags&1&&(this._procField("aux_info_type","uint",32),this._procField("aux_info_type_parameter",
"uint",32));this._procField("default_sample_info_size","uint",8);this._procField("sample_count","uint",32);this.default_sample_info_size===0&&this._procFieldArray("sample_info_size",this.sample_count,"uint",8)});a.g.addBoxProcessor("senc",b);a.g.addBoxProcessor("uuid",function(){let c=!0;for(let d=0;d<16;d++)this.usertype[d]!==$E[d]&&(c=!1);c&&(this._parsing&&(this.type="sepiff"),b.call(this))})}
function aF(a,b){let c=8;for(let d=0;d<a.boxes.length&&a.boxes[d].type!==b;d++)c+=a.boxes[d].size;return c}
var bF=class{constructor(a){this.h=a;(this.g=bx.get("ISOBoxer")())&&ZE(this)}destroy(){}isSupported(a,b){const c=a.startsWith("mss/");if(!this.g||!c)return!1;if(b)return Dh(this.convertCodecs(b,a));b=this.convertCodecs("audio",a);a=this.convertCodecs("video",a);return Dh(b)||Dh(a)}convertCodecs(a,b){return b.replace("mss/","")}getOriginalMimeType(){return this.h}transmux(a,b,c){if(!c)return Promise.resolve(C(a));if(!b.mssPrivateData)return Promise.reject(new F(2,3,3020,c?c.P()[0]:null));try{let e;
const f=this.g.parseBuffer(a),g=f.fetch("tfhd");g.track_ID=b.id+1;let h=f.fetch("tfdt");const k=f.fetch("traf");h===null&&(h=this.g.createFullBox("tfdt",k,g),h.version=1,h.flags=0,h.baseMediaDecodeTime=Math.floor(c.startTime*b.mssPrivateData.timescale));const l=f.fetch("trun");let m=f.fetch("tfxd");m&&m._parent.boxes.splice(m._parent.boxes.indexOf(m),1);let n=f.fetch("tfrf");n&&n._parent.boxes.splice(n._parent.boxes.indexOf(n),1);const p=f.fetch("sepiff");if(p!==null){p.type="senc";p.usertype=void 0;
let t=f.fetch("saio");if(t===null){t=this.g.createFullBox("saio",k);t.version=0;t.flags=0;t.entry_count=1;t.offset=[0];const u=this.g.createFullBox("saiz",k);u.version=0;u.flags=0;u.sample_count=p.sample_count;u.default_sample_info_size=0;u.sample_info_size=[];if(p.flags&2)for(e=0;e<p.sample_count;e+=1)u.sample_info_size[e]=10+6*p.entry[e].NumberOfEntries;else u.default_sample_info_size=8}}g.flags&=16777214;g.flags|=131072;l.flags|=1;const r=f.fetch("moof");l.data_offset=r.getLength()+8;const q=f.fetch("saio");
q!==null&&(q.offset[0]=aF(r,"traf")+aF(k,"senc")+16);var d=C(f.write());return Promise.resolve(d)}catch(e){return e instanceof F?Promise.reject(e):Promise.reject(new F(2,3,3022,c?c.P()[0]:null))}}};v("shaka.transmuxer.MssTransmuxer",bF);bF.prototype.transmux=bF.prototype.transmux;bF.prototype.getOriginalMimeType=bF.prototype.getOriginalMimeType;bF.prototype.convertCodecs=bF.prototype.convertCodecs;bF.prototype.isSupported=bF.prototype.isSupported;bF.prototype.destroy=bF.prototype.destroy;
var $E=new Uint8Array([162,57,79,82,90,155,79,20,162,68,108,66,124,100,141,244]);Ud("mss/audio/mp4",()=>new bF("mss/audio/mp4"),$d);Ud("mss/video/mp4",()=>new bF("mss/video/mp4"),$d);function cF(a){if(a.length<1)return 960;var b=a[0];const c=b&3;b=dF[b>>3&31];if(c===0)a=1;else if(c===1||c===2)a=2;else{if(a.length<2)return b;a=a[1]&63;if(a===0)return b}return b*a}var dF=[480,960,1920,2880,480,960,1920,2880,480,960,1920,2880,480,960,480,960,120,240,480,960,120,240,480,960,120,240,480,960,120,240,480,960];var gF=class{constructor(a){this.m=a;this.g=0;this.j=new Map;this.l=this.i=this.h=null}destroy(){this.j.clear();this.i&&this.i.destroy()}isSupported(a,b){if(a.toLowerCase().split(";")[0]!="video/mp2t")return!1;var c=a;b&&(c=this.convertCodecs(b,a));var d=le(c).split(",");c=Zb("audio",d);d=Zb("video",d);if(c&&(c=ge(c),!eF.includes(c))||d&&(c=ge(d),!fF.includes(c)))return!1;if(b)return Dh(this.convertCodecs(b,a));b=this.convertCodecs("audio",a);a=this.convertCodecs("video",a);return Dh(b)||Dh(a)}convertCodecs(a,
b){return b.toLowerCase().split(";")[0]=="video/mp2t"?(b=le(b).replace("mp4a.40.34","mp3").split(",").map(c=>kf(c,"audio/mp4")).map(lf).join(","),a=="audio"?`audio/mp4; codecs="${b}"`:`video/mp4; codecs="${b}"`):b}getOriginalMimeType(){return this.m}transmux(a,b,c,d,e){const f=C(a);if(e=="audio"&&!nj(f)){const y=Xi(f);let w=y.length;for(;w<f.length;w++)if(WE(f,w))return Promise.reject(new F(2,3,3018,c?c.P()[0]:null));for(w=y.length;w<f.length;w++)if(xE(f,w))return this.i||(this.i=new CE("audio/aac")),
this.i.transmux(a,b,c,d,e);return Promise.reject(new F(2,3,3018,c?c.P()[0]:null))}this.h?this.h.clearData():this.h=new vj;this.h.Fe(c.i);const g=this.h.parse(f),h=[],k=g.ld();try{let y=null;if(e=="video"){switch(k.video){case "avc":const w=[];let z=null;const A=g.Nc(),B=KE(A);if(!B.length)throw new F(2,3,3023,c?c.P()[0]:null);for(let aa=0;aa<B.length;aa++){const N=B[aa];z==null&&(z=N.dts);w.push({data:N.data,size:N.data.byteLength,duration:aa+1<B.length?(B[aa+1].dts||0)-(N.dts||0):B.length>1?(N.dts||
0)-(B[aa-1].dts||0):(c.endTime-c.startTime)*9E4,cb:Math.round((N.pts||0)-(N.dts||0)),flags:N.isKeyframe?AE:BE})}const D=[];for(const aa of A)D.push(...aa.nalus);const E=IE(D);if(!E||z==null)throw new F(2,3,3018,c?c.P()[0]:null);b.height=b.height||E.height;b.width=b.width||E.width;y={id:b.id,type:"video",codecs:"avc1",timescale:9E4,duration:d,mb:[],ya:new Uint8Array([]),Ma:E.Ma,Sa:E.Sa,Ta:E.Ta,data:{sequenceNumber:this.g,baseMediaDecodeTime:z,ib:w},stream:b};break;case "hvc":const Z=[];let J=null;
const K=[],ba=g.Nc();var l=new Uint8Array(0),m=!1;if(!ba.length)throw new F(2,3,3023,c?c.P()[0]:null);for(let aa=0;aa<ba.length;aa++){const N=ba[aa],ra=N.nalus;K.push(...ra);a:{let Ka=!1;const Oa=[];let pb=0,hb=!1;for(const Nc of ra){let rb;switch(Nc.type){case 1:case 0:rb=hb=!0;break;case 19:case 20:case 21:Ka=rb=hb=!0;break;case 32:case 33:case 34:rb=!0;break;case 35:hb=rb=!0;break;case 39:case 40:rb=!0;break;default:rb=!1}hb&&rb&&(Oa.push(Nc.fullData),pb+=Nc.fullData.byteLength)}if(!Oa.length){var n=
!1;break a}pb+=4*Oa.length;const Tb=new Uint8Array(pb);let jd=0;for(const Nc of Oa){const rb=Nc.byteLength;Tb[jd]=rb>>24&255;Tb[jd+1]=rb>>16&255;Tb[jd+2]=rb>>8&255;Tb[jd+3]=rb&255;Tb.set(Nc,jd+4);jd+=rb+4}l=Tb;m=Ka;n=!0}n&&(J==null&&N.dts!=null&&(J=N.dts),Z.push({data:l,size:l.byteLength,duration:aa+1<ba.length?(ba[aa+1].dts||0)-(N.dts||0):ba.length>1?(N.dts||0)-(ba[aa-1].dts||0):(c.endTime-c.startTime)*9E4,cb:Math.round((N.pts||0)-(N.dts||0)),flags:m?AE:BE}))}const I=LE(K);if(!I||J==null)throw new F(2,
3,3018,c?c.P()[0]:null);b.height=b.height||I.height;b.width=b.width||I.width;y={id:b.id,type:"video",codecs:"hvc1",timescale:9E4,duration:d,mb:[],ya:new Uint8Array([]),Ma:I.Ma,Sa:I.Sa,Ta:I.Ta,data:{sequenceNumber:this.g,baseMediaDecodeTime:J,ib:Z},stream:b}}y&&(h.push(y),y=null)}if(e=="audio"){switch(k.audio){case "aac":const w=[];let z,A=null,B=null,D=null;for(const Pa of g.gb()){let va=Pa.data;if(!va)continue;let ka=0;if(B==-1&&D)va=Rb(D,Pa.data),B=null;else if(B!=null&&D){ka=Math.max(0,B);const Xa=
Rb(D,va.subarray(0,ka));w.push({data:Xa,size:Xa.byteLength,duration:1024,cb:0,flags:zE});B=D=null}z=wE(va,ka);if(!z)throw new F(2,3,3018,c?c.P()[0]:null);b.audioSamplingRate=z.sampleRate;b.channelsCount=z.channelCount;A==null&&Pa.pts!==null&&(A=Pa.pts);for(;ka<va.length;){const Xa=vE(va,ka);if(!Xa){D=va.subarray(ka,va.length);B=-1;break}const je=Xa.qd+Xa.ia;B=Math.max(0,ka+je-va.length);B!=0?D=va.subarray(ka+Xa.qd,ka+je):ka+je<=va.length&&w.push({data:va.subarray(ka+Xa.qd,ka+je),size:Xa.ia,duration:1024,
cb:0,flags:zE});ka+=je}}if(!z||A==null){A=c.startTime*9E4;const Pa=Zb("audio",b.codecs.split(","));if(!Pa||!b.channelsCount||!b.audioSamplingRate)throw new F(2,3,3018,c?c.P()[0]:null);z={sampleRate:b.audioSamplingRate,channelCount:b.channelsCount,codec:Pa};const va=yE(Pa,b.channelsCount);if(!va)throw new F(2,3,3018,c?c.P()[0]:null);const ka=A+(c.endTime-c.startTime)*9E4;let Xa=A;for(;Xa<ka;)w.push({data:va,size:va.byteLength,duration:1024,cb:0,flags:zE}),Xa+=1024/z.sampleRate*9E4}const E=z.sampleRate,
Z=A/9E4*E;y={id:b.id,type:"audio",codecs:z.codec,timescale:E,duration:d,mb:[],ya:new Uint8Array([]),Ma:new Uint8Array([]),Sa:0,Ta:0,data:{sequenceNumber:this.g,baseMediaDecodeTime:Z,ib:w},stream:b};break;case "ac3":const J=[];let K=0,ba=new Uint8Array([]),I=null;const aa={sampleRate:0,channelCount:0,ya:new Uint8Array(0),ia:0};for(const Pa of g.gb()){const va=Pa.data;I==null&&Pa.pts!==null&&(I=Pa.pts);let ka=0;for(;ka<va.length;)DE(va,ka,aa)?(b.audioSamplingRate=aa.sampleRate,b.channelsCount=aa.channelCount,
K=aa.sampleRate,ba=aa.ya,J.push({data:va.subarray(ka,ka+aa.ia),size:aa.ia,duration:1536,cb:0,flags:zE}),ka+=aa.ia):ka++}if(K==0||ba.byteLength==0||I==null)throw new F(2,3,3018,c?c.P()[0]:null);const N=I/9E4*K;y={id:b.id,type:"audio",codecs:"ac-3",timescale:K,duration:d,mb:[],ya:ba,Ma:new Uint8Array([]),Sa:0,Ta:0,data:{sequenceNumber:this.g,baseMediaDecodeTime:N,ib:J},stream:b};break;case "ec3":const ra=[];let Ka=0,Oa=new Uint8Array([]),pb=null;const hb={sampleRate:0,channelCount:0,ya:new Uint8Array(0),
ia:0};for(const Pa of g.gb()){const va=Pa.data;pb==null&&Pa.pts!==null&&(pb=Pa.pts);let ka=0;for(;ka<va.length;)GE(va,ka,hb)?(b.audioSamplingRate=hb.sampleRate,b.channelsCount=hb.channelCount,Ka=hb.sampleRate,Oa=hb.ya,ra.push({data:va.subarray(ka,ka+hb.ia),size:hb.ia,duration:1536,cb:0,flags:zE}),ka+=hb.ia):ka++}if(Ka==0||Oa.byteLength==0||pb==null)throw new F(2,3,3018,c?c.P()[0]:null);const Tb=pb/9E4*Ka;y={id:b.id,type:"audio",codecs:"ec-3",timescale:Ka,duration:d,mb:[],ya:Oa,Ma:new Uint8Array([]),
Sa:0,Ta:0,data:{sequenceNumber:this.g,baseMediaDecodeTime:Tb,ib:ra},stream:b};break;case "mp3":const jd=[];let Nc,rb=null;for(const Pa of g.gb()){const va=Pa.data;if(!va)continue;rb==null&&Pa.pts!==null&&(rb=Pa.pts);let ka=0;for(;ka<va.length;){const Xa=QE(va,ka);Xa?(Nc||=Xa,ka+Xa.ia<=va.length&&jd.push({data:va.subarray(ka,ka+Xa.ia),size:Xa.ia,duration:1152,cb:0,flags:zE}),ka+=Xa.ia):ka++}}if(!Nc||rb==null)throw new F(2,3,3018,c?c.P()[0]:null);const Pu=Nc.sampleRate,hF=rb/9E4*Pu;y={id:b.id,type:"audio",
codecs:"mp3",timescale:Pu,duration:d,mb:[],ya:new Uint8Array([]),Ma:new Uint8Array([]),Sa:0,Ta:0,data:{sequenceNumber:this.g,baseMediaDecodeTime:hF,ib:jd},stream:b};break;case "opus":const Qu=[];let fj=null;const Oc=g.J;if(!Oc)throw new F(2,3,3018,c?c.P()[0]:null);let yb=[];switch(Oc.nh){case 1:case 2:yb=[0];break;case 0:yb=[255,1,1,0,1];break;case 128:yb=[255,2,0,0,1];break;case 3:yb=[1,2,1,0,2,1];break;case 4:yb=[1,2,2,0,1,2,3];break;case 5:yb=[1,3,2,0,4,1,2,3];break;case 6:yb=[1,4,2,0,4,1,2,3,
5];break;case 7:yb=[1,4,2,0,4,1,2,3,5,6];break;case 8:yb=[1,5,3,0,6,1,2,3,4,5,7];break;case 130:yb=[1,1,2,0,1];break;case 131:yb=[1,1,3,0,1,2];break;case 132:yb=[1,1,4,0,1,2,3];break;case 133:yb=[1,1,5,0,1,2,3,4];break;case 134:yb=[1,1,6,0,1,2,3,4,5];break;case 135:yb=[1,1,7,0,1,2,3,4,5,6];break;case 136:yb=[1,1,8,0,1,2,3,4,5,6,7]}var p=new Uint8Array([0,Oc.channelCount,0,0,Oc.sampleRate>>>24&255,Oc.sampleRate>>>17&255,Oc.sampleRate>>>8&255,Oc.sampleRate>>>0&255,0,0,...yb]);const Ru=Oc.sampleRate;
for(const Pa of g.gb()){const va=Pa.data;fj==null&&Pa.pts!==null&&(fj=Pa.pts);let ka=0;for(;ka<va.length;){const Xa=(va[ka+1]&16)!==0,je=(va[ka+1]&8)!==0;let kd=ka+2,gj=0;for(;va[kd]===255;)gj+=255,kd+=1;gj+=va[kd];kd+=1;kd+=Xa?2:0;kd+=je?2:0;const Dm=va.slice(kd,kd+gj);Qu.push({data:Dm,size:Dm.byteLength,duration:cF(Dm),cb:0,flags:zE});ka=kd+gj}}if(p.byteLength==0||fj==null)throw new F(2,3,3018,c?c.P()[0]:null);b.audioSamplingRate=Oc.sampleRate;b.channelsCount=Oc.channelCount;const iF=fj/9E4*Ru;
y={id:b.id,type:"audio",codecs:"opus",timescale:Ru,duration:d,mb:[],ya:p,Ma:new Uint8Array([]),Sa:0,Ta:0,data:{sequenceNumber:this.g,baseMediaDecodeTime:iF,ib:Qu},stream:b}}y&&h.push(y)}}catch(y){return y&&y.code==3023?Promise.resolve(new Uint8Array([])):Promise.reject(y)}if(!h.length)return Promise.reject(new F(2,3,3018,c?c.P()[0]:null));const r=new oi(h);let q;const t=b.id+"_"+c.i;this.j.has(t)?q=this.j.get(t):(q=Sh(r),this.j.set(t,q));const u=this.l!==q,x=ni(r);this.l=q;this.g++;return Promise.resolve({data:x,
init:u?q:null})}};v("shaka.transmuxer.TsTransmuxer",gF);gF.prototype.transmux=gF.prototype.transmux;gF.prototype.getOriginalMimeType=gF.prototype.getOriginalMimeType;gF.prototype.convertCodecs=gF.prototype.convertCodecs;gF.prototype.isSupported=gF.prototype.isSupported;gF.prototype.destroy=gF.prototype.destroy;var eF=["aac","ac-3","ec-3","mp3","opus"],fF=["avc","hevc"];Ud("video/mp2t",()=>new gF("video/mp2t"),Yd);v("shaka.util.FairPlayUtils",class extends Gm{});}).call(exportTo,innerGlobal,innerGlobal,undefined);if(typeof exports!="undefined")for(var k in exportTo.shaka)exports[k]=exportTo.shaka[k];else if(typeof define=="function"&&define.amd)define(function(){return exportTo.shaka});else innerGlobal.shaka=exportTo.shaka})();

//# sourceMappingURL=shaka-player.compiled-es2021.map